title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
How to Build a Machine Learning Model to Identify Credit Card Fraud in 5 Steps | by Claudia Ng | Towards Data Science
With the surge in e-commerce and digital transactions, identity fraud is has also risen to affect millions of people every year. In 2019, fraud losses in the US alone were estimated to be at around US$16.9 billion, a substantial portion of which includes losses from credit card fraud1. In addition to strengthening cybe...
[ { "code": null, "e": 459, "s": 172, "text": "With the surge in e-commerce and digital transactions, identity fraud is has also risen to affect millions of people every year. In 2019, fraud losses in the US alone were estimated to be at around US$16.9 billion, a substantial portion of which includes ...
Undefined Behavior in C and C++ - GeeksforGeeks
Undefined Behavior in C and C++ Name Mangling and extern “C” in C++ How does ‘void*’ differ in C and C++? Write a program that produces different results in C and C++ Type difference of character literals in C and C++ Difference Between C Structures and C++ Structures Virtual Functions and Runtime Polymorphism in C++ |...
[ { "code": null, "e": 22194, "s": 22162, "text": "Undefined Behavior in C and C++" }, { "code": null, "e": 22230, "s": 22194, "text": "Name Mangling and extern “C” in C++" }, { "code": null, "e": 22268, "s": 22230, "text": "How does ‘void*’ differ in C and C++?...
Amazon SageMaker Fast File Mode. Methods for Streaming Training Data... | by Chaim Rand | Towards Data Science
Last year we published a blog post in which we surveyed different methods for streaming training data stored in Amazon S3 into an Amazon SageMaker training session. We highlighted some of the strengths and weaknesses of the different options and examined their ability to address some specific needs such as: dynamic boo...
[ { "code": null, "e": 481, "s": 172, "text": "Last year we published a blog post in which we surveyed different methods for streaming training data stored in Amazon S3 into an Amazon SageMaker training session. We highlighted some of the strengths and weaknesses of the different options and examined ...
Kth Frequency | Practice | GeeksforGeeks
Geek hosted a coding competition, some of the questions were easy and some of them were hard. You are given an array arr of positive integers of size N and an integer K, arr[i] represents the hardness of each problem of geeks' contest. Among those N numbers, your task is to find the numbers which appear more than K tim...
[ { "code": null, "e": 651, "s": 238, "text": "Geek hosted a coding competition, some of the questions were easy and some of them were hard. You are given an array arr of positive integers of size N and an integer K, arr[i] represents the hardness of each problem of geeks' contest. Among those N numbe...
How to Execute a Script in SQLite using Python? - GeeksforGeeks
09 May, 2021 In this article, we are going to see how to execute a script in SQLite using Python. Here we are executing create table and insert records into table scripts through Python. In Python, the sqlite3 module supports SQLite database for storing the data in the database. Step 1: First we need to import the sqli...
[ { "code": null, "e": 25555, "s": 25527, "text": "\n09 May, 2021" }, { "code": null, "e": 25822, "s": 25555, "text": "In this article, we are going to see how to execute a script in SQLite using Python. Here we are executing create table and insert records into table scripts throu...
Jagged Array in Java - GeeksforGeeks
15 Nov, 2021 Prerequisite: Arrays in Java A jagged array is an array of arrays such that member arrays can be of different sizes, i.e., we can create a 2-D array but with a variable number of columns in each row. These types of arrays are also known as Jagged arrays. Pictorial representation of Jagged array in Memory:...
[ { "code": null, "e": 30305, "s": 30277, "text": "\n15 Nov, 2021" }, { "code": null, "e": 30334, "s": 30305, "text": "Prerequisite: Arrays in Java" }, { "code": null, "e": 30561, "s": 30334, "text": "A jagged array is an array of arrays such that member arrays ...
HTML <object> vspace Attribute - GeeksforGeeks
14 Dec, 2021 The HTML <object> vspace Attribute is used to specify the number of whitespace on the bottom and top side of an object. Syntax: <object vspace="pixels"> Attribute: pixels: It specifies the number of whitespaces on the top and bottom of an object in terms of pixels. Note: The <object> vspace Attribute is...
[ { "code": null, "e": 26139, "s": 26111, "text": "\n14 Dec, 2021" }, { "code": null, "e": 26259, "s": 26139, "text": "The HTML <object> vspace Attribute is used to specify the number of whitespace on the bottom and top side of an object." }, { "code": null, "e": 26269,...
How to use GET method to send data in jQuery Ajax?
The jQuery.get( url, [data], [callback], [type] ) method loads data from the server using a GET HTTP request. Here is the description of all the parameters used by this method − url − A string containing the URL to which the request is sent data − This optional parameter represents key/value pairs that will be sent to ...
[ { "code": null, "e": 1172, "s": 1062, "text": "The jQuery.get( url, [data], [callback], [type] ) method loads data from the server using a GET HTTP request." }, { "code": null, "e": 1240, "s": 1172, "text": "Here is the description of all the parameters used by this method −" }...
How to Color Scatter Plot Points in R ? - GeeksforGeeks
30 May, 2021 A scatter plot is a set of dotted points to represent individual pieces of data in the horizontal and vertical axis. But by default, the color of these points is black and sometimes there might be a need to change the color of these points. In this article, we will discuss how to change the color of point...
[ { "code": null, "e": 26597, "s": 26569, "text": "\n30 May, 2021" }, { "code": null, "e": 26839, "s": 26597, "text": "A scatter plot is a set of dotted points to represent individual pieces of data in the horizontal and vertical axis. But by default, the color of these points is b...
What is the use of ON COMPLETION PRESERVE clause while creating the event?
As we know that an event is automatically dropped when it is expired and we would not be able to see it from SHOW EVENTS statement. To change such kind of behavior we can use ON COMPLETION PRESERVE while creating the event. It can be understood from the following example − mysql> Create table event_messages(ID INT NOT ...
[ { "code": null, "e": 1336, "s": 1062, "text": "As we know that an event is automatically dropped when it is expired and we would not be able to see it from SHOW EVENTS statement. To change such kind of behavior we can use ON COMPLETION PRESERVE while creating the event. It can be understood from the...
BigQuery CTEs by Example | Towards Data Science
This is my 20th year working with SQL (eek!). To mark this milestone, I recently wrote an article on the 10 SQL naming standards I live by, which I feel, produce SQL that is easy to read, debug, and maintain. towardsdatascience.com Following this theme, I thought I’d explore some of the other elements of the SQL langua...
[ { "code": null, "e": 381, "s": 172, "text": "This is my 20th year working with SQL (eek!). To mark this milestone, I recently wrote an article on the 10 SQL naming standards I live by, which I feel, produce SQL that is easy to read, debug, and maintain." }, { "code": null, "e": 404, ...
C# - Infinite Loop - GeeksforGeeks
21 Jul, 2021 Infinite Loop is a loop that never terminates or ends and repeats indefinitely. Or in other words, an infinite loop is a loop in which the test condition does not evaluate to false and the loop continues forever until an external force is used to end it. You can create an infinite loop: Using for loop Usin...
[ { "code": null, "e": 25657, "s": 25629, "text": "\n21 Jul, 2021" }, { "code": null, "e": 25945, "s": 25657, "text": "Infinite Loop is a loop that never terminates or ends and repeats indefinitely. Or in other words, an infinite loop is a loop in which the test condition does not ...
Custom Notifications in ElectronJS - GeeksforGeeks
11 May, 2020 ElectronJS is an Open Source Framework used for building Cross-Platform native desktop applications using web technologies such as HTML, CSS, and JavaScript which are capable of running on Windows, macOS, and Linux operating systems. It combines the Chromium engine and NodeJS into a Single Runtime. Electro...
[ { "code": null, "e": 24277, "s": 24249, "text": "\n11 May, 2020" }, { "code": null, "e": 24577, "s": 24277, "text": "ElectronJS is an Open Source Framework used for building Cross-Platform native desktop applications using web technologies such as HTML, CSS, and JavaScript which ...
Tryit Editor v3.7
Tryit: HTML article element
[]
Repdigit Numbers - GeeksforGeeks
23 Mar, 2021 Repdigit Number is a number N which has all the digits in its representation in base B equal.Some of the Repdigit number are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55.... Given a number N, the task is to check if N is an Repdigit Number in Base B or not. If N is a Repdigit Number in Base B th...
[ { "code": null, "e": 24301, "s": 24273, "text": "\n23 Mar, 2021" }, { "code": null, "e": 24429, "s": 24301, "text": "Repdigit Number is a number N which has all the digits in its representation in base B equal.Some of the Repdigit number are: " }, { "code": null, "e"...
Get contents of a Tkinter Entry widget
An Entry widget is a basic one-line character widget that supports only single-line text input. An Entry widget can be defined by initializing the Entry(parent, width) constructor. To validate the Entry widget, we can use the get() method which results in the character entered in the Entry widget. Let us define an Entr...
[ { "code": null, "e": 1243, "s": 1062, "text": "An Entry widget is a basic one-line character widget that supports only single-line text input. An Entry widget can be defined by initializing the Entry(parent, width) constructor." }, { "code": null, "e": 1361, "s": 1243, "text": "T...
How to clone an ArrayList to another ArrayList in Java? - GeeksforGeeks
08 Dec, 2020 The clone() method of the ArrayList class is used to clone an ArrayList to another ArrayList in Java as it returns a shallow copy of its caller ArrayList. Syntax: public Object clone(); Return Value: This function returns a copy of the instance of Object. Below program illustrate the Java.util.ArrayList.c...
[ { "code": null, "e": 24025, "s": 23997, "text": "\n08 Dec, 2020" }, { "code": null, "e": 24181, "s": 24025, "text": "The clone() method of the ArrayList class is used to clone an ArrayList to another ArrayList in Java as it returns a shallow copy of its caller ArrayList. " }, ...
Productivity Tip: Adding Jupyter and Anaconda shortcuts to Windows’ right-click context menu | by Gabriel Signoretti | Towards Data Science
This is going to be a quick one and, if you are anything like me and is used to mostly work with Linux computers for development, you may find this useful. As I just said, for most of my life I’ve primarily used Ubuntu systems to do almost all of my programming work. But recently I've gotten a little fed up with some c...
[ { "code": null, "e": 431, "s": 47, "text": "This is going to be a quick one and, if you are anything like me and is used to mostly work with Linux computers for development, you may find this useful. As I just said, for most of my life I’ve primarily used Ubuntu systems to do almost all of my progra...
Enumerable.Repeat method in C#
Enumerable.Repeat method is part of System.Linq namespace. It returns a collection with repeated elements in C#. Firstly, set which element you want to repeat and how many times. As an example, let us see how to repeat number 10, five times − Enumerable.Repeat(10, 5); The following is the complete example − Live Demo ...
[ { "code": null, "e": 1121, "s": 1062, "text": "Enumerable.Repeat method is part of System.Linq namespace." }, { "code": null, "e": 1175, "s": 1121, "text": "It returns a collection with repeated elements in C#." }, { "code": null, "e": 1241, "s": 1175, "text":...
Text Summarization with GloVe Embeddings.. | by Sayak Misra | Towards Data Science
This story is a continuation to our previous blog post, where we have discussed the basics of text summarization, the various approaches and how we implemented an encoder-decoder model(with attention) to solve the problem in hand. Just to recap, text summarization is a process of generating a concise and meaningful sum...
[ { "code": null, "e": 278, "s": 47, "text": "This story is a continuation to our previous blog post, where we have discussed the basics of text summarization, the various approaches and how we implemented an encoder-decoder model(with attention) to solve the problem in hand." }, { "code": nul...
Keras data generators and how to use them | by Ilya Michlin | Towards Data Science
You probably encountered a situation where you try to load a dataset but there is not enough memory in your machine. As the field of machine learning progresses, this problem becomes more and more common. Today this is already one of the challenges in the field of vision where large datasets of images and video files a...
[ { "code": null, "e": 505, "s": 171, "text": "You probably encountered a situation where you try to load a dataset but there is not enough memory in your machine. As the field of machine learning progresses, this problem becomes more and more common. Today this is already one of the challenges in the...
10 Techniques to Speed Up Python Efficiency | Towards Data Science | Towards Data Science
Python is a scripting language. Compared with compiled languages like C/C++, Python has some disadvantages in efficiency and performance. However, we could use some techniques to speed up the efficiency of Python code. In this article, I will show you the speed-up techniques I usually used in my work. The test environm...
[ { "code": null, "e": 475, "s": 172, "text": "Python is a scripting language. Compared with compiled languages like C/C++, Python has some disadvantages in efficiency and performance. However, we could use some techniques to speed up the efficiency of Python code. In this article, I will show you the...
How to Show and Hide div elements using radio buttons?
03 Aug, 2021 In order to display data/content of a specific element by selecting the particular radio button in jQuery we can use the following two methods: hide() methods: This method is used to hiding the syntax or the element of html that you want to hide.Syntax:$(selector).hide(speed, callback);show() methods: This...
[ { "code": null, "e": 28, "s": 0, "text": "\n03 Aug, 2021" }, { "code": null, "e": 172, "s": 28, "text": "In order to display data/content of a specific element by selecting the particular radio button in jQuery we can use the following two methods:" }, { "code": null, ...
Java Program to Blur Image using Smoothing
28 Oct, 2021 Blurring is a simple and frequently used image processing operation. It is also called as Smoothing. Smoothing of an image removes noisy pixels from the image and applying a low-pass filter to an image. A low-pass filter means removing noise from an image while leaving the majority of the image undamaged. ...
[ { "code": null, "e": 54, "s": 26, "text": "\n28 Oct, 2021" }, { "code": null, "e": 502, "s": 54, "text": "Blurring is a simple and frequently used image processing operation. It is also called as Smoothing. Smoothing of an image removes noisy pixels from the image and applying a ...
Find the siblings of tags using BeautifulSoup
03 Mar, 2021 Prerequisite: BeautifulSoup BeautifulSoup(bs4) is a Python library for pulling data out of HTML and XML files. This module does not come in built-in with Python. To install this type the below command in the terminal. In this article, we will learn about siblings in HTML tags using BeautifulSoup. Here we w...
[ { "code": null, "e": 28, "s": 0, "text": "\n03 Mar, 2021" }, { "code": null, "e": 56, "s": 28, "text": "Prerequisite: BeautifulSoup" }, { "code": null, "e": 326, "s": 56, "text": "BeautifulSoup(bs4) is a Python library for pulling data out of HTML and XML file...
Armstrong Numbers | Practice | GeeksforGeeks
For a given 3 digit number, find whether it is armstrong number or not. An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. Return "Yes" if it is a armstrong number else return "No". NOTE: 371 is an Armstrong number since 33 + 73 + 13 = 371 Exam...
[ { "code": null, "e": 565, "s": 238, "text": "For a given 3 digit number, find whether it is armstrong number or not. An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. Return \"Yes\" if it is a armstrong number else return \"...
Ratio of area of a rectangle with the rectangle inscribed in it
11 Jul, 2022 Given two rectangles, X with a ratio of length to width a:b and Y with a ratio of length to width c:d respectively. Both the rectangles can be resized as long as the ratio of sides remains the same. The task is to place the second rectangle inside the first rectangle such that at least 1 side is equal and ...
[ { "code": null, "e": 28, "s": 0, "text": "\n11 Jul, 2022" }, { "code": null, "e": 489, "s": 28, "text": "Given two rectangles, X with a ratio of length to width a:b and Y with a ratio of length to width c:d respectively. Both the rectangles can be resized as long as the ratio of ...
How to change a primary key in MySQL to auto_increment?
To change a primary key to auto_increment, you can use MODIFY command. Let us first create a table. mysql> create table changePrimaryKeyInAutoIncrement -> ( -> StudentId int not null primary key, -> StudentName varchar(100), -> StudentAge int, -> StudentAddress varchar(100) -> ); Query OK, 0 rows affe...
[ { "code": null, "e": 1287, "s": 1187, "text": "To change a primary key to auto_increment, you can use MODIFY command. Let us first create a table." }, { "code": null, "e": 1523, "s": 1287, "text": "mysql> create table changePrimaryKeyInAutoIncrement\n -> (\n -> StudentId int ...
Python script to get device vendor name from MAC Address
29 Dec, 2020 Prerequisite: Python Requests A MAC address is a unique identity of a network interface that is used to address the device in a Computer Network. A MAC address is made up of 12 hexadecimal digits, 6 octets separated by ‘:’. There are 6 octets in a MAC address. In the first half, the manufacturer info is st...
[ { "code": null, "e": 28, "s": 0, "text": "\n29 Dec, 2020" }, { "code": null, "e": 58, "s": 28, "text": "Prerequisite: Python Requests" }, { "code": null, "e": 174, "s": 58, "text": "A MAC address is a unique identity of a network interface that is used to addr...
GATE | GATE CS 2019 | Question 27
17 Aug, 2021 Consider the following C program: #include <stdio.h> int jumble(int x, int y) { x = 2 * x + y; return x; }int main() { int x = 2, y = 5; y = jumble(y, x); x = jumble(y, x); printf("%d\n", x); return 0; } The value printed by program is __________ . Note: This was Numerical Type question.(A) 2...
[ { "code": null, "e": 52, "s": 24, "text": "\n17 Aug, 2021" }, { "code": null, "e": 86, "s": 52, "text": "Consider the following C program:" }, { "code": "#include <stdio.h> int jumble(int x, int y) { x = 2 * x + y; return x; }int main() { int x = 2, y = 5; y = j...
Line Clipping | Set 2 (Cyrus Beck Algorithm)
28 Jun, 2019 Background:Cyrus Beck is a line clipping algorithm that is made for convex polygons. It allows line clipping for non-rectangular windows, unlike Cohen Sutherland or Nicholl Le Nicholl. It also removes the repeated clipping needed in Cohen Sutherland. Input: 1. Convex area of interest which is define...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Jun, 2019" }, { "code": null, "e": 279, "s": 28, "text": "Background:Cyrus Beck is a line clipping algorithm that is made for convex polygons. It allows line clipping for non-rectangular windows, unlike Cohen Sutherland or Nicholl Le...
Queue element() method in Java
26 Sep, 2018 The element() method of Queue Interface returns the element at the front the container. It does not deletes the element in the container. This method returns the head of the queue. This method differs from peek() only in that it throws an exception if this queue is empty. Syntax: E element() Returns: This ...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 Sep, 2018" }, { "code": null, "e": 209, "s": 28, "text": "The element() method of Queue Interface returns the element at the front the container. It does not deletes the element in the container. This method returns the head of the q...
What is the main difference between int.Parse() and Convert.ToInt32 in C#?
Convert a string representation of number to an integer, using the int.Parse or Convert.ToInt32 method in C#. If the string cannot be converted, then the int.Parse or Convert.ToInt32 method returns an exception Convert.ToInt32 allows null value, it doesn't throw any errors Int.parse does not allow null value, and it th...
[ { "code": null, "e": 1398, "s": 1187, "text": "Convert a string representation of number to an integer, using the int.Parse or Convert.ToInt32 method in C#. If the string cannot be converted, then the int.Parse or Convert.ToInt32 method returns an exception" }, { "code": null, "e": 1544,...
Set the width of a button with CSS
To set the button width, use the CSS width property. You can try to run the following code to set the width of a button − Live Demo <!DOCTYPE html> <html> <head> <style> .btn { background-color: yellow; color: black; width: 120px; text-align: center; ...
[ { "code": null, "e": 1240, "s": 1187, "text": "To set the button width, use the CSS width property." }, { "code": null, "e": 1309, "s": 1240, "text": "You can try to run the following code to set the width of a button −" }, { "code": null, "e": 1319, "s": 1309, ...
Partition of a set into K subsets with equal sum
11 Jul, 2022 Given an integer array of N elements, the task is to divide this array into K non-empty subsets such that the sum of elements in every subset is same. All elements of this array should be part of exactly one partition. Examples: Input : arr = [2, 1, 4, 5, 6], K = 3 Output : Yes we can divide above array ...
[ { "code": null, "e": 52, "s": 24, "text": "\n11 Jul, 2022" }, { "code": null, "e": 283, "s": 52, "text": "Given an integer array of N elements, the task is to divide this array into K non-empty subsets such that the sum of elements in every subset is same. All elements of this ar...
PHP | header() Function
01 Aug, 2021 The header() function is an inbuilt function in PHP which is used to send a raw HTTP header. The HTTP functions are those functions which manipulate information sent to the client or browser by the Web server, before any other output has been sent. The PHP header() function send a HTTP header to a client o...
[ { "code": null, "e": 52, "s": 24, "text": "\n01 Aug, 2021" }, { "code": null, "e": 689, "s": 52, "text": "The header() function is an inbuilt function in PHP which is used to send a raw HTTP header. The HTTP functions are those functions which manipulate information sent to the c...
Flutter – BoxDecoration Widget
22 Jun, 2021 BoxDecoration is a build-in widget in flutter API. At a bare basic level, it describes how a box should be painted on the screen. The shape of the box needs not to be just a rectangle or a square it can circle also. It comes with a ton of properties we can add an image inside, add a radius to the border (i...
[ { "code": null, "e": 54, "s": 26, "text": "\n22 Jun, 2021" }, { "code": null, "e": 515, "s": 54, "text": "BoxDecoration is a build-in widget in flutter API. At a bare basic level, it describes how a box should be painted on the screen. The shape of the box needs not to be just a ...
Using _ (underscore) as Variable Name in Java
25 Nov, 2021 As we do know variables in java or rather in any language is introduced to write a code where it is suggested to give meaningful names to the variables as per their usage in code and especially in object-oriented languages are supposed to be used locally where ever it is possible instead of just using them...
[ { "code": null, "e": 53, "s": 25, "text": "\n25 Nov, 2021" }, { "code": null, "e": 515, "s": 53, "text": "As we do know variables in java or rather in any language is introduced to write a code where it is suggested to give meaningful names to the variables as per their usage in ...
SQL Query to Convert VARCHAR to INT
28 Oct, 2021 SQL Server’s CAST() and CONVERT() methods can be used to convert VARCHAR to INT. We’ll also look at the more efficient and secure approach to transform values from one data type to another. The CAST() function in SQL Server is used to cast or transform a value or an expression from one data type to another...
[ { "code": null, "e": 53, "s": 25, "text": "\n28 Oct, 2021" }, { "code": null, "e": 243, "s": 53, "text": "SQL Server’s CAST() and CONVERT() methods can be used to convert VARCHAR to INT. We’ll also look at the more efficient and secure approach to transform values from one data t...
Insert a node in Binary Search Tree Iteratively
18 Aug, 2021 A recursive approach to insert a new node in a BST is already discussed in the post: Binary Search Tree | SET 1. In this post, an iterative approach to insert a node in BST is discussed. Insertion of a Key A new key is always inserted at the leaf node. Start searching a key from root till we hit a leaf no...
[ { "code": null, "e": 53, "s": 25, "text": "\n18 Aug, 2021" }, { "code": null, "e": 241, "s": 53, "text": "A recursive approach to insert a new node in a BST is already discussed in the post: Binary Search Tree | SET 1. In this post, an iterative approach to insert a node in BST i...
Java Swing – JPanel With Examples
10 Nov, 2021 JPanel, a part of the Java Swing package, is a container that can store a group of components. The main task of JPanel is to organize components, various layouts can be set in JPanel which provide better organization of components, however, it does not have a title bar. JPanel(): creates a new panel with a...
[ { "code": null, "e": 52, "s": 24, "text": "\n10 Nov, 2021" }, { "code": null, "e": 323, "s": 52, "text": "JPanel, a part of the Java Swing package, is a container that can store a group of components. The main task of JPanel is to organize components, various layouts can be set i...
DELETE method- Python requests
26 Feb, 2020 Requests library is one of the important aspects of Python for making HTTP requests to a specified URL. This article revolves around how one can make DELETE request to a specified URL using requests.delete() method. Before checking out the DELETE method, let’s figure out what a Http DELETE request is – DEL...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 Feb, 2020" }, { "code": null, "e": 332, "s": 28, "text": "Requests library is one of the important aspects of Python for making HTTP requests to a specified URL. This article revolves around how one can make DELETE request to a speci...
Number of triangles possible with given lengths of sticks which are powers of 2
08 Jun, 2022 Given an array of N integers where arr[i] denotes the number of sticks of length 2i. The task is to find the number of triangles possible with given lengths having area ≥ 0. Note: Every stick can only be used once. Examples: Input: a[] = {1, 2, 2, 2, 2} Output: 3 All possible triangles are: (20, 24, 24),...
[ { "code": null, "e": 28, "s": 0, "text": "\n08 Jun, 2022" }, { "code": null, "e": 243, "s": 28, "text": "Given an array of N integers where arr[i] denotes the number of sticks of length 2i. The task is to find the number of triangles possible with given lengths having area ≥ 0. N...
Maximum area rectangle by picking four sides from array
16 Mar, 2022 Given an array of n positive integers that represent lengths. Find out the maximum possible area whose four sides are picked from given array. Note that a rectangle can only be formed if there are two pairs of equal values in given array. Examples: Input : arr[] = {2, 1, 2, 5, 4, 4} Output : 8 Explanation...
[ { "code": null, "e": 54, "s": 26, "text": "\n16 Mar, 2022" }, { "code": null, "e": 293, "s": 54, "text": "Given an array of n positive integers that represent lengths. Find out the maximum possible area whose four sides are picked from given array. Note that a rectangle can only ...
Servlets - Environment Setup
A development environment is where you would develop your Servlet, test them and finally run them. Like any other Java program, you need to compile a servlet by using the Java compiler javac and after compilation the servlet application, it would be deployed in a configured environment to test and run.. This developmen...
[ { "code": null, "e": 2418, "s": 2319, "text": "A development environment is where you would develop your Servlet, test them and finally run them." }, { "code": null, "e": 2624, "s": 2418, "text": "Like any other Java program, you need to compile a servlet by using the Java compil...
Perl | Count the frequency of words in text
12 Feb, 2019 Counting frequency of all words of a string is a basic operation for any programming language. The frequency of each word of the text can be counted and stored in a hash for further use. In Perl, we can do this by firstly splitting the words of the string into an array. We use the function split / / which ...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Feb, 2019" }, { "code": null, "e": 648, "s": 28, "text": "Counting frequency of all words of a string is a basic operation for any programming language. The frequency of each word of the text can be counted and stored in a hash for f...
Swapping Pairs of Characters in a String in Java
30 Aug, 2020 Given string str, the task is to write a Java program to swap the pairs of characters of a string. If the string contains an odd number of characters then the last character remains as it is. Examples: Input: str = “Java” Output: aJva Explanation: The given string contains even number of characters. Theref...
[ { "code": null, "e": 53, "s": 25, "text": "\n30 Aug, 2020" }, { "code": null, "e": 245, "s": 53, "text": "Given string str, the task is to write a Java program to swap the pairs of characters of a string. If the string contains an odd number of characters then the last character ...
Prefix to Postfix Conversion
24 May, 2022 Prefix: An expression is called the prefix expression if the operator appears in the expression before the operands. Simply of the form (operator operand1 operand2). Example : *+AB-CD (Infix : (A+B) * (C-D) ) Postfix: An expression is called the postfix expression if the operator appears in the expression ...
[ { "code": null, "e": 52, "s": 24, "text": "\n24 May, 2022" }, { "code": null, "e": 261, "s": 52, "text": "Prefix: An expression is called the prefix expression if the operator appears in the expression before the operands. Simply of the form (operator operand1 operand2). Example ...
Check if any K ranges overlap at any point
22 Jun, 2022 Given N ranges [L, R] and an integer K, the task is to check if there are any K ranges that overlap at any point. Examples: Input: ranges[][] = {{1, 3}, {2, 4}, {3, 4}, {7, 10}}, K = 3 Output: Yes 3 is a common point among the ranges {1, 3}, {2, 4} and {3, 4}. Input: ranges[][] = {{1, 2}, {3, 4}, {5, 6}, ...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Jun, 2022" }, { "code": null, "e": 142, "s": 28, "text": "Given N ranges [L, R] and an integer K, the task is to check if there are any K ranges that overlap at any point." }, { "code": null, "e": 153, "s": 142, "...
How to Solve a Production Planning and Inventory Problem in Python | by Khuyen Tran | Towards Data Science
Imagine you are an owner of a clothing store. The demand for clothes varies from day to day (more people prefer to go shopping on the weekend than on the weekday). The production cost also varies from day to day (it costs more to hire workers to work on the weekend). Your job is to determine how many units of clothes t...
[ { "code": null, "e": 440, "s": 172, "text": "Imagine you are an owner of a clothing store. The demand for clothes varies from day to day (more people prefer to go shopping on the weekend than on the weekday). The production cost also varies from day to day (it costs more to hire workers to work on t...
Bitcoin Price Prediction Using Time Series Forecasting | by Ayushi Asthana | Towards Data Science
This article is about predicting bitcoin price using time series forecasting. Time series forecasting is quite different from other machine learning models because - 1. It is time dependent. So, the basic assumption of a linear regression model that the observations are independent doesn’t hold in this case. 2. Along w...
[ { "code": null, "e": 338, "s": 172, "text": "This article is about predicting bitcoin price using time series forecasting. Time series forecasting is quite different from other machine learning models because -" }, { "code": null, "e": 482, "s": 338, "text": "1. It is time depend...
Shortest Path in a Directed Acyclic Graph
One weighted directed acyclic graph is given. Another source vertex is also provided. Now we have to find the shortest distance from the starting node to all other vertices, in the graph. To detect Smaller distance, we can use another algorithm like Bellman-Ford for the graph with negative weight, for positive weight t...
[ { "code": null, "e": 1250, "s": 1062, "text": "One weighted directed acyclic graph is given. Another source vertex is also provided. Now we have to find the shortest distance from the starting node to all other vertices, in the graph." }, { "code": null, "e": 1524, "s": 1250, "te...
A brief guide to data imputation with Python and R | by Pavlo Horbonos | Towards Data Science
We all know, that data cleaning is one of the most time-consuming stages in the data analysis process. We need to acquire missing values, check their distribution, figure out the patterns, and make a decision on how to fill the spaces. At this point you should realize, that identification of missing data patterns and c...
[ { "code": null, "e": 637, "s": 172, "text": "We all know, that data cleaning is one of the most time-consuming stages in the data analysis process. We need to acquire missing values, check their distribution, figure out the patterns, and make a decision on how to fill the spaces. At this point you s...
Get the sum of multiple row (not all) values from a MySQL table?
You can use aggregate function SUM() from MySQL for this. Let us first create a table − mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Amount int ); Query OK, 0 rows affected (0.65 sec) Insert some records in the table using insert command − mysql> insert into DemoTable(Amount) values...
[ { "code": null, "e": 1150, "s": 1062, "text": "You can use aggregate function SUM() from MySQL for this. Let us first create a table −" }, { "code": null, "e": 1283, "s": 1150, "text": "mysql> create table DemoTable\n(\n Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,\n Amount in...
C | Arrays | Question 2 - GeeksforGeeks
11 Jan, 2013 Predict the output of below program: #include <stdio.h> int main(){ int arr[5]; // Assume base address of arr is 2000 and size of integer is 32 bit printf("%u %u", arr + 1, &arr + 1); return 0;} (A) 2004 2020(B) 2004 2004(C) 2004 Garbage value(D) The program fails to compile because Address...
[ { "code": null, "e": 23591, "s": 23563, "text": "\n11 Jan, 2013" }, { "code": null, "e": 23628, "s": 23591, "text": "Predict the output of below program:" }, { "code": "#include <stdio.h> int main(){ int arr[5]; // Assume base address of arr is 2000 and size of int...
Display two digits day number in Java
To display two-digit day number, use the SimpleDateFormat('dd') as shown below − // displaying two-digit day number f = new SimpleDateFormat("dd"); String strDay = f.format(new Date()); System.out.println("Day Number = "+strDay); Since, we have used the Format and SimpleDateFormat class above, therefore import the foll...
[ { "code": null, "e": 1143, "s": 1062, "text": "To display two-digit day number, use the SimpleDateFormat('dd') as shown below −" }, { "code": null, "e": 1292, "s": 1143, "text": "// displaying two-digit day number\nf = new SimpleDateFormat(\"dd\");\nString strDay = f.format(new D...
C++ Program to Implement Hash Tables
A hash table is a data structure which is used to store key-value pairs. Hash function is used by hash table to compute an index into an array in which an element will be inserted or searched. This is a C++ program to Implement Hash Tables. Begin Initialize the table size T_S to some integer value. Create a struc...
[ { "code": null, "e": 1255, "s": 1062, "text": "A hash table is a data structure which is used to store key-value pairs. Hash function is used by hash table to compute an index into an array in which an element will be inserted or searched." }, { "code": null, "e": 1303, "s": 1255, ...
How to get an amazing Terminal. In Windows and Linux; including... | by Martin Thoma | Towards Data Science
As a developer with 10+ years of experience, I love using the shell. The commands never change, I can create custom shortcuts, it’s reliable and fast. The defaults are not great, though. After reading this article, you will know how to get an awesome shell + terminal on your system. The shell is what actually executes ...
[ { "code": null, "e": 456, "s": 172, "text": "As a developer with 10+ years of experience, I love using the shell. The commands never change, I can create custom shortcuts, it’s reliable and fast. The defaults are not great, though. After reading this article, you will know how to get an awesome shel...
p5.js | min() function - GeeksforGeeks
09 Apr, 2019 The min() function in p5.js is used to get the minimum value from the sequence of numbers. Syntax: min(a, b) or min(arr) Parameters: The min(a, b) function accepts two parameters which are two different number and compared to get minimum value among them. The min(arr) function accepts a single parameter ar...
[ { "code": null, "e": 25382, "s": 25354, "text": "\n09 Apr, 2019" }, { "code": null, "e": 25473, "s": 25382, "text": "The min() function in p5.js is used to get the minimum value from the sequence of numbers." }, { "code": null, "e": 25481, "s": 25473, "text": ...
Count number of bits to be flipped to convert A to B | Set-2 - GeeksforGeeks
17 Nov, 2021 Given two integers A and B, the task is to count the number of bits needed to be flipped to convert A to B.Examples: Input: A = 10, B = 7 Output: 3 binary(10) = 1010 binary(7) = 0111 1010 0111 3 bits need to be flipped.Input: A = 8, B = 7 Output: 4 Approach: An approach to solve this problem has alre...
[ { "code": null, "e": 25013, "s": 24985, "text": "\n17 Nov, 2021" }, { "code": null, "e": 25132, "s": 25013, "text": "Given two integers A and B, the task is to count the number of bits needed to be flipped to convert A to B.Examples: " }, { "code": null, "e": 25266, ...
Partition of a set into K subsets with equal sum using BitMask and DP - GeeksforGeeks
11 Aug, 2021 Given an integer array arr[] of consisting of N integers, the task is check if it is possible to divide the given array into K non-empty subsets of equal sum such that every array element is part of a single subset.Examples: Input: arr[] = {2, 1, 4, 5, 6}, K = 3 Output: Yes Explanation: Possible subsets ...
[ { "code": null, "e": 24924, "s": 24896, "text": "\n11 Aug, 2021" }, { "code": null, "e": 25151, "s": 24924, "text": "Given an integer array arr[] of consisting of N integers, the task is check if it is possible to divide the given array into K non-empty subsets of equal sum such ...
java.time.LocalDateTime.parse() Method Example
The java.time.LocalDateTime.parse(CharSequence text) method obtains an instance of LocalDateTime from a text string such as 2017-02-03T10:15:30. Following is the declaration for java.time.LocalDateTime.parse(CharSequence text) method. public static LocalDateTime parse(CharSequence text) text − the text to parse such a...
[ { "code": null, "e": 2060, "s": 1915, "text": "The java.time.LocalDateTime.parse(CharSequence text) method obtains an instance of LocalDateTime from a text string such as 2017-02-03T10:15:30." }, { "code": null, "e": 2150, "s": 2060, "text": "Following is the declaration for java...
Android SQLite Database in Kotlin - GeeksforGeeks
16 Sep, 2021 Android comes with an inbuilt implementation of a database package, which is SQLite, an open-source SQL database that stores data in form of text in devices. In this article, we will look at the implementation of Android SQLite in Kotlin. SQLite is a self-contained, high-reliability, embedded, full-featur...
[ { "code": null, "e": 25142, "s": 25114, "text": "\n16 Sep, 2021" }, { "code": null, "e": 25382, "s": 25142, "text": "Android comes with an inbuilt implementation of a database package, which is SQLite, an open-source SQL database that stores data in form of text in devices. In th...
Pandas Hacks: read_clipboard(). Well, it’s not a hack, but it saves you... | by Adrian Mark Perea | Towards Data Science
We’ve all been there: we’re reading an interesting piece of data on Kaggle, StackOverflow, or some obscure website on the second page of Google (yikes!), and it had enough shimmer to pique our curiosity to lure us to playing with it, because we (cool data science people) are just suckers for them sweet data insights. W...
[ { "code": null, "e": 615, "s": 172, "text": "We’ve all been there: we’re reading an interesting piece of data on Kaggle, StackOverflow, or some obscure website on the second page of Google (yikes!), and it had enough shimmer to pique our curiosity to lure us to playing with it, because we (cool data...
Solidity - Variable Scope
Scope of local variables is limited to function in which they are defined but State variables can have three types of scopes. Public − Public state variables can be accessed internally as well as via messages. For a public state variable, an automatic getter function is generated. Public − Public state variables can be...
[ { "code": null, "e": 2681, "s": 2555, "text": "Scope of local variables is limited to function in which they are defined but State variables can have three types of scopes." }, { "code": null, "e": 2837, "s": 2681, "text": "Public − Public state variables can be accessed internal...
Interactive climate data visualizations with Python & Plotly | by JP Hwang | Towards Data Science
Bar graphs (or column graphs to be exact) are very, very effective forms of data visualisation. They’re perceptually great, and usually don’t require as much explanation as some of the more unusual plots so. Subplot are not often talked about, but they can be very powerful and effective. Used in a certain way, they can...
[ { "code": null, "e": 671, "s": 172, "text": "Bar graphs (or column graphs to be exact) are very, very effective forms of data visualisation. They’re perceptually great, and usually don’t require as much explanation as some of the more unusual plots so. Subplot are not often talked about, but they ca...
How to print div content using jQuery?
Let’s say we have the following button − <input type='button' id='buttonId' value='Press Me To print the data'> On click of the above button, call the function() with on() − $('#buttonId').on('click', function () { displayTheData(); }) The above function is using the html() to display the following div − <div id='pr...
[ { "code": null, "e": 1103, "s": 1062, "text": "Let’s say we have the following button −" }, { "code": null, "e": 1174, "s": 1103, "text": "<input type='button' id='buttonId' value='Press Me To print the data'>" }, { "code": null, "e": 1236, "s": 1174, "text": ...
Built-in Functions in AWK - GeeksforGeeks
23 Feb, 2018 AWK has lots of built-in functions for numeric, string, input, and output operations. Awk has the following two types of high level built-in function categories: Built-in functions for numeric operations. Built-in functions for string operations. Prerequisite – AWK command in Unix/Linux Built-in functions ...
[ { "code": null, "e": 24406, "s": 24378, "text": "\n23 Feb, 2018" }, { "code": null, "e": 24568, "s": 24406, "text": "AWK has lots of built-in functions for numeric, string, input, and output operations. Awk has the following two types of high level built-in function categories:" ...
Difference between namespace and class - GeeksforGeeks
26 Jan, 2018 Classes are data types. They are an expanded concept of structures, they can contain data members, but they can also contain functions as members whereas a namespace is simply an abstract way of grouping items together. A namespace cannot be created as an object; think of it more as a naming convention. It...
[ { "code": null, "e": 24794, "s": 24766, "text": "\n26 Jan, 2018" }, { "code": null, "e": 25328, "s": 24794, "text": "Classes are data types. They are an expanded concept of structures, they can contain data members, but they can also contain functions as members whereas a namespa...
The best way to remove duplicates from an array of objects in JavaScript?
Let’s say the following is our array of objects with duplicates − var studentDetails=[ {studentId:101}, {studentId:104}, {studentId:106}, {studentId:104}, {studentId:110}, {studentId:106}, ] Use the concept of set to remove duplicates as in the below code − var studentDetails=[ {studentId:101}, ...
[ { "code": null, "e": 1128, "s": 1062, "text": "Let’s say the following is our array of objects with duplicates −" }, { "code": null, "e": 1271, "s": 1128, "text": "var studentDetails=[\n {studentId:101},\n {studentId:104},\n {studentId:106},\n {studentId:104},\n {studen...
Extending a list in Python (5 different ways) - GeeksforGeeks
11 Oct, 2019 Extending a list in python can be done is following ways:1. Using append() function: We can append at the end of the list by using append() function. For appending any single value to the list or appending a list to the list, the syntax stays the same. But we can only append a single value at a time using ...
[ { "code": null, "e": 24388, "s": 24360, "text": "\n11 Oct, 2019" }, { "code": null, "e": 24713, "s": 24388, "text": "Extending a list in python can be done is following ways:1. Using append() function: We can append at the end of the list by using append() function. For appending...
OpenCV Python Program to analyze an image using Histogram - GeeksforGeeks
15 Feb, 2018 In this article, image analysis using Matplotlib and OpenCV is discussed. Let’s first understand how to experiment image data with various styles and how to represent with Histogram.Prerequisites: OpenCV matplotlib Importing image data import matplotlib.pyplot as plt #importing matplotlib The image should ...
[ { "code": null, "e": 24109, "s": 24081, "text": "\n15 Feb, 2018" }, { "code": null, "e": 24306, "s": 24109, "text": "In this article, image analysis using Matplotlib and OpenCV is discussed. Let’s first understand how to experiment image data with various styles and how to repres...
Is it possible to sum two fields in MongoDB using the Aggregation framework?
Yes, it is possible using the $project operator. Let us first create a collection with documents > db.sumTwoFieldsDemo.insertOne({"FirstValue":150,"SecondValue":350}); { "acknowledged" : true, "insertedId" : ObjectId("5c9b4bfe15e86fd1496b38cd") } > db.sumTwoFieldsDemo.insertOne({"FirstValue":450,"SecondValue":155...
[ { "code": null, "e": 1159, "s": 1062, "text": "Yes, it is possible using the $project operator. Let us first create a collection with documents" }, { "code": null, "e": 1630, "s": 1159, "text": "> db.sumTwoFieldsDemo.insertOne({\"FirstValue\":150,\"SecondValue\":350});\n{\n \"a...
PySpark - Serializers
Serialization is used for performance tuning on Apache Spark. All data that is sent over the network or written to the disk or persisted in the memory should be serialized. Serialization plays an important role in costly operations. PySpark supports custom serializers for performance tuning. The following two serialize...
[ { "code": null, "e": 2038, "s": 1805, "text": "Serialization is used for performance tuning on Apache Spark. All data that is sent over the network or written to the disk or persisted in the memory should be serialized. Serialization plays an important role in costly operations." }, { "code"...
How to Restrict User to Enter Date Manually in Date Field using AngularJS ? - GeeksforGeeks
17 Dec, 2020 In this article, we will see how to restrict the user to enter the date manually in the date field. Approach: First, we need to write the code for input, and we need to give its type as the date in the HTML file. Then in-order to restrict the user to enter date manually we can use onkeydown event. In the o...
[ { "code": null, "e": 24718, "s": 24690, "text": "\n17 Dec, 2020" }, { "code": null, "e": 24818, "s": 24718, "text": "In this article, we will see how to restrict the user to enter the date manually in the date field." }, { "code": null, "e": 24828, "s": 24818, ...
How to read an external JSON file in JavaScript
Suppose we have a JSON file config.json that contains the following data − { "secret": "sfsaad7898fdsfsdf^*($%^*$", "connectionString": "mongodb+srv://username:password@cluster0.laaif.mongodb.net/events?retryWrites=tr ue&w=majority", "localConnectionString": "mongodb+srv://username:password@cluster0.l...
[ { "code": null, "e": 1137, "s": 1062, "text": "Suppose we have a JSON file config.json that contains the following data −" }, { "code": null, "e": 1544, "s": 1137, "text": "{\n \"secret\": \"sfsaad7898fdsfsdf^*($%^*$\",\n \"connectionString\":\n \"mongodb+srv://username:pas...
What are the SAM Interfaces in Java?
An interface having only one abstract method is known as a functional interface and also named as Single Abstract Method Interfaces (SAM Interfaces). One abstract method means that either a default method or an abstract method whose implementation is available by default is allowed. The instances of SAM interfaces are ...
[ { "code": null, "e": 1574, "s": 1062, "text": "An interface having only one abstract method is known as a functional interface and also named as Single Abstract Method Interfaces (SAM Interfaces). One abstract method means that either a default method or an abstract method whose implementation is av...
GATE | GATE-CS-2007 | Question 37 - GeeksforGeeks
19 Nov, 2018 Consider a pipelined processor with the following four stages: IF: Instruction Fetch ID: Instruction Decode and Operand Fetch EX: Execute WB: Write Back The IF, ID and WB stages take one clock cycle each to complete the operation. The number of clock cycles for the EX stage dependson the instruction. The A...
[ { "code": null, "e": 25689, "s": 25661, "text": "\n19 Nov, 2018" }, { "code": null, "e": 25752, "s": 25689, "text": "Consider a pipelined processor with the following four stages:" }, { "code": null, "e": 25842, "s": 25752, "text": "IF: Instruction Fetch\nID: ...
How to concatenate MySQL distinct query results into a string?
Use group_concat() function from MySQL to concatenate. Let us first create a table − mysql> create table DemoTable -> ( -> Subject varchar(10) -> ); Query OK, 0 rows affected (0.43 sec) Insert some records in the table using insert command − mysql> insert into DemoTable values('C'); Query OK, 1 row affected (0...
[ { "code": null, "e": 1147, "s": 1062, "text": "Use group_concat() function from MySQL to concatenate. Let us first create a table −" }, { "code": null, "e": 1257, "s": 1147, "text": "mysql> create table DemoTable\n -> (\n -> Subject varchar(10)\n -> );\nQuery OK, 0 rows aff...
Dimensionality Reduction (PCA) Explained | by Vatsal | Towards Data Science
Table of Contents Introduction What is Dimensionality Reduction? Linear Combination Feature Engineering & Feature Selection Data PCA- Intuition- Mathematical Breakdown - Advantages- Disadvantages- Implementation Summary Resources Introduction Dimensionality reduction is a popular method in machine learning commonly use...
[ { "code": null, "e": 190, "s": 172, "text": "Table of Contents" }, { "code": null, "e": 203, "s": 190, "text": "Introduction" }, { "code": null, "e": 237, "s": 203, "text": "What is Dimensionality Reduction?" }, { "code": null, "e": 256, "s": 2...
Openpyxl - Adding Image - GeeksforGeeks
07 Jan, 2022 Openpyxl is a Python library for manipulating excel documents of the format (xlsx/xlsm/xltx/xltm) created in different variants of Microsoft Excel. The Genesis of the library happened due to lack of a native library to read/write natively from Python the Office Open XML format. Openpyxl provides python wit...
[ { "code": null, "e": 25647, "s": 25619, "text": "\n07 Jan, 2022" }, { "code": null, "e": 25926, "s": 25647, "text": "Openpyxl is a Python library for manipulating excel documents of the format (xlsx/xlsm/xltx/xltm) created in different variants of Microsoft Excel. The Genesis of ...
Is name a reserved word in MySQL?
No, name is not a reserved word in MySQL, you can use without backtick symbol. If you are working on a reserved word then use backtick symbol. Let us first create a table − mysql> create table name ( name varchar(10) ); Query OK, 0 rows affected (0.78 sec) Now you can insert some records in the table using ins...
[ { "code": null, "e": 1235, "s": 1062, "text": "No, name is not a reserved word in MySQL, you can use without backtick symbol. If you are working on a reserved word then use backtick symbol. Let us first create a table −" }, { "code": null, "e": 1328, "s": 1235, "text": "mysql> cr...
adduser command in Linux with Examples - GeeksforGeeks
22 Jun, 2020 adduser command in Linux is used to add a new user to your current Linux machine. This command allows you to modify the configurations of the user which is to be created. It is similar to the useradd command in Linux. The adduser command is much interactive as compared to useradd command. To install adduse...
[ { "code": null, "e": 24145, "s": 24117, "text": "\n22 Jun, 2020" }, { "code": null, "e": 24435, "s": 24145, "text": "adduser command in Linux is used to add a new user to your current Linux machine. This command allows you to modify the configurations of the user which is to be c...
Movies Data Science — Pull & Analyze IMDb data using Python | by Jean L | Towards Data Science
IMDb (Internet Movie Database) is one of the most recognized names for its comprehensive online database collection of movies, films, TV series and so on. As of today (July 2020), you’ll see through the following data pull that IMDb database has approximately 7 million titles. In this article, I will use Python in Jupy...
[ { "code": null, "e": 626, "s": 172, "text": "IMDb (Internet Movie Database) is one of the most recognized names for its comprehensive online database collection of movies, films, TV series and so on. As of today (July 2020), you’ll see through the following data pull that IMDb database has approxima...
How to find and replace within a text file using Python?
The following code does the replacement in the given text file. After the replacement, the text is written to a new text file 'bar.txt' f1 = open('foo.txt', 'r') f2 = open('bar.txt', 'w') for line in f1: print line f2.write(line.replace('Poetry', 'Prose')) f2 = open('bar.txt', 'r') for line in f2: print lin...
[ { "code": null, "e": 1127, "s": 1062, "text": "The following code does the replacement in the given text file. " }, { "code": null, "e": 1199, "s": 1127, "text": "After the replacement, the text is written to a new text file 'bar.txt'" }, { "code": null, "e": 1407, ...
String with additive sequence
05 Jul, 2022 Given a string, the task is to find whether it contains an additive sequence or not. A string contains an additive sequence if its digits can make a sequence of numbers in which every number is addition of previous two numbers. A valid string should contain at least three digit to make one additive sequenc...
[ { "code": null, "e": 52, "s": 24, "text": "\n05 Jul, 2022" }, { "code": null, "e": 363, "s": 52, "text": "Given a string, the task is to find whether it contains an additive sequence or not. A string contains an additive sequence if its digits can make a sequence of numbers in wh...
Sum of subsets of all the subsets of an array | O(N)
22 Jun, 2022 Given an array arr[] of length N, the task is to find the overall sum of subsets of all the subsets of the array.Examples: Input: arr[] = {1, 1} Output: 6 All possible subsets: a) {} : 0 All the possible subsets of this subset will be {}, Sum = 0 b) {1} : 1 All the possible subsets of this subset will be...
[ { "code": null, "e": 52, "s": 24, "text": "\n22 Jun, 2022" }, { "code": null, "e": 177, "s": 52, "text": "Given an array arr[] of length N, the task is to find the overall sum of subsets of all the subsets of the array.Examples: " }, { "code": null, "e": 658, "s"...
Screen Mirroring of Android Smartphone using Raspberry Pi
17 Jan, 2022 Raspberry Pi consists series of small single-board computers. It was developed in the United Kingdom by the Raspberry Pi foundation in association with Broadcom. The first Raspberry Pi model was launched in 2012 and by the time it became popular because of its wide applications in many fields like many use...
[ { "code": null, "e": 52, "s": 24, "text": "\n17 Jan, 2022" }, { "code": null, "e": 494, "s": 52, "text": "Raspberry Pi consists series of small single-board computers. It was developed in the United Kingdom by the Raspberry Pi foundation in association with Broadcom. The first Ra...
numpy.sum() in Python
03 Apr, 2020 numpy.sum(arr, axis, dtype, out) : This function returns the sum of array elements over the specified axis. Parameters :arr : input array.axis : axis along which we want to calculate the sum value. Otherwise, it will consider arr to be flattened(works on all the axis). axis = 0 means along the column and a...
[ { "code": null, "e": 28, "s": 0, "text": "\n03 Apr, 2020" }, { "code": null, "e": 136, "s": 28, "text": "numpy.sum(arr, axis, dtype, out) : This function returns the sum of array elements over the specified axis." }, { "code": null, "e": 559, "s": 136, "text":...
Number of square matrices with all 1s
26 Apr, 2021 Given an N*M matrix containing only 0s and 1s, the task is to count the number of square submatrices containing all 1s.Examples: Input: arr[][] = {{0, 1, 1, 1}, {1, 1, 1, 1}, {0, 1, 1, 1}} Output: 15 Explanation: There are 10 squares of side length 1. There are 4 squares of side length 2. There is 1 squar...
[ { "code": null, "e": 52, "s": 24, "text": "\n26 Apr, 2021" }, { "code": null, "e": 182, "s": 52, "text": "Given an N*M matrix containing only 0s and 1s, the task is to count the number of square submatrices containing all 1s.Examples: " }, { "code": null, "e": 483, ...
Reading Rows from a CSV File in Python
20 Dec, 2021 CSV stands for Comma Separated Values. This file format is a delimited text file that uses a comma as a delimiter to separate the text present in it. Or in other words, CSV files are used to store data in tabular form. As per the name suggested, this file contains the data which is separated by a comma and...
[ { "code": null, "e": 53, "s": 25, "text": "\n20 Dec, 2021" }, { "code": null, "e": 470, "s": 53, "text": "CSV stands for Comma Separated Values. This file format is a delimited text file that uses a comma as a delimiter to separate the text present in it. Or in other words, CSV f...
ML | Feature Scaling – Part 2
05 Jul, 2021 Feature Scaling is a technique to standardize the independent features present in the data in a fixed range. It is performed during the data pre-processing to handle highly varying magnitudes or values or units. If feature scaling is not done, then a machine learning algorithm tends to weigh greater values...
[ { "code": null, "e": 52, "s": 24, "text": "\n05 Jul, 2021" }, { "code": null, "e": 455, "s": 52, "text": "Feature Scaling is a technique to standardize the independent features present in the data in a fixed range. It is performed during the data pre-processing to handle highly v...
PyQt5 – QCommandLinkButton Class
26 Jun, 2020 QCommandLinkButton is a control widget that was introduced by Windows Vista. Its intended use is similar to that of a radio button in that it is used to choose between a set of mutually exclusive options. The appearance of it is generally similar to that of a flat push button, but it allows for a descripti...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 Jun, 2020" }, { "code": null, "e": 562, "s": 28, "text": "QCommandLinkButton is a control widget that was introduced by Windows Vista. Its intended use is similar to that of a radio button in that it is used to choose between a set o...
PHP | filter_input_array() Function
18 Jul, 2019 The filter_input_array() function is an inbuilt function in PHP which is used to get external variables (e.g. from form input) and filters them if it is specified. This function is similar to filter_input() function but the only difference is filter_input() filters a single value but in filter_input_array(...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Jul, 2019" }, { "code": null, "e": 555, "s": 28, "text": "The filter_input_array() function is an inbuilt function in PHP which is used to get external variables (e.g. from form input) and filters them if it is specified. This functi...
Find the Nth row in Pascal’s Triangle
02 Jun, 2022 Given a non-negative integer N, the task is to find the Nth row of Pascal’s Triangle. Note: The row index starts from 0. Pascal’s Triangle: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 Examples: Input: N = 3 Output: 1, 3, 3, 1 Explanation: The elements in the 3rd row are 1 3 3 1. Input: N = 0 Output: 1 Naive Approa...
[ { "code": null, "e": 52, "s": 24, "text": "\n02 Jun, 2022" }, { "code": null, "e": 139, "s": 52, "text": "Given a non-negative integer N, the task is to find the Nth row of Pascal’s Triangle. " }, { "code": null, "e": 175, "s": 139, "text": "Note: The row inde...
How to create a responsive Modal Sign-Up form for a Website?
14 Aug, 2020 Follow the steps to create a responsive sign up form using CSS.Step 1:Adding HTML Use a “form” element to process the input.Then add inputs (with a matching label) for each fieldStep 2:Adding CSS Add the required CSS to design the login page try to keep the design as simple as possible.Input: html <!DOCT...
[ { "code": null, "e": 54, "s": 26, "text": "\n14 Aug, 2020" }, { "code": null, "e": 350, "s": 54, "text": "Follow the steps to create a responsive sign up form using CSS.Step 1:Adding HTML Use a “form” element to process the input.Then add inputs (with a matching label) for each f...
C Program for Tower of Hanoi
16 Jun, 2022 Tower of Hanoi is a mathematical puzzle where we have three rods and n disks. The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules: 1) Only one disk can be moved at a time. 2) Each move consists of taking the upper disk from one of the stacks and placin...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Jun, 2022" }, { "code": null, "e": 486, "s": 28, "text": "Tower of Hanoi is a mathematical puzzle where we have three rods and n disks. The objective of the puzzle is to move the entire stack to another rod, obeying the following sim...
Getting screen’s height and width using Tkinter | Python
14 Sep, 2021 Tkinter provides some methods with the help of which we can get the current screen height and width.Following methods can be used to decide height and width : winfo_screenheight() // Returns screen height in pixels winfo_screenmmheight() // Returns screen height in mm winfo_screenwidth() // Returns scre...
[ { "code": null, "e": 28, "s": 0, "text": "\n14 Sep, 2021" }, { "code": null, "e": 188, "s": 28, "text": "Tkinter provides some methods with the help of which we can get the current screen height and width.Following methods can be used to decide height and width : " }, { "...
Data Structures | Heap | Question 12
28 Jun, 2021 The elements 32, 15, 20, 30, 12, 25, 16 are inserted one by one in the given order into a Max Heap. The resultant Max Heap is. (A) a(B) b(C) c(D) dAnswer: (A)Explanation: 32, 15, 20, 30, 12, 25, 16 After insertion of 32, 15 and 20 32 / \ 15 20 After insertion of 30 ...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Jun, 2021" }, { "code": null, "e": 155, "s": 28, "text": "The elements 32, 15, 20, 30, 12, 25, 16 are inserted one by one in the given order into a Max Heap. The resultant Max Heap is." }, { "code": null, "e": 199, "s...
Swap every two bits in bytes
22 May, 2022 Swap all the pair of bits in a byte. Before swapping: 11-10-11-01 After swapping: 11-01-11-10Examples: Input : 00000010 Output : 00000001 Input : 00000100 Output : 00001000 Approach: x = ((x & 0x55555555) >> 1) | ((x & 0xAAAAAAAA) <> 1 extracts the high bit position and shifts it to the low bit posi...
[ { "code": null, "e": 54, "s": 26, "text": "\n22 May, 2022" }, { "code": null, "e": 159, "s": 54, "text": "Swap all the pair of bits in a byte. Before swapping: 11-10-11-01 After swapping: 11-01-11-10Examples: " }, { "code": null, "e": 232, "s": 159, "text": "...