title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Erlang - Variables | In Erlang, all the variables are bound with the ‘=’ statement. All variables need to start with the upper case character. In other programming languages, the ‘=’ sign is used for the assignment, but not in the case of Erlang. As stated, variables are defined with the use of the ‘=’ statement.
One key thing to note in E... | [
{
"code": null,
"e": 2595,
"s": 2301,
"text": "In Erlang, all the variables are bound with the ‘=’ statement. All variables need to start with the upper case character. In other programming languages, the ‘=’ sign is used for the assignment, but not in the case of Erlang. As stated, variables are de... |
Remove a character from a Java StringBuffer object | In order to remove a character from a Java StringBuffer object, we use the deleteCharAt() method. The deleteCharAt() removes the character at the specified index. The length of resultant sequence of characters of the StringBuffer object is reduced by one.
Declaration − The java.lang.StringBuffer.deleteCharAt() method i... | [
{
"code": null,
"e": 1318,
"s": 1062,
"text": "In order to remove a character from a Java StringBuffer object, we use the deleteCharAt() method. The deleteCharAt() removes the character at the specified index. The length of resultant sequence of characters of the StringBuffer object is reduced by on... |
Gradient Descent and Adam Optimization | Towards Data Science | How artificial intelligence has influenced our daily lives in the past decade is something we can only ponder about. From spam filtering to news clustering, computer vision applications like fingerprint sensors to natural language processing problems like handwriting and speech recognition, it is very easy to undermine... | [
{
"code": null,
"e": 932,
"s": 172,
"text": "How artificial intelligence has influenced our daily lives in the past decade is something we can only ponder about. From spam filtering to news clustering, computer vision applications like fingerprint sensors to natural language processing problems like... |
DAX Filter - ALLSELECTED function | ALLSELECTED function gets the context that represents all rows and columns in the query, while keeping explicit filters and contexts other than row and column filters.
This function can be used to obtain visual totals in queries.
ALLSELECTED ([<tableName> | <columnName>])
tableName
Optional.
The name of a table.
It ca... | [
{
"code": null,
"e": 2169,
"s": 2001,
"text": "ALLSELECTED function gets the context that represents all rows and columns in the query, while keeping explicit filters and contexts other than row and column filters."
},
{
"code": null,
"e": 2231,
"s": 2169,
"text": "This function ... |
What is the difference between declaration and definition in C#? | Declaration means that variable is only declared and memory is allocated, but no value is set.
However, definition means the variables has been initialized.
The same works for variables, arrays, collections, etc.
Declaring a variable.
int x;
Let’s define and assign a value.
x = 10;
Declaring an array.
int [] n // decl... | [
{
"code": null,
"e": 1157,
"s": 1062,
"text": "Declaration means that variable is only declared and memory is allocated, but no value is set."
},
{
"code": null,
"e": 1219,
"s": 1157,
"text": "However, definition means the variables has been initialized."
},
{
"code": nul... |
Fit multiple propensity models and choose the best performing one for implementing a profit optimisation | by Diego Usai | Towards Data Science | In this day and age, a business that leverages data to understand the drivers of customers’ behaviour has a true competitive advantage. Organisations can dramatically improve their performance in the market by analysing customer level data in an effective way and focus their efforts towards those that are more likely t... | [
{
"code": null,
"e": 501,
"s": 171,
"text": "In this day and age, a business that leverages data to understand the drivers of customers’ behaviour has a true competitive advantage. Organisations can dramatically improve their performance in the market by analysing customer level data in an effective... |
How to load and use static files in Django? - GeeksforGeeks | 16 Mar, 2021
Static Files such as Images, CSS or JS files are often loaded via a different app in production websites to avoid loading multiple stuff from the same server. This article revolves arouund, how you can setup static app in Django and server Static Files from the same.
let’s create a new project first for t... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n16 Mar, 2021"
},
{
"code": null,
"e": 24169,
"s": 23901,
"text": "Static Files such as Images, CSS or JS files are often loaded via a different app in production websites to avoid loading multiple stuff from the same server. This... |
Represent Int64 as a Hexadecimal String in C# | To represent Int64 as a Binary string in C#, use the ToString() method and set the base as the ToString() method’s second parameter i.e.16 for Hexadecimal.
Int64 represents a 64-bit signed integer.
Firstly, set an Int64 variable.
long val = 947645;
Now, convert it to a hex string by including 16 as the second parameter... | [
{
"code": null,
"e": 1218,
"s": 1062,
"text": "To represent Int64 as a Binary string in C#, use the ToString() method and set the base as the ToString() method’s second parameter i.e.16 for Hexadecimal."
},
{
"code": null,
"e": 1260,
"s": 1218,
"text": "Int64 represents a 64-bit ... |
Python - noise() function in Wand - GeeksforGeeks | 08 May, 2020
Image noise is random variation of brightness or color information in images, and is usually an aspect of electronic noise. We can add noise to the image using noise() function. noise function can be useful when applied before a blur operation to defuse an image.
Following are the noise we can add using no... | [
{
"code": null,
"e": 24186,
"s": 24158,
"text": "\n08 May, 2020"
},
{
"code": null,
"e": 24450,
"s": 24186,
"text": "Image noise is random variation of brightness or color information in images, and is usually an aspect of electronic noise. We can add noise to the image using noi... |
A True End-to-End ML Example: Lead Scoring | by Adam Barnhard | Towards Data Science | Selling something can be hard work. A business might have many potential customers leads but most of those customers won’t turn into actual, paying customers in the end. A sales team has to sort through a long list of potential customers and figure out how to spend their time. That’s where lead scoring comes in. This i... | [
{
"code": null,
"e": 844,
"s": 171,
"text": "Selling something can be hard work. A business might have many potential customers leads but most of those customers won’t turn into actual, paying customers in the end. A sales team has to sort through a long list of potential customers and figure out ho... |
Cascading of Input/Output Operators in C++ - GeeksforGeeks | 28 Dec, 2020
Prerequisite: Operator Overloading in C++, Types of Operator Overloading
When an object calls an operator function by passing an argument and the returned value of the operator function calls the next operator function in the same expression, it is called as cascading of operators. Below are the examples f... | [
{
"code": null,
"e": 25477,
"s": 25449,
"text": "\n28 Dec, 2020"
},
{
"code": null,
"e": 25550,
"s": 25477,
"text": "Prerequisite: Operator Overloading in C++, Types of Operator Overloading"
},
{
"code": null,
"e": 25828,
"s": 25550,
"text": "When an object ca... |
How to change the font size of a text using JavaScript? | This method causes a string to be displayed in the specified size as if it were in a <font size= "size"> tag.
You can try to run the following code to change the font size of a text using JavaScript −
Live Demo
<html>
<head>
<title>JavaScript String fontsize() Method</title>
</head>
<body>
<script... | [
{
"code": null,
"e": 1297,
"s": 1187,
"text": "This method causes a string to be displayed in the specified size as if it were in a <font size= \"size\"> tag."
},
{
"code": null,
"e": 1388,
"s": 1297,
"text": "You can try to run the following code to change the font size of a tex... |
JavaScript Interview Questions and Answers | 05 Nov, 2019
What are the differences between Java and JavaScript ?JavaScript is a client-side scripting language and Java is object Oriented Programming language, both of them are totally different from each other.JavaScript: It is a light-weighted programming language (“scripting language”) and used to develop intera... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n05 Nov, 2019"
},
{
"code": null,
"e": 6778,
"s": 52,
"text": "What are the differences between Java and JavaScript ?JavaScript is a client-side scripting language and Java is object Oriented Programming language, both of them are total... |
Convert PDF File Text to Audio Speech using Python | 15 Jul, 2021
Let us see how to read a PDF that is converting a textual PDF file into audio.
Packages Used:
pyttsx3: It is a Python library for Text to Speech. It has many functions which will help the machine to communicate with us. It will help the machine to speak to us
PyPDF2: It will help to the text from the PDF. ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n15 Jul, 2021"
},
{
"code": null,
"e": 131,
"s": 52,
"text": "Let us see how to read a PDF that is converting a textual PDF file into audio."
},
{
"code": null,
"e": 146,
"s": 131,
"text": "Packages Used:"
},
{
... |
Maximum area of triangle having different vertex colors | 19 Apr, 2022
Given a matrix of N rows and M columns, consists of three value {r, g, b}. The task is to find the area of the largest triangle that has one side parallel to y-axis i.e vertical and the color of all three vertices are different.Examples:
Input : N = 4, M =5
mat[][] =
{
r, r, r, r, r,
r, r, r, r,... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Apr, 2022"
},
{
"code": null,
"e": 292,
"s": 52,
"text": "Given a matrix of N rows and M columns, consists of three value {r, g, b}. The task is to find the area of the largest triangle that has one side parallel to y-axis i.e verti... |
PHP program to add item at the beginning of associative array | 11 Feb, 2019
In PHP associative array is the type of array where the index need not to be strictly sequential like indexed array. Normally add a new element in an existing associative array it will get appended at the end of that array.
Example:
<?php // Existing array$arr = array('one' => 1, 'two' => 2); // New ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Feb, 2019"
},
{
"code": null,
"e": 252,
"s": 28,
"text": "In PHP associative array is the type of array where the index need not to be strictly sequential like indexed array. Normally add a new element in an existing associative arra... |
jQuery | element + next Selector | 19 Aug, 2021
The (“element + next”) selector selects in jQuery used to select the just “next” element of the specified “element”. This selector only works when the “next” element is placed just after the specified element.
For Example:
If the statement is $(“div + p”) then this will only select the first “p” element ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Aug, 2021"
},
{
"code": null,
"e": 239,
"s": 28,
"text": "The (“element + next”) selector selects in jQuery used to select the just “next” element of the specified “element”. This selector only works when the “next” element is placed... |
Workflow of OAuth 2.0 | 22 Sep, 2021
OAuth2.0 is an Open industry-standard authorization protocol that allows a third party to gain limited access to another HTTP service, such as Google, Facebook, and GitHub, on behalf of a user, once the user grants permission to access their credentials.
Most websites require you to complete a registratio... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Sep, 2021"
},
{
"code": null,
"e": 308,
"s": 52,
"text": "OAuth2.0 is an Open industry-standard authorization protocol that allows a third party to gain limited access to another HTTP service, such as Google, Facebook, and GitHub, o... |
Ternary Search Tree | 14 Jun, 2022
A ternary search tree is a special trie data structure where the child nodes of a standard trie are ordered as a binary search tree.
Representation of ternary search trees: Unlike trie(standard) data structure where each node contains 26 pointers for its children, each node in a ternary search tree contai... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n14 Jun, 2022"
},
{
"code": null,
"e": 186,
"s": 52,
"text": "A ternary search tree is a special trie data structure where the child nodes of a standard trie are ordered as a binary search tree. "
},
{
"code": null,
"e": 101... |
Sum of Bitwise-OR of all subarrays of a given Array | Set 2 | 02 Jun, 2021
Give an array of positive integers. The task is to find the total sum after performing the bitwise OR operation on all the sub-arrays of the given array.Examples:
Input : arr[] = {1, 2, 3, 4, 5}
Output : 71
Input : arr[] = {6, 5, 4, 3, 2}
Output : 84
Explanation:
Simple Approach: A simple approach i... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n02 Jun, 2021"
},
{
"code": null,
"e": 217,
"s": 52,
"text": "Give an array of positive integers. The task is to find the total sum after performing the bitwise OR operation on all the sub-arrays of the given array.Examples: "
},
{... |
Find the node with minimum value in a Binary Search Tree | 20 Jun, 2022
This is quite simple. Just traverse the node from root to left recursively until left is NULL. The node whose left is NULL is the node with minimum value.
For the above tree, we start with 20, then we move left 8, we keep on moving to left until we see NULL. Since left of 4 is NULL, 4 is the node with ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n20 Jun, 2022"
},
{
"code": null,
"e": 210,
"s": 53,
"text": "This is quite simple. Just traverse the node from root to left recursively until left is NULL. The node whose left is NULL is the node with minimum value. "
},
{
"co... |
Java Program to Print Pascal’s Triangle | 20 Apr, 2022
Pascal’s triangle is a pattern of the triangle which is based on nCr.below is the pictorial representation of Pascal’s triangle.
Example:
Input : N = 5
Output:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
Approach #1:
nCr formula:
n ! / ( n – r ) ! r !
After using nCr ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n20 Apr, 2022"
},
{
"code": null,
"e": 183,
"s": 54,
"text": "Pascal’s triangle is a pattern of the triangle which is based on nCr.below is the pictorial representation of Pascal’s triangle."
},
{
"code": null,
"e": 192,
... |
Node.js fs.truncate() Method | 12 Oct, 2021
The fs.truncate() method in node.js is used to change the size of the file i.e either increase or decrease the file size. This method changes the length of the file at the path by len bytes. If len represents a length shorter than the file’s current length, the file is truncated to that length. If it is gr... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Oct, 2021"
},
{
"code": null,
"e": 424,
"s": 28,
"text": "The fs.truncate() method in node.js is used to change the size of the file i.e either increase or decrease the file size. This method changes the length of the file at the pat... |
Program to calculate value of nCr | 18 Jan, 2022
Following are common definition of Binomial Coefficients.
A binomial coefficient C(n, k) can be defined as the coefficient of X^k in the expansion of (1 + X)^n.A binomial coefficient C(n, k) also gives the number of ways, disregarding order, that k objects can be chosen from among n objects; more formall... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 Jan, 2022"
},
{
"code": null,
"e": 112,
"s": 52,
"text": "Following are common definition of Binomial Coefficients. "
},
{
"code": null,
"e": 435,
"s": 112,
"text": "A binomial coefficient C(n, k) can be defined... |
How to Make Grouped Boxplots with ggplot2 in R? | 03 Dec, 2021
In this article, we will discuss how to make a grouped boxplot in the R Programming Language using the ggplot2 package.
Boxplot helps us to visualize the distribution of quantitative data comparing different continuous or categorical variables. Boxplots consist of a five-number summary which helps in detec... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Dec, 2021"
},
{
"code": null,
"e": 148,
"s": 28,
"text": "In this article, we will discuss how to make a grouped boxplot in the R Programming Language using the ggplot2 package."
},
{
"code": null,
"e": 473,
"s": 148,... |
How to import config.php file in a PHP script ? | 02 Mar, 2020
The include statement in PHP copies the code of text from the file mentioned, into the file that uses the include statement. It directs the preprocessor to insert the content specified into the following program. The name of the file to be included is written in double-quotes. It is a good practice to writ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Mar, 2020"
},
{
"code": null,
"e": 697,
"s": 28,
"text": "The include statement in PHP copies the code of text from the file mentioned, into the file that uses the include statement. It directs the preprocessor to insert the content ... |
Node.js Date.addDays() API | 12 Mar, 2021
The date-and-time.Date.addDays() is a minimalist collection of functions for manipulating JS date and time module which is used to add the extra Days to the existing date and time.
Required Module: Install the module by npm or used it locally.
By using npm.
npm install date-and-time --save
By using CDN lin... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Mar, 2021"
},
{
"code": null,
"e": 209,
"s": 28,
"text": "The date-and-time.Date.addDays() is a minimalist collection of functions for manipulating JS date and time module which is used to add the extra Days to the existing date and ... |
tgamma() method in C/C++ with Examples | 04 Oct, 2021
The tgamma() function is defined in header math.h header in C and cmath library in C++. This function is used to compute the gamma function of an argument passed to the function.Syntax:
float tgamma(float x);
double tgamma(double x);
long double tgamma(long double x);
Parameters: This method accept... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Oct, 2021"
},
{
"code": null,
"e": 216,
"s": 28,
"text": "The tgamma() function is defined in header math.h header in C and cmath library in C++. This function is used to compute the gamma function of an argument passed to the functi... |
How To Rename Columns In Pandas | Towards Data Science | Renaming dataframe columns is a common practise especially when we are interested in sharing some insights with other people and teams. This means that we may wish to make column names more meaningful so that it would be easier for readers to relate them to specific contexts.
In this short article, we will look at a fe... | [
{
"code": null,
"e": 448,
"s": 171,
"text": "Renaming dataframe columns is a common practise especially when we are interested in sharing some insights with other people and teams. This means that we may wish to make column names more meaningful so that it would be easier for readers to relate them ... |
C# | Check if Caps Lock is on or off through Console - GeeksforGeeks | 28 Jan, 2019
Given the normal Console in C#, the task is to check if the CAPS LOCK is on or off through Console.
Approach: This can be done using the CAPS LOCK property in the Console class of the System package in C#.
Program 1: When the CAPS LOCK is on
// C# program to illustrate the// Console.CapsLock Propertyusing ... | [
{
"code": null,
"e": 26463,
"s": 26435,
"text": "\n28 Jan, 2019"
},
{
"code": null,
"e": 26563,
"s": 26463,
"text": "Given the normal Console in C#, the task is to check if the CAPS LOCK is on or off through Console."
},
{
"code": null,
"e": 26669,
"s": 26563,
... |
Design IIR Lowpass Butterworth Filter using Bilinear Transformation Method in Scipy- Python - GeeksforGeeks | 16 Dec, 2021
IIR stands for Infinite Impulse Response, It is one of the striking features of many linear-time invariant systems that are distinguished by having an impulse response h(t)/h(n) which does not become zero after some point but instead continues infinitely.
It basically behaves just like an ordinary digital... | [
{
"code": null,
"e": 25719,
"s": 25688,
"text": " \n16 Dec, 2021\n"
},
{
"code": null,
"e": 25975,
"s": 25719,
"text": "IIR stands for Infinite Impulse Response, It is one of the striking features of many linear-time invariant systems that are distinguished by having an impulse r... |
Tryit Editor v3.7 | Tryit: HTML button as link | [] |
Unusual behaviour with character pointers - GeeksforGeeks | 03 Nov, 2020
In C++, cout shows different printing behaviour with character pointers/arrays unlike pointers/arrays of other data types. So this article will firstly explain how cout behaves differently with character pointers, and then the reason and the working mechanism behind it will be discussed.
Example 1:
C++
// ... | [
{
"code": null,
"e": 23733,
"s": 23705,
"text": "\n03 Nov, 2020"
},
{
"code": null,
"e": 24022,
"s": 23733,
"text": "In C++, cout shows different printing behaviour with character pointers/arrays unlike pointers/arrays of other data types. So this article will firstly explain how... |
How to select multiple options in a dropdown list with JavaScript? | To select multiple options in a drop-down list, use the multiple properties. It allows you to select more than one option while pressing CTRL key.
You can try to run the following code to learn how to select more than one options at once in a dropdownlist.
Live Demo
<!DOCTYPE html>
<html>
<body>
<form id="myFo... | [
{
"code": null,
"e": 1209,
"s": 1062,
"text": "To select multiple options in a drop-down list, use the multiple properties. It allows you to select more than one option while pressing CTRL key."
},
{
"code": null,
"e": 1319,
"s": 1209,
"text": "You can try to run the following co... |
Better Heatmaps and Correlation Matrix Plots in Python | by Drazen Zaric | Towards Data Science | [Update 2020–04–12: The code described below is now available as a pip package — https://pypi.org/project/heatmapz/. There’s also a Google Colab notebook here, you can see a few examples in there and play around with the lib]
You already know that if you have a data set with many columns, a good way to quickly check co... | [
{
"code": null,
"e": 398,
"s": 172,
"text": "[Update 2020–04–12: The code described below is now available as a pip package — https://pypi.org/project/heatmapz/. There’s also a Google Colab notebook here, you can see a few examples in there and play around with the lib]"
},
{
"code": null,
... |
Usage of Bootstrap navbar-btn class | Add buttons using class .navbar-btn to <button> elements not residing in a <form> to vertically center them in the navbar. .navbar-btn can be used on <a> and <input> elements.
You can try to run the following code to implement the navbar-btn class
Live Demo
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Exampl... | [
{
"code": null,
"e": 1238,
"s": 1062,
"text": "Add buttons using class .navbar-btn to <button> elements not residing in a <form> to vertically center them in the navbar. .navbar-btn can be used on <a> and <input> elements."
},
{
"code": null,
"e": 1310,
"s": 1238,
"text": "You ca... |
MongoEngine - Quick Guide | NoSQL databases have seen rise in popularity in the last decade. In today’s world of real time web applications, huge amount of data is being generated with mobile and embedded devices. Traditional relational databases (like Oracle, MySQL, etc.) are not suitable for strings. The processing of such data is also difficul... | [
{
"code": null,
"e": 2810,
"s": 2310,
"text": "NoSQL databases have seen rise in popularity in the last decade. In today’s world of real time web applications, huge amount of data is being generated with mobile and embedded devices. Traditional relational databases (like Oracle, MySQL, etc.) are not... |
How to add hours and minutes to a date with JavaScript? | To add hours and minutes to a date, use the setHours() and setMinutes() method in JavaScript.
You can try to run the following code to add hours and minutes −
<html>
<head>
<title>JavaScript Dates</title>
</head>
<body>
<script>
var dt = new Date();
document.write("Current Date: "... | [
{
"code": null,
"e": 1156,
"s": 1062,
"text": "To add hours and minutes to a date, use the setHours() and setMinutes() method in JavaScript."
},
{
"code": null,
"e": 1221,
"s": 1156,
"text": "You can try to run the following code to add hours and minutes −"
},
{
"code": n... |
Java Program to add Combo Box to JTable | Use the JComboBox to add a combo box to a table -
JComboBox<String> comboBox = new JComboBox<>();
Now, add the combo box items -
comboBox.addItem("Asia");
comboBox.addItem("Europe");
comboBox.addItem("North America");
comboBox.addItem("South America");
Now, use the TableColumn and set the column wherein you want to set... | [
{
"code": null,
"e": 1112,
"s": 1062,
"text": "Use the JComboBox to add a combo box to a table -"
},
{
"code": null,
"e": 1160,
"s": 1112,
"text": "JComboBox<String> comboBox = new JComboBox<>();"
},
{
"code": null,
"e": 1191,
"s": 1160,
"text": "Now, add the ... |
Find all the names beginning with the letter 'a' or ‘b’ or ‘c’ using MySQL query? | You need to use LIKE with OR operator to find all the names that starts with a or b or c. The syntax is as follows:
SELECT *FROM yourTableName WHERE yourColumnName like 'A%' or yourColumnName like 'B%' or yourColumnName like 'C%';
The above query finds all names that starts only with the letter ‘a’ or ‘b’ or ‘c’. To un... | [
{
"code": null,
"e": 1178,
"s": 1062,
"text": "You need to use LIKE with OR operator to find all the names that starts with a or b or c. The syntax is as follows:"
},
{
"code": null,
"e": 1293,
"s": 1178,
"text": "SELECT *FROM yourTableName WHERE yourColumnName like 'A%' or yourC... |
Deletion of head and tail element logic in a linked list using C language. | Linked lists use dynamic memory allocation i.e. they grow and shrink accordingly. It is collection of nodes.
Node has two parts, which are data and link. These are explained below.
There are three types of operations on linked lists which are as follows −
Insertion
Deletion
Traversing
Identify the node.
Adjust the link... | [
{
"code": null,
"e": 1171,
"s": 1062,
"text": "Linked lists use dynamic memory allocation i.e. they grow and shrink accordingly. It is collection of nodes."
},
{
"code": null,
"e": 1243,
"s": 1171,
"text": "Node has two parts, which are data and link. These are explained below."
... |
Can we change the order of public static void main() to static public void main() in Java? | Yes, we can change the order of public static void main() to static public void main() in Java, the compiler doesn't throw any compile-time or runtime error. In Java, we can declare access modifiers in any order, the method name comes last, the return type comes second to last and then after it's our choice. But it's r... | [
{
"code": null,
"e": 1495,
"s": 1062,
"text": "Yes, we can change the order of public static void main() to static public void main() in Java, the compiler doesn't throw any compile-time or runtime error. In Java, we can declare access modifiers in any order, the method name comes last, the return t... |
Python PostgreSQL - Select Data | You can retrieve the contents of an existing table in PostgreSQL using the SELECT statement. At this statement, you need to specify the name of the table and, it returns its contents in tabular format which is known as result set.
Following is the syntax of the SELECT statement in PostgreSQL −
SELECT column1, column2, ... | [
{
"code": null,
"e": 2321,
"s": 2090,
"text": "You can retrieve the contents of an existing table in PostgreSQL using the SELECT statement. At this statement, you need to specify the name of the table and, it returns its contents in tabular format which is known as result set."
},
{
"code": ... |
Boxplot with variable length data in Matplotlib | To make a boxplot with variable length data in Matplotlib, we can take the following steps −
Set the figure size and adjust the padding between and around the subplots.
Make a list of data points.
Make a box and whisker plot using boxplot() method.
To display the figure, use show() method.
from matplotlib import pyplot... | [
{
"code": null,
"e": 1155,
"s": 1062,
"text": "To make a boxplot with variable length data in Matplotlib, we can take the following steps −"
},
{
"code": null,
"e": 1231,
"s": 1155,
"text": "Set the figure size and adjust the padding between and around the subplots."
},
{
... |
Intro to Regular Expressions (Regex) | Towards Data Science | We live in a data-centric age. Data has been described as the new oil. But just like oil, data isn’t always useful in its raw form. One form of data that is particularly hard to use in its raw form is unstructured data.
A lot of data is unstructured data. Unstructured data doesn’t fit nicely into a format for analysis,... | [
{
"code": null,
"e": 392,
"s": 172,
"text": "We live in a data-centric age. Data has been described as the new oil. But just like oil, data isn’t always useful in its raw form. One form of data that is particularly hard to use in its raw form is unstructured data."
},
{
"code": null,
"e"... |
C++ Class Member Functions | A member function of a class is a function that has its definition or its prototype within the class definition like any other variable. It operates on any object of the class of which it is a member, and has access to all the members of a class for that object.
Let us take previously defined class to access the membe... | [
{
"code": null,
"e": 2581,
"s": 2318,
"text": "A member function of a class is a function that has its definition or its prototype within the class definition like any other variable. It operates on any object of the class of which it is a member, and has access to all the members of a class for tha... |
Convert JSON file into CSV file and displaying the data using Node.js - GeeksforGeeks | 09 Apr, 2021
There are so many ways to store data for better understanding for individual purposes, in few cases, JSON files will be more suitable in few cases, CSV files, and there are also lots of other types as well like XML, etc. In this article, we will convert the JSON file data into CSV file data and also displa... | [
{
"code": null,
"e": 25002,
"s": 24974,
"text": "\n09 Apr, 2021"
},
{
"code": null,
"e": 25333,
"s": 25002,
"text": "There are so many ways to store data for better understanding for individual purposes, in few cases, JSON files will be more suitable in few cases, CSV files, and ... |
How to run an Android service always in background? | This example demonstrates how do I run an android service always in background.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8"?>
<Relati... | [
{
"code": null,
"e": 1142,
"s": 1062,
"text": "This example demonstrates how do I run an android service always in background."
},
{
"code": null,
"e": 1271,
"s": 1142,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required detail... |
Python & MySQL - Create Database Example | Python uses c.execute(q) function to create or delete a MySQL database where c is cursor and q is the query to be executed.
# execute SQL query using execute() method.
cursor.execute(sql)
$sql
Required - SQL query to create a MySQL database.
Try the following example to create a database −
Copy and paste the following... | [
{
"code": null,
"e": 2343,
"s": 2219,
"text": "Python uses c.execute(q) function to create or delete a MySQL database where c is cursor and q is the query to be executed."
},
{
"code": null,
"e": 2408,
"s": 2343,
"text": "# execute SQL query using execute() method.\ncursor.execut... |
Selecting a drop-down list by using the Selenium.select_by_visible_text() method in Python - GeeksforGeeks | 11 Oct, 2020
Selenium is an effective device for controlling an internet browser thru the program. It is purposeful for all browsers, works on all fundamental OS and its scripts are written in numerous languages i.e Python, Java, C#, etc, we can be running with Python.
Different methods of Select class:
Selection an op... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n11 Oct, 2020"
},
{
"code": null,
"e": 24158,
"s": 23901,
"text": "Selenium is an effective device for controlling an internet browser thru the program. It is purposeful for all browsers, works on all fundamental OS and its script... |
C program to print digital clock with current time | In this section we will see how to make a digital clock using C. To work with time we can use the time.h header file. This header file has some function signatures that are used to handle date and time related issues.
The four important components of time.h is like below
size_t This size_t is basically the unsigned int... | [
{
"code": null,
"e": 1280,
"s": 1062,
"text": "In this section we will see how to make a digital clock using C. To work with time we can use the time.h header file. This header file has some function signatures that are used to handle date and time related issues."
},
{
"code": null,
"e"... |
File isHidden() method in Java with Examples - GeeksforGeeks | 28 Jan, 2019
The isHidden() function is a part of File class in Java . This function determines whether the is a file or Directory denoted by the abstract filename is Hidden or not.The function returns true if the abstract file path is Hidden else return false.
Function signature:
public boolean isHidden()
Syntax:
file... | [
{
"code": null,
"e": 24824,
"s": 24796,
"text": "\n28 Jan, 2019"
},
{
"code": null,
"e": 25073,
"s": 24824,
"text": "The isHidden() function is a part of File class in Java . This function determines whether the is a file or Directory denoted by the abstract filename is Hidden or... |
Basic Line Chart with curved lines | Following is an example of a basic line chart with smooth curved lines. We've already seen the configuration used to draw this chart in Google Charts Configuration Syntax chapter. So, let's see the complete example.
We've added backgroundColor configuration to change default background color.
// Set chart options
var o... | [
{
"code": null,
"e": 2477,
"s": 2261,
"text": "Following is an example of a basic line chart with smooth curved lines. We've already seen the configuration used to draw this chart in Google Charts Configuration Syntax chapter. So, let's see the complete example."
},
{
"code": null,
"e": ... |
How GIN Indices Can Make Your Postgres Queries 15x Faster | by GreekDataGuy | Towards Data Science | Adding an index has improved query time from minutes to milliseconds more than I can count during my career. As data scientists, we spend A LOT of time querying and analyzing data so we should know how to do it efficiently.
Postgres has 6 index types. Today we’re covering GIN indices.
We’re going to seed a database wit... | [
{
"code": null,
"e": 396,
"s": 172,
"text": "Adding an index has improved query time from minutes to milliseconds more than I can count during my career. As data scientists, we spend A LOT of time querying and analyzing data so we should know how to do it efficiently."
},
{
"code": null,
... |
How to convert row index number or row index name of an R data frame to a vector? | We might want to extract row index irrespective of its type (whether numeric or string) to do some calculations if it is incorrectly set as a row index. It happens during the data collection process or incorrect processing of data. Also, since row indexes are helpful to access row we must have proper names to them inst... | [
{
"code": null,
"e": 1591,
"s": 1062,
"text": "We might want to extract row index irrespective of its type (whether numeric or string) to do some calculations if it is incorrectly set as a row index. It happens during the data collection process or incorrect processing of data. Also, since row index... |
Hide or show HTML elements using visibility property in JavaScript - GeeksforGeeks | 02 Mar, 2021
The visibility property is used to hide or show the content of HTML elements. The visibility property specifies that the element is currently visible on the page. The ‘hidden’ value can be used to hide the element. This hides the element but does not remove the space taken by the element, unlike the displa... | [
{
"code": null,
"e": 24711,
"s": 24683,
"text": "\n02 Mar, 2021"
},
{
"code": null,
"e": 25030,
"s": 24711,
"text": "The visibility property is used to hide or show the content of HTML elements. The visibility property specifies that the element is currently visible on the page. ... |
How To Apply Data Science To Real Business Problems | by Ben Rogojan | Towards Data Science | Focused on E-Commerce and Healthcare
*Heads up, if you want to skip the intro and go straight to the examples, scroll to the first header
Data science and statistics are not magic. They won’t magically fix all of a company’s problems. However, they are useful tools to help companies make more accurate decisions and aut... | [
{
"code": null,
"e": 208,
"s": 171,
"text": "Focused on E-Commerce and Healthcare"
},
{
"code": null,
"e": 309,
"s": 208,
"text": "*Heads up, if you want to skip the intro and go straight to the examples, scroll to the first header"
},
{
"code": null,
"e": 550,
"s... |
How to sum elements of a column in MySQL? | Use aggregate function sum() to sum the elements of a column in MySQL. The syntax is as follows −
select sum(yourColumnName1) as anyVariableName1,sum(yourColumnName2) as anyVariableName2,sum(yourColumnName3) as anyVariableName3,............N from yourTableName;
To understand the above syntax, let us create a table. The... | [
{
"code": null,
"e": 1160,
"s": 1062,
"text": "Use aggregate function sum() to sum the elements of a column in MySQL. The syntax is as follows −"
},
{
"code": null,
"e": 1324,
"s": 1160,
"text": "select sum(yourColumnName1) as anyVariableName1,sum(yourColumnName2) as anyVariableN... |
How to Scroll top in RecyclerView with LinearLayoutManager in Android? | Before getting into example, we should know what is Recycler view in android. Recycler view is more advanced version of list view and it works based on View holder design pattern. Using recycler view we can show grids and list of items .
This example demonstrate
about how to Scroll top in RecyclerView with LinearLayout... | [
{
"code": null,
"e": 1300,
"s": 1062,
"text": "Before getting into example, we should know what is Recycler view in android. Recycler view is more advanced version of list view and it works based on View holder design pattern. Using recycler view we can show grids and list of items ."
},
{
"... |
Chef - Libraries | Libraries in Chef provides a place to encapsulate compiled logic so that the cookbook recipes remain neat and clean.
Step 1 − Create a helper method in cookbook’s library.
vipin@laptop:~/chef-repo $ subl cookbooks/my_cookbook/libraries/ipaddress.rb
class Chef::Recipe
def netmask(ipaddress)
IPAddress(ipaddress).netma... | [
{
"code": null,
"e": 2497,
"s": 2380,
"text": "Libraries in Chef provides a place to encapsulate compiled logic so that the cookbook recipes remain neat and clean."
},
{
"code": null,
"e": 2552,
"s": 2497,
"text": "Step 1 − Create a helper method in cookbook’s library."
},
{
... |
How to make a class JSON Serializable in Python? | Serialisation is the process of transforming objects of complex data types to native data types so that they can then be easily converted to JSON notation.
If you have a JSON string, you can convert it into a JSON string by using the json.dumps() method.
Python pickle module is used for serialising and deserialising a... | [
{
"code": null,
"e": 1219,
"s": 1062,
"text": "Serialisation is the process of transforming objects of complex data types to native data types so that they can then be easily converted to JSON notation. "
},
{
"code": null,
"e": 1318,
"s": 1219,
"text": "If you have a JSON string... |
Rearrange array such that even positioned are greater than odd - GeeksforGeeks | 20 Apr, 2021
Given an array A of n elements, sort the array according to the following relations :
, if i is even.
, if i is odd. Print the resultant array.Examples :
Input : A[] = {1, 2, 2, 1}
Output : 1 2 1 2
Explanation :
For 1st element, 1 1, i = 2 is even.
3rd element, 1 1, i = 4 is even.
Input : ... | [
{
"code": null,
"e": 25436,
"s": 25408,
"text": "\n20 Apr, 2021"
},
{
"code": null,
"e": 25524,
"s": 25436,
"text": "Given an array A of n elements, sort the array according to the following relations : "
},
{
"code": null,
"e": 25544,
"s": 25526,
"text": ", ... |
Get or set the element at the specified index in ArrayList in C# | To get or set the element at the specified index in ArrayList, the code is as follows −
Live Demo
using System;
using System.Collections;
public class Demo {
public static void Main() {
ArrayList arrList = new ArrayList();
arrList.Add("Laptop");
arrList.Add("Desktop");
arrList.Add("Notebook"... | [
{
"code": null,
"e": 1150,
"s": 1062,
"text": "To get or set the element at the specified index in ArrayList, the code is as follows −"
},
{
"code": null,
"e": 1161,
"s": 1150,
"text": " Live Demo"
},
{
"code": null,
"e": 1711,
"s": 1161,
"text": "using System... |
Java Program to Calculate Power of a Number - GeeksforGeeks | 31 Oct, 2019
Given a number N and a power P, the task is to find the exponent of this number raised to the given power, i.e. NP.
Examples:
Input: N = 5, P = 2
Output: 25
Input: N = 2, P = 5
Output: 32
Below are the various ways to find NP:
Method 1: Using Recursion// Java program to find the power of a number// using... | [
{
"code": null,
"e": 24104,
"s": 24076,
"text": "\n31 Oct, 2019"
},
{
"code": null,
"e": 24220,
"s": 24104,
"text": "Given a number N and a power P, the task is to find the exponent of this number raised to the given power, i.e. NP."
},
{
"code": null,
"e": 24230,
... |
JSON - Schema | JSON Schema is a specification for JSON based format for defining the structure of JSON data. It was written under IETF draft which expired in 2011. JSON Schema −
Describes your existing data format.
Clear, human- and machine-readable documentation.
Complete structural validation, useful for automated testing.
Complete... | [
{
"code": null,
"e": 1943,
"s": 1780,
"text": "JSON Schema is a specification for JSON based format for defining the structure of JSON data. It was written under IETF draft which expired in 2011. JSON Schema −"
},
{
"code": null,
"e": 1980,
"s": 1943,
"text": "Describes your exis... |
How to open External Programs using Tkinter? - GeeksforGeeks | 24 Jan, 2021
Prerequisite: Tkinter, os
Python offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with Tkinter is the fastest and easiest way to ... | [
{
"code": null,
"e": 25108,
"s": 25080,
"text": "\n24 Jan, 2021"
},
{
"code": null,
"e": 25134,
"s": 25108,
"text": "Prerequisite: Tkinter, os"
},
{
"code": null,
"e": 25574,
"s": 25134,
"text": "Python offers multiple options for developing a GUI (Graphical U... |
Reverse a String (Recursive) C++ | Recursion is simply the way toward rehashing things in a self-comparative way. In programming dialects, if a program enables you to call a capacity inside a similar capacity, at that point, it is known as a recursive call of the capacity. You can switch a string utilizing the recursive capacity as appeared in the accom... | [
{
"code": null,
"e": 1399,
"s": 1062,
"text": "Recursion is simply the way toward rehashing things in a self-comparative way. In programming dialects, if a program enables you to call a capacity inside a similar capacity, at that point, it is known as a recursive call of the capacity. You can switch... |
Fortran - Arithmetic Operators | Following table shows all the arithmetic operators supported by Fortran. Assume variable A holds 5 and variable B holds 3 then −
Try the following example to understand all the arithmetic operators available in Fortran −
program arithmeticOp
! this program performs arithmetic calculation
implicit none
! variable... | [
{
"code": null,
"e": 2275,
"s": 2146,
"text": "Following table shows all the arithmetic operators supported by Fortran. Assume variable A holds 5 and variable B holds 3 then −"
},
{
"code": null,
"e": 2367,
"s": 2275,
"text": "Try the following example to understand all the arith... |
How to get current Wi-Fi mac address in android? | This example demonstrate about How to get current Wi-Fi mac address in android.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version = "1.0" encoding = "utf-8"?>
<Li... | [
{
"code": null,
"e": 1142,
"s": 1062,
"text": "This example demonstrate about How to get current Wi-Fi mac address in android."
},
{
"code": null,
"e": 1271,
"s": 1142,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required detail... |
How to Add and Remove multiple classes in jQuery ? - GeeksforGeeks | 03 Aug, 2021
Given an HTML element and the task is to add and remove multiple classes from it using JQuery.
Approach:
First select the element to which multiple classes will be added.
Then use addClass() method to add multiple classes to the element and removeClass() method to remove multiple classes.
Example 1: This e... | [
{
"code": null,
"e": 25015,
"s": 24987,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 25110,
"s": 25015,
"text": "Given an HTML element and the task is to add and remove multiple classes from it using JQuery."
},
{
"code": null,
"e": 25120,
"s": 25110,
"tex... |
MySQL query to select all entries from a particular month | To select all entries from a particular month in MySQL, use the monthname() or month() function.
The syntax is as follows.
select *from yourTableName where monthname(yourColumnName)='yourMonthName';
To understand the above syntax, let us create a table. The query to create a table is as follows
mysql> create table sele... | [
{
"code": null,
"e": 1159,
"s": 1062,
"text": "To select all entries from a particular month in MySQL, use the monthname() or month() function."
},
{
"code": null,
"e": 1185,
"s": 1159,
"text": "The syntax is as follows."
},
{
"code": null,
"e": 1261,
"s": 1185,
... |
Difference Between CrudRepository and JPARepository in Java | CrudRepository and JPA repository both are the interface of the spring data repository library. Spring data repository reduces the boilerplate code by providing some predefined finders to access the data layer for various persistence layers.
JPA repository extends CrudRepository and PagingAndSorting repository. It inhe... | [
{
"code": null,
"e": 1304,
"s": 1062,
"text": "CrudRepository and JPA repository both are the interface of the spring data repository library. Spring data repository reduces the boilerplate code by providing some predefined finders to access the data layer for various persistence layers."
},
{
... |
Read ERA5 Directly into Memory with Python | by Luke Gloege, Ph.D. | Towards Data Science | ERA5 is the fifth generation climate reanalysis produced by the European Centre for Medium-Range Weather Forecasts (ECMWF). The product provides hourly output for many atmospheric, land-surface, and ocean-state parameters together with estimates of uncertainty. However, unless you are working in the cloud, storing raw ... | [
{
"code": null,
"e": 534,
"s": 172,
"text": "ERA5 is the fifth generation climate reanalysis produced by the European Centre for Medium-Range Weather Forecasts (ECMWF). The product provides hourly output for many atmospheric, land-surface, and ocean-state parameters together with estimates of uncert... |
Getting hash of a file using CMD - GeeksforGeeks | 23 Oct, 2020
A cryptographic hash is a fixed size string (or text) that is used as an identifier/fingerprint of some data. These are particularly useful in determining the integrity of files after they are transferred over a communication channel. Hashes are even utilized by certain OS-level processes for their working... | [
{
"code": null,
"e": 24492,
"s": 24464,
"text": "\n23 Oct, 2020"
},
{
"code": null,
"e": 25039,
"s": 24492,
"text": "A cryptographic hash is a fixed size string (or text) that is used as an identifier/fingerprint of some data. These are particularly useful in determining the inte... |
How to select a radio button by default in JavaScript? | To select a radio button by default we have to check it as true. If it is checked as true then by default it will be autofocused.
In the following example, we have only radio buttons and none of them is autofocused.
Live Demo
<html>
<form id="radiobuttons" name="radiobutton">
<input id="rad1" value="a" type="... | [
{
"code": null,
"e": 1193,
"s": 1062,
"text": "To select a radio button by default we have to check it as true. If it is checked as true then by default it will be autofocused. "
},
{
"code": null,
"e": 1279,
"s": 1193,
"text": "In the following example, we have only radio button... |
How to check if a column is categorical in R data frame? | To check if a column is categorical in R data frame, we can follow the below steps −
First of all, create a data frame.
Use class function to check the class of the column.
Let's create a data frame as shown below −
Live Demo
x<-rpois(25,2)
y<-sample(LETTERS[1:4],25,replace=TRUE)
z<-factor(sample(c("Low","Medium","Hig... | [
{
"code": null,
"e": 1147,
"s": 1062,
"text": "To check if a column is categorical in R data frame, we can follow the below steps −"
},
{
"code": null,
"e": 1182,
"s": 1147,
"text": "First of all, create a data frame."
},
{
"code": null,
"e": 1235,
"s": 1182,
... |
C++ Program to Remove all Characters in a String Except Alphabets | A string is a one-dimensional character array that is terminated by a null character. It may contain characters, digits, special symbols etc.
A program to remove all characters in a string except alphabets is given as follows.
#include <iostream>
using namespace std;
int main() {
char str[100] = "String@123!!";
i... | [
{
"code": null,
"e": 1204,
"s": 1062,
"text": "A string is a one-dimensional character array that is terminated by a null character. It may contain characters, digits, special symbols etc."
},
{
"code": null,
"e": 1289,
"s": 1204,
"text": "A program to remove all characters in a ... |
MongoDB query for exact match | For exact match, you can use $exists that checks for a match. Let us create a collection with documents −
> db.demo290.insertOne({"ListOfName":"Chris"});
{
"acknowledged" : true,
"insertedId" : ObjectId("5e4c0c9e5d93261e4bc9ea2d")
}
> db.demo290.insertOne({"ListOfName":["Chris","David"]});
{
"acknowledged" : t... | [
{
"code": null,
"e": 1168,
"s": 1062,
"text": "For exact match, you can use $exists that checks for a match. Let us create a collection with documents −"
},
{
"code": null,
"e": 1444,
"s": 1168,
"text": "> db.demo290.insertOne({\"ListOfName\":\"Chris\"});\n{\n \"acknowledged\" ... |
Binary Classification with Logistic Regression | by Dirk Hornung | Towards Data Science | In performance marketing, an important Key Performance Indicator (KPI) is given by the Click Through Rate (CTR). The CTR is the ratio of users who click on a specific link to the number of total users who view a page, email, or advertisement (ad).
Estimating the CTR is a binary classification problem. When a user views... | [
{
"code": null,
"e": 420,
"s": 172,
"text": "In performance marketing, an important Key Performance Indicator (KPI) is given by the Click Through Rate (CTR). The CTR is the ratio of users who click on a specific link to the number of total users who view a page, email, or advertisement (ad)."
},
... |
React-Bootstrap Button Component | 17 Jun, 2021
Introduction: React-Bootstrap is a front-end framework that was designed keeping react in mind. Bootstrap was re-built and revamped for React, hence it is known as React-Bootstrap. Buttons are used to perform actions on the website and they play a crucial role in the front-end part.
Buttons props:
variant:... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Jun, 2021"
},
{
"code": null,
"e": 312,
"s": 28,
"text": "Introduction: React-Bootstrap is a front-end framework that was designed keeping react in mind. Bootstrap was re-built and revamped for React, hence it is known as React-Boots... |
HTML | size Attribute | 09 Dec, 2021
The size attribute in HTML is used to specify the initial width for the input field and a number of visible rows for the select element.The size attribute can be used with the following elements:
<input>
<hr>
<select>
<font>
Attribute Values: It contains a numeric value that specify the number of visibl... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n09 Dec, 2021"
},
{
"code": null,
"e": 251,
"s": 53,
"text": "The size attribute in HTML is used to specify the initial width for the input field and a number of visible rows for the select element.The size attribute can be used with th... |
Python | Remove square brackets from list | 05 Sep, 2019
Sometimes, while working with displaying the contents of list, the square brackets, both opening and closing are undesired. For this when we need to print whole list without accessing the elements for loops, we require a method to perform this. Let’s discuss a shorthand by which this task can be performed.... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n05 Sep, 2019"
},
{
"code": null,
"e": 361,
"s": 53,
"text": "Sometimes, while working with displaying the contents of list, the square brackets, both opening and closing are undesired. For this when we need to print whole list without ... |
String rjust() and ljust() in python() | 08 Jan, 2018
1. String rjust() The string rjust() method returns a new string of given length after substituting a given character in left side of original string.
Syntax:
string.rjust(length, fillchar)
Parameters:
length: length of the modified string. If length is less than or equal to the length of the original stri... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Jan, 2018"
},
{
"code": null,
"e": 179,
"s": 28,
"text": "1. String rjust() The string rjust() method returns a new string of given length after substituting a given character in left side of original string."
},
{
"code": nu... |
How to create a link in JavaScript ? | 20 Jul, 2021
Given an HTML document and the task is to create a JavaScript link and add it to the document using JavaScript.
Approach:
Create an anchor <a> element.
Create a text node with some text which will display as a link.
Append the text node to the anchor <a> element.
Set the title and href property of the <a> ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Jul, 2021"
},
{
"code": null,
"e": 140,
"s": 28,
"text": "Given an HTML document and the task is to create a JavaScript link and add it to the document using JavaScript."
},
{
"code": null,
"e": 150,
"s": 140,
"te... |
Peterson’s Algorithm in Process Synchronization | 28 Oct, 2019
Prerequisite – synchronization, Critical Section
Problem:The producer consumer problem (or bounded buffer problem) describes two processes, the producer and the consumer, which share a common, fixed-size buffer used as a queue. Producer produce an item and put it into buffer. If buffer is already full then... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Oct, 2019"
},
{
"code": null,
"e": 101,
"s": 52,
"text": "Prerequisite – synchronization, Critical Section"
},
{
"code": null,
"e": 721,
"s": 101,
"text": "Problem:The producer consumer problem (or bounded buffer... |
Observer Pattern | Set 1 (Introduction) | 01 Sep, 2021
Let us first consider the following scenario to understand observer pattern.
Scenario:
Suppose we are building a cricket app that notifies viewers about the information such as current score, run rate etc. Suppose we have made two display elements CurrentScoreDisplay and AverageScoreDisplay. CricketData ha... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n01 Sep, 2021"
},
{
"code": null,
"e": 129,
"s": 52,
"text": "Let us first consider the following scenario to understand observer pattern."
},
{
"code": null,
"e": 139,
"s": 129,
"text": "Scenario:"
},
{
"cod... |
How to remove SVG content? | 30 Jun, 2022
In order to remove SVG content, you can use the remove() function provided by D3.js. The remove() function is used along with two methods which are also provided by D3.js. Following methods are:
Using select() Method with remove() Method: The d3.select() method is used to select the first element that need... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jun, 2022"
},
{
"code": null,
"e": 223,
"s": 28,
"text": "In order to remove SVG content, you can use the remove() function provided by D3.js. The remove() function is used along with two methods which are also provided by D3.js. Fol... |
PLSQL | ADD_MONTHS Function | 24 Oct, 2019
The PLSQL ADD_MONTHS function is used to return a date with a specified number of months added to it. The ADD_MONTHS function accepts two parameters which are the initial date and the number of months to be added to it.The ADD_MONTHS function returns a value of the date data type.
The date argument can be ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Oct, 2019"
},
{
"code": null,
"e": 310,
"s": 28,
"text": "The PLSQL ADD_MONTHS function is used to return a date with a specified number of months added to it. The ADD_MONTHS function accepts two parameters which are the initial date... |
Largest and Smallest N-digit Octal Numbers | 30 Nov, 2021
Given an integer N, the task is to find the smallest and largest N-digit numbers in Octal Number System.
Examples:
Input: N = 4 Output: Largest: 7777 Smallest: 1000
Input: N = 2 Output: Largest: 77 Smallest: 10
Approach: The following steps can be followed to compute the required answer:
Largest Number... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Nov, 2021"
},
{
"code": null,
"e": 133,
"s": 28,
"text": "Given an integer N, the task is to find the smallest and largest N-digit numbers in Octal Number System."
},
{
"code": null,
"e": 144,
"s": 133,
"text": "E... |
Python | Pandas Timestamp.isoformat | 14 Jan, 2019
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.
Pandas Timestamp.isoformat() function is used to convert the given Timestamp object into the ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Jan, 2019"
},
{
"code": null,
"e": 242,
"s": 28,
"text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes imp... |
C# Program to Find Binary Equivalent of an Integer using Recursion - GeeksforGeeks | 18 Oct, 2021
Given an integer number, now we convert the given integer number into a binary number using recursion. Recursion is a method in which a function calls itself directly or indirectly and such type of function is known as a recursive function. It solves the problem very efficiently like we find the binary equ... | [
{
"code": null,
"e": 26098,
"s": 26070,
"text": "\n18 Oct, 2021"
},
{
"code": null,
"e": 26428,
"s": 26098,
"text": "Given an integer number, now we convert the given integer number into a binary number using recursion. Recursion is a method in which a function calls itself direc... |
Google’s Open Images: Now easier to download and evaluate with FiftyOne | by Eric Hofesmann | Towards Data Science | Google’s Open Images is a behemoth of a dataset. With over 9 million images, 80 million annotations, and 600 classes spanning multiple tasks, it stands to be one of the leading datasets in the computer vision community.
Working with Open Images is now easier than ever with the its integration into the open-source ML de... | [
{
"code": null,
"e": 392,
"s": 172,
"text": "Google’s Open Images is a behemoth of a dataset. With over 9 million images, 80 million annotations, and 600 classes spanning multiple tasks, it stands to be one of the leading datasets in the computer vision community."
},
{
"code": null,
"e"... |
Python | Pandas dataframe.applymap() | 16 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.
Dataframe.applymap() method applies a function that accepts and returns a scalar to every ele... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 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... |
Program to perform a letter frequency attack on a monoalphabetic substitution cipher | 19 Dec, 2021
Given a string S of size N representing a monoalphabetic cipher, the task is to print the top five possible plain texts that can be decrypted from the given monoalphabetic cipher using a letter frequency attack.
Examples:
Input: S = “ETAOINSHRDLCUMWFGYPBVKJXQZ”Output: A SIMPLE MESSAGE B TJNQMF... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n19 Dec, 2021"
},
{
"code": null,
"e": 266,
"s": 54,
"text": "Given a string S of size N representing a monoalphabetic cipher, the task is to print the top five possible plain texts that can be decrypted from the given monoalphabetic ci... |
Add and Remove Views in Android Dynamically in Kotlin? | This example demonstrates how to Add and Remove Views in Android Dynamically in Kotlin.
Step 1 − Create a new project in Android Studio, go to File ? New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8"?... | [
{
"code": null,
"e": 1275,
"s": 1187,
"text": "This example demonstrates how to Add and Remove Views in Android Dynamically in Kotlin."
},
{
"code": null,
"e": 1404,
"s": 1275,
"text": "Step 1 − Create a new project in Android Studio, go to File ? New Project and fill all require... |
What is a Loopback Address? | 24 Nov, 2021
A loopback address is a distinct reserved IP address range that starts from 127.0.0.0 ends at 127.255.255.255 though 127.255.255.255 is the broadcast address for 127.0.0.0/8. The loopback addresses are built into the IP domain system, enabling devices to transmit and receive the data packets. The loopback ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 386,
"s": 28,
"text": "A loopback address is a distinct reserved IP address range that starts from 127.0.0.0 ends at 127.255.255.255 though 127.255.255.255 is the broadcast address for 127.0.0.0/8. ... |
Locale getDefault() method in Java - GeeksforGeeks | 07 Sep, 2018
This method returns default Locale set by the Java Virtual Machine. This is static method so it can be called without creating object of the class Locale.
Syntax:
public static Locale getDefault()
Return Value: The method returns default Locale set by the Java Virtual Machine.
Below is the code to illustra... | [
{
"code": null,
"e": 24186,
"s": 24158,
"text": "\n07 Sep, 2018"
},
{
"code": null,
"e": 24341,
"s": 24186,
"text": "This method returns default Locale set by the Java Virtual Machine. This is static method so it can be called without creating object of the class Locale."
},
... |
Delete elements in range in Python | Deleting a single element from a python is straight forward by using the index of the element and the del function. But there may be scenarios when we need to delete elements for a group of indices. This article explores the approaches to delete only those elements form the list which are specified in the index list.
I... | [
{
"code": null,
"e": 1381,
"s": 1062,
"text": "Deleting a single element from a python is straight forward by using the index of the element and the del function. But there may be scenarios when we need to delete elements for a group of indices. This article explores the approaches to delete only th... |
DOM - DOMException Object | The DOMException represents an abnormal event happening when a method or a property is used.
Below table lists the properties of the DOMException object
name
Returns a DOMString that contains one of the string associated with an error constant (as seen the table below).
IndexSizeError
The index is not in the allowed ra... | [
{
"code": null,
"e": 2381,
"s": 2288,
"text": "The DOMException represents an abnormal event happening when a method or a property is used."
},
{
"code": null,
"e": 2441,
"s": 2381,
"text": "Below table lists the properties of the DOMException object"
},
{
"code": null,
... |
Working with PDF files in Python? | Python is a very versatile language as it provides huge set of libraries to work on different requirements. We all work on Portable Document Format (PDF) files. Python provides different ways to work with pdf files. In this we are going to use python library called PyPDF2 to work with pdf file.
PyPDF2 is a pure-python ... | [
{
"code": null,
"e": 1358,
"s": 1062,
"text": "Python is a very versatile language as it provides huge set of libraries to work on different requirements. We all work on Portable Document Format (PDF) files. Python provides different ways to work with pdf files. In this we are going to use python li... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.