title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Xamarin - Android Activity Lifecycle | When a user navigates through an Android App, a series of events occurs. For example, when a user launches an app, e.g., the Facebook App, it starts and becomes visible on the foreground to the user, onCreate() → onStart() → onResume().
If another activity starts, e.g., a phone call comes in, then the Facebook app will... | [
{
"code": null,
"e": 2335,
"s": 2098,
"text": "When a user navigates through an Android App, a series of events occurs. For example, when a user launches an app, e.g., the Facebook App, it starts and becomes visible on the foreground to the user, onCreate() → onStart() → onResume()."
},
{
"c... |
How to Apply a function to multiple columns in Pandas? | 24 Oct, 2021
Let us see how to apply a function to multiple columns in a Pandas DataFrame. To execute this task will be using the apply() function.
This function applies a function along an axis of the DataFrame.
Syntax : DataFrame.apply(parameters)Parameters :
func : Function to apply to each column or row.
axis ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Oct, 2021"
},
{
"code": null,
"e": 164,
"s": 28,
"text": "Let us see how to apply a function to multiple columns in a Pandas DataFrame. To execute this task will be using the apply() function. "
},
{
"code": null,
"e": 23... |
BigInteger bitLength() Method in Java | 28 Jan, 2022
The java.math.BigInteger.bitLength() method returns the number of bits in the minimal two’s-complement representation of this BigInteger, excluding a sign bit. For positive BigIntegers, this is equivalent to the number of bits in the ordinary binary representation. The bitLength method Computes (ceil(log2(... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jan, 2022"
},
{
"code": null,
"e": 374,
"s": 28,
"text": "The java.math.BigInteger.bitLength() method returns the number of bits in the minimal two’s-complement representation of this BigInteger, excluding a sign bit. For positive Bi... |
How to create a progress bar animation using HTML and CSS ? - GeeksforGeeks | 03 Sep, 2021
In this mini Web Development project we will utilize CSS animations and create a progress bar using them. The progress bar will start from zero and go to a certain extent as we want. The progress bar is basically showing the expertise of a programmer in different languages in animated form.
Prerequisite: ... | [
{
"code": null,
"e": 26621,
"s": 26593,
"text": "\n03 Sep, 2021"
},
{
"code": null,
"e": 26914,
"s": 26621,
"text": "In this mini Web Development project we will utilize CSS animations and create a progress bar using them. The progress bar will start from zero and go to a certain... |
Print N lines of 4 numbers such that every pair among 4 numbers has a GCD K - GeeksforGeeks | 11 Nov, 2021
Given N and K, the task is to print N lines where each line contains 4 numbers such that every among those 4 numbers has a GCD K and the maximum number used in N*4 should be minimized.Note: In case of multiple outputs, print any one. Examples:
Input: N = 1, K = 1 Output: 1 2 3 5 Every pair among 1, 2, 3 a... | [
{
"code": null,
"e": 26333,
"s": 26305,
"text": "\n11 Nov, 2021"
},
{
"code": null,
"e": 26578,
"s": 26333,
"text": "Given N and K, the task is to print N lines where each line contains 4 numbers such that every among those 4 numbers has a GCD K and the maximum number used in N*4... |
Join Pandas DataFrames matching by substring - GeeksforGeeks | 07 Apr, 2021
Prerequisites: Pandas
In this article, we will learn how to join two Data Frames matching by substring with python.
join(): joins all the elements in an iteration into a single string
lambda(): an anonymous method which is declared without a name and can accept any number of parameters
find(): gets the in... | [
{
"code": null,
"e": 25563,
"s": 25535,
"text": "\n07 Apr, 2021"
},
{
"code": null,
"e": 25585,
"s": 25563,
"text": "Prerequisites: Pandas"
},
{
"code": null,
"e": 25680,
"s": 25585,
"text": "In this article, we will learn how to join two Data Frames matching ... |
Python - Dictionary Values Division - GeeksforGeeks | 29 Dec, 2019
Sometimes, while working with dictionaries, we might have utility problem in which we need to perform elementary operation among the common keys of dictionaries. This can be extended to any operation to be performed. Let’s discuss division of like key values and ways to solve it in this article.
Method #1 ... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n29 Dec, 2019"
},
{
"code": null,
"e": 25834,
"s": 25537,
"text": "Sometimes, while working with dictionaries, we might have utility problem in which we need to perform elementary operation among the common keys of dictionaries. T... |
Update a MySQL column with JSON format? | To display records like JSON format, use MySQL concat(). Let us first create a table −
mysql> create table DemoTable1373
-> (
-> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> StudentDetails text
-> );
Query OK, 0 rows affected (0.86 sec)
Insert some records in the table using insert command. Here, w... | [
{
"code": null,
"e": 1149,
"s": 1062,
"text": "To display records like JSON format, use MySQL concat(). Let us first create a table −"
},
{
"code": null,
"e": 1320,
"s": 1149,
"text": "mysql> create table DemoTable1373\n -> (\n -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY... |
How to create a link to send email in HTML? | To create a link to send email, use <a> tag, with href attribute. The mailto link is added inside the <a> tag. Just keep in mind to add the email address where you want to receive the email in the mailto link.
You can try to run the following code to create a link to send email in HTML.
Live Demo
<!DOCTYPE html>
<html>... | [
{
"code": null,
"e": 1272,
"s": 1062,
"text": "To create a link to send email, use <a> tag, with href attribute. The mailto link is added inside the <a> tag. Just keep in mind to add the email address where you want to receive the email in the mailto link."
},
{
"code": null,
"e": 1350,
... |
Find the list elements starting with specific letter in Python | In this article we will find all those elements from a list which start with specific letter.
We use the lower function so that the test later can match with the first letter of the the elements in the list irrespective of the case. Then we use the index at 0 so that the first letter of the elements in a list are compa... | [
{
"code": null,
"e": 1156,
"s": 1062,
"text": "In this article we will find all those elements from a list which start with specific letter."
},
{
"code": null,
"e": 1408,
"s": 1156,
"text": "We use the lower function so that the test later can match with the first letter of the ... |
How to create a text file and insert data to that file on Android using Kotlin? | This example demonstrates how to create a text file and insert data to that file on Android using Kotlin.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" ... | [
{
"code": null,
"e": 1168,
"s": 1062,
"text": "This example demonstrates how to create a text file and insert data to that file on Android using Kotlin."
},
{
"code": null,
"e": 1297,
"s": 1168,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project an... |
Pascal - Records | Pascal arrays allow you to define type of variables that can hold several data items of the same kind but a record is another user-defined data type available in Pascal which allows you to combine data items of different kinds.
Records consist of different fields. Suppose you want to keep track of your books in a libra... | [
{
"code": null,
"e": 2311,
"s": 2083,
"text": "Pascal arrays allow you to define type of variables that can hold several data items of the same kind but a record is another user-defined data type available in Pascal which allows you to combine data items of different kinds."
},
{
"code": nul... |
C++ Program to Implement Booth’s Multiplication Algorithm for Multiplication of 2 signed Numbers | Booth’s algorithm is a multiplication algorithm that multiplies two signed binary numbers in 2’s compliment notation. Booth used desk calculators that were faster at shifting than adding and created the algorithm to increase their speed.
Begin
Put multiplicand in BR and multiplier in QR
and then the algorithm ... | [
{
"code": null,
"e": 1300,
"s": 1062,
"text": "Booth’s algorithm is a multiplication algorithm that multiplies two signed binary numbers in 2’s compliment notation. Booth used desk calculators that were faster at shifting than adding and created the algorithm to increase their speed."
},
{
"... |
Postman with Newman & Jenkins | We can integrate Postman with Newman and Jenkins. Newman is used to verify and execute a Collection. To integrate Newman and Jenkins, we have to follow the below steps −
Step1 − We have to complete the installation and configuration of Jenkins. The steps to perform this task is discussed in details in the below link −
... | [
{
"code": null,
"e": 1232,
"s": 1062,
"text": "We can integrate Postman with Newman and Jenkins. Newman is used to verify and execute a Collection. To integrate Newman and Jenkins, we have to follow the below steps −"
},
{
"code": null,
"e": 1382,
"s": 1232,
"text": "Step1 − We h... |
turtle.home() function in Python - GeeksforGeeks | 21 Jul, 2020
The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support.
This function is used to move the turtle to the origin i.e. coordinates (0,0). Whatever, t... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n21 Jul, 2020"
},
{
"code": null,
"e": 24118,
"s": 23901,
"text": "The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it... |
What is ResultSet Concurrency in JDBC? | The concurrency of the ResultSet object determines whether its contents can be updated or not.
The Connection interface provides 3 variants of the createStatement() method where one of the method's signature is as follows:
Statement createStatement(int resultSetType, int resultSetConcurrency)
This method accepts two in... | [
{
"code": null,
"e": 1157,
"s": 1062,
"text": "The concurrency of the ResultSet object determines whether its contents can be updated or not."
},
{
"code": null,
"e": 1285,
"s": 1157,
"text": "The Connection interface provides 3 variants of the createStatement() method where one ... |
Print all subsequences of a string in C++ | In this problem, we are given a string and we have to print all the subsequences of the string. The substring generated is created by deleting the elements of the string but the order remains the same(i.e. Order cannot be changed).
Let’s take an example to understand the topic better −
Input: xyz
Output: x,y,z,xy,yz,xz... | [
{
"code": null,
"e": 1294,
"s": 1062,
"text": "In this problem, we are given a string and we have to print all the subsequences of the string. The substring generated is created by deleting the elements of the string but the order remains the same(i.e. Order cannot be changed)."
},
{
"code":... |
SciPy - Optimize | The scipy.optimize package provides several commonly used optimization algorithms. This module contains the following aspects −
Unconstrained and constrained minimization of multivariate scalar functions (minimize()) using a variety of algorithms (e.g. BFGS, Nelder-Mead simplex, Newton Conjugate Gradient, COBYLA or SLS... | [
{
"code": null,
"e": 2015,
"s": 1887,
"text": "The scipy.optimize package provides several commonly used optimization algorithms. This module contains the following aspects −"
},
{
"code": null,
"e": 2211,
"s": 2015,
"text": "Unconstrained and constrained minimization of multivar... |
time.Parse() Function in Golang With Examples - GeeksforGeeks | 19 Apr, 2020
In Go language, time packages supplies functionality for determining as well as viewing time. The Parse() function in Go language is used to parse a formatted string and then finds the time value that it forms. Moreover, this function is defined under the time package. Here, you need to import “time” packa... | [
{
"code": null,
"e": 25795,
"s": 25767,
"text": "\n19 Apr, 2020"
},
{
"code": null,
"e": 26138,
"s": 25795,
"text": "In Go language, time packages supplies functionality for determining as well as viewing time. The Parse() function in Go language is used to parse a formatted stri... |
Python EasyGUI – Integer Box - GeeksforGeeks | 05 Sep, 2020
Integer Box : It is used to get the integer input from the user, input should be integer input not sting which happens in enter box. It displays the title, message to be displayed, place to enter a integer input and a pair of “Ok”, “Cancel” button which is used confirm the input. We can set some default in... | [
{
"code": null,
"e": 26033,
"s": 26005,
"text": "\n05 Sep, 2020"
},
{
"code": null,
"e": 26495,
"s": 26033,
"text": "Integer Box : It is used to get the integer input from the user, input should be integer input not sting which happens in enter box. It displays the title, message... |
How to Create/Add a New Virtual Disk for an Existing Linux Virtual Machine | This article helps you to create and add a new virtual disk to an existing Linux virtual machine on VMware. Here are some steps for adding a new SCSI based virtual disk on a CentOS Linux virtual machine. We are assuming that you are already familiar with Linux system administration skills and having knowledge of vCente... | [
{
"code": null,
"e": 1506,
"s": 1062,
"text": "This article helps you to create and add a new virtual disk to an existing Linux virtual machine on VMware. Here are some steps for adding a new SCSI based virtual disk on a CentOS Linux virtual machine. We are assuming that you are already familiar wit... |
AngularJS | json Filter - GeeksforGeeks | 30 Apr, 2019
The json filter in AngularJs is used to convert a JavaScript object into a JSON. string.JavaScript object that we are using can be of any kind of JavaScript Object.
Syntax:
{{ object | json : spacing }}
Where json is used to specifies that object should be displayed in JSON format and spacing is an op... | [
{
"code": null,
"e": 28271,
"s": 28243,
"text": "\n30 Apr, 2019"
},
{
"code": null,
"e": 28436,
"s": 28271,
"text": "The json filter in AngularJs is used to convert a JavaScript object into a JSON. string.JavaScript object that we are using can be of any kind of JavaScript Object... |
8085 program to find the factorial of a number - GeeksforGeeks | 07 Sep, 2018
Problem – Write an assembly language program for calculating the factorial of a number using 8085 microprocessor.
Example –
Input : 04H
Output : 18H
as 04*03*02*01 = 24 in decimal => 18H
In 8085 microprocessor, no direct instruction exists to multiply two numbers, so multiplication is done by repeated ad... | [
{
"code": null,
"e": 25154,
"s": 25126,
"text": "\n07 Sep, 2018"
},
{
"code": null,
"e": 25268,
"s": 25154,
"text": "Problem – Write an assembly language program for calculating the factorial of a number using 8085 microprocessor."
},
{
"code": null,
"e": 25278,
"... |
How to grep multiline search patterns in Linux? | In order to be able to grep multiple lines of pattern present in a file, we will make use of the number of grep command that Linux provides us with. But first, we must 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... | [
{
"code": null,
"e": 1292,
"s": 1062,
"text": "In order to be able to grep multiple lines of pattern present in a file, we will make use of the number of grep command that Linux provides us with. But first, we must understand what a grep command is and how to use it on Linux."
},
{
"code": n... |
How can I rotate xtick labels through 90 degrees in Matplotlib? | To rotate xtick labels through 90 degrees, we can take the following steps −
Make a list (x) of numbers.
Make a list (x) of numbers.
Add a subplot to the current figure.
Add a subplot to the current figure.
Set ticks on X-axis.
Set ticks on X-axis.
Set xtick labels and use rotate=90 as the arguments in the method.
Set ... | [
{
"code": null,
"e": 1139,
"s": 1062,
"text": "To rotate xtick labels through 90 degrees, we can take the following steps −"
},
{
"code": null,
"e": 1167,
"s": 1139,
"text": "Make a list (x) of numbers."
},
{
"code": null,
"e": 1195,
"s": 1167,
"text": "Make a... |
Perl CGI Environment Variables | All the Perl CGI program will have access to the following environment variables. These variables play an important role while writing any CGI program in Perl.
Here is a small Perl CGI program to list down all the CGI variables supported by your Web server. Click this link to see the result Get Environment
#!/usr/bin/p... | [
{
"code": null,
"e": 1222,
"s": 1062,
"text": "All the Perl CGI program will have access to the following environment variables. These variables play an important role while writing any CGI program in Perl."
},
{
"code": null,
"e": 1370,
"s": 1222,
"text": "Here is a small Perl C... |
JavaScript filter array by multiple strings? | To filter array by multiple strings, use for loop along with indexOf(). Following is the code −
var details = [
'My first Name is John and last Name is Smith',
'My first Name is John and last Name is Doe',
'Student first Name is John and last Name is Taylor'
];
var isPresent;
var records = [];
var matchWords =... | [
{
"code": null,
"e": 1158,
"s": 1062,
"text": "To filter array by multiple strings, use for loop along with indexOf(). Following is the code −"
},
{
"code": null,
"e": 1737,
"s": 1158,
"text": "var details = [\n 'My first Name is John and last Name is Smith',\n 'My first Name... |
MultiLingual Amazon Reviews Classification | by Priya Dwivedi | Towards Data Science | NLP is going to be the most transformational tech of this decade. And Transformer models are fuelling the advancement in NLP. In this blog, we look at an application of Transformers on multilingual data. Many businesses are now global in their reach and are collecting data in many languages. NLP is also building strong... | [
{
"code": null,
"e": 656,
"s": 172,
"text": "NLP is going to be the most transformational tech of this decade. And Transformer models are fuelling the advancement in NLP. In this blog, we look at an application of Transformers on multilingual data. Many businesses are now global in their reach and a... |
How to Clone tables in Delta Lake using Spark? | Towards Data Science | In Databricks delta lake, Clones are simply copies of your delta tables at a given snapshot in time, they have the same schema, structure, and partitioning as your source table. Once you create a clone the changes made to it do not affect the source table and vice-versa. This is a feature available in Databricks 7.2.
D... | [
{
"code": null,
"e": 491,
"s": 172,
"text": "In Databricks delta lake, Clones are simply copies of your delta tables at a given snapshot in time, they have the same schema, structure, and partitioning as your source table. Once you create a clone the changes made to it do not affect the source table... |
Find length of loop in linked list in C++ | In this problem, we are given a linked list that might contain loops. Our task is to find the length of the loop in the linked list.
Problem Description: we need to count the number of nodes in the loop if it contains a loop otherwise return -1.
Let’s take an example to understand the problem,
Input: linked-list :
Ou... | [
{
"code": null,
"e": 1196,
"s": 1062,
"text": "In this problem, we are given a linked list that might contain loops. Our task is to find the length of the loop in the linked list. "
},
{
"code": null,
"e": 1309,
"s": 1196,
"text": "Problem Description: we need to count the number... |
Bash Scripting - How to check If File Exists - GeeksforGeeks | 28 Nov, 2021
In this article, we will write a bash script to check if files exist or not.
test [expression]
[ expression ]
[[ expression ]]
Here, in expression, we write parameter and file name. Let us see some parameters that can be used in the expression: –
–f: It returns True if the file exists as a common ( regul... | [
{
"code": null,
"e": 24015,
"s": 23987,
"text": "\n28 Nov, 2021"
},
{
"code": null,
"e": 24093,
"s": 24015,
"text": "In this article, we will write a bash script to check if files exist or not. "
},
{
"code": null,
"e": 24111,
"s": 24093,
"text": "test [expres... |
LifecycleObserever with Activities in Android - GeeksforGeeks | 05 May, 2021
LifecycleObserever is Observer is one of the Jetpack Architecture components and is an interface that observes and performs the specified task depending upon the Lifecycle owner’s Lifecycle changes. For example, MainActivity has its own lifecycle and itself is Lifecycle owner and we can implement the Lifec... | [
{
"code": null,
"e": 24725,
"s": 24697,
"text": "\n05 May, 2021"
},
{
"code": null,
"e": 25386,
"s": 24725,
"text": "LifecycleObserever is Observer is one of the Jetpack Architecture components and is an interface that observes and performs the specified task depending upon the L... |
Java Program to display time in 24-hour format | Use the SimpleDateFormat class to display time in 24-hour format.
Set the format
Date dt = new Date();
SimpleDateFormat dateFormat;
dateFormat = new SimpleDateFormat("kk:mm:ss");
Now, the following will display time in 24-hour format
dateFormat.format(dt)
The following is an example
Live Demo
import java.text.SimpleDa... | [
{
"code": null,
"e": 1128,
"s": 1062,
"text": "Use the SimpleDateFormat class to display time in 24-hour format."
},
{
"code": null,
"e": 1143,
"s": 1128,
"text": "Set the format"
},
{
"code": null,
"e": 1241,
"s": 1143,
"text": "Date dt = new Date();\nSimpleD... |
Design an IIR Notch Filter to Denoise Signal using Python - GeeksforGeeks | 02 Feb, 2022
IIR stands for Infinite Impulse Response, It is one of the striking features of many linear-time invariant systems that are distinguished by having an impulse response h(t)/h(n) which does not become zero after some point but instead continues infinitely.
A Notch Filter is a bandstop filter with a very nar... | [
{
"code": null,
"e": 24212,
"s": 24184,
"text": "\n02 Feb, 2022"
},
{
"code": null,
"e": 24468,
"s": 24212,
"text": "IIR stands for Infinite Impulse Response, It is one of the striking features of many linear-time invariant systems that are distinguished by having an impulse resp... |
Tryit Editor v3.7 | Tryit: input type = radio | [] |
How will you select a particular value in a dropdown without using the methods of Select class in Selenium? | We can select a particular value in a dropdown using the method of Select class by using findElements() method.
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import java.util.concurrent.TimeUnit;
import java.ut... | [
{
"code": null,
"e": 1174,
"s": 1062,
"text": "We can select a particular value in a dropdown using the method of Select class by using findElements() method."
},
{
"code": null,
"e": 2328,
"s": 1174,
"text": "import org.openqa.selenium.By;\nimport org.openqa.selenium.WebDriver;\... |
Group Integers in Python | Suppose we have a list of numbers called nums, we have to check whether we can split the list into 1 or more groups such that: 1. Size of each group is greater than or equal to 2. 2. Sizes of all groups are same. 3. All the numbers present in each group are the same.
So, if the input is like [3, 4, 6, 9, 4, 3, 6, 9], t... | [
{
"code": null,
"e": 1330,
"s": 1062,
"text": "Suppose we have a list of numbers called nums, we have to check whether we can split the list into 1 or more groups such that: 1. Size of each group is greater than or equal to 2. 2. Sizes of all groups are same. 3. All the numbers present in each group... |
Design of 512x8 RAM using 128x8 RAM - GeeksforGeeks | 23 Feb, 2021
If we see RAM physically then we notice that RAM is made up of a few chips. We can design the required RAM size using basic RAM chips.
We can observe a basic RAM chip as follows: –
CS1: –For chip select 1, the value should be 1CS2: –For chip select 2, the value should be 0.Read and Write: –Used for upcomi... | [
{
"code": null,
"e": 24382,
"s": 24354,
"text": "\n23 Feb, 2021"
},
{
"code": null,
"e": 24518,
"s": 24382,
"text": "If we see RAM physically then we notice that RAM is made up of a few chips. We can design the required RAM size using basic RAM chips. "
},
{
"code": null,... |
How To Make PCA Plot with R | 23 Sep, 2021
Principal component analysis(PCA) in R programming is the analysis of the linear components of all existing attributes. Principal components are linear combinations (orthogonal transformation) of the original predictor in the dataset. It is a useful technique for EDA(Exploratory data analysis) and allowing... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Sep, 2021"
},
{
"code": null,
"e": 417,
"s": 28,
"text": "Principal component analysis(PCA) in R programming is the analysis of the linear components of all existing attributes. Principal components are linear combinations (orthogona... |
MD5 hash in Java | 05 Aug, 2020
To calculate cryptographic hashing value in Java, MessageDigest Class is used, under the package java.security.
MessageDigest Class provides following cryptographic hash function to find hash value of a text, they are:1. MD52. SHA-13. SHA-256
This Algorithms are initialize in static method called getInstan... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n05 Aug, 2020"
},
{
"code": null,
"e": 164,
"s": 52,
"text": "To calculate cryptographic hashing value in Java, MessageDigest Class is used, under the package java.security."
},
{
"code": null,
"e": 295,
"s": 164,
"t... |
k largest(or smallest) elements in an array | 05 Jul, 2022
Write an efficient program for printing k largest elements in an array. Elements in an array can be in any order.For example: if the given array is [1, 23, 12, 9, 30, 2, 50] and you are asked for the largest 3 elements i.e., k = 3 then your program should print 50, 30, and 23.
Method 1 (Use Bubble k times)... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 Jul, 2022"
},
{
"code": null,
"e": 332,
"s": 54,
"text": "Write an efficient program for printing k largest elements in an array. Elements in an array can be in any order.For example: if the given array is [1, 23, 12, 9, 30, 2, 50] ... |
How to change size of labels in the Bokeh legend? | 12 Jul, 2021
In this article, we will be learning about how to change the size of labels in bokeh legend. Legend plays a very important role in bokeh. With the help of legend, we can point to various types of glyphs in a plot that bokeh provides us, and can customize them according to our choice. Along with that, we ca... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Jul, 2021"
},
{
"code": null,
"e": 498,
"s": 28,
"text": "In this article, we will be learning about how to change the size of labels in bokeh legend. Legend plays a very important role in bokeh. With the help of legend, we can point... |
Reference to Array in C++ | 29 Jun, 2021
Reference to an array means aliasing an array while retaining its identity. Reference to an array will not be an int* but an int[]. Let us discuss this in detail by discussing the difference between these two. This is quite weird that int[] is the same as int* but still compiler perspective on both is enti... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Jun, 2021"
},
{
"code": null,
"e": 419,
"s": 54,
"text": "Reference to an array means aliasing an array while retaining its identity. Reference to an array will not be an int* but an int[]. Let us discuss this in detail by discussin... |
Python program to print even length words in a string | 29 May, 2022
Given a string. The task is to print all words with even length in the given string.
Examples:
Input: s = "This is a python language"
Output: This
is
python
language
Input: s = "i am laxmi"
Output: am
Method: Finding even length words using for loop and if sta... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 May, 2022"
},
{
"code": null,
"e": 137,
"s": 52,
"text": "Given a string. The task is to print all words with even length in the given string."
},
{
"code": null,
"e": 148,
"s": 137,
"text": "Examples: "
},
{... |
Differences and Applications of List, Tuple, Set and Dictionary in Python | 30 Jan, 2022
Lists: are just like dynamic sized arrays, declared in other languages (vector in C++ and ArrayList in Java). Lists need not be homogeneous always which makes it the most powerful tool in Python.
Tuple: A Tuple is a collection of Python objects separated by commas. In some ways, a tuple is similar to a lis... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Jan, 2022"
},
{
"code": null,
"e": 248,
"s": 52,
"text": "Lists: are just like dynamic sized arrays, declared in other languages (vector in C++ and ArrayList in Java). Lists need not be homogeneous always which makes it the most pow... |
React JS useMemo Hook | 27 Oct, 2020
The useMemo is a hook used in the functional component of react that returns a memoized value. In Computer Science, memoization is a concept used in general when we don’t need to recompute the function with a given argument for the next time as it returns the cached result. A memoized function remembers th... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n27 Oct, 2020"
},
{
"code": null,
"e": 951,
"s": 54,
"text": "The useMemo is a hook used in the functional component of react that returns a memoized value. In Computer Science, memoization is a concept used in general when we don’t nee... |
Check if two given circles touch or intersect each other | 22 Jun, 2022
There are two circle A and B with their centres C1(x1, y1) and C2(x2, y2) and radius R1 and R2. Task is to check both circles A and B touch each other or not.
Examples :
Input : C1 = (3, 4)
C2 = (14, 18)
R1 = 5, R2 = 8
Output : Circles do not touch each other.
Input : C1 = (2, 3)
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 211,
"s": 52,
"text": "There are two circle A and B with their centres C1(x1, y1) and C2(x2, y2) and radius R1 and R2. Task is to check both circles A and B touch each other or not."
},
{
"... |
Count subsequences in first string which are anagrams of the second string | 06 Jul, 2022
Given two strings str1 and str2 of length n1 and n2 respectively. The problem is to count all the subsequences of str1 which are anagrams of str2. Examples:
Input : str1 = "abacd", str2 = "abc"
Output : 2
Index of characters in the 2 subsequences are:
{0, 1, 3} = {a, b, c} = abc and
{1, 2, 3} = {b, a, c}... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Jul, 2022"
},
{
"code": null,
"e": 213,
"s": 54,
"text": "Given two strings str1 and str2 of length n1 and n2 respectively. The problem is to count all the subsequences of str1 which are anagrams of str2. Examples: "
},
{
"... |
What is the purpose of a function prototype in C/C++? | Here we will see what are the purpose of using function prototypes in C or C++. The function prototypes are used to tell the compiler about the number of arguments and about the required datatypes of a function parameter, it also tells about the return type of the function. By this information, the compiler cross-check... | [
{
"code": null,
"e": 1695,
"s": 1187,
"text": "Here we will see what are the purpose of using function prototypes in C or C++. The function prototypes are used to tell the compiler about the number of arguments and about the required datatypes of a function parameter, it also tells about the return ... |
Python | Find the Number Occurring Odd Number of Times using Lambda expression and reduce function | 20 Oct, 2018
Given an array of positive integers. All numbers occur even number of times except one number which occurs odd number of times. Find the number in O(n) time & constant space.
Examples:
Input : [1, 2, 3, 2, 3, 1, 3]
Output : 3
We have existing solution for this problem please refer Find the Number Occurr... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Oct, 2018"
},
{
"code": null,
"e": 203,
"s": 28,
"text": "Given an array of positive integers. All numbers occur even number of times except one number which occurs odd number of times. Find the number in O(n) time & constant space."... |
Multiset of Tuples in C++ with Examples | 24 Jan, 2022
What is a tuple?
A tuple in C++ is an object which binds a group of elements together. The elements can be similar as well as different data types. The elements of tuples are initialized as in the order in which they will be accessed.
Syntax:
tuple<data_type1, data_type2, dataType3, ....> myTuple
Here,dat... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Jan, 2022"
},
{
"code": null,
"e": 45,
"s": 28,
"text": "What is a tuple?"
},
{
"code": null,
"e": 263,
"s": 45,
"text": "A tuple in C++ is an object which binds a group of elements together. The elements can be s... |
JavaScript String trim() Method | 07 Oct, 2021
Below is the example of the String trim() Method.
Example:
JavaScript
<script>function func() { var str = "GeeksforGeeks "; var st = str.trim(); document.write(st);}func();</script>
Output:
GeeksForGeeks
str.trim() method is used to remove the white spaces from both the ends of the given str... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n07 Oct, 2021"
},
{
"code": null,
"e": 103,
"s": 52,
"text": "Below is the example of the String trim() Method. "
},
{
"code": null,
"e": 112,
"s": 103,
"text": "Example:"
},
{
"code": null,
"e": 123,
... |
Reverse string without using any temporary variable | 07 Jul, 2022
We are given a string. We are also given indexes of first and last characters in string. The task is to reverse the string without using any extra variable.
Examples:
Input : str = "abc"
Output : str = "cba"
Input : str = "GeeksforGeeks"
Output : str = "skeeGrofskeeG"
If we take a look at program to r... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 211,
"s": 54,
"text": "We are given a string. We are also given indexes of first and last characters in string. The task is to reverse the string without using any extra variable."
},
{
"co... |
Elasticsearch meets BERT: Building Search Engine with Elasticsearch and BERT | by Hironsan | Towards Data Science | In this post, we use a pre-trained BERT model and Elasticsearch to build a search engine. Elasticsearch has recently released text similarity search with vector fields. On the other hand, you can convert text into a fixed-length vector using BERT. So once we convert documents into vectors by BERT and store them into El... | [
{
"code": null,
"e": 566,
"s": 172,
"text": "In this post, we use a pre-trained BERT model and Elasticsearch to build a search engine. Elasticsearch has recently released text similarity search with vector fields. On the other hand, you can convert text into a fixed-length vector using BERT. So once... |
Java program to find the sum of elements of an array | To find the sum of elements of an array.
create an empty variable. (sum)
Initialize it with 0 in a loop.
Traverse through each element (or get each element from the user) add each element to sum.
Print sum.
import java.util.Arrays;
import java.util.Scanner;
public class SumOfElementsOfAnArray {
public static void ma... | [
{
"code": null,
"e": 1103,
"s": 1062,
"text": "To find the sum of elements of an array."
},
{
"code": null,
"e": 1135,
"s": 1103,
"text": "create an empty variable. (sum)"
},
{
"code": null,
"e": 1167,
"s": 1135,
"text": "Initialize it with 0 in a loop."
},
... |
Area of the largest square that can be formed from the given length sticks using Hashing - GeeksforGeeks | 06 Apr, 2021
Given an array arr[] of N integers representing the heights of the sticks. The task is to find the area of the largest square that can be formed using these sticks and the count of such squares. Note that a single side of the square can only use a single stick.Examples:
Input: arr[] = {5, 3, 2, 3, 6, 3, 3... | [
{
"code": null,
"e": 24411,
"s": 24383,
"text": "\n06 Apr, 2021"
},
{
"code": null,
"e": 24683,
"s": 24411,
"text": "Given an array arr[] of N integers representing the heights of the sticks. The task is to find the area of the largest square that can be formed using these sticks... |
Set two Matplotlib imshow plots to have the same colormap scale | To set two matplotlib imshow() plots to have the same colormap scale, we can take the following
Set the figure size and adjust the padding between and around the subplots.
Create d1 and d2 matrices using Numpy.
Get the resultant matrix to get the maximum and minmum value.
Use amin and amax methods for minimum and maxim... | [
{
"code": null,
"e": 1158,
"s": 1062,
"text": "To set two matplotlib imshow() plots to have the same colormap scale, we can take the following"
},
{
"code": null,
"e": 1234,
"s": 1158,
"text": "Set the figure size and adjust the padding between and around the subplots."
},
{
... |
MySQL Tryit Editor v1.0 | SELECT MIN(Price) AS SmallestPrice
FROM Products;
Edit the SQL Statement, and click "Run SQL" to see the result.
This SQL-Statement is not supported in the WebSQL Database.
The example still works, because it uses a modified version of SQL.
Your browser does not support WebSQL.
Your are now using a light-ve... | [
{
"code": null,
"e": 35,
"s": 0,
"text": "SELECT MIN(Price) AS SmallestPrice"
},
{
"code": null,
"e": 51,
"s": 35,
"text": "FROM Products; "
},
{
"code": null,
"e": 53,
"s": 51,
"text": ""
},
{
"code": null,
"e": 125,
"s": 62,
"text": "Edi... |
Programming a slideshow with HTML and CSS | 16 Dec, 2021
In this article, we will know how to build the slideshow using HTML & CSS. A slideshow can be used to display text or images that continuously scroll from one slide to the other to display its content. This article shows an approach to building a slideshow with the use of only HTML and CSS. It consumes les... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n16 Dec, 2021"
},
{
"code": null,
"e": 568,
"s": 52,
"text": "In this article, we will know how to build the slideshow using HTML & CSS. A slideshow can be used to display text or images that continuously scroll from one slide to the ot... |
Reverse a doubly linked list in groups of given size | 03 Jul, 2022
Given a doubly linked list containing n nodes. The problem is to reverse every group of k nodes in the list.
Examples:
Prerequisite: Reverse a doubly linked list | Set-2.
Approach: Create a recursive function say reverse(head, k). This function receives the head or the first node of each group of k nodes... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n03 Jul, 2022"
},
{
"code": null,
"e": 163,
"s": 54,
"text": "Given a doubly linked list containing n nodes. The problem is to reverse every group of k nodes in the list."
},
{
"code": null,
"e": 175,
"s": 163,
"text... |
Java Program to Implement HashTables with Linear Probing | 17 Jun, 2021
Hashing is a technique that is used to uniquely identify a specific object from a group of similar objects. Suppose an object is to be assigned a key to it to make searching easy. To store the key/value pair, one can use a simple array like a data structure where keys (integers) can be used directly as an ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n17 Jun, 2021"
},
{
"code": null,
"e": 917,
"s": 52,
"text": "Hashing is a technique that is used to uniquely identify a specific object from a group of similar objects. Suppose an object is to be assigned a key to it to make searching ... |
Matplotlib.pyplot.subplots() in Python | 11 Apr, 2020
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface.
Sample Code
# sample codeimport matplotlib.pyplot as plt plt.plot([1, 2, 3, 4], [16, 4, 1, 8]) plt.show()
O... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n11 Apr, 2020"
},
{
"code": null,
"e": 247,
"s": 52,
"text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MA... |
Find all pairs in an Array in sorted order with minimum absolute difference | 04 Jan, 2022
Given an integer array arr[] of size N, the task is to find all distinct pairs having minimum absolute difference and print them in ascending order.
Examples:
Input: arr[] = {4, 2, 1, 3}Output: {1, 2}, {2, 3}, {3, 4}Explanation: The minimum absolute difference between pairs is 1.
Input: arr[] = {1, 3, 8, ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Jan, 2022"
},
{
"code": null,
"e": 178,
"s": 28,
"text": "Given an integer array arr[] of size N, the task is to find all distinct pairs having minimum absolute difference and print them in ascending order. "
},
{
"code": nul... |
Difference between Docker Image and Container | 12 Jul, 2022
1. Docker Image: The concept of Images and Container is like class and object in which object is an instance of class and class is the blueprint of the object. Images are different in Virtual Machines and Docker, in virtual machines images, are just snapshots of running virtual machines at different points... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Jul, 2022"
},
{
"code": null,
"e": 1066,
"s": 28,
"text": "1. Docker Image: The concept of Images and Container is like class and object in which object is an instance of class and class is the blueprint of the object. Images are dif... |
Python | Tkinter ttk.Checkbutton and comparison with simple Checkbutton | 27 Mar, 2019
Tkinter is a GUI (Graphical User Interface) module which comes along with the Python itself. This module is widely used to create GUI applications. tkinter.ttk is used to create the GUI applications with the effects of modern graphics which cannot be achieved using only tkinter. Checkbutton is used to sele... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Mar, 2019"
},
{
"code": null,
"e": 356,
"s": 28,
"text": "Tkinter is a GUI (Graphical User Interface) module which comes along with the Python itself. This module is widely used to create GUI applications. tkinter.ttk is used to crea... |
SQL Query to Update All Rows in a Table | 10 Oct, 2021
The Update statement is a SQL keyword to update data in the database. We can update all the rows in the database or some values with the help of conditions. The update is a SQL keyword and it falls under Data Manipulation Language(DML), as the name suggests it is used to manipulate the data. There are ma... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n10 Oct, 2021"
},
{
"code": null,
"e": 397,
"s": 52,
"text": "The Update statement is a SQL keyword to update data in the database. We can update all the rows in the database or some values with the help of conditions. The update is a ... |
Shortest cycle in an undirected unweighted graph | 18 Mar, 2022
Given an undirected unweighted graph. The task is to find the length of the shortest cycle in the given graph. If no cycle exists print -1.
Examples:
Input:
Output: 4 Cycle 6 -> 1 -> 5 -> 0 -> 6
Input:
Output: 3 Cycle 6 -> 1 -> 2 -> 6
Prerequisites: Dijkstra
Approach: For every vertex, we check if it... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 Mar, 2022"
},
{
"code": null,
"e": 192,
"s": 52,
"text": "Given an undirected unweighted graph. The task is to find the length of the shortest cycle in the given graph. If no cycle exists print -1."
},
{
"code": null,
"e... |
Length of smallest substring of a given string which contains another string as subsequence | Set 2 | 04 Feb, 2022
Given two strings A and B, the task is to find the smallest substring of A having B as a subsequence.
Examples:
Input: A = “abcdefababaef”, B = “abf”Output: 5Explanation:Smallest substring of A having B as subsequence is abcdef.Therefore, the required length is 5.
Input: A = “abcdefababaef”, B = “aef”Outpu... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n04 Feb, 2022"
},
{
"code": null,
"e": 156,
"s": 54,
"text": "Given two strings A and B, the task is to find the smallest substring of A having B as a subsequence."
},
{
"code": null,
"e": 166,
"s": 156,
"text": "Exa... |
Static Keyword in C++ | When static keyword is used, variable or data members or functions can not be modified again. It is allocated for the lifetime of program. Static functions can be called directly by using class name.
Static variables are initialized only once. Compiler persist the variable till the end of the program. Static variable c... | [
{
"code": null,
"e": 1387,
"s": 1187,
"text": "When static keyword is used, variable or data members or functions can not be modified again. It is allocated for the lifetime of program. Static functions can be called directly by using class name."
},
{
"code": null,
"e": 1694,
"s": 1... |
Find a pair with maximum product in array of Integers | 28 Jun, 2022
Given an array with both +ive and -ive integers, return a pair with highest product.
Examples :
Input: arr[] = {1, 4, 3, 6, 7, 0}
Output: {6,7}
Input: arr[] = {-1, -3, -4, 2, 0, -5}
Output: {-4,-5}
A Simple Solution is to consider every pair and keep track of the maximum product. Below is the imple... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2022"
},
{
"code": null,
"e": 137,
"s": 52,
"text": "Given an array with both +ive and -ive integers, return a pair with highest product."
},
{
"code": null,
"e": 150,
"s": 137,
"text": "Examples : "
},
... |
Minimum number of characters required to be added to a String such that all lowercase alphabets occurs as a subsequence in increasing order | 09 Sep, 2021
Given a string S consisting of N characters, the task is to find the minimum number of characters that must be added to S such that all lowercase alphabets occur as a subsequence in increasing order in S.
Examples:
Input: S = “axyabzaxd”Output: 22Explanation:The characters from b to w (bcdefghijklmnopqrstu... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Sep, 2021"
},
{
"code": null,
"e": 257,
"s": 52,
"text": "Given a string S consisting of N characters, the task is to find the minimum number of characters that must be added to S such that all lowercase alphabets occur as a subsequ... |
How to Get TreeMap Key or Value using Index in Java? | 23 Jul, 2021
The TreeMap in Java is used to implement the Map interface and NavigableMap along with the AbstractMap Class. The TreeMap is sorted according to the natural ordering of its keys. The TreeMap class is a Red-Black tree implementation of the Map interface and thus does not expose any methods using which we ca... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Jul, 2021"
},
{
"code": null,
"e": 392,
"s": 28,
"text": "The TreeMap in Java is used to implement the Map interface and NavigableMap along with the AbstractMap Class. The TreeMap is sorted according to the natural ordering of its ke... |
Java program to calculate the percentage | Percent means percent (hundreds), i.e., a ratio of the parts out of 100. The symbol of a percent is %. We generally count the percentage of marks obtained, return on investment etc. The percentage can go beyond 100% also.
For Example, assuming that we have total and a part. So we say what part is what percent of total ... | [
{
"code": null,
"e": 1409,
"s": 1187,
"text": "Percent means percent (hundreds), i.e., a ratio of the parts out of 100. The symbol of a percent is %. We generally count the percentage of marks obtained, return on investment etc. The percentage can go beyond 100% also."
},
{
"code": null,
... |
Check if two strings can be made equal by swapping one character among each other | 23 May, 2022
Given two strings A and B of length N, the task is to check whether the two strings can be made equal by swapping any character of A with any other character of B only once.Examples:
Input: A = “SEEKSFORGEEKS”, B = “GEEKSFORGEEKG” Output: Yes “SEEKSFORGEEKS” and “GEEKSFORGEEKG” can be swapped to make bot... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 May, 2022"
},
{
"code": null,
"e": 237,
"s": 52,
"text": "Given two strings A and B of length N, the task is to check whether the two strings can be made equal by swapping any character of A with any other character of B only once.E... |
Sum of GCD of all possible sequences | 24 Mar, 2022
Given two numbers N and K. A sequence A1, A2, ....AN of length N can be created by placing numbers from 1 to K at each position, making a total of KN sequences. The task is to find the sum of GCD of all the sequences formed.Note: The answer can be very large, so take modulo of 109 + 7.
Examples:
Input: N... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Mar, 2022"
},
{
"code": null,
"e": 342,
"s": 54,
"text": "Given two numbers N and K. A sequence A1, A2, ....AN of length N can be created by placing numbers from 1 to K at each position, making a total of KN sequences. The task is t... |
How to Extract YouTube Comments Using Youtube API - Python - GeeksforGeeks | 26 Dec, 2020
Prerequisite: YouTube API
Google provides a large set of API’s for the developer to choose from. Each and every service provided by Google has an associated API. Being on of them, YouTube Data API is very simple to use provides features like –
Search for videos
Handle videos like retrieve information about... | [
{
"code": null,
"e": 25647,
"s": 25619,
"text": "\n26 Dec, 2020"
},
{
"code": null,
"e": 25673,
"s": 25647,
"text": "Prerequisite: YouTube API"
},
{
"code": null,
"e": 25891,
"s": 25673,
"text": "Google provides a large set of API’s for the developer to choose... |
Queries to update array elements in a range [L, R] to satisfy given conditions - GeeksforGeeks | 02 Dec, 2021
Given an array arr[] consisting of N 0s and an array Q[][] with each row of the form (L, R)., the task for each query is to update all the array elements in the range [L, R] such that arr[i] = i – L + 1.
Examples:
Input: arr[] = { 0, 0, 0, 0 }, Q[][] = { { 1, 2 }, { 0, 1 } } Output: 1 3 2 0 Explanation: Qu... | [
{
"code": null,
"e": 26587,
"s": 26559,
"text": "\n02 Dec, 2021"
},
{
"code": null,
"e": 26791,
"s": 26587,
"text": "Given an array arr[] consisting of N 0s and an array Q[][] with each row of the form (L, R)., the task for each query is to update all the array elements in the ra... |
BabelJS - CLI | Babel comes with a built-in command line interface, which can be used to compile the code.
Create a directory wherein you would be working. Here, we have created directory called babelproject. Let us make use of nodejs to create the project details.
We have used npm init to create the project as shown below −
Here is t... | [
{
"code": null,
"e": 2186,
"s": 2095,
"text": "Babel comes with a built-in command line interface, which can be used to compile the code."
},
{
"code": null,
"e": 2345,
"s": 2186,
"text": "Create a directory wherein you would be working. Here, we have created directory called bab... |
Python OR Operator - GeeksforGeeks | 19 Oct, 2021
Python OR Operator takes at least two boolean expressions and returns True if any one of the expressions is True. If all the expressions are False then it returns False.
Python OR operator returns True in any one of the boolean expressions passed is True.
Python3
bool1 = 2>3bool2 = 2<3 print('bool1:', boo... | [
{
"code": null,
"e": 25647,
"s": 25619,
"text": "\n19 Oct, 2021"
},
{
"code": null,
"e": 25817,
"s": 25647,
"text": "Python OR Operator takes at least two boolean expressions and returns True if any one of the expressions is True. If all the expressions are False then it returns ... |
How to combine LaTeX and R for report generation | Towards Data Science | If you have to create a report, LaTeX is definitely the choice to make, everything looks better in LaTeX!
Chances are that you used it to write your thesis or some assays, back in your academia years. Indeed, environments like texstudio or the more recent Overleaf are great for single projects. But now in your day job,... | [
{
"code": null,
"e": 278,
"s": 172,
"text": "If you have to create a report, LaTeX is definitely the choice to make, everything looks better in LaTeX!"
},
{
"code": null,
"e": 550,
"s": 278,
"text": "Chances are that you used it to write your thesis or some assays, back in your a... |
Program to calculate Root Mean Square | 01 Apr, 2021
Given an array of N numbers. The task is to calculate the Root Mean Square(RMS) of the given numbers. Examples:
Input: arr[] = {1, 2, 3, 4, 5}
Output: 3.31662
Input: arr[] = {10, 4, 6, 8}
Output: 7.34847
Approach: The Root Mean Square value of N numbers x1,x2,x3,.....xn can be given as,
RMS method f... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n01 Apr, 2021"
},
{
"code": null,
"e": 167,
"s": 53,
"text": "Given an array of N numbers. The task is to calculate the Root Mean Square(RMS) of the given numbers. Examples: "
},
{
"code": null,
"e": 260,
"s": 167,
... |
How to run JavaScript from PHP? | 31 Jul, 2021
JavaScript is the client side scripting language and PHP is the server side scripting language. JavaScript is used as client side to check and verify client details and PHP is server side used to interact with database. In PHP, HTML is used as a string in the code. In order to render it to the browser, we ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n31 Jul, 2021"
},
{
"code": null,
"e": 414,
"s": 54,
"text": "JavaScript is the client side scripting language and PHP is the server side scripting language. JavaScript is used as client side to check and verify client details and PHP i... |
m-WAY Search Trees | Set-1 ( Searching ) | 23 Jun, 2022
The m-way search trees are multi-way trees which are generalised versions of binary trees where each node contains multiple elements. In an m-Way tree of order m, each node contains a maximum of m – 1 elements and m children.The goal of m-Way search tree of height h calls for O(h) no. of accesses for an in... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Jun, 2022"
},
{
"code": null,
"e": 813,
"s": 52,
"text": "The m-way search trees are multi-way trees which are generalised versions of binary trees where each node contains multiple elements. In an m-Way tree of order m, each node c... |
Handling large numbers in C++? | In C++, we can use large numbers by using the boost library. This C++ boost library is widely used library. This is used for different sections. It has large domain of applications. For example, using boost, we can use large number like 264 in C++.
Here we will see some examples of boost library. We can use big integer... | [
{
"code": null,
"e": 1311,
"s": 1062,
"text": "In C++, we can use large numbers by using the boost library. This C++ boost library is widely used library. This is used for different sections. It has large domain of applications. For example, using boost, we can use large number like 264 in C++."
}... |
ggplot2 - Multi Panel Plots | Multi panel plots mean plot creation of multiple graphs together in a single plot. We will use par() function to put multiple graphs in a single plot by passing graphical parameters mfrow and mfcol.
Here we will use “AirQuality” dataset to implement multi panel plots. Let us understand the dataset first to have a look ... | [
{
"code": null,
"e": 2221,
"s": 2022,
"text": "Multi panel plots mean plot creation of multiple graphs together in a single plot. We will use par() function to put multiple graphs in a single plot by passing graphical parameters mfrow and mfcol."
},
{
"code": null,
"e": 2599,
"s": 22... |
Count number of triangles possible for the given sides range - GeeksforGeeks | 07 Apr, 2021
Given four integers A, B, C, and D, the task is to find the number of distinct sets (X, Y, and Z) where X, Y and Z denotes the length of sides forming a valid triangle. A ≤ X ≤ B, B ≤ Y ≤ C, and C ≤ Z ≤ D.Examples:
Input: A = 2, B = 3, C = 4, D = 5 Output: 7 Explanation: Possible Length of Side of Triang... | [
{
"code": null,
"e": 25061,
"s": 25033,
"text": "\n07 Apr, 2021"
},
{
"code": null,
"e": 25278,
"s": 25061,
"text": "Given four integers A, B, C, and D, the task is to find the number of distinct sets (X, Y, and Z) where X, Y and Z denotes the length of sides forming a valid tria... |
Tree Traversals (Inorder, Preorder and Postorder) - GeeksforGeeks | 30 Nov, 2021
Unlike linear data structures (Array, Linked List, Queues, Stacks, etc) which have only one logical way to traverse them, trees can be traversed in different ways. Following are the generally used ways for traversing trees.
Depth First Traversals: (a) Inorder (Left, Root, Right) : 4 2 5 1 3 (b) Preorder (... | [
{
"code": null,
"e": 29781,
"s": 29750,
"text": " \n30 Nov, 2021\n"
},
{
"code": null,
"e": 30005,
"s": 29781,
"text": "Unlike linear data structures (Array, Linked List, Queues, Stacks, etc) which have only one logical way to traverse them, trees can be traversed in different wa... |
Unsupervised Sentiment Analysis. How to extract sentiment from the data... | by Rafał Wójcik | Towards Data Science | Note: full code available in github repo:
github.com
One of the common applications of NLP methods is sentiment analysis, where you try to extract from the data information about the emotions of the writer. Mainly, at least at the beginning, you would try to distinguish between positive and negative sentiment, eventual... | [
{
"code": null,
"e": 214,
"s": 172,
"text": "Note: full code available in github repo:"
},
{
"code": null,
"e": 225,
"s": 214,
"text": "github.com"
},
{
"code": null,
"e": 584,
"s": 225,
"text": "One of the common applications of NLP methods is sentiment analy... |
Python 3 - Number randrange() Method | The randrange() method returns a randomly selected element from range(start, stop, step).
Following is the syntax for the randrange() method
randrange ([start,] stop [,step])
Note − This function is not accessible directly, so we need to import the random module and then we need to call this function using the random ... | [
{
"code": null,
"e": 2430,
"s": 2340,
"text": "The randrange() method returns a randomly selected element from range(start, stop, step)."
},
{
"code": null,
"e": 2481,
"s": 2430,
"text": "Following is the syntax for the randrange() method"
},
{
"code": null,
"e": 2516... |
Find pairs of Positive and Negative values present in given array | 27 Jun, 2022
Given an array of distinct integers, print all the pairs having positive value and negative value of a number that exists in the array. The pairs can be printed in any order.
Examples:
Input: arr[] = { 1, -3, 2, 3, 6, -1 }Output: -1 1 -3 3
Input: arr[] = { 4, 8, 9, -4, 1, -1, -8, -9 }Output: -4 4 -8 8... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 Jun, 2022"
},
{
"code": null,
"e": 228,
"s": 52,
"text": "Given an array of distinct integers, print all the pairs having positive value and negative value of a number that exists in the array. The pairs can be printed in any order... |
Replace values from dataframe column using R | 07 Apr, 2021
In this article, we will discuss how to replace values from a DataFrame column in R Programming Language.
Whenever we deal with some data, it is necessary that we draw accurate conclusions from it. Now imagine what if, there are some missing values(this happens when some observation is missing in a column ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Apr, 2021"
},
{
"code": null,
"e": 134,
"s": 28,
"text": "In this article, we will discuss how to replace values from a DataFrame column in R Programming Language."
},
{
"code": null,
"e": 634,
"s": 134,
"text": "... |
HTML5 - WebSockets | WebSockets is a next-generation bidirectional communication technology for web applications which operates over a single socket and is exposed via a JavaScript interface in HTML 5 compliant browsers.
Once you get a Web Socket connection with the web server, you can send data from browser to server by calling a send() m... | [
{
"code": null,
"e": 2942,
"s": 2742,
"text": "WebSockets is a next-generation bidirectional communication technology for web applications which operates over a single socket and is exposed via a JavaScript interface in HTML 5 compliant browsers."
},
{
"code": null,
"e": 3140,
"s": 2... |
How to Display HTML in Textview along with Images in Android? | 19 Oct, 2021
There are some situations when one needs to display rich formatted text in the app, like for a blog app or an app like Quora but Android’s inbuilt function doesn’t allow to display inline images by default, moreover they show the ugly blue line to the left of anything inside blockquote tag. Here is the sim... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Oct, 2021"
},
{
"code": null,
"e": 549,
"s": 52,
"text": "There are some situations when one needs to display rich formatted text in the app, like for a blog app or an app like Quora but Android’s inbuilt function doesn’t allow to d... |
Sum of all elements between k1’th and k2’th smallest elements | 06 Jul, 2022
Given an array of integers and two numbers k1 and k2. Find the sum of all elements between given two k1’th and k2’th smallest elements of the array. It may be assumed that (1 <= k1 < k2 <= n) and all elements of array are distinct.
Examples :
Input : arr[] = {20, 8, 22, 4, 12, 10, 14}, k1 = 3, k2 = 6
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Jul, 2022"
},
{
"code": null,
"e": 284,
"s": 52,
"text": "Given an array of integers and two numbers k1 and k2. Find the sum of all elements between given two k1’th and k2’th smallest elements of the array. It may be assumed that (1... |
Ruby | Array sample() function | 06 Dec, 2019
Array#sample() : sample() is a Array class method which returns a random element or n random elements from the array.
Syntax: Array.sample()
Parameter: Array
Return: a random element or n random elements from the array.
Example #1 :
# Ruby code for sample() method # declaring arraya = [18, 22, 33, nil, 5,... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Dec, 2019"
},
{
"code": null,
"e": 146,
"s": 28,
"text": "Array#sample() : sample() is a Array class method which returns a random element or n random elements from the array."
},
{
"code": null,
"e": 169,
"s": 146,
... |
How to Extract Data from PDF file in Android? | 15 Jan, 2021
PDF is a portable document format that is used to represent data such as images, tables, and many more. Nowadays the use of PDF is increased rapidly in different fields. Many apps have switched overusing PDF files to represent data. So some of the apps have a requirement to extract the data from the PDF fi... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n15 Jan, 2021"
},
{
"code": null,
"e": 516,
"s": 52,
"text": "PDF is a portable document format that is used to represent data such as images, tables, and many more. Nowadays the use of PDF is increased rapidly in different fields. Many... |
Python – Convert List of lists to list of Sets | 25 Feb, 2021
Given a list containing lists, the task is to write a Python Program to convert it to a list containing sets.
Examples:
Input : [[1, 2, 1], [1, 2, 3], [2, 2, 2, 2], [0]]
Output : [{1, 2}, {1, 2, 3}, {2}, {0}]
Input : [[4, 4], [5, 5, 5], [1, 2, 3]]
Output : [{4}, {5}, {1, 2, 3}]
Method 1: Using list compre... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Feb, 2021"
},
{
"code": null,
"e": 138,
"s": 28,
"text": "Given a list containing lists, the task is to write a Python Program to convert it to a list containing sets."
},
{
"code": null,
"e": 148,
"s": 138,
"text... |
Entity Framework - Seed Database | In Entity Framework, Seed was introduced in EF 4.1 and works with database initializers. The general idea of a Seed Method is to initialize data into a database that is being created by Code First or evolved by Migrations. This data is often test data, but may also be reference data such as lists of known Students, Cou... | [
{
"code": null,
"e": 3551,
"s": 3166,
"text": "In Entity Framework, Seed was introduced in EF 4.1 and works with database initializers. The general idea of a Seed Method is to initialize data into a database that is being created by Code First or evolved by Migrations. This data is often test data, ... |
LongSummaryStatistics getCount() method in Java with Examples | 27 Jun, 2019
The getCount() method of LongSummaryStatistics class in Java is used to get the count of records in this LongSummaryStatistics.
Syntax:
public long getCount()
Parameter: This method do not accept any value as parameter.
Return Value: This method returns the count of the records in this LongSummaryStatisti... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Jun, 2019"
},
{
"code": null,
"e": 156,
"s": 28,
"text": "The getCount() method of LongSummaryStatistics class in Java is used to get the count of records in this LongSummaryStatistics."
},
{
"code": null,
"e": 164,
"... |
How to read multiple Excel files in R | 18 Jul, 2021
In this article, we will discuss how to merge multiple Excel files in the R programming language.
dplyr: The dplyr package in R is a structure of data manipulation that provides a uniform set of verbs, helping to resolve the most frequent data manipulation hurdles.
plyr: The “plyr” package in R is used to ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Jul, 2021"
},
{
"code": null,
"e": 126,
"s": 28,
"text": "In this article, we will discuss how to merge multiple Excel files in the R programming language."
},
{
"code": null,
"e": 294,
"s": 126,
"text": "dplyr: T... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.