title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Smith Number | 23 Jun, 2022
Given a number n, the task is to find out whether this number is smith or not. A Smith Number is a composite number whose sum of digits is equal to the sum of digits in its prime factorization. Examples:
Input : n = 4
Output : Yes
Prime factorization = 2, 2 and 2 + 2 = 4
Therefore, 4 is a smith number
I... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Jun, 2022"
},
{
"code": null,
"e": 256,
"s": 52,
"text": "Given a number n, the task is to find out whether this number is smith or not. A Smith Number is a composite number whose sum of digits is equal to the sum of digits in its p... |
OpenMP | Introduction with Installation Guide | 23 Apr, 2019
After a long thirst for parallelizing highly regular loops in matrix-oriented numerical programming, OpenMP was introduced by OpenMP Architecture Review Board (ARB) on 1997. In the subsequent releases, the enthusiastic OpenMP team added many features to it including the task parallelizing, support for acce... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Apr, 2019"
},
{
"code": null,
"e": 440,
"s": 28,
"text": "After a long thirst for parallelizing highly regular loops in matrix-oriented numerical programming, OpenMP was introduced by OpenMP Architecture Review Board (ARB) on 1997. I... |
Graph Matrices in Software Testing | 11 Mar, 2022
A graph matrix is a data structure that can assist in developing a tool for automation of path testing. Properties of graph matrices are fundamental for developing a test tool and hence graph matrices are very useful in understanding software testing concepts and theory.
What is a Graph Matrix ?A graph mat... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Mar, 2022"
},
{
"code": null,
"e": 300,
"s": 28,
"text": "A graph matrix is a data structure that can assist in developing a tool for automation of path testing. Properties of graph matrices are fundamental for developing a test tool... |
p5.js | textFont() Function | 16 Apr, 2020
The textFont() function in p5.js is used to specify the font that will be used to draw text using the text() function. In the WEBGL mode, only the fonts loaded by the loadFont() method are supported.
Syntax:
textFont( font, size )
Parameters: This function accepts two parameters as mentioned above and desc... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Apr, 2020"
},
{
"code": null,
"e": 228,
"s": 28,
"text": "The textFont() function in p5.js is used to specify the font that will be used to draw text using the text() function. In the WEBGL mode, only the fonts loaded by the loadFont... |
How to use Radio Component in ReactJS? | 05 May, 2021
Radio buttons allow the user to select one option from a set. Material UI for React has this component available for us and it is very easy to integrate. We can use Radio Component in ReactJS using the following approach:
Creating React Application And Installing Module:
Step 1: Create a React application ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 May, 2021"
},
{
"code": null,
"e": 276,
"s": 54,
"text": "Radio buttons allow the user to select one option from a set. Material UI for React has this component available for us and it is very easy to integrate. We can use Radio Com... |
find_element_by_class_name() driver method – Selenium Python | 15 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. After you have installed selenium and checked out – Navigating links using get method, you might want to play more with S... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Apr, 2020"
},
{
"code": null,
"e": 525,
"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 ... |
How to Use Proguard in Android Application Properly? | 19 Sep, 2021
While writing the code for your Android app, there may be some lines of code that are unnecessary and may increase the size of your app’s APK. Aside from useless code, there are numerous libraries that you may have incorporated in your program but did not use all of the functionalities that each library pr... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Sep, 2021"
},
{
"code": null,
"e": 653,
"s": 28,
"text": "While writing the code for your Android app, there may be some lines of code that are unnecessary and may increase the size of your app’s APK. Aside from useless code, there a... |
Class Based vs Function Based Views – Which One is Better to Use in Django? | 15 May, 2021
Django...We all know the popularity of this python framework all over the world. This framework has made life easier for developers. It has become easier for developers to build a full-fledged web application in Django. If you’re an experienced Django developer then surely you might have been aware of the ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n15 May, 2021"
},
{
"code": null,
"e": 466,
"s": 53,
"text": "Django...We all know the popularity of this python framework all over the world. This framework has made life easier for developers. It has become easier for developers to bu... |
How to display images in Angular2 ? | 27 Jun, 2020
We can serve an image in angular2 by first placing the image in the assets directory of your project where you can create a specific directory for the images or just keep it in the assets directory as it is.Once you have put all the required images in the assets directory open the specific component typesc... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Jun, 2020"
},
{
"code": null,
"e": 511,
"s": 28,
"text": "We can serve an image in angular2 by first placing the image in the assets directory of your project where you can create a specific directory for the images or just keep it i... |
How to create Pandas DataFrame from nested XML? | 28 Apr, 2021
In this article, we will learn how to create Pandas DataFrame from nested XML. We will use the xml.etree.ElementTree module, which is a built-in module in Python for parsing or reading information from the XML file. The ElementTree represents the XML document as a tree and the Element represents only a sin... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n28 Apr, 2021"
},
{
"code": null,
"e": 383,
"s": 54,
"text": "In this article, we will learn how to create Pandas DataFrame from nested XML. We will use the xml.etree.ElementTree module, which is a built-in module in Python for parsing ... |
Choose k array elements such that difference of maximum and minimum is minimized | 06 Jul, 2022
Given an array of n integers and a positive number k. We are allowed to take any k integers from the given array. The task is to find the minimum possible value of the difference between maximum and minimum of K numbers.
Examples:
Input : arr[] = {10, 100, 300, 200, 1000, 20, 30}
k = 3
Output : 20... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Jul, 2022"
},
{
"code": null,
"e": 273,
"s": 52,
"text": "Given an array of n integers and a positive number k. We are allowed to take any k integers from the given array. The task is to find the minimum possible value of the differ... |
Python | Deleting all occurrences of character | 25 Jun, 2022
These days string manipulation is very popular in Python, and due to its immutable character, sometimes, it becomes more important to know its working and hacks. This particular article solves the problem of deleting all occurrences of a character from a string. Let’s discuss ways in which this can be achi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Jun, 2022"
},
{
"code": null,
"e": 342,
"s": 28,
"text": "These days string manipulation is very popular in Python, and due to its immutable character, sometimes, it becomes more important to know its working and hacks. This particul... |
Make subplots span multiple grid rows and columns in Matplotlib | 29 Oct, 2021
In this article, we are going to discuss how to make subplots span multiple grid rows and columns using matplotlib module.
For Representation in Python, matplotlib library has been the workhorse for a long while now. It has held its own even after more agile opponents with simpler code interface and abilit... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Oct, 2021"
},
{
"code": null,
"e": 151,
"s": 28,
"text": "In this article, we are going to discuss how to make subplots span multiple grid rows and columns using matplotlib module."
},
{
"code": null,
"e": 647,
"s": 1... |
How to Verify the Distribution of Data using Q-Q Plots? | by Satyam Kumar | Towards Data Science | A Q-Q plot, or Quantile-Quantile plot, is a graphical method to verify the distribution of any random variable such as normal, exponential, lognormal, etc. It is a statistical approach to observe the nature of any distribution.
For example, if given a distribution need to be verified if it is a normal distribution or n... | [
{
"code": null,
"e": 400,
"s": 172,
"text": "A Q-Q plot, or Quantile-Quantile plot, is a graphical method to verify the distribution of any random variable such as normal, exponential, lognormal, etc. It is a statistical approach to observe the nature of any distribution."
},
{
"code": null,... |
1's and 2's complement of a Binary Number - GeeksforGeeks | 02 Nov, 2021
Given a Binary Number as a string, print its 1’s and 2’s complements.
1’s complement of a binary number is another binary number obtained by toggling all bits in it, i.e., transforming the 0 bit to 1 and the 1 bit to 0.
Examples:
1's complement of "0111" is "1000"
1's complement of "1100" is "0011"
2’s... | [
{
"code": null,
"e": 24828,
"s": 24800,
"text": "\n02 Nov, 2021"
},
{
"code": null,
"e": 24899,
"s": 24828,
"text": "Given a Binary Number as a string, print its 1’s and 2’s complements. "
},
{
"code": null,
"e": 25049,
"s": 24899,
"text": "1’s complement of a... |
while Loop in java | A while loop statement in Java programming language repeatedly executes a target statement as long as a given condition is true.
The syntax of a while loop is −
while(Boolean_expression) {
// Statements
}
Here, statement(s) may be a single statement or a block of statements. The condition may be any expression, and... | [
{
"code": null,
"e": 2506,
"s": 2377,
"text": "A while loop statement in Java programming language repeatedly executes a target statement as long as a given condition is true."
},
{
"code": null,
"e": 2538,
"s": 2506,
"text": "The syntax of a while loop is −"
},
{
"code":... |
Leverage on D3.js v4 to build a Network Graph for Tableau | by Charmaine Chui | Towards Data Science | So recently countries around the world are feverishly contact-tracing to control the Covid-19 infection rates. As a fellow data analyst I have been exposed to my fair share of network diagrams lately. It was intriguing to see a graph made up primarily of nodes and links to be not only aesthetically appealing but also r... | [
{
"code": null,
"e": 553,
"s": 171,
"text": "So recently countries around the world are feverishly contact-tracing to control the Covid-19 infection rates. As a fellow data analyst I have been exposed to my fair share of network diagrams lately. It was intriguing to see a graph made up primarily of ... |
LexNLP — Library For Automated Text Extraction & NER | by Rohan Gupta | Towards Data Science | A few weeks ago, I had to extract certain types of data from a set of documents and wondered what was the best way to do it. The documents were all leasing forms with data such as entity names, addresses, dates, amounts, conditions, etc.
I started out the old fashioned way, using regex to identify certain fields with t... | [
{
"code": null,
"e": 409,
"s": 171,
"text": "A few weeks ago, I had to extract certain types of data from a set of documents and wondered what was the best way to do it. The documents were all leasing forms with data such as entity names, addresses, dates, amounts, conditions, etc."
},
{
"co... |
Installation and Getting Started | You can easily install Jupyter notebook application using pip package manager.
pip3 install jupyter
To start the application, use the following command in the command prompt window.
c:\python36>jupyter notebook
The server application starts running at default port number 8888 and browser window opens to show notebook... | [
{
"code": null,
"e": 2739,
"s": 2660,
"text": "You can easily install Jupyter notebook application using pip package manager."
},
{
"code": null,
"e": 2761,
"s": 2739,
"text": "pip3 install jupyter\n"
},
{
"code": null,
"e": 2843,
"s": 2761,
"text": "To start ... |
Chomsky Normal Form | Theory of Computation
In Automata, every grammar in Chomsky Normal Form is context-free. So, every context free grammar can be converted into Chomsky Normal Form. The name Chomsky Normal Form came from Noam Chomsky, who is an American linguist, philosopher and scientist. He had modelled knowledge of the language using ... | [
{
"code": null,
"e": 112,
"s": 90,
"text": "Theory of Computation"
},
{
"code": null,
"e": 635,
"s": 112,
"text": "In Automata, every grammar in Chomsky Normal Form is context-free. So, every context free grammar can be converted into Chomsky Normal Form. The name Chomsky Normal ... |
Materialize - Chips | Materialize provides a special component called Chip, which can be used to represent a small set of information. For example, a contact, tags, etc.
chip
Set the div container as a chip.
The following example demonstrates the use of chip class to showcase creating various types of tags.
<!DOCTYPE html>
<html>
<head>
... | [
{
"code": null,
"e": 2335,
"s": 2187,
"text": "Materialize provides a special component called Chip, which can be used to represent a small set of information. For example, a contact, tags, etc."
},
{
"code": null,
"e": 2340,
"s": 2335,
"text": "chip"
},
{
"code": null,
... |
Scala Queue sum() method with example - GeeksforGeeks | 29 Oct, 2019
The sum() method is utilized to return the sum of all the elements of the queue.
Method Definition: def sum: A
Return Type: It returns the sum of all the elements of the queue.
Example #1:
// Scala program of sum() // method // Import Queue import scala.collection.mutable._ // Creating object object Gf... | [
{
"code": null,
"e": 23477,
"s": 23449,
"text": "\n29 Oct, 2019"
},
{
"code": null,
"e": 23558,
"s": 23477,
"text": "The sum() method is utilized to return the sum of all the elements of the queue."
},
{
"code": null,
"e": 23588,
"s": 23558,
"text": "Method De... |
Do I need to import the Java.lang package anytime during running a program? | No, java.lang package is a default package in Java therefore, there is no need to import it explicitly.
i.e. without importing you can access the classes of this package.
If you observe the following example here we haven’t imported the lang package explicitly but, still we are able to calculate the square root of a nu... | [
{
"code": null,
"e": 1166,
"s": 1062,
"text": "No, java.lang package is a default package in Java therefore, there is no need to import it explicitly."
},
{
"code": null,
"e": 1233,
"s": 1166,
"text": "i.e. without importing you can access the classes of this package."
},
{
... |
Predicting Hourly Energy consumption of San Diego (short & long term forecasts)— II | Towards Data Science | Part 1 of this post had covered the basics of energy (electricity) consumption, how to import, resample, and merge datasets gathered from different sources and EDA. Some inferences were also extracted from San Deigo’s energy consumption data merged with temperature and solar panels installation data.
towardsdatascience... | [
{
"code": null,
"e": 348,
"s": 46,
"text": "Part 1 of this post had covered the basics of energy (electricity) consumption, how to import, resample, and merge datasets gathered from different sources and EDA. Some inferences were also extracted from San Deigo’s energy consumption data merged with te... |
COUNTIF in 5 languages (VBA/SQL/PYTHON/M query/DAX powerBI) | by Aymen | Towards Data Science | Excel is a powerful spreadsheet used by most people working in data analysis. The increase of volume of data and development user-friendly tools is an opportunity of improvement of Excel reports by mixing them with another tool or language.
As working for a financial reporting department I faced the need to boost our r... | [
{
"code": null,
"e": 413,
"s": 172,
"text": "Excel is a powerful spreadsheet used by most people working in data analysis. The increase of volume of data and development user-friendly tools is an opportunity of improvement of Excel reports by mixing them with another tool or language."
},
{
... |
ProgressDialog in Android using Kotlin? | This example demonstrates how to show a progress dialog in Android using 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"?>
<Relat... | [
{
"code": null,
"e": 1143,
"s": 1062,
"text": "This example demonstrates how to show a progress dialog in Android using Kotlin."
},
{
"code": null,
"e": 1272,
"s": 1143,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇉ New Project and fill all required detai... |
Practice questions on Arrays in C++ | Array is a data structure that store data in the contagious memory location.
Declaring arrays
Declaring arrays is done by the following syntax :
int 1D[] - for 1-D array
int 2D[][] - for 2-D array
If you initialize an array with lesser number of elements, rest are initialized with 0.
Memory address of elements of the a... | [
{
"code": null,
"e": 1139,
"s": 1062,
"text": "Array is a data structure that store data in the contagious memory location."
},
{
"code": null,
"e": 1156,
"s": 1139,
"text": "Declaring arrays"
},
{
"code": null,
"e": 1259,
"s": 1156,
"text": "Declaring arrays ... |
Scala - Lists | Scala Lists are quite similar to arrays which means, all the elements of a list have the same type but there are two important differences. First, lists are immutable, which means elements of a list cannot be changed by assignment. Second, lists represent a linked list whereas arrays are flat.
The type of a list that h... | [
{
"code": null,
"e": 2293,
"s": 1998,
"text": "Scala Lists are quite similar to arrays which means, all the elements of a list have the same type but there are two important differences. First, lists are immutable, which means elements of a list cannot be changed by assignment. Second, lists represe... |
Maximum Product Subarray | Practice | GeeksforGeeks | Given an array Arr[] that contains N integers (may be positive, negative or zero). Find the product of the maximum product subarray.
Example 1:
Input:
N = 5
Arr[] = {6, -3, -10, 0, 2}
Output: 180
Explanation: Subarray with maximum product
is [6, -3, -10] which gives product as 180.
Example 2:
Input:
N = 6
Arr[] = {2, ... | [
{
"code": null,
"e": 371,
"s": 238,
"text": "Given an array Arr[] that contains N integers (may be positive, negative or zero). Find the product of the maximum product subarray."
},
{
"code": null,
"e": 382,
"s": 371,
"text": "Example 1:"
},
{
"code": null,
"e": 522,
... |
Check if two trees have same structure - GeeksforGeeks | 08 Apr, 2022
Given two binary trees. The task is to write a program to check if the two trees are identical in structure.
In the above figure both of the trees, Tree1 and Tree2 are identical in structure. That is, they have the same structure.Note: This problem is different from Check if two trees are identical as her... | [
{
"code": null,
"e": 25034,
"s": 25006,
"text": "\n08 Apr, 2022"
},
{
"code": null,
"e": 25144,
"s": 25034,
"text": "Given two binary trees. The task is to write a program to check if the two trees are identical in structure. "
},
{
"code": null,
"e": 25435,
"s": ... |
MySQL - SUM rows with same ID? | To sum rows with same ID, use the GROUP BY HAVING clause.
Let us create a table −
mysql> create table demo84
-> (
-> id int,
-> price int
-> )
-> ;
Query OK, 0 rows affected (0.60
Insert some records into the table with the help of insert command −
mysql> insert into demo84 values(1,2000);
Query OK, 1 ro... | [
{
"code": null,
"e": 1120,
"s": 1062,
"text": "To sum rows with same ID, use the GROUP BY HAVING clause."
},
{
"code": null,
"e": 1144,
"s": 1120,
"text": "Let us create a table −"
},
{
"code": null,
"e": 1257,
"s": 1144,
"text": "mysql> create table demo84\n ... |
A Real-World Application of Vector Autoregressive (VAR) model | by Mohammad Masum, PhD | Towards Data Science | Multivariate Time Series Analysis
A univariate time series data contains only one single time-dependent variable while a multivariate time series data consists of multiple time-dependent variables. We generally use multivariate time series analysis to model and explain the interesting interdependencies and co-movements... | [
{
"code": null,
"e": 206,
"s": 172,
"text": "Multivariate Time Series Analysis"
},
{
"code": null,
"e": 999,
"s": 206,
"text": "A univariate time series data contains only one single time-dependent variable while a multivariate time series data consists of multiple time-dependent... |
CoffeeScript - Conditionals | While programming, we encounter some scenarios where we have to choose a path from a given set of paths. In such situations, we need conditional statements. Conditional statements help us take decisions and perform right actions.
Following is the general form of a typical decision-making structure found in most of the ... | [
{
"code": null,
"e": 2539,
"s": 2309,
"text": "While programming, we encounter some scenarios where we have to choose a path from a given set of paths. In such situations, we need conditional statements. Conditional statements help us take decisions and perform right actions."
},
{
"code": n... |
Text Analysis & Feature Engineering with NLP | by Mauro Di Pietro | Towards Data Science | In this article, using NLP and Python, I will explain how to analyze text data and extract features for your machine learning model.
NLP (Natural Language Processing) is a field of artificial intelligence that studies the interactions between computers and human languages, in particular how to program computers to proc... | [
{
"code": null,
"e": 304,
"s": 171,
"text": "In this article, using NLP and Python, I will explain how to analyze text data and extract features for your machine learning model."
},
{
"code": null,
"e": 846,
"s": 304,
"text": "NLP (Natural Language Processing) is a field of artif... |
Program to find minimum swaps needed to group all 1s together in Python | Suppose we have a binary string, we have to find the minimum number of swaps needed to group all 1’s together in any place in the string. So if the input is like "10101001101", then the output will be 3, as possible solution is "00000111111".
To solve this, we will follow these steps −
data := a list of bits from the g... | [
{
"code": null,
"e": 1305,
"s": 1062,
"text": "Suppose we have a binary string, we have to find the minimum number of swaps needed to group all 1’s together in any place in the string. So if the input is like \"10101001101\", then the output will be 3, as possible solution is \"00000111111\"."
},
... |
4 Machine Learning System Architectures | by Kurtis Pykes | Towards Data Science | I’m a big advocate for learning by doing, and it just so turns out that it’s probably the best way to learn machine learning. If you’re a machine learning engineer (and possibly a Data Scientists), you may never quite feel fulfilled when a project ends at the model evaluation phase of the Machine Learning Workflow, as ... | [
{
"code": null,
"e": 633,
"s": 171,
"text": "I’m a big advocate for learning by doing, and it just so turns out that it’s probably the best way to learn machine learning. If you’re a machine learning engineer (and possibly a Data Scientists), you may never quite feel fulfilled when a project ends at... |
How to make textarea 100% without overflow when padding is present ? | 14 Jan, 2022
If we have given an HTML document containing <textarea> element and its parent element contains some padding then how to make textarea width to 100%. textarea contains. The idea is to create a div with the class name “wrapper”. Inside that <div> element, we create a text area with a certain number of colum... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Jan, 2022"
},
{
"code": null,
"e": 469,
"s": 28,
"text": "If we have given an HTML document containing <textarea> element and its parent element contains some padding then how to make textarea width to 100%. textarea contains. The id... |
Choose X such that (A xor X) + (B xor X) is minimized | 26 Nov, 2021
Given two integers A and B. The task is to choose an integer X such that (A xor X) + (B xor X) is the minimum possible.
Examples:
Input: A = 2, B = 3 Output: X = 2, Sum = 1
Input: A = 7, B = 8 Output: X = 0, Sum = 15
A simple solution is to generate all possible sum by taking xor of A and B with all poss... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Nov, 2021"
},
{
"code": null,
"e": 148,
"s": 28,
"text": "Given two integers A and B. The task is to choose an integer X such that (A xor X) + (B xor X) is the minimum possible."
},
{
"code": null,
"e": 159,
"s": 148,... |
StringBuffer deleteCharAt() Method in Java with Examples | 06 Dec, 2018
The Java.lang.StringBuffer.deleteCharAt() is a built-in Java method which removes the char at the specified position in this sequence. So that the sequence is reduced by 1 char.
Syntax:
public StringBuffer deleteCharAt(int indexpoint)
Parameters : The method accepts a single parameter indexpoint of integer... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n06 Dec, 2018"
},
{
"code": null,
"e": 231,
"s": 53,
"text": "The Java.lang.StringBuffer.deleteCharAt() is a built-in Java method which removes the char at the specified position in this sequence. So that the sequence is reduced by 1 ch... |
Javascript | Math.sign( ) Function | 09 Feb, 2022
The Math.sign() is a builtin function in JavaScript and is used to know the sign of a number, indicating whether the number specified is negative or positive.
Syntax:
Math.sign(number)
Parameters: This function accepts a single parameter number which represents the number whose sign you want to know.
Retur... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Feb, 2022"
},
{
"code": null,
"e": 187,
"s": 28,
"text": "The Math.sign() is a builtin function in JavaScript and is used to know the sign of a number, indicating whether the number specified is negative or positive."
},
{
"c... |
Find the levels of factor of a given vector in R | 23 May, 2021
Factors are the objects which are used to categorize the data and display the data as levels. The objects can be integer, character. They can be used to find the unique values in the given vector. The resulting data is known as levels. Factors are useful in statistical analysis in analyzing the categorical... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 May, 2021"
},
{
"code": null,
"e": 479,
"s": 28,
"text": "Factors are the objects which are used to categorize the data and display the data as levels. The objects can be integer, character. They can be used to find the unique values... |
Left pad an integer in Java with zeros | Let us see an example first to understand how an integer looks with left padding −
888 //left padding with spaces
0000000999 //left padding with 7 zeros
Let us see an example to left pad a number with zero −
Live Demo
public class Demo {
public static void main(String[] args) {
int val = 9899;
System.ou... | [
{
"code": null,
"e": 1145,
"s": 1062,
"text": "Let us see an example first to understand how an integer looks with left padding −"
},
{
"code": null,
"e": 1215,
"s": 1145,
"text": "888 //left padding with spaces\n0000000999 //left padding with 7 zeros"
},
{
"code": null,
... |
How to save a plot in Seaborn with Python (Matplotlib)? | To save a plot in Seaborn, we can use the savefig() method.
Set the figure size and adjust the padding between and around the subplots.
Make a two-dimensional, size-mutable, potentially heterogeneous tabular data.
Plot pairwise relationships in a dataset.
Save the plot into a file using savefig() method.
To display the... | [
{
"code": null,
"e": 1122,
"s": 1062,
"text": "To save a plot in Seaborn, we can use the savefig() method."
},
{
"code": null,
"e": 1198,
"s": 1122,
"text": "Set the figure size and adjust the padding between and around the subplots."
},
{
"code": null,
"e": 1276,
... |
Reloading modules in Python? | The reload() - reloads a previously imported module or loaded module. This comes handy in a situation where you repeatedly run a test script during an interactive session, it always uses the first version of the modules we are developing, even we have mades changes to the code. In that scenario we need to make sure tha... | [
{
"code": null,
"e": 1406,
"s": 1062,
"text": "The reload() - reloads a previously imported module or loaded module. This comes handy in a situation where you repeatedly run a test script during an interactive session, it always uses the first version of the modules we are developing, even we have m... |
Face Mask Detection using YOLOv5. COVID-19: Guide to build a face mask... | by Àlex Escolà Nixon | Towards Data Science | In this post, we’ll be going through a step-by-step guide on how to train a YOLOv5 model to detect whether people are wearing a mask or not on a video stream.
We’ll start by going through some basic concepts behind object detection models and motivate the use of YOLOv5 for this problem.
From there, we’ll review the dat... | [
{
"code": null,
"e": 330,
"s": 171,
"text": "In this post, we’ll be going through a step-by-step guide on how to train a YOLOv5 model to detect whether people are wearing a mask or not on a video stream."
},
{
"code": null,
"e": 459,
"s": 330,
"text": "We’ll start by going throug... |
java.util.regex.Matcher.quoteReplacement() | The java.time.Matcher.quoteReplacement(String s) method returns a literal replacement String for the specified String.
Following is the declaration for java.time.Matcher.quoteReplacement(String s) method.
public static String quoteReplacement(String s)
s − The string to be literalized.
s − The string to be literalized... | [
{
"code": null,
"e": 2243,
"s": 2124,
"text": "The java.time.Matcher.quoteReplacement(String s) method returns a literal replacement String for the specified String."
},
{
"code": null,
"e": 2329,
"s": 2243,
"text": "Following is the declaration for java.time.Matcher.quoteReplace... |
The Zen of Python: A guide to Python’s design principles | by Vishal Sharma | Towards Data Science | A Pythoneer once wrote 20 aphorisms stating how one can write beautiful and clean code with Python. Came to be known as “The Zen of Python”, these aphorisms exploded amongst Python developers. Tim Peters wrote these BDFL’s (Benevolent Dictator For Life, a nickname of Python creator Guido van Rossum) 20 guiding principl... | [
{
"code": null,
"e": 572,
"s": 171,
"text": "A Pythoneer once wrote 20 aphorisms stating how one can write beautiful and clean code with Python. Came to be known as “The Zen of Python”, these aphorisms exploded amongst Python developers. Tim Peters wrote these BDFL’s (Benevolent Dictator For Life, a... |
Apache Commons IO - IOUtils | IOUtils provide utility methods for reading, writing and copying files. The methods work with InputStream, OutputStream, Reader and Writer.
Following is the declaration for org.apache.commons.io.IOUtils Class −
public class IOUtils
extends Object
The features of IOUtils are given below −
Provides static utility met... | [
{
"code": null,
"e": 2544,
"s": 2404,
"text": "IOUtils provide utility methods for reading, writing and copying files. The methods work with InputStream, OutputStream, Reader and Writer."
},
{
"code": null,
"e": 2615,
"s": 2544,
"text": "Following is the declaration for org.apach... |
Spring OXM - Quick Guide | The Spring Framework provides Object/XML or O/X mapping using global marshaller/unmarshaller interfaces and allows to switch O/X mapping frameworks easily. This process of converting an object to XML is called XML Marshalling/Serialization and conversion from XML to object is called XML Demarshalling/Deserialization.
S... | [
{
"code": null,
"e": 2223,
"s": 1904,
"text": "The Spring Framework provides Object/XML or O/X mapping using global marshaller/unmarshaller interfaces and allows to switch O/X mapping frameworks easily. This process of converting an object to XML is called XML Marshalling/Serialization and conversio... |
Avoid R-squared to judge regression model performance | by Kevin Dunn | Towards Data Science | Summary
R2 can be calculated before even fitting a regression model, which doesn’t make sense then to use it for judging prediction ability. Also you get the same R2 value if you flip the input and output around. Again, this is nonsensical for a prediction metric.
The intention of your regression model is the important... | [
{
"code": null,
"e": 179,
"s": 171,
"text": "Summary"
},
{
"code": null,
"e": 436,
"s": 179,
"text": "R2 can be calculated before even fitting a regression model, which doesn’t make sense then to use it for judging prediction ability. Also you get the same R2 value if you flip th... |
Saliency Map Using PyTorch | Towards Data Science | When we use machine learning models such as Logistic Regression or Decision Tree, we can interpret which variables contribute to the prediction result. But, this step will be difficult when we are using deep learning model.
Deep Learning model is a black-box model. It means that we cannot analyze how the model can pred... | [
{
"code": null,
"e": 395,
"s": 171,
"text": "When we use machine learning models such as Logistic Regression or Decision Tree, we can interpret which variables contribute to the prediction result. But, this step will be difficult when we are using deep learning model."
},
{
"code": null,
... |
Maximum Spanning Tree using Prim’s Algorithm - GeeksforGeeks | 10 Nov, 2021
Given undirected weighted graph G, the task is to find the Maximum Spanning Tree of the Graph using Prim’s Algorithm
Prims algorithm is a Greedy algorithm which can be used to find the Minimum Spanning Tree (MST) as well as the Maximum Spanning Tree of a Graph.
Examples:
Input: graph[V][V] = {{0, 2, 0, 6, ... | [
{
"code": null,
"e": 24701,
"s": 24673,
"text": "\n10 Nov, 2021"
},
{
"code": null,
"e": 24818,
"s": 24701,
"text": "Given undirected weighted graph G, the task is to find the Maximum Spanning Tree of the Graph using Prim’s Algorithm"
},
{
"code": null,
"e": 24963,
... |
Basics of GIFs with Python’s Matplotlib | by Thiago Carvalho | Towards Data Science | There are plenty of ways to build animations in Matplotlib. They even have an Animation class with functions and methods to support this task.
But I often find those methods over-complicated, and many times I want to get something together without too much complexity.
In this article, I’ll go through the basics of crea... | [
{
"code": null,
"e": 314,
"s": 171,
"text": "There are plenty of ways to build animations in Matplotlib. They even have an Animation class with functions and methods to support this task."
},
{
"code": null,
"e": 440,
"s": 314,
"text": "But I often find those methods over-complic... |
Python - Object Oriented | Python has been an object-oriented language since it existed. Because of this, creating and using classes and objects are downright easy. This chapter helps you become an expert in using Python's object-oriented programming support.
If you do not have any previous experience with object-oriented (OO) programming, you m... | [
{
"code": null,
"e": 2477,
"s": 2244,
"text": "Python has been an object-oriented language since it existed. Because of this, creating and using classes and objects are downright easy. This chapter helps you become an expert in using Python's object-oriented programming support."
},
{
"code"... |
How to work with document.head in JavaScript? | Use the document.head property in JavaScript to get the id of the <head> tag of the document. You can try to run the following code to implement document.head property in JavaScript −
Live Demo
<!DOCTYPE html>
<html>
<head id = "myid">
<title>JavaScript Example</title>
</head>
<body>
<h1>Employee ... | [
{
"code": null,
"e": 1246,
"s": 1062,
"text": "Use the document.head property in JavaScript to get the id of the <head> tag of the document. You can try to run the following code to implement document.head property in JavaScript −"
},
{
"code": null,
"e": 1257,
"s": 1246,
"text":... |
Multi Class Text Classification With Deep Learning Using BERT | by Susan Li | Towards Data Science | Most of the researchers submit their research papers to academic conference because its a faster way of making the results available. Finding and selecting a suitable conference has always been challenging especially for young researchers.
However, based on the previous conferences proceeding data, the researchers can ... | [
{
"code": null,
"e": 411,
"s": 171,
"text": "Most of the researchers submit their research papers to academic conference because its a faster way of making the results available. Finding and selecting a suitable conference has always been challenging especially for young researchers."
},
{
"... |
Rexx - pull | This is used to pull input from the stack or from the default stream.
Pull variable
Variable − The variable to which the input value will be assigned to.
Variable − The variable to which the input value will be assigned to.
None
/* Main program */
options arexx_bifs
pull input
say input
When you run the above pro... | [
{
"code": null,
"e": 2409,
"s": 2339,
"text": "This is used to pull input from the stack or from the default stream."
},
{
"code": null,
"e": 2425,
"s": 2409,
"text": "Pull variable \n"
},
{
"code": null,
"e": 2495,
"s": 2425,
"text": "Variable − The variable ... |
Maximum absolute difference of value and index sums in C | We are given with an array of integers. The task is to calculate the maximum absolute difference of value and index sums. That is for each pair of indexes (i,j) in an array, we have to calculate | Arr[i] - A[j] | + |i-j| and find the maximum such sum possible. Here |A| means absolute value of A. If array has 4 elements... | [
{
"code": null,
"e": 1507,
"s": 1062,
"text": "We are given with an array of integers. The task is to calculate the maximum absolute difference of value and index sums. That is for each pair of indexes (i,j) in an array, we have to calculate | Arr[i] - A[j] | + |i-j| and find the maximum such sum po... |
Implementing Linear and Polynomial Regression From Scratch | by Chris Tam | Towards Data Science | In this tutorial, we’ll go through how to implement a simple linear regression model using a least squares approach to fit the data. After that, we’ll extend the model to a polynomial regression model in order to capture more complex signals. We’ll be using the mean squared error to measure the quality of fit for every... | [
{
"code": null,
"e": 599,
"s": 172,
"text": "In this tutorial, we’ll go through how to implement a simple linear regression model using a least squares approach to fit the data. After that, we’ll extend the model to a polynomial regression model in order to capture more complex signals. We’ll be usi... |
Python PostgreSQL - Create Table | You can create a new table in a database in PostgreSQL using the CREATE TABLE statement. While executing this you need to specify the name of the table, column names and their data types.
Following is the syntax of the CREATE TABLE statement in PostgreSQL.
CREATE TABLE table_name(
column1 datatype,
column2 dataty... | [
{
"code": null,
"e": 3393,
"s": 3205,
"text": "You can create a new table in a database in PostgreSQL using the CREATE TABLE statement. While executing this you need to specify the name of the table, column names and their data types."
},
{
"code": null,
"e": 3462,
"s": 3393,
"te... |
Sort items in a Java TreeSet | First, create a TreeSet and add elements to it −
TreeSet<String> set = new TreeSet<String>();
set.add("65");
set.add("45");
set.add("19");
set.add("27");
set.add("89");
set.add("57");
Now, sort it in ascending order, which is the default −
Iterator<String> i = set.iterator();
while(i.hasNext()){
System.out.println(i... | [
{
"code": null,
"e": 1111,
"s": 1062,
"text": "First, create a TreeSet and add elements to it −"
},
{
"code": null,
"e": 1246,
"s": 1111,
"text": "TreeSet<String> set = new TreeSet<String>();\nset.add(\"65\");\nset.add(\"45\");\nset.add(\"19\");\nset.add(\"27\");\nset.add(\"89\")... |
Protein Sequence Classification. A case study on Pfam dataset to... | by Ronak Vijay | Towards Data Science | Proteins are large, complex biomolecules that play many critical roles in biological bodies. Proteins are made up of one or more long chains of amino acid sequences. These Sequences are the arrangement of amino acids in a protein, held together by peptide bonds. Proteins can be made from 20 different kinds of amino aci... | [
{
"code": null,
"e": 629,
"s": 172,
"text": "Proteins are large, complex biomolecules that play many critical roles in biological bodies. Proteins are made up of one or more long chains of amino acid sequences. These Sequences are the arrangement of amino acids in a protein, held together by peptide... |
How does tuple comparison work in Python? | Tuples are compared position by position: the first item of the first tuple is compared to the first item of the second tuple; if they are not equal, this is the result of the comparison, else the second item is considered, then the third and so on.
>>> a = (1, 2, 3)
>>> b = (1, 2, 5)
>>> a < b
True
There is another t... | [
{
"code": null,
"e": 1313,
"s": 1062,
"text": "Tuples are compared position by position: the first item of the first tuple is compared to the first item of the second tuple; if they are not equal, this is the result of the comparison, else the second item is considered, then the third and so on. "
... |
How to set color opacity with RGBA in CSS? - GeeksforGeeks | 26 Apr, 2021
In this article, we will see how to set the color opacity with RGBA in CSS. RGBA is a color format, basically containing values for red, green, blue respectively and ‘A’ in RGBA stands for Alpha. To set the opacity of color we mainly change the value of alpha. The value of alpha varies from 0.0 (fully tran... | [
{
"code": null,
"e": 25321,
"s": 25293,
"text": "\n26 Apr, 2021"
},
{
"code": null,
"e": 25660,
"s": 25321,
"text": "In this article, we will see how to set the color opacity with RGBA in CSS. RGBA is a color format, basically containing values for red, green, blue respectively a... |
How to add image to ggplot2 in R ? - GeeksforGeeks | 17 Jun, 2021
In this article, we will discuss how to insert or add an image into a plot using ggplot2 in R Programming Language.
The ggplot() method of this package is used to initialize a ggplot object. It can be used to declare the input data frame for a graphic and can also be used to specify the set of plot aesthet... | [
{
"code": null,
"e": 24851,
"s": 24823,
"text": "\n17 Jun, 2021"
},
{
"code": null,
"e": 24967,
"s": 24851,
"text": "In this article, we will discuss how to insert or add an image into a plot using ggplot2 in R Programming Language."
},
{
"code": null,
"e": 25295,
... |
How to make a GridLayout fit screen size in Android? | This example demonstrates how How to make a GridLayout fit screen size 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"?>
<Gri... | [
{
"code": null,
"e": 1145,
"s": 1062,
"text": "This example demonstrates how How to make a GridLayout fit screen size in Android."
},
{
"code": null,
"e": 1274,
"s": 1145,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required det... |
Flutter - Animation | Animation is a complex procedure in any mobile application. In spite of its complexity, Animation enhances the user experience to a new level and provides a rich user interaction. Due to its richness, animation becomes an integral part of modern mobile application. Flutter framework recognizes the importance of Animati... | [
{
"code": null,
"e": 2623,
"s": 2218,
"text": "Animation is a complex procedure in any mobile application. In spite of its complexity, Animation enhances the user experience to a new level and provides a rich user interaction. Due to its richness, animation becomes an integral part of modern mobile ... |
Angular Material - Content | The md-content, an Angular Directive, is a container element and is used for scrollable content. The layout-padding attribute can be added to have padded content.
The following example shows the use of md-content directive and also the use of angular content display.
am_content.htm
<html lang = "en">
<head>
<l... | [
{
"code": null,
"e": 2353,
"s": 2190,
"text": "The md-content, an Angular Directive, is a container element and is used for scrollable content. The layout-padding attribute can be added to have padded content."
},
{
"code": null,
"e": 2458,
"s": 2353,
"text": "The following examp... |
MySQL - STR_TO_DATE() Function | The DATE, DATETIME and TIMESTAMP datatypes in MySQL are used to store the date, date and time, time stamp values respectively. Where a time stamp is a numerical value representing the number of milliseconds from '1970-01-01 00:00:01' UTC (epoch) to the specified time. MySQL provides a set of functions to manipulate the... | [
{
"code": null,
"e": 2664,
"s": 2333,
"text": "The DATE, DATETIME and TIMESTAMP datatypes in MySQL are used to store the date, date and time, time stamp values respectively. Where a time stamp is a numerical value representing the number of milliseconds from '1970-01-01 00:00:01' UTC (epoch) to the ... |
C/C++ Program for Greedy Algorithm to find Minimum number of Coins | A greedy algorithm is an algorithm used to find an optimal solution for the given problem. greedy algorithm works by finding locally optimal solutions ( optimal solution for a part of the problem) of each part so show the Global optimal solution could be found.
In this problem, we will use a greedy algorithm to find th... | [
{
"code": null,
"e": 1324,
"s": 1062,
"text": "A greedy algorithm is an algorithm used to find an optimal solution for the given problem. greedy algorithm works by finding locally optimal solutions ( optimal solution for a part of the problem) of each part so show the Global optimal solution could b... |
MySQL Aliases | Aliases are used to give a table, or a column in a table, a temporary name.
Aliases are often used to make column names more readable.
An alias only exists for the duration of that query.
An alias is created with the AS keyword.
In this tutorial we will use the well-known Northwind sample database.
Below is a selection... | [
{
"code": null,
"e": 76,
"s": 0,
"text": "Aliases are used to give a table, or a column in a table, a temporary name."
},
{
"code": null,
"e": 135,
"s": 76,
"text": "Aliases are often used to make column names more readable."
},
{
"code": null,
"e": 188,
"s": 135,... |
Python – Merge Dictionaries List with duplicate Keys | When it is required to merge dictionaries list with duplicate keys, the keys of the strings are iterated over and depending on the condition, the result is determined.
Below is a demonstration of the same
my_list_1 = [{"aba": 1, "best": 4}, {"python": 10, "fun": 15}, {"scala": "fun"}]
my_list_2 = [{"scala": 6}, {"pyth... | [
{
"code": null,
"e": 1230,
"s": 1062,
"text": "When it is required to merge dictionaries list with duplicate keys, the keys of the strings are iterated over and depending on the condition, the result is determined."
},
{
"code": null,
"e": 1267,
"s": 1230,
"text": "Below is a dem... |
Number Pattern | Practice | GeeksforGeeks | For a given number N. Print the pattern in the following form: 1 121 12321 1234321 for N = 4.
Example 1:
Input:
N = 3
Output:
1 121 12321
Explanation:
For N = 3 we will print the 3 strings
according to the pattern.
Example 2:
Input:
N = 6
Output:
1 121 12321 1234321 123454321 12345654321
Explanation:
For N = 6 we will... | [
{
"code": null,
"e": 320,
"s": 226,
"text": "For a given number N. Print the pattern in the following form: 1 121 12321 1234321 for N = 4."
},
{
"code": null,
"e": 331,
"s": 320,
"text": "Example 1:"
},
{
"code": null,
"e": 442,
"s": 331,
"text": "Input:\nN = ... |
How to programmatically add buttons into a layout one by one in several lines in Android | This example demonstrates how do I programmatically add buttons into a layout one by one several lines 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 versi... | [
{
"code": null,
"e": 1177,
"s": 1062,
"text": "This example demonstrates how do I programmatically add buttons into a layout one by one several lines in android."
},
{
"code": null,
"e": 1306,
"s": 1177,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New P... |
IDE | GeeksforGeeks | A computer science portal for geeks | Please enter your email address or userHandle. | [] |
MySQL show tables sort by table name? | You can sort the table_name property from INFORMATION_SCHEMA.TABLES with ORDER BY clause. Sort in ascending order or descending order with the help of ASC or DESC respectively. The syntax is as follows −
SELECT table_name
FROM information_schema.tables
WHERE table_type = 'BASE TABLE' AND table_schema='yourDatabaseName'... | [
{
"code": null,
"e": 1266,
"s": 1062,
"text": "You can sort the table_name property from INFORMATION_SCHEMA.TABLES with ORDER BY clause. Sort in ascending order or descending order with the help of ASC or DESC respectively. The syntax is as follows −"
},
{
"code": null,
"e": 1409,
"s... |
How to validate HTML tag using Regular Expression - GeeksforGeeks | 04 Feb, 2021
Given string str, the task is to check whether it is a valid HTML tag or not by using Regular Expression.The valid HTML tag must satisfy the following conditions:
It should start with an opening tag (<).It should be followed by a double quotes string or single quotes string.It should not allow one double ... | [
{
"code": null,
"e": 24581,
"s": 24553,
"text": "\n04 Feb, 2021"
},
{
"code": null,
"e": 24745,
"s": 24581,
"text": "Given string str, the task is to check whether it is a valid HTML tag or not by using Regular Expression.The valid HTML tag must satisfy the following conditions: ... |
Complete Step-by-Step Gradient Descent Algorithm from Scratch | by Albers Uzila | Towards Data Science | Table of Contents (read till the end to see how you can get the complete python code of this story)· What is Optimization?· Gradient Descent (the Easy Way)· Armijo Line Search· Gradient Descent (the Hard Way)· Conclusion
If you’ve been studying machine learning long enough, you’ve probably heard terms such as SGD or Ad... | [
{
"code": null,
"e": 392,
"s": 171,
"text": "Table of Contents (read till the end to see how you can get the complete python code of this story)· What is Optimization?· Gradient Descent (the Easy Way)· Armijo Line Search· Gradient Descent (the Hard Way)· Conclusion"
},
{
"code": null,
"e... |
Recommend using Scikit-Learn and Tensorflow Recommender | by Jesko Rehberg | Towards Data Science | Motivation:
We will learn how to recommend sales items to customers, looking at customer’s individual purchase history. In my previous post I explained many concepts of recommending engines in detail:
towardsdatascience.com
This post focuses on recommending using Scikit-Learn and Tensorflow Recommender.
Solution:
First... | [
{
"code": null,
"e": 184,
"s": 172,
"text": "Motivation:"
},
{
"code": null,
"e": 373,
"s": 184,
"text": "We will learn how to recommend sales items to customers, looking at customer’s individual purchase history. In my previous post I explained many concepts of recommending engi... |
Dask DataFrames — How to Run Pandas in Parallel With Ease | by Dario Radečić | Towards Data Science | So you have some experience with Pandas, and you’re aware of its biggest limitation — it doesn’t scale all that easily. Is there a solution?
Yes — Dask Data Frames.
Most of Dask API is identical to Pandas, but Dask can run in parallel on all CPU cores. It can even run on a cluster, but that’s a topic for another time.
... | [
{
"code": null,
"e": 313,
"s": 172,
"text": "So you have some experience with Pandas, and you’re aware of its biggest limitation — it doesn’t scale all that easily. Is there a solution?"
},
{
"code": null,
"e": 337,
"s": 313,
"text": "Yes — Dask Data Frames."
},
{
"code":... |
Redis - Lists | Redis Lists are simply lists of strings, sorted by insertion order. You can add elements in Redis lists in the head or the tail of the list.
Maximum length of a list is 232 - 1 elements (4294967295, more than 4 billion of elements per list).
redis 127.0.0.1:6379> LPUSH tutorials redis
(integer) 1
redis 127.0.0.1:6379... | [
{
"code": null,
"e": 2186,
"s": 2045,
"text": "Redis Lists are simply lists of strings, sorted by insertion order. You can add elements in Redis lists in the head or the tail of the list."
},
{
"code": null,
"e": 2287,
"s": 2186,
"text": "Maximum length of a list is 232 - 1 eleme... |
Python os.dup2() Method | Python method dup2() duplicates file descriptor fd to fd2, closing the latter first if necessary.
Note − New file description would be assigned only when it is available. In the following example given below, 1000 would be assigned as a duplicate fd in case when 1000 is available.
Following is the syntax for dup2() met... | [
{
"code": null,
"e": 2342,
"s": 2244,
"text": "Python method dup2() duplicates file descriptor fd to fd2, closing the latter first if necessary."
},
{
"code": null,
"e": 2526,
"s": 2342,
"text": "Note − New file description would be assigned only when it is available. In the foll... |
Visualizing High Dimensional Data | by Himanshu Sharma | Towards Data Science | Data visualization helps in identifying hidden patterns, associations, and trends between different columns of data. We create different types of charts, plots, graphs, etc. in order to understand what data is all about and how different columns are related to each other.
It is easy to visualize data that have lower di... | [
{
"code": null,
"e": 444,
"s": 171,
"text": "Data visualization helps in identifying hidden patterns, associations, and trends between different columns of data. We create different types of charts, plots, graphs, etc. in order to understand what data is all about and how different columns are relat... |
Different ways to start a Task in C# | To start a task in C#, follow any of the below given ways.
Use a delegate to start a task.
Task t = new Task(delegate { PrintMessage(); });
t.Start();
Use Task Factory to start a task.
Task.Factory.StartNew(() => {Console.WriteLine("Welcome!"); });
You can also use Lambda.
Task t = new Task( () => PrintMessage() );
t... | [
{
"code": null,
"e": 1121,
"s": 1062,
"text": "To start a task in C#, follow any of the below given ways."
},
{
"code": null,
"e": 1153,
"s": 1121,
"text": "Use a delegate to start a task."
},
{
"code": null,
"e": 1214,
"s": 1153,
"text": "Task t = new Task(de... |
MySQL SELECT from two tables with a single query | Use UNION to select from two tables. Let us first create a table −
mysql> create table DemoTable1
(
Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
FirstName varchar(20)
);
Query OK, 0 rows affected (0.90 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable1(FirstName) values('Chr... | [
{
"code": null,
"e": 1129,
"s": 1062,
"text": "Use UNION to select from two tables. Let us first create a table −"
},
{
"code": null,
"e": 1274,
"s": 1129,
"text": "mysql> create table DemoTable1\n(\n Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,\n FirstName varchar(20)\n);\nQu... |
Explain JavaScript "this" keyword? | The JavaScript this keyword references the object to which it belongs. It can refer to the global object if alone or inside a function. It refers to the owner object if inside a method and refers to the HTML element that received the event in an event listener.
Following is the code for the JavaScript this Identifier −... | [
{
"code": null,
"e": 1324,
"s": 1062,
"text": "The JavaScript this keyword references the object to which it belongs. It can refer to the global object if alone or inside a function. It refers to the owner object if inside a method and refers to the HTML element that received the event in an event l... |
Add Two Numbers in Python | Suppose we have given two non-empty linked lists. These two lists are representing two non-negative integer numbers. The digits are stored in reverse order. Each of their nodes contains only one digit. Add the two numbers and return the result as a linked list. We are taking the assumption that the two numbers do not c... | [
{
"code": null,
"e": 1546,
"s": 1062,
"text": "Suppose we have given two non-empty linked lists. These two lists are representing two non-negative integer numbers. The digits are stored in reverse order. Each of their nodes contains only one digit. Add the two numbers and return the result as a link... |
Scala - Operators | An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. Scala is rich in built-in operators and provides the following types of operators −
Arithmetic Operators
Relational Operators
Logical Operators
Bitwise Operators
Assignment Operators
This chapter will examine the ... | [
{
"code": null,
"e": 2189,
"s": 1998,
"text": "An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. Scala is rich in built-in operators and provides the following types of operators −"
},
{
"code": null,
"e": 2210,
"s": 2189,
... |
CharMatcher Class in Java | The CharMatcher class determines a true or false value for any Java char value, just as Predicate does for any Object.
Create the following java program using any editor of your choice in say C:/> Guava.
Following is the GuavaTester.java code −
import com.google.common.base.CharMatcher;
import com.google.common.base.Sp... | [
{
"code": null,
"e": 1181,
"s": 1062,
"text": "The CharMatcher class determines a true or false value for any Java char value, just as Predicate does for any Object."
},
{
"code": null,
"e": 1266,
"s": 1181,
"text": "Create the following java program using any editor of your choi... |
JavaScript String - split() Method | This method splits a String object into an array of strings by separating the string into substrings.
Its syntax is as follows −
string.split([separator][, limit]);
separator − Specifies the character to use for separating the string. If separator is omitted, the array returned contains one element consisting of the e... | [
{
"code": null,
"e": 2568,
"s": 2466,
"text": "This method splits a String object into an array of strings by separating the string into substrings."
},
{
"code": null,
"e": 2595,
"s": 2568,
"text": "Its syntax is as follows −"
},
{
"code": null,
"e": 2632,
"s": 2... |
Jupyter Notebook Not Rendering on GitHub? Here’s a Simple Solution. | by Sidney Kung | Towards Data Science | Have you ever tried to preview your Jupyter Notebook file and received this pesky error message after about 20+ seconds of waiting?
About 70% of the time, we see this message. As if it’s a gamble to see whether your .ipynb file will render or not.
Good news, this “Sorry, something went wrong. Reload?” message doesn’t h... | [
{
"code": null,
"e": 304,
"s": 172,
"text": "Have you ever tried to preview your Jupyter Notebook file and received this pesky error message after about 20+ seconds of waiting?"
},
{
"code": null,
"e": 420,
"s": 304,
"text": "About 70% of the time, we see this message. As if it’s... |
Check if the String starts with specified prefix 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.In Golang strings, you can check whether the string begins with the specified prefix ... | [
{
"code": null,
"e": 24069,
"s": 24041,
"text": "\n26 Aug, 2019"
},
{
"code": null,
"e": 24710,
"s": 24069,
"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... |
Importing Data in Python | When running python programs, we need to use datasets for data analysis. Python has various modules which help us in importing the external data in various file formats to a python program. In this example we will see how to import data of various formats to a python program.
The csv module enables us to read each of t... | [
{
"code": null,
"e": 1339,
"s": 1062,
"text": "When running python programs, we need to use datasets for data analysis. Python has various modules which help us in importing the external data in various file formats to a python program. In this example we will see how to import data of various forma... |
An in-depth EfficientNet tutorial using TensorFlow — How to use EfficientNet on a custom dataset. | by Mostafa Ibrahim | Towards Data Science | Convolutional Neural Networks (ConvNets) are commonly developed at a fixed resource budget, and then scaled up for better accuracy if more resources are available. In this paper, we systematically study model scaling and identify that carefully balancing network depth, width, and resolution can lead to better performan... | [
{
"code": null,
"e": 761,
"s": 172,
"text": "Convolutional Neural Networks (ConvNets) are commonly developed at a fixed resource budget, and then scaled up for better accuracy if more resources are available. In this paper, we systematically study model scaling and identify that carefully balancing ... |
How to retrieve auto-incremented value generated by PreparedStatement using JDBC? | While creating a table, in certain scenarios, we need values to column such as ID, to be generated/incremented automatically. Various databases support this feature in different ways.
In MySQL database you can declare a column auto increment using the following syntax.
CREATE TABLE table_name(
ID INT PRIMARY KEY AUT... | [
{
"code": null,
"e": 1246,
"s": 1062,
"text": "While creating a table, in certain scenarios, we need values to column such as ID, to be generated/incremented automatically. Various databases support this feature in different ways."
},
{
"code": null,
"e": 1332,
"s": 1246,
"text":... |
Polygon: Real-Time Stocks, Forex, and Crypto Data. | by Bernard Brenyah | Towards Data Science | You may have heard this quote “Data Is The New Oil” one too many times. Regardless of one’s opinion on this assertion, it is widely recognised that data is crucial to the innovative processes of every industry. The financial industry, in particular, is one industry where having access to quality and updated data is cru... | [
{
"code": null,
"e": 819,
"s": 172,
"text": "You may have heard this quote “Data Is The New Oil” one too many times. Regardless of one’s opinion on this assertion, it is widely recognised that data is crucial to the innovative processes of every industry. The financial industry, in particular, is on... |
How to handle JSON in Python?. In this article, we will learn and... | by Tanu N Prabhu | Towards Data Science | JSON is the abbreviation for JavaScript Object Notation: one of the easiest data formats for humans being like you and me to read and write. JSON is often declared as a text format that is completely language independent. It is based on a subset of the JavaScript Programming Language Standard ECMA-262 3rd Edition — Dec... | [
{
"code": null,
"e": 503,
"s": 171,
"text": "JSON is the abbreviation for JavaScript Object Notation: one of the easiest data formats for humans being like you and me to read and write. JSON is often declared as a text format that is completely language independent. It is based on a subset of the Ja... |
How to read csv file with Pandas without header? - GeeksforGeeks | 03 Mar, 2021
Prerequisites: Pandas
A header of the CSV file is an array of values assigned to each of the columns. It acts as a row header for the data. This article discusses how we can read a csv file without header using pandas. To do this header attribute should be set to None while reading the file.
Syntax:
read_c... | [
{
"code": null,
"e": 24633,
"s": 24605,
"text": "\n03 Mar, 2021"
},
{
"code": null,
"e": 24655,
"s": 24633,
"text": "Prerequisites: Pandas"
},
{
"code": null,
"e": 24926,
"s": 24655,
"text": "A header of the CSV file is an array of values assigned to each of t... |
Merge contents of two files into a third file using C | This is a c program to merge the contents of two files into the third file.
For Example.
java.txt is having initial content “Java is a programing language.”
kotlin.txt is having initial content “ kotlin is a programing language.”
ttpoint.txt is having initial content as blank
files are merged
ttpoint.txt will have fina... | [
{
"code": null,
"e": 1138,
"s": 1062,
"text": "This is a c program to merge the contents of two files into the third file."
},
{
"code": null,
"e": 1151,
"s": 1138,
"text": "For Example."
},
{
"code": null,
"e": 1339,
"s": 1151,
"text": "java.txt is having ini... |
Global keyword in Python - GeeksforGeeks | 31 May, 2020
Global keyword is a keyword that allows a user to modify a variable outside of the current scope. It is used to create global variables from a non-global scope i.e inside a function. Global keyword is used inside a function only when we want to do assignments or when we want to change a variable. Global is... | [
{
"code": null,
"e": 41161,
"s": 41133,
"text": "\n31 May, 2020"
},
{
"code": null,
"e": 41508,
"s": 41161,
"text": "Global keyword is a keyword that allows a user to modify a variable outside of the current scope. It is used to create global variables from a non-global scope i.e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.