title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Lexicographically largest subsequence such that every character occurs at least k times
07 Jul, 2022 Given a string S and an integer K. The task is to find lexicographically largest subsequence of S, say T, such that every character in T must occur at least K times.Examples: Input : S = "banana", K = 2. Output : nn Possible subsequence where each character exists at least 2 times are: From the above sub...
[ { "code": null, "e": 54, "s": 26, "text": "\n07 Jul, 2022" }, { "code": null, "e": 231, "s": 54, "text": "Given a string S and an integer K. The task is to find lexicographically largest subsequence of S, say T, such that every character in T must occur at least K times.Examples:...
Django ORM – Inserting, Updating & Deleting Data
11 Feb, 2020 Prerequisite: Django models Django lets us interact with its database models, i.e. add, delete, modify and query objects, using a database-abstraction API called ORM(Object Relational Mapper). This article discusses all the useful operations we can perform using Django ORM. For demonstration purposes, we w...
[ { "code": null, "e": 52, "s": 24, "text": "\n11 Feb, 2020" }, { "code": null, "e": 80, "s": 52, "text": "Prerequisite: Django models" }, { "code": null, "e": 327, "s": 80, "text": "Django lets us interact with its database models, i.e. add, delete, modify and ...
How to create Right Aligned Menu Links using HTML and CSS ?
21 Nov, 2019 The right-aligned menu links are used on many websites. Like hotels website that contains lots of options in the menu section but in case of emergency to make contact with them need specific attention. In that case, you can put all the menu options on the left side of the navigation bar and display contact...
[ { "code": null, "e": 28, "s": 0, "text": "\n21 Nov, 2019" }, { "code": null, "e": 676, "s": 28, "text": "The right-aligned menu links are used on many websites. Like hotels website that contains lots of options in the menu section but in case of emergency to make contact with the...
Read and Write operations in Memory
24 Jan, 2022 A memory unit stores binary information in groups of bits called words. Data input lines provide the information to be stored into the memory, Data output lines carry the information out from the memory. The control lines Read and write specifies the direction of transfer of data. Basically, in the memory ...
[ { "code": null, "e": 52, "s": 24, "text": "\n24 Jan, 2022" }, { "code": null, "e": 529, "s": 52, "text": "A memory unit stores binary information in groups of bits called words. Data input lines provide the information to be stored into the memory, Data output lines carry the inf...
Remove duplicates from an unsorted linked list
14 Jun, 2022 Write a removeDuplicates() function that takes a list and deletes any duplicate nodes from the list. The list is not sorted. For example if the linked list is 12->11->12->21->41->43->21 then removeDuplicates() should convert the list to 12->11->21->41->43. METHOD 1 (Using two loops) This is the simple wa...
[ { "code": null, "e": 52, "s": 24, "text": "\n14 Jun, 2022" }, { "code": null, "e": 311, "s": 52, "text": "Write a removeDuplicates() function that takes a list and deletes any duplicate nodes from the list. The list is not sorted. For example if the linked list is 12->11->12->21-...
Bash Scripting – While Loop
16 Feb, 2022 A while loop is a statement that iterates over a block of code till the condition specified is evaluated to true. We can use this statement or loop in our program when do not know how many times the condition is going to evaluate to false before evaluating to true. The syntax of a while loop in BASH is s...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Feb, 2022" }, { "code": null, "e": 296, "s": 28, "text": "A while loop is a statement that iterates over a block of code till the condition specified is evaluated to true. We can use this statement or loop in our program when do not ...
UUID() function in MySQL
16 Dec, 2020 This function in MySQL is used to return a Universal Unique Identifier (UUID) generated according to RFC 4122, “A Universally Unique Identifier (UUID) URN Namespace”.It is designed as a number that is universally unique. Two UUID values are expected to be distinct, even they are generated on two independen...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Dec, 2020" }, { "code": null, "e": 476, "s": 28, "text": "This function in MySQL is used to return a Universal Unique Identifier (UUID) generated according to RFC 4122, “A Universally Unique Identifier (UUID) URN Namespace”.It is des...
unordered_multiset and its uses
19 Oct, 2021 We have discussed about unordered_set in our previous post the problem with unordered_set is that, it is not possible to store duplicate entries in that data structure. For example if we have some value v already in unordered_set, inserting v again will have no effect. To handle this duplication unordered_...
[ { "code": null, "e": 52, "s": 24, "text": "\n19 Oct, 2021" }, { "code": null, "e": 1200, "s": 52, "text": "We have discussed about unordered_set in our previous post the problem with unordered_set is that, it is not possible to store duplicate entries in that data structure. For ...
LinkedList element() method in Java with Examples
10 Dec, 2018 The element() method of java.util.LinkedList class retrieves, but does not remove, the head (first element) of this list. Syntax: public E element() Return Value: This method returns the head of this list. Below are the examples to illustrate the element() method Example 1: // Java program to demonstrate//...
[ { "code": null, "e": 28, "s": 0, "text": "\n10 Dec, 2018" }, { "code": null, "e": 150, "s": 28, "text": "The element() method of java.util.LinkedList class retrieves, but does not remove, the head (first element) of this list." }, { "code": null, "e": 158, "s": 15...
Understanding “register” keyword in C
21 Aug, 2019 Registers are faster than memory to access, so the variables which are most frequently used in a C program can be put in registers using register keyword. The keyword register hints to compiler that a given variable can be put in a register. It’s compiler’s choice to put it in a register or not. Generally,...
[ { "code": null, "e": 52, "s": 24, "text": "\n21 Aug, 2019" }, { "code": null, "e": 433, "s": 52, "text": "Registers are faster than memory to access, so the variables which are most frequently used in a C program can be put in registers using register keyword. The keyword registe...
Introduction to Microsoft Azure | A cloud computing service
03 Jun, 2022 What is Azure? Azure is Microsoft’s cloud platform, just like Google has it’s Google Cloud and Amazon has it’s Amazon Web Service or AWS.000. Generally, it is a platform through which we can use Microsoft’s resource. For example, to set up a huge server, we will require huge investment, effort, physical sp...
[ { "code": null, "e": 28, "s": 0, "text": "\n03 Jun, 2022" }, { "code": null, "e": 43, "s": 28, "text": "What is Azure?" }, { "code": null, "e": 685, "s": 43, "text": "Azure is Microsoft’s cloud platform, just like Google has it’s Google Cloud and Amazon has it...
How to Install a local module using npm?
06 Oct, 2021 This article shows how to install local module using npm. Local modules are modules created locally in your Node.js application to create user-required functionality. These local modules include different functionalities of your application in separate files and folders. To link the local module first you ...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 Oct, 2021" }, { "code": null, "e": 86, "s": 28, "text": "This article shows how to install local module using npm." }, { "code": null, "e": 395, "s": 86, "text": "Local modules are modules created locally in your ...
Word Wrap Problem | DP-19
12 May, 2022 Given a sequence of words, and a limit on the number of characters that can be put in one line (line width). Put line breaks in the given sequence such that the lines are printed neatly. Assume that the length of each word is smaller than the line width.The word processors like MS Word do task of placing l...
[ { "code": null, "e": 54, "s": 26, "text": "\n12 May, 2022" }, { "code": null, "e": 522, "s": 54, "text": "Given a sequence of words, and a limit on the number of characters that can be put in one line (line width). Put line breaks in the given sequence such that the lines are pri...
Thread Pools in Java
30 Jul, 2020 Background Server Programs such as database and web servers repeatedly execute requests from multiple clients and these are oriented around processing a large number of short tasks. An approach for building a server application would be to create a new thread each time a request arrives and service this ne...
[ { "code": null, "e": 54, "s": 26, "text": "\n30 Jul, 2020" }, { "code": null, "e": 65, "s": 54, "text": "Background" }, { "code": null, "e": 658, "s": 65, "text": "Server Programs such as database and web servers repeatedly execute requests from multiple clien...
How to display records having sum between a specific range using GROUP BY, HAVING and ORDER BY in a single MySQL query?
Let us first create a table − mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, CustomerName varchar(20), ProductPrice int ); Query OK, 0 rows affected (0.70 sec) Insert some records in the table using insert command − mysql> insert into DemoTable(CustomerName,ProductPrice) values('Ch...
[ { "code": null, "e": 1092, "s": 1062, "text": "Let us first create a table −" }, { "code": null, "e": 1260, "s": 1092, "text": "mysql> create table DemoTable\n(\n Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,\n CustomerName varchar(20),\n ProductPrice int\n);\nQuery OK, 0 row...
Python MySQL - Join
When you have divided the data in two tables you can fetch combined records from these two tables using Joins. Suppose we have created a table with name EMPLOYEE and populated data into it as shown below − mysql> CREATE TABLE EMPLOYEE( FIRST_NAME CHAR(20) NOT NULL, LAST_NAME CHAR(20), AGE INT, SEX CHAR(1), ...
[ { "code": null, "e": 3316, "s": 3205, "text": "When you have divided the data in two tables you can fetch combined records from these two tables using Joins." }, { "code": null, "e": 3411, "s": 3316, "text": "Suppose we have created a table with name EMPLOYEE and populated data i...
JIRA - Quick Guide
JIRA is an Incident Management Tool used for Project Management, Bug Tracking, Issue Tracking and Workflow. JIRA is based on the following three concepts – Project, Issue and Workflow. The following points explain some interesting details of JIRA. JIRA is an incident management tool. JIRA is an incident management tool...
[ { "code": null, "e": 2380, "s": 2195, "text": "JIRA is an Incident Management Tool used for Project Management, Bug Tracking, Issue Tracking and Workflow. JIRA is based on the following three concepts – Project, Issue and Workflow." }, { "code": null, "e": 2443, "s": 2380, "text"...
Scala String substring(int beginIndex, int endIndex) method with example - GeeksforGeeks
29 Oct, 2019 The substring(int beginIndex, int endIndex) method is utilized to find the sub-string from the stated String which starts and ends with the index specified. Method Definition: String substring(int beginIndex, int endIndex) Return Type: It returns string which is the part of the stated String. Note: It is s...
[ { "code": null, "e": 23515, "s": 23487, "text": "\n29 Oct, 2019" }, { "code": null, "e": 23672, "s": 23515, "text": "The substring(int beginIndex, int endIndex) method is utilized to find the sub-string from the stated String which starts and ends with the index specified." }, ...
How to set the Row Height of a JTree with Java?
To set the row height of a JTree, use the setRowHeight() and as a parameter set the height in pixels − tree.setRowHeight(25); The following is an example to set the row height of a JTree with Java − package my; import javax.swing.JFrame; import javax.swing.JTree; import javax.swing.tree.DefaultMutableTreeNode; public c...
[ { "code": null, "e": 1165, "s": 1062, "text": "To set the row height of a JTree, use the setRowHeight() and as a parameter set the height in pixels −" }, { "code": null, "e": 1188, "s": 1165, "text": "tree.setRowHeight(25);" }, { "code": null, "e": 1261, "s": 1188...
Stream generate() method in Java with examples
06 Dec, 2018 Stream generate(Supplier<T> s) returns an infinite sequential unordered stream where each element is generated by the provided Supplier. This is suitable for generating constant streams, streams of random elements, etc. Syntax : static <T> Stream<T> generate(Supplier<T> s) Where, Stream is an interface an...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 Dec, 2018" }, { "code": null, "e": 248, "s": 28, "text": "Stream generate(Supplier<T> s) returns an infinite sequential unordered stream where each element is generated by the provided Supplier. This is suitable for generating consta...
How to change colors of a Drawable in Android?
This example demonstrates how to change the colors of a Drawable 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"?> <LinearLay...
[ { "code": null, "e": 1264, "s": 1187, "text": "This example demonstrates how to change the colors of a Drawable in Android." }, { "code": null, "e": 1393, "s": 1264, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details t...
Python | Play a video using OpenCV
15 Oct, 2018 OpenCV (Open Source Computer Vision) is a computer vision library that contains various functions to perform operations on Images or videos. OpenCV library can be used to perform multiple operations on videos. Let’s see how to play a video using the OpenCV Python. To capture a video, we need to create a Vi...
[ { "code": null, "e": 52, "s": 24, "text": "\n15 Oct, 2018" }, { "code": null, "e": 262, "s": 52, "text": "OpenCV (Open Source Computer Vision) is a computer vision library that contains various functions to perform operations on Images or videos. OpenCV library can be used to per...
Print multiplication table of a given number in C
Print multiplication table of a given number Accept any number from the User for which we need to form multiplication table. Multiply the given number starting with the value of I (=1) Multiply the given number by incrementing the value of I till the I value is lesser than or equal to 12. /* Program to print the multip...
[ { "code": null, "e": 1232, "s": 1187, "text": "Print multiplication table of a given number" }, { "code": null, "e": 1312, "s": 1232, "text": "Accept any number from the User for which we need to form multiplication table." }, { "code": null, "e": 1372, "s": 1312,...
How to Make a Bell Curve in R?
24 Feb, 2021 To make a bell curve in R we will be using the help of normal distribution which will lead to a bell curve that will be symmetrical about the mean. Half of the data will fall to the left of the mean and half will fall to the right. In probability theory, a normal distribution is a type of continuous probab...
[ { "code": null, "e": 52, "s": 24, "text": "\n24 Feb, 2021" }, { "code": null, "e": 284, "s": 52, "text": "To make a bell curve in R we will be using the help of normal distribution which will lead to a bell curve that will be symmetrical about the mean. Half of the data will fall...
Python | Canvas in Kivy using .kv file
04 Jul, 2022 Kivy is a platform-independent GUI tool in Python. As it can be run on Android, IOS, Linux and Windows etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktop applications. Kivy Tutorial – Learn Kivy with Examples. The Canvas is the root object ...
[ { "code": null, "e": 52, "s": 24, "text": "\n04 Jul, 2022" }, { "code": null, "e": 287, "s": 52, "text": "Kivy is a platform-independent GUI tool in Python. As it can be run on Android, IOS, Linux and Windows etc. It is basically used to develop the Android application, but it do...
Finding the k smallest values of a NumPy array
02 Sep, 2020 In this article, let us see how to find the k number of the smallest values from a NumPy array. Examples: Input: [1,3,5,2,4,6] k = 3 Output: [1,2,3] Method 1: Using np.sort() . Approach: Create a NumPy array.Determine the value of k.Sort the array in ascending order using the sort() method.Print the f...
[ { "code": null, "e": 28, "s": 0, "text": "\n02 Sep, 2020" }, { "code": null, "e": 124, "s": 28, "text": "In this article, let us see how to find the k number of the smallest values from a NumPy array." }, { "code": null, "e": 134, "s": 124, "text": "Examples:"...
Smallest subarray with all occurrences of a most frequent element
11 May, 2022 Given an array, A. Let x be an element in the array. x has the maximum frequency in the array. Find the smallest subsegment of the array which also has x as the maximum frequency element.Examples: Input : arr[] = {4, 1, 1, 2, 2, 1, 3, 3} Output : 1, 1, 2, 2, 1 The most frequent element is 1. The smal...
[ { "code": null, "e": 54, "s": 26, "text": "\n11 May, 2022" }, { "code": null, "e": 253, "s": 54, "text": "Given an array, A. Let x be an element in the array. x has the maximum frequency in the array. Find the smallest subsegment of the array which also has x as the maximum frequ...
Map.entries( ) In JavaScript
31 May, 2022 What is a map in JavaScript? Map is a data structure in JavaScript which allows storing of [key, value] pairs where any value can be either used as a key or value. The keys and values in the map collection may be of any type and if a value is added to the map collection using a key that already exists in t...
[ { "code": null, "e": 28, "s": 0, "text": "\n31 May, 2022" }, { "code": null, "e": 57, "s": 28, "text": "What is a map in JavaScript?" }, { "code": null, "e": 192, "s": 57, "text": "Map is a data structure in JavaScript which allows storing of [key, value] pair...
How to use close() and quit() method in Selenium Python ?
06 Mar, 2020 While doing stuff with selenium multiple browsers with multiple tabs will normally opens in order to close these tabs close() and quit() methods are used. close() method is used to close the current browser window on which the focus is set, on the other hand quit() method essentially calls the driver.dispo...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 Mar, 2020" }, { "code": null, "e": 437, "s": 28, "text": "While doing stuff with selenium multiple browsers with multiple tabs will normally opens in order to close these tabs close() and quit() methods are used. close() method is us...
TensorFlow - Exporting
Here, we will focus on MetaGraph formation in TensorFlow. This will help us understand export module in TensorFlow. The MetaGraph contains the basic information, which is required to train, perform evaluation, or run inference on a previously trained graph. Following is the code snippet for the same − def export_meta_g...
[ { "code": null, "e": 2707, "s": 2449, "text": "Here, we will focus on MetaGraph formation in TensorFlow. This will help us understand export module in TensorFlow. The MetaGraph contains the basic information, which is required to train, perform evaluation, or run inference on a previously trained gr...
TypeScript - Variables
A variable, by definition, is “a named space in the memory” that stores values. In other words, it acts as a container for values in a program. TypeScript variables must follow the JavaScript naming rules − Variable names can contain alphabets and numeric digits. Variable names can contain alphabets and numeric digits....
[ { "code": null, "e": 2389, "s": 2182, "text": "A variable, by definition, is “a named space in the memory” that stores values. In other words, it acts as a container for values in a program. TypeScript variables must follow the JavaScript naming rules −" }, { "code": null, "e": 2446, ...
Java.lang.StackTraceElement class in Java
03 Sep, 2021 An element in a stack trace, as returned by Throwable.getStackTrace(). Each element represents a single stack frame. All stack frames except for the one at the top of the stack represent a method invocation. The frame at the top of the stack represents the execution point at which the stack trace was gener...
[ { "code": null, "e": 28, "s": 0, "text": "\n03 Sep, 2021" }, { "code": null, "e": 342, "s": 28, "text": "An element in a stack trace, as returned by Throwable.getStackTrace(). Each element represents a single stack frame. All stack frames except for the one at the top of the stac...
Creating an Server-Client Application using the DatagramPacket and DatagramSocket classes
20 Nov, 2021 To create an application that uses UDP to establish the connection between a client and server, we need to perform the following steps: Create a server program Create a client program Execute the client and server program Let’s perform the steps in the following subsections: Creating the Server Program Le...
[ { "code": null, "e": 28, "s": 0, "text": "\n20 Nov, 2021" }, { "code": null, "e": 164, "s": 28, "text": "To create an application that uses UDP to establish the connection between a client and server, we need to perform the following steps:" }, { "code": null, "e": 18...
Hill Cipher
21 Jul, 2021 Hill cipher is a polygraphic substitution cipher based on linear algebra.Each letter is represented by a number modulo 26. Often the simple scheme A = 0, B = 1, ..., Z = 25 is used, but this is not an essential feature of the cipher. To encrypt a message, each block of n letters (considered as an n-compone...
[ { "code": null, "e": 52, "s": 24, "text": "\n21 Jul, 2021" }, { "code": null, "e": 682, "s": 52, "text": "Hill cipher is a polygraphic substitution cipher based on linear algebra.Each letter is represented by a number modulo 26. Often the simple scheme A = 0, B = 1, ..., Z = 25 i...
Print characters and their frequencies in order of occurrence in C++
This problem, We are given a string of lowercase characters. and we have to find the frequencies of each character that occurs in the string. the below example when explaining more about the problem. Input : “jskdk” Output : j 1 s 1 k 2 d 1 Explanation − In the String, the characters j, s, d occur once and k occurs twi...
[ { "code": null, "e": 1262, "s": 1062, "text": "This problem, We are given a string of lowercase characters. and we have to find the frequencies of each character that occurs in the string. the below example when explaining more about the problem." }, { "code": null, "e": 1303, "s": 1...
How to Delete Tkinter Text Box's Contents?
Tkinter provides many functions and modules through which we can create fully featured applications with buttons, dialogue boxes, widgets, and many more. To create a text widget, we can use the tkinter entry widget function which is basically a constructor and it takes the window or frame of the tkinter. Further, we ca...
[ { "code": null, "e": 1216, "s": 1062, "text": "Tkinter provides many functions and modules through which we can create fully\nfeatured applications with buttons, dialogue boxes, widgets, and many more." }, { "code": null, "e": 1524, "s": 1216, "text": "To create a text widget, we...
Colab on steroids: free GPU instances with SSH access and Visual Studio Code Server | Towards Data Science
As most of you already know, Google Research offers free instances of Jupyter Notebook environment, with GPU and TPU, that runs entirely in the cloud. The platform is called Colaboratory (“Colab” for short) and it is a great resource when you want to perform quick experiments or prototype new machine learning models be...
[ { "code": null, "e": 547, "s": 172, "text": "As most of you already know, Google Research offers free instances of Jupyter Notebook environment, with GPU and TPU, that runs entirely in the cloud. The platform is called Colaboratory (“Colab” for short) and it is a great resource when you want to perf...
Bitwise ORs of Subarrays in C++
Suppose we have an array A of non-negative integers. For every (contiguous) subarray say B = [A[i], A[i+1], ..., A[j]] (with i <= j), we will do the bitwise OR of all the elements in B, obtaining a result A[i] | A[i+1] | ... | A[j]. We have to find the number of possible results. (Results that occur more than once are ...
[ { "code": null, "e": 1422, "s": 1062, "text": "Suppose we have an array A of non-negative integers. For every (contiguous) subarray say B = [A[i], A[i+1], ..., A[j]] (with i <= j), we will do the bitwise OR of all the elements in B, obtaining a result A[i] | A[i+1] | ... | A[j]. We have to find the ...
Python - Sum only specific rows of a Pandas Dataframe
To sum only specific rows, use the loc() method. Mention the beginning and end row index using the : operator. Using loc(), you can also set the columns to be included. We can display the result in a new column. At first, let us create a DataFrame. We have Product records in it, including the Opening and Closing Stock ...
[ { "code": null, "e": 1274, "s": 1062, "text": "To sum only specific rows, use the loc() method. Mention the beginning and end row index using the : operator. Using loc(), you can also set the columns to be included. We can display the result in a new column." }, { "code": null, "e": 1384...
Calculate range of data types using C++
In C++ we have different datatypes like int, char, double etc. In this section we will see how to get the size of them programmatically. We can get the size of datatypes in byte, so we can simply multiply them into 8 to get the values in bits. Now we know that if the number of bits are n, then the minimum range will be...
[ { "code": null, "e": 1199, "s": 1062, "text": "In C++ we have different datatypes like int, char, double etc. In this section we will see how to get the size of them programmatically." }, { "code": null, "e": 1526, "s": 1199, "text": "We can get the size of datatypes in byte, so ...
Deep Face Recognition
11 Jun, 2021 DeepFace is the facial recognition system used by Facebook for tagging images. It was proposed by researchers at Facebook AI Research (FAIR) at the 2014 IEEE Computer Vision and Pattern Recognition Conference (CVPR). In modern face recognition there are 4 steps: DetectAlignRepresentClassify Detect Align ...
[ { "code": null, "e": 54, "s": 26, "text": "\n11 Jun, 2021" }, { "code": null, "e": 272, "s": 54, "text": "DeepFace is the facial recognition system used by Facebook for tagging images. It was proposed by researchers at Facebook AI Research (FAIR) at the 2014 IEEE Computer Vision ...
Node.js fs.readFile() Method
12 Oct, 2021 The fs.readFile() method is an inbuilt method which is used to read the file. This method read the entire file into buffer. To load the fs module we use require() method. For example: var fs = require(‘fs’); Syntax: fs.readFile( filename, encoding, callback_function ) Parameters: The method accept three...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Oct, 2021" }, { "code": null, "e": 237, "s": 28, "text": "The fs.readFile() method is an inbuilt method which is used to read the file. This method read the entire file into buffer. To load the fs module we use require() method. For ...
Different Ways to Prevent Method Overriding in Java
10 Aug, 2021 Inheritance is a substantial rule of any Object-Oriented Programming (OOP) language but still, there are ways to prevent method overriding in child classes which are as follows: Methods: Using a static methodUsing private access modifierUsing default access modifierUsing the final keyword method Using a st...
[ { "code": null, "e": 28, "s": 0, "text": "\n10 Aug, 2021" }, { "code": null, "e": 206, "s": 28, "text": "Inheritance is a substantial rule of any Object-Oriented Programming (OOP) language but still, there are ways to prevent method overriding in child classes which are as follow...
Sum of Fibonacci Numbers
22 Nov, 2021 Given a number positive number n, find value of f0 + f1 + f2 + .... + fn where fi indicates i’th Fibonacci number. Remember that f0 = 0, f1 = 1, f2 = 1, f3 = 2, f4 = 3, f5 = 5, ... Examples : Input : n = 3 Output : 4 Explanation : 0 + 1 + 1 + 2 = 4 Input : n = 4 Output : 7 Explanation : 0 + 1 + 1 +...
[ { "code": null, "e": 54, "s": 26, "text": "\n22 Nov, 2021" }, { "code": null, "e": 248, "s": 54, "text": "Given a number positive number n, find value of f0 + f1 + f2 + .... + fn where fi indicates i’th Fibonacci number. Remember that f0 = 0, f1 = 1, f2 = 1, f3 = 2, f4 = 3, f5 = ...
Maximum Path Sum in a Binary Tree
02 Jul, 2021 Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree.Example: Input: Root of below tree 1 / \ 2 3 Output: 6 See below diagram for another example. 1+2+3 For each node there can be four ways that the max path goes through the node: 1. N...
[ { "code": null, "e": 52, "s": 24, "text": "\n02 Jul, 2021" }, { "code": null, "e": 161, "s": 52, "text": "Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree.Example: " }, { "code": null, "e": 273, "s": 161, "text...
Python – Itertools.Permutations()
11 Jul, 2022 Itertool is a module provided by Python for creating iterators for efficient looping. It also provides various features or functions that work with iterators to produce complex iterators and help us to solve problems easily and efficiently in terms of time as well as memory. Itertools module provides us va...
[ { "code": null, "e": 53, "s": 25, "text": "\n11 Jul, 2022" }, { "code": null, "e": 488, "s": 53, "text": "Itertool is a module provided by Python for creating iterators for efficient looping. It also provides various features or functions that work with iterators to produce compl...
Sum of product of all elements of sub-arrays of size k
03 Jan, 2022 Given an array and a number k, the task is to calculate the sum of the product of all elements of subarrays of size k.Examples : Input : arr[] = {1, 2, 3, 4, 5, 6} k = 3 Output : 210 Consider all subarrays of size k 1*2*3 = 6 2*3*4 = 24 3*4*5 = 60 4*5*6 = 120 6 + 24 + 60 + 120 = 210 Inp...
[ { "code": null, "e": 52, "s": 24, "text": "\n03 Jan, 2022" }, { "code": null, "e": 183, "s": 52, "text": "Given an array and a number k, the task is to calculate the sum of the product of all elements of subarrays of size k.Examples : " }, { "code": null, "e": 542, ...
Python | Pandas Series.iloc
28 Jan, 2019 Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique bu...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Jan, 2019" }, { "code": null, "e": 242, "s": 28, "text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes imp...
How to Pass Video Using Intent Between Activities in Android?
23 Dec, 2021 In android, An Intent provides a facility for performing late runtime binding between the code in different applications. Its most significant use is in the launching of activities, where it can be thought of as the glue between activities. It is basically a passive data structure holding an abstract descr...
[ { "code": null, "e": 28, "s": 0, "text": "\n23 Dec, 2021" }, { "code": null, "e": 372, "s": 28, "text": "In android, An Intent provides a facility for performing late runtime binding between the code in different applications. Its most significant use is in the launching of activ...
PyQt5 QSpinBox – Setting Maximum value
06 May, 2020 In this article we will see how we can set the maximum value i.e upper bound of the spin box, by default when we create a spin box it ranges from 0 to 99 i.e its maximum value is 99 although we can change this. In order to do this we will use spin_box.setMaximum method Syntax : spin_box.setMaximum(n) Argum...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 May, 2020" }, { "code": null, "e": 239, "s": 28, "text": "In this article we will see how we can set the maximum value i.e upper bound of the spin box, by default when we create a spin box it ranges from 0 to 99 i.e its maximum value...
Matplotlib.figure.Figure.gca() in Python
30 Apr, 2020 Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The figure module provides the top-level Artist, the Figure, which contains all the plot elements. This module is used to control the default spacing of the subplots and top level container for all plot elemen...
[ { "code": null, "e": 28, "s": 0, "text": "\n30 Apr, 2020" }, { "code": null, "e": 339, "s": 28, "text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The figure module provides the top-level Artist, the Figure, which contains a...
Java String getChars() with examples
04 Feb, 2022 The java string getChars() method copies characters from the given string into the destination character array.Syntax: public void getChars(int srhStartIndex, int srhEndIndex, char[] destArray, int destStartIndex) Parameters: srhStartIndex : Index of the first character in the string to copy. srhE...
[ { "code": null, "e": 53, "s": 25, "text": "\n04 Feb, 2022" }, { "code": null, "e": 174, "s": 53, "text": "The java string getChars() method copies characters from the given string into the destination character array.Syntax: " }, { "code": null, "e": 635, "s": 17...
Java Program for Binary Search (Recursive and Iterative)
13 Jun, 2022 So as we all know binary search is one of the searching algorithms that is most frequently applied while dealing with data structures where the eccentric goal is not to traverse the whole array. Here array must be sorted as we check the middle element and ignore the half of the array which is of no use as ...
[ { "code": null, "e": 54, "s": 26, "text": "\n13 Jun, 2022" }, { "code": null, "e": 572, "s": 54, "text": "So as we all know binary search is one of the searching algorithms that is most frequently applied while dealing with data structures where the eccentric goal is not to trave...
Sliding Window protocols Summary With Questions
03 May, 2022 Prerequisites – Stop & Wait, Go Back N, Selective Repeat Before starting with the questions a quick recap for all the protocols. Stop and wait – Sender window size (Ws) = 1Receiver window size (Wr) = 1Sequence Number ≥ 1 + 1Uses independent acknowledgementDiscards out of order packetsPacket Loss ? Retransm...
[ { "code": null, "e": 54, "s": 26, "text": "\n03 May, 2022" }, { "code": null, "e": 111, "s": 54, "text": "Prerequisites – Stop & Wait, Go Back N, Selective Repeat" }, { "code": null, "e": 199, "s": 111, "text": "Before starting with the questions a quick recap...
Mathematical functions in MySQL
07 Aug, 2019 SQL stands for ‘Structured Query Language’. As the name already suggests, the data is stored in the form of rows and columns, in a structured format. Using the SQL language, we can store, retrieve, and manipulate the data stored in the MySQL database. Sometimes, the database table contains thousands of ent...
[ { "code": null, "e": 28, "s": 0, "text": "\n07 Aug, 2019" }, { "code": null, "e": 280, "s": 28, "text": "SQL stands for ‘Structured Query Language’. As the name already suggests, the data is stored in the form of rows and columns, in a structured format. Using the SQL language, w...
Program to Convert a Vector to List in Java
11 Dec, 2018 Given a Vector, the task is to Convert Vector to List in Java Examples: Input: Vector: [1, 2, 3, 4, 5] Output: List: [1, 2, 3, 4, 5] Input : Vector = [a, b, c, d, e, f] Output : List = [a, b, c, d, e, f] Using Collections.list() methodSyntax:List list = Collections.list(vec.elements()); Approach:Get the...
[ { "code": null, "e": 28, "s": 0, "text": "\n11 Dec, 2018" }, { "code": null, "e": 90, "s": 28, "text": "Given a Vector, the task is to Convert Vector to List in Java" }, { "code": null, "e": 100, "s": 90, "text": "Examples:" }, { "code": null, "e":...
Routes and Navigator in Flutter
13 Jun, 2022 Flutter is an open-source mobile app SDK created by Google. Flutter uses Dart language for creating mobile apps, that follow object-oriented concepts. Flutter has a very good reach among mobile app developers because of its striking features like cross-platform development, hot reload, hot restart, eye-cat...
[ { "code": null, "e": 52, "s": 24, "text": "\n13 Jun, 2022" }, { "code": null, "e": 467, "s": 52, "text": "Flutter is an open-source mobile app SDK created by Google. Flutter uses Dart language for creating mobile apps, that follow object-oriented concepts. Flutter has a very good...
TimeZone getOffset() Method in Java with Examples
02 Jan, 2019 The getOffset() method of TimeZone class in Java is used to know the offset value of this TimeZone at a specific date from the UTC or the Universal Time Coordinated. Syntax: public int getOffset(long in_date) Parameters: The method accepts one parameter, in_date of long type that refers to the actual date ...
[ { "code": null, "e": 28, "s": 0, "text": "\n02 Jan, 2019" }, { "code": null, "e": 194, "s": 28, "text": "The getOffset() method of TimeZone class in Java is used to know the offset value of this TimeZone at a specific date from the UTC or the Universal Time Coordinated." }, {...
All-Pairs Shortest Paths
The all pair shortest path algorithm is also known as Floyd-Warshall algorithm is used to find all pair shortest path problem from a given weighted graph. As a result of this algorithm, it will generate a matrix, which will represent the minimum distance from any node to all other nodes in the graph. At first the outpu...
[ { "code": null, "e": 1364, "s": 1062, "text": "The all pair shortest path algorithm is also known as Floyd-Warshall algorithm is used to find all pair shortest path problem from a given weighted graph. As a result of this algorithm, it will generate a matrix, which will represent the minimum distanc...
Java Program to Search the Contents of a Table in JDBC - GeeksforGeeks
27 Oct, 2021 In order to deal with JDBC standard 7 steps are supposed to be followed: Import the databaseLoad and register driversCreate a connectionCreate a statementExecute the queryProcess the resultsClose the connection Import the database Load and register drivers Create a connection Create a statement Execute the...
[ { "code": null, "e": 24111, "s": 24083, "text": "\n27 Oct, 2021" }, { "code": null, "e": 24184, "s": 24111, "text": "In order to deal with JDBC standard 7 steps are supposed to be followed:" }, { "code": null, "e": 24322, "s": 24184, "text": "Import the databa...
Automate your Data Management Discipline with Python | by Garrett Eichhorn | Towards Data Science
Anyone that interacts with data understands the importance of data quality. Whether you’re performing basic analysis in excel or forecasting sales trends with decision trees, poor data will always rear its ugly head and curtail your progress. It’s easy to place the onus on the overworked data steward and the gluttonous...
[ { "code": null, "e": 751, "s": 172, "text": "Anyone that interacts with data understands the importance of data quality. Whether you’re performing basic analysis in excel or forecasting sales trends with decision trees, poor data will always rear its ugly head and curtail your progress. It’s easy to...
Python For Loops
A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string). This is less like the for keyword in other programming languages, and works more like an iterator method as found in other object-orientated programming languages. With the for loop we can execute a set...
[ { "code": null, "e": 118, "s": 0, "text": "A for loop is used for iterating over a sequence (that is either a list, a tuple, \na dictionary, a set, or a string)." }, { "code": null, "e": 282, "s": 118, "text": "This is less like the for keyword in other programming languages, and...
VBScript If..ElseIf..Else Statements
An If statement followed by one or more ElseIf Statements that consists of boolean expressions and then followed by a default else statement, which executes when all the condition becomes false. The syntax of an If-ElseIf-Else statement in VBScript is − If(boolean_expression) Then Statement 1 ..... ..... Statem...
[ { "code": null, "e": 2275, "s": 2080, "text": "An If statement followed by one or more ElseIf Statements that consists of boolean expressions and then followed by a default else statement, which executes when all the condition becomes false." }, { "code": null, "e": 2334, "s": 2275, ...
How to create a dynamic 2D array inside a class in C++
Here it is a simple C++ program to create a dynamic 2D array inside a class to print the elements of the array. Begin Create a class Arr and declare size of array. Inside the class, initialize all the elements by using for loop. Print the all elements. End. Live Demo #include <iostream> #include <stdlib.h> us...
[ { "code": null, "e": 1174, "s": 1062, "text": "Here it is a simple C++ program to create a dynamic 2D array inside a class to print the elements of the array." }, { "code": null, "e": 1329, "s": 1174, "text": "Begin\n Create a class Arr and declare size of array.\n Inside the...
PLSQL | SOUNDEX Function - GeeksforGeeks
27 Sep, 2019 The PLSQL SOUNDEX function is used for returning a phonetic representation of a string. The phonetic represents the way the string will sound. The PLSQL SOUNDEX function helps to compare words that are spelled differently, but sound alike in English. The SOUNDEX function accepts one parameter input_string ...
[ { "code": null, "e": 25237, "s": 25209, "text": "\n27 Sep, 2019" }, { "code": null, "e": 25488, "s": 25237, "text": "The PLSQL SOUNDEX function is used for returning a phonetic representation of a string. The phonetic represents the way the string will sound. The PLSQL SOUNDEX fu...
Count Hexadecimal Number - GeeksforGeeks
16 Apr, 2021 Given a range [L, R]. The task is to find the total number of Hexadecimal alphabets that are required to write every number in the range. Hexadecimal alphabets are the alphabets in the range [A, F] which are required to represent decimal numbers from the range [10, 15]Examples: Input: L = 10, R = 15 Outp...
[ { "code": null, "e": 24137, "s": 24109, "text": "\n16 Apr, 2021" }, { "code": null, "e": 24418, "s": 24137, "text": "Given a range [L, R]. The task is to find the total number of Hexadecimal alphabets that are required to write every number in the range. Hexadecimal alphabets are...
Laravel | Eloquent Model Basics - GeeksforGeeks
30 Dec, 2019 Laravel is an MVC based PHP framework. In MVC architecture, ‘M’ stands for ‘Model’. A Model is basically a way for querying data to and from the table in the database. Laravel provides a simple way to do that using Eloquent ORM (Object-Relational Mapping). Every table has a Model to interact with the table...
[ { "code": null, "e": 23937, "s": 23909, "text": "\n30 Dec, 2019" }, { "code": null, "e": 24246, "s": 23937, "text": "Laravel is an MVC based PHP framework. In MVC architecture, ‘M’ stands for ‘Model’. A Model is basically a way for querying data to and from the table in the datab...
TypeScript - For Loop
The for loop executes the code block for a specified number of times. It can be used to iterate over a fixed set of values, such as an array. The syntax of the for loop is as below − for (initial_count_value; termination-condition; step) { //statements } The loop uses a count variable to keep track of the iteratio...
[ { "code": null, "e": 2231, "s": 2048, "text": "The for loop executes the code block for a specified number of times. It can be used to iterate over a fixed set of values, such as an array. The syntax of the for loop is as below −" }, { "code": null, "e": 2308, "s": 2231, "text": ...
Amazon Interview Experience for SDE-1 (Off-Campus) - GeeksforGeeks
17 Oct, 2021 Round 1: Online Assessment Amazon Fresh Deliveries: Given all Locations list of co-ordinates (x,y) you have to find the X – closest locations from truck’s location which is (0,0). Distance is calculated using the formula (x^2 + y^2). If there is a tie then choose the co-ordinate with the least x value. Sam...
[ { "code": null, "e": 24807, "s": 24779, "text": "\n17 Oct, 2021" }, { "code": null, "e": 24834, "s": 24807, "text": "Round 1: Online Assessment" }, { "code": null, "e": 25126, "s": 24834, "text": "Amazon Fresh Deliveries: Given all Locations list of co-ordinat...
How to Get a Job with Python. It is a simple use of Python, you do... | by Lazar Gugleta | Towards Data Science
There are so many websites out there offering job listings for different fields of jobs. Even though you might be at a certain position you should always look for a job and that can get boring. But here comes a simple solution in order to get through so many of those job offers with ease! We are going to build an easy ...
[ { "code": null, "e": 462, "s": 172, "text": "There are so many websites out there offering job listings for different fields of jobs. Even though you might be at a certain position you should always look for a job and that can get boring. But here comes a simple solution in order to get through so m...
Python | Split string in groups of n consecutive characters - GeeksforGeeks
24 Jun, 2020 Given a string (be it either string of numbers or characters), write a Python program to split the string by every nth character. Examples: Input : str = "Geeksforgeeks", n = 3 Output : ['Gee', 'ksf', 'oor', 'gee', 'ks'] Input : str = "1234567891234567", n = 4 Output : [1234, 5678, 9123, 4567] Method #1:...
[ { "code": null, "e": 24138, "s": 24110, "text": "\n24 Jun, 2020" }, { "code": null, "e": 24268, "s": 24138, "text": "Given a string (be it either string of numbers or characters), write a Python program to split the string by every nth character." }, { "code": null, "...
Inserting the current datetime in MongoDB?
To insert current datetime in MongoDB, use the $setOnInsert operator. Let us first implement the following query to create a collection with documents >db.addCurrentDateTimeDemo.insertOne({"StudentName":"John","StudentAdmissionDate":new Date("2012-01-21") }); { "acknowledged" : true, "insertedId" : ObjectId("5c97...
[ { "code": null, "e": 1213, "s": 1062, "text": "To insert current datetime in MongoDB, use the $setOnInsert operator. Let us first implement the following query to create a collection with documents" }, { "code": null, "e": 1797, "s": 1213, "text": ">db.addCurrentDateTimeDemo.inse...
Interactive Time Series with Python and API: Generating Heatmap of Taxis in Singapore | by Shawn Tham | Towards Data Science
Land Transport Authority (LTA) of Singapore has an API that shows live coordinates of all taxis. It is quite a cool API that shows real-time taxi movement that is refreshed every 30 seconds. However, there is little work done with this API after searching up for more information on it. Hence, in this article, I will wa...
[ { "code": null, "e": 610, "s": 172, "text": "Land Transport Authority (LTA) of Singapore has an API that shows live coordinates of all taxis. It is quite a cool API that shows real-time taxi movement that is refreshed every 30 seconds. However, there is little work done with this API after searching...
Build a web data dashboard in just minutes with Python | by JP Hwang | Towards Data Science
I don’t know about you, but I occasionally find it a little bit intimidating to have to code something. This is doubly so when I’m building something akin to web development rather than doing some local data analysis and visualisation. I’m a competent Python coder, but I wouldn’t call myself a web developer at all, eve...
[ { "code": null, "e": 548, "s": 172, "text": "I don’t know about you, but I occasionally find it a little bit intimidating to have to code something. This is doubly so when I’m building something akin to web development rather than doing some local data analysis and visualisation. I’m a competent Pyt...
Convert one base to other bases in a single Java Program
Let’s say we have an Octal number. To convert Octal to other bases like binary, hexadecimal, etc, the Java code is as follows − Live Demo public class Demo{ public static String base_convert(String num, int source, int destination){ return Integer.toString(Integer.parseInt(num, source), destination); } ...
[ { "code": null, "e": 1190, "s": 1062, "text": "Let’s say we have an Octal number. To convert Octal to other bases like binary, hexadecimal, etc, the Java code is as follows −" }, { "code": null, "e": 1201, "s": 1190, "text": " Live Demo" }, { "code": null, "e": 1916, ...
Booleans are Fun and Mysterious. Some fun puzzles with answers about the... | by Naser Tamimi | Towards Data Science
In data science and programming, boolean (True and False) data are considered simple and boring. I believe booleans are fun and sometimes unpredictable if you don’t know their logic. I will convince many of you that some interesting features are associated with boolean objects that you probably ignored. Let me start wi...
[ { "code": null, "e": 477, "s": 172, "text": "In data science and programming, boolean (True and False) data are considered simple and boring. I believe booleans are fun and sometimes unpredictable if you don’t know their logic. I will convince many of you that some interesting features are associate...
Jython - Functions
A complex programming logic is broken into one or more independent and reusable blocks of statements called as functions. Python’s standard library contains large numbers of built-in functions. One can also define their own function using the def keyword. User defined name of the function is followed by a block of stat...
[ { "code": null, "e": 2467, "s": 2081, "text": "A complex programming logic is broken into one or more independent and reusable blocks of statements called as functions. Python’s standard library contains large numbers of built-in functions. One can also define their own function using the def keywor...
How to create String object in Java?
You can create a String by - Assigning a string value wrapped in " " to a String type variable. Assigning a string value wrapped in " " to a String type variable. String message = "Hello Welcome to Tutorialspoint"; Creating an object of the String class using the new keyword by passing the string value as a parameter o...
[ { "code": null, "e": 1091, "s": 1062, "text": "You can create a String by -" }, { "code": null, "e": 1158, "s": 1091, "text": "Assigning a string value wrapped in \" \" to a String type variable." }, { "code": null, "e": 1225, "s": 1158, "text": "Assigning a s...
Update array of objects with JavaScript?
Let’s say the following are our array of objects − var studentDetails = [ { firstName: "John", listOfSubject: ['MySQL', 'MongoDB']}, {firstName: "David", listOfSubject: ['Java', 'C'] }] We need to add the following in the already created array of objects − {firstName: "Bob", listOfSubject: ['JavaScript']}; var st...
[ { "code": null, "e": 1113, "s": 1062, "text": "Let’s say the following are our array of objects −" }, { "code": null, "e": 1254, "s": 1113, "text": "var studentDetails = [\n { firstName: \"John\", listOfSubject: ['MySQL', 'MongoDB']},\n {firstName: \"David\", listOfSubject: [...
How to change the size of correlation coefficient value in correlation matrix plot using corrplot in R?
The correlation coefficient value size in correlation matrix plot created by using corrplot function ranges from 0 to 1, 0 referring to the smallest and 1 referring to the largest, by default it is 1. To change this size, we need to use number.cex argument. For example, if we want to decrease the size to half then we c...
[ { "code": null, "e": 1407, "s": 1062, "text": "The correlation coefficient value size in correlation matrix plot created by using corrplot function ranges from 0 to 1, 0 referring to the smallest and 1 referring to the largest, by default it is 1. To change this size, we need to use number.cex argum...
How to add transition on hover with CSS?
To add transition with hover on CSS, the code is as follows − Live Demo <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style> body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; padding: 20px; } .scaleBtn { display: inli...
[ { "code": null, "e": 1124, "s": 1062, "text": "To add transition with hover on CSS, the code is as follows −" }, { "code": null, "e": 1135, "s": 1124, "text": " Live Demo" }, { "code": null, "e": 1766, "s": 1135, "text": "<!DOCTYPE html>\n<html>\n<head>\n<meta...
Everything You Need to Know about Indexing in Python | by Emmett Boudreau | Towards Data Science
In general-purpose programming, it is quite common to work with data structures. Data structures are types that are composed of smaller data-types. An example of a data structure is list, or a dictionary. Data structures allow us to organize and work with several components conveniently as members of the same consisten...
[ { "code": null, "e": 760, "s": 172, "text": "In general-purpose programming, it is quite common to work with data structures. Data structures are types that are composed of smaller data-types. An example of a data structure is list, or a dictionary. Data structures allow us to organize and work with...
How to use Thread in Tkinter Python?
With Tkinter, we can call multiple functions at a time using Threading. It provides asynchronous execution of some functions in an application. In order to use a thread in Python, we can import a module called threading and subclass its Thread class. Inside our new class, we need to overwrite the Run method and perform...
[ { "code": null, "e": 1331, "s": 1187, "text": "With Tkinter, we can call multiple functions at a time using Threading. It provides\nasynchronous execution of some functions in an application." }, { "code": null, "e": 1528, "s": 1331, "text": "In order to use a thread in Python, w...
JavaScript RangeError | Precision is out of range
22 Jul, 2020 This JavaScript exception precision is out of range occurs if a number which is outside the range of 0 and 20 (or 21) is passed into toFixed(), toPrecision(), or toExponential() method. Error Message: RangeError: The number of fractional digits is out of range (Edge)RangeError: The precision is out of rang...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Jul, 2020" }, { "code": null, "e": 214, "s": 28, "text": "This JavaScript exception precision is out of range occurs if a number which is outside the range of 0 and 20 (or 21) is passed into toFixed(), toPrecision(), or toExponential...
Overloading New and Delete operator in c++
26 Jan, 2022 The new and delete operators can also be overloaded like other operators in C++. New and Delete operators can be overloaded globally or they can be overloaded for specific classes. If these operators are overloaded using member function for a class, it means that these operators are overloaded only for th...
[ { "code": null, "e": 54, "s": 26, "text": "\n26 Jan, 2022" }, { "code": null, "e": 236, "s": 54, "text": "The new and delete operators can also be overloaded like other operators in C++. New and Delete operators can be overloaded globally or they can be overloaded for specific cl...
std::is_enum Template in C++
19 Nov, 2018 The std::is_enum template of C++ STL is used to check whether the given type is enum or not. It returns a boolean value showing the same. Syntax: template <class T> struct is_enum; Parameter: This template accepts single parameter T (Trait class) to check whether T is a enumeration type or not. Return Valu...
[ { "code": null, "e": 28, "s": 0, "text": "\n19 Nov, 2018" }, { "code": null, "e": 166, "s": 28, "text": "The std::is_enum template of C++ STL is used to check whether the given type is enum or not. It returns a boolean value showing the same." }, { "code": null, "e": ...
Ulam Number Sequence
18 Aug, 2021 Given a positive integer n , the task is to print nth Number of the Ulam Number SequenceUlam Number: In Mathematics, An Ulam number is the member of an Integer sequence that starts with the term U1 = 1 and U1 = 2 and then for every n > 2, Un is defined is smallest positive integer greater than Un-1 which c...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Aug, 2021" }, { "code": null, "e": 438, "s": 28, "text": "Given a positive integer n , the task is to print nth Number of the Ulam Number SequenceUlam Number: In Mathematics, An Ulam number is the member of an Integer sequence that s...
ML | Matrix plots in Seaborn
01 Feb, 2022 Seaborn is a wonderful visualization library provided by python. It has several kinds of plots through which it provides the amazing visualization capabilities. Some of them include count plot, scatter plot, pair plots, regression plots, matrix plots and much more. This article deals with the matrix plots ...
[ { "code": null, "e": 28, "s": 0, "text": "\n01 Feb, 2022" }, { "code": null, "e": 688, "s": 28, "text": "Seaborn is a wonderful visualization library provided by python. It has several kinds of plots through which it provides the amazing visualization capabilities. Some of them i...
How to remove a subset from a DataFrame in R ?
23 May, 2021 A subset is a combination of cells that form a smaller data frame formed out from the original data frame. A set of rows and columns can be removed from the original data frame to reduce a part of the data frame. The subset removal can be based on constraints to which rows and columns are subjected to. In ...
[ { "code": null, "e": 28, "s": 0, "text": "\n23 May, 2021" }, { "code": null, "e": 426, "s": 28, "text": "A subset is a combination of cells that form a smaller data frame formed out from the original data frame. A set of rows and columns can be removed from the original data fram...
Write a URL in a C++ program
21 Jun, 2022 Writing URLs in programming code doesn’t affect the program and the compiler will not throw any error. Here, we will how to use Url in various languages without any errors. The full form of URL is Uniform Resource Locators. URLs are unique they store the address of a particular web application. C++ Java P...
[ { "code": null, "e": 54, "s": 26, "text": "\n21 Jun, 2022" }, { "code": null, "e": 227, "s": 54, "text": "Writing URLs in programming code doesn’t affect the program and the compiler will not throw any error. Here, we will how to use Url in various languages without any errors." ...
Maximum Possible Rating of a Coding Contest
27 Jul, 2020 Given two arrays of positive integer Point[], Upvote[] of size N and a value K (1 <= K <= N). The task is to choose atleast K elements(Problems) such that the rating of the coding contest is maximum.Rating of contest: Rating of a contest is defined as total points of all problems in the contest multiplied ...
[ { "code": null, "e": 54, "s": 26, "text": "\n27 Jul, 2020" }, { "code": null, "e": 418, "s": 54, "text": "Given two arrays of positive integer Point[], Upvote[] of size N and a value K (1 <= K <= N). The task is to choose atleast K elements(Problems) such that the rating of the c...
Convert PyMongo Cursor to Dataframe
26 May, 2020 Prerequisites: MongoDB Python Basics This article is about converting the PyMongo Cursor to Pandas Dataframe. Functions like find() and find_one() returns the Cursor instance. Let’s begin: Importing Required Modules: Import the required module using the command:from pymongo import MongoClient from pandas i...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 May, 2020" }, { "code": null, "e": 65, "s": 28, "text": "Prerequisites: MongoDB Python Basics" }, { "code": null, "e": 204, "s": 65, "text": "This article is about converting the PyMongo Cursor to Pandas Dataframe...
How to use while True in Python
22 Nov, 2021 In this article, we will discuss how to use while True in Python. While loop is used to execute a block of code repeatedly until given boolean condition evaluated to False. If we write while True then the loop will run forever. Python3 # Python program to demonstrate# while loop with True while True: p...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Nov, 2021" }, { "code": null, "e": 94, "s": 28, "text": "In this article, we will discuss how to use while True in Python." }, { "code": null, "e": 256, "s": 94, "text": "While loop is used to execute a block of c...
Python – Filter all uppercase characters Tuples from given list of tuples
02 Sep, 2020 Given a Tuple list, filter tuples which contains all uppercase characters. Input : test_list = [(“GFG”, “IS”, “BEST”), (“GFg”, “AVERAGE”), (“GfG”, ), (“Gfg”, “CS”)]Output : [(‘GFG’, ‘IS’, ‘BEST’)]Explanation : Only 1 tuple has all uppercase Strings. Input : test_list = [(“GFG”, “iS”, “BEST”), (“GFg”, “AVER...
[ { "code": null, "e": 28, "s": 0, "text": "\n02 Sep, 2020" }, { "code": null, "e": 103, "s": 28, "text": "Given a Tuple list, filter tuples which contains all uppercase characters." }, { "code": null, "e": 278, "s": 103, "text": "Input : test_list = [(“GFG”, “I...
Python sympy | Matrix.rref() method
13 Aug, 2019 With the help of sympy.Matrix().rref() method, we can put a matrix into reduced Row echelon form. Matrix().rref() returns a tuple of two elements. The first is the reduced row echelon form, and the second is a tuple of indices of the pivot columns. Syntax: Matrix().rref() Returns: Returns a tuple of which ...
[ { "code": null, "e": 52, "s": 24, "text": "\n13 Aug, 2019" }, { "code": null, "e": 301, "s": 52, "text": "With the help of sympy.Matrix().rref() method, we can put a matrix into reduced Row echelon form. Matrix().rref() returns a tuple of two elements. The first is the reduced ro...
How to calculate the number of occurrences of a character in each row of R DataFrame ?
18 Apr, 2022 In this article, we will discuss how to calculate the number of occurrences of a given character in each row in DataFrame in R Programming Language. The stringr package in R programming language can be used to perform string manipulations and extraction, which can be installed into the working space. The s...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Apr, 2022" }, { "code": null, "e": 177, "s": 28, "text": "In this article, we will discuss how to calculate the number of occurrences of a given character in each row in DataFrame in R Programming Language." }, { "code": null...
Making Calls in Flutter
13 Jun, 2022 In this online world, customer care is playing a major role in the success of a company. Users are quite satisfied when they converse with the executives through calls. This has forced companies to add phone numbers to their apps for their customers to contact them easily. But, dialing those numbers from t...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Jun, 2022" }, { "code": null, "e": 587, "s": 28, "text": "In this online world, customer care is playing a major role in the success of a company. Users are quite satisfied when they converse with the executives through calls. This h...
Python | How to shorten long URLs using Bitly API
22 Oct, 2018 Bitly is used to shorten, brand, share, or retrieve data from links programmatically. In this article, we’ll see how to shorten URLs using Bitly API. Below is a working example to shorten a URL using Bitly API. Step #1: Install Bitly API using gitgit clone https://github.com/bitly/bitly-api-python.git Go i...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Oct, 2018" }, { "code": null, "e": 114, "s": 28, "text": "Bitly is used to shorten, brand, share, or retrieve data from links programmatically." }, { "code": null, "e": 239, "s": 114, "text": "In this article, we’...
Find XOR of numbers from the range [L, R]
13 Jun, 2022 Given two integers L and R, the task is to find the XOR of elements of the range [L, R]. Examples: Input: L = 4, R = 8 Output: 8 4 ^ 5 ^ 6 ^ 7 ^ 8 = 8 Input: L = 3, R = 7 Output: 3 Naive Approach: Initialize answer as zero, Traverse all numbers from L to R and perform XOR of the numbers one by one with t...
[ { "code": null, "e": 53, "s": 25, "text": "\n13 Jun, 2022" }, { "code": null, "e": 152, "s": 53, "text": "Given two integers L and R, the task is to find the XOR of elements of the range [L, R]. Examples:" }, { "code": null, "e": 204, "s": 152, "text": "Input:...
Programming Language For Placement – C++, Java or Python?
12 Dec, 2020 Many times we’ve seen students struggling with the dilemma of choosing a worthwhile Programming Language for the sake of placements. Though this situation is somewhat justifiable as among the numerous Programming Language available across the world, to pick out the one that can help you to get your DREAM J...
[ { "code": null, "e": 53, "s": 25, "text": "\n12 Dec, 2020" }, { "code": null, "e": 383, "s": 53, "text": "Many times we’ve seen students struggling with the dilemma of choosing a worthwhile Programming Language for the sake of placements. Though this situation is somewhat justifi...