title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Decoding the Confusion Matrix. Understand the Confusion Matrix and... | by Prateek Sharma | Towards Data Science | In the case of classification problem having only one classification accuracy might not give you the whole picture. So, a confusion matrix or error matrix is used for summarizing the performance of a classification algorithm.
Calculating a confusion matrix can give you an idea of where the classification model is right... | [
{
"code": null,
"e": 398,
"s": 172,
"text": "In the case of classification problem having only one classification accuracy might not give you the whole picture. So, a confusion matrix or error matrix is used for summarizing the performance of a classification algorithm."
},
{
"code": null,
... |
Longest substring that starts with X and ends with Y - GeeksforGeeks | 07 May, 2021
Given a string str, two characters X and Y. The task is to find the length of the longest substring that starts with X and ends with Y. It is given that there always exists a substring that starts with X and ends with Y. Examples:
Input: str = “QWERTYASDFZXCV”, X = ‘A’, Y = ‘Z’ Output: 5 Explanation: The... | [
{
"code": null,
"e": 24682,
"s": 24654,
"text": "\n07 May, 2021"
},
{
"code": null,
"e": 24915,
"s": 24682,
"text": "Given a string str, two characters X and Y. The task is to find the length of the longest substring that starts with X and ends with Y. It is given that there alwa... |
JSON with PHP | This chapter covers how to encode and decode JSON objects using PHP programming language. Let's start with preparing the environment to start our programming with PHP for JSON.
As of PHP 5.2.0, the JSON extension is bundled and compiled into PHP by default.
PHP json_encode() function is used for encoding JSON in PHP. T... | [
{
"code": null,
"e": 1957,
"s": 1780,
"text": "This chapter covers how to encode and decode JSON objects using PHP programming language. Let's start with preparing the environment to start our programming with PHP for JSON."
},
{
"code": null,
"e": 2038,
"s": 1957,
"text": "As of... |
Different Ways to Copy Content From One File to Another File in Java - GeeksforGeeks | 26 Oct, 2020
In Java, we can copy the contents of one file to another file. This can be done by the FileInputStream and FileOutputStream classes.
FileInputStream Class
It is a byte input stream class which helps in reading the bytes from a file. It provides different methods to read the data from a file.
FileInputStrea... | [
{
"code": null,
"e": 23948,
"s": 23920,
"text": "\n26 Oct, 2020"
},
{
"code": null,
"e": 24081,
"s": 23948,
"text": "In Java, we can copy the contents of one file to another file. This can be done by the FileInputStream and FileOutputStream classes."
},
{
"code": null,
... |
C# | Get the last node of the LinkedList<T> - GeeksforGeeks | 01 Feb, 2019
LinkedList<T>.Last property is used to get the last node of the LinkedList<T>.
Syntax:
public System.Collections.Generic.LinkedListNode Last { get; }
Return Value: The last LinkedListNode<T> of the LinkedList<T>.
Below given are some examples to understand the implementation in a better way:
Example 1:
//... | [
{
"code": null,
"e": 24302,
"s": 24274,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 24381,
"s": 24302,
"text": "LinkedList<T>.Last property is used to get the last node of the LinkedList<T>."
},
{
"code": null,
"e": 24389,
"s": 24381,
"text": "Syntax:"
... |
How to create a bar chart using ggplot2 with facets that are in the order of the data in R? | Since visualization is an essential part of data analysis, we should make sure that the plots are created in a form that is easily readable for users. For this purpose, the facets in a bar chart helps us to understand the factor variable levels for another factor. To create such type of bar chart, we can use facet_grid... | [
{
"code": null,
"e": 1412,
"s": 1062,
"text": "Since visualization is an essential part of data analysis, we should make sure that the plots are created in a form that is easily readable for users. For this purpose, the facets in a bar chart helps us to understand the factor variable levels for anot... |
Find sum of the series 1-2+3-4+5-6+7....... - GeeksforGeeks | 22 Mar, 2021
Given a number N. The task is to find the sum of the below series up to nth term.
1- 2 + 3 – 4 + 5 – 6 +....
Examples:
Input : N = 8
Output : -4
Input : N = 10001
Output : 5001
Approach: If we observe carefully, we can see that the sum of the above series follows a pattern of alternating positive and... | [
{
"code": null,
"e": 26733,
"s": 26705,
"text": "\n22 Mar, 2021"
},
{
"code": null,
"e": 26816,
"s": 26733,
"text": "Given a number N. The task is to find the sum of the below series up to nth term. "
},
{
"code": null,
"e": 26843,
"s": 26816,
"text": "1- 2 + ... |
A Simple Guide to Scikit-Learn — Building a Machine Learning Model in Python | by Frank Andrade | Towards Data Science | If you’re learning Python and would like to develop a machine learning model then a library that you want to seriously consider is scikit-learn. Scikit-learn (also known as sklearn) is a machine learning library used in Python that provides many unsupervised and supervised learning algorithms.
In this simple guide, we’... | [
{
"code": null,
"e": 467,
"s": 172,
"text": "If you’re learning Python and would like to develop a machine learning model then a library that you want to seriously consider is scikit-learn. Scikit-learn (also known as sklearn) is a machine learning library used in Python that provides many unsupervi... |
Pyspark - Filter dataframe based on multiple conditions - GeeksforGeeks | 04 Jul, 2021
In this article, we are going to see how to Filter dataframe based on multiple conditions.
Let’s Create a Dataframe for demonstration:
Python3
# importing moduleimport pyspark # importing sparksession from pyspark.sql modulefrom pyspark.sql import SparkSession # creating sparksession and giving an app na... | [
{
"code": null,
"e": 26289,
"s": 26261,
"text": "\n04 Jul, 2021"
},
{
"code": null,
"e": 26380,
"s": 26289,
"text": "In this article, we are going to see how to Filter dataframe based on multiple conditions."
},
{
"code": null,
"e": 26424,
"s": 26380,
"text": ... |
ES9 - New Features | Here, we will learn about the new features in ES9. Let us begin by understanding about the asynchronous generators.
Asynchronous generators can be made asynchronous by using the async keyword. The syntax for defining an async generator is given below −
async function* generator_name() {
//statements
}
Following exa... | [
{
"code": null,
"e": 2393,
"s": 2277,
"text": "Here, we will learn about the new features in ES9. Let us begin by understanding about the asynchronous generators."
},
{
"code": null,
"e": 2530,
"s": 2393,
"text": "Asynchronous generators can be made asynchronous by using the asyn... |
How to Install glob in Python on MacOS? - GeeksforGeeks | 17 Feb, 2022
In this article, we will learn how to install glob in Python on MacOS.
Glob is a general term used to define techniques to match specified patterns according to rules related to Unix shell. Linux and Unix systems and shells also support glob and also provide function glob() in system libraries.
Follow the ... | [
{
"code": null,
"e": 26207,
"s": 26179,
"text": "\n17 Feb, 2022"
},
{
"code": null,
"e": 26278,
"s": 26207,
"text": "In this article, we will learn how to install glob in Python on MacOS."
},
{
"code": null,
"e": 26503,
"s": 26278,
"text": "Glob is a general t... |
How to update after aggregate in MongoDB? | To update documents, you cannot use aggregation pipeline. You can use update(). Let us first create a collection with documents −
> db.demo376.insertOne(
... {
...
... "id" :101,
...
... "details" : [
... {
... Name:"Chris",
... Age:21,
... Score:45
... ... | [
{
"code": null,
"e": 1192,
"s": 1062,
"text": "To update documents, you cannot use aggregation pipeline. You can use update(). Let us first create a collection with documents −"
},
{
"code": null,
"e": 1717,
"s": 1192,
"text": "> db.demo376.insertOne(\n... {\n...\n... \"... |
How to Compile and Run C/C++/Java Programs in Linux - GeeksforGeeks | 11 Mar, 2019
C is a procedural programming language. It was initially developed by Dennis Ritchie between 1969 and 1973. It was mainly developed as a system programming language to write an operating system. The main features of C language include low-level access to memory, a simple set of keywords, and clean style, t... | [
{
"code": null,
"e": 25453,
"s": 25425,
"text": "\n11 Mar, 2019"
},
{
"code": null,
"e": 26077,
"s": 25453,
"text": "C is a procedural programming language. It was initially developed by Dennis Ritchie between 1969 and 1973. It was mainly developed as a system programming languag... |
Python | How to copy a nested list - GeeksforGeeks | 10 Apr, 2019
In the previous article, we have seen how to clone or Copy a list, now let’s see how to copy a nested list in Python.
Method #1: Using Iteration
# Python program to copy a nested list # List initializationInput_list = [[0, 1, 2], [3, 4, 5], ]Output = [] # Using iteration to assign valuesfor x in range(l... | [
{
"code": null,
"e": 25555,
"s": 25527,
"text": "\n10 Apr, 2019"
},
{
"code": null,
"e": 25673,
"s": 25555,
"text": "In the previous article, we have seen how to clone or Copy a list, now let’s see how to copy a nested list in Python."
},
{
"code": null,
"e": 25700,
... |
C library function - fgetc() | The C library function int fgetc(FILE *stream) gets the next character (an unsigned char) from the specified stream and advances the position indicator for the stream.
Following is the declaration for fgetc() function.
int fgetc(FILE *stream)
stream − This is the pointer to a FILE object that identifies the stream on w... | [
{
"code": null,
"e": 2175,
"s": 2007,
"text": "The C library function int fgetc(FILE *stream) gets the next character (an unsigned char) from the specified stream and advances the position indicator for the stream."
},
{
"code": null,
"e": 2226,
"s": 2175,
"text": "Following is t... |
How to disable scroll to change number in <input type="number"> field using JavaScript/jQuery? - GeeksforGeeks | 17 Sep, 2019
Given an HTML document containing <input type = “number”> attribute and the task is to disable the mouse scroll wheel to change number value using JavaScript/jQuery.
Approach:
Select the element.
Add an event to that element which will call a function when scrolling starts.
Make the element blur on scrolli... | [
{
"code": null,
"e": 25300,
"s": 25272,
"text": "\n17 Sep, 2019"
},
{
"code": null,
"e": 25466,
"s": 25300,
"text": "Given an HTML document containing <input type = “number”> attribute and the task is to disable the mouse scroll wheel to change number value using JavaScript/jQuer... |
C library function - floor() | The C library function double floor(double x) returns the largest integer value less than or equal to x.
Following is the declaration for floor() function.
double floor(double x)
x − This is the floating point value.
x − This is the floating point value.
This function returns the largest integral value not greater than... | [
{
"code": null,
"e": 2112,
"s": 2007,
"text": "The C library function double floor(double x) returns the largest integer value less than or equal to x."
},
{
"code": null,
"e": 2163,
"s": 2112,
"text": "Following is the declaration for floor() function."
},
{
"code": null... |
Lipschitz Continuity and Spectral Normalization | by Wanshun Wong | Towards Data Science | One of the biggest weaknesses of neural networks is that they can be too sensitive to their inputs. The most famous illustration of neural networks’ lack of robustness is probably adversarial examples in computer vision, where small, imperceptible perturbations to the pixels of an image are able to change the neural ne... | [
{
"code": null,
"e": 848,
"s": 172,
"text": "One of the biggest weaknesses of neural networks is that they can be too sensitive to their inputs. The most famous illustration of neural networks’ lack of robustness is probably adversarial examples in computer vision, where small, imperceptible perturb... |
React Router | Create React App doesn't include page routing.
React Router is the most popular solution.
To add React Router in your application, run this in the terminal from the root directory of the application:
Note: This tutorial uses React Router v6.
If you are upgrading from v5, you will need to use the @latest flag:
To create... | [
{
"code": null,
"e": 47,
"s": 0,
"text": "Create React App doesn't include page routing."
},
{
"code": null,
"e": 90,
"s": 47,
"text": "React Router is the most popular solution."
},
{
"code": null,
"e": 200,
"s": 90,
"text": "To add React Router in your appli... |
3 Methods to Create Conditional Columns with Python Pandas and Numpy | by Soner Yıldırım | Towards Data Science | Python is arguably the most popular programming language in the data science ecosystem. One of the reasons for such a popularity is the rich selection of Python libraries for data science.
These libraries offer fast, flexible, and efficient methods for performing data operations. Pandas and Numpy are two popular Python... | [
{
"code": null,
"e": 360,
"s": 171,
"text": "Python is arguably the most popular programming language in the data science ecosystem. One of the reasons for such a popularity is the rich selection of Python libraries for data science."
},
{
"code": null,
"e": 549,
"s": 360,
"text"... |
Data Scaling for Machine Learning — The Essential Guide | by Dario Radečić | Towards Data Science | It’s possible that you will come across datasets with lots of numerical noise built-in, such as variance or differently-scaled data, so a good preprocessing is a must before even thinking about machine learning. A good preprocessing solution for this type of problem is often referred to as standardization.
Standardizat... | [
{
"code": null,
"e": 480,
"s": 172,
"text": "It’s possible that you will come across datasets with lots of numerical noise built-in, such as variance or differently-scaled data, so a good preprocessing is a must before even thinking about machine learning. A good preprocessing solution for this type... |
MySQL DATE_ADD() to increment a date based on the value in another column? | Let us first create a table with one of the columns as DueDate and another one “RepeatTime, which displays how many times, let’s say a user was reminded to submit the payment −
mysql> create table DemoTable
-> (
-> DueDate date,
-> RepeatTime int
-> );
Query OK, 0 rows affected (0.57 sec)
Insert some record... | [
{
"code": null,
"e": 1239,
"s": 1062,
"text": "Let us first create a table with one of the columns as DueDate and another one “RepeatTime, which displays how many times, let’s say a user was reminded to submit the payment −"
},
{
"code": null,
"e": 1364,
"s": 1239,
"text": "mysql... |
How to keep two columns in one order in Android sqlite? | Before getting into example, we should know what sqlite data base in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the relational database features. In order to access this database, you d... | [
{
"code": null,
"e": 1457,
"s": 1062,
"text": "Before getting into example, we should know what sqlite data base in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the re... |
Arraylist.contains() in Java - GeeksforGeeks | 27 Mar, 2018
ArrayList contains() method in Java is used for checking if the specified element exists in the given list or not.
Syntax:
public boolean contains(Object)
object-element to be searched for
Parameters:object- element whose presence in this list is to be tested
Returns:It returns true if the specified elemen... | [
{
"code": null,
"e": 24922,
"s": 24894,
"text": "\n27 Mar, 2018"
},
{
"code": null,
"e": 25037,
"s": 24922,
"text": "ArrayList contains() method in Java is used for checking if the specified element exists in the given list or not."
},
{
"code": null,
"e": 25045,
... |
GATE | GATE-CS-2004 | Question 73 - GeeksforGeeks | 28 Jun, 2021
The inclusion of which of the following sets into
S = {{1, 2}, {1, 2, 3}, {1, 3, 5}, (1, 2, 4), (1, 2, 3, 4, 5}}
is necessary and sufficient to make S a complete lattice under the partial order defined by set containment ?(A) {1}(B) {1}, {2, 3}(C) {1}, {1, 3}(D) {1}, {1, 3}, (1, 2, 3, 4}, {1, 2, 3, 5)Answe... | [
{
"code": null,
"e": 24065,
"s": 24037,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24115,
"s": 24065,
"text": "The inclusion of which of the following sets into"
},
{
"code": null,
"e": 24178,
"s": 24115,
"text": "S = {{1, 2}, {1, 2, 3}, {1, 3, 5}, (1, 2... |
Find n highest values in an object JavaScript | Let’s say, we have an object that describes various qualities of a football player like this −
const qualities = {
defence: 82,
attack: 92,
heading: 91,
pace: 96,
dribbling: 88,
tenacity: 97,
vision: 91,
passing: 95,
shooting: 90
};
We wish to write a function that takes in such object and a ... | [
{
"code": null,
"e": 1157,
"s": 1062,
"text": "Let’s say, we have an object that describes various qualities of a football player like this −"
},
{
"code": null,
"e": 1322,
"s": 1157,
"text": "const qualities = {\n defence: 82,\n attack: 92,\n heading: 91,\n pace: 96,\n ... |
Job Sequencing Problem | Practice | GeeksforGeeks | Given a set of N jobs where each jobi has a deadline and profit associated with it.
Each job takes 1 unit of time to complete and only one job can be scheduled at a time. We earn the profit associated with job if and only if the job is completed by its deadline.
Find the number of jobs done and the maximum profit.
No... | [
{
"code": null,
"e": 323,
"s": 238,
"text": "Given a set of N jobs where each jobi has a deadline and profit associated with it. "
},
{
"code": null,
"e": 503,
"s": 323,
"text": "Each job takes 1 unit of time to complete and only one job can be scheduled at a time. We earn the pr... |
Difference between Sequence Diagram and Activity Diagram | 06 Mar, 2019
What is Sequence Diagram ?
A sequence diagram simply depicts interaction between objects in a sequential order i.e. the order in which these interactions take place. We can also use the terms event diagrams or event scenarios to refer to a sequence diagram. Sequence diagrams describe how and in what order ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Mar, 2019"
},
{
"code": null,
"e": 55,
"s": 28,
"text": "What is Sequence Diagram ?"
},
{
"code": null,
"e": 509,
"s": 55,
"text": "A sequence diagram simply depicts interaction between objects in a sequential ord... |
Check perfect square using addition/subtraction | 01 Apr, 2021
Given a positive integer n, check if it is perfect square or not using only addition/subtraction operations and in minimum time complexity.We strongly recommend you to minimize your browser and try this yourself first.We can use the property of odd number for this purpose:
Addition of first n odd numbers ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n01 Apr, 2021"
},
{
"code": null,
"e": 327,
"s": 52,
"text": "Given a positive integer n, check if it is perfect square or not using only addition/subtraction operations and in minimum time complexity.We strongly recommend you to minimi... |
How to Search an Item in ListView using EditText and TextWatcher in Android? | 09 Dec, 2021
Some applications provide a search bar for looking up any particular item from a list of items. Technically, a search bar is an EditText and an item list can be a ListView, RecyclerView, or a GridView that contains some items. Now, when a user types something in the EditText, the list must update in accord... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Dec, 2021"
},
{
"code": null,
"e": 1007,
"s": 28,
"text": "Some applications provide a search bar for looking up any particular item from a list of items. Technically, a search bar is an EditText and an item list can be a ListView, R... |
numpy.rint() in Python | 04 Dec, 2020
The numpy.rint() is a mathematical function that rounds elements of the array to the nearest integer.
Syntax : numpy.rint(x[, out]) = ufunc ‘rint’)Parameters :array : [array_like] Input array.
Return : An array with all array elements being rounded off, having same type and shape as input.
Code #1 : Worki... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Dec, 2020"
},
{
"code": null,
"e": 130,
"s": 28,
"text": "The numpy.rint() is a mathematical function that rounds elements of the array to the nearest integer."
},
{
"code": null,
"e": 221,
"s": 130,
"text": "Synt... |
How to disable/ enable checkbox with jQuery? | fTo disable and enable checkbox, use the attr() method.
Initially set the input type checkbox and disable it −
<input type="checkbox" id="sName" name= "Male" style="width: 25px" value="male" disabled="disabled"/>Male
Now on the click of a button, toggle between disabled and enabled checkbox −
$("#button1").click(functi... | [
{
"code": null,
"e": 1243,
"s": 1187,
"text": "fTo disable and enable checkbox, use the attr() method."
},
{
"code": null,
"e": 1298,
"s": 1243,
"text": "Initially set the input type checkbox and disable it −"
},
{
"code": null,
"e": 1404,
"s": 1298,
"text": "... |
How to change axes limits in Seaborn? | 14 Sep, 2021
Seaborn is a Python data visualization library based on matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics. Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. There are two methods... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 387,
"s": 28,
"text": "Seaborn is a Python data visualization library based on matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics. Axes Class ... |
Python3 Program to Find Lexicographically minimum string rotation | Set 1 | 27 Dec, 2021
Write code to find lexicographic minimum in a circular array, e.g. for the array BCABDADAB, the lexicographic minimum is ABBCABDAD.Source: Google Written TestMore Examples:
Input: GEEKSQUIZ
Output: EEKSQUIZG
Input: GFG
Output: FGG
Input: GEEKSFORGEEKS
Output: EEKSFORGEEKSG
Following is a simple solut... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Dec, 2021"
},
{
"code": null,
"e": 202,
"s": 28,
"text": "Write code to find lexicographic minimum in a circular array, e.g. for the array BCABDADAB, the lexicographic minimum is ABBCABDAD.Source: Google Written TestMore Examples: "
... |
How to merge table cells in HTML? | To merge cells in HTML, use the colspan and rowspan attribute. The rowspan attribute is for the number of rows a cell should span, whereas the colspan attribute is for a number of columns a cell should span.
Both the attribute will be inside the <td> tag. The number will be a numeric value, for example, 2 for 2 rows if... | [
{
"code": null,
"e": 1395,
"s": 1187,
"text": "To merge cells in HTML, use the colspan and rowspan attribute. The rowspan attribute is for the number of rows a cell should span, whereas the colspan attribute is for a number of columns a cell should span."
},
{
"code": null,
"e": 1549,
... |
Red-Black Trees | Top-Down Insertion | 01 Dec, 2021
In Bottom-Up insertion of Red-Black Trees, “simple” Binary Search Tree insertion is used, followed by correction of the RB-Tree Violations on the way back up to the root. This can be done easily with the help of recursion. While in Top-Down Insertion, the corrections are done while traversing down the tree... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n01 Dec, 2021"
},
{
"code": null,
"e": 728,
"s": 54,
"text": "In Bottom-Up insertion of Red-Black Trees, “simple” Binary Search Tree insertion is used, followed by correction of the RB-Tree Violations on the way back up to the root. Thi... |
Three way partitioning of an array around a given range | 07 Jul, 2022
Given an array and a range [lowVal, highVal], partition the array around the range such that array is divided in three parts.
All elements smaller than lowVal come first. All elements in range lowVal to highVal come next. All elements greater than highVal appear in the end.
All elements smaller than lowV... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 181,
"s": 54,
"text": "Given an array and a range [lowVal, highVal], partition the array around the range such that array is divided in three parts. "
},
{
"code": null,
"e": 331,
"... |
Java Program to Interchange Any Two Columns in the Matrix | 07 Dec, 2021
Given a matrix having m rows and n columns. We have to write a Java program to interchange any two Columns(ie column no K and L given in the input) in the given matrix. Swap Operation is required to interchange the elements of two columns. O(1) operation to swap two columns is impossible because complete t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Dec, 2021"
},
{
"code": null,
"e": 377,
"s": 28,
"text": "Given a matrix having m rows and n columns. We have to write a Java program to interchange any two Columns(ie column no K and L given in the input) in the given matrix. Swap O... |
How to get phone number in android? | This example demonstrate about How to get phone number 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"?>
<android.support... | [
{
"code": null,
"e": 1254,
"s": 1187,
"text": "This example demonstrate about How to get phone number in android."
},
{
"code": null,
"e": 1383,
"s": 1254,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a... |
How to create Dark Mode in ReactJS using Material UI ? | 19 Jul, 2021
Having a dark mode on your website or application has become very popular nowadays. In this article, you will learn how to add a dark mode switch in your React web app to toggle between light and dark mode.
Step for Creating React Application And Installing Module:
Step 1: Create a React application using ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Jul, 2021"
},
{
"code": null,
"e": 259,
"s": 52,
"text": "Having a dark mode on your website or application has become very popular nowadays. In this article, you will learn how to add a dark mode switch in your React web app to tog... |
Perl | Security Issues in CGI | 28 Aug, 2019
Before diving into the security issues with CGI and Perl, let’s know what Perl is. Perl stands for Practical Extraction and Reporting Language. It was built in 1987 by Larry Wall. Its a smart Object oriented language since it takes some useful features from C and BASIC as well. This programming language us... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Aug, 2019"
},
{
"code": null,
"e": 532,
"s": 28,
"text": "Before diving into the security issues with CGI and Perl, let’s know what Perl is. Perl stands for Practical Extraction and Reporting Language. It was built in 1987 by Larry W... |
Installing Helm & Kubernetes in Docker | 14 Jun, 2021
Helm is simply a package manager for Kubernetes. It helps you manage Kubernetes applications — Helm Charts helps you define, install, and upgrade even the most complex Kubernetes application.
Follow the below steps to install Helm and Kubernetes in Docker:
Step 1: Installing Docker
First, download the Dock... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n14 Jun, 2021"
},
{
"code": null,
"e": 244,
"s": 52,
"text": "Helm is simply a package manager for Kubernetes. It helps you manage Kubernetes applications — Helm Charts helps you define, install, and upgrade even the most complex Kubern... |
ML | Multiple Linear Regression (Backward Elimination Technique) | 18 May, 2020
Multiple Linear Regression is a type of regression where the model depends on several independent variables(instead of only on one independent variable as seen in the case of Simple Linear Regression). Multiple Linear Regression has several techniques to build an effective model namely:
All-in
Backward Eli... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 May, 2020"
},
{
"code": null,
"e": 340,
"s": 52,
"text": "Multiple Linear Regression is a type of regression where the model depends on several independent variables(instead of only on one independent variable as seen in the case of... |
Understanding Text Vectorizations I: How Having a Bag of Words Already Shows What People Think About Your Product | Towards Data Science | Do you know that we already (almost) solved sentiment analysis problems before neural networks become ubiquitous?
In the current era of natural language processing (NLP) increasingly relying on deep learning models that generate amazing performances, we have often overlooked the importance of the simplest types of text... | [
{
"code": null,
"e": 286,
"s": 172,
"text": "Do you know that we already (almost) solved sentiment analysis problems before neural networks become ubiquitous?"
},
{
"code": null,
"e": 1123,
"s": 286,
"text": "In the current era of natural language processing (NLP) increasingly re... |
Message Passing in Java - GeeksforGeeks | 01 Oct, 2019
What is message passing and why it is used?Message Passing in terms of computers is communication between processes. It is a form of communication used in object-oriented programming as well as parallel programming. Message passing in Java is like sending an object i.e. message from one thread to another t... | [
{
"code": null,
"e": 24230,
"s": 24202,
"text": "\n01 Oct, 2019"
},
{
"code": null,
"e": 24893,
"s": 24230,
"text": "What is message passing and why it is used?Message Passing in terms of computers is communication between processes. It is a form of communication used in object-o... |
React ES6 Array Methods | There are many JavaScript array methods.
One of the most useful in React is the .map() array method.
The .map() method allows you to run a function on each item in the array,
returning a new array as the result.
In React, map() can be used to generate lists.
Generate a list of items from an array:
const myArray = ['app... | [
{
"code": null,
"e": 41,
"s": 0,
"text": "There are many JavaScript array methods."
},
{
"code": null,
"e": 101,
"s": 41,
"text": "One of the most useful in React is the .map() array method."
},
{
"code": null,
"e": 212,
"s": 101,
"text": "The .map() method al... |
Bool.parse method in C# | To convert a string to a bool, use the Bool.parse method in C# −
Firstly, set a string −
string str = "true";
Now, convert it to bool −
bool.Parse(str);
Here is the complete code −
Live Demo
using System;
using System.Linq;
class Demo {
static void Main() {
string str = "true";
bool res = bool.Parse(str... | [
{
"code": null,
"e": 1127,
"s": 1062,
"text": "To convert a string to a bool, use the Bool.parse method in C# −"
},
{
"code": null,
"e": 1151,
"s": 1127,
"text": "Firstly, set a string −"
},
{
"code": null,
"e": 1172,
"s": 1151,
"text": "string str = \"true\";... |
Excel-Python App for Non-Pythonists | by Jesko Rehberg | Towards Data Science | Motivation:
Oftentimes we conduct impressive Python analysis, but all that our colleagues are asking for is to receive the final results within Excel. Many of our colleagues do not want to work with Jupyter Notebook, Python scripts and the like. They just want to stick with their beloved spreadsheet tool (like Microsof... | [
{
"code": null,
"e": 58,
"s": 46,
"text": "Motivation:"
},
{
"code": null,
"e": 720,
"s": 58,
"text": "Oftentimes we conduct impressive Python analysis, but all that our colleagues are asking for is to receive the final results within Excel. Many of our colleagues do not want to ... |
PyQt - QFormLayout Class | QFormLayout is a convenient way to create two column form, where each row consists of an input field associated with a label. As a convention, the left column contains the label and the right column contains an input field. Mainly three overloads of addRow() method addLayout() are commonly used.
addRow(QLabel, QWidget)... | [
{
"code": null,
"e": 2223,
"s": 1926,
"text": "QFormLayout is a convenient way to create two column form, where each row consists of an input field associated with a label. As a convention, the left column contains the label and the right column contains an input field. Mainly three overloads of add... |
How to underline a text in HTML? | To underline a text in HTML, use the <u> tag. The <u> tag deprecated in HTML, but then re-introduced in HTML5. Now it represents a text different from another text stylistically, such as a misspelled word.
To underline a text, you can also use the style attribute. The style attribute specifies an inline style for an el... | [
{
"code": null,
"e": 1268,
"s": 1062,
"text": "To underline a text in HTML, use the <u> tag. The <u> tag deprecated in HTML, but then re-introduced in HTML5. Now it represents a text different from another text stylistically, such as a misspelled word."
},
{
"code": null,
"e": 1477,
... |
C# | StringDictionary Class - GeeksforGeeks | 24 Jan, 2019
StringDictionary is a specialized collection. This class comes under the System.Collections.Specialized namespace. It only allows string keys and string values. It suffers from performance problems. It implements a hash table with the key and the value strongly typed to be strings rather than objects.
Char... | [
{
"code": null,
"e": 24426,
"s": 24398,
"text": "\n24 Jan, 2019"
},
{
"code": null,
"e": 24729,
"s": 24426,
"text": "StringDictionary is a specialized collection. This class comes under the System.Collections.Specialized namespace. It only allows string keys and string values. It... |
LESS - Comments | Comments make the code clear and understandable for the users. You can use both the block style and the inline comments in the code, but when you compile the LESS code, the single line comments will not appear in the CSS file.
The following example demonstrates the use of comments in the LESS file −
<html>
<head>
... | [
{
"code": null,
"e": 2777,
"s": 2550,
"text": "Comments make the code clear and understandable for the users. You can use both the block style and the inline comments in the code, but when you compile the LESS code, the single line comments will not appear in the CSS file."
},
{
"code": null... |
C Program to print “Even” or “Odd” without using Conditional statement | In this section we will see how to check whether a number is odd or even without using any kind of conditional statements like (<, <=, !=, >, >=, ==).
We can easily check the odd or even by using the conditional statements. We can divide the number by 2, then check whether the remainder is 0 or not. if 0, then it is ev... | [
{
"code": null,
"e": 1213,
"s": 1062,
"text": "In this section we will see how to check whether a number is odd or even without using any kind of conditional statements like (<, <=, !=, >, >=, ==)."
},
{
"code": null,
"e": 1500,
"s": 1213,
"text": "We can easily check the odd or ... |
Check whether a given number is even or odd - GeeksforGeeks | 10 May, 2022
Given a number, check whether it is even or odd.
Examples :
Input: 2
Output: even
Input: 5
Output: odd
One simple solution is to find the remainder after dividing by 2.
C++
Java
Python3
C#
PHP
Javascript
// A simple C++ program to// check for even or odd#include <iostream>using namespace std; // Return... | [
{
"code": null,
"e": 26502,
"s": 26474,
"text": "\n10 May, 2022"
},
{
"code": null,
"e": 26551,
"s": 26502,
"text": "Given a number, check whether it is even or odd."
},
{
"code": null,
"e": 26563,
"s": 26551,
"text": "Examples : "
},
{
"code": null,
... |
Dart Programming - Generics | Dart is an optionally typed language. Collections in Dart are heterogeneous by default. In other words, a single Dart collection can host values of various types. However, a Dart collection can be made to hold homogenous values. The concept of Generics can be used to achieve the same.
The use of Generics enforces a res... | [
{
"code": null,
"e": 2811,
"s": 2525,
"text": "Dart is an optionally typed language. Collections in Dart are heterogeneous by default. In other words, a single Dart collection can host values of various types. However, a Dart collection can be made to hold homogenous values. The concept of Generics ... |
How to add Google map inside html page without using API key ? - GeeksforGeeks | 16 Apr, 2020
There are two ways to add google maps inside HTML page:
Using API keyWithout using API key
Using API key
Without using API key
To learn first case you can follow the article while to learn other one follow this article.
To insert google map inside the HTML page, follow the steps:
Go to the google maps and ... | [
{
"code": null,
"e": 25320,
"s": 25292,
"text": "\n16 Apr, 2020"
},
{
"code": null,
"e": 25376,
"s": 25320,
"text": "There are two ways to add google maps inside HTML page:"
},
{
"code": null,
"e": 25411,
"s": 25376,
"text": "Using API keyWithout using API key... |
Add image to a live camera feed using OpenCV-Python - GeeksforGeeks | 03 Feb, 2022
In this article, we are going to learn how to insert an image in your live camera feed using OpenCV in Python.
CV reads and stores all the images as a NumPy array. We need the NumPy library to manipulate the image and as expected we need the cv2 module.
Python3
# importing librariesimport cv2import numpy... | [
{
"code": null,
"e": 25579,
"s": 25551,
"text": "\n03 Feb, 2022"
},
{
"code": null,
"e": 25690,
"s": 25579,
"text": "In this article, we are going to learn how to insert an image in your live camera feed using OpenCV in Python."
},
{
"code": null,
"e": 25835,
"s":... |
Number pattern in JavaScript | We are required to write a JavaScript and HTML program that provides the user with a text input and button. When the user enters any value in the input, say 5, and clicks the button, we should print the following pattern on the screen.
(for n = 5)
01
01 02
01 02 03
01 02 03 04
01 02 03 04 05
The code for this will be −... | [
{
"code": null,
"e": 1298,
"s": 1062,
"text": "We are required to write a JavaScript and HTML program that provides the user with a text input and button. When the user enters any value in the input, say 5, and clicks the button, we should print the following pattern on the screen."
},
{
"co... |
Create and Deploy a Simple Web Application with Flask and Heroku | by Naveen Venkatesan | Towards Data Science | Say you’ve written a really cool script in Python to do some interesting data analysis and now you want to demonstrate it to others. Chances are, sending over a .py file and asking others to run it, or demonstrating yourself running it on the command line won’t have the same grasp as a nicely packaged and polished web ... | [
{
"code": null,
"e": 767,
"s": 172,
"text": "Say you’ve written a really cool script in Python to do some interesting data analysis and now you want to demonstrate it to others. Chances are, sending over a .py file and asking others to run it, or demonstrating yourself running it on the command line... |
bits.OnesCount() Function in Golang with Examples - GeeksforGeeks | 19 Apr, 2020
Go language provides inbuilt support for bits to implement bit counting and manipulation functions for the predeclared unsigned integer types with the help of bits package. This package provides OnesCount() function which is used to find the number of one bits in a. To access the OnesCount() function you n... | [
{
"code": null,
"e": 25813,
"s": 25785,
"text": "\n19 Apr, 2020"
},
{
"code": null,
"e": 26204,
"s": 25813,
"text": "Go language provides inbuilt support for bits to implement bit counting and manipulation functions for the predeclared unsigned integer types with the help of bits... |
PHP | dechex( ) Function - GeeksforGeeks | 09 Mar, 2018
The dechex() is a built-in function in PHP and is used to convert a given decimal number to an equivalent hexadecimal number. The word ‘dechex’ in the name of function stands for decimal to hexadecimal. The dechex() function works only with unsigned numbers. If the argument passed to it is negative then it... | [
{
"code": null,
"e": 25600,
"s": 25572,
"text": "\n09 Mar, 2018"
},
{
"code": null,
"e": 26035,
"s": 25600,
"text": "The dechex() is a built-in function in PHP and is used to convert a given decimal number to an equivalent hexadecimal number. The word ‘dechex’ in the name of func... |
Handling with only visible elements in Cypress | After a test case is run on Cypress, we need to debug and understand the logs in
case of a failure. Cypress has the feature to provide information to the user on what
incident took place before and after the failure had happened.
The above screenshots show a full log of the test cases executed with pass/ fail
results. ... | [
{
"code": null,
"e": 1292,
"s": 1062,
"text": "After a test case is run on Cypress, we need to debug and understand the logs in\ncase of a failure. Cypress has the feature to provide information to the user on what\nincident took place before and after the failure had happened."
},
{
"code":... |
MySQL DROP TABLE Statement | The DROP TABLE statement is used to drop an existing table in a database.
Note: Be careful before dropping a table. Deleting a
table will result in loss of complete information stored in the table!
The following SQL statement drops the existing table "Shippers":
The TRUNCATE TABLE statement is used to delete the data ... | [
{
"code": null,
"e": 74,
"s": 0,
"text": "The DROP TABLE statement is used to drop an existing table in a database."
},
{
"code": null,
"e": 199,
"s": 74,
"text": "Note: Be careful before dropping a table. Deleting a \ntable will result in loss of complete information stored in t... |
DFA of a string in which 3rd symbol from RHS is ‘a’ - GeeksforGeeks | 06 Sep, 2019
Prerequisite – Finite Automata Introduction, DFA of a string in which 2nd symbol from RHS is ‘a’Problem – Draw deterministic finite automata (DFA) of the language containing the set of all strings over {a, b} in which 3rd symbol from RHS is ‘a’.
The strings in which 3rd last symbol is “a” are:
aaa, aab, aa... | [
{
"code": null,
"e": 24541,
"s": 24513,
"text": "\n06 Sep, 2019"
},
{
"code": null,
"e": 24787,
"s": 24541,
"text": "Prerequisite – Finite Automata Introduction, DFA of a string in which 2nd symbol from RHS is ‘a’Problem – Draw deterministic finite automata (DFA) of the language ... |
Plotly Express: the Good, the Bad, and the Ugly | by Reilly Meinert | Towards Data Science | Creating effective data visualizations is a very important part of data science from the beginning to the end of the data science process. Using visualizations during your exploratory data analysis is a great way to get a good idea of what your data is about. Creating visualizations at the end of your project is a grea... | [
{
"code": null,
"e": 847,
"s": 172,
"text": "Creating effective data visualizations is a very important part of data science from the beginning to the end of the data science process. Using visualizations during your exploratory data analysis is a great way to get a good idea of what your data is ab... |
How to create a string from a Java ArrayList? | To convert the contents of an ArrayList to a String, create a StringBuffer object append the contents of the ArrayList to it, finally convert the StringBuffer object to String using the toString() method.
import java.util.ArrayList;
public class String_ArrayList {
public static void main(String args[]) {
Arra... | [
{
"code": null,
"e": 1267,
"s": 1062,
"text": "To convert the contents of an ArrayList to a String, create a StringBuffer object append the contents of the ArrayList to it, finally convert the StringBuffer object to String using the toString() method."
},
{
"code": null,
"e": 1698,
"... |
Semantic-UI | Buttons - GeeksforGeeks | 28 May, 2020
Semantic UI is an open-source framework that uses CSS and jQuery to build great user interfaces. It is the same as a bootstrap for use and has great different elements to use to make your website look more amazing.
It can be used directly by CDN. There are different types of buttons in Semantic UI. It prov... | [
{
"code": null,
"e": 24985,
"s": 24957,
"text": "\n28 May, 2020"
},
{
"code": null,
"e": 25200,
"s": 24985,
"text": "Semantic UI is an open-source framework that uses CSS and jQuery to build great user interfaces. It is the same as a bootstrap for use and has great different elem... |
mysql - Unix, Linux Command | mysql
is a simple SQL shell (with GNU
readline
capabilities). It supports interactive and noninteractive use. When used interactively, query results are presented in an ASCII-table format. When used noninteractively (for example, as a filter), the result is presented in tab-separated format. The output format can be ch... | [
{
"code": null,
"e": 10928,
"s": 10577,
"text": "\nmysql\nis a simple SQL shell (with GNU\nreadline\ncapabilities). It supports interactive and noninteractive use. When used interactively, query results are presented in an ASCII-table format. When used noninteractively (for example, as a filter), th... |
How to add a parameter to the URL in JavaScript ? - GeeksforGeeks | 30 May, 2019
Given a URL and the task is to add an additional parameter (name & value) to the URL using JavaScript.
URL.searchParams: This readonly property of the URL interface returns a URLSearchParams object providing access to the GET decoded query arguments in the URL.
Syntax:
var URLSearchParams = URL.searchParam... | [
{
"code": null,
"e": 26731,
"s": 26703,
"text": "\n30 May, 2019"
},
{
"code": null,
"e": 26834,
"s": 26731,
"text": "Given a URL and the task is to add an additional parameter (name & value) to the URL using JavaScript."
},
{
"code": null,
"e": 26993,
"s": 26834,
... |
How to extract paragraph from a website and save it as a text file? - GeeksforGeeks | 29 Dec, 2020
Perquisites:
Beautiful soup
Urllib
Scraping is an essential technique which helps us to retrieve useful data from a URL or a html file that can be used in another manner. The given article shows how to extract paragraph from a URL and save it as a text file.
bs4: Beautiful Soup(bs4) is a Python library u... | [
{
"code": null,
"e": 24390,
"s": 24362,
"text": "\n29 Dec, 2020"
},
{
"code": null,
"e": 24405,
"s": 24390,
"text": "Perquisites: "
},
{
"code": null,
"e": 24420,
"s": 24405,
"text": "Beautiful soup"
},
{
"code": null,
"e": 24427,
"s": 24420,
... |
Given a sequence of words, print all anagrams together | Set 1 - GeeksforGeeks | 12 Apr, 2022
Given an array of words, print all anagrams together. For example, if the given array is {“cat”, “dog”, “tac”, “god”, “act”}, then output may be “cat tac act dog god”.
A simple method is to create a Hash Table. Calculate the hash value of each word in such a way that all anagrams have the same hash value. ... | [
{
"code": null,
"e": 26007,
"s": 25979,
"text": "\n12 Apr, 2022"
},
{
"code": null,
"e": 26175,
"s": 26007,
"text": "Given an array of words, print all anagrams together. For example, if the given array is {“cat”, “dog”, “tac”, “god”, “act”}, then output may be “cat tac act dog g... |
MongoDB query to find and return subdocument with criteria? | Let us create a collection with documents −
> db.demo345.insertOne({
... "UserName" : "Robert",
... "UserDetails" : [
... {
... "isMarried" : false,
... "CountryName":"US"
...
... },
... {
... "isMarried" : true,
... "CountryName":"UK"
... | [
{
"code": null,
"e": 1106,
"s": 1062,
"text": "Let us create a collection with documents −"
},
{
"code": null,
"e": 1615,
"s": 1106,
"text": "> db.demo345.insertOne({\n... \"UserName\" : \"Robert\",\n... \"UserDetails\" : [\n... {\n... \"isMarried\" ... |
Highcharts - Chart with Data Labels | We have already seen the configuration used to draw this chart in Highcharts Configuration Syntax chapter. Now, we will discuss an example of a line chart with data labels.
highcharts_line_labels.htm
<html>
<head>
<title>Highcharts Tutorial</title>
<script src = "https://ajax.googleapis.com/ajax/libs/jqu... | [
{
"code": null,
"e": 2190,
"s": 2017,
"text": "We have already seen the configuration used to draw this chart in Highcharts Configuration Syntax chapter. Now, we will discuss an example of a line chart with data labels."
},
{
"code": null,
"e": 2217,
"s": 2190,
"text": "highchart... |
How to create a Choropleth Map Plot in Python with Geoviews | by Christos Zeglis | Towards Data Science | In another post we learned how to use the geoviews.Points method to create a plot of points that represent specific coordinates on a map. We also used the geoviews.tile_sources to get a map which we can use as our base layer for the points to be plotted on. Since I didn’t find a guide for using Geoviews for choropleth ... | [
{
"code": null,
"e": 538,
"s": 171,
"text": "In another post we learned how to use the geoviews.Points method to create a plot of points that represent specific coordinates on a map. We also used the geoviews.tile_sources to get a map which we can use as our base layer for the points to be plotted o... |
SVD: Where Model Tuning Goes Wrong | by Neil Chandarana | Towards Data Science | There are many ways to build recommender systems. Latent factor models are a family of techniques that seek a low dimension decomposition of a given ratings matrix. SVD is the name dubbed to a latent factor model involving parameter estimation by stochastic gradient descent made popular by Simon Funk in the context of ... | [
{
"code": null,
"e": 717,
"s": 172,
"text": "There are many ways to build recommender systems. Latent factor models are a family of techniques that seek a low dimension decomposition of a given ratings matrix. SVD is the name dubbed to a latent factor model involving parameter estimation by stochast... |
Find if a substring exists within a string in Arduino | In order to check if a specific substring exists within a string in Arduino, the indexOf() function can be used. This returns the index of the first occurrence of the character or a string that you are searching for within another string. In case the character or string does not exist within the given string, the funct... | [
{
"code": null,
"e": 1398,
"s": 1062,
"text": "In order to check if a specific substring exists within a string in Arduino, the indexOf() function can be used. This returns the index of the first occurrence of the character or a string that you are searching for within another string. In case the ch... |
Java Program to open the command prompt and insert commands - GeeksforGeeks | 19 Jun, 2017
This article aims to provide you a simple code to open Command Prompt and how you can insert the commands in it using Java language.
Here we will use Runtime class of java.lang Package. This class allows Java application to interfere with the environment in which it is running as each and every Java applic... | [
{
"code": null,
"e": 24418,
"s": 24390,
"text": "\n19 Jun, 2017"
},
{
"code": null,
"e": 24551,
"s": 24418,
"text": "This article aims to provide you a simple code to open Command Prompt and how you can insert the commands in it using Java language."
},
{
"code": null,
... |
How to Scroll Down or UP a Page in Selenium Webdriver? | We can scroll down or up a page in Selenium webdriver using JavaScript Executor. Selenium can execute JavaScript commands with the help of the executeScript method.
To scroll down vertically in a page we have to use the JavaScript command window.scrollBy. Then pass the pixel values to be traversed along the x and y axi... | [
{
"code": null,
"e": 1227,
"s": 1062,
"text": "We can scroll down or up a page in Selenium webdriver using JavaScript Executor. Selenium can execute JavaScript commands with the help of the executeScript method."
},
{
"code": null,
"e": 1433,
"s": 1227,
"text": "To scroll down ve... |
Building a neural network in C#. Creating a neural network with the... | by Kip Parker | Towards Data Science | We will be building a Deep Neural Network that is capable of learning through Backpropagation and evolution. The Code will be extensible to allow for changes to the Network architecture, allowing for easy modification in the way the network performs through code.
The network is a Minimum viable product but can be easil... | [
{
"code": null,
"e": 436,
"s": 172,
"text": "We will be building a Deep Neural Network that is capable of learning through Backpropagation and evolution. The Code will be extensible to allow for changes to the Network architecture, allowing for easy modification in the way the network performs throu... |
Extract maximum numeric value from a given string | Set 2 (Regex approach) - GeeksforGeeks | 12 Apr, 2022
Given an alphanumeric string, extract maximum numeric value from that string. Examples:
Input : 100klh564abc365bg
Output : 564
Maximum numeric value among 100, 564
and 365 is 564.
Input : abchsd0365sdhs
Output : 365
In Set 1, we have discussed general approach for extract numeric value from given string.I... | [
{
"code": null,
"e": 24937,
"s": 24909,
"text": "\n12 Apr, 2022"
},
{
"code": null,
"e": 25025,
"s": 24937,
"text": "Given an alphanumeric string, extract maximum numeric value from that string. Examples:"
},
{
"code": null,
"e": 25154,
"s": 25025,
"text": "In... |
Python - How to write pandas dataframe to a CSV file | To write pandas dataframe to a CSV file in Python, use the to_csv() method. At first, let us create a dictionary of lists −
# dictionary of lists
d = {'Car': ['BMW', 'Lexus', 'Audi', 'Mercedes', 'Jaguar', 'Bentley'],'Date_of_purchase': ['2020-10-10', '2020-10-12', '2020-10-17', '2020-10-16', '2020-10-19', '2020-10-22']... | [
{
"code": null,
"e": 1186,
"s": 1062,
"text": "To write pandas dataframe to a CSV file in Python, use the to_csv() method. At first, let us create a dictionary of lists −"
},
{
"code": null,
"e": 1385,
"s": 1186,
"text": "# dictionary of lists\nd = {'Car': ['BMW', 'Lexus', 'Audi'... |
Print All Distinct Elements of a given integer array - GeeksforGeeks | 11 Feb, 2022
Given an integer array, print all distinct elements in array. The given array may contain duplicates and the output should print every element only once. The given array is not sorted.Examples:
Input: arr[] = {12, 10, 9, 45, 2, 10, 10, 45}
Output: 12, 10, 9, 45, 2
Input: arr[] = {1, 2, 3, 4, 5}
Output: 1... | [
{
"code": null,
"e": 41194,
"s": 41166,
"text": "\n11 Feb, 2022"
},
{
"code": null,
"e": 41389,
"s": 41194,
"text": "Given an integer array, print all distinct elements in array. The given array may contain duplicates and the output should print every element only once. The given... |
C# Program to get the first three elements from a list | Use the Take() method to get the first individual number of elements in C#.
Firstly, set a list and add elements −
List<string> myList = new List<string>();
myList.Add("One");
myList.Add("Two");
myList.Add("Three");
myList.Add("Four");
myList.Add("Five");
myList.Add("Six");
Now, use the Take() method to get the element... | [
{
"code": null,
"e": 1138,
"s": 1062,
"text": "Use the Take() method to get the first individual number of elements in C#."
},
{
"code": null,
"e": 1177,
"s": 1138,
"text": "Firstly, set a list and add elements −"
},
{
"code": null,
"e": 1337,
"s": 1177,
"text... |
Angular Material - CheckBoxes | The md-checkbox, an Angular Directive, is used as a checkbox control.
The following table lists down the parameters and description of the different attributes of md-checkbox.
* ng-model
Assignable angular expression to data-bind to.
name
The property name of the form under which the control is published.
ng-true-value... | [
{
"code": null,
"e": 2260,
"s": 2190,
"text": "The md-checkbox, an Angular Directive, is used as a checkbox control."
},
{
"code": null,
"e": 2366,
"s": 2260,
"text": "The following table lists down the parameters and description of the different attributes of md-checkbox."
},
... |
How to Detect License Plates with Python and YOLO | by Dario Radečić | Towards Data Science | Computer vision is everywhere — from facial recognition, manufacturing, agriculture, to self-driving vehicles. Today you’ll enter the world of modern computer vision with a hands-on example. You will learn how to detect license plates with the YOLO algorithm.
Why do you need YOLO? What’s wrong with traditional computer... | [
{
"code": null,
"e": 432,
"s": 172,
"text": "Computer vision is everywhere — from facial recognition, manufacturing, agriculture, to self-driving vehicles. Today you’ll enter the world of modern computer vision with a hands-on example. You will learn how to detect license plates with the YOLO algori... |
jQuery - Progressbar.js | Progressbar.js is a jQuery plugin for showing progress bar
A Simple of progressbar example as shown below −
<!doctype html>
<html>
<head>
<meta charset = "utf-8">
<meta http-equiv = "X-UA-Compatible" content = "IE = edge,chrome = 1">
<meta name = "viewport" content = "width = device-width,
... | [
{
"code": null,
"e": 2381,
"s": 2322,
"text": "Progressbar.js is a jQuery plugin for showing progress bar"
},
{
"code": null,
"e": 2430,
"s": 2381,
"text": "A Simple of progressbar example as shown below −"
},
{
"code": null,
"e": 3568,
"s": 2430,
"text": "<!d... |
Clustering documents with Python. A simple example with Wikipedia... | by Dimitris Panagopoulos | Towards Data Science | Natural Language Processing has made huge advancements in the last years. Currently, various implementations of neural networks are cutting edge and it seems that everybody talks about them. But, sometimes a simpler solution might be preferable. After all, one should try to walk before running. In this short article, I... | [
{
"code": null,
"e": 670,
"s": 171,
"text": "Natural Language Processing has made huge advancements in the last years. Currently, various implementations of neural networks are cutting edge and it seems that everybody talks about them. But, sometimes a simpler solution might be preferable. After all... |
Dart Programming - Returning Function | Functions may also return value along with the control, back to the caller. Such functions are called as returning functions.
return_type function_name(){
//statements
return value;
}
The return_type can be any valid data type.
The return_type can be any valid data type.
The return statement is optional. I... | [
{
"code": null,
"e": 2651,
"s": 2525,
"text": "Functions may also return value along with the control, back to the caller. Such functions are called as returning functions."
},
{
"code": null,
"e": 2722,
"s": 2651,
"text": "return_type function_name(){ \n //statements \n re... |
MySQL - DATE_ADD() 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 ... |
Filter an object based on an array JavaScript | Let’s say. we have an array and an object like this −
const arr = ['a', 'd', 'f'];
const obj = {
"a": 5,
"b": 8,
"c": 4,
"d": 1,
"e": 9,
"f": 2,
"g": 7
};
We are required to write a function that takes in the object and the array and filter away all the
object properties that are not an element of ... | [
{
"code": null,
"e": 1116,
"s": 1062,
"text": "Let’s say. we have an array and an object like this −"
},
{
"code": null,
"e": 1238,
"s": 1116,
"text": "const arr = ['a', 'd', 'f'];\nconst obj = {\n \"a\": 5,\n \"b\": 8,\n \"c\": 4,\n \"d\": 1,\n \"e\": 9,\n \"f\": 2,\... |
What is the use of NCHAR in MySQL? | MySQL defines NCHAR as a way to indicate that a CHAR column should use predefined character set. Utf8 is used by MySQL as its predefined character set.
In the example below, we are creating a table named ‘Student1’. In this table, we are declaring the data types of three columns with three different declaration styles ... | [
{
"code": null,
"e": 1214,
"s": 1062,
"text": "MySQL defines NCHAR as a way to indicate that a CHAR column should use predefined character set. Utf8 is used by MySQL as its predefined character set."
},
{
"code": null,
"e": 1449,
"s": 1214,
"text": "In the example below, we are c... |
AVRO - Deserialization By Generating Class | As described earlier, one can read an Avro schema into a program either by generating a class corresponding to the schema or by using the parsers library. This chapter describes how to read the schema by generating a class and Deserialize the data using Avro.
The serialized data is stored in the file emp.avro. You can ... | [
{
"code": null,
"e": 2121,
"s": 1861,
"text": "As described earlier, one can read an Avro schema into a program either by generating a class corresponding to the schema or by using the parsers library. This chapter describes how to read the schema by generating a class and Deserialize the data using... |
Program to find Circumcenter of a Triangle in C++ | In this tutorial, we will be discussing a program to find the circumcenter of a triangle.
For this we will be provided with three noncollinear points. Our task is to find the circumcenter of the triangle formed by those points.
Live Demo
#include <iostream>
#include <cfloat>
using namespace std;
//storing X and Y valu... | [
{
"code": null,
"e": 1152,
"s": 1062,
"text": "In this tutorial, we will be discussing a program to find the circumcenter of a triangle."
},
{
"code": null,
"e": 1290,
"s": 1152,
"text": "For this we will be provided with three noncollinear points. Our task is to find the circumc... |
Python - Matrix | Matrix is a special case of two dimensional array where each data element is of strictly same size. So every matrix is also a two dimensional array but not vice versa.
Matrices are very important data structures for many mathematical and scientific calculations. As we have already discussed two dimnsional array data st... | [
{
"code": null,
"e": 2495,
"s": 2327,
"text": "Matrix is a special case of two dimensional array where each data element is of strictly same size. So every matrix is also a two dimensional array but not vice versa."
},
{
"code": null,
"e": 2766,
"s": 2495,
"text": "Matrices are v... |
Attention-Based Deep Multiple Instance Learning | by Jonathan Glaser | Towards Data Science | This post consists of the following parts:
Part 1 is an overview on why AI is positioned to transform the healthcare industry.
Part 2 is an explanation of a machine learning technique called multiple instance learning and why it is suitable for pathology applications.
These serve as a build-up for Part 3 which outlines... | [
{
"code": null,
"e": 214,
"s": 171,
"text": "This post consists of the following parts:"
},
{
"code": null,
"e": 298,
"s": 214,
"text": "Part 1 is an overview on why AI is positioned to transform the healthcare industry."
},
{
"code": null,
"e": 440,
"s": 298,
... |
This thing called Weight Decay. Learn how to use weight decay to train... | by Dipam Vasani | Towards Data Science | In my previous article, I mentioned that data augmentation helps deep learning models generalize well. That was on the data side of things. What about the model side of things? What can we do while training our models, that will help them generalize even better.
We do weight decay.
We start by looking at the image abov... | [
{
"code": null,
"e": 310,
"s": 47,
"text": "In my previous article, I mentioned that data augmentation helps deep learning models generalize well. That was on the data side of things. What about the model side of things? What can we do while training our models, that will help them generalize even b... |
How to match two strings that are present in one line with grep in Linux? | In order to be able to grep two strings that exists on the same line in Linux command line, we must first understand what a grep command is and how to use it on Linux.
The grep command in Linux is used to filter searches in a file for a particular pattern of characters. It is one of the most used Linux utility commands... | [
{
"code": null,
"e": 1230,
"s": 1062,
"text": "In order to be able to grep two strings that exists on the same line in Linux command line, we must first understand what a grep command is and how to use it on Linux."
},
{
"code": null,
"e": 1459,
"s": 1230,
"text": "The grep comma... |
Question Answering with Pretrained Transformers Using PyTorch | by Raymond Cheng | Towards Data Science | Question answering is a task in information retrieval and Natural Language Processing (NLP) that investigates software that can answer questions asked by humans in natural language. In Extractive Question Answering, a context is provided so that the model can refer to it and make predictions on where the answer lies wi... | [
{
"code": null,
"e": 510,
"s": 172,
"text": "Question answering is a task in information retrieval and Natural Language Processing (NLP) that investigates software that can answer questions asked by humans in natural language. In Extractive Question Answering, a context is provided so that the model... |
How to dynamically allocate a 2D array in C? | A 2D array can be dynamically allocated in C using a single pointer. This means that a memory block of size row*column*dataTypeSize is allocated using malloc and pointer arithmetic can be used to access the matrix elements.
A program that demonstrates this is given as follows.
Live Demo
#include <stdio.h>
#include <st... | [
{
"code": null,
"e": 1286,
"s": 1062,
"text": "A 2D array can be dynamically allocated in C using a single pointer. This means that a memory block of size row*column*dataTypeSize is allocated using malloc and pointer arithmetic can be used to access the matrix elements."
},
{
"code": null,
... |
Nested Classes in Java | Writing a class within another is allowed in Java. The class written within is called the nested class, and the class that holds the inner class is called the outer class. Nested classes are divided into two types −
Non-static nested classes (Inner Classes) − These are the non-static members of a class.
Non-static nest... | [
{
"code": null,
"e": 1278,
"s": 1062,
"text": "Writing a class within another is allowed in Java. The class written within is called the nested class, and the class that holds the inner class is called the outer class. Nested classes are divided into two types −"
},
{
"code": null,
"e": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.