title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Expected Number of Trials to get N Consecutive Heads | 17 May, 2021
Given a number N. The task is to find the expected number of times a coin must be flipped to get N heads consecutively.Example:
Input: N = 2 Output: 6Input: N = 5 Output: 62
Approach: The key is to observe that if we see a tail between any consecutive N flip, it breaks the streak for continuous heads... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n17 May, 2021"
},
{
"code": null,
"e": 182,
"s": 52,
"text": "Given a number N. The task is to find the expected number of times a coin must be flipped to get N heads consecutively.Example: "
},
{
"code": null,
"e": 230,
... |
Explain subn() methods of βreβ module in Python ? | A regular expression is a special sequence of characters that helps you match or find other strings or sets of strings, using a specialized syntax held in a pattern. Regular expressions are widely used in UNIX world. The re module in python refers to the module Regular Expressions (RE). It specifies a set of strings or... | [
{
"code": null,
"e": 1592,
"s": 1187,
"text": "A regular expression is a special sequence of characters that helps you match or find other strings or sets of strings, using a specialized syntax held in a pattern. Regular expressions are widely used in UNIX world. The re module in python refers to th... |
time.Time.Before() Function in Golang With Examples | 19 Apr, 2020
In Go language, time packages supplies functionality for determining as well as viewing time. The Time.Before() function in Go language is used to check if the stated time instant t is before the stated u or not. Moreover, this function is defined under the time package. Here, you need to import the βtimeβ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Apr, 2020"
},
{
"code": null,
"e": 377,
"s": 28,
"text": "In Go language, time packages supplies functionality for determining as well as viewing time. The Time.Before() function in Go language is used to check if the stated time ins... |
Implementing Yann LeCunβs LeNet-5 in PyTorch | by Eryk Lewinson | Towards Data Science | Recently, I watched the Data Science Pioneers movie by Dataiku, in which several data scientists talked about their jobs and how they apply data science in their daily jobs. In one of the talks, they mention how Yann LeCunβs Convolutional Neural Network architecture (also known as LeNet-5) was used by the American Post... | [
{
"code": null,
"e": 891,
"s": 171,
"text": "Recently, I watched the Data Science Pioneers movie by Dataiku, in which several data scientists talked about their jobs and how they apply data science in their daily jobs. In one of the talks, they mention how Yann LeCunβs Convolutional Neural Network a... |
Maximum area of quadrilateral - GeeksforGeeks | 29 Nov, 2021
Given four sides of quadrilateral a, b, c, d, find the maximum area of the quadrilateral possible from the given sides .Examples:
Input : 1 2 1 2
Output : 2.00
It is optimal to construct a rectangle for maximum area .
According to Bretschneiderβs formula, the area of a general quadrilateral is given ... | [
{
"code": null,
"e": 24700,
"s": 24672,
"text": "\n29 Nov, 2021"
},
{
"code": null,
"e": 24832,
"s": 24700,
"text": "Given four sides of quadrilateral a, b, c, d, find the maximum area of the quadrilateral possible from the given sides .Examples: "
},
{
"code": null,
... |
How to run multiple test cases using TestNG Test Suite in Selenium? | We can run multiple test cases using TestNG test suite in Selenium webdriver. To execute test cases simultaneously, we have to enable parallel execution in TestNG.
A TestNG execution is driven by the TestNG xml file. To trigger parallel execution we have to use the attributes β parallel and thread-count. The attribute ... | [
{
"code": null,
"e": 1226,
"s": 1062,
"text": "We can run multiple test cases using TestNG test suite in Selenium webdriver. To execute test cases simultaneously, we have to enable parallel execution in TestNG."
},
{
"code": null,
"e": 1583,
"s": 1226,
"text": "A TestNG execution... |
AtomicInteger set() method in Java with examples - GeeksforGeeks | 29 Jan, 2019
The java.util.concurrent.atomic.AtomicInteger.set() is an inbuilt method in java that updates the previous value and sets it to a new value which is passed in the parameter.
Syntax:
public final void set(int newVal)
Parameters: The function accepts a single mandatory parameter newVal which is to be update... | [
{
"code": null,
"e": 24500,
"s": 24472,
"text": "\n29 Jan, 2019"
},
{
"code": null,
"e": 24674,
"s": 24500,
"text": "The java.util.concurrent.atomic.AtomicInteger.set() is an inbuilt method in java that updates the previous value and sets it to a new value which is passed in the ... |
Exploratory Factor Analysis vs Principal Components: from concept to application | by Rafael Valdece Sousa Bastos | Towards Data Science | In data science, we often want to measure variables such as social-economic status (SES). Some variables have a lot of parameters (or items), for example, SES can be measured based on income, education, etc. Then, to proceed with the analysis, it is common to reduce the number of parameters to fewer components through ... | [
{
"code": null,
"e": 665,
"s": 172,
"text": "In data science, we often want to measure variables such as social-economic status (SES). Some variables have a lot of parameters (or items), for example, SES can be measured based on income, education, etc. Then, to proceed with the analysis, it is commo... |
How to Run MySQL and phpMyAdmin Using Docker | by Mahbub Zaman | Towards Data Science | Managing a MySQL server using the command-line interface can be difficult for many people. It becomes a lot easier when we can work with a graphical interface. The database administration tool phpMyAdmin solves that problem. We can use this tool over a web interface. It supports MySQL and MariaDB with a wide variety of... | [
{
"code": null,
"e": 582,
"s": 171,
"text": "Managing a MySQL server using the command-line interface can be difficult for many people. It becomes a lot easier when we can work with a graphical interface. The database administration tool phpMyAdmin solves that problem. We can use this tool over a we... |
Creating and Deploying using AWS CLI | AWS CLI is a command line tool which helps to work with AWS services. We can use it to create, update, delete, invoke aws lambda function. In this chapter, you will discuss about installation and usage of AWS CLI in detail.
This section will guide you through the installation of AWS CLI on various operating systems. Fo... | [
{
"code": null,
"e": 2630,
"s": 2406,
"text": "AWS CLI is a command line tool which helps to work with AWS services. We can use it to create, update, delete, invoke aws lambda function. In this chapter, you will discuss about installation and usage of AWS CLI in detail."
},
{
"code": null,
... |
Java Inheritance (Subclass and Superclass) | In Java, it is possible to inherit attributes and methods from one class to another. We group the "inheritance concept" into two categories:
subclass (child) - the class that inherits from another class
superclass (parent) - the class being inherited from
To inherit from a class, use the extends
keyword.
In the exampl... | [
{
"code": null,
"e": 141,
"s": 0,
"text": "In Java, it is possible to inherit attributes and methods from one class to another. We group the \"inheritance concept\" into two categories:"
},
{
"code": null,
"e": 203,
"s": 141,
"text": "subclass (child) - the class that inherits fr... |
How to create pivot table with sum for data stored in R data frame? | To create pivot table with sum for data stored in R data frame, we can follow the below steps β
First of all, create a data frame with two categorical and one numerical column.
First of all, create a data frame with two categorical and one numerical column.
Then, use dcast function from reshape2 package to create pivot... | [
{
"code": null,
"e": 1158,
"s": 1062,
"text": "To create pivot table with sum for data stored in R data frame, we can follow the below steps β"
},
{
"code": null,
"e": 1239,
"s": 1158,
"text": "First of all, create a data frame with two categorical and one numerical column."
},... |
Mutex lock for Linux Thread Synchronization - GeeksforGeeks | 20 Nov, 2019
Prerequisite : Multithreading in C
Thread synchronization is defined as a mechanism which ensures that two or more concurrent processes or threads do not simultaneously execute some particular program segment known as a critical section. Processesβ access to critical section is controlled by using synchron... | [
{
"code": null,
"e": 24051,
"s": 24023,
"text": "\n20 Nov, 2019"
},
{
"code": null,
"e": 24086,
"s": 24051,
"text": "Prerequisite : Multithreading in C"
},
{
"code": null,
"e": 24750,
"s": 24086,
"text": "Thread synchronization is defined as a mechanism which ... |
Angular PrimeNG Card Component - GeeksforGeeks | 11 Sep, 2021
Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the Card Component in Angular PrimeNG. We will also learn about th... | [
{
"code": null,
"e": 25109,
"s": 25081,
"text": "\n11 Sep, 2021"
},
{
"code": null,
"e": 25496,
"s": 25109,
"text": "Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make resp... |
How do inline variables work in C++/C++17? | In C++, we can use the inline keyword for functions. In C++ 17 version, the inline variable concept has come.
The inline variable is allowed to be defined in multiple translation units. It also follows the one definition rule. If this is defined more than one time, the compiler merges them all into a single object in f... | [
{
"code": null,
"e": 1172,
"s": 1062,
"text": "In C++, we can use the inline keyword for functions. In C++ 17 version, the inline variable concept has come."
},
{
"code": null,
"e": 1396,
"s": 1172,
"text": "The inline variable is allowed to be defined in multiple translation uni... |
C Language | Set 3 - GeeksforGeeks | 09 Apr, 2018
Following questions have been asked in GATE CS exam.
1.Assume the following C variable declaration
int *A [10], B[10][10];
Of the following expressionsI A[2]II A[2][3]III B[1]IV B[2][3]which will not give compile-time errors if used as left hand sides of assignment statements in a C program (GATE CS 200... | [
{
"code": null,
"e": 23569,
"s": 23541,
"text": "\n09 Apr, 2018"
},
{
"code": null,
"e": 23622,
"s": 23569,
"text": "Following questions have been asked in GATE CS exam."
},
{
"code": null,
"e": 23668,
"s": 23622,
"text": "1.Assume the following C variable dec... |
Count the number of objects using Static member function in C++ | Here we will see how to count number of objects are created from a specific class using some static member functions. The static members are class properties, not the object properties. For a single class there will be only one instance for static members. No new members are created for each objects.
In this problem we... | [
{
"code": null,
"e": 1364,
"s": 1062,
"text": "Here we will see how to count number of objects are created from a specific class using some static member functions. The static members are class properties, not the object properties. For a single class there will be only one instance for static membe... |
Data Classes in Python | Set 3 (dataclass fields) - GeeksforGeeks | 12 Apr, 2019
Prerequisite: Data Classes in Python Set 1 | Set 2
In this post we will discuss how to modify certain properties of the attributes of DataClass object, without explicitly writing code for it using field function.
field() function β
dataclasses.field(*, default=MISSING, default_factory=MISSING, repr=True, h... | [
{
"code": null,
"e": 23801,
"s": 23773,
"text": "\n12 Apr, 2019"
},
{
"code": null,
"e": 23852,
"s": 23801,
"text": "Prerequisite: Data Classes in Python Set 1 | Set 2"
},
{
"code": null,
"e": 24014,
"s": 23852,
"text": "In this post we will discuss how to mod... |
Python SQLite - Join | When you have divided the data in two tables you can fetch combined records from these two tables using Joins.
Assume we have created a table with name CRICKETERS using the following query β
sqlite> CREATE TABLE CRICKETERS (
First_Name VARCHAR(255),
Last_Name VARCHAR(255),
Age int,
Place_Of_Birth VARCHAR(25... | [
{
"code": null,
"e": 3316,
"s": 3205,
"text": "When you have divided the data in two tables you can fetch combined records from these two tables using Joins."
},
{
"code": null,
"e": 3396,
"s": 3316,
"text": "Assume we have created a table with name CRICKETERS using the following... |
Grant all privileges of a database to a MySQL user? | First, create a user and password using CREATE command. The syntax is as follows.
CREATE USER 'yourUserName'@'localhost' IDENTIFIED BY 'yourPassword';
The syntax to give all privileges of the specific database to the user is as follows.
GRANT ALL PRIVILEGES ON yourDatabaseName . * TO 'yourUserName'@'localhost';
Now you... | [
{
"code": null,
"e": 1144,
"s": 1062,
"text": "First, create a user and password using CREATE command. The syntax is as follows."
},
{
"code": null,
"e": 1213,
"s": 1144,
"text": "CREATE USER 'yourUserName'@'localhost' IDENTIFIED BY 'yourPassword';"
},
{
"code": null,
... |
How can I use a script to create users in MongoDB? | You can use createUser() method for this. Following is the syntax β
db.createUser(
{
user: "yourUserName",
pwd: "yourPassword",
roles: [ { role: "read", db: "yourDatabaseName" } ]
}
);
Let us create a user in MongoDB. Here, we are using database βtestβ β
> db.createUser(
... {
... user:... | [
{
"code": null,
"e": 1130,
"s": 1062,
"text": "You can use createUser() method for this. Following is the syntax β"
},
{
"code": null,
"e": 1271,
"s": 1130,
"text": "db.createUser(\n {\n user: \"yourUserName\",\n pwd: \"yourPassword\",\n roles: [ { role: \"read\"... |
How to find a matching substring using regular expression in C#? | Our string is β
string str = " My make ";
Use the following regular expression to find the substring βmakeβ
@"\bmake\b"
Here is the complete code β
Live Demo
using System;
using System.Text.RegularExpressions;
namespace RegExApplication {
public class Program {
private static void showMatch(string text, st... | [
{
"code": null,
"e": 1078,
"s": 1062,
"text": "Our string is β"
},
{
"code": null,
"e": 1105,
"s": 1078,
"text": "string str = \" My make \";\n"
},
{
"code": null,
"e": 1171,
"s": 1105,
"text": "Use the following regular expression to find the substring βmakeβ... |
How to call a method after a delay in Android Kotlin? | This example demonstrates how to call a method after a delay in Android 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"?>
<Relativ... | [
{
"code": null,
"e": 1142,
"s": 1062,
"text": "This example demonstrates how to call a method after a delay in Android Kotlin."
},
{
"code": null,
"e": 1270,
"s": 1142,
"text": "Step 1 β Create a new project in Android Studio, go to File? New Project and fill all required details... |
Pytube | Python library to download youtube videos - GeeksforGeeks | 08 Dec, 2021
YouTube is very popular video sharing website. Downloading a video from YouTube is a tough job. Downloading the Downloader and get the video using that or go to any other website which fetches the video and saves on your computer. Using Python, this task is very easy. Few lines of code will download the vi... | [
{
"code": null,
"e": 24751,
"s": 24723,
"text": "\n08 Dec, 2021"
},
{
"code": null,
"e": 25437,
"s": 24751,
"text": "YouTube is very popular video sharing website. Downloading a video from YouTube is a tough job. Downloading the Downloader and get the video using that or go to an... |
How to call a parent method from child class in JavaScript? - GeeksforGeeks | 05 Jun, 2020
A property in programming known as inheritance, by virtue of which a class can derive the methods and properties of other class analogous to parent-child relationship in living beings. A child inherits its characteristics from its parents but it doesnβt work the other around. Also, similar to the parent-ch... | [
{
"code": null,
"e": 24364,
"s": 24336,
"text": "\n05 Jun, 2020"
},
{
"code": null,
"e": 24995,
"s": 24364,
"text": "A property in programming known as inheritance, by virtue of which a class can derive the methods and properties of other class analogous to parent-child relations... |
Common error in Group By - GeeksforGeeks | 19 Jun, 2019
Prerequisite: SQL | GROUP BY
Error:Column βcolβ is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Examples:
Input:
select empId, empName, empAmount from emp group by empId, empName
Output: Error
Explanation:empAmount is not in group by list... | [
{
"code": null,
"e": 24294,
"s": 24266,
"text": "\n19 Jun, 2019"
},
{
"code": null,
"e": 24323,
"s": 24294,
"text": "Prerequisite: SQL | GROUP BY"
},
{
"code": null,
"e": 24456,
"s": 24323,
"text": "Error:Column βcolβ is invalid in the select list because it i... |
Python Inner Functions - GeeksforGeeks | 25 Nov, 2019
In Python, functions are treated as first class objects. First class objects in a language are handled uniformly throughout. They may be stored in data structures, passed as arguments, or used in control structures. A programming language is said to support first-class functions if it treats functions as f... | [
{
"code": null,
"e": 24268,
"s": 24240,
"text": "\n25 Nov, 2019"
},
{
"code": null,
"e": 24649,
"s": 24268,
"text": "In Python, functions are treated as first class objects. First class objects in a language are handled uniformly throughout. They may be stored in data structures,... |
Fun with the Binomial Distribution | by Tony Yiu | Towards Data Science | Everyone knows and loves the normal distribution. It is used in a huge variety of applications such as investment modeling, A/B testing, and manufacturing process improvement (six sigma).
But people are less familiar with the binomial distribution. Thatβs a shame because the binomial distribution is really useful. Have... | [
{
"code": null,
"e": 360,
"s": 172,
"text": "Everyone knows and loves the normal distribution. It is used in a huge variety of applications such as investment modeling, A/B testing, and manufacturing process improvement (six sigma)."
},
{
"code": null,
"e": 529,
"s": 360,
"text":... |
Program to find Smallest and Largest Word in a String in C++ | In this problem, we are given string str. Our task is to create a program to
find Smallest and Largest Word in a String in C++.
Problem Description β Here, we have a string we need to find the word whose length is maximum and minimum out of all words in the string. The word is separated using white spaces or null(\0) c... | [
{
"code": null,
"e": 1190,
"s": 1062,
"text": "In this problem, we are given string str. Our task is to create a program to\nfind Smallest and Largest Word in a String in C++."
},
{
"code": null,
"e": 1393,
"s": 1190,
"text": "Problem Description β Here, we have a string we need ... |
8 different ways to Add Two Numbers in C/C++ - GeeksforGeeks | 29 May, 2021
Given two numbers A and B, the task is to find the sum of the given two numbers.Examples:
Input: A = 5, B = 6 Output: sum = 11Input: A = 4, B = 11 Output: sum = 15
Method 1 β using Addition Operator: Here simply use the addition operator between two numbers and print the sum of the number.
sum = A + B ... | [
{
"code": null,
"e": 24642,
"s": 24614,
"text": "\n29 May, 2021"
},
{
"code": null,
"e": 24733,
"s": 24642,
"text": "Given two numbers A and B, the task is to find the sum of the given two numbers.Examples: "
},
{
"code": null,
"e": 24809,
"s": 24733,
"text": ... |
\bigcap - Tex Command | \bigcap - Used to draw bigcap symbol.
{ \bigcap }
\bigcap command is used to draw bigcap symbol.
\bigcap
β
\bigcap
β
\bigcap
14 Lectures
52 mins
Ashraf Said
11 Lectures
1 hours
Ashraf Said
9 Lectures
1 hours
Emenwa Global, Ejike IfeanyiChukwu
29 Lectures
2.5 h... | [
{
"code": null,
"e": 8024,
"s": 7986,
"text": "\\bigcap - Used to draw bigcap symbol."
},
{
"code": null,
"e": 8036,
"s": 8024,
"text": "{ \\bigcap }"
},
{
"code": null,
"e": 8083,
"s": 8036,
"text": "\\bigcap command is used to draw bigcap symbol."
},
{
... |
Detecting Sounds with Deep Learning | by Hyeongchan Kim | Towards Data Science | Created together with Dmytro Karabash, Maxim Korotkov, Tony Chen.
Have you ever woken up without understanding what it was, but knowing for sure that some sound isnβt right?
Sound identification is one of our instincts that kept human beings safe. Sounds play a significant role in our life, Starting from recognizing a ... | [
{
"code": null,
"e": 238,
"s": 172,
"text": "Created together with Dmytro Karabash, Maxim Korotkov, Tony Chen."
},
{
"code": null,
"e": 346,
"s": 238,
"text": "Have you ever woken up without understanding what it was, but knowing for sure that some sound isnβt right?"
},
{
... |
Mapping 2019β20 Australian bushfires | by Miguel Pinto | Towards Data Science | The extreme extent of 2019β20 Australian bushfires made headlines around the world at the beginning of 2020. Extreme events like these are expected to become more frequent in a warming climate. Monitoring the extent of the fires is very important to assess the damage and for a wide range of applications ranging from fo... | [
{
"code": null,
"e": 869,
"s": 172,
"text": "The extreme extent of 2019β20 Australian bushfires made headlines around the world at the beginning of 2020. Extreme events like these are expected to become more frequent in a warming climate. Monitoring the extent of the fires is very important to asses... |
Java Program to Get the Size of Given File in Bytes, KiloBytes and MegaBytes | 09 Mar, 2021
The in-built File.length() method in java can be used to get file size in java. The length() function is a part of the File class in Java. This function returns the length of the file whose path was specified. If the file does not exist or some error happens then it returns 0.
Parameters: This method does ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Mar, 2021"
},
{
"code": null,
"e": 306,
"s": 28,
"text": "The in-built File.length() method in java can be used to get file size in java. The length() function is a part of the File class in Java. This function returns the length of ... |
Tesseract OCR with Java with Examples | 06 Dec, 2021
In this article, we will learn how to work with Tesseract OCR in Java using the Tesseract API.
What is Tesseract OCR?Tesseract OCR is an optical character reading engine developed by HP laboratories in 1985 and open sourced in 2005. Since 2006 it is developed by Google. Tesseract has Unicode (UTF-8) suppor... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Dec, 2021"
},
{
"code": null,
"e": 123,
"s": 28,
"text": "In this article, we will learn how to work with Tesseract OCR in Java using the Tesseract API."
},
{
"code": null,
"e": 703,
"s": 123,
"text": "What is Tes... |
Uniform-Cost Search (Dijkstra for large Graphs) | 25 Aug, 2021
Uniform-Cost Search is a variant of Dijikstraβs algorithm. Here, instead of inserting all vertices into a priority queue, we insert only source, then one by one insert when needed. In every step, we check if the item is already in priority queue (using visited array). If yes, we perform decrease key, else ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n25 Aug, 2021"
},
{
"code": null,
"e": 557,
"s": 54,
"text": "Uniform-Cost Search is a variant of Dijikstraβs algorithm. Here, instead of inserting all vertices into a priority queue, we insert only source, then one by one insert when n... |
Tuple Relational Calculus (TRC) in DBMS | 30 Nov, 2021
Tuple Relational Calculus is a non-procedural query language unlike relational algebra. Tuple Calculus provides only the description of the query but it does not provide the methods to solve it. Thus, it explains what to do but not how to do. In Tuple Calculus, a query is expressed as
{t| P(t)}
where t = ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Nov, 2021"
},
{
"code": null,
"e": 339,
"s": 52,
"text": "Tuple Relational Calculus is a non-procedural query language unlike relational algebra. Tuple Calculus provides only the description of the query but it does not provide the ... |
Optparse module in Python | 17 Feb, 2022
Optparse module makes easy to write command-line tools. It allows argument parsing in the python program.
optparse make it easy to handle the command-line argument.
It comes default with python.
It allows dynamic data input to change the output
Code: Creating an OptionParser object.
Python3
import optpars... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n17 Feb, 2022"
},
{
"code": null,
"e": 160,
"s": 54,
"text": "Optparse module makes easy to write command-line tools. It allows argument parsing in the python program."
},
{
"code": null,
"e": 219,
"s": 160,
"text": ... |
Print all triplets with given sum | 08 Jun, 2022
Given an array of distinct elements. The task is to find triplets in array whose sum is equal to a given number.
Examples:
Input: arr[] = {0, -1, 2, -3, 1}
sum = -2
Output: 0 -3 1
-1 2 -3
If we calculate the sum of the output,
0 + (-3) + 1 = -2
(-1) + 2 + (-3) = -2
Input: arr[] = {1, -... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Jun, 2022"
},
{
"code": null,
"e": 167,
"s": 54,
"text": "Given an array of distinct elements. The task is to find triplets in array whose sum is equal to a given number."
},
{
"code": null,
"e": 178,
"s": 167,
"... |
14 Lesser-Known Impressive Features of Scikit Learn Library | by Davis David | Towards Data Science | Scikit learn remains one of the most popular open-source and machine learning library in the world of Artificial Intelligence. The scikit-learn library contains a lot of efficient tools for machine learning and statistical modeling including classification, regression, clustering, and dimensionality reduction.
Scikit-l... | [
{
"code": null,
"e": 484,
"s": 172,
"text": "Scikit learn remains one of the most popular open-source and machine learning library in the world of Artificial Intelligence. The scikit-learn library contains a lot of efficient tools for machine learning and statistical modeling including classificatio... |
GATE | GATE CS Mock 2018 | Set 2 | Question 42 - GeeksforGeeks | 08 Mar, 2018
S1 : Anyone of the followings can be used to declare a node for a singly linked list. If we use the first declaration, βstruct node * nodePtr;β would be used to declare pointer to a node. If we use the second declaration, βNODEPTR nodePtr;β can be used to declare pointer to a node.
/* First declaration */
... | [
{
"code": null,
"e": 25831,
"s": 25803,
"text": "\n08 Mar, 2018"
},
{
"code": null,
"e": 26114,
"s": 25831,
"text": "S1 : Anyone of the followings can be used to declare a node for a singly linked list. If we use the first declaration, βstruct node * nodePtr;β would be used to de... |
journalctl Command in Linux with Examples | 10 Feb, 2022
journalctl command in Linux is used to view systemd, kernel and journal logs. The logs are presented in the following way:
-- Logs begin at [date_time_stamp], end at [dat_time_stamp]
[date_time_stamp] [host_name] kernel:
It displays the paginated output, hence it is a bit easy to navigate through a lot of... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Feb, 2022"
},
{
"code": null,
"e": 151,
"s": 28,
"text": "journalctl command in Linux is used to view systemd, kernel and journal logs. The logs are presented in the following way:"
},
{
"code": null,
"e": 250,
"s": 1... |
last command in Linux with Examples | 22 May, 2019
The last command in Linux is used to display the list of all the users logged in and out since the file /var/log/wtmp was created. One or more usernames can be given as an argument to display their login in (and out) time and their host-name.
Syntax:
last [options] [username...] [tty...]
Example:
Options:
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 May, 2019"
},
{
"code": null,
"e": 271,
"s": 28,
"text": "The last command in Linux is used to display the list of all the users logged in and out since the file /var/log/wtmp was created. One or more usernames can be given as an arg... |
HTML - Elements | An HTML element is defined by a starting tag. If the element contains other content, it ends with a closing tag, where the element name is preceded by a forward slash as shown below with few tags β
So here <p>....</p> is an HTML element, <h1>...</h1> is another HTML element. There are some HTML elements which don't nee... | [
{
"code": null,
"e": 2706,
"s": 2508,
"text": "An HTML element is defined by a starting tag. If the element contains other content, it ends with a closing tag, where the element name is preceded by a forward slash as shown below with few tags β"
},
{
"code": null,
"e": 2925,
"s": 270... |
Find missing element in a sorted array of consecutive numbers | 05 Aug, 2021
Given an array arr[] of n distinct integers. Elements are placed sequentially in ascending order with one element missing. The task is to find the missing element.Examples:
Input: arr[] = {1, 2, 4, 5, 6, 7, 8, 9} Output: 3Input: arr[] = {-4, -3, -1, 0, 1, 2} Output: -2Input: arr[] = {1, 2, 3, 4} Output: ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n05 Aug, 2021"
},
{
"code": null,
"e": 227,
"s": 52,
"text": "Given an array arr[] of n distinct integers. Elements are placed sequentially in ascending order with one element missing. The task is to find the missing element.Examples: ... |
R - JSON Files | JSON file stores data as text in human-readable format. Json stands for JavaScript Object Notation. R can read JSON files using the rjson package.
In the R console, you can issue the following command to install the rjson package.
install.packages("rjson")
Create a JSON file by copying the below data into a text edito... | [
{
"code": null,
"e": 2683,
"s": 2536,
"text": "JSON file stores data as text in human-readable format. Json stands for JavaScript Object Notation. R can read JSON files using the rjson package."
},
{
"code": null,
"e": 2767,
"s": 2683,
"text": "In the R console, you can issue the... |
Spring Boot β CRUD Operations | 17 Dec, 2021
CRUD stands for Create, Read/Retrieve, Update and Delete and these are the four basic operations that we perform on persistence storage. CRUD is data-oriented and the standardized use of HTTP methods. HTTP has a few methods which work as CRUD operations and do note they are very vital from a developmental ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Dec, 2021"
},
{
"code": null,
"e": 513,
"s": 28,
"text": "CRUD stands for Create, Read/Retrieve, Update and Delete and these are the four basic operations that we perform on persistence storage. CRUD is data-oriented and the standard... |
Divide a Pandas DataFrame randomly in a given ratio | 25 Oct, 2021
Divide a Pandas Dataframe task is very useful in case of split a given dataset into train and test data for training and testing purposes in the field of Machine Learning, Artificial Intelligence, etc. Letβs see how to divide the pandas dataframe randomly into given ratios. For this task, We will use Data... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Oct, 2021"
},
{
"code": null,
"e": 409,
"s": 28,
"text": "Divide a Pandas Dataframe task is very useful in case of split a given dataset into train and test data for training and testing purposes in the field of Machine Learning, Art... |
JavaScript | Creating a Custom Image Slider | 26 Nov, 2019
What is an image slider?
Image Slider or Image Carousel is an expedient way to show multiple images on a website. Alluring flashy images can draw many visitors to the site. Below image shows a sample image slider:
In this post, we will create the above image slider using HTML, CSS and JavaScript. Letβs beg... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n26 Nov, 2019"
},
{
"code": null,
"e": 77,
"s": 52,
"text": "What is an image slider?"
},
{
"code": null,
"e": 266,
"s": 77,
"text": "Image Slider or Image Carousel is an expedient way to show multiple images on a we... |
Quiver Plot in Matplotlib | 23 Feb, 2022
Quiver plot is basically a type of 2D plot which shows vector lines as arrows. This type of plots are useful in Electrical engineers to visualize electrical potential and show stress gradients in Mechanical engineering.
Letβs start creating a simple quiver plot containing one arrow which will explain how ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Feb, 2022"
},
{
"code": null,
"e": 249,
"s": 28,
"text": "Quiver plot is basically a type of 2D plot which shows vector lines as arrows. This type of plots are useful in Electrical engineers to visualize electrical potential and show... |
Difference between β__eq__β VS βisβ VS β==β in Python | 01 Oct, 2020
There are various ways using which the objects of any type in Python can be compared. Python has β==β operator, βisβ operator, and β__eq__β dunder method for comparing two objects of a class or to customize the comparison. This article explains the above said three operators and how they differ from each o... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n01 Oct, 2020"
},
{
"code": null,
"e": 367,
"s": 54,
"text": "There are various ways using which the objects of any type in Python can be compared. Python has β==β operator, βisβ operator, and β__eq__β dunder method for comparing two ob... |
Make all elements of an Array equal by adding or subtracting at most K | 12 Jun, 2022
Given an array arr[] containing positive integers of size N and an integer K, the task is to make all the elements in the array equal to some value D (D > 0) such that |arr[i] β D| β€ K. Print the value of D or -1 if it is not possible to make the array equal. Examples:
Input: arr[] = {1, 2, 3, 4, 5}, K =... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n12 Jun, 2022"
},
{
"code": null,
"e": 324,
"s": 52,
"text": "Given an array arr[] containing positive integers of size N and an integer K, the task is to make all the elements in the array equal to some value D (D > 0) such that |arr[i... |
IntStream of() in Java | 18 May, 2021
IntStream of(int t) returns a sequential IntStream containing a single element. Syntax :
static IntStream of(int t)
Parameters :
IntStream : A sequence of primitive int-valued elements.t : Represents the single element in the IntStream.
IntStream : A sequence of primitive int-valued elements.
t : Repre... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 May, 2021"
},
{
"code": null,
"e": 143,
"s": 52,
"text": "IntStream of(int t) returns a sequential IntStream containing a single element. Syntax : "
},
{
"code": null,
"e": 170,
"s": 143,
"text": "static IntStre... |
Project Idea | AI Therapist | 23 Nov, 2021
Project Title : AI therapist
Introduction: Input is user provided description about how his day went in two-three lines. Using natural language processing, our program detects how user is feeling. He may be feeling depressed, feared, angry etc. Then a recommender system is used to show him content based on... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Nov, 2021"
},
{
"code": null,
"e": 81,
"s": 52,
"text": "Project Title : AI therapist"
},
{
"code": null,
"e": 480,
"s": 81,
"text": "Introduction: Input is user provided description about how his day went in two... |
Pygame β Creating Sprites | 28 Jul, 2021
Sprites are objects, with different properties like height, width, color, etc., and methods like moving right, left, up and down, jump, etc. In this article, we are looking to create an object in which users can control that object and move it forward, backward, up, and down using arrow keys.
Let first loo... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jul, 2021"
},
{
"code": null,
"e": 322,
"s": 28,
"text": "Sprites are objects, with different properties like height, width, color, etc., and methods like moving right, left, up and down, jump, etc. In this article, we are looking to... |
real() function in C++ | 08 Oct, 2018
The real() function is defined in the complex header file. The real() function is used to find the real part of the complex number.
Syntax:
template<class T> T
real(const complex<T>& z);
Parameter: This method takes a mandatory parameter z: which represents the given complex number.
Return: It return... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Oct, 2018"
},
{
"code": null,
"e": 186,
"s": 54,
"text": "The real() function is defined in the complex header file. The real() function is used to find the real part of the complex number."
},
{
"code": null,
"e": 194,
... |
What are Ambients in TypeScript ? | 26 Jul, 2021
Typescript provides a way for using third-party libraries like Node.js, jQuery, AngularJS, etc. in an easier and safer manner. These are done with the help of Ambient declarations.
Ambient Declarations are a method which informs the TypeScript compiler that the real source code (like functions or variables... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Jul, 2021"
},
{
"code": null,
"e": 209,
"s": 28,
"text": "Typescript provides a way for using third-party libraries like Node.js, jQuery, AngularJS, etc. in an easier and safer manner. These are done with the help of Ambient declarat... |
PayTm Interview Experience | Set 23 (For 2 Years Experienced) | 11 Mar, 2018
Round 1:
First round was taken on mettl, online judge. There was two questions and that required to be done in 1hr
1. A paragraph which contained some dates in format DD-MM-YYYY, find number of distinct years in the paragraph.
For e.g Some random words with date 12-01-1990 and some more words with date 1... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Mar, 2018"
},
{
"code": null,
"e": 63,
"s": 54,
"text": "Round 1:"
},
{
"code": null,
"e": 169,
"s": 63,
"text": "First round was taken on mettl, online judge. There was two questions and that required to be done... |
Python Decorators: A Complete Guide | 22 Jun, 2020
A decorator is a design pattern tool in Python for wrapping code around functions or classes (defined blocks). This design pattern allows a programmer to add new functionality to existing functions or classes without modifying the existing structure. The section provides an overview of what decorators are,... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n22 Jun, 2020"
},
{
"code": null,
"e": 432,
"s": 54,
"text": "A decorator is a design pattern tool in Python for wrapping code around functions or classes (defined blocks). This design pattern allows a programmer to add new functionalit... |
cc command in Linux with Examples - GeeksforGeeks | 15 May, 2019
cc command is stands for C Compiler, usually an alias command to gcc or clang. As the name suggests, executing the cc command will usually call the gcc on Linux systems. It is used to compile the C language codes and create executables. The number of options available for the cc command is very high. The m... | [
{
"code": null,
"e": 24039,
"s": 24011,
"text": "\n15 May, 2019"
},
{
"code": null,
"e": 24403,
"s": 24039,
"text": "cc command is stands for C Compiler, usually an alias command to gcc or clang. As the name suggests, executing the cc command will usually call the gcc on Linux sy... |
Accessing nth element from Python tuples in list | A python list can contain tuples as its elements. In this article we will explore how to access every nth element form the tuples that are present as the elements in the given tuple.
We can design a for loop to access the elements from the list with the in clause applied for nth index. Then we store the result into a n... | [
{
"code": null,
"e": 1245,
"s": 1062,
"text": "A python list can contain tuples as its elements. In this article we will explore how to access every nth element form the tuples that are present as the elements in the given tuple."
},
{
"code": null,
"e": 1391,
"s": 1245,
"text": ... |
How to create clickable links in a textView on Android? | This example demonstrates how do I create clickable links in a textView on 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"?>
<Re... | [
{
"code": null,
"e": 1146,
"s": 1062,
"text": "This example demonstrates how do I create clickable links in a textView on android."
},
{
"code": null,
"e": 1275,
"s": 1146,
"text": "Step 1 β Create a new project in Android Studio, go to File β New Project and fill all required de... |
Builtin functions of GCC compiler in C++ | In the GCC compiler there are some builtin functions. These functions are like below.
This builtin function is used to count the number of 1s in an integer type data. Let us see an example of _builtin_popcount() function.
Live Demo
#include<iostream>
using namespace std;
int main() {
int n = 13; //The binary is 110... | [
{
"code": null,
"e": 1148,
"s": 1062,
"text": "In the GCC compiler there are some builtin functions. These functions are like below."
},
{
"code": null,
"e": 1284,
"s": 1148,
"text": "This builtin function is used to count the number of 1s in an integer type data. Let us see an e... |
Permutation Sequence in C++ | Suppose the set is like [1,2,3,...,n], contains a total of n! unique permutations. By listing and labeling all of the permutations in order, we get these sequence for n = 3: ["123","132","213","231","312","321"] So if n and k are given, then return the kth permutation sequence. The n will be between 1 to 9 (inclusive) ... | [
{
"code": null,
"e": 1447,
"s": 1062,
"text": "Suppose the set is like [1,2,3,...,n], contains a total of n! unique permutations. By listing and labeling all of the permutations in order, we get these sequence for n = 3: [\"123\",\"132\",\"213\",\"231\",\"312\",\"321\"] So if n and k are given, then... |
numpy.squeeze | This function removes one-dimensional entry from the shape of the given array. Two parameters are required for this function.
numpy.squeeze(arr, axis)
Where,
arr
Input array
axis
int or tuple of int. selects a subset of single dimensional entries in the shape
import numpy as np
x = np.arange(9).reshape(1,3,3)
prin... | [
{
"code": null,
"e": 2369,
"s": 2243,
"text": "This function removes one-dimensional entry from the shape of the given array. Two parameters are required for this function."
},
{
"code": null,
"e": 2395,
"s": 2369,
"text": "numpy.squeeze(arr, axis)\n"
},
{
"code": null,
... |
Output of C programs | Set 64 (Pointers) - GeeksforGeeks | 25 Apr, 2018
Prerequisite : Pointers in CQuestion 1 : What will be the output of following program?
#include "stdio.h"int main(){ char a[] = { 'A', 'B', 'C', 'D' }; char* ppp = &a[0]; *ppp++; // Line 1 printf("%c %c ", *++ppp, --*ppp); // Line 2}
OPTIONS:a)C Bb)B Ac)B Cd)C A
OUTPUT: (d) C A
Explanation:Lin... | [
{
"code": null,
"e": 24366,
"s": 24338,
"text": "\n25 Apr, 2018"
},
{
"code": null,
"e": 24453,
"s": 24366,
"text": "Prerequisite : Pointers in CQuestion 1 : What will be the output of following program?"
},
{
"code": "#include \"stdio.h\"int main(){ char a[] = { 'A', ... |
What is Non-Immediate Left Recursion in compiler design? | A Grammar G (V, T, P, S) is left recursive if it has a production in the form.
A β A Ξ± |Ξ².
The above Grammar is left recursive because the left of production is occurring at a first position on the right side of production. It can eliminate left recursion by replacing a pair of production with
A β Ξ²Aβ²
A β Ξ±Aβ²|Ξ΅
The gen... | [
{
"code": null,
"e": 1141,
"s": 1062,
"text": "A Grammar G (V, T, P, S) is left recursive if it has a production in the form."
},
{
"code": null,
"e": 1153,
"s": 1141,
"text": "A β A Ξ± |Ξ²."
},
{
"code": null,
"e": 1357,
"s": 1153,
"text": "The above Grammar is... |
Find the size of a HashMap in Java | Use the size() method to get the size of HashMap. Let us first create a HashMap
HashMap hm = new HashMap();
Now, add some elements β
hm.put("Bag", new Integer(1100));
hm.put("Sunglasses", new Integer(2000));
hm.put("Franes", new Integer(800));
hm.put("Wallet", new Integer(700));
hm.put("Belt", new Integer(600));
Since,... | [
{
"code": null,
"e": 1142,
"s": 1062,
"text": "Use the size() method to get the size of HashMap. Let us first create a HashMap"
},
{
"code": null,
"e": 1170,
"s": 1142,
"text": "HashMap hm = new HashMap();"
},
{
"code": null,
"e": 1195,
"s": 1170,
"text": "Now... |
$("#submitButton").attr("disabled", "disabled") | This would modify the disabled attribute to the value "disabled" while clicking Submit button.
Here is the simple syntax to use this method β
selector.attr("disabled","disabled");
Here is the description of all the parameters used by this method β
disabled This is the CSS property of the matched element.
disabled This... | [
{
"code": null,
"e": 1783,
"s": 1688,
"text": "This would modify the disabled attribute to the value \"disabled\" while clicking Submit button."
},
{
"code": null,
"e": 1830,
"s": 1783,
"text": "Here is the simple syntax to use this method β"
},
{
"code": null,
"e": 1... |
The Fastest and Easiest Way to Forecast Data on Python | by Rohan Gupta | Towards Data Science | Recently, I learned about Prophet (fbprophet). If youβre a Data Scientist who works with time-series data, you will love this tool.
For those not aware, Prophet was developed by Facebook to aid Data Scientists with automated forecasting for time-series data through its simple Sk-Learn style API. Prophet can be fine-tun... | [
{
"code": null,
"e": 303,
"s": 171,
"text": "Recently, I learned about Prophet (fbprophet). If youβre a Data Scientist who works with time-series data, you will love this tool."
},
{
"code": null,
"e": 915,
"s": 303,
"text": "For those not aware, Prophet was developed by Facebook... |
How to get file URI reference in Java? | The class named File of the java.io package represents a file or directory (path names) in the system. This class provides various methods to perform various operations on files/directories.
In general, an URI (Uniform Resource Identifier) represents a resource. The URI class of Java represents this format You can get ... | [
{
"code": null,
"e": 1253,
"s": 1062,
"text": "The class named File of the java.io package represents a file or directory (path names) in the system. This class provides various methods to perform various operations on files/directories."
},
{
"code": null,
"e": 1439,
"s": 1253,
... |
Count the numbers divisible by βMβ in a given range in C++ | We are given three numbers A,B and M. A and B define the range [A,B] of numbers.The goal is
to count numbers between A and B that are divisible by M.
We will start from i=A till first multiple of M. Increment count if i%M=0. Now increment i till i<=B
and increase count.
Letβs understand with examples.
A=11,B=20, M=5
Co... | [
{
"code": null,
"e": 1212,
"s": 1062,
"text": "We are given three numbers A,B and M. A and B define the range [A,B] of numbers.The goal is\nto count numbers between A and B that are divisible by M."
},
{
"code": null,
"e": 1333,
"s": 1212,
"text": "We will start from i=A till fir... |
Yii - Gii | Gii is the extension, that provides a web-based code generator for generating models, forms, modules, CRUD, and so forth.
By default, the following generators are available β
Model Generator β Generates an ActiveRecord class for the specified database table.
Model Generator β Generates an ActiveRecord class for the spe... | [
{
"code": null,
"e": 2955,
"s": 2833,
"text": "Gii is the extension, that provides a web-based code generator for generating models, forms, modules, CRUD, and so forth."
},
{
"code": null,
"e": 3008,
"s": 2955,
"text": "By default, the following generators are available β"
},
... |
Bootstrap 4 .card-header-tabs class | Use the card-header-tabs in Bootstrap to style navigation links in card header β
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs">
<li class="nav-item">
<a class="nav-link active" href="#">Drupal Commerce</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">WooCommer... | [
{
"code": null,
"e": 1143,
"s": 1062,
"text": "Use the card-header-tabs in Bootstrap to style navigation links in card header β"
},
{
"code": null,
"e": 1414,
"s": 1143,
"text": "<div class=\"card-header\">\n <ul class=\"nav nav-tabs card-header-tabs\">\n <li class=\"nav-item... |
TreeSet comparator() Method in Java with Examples | 01 Nov, 2021
TreeSet is one of the most important implementations of the SortedSet interface in Java that uses a Tree for storage. The ordering of the elements is maintained by a set using their natural ordering whether or not an explicit comparator is provided. This must be consistent with equals if it is to correctly... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Nov, 2021"
},
{
"code": null,
"e": 365,
"s": 28,
"text": "TreeSet is one of the most important implementations of the SortedSet interface in Java that uses a Tree for storage. The ordering of the elements is maintained by a set using... |
Python β PyTorch abs() method | 26 May, 2020
PyTorch torch.abs() method computes the element-wise absolute value of the given input tensor.
Syntax: torch.abs(inp, out=None) ? Tensor
Arguments
inp: This is input tensor.
out: This is optional parameter and is the output tensor.
Return: It returns a Tensor having absolute value of input inp.
# Importing... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 May, 2020"
},
{
"code": null,
"e": 123,
"s": 28,
"text": "PyTorch torch.abs() method computes the element-wise absolute value of the given input tensor."
},
{
"code": null,
"e": 165,
"s": 123,
"text": "Syntax: tor... |
Nested list in C++ STL | 18 Sep, 2018
list in STL is used to represent a linked list in C++. How to create a nested list. We are given n lists, we need to create a list of n lists.
Examples:
Input : Number of lists: 2
1st list: {1 2}
2nd list: {3 4 5 6
Output :
[
[ 1 2 ]
[ 3 4 5 6 ]
]
Input : Number of lists: 3
1st list : {0 1}
2n... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Sep, 2018"
},
{
"code": null,
"e": 171,
"s": 28,
"text": "list in STL is used to represent a linked list in C++. How to create a nested list. We are given n lists, we need to create a list of n lists."
},
{
"code": null,
... |
Generate all Combinations of xCm in R Programming β combn() Function | 08 Jun, 2020
combn() function in R Language is used to generate all combinations of the elements of x taken m at a time.
Syntax: combn(x, m)
Parameters:x: total number of elements takenr: number of elements taken at a time out of βxβ elements
Example 1:
# R program to illustrate# combn function # Calling the combn() f... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Jun, 2020"
},
{
"code": null,
"e": 136,
"s": 28,
"text": "combn() function in R Language is used to generate all combinations of the elements of x taken m at a time."
},
{
"code": null,
"e": 156,
"s": 136,
"text":... |
How to Create a Coin Flipping App using ReactJS? | 07 Jul, 2021
Basically, we want to build an app to toss or flip the coin. each time coin is flipped randomly a side of a coin is shown from head and tail and also we want to keep track of how many times coins are flipped and how many times heads and tails appear from those.
We create three components βAppβ and βFlipCoi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Jul, 2021"
},
{
"code": null,
"e": 290,
"s": 28,
"text": "Basically, we want to build an app to toss or flip the coin. each time coin is flipped randomly a side of a coin is shown from head and tail and also we want to keep track of ... |
Why Does C Treat Array Parameters as Pointers? | 25 Nov, 2021
In C, array parameters are treated as pointers mainly to,
To increase the efficiency of code
To save time
It is inefficient to copy the array data in terms of both memory and time; and most of the time, when we pass an array our intention is to just refer to the array we are interested in, not to create a ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n25 Nov, 2021"
},
{
"code": null,
"e": 110,
"s": 52,
"text": "In C, array parameters are treated as pointers mainly to,"
},
{
"code": null,
"e": 145,
"s": 110,
"text": "To increase the efficiency of code"
},
{
... |
Python Program for Finding the vertex, focus and directrix of a parabola | 03 Dec, 2018
A set of points on a plain surface that forms a curve such that any point on that curve is equidistant from the focus is a parabola.Vertex of a parabola is the coordinate from which it takes the sharpest turn whereas a is the straight line used to generate the curve.
The standard form of a parabola equatio... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Dec, 2018"
},
{
"code": null,
"e": 296,
"s": 28,
"text": "A set of points on a plain surface that forms a curve such that any point on that curve is equidistant from the focus is a parabola.Vertex of a parabola is the coordinate from... |
How to check for empty string in PHP ? | 07 Oct, 2021
In this article, we will see how to check for empty string in PHP. String is a set of characters. A string is said to be empty, if it contains no characters. We can use empty() function to check whether a string is empty or not.
The function is used to check whether the string is empty or not. It will retu... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Oct, 2021"
},
{
"code": null,
"e": 257,
"s": 28,
"text": "In this article, we will see how to check for empty string in PHP. String is a set of characters. A string is said to be empty, if it contains no characters. We can use empty(... |
POJI in Java | 05 May, 2021
POJI: stands for Plain Old Java Interface. A POJI is an ordinary interface without any specialties. The interfaces that do not extend from technology/framework specific interfaces. For example all user defined interfaces are POJI and an interface that inherits from AppletInitializer of Java Beans is not PO... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 May, 2021"
},
{
"code": null,
"e": 348,
"s": 28,
"text": "POJI: stands for Plain Old Java Interface. A POJI is an ordinary interface without any specialties. The interfaces that do not extend from technology/framework specific interf... |
Using Certbot Manually for SSL certificates | 24 Nov, 2020
Letβs Encrypt has become one of the most important organizations for creating a secure Internet. Letβs Encrypt is a free, automated, and open certificate authority (CA), run for the publicβs benefit, a service provided by the Internet Security Research Group (ISRG). They give people the digital certificate... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Nov, 2020"
},
{
"code": null,
"e": 564,
"s": 28,
"text": "Letβs Encrypt has become one of the most important organizations for creating a secure Internet. Letβs Encrypt is a free, automated, and open certificate authority (CA), run f... |
C# | String vs StringBuilder | 23 Jan, 2019
StringBuilder is used to represent a mutable string of characters. Mutable means the string which can be changed. So String objects are immutable but StringBuilder is the mutable string type. It will not create a new modified instance of the current string object but do the modifications in the existing st... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n23 Jan, 2019"
},
{
"code": null,
"e": 496,
"s": 54,
"text": "StringBuilder is used to represent a mutable string of characters. Mutable means the string which can be changed. So String objects are immutable but StringBuilder is the mut... |
Extract substrings between any pair of delimiters | 14 Dec, 2021
Given a string str, the task is to extract the substrings present between two delimiters, i.e. β[β and β]β.
Examples:
Input: str = β[This is a string to be extracted]βOutput: This is a string to be extractedExplanation: The square brackets β[β and β]β serve as delimiters in the given string.
Input: str= β[... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 Dec, 2021"
},
{
"code": null,
"e": 162,
"s": 54,
"text": "Given a string str, the task is to extract the substrings present between two delimiters, i.e. β[β and β]β."
},
{
"code": null,
"e": 172,
"s": 162,
"text"... |
Python | os.remove() method | 29 May, 2019
OS module in Python provides functions for interacting with the operating system. OS comes under Pythonβs standard utility modules. This module provides a portable way of using operating system dependent functionality.
All functions in os module raise OSError in the case of invalid or inaccessible file nam... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 May, 2019"
},
{
"code": null,
"e": 271,
"s": 52,
"text": "OS module in Python provides functions for interacting with the operating system. OS comes under Pythonβs standard utility modules. This module provides a portable way of usi... |
Search Text in MongoDB | 08 Mar, 2021
MongoDB provides a good technique that is text search. Using this technique we can find a piece of text or a specified word from the string fields. Or in other words, MongoDB allows you to perform a query operation to find the specified text from the string. In MongoDB, we can perform text search using tex... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Mar, 2021"
},
{
"code": null,
"e": 389,
"s": 54,
"text": "MongoDB provides a good technique that is text search. Using this technique we can find a piece of text or a specified word from the string fields. Or in other words, MongoDB... |
Handling NameError Exception in Python | 29 Jan, 2022
Prerequisites: Python Exception Handling
There are several standard exceptions in Python and NameError is one among them. NameError is raised when the identifier being accessed is not defined in the local or global scope. General causes for NameError being raised are :
1. Misspelled built-in functions:
In ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n29 Jan, 2022"
},
{
"code": null,
"e": 94,
"s": 53,
"text": "Prerequisites: Python Exception Handling"
},
{
"code": null,
"e": 323,
"s": 94,
"text": "There are several standard exceptions in Python and NameError is o... |
How to use Docker Default Bridge Networking? | 05 Nov, 2020
Docker allows you to create dedicated channels between multiple Docker Containers to create a network of Containers that can share files and other resources with each other. This is called Docker Networking. You can create Docker Networks with various kinds of Network Drivers which include Bridge drivers, ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Nov, 2020"
},
{
"code": null,
"e": 570,
"s": 28,
"text": "Docker allows you to create dedicated channels between multiple Docker Containers to create a network of Containers that can share files and other resources with each other. T... |
Selenium - Multi Select Action | Sometimes we would be in a situation to select two or more items in a list box or text area. To understand the same, we would demonstrate multiple selection from the list using 'https://demos.devexpress.com/aspxeditorsdemos/ListEditors/MultiSelect.aspx'.
Let us say, we want to select 3 items from this list as shown bel... | [
{
"code": null,
"e": 2264,
"s": 2009,
"text": "Sometimes we would be in a situation to select two or more items in a list box or text area. To understand the same, we would demonstrate multiple selection from the list using 'https://demos.devexpress.com/aspxeditorsdemos/ListEditors/MultiSelect.aspx'... |
How to call a function when content of a div changes using jQuery ? | 24 May, 2021
The task is to call a function when the content of a div is changed. You can achieve this task by using the in-built method known as .change(). In simple words whenever the field is been changed we call a function that will throw a pop-up.
.change(): This method will only trigger when some change occurs in... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 May, 2021"
},
{
"code": null,
"e": 268,
"s": 28,
"text": "The task is to call a function when the content of a div is changed. You can achieve this task by using the in-built method known as .change(). In simple words whenever the fi... |
Flutter β Draggable Scrollable Sheet | 16 Aug, 2021
In this tutorial, we are going to learn what the DraggableScrollableSheet widget is and how to implement it in Flutter.
What is Flutter
DraggableScrollableSheet
Project Setup
Project Code
Flutter is an open-source UI software development kit created by Google with which we can develop applications for Andr... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Aug, 2021"
},
{
"code": null,
"e": 148,
"s": 28,
"text": "In this tutorial, we are going to learn what the DraggableScrollableSheet widget is and how to implement it in Flutter."
},
{
"code": null,
"e": 164,
"s": 148,... |
Merge an array of size n into another array of size m+n | 09 Jun, 2022
There are two sorted arrays. First one is of size m+n containing only m elements. Another one is of size n and contains n elements. Merge these two arrays into the first array of size m+n such that the output is sorted. Input: array with m+n elements (mPlusN[]).
NA => Value is not filled/available in arr... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Jun, 2022"
},
{
"code": null,
"e": 317,
"s": 52,
"text": "There are two sorted arrays. First one is of size m+n containing only m elements. Another one is of size n and contains n elements. Merge these two arrays into the first arra... |
Bug Tracking System | 13 Dec, 2020
What is Bug tracking system? A bug tracking system is software that keeps track of bugs that the user encountered in any software development or in any project.
The three main functionalities of the Bug Tracking system is:
Creating a new text file and writing the details entered by the user into the text f... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n13 Dec, 2020"
},
{
"code": null,
"e": 213,
"s": 52,
"text": "What is Bug tracking system? A bug tracking system is software that keeps track of bugs that the user encountered in any software development or in any project."
},
{
... |
SymPy - Symbols | Symbol is the most important class in symPy library. As mentioned earlier, symbolic computations are done with symbols. SymPy variables are objects of Symbols class.
Symbol() function's argument is a string containing symbol which can be assigned to a variable.
>>> from sympy import Symbol
>>> x=Symbol('x')
>>> y=Sym... | [
{
"code": null,
"e": 2185,
"s": 2019,
"text": "Symbol is the most important class in symPy library. As mentioned earlier, symbolic computations are done with symbols. SymPy variables are objects of Symbols class."
},
{
"code": null,
"e": 2281,
"s": 2185,
"text": "Symbol() functio... |
isspace() function in C++ | The isspace() function is a predefined function in ctype.h. It specifies whether the argument is a whitespace character or not. Some of the whitespace characters are space, horizontal tab, vertical tab etc.
A program that implements isspace() function by counting the number of spaces in a string is given as follows β
... | [
{
"code": null,
"e": 1269,
"s": 1062,
"text": "The isspace() function is a predefined function in ctype.h. It specifies whether the argument is a whitespace character or not. Some of the whitespace characters are space, horizontal tab, vertical tab etc."
},
{
"code": null,
"e": 1381,
... |
Logical Operators on String in Java | Let us implement logical operators on String in Java β
Live Demo
import java.io.*;
public class Demo{
public static void main(String[] args){
int a = 45, b = 32, c = 87, d = 1;
System.out.println("The first variable is " + a);
System.out.println("The second variable is = " + b);
System.out.p... | [
{
"code": null,
"e": 1117,
"s": 1062,
"text": "Let us implement logical operators on String in Java β"
},
{
"code": null,
"e": 1128,
"s": 1117,
"text": " Live Demo"
},
{
"code": null,
"e": 1622,
"s": 1128,
"text": "import java.io.*;\npublic class Demo{\n pub... |
Multiple linear regression with interactions. | Towards Data Science | We all had some sort of experience with linear regression. Itβs one of the most used regression techniques used. Why? Because it is simple to explain and it is easy to implement. But what happens when you have more than one variable? How can you deal with this increased complexity and still use an easy to understand re... | [
{
"code": null,
"e": 633,
"s": 171,
"text": "We all had some sort of experience with linear regression. Itβs one of the most used regression techniques used. Why? Because it is simple to explain and it is easy to implement. But what happens when you have more than one variable? How can you deal with... |
How to iterate over a Java list? | Often, you will want to cycle through the elements in a collection. For example, you might want to display each element.
The easiest way to do this is to employ an iterator, which is an object that implements either the Iterator or the ListIterator interface.
Iterator enables you to cycle through a collection, obtainin... | [
{
"code": null,
"e": 1183,
"s": 1062,
"text": "Often, you will want to cycle through the elements in a collection. For example, you might want to display each element."
},
{
"code": null,
"e": 1322,
"s": 1183,
"text": "The easiest way to do this is to employ an iterator, which is... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.