title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Bottom Navigation Bar in Android - GeeksforGeeks | 18 Aug, 2021
We all have come across apps that have a Bottom Navigation Bar. Some popular examples include Instagram, WhatsApp, etc. In this article, let’s learn how to implement such a functional Bottom Navigation Bar in the Android app. Below is the preview of a sample Bottom Navigation Bar:
Why do we need a Bottom N... | [
{
"code": null,
"e": 26399,
"s": 26371,
"text": "\n18 Aug, 2021"
},
{
"code": null,
"e": 26681,
"s": 26399,
"text": "We all have come across apps that have a Bottom Navigation Bar. Some popular examples include Instagram, WhatsApp, etc. In this article, let’s learn how to impleme... |
Comparing two ValueTuple<T1, T2> in C# - GeeksforGeeks | 29 Dec, 2019
ValueTuple is a structure introduced in C# 7.0 which represents the value type Tuple. It is already included in .NET Framework 4.7 or higher version. It allows you to store a data set that contains multiple values that may or may not be related to each other.You can also compare the instance of two value t... | [
{
"code": null,
"e": 25835,
"s": 25807,
"text": "\n29 Dec, 2019"
},
{
"code": null,
"e": 26438,
"s": 25835,
"text": "ValueTuple is a structure introduced in C# 7.0 which represents the value type Tuple. It is already included in .NET Framework 4.7 or higher version. It allows you... |
Generation Google Scholarship (APAC) Online Challenge Experience - GeeksforGeeks | 26 Apr, 2021
I had applied for an APAC scholarship in March 2021 through their Google Career Page and I got a mail that there will be an Online Challenge from 9th April to 10th April. In the challenge, there were two sections designed with multiple-choice questions (1) General Cognitive Ability and (2) Role Related Kno... | [
{
"code": null,
"e": 26617,
"s": 26589,
"text": "\n26 Apr, 2021"
},
{
"code": null,
"e": 26976,
"s": 26617,
"text": "I had applied for an APAC scholarship in March 2021 through their Google Career Page and I got a mail that there will be an Online Challenge from 9th April to 10th... |
Replacing All Occurrences of Specified Element of Java ArrayList - GeeksforGeeks | 15 Nov, 2021
ArrayList is present in java.util package and it is the implementation class of List interface. It does allow the duplicates elements and also it maintains the insertion order of the elements. It dynamically resized its capacity. Though, it may be slower than standard arrays but can be helpful in programs ... | [
{
"code": null,
"e": 26263,
"s": 26235,
"text": "\n15 Nov, 2021"
},
{
"code": null,
"e": 26621,
"s": 26263,
"text": "ArrayList is present in java.util package and it is the implementation class of List interface. It does allow the duplicates elements and also it maintains the ins... |
Java Program To Remove All The Duplicate Entries From The Collection - GeeksforGeeks | 03 Mar, 2021
As we know that the HashSet contains only unique elements, ie no duplicate entries are allowed, and since our aim is to remove the duplicate entries from the collection, so for removing all the duplicate entries from the collection, we will use HashSet.The HashSet class implements the Set interface, backed... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n03 Mar, 2021"
},
{
"code": null,
"e": 25873,
"s": 25225,
"text": "As we know that the HashSet contains only unique elements, ie no duplicate entries are allowed, and since our aim is to remove the duplicate entries from the colle... |
PyQt5 - How to make text center align for non-editable ComboBox - GeeksforGeeks | 22 Apr, 2020
In this article we will see how we can center align the text of combo box and combo box should remain non-editable. By default the combo box text is left align and combo box don’t have any alignment method of its own.
In order to center align the text we have to do the following –
1. Create a combo box2. M... | [
{
"code": null,
"e": 25583,
"s": 25555,
"text": "\n22 Apr, 2020"
},
{
"code": null,
"e": 25801,
"s": 25583,
"text": "In this article we will see how we can center align the text of combo box and combo box should remain non-editable. By default the combo box text is left align and... |
Buy Maximum Stocks if i stocks can be bought on i-th day - GeeksforGeeks | 27 Aug, 2021
In a stock market, there is a product with its infinite stocks. The stock prices are given for N days, where arr[i] denotes the price of the stock on the ith day. There is a rule that a customer can buy at most i stock on the ith day. If the customer has an amount of k amount of money initially, find out t... | [
{
"code": null,
"e": 26473,
"s": 26445,
"text": "\n27 Aug, 2021"
},
{
"code": null,
"e": 26829,
"s": 26473,
"text": "In a stock market, there is a product with its infinite stocks. The stock prices are given for N days, where arr[i] denotes the price of the stock on the ith day. ... |
Matplotlib.axes.Axes.set_clip_on() in Python - GeeksforGeeks | 30 Apr, 2020
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute.
The Axe... | [
{
"code": null,
"e": 26067,
"s": 26039,
"text": "\n30 Apr, 2020"
},
{
"code": null,
"e": 26367,
"s": 26067,
"text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, ... |
Nested Queries in PyMongo - GeeksforGeeks | 08 Jun, 2020
MongoDB is a NoSQL document-oriented database. It does not give much importance for relations or can also be said as it is schema-free.
PyMongo is a Python module that can be used to interact between the mongo database and Python applications. The data that is exchanged between the Python application and t... | [
{
"code": null,
"e": 26037,
"s": 26009,
"text": "\n08 Jun, 2020"
},
{
"code": null,
"e": 26173,
"s": 26037,
"text": "MongoDB is a NoSQL document-oriented database. It does not give much importance for relations or can also be said as it is schema-free."
},
{
"code": null,... |
How to print Dataframe in Python without Index? - GeeksforGeeks | 13 Sep, 2021
Prerequisites: Pandas
When printing a dataframe, by default, index appears with the output but this can be removed if required. To print the dataframe without indices index parameter in to_string() must be set to False.
Syntax:
df.to_string(index = False)
Approach:
Import module
Create a simple dataframe ... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n13 Sep, 2021"
},
{
"code": null,
"e": 25559,
"s": 25537,
"text": "Prerequisites: Pandas"
},
{
"code": null,
"e": 25757,
"s": 25559,
"text": "When printing a dataframe, by default, index appears with the output... |
Count the number of ways to divide an array into three contiguous parts having equal sum - GeeksforGeeks | 19 Jan, 2022
Given an array of n numbers. Our task is to find out the number of ways to divide the array into three contiguous parts such that the sum of three parts is equal. In other words, we need to find the number of index pairs i and j such that sum of elements from 0 to i-1 is equal to the sum of elements from i... | [
{
"code": null,
"e": 26293,
"s": 26265,
"text": "\n19 Jan, 2022"
},
{
"code": null,
"e": 26655,
"s": 26293,
"text": "Given an array of n numbers. Our task is to find out the number of ways to divide the array into three contiguous parts such that the sum of three parts is equal. ... |
GraphQL | Query - GeeksforGeeks | 23 Mar, 2020
We will use GraphQL API for demonstration. GraphQL is an open-source data query and manipulation language for APIs and a runtime for fulfilling queries with existing data. It’s neither an architectural pattern nor a web service. GraphQL was developed internally by Facebook in 2012 before being publicly rel... | [
{
"code": null,
"e": 26195,
"s": 26167,
"text": "\n23 Mar, 2020"
},
{
"code": null,
"e": 26517,
"s": 26195,
"text": "We will use GraphQL API for demonstration. GraphQL is an open-source data query and manipulation language for APIs and a runtime for fulfilling queries with existi... |
Tensorflow.js tf.train.Optimizer class .minimize() Method - GeeksforGeeks | 03 Sep, 2021Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment.The .minimize() method executes the given function f() and tries to minimize the scalar output of f() by computing the gradients of y with resp... | [
{
"code": null,
"e": 43994,
"s": 23503,
"text": "\n03 Sep, 2021Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment.The .minimize() method executes the given function f() and tries to mini... |
Level-up your Kaplan-Meier curves with Tableau | by Eryk Lewinson | Towards Data Science | In a previous article, I showed how we can create the Kaplan-Meier curves using Python. As much as I love Python and writing code, there might be some alternative approaches with their unique set of benefits. Enter Tableau!
Tableau is a business intelligence tool used for creating elegant and interactive visualizations... | [
{
"code": null,
"e": 271,
"s": 47,
"text": "In a previous article, I showed how we can create the Kaplan-Meier curves using Python. As much as I love Python and writing code, there might be some alternative approaches with their unique set of benefits. Enter Tableau!"
},
{
"code": null,
... |
Strict equality vs Loose equality in JavaScript. | The loose equality operator ‘==’ allows us to compare two or more operands by converting their value to a common type first and then checking for the equality between them.
strict equality operator ‘===’ allows us to compare two or more operands by checking the equality between the values as well as their types . It re... | [
{
"code": null,
"e": 1235,
"s": 1062,
"text": "The loose equality operator ‘==’ allows us to compare two or more operands by converting their value to a common type first and then checking for the equality between them."
},
{
"code": null,
"e": 1460,
"s": 1235,
"text": "strict eq... |
How to sort an Array using STL in C++? | Here we will see how to sort an array using STL functions in C++. So if the array is like A = [52, 14, 85, 63, 99, 54, 21], then the output will be [14 21 52 54 63 85 99]. To sort we have one function called sort() present in the header file <algorithm>. The code is like below −
Live Demo
#include <iostream>
#include ... | [
{
"code": null,
"e": 1342,
"s": 1062,
"text": "Here we will see how to sort an array using STL functions in C++. So if the array is like A = [52, 14, 85, 63, 99, 54, 21], then the output will be [14 21 52 54 63 85 99]. To sort we have one function called sort() present in the header file <algorithm>... |
If elseif else or ternary operator to compare numbers PHP? | You can use any of them, but a more professional approach is using the ternary operator (?). Performance of both if-else and ternary operator is the same.
Let’s say we have the following two variable values −
$value1=10;
$value2=0;
We need to compare the above 2 variable values.
Live Demo
<!DOCTYPE html>
<html>
<body>... | [
{
"code": null,
"e": 1217,
"s": 1062,
"text": "You can use any of them, but a more professional approach is using the ternary operator (?). Performance of both if-else and ternary operator is the same."
},
{
"code": null,
"e": 1271,
"s": 1217,
"text": "Let’s say we have the follo... |
Construct a unique matrix n x n for an input n - GeeksforGeeks | 21 Apr, 2021
Given an odd integer n, find a matrix of size n x n with following conditions:
Each cell contains an integer from 1 and n (inclusive).No integer appears twice in the same row or the same column.All 1’s must be at every possible distance from the center of the matrix. The center of a n x n square is cell (... | [
{
"code": null,
"e": 24950,
"s": 24922,
"text": "\n21 Apr, 2021"
},
{
"code": null,
"e": 25030,
"s": 24950,
"text": "Given an odd integer n, find a matrix of size n x n with following conditions: "
},
{
"code": null,
"e": 25286,
"s": 25030,
"text": "Each cell ... |
How to search in array of object in MongoDB? | To search the array of object in MongoDB, you can use $elemMatch operator. This operator allows us to search for more than one component from an array object.
To understand the above concept, let us create a collection with the document. The query to create a collection with a document is as follows −
> db.searchArrayD... | [
{
"code": null,
"e": 1221,
"s": 1062,
"text": "To search the array of object in MongoDB, you can use $elemMatch operator. This operator allows us to search for more than one component from an array object."
},
{
"code": null,
"e": 1365,
"s": 1221,
"text": "To understand the above... |
Underscore.js _.each() Function | 25 Nov, 2021
Underscore.js is a JavaScript library that provides a lot of useful functions that helps in the programming in a big way like the map, filter, invoke etc even without using any built-in objects. The _.each() function is an inbuilt function in Underscore.js library of JavaScript which is used to return the ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n25 Nov, 2021"
},
{
"code": null,
"e": 400,
"s": 52,
"text": "Underscore.js is a JavaScript library that provides a lot of useful functions that helps in the programming in a big way like the map, filter, invoke etc even without using a... |
Check if actual binary representation of a number is palindrome - GeeksforGeeks | 08 Apr, 2021
Given a non-negative integer n. The problem is to check if binary representation of n is palindrome or not. Note that the actual binary representation of the number is being considered for palindrome checking, no leading 0’s are being considered.Examples :
Input : 9
Output : Yes
(9)10 = (1001)2
Input : ... | [
{
"code": null,
"e": 24489,
"s": 24461,
"text": "\n08 Apr, 2021"
},
{
"code": null,
"e": 24748,
"s": 24489,
"text": "Given a non-negative integer n. The problem is to check if binary representation of n is palindrome or not. Note that the actual binary representation of the numbe... |
VB.Net - Nested If Statements | It is always legal in VB.Net to nest If-Then-Else statements, which means you can use one If or ElseIf statement inside another If ElseIf statement(s).
The syntax for a nested If statement is as follows −
If( boolean_expression 1)Then
'Executes when the boolean expression 1 is true
If(boolean_expression 2)Then
... | [
{
"code": null,
"e": 2452,
"s": 2300,
"text": "It is always legal in VB.Net to nest If-Then-Else statements, which means you can use one If or ElseIf statement inside another If ElseIf statement(s)."
},
{
"code": null,
"e": 2505,
"s": 2452,
"text": "The syntax for a nested If sta... |
How to handle the click event in Listview in Android using Kotlin? | This example demonstrates how to handle the click event in Listview in Android using Kotlin.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf... | [
{
"code": null,
"e": 1155,
"s": 1062,
"text": "This example demonstrates how to handle the click event in Listview in Android using Kotlin."
},
{
"code": null,
"e": 1284,
"s": 1155,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all re... |
JSF - Spring Integration | Spring provides special class DelegatingVariableResolver to integrate JSF and Spring together in a seamless manner.
Following steps are required to integrate Spring Dependency Injection (IOC) feature in JSF.
Add a variable-resolver entry in faces-config.xml to point to spring class DelegatingVariableResolver.
<faces-co... | [
{
"code": null,
"e": 2068,
"s": 1952,
"text": "Spring provides special class DelegatingVariableResolver to integrate JSF and Spring together in a seamless manner."
},
{
"code": null,
"e": 2160,
"s": 2068,
"text": "Following steps are required to integrate Spring Dependency Inject... |
Explain VirtualizedList component usage in ReactNative? | The VirtualizedList component is best when your list is massively big in size.VirtualizedList helps in better performance and memory usage.As user scrolls, the data is shown to the user.
The basic component of VirtualizedList is as follows &minuns;
<VirtualizedList data={DATA} initialNumToRender={4} renderItem={renderI... | [
{
"code": null,
"e": 1249,
"s": 1062,
"text": "The VirtualizedList component is best when your list is massively big in size.VirtualizedList helps in better performance and memory usage.As user scrolls, the data is shown to the user."
},
{
"code": null,
"e": 1311,
"s": 1249,
"tex... |
PHP & MySQL - Update Records Example | PHP uses mysqli query() or mysql_query() function to update records in a MySQL table. This function takes two parameters and returns TRUE on success or FALSE on failure.
$mysqli->query($sql,$resultmode)
$sql
Required - SQL query to update records in a MySQL table.
$resultmode
Optional - Either the constant MYSQLI_USE_... | [
{
"code": null,
"e": 2302,
"s": 2132,
"text": "PHP uses mysqli query() or mysql_query() function to update records in a MySQL table. This function takes two parameters and returns TRUE on success or FALSE on failure."
},
{
"code": null,
"e": 2336,
"s": 2302,
"text": "$mysqli->que... |
Algorithmic Trading with RSI using Python | by Victor Sim | Towards Data Science | Machine Learning is computationally intensive, as the algorithm is not deterministic and therefore must be constantly tweaked over time. However, technical indicators are much quicker, as the equations do not change. This therefore improves their ability to be used for real-time trading.
Here is the github repo (ads).
... | [
{
"code": null,
"e": 336,
"s": 47,
"text": "Machine Learning is computationally intensive, as the algorithm is not deterministic and therefore must be constantly tweaked over time. However, technical indicators are much quicker, as the equations do not change. This therefore improves their ability t... |
Create Interactive Tools in Google Colab using Widgets | by Huajing Shi | Towards Data Science | In times full of uncertainty, wouldn’t you wonder what the future holds? Let’s stop worrying and have some fun while learning how to create a user-friendly tool in Python for reading your daily horoscope.
As a coding exercise, I envisioned to create an interactive tool in a Python notebook as shown in the above animati... | [
{
"code": null,
"e": 376,
"s": 171,
"text": "In times full of uncertainty, wouldn’t you wonder what the future holds? Let’s stop worrying and have some fun while learning how to create a user-friendly tool in Python for reading your daily horoscope."
},
{
"code": null,
"e": 601,
"s":... |
Comparator Class in C++ with Examples - GeeksforGeeks | 15 Sep, 2020
Comparator Classes are used to compare the objects of user-defined classes. In order to develop a generic function use template, and in order to make the function more generic use containers, so that comparisons between data can be made.
Syntax:
class comparator_class {public: // Comparator function ... | [
{
"code": null,
"e": 24477,
"s": 24449,
"text": "\n15 Sep, 2020"
},
{
"code": null,
"e": 24715,
"s": 24477,
"text": "Comparator Classes are used to compare the objects of user-defined classes. In order to develop a generic function use template, and in order to make the function ... |
Minimum Swaps for Bracket Balancing - GeeksforGeeks | 02 Jun, 2021
You are given a string of 2N characters consisting of N ‘[‘ brackets and N ‘]’ brackets. A string is considered balanced if it can be represented in the for S2[S1] where S1 and S2 are balanced strings. We can make an unbalanced string balanced by swapping adjacent characters. Calculate the minimum number o... | [
{
"code": null,
"e": 24409,
"s": 24381,
"text": "\n02 Jun, 2021"
},
{
"code": null,
"e": 24761,
"s": 24409,
"text": "You are given a string of 2N characters consisting of N ‘[‘ brackets and N ‘]’ brackets. A string is considered balanced if it can be represented in the for S2[S1]... |
Tryit Editor v3.7 | HTML Computer Code
Tryit: HTML kbd element | [
{
"code": null,
"e": 29,
"s": 10,
"text": "HTML Computer Code"
}
] |
ggplot2 - Quick Guide | ggplot2 is an R package which is designed especially for data visualization and providing best exploratory data analysis. It provides beautiful, hassle-free plots that take care of minute details like drawing legends and representing them. The plots can be created iteratively and edited later. This package is designed ... | [
{
"code": null,
"e": 2526,
"s": 2022,
"text": "ggplot2 is an R package which is designed especially for data visualization and providing best exploratory data analysis. It provides beautiful, hassle-free plots that take care of minute details like drawing legends and representing them. The plots can... |
Tryit Editor v3.6 - Show React | import React from 'react';
import ReactDOM from 'react-dom/client';
function Car(props) {
return <h2>I am a { props.brand }!</h2>;
}
function Garage() {
const carName = "Ford";
return (
<>
<h1>Who lives in my garage?</h1>
<Car brand={ carName } />
</>
);
}
const root = ReactDOM.createRoot(d... | [
{
"code": null,
"e": 381,
"s": 0,
"text": "\nimport React from 'react';\nimport ReactDOM from 'react-dom/client';\n\nfunction Car(props) {\n return <h2>I am a { props.brand }!</h2>;\n}\n\nfunction Garage() {\n const carName = \"Ford\";\n return (\n <>\n\t <h1>Who lives in my garage?</h1>\n\... |
Longest Substring with At Most K Distinct Characters in C++ | Suppose we have a string; we have to calculate the length of the longest substring T that contains at most k distinct characters.
So, if the input is like s = "eceba", k = 2, then the output will be 3 as T is "ece" which its length is 3.
To solve this, we will follow these steps −
ans := 0
ans := 0
Define one map m
Def... | [
{
"code": null,
"e": 1192,
"s": 1062,
"text": "Suppose we have a string; we have to calculate the length of the longest substring T that contains at most k distinct characters."
},
{
"code": null,
"e": 1300,
"s": 1192,
"text": "So, if the input is like s = \"eceba\", k = 2, then ... |
Change the size of Bootstrap input groups | Change the size of the input groups, by adding the relative form sizing classes like .input-group-lg, input-group-sm, input-group-xs to the .input-group itself.
You can try to run the following code to change the size of input groups in Bootstrap:
Live Demo
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Exampl... | [
{
"code": null,
"e": 1223,
"s": 1062,
"text": "Change the size of the input groups, by adding the relative form sizing classes like .input-group-lg, input-group-sm, input-group-xs to the .input-group itself."
},
{
"code": null,
"e": 1310,
"s": 1223,
"text": "You can try to run th... |
PostgreSQL - CASE Statement - GeeksforGeeks | 28 Aug, 2020
PostgreSQL provides you with CASE statements that allow you to execute a block of code conditionally. There are two forms of the CASE statement:
Simple CASE statement
Searched CASE statement
Syntax:
CASE search-expression
WHEN expression_1 [, expression_2, ...] THEN
when-statements
[ ... ]
[E... | [
{
"code": null,
"e": 27609,
"s": 27581,
"text": "\n28 Aug, 2020"
},
{
"code": null,
"e": 27755,
"s": 27609,
"text": "PostgreSQL provides you with CASE statements that allow you to execute a block of code conditionally. There are two forms of the CASE statement: "
},
{
"co... |
How to set a Timeout for an AsyncTask in Kotlin Android? | This example demonstrates how to set a Timeout for an AsyncTask in Kotlin.
Step 1 − Create a new project in Android Studio, go to File ⇉ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLay... | [
{
"code": null,
"e": 1137,
"s": 1062,
"text": "This example demonstrates how to set a Timeout for an AsyncTask in Kotlin."
},
{
"code": null,
"e": 1266,
"s": 1137,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇉ New Project and fill all required details to ... |
IsNullOrWhiteSpace() Method in C# | This method returns true if the entered string has only whitespace characters or is null.
Let say you checked for null value −
bool val1 = string.IsNullOrWhiteSpace(null);
The above returns True, since the string is “null”. In the same way, check it for whitespace character.
Here is the entire example that checks for n... | [
{
"code": null,
"e": 1152,
"s": 1062,
"text": "This method returns true if the entered string has only whitespace characters or is null."
},
{
"code": null,
"e": 1189,
"s": 1152,
"text": "Let say you checked for null value −"
},
{
"code": null,
"e": 1234,
"s": 118... |
Alternate Primes till N - GeeksforGeeks | 25 Oct, 2021
We have to print alternate prime numbers till N.Examples:
Input : N = 10
Output : 2 5
Input : N = 15
Output : 2 5 11
Naive Approach:We can just simply iterate over N and check whether the number is prime or not and print the alternate number just by keeping a simple altering flag variable.
C++
Java... | [
{
"code": null,
"e": 24636,
"s": 24608,
"text": "\n25 Oct, 2021"
},
{
"code": null,
"e": 24696,
"s": 24636,
"text": "We have to print alternate prime numbers till N.Examples: "
},
{
"code": null,
"e": 24758,
"s": 24696,
"text": "Input : N = 10\nOutput : 2 5 \... |
What does buffer flush means in C++ ? | The buffer flush is used to transfer of computer data from one temporary storage area to computers permanent memory. If we change anything in some file, the changes we see on the screen are stored temporarily in a buffer.
In C++, we can explicitly have flushed to force the buffer to be written. If we use std::endl, it ... | [
{
"code": null,
"e": 1284,
"s": 1062,
"text": "The buffer flush is used to transfer of computer data from one temporary storage area to computers permanent memory. If we change anything in some file, the changes we see on the screen are stored temporarily in a buffer."
},
{
"code": null,
... |
Decrypt String from Alphabet to Integer Mapping in Python | Suppose we have a string s that is formed by digits ('0' - '9') and '#'. We have to map s to one English lowercase characters as follows −
Characters ('a' to 'i') are represented by ('1' to '9') respectively.
Characters ('a' to 'i') are represented by ('1' to '9') respectively.
Characters ('j' to 'z') are represented b... | [
{
"code": null,
"e": 1201,
"s": 1062,
"text": "Suppose we have a string s that is formed by digits ('0' - '9') and '#'. We have to map s to one English lowercase characters as follows −"
},
{
"code": null,
"e": 1271,
"s": 1201,
"text": "Characters ('a' to 'i') are represented by ... |
Python Tuple cmp() Method | Python tuple method cmp() compares elements of two tuples.
Following is the syntax for cmp() method −
cmp(tuple1, tuple2)
tuple1 − This is the first tuple to be compared
tuple1 − This is the first tuple to be compared
tuple2 − This is the second tuple to be compared
tuple2 − This is the second tuple to be compared
If ... | [
{
"code": null,
"e": 2303,
"s": 2244,
"text": "Python tuple method cmp() compares elements of two tuples."
},
{
"code": null,
"e": 2346,
"s": 2303,
"text": "Following is the syntax for cmp() method −"
},
{
"code": null,
"e": 2367,
"s": 2346,
"text": "cmp(tuple... |
How to get all the MySQL triggers and the triggers for only the current database | To get all the MySQL triggers, following is the syntax −
select trigger_schema,trigger_name from information_schema.triggers;
Let us implement the above syntax to get all the trigger names along with schema −
mysql> select trigger_schema,trigger_name from information_schema.triggers;
This will produce the following out... | [
{
"code": null,
"e": 1119,
"s": 1062,
"text": "To get all the MySQL triggers, following is the syntax −"
},
{
"code": null,
"e": 1188,
"s": 1119,
"text": "select trigger_schema,trigger_name from information_schema.triggers;"
},
{
"code": null,
"e": 1271,
"s": 1188... |
How to remove grid lines from an image in Python Matplotlib? | To remove grid lines from an image, we can take the following steps −
Set the figure size and adjust the padding between and around the subplots.
Load an image from a file.
Convert the image from one color space to another.
To remove grid lines, use ax.grid(False).
Display the data as an image, i.e., on a 2D regular ra... | [
{
"code": null,
"e": 1132,
"s": 1062,
"text": "To remove grid lines from an image, we can take the following steps −"
},
{
"code": null,
"e": 1208,
"s": 1132,
"text": "Set the figure size and adjust the padding between and around the subplots."
},
{
"code": null,
"e":... |
Clicking on elements within an SVG using XPath (Selenium WebDriver). | We can click on elements with an SVG using XPath in Selenium. The SVG element has the tag name svg. It has attributes like width, height, viewBox, and so on.
To click the element with svg, we should identify the element then utilize the Actions class. We shall first move to that element with the moveToElement method an... | [
{
"code": null,
"e": 1220,
"s": 1062,
"text": "We can click on elements with an SVG using XPath in Selenium. The SVG element has the tag name svg. It has attributes like width, height, viewBox, and so on."
},
{
"code": null,
"e": 1419,
"s": 1220,
"text": "To click the element wit... |
IPC through shared memory | Shared memory is a memory shared between two or more processes. However, why do we need to share memory or some other means of communication?
To reiterate, each process has its own address space, if any process wants to communicate with some information from its own address space to other processes, then it is only pos... | [
{
"code": null,
"e": 1204,
"s": 1062,
"text": "Shared memory is a memory shared between two or more processes. However, why do we need to share memory or some other means of communication?"
},
{
"code": null,
"e": 1525,
"s": 1204,
"text": "To reiterate, each process has its own a... |
Running multiple commands when a button is pressed in Tkinter | The Button widget provides a way to communicate through all the existing functionalities of an application. We can perform a certain action with the help of a Button that encapsulates the function and the objects. However, there might be cases when we want to perform multiple operations with a single button. This can b... | [
{
"code": null,
"e": 1487,
"s": 1062,
"text": "The Button widget provides a way to communicate through all the existing functionalities of an application. We can perform a certain action with the help of a Button that encapsulates the function and the objects. However, there might be cases when we w... |
Flexible Array Members in a structure in C | Flexible Array members in a structure in C means we can declare array without its dimension within a structure and its size will be flexible in nature. Flexible array member must be the last member of class.
Here is an example:
#include
#include
#include
//structure of type employee and must contain at least one more n... | [
{
"code": null,
"e": 1270,
"s": 1062,
"text": "Flexible Array members in a structure in C means we can declare array without its dimension within a structure and its size will be flexible in nature. Flexible array member must be the last member of class."
},
{
"code": null,
"e": 1290,
... |
How to add Image to MySql database using Servlet and JDBC | 21 Jun, 2020
Structured Query Language or SQL is a standard Database language which is used to create, maintain and retrieve the data from relational databases like MySQL, Oracle, SQL Server, PostGre, etc. In this article, we will understand how to add an image to the MYSQL database using servlet.
MYSQL is a relational... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Jun, 2020"
},
{
"code": null,
"e": 314,
"s": 28,
"text": "Structured Query Language or SQL is a standard Database language which is used to create, maintain and retrieve the data from relational databases like MySQL, Oracle, SQL Serv... |
How to set the font of the TextBox Content in C#? | 29 Nov, 2019
In Windows forms, TextBox plays an important role. With the help of TextBox, the user can enter data in the application, it can be of a single line or of multiple lines. In TextBox, you are allowed to change the font of the content present in the TextBox with the help of Font property which makes your text... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Nov, 2019"
},
{
"code": null,
"e": 422,
"s": 28,
"text": "In Windows forms, TextBox plays an important role. With the help of TextBox, the user can enter data in the application, it can be of a single line or of multiple lines. In Te... |
Insert a new axis within a NumPy array | 29 Aug, 2020
This post deals with the ways to increase the dimension of an array in NumPy. NumPy provides us with two different built-in functions to increase the dimension of an array i.e.,
1D array will become 2D array
2D array will become 3D array
3D array will become 4D array
4D array will become 5D array
Method ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 Aug, 2020"
},
{
"code": null,
"e": 231,
"s": 52,
"text": "This post deals with the ways to increase the dimension of an array in NumPy. NumPy provides us with two different built-in functions to increase the dimension of an array i.... |
Roman Number to Integer | Practice | GeeksforGeeks | Given a string in roman no format (s) your task is to convert it to an integer . Various symbols and their values are given below.
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
Example 1:
Input:
s = V
Output: 5
Example 2:
Input:
s = III
Output: 3
Your Task:
Complete the function romanToDecimal() which takes a string as inpu... | [
{
"code": null,
"e": 407,
"s": 238,
"text": "Given a string in roman no format (s) your task is to convert it to an integer . Various symbols and their values are given below.\nI 1\nV 5\nX 10\nL 50\nC 100\nD 500\nM 1000"
},
{
"code": null,
"e": 418,
"s": 407,
"text": "Example 1:... |
Self-Typing Text Effect using CSS & JavaScript | 21 Jul, 2020
Self-Typing Text Effect is a type of effect in which all the alphabets of the text are revealed one-by-one, one after the other to give the look and feel of being typed on the screen by themselves. Even though this is a basic text effect, it is still an eye capturing and an effective animation. This animat... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Jul, 2020"
},
{
"code": null,
"e": 845,
"s": 28,
"text": "Self-Typing Text Effect is a type of effect in which all the alphabets of the text are revealed one-by-one, one after the other to give the look and feel of being typed on the... |
Stream sorted (Comparator comparator) method in Java | 06 Dec, 2018
Stream sorted(Comparator comparator) returns a stream consisting of the elements of this stream, sorted according to the provided Comparator. For ordered streams, the sort method is stable but for unordered streams, no stability is guaranteed. It is a stateful intermediate operation i.e, it may incorporate... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Dec, 2018"
},
{
"code": null,
"e": 588,
"s": 54,
"text": "Stream sorted(Comparator comparator) returns a stream consisting of the elements of this stream, sorted according to the provided Comparator. For ordered streams, the sort me... |
Python - Regular Expressions | 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 Python module re provides full support for Perl-like regular expressions in Python. The re module r... | [
{
"code": null,
"e": 2595,
"s": 2378,
"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."
},
{
"code": null,
"e":... |
Dynamic CheckBox in Android with Examples | 19 Feb, 2021
Android offers a wide variety of widgets for user interactions and CheckBox is one among them. CheckBox is a special kind of button with two states that can be either checked or unchecked. They serve as a simple tool to gather information from the user without much hassle. They are generally used to mark t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Feb, 2021"
},
{
"code": null,
"e": 399,
"s": 28,
"text": "Android offers a wide variety of widgets for user interactions and CheckBox is one among them. CheckBox is a special kind of button with two states that can be either checked ... |
Target Code Generation in Compiler Design | 29 Dec, 2020
Target code generation is the final Phase of Compiler.
Input : Optimized Intermediate Representation.Output : Target Code.Task Performed : Register allocation methods and optimization, assembly level code.Method : Three popular strategies for register allocation and optimization.Implementation : Algorithms... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Dec, 2020"
},
{
"code": null,
"e": 109,
"s": 54,
"text": "Target code generation is the final Phase of Compiler."
},
{
"code": null,
"e": 2303,
"s": 109,
"text": "Input : Optimized Intermediate Representation.Out... |
Pascal - Passing Pointers to Subprograms | Pointer variables may be passed as parameters in function and procedure arguments. Pointer variables can be passed on both as value and variable parameters; however, when passed as variable parameters, the subprogram might inadvertently alter the value of the pointer which will lead to strange results.
The following pr... | [
{
"code": null,
"e": 2521,
"s": 2217,
"text": "Pointer variables may be passed as parameters in function and procedure arguments. Pointer variables can be passed on both as value and variable parameters; however, when passed as variable parameters, the subprogram might inadvertently alter the value ... |
How to plot two histograms together in Matplotlib? | 11 Dec, 2020
Prerequisites:
Matplotlib
The histogram is the graphical representation that organizes grouped data points into the specified range. Creating the histogram provides the visual representation of data distribution. By using a histogram we can represent the large amount of data and it’s frequency as one cont... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Dec, 2020"
},
{
"code": null,
"e": 69,
"s": 54,
"text": "Prerequisites:"
},
{
"code": null,
"e": 81,
"s": 69,
"text": " Matplotlib"
},
{
"code": null,
"e": 374,
"s": 81,
"text": "The histogram... |
Shamir’s Secret Sharing Algorithm | Cryptography | 28 Jun, 2022
Cryptography is a technique of securing information and communications through the use of codes so that only those person for whom the information is intended can understand it and process it. Thus preventing unauthorized access to information. The prefix “crypt” means “hidden” and suffix graphy means “wri... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2022"
},
{
"code": null,
"e": 686,
"s": 52,
"text": "Cryptography is a technique of securing information and communications through the use of codes so that only those person for whom the information is intended can understand ... |
How to set a background color to full page using Tailwind CSS ? | 26 May, 2021
In this article, we will learn to apply background color using Tailwind CSS.
Approach:
We can set a full-page background color by simply changing the screen height of an HTML body. In Tailwind CSS, we use an alternative of CSS background-color property which is represented as background-color-opacity ( eg... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 May, 2021"
},
{
"code": null,
"e": 105,
"s": 28,
"text": "In this article, we will learn to apply background color using Tailwind CSS."
},
{
"code": null,
"e": 115,
"s": 105,
"text": "Approach:"
},
{
"code... |
Program to find the Nth Harmonic Number | 20 Dec, 2021
Given a number N. The task is to find the Nth Harmonic Number.Let the nth harmonic number be Hn.The harmonic series is as follows:
H1 = 1 H2 = H1 + 1/2 H3 = H2 + 1/3 H4 = H3 + 1/4 . . . Hn = Hn-1 + 1/n
Examples:
Input : N = 5
Output : 2.45
Input : N = 9
Output : 2.71786
The idea is to traverse fro... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Dec, 2021"
},
{
"code": null,
"e": 161,
"s": 28,
"text": "Given a number N. The task is to find the Nth Harmonic Number.Let the nth harmonic number be Hn.The harmonic series is as follows: "
},
{
"code": null,
"e": 234,
... |
Laravel | View Basics | 30 Dec, 2019
Laravel is an MVC based PHP framework. In MVC architecture, V stands for View. The View is data that is going to be displayed to the user on their browser and the user can interact with it. It is simply an interface provided to the user for interaction.
Laravel used a powerful templating engine called Blad... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Dec, 2019"
},
{
"code": null,
"e": 306,
"s": 52,
"text": "Laravel is an MVC based PHP framework. In MVC architecture, V stands for View. The View is data that is going to be displayed to the user on their browser and the user can in... |
Arrays in C/C++ program | The array is a collection of a fixed number of items of the same data type. These elements are stored in contiguous memory locations in the memory.
Every single element of the value can be accessed from its index value using the brackets “[]” and the array name like a[4], a[3], etc.
In c/c++ programming languages, arra... | [
{
"code": null,
"e": 1210,
"s": 1062,
"text": "The array is a collection of a fixed number of items of the same data type. These elements are stored in contiguous memory locations in the memory."
},
{
"code": null,
"e": 1346,
"s": 1210,
"text": "Every single element of the value ... |
Java 9 - Module System | Java 9, a new kind of programming component called module has been introduced. A module is a self-describing collection of code and data and has a name to identify it.
With the Modules component, following enhancements has been added in Java 9 −
A new optional phase,link time, is introduced. This phase is in-between co... | [
{
"code": null,
"e": 2277,
"s": 2109,
"text": "Java 9, a new kind of programming component called module has been introduced. A module is a self-describing collection of code and data and has a name to identify it."
},
{
"code": null,
"e": 2355,
"s": 2277,
"text": "With the Modul... |
Architecture of Apache Cassandra - GeeksforGeeks | 27 Sep, 2021
Avinash Lakshman and Prashant Malik initially developed Cassandra at Facebook to power the Facebook inbox search feature. Facebook released Cassandra as an open source project on google code in July 2008. It became an Apache incubator project in March 2009. It became one of the top level project in 17 Feb ... | [
{
"code": null,
"e": 23559,
"s": 23531,
"text": "\n27 Sep, 2021"
},
{
"code": null,
"e": 24129,
"s": 23559,
"text": "Avinash Lakshman and Prashant Malik initially developed Cassandra at Facebook to power the Facebook inbox search feature. Facebook released Cassandra as an open so... |
Get/Set process resource limits in C - GeeksforGeeks | 17 Dec, 2018
The getrlimit() and setrlimit() system calls can be used to get and set the resource limits such as files, CPU, memory etc. associated with a process.
Each resource has an associated soft and hard limit.
soft limit: The soft limit is the actual limit enforced by the kernel for the corresponding resource.
h... | [
{
"code": null,
"e": 25881,
"s": 25853,
"text": "\n17 Dec, 2018"
},
{
"code": null,
"e": 26032,
"s": 25881,
"text": "The getrlimit() and setrlimit() system calls can be used to get and set the resource limits such as files, CPU, memory etc. associated with a process."
},
{
... |
Python OpenCV - getgaussiankernel() Function - GeeksforGeeks | 19 Dec, 2021
Python OpenCV getGaussianKernel() function is used to find the Gaussian filter coefficients. The Gaussian kernel is also used in Gaussian Blurring. Gaussian Blurring is the smoothing technique that uses a low pass filter whose weights are derived from a Gaussian function. In fact, this is the most widely u... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n19 Dec, 2021"
},
{
"code": null,
"e": 25980,
"s": 25537,
"text": "Python OpenCV getGaussianKernel() function is used to find the Gaussian filter coefficients. The Gaussian kernel is also used in Gaussian Blurring. Gaussian Blurri... |
Launch a Website on AWS S3 - GeeksforGeeks | 30 Aug, 2020
Launching a website is one of the most important thing for a company either it is a startup or a well established company. But. Launching a website is not an easy task there are a lot of things to be taken care off.AWS makes it easier for both with complete knowledge or a startup. By using AWS S3 service h... | [
{
"code": null,
"e": 25493,
"s": 25465,
"text": "\n30 Aug, 2020"
},
{
"code": null,
"e": 25940,
"s": 25493,
"text": "Launching a website is one of the most important thing for a company either it is a startup or a well established company. But. Launching a website is not an easy ... |
How to Add Audio Files to Android App in Android Studio? - GeeksforGeeks | 18 Feb, 2021
The audio file format is a file format for saving digital audio data on a computer system and all are aware of audio files. So in this article, we are going to discuss how can we add audio files to the android app. There are three major groups of audio file formats:
Format Name
Description
Examples
Note: A... | [
{
"code": null,
"e": 26337,
"s": 26309,
"text": "\n18 Feb, 2021"
},
{
"code": null,
"e": 26604,
"s": 26337,
"text": "The audio file format is a file format for saving digital audio data on a computer system and all are aware of audio files. So in this article, we are going to dis... |
Array range queries over range queries - GeeksforGeeks | 28 Apr, 2022
Given an array of size n and a give set of commands of size m. The commands are enumerated from 1 to m. These commands can be of the following two types of commands:
Type 1 [l r (1 <= l <= r <= n)] : Increase all elements of the array by one, whose indices belongs to the range [l, r]. In these queries of ... | [
{
"code": null,
"e": 42521,
"s": 42493,
"text": "\n28 Apr, 2022"
},
{
"code": null,
"e": 42688,
"s": 42521,
"text": "Given an array of size n and a give set of commands of size m. The commands are enumerated from 1 to m. These commands can be of the following two types of command... |
Bitwise OR (or | ) of a range - GeeksforGeeks | 03 Jun, 2021
Given two integers L and R. Determine the bitwise OR of all the integers in the range [L, R] (both inclusive).
Examples:
Input: L = 3, R = 8
Output: 15
3 | 4 | 5 | 6 | 7 | 8 = 15
Input: L = 12, R = 18
Output: 31
12 | 13 | 14 | 15 | 16 | 17 | 18 = 31
A naive approach is to traverse through all the integ... | [
{
"code": null,
"e": 26279,
"s": 26251,
"text": "\n03 Jun, 2021"
},
{
"code": null,
"e": 26390,
"s": 26279,
"text": "Given two integers L and R. Determine the bitwise OR of all the integers in the range [L, R] (both inclusive)."
},
{
"code": null,
"e": 26402,
"s":... |
Ruby | DateTime now() function - GeeksforGeeks | 09 Jan, 2020
DateTime#now() : now() is a DateTime class method which returns a DateTime object denoting the given calendar date.
Syntax: DateTime.now()
Parameter: DateTime values
Return: DateTime object denoting the given calendar date.
Example #1 :
# Ruby code for DateTime.now() method # loading libraryrequire 'date'... | [
{
"code": null,
"e": 24841,
"s": 24813,
"text": "\n09 Jan, 2020"
},
{
"code": null,
"e": 24957,
"s": 24841,
"text": "DateTime#now() : now() is a DateTime class method which returns a DateTime object denoting the given calendar date."
},
{
"code": null,
"e": 24980,
... |
p5.js | pixelDensity() function - GeeksforGeeks | 16 Apr, 2019
The pixelDensity() function in p5.js is used to set the pixel scaling for high pixel density displays. The default value of pixel density is set to match display density. The pixelDensity(1) is used to turn off display density. The pixelDensity() function without arguments returns the current pixel density... | [
{
"code": null,
"e": 44937,
"s": 44909,
"text": "\n16 Apr, 2019"
},
{
"code": null,
"e": 45260,
"s": 44937,
"text": "The pixelDensity() function in p5.js is used to set the pixel scaling for high pixel density displays. The default value of pixel density is set to match display d... |
Computer Networks | Set 3 - GeeksforGeeks | 30 Nov, 2021
Following Questions have been asked in GATE 2011 CS exam.
1) A layer-4 firewall ( a device that can look at all protocol headers up to the transport layer) CANNOT (A) block HTTP traffic during 9:00PM and 5:00AM (B) block all ICMP traffic (C) stop incoming traffic from a specific IP address but allow outgo... | [
{
"code": null,
"e": 37839,
"s": 37811,
"text": "\n30 Nov, 2021"
},
{
"code": null,
"e": 37898,
"s": 37839,
"text": "Following Questions have been asked in GATE 2011 CS exam. "
},
{
"code": null,
"e": 38284,
"s": 37898,
"text": "1) A layer-4 firewall ( a devic... |
Find length of longest subsequence of one string which is substring of another string in C++ | Suppose, we have two strings X and Y, and we have to find the length of longest subsequence of string X, which is substring in sequence Y. So if X = “ABCD” and Y = “BACDBDCD”, then output will be 3. As “ACD” is the longest sub-sequence of X, which is substring of Y.
Here we will use the dynamic programming approach to ... | [
{
"code": null,
"e": 1329,
"s": 1062,
"text": "Suppose, we have two strings X and Y, and we have to find the length of longest subsequence of string X, which is substring in sequence Y. So if X = “ABCD” and Y = “BACDBDCD”, then output will be 3. As “ACD” is the longest sub-sequence of X, which is su... |
How to validate if input in input field has uppercase letters only using express-validator? - GeeksforGeeks | 07 Apr, 2022
In HTML forms, we often required validation of different types. Validate existing email, validate password length, validate confirm password, validate to allow only integer inputs, these are some examples of validation. In a certain input field, only uppercase letters are allowed. We can also validate thes... | [
{
"code": null,
"e": 25002,
"s": 24974,
"text": "\n07 Apr, 2022"
},
{
"code": null,
"e": 25393,
"s": 25002,
"text": "In HTML forms, we often required validation of different types. Validate existing email, validate password length, validate confirm password, validate to allow onl... |
Checking for vowels in array of numbers using JavaScript | We are required to write a JavaScript function that takes in takes in an array of numbers. If in that array there exists any number which is the char code any vowel in ascii we should switch that number to the corresponding vowel and return the new array.
Following is the code −
Live Demo
const arr = [5, 23, 67, 101, ... | [
{
"code": null,
"e": 1318,
"s": 1062,
"text": "We are required to write a JavaScript function that takes in takes in an array of numbers. If in that array there exists any number which is the char code any vowel in ascii we should switch that number to the corresponding vowel and return the new arra... |
Next Permutation in Python | Suppose we want to implement the next permutation method, that method rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, this method will rearrange it as the lowest possible order (That is actually, sorted in ascending order). The replacement must be ... | [
{
"code": null,
"e": 1539,
"s": 1062,
"text": "Suppose we want to implement the next permutation method, that method rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, this method will rearrange it as the lowest possible order (Tha... |
Check if a prime number can be expressed as sum of two Prime Numbers - GeeksforGeeks | 07 Apr, 2021
Given a prime number . The task is to check if it is possible to express as sum of two separate prime numbers.Note: The range of N is less than 108.
Examples:
Input : N = 13
Output : Yes
Explanation : The number 13 can be written as 11 + 2,
here 11 and 2 are both prime.
Input : N = 11
Output : No
Simple... | [
{
"code": null,
"e": 24860,
"s": 24832,
"text": "\n07 Apr, 2021"
},
{
"code": null,
"e": 25009,
"s": 24860,
"text": "Given a prime number . The task is to check if it is possible to express as sum of two separate prime numbers.Note: The range of N is less than 108."
},
{
... |
Threads and Thread Synchronization in C# | Using Synchronization, you can synchronize access to resources in multithreaded applications.
A mutex can be used to synchronize threads across processes Use it to prevent the simultaneous execution of a block of code by more than one thread at a time.
C# lock statement is used to ensure that a block of code runs witho... | [
{
"code": null,
"e": 1156,
"s": 1062,
"text": "Using Synchronization, you can synchronize access to resources in multithreaded applications."
},
{
"code": null,
"e": 1315,
"s": 1156,
"text": "A mutex can be used to synchronize threads across processes Use it to prevent the simult... |
Node.js | path.join() Method - GeeksforGeeks | 14 Feb, 2020
The path.join() method is used to join a number of path-segments using the platform-specific delimiter to form a single path. The final path is normalized after the joining takes place. The path-segments are specified using comma-separated values.
Syntax:
path.join( [...paths] )
Parameters: This function... | [
{
"code": null,
"e": 37354,
"s": 37326,
"text": "\n14 Feb, 2020"
},
{
"code": null,
"e": 37602,
"s": 37354,
"text": "The path.join() method is used to join a number of path-segments using the platform-specific delimiter to form a single path. The final path is normalized after th... |
Underline Text in Tkinter Label widget | Tkinter label widgets can be styled using the predefined attributes and functions in the library. Labels are useful in place of adding text and displaying images in the application. Sometimes, we need to style the font property of Label Text such as fontfamily, font-style (Bold, strike, underline, etc.), font-size, and... | [
{
"code": null,
"e": 1502,
"s": 1062,
"text": "Tkinter label widgets can be styled using the predefined attributes and functions in the library. Labels are useful in place of adding text and displaying images in the application. Sometimes, we need to style the font property of Label Text such as fon... |
Python While Loops | Python has two primitive loop commands:
while loops
for loops
With the while loop we can execute a set of statements as long as a condition is true.
Print i as long as i is less than 6:
Note: remember to increment i, or else the loop will continue forever.
The while loop requires relevant variables to be ready, in this... | [
{
"code": null,
"e": 40,
"s": 0,
"text": "Python has two primitive loop commands:"
},
{
"code": null,
"e": 52,
"s": 40,
"text": "while loops"
},
{
"code": null,
"e": 62,
"s": 52,
"text": "for loops"
},
{
"code": null,
"e": 149,
"s": 62,
"te... |
Pandas Series | A Pandas Series is like a column in a table.
It is a one-dimensional array holding data of any type.
Create a simple Pandas Series from a list:
If nothing else is specified, the values are labeled with their index number. First value
has index 0, second value has index 1 etc.
This label can be used to access a specifi... | [
{
"code": null,
"e": 45,
"s": 0,
"text": "A Pandas Series is like a column in a table."
},
{
"code": null,
"e": 101,
"s": 45,
"text": "It is a one-dimensional array holding data of any type."
},
{
"code": null,
"e": 144,
"s": 101,
"text": "Create a simple Pand... |
Create a Snake-Game using Turtle in Python - GeeksforGeeks | 08 Dec, 2021
A snake game is an arcade maze game which has been developed by Gremlin Industries and published by Sega in October 1976. It is considered to be a skillful game and has popularized among people for generations. The snake in the Snake game is controlled using the four direction buttons relative to the direc... | [
{
"code": null,
"e": 24035,
"s": 24007,
"text": "\n08 Dec, 2021"
},
{
"code": null,
"e": 24532,
"s": 24035,
"text": "A snake game is an arcade maze game which has been developed by Gremlin Industries and published by Sega in October 1976. It is considered to be a skillful game an... |
The basics of deploying Logstash pipelines to Kubernetes | by Danny Kay | Towards Data Science | Do you have a long list of the things you want to learn on a list in your brain?
I did, until I wrote that list down on a piece of paper and decided to do something about it. Towards the end of 2018 I started to wrap up things I’d been learning and decided to put some structure into my learning for 2019.
2018 had been ... | [
{
"code": null,
"e": 128,
"s": 47,
"text": "Do you have a long list of the things you want to learn on a list in your brain?"
},
{
"code": null,
"e": 353,
"s": 128,
"text": "I did, until I wrote that list down on a piece of paper and decided to do something about it. Towards the ... |
How to Alter a SQLite Table using Python ? - GeeksforGeeks | 03 Jun, 2021
In this article, we will discuss how can we alter tables in the SQLite database from a Python program using the sqlite3 module.
We can do this by using ALTER statement. It allows to:
Add one or more column to the table
The syntax of ALTER TABLE to add a new column in an existing table in SQLite is given ... | [
{
"code": null,
"e": 23973,
"s": 23942,
"text": " \n03 Jun, 2021\n"
},
{
"code": null,
"e": 24102,
"s": 23973,
"text": "In this article, we will discuss how can we alter tables in the SQLite database from a Python program using the sqlite3 module. "
},
{
"code": null,
... |
jQuery - toggle( speed, [callback] ) Method | The toggle( speed, [callback]) method toggles displaying each of the set of matched elements using a graceful animation and firing an optional callback after completion.
Here is the simple syntax to use this method −
selector.toggle( speed, [callback]);
Here is the description of all the parameters used by this method... | [
{
"code": null,
"e": 2492,
"s": 2322,
"text": "The toggle( speed, [callback]) method toggles displaying each of the set of matched elements using a graceful animation and firing an optional callback after completion."
},
{
"code": null,
"e": 2539,
"s": 2492,
"text": "Here is the ... |
\notin - Tex Command | \notin - Used to create notin symbol.
{ \notin}
\notin command draws notin symbol.
\notin
∉
\notin
∉
\notin
14 Lectures
52 mins
Ashraf Said
11 Lectures
1 hours
Ashraf Said
9 Lectures
1 hours
Emenwa Global, Ejike IfeanyiChukwu
29 Lectures
2.5 hours
Mohamma... | [
{
"code": null,
"e": 8024,
"s": 7986,
"text": "\\notin - Used to create notin symbol."
},
{
"code": null,
"e": 8034,
"s": 8024,
"text": "{ \\notin}"
},
{
"code": null,
"e": 8069,
"s": 8034,
"text": "\\notin command draws notin symbol."
},
{
"code": nul... |
Beating the S&P500 Using Machine Learning | by Thomas Rochefort-Beaudoin | Towards Data Science | The S&P 500 index is one of the most followed market indexes and is often used as a benchmark for the overall US equity market. While one could consider investing in a passive fund replicating the S&P500, many will turn towards fund managers and will prefer investing in active funds. Unfortunately, more and more studie... | [
{
"code": null,
"e": 901,
"s": 172,
"text": "The S&P 500 index is one of the most followed market indexes and is often used as a benchmark for the overall US equity market. While one could consider investing in a passive fund replicating the S&P500, many will turn towards fund managers and will pref... |
Average of pairwise difference of all pairs formed from given N integers - GeeksforGeeks | 13 Dec, 2021
Given an array arr[] containing N integers, the task is to calculate the average of the difference between both elements in pairs formed from given N integers.
Examples:
Input: arr[] = {-1, 3, -5, 4}Output: 5.166667Explanation: There are 6 possible pair of points in the given array with the pairwise differ... | [
{
"code": null,
"e": 26151,
"s": 26123,
"text": "\n13 Dec, 2021"
},
{
"code": null,
"e": 26311,
"s": 26151,
"text": "Given an array arr[] containing N integers, the task is to calculate the average of the difference between both elements in pairs formed from given N integers."
... |
Python Structural Pattern Matching — Top 3 Use Cases To Get You Started | by Dario Radečić | Towards Data Science | Python’s equivalent of a switch statement is finally here in Python 3.10. It hides behind a fancy name of Structural Pattern Matching, and does what you’d expect and more. It packs support for working with primitive data types, sequences, and even classes and enums.
Today I’ll show you how to get started, and debate in... | [
{
"code": null,
"e": 314,
"s": 47,
"text": "Python’s equivalent of a switch statement is finally here in Python 3.10. It hides behind a fancy name of Structural Pattern Matching, and does what you’d expect and more. It packs support for working with primitive data types, sequences, and even classes ... |
Sum of product of r and rth Binomial Coefficient (r * nCr) - GeeksforGeeks | 25 Mar, 2021
Given a positive integer n. The task is to find the sum of the product of r and rth Binomial Coefficient. In other words find: Σ (r * nCr), where 0 <= r <= n.Examples:
Input : n = 2
Output : 4
0.2C0 + 1.2C1 + 2.2C2
= 0*2 + 1*2 + 2*1
= 4
Input : n = 5
Output : 80
Method 1 (Brute Force) : The idea is to... | [
{
"code": null,
"e": 25941,
"s": 25913,
"text": "\n25 Mar, 2021"
},
{
"code": null,
"e": 26111,
"s": 25941,
"text": "Given a positive integer n. The task is to find the sum of the product of r and rth Binomial Coefficient. In other words find: Σ (r * nCr), where 0 <= r <= n.Examp... |
Find duplicates in a given array when elements are not limited to a range - GeeksforGeeks | 22 Jun, 2021
Given an array of n integers. The task is to print the duplicates in the given array. If there are no duplicates then print -1.
Examples:
Input: {2, 10,10, 100, 2, 10, 11,2,11,2}
Output: 2 10 11
Input: {5, 40, 1, 40, 100000, 1, 5, 1}
Output: 5 40 1
Note: The duplicate elements can be printed in any orde... | [
{
"code": null,
"e": 26533,
"s": 26505,
"text": "\n22 Jun, 2021"
},
{
"code": null,
"e": 26662,
"s": 26533,
"text": "Given an array of n integers. The task is to print the duplicates in the given array. If there are no duplicates then print -1. "
},
{
"code": null,
"e... |
Frequency of a substring in a string | Set 2 - GeeksforGeeks | 30 Oct, 2020
Given a string str of length N and a substring pattern of length M, the task is to find the frequency of occurrences of pattern as a substring in the given string. If pattern is present in the string str, then print “Yes” with the count of its occurrence. Otherwise, print “No”.
Examples:
Input: str = “geek... | [
{
"code": null,
"e": 26653,
"s": 26625,
"text": "\n30 Oct, 2020"
},
{
"code": null,
"e": 26932,
"s": 26653,
"text": "Given a string str of length N and a substring pattern of length M, the task is to find the frequency of occurrences of pattern as a substring in the given string.... |
Pentanacci Numbers - GeeksforGeeks | 27 Feb, 2022
The Pentanacci series is a generalization of the Fibonacci sequence where each term is the sum of the five preceding terms. The first few Pentanacci numbers are as follows – 0, 0, 0, 0, 1, 1, 2, 4, 8, 16, 31, 61, 120, 236, 464, 912, 1793, 3525, 6930, 13624, 26784, 52656, 103519.....
Nth Term of Pentanacci ... | [
{
"code": null,
"e": 25779,
"s": 25751,
"text": "\n27 Feb, 2022"
},
{
"code": null,
"e": 26063,
"s": 25779,
"text": "The Pentanacci series is a generalization of the Fibonacci sequence where each term is the sum of the five preceding terms. The first few Pentanacci numbers are as... |
How to search by key=>value in a multidimensional array in PHP ? - GeeksforGeeks | 20 May, 2019
In PHP, multidimensional array search refers to searching a key=>value in a multilevel nested array. This search can be done either by the iterative or recursive approach.
Recursive Approach: Check if the key exists in a multidimensional array and the value of a key is equal to required one then the result... | [
{
"code": null,
"e": 25823,
"s": 25795,
"text": "\n20 May, 2019"
},
{
"code": null,
"e": 25995,
"s": 25823,
"text": "In PHP, multidimensional array search refers to searching a key=>value in a multilevel nested array. This search can be done either by the iterative or recursive a... |
Named Pipe or FIFO with example C program - GeeksforGeeks | 05 Aug, 2021
In computing, a named pipe (also known as a FIFO) is one of the methods for inter-process communication.
It is an extension to the traditional pipe concept on Unix. A traditional pipe is “unnamed” and lasts only as long as the process.
A named pipe, however, can last as long as the system is up, beyond t... | [
{
"code": null,
"e": 25695,
"s": 25667,
"text": "\n05 Aug, 2021"
},
{
"code": null,
"e": 25802,
"s": 25695,
"text": "In computing, a named pipe (also known as a FIFO) is one of the methods for inter-process communication. "
},
{
"code": null,
"e": 25933,
"s": 258... |
Principle of programming languages | Set 1 - GeeksforGeeks | 27 Mar, 2017
Following questions have been asked in GATE CS exam.
1.The most appropriate matching for the following pairs
X: Indirect addressing 1: Loops
Y: Immediate addressing 2: Pointers
Z: Auto decrement addressing 3. Constants
is (GATE CS 2000)(a) X—3 Y—2 Z—1(b) X—1 Y—3... | [
{
"code": null,
"e": 25203,
"s": 25175,
"text": "\n27 Mar, 2017"
},
{
"code": null,
"e": 25256,
"s": 25203,
"text": "Following questions have been asked in GATE CS exam."
},
{
"code": null,
"e": 25312,
"s": 25256,
"text": "1.The most appropriate matching for t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.