title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Permutation and Combination in Java
Permutation and Combination are a part of Combinatorics. Permutation is the different arrangements that a set of elements can make if the elements are taken one at a time, some at a time or all at a time. Combination is is the different ways of selecting elements if the elements are taken one at a time, some at a time ...
[ { "code": null, "e": 1525, "s": 1187, "text": "Permutation and Combination are a part of Combinatorics. Permutation is the different arrangements that a set of elements can make if the elements are taken one at a time, some at a time or all at a time. Combination is is the different ways of selectin...
Setting up the environment in Java
27 May, 2022 Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented, etc. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture. The latest version is Java 17. Below are the environment se...
[ { "code": null, "e": 53, "s": 25, "text": "\n27 May, 2022" }, { "code": null, "e": 678, "s": 53, "text": "Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented, etc. Java applications are typically compiled to bytecode that can r...
Program to check if a String in Java contains only whitespaces
22 Jan, 2020 Given a string str, the task is to check if this string contains only whitespaces or some text, in Java. Examples: Input: str = " " Output: True Input: str = "GFG" Output: False Approach: Get the String to be checked in str We can use the trim() method of String class to remove the leading ...
[ { "code": null, "e": 52, "s": 24, "text": "\n22 Jan, 2020" }, { "code": null, "e": 157, "s": 52, "text": "Given a string str, the task is to check if this string contains only whitespaces or some text, in Java." }, { "code": null, "e": 167, "s": 157, "text": "...
Bitmasking and Dynamic Programming | Set-2 (TSP)
25 Apr, 2022 In this post, we will be using our knowledge of dynamic programming and Bitmasking technique to solve one of the famous NP-hard problem “Traveling Salesman Problem”.Before solving the problem, we assume that the reader has the knowledge of DP and formation of DP transition relation Bitmasking in DP Trave...
[ { "code": null, "e": 54, "s": 26, "text": "\n25 Apr, 2022" }, { "code": null, "e": 296, "s": 54, "text": "In this post, we will be using our knowledge of dynamic programming and Bitmasking technique to solve one of the famous NP-hard problem “Traveling Salesman Problem”.Before so...
Python | fabs() vs abs()
09 Aug, 2021 Both the abs() and the fabs() function is used to find the absolute value of a number, i.e., remove the negative sign of a number. Syntax of abs(): abs(number) Syntax of fabs(): math.fabs(number) Both will return the absolute value of a number. The difference is that math.fabs(number) will always return...
[ { "code": null, "e": 53, "s": 25, "text": "\n09 Aug, 2021" }, { "code": null, "e": 186, "s": 53, "text": "Both the abs() and the fabs() function is used to find the absolute value of a number, i.e., remove the negative sign of a number. " }, { "code": null, "e": 204,...
SQL Natural Join - GeeksforGeeks
13 Apr, 2021 In this article, we will discuss the overview of SQL Natural Join and then mainly focus to implement query with the help of examples. Let’s discuss it one by one. Overview :Natural join is an SQL join operation that creates join on the base of the common columns in the tables. To perform natural join there...
[ { "code": null, "e": 23902, "s": 23874, "text": "\n13 Apr, 2021" }, { "code": null, "e": 24065, "s": 23902, "text": "In this article, we will discuss the overview of SQL Natural Join and then mainly focus to implement query with the help of examples. Let’s discuss it one by one."...
Animations with Matplotlib. Animations are an interesting way of... | by Parul Pandey | Towards Data Science
Animations are an interesting way of demonstrating a phenomenon. We as humans are always enthralled by animated and interactive charts rather than the static ones. Animations make even more sense when depicting time-series data like stock prices over the years, climate change over the past decade, seasonalities and tre...
[ { "code": null, "e": 564, "s": 172, "text": "Animations are an interesting way of demonstrating a phenomenon. We as humans are always enthralled by animated and interactive charts rather than the static ones. Animations make even more sense when depicting time-series data like stock prices over the ...
MFC - Strings
Strings are objects that represent sequences of characters. The C-style character string originated within the C language and continues to be supported within C++. This string is actually a one-dimensional array of characters which is terminated by a null character '\0'. This string is actually a one-dimensional array ...
[ { "code": null, "e": 2231, "s": 2067, "text": "Strings are objects that represent sequences of characters. The C-style character string originated within the C language and continues to be supported within C++." }, { "code": null, "e": 2339, "s": 2231, "text": "This string is act...
Python - Working with PNG Images using Matplotlib
Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack. #applying pseudocolor # importing pyplot and image from matplotlib import matplotlib.pyplot as plt import ma...
[ { "code": null, "e": 1274, "s": 1062, "text": "Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack." }, { "code": null, "e": 2693...
Check whether two strings are equivalent or not according to given condition - GeeksforGeeks
09 Nov, 2021 Given two strings A and B of equal size. Two strings are equivalent either of the following conditions hold true: 1) They both are equal. Or, 2) If we divide the string A into two contiguous substrings of same size A1 and A2 and string B into two contiguous substrings of same size B1 and B2, then one of th...
[ { "code": null, "e": 24299, "s": 24271, "text": "\n09 Nov, 2021" }, { "code": null, "e": 24639, "s": 24299, "text": "Given two strings A and B of equal size. Two strings are equivalent either of the following conditions hold true: 1) They both are equal. Or, 2) If we divide the s...
Erlang - Tuples
A tuple is a compound data type with a fixed number of terms. Each term in the Tuple is called an element. The number of elements is said to be the size of the Tuple. An example of how the Tuple data type can be used is shown in the following program. Here we are defining a Tuple P which has 3 terms. The tuple_size is ...
[ { "code": null, "e": 2468, "s": 2301, "text": "A tuple is a compound data type with a fixed number of terms. Each term in the Tuple is called an element. The number of elements is said to be the size of the Tuple." }, { "code": null, "e": 2553, "s": 2468, "text": "An example of h...
Python script to monitor website changes
24 Nov, 2021 In this article, we are going to discuss how to create a python script to monitor website changes. You can code a program to monitor a website and it will notify you if there are any changes. This program has many useful scenarios for example if your school website has updated something you will come to kn...
[ { "code": null, "e": 54, "s": 26, "text": "\n24 Nov, 2021" }, { "code": null, "e": 375, "s": 54, "text": "In this article, we are going to discuss how to create a python script to monitor website changes. You can code a program to monitor a website and it will notify you if there...
Python | Prefix extraction before specific character
25 Jun, 2022 Sometimes, we might have a use case in which we need to find a prefix in a string. But sometimes, the requirement can be something dynamic like a specific input character than number of elements for the decision of getting prefix. Let’s discuss certain ways in which we can find the prefix of a string befor...
[ { "code": null, "e": 28, "s": 0, "text": "\n25 Jun, 2022" }, { "code": null, "e": 358, "s": 28, "text": "Sometimes, we might have a use case in which we need to find a prefix in a string. But sometimes, the requirement can be something dynamic like a specific input character than...
How to create a skewed background using CSS ?
13 May, 2020 The skewed background design pattern is used as a banner on the front page of a website. It gives the website more natural and pleasing look. The skewed background can be easily created using CSS before and after selectors and using skew function. Approach: The approach is simple. We will use a skew functi...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 May, 2020" }, { "code": null, "e": 276, "s": 28, "text": "The skewed background design pattern is used as a banner on the front page of a website. It gives the website more natural and pleasing look. The skewed background can be easi...
p5.js | center() Function
20 Aug, 2019 The center() function is used to set the alignment of element into the center either vertically, horizontally, or both, relative to its parent element or according to the body if the element has no parent. If this function does not contain any parameters then the element will align both vertically and hori...
[ { "code": null, "e": 28, "s": 0, "text": "\n20 Aug, 2019" }, { "code": null, "e": 345, "s": 28, "text": "The center() function is used to set the alignment of element into the center either vertically, horizontally, or both, relative to its parent element or according to the body...
Python – Efficient Text Data Cleaning
18 Oct, 2021 Gone are the days when we used to have data mostly in row-column format, or we can say Structured data. In present times, the data being collected is more unstructured than structured. We have data in the form of text, images, audio etc and the ratio of Structured to Unstructured data has decreased over th...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Oct, 2021" }, { "code": null, "e": 398, "s": 28, "text": "Gone are the days when we used to have data mostly in row-column format, or we can say Structured data. In present times, the data being collected is more unstructured than st...
Maximum Product Subarray | Set 3
12 May, 2021 Given an array A[] that contains both positive and negative integers, find the maximum product subarray.Examples : Input: A[] = { 6, -3, -10, 0, 2 } Output: 180 // The subarray is {6, -3, -10} Input: A[] = {-1, -3, -10, 0, 60 } Output: 60 // The subarray is {60} Input: A[] = { -2, -3, 0, -2, -40 } Ou...
[ { "code": null, "e": 52, "s": 24, "text": "\n12 May, 2021" }, { "code": null, "e": 169, "s": 52, "text": "Given an array A[] that contains both positive and negative integers, find the maximum product subarray.Examples : " }, { "code": null, "e": 398, "s": 169, ...
D3.js | d3.select() Function
17 Jul, 2019 The d3.select() function in D3.js is used to select the first element that matches the specified selector string. If any element is not matched then it returns the empty selection. If multiple elements are matched with the selector then only the first matching element will be selected. Syntax: d3.select("e...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Jul, 2019" }, { "code": null, "e": 315, "s": 28, "text": "The d3.select() function in D3.js is used to select the first element that matches the specified selector string. If any element is not matched then it returns the empty selec...
Vector in C++ STL
06 Jul, 2022 Vectors are the same as dynamic arrays with the ability to resize itself automatically when an element is inserted or deleted, with their storage being handled automatically by the container. Vector elements are placed in contiguous storage so that they can be accessed and traversed using iterators. In vec...
[ { "code": null, "e": 52, "s": 24, "text": "\n06 Jul, 2022" }, { "code": null, "e": 643, "s": 52, "text": "Vectors are the same as dynamic arrays with the ability to resize itself automatically when an element is inserted or deleted, with their storage being handled automatically ...
MongoDB – copyTo() Method
16 Mar, 2021 In MongoDB, copyTo() method is used to copies all the documents from one collection(Source collection) to another collection(Target collection) using server-side JavaScript and if that other collection(Target collection) is not present then MongoDB creates a new collection with that name. This method uses ...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Mar, 2021" }, { "code": null, "e": 365, "s": 28, "text": "In MongoDB, copyTo() method is used to copies all the documents from one collection(Source collection) to another collection(Target collection) using server-side JavaScript an...
Google Interview Experience | Set 4
04 Jun, 2019 Though I didn’t clear google but I want to share my Google interview experience , so it can help other’s . Please find my interview experience below: My Google Interview Experience for Software Developer Position [Android Core Team], London, United Kingdom Like many other enthusiastic engineers, I too appl...
[ { "code": null, "e": 52, "s": 24, "text": "\n04 Jun, 2019" }, { "code": null, "e": 202, "s": 52, "text": "Though I didn’t clear google but I want to share my Google interview experience , so it can help other’s . Please find my interview experience below:" }, { "code": nu...
How to insert an item at the beginning of an array in PHP ?
06 Jun, 2021 Arrays in PHP is a type of data structure that allows us to store multiple elements of similar data type under a single variable thereby saving us the effort of creating a different variable for every data. The arrays are helpful to create a list of elements of similar types, which can be accessed using th...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 Jun, 2021" }, { "code": null, "e": 670, "s": 28, "text": "Arrays in PHP is a type of data structure that allows us to store multiple elements of similar data type under a single variable thereby saving us the effort of creating a dif...
Python | Check if all elements in a List are same
08 Dec, 2018 Given a list, write a Python program to check if all the elements in given list are same. Example: Input: ['Geeks', 'Geeks', 'Geeks', 'Geeks', ] Output: Yes Input: ['Geeks', 'Is', 'all', 'Same', ] Output: No There are various ways we can do this task. Let’s see different ways we can check if all elements ...
[ { "code": null, "e": 53, "s": 25, "text": "\n08 Dec, 2018" }, { "code": null, "e": 143, "s": 53, "text": "Given a list, write a Python program to check if all the elements in given list are same." }, { "code": null, "e": 152, "s": 143, "text": "Example:" }, ...
What is Python's Sys Module
The sys module in Python provides valuable information about the Python interpreter. You can also use it to obtain details about the constants, functions and methods of the Python interpreter. The sys module comes packaged with Python, which means you do not need to download and install it separately using the PIP pack...
[ { "code": null, "e": 1380, "s": 1187, "text": "The sys module in Python provides valuable information about the Python interpreter. You can also use it to obtain details about the constants, functions and methods of the Python interpreter." }, { "code": null, "e": 1520, "s": 1380, ...
How to make graphics with transparent background in R using ggplot2?
14 Sep, 2021 In this article, we will discuss how to create graphs with transparent background in R programming language. The required task will be achieved by using theme() function with appropriate parameters. theme() function used to modify theme settings. To actually visualize a transparent background the image ha...
[ { "code": null, "e": 28, "s": 0, "text": "\n14 Sep, 2021" }, { "code": null, "e": 138, "s": 28, "text": "In this article, we will discuss how to create graphs with transparent background in R programming language. " }, { "code": null, "e": 402, "s": 138, "text...
Python | Pandas dataframe.idxmax()
19 Nov, 2018 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 dataframe.idxmax() function returns index of first occurrence of maximum over requeste...
[ { "code": null, "e": 28, "s": 0, "text": "\n19 Nov, 2018" }, { "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...
TypeScript | String search() Method
17 Feb, 2021 The search() is an inbuilt function in TypeScript that is used to search for a match between a regular expression and this String object. Syntax: string.search(regexp); Parameter: This methods accept a single parameter as mentioned above and described below: regexp: This parameter is a RegExp object. Retu...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Feb, 2021" }, { "code": null, "e": 174, "s": 28, "text": "The search() is an inbuilt function in TypeScript that is used to search for a match between a regular expression and this String object. Syntax:" }, { "code": null, ...
vi Editor in UNIX
16 May, 2020 The default editor that comes with the UNIX operating system is called vi (visual editor). Using vi editor, we can edit an existing file or create a new file from scratch. we can also use this editor to just read a text file.Syntax: vi filename Input:Output: Modes of Operation in vi editor There are three...
[ { "code": null, "e": 54, "s": 26, "text": "\n16 May, 2020" }, { "code": null, "e": 287, "s": 54, "text": "The default editor that comes with the UNIX operating system is called vi (visual editor). Using vi editor, we can edit an existing file or create a new file from scratch. we...
How to convert the hamburger icon of navigation menu to X on click ? - GeeksforGeeks
25 Jun, 2021 The navigation menu is the most important section of a website. It helps in navigating through the website. Having a proper animation not only makes the website look good but also provides a user-friendly interface to the customer. Hence, this animation will make it possible to convert the three lines or t...
[ { "code": null, "e": 24465, "s": 24437, "text": "\n25 Jun, 2021" }, { "code": null, "e": 25187, "s": 24465, "text": "The navigation menu is the most important section of a website. It helps in navigating through the website. Having a proper animation not only makes the website lo...
Set equal_range() function in C++ STL
In this article we are going to discuss the set::equal_range() function in C++ STL, their syntax, working and their return values. Sets in C++ STL are the containers which must have unique elements in a general order. Sets must have unique elements because the value of the element identifies the element. Once added a v...
[ { "code": null, "e": 1193, "s": 1062, "text": "In this article we are going to discuss the set::equal_range() function in C++ STL, their syntax, working and their return values." }, { "code": null, "e": 1528, "s": 1193, "text": "Sets in C++ STL are the containers which must have ...
Apply changes to all the images in given folder - Using Python PIL - GeeksforGeeks
21 Nov, 2019 Given a dataset of raw images, which usually need some pre-processing, which one person has to do physically. It is generally a task that requires some repetitive operation to perform for each image. Well, we can easily automate this process using some simple Python code and some libraries with it. So with...
[ { "code": null, "e": 24474, "s": 24446, "text": "\n21 Nov, 2019" }, { "code": null, "e": 24922, "s": 24474, "text": "Given a dataset of raw images, which usually need some pre-processing, which one person has to do physically. It is generally a task that requires some repetitive ...
BigDecimal signum() Method in Java - GeeksforGeeks
04 Dec, 2018 The java.math.BigDecimal.signum() is an inbuilt method in Java that returns the signum function of this BigDecimal. The sign function or signum function is an odd mathematical function that extracts the sign of a real number. In mathematical expressions, the sign function is often represented as sgn. Synta...
[ { "code": null, "e": 24816, "s": 24788, "text": "\n04 Dec, 2018" }, { "code": null, "e": 25118, "s": 24816, "text": "The java.math.BigDecimal.signum() is an inbuilt method in Java that returns the signum function of this BigDecimal. The sign function or signum function is an odd ...
JavaScript Date getMonth() Method - GeeksforGeeks
12 Oct, 2021 Below is the example of Date getMonth() method. Example: javascript <script type="text/javascript"> // Creating a Date Object var DateObj = new Date('October 15, 1996 05:35:32'); // Month from above Date Object is // Being extracted using getMonth() var months = DateObj.getMonth(); // Pri...
[ { "code": null, "e": 24798, "s": 24770, "text": "\n12 Oct, 2021" }, { "code": null, "e": 24848, "s": 24798, "text": "Below is the example of Date getMonth() method. " }, { "code": null, "e": 24859, "s": 24848, "text": "Example: " }, { "code": null, ...
Training Neural Network from Scratch using PyTorch in just 7 cells | by Khush Patel | Towards Data Science
Content of the blog: Installation and import modulesre-processing and loading the datasetDesigning the modelTraining the modelVisualizing the Output Installation and import modules re-processing and loading the dataset Designing the model Training the model Visualizing the Output First thing first. Regardless of the op...
[ { "code": null, "e": 193, "s": 172, "text": "Content of the blog:" }, { "code": null, "e": 321, "s": 193, "text": "Installation and import modulesre-processing and loading the datasetDesigning the modelTraining the modelVisualizing the Output" }, { "code": null, "e": ...
Int64.MaxValue Field in C# with Examples - GeeksforGeeks
08 Apr, 2019 The MaxValue field or property of Int64 Struct is used to represent the maximum value of Int64. The value of this field is constant means that the user cannot change the value of this field. The value of this field is 9223372036854775807. Its hexadecimal value is 0x7FFFFFFFFFFFFFFF. Syntax: public const lo...
[ { "code": null, "e": 24264, "s": 24236, "text": "\n08 Apr, 2019" }, { "code": null, "e": 24548, "s": 24264, "text": "The MaxValue field or property of Int64 Struct is used to represent the maximum value of Int64. The value of this field is constant means that the user cannot chan...
Breaking Down Goodreads Dataset using Python | by Shivangi Sareen | Towards Data Science
I love reading books and am always looking out for the next one to read, even before I start the one recently bought. So, I decided to mess around with this Goodreads dataset I happened to stumble upon on Kaggle and see what book recommendations I would end up with. It was super fun and packed with learning! Like alway...
[ { "code": null, "e": 438, "s": 171, "text": "I love reading books and am always looking out for the next one to read, even before I start the one recently bought. So, I decided to mess around with this Goodreads dataset I happened to stumble upon on Kaggle and see what book recommendations I would e...
You Should Use CatBoost. Here’s Why. | Towards Data Science
IntroductionCatBoostShort TutorialSummaryReferences Introduction CatBoost Short Tutorial Summary References With Data Science competitions becoming more and more popular, especially on the site, Kaggle, so are new Machine Learning algorithms. Whereas XGBoost was the most competitive and accurate algorithm most of the t...
[ { "code": null, "e": 224, "s": 172, "text": "IntroductionCatBoostShort TutorialSummaryReferences" }, { "code": null, "e": 237, "s": 224, "text": "Introduction" }, { "code": null, "e": 246, "s": 237, "text": "CatBoost" }, { "code": null, "e": 261, ...
How to install python modules without root access?
If you are not able to install modules on a machine(due to not having enough permissions), you could use either virtualenv or save the module files in another directory and use the following code to allow Python to search for modules in the given directory: >>> import os, sys >>> file_path = 'AdditionalModules/' >>> sy...
[ { "code": null, "e": 1320, "s": 1062, "text": "If you are not able to install modules on a machine(due to not having enough permissions), you could use either virtualenv or save the module files in another directory and use the following code to allow Python to search for modules in the given direct...
Bootstrap 4 | Toast - GeeksforGeeks
04 May, 2022 Toast is used to create something like an alert box which is shown for a short time like a couple of seconds when something happens. Like when the user clicks on a button or submits a form and many other actions. .toast: It helps to create a toast .toast-header : It helps to create the toast header .toast-...
[ { "code": null, "e": 29793, "s": 29765, "text": "\n04 May, 2022" }, { "code": null, "e": 30006, "s": 29793, "text": "Toast is used to create something like an alert box which is shown for a short time like a couple of seconds when something happens. Like when the user clicks on a...
Binary number to decimal number | Practice | GeeksforGeeks
Given a Binary Number B, find its decimal equivalent. Example 1: Input: B = 10001000 Output: 136 Example 2: Input: B = 101100 Output: 44 Your Task: You don't need to read or print anything. Your task is to complete the function binary_to_decimal() which takes the binary number as string input parameter and return...
[ { "code": null, "e": 294, "s": 238, "text": "Given a Binary Number B, find its decimal equivalent.\n " }, { "code": null, "e": 305, "s": 294, "text": "Example 1:" }, { "code": null, "e": 338, "s": 305, "text": "Input: B = 10001000\nOutput: 136\n" }, { ...
Find All Duplicate Subtrees - GeeksforGeeks
20 Nov, 2021 Given a binary tree, find all duplicate subtrees. For each duplicate subtree, we only need to return the root node of any one of them. Two trees are duplicates if they have the same structure with the same node values.Examples: Input : 1 / \ 2 3 / / \ 4 2 4 / 4 ...
[ { "code": null, "e": 37201, "s": 37173, "text": "\n20 Nov, 2021" }, { "code": null, "e": 37430, "s": 37201, "text": "Given a binary tree, find all duplicate subtrees. For each duplicate subtree, we only need to return the root node of any one of them. Two trees are duplicates if ...
C# | How to use strings in switch statement - GeeksforGeeks
23 Jan, 2019 The switch statement is a multiway branch statement. It provides an easy way to forward execution to different parts of code based on the value of the expression. String is the only non-integer type which can be used in switch statement. Important points: Switching on strings can be more costly in term of ...
[ { "code": null, "e": 25435, "s": 25407, "text": "\n23 Jan, 2019" }, { "code": null, "e": 25673, "s": 25435, "text": "The switch statement is a multiway branch statement. It provides an easy way to forward execution to different parts of code based on the value of the expression. ...
Difference between != and is not operator in Python - GeeksforGeeks
11 Dec, 2020 In this article, we are going to see != (Not equal) operators. In Python != is defined as not equal to operator. It returns True if operands on either side are not equal to each other, and returns False if they are equal. Whereas is not operator checks whether id() of two objects is same or not. If same, i...
[ { "code": null, "e": 24402, "s": 24374, "text": "\n11 Dec, 2020" }, { "code": null, "e": 24885, "s": 24402, "text": "In this article, we are going to see != (Not equal) operators. In Python != is defined as not equal to operator. It returns True if operands on either side are not...
How to Close a Tkinter Window With a Button? - GeeksforGeeks
17 Dec, 2020 Prerequisites: Tkinter Python’s Tkinter module offers the Button function to create a button in a Tkinter Window to execute any task once the button is clicked. The task can be assigned in the command parameter of Button() function. Given below are various methods by which this can be achieved. Approach: I...
[ { "code": null, "e": 25783, "s": 25755, "text": "\n17 Dec, 2020" }, { "code": null, "e": 25806, "s": 25783, "text": "Prerequisites: Tkinter" }, { "code": null, "e": 26079, "s": 25806, "text": "Python’s Tkinter module offers the Button function to create a butt...
Top View of Binary Tree | Practice | GeeksforGeeks
Given below is a binary tree. The task is to print the top view of binary tree. Top view of a binary tree is the set of nodes visible when the tree is viewed from the top. For the given below tree 1 / \ 2 3 / \ / \ 4 5 6 7 Top view will be: 4 2 1 3 7 Note: Return nodes from leftmos...
[ { "code": null, "e": 435, "s": 238, "text": "Given below is a binary tree. The task is to print the top view of binary tree. Top view of a binary tree is the set of nodes visible when the tree is viewed from the top. For the given below tree" }, { "code": null, "e": 499, "s": 435, ...
Controlling the Visibility of Class and Interface in Java - GeeksforGeeks
22 Feb, 2021 Maintenance is one of the important aspects of software development, and experience has shown that software that maintains its component’s visibility low is more maintainable than one that exposes its component more. You’re not going to know it upfront, but when redesigning the application, you’re going to...
[ { "code": null, "e": 23557, "s": 23529, "text": "\n22 Feb, 2021" }, { "code": null, "e": 23883, "s": 23557, "text": "Maintenance is one of the important aspects of software development, and experience has shown that software that maintains its component’s visibility low is more m...
How to Install PowerShell in Linux? - GeeksforGeeks
06 Oct, 2021 PowerShell is well-known among Windows administrators. It is a.NET-based task-based command-line shell and scripting language. You can quickly automate tasks for operating system maintenance and much more with PowerShell. PowerShell was once only available for Microsoft Windows. This admin tool, on the ot...
[ { "code": null, "e": 24633, "s": 24602, "text": " \n06 Oct, 2021\n" }, { "code": null, "e": 24989, "s": 24633, "text": "PowerShell is well-known among Windows administrators. It is a.NET-based task-based command-line shell and scripting language. You can quickly automate tasks fo...
Dice throw | Practice | GeeksforGeeks
Given N dice each with M faces, numbered from 1 to M, find the number of ways to get sum X. X is the summation of values on each face when all the dice are thrown. Example 1: Input: M = 6, N = 3, X = 12 Output: 25 Explanation: There are 25 total ways to get the Sum 12 using 3 dices with faces from 1 to 6. Example 2: ...
[ { "code": null, "e": 402, "s": 238, "text": "Given N dice each with M faces, numbered from 1 to M, find the number of ways to get sum X. X is the summation of values on each face when all the dice are thrown." }, { "code": null, "e": 415, "s": 404, "text": "Example 1:" }, { ...
Difference between process.nextTick() and setImmediate() Methods - GeeksforGeeks
11 Apr, 2022 To understand the difference between process.nextTick() and setImmediate() methods, we first need to understand the working of Node.js Event Loop. What is Node.js Event Loop?Due to the fact that JavaScript is single-threaded i.e. it performs only a single process at a time, so it is the Event Loop that all...
[ { "code": null, "e": 23877, "s": 23849, "text": "\n11 Apr, 2022" }, { "code": null, "e": 24024, "s": 23877, "text": "To understand the difference between process.nextTick() and setImmediate() methods, we first need to understand the working of Node.js Event Loop." }, { "c...
Partition Equal Subset Sum | Practice | GeeksforGeeks
Given an array arr[] of size N, check if it can be partitioned into two parts such that the sum of elements in both parts is the same. Example 1: Input: N = 4 arr = {1, 5, 11, 5} Output: YES Explaination: The two parts are {1, 5, 5} and {11}. Example 2: Input: N = 3 arr = {1, 3, 5} Output: NO Explaination: This array...
[ { "code": null, "e": 373, "s": 238, "text": "Given an array arr[] of size N, check if it can be partitioned into two parts such that the sum of elements in both parts is the same." }, { "code": null, "e": 384, "s": 373, "text": "Example 1:" }, { "code": null, "e": 483...
How to insert data in MySQL database from an HTML form using Django
Theory of Computation In this article, you will learn how to insert a contact form data to a MySQL database using Django. Django is a free, open-source Python based framework. It enables fast development of any type of web applications. Like other programming languages, it can easily connect with a database. Django ope...
[ { "code": null, "e": 112, "s": 90, "text": "Theory of Computation" }, { "code": null, "e": 685, "s": 112, "text": "In this article, you will learn how to insert a contact form data to a MySQL database using Django. Django is a free, open-source Python based framework. It enables ...
PostgreSQL - Array Function
PostgreSQL ARRAY_AGG function is used to concatenate the input values including null into an array. To understand the ARRAY_AGG function, consider the table COMPANY having records as follows − testdb# select * from COMPANY; id | name | age | address | salary ----+-------+-----+-----------+-------- 1 | Paul | 32...
[ { "code": null, "e": 2925, "s": 2825, "text": "PostgreSQL ARRAY_AGG function is used to concatenate the input values including null into an array." }, { "code": null, "e": 3018, "s": 2925, "text": "To understand the ARRAY_AGG function, consider the table COMPANY having records as...
Defining the Moving Average Model for Time Series Forecasting in Python | by Marco Peixeiro | Towards Data Science
One of the foundational models for time series forecasting is the moving average model, denoted as MA(q). This is one of the basic statistical models that is a building block of more complex models such as the ARMA, ARIMA, SARIMA and SARIMAX models. A deep understanding of the MA(q) is thus a key step prior to using mo...
[ { "code": null, "e": 544, "s": 171, "text": "One of the foundational models for time series forecasting is the moving average model, denoted as MA(q). This is one of the basic statistical models that is a building block of more complex models such as the ARMA, ARIMA, SARIMA and SARIMAX models. A dee...
Automate Your Python Script with Process Manager 2 (PM2) | by Joe T. Santhanavanich | Towards Data Science
In Data Science, you may have to run or process your Python script periodically especially the data collection to make your workflow up-to-date as it directly related to your result accuracy. You may have a Python script to run every 1,2,..., xx minutes/hours or at 6 am, 9 pm, yy am/pm every day. And doing it yourself ...
[ { "code": null, "e": 527, "s": 172, "text": "In Data Science, you may have to run or process your Python script periodically especially the data collection to make your workflow up-to-date as it directly related to your result accuracy. You may have a Python script to run every 1,2,..., xx minutes/h...
Characteristics of a Clean Code - GeeksforGeeks
17 Apr, 2020 Programmers or developers usually write codes for their project or for some companies. Or some start writing code as a beginner in the programming world. In all these scenarios a nostalgic moment comes when you revisit your code after a long time. You find your own code so difficult to understand. Here are...
[ { "code": null, "e": 24908, "s": 24880, "text": "\n17 Apr, 2020" }, { "code": null, "e": 25300, "s": 24908, "text": "Programmers or developers usually write codes for their project or for some companies. Or some start writing code as a beginner in the programming world. In all th...
Check if an array is sorted and rotated in Python
Suppose we have an array of n unique values. We have to check whether this array is sorted and rotated anti-clockwise. Here at least one rotation is required so a fully sorted array is not considered as sorted and rotated. So, if the input is like nums = [4,5,6,8,1,3], then the output will be True as we can rotate two ...
[ { "code": null, "e": 1285, "s": 1062, "text": "Suppose we have an array of n unique values. We have to check whether this array is sorted and rotated anti-clockwise. Here at least one rotation is required so a fully sorted array is not considered as sorted and rotated." }, { "code": null, ...
K-Means Clustering Tutorial for Data Scientists | Towards Data Science
IntroductionTutorialSummaryReferences Introduction Tutorial Summary References Customer segmentation is widely used by both Data Scientists and Machine Learning Engineers to detect data that is the most similar to one another. These are groups that are closely related to that same group, but different enough to be a ne...
[ { "code": null, "e": 210, "s": 172, "text": "IntroductionTutorialSummaryReferences" }, { "code": null, "e": 223, "s": 210, "text": "Introduction" }, { "code": null, "e": 232, "s": 223, "text": "Tutorial" }, { "code": null, "e": 240, "s": 232, ...
Python os.remove() Method
Python method remove() removes the file path. If the path is a directory, OSError is raised. Following is the syntax for remove() method − os.remove(path) path − This is the path, which is to be removed. path − This is the path, which is to be removed. This method does not return any value. The following example shows...
[ { "code": null, "e": 2337, "s": 2244, "text": "Python method remove() removes the file path. If the path is a directory, OSError is raised." }, { "code": null, "e": 2383, "s": 2337, "text": "Following is the syntax for remove() method −" }, { "code": null, "e": 2400, ...
Equilibrium index of an array | Practice | GeeksforGeeks
Equilibrium index of an array is an index such that the sum of elements at lower indexes is equal to the sum of elements at higher indexes. Given an array, your task is to find the index of first Equilibrium point in the array. Input Format: The first line of input takes an integer T denoting the no of test cases, the...
[ { "code": null, "e": 862, "s": 238, "text": "Equilibrium index of an array is an index such that the sum of elements at lower indexes is equal to the sum of elements at higher indexes.\nGiven an array, your task is to find the index of first Equilibrium point in the array.\n\nInput Format:\nThe firs...
Protected vs Private Access Modifiers in Java - GeeksforGeeks
28 Apr, 2021 Access modifiers are those elements in code that determine the scope for that variable. As we know there are three access modifiers available namely public, protected, and private. Let us see the differences between Protected and Private access modifiers. Access Modifier 1: Protected The methods or varia...
[ { "code": null, "e": 24932, "s": 24901, "text": " \n28 Apr, 2021\n" }, { "code": null, "e": 25189, "s": 24932, "text": "Access modifiers are those elements in code that determine the scope for that variable. As we know there are three access modifiers available namely public, pro...
Python Pillow - Creating a Watermark
You have noticed that, some of the online photos are watermarked. Watermark is definitely one of the better ways to protect your images from misuse. Also, it is recommended to add watermark to your creative photos, before sharing them on social media to prevent it from being misused. Watermark is generally some text or...
[ { "code": null, "e": 2485, "s": 2200, "text": "You have noticed that, some of the online photos are watermarked. Watermark is definitely one of the better ways to protect your images from misuse. Also, it is recommended to add watermark to your creative photos, before sharing them on social media to...
Getting Minimum and Maximum Value in MySQL
We need to use the MAX(columnName) to find the Maximum value in a column, whereas use the MIN(columnName) to find the Maximum value in a column. Let’s say following is the syntax to find the highest and lowest value in a specific column − mysql> SELECT @min_val:=MIN(columnName),@max_val:=MAX(columnName) FROM tableName;...
[ { "code": null, "e": 1207, "s": 1062, "text": "We need to use the MAX(columnName) to find the Maximum value in a column, whereas use the MIN(columnName) to find the Maximum value in a column." }, { "code": null, "e": 1301, "s": 1207, "text": "Let’s say following is the syntax to ...
Unit Testing for Data Scientists. Using Pytest to improve the stability... | by Maarten Grootendorst | Towards Data Science
As Data Science becomes more of a staple in large organizations, the need for proper testing of code slowly becomes more integrated into the skillset of a Data Scientist. Imagine you have been creating a pipeline for predicting customer churn in your organization. A few months after deploying your solution, there are n...
[ { "code": null, "e": 343, "s": 172, "text": "As Data Science becomes more of a staple in large organizations, the need for proper testing of code slowly becomes more integrated into the skillset of a Data Scientist." }, { "code": null, "e": 541, "s": 343, "text": "Imagine you hav...
boost::split in C++ library - GeeksforGeeks
14 Dec, 2021 This function is similar to strtok in C. Input sequence is split into tokens, separated by separators. Separators are given by means of the predicate.Syntax: Template: split(Result, Input, Predicate Pred); Parameters: Input: A container which will be searched. Pred: A predicate to identify separators. T...
[ { "code": null, "e": 24334, "s": 24306, "text": "\n14 Dec, 2021" }, { "code": null, "e": 24493, "s": 24334, "text": "This function is similar to strtok in C. Input sequence is split into tokens, separated by separators. Separators are given by means of the predicate.Syntax: " }...
Queries for elements greater than K in the given index range using Segment Tree - GeeksforGeeks
30 Nov, 2021 Given an array arr[] of N elements and a number of queries where each query will contain three integers L, R, and K. For each query, the task is to find the number of elements in the subarray arr[L...R] which are greater than K. Examples: Input: arr[] = {7, 3, 9, 13, 5, 4}, q[] = {{0, 3, 6}, {1, 5, 8}} Ou...
[ { "code": null, "e": 24403, "s": 24375, "text": "\n30 Nov, 2021" }, { "code": null, "e": 24632, "s": 24403, "text": "Given an array arr[] of N elements and a number of queries where each query will contain three integers L, R, and K. For each query, the task is to find the number...
Check whether an array can be made strictly increasing by incrementing and decrementing adjacent pairs - GeeksforGeeks
16 Dec, 2021 Given an array arr[] of size N consisting of non-negative integers. In one move ith index element of the array is decreased by 1 and (i+1)th index is increased by 1. The task is to check if there is any possibility to make the given array strictly increasing (containing non-negative integers only) by makin...
[ { "code": null, "e": 24405, "s": 24377, "text": "\n16 Dec, 2021" }, { "code": null, "e": 24735, "s": 24405, "text": "Given an array arr[] of size N consisting of non-negative integers. In one move ith index element of the array is decreased by 1 and (i+1)th index is increased by ...
Daily life Linux Commands - GeeksforGeeks
06 Aug, 2020 Clear the Terminal : In our daily life, we use to work on Terminal if we are using LINUX. Continuous working on terminal makes the terminal screen full of commands and for removing them and making our screen totally free of character, we often use clear command. Key combination ‘Ctrl+l‘ has the same effect...
[ { "code": null, "e": 24654, "s": 24626, "text": "\n06 Aug, 2020" }, { "code": null, "e": 30585, "s": 24654, "text": "Clear the Terminal : In our daily life, we use to work on Terminal if we are using LINUX. Continuous working on terminal makes the terminal screen full of commands...
Mockito - Resetting Mock
Mockito provides the capability to a reset a mock so that it can be reused later. Take a look at the following code snippet. //reset mock reset(calcService); Here we've reset mock object. MathApplication makes use of calcService and after reset the mock, using mocked method will fail the test. Step 1 − Create an inter...
[ { "code": null, "e": 2105, "s": 1980, "text": "Mockito provides the capability to a reset a mock so that it can be reused later. Take a look at the following code snippet." }, { "code": null, "e": 2139, "s": 2105, "text": "//reset mock\nreset(calcService);\n" }, { "code":...
An Implementation of DBSCAN on PySpark | by Salil Jain | Towards Data Science
DBSCAN is a well-known clustering algorithm that has stood the test of time. Though the algorithm is not included in Spark MLLib. There are a few implementations (1, 2, 3) though they are in scala. Implementation in PySpark uses the cartesian product of rdd to itself which results in O(n2) complexity and possibly O(n2)...
[ { "code": null, "e": 519, "s": 172, "text": "DBSCAN is a well-known clustering algorithm that has stood the test of time. Though the algorithm is not included in Spark MLLib. There are a few implementations (1, 2, 3) though they are in scala. Implementation in PySpark uses the cartesian product of r...
Getting started with Apache Cassandra and Python | by Adnan Siddiqi | Towards Data Science
In this post, I am going to talk about Apache Cassandra, its purpose, usage, configuration, and setting up a cluster and in the end, how can you access it in your Python applications. At the end of this post, you should have a basic understanding of Cassandra and how you can use in your Python apps. According to Wikipe...
[ { "code": null, "e": 473, "s": 172, "text": "In this post, I am going to talk about Apache Cassandra, its purpose, usage, configuration, and setting up a cluster and in the end, how can you access it in your Python applications. At the end of this post, you should have a basic understanding of Cassa...
Which is faster, Python threads or processes? Some insightful examples | by James Fulton | Towards Data Science
If you are reading this, you have likely been trying to work out what the difference is between threads and processes in Python, and when you should use each. In order to explain some of the key differences, I’m going to show some example functions, and analyse how long they take to run using both threads and processes...
[ { "code": null, "e": 464, "s": 46, "text": "If you are reading this, you have likely been trying to work out what the difference is between threads and processes in Python, and when you should use each. In order to explain some of the key differences, I’m going to show some example functions, and an...
Java lang.Long.toBinaryString() method with Examples - GeeksforGeeks
05 Dec, 2018 The java.lang.Long.toBinaryString() method returns a string representation of the long argument as an unsigned integer in base 2. It accepts an argument in Long data-type and returns the corresponding binary string. Syntax: public static String toBinaryString(long num) Parameters : The function accepts a ...
[ { "code": null, "e": 24015, "s": 23987, "text": "\n05 Dec, 2018" }, { "code": null, "e": 24231, "s": 24015, "text": "The java.lang.Long.toBinaryString() method returns a string representation of the long argument as an unsigned integer in base 2. It accepts an argument in Long da...
Powershell - Measure-Command Cmdlet
Measure-Command cmdlet is used to meaure the time taken by script or command. In these example, we're see the Measure-Command cmdlet in action. In this example, we'll show how to measure time of Get-EventLog command to log an event in PowerShell event log. Measure-Command { Get-EventLog "Windows PowerShell" } Days ...
[ { "code": null, "e": 2112, "s": 2034, "text": "Measure-Command cmdlet is used to meaure the time taken by script or command." }, { "code": null, "e": 2178, "s": 2112, "text": "In these example, we're see the Measure-Command cmdlet in action." }, { "code": null, "e": 2...
What is the difference between functions and methods in JavaScript?
Functions and methods are the same in JavaScript, but a method is a function, which is a property of an object. The following is an example of a function in JavaScript − function functionname(param1, param2){ // code } The method is a function associated with an object. The following is an example of a method in Jav...
[ { "code": null, "e": 1174, "s": 1062, "text": "Functions and methods are the same in JavaScript, but a method is a function, which is a property of an object." }, { "code": null, "e": 1232, "s": 1174, "text": "The following is an example of a function in JavaScript −" }, { ...
HTTP Requests with axios in ReactJS
In this article, we are going to learn how to send and receive Http Responses with axios in a React application. Automatic conversion of response to JSON format Automatic conversion of response to JSON format Easy to use and more secure Easy to use and more secure Setting up global HTTP interceptors Setting up global H...
[ { "code": null, "e": 1175, "s": 1062, "text": "In this article, we are going to learn how to send and receive Http Responses with axios in a React application." }, { "code": null, "e": 1223, "s": 1175, "text": "Automatic conversion of response to JSON format" }, { "code":...
Python - Test if list is Palindrome - GeeksforGeeks
11 Oct, 2020 Given a List, check if its palindrome. Input : test_list = [4, 5, 4] Output : True Explanation : List is same from front and rear. Input : test_list = [4, 5, 5] Output : True Explanation : List is not same from front and rear. Method #1: Using list slicing In this, we extract first and reversed 2nd half ...
[ { "code": null, "e": 25647, "s": 25619, "text": "\n11 Oct, 2020" }, { "code": null, "e": 25687, "s": 25647, "text": "Given a List, check if its palindrome. " }, { "code": null, "e": 25779, "s": 25687, "text": "Input : test_list = [4, 5, 4] Output : True Explan...
Find keys with duplicate values in dictionary in Python
While dealing with dictionaries, we may come across situation when there are duplicate values in the dictionary while obviously the keys remain unique. In this article we will see how we can achieve thi. We exchange the keys with values of the dictionaries and then keep appending the values associated with a given key....
[ { "code": null, "e": 1266, "s": 1062, "text": "While dealing with dictionaries, we may come across situation when there are duplicate values in the dictionary while obviously the keys remain unique. In this article we will see how we can achieve thi." }, { "code": null, "e": 1478, "s...
Calculate height of Binary Tree using Inorder and Level Order Traversal - GeeksforGeeks
22 Jun, 2021 Given inorder traversal and Level Order traversal of a Binary Tree. The task is to calculate the height of the tree without constructing it. Example: Input : Input: Two arrays that represent Inorder and level order traversals of a Binary Tree in[] = {4, 8, 10, 12, 14, 20, 22}; ...
[ { "code": null, "e": 26687, "s": 26659, "text": "\n22 Jun, 2021" }, { "code": null, "e": 26829, "s": 26687, "text": "Given inorder traversal and Level Order traversal of a Binary Tree. The task is to calculate the height of the tree without constructing it. " }, { "code":...
Mastering Pandas Groupby. Understanding the Groupby Method | by Sadrach Pierre, Ph.D. | Towards Data Science
Pandas is a python library that provides tools for data transformation and statistical analysis. The ‘groupby’ method in pandas allows us to group large amounts of data and perform operations on these groups. In this post, we will discuss how to use the ‘groupby’ method in Pandas. For our purposes we will be using the ...
[ { "code": null, "e": 547, "s": 171, "text": "Pandas is a python library that provides tools for data transformation and statistical analysis. The ‘groupby’ method in pandas allows us to group large amounts of data and perform operations on these groups. In this post, we will discuss how to use the ‘...
Puzzle 17 | (Ratio of Boys and Girls in a Country where people want only boys)
11 May, 2021 In a country, all families want a boy. They keep having babies till a boy is born. What is the expected ratio of boys and girls in the country? Solution:Assumptions: Probability of having a boy or girl is same. Also, the probability of next kid being a boy doesn’t depend on history. The problem can be ...
[ { "code": null, "e": 54, "s": 26, "text": "\n11 May, 2021" }, { "code": null, "e": 198, "s": 54, "text": "In a country, all families want a boy. They keep having babies till a boy is born. What is the expected ratio of boys and girls in the country?" }, { "code": null, ...
Efficient ways to compare a variable with multiple values
16 Jul, 2021 In this article, we will discuss the ways to compare a variable with values. Method 1: The idea is to compare each variable individually to all the multiple values at a time. Program 1: C++ Java Python3 C# Javascript // C++ program to compare one variable// with multiple variable#include <iostream>using na...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Jul, 2021" }, { "code": null, "e": 105, "s": 28, "text": "In this article, we will discuss the ways to compare a variable with values." }, { "code": null, "e": 203, "s": 105, "text": "Method 1: The idea is to comp...
How to implement user defined Shared Pointers in C++
28 Oct, 2020 Shared Pointers : A std::shared_ptr is a container for raw pointers. It is a reference counting ownership model i.e. it maintains the reference count of its contained pointer in cooperation with all copies of the std::shared_ptr. So, the counter is incremented each time a new pointer points to the resource...
[ { "code": null, "e": 52, "s": 24, "text": "\n28 Oct, 2020" }, { "code": null, "e": 1009, "s": 52, "text": "Shared Pointers : A std::shared_ptr is a container for raw pointers. It is a reference counting ownership model i.e. it maintains the reference count of its contained pointe...
Python | sympy.expand() method
12 Jun, 2019 With the help of sympy.expand() method, we can expand the mathematical expressions in the form of variables by using sympy.expand() method. Syntax : sympy.expand(expression)Return : Return mathematical expression. Example #1 :In this example we can see that by using sympy.expand() method, we can get the ma...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Jun, 2019" }, { "code": null, "e": 168, "s": 28, "text": "With the help of sympy.expand() method, we can expand the mathematical expressions in the form of variables by using sympy.expand() method." }, { "code": null, "e"...
vector::empty() and vector::size() in C++ STL
09 Jun, 2022 Vectors are the same as dynamic arrays with the ability to resize themselves automatically when an element is inserted or deleted, with their storage being handled automatically by the container. The empty() function is used to check if the vector container is empty or not.Syntax : vectorname.empty() Par...
[ { "code": null, "e": 52, "s": 24, "text": "\n09 Jun, 2022" }, { "code": null, "e": 249, "s": 52, "text": "Vectors are the same as dynamic arrays with the ability to resize themselves automatically when an element is inserted or deleted, with their storage being handled automatica...
Make all strings from a given array equal by replacing minimum number of characters
08 Jun, 2021 Given an array of equal-length strings arr[], the task is to make all the strings of the array equal by replacing any character of a string with any other character, minimum number of times. Examples: Input: arr[] = { “west”, “east”, “wait” } Output: 3 Explanation: Replacing arr[0][1] with ‘a’ modifies arr...
[ { "code": null, "e": 54, "s": 26, "text": "\n08 Jun, 2021" }, { "code": null, "e": 245, "s": 54, "text": "Given an array of equal-length strings arr[], the task is to make all the strings of the array equal by replacing any character of a string with any other character, minimum ...
How to join on multiple columns in Pyspark?
19 Dec, 2021 In this article, we will discuss how to join multiple columns in PySpark Dataframe using Python. Let’s create the first dataframe: Python3 # importing moduleimport pyspark # importing sparksession from pyspark.sql modulefrom pyspark.sql import SparkSession # creating sparksession and giving an app namesp...
[ { "code": null, "e": 28, "s": 0, "text": "\n19 Dec, 2021" }, { "code": null, "e": 125, "s": 28, "text": "In this article, we will discuss how to join multiple columns in PySpark Dataframe using Python." }, { "code": null, "e": 159, "s": 125, "text": "Let’s cre...
Range Slider using Material UI in React
11 Feb, 2021 Material-UI is a React-based module. The Material-UI library provides users with the most efficient, effective, and user-friendly interface. For using the Range slider we need to install Material-UI. Moreover, for the custom styling, you can always refer to the API of the SVG icon component in Material-UI....
[ { "code": null, "e": 28, "s": 0, "text": "\n11 Feb, 2021" }, { "code": null, "e": 336, "s": 28, "text": "Material-UI is a React-based module. The Material-UI library provides users with the most efficient, effective, and user-friendly interface. For using the Range slider we need...
How to Use Material Contextual ActionBar Library in Android App?
14 Sep, 2021 Let us first understand the two types of app bars in an android app: The Regular AppBar The Contextual AppBar The Regular AppBar is just a normalized app bar that appears on the top of a page and can be well customized according to the user’s requirements. It can be used to display page topics/company name...
[ { "code": null, "e": 54, "s": 26, "text": "\n14 Sep, 2021" }, { "code": null, "e": 123, "s": 54, "text": "Let us first understand the two types of app bars in an android app:" }, { "code": null, "e": 142, "s": 123, "text": "The Regular AppBar" }, { "co...
Save and Load RData Workspace Files in R
16 Dec, 2021 In this article, we will discuss how to save and load R data workspace files in R programming language. The save.image method in R is used to save the current workspace files. It is an extended version of the save method in R which is used to create a list of all the declared data objects and save them int...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Dec, 2021" }, { "code": null, "e": 132, "s": 28, "text": "In this article, we will discuss how to save and load R data workspace files in R programming language." }, { "code": null, "e": 455, "s": 132, "text": "Th...
Python | Sort Tuples in Increasing Order by any key
18 Dec, 2017 Given a tuple, sort the list of tuples in increasing order by any key in tuple. Examples: Input : tuple = [(2, 5), (1, 2), (4, 4), (2, 3)] m = 0 Output : [(1, 2), (2, 3), (2, 5), (4, 4)] Explanation: Sorted using the 0th index key. Input : [(23, 45, 20), (25, 44, 39), (89, 40, 23)] ...
[ { "code": null, "e": 52, "s": 24, "text": "\n18 Dec, 2017" }, { "code": null, "e": 132, "s": 52, "text": "Given a tuple, sort the list of tuples in increasing order by any key in tuple." }, { "code": null, "e": 142, "s": 132, "text": "Examples:" }, { "...
Minimum Cost Polygon Triangulation
29 Jun, 2022 A triangulation of a convex polygon is formed by drawing diagonals between non-adjacent vertices (corners) such that the diagonals never intersect. The problem is to find the cost of triangulation with the minimum cost. The cost of a triangulation is sum of the weights of its component triangles. Weight of...
[ { "code": null, "e": 52, "s": 24, "text": "\n29 Jun, 2022" }, { "code": null, "e": 468, "s": 52, "text": "A triangulation of a convex polygon is formed by drawing diagonals between non-adjacent vertices (corners) such that the diagonals never intersect. The problem is to find the...
PostgreSQL – REVOKE
17 Aug, 2021 In PostgreSQL, the REVOKE statement is used to revoke previously granted privileges on database objects through a role. The following shows the syntax of the REVOKE statement: Syntax: REVOKE privilege | ALL ON TABLE tbl_name | ALL TABLES IN SCHEMA schema_name FROM role_name; Let’s analyze the above synta...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Aug, 2021" }, { "code": null, "e": 148, "s": 28, "text": "In PostgreSQL, the REVOKE statement is used to revoke previously granted privileges on database objects through a role." }, { "code": null, "e": 204, "s": 148,...
Print the content of a div element using JavaScript
26 Jul, 2021 To print the content of div in JavaScript, first store the content of div in a JavaScript variable and then the print button is clicked. The contents of the HTML div element to be extracted. Then a JavaScript popup window is created and the extracted contents of the HTML div elements are written to the pop...
[ { "code": null, "e": 53, "s": 25, "text": "\n26 Jul, 2021" }, { "code": null, "e": 447, "s": 53, "text": "To print the content of div in JavaScript, first store the content of div in a JavaScript variable and then the print button is clicked. The contents of the HTML div element ...
PostgreSQL – IF Statement
22 Feb, 2022 PostgreSQL has an IF statement executes `statements` if a condition is true. If the condition evaluates to false, the control is passed to the next statement after the END IF part. Syntax: IF condition THEN statements; END IF; The above conditional statement is a boolean expression that evaluates to ei...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Feb, 2022" }, { "code": null, "e": 209, "s": 28, "text": "PostgreSQL has an IF statement executes `statements` if a condition is true. If the condition evaluates to false, the control is passed to the next statement after the END IF ...
Google Cloud Platform – Introduction to BigQuery Sandbox
23 Apr, 2021 BigQuery sandbox gives you free access to try out BigQuery and use the UI without providing a credit card or using a billing account. It’s a quick way to get started and try out some BigQuery concepts. To get started, click on this link and follow along with the rest of the article. If you’re a new Google...
[ { "code": null, "e": 28, "s": 0, "text": "\n23 Apr, 2021" }, { "code": null, "e": 231, "s": 28, "text": "BigQuery sandbox gives you free access to try out BigQuery and use the UI without providing a credit card or using a billing account. It’s a quick way to get started and try o...
HTML Basics
22 Jun, 2022 In this article, we will see the HTML Basics by understanding all the basic stuff of HTML coding. There are various tags that we must consider and include while starting to code in HTML. These tags help in the organization and basic formatting of elements in our script or web pages. These step-by-step proc...
[ { "code": null, "e": 53, "s": 25, "text": "\n22 Jun, 2022" }, { "code": null, "e": 419, "s": 53, "text": "In this article, we will see the HTML Basics by understanding all the basic stuff of HTML coding. There are various tags that we must consider and include while starting to c...
Python | Ways to create triplets from given list
18 Feb, 2019 Given a list of words, write a Python program to create triplets from the given list. Examples : Input: [‘Geeks’, ‘for’, ‘Geeks’, ‘is’, ‘best’, ‘resource’, ‘for’, ‘study’]Output:[[‘Geeks’, ‘for’, ‘Geeks’], [‘for’, ‘Geeks’, ‘is’],[‘Geeks’, ‘is’, ‘best’], [‘is’, ‘best’, ‘resource’],[‘best’, ‘resource’, ‘for’...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Feb, 2019" }, { "code": null, "e": 114, "s": 28, "text": "Given a list of words, write a Python program to create triplets from the given list." }, { "code": null, "e": 125, "s": 114, "text": "Examples :" }, {...
Web Workers in Javascript
04 Jun, 2019 Web workers are giving us the possibility to write multi-threaded Javascript, which does not block the DOM. Even the Asynchronous operations block the DOM to some extent. On the other side, web workers help us solve this problem, escaping the single-threaded environment and reaching a higher performance of...
[ { "code": null, "e": 28, "s": 0, "text": "\n04 Jun, 2019" }, { "code": null, "e": 351, "s": 28, "text": "Web workers are giving us the possibility to write multi-threaded Javascript, which does not block the DOM. Even the Asynchronous operations block the DOM to some extent. On t...
Find the number of islands | Set 1 (Using DFS)
20 Jun, 2022 Given a boolean 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains 5 islands Example: Input : mat[][] = {{1, 1, 0, 0, 0}, {0, 1, 0, 0, 1}, {1, 0, 0, 1, 1}, {0, 0, 0, 0, 0}, ...
[ { "code": null, "e": 54, "s": 26, "text": "\n20 Jun, 2022" }, { "code": null, "e": 199, "s": 54, "text": "Given a boolean 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains 5 islands" }, { "code": null, ...
Build a bidirectional text generator with XLNet | by Rostyslav Neskorozhenyi | Towards Data Science
Current Transformers based models, like GPT-2 or even GPT-3 show incredible achievements in the task of text-generation (prediction of the next probable word based on the previous sequence of words). These models can create long, creative and cohesive texts, but usually they can generate text only in one direction, fro...
[ { "code": null, "e": 847, "s": 172, "text": "Current Transformers based models, like GPT-2 or even GPT-3 show incredible achievements in the task of text-generation (prediction of the next probable word based on the previous sequence of words). These models can create long, creative and cohesive tex...