title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Automating Analytics in Tableau — Python & Tabcmd | by Eshwaran Venkat | Towards Data Science | Tableau has been recognized as a leading tool in Analytics and Business Intelligence Platforms for seven consecutive years by Gartner. BI/Data teams in companies of all shapes and sizes in nearly every industrial sector develop dashboards to effectively communicate key business metrics across the organization.
One majo... | [
{
"code": null,
"e": 484,
"s": 172,
"text": "Tableau has been recognized as a leading tool in Analytics and Business Intelligence Platforms for seven consecutive years by Gartner. BI/Data teams in companies of all shapes and sizes in nearly every industrial sector develop dashboards to effectively c... |
BeautifulSoup - Scraping Paragraphs from HTML - GeeksforGeeks | 24 Jan, 2021
In this article, we will discuss how to scrap paragraphs from HTML using Beautiful Soup
Method 1: using bs4 and urllib.
Module Needed:
bs4: Beautiful Soup(bs4) is a Python library for pulling data out of HTML and XML files. For installing the module-
pip install bs4.
urllib: urllib is a package that collec... | [
{
"code": null,
"e": 25671,
"s": 25643,
"text": "\n24 Jan, 2021"
},
{
"code": null,
"e": 25759,
"s": 25671,
"text": "In this article, we will discuss how to scrap paragraphs from HTML using Beautiful Soup"
},
{
"code": null,
"e": 25791,
"s": 25759,
"text": "Me... |
Java Program to convert an integer into binary | To convert an integer to binary, use the Integer.toBinaryString() method in Java.
Let’s say the following is the integer we want to convert.
int val = 999;
Converting the above integer to binary.
Integer.toBinaryString(val)
Live Demo
public class Demo {
public static void main(String[] args) {
int val = 999... | [
{
"code": null,
"e": 1144,
"s": 1062,
"text": "To convert an integer to binary, use the Integer.toBinaryString() method in Java."
},
{
"code": null,
"e": 1203,
"s": 1144,
"text": "Let’s say the following is the integer we want to convert."
},
{
"code": null,
"e": 1218... |
Case-insensitive string comparison in C++ | In C++ we have strings in standard library. In this program we will see how to check whether two strings are identical or not. In this case we will ignore the case.
Here the logic is simple. We will convert the whole string into lowercase or uppercase strings, then compare them, and return the result.
We have used the ... | [
{
"code": null,
"e": 1227,
"s": 1062,
"text": "In C++ we have strings in standard library. In this program we will see how to check whether two strings are identical or not. In this case we will ignore the case."
},
{
"code": null,
"e": 1365,
"s": 1227,
"text": "Here the logic is... |
Given a linked list of 0s, 1s and 2s, sort it. | Practice | GeeksforGeeks | Given a linked list of N nodes where nodes can contain values 0s, 1s, and 2s only. The task is to segregate 0s, 1s, and 2s linked list such that all zeros segregate to head side, 2s at the end of the linked list, and 1s in the mid of 0s and 2s.
Example 1:
Input:
N = 8
value[] = {1,2,2,1,2,0,2,2}
Output: 0 1 1 2 2 2 2 2... | [
{
"code": null,
"e": 483,
"s": 238,
"text": "Given a linked list of N nodes where nodes can contain values 0s, 1s, and 2s only. The task is to segregate 0s, 1s, and 2s linked list such that all zeros segregate to head side, 2s at the end of the linked list, and 1s in the mid of 0s and 2s."
},
{
... |
Check if string begins with punctuation in JavaScript | Let’s say we have the following strings. One of them is beginning with a question mark i.e.
punctuation −
var sentence1 = 'My Name is John Smith.'
var sentence2 = '? My Name is John Smith.'
We need to check whether any of the above two sentences begin with punctuation. To check if
string begins with punctuation, the co... | [
{
"code": null,
"e": 1168,
"s": 1062,
"text": "Let’s say we have the following strings. One of them is beginning with a question mark i.e.\npunctuation −"
},
{
"code": null,
"e": 1252,
"s": 1168,
"text": "var sentence1 = 'My Name is John Smith.'\nvar sentence2 = '? My Name is Joh... |
A Python Beginner’s Look at .loc. As a Python beginner, using .loc to... | by Joseph H | Towards Data Science | As a Python beginner, using .loc to retrieve and update values in a pandas dataframe just wasn’t clicking for me. In an earlier post, I shared what I’d learned about retrieving data with .loc. Today, we’ll talk about setting values.
As a refresher, here are the first 10 rows of the Pokémon data we’re working with:
Set... | [
{
"code": null,
"e": 404,
"s": 171,
"text": "As a Python beginner, using .loc to retrieve and update values in a pandas dataframe just wasn’t clicking for me. In an earlier post, I shared what I’d learned about retrieving data with .loc. Today, we’ll talk about setting values."
},
{
"code": ... |
Bootstrap - Scrollspy Plugin | The Scroll spy (auto updating nav) plugin allows you to target sections of the page based on the scroll position. In its basic implementation, as you scroll, you can add .active classes to the navbar based on the scroll position.
You can add scrollspy behavior to your topbar navigation −
Via data attributes − add data-... | [
{
"code": null,
"e": 3561,
"s": 3331,
"text": "The Scroll spy (auto updating nav) plugin allows you to target sections of the page based on the scroll position. In its basic implementation, as you scroll, you can add .active classes to the navbar based on the scroll position."
},
{
"code": n... |
Analyzing Anime data in R. If you are a fan of Anime then you are... | by Hamza Rafiq | Towards Data Science | If you are a fan of Anime then you are going to love this analysis I did in R. This data comes from the MyAnimeList website and was sourced as part of the Tidy Tuesday initiative by the R for Data Science community. You can download a tidy version of this data from here. They post interesting datasets every week and th... | [
{
"code": null,
"e": 809,
"s": 172,
"text": "If you are a fan of Anime then you are going to love this analysis I did in R. This data comes from the MyAnimeList website and was sourced as part of the Tidy Tuesday initiative by the R for Data Science community. You can download a tidy version of this... |
How to get the absolute value of a number in JavaScript? | To get the absolute value of a number in JavaScript, use the Math.abs() function. It returns the absolute value. The following is the parameter supported by the abs() method −
x − A number
You can try to run the following code to learn how to get the absolute value of a number −
Live Demo
<html>
<head>
<title>... | [
{
"code": null,
"e": 1238,
"s": 1062,
"text": "To get the absolute value of a number in JavaScript, use the Math.abs() function. It returns the absolute value. The following is the parameter supported by the abs() method −"
},
{
"code": null,
"e": 1251,
"s": 1238,
"text": "x − A ... |
Switch case in R | 21 Apr, 2020
Switch case statements are a substitute for long if statements that compare a variable to several integral values. Switch case in R is a multiway branch statement. It allows a variable to be tested for equality against a list of values.
Switch statement follows the approach of mapping and searching over a ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Apr, 2020"
},
{
"code": null,
"e": 265,
"s": 28,
"text": "Switch case statements are a substitute for long if statements that compare a variable to several integral values. Switch case in R is a multiway branch statement. It allows a... |
How to Make a Time Series Plot with Rolling Average in Python? | 02 Dec, 2020
Time Series Plot is used to observe various trends in the dataset over a period of time. In such problems, the data is ordered by time and can fluctuate by the unit of time considered in the dataset (day, month, seconds, hours, etc.). When plotting the time series data, these fluctuations may prevent us to... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Dec, 2020"
},
{
"code": null,
"e": 504,
"s": 28,
"text": "Time Series Plot is used to observe various trends in the dataset over a period of time. In such problems, the data is ordered by time and can fluctuate by the unit of time co... |
SQL Query to Return Rows Matching a Certain Condition | 14 Nov, 2021
In SQL, sometimes we need to select matching a certain condition from the table. We will use the SELECT command along with the WHERE clause to apply a condition to achieve this in SQL. For this article. We will be using the Microsoft SQL Server as our database.
Syntax:
SELECT COLUMN_NAME_1, COLUMN_NAME_2, ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 Nov, 2021"
},
{
"code": null,
"e": 316,
"s": 54,
"text": "In SQL, sometimes we need to select matching a certain condition from the table. We will use the SELECT command along with the WHERE clause to apply a condition to achieve th... |
Page Table Entries in Page Table | 16 Aug, 2019
Prerequisite – Paging
Page table has page table entries where each page table entry stores a frame number and optional status (like protection) bits. Many of status bits used in the virtual memory system. The most important thing in PTE is frame Number.
Page table entry has the following information –
Fram... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n16 Aug, 2019"
},
{
"code": null,
"e": 76,
"s": 54,
"text": "Prerequisite – Paging"
},
{
"code": null,
"e": 308,
"s": 76,
"text": "Page table has page table entries where each page table entry stores a frame number a... |
Vector contains() Method in Java | 17 Aug, 2018
The java.util.vector.contains() method is used to check whether a specific element is present in the Vector or not. So basically it is used to check if a vector contains any particular element or not.
Syntax:
Vector.contains(Object element)
Parameters: This method takes a mandatory parameter element which ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Aug, 2018"
},
{
"code": null,
"e": 229,
"s": 28,
"text": "The java.util.vector.contains() method is used to check whether a specific element is present in the Vector or not. So basically it is used to check if a vector contains any p... |
rect element method – Selenium Python | 30 Apr, 2020
Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium WebDriver. To open a webpage using Selenium Python, checkout – Navigating links using get method – Selenium Python. Just being able ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Apr, 2020"
},
{
"code": null,
"e": 585,
"s": 28,
"text": "Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium ... |
Pattern split(CharSequence) method in Java with Examples | 21 Feb, 2019
split(CharSequence) method of a Pattern class used to splits the given char sequence passed as parameter to method around matches of this pattern.This method can split charSequence into an array of String’s, using the regular expression used to compile the pattern as a delimiter.so we can say that the meth... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Feb, 2019"
},
{
"code": null,
"e": 431,
"s": 28,
"text": "split(CharSequence) method of a Pattern class used to splits the given char sequence passed as parameter to method around matches of this pattern.This method can split charSeq... |
Print all pairs in an unsorted array with equal sum | 30 Jun, 2022
Given an unsorted array A[]. The task is to print all unique pairs in the unsorted array with equal sum.Note: Print the result in the format as shown in the below examples. Examples:
Input: A[] = { 6, 4, 12, 10, 22, 54, 32, 42, 21, 11}
Output:
Pairs : ( 4, 12) ( 6, 10) have sum : 16
Pairs : ( 10, 22) ( ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n30 Jun, 2022"
},
{
"code": null,
"e": 239,
"s": 54,
"text": "Given an unsorted array A[]. The task is to print all unique pairs in the unsorted array with equal sum.Note: Print the result in the format as shown in the below examples. E... |
Rotate in C++ STL | 05 Jun, 2022
The function is defined in header <algorithm>. It rotates the order of the elements in the range [first, last], in such a way that the element pointed by the middle becomes the new first element. Function Template :
void rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last) first, las... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 Jun, 2022"
},
{
"code": null,
"e": 270,
"s": 54,
"text": "The function is defined in header <algorithm>. It rotates the order of the elements in the range [first, last], in such a way that the element pointed by the middle becomes t... |
Scala List filter() method with example | 26 Jul, 2019
The filter() method is utilized to select all elements of the list which satisfies a stated predicate.
Method Definition: def filter(p: (A) => Boolean): List[A]
Return Type: It returns a new list consisting all the elements of the list which satisfies the given predicate.
Example #1:
// Scala program of fi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Jul, 2019"
},
{
"code": null,
"e": 131,
"s": 28,
"text": "The filter() method is utilized to select all elements of the list which satisfies a stated predicate."
},
{
"code": null,
"e": 189,
"s": 131,
"text": "Met... |
Machine Independent Code optimization in Compiler Design | 16 Sep, 2021
Machine Independent code optimization tries to make the intermediate code more efficient by transforming a section of code that doesn’t involve hardware components like CPU registers or any absolute memory location. Generally, it optimizes code by eliminating redundancies, reducing the number of lines in c... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n16 Sep, 2021"
},
{
"code": null,
"e": 507,
"s": 52,
"text": "Machine Independent code optimization tries to make the intermediate code more efficient by transforming a section of code that doesn’t involve hardware components like CPU r... |
Renaming columns in a Pandas DataFrame | by B. Chen | Towards Data Science | In data analysis, we may work on a dataset that has no column names or column names contain some unwanted characters (e.g. space), or maybe we just want to rename columns to have better names. These all require us to rename columns in a Pandas DataFrame.
In this article, you’ll learn 5 different approaches to do that. ... | [
{
"code": null,
"e": 426,
"s": 171,
"text": "In data analysis, we may work on a dataset that has no column names or column names contain some unwanted characters (e.g. space), or maybe we just want to rename columns to have better names. These all require us to rename columns in a Pandas DataFrame."... |
How to create a social media login form with CSS? | Following is the code to create a social media login form using CSS −
Live Demo
<!DOCTYPE html>
<html>
<head>
<title>Responsive login form with social media login buttons</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet"
href="https://cdnjs.c... | [
{
"code": null,
"e": 1132,
"s": 1062,
"text": "Following is the code to create a social media login form using CSS −"
},
{
"code": null,
"e": 1143,
"s": 1132,
"text": " Live Demo"
},
{
"code": null,
"e": 3409,
"s": 1143,
"text": "<!DOCTYPE html>\n<html>\n<head... |
Python - Dictionary Exercises | Now you have learned a lot about dictionaries, and how to use them in Python.
Are you ready for a test?
Try to insert the missing part to make the code work as expected:
Use the get method to print the value of the "model" key of the car dictionary.
car = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
prin... | [
{
"code": null,
"e": 78,
"s": 0,
"text": "Now you have learned a lot about dictionaries, and how to use them in Python."
},
{
"code": null,
"e": 104,
"s": 78,
"text": "Are you ready for a test?"
},
{
"code": null,
"e": 170,
"s": 104,
"text": "Try to insert the... |
Construct BST from its given level order traversal - GeeksforGeeks | 07 Jul, 2021
Construct the BST (Binary Search Tree) from its given level order traversal.Examples:
Input : arr[] = {7, 4, 12, 3, 6, 8, 1, 5, 10}
Output : BST:
7
/ \
4 12
/ \ /
3 6 8
/ / \
1 5 10
The idea is to use the Recursion:- We know t... | [
{
"code": null,
"e": 25246,
"s": 25218,
"text": "\n07 Jul, 2021"
},
{
"code": null,
"e": 25334,
"s": 25246,
"text": "Construct the BST (Binary Search Tree) from its given level order traversal.Examples: "
},
{
"code": null,
"e": 25507,
"s": 25334,
"text": "In... |
Right view of Binary Tree using Queue | 10 Jun, 2022
Given a Binary Tree, print Right view of it. Right view of a Binary Tree is set of nodes visible when tree is visited from Right side. Examples:
Input :
10
/ \
2 3
/ \ / \
7 8 12 15
/
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n10 Jun, 2022"
},
{
"code": null,
"e": 199,
"s": 52,
"text": "Given a Binary Tree, print Right view of it. Right view of a Binary Tree is set of nodes visible when tree is visited from Right side. Examples: "
},
{
"code": null,... |
VBScript Day Function | The Day function returns a number between 1 and 31 that represents the day of the specified date.
Day(date)
<!DOCTYPE html>
<html>
<body>
<script language = "vbscript" type = "text/vbscript">
document.write(Day("2013-06-30"))
</script>
</body>
</html>
When you save it as .html and e... | [
{
"code": null,
"e": 2312,
"s": 2214,
"text": "The Day function returns a number between 1 and 31 that represents the day of the specified date."
},
{
"code": null,
"e": 2324,
"s": 2312,
"text": "Day(date) \n"
},
{
"code": null,
"e": 2503,
"s": 2324,
"text": "... |
getline (string) in C++ | 08 Jul, 2022
The C++ getline() is a standard library function that is used to read a string or a line from an input stream. It is a part of the <string> header. The getline() function extracts characters from the input stream and appends it to the string object until the delimiting character is encountered. While doing... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Jul, 2022"
},
{
"code": null,
"e": 516,
"s": 52,
"text": "The C++ getline() is a standard library function that is used to read a string or a line from an input stream. It is a part of the <string> header. The getline() function ext... |
How to Add Repositories in Linux | 04 Jul, 2022
The installation process of any software in Linux is totally different from Windows. In Linux, the software is installed via repositories. Let us discuss some methods to add repositories to Ubuntu/Debian-based Linux.
The most recommendable method is the command line method, so let’s discuss it.
Use the fol... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Jul, 2022"
},
{
"code": null,
"e": 245,
"s": 28,
"text": "The installation process of any software in Linux is totally different from Windows. In Linux, the software is installed via repositories. Let us discuss some methods to add r... |
numpy.hypot() in Python | 18 Nov, 2020
This mathematical function helps user to calculate hypotenuse for the right angled triangle, given its side and perpendicular. Result is equivalent to Equivalent to sqrt(x1**2 + x2**2), element-wise.Syntax :
numpy.exp2(arr1, arr2[, out]) = ufunc 'hypot') :
Parameters :
arr1, arr2 : [array_like] Legs(side... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Nov, 2020"
},
{
"code": null,
"e": 236,
"s": 28,
"text": "This mathematical function helps user to calculate hypotenuse for the right angled triangle, given its side and perpendicular. Result is equivalent to Equivalent to sqrt(x1**2... |
How to convert JPG to PNG using Node.js ? - GeeksforGeeks | 06 Apr, 2021
JPG and PNG both are widely used image formats. Using these formats allows the user to contain and use digital images. In this article, we will discuss how to convert a given JPG image to a PNG image using Node.js which can then be helpful to use the image in our web application.
Jimp (JavaScript Image Man... | [
{
"code": null,
"e": 26377,
"s": 26349,
"text": "\n06 Apr, 2021"
},
{
"code": null,
"e": 26658,
"s": 26377,
"text": "JPG and PNG both are widely used image formats. Using these formats allows the user to contain and use digital images. In this article, we will discuss how to conv... |
All about Bit Manipulation - GeeksforGeeks | 24 Apr, 2022
Bit Manipulation is a technique used in a variety of problems to get the solution in an optimized way. This technique is very effective from a Competitive Programming point of view. It is all about Bitwise Operators which directly works upon binary numbers or bits of numbers that help the implementation fa... | [
{
"code": null,
"e": 24932,
"s": 24904,
"text": "\n24 Apr, 2022"
},
{
"code": null,
"e": 25290,
"s": 24932,
"text": "Bit Manipulation is a technique used in a variety of problems to get the solution in an optimized way. This technique is very effective from a Competitive Programm... |
Drop rows from Pandas dataframe with missing values or NaN in columns - GeeksforGeeks | 02 Jul, 2020
Pandas provides various data structures and operations for manipulating numerical data and time series. However, there can be cases where some data might be missing. In Pandas missing data is represented by two value:
None: None is a Python singleton object that is often used for missing data in Python cod... | [
{
"code": null,
"e": 25128,
"s": 25100,
"text": "\n02 Jul, 2020"
},
{
"code": null,
"e": 25346,
"s": 25128,
"text": "Pandas provides various data structures and operations for manipulating numerical data and time series. However, there can be cases where some data might be missin... |
How to create an empty and a full NumPy array? - GeeksforGeeks | 01 Oct, 2020
Sometimes there is a need to create an empty and full array simultaneously for a particular question. In this situation, we have two functions named as numpy.empty() and numpy.full() to create an empty and full arrays.
Syntax:
numpy.full(shape, fill_value, dtype = None, order = ‘C’)
numpy.empty(shape, dtyp... | [
{
"code": null,
"e": 26147,
"s": 26119,
"text": "\n01 Oct, 2020"
},
{
"code": null,
"e": 26366,
"s": 26147,
"text": "Sometimes there is a need to create an empty and full array simultaneously for a particular question. In this situation, we have two functions named as numpy.empty... |
How to determine length or size of an Array in Java? | 30 Sep, 2019
There is no size() method available with the array. But there is a length field available in the array that can be used to find the length or size of the array.
array.length: length is a final variable applicable for arrays. With the help of the length variable, we can obtain the size of the array.
Example... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Sep, 2019"
},
{
"code": null,
"e": 213,
"s": 52,
"text": "There is no size() method available with the array. But there is a length field available in the array that can be used to find the length or size of the array."
},
{
... |
Check for integer overflow on multiplication | 25 Jun, 2021
Given two integer a and b, find whether their product (a x b) exceed the signed 64 bit integer or not. If it exceed print Yes else print No. Examples:
Input : a = 100, b = 200
Output : No
Input : a = 10000000000,
b = -10000000000
Output : Yes
Approach :
If either of the number is 0, then it... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n25 Jun, 2021"
},
{
"code": null,
"e": 205,
"s": 52,
"text": "Given two integer a and b, find whether their product (a x b) exceed the signed 64 bit integer or not. If it exceed print Yes else print No. Examples: "
},
{
"code":... |
p5.Camera lookAt() Method | 28 Jul, 2020
The lookAt() method of p5.Camera in p5.js is used to reorient the camera to look at the given position in the world space. The position of the camera does not change during the reorientation.
Syntax:
lookAt( x, y, z )
Parameters: This method accepts three parameters as mentioned above and described below:... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jul, 2020"
},
{
"code": null,
"e": 220,
"s": 28,
"text": "The lookAt() method of p5.Camera in p5.js is used to reorient the camera to look at the given position in the world space. The position of the camera does not change during th... |
How to reverse a Colormap using Matplotlib in Python? | 14 Dec, 2021
Prerequisites: Matplotlib
Matplotlib has many built-in Colormaps. Colormaps are nothing but the dictionary which maps the integer data/numbers into colors. Colormaps are used to differentiate or distinguish the data in a particular plot. The reason to use the colormaps is that it is easier for humans to di... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Dec, 2021"
},
{
"code": null,
"e": 54,
"s": 28,
"text": "Prerequisites: Matplotlib"
},
{
"code": null,
"e": 459,
"s": 54,
"text": "Matplotlib has many built-in Colormaps. Colormaps are nothing but the dictionary w... |
Find N distinct integers with GCD of sequence as 1 and GCD of each pair greater than 1 | 13 Dec, 2021
Given an integer N, the task is to find a sequence of N distinct positive integers such that the Greatest Common Divisor of the sequence is 1 and GCD of all possible pairs of elements is greater than 1.
Input: N = 4Output: 84 60 105 70Explanation: The GCD(84, 60, 105, 70) is 1 and the GCD of all possible p... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Dec, 2021"
},
{
"code": null,
"e": 231,
"s": 28,
"text": "Given an integer N, the task is to find a sequence of N distinct positive integers such that the Greatest Common Divisor of the sequence is 1 and GCD of all possible pairs of ... |
Python – Create a List of Tuples | 28 Jul, 2021
In this article, we will discuss multiple ways by which we can create a list of tuples in Python.
we can create a list of tuples using list and tuples directly.
Syntax:
[(tuple1),(tuple2),(tuple3),..,(tuple n)]
Example: Python code to create list of tuples using list and tuple
Python3
# create tuples with ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jul, 2021"
},
{
"code": null,
"e": 150,
"s": 52,
"text": "In this article, we will discuss multiple ways by which we can create a list of tuples in Python."
},
{
"code": null,
"e": 213,
"s": 150,
"text": "we can ... |
Program to print the arrow pattern | 29 Oct, 2021
Given the value of n, print the arrow pattern.Examples :
Input : n = 5
Output :
*
**
***
****
*****
****
***
**
*
Input : n = 7
Output :
*
**
***
****
*****
******
*******
******
*****
****
***
**
*
Below is the program to p... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Oct, 2021"
},
{
"code": null,
"e": 113,
"s": 54,
"text": "Given the value of n, print the arrow pattern.Examples : "
},
{
"code": null,
"e": 334,
"s": 113,
"text": "Input : n = 5\nOutput : \n\n *\n **\n ***\n... |
Visualizing Bubble Sort using Tkinter in Python | 10 Sep, 2021
In this article, we will use the Python GUI Library Tkinter to visualize the Bubble Sort algorithm.
Tkinter is a very easy to use and beginner-friendly GUI library that can be used to visualize the sorting algorithms.
Here Bubble Sort Algorithm is visualized which works by repeatedly swapping the adjacent... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Sep, 2021"
},
{
"code": null,
"e": 129,
"s": 28,
"text": "In this article, we will use the Python GUI Library Tkinter to visualize the Bubble Sort algorithm. "
},
{
"code": null,
"e": 247,
"s": 129,
"text": "Tkint... |
Data Pre-Processing with Sklearn using Standard and Minmax scaler | 03 Feb, 2022
Data Scaling is a data preprocessing step for numerical features. Many machine learning algorithms like Gradient descent methods, KNN algorithm, linear and logistic regression, etc. require data scaling to produce good results. Various scalers are defined for this purpose. This article concentrates on Stan... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n03 Feb, 2022"
},
{
"code": null,
"e": 518,
"s": 53,
"text": "Data Scaling is a data preprocessing step for numerical features. Many machine learning algorithms like Gradient descent methods, KNN algorithm, linear and logistic regressio... |
INSTR() function in MySQL | 07 Dec, 2020
INSTR() :This function in MySQL is used to return the location of the first occurrence of a substring within a given string.
Syntax :
INSTR(string_1, string_2)
Parameters :This function accepts 2 parameters.
string_1 –The string where searching takes place.
string_2 –The string/sub-string which will be sea... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Dec, 2020"
},
{
"code": null,
"e": 153,
"s": 28,
"text": "INSTR() :This function in MySQL is used to return the location of the first occurrence of a substring within a given string."
},
{
"code": null,
"e": 162,
"s":... |
How to export a DataFrame to Excel File in R ? | 21 Apr, 2021
It is a frequent requirement to save our dataframe for portability after working on it on the auxiliary memory of the computer system using R Programming Language. In this article, we will be using writexl package to export our dataframe to excel(.xlsx). The write_xlsx() function of the writexl package is ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Apr, 2021"
},
{
"code": null,
"e": 382,
"s": 28,
"text": "It is a frequent requirement to save our dataframe for portability after working on it on the auxiliary memory of the computer system using R Programming Language. In this art... |
Python Program to Create a Class and Compute the Area and the Perimeter of the Circle | When it is required to find the area and perimeter of a circle using classes, object oriented method is used. Here, a class is defined, and attributes are defined. Functions are defined within the class that perform certain operations. An instance of the class is created, and the functions are used to find the area and... | [
{
"code": null,
"e": 1533,
"s": 1187,
"text": "When it is required to find the area and perimeter of a circle using classes, object oriented method is used. Here, a class is defined, and attributes are defined. Functions are defined within the class that perform certain operations. An instance of th... |
R – Lists | 27 Oct, 2021
A list in R is a generic object consisting of an ordered collection of objects. Lists are one-dimensional, heterogeneous data structures. The list can be a list of vectors, a list of matrices, a list of characters and a list of functions, and so on.
A list is a vector but with heterogeneous data elements.... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Oct, 2021"
},
{
"code": null,
"e": 279,
"s": 28,
"text": "A list in R is a generic object consisting of an ordered collection of objects. Lists are one-dimensional, heterogeneous data structures. The list can be a list of vectors, a ... |
Python | Test if string contains element from list | 17 Aug, 2021
During web development in Python, we generally come across a problem where we need to test if a particular element from a given list lies as sub-string or not. This kind of problem is also very common in Machine Learning domain. Let’s discuss certain ways in which this can be done. Method #1 : Using list c... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Aug, 2021"
},
{
"code": null,
"e": 574,
"s": 28,
"text": "During web development in Python, we generally come across a problem where we need to test if a particular element from a given list lies as sub-string or not. This kind of pr... |
What is a stub in Node.js ? | 19 Aug, 2020
A small program routine that substitutes for a longer program which is possible to be loaded later or that is remotely located.
Features of stub:
Stubs can be either anonymous.
Stubs can be wrapped into existing functions. When we wrap a stub into the existing function the original function is not called.
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Aug, 2020"
},
{
"code": null,
"e": 156,
"s": 28,
"text": "A small program routine that substitutes for a longer program which is possible to be loaded later or that is remotely located."
},
{
"code": null,
"e": 174,
"... |
What is the lifetime of a static variable in a C++ function? | A static variable is a variable that is declared using the keyword static. The space for the static variable is allocated only one time and this is used for the entirety of the program.
Once this variable is declared, it exists till the program executes. So, the lifetime of a static variable is the lifetime of the prog... | [
{
"code": null,
"e": 1373,
"s": 1187,
"text": "A static variable is a variable that is declared using the keyword static. The space for the static variable is allocated only one time and this is used for the entirety of the program."
},
{
"code": null,
"e": 1512,
"s": 1373,
"text... |
Python - Backtracking | Backtracking is a form of recursion. But it involves choosing only option out of any possibilities. We begin by choosing an option and backtrack from it, if we reach a state where we conclude that this specific option does not give the required solution. We repeat these steps by going across each available option until... | [
{
"code": null,
"e": 2811,
"s": 2461,
"text": "Backtracking is a form of recursion. But it involves choosing only option out of any possibilities. We begin by choosing an option and backtrack from it, if we reach a state where we conclude that this specific option does not give the required solution... |
Node.js Stream writable._write() Method | 11 Oct, 2021
The writable._write() method is an inbuilt application programming interface of Stream module which is used to implement a writable stream. The writable._write() method is affixed with an underscore as it is inside the class that defines it. Moreover, the user program must not call it directly. This method... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Oct, 2021"
},
{
"code": null,
"e": 433,
"s": 28,
"text": "The writable._write() method is an inbuilt application programming interface of Stream module which is used to implement a writable stream. The writable._write() method is aff... |
Python | os.get_exec_path() method | 01 Nov, 2019
OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality.
All functions in os module raise OSError in the case of invalid or inaccessible file nam... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Nov, 2019"
},
{
"code": null,
"e": 247,
"s": 28,
"text": "OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of usin... |
Convert the value of the current DateTime object to UTC in C# | To convert the value of the current DateTime object to Coordinated Universal Time (UTC), the code is as follows −
Live Demo
using System;
public class Demo {
public static void Main() {
DateTime d = new DateTime(2019, 12, 11, 7, 11, 25);
Console.WriteLine("Date = {0}", d);
DateTime res = d.ToUnive... | [
{
"code": null,
"e": 1176,
"s": 1062,
"text": "To convert the value of the current DateTime object to Coordinated Universal Time (UTC), the code is as follows −"
},
{
"code": null,
"e": 1187,
"s": 1176,
"text": " Live Demo"
},
{
"code": null,
"e": 1462,
"s": 1187,... |
Proxy Method – Python Design Patterns | 10 Feb, 2020
The Proxy method is Structural design pattern that allows you to provide the replacement for an another object. Here, we use different classes to represent the functionalities of another class. The most important part is that here we create an object having original object functionality to provide to the o... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Feb, 2020"
},
{
"code": null,
"e": 448,
"s": 28,
"text": "The Proxy method is Structural design pattern that allows you to provide the replacement for an another object. Here, we use different classes to represent the functionalities... |
Parallel Coordinates in Matplotlib | 24 Jan, 2021
In this article, we will learn How to Plot Parallel Coordinates in Matplotlib. So, first discuss some concepts :
Matplotlib may be a tremendous visualization library in Python for 2D plots of arrays. Matplotlib could also be a multi-platform data visualization library built on NumPy arrays and designed to ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Jan, 2021"
},
{
"code": null,
"e": 141,
"s": 28,
"text": "In this article, we will learn How to Plot Parallel Coordinates in Matplotlib. So, first discuss some concepts :"
},
{
"code": null,
"e": 425,
"s": 141,
"t... |
Pattern Searching using a Trie of all Suffixes | 09 May, 2022
Problem Statement: Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[] in txt[]. You may assume that n > m.As discussed in the previous post, we discussed that there are two ways efficiently solve the above problem.1) Prep... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 May, 2022"
},
{
"code": null,
"e": 483,
"s": 52,
"text": "Problem Statement: Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[] in txt[]. You may ... |
Removing Element from the Specified Index in Java ArrayList | 04 Dec, 2020
The remove(int index) method present in java.util.ArrayList class removes the element at the specified position in this list and shifts any subsequent elements to the left (i.e. subtracts one from their indices).
Syntax :
public removed_element remove(int index)
Parameters: The index of the element to be ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Dec, 2020"
},
{
"code": null,
"e": 241,
"s": 28,
"text": "The remove(int index) method present in java.util.ArrayList class removes the element at the specified position in this list and shifts any subsequent elements to the left (i.... |
How to Implement Preferences Settings Screen in Android? | 11 Oct, 2021
In many apps, we have seen the Settings screen which is most common in most of the apps. This settings screen is used to manage the preferences of the users. For creating this settings screen android provides a feature to make a settings preferences screen. In this article, we will take a look at implement... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n11 Oct, 2021"
},
{
"code": null,
"e": 408,
"s": 53,
"text": "In many apps, we have seen the Settings screen which is most common in most of the apps. This settings screen is used to manage the preferences of the users. For creating thi... |
PriorityQueue peek() Method in Java | 10 Dec, 2018
The java.util.PriorityQueue.peek() method in Java is used to retrieve or fetch the first element of the Queue or the element present at the head of the Queue. The element retrieved does not get deleted or removed from the Queue.
Syntax:
Priority_Queue.peek()
Parameters: The method does not take any paramet... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Dec, 2018"
},
{
"code": null,
"e": 257,
"s": 28,
"text": "The java.util.PriorityQueue.peek() method in Java is used to retrieve or fetch the first element of the Queue or the element present at the head of the Queue. The element retr... |
Python – Getting all the Wifi Devices the system has connected | 01 Jun, 2021
In this article we will see how we can all those wifi network on which the system is ever connected to. Wi-Fi is a wireless networking technology that allows devices such as computers (laptops and desktops), mobile devices (smart phones and wearables), and other equipment (printers and video cameras) to in... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Jun, 2021"
},
{
"code": null,
"e": 780,
"s": 28,
"text": "In this article we will see how we can all those wifi network on which the system is ever connected to. Wi-Fi is a wireless networking technology that allows devices such as c... |
Check if the end of the Array can be reached from a given position | 09 Nov, 2021
Given an array arr[] of N positive integers and a number S, the task is to reach the end of the array from index S. We can only move from current index i to index (i + arr[i]) or (i – arr[i]). If there is a way to reach the end of the array then print “Yes” else print “No”.
Examples:
Input: arr[] = {4, 1,... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n09 Nov, 2021"
},
{
"code": null,
"e": 329,
"s": 54,
"text": "Given an array arr[] of N positive integers and a number S, the task is to reach the end of the array from index S. We can only move from current index i to index (i + arr[i]... |
Implement PriorityQueue through Comparator in Java | 19 Jul, 2019
Prerequisite : Priority Queue, ComparatorPriority Queue is like a regular queue, but each element has a “priority” associated with it. In a priority queue, an element with high priority is served before an element with low priority. For this, it uses a comparison function which imposes a total ordering of ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n19 Jul, 2019"
},
{
"code": null,
"e": 375,
"s": 54,
"text": "Prerequisite : Priority Queue, ComparatorPriority Queue is like a regular queue, but each element has a “priority” associated with it. In a priority queue, an element with hi... |
Size of the Largest Trees in a Forest formed by the given Graph | 24 Sep, 2021
Given an undirected acyclic graph having N nodes and M edges, the task is to find the size of the largest tree in the forest formed by the graph.
A forest is a collection of disjoint trees. In other words, we can also say that forest is a collection of an acyclic graph which is not connected.
Examples:
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Sep, 2021"
},
{
"code": null,
"e": 199,
"s": 52,
"text": "Given an undirected acyclic graph having N nodes and M edges, the task is to find the size of the largest tree in the forest formed by the graph. "
},
{
"code": null,... |
How to update nested state properties in ReactJS? | 28 Dec, 2020
There are the following approaches to update nested state properties in ReactJS:
Approach 1: We can create a dummy object to perform operations on it (update properties that we want) then replace the component’s state with the updated object.
Approach 2: We can pass the old nested object using the spread o... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Dec, 2020"
},
{
"code": null,
"e": 109,
"s": 28,
"text": "There are the following approaches to update nested state properties in ReactJS:"
},
{
"code": null,
"e": 271,
"s": 109,
"text": "Approach 1: We can create... |
Python | Ways to sort list of float values | 11 May, 2020
Given a list of float values, write a Python program to sort the list.
Examples:
Input: list = ['1.2', '.8', '19.8', '2.7', '99.8', '80.7']
Output: ['.8', '1.2', '2.7', '19.8', '80.7', '99.8']
Input: list = [12.8, .178, 1.8, 782.7, 99.8, 8.7]
Output: [0.178, 1.8, 8.7, 12.8, 99.8, 782.7]
Let’s discuss dif... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 May, 2020"
},
{
"code": null,
"e": 99,
"s": 28,
"text": "Given a list of float values, write a Python program to sort the list."
},
{
"code": null,
"e": 109,
"s": 99,
"text": "Examples:"
},
{
"code": null,... |
How to make Mongoose multiple collections using Node.js ? | 31 May, 2021
Mongoose is an Object Data Modeling (ODM) library for MongoDB. It defines a strongly-typed-schema, with default values and schema validations which are later mapped to a MongoDB document.
For creating a collection with Mongoose you have to create two necessary things:
Schema: It is a document structure th... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n31 May, 2021"
},
{
"code": null,
"e": 240,
"s": 52,
"text": "Mongoose is an Object Data Modeling (ODM) library for MongoDB. It defines a strongly-typed-schema, with default values and schema validations which are later mapped to a Mong... |
Preorder predecessor of a Node in Binary Tree | 01 Jun, 2022
Given a binary tree and a node in the binary tree, find Preorder predecessor of the given node. Examples:
Consider the following binary tree
20
/ \
10 26
/ \ / \
4 18 24 27
/ \
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n01 Jun, 2022"
},
{
"code": null,
"e": 160,
"s": 52,
"text": "Given a binary tree and a node in the binary tree, find Preorder predecessor of the given node. Examples: "
},
{
"code": null,
"e": 535,
"s": 160,
"text"... |
How to select values from a JSON object using jQuery ? | 18 Jan, 2021
In this article, we will select values from a JSON object and display them on the browser using jQuery. To select values from a JSON object to webpage, we use append() method.
This append() method in jQuery is used to insert some content at the end of the selected elements.
Syntax:
$(selector).append( con... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Jan, 2021"
},
{
"code": null,
"e": 205,
"s": 28,
"text": "In this article, we will select values from a JSON object and display them on the browser using jQuery. To select values from a JSON object to webpage, we use append() method.... |
Print all root to leaf paths of an N-ary tree | 14 Aug, 2021
Given an N-Ary tree, the task is to print all root to leaf paths of the given N-ary Tree.
Examples:
Input: 1 / \ 2 3 / / \ 4 5 6 / \ 7 8
... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 Aug, 2021"
},
{
"code": null,
"e": 144,
"s": 54,
"text": "Given an N-Ary tree, the task is to print all root to leaf paths of the given N-ary Tree."
},
{
"code": null,
"e": 154,
"s": 144,
"text": "Examples:"
},... |
3-Way QuickSort (Dutch National Flag) | Here we will see the quicksort technique but we will use three-way quicksort. The basic quicksort technique is just finding an element as pivot then partition the array around pivot, after that, recur for sub arrays on left and right of the pivot.
The three-way quicksort is similar, but there are three sections. array ... | [
{
"code": null,
"e": 1310,
"s": 1062,
"text": "Here we will see the quicksort technique but we will use three-way quicksort. The basic quicksort technique is just finding an element as pivot then partition the array around pivot, after that, recur for sub arrays on left and right of the pivot."
},... |
Batch Script - Replace a String | To replace a substring with another string use the string substitution feature.
@echo off
set str=This message needs changed.
echo %str%
set str=%str:needs=has%
echo %str%
The key thing to note about the above program is, the example replaces the word ‘needs’ with the string ‘has’ via the statement %str:needs = ha... | [
{
"code": null,
"e": 2249,
"s": 2169,
"text": "To replace a substring with another string use the string substitution feature."
},
{
"code": null,
"e": 2346,
"s": 2249,
"text": "@echo off \nset str=This message needs changed. \necho %str% \n\nset str=%str:needs=has% \necho %str%"... |
Numpy Cheat Sheet. A quick guide to the basics of the... | by XuanKhanh Nguyen | Towards Data Science | NumPy is the library that gives Python its ability to work with data at speed. Numpy has several advantages over data cleaning and manipulation. It allows for efficient operations on the data structures often used in machine learning: vectors, matrices, and tensors.
When I first learned NumPy, I had trouble remembering... | [
{
"code": null,
"e": 439,
"s": 172,
"text": "NumPy is the library that gives Python its ability to work with data at speed. Numpy has several advantages over data cleaning and manipulation. It allows for efficient operations on the data structures often used in machine learning: vectors, matrices, a... |
Maximum Sum Increasing Subsequence
| Maximum Sum Increasing subsequence is a subsequence of a given list of integers, whose sum is maximum and in the subsequence, all elements are sorted in increasing order.
Let there is an array to store max sum increasing subsequence, such that L[i] is the max sum increasing subsequence, which is ending with array[i].
I... | [
{
"code": null,
"e": 1233,
"s": 1062,
"text": "Maximum Sum Increasing subsequence is a subsequence of a given list of integers, whose sum is maximum and in the subsequence, all elements are sorted in increasing order."
},
{
"code": null,
"e": 1381,
"s": 1233,
"text": "Let there i... |
C# NullReferenceException | NullReferenceException occurs when you try to to access member fields, or function types that points to null.
Here is an example −
Live Demo
using System;
class Demo {
static void Main() {
string str = null;
if (str.Length > 0) {
Console.WriteLine(str);
}
}
}
The following is the out... | [
{
"code": null,
"e": 1172,
"s": 1062,
"text": "NullReferenceException occurs when you try to to access member fields, or function types that points to null."
},
{
"code": null,
"e": 1193,
"s": 1172,
"text": "Here is an example −"
},
{
"code": null,
"e": 1204,
"s":... |
Data Visualisation in Python using Matplotlib and Seaborn - GeeksforGeeks | 29 Oct, 2021
It may sometimes seem easier to go through a set of data points and build insights from it but usually this process may not yield good results. There could be a lot of things left undiscovered as a result of this process. Additionally, most of the data sets used in real life are too big to do any analysis ... | [
{
"code": null,
"e": 25074,
"s": 25046,
"text": "\n29 Oct, 2021"
},
{
"code": null,
"e": 25446,
"s": 25074,
"text": "It may sometimes seem easier to go through a set of data points and build insights from it but usually this process may not yield good results. There could be a lo... |
How to split a data frame by column in R? | If we have a data frame column that contains some duplicate values or represent categories then we might want to split the data frame based on that column.
For example, if we have a data frame called df that contains a column say Col then we can split the data frame by Col by using the command given below −
split(df,df... | [
{
"code": null,
"e": 1218,
"s": 1062,
"text": "If we have a data frame column that contains some duplicate values or represent categories then we might want to split the data frame based on that column."
},
{
"code": null,
"e": 1371,
"s": 1218,
"text": "For example, if we have a ... |
Search record with a specific value in MySQL using LIKE or REGEXP? | Let us first create a table −
mysql> create table DemoTable651 (Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,Value varchar(100));
Query OK, 0 rows affected (0.59 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable651(Value) values('Title');
Query OK, 1 row affected (0.13 sec)
mysql> ... | [
{
"code": null,
"e": 1092,
"s": 1062,
"text": "Let us first create a table −"
},
{
"code": null,
"e": 1227,
"s": 1092,
"text": "mysql> create table DemoTable651 (Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,Value varchar(100));\nQuery OK, 0 rows affected (0.59 sec)"
},
{
"c... |
How to retrieve Azure VMs using PowerShell? | To retrieve the azure VMs using PowerShell, we can use Get-AzVM commands but before that make sure you logged in using Azure Credentials in the console. When you type this command, you will get the list of all VMs in the specified subscription.
To check which all properties are supported you can use the
Get-AzVM | gm -... | [
{
"code": null,
"e": 1307,
"s": 1062,
"text": "To retrieve the azure VMs using PowerShell, we can use Get-AzVM commands but before that make sure you logged in using Azure Credentials in the console. When you type this command, you will get the list of all VMs in the specified subscription."
},
... |
Groovy - While Statement | The syntax of the while statement is shown below −
while(condition) {
statement #1
statement #2
...
}
The while statement is executed by first evaluating the condition expression (a Boolean value), and if the result is true, then the statements in the while loop are executed. The process is repeated start... | [
{
"code": null,
"e": 2289,
"s": 2238,
"text": "The syntax of the while statement is shown below −"
},
{
"code": null,
"e": 2354,
"s": 2289,
"text": "while(condition) { \n statement #1 \n statement #2 \n ... \n}\n"
},
{
"code": null,
"e": 2904,
"s": 2354,
... |
How to check the memory used by a program in Java?
| For a long-running java code, which makes heavy use of dynamic memory, we may end up with Out-Of-Memory errors due to a memory shortage of the heap space.
In the below program, we can test the free java heap space used by a program. If the heap space is used more than 90 percent, then the garbage collector is explicitl... | [
{
"code": null,
"e": 1217,
"s": 1062,
"text": "For a long-running java code, which makes heavy use of dynamic memory, we may end up with Out-Of-Memory errors due to a memory shortage of the heap space."
},
{
"code": null,
"e": 1546,
"s": 1217,
"text": "In the below program, we ca... |
Altair vs. Matplotlib | by Eugene Teoh | Towards Data Science | If you have just started in Python, you might have heard of Matplotlib. Matplotlib has been the go-to visualisation library for anyone starting in Python, but is it the best?
In this article, I will introduce and discuss the differences between Altair and Matplotlib, what they are good at, and who should use them?
Firs... | [
{
"code": null,
"e": 346,
"s": 171,
"text": "If you have just started in Python, you might have heard of Matplotlib. Matplotlib has been the go-to visualisation library for anyone starting in Python, but is it the best?"
},
{
"code": null,
"e": 487,
"s": 346,
"text": "In this art... |
Entity embedding using t-SNE. The well known dimensionality reduction... | by Michael Larionov, PhD | Towards Data Science | We have been discussing some of the possible ways to embed categorical features: Kernel PCA and Spectral Encoding. The goal of such embedding is to map categorical features to vectors in a low dimensional space. The advantage is this mapping dramatically reduce overfitting, compared to 1-hot encoding. However we can lo... | [
{
"code": null,
"e": 1004,
"s": 172,
"text": "We have been discussing some of the possible ways to embed categorical features: Kernel PCA and Spectral Encoding. The goal of such embedding is to map categorical features to vectors in a low dimensional space. The advantage is this mapping dramatically... |
How to display JavaScript variable value in alert box? | To display JavaScript variable value in an alert box, try to run the following code −
Live Demo
<html>
<head>
<script>
function display() {
var a = "Simple";
var b = "Learning";
alert(a +" Easy "+ b);
}
</script>
</head>
<body>
<input type... | [
{
"code": null,
"e": 1148,
"s": 1062,
"text": "To display JavaScript variable value in an alert box, try to run the following code −"
},
{
"code": null,
"e": 1158,
"s": 1148,
"text": "Live Demo"
},
{
"code": null,
"e": 1451,
"s": 1158,
"text": "<html>\n <hea... |
MySQL query to select records beginning from a specific id | Let us first create a table −
mysql> create table DemoTable
-> (
-> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> Name varchar(100)
-> );
Query OK, 0 rows affected (0.67 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable(Name) values('John');
Query OK, 1 row affected ... | [
{
"code": null,
"e": 1092,
"s": 1062,
"text": "Let us first create a table −"
},
{
"code": null,
"e": 1250,
"s": 1092,
"text": "mysql> create table DemoTable\n -> (\n -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> Name varchar(100)\n -> );\nQuery OK, 0 rows affected ... |
A definitive explanation to the Hinge Loss for Support Vector Machines. | by Vagif Aliyev | Towards Data Science | NOTE: This article assumes that you are familiar with how an SVM operates. If this is not the case for you, be sure to check my out previous article which breaks down the SVM algorithm from first principles, and also includes a coded implementation of the algorithm from scratch!
I have seen lots of articles and blog po... | [
{
"code": null,
"e": 327,
"s": 47,
"text": "NOTE: This article assumes that you are familiar with how an SVM operates. If this is not the case for you, be sure to check my out previous article which breaks down the SVM algorithm from first principles, and also includes a coded implementation of the ... |
What are the ways of submitting a form in Selenium with python? | There are multiple ways of submitting a form in Selenium. One of the methods is to directly use the click() method on the form submitting button. The next approach is to use the submit() method on the form page.
Using the submit() method.This method shall simply submit the form after the required data is entered on the... | [
{
"code": null,
"e": 1274,
"s": 1062,
"text": "There are multiple ways of submitting a form in Selenium. One of the methods is to directly use the click() method on the form submitting button. The next approach is to use the submit() method on the form page."
},
{
"code": null,
"e": 1394... |
File Handling through C++ Classes | In this tutorial, we will be discussing a program to understand File Handling through C++ classes.
The default functions used in file handling to interact with files can be defined by the user using classes. Below is the implementation of ifstream and ofstream functions.
#include <iostream>
#include <fstream>
using nam... | [
{
"code": null,
"e": 1161,
"s": 1062,
"text": "In this tutorial, we will be discussing a program to understand File Handling through C++ classes."
},
{
"code": null,
"e": 1334,
"s": 1161,
"text": "The default functions used in file handling to interact with files can be defined b... |
SAP ABAP - Nested Loop | The DO and WHILE statements can be tested as well as combined with other loop forms. Each nested loop will have it’s own SY-INDEX created and monitored by the system.
The syntax for nested DO loop is −
DO [n TIMES].
<statement block n>.
DO [m TIMES].
<statement block m>.
ENDDO.
ENDDO.
REPORT YS_SEP_15.
... | [
{
"code": null,
"e": 3065,
"s": 2898,
"text": "The DO and WHILE statements can be tested as well as combined with other loop forms. Each nested loop will have it’s own SY-INDEX created and monitored by the system."
},
{
"code": null,
"e": 3100,
"s": 3065,
"text": "The syntax for ... |
How to select one item at a time from JCheckBox in Java? | A JCheckBox can extend JToggleButton and it can be a small box that is either checked or unchecked.
When we click on a JCheckBox, it changes from checked to unchecked or vice versa automatically.
A JCheckBox can generate an ActionListener or an ItemListener whenever the checkbox is changed.
An isSelected() method is us... | [
{
"code": null,
"e": 1162,
"s": 1062,
"text": "A JCheckBox can extend JToggleButton and it can be a small box that is either checked or unchecked."
},
{
"code": null,
"e": 1258,
"s": 1162,
"text": "When we click on a JCheckBox, it changes from checked to unchecked or vice versa a... |
How to empty an array in Java | Use List.clear() method to empty an array.
import java.util.ArrayList;
import java.util.List;
public class Tester {
public static void main(String[] args) {
List<String> list = new ArrayList<>();
list.add("A");
list.add("B");
list.add("C");
list.add("D");
list.add("E");
list... | [
{
"code": null,
"e": 1105,
"s": 1062,
"text": "Use List.clear() method to empty an array."
},
{
"code": null,
"e": 1563,
"s": 1105,
"text": "import java.util.ArrayList;\nimport java.util.List;\npublic class Tester {\n public static void main(String[] args) {\n List<String>... |
How to check if two given sets are disjoint? - GeeksforGeeks | 21 Jun, 2021
Given two sets represented by two arrays, how to check if the given two sets are disjoint or not? It may be assumed that the given arrays have no duplicates.
Input: set1[] = {12, 34, 11, 9, 3}
set2[] = {2, 1, 3, 5}
Output: Not Disjoint
3 is common in two sets.
Input: set1[] = {12, 34, 11, 9, 3}
... | [
{
"code": null,
"e": 24115,
"s": 24087,
"text": "\n21 Jun, 2021"
},
{
"code": null,
"e": 24273,
"s": 24115,
"text": "Given two sets represented by two arrays, how to check if the given two sets are disjoint or not? It may be assumed that the given arrays have no duplicates."
},... |
Android Fade In/Out in Kotlin - GeeksforGeeks | 28 Oct, 2021
In Android Animations are the visuals that are added to make the user interface more interactive, clear and good looking. Fade In and Fade out animations are used to modify the appearance of any view over a set interval of time so that user can be notified about the changes that are occurring in our applic... | [
{
"code": null,
"e": 23627,
"s": 23599,
"text": "\n28 Oct, 2021"
},
{
"code": null,
"e": 24029,
"s": 23627,
"text": "In Android Animations are the visuals that are added to make the user interface more interactive, clear and good looking. Fade In and Fade out animations are used ... |
DeleteView - Class Based Views Django - GeeksforGeeks | 13 Jan, 2022
Delete View refers to a view (logic) to delete a particular instance of a table from the database. It is used to delete entries in the database for example, deleting an article at geeksforgeeks. We have already discussed basics of Delete View in Delete View – Function based Views Django. Class-based views ... | [
{
"code": null,
"e": 24364,
"s": 24336,
"text": "\n13 Jan, 2022"
},
{
"code": null,
"e": 24884,
"s": 24364,
"text": "Delete View refers to a view (logic) to delete a particular instance of a table from the database. It is used to delete entries in the database for example, deleti... |
Creating a table look-a-like using Tkinter | A table contains data items in the form of rows and columns. Consider a case of having a table GUI in an application where we can manipulate the data using other Python libraries such as Numpy, Pandas, Matplotlib, etc. Tkinter provides TreeView widget which enable the user to draw the table and insert the data into it.... | [
{
"code": null,
"e": 1487,
"s": 1062,
"text": "A table contains data items in the form of rows and columns. Consider a case of having a table GUI in an application where we can manipulate the data using other Python libraries such as Numpy, Pandas, Matplotlib, etc. Tkinter provides TreeView widget w... |
Ionic - Cordova Integration | Cordova offers ngCordova, which is set of wrappers specifically designed to work with AngularJS.
When you the start Ionic app, you will notice that it is using bower. It can be used for managing ngCordova plugins. If you have bower installed skip this step, if you do not have it, then you can install it in the command ... | [
{
"code": null,
"e": 2560,
"s": 2463,
"text": "Cordova offers ngCordova, which is set of wrappers specifically designed to work with AngularJS."
},
{
"code": null,
"e": 2798,
"s": 2560,
"text": "When you the start Ionic app, you will notice that it is using bower. It can be used ... |
Repeating a String for Specific Number of Times in Golang - GeeksforGeeks | 26 Aug, 2019
In Go language, strings are different from other languages like Java, C++, Python, etc. It is a sequence of variable-width characters where each and every character is represented by one or more bytes using UTF-8 Encoding.You are allowed to repeat a string of for a specific number of times with the help of... | [
{
"code": null,
"e": 24378,
"s": 24350,
"text": "\n26 Aug, 2019"
},
{
"code": null,
"e": 24906,
"s": 24378,
"text": "In Go language, strings are different from other languages like Java, C++, Python, etc. It is a sequence of variable-width characters where each and every characte... |
Overloading unary operators + in C++ | The operator keyword declares a function specifying what operator-symbol means that once applied to instances of a class. this gives the operator more than one meaning, or "overloads" it. The compiler distinguishes between the different meanings of an operator by examining the types of its operands.
The unary operators... | [
{
"code": null,
"e": 1363,
"s": 1062,
"text": "The operator keyword declares a function specifying what operator-symbol means that once applied to instances of a class. this gives the operator more than one meaning, or \"overloads\" it. The compiler distinguishes between the different meanings of an... |
Check if there is any common character in two given strings - GeeksforGeeks | 27 May, 2021
Given two strings. The task is to check that is there any common character in between two strings.
Examples:
Input: s1 = "geeksforgeeks", s2 = "geeks"
Output: Yes
Input: s1 = "geeks", s2 = "for"
Output: No
Approach: Traverse the 1st string and map the characters of the string with its frequency, in this... | [
{
"code": null,
"e": 24767,
"s": 24739,
"text": "\n27 May, 2021"
},
{
"code": null,
"e": 24867,
"s": 24767,
"text": "Given two strings. The task is to check that is there any common character in between two strings. "
},
{
"code": null,
"e": 24878,
"s": 24867,
... |
Bool to int conversion in C++ | Here we will see how to convert bool to int equivalent in C++. Bool is a datatype in C++, and we can use true or false keyword for it. If we want to convert bool to int, we can use typecasting. Always true value will be 1, and false value will be 0.
#include <iostream>
using namespace std;
main() {
bool my_bool;
... | [
{
"code": null,
"e": 1312,
"s": 1062,
"text": "Here we will see how to convert bool to int equivalent in C++. Bool is a datatype in C++, and we can use true or false keyword for it. If we want to convert bool to int, we can use typecasting. Always true value will be 1, and false value will be 0."
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.