title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Garbage Collector with Pandas DataFrame | Apratim Biswas | Dec 2020 | Towards Data Science | It’s almost 2021. Memory is inexpensive and it’s easy to access cloud platforms like Amazon Web Services (AWS) or Google Cloud Platform (GCP) and throw vast amount of resources at a data problem. And so, we usually don’t worry about memory (RAM) these days. But there are at least two problems with this line of thinking... | [
{
"code": null,
"e": 494,
"s": 172,
"text": "It’s almost 2021. Memory is inexpensive and it’s easy to access cloud platforms like Amazon Web Services (AWS) or Google Cloud Platform (GCP) and throw vast amount of resources at a data problem. And so, we usually don’t worry about memory (RAM) these day... |
Python | Find elements within range in numpy - GeeksforGeeks | 12 Mar, 2019
Given numpy array, the task is to find elements within some specific range. Let’s discuss some ways to do the task. Method #1: Using np.where()
# python code to demonstrate# finding elements in range# in numpy arrayimport numpy as np ini_array = np.array([1, 2, 3, 45, 4, 7, 810, 9, 6]) # printing initial... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n12 Mar, 2019"
},
{
"code": null,
"e": 24045,
"s": 23901,
"text": "Given numpy array, the task is to find elements within some specific range. Let’s discuss some ways to do the task. Method #1: Using np.where()"
},
{
"code... |
Firebase - Event Types | Firebase offers several different event types for reading data. Some of the most commonly used ones are described below.
The first event type is value. We showed you how to use value in our last chapter. This event type will be triggered every time the data changes and it will retrieve all the data including children.
... | [
{
"code": null,
"e": 2287,
"s": 2166,
"text": "Firebase offers several different event types for reading data. Some of the most commonly used ones are described below."
},
{
"code": null,
"e": 2486,
"s": 2287,
"text": "The first event type is value. We showed you how to use value... |
Difference Between Identifier and Variable | In this post, we will understand the difference between an identifier and a variable.
All of them are not variables.
All of them are not variables.
They are used to name a variable, a function, a class, a structure, a union.
They are used to name a variable, a function, a class, a structure, a union.
It is created to g... | [
{
"code": null,
"e": 1148,
"s": 1062,
"text": "In this post, we will understand the difference between an identifier and a variable."
},
{
"code": null,
"e": 1179,
"s": 1148,
"text": "All of them are not variables."
},
{
"code": null,
"e": 1210,
"s": 1179,
"te... |
JavaScript String - match() Method | This method is used to retrieve the matches when matching a string against a regular expression.
Use the following syntax to use the match() method.
string.match( param )
param − A regular expression object.
If the regular expression does not include the g flag, it returns the same result as regexp.exec(string).
If th... | [
{
"code": null,
"e": 2563,
"s": 2466,
"text": "This method is used to retrieve the matches when matching a string against a regular expression."
},
{
"code": null,
"e": 2615,
"s": 2563,
"text": "Use the following syntax to use the match() method."
},
{
"code": null,
"... |
What is the difference between Func delegate and Action delegate in C#? | A delegate is a type that represents references to methods with a particular parameter list and return type. When we instantiate a delegate, we can associate its instance with any method with a compatible signature and return type. We can invoke (or call) the method through the delegate instance.
Func is a generic dele... | [
{
"code": null,
"e": 1360,
"s": 1062,
"text": "A delegate is a type that represents references to methods with a particular parameter list and return type. When we instantiate a delegate, we can associate its instance with any method with a compatible signature and return type. We can invoke (or cal... |
PHP | imagecreatefrombmp() Function - GeeksforGeeks | 29 Jan, 2020
The imagecreatefrombmp() function is an inbuilt function in PHP which is used to create a new image from file or URL.
Syntax:
resource imagecreatefrombmp( string $filename )
Parameters: This function accepts a single parameter $filename which holds the name or URL of a file.
Return Value: This function ret... | [
{
"code": null,
"e": 24581,
"s": 24553,
"text": "\n29 Jan, 2020"
},
{
"code": null,
"e": 24699,
"s": 24581,
"text": "The imagecreatefrombmp() function is an inbuilt function in PHP which is used to create a new image from file or URL."
},
{
"code": null,
"e": 24707,
... |
Find Weekday using Zeller's Algorithm | Zeller’s Algorithm is used to find the weekday from a given date. The formula to find weekday using Zeller’s Algorithm is here:
The formula is containing some variables; They are −
d − The day of the date.
m: It is the month code. From March to December it is 3 to 12, for January it is 13, and for February it is 14. Wh... | [
{
"code": null,
"e": 1190,
"s": 1062,
"text": "Zeller’s Algorithm is used to find the weekday from a given date. The formula to find weekday using Zeller’s Algorithm is here:"
},
{
"code": null,
"e": 1243,
"s": 1190,
"text": "The formula is containing some variables; They are −"
... |
Feature Selection Techniques in Machine Learning with Python | by Rahil Shaikh | Towards Data Science | With the new day comes new strength and new thoughts — Eleanor Roosevelt
We all may have faced this problem of identifying the related features from a set of data and removing the irrelevant or less important features with do not contribute much to our target variable in order to achieve better accuracy for our model.
... | [
{
"code": null,
"e": 245,
"s": 172,
"text": "With the new day comes new strength and new thoughts — Eleanor Roosevelt"
},
{
"code": null,
"e": 492,
"s": 245,
"text": "We all may have faced this problem of identifying the related features from a set of data and removing the irrele... |
Python Grouping similar substrings in list | In this tutorial, we are going to write a program that groups similar substrings from a list. Let's see an example to understand it more clearly.
strings = ['tutorials-python', 'tutorials-c', 'tutorials-java', 'tutorials-javascript', 'python-1', 'python-2',
'javascript-1']
[['tutorials-python', 'tutorials-c', 'tutorial... | [
{
"code": null,
"e": 1208,
"s": 1062,
"text": "In this tutorial, we are going to write a program that groups similar substrings from a list. Let's see an example to understand it more clearly."
},
{
"code": null,
"e": 1336,
"s": 1208,
"text": "strings = ['tutorials-python', 'tuto... |
BetaBoosting. XGBoost with a Funky Learning Rate | by Tyler Blume | Towards Data Science | TLDR: Traditionally, Gradient Boosting implementations such as XGBoost have used a static learning rate. We propose using a function whose parameters can be passed to a standard hyperparameter tuning process to learn the ‘optimal’ learning rate shape.
All code lives here: BetaBoost Github
At this point, we all know of ... | [
{
"code": null,
"e": 424,
"s": 172,
"text": "TLDR: Traditionally, Gradient Boosting implementations such as XGBoost have used a static learning rate. We propose using a function whose parameters can be passed to a standard hyperparameter tuning process to learn the ‘optimal’ learning rate shape."
... |
Design Patterns | Set 2 (Factory Method) - GeeksforGeeks | 07 Oct, 2021
Factory method is a creational design pattern, i.e., related to object creation. In Factory pattern, we create objects without exposing the creation logic to the client and the client uses the same common interface to create a new type of object.
The idea is to use a static member-function (static factory... | [
{
"code": null,
"e": 24047,
"s": 24019,
"text": "\n07 Oct, 2021"
},
{
"code": null,
"e": 24295,
"s": 24047,
"text": "Factory method is a creational design pattern, i.e., related to object creation. In Factory pattern, we create objects without exposing the creation logic to the c... |
Calculate the Mean of each Row of an Object in R Programming – rowMeans() Function - GeeksforGeeks | 05 Jun, 2020
rowMeans() function in R Language is used to find out the mean of each row of a data frame, matrix, or array.
Syntax: rowMeans(data)
Parameter:data: data frame, array, or matrix
Example 1
# R program to illustrate # rowMean function # Create example values # Set seedset.seed(1234) # Create example... | [
{
"code": null,
"e": 24992,
"s": 24964,
"text": "\n05 Jun, 2020"
},
{
"code": null,
"e": 25102,
"s": 24992,
"text": "rowMeans() function in R Language is used to find out the mean of each row of a data frame, matrix, or array."
},
{
"code": null,
"e": 25125,
"s": ... |
Bayesian A/B Testing in PyMC3 | by Dr. Robert Kübler | Towards Data Science | From time to time, you have to choose between two options. This might be in completely uninformed situations where you can pick the better option with a mere probability of 50%. In some of these uninformed cases, you can even boost this probability with a simple trick, as demonstrated in my other article.
However, usua... | [
{
"code": null,
"e": 479,
"s": 172,
"text": "From time to time, you have to choose between two options. This might be in completely uninformed situations where you can pick the better option with a mere probability of 50%. In some of these uninformed cases, you can even boost this probability with a... |
Byte Code in Java - GeeksforGeeks | 19 Oct, 2021
Byte Code can be defined as an intermediate code generated by the compiler after the compilation of source code(JAVA Program). This intermediate code makes Java a platform-independent language.
Compiler converts the source code or the Java program into the Byte Code(or machine code), and secondly, the Inte... | [
{
"code": null,
"e": 24090,
"s": 24062,
"text": "\n19 Oct, 2021"
},
{
"code": null,
"e": 24284,
"s": 24090,
"text": "Byte Code can be defined as an intermediate code generated by the compiler after the compilation of source code(JAVA Program). This intermediate code makes Java a ... |
D3.js - Dragging API | Drag and drop is one of the most familiar concept in d3.js. This chapter explains dragging and its methods in detail.
We can directly include dragging API using the following script.
<script src = "https://d3js.org/d3-dispatch.v1.min.js"></script>
<script src = "https://d3js.org/d3-selection.v1.min.js"></script>
<scrip... | [
{
"code": null,
"e": 2248,
"s": 2130,
"text": "Drag and drop is one of the most familiar concept in d3.js. This chapter explains dragging and its methods in detail."
},
{
"code": null,
"e": 2313,
"s": 2248,
"text": "We can directly include dragging API using the following script.... |
How to Convert Decimal to Octal? | Decimal system is most familiar number system to the general public. It is base 10 which has only 10 symbols − 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. Whereas octal system is one of the number systems to represent numbers. It is base 8 which has only 8 symbols − 0, 1, 2, 3, 4, 5, 6, and 7.
There are various direct or indirect... | [
{
"code": null,
"e": 1471,
"s": 1187,
"text": "Decimal system is most familiar number system to the general public. It is base 10 which has only 10 symbols − 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. Whereas octal system is one of the number systems to represent numbers. It is base 8 which has only 8 symbols... |
Class getResource() method in Java with Examples | 27 Dec, 2019
The getResource() method of java.lang.Class class is used to get the resource with the specified resource of this class. The method returns the specified resource of this class in the form of URL object.
Syntax:
public URL getResource(String resourceName)
Parameter: This method accepts a parameter resourc... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Dec, 2019"
},
{
"code": null,
"e": 232,
"s": 28,
"text": "The getResource() method of java.lang.Class class is used to get the resource with the specified resource of this class. The method returns the specified resource of this clas... |
Python – Group keys to values list | 10 May, 2020
Sometimes, while working with Python dictionaries, we can have problem in which we need to find all possible values of all keys in a dictionary. This utility is quite common and can occur in many domains including day-day programming and school programming. Lets discuss certain way in which this task can b... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 May, 2020"
},
{
"code": null,
"e": 348,
"s": 28,
"text": "Sometimes, while working with Python dictionaries, we can have problem in which we need to find all possible values of all keys in a dictionary. This utility is quite common a... |
Python | Numpy np.disp() method | 02 Dec, 2019
With the help of np.disp() method, we can get the string into a display buffer and by using stringIO class we can get the values from buffer by using np.disp() method.
Syntax : np.disp(message, device)Return : Will not return anything without StringIO class.
Example #1 :In this example by using np.disp() m... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Dec, 2019"
},
{
"code": null,
"e": 196,
"s": 28,
"text": "With the help of np.disp() method, we can get the string into a display buffer and by using stringIO class we can get the values from buffer by using np.disp() method."
},
... |
Minimum flips required to form given binary string where every flip changes all bits to its right as well | 13 Feb, 2022
Given a string S, the task is to find minimum flips required to convert an initial binary string consisting of only zeroes to S where every flip of a character flips all succeeding characters as well. Examples:
Input: S = “01011” Output: 3 Explanation: Initial String – “00000” Flip the 2nd bit – “01111” ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n13 Feb, 2022"
},
{
"code": null,
"e": 267,
"s": 54,
"text": "Given a string S, the task is to find minimum flips required to convert an initial binary string consisting of only zeroes to S where every flip of a character flips all succ... |
Pancake sorting | 14 Jun, 2022
Given an unsorted array, the task is to sort the given array. You are allowed to do only following operation on array.
flip(arr, i): Reverse array from 0 to i
Examples:
Input: arr[] = { 23, 10, 20, 11, 12, 6, 7 }Output: { 6, 7, 10, 11, 12, 20, 23}
Input: arr[] = { 0, 1, 1, 0, 0 }Output: { 0, 0, 0, 1, 1 }... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 Jun, 2022"
},
{
"code": null,
"e": 174,
"s": 54,
"text": "Given an unsorted array, the task is to sort the given array. You are allowed to do only following operation on array. "
},
{
"code": null,
"e": 215,
"s": 174... |
Longest subarray with difference exactly K between any two distinct values | 30 Sep, 2021
Given an array arr[] of length N and an integer K, the task is to find the longest subarray with difference between any two distinct values equal to K. Print the length of the longest subarray obtained. Otherwise, if no such subarray is obtained, print -1.
Examples:
Input: arr[] = {0, 0, 1, 1, 3, 3, 3}, K... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Sep, 2021"
},
{
"code": null,
"e": 309,
"s": 52,
"text": "Given an array arr[] of length N and an integer K, the task is to find the longest subarray with difference between any two distinct values equal to K. Print the length of th... |
Difference between big O notations and tilde | 09 Jun, 2021
In asymptotic analysis of algorithms we often encounter terms like Big-Oh, Omega, Theta and Tilde, which describe the performance of an algorithm. You can refer to the following links to get more insights about asymptotic analysis :
Analysis of Algorithms Different NotationsDifference between Big Oh, Big O... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n09 Jun, 2021"
},
{
"code": null,
"e": 286,
"s": 53,
"text": "In asymptotic analysis of algorithms we often encounter terms like Big-Oh, Omega, Theta and Tilde, which describe the performance of an algorithm. You can refer to the follow... |
What is Is-A-Relationship in Java? | 01 Dec, 2021
A relationship in Java means different relations between two or more classes. For example, if a class Bulb inherits another class Device, then we can say that Bulb is having is-a relationship with Device, which implies Bulb is a device.
In Java, we have two types of relationship:
Is-A relationship: Whene... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n01 Dec, 2021"
},
{
"code": null,
"e": 293,
"s": 54,
"text": "A relationship in Java means different relations between two or more classes. For example, if a class Bulb inherits another class Device, then we can say that Bulb is having ... |
JavaScript | Errors – Throw and Try to Catch | 27 Mar, 2019
When executing JavaScript code, errors will most definitely occur. These errors can occur due to the fault from the programmer’s side or the input is wrong or even if there is a problem with the logic of the program. But all errors can be solved and to do so we use five statements that will now be explaine... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n27 Mar, 2019"
},
{
"code": null,
"e": 364,
"s": 54,
"text": "When executing JavaScript code, errors will most definitely occur. These errors can occur due to the fault from the programmer’s side or the input is wrong or even if there i... |
Python | Sessions framework using django | 24 Jun, 2019
Prerequisites: Django Installation | Introduction to Django
Sessions framework can be used to provide persistent behaviour for anonymous users in the website.Sessions are the mechanism used by Django for you store and retrieve data on a per-site-visitor basis.Django uses a cookie containing a special sessi... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Jun, 2019"
},
{
"code": null,
"e": 114,
"s": 54,
"text": "Prerequisites: Django Installation | Introduction to Django"
},
{
"code": null,
"e": 368,
"s": 114,
"text": "Sessions framework can be used to provide per... |
Largest subtree sum for each vertex of given N-ary Tree | 28 Feb, 2022
Given an N-array tree of N nodes, rooted at 1, with edges in the form {u, v}, and an array values[] consisting of N integers. Each vertex i has an integer value denoted by values[i]. The task is to find the largest Subtree Sum possible for each vertex i by adding its value to a non-empty subset of its chil... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n28 Feb, 2022"
},
{
"code": null,
"e": 373,
"s": 54,
"text": "Given an N-array tree of N nodes, rooted at 1, with edges in the form {u, v}, and an array values[] consisting of N integers. Each vertex i has an integer value denoted by va... |
How to convert a class to another class type in C++? | 14 Sep, 2021
Pre-requisite: Type Conversion in C++, Advanced C++ | Conversion OperatorsThrough class conversion, one can assign data that belongs to a particular class type to an object that belongs to another class type. Example: Let there be two classes ‘A’ and ‘B’. If we want to allocate the details that belong to c... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 427,
"s": 52,
"text": "Pre-requisite: Type Conversion in C++, Advanced C++ | Conversion OperatorsThrough class conversion, one can assign data that belongs to a particular class type to an object t... |
Python | Find elements of a list by indices | 18 Apr, 2019
Given two lists with elements and indices, write a Python program to find elements of list 1 at indices present in list 2.
Examples:
Input : lst1 = [10, 20, 30, 40, 50]
lst2 = [0, 2, 4]
Output : [10, 30, 50]
Explanation:
Output elements at indices 0, 2 and 4 i.e 10, 30 and 50 respectively.
Input... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Apr, 2019"
},
{
"code": null,
"e": 151,
"s": 28,
"text": "Given two lists with elements and indices, write a Python program to find elements of list 1 at indices present in list 2."
},
{
"code": null,
"e": 161,
"s": 1... |
Find max and second max salary for a MySQL Employee table? | You can get max and second max salary from an Employee table using LIMIT OFFSET. The syntax is as follows −
SELECT yourColumnName1,yourColumnName2,....N from yourTableName ORDER BY
yourColumnName desc limit 2 offset 0;
To understand the above syntax, let us create a table. The query to create a table is as follows −
my... | [
{
"code": null,
"e": 1295,
"s": 1187,
"text": "You can get max and second max salary from an Employee table using LIMIT OFFSET. The syntax is as follows −"
},
{
"code": null,
"e": 1406,
"s": 1295,
"text": "SELECT yourColumnName1,yourColumnName2,....N from yourTableName ORDER BY\n... |
Python program to convert floating to binary | 15 Jun, 2022
Python doesn’t provide any inbuilt method to easily convert floating point decimal numbers to binary number. So, Let’s do this manually. Approach : To convert a floating point decimal number into binary, first convert the integer part into binary form and then fractional part into binary form and finally c... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Jun, 2022"
},
{
"code": null,
"e": 820,
"s": 28,
"text": "Python doesn’t provide any inbuilt method to easily convert floating point decimal numbers to binary number. So, Let’s do this manually. Approach : To convert a floating point... |
How to read Dictionary from File in Python? | 12 Nov, 2021
A Dictionary in Python is collection of key-value pairs, where key is always unique and oftenly we need to store a dictionary and read it back again.
We can read a dictionary from a file in 3 ways:
Using the json.loads() method : Converts the string of valid dictionary into json form.Using the ast.literal_... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Nov, 2021"
},
{
"code": null,
"e": 178,
"s": 28,
"text": "A Dictionary in Python is collection of key-value pairs, where key is always unique and oftenly we need to store a dictionary and read it back again."
},
{
"code": nul... |
What are the HTML tags used to display the data in the tabular form ? | 31 Oct, 2021
In this article, we will know the HTML tags that can be used to display the data in tabular form. A table is a representation of data in rows and columns, that helps to organize the complex structured data. Tables are widely used in communication, research, and data analysis. For instance, if we need to f... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Oct, 2021"
},
{
"code": null,
"e": 547,
"s": 28,
"text": "In this article, we will know the HTML tags that can be used to display the data in tabular form. A table is a representation of data in rows and columns, that helps to organ... |
Check if count of substrings in S with string S1 as prefix and S2 as suffix is equal to that with S2 as prefix and S1 as suffix | 06 May, 2021
Given three strings S, S1, and S2, the task is to check if the number of substrings that start and end with S1 and S2 is equal to the number of substrings that start and end with S2 and S1 or not. If found to be true, then print “Yes”. Otherwise, print “No”.
Examples:
Input: S = “helloworldworldhelloworld”... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 May, 2021"
},
{
"code": null,
"e": 287,
"s": 28,
"text": "Given three strings S, S1, and S2, the task is to check if the number of substrings that start and end with S1 and S2 is equal to the number of substrings that start and end w... |
How to create a table with fixed header and scrollable body ? - GeeksforGeeks | 25 Mar, 2021
The purpose of this article is to create a table with a fixed header and scrollable body. We can create such a table with either of the two approaches.
By setting the position property to “sticky” and specifying “0” as a value of the top property for the <th> element.By setting the display to “block” for b... | [
{
"code": null,
"e": 31345,
"s": 31317,
"text": "\n25 Mar, 2021"
},
{
"code": null,
"e": 31497,
"s": 31345,
"text": "The purpose of this article is to create a table with a fixed header and scrollable body. We can create such a table with either of the two approaches."
},
{
... |
Espresso Testing Framework - Architecture | In this chapter, let us learn the terms of espresso testing framework, how to write a simple espresso test case and the complete workflow or architecture of the espresso testing framework.
Espresso provides a large number of classes to test user interface and the user interaction of an android application. They can be ... | [
{
"code": null,
"e": 2165,
"s": 1976,
"text": "In this chapter, let us learn the terms of espresso testing framework, how to write a simple espresso test case and the complete workflow or architecture of the espresso testing framework."
},
{
"code": null,
"e": 2346,
"s": 2165,
"t... |
How to create FileFilter for JFileChooser in Java and display File Type accordingly? | To create FileFilter, use the FileNamExtensionFilter class. The following is an example to display File Type in JFileChooser −
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileNameExtensionFilter;
public class SwingDemo {
public static void main(String[] args) {
JFileChooser file = new JFile... | [
{
"code": null,
"e": 1189,
"s": 1062,
"text": "To create FileFilter, use the FileNamExtensionFilter class. The following is an example to display File Type in JFileChooser −"
},
{
"code": null,
"e": 1624,
"s": 1189,
"text": "import javax.swing.JFileChooser;\nimport javax.swing.fi... |
How to get substring between two similar characters in JavaScript? | Let’s say we have the following string with some colons −
var values="This is:the first program in JavaScript:After that I will do Data Structure program";
We need to get the substring between the colon. The output should be −
the first program in JavaScript
For this, use the concept of split().
Following is the code ... | [
{
"code": null,
"e": 1120,
"s": 1062,
"text": "Let’s say we have the following string with some colons −"
},
{
"code": null,
"e": 1218,
"s": 1120,
"text": "var values=\"This is:the first program in JavaScript:After that I will do Data Structure program\";"
},
{
"code": nu... |
Print the longest prefix of the given string which is also the suffix of the same string in C Program. | Given a string in which we have to check that the length of the longest prefix which is also a suffix of the string like there is a string “abcab” so here “ab” is of length 2 and is the longest substring with same prefix and suffix.
Input: str[] = { “aabbccdaabbcc” }
Output: 6
Input: abdab
Output: 2
If we will start th... | [
{
"code": null,
"e": 1295,
"s": 1062,
"text": "Given a string in which we have to check that the length of the longest prefix which is also a suffix of the string like there is a string “abcab” so here “ab” is of length 2 and is the longest substring with same prefix and suffix."
},
{
"code"... |
Java DatabaseMetaData getProcedures() method with example | This method retrieves the description of the stored procedures of a database/catalog. It accepts 3 parameters −
catalog: A string parameter representing the name of the catalog (database in general) in which the procedure exists. Pass "" to get the description of the primary key columns in tables with no catalog and, p... | [
{
"code": null,
"e": 1174,
"s": 1062,
"text": "This method retrieves the description of the stored procedures of a database/catalog. It accepts 3 parameters −"
},
{
"code": null,
"e": 1452,
"s": 1174,
"text": "catalog: A string parameter representing the name of the catalog (data... |
Logical Operators in C++ | The concept of logical operators is simple. They allow a program to make a decision based on multiple conditions. Each operand is considered a condition that can be evaluated to a true or false value. Then the value of the conditions is used to determine the overall value of the op1 operator op2 or !op1 grouping.
The l... | [
{
"code": null,
"e": 1377,
"s": 1062,
"text": "The concept of logical operators is simple. They allow a program to make a decision based on multiple conditions. Each operand is considered a condition that can be evaluated to a true or false value. Then the value of the conditions is used to determin... |
JavaScript - Date getMonth() Method | Javascript date getMonth() method returns the month in the specified date according to local time. The value returned by getMonth() is an integer between 0 and 11. 0 corresponds to January, 1 to February, and so on.
Its syntax is as follows −
Date.getMonth()
Returns the Month in the specified date according to local t... | [
{
"code": null,
"e": 2682,
"s": 2466,
"text": "Javascript date getMonth() method returns the month in the specified date according to local time. The value returned by getMonth() is an integer between 0 and 11. 0 corresponds to January, 1 to February, and so on."
},
{
"code": null,
"e": ... |
What does an auto keyword do in C++? | Auto was a keyword that C++ "inherited" from C that had been there nearly forever, but virtually never used. All this changed with the introduction of auto to do type deduction from the context in C++11. Before C++ 11, each data type needs to be explicitly declared at compile time, limiting the values of an expression ... | [
{
"code": null,
"e": 1530,
"s": 1062,
"text": "Auto was a keyword that C++ \"inherited\" from C that had been there nearly forever, but virtually never used. All this changed with the introduction of auto to do type deduction from the context in C++11. Before C++ 11, each data type needs to be expli... |
How to create your own Custom Object Detector | by Eloy Marín | Towards Data Science | This article aims to help beginners that want to develop their own custom object detector for the first time, guiding them through all the key points to train a successful model.
The example shown will be trained with ImageAI, an open-source Python library which allows you to train a model with a few lines of code.
In ... | [
{
"code": null,
"e": 350,
"s": 171,
"text": "This article aims to help beginners that want to develop their own custom object detector for the first time, guiding them through all the key points to train a successful model."
},
{
"code": null,
"e": 488,
"s": 350,
"text": "The exa... |
How does PowerShell Remoting work? | There are several ways to connect to remote computer cmdlets. These computers can be in the same
domain, different domains, or for the workgroups using PowerShell. Here, we will mainly focus on the
inbuilt parameter, Invoke-Command, and to execute PSSession command remotely.
Many cmdlets in PowerShell supports the -Com... | [
{
"code": null,
"e": 1338,
"s": 1062,
"text": "There are several ways to connect to remote computer cmdlets. These computers can be in the same\ndomain, different domains, or for the workgroups using PowerShell. Here, we will mainly focus on the\ninbuilt parameter, Invoke-Command, and to execute PSS... |
How can I create a stored procedure to update values in a MySQL table? | We can create a stored procedure with IN operator to update values in a MySQL table. To make it understand we are taking an example of a table named ‘student_info’ having the following data −
mysql> Select * from student_info;
+------+---------+------------+------------+
| id | Name | Address | Subject |
+--... | [
{
"code": null,
"e": 1254,
"s": 1062,
"text": "We can create a stored procedure with IN operator to update values in a MySQL table. To make it understand we are taking an example of a table named ‘student_info’ having the following data −"
},
{
"code": null,
"e": 1674,
"s": 1254,
... |
How to detect long press in Android? | This example demonstrates how do I detect long Press in android.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:... | [
{
"code": null,
"e": 1127,
"s": 1062,
"text": "This example demonstrates how do I detect long Press in android."
},
{
"code": null,
"e": 1256,
"s": 1127,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a n... |
C Program for Naive algorithm for Pattern Searching | Pattern matching in C− We have to find if a string is present in another string, as an example, the string "algorithm” is present within the string "naive algorithm". If it is found, then its location (i.e. position it is present at) is displayed. We tend to create a function that receives 2 character arrays and return... | [
{
"code": null,
"e": 1439,
"s": 1062,
"text": "Pattern matching in C− We have to find if a string is present in another string, as an example, the string \"algorithm” is present within the string \"naive algorithm\". If it is found, then its location (i.e. position it is present at) is displayed. We... |
GCDs of given index ranges in an array - GeeksforGeeks | 23 Jan, 2020
Given an array a[0 . . . n-1]. We should be able to efficiently find the GCD from index qs (query start) to qe (query end) where 0 <= qs <= qe <= n-1.
Example :
Input : a[] = {2, 3, 60, 90, 50};
Index Ranges : {1, 3}, {2, 4}, {0, 2}
Output: GCDs of given ranges are 3, 10, 1
Method 1 (Simple)
A... | [
{
"code": null,
"e": 25218,
"s": 25190,
"text": "\n23 Jan, 2020"
},
{
"code": null,
"e": 25369,
"s": 25218,
"text": "Given an array a[0 . . . n-1]. We should be able to efficiently find the GCD from index qs (query start) to qe (query end) where 0 <= qs <= qe <= n-1."
},
{
... |
Asynchronous programming in C# using Async and Await keyword | Asynchronous programming in C# is an efficient approach towards activities blocked or access is delayed. If an activity is blocked like this in a synchronous process, then the complete application waits and it takes more time. The application stops responding. Using the asynchronous approach, the applications continue ... | [
{
"code": null,
"e": 1408,
"s": 1062,
"text": "Asynchronous programming in C# is an efficient approach towards activities blocked or access is delayed. If an activity is blocked like this in a synchronous process, then the complete application waits and it takes more time. The application stops resp... |
How to get hour, minutes and seconds in android using offset time API class? | This example demonstrate about How to get hour, minutes and seconds in android using offset time API class.
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": 1170,
"s": 1062,
"text": "This example demonstrate about How to get hour, minutes and seconds in android using offset time API class."
},
{
"code": null,
"e": 1299,
"s": 1170,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project ... |
The Definitive Way To Sort Arrays In Spark 3.0 | by German Schiavon Matteo | Towards Data Science | Earlier last year(2020) I had the need to sort an array, and I found that there were two functions, very similar in name, but different in functionality.
These are array_sort and sort_array.
Which one to use? At first, I felt confused, Why would there be two functions to do the same?
Well, the difference is that array_... | [
{
"code": null,
"e": 325,
"s": 171,
"text": "Earlier last year(2020) I had the need to sort an array, and I found that there were two functions, very similar in name, but different in functionality."
},
{
"code": null,
"e": 362,
"s": 325,
"text": "These are array_sort and sort_ar... |
How to convert JSON text to JavaScript JSON object? | The JSON parse() method is used for converting a JSON text to a JavaScript object.
Following is the code for converting JSON text to JavaScript JSON object −
Live Demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Docume... | [
{
"code": null,
"e": 1145,
"s": 1062,
"text": "The JSON parse() method is used for converting a JSON text to a JavaScript object."
},
{
"code": null,
"e": 1220,
"s": 1145,
"text": "Following is the code for converting JSON text to JavaScript JSON object −"
},
{
"code": nu... |
Modes of Writing a Perl Code - GeeksforGeeks | 23 May, 2019
Perl is a general purpose, high level interpreted and dynamic programming language. Perl supports both the procedural and Object-Oriented programming. At the beginning level, Perl was developed only for the system management and text handling but in later versions, Perl got the ability to handle regular ex... | [
{
"code": null,
"e": 23679,
"s": 23651,
"text": "\n23 May, 2019"
},
{
"code": null,
"e": 24137,
"s": 23679,
"text": "Perl is a general purpose, high level interpreted and dynamic programming language. Perl supports both the procedural and Object-Oriented programming. At the begin... |
Jasmine JavaScript Testing - toBe vs toEqual | Arrays can be compared in 2 ways −
They refer to the same array object in memory.
They refer to the same array object in memory.
They may refer to different objects but their contents are all equal.
They may refer to different objects but their contents are all equal.
For case 1, jasmine provides the toBe method. This ... | [
{
"code": null,
"e": 1097,
"s": 1062,
"text": "Arrays can be compared in 2 ways −"
},
{
"code": null,
"e": 1144,
"s": 1097,
"text": "They refer to the same array object in memory."
},
{
"code": null,
"e": 1191,
"s": 1144,
"text": "They refer to the same array ... |
Python 3 - Functions | A function is a block of organized, reusable code that is used to perform a single, related action. Functions provide better modularity for your application and a high degree of code reusing.
As you already know, Python gives you many built-in functions like print(), etc. but you can also create your own functions. The... | [
{
"code": null,
"e": 2532,
"s": 2340,
"text": "A function is a block of organized, reusable code that is used to perform a single, related action. Functions provide better modularity for your application and a high degree of code reusing."
},
{
"code": null,
"e": 2708,
"s": 2532,
... |
Geek-onacci Number || | Practice | GeeksforGeeks | Geek created a random series and given a name geek-onacci series. Given four integers A, B, C, N. A, B, C represents the first three numbers of geek-onacci series. Find the Nth number of the series. The nth number of geek-onacci series is a sum of the last three numbers (summation of N-1th, N-2th, and N-3th geek-onacci... | [
{
"code": null,
"e": 628,
"s": 226,
"text": "Geek created a random series and given a name geek-onacci series. Given four integers A, B, C, N. A, B, C represents the first three numbers of geek-onacci series. Find the Nth number of the series. The nth number of geek-onacci series is a sum of the las... |
Convert from String to float in Java | To convert String to float, use the valueOf() method.
Let’s say we have the following string value.
String str = "0.8";
Converting the string to float.
Float floatVal = Float.valueOf(str).floatValue();
The following is the complete example.
Live Demo
public class Demo {
public static void main(String args[]) {
... | [
{
"code": null,
"e": 1116,
"s": 1062,
"text": "To convert String to float, use the valueOf() method."
},
{
"code": null,
"e": 1162,
"s": 1116,
"text": "Let’s say we have the following string value."
},
{
"code": null,
"e": 1182,
"s": 1162,
"text": "String str ... |
Introduction to the Hurst exponent — with code in Python | by Eryk Lewinson | Towards Data Science | In finance, some of the most commonly used trading strategies are based on momentum and mean-reversion. I will try to provide a quick explanation of the two.
In momentum-based strategies, the investors try to capitalize on the continuance of the existing market trend. For example, in the last period of interest, a cert... | [
{
"code": null,
"e": 330,
"s": 172,
"text": "In finance, some of the most commonly used trading strategies are based on momentum and mean-reversion. I will try to provide a quick explanation of the two."
},
{
"code": null,
"e": 864,
"s": 330,
"text": "In momentum-based strategies... |
Count of total anagram substrings - GeeksforGeeks | 29 Apr, 2020
Given a string of lower alphabet characters, count total substring of this string which are anagram to each other.
Examples:
Input : str = “xyyx”
Output : 4
Total substrings of this string which
are anagram to each other are 4 which
can be enumerated as,
{“x”, “x”}, {"y", "y"}, {“xy”, “yx”},
{“xyy”, “yy... | [
{
"code": null,
"e": 24647,
"s": 24619,
"text": "\n29 Apr, 2020"
},
{
"code": null,
"e": 24762,
"s": 24647,
"text": "Given a string of lower alphabet characters, count total substring of this string which are anagram to each other."
},
{
"code": null,
"e": 24772,
... |
Calculate volume and surface area of Torus - GeeksforGeeks | 06 Sep, 2021
This article is about the surface and mathematical concept of a torus. A 3D shape made by revolving a small circle (radius r) along a line made by a bigger circle (radius R).
Torus
Property:
It can be made by revolving a small circle (radius r) along a line made by a bigger circle (radius R).It is not a ... | [
{
"code": null,
"e": 24301,
"s": 24273,
"text": "\n06 Sep, 2021"
},
{
"code": null,
"e": 24478,
"s": 24301,
"text": "This article is about the surface and mathematical concept of a torus. A 3D shape made by revolving a small circle (radius r) along a line made by a bigger circle ... |
Android WebView in Kotlin - GeeksforGeeks | 07 May, 2021
WebView is a view that is used to display web pages inside the app. It is used to turn the app into a web application. In this article let’s display the https://www.geeksforgeeks.org/ inside the Android Application using Kotlin.
Note: To implement Android WebView in Java please refer How to use WebView in ... | [
{
"code": null,
"e": 25812,
"s": 25784,
"text": "\n07 May, 2021"
},
{
"code": null,
"e": 26041,
"s": 25812,
"text": "WebView is a view that is used to display web pages inside the app. It is used to turn the app into a web application. In this article let’s display the https://ww... |
How to get text from each cell of an HTML table using Selenium? | We can get text from each cell of an HTML table with Selenium webdriver.A <table> tag is used to define a table in an html document. A table consists of rows represented by <tr> and columns represented by <td>. The table headers are identified by <th> tag.
Let us consider a table from which we will get text from each c... | [
{
"code": null,
"e": 1319,
"s": 1062,
"text": "We can get text from each cell of an HTML table with Selenium webdriver.A <table> tag is used to define a table in an html document. A table consists of rows represented by <tr> and columns represented by <td>. The table headers are identified by <th> t... |
Minimum sum of absolute difference of pairs of two arrays | 08 Jul, 2022
Given two arrays a[] and b[] of equal length n. The task is to pair each element of array a to an element in array b, such that sum S of absolute differences of all the pairs is minimum.Suppose, two elements a[i] and a[j] (i != j) of a are paired with elements b[p] and b[q] of b respectively, then p should... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n08 Jul, 2022"
},
{
"code": null,
"e": 380,
"s": 53,
"text": "Given two arrays a[] and b[] of equal length n. The task is to pair each element of array a to an element in array b, such that sum S of absolute differences of all the pairs... |
How to Create Todo List in Angular 7 ? | 14 May, 2020
The ToDo app is used to help us to remember some important task. We just add the task and when accomplished, delete them. This to-do list uses various Bootstrap classes that make our web application not only attractive but also responsive.
Approach:
Create a new angular app using following command:ng new m... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 May, 2020"
},
{
"code": null,
"e": 268,
"s": 28,
"text": "The ToDo app is used to help us to remember some important task. We just add the task and when accomplished, delete them. This to-do list uses various Bootstrap classes that m... |
Difference between isset() and array_key_exists() Function in PHP | 09 Oct, 2018
isset() function
The isset() function is an inbuilt function in PHP which checks whether a variable is set and is not NULL. This function also checks if a declared variable, array or array key has null value, if it does, isset() returns false, it returns true in all other possible cases.
Syntax:
bool isset... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Oct, 2018"
},
{
"code": null,
"e": 69,
"s": 52,
"text": "isset() function"
},
{
"code": null,
"e": 341,
"s": 69,
"text": "The isset() function is an inbuilt function in PHP which checks whether a variable is set ... |
PyQt5 QDateEdit – Getting Input Date | 25 May, 2021
In this article we will see how we can get the input date of the QDateEdit. User can set date to the date edit with the help of cursor and the keyboard but sometimes there is a need of setting initial date or date programmatically for showing date in the records, which can be done with the help of setDate ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 May, 2021"
},
{
"code": null,
"e": 409,
"s": 28,
"text": "In this article we will see how we can get the input date of the QDateEdit. User can set date to the date edit with the help of cursor and the keyboard but sometimes there is ... |
Program to make Indian Flag in Python | Step by Step | 07 Nov, 2018
Here, We’ll be making Indian Flag in Python using Spyder tool which is a part of Anaconda interface. It is the beginner’s practice problem for python programmers.
Prerequisite: The only prerequisite for this code is little knowledge of basic python programming. You may install anaconda from here if you don... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n07 Nov, 2018"
},
{
"code": null,
"e": 217,
"s": 54,
"text": "Here, We’ll be making Indian Flag in Python using Spyder tool which is a part of Anaconda interface. It is the beginner’s practice problem for python programmers."
},
{
... |
Collect all coins in minimum number of steps | 26 Apr, 2021
Given many stacks of coins which are arranged adjacently. We need to collect all these coins in the minimum number of steps where in one step we can collect one horizontal line of coins or vertical line of coins and collected coins should be continuous.Examples :
Input : height[] = [2 1 2 5 1]
Each value... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n26 Apr, 2021"
},
{
"code": null,
"e": 318,
"s": 52,
"text": "Given many stacks of coins which are arranged adjacently. We need to collect all these coins in the minimum number of steps where in one step we can collect one horizontal li... |
TextTable module in Python | 11 Oct, 2020
It is a python module, which helps us to print table on terminal. It is one of the basic python modules for reading and writing text tables in ASCII code. It aims to make the interface as similar as possible like csv module in Python. The texttable module supports both fixed-size tables (where column sizes... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Oct, 2020"
},
{
"code": null,
"e": 418,
"s": 28,
"text": "It is a python module, which helps us to print table on terminal. It is one of the basic python modules for reading and writing text tables in ASCII code. It aims to make the ... |
lzma.LZMACompressor() in Python | 26 Mar, 2020
With the help of lzma.LZMACompressor() method, we can get compressor to compress the bytes of string by using lzma.LZMACompressor() method.
Syntax : lzma.LZMACompressor()Return : Return compressed string.
Example #1 :In this example we can see that by using lzma.LZMACompressor() method, we are able to comp... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Mar, 2020"
},
{
"code": null,
"e": 168,
"s": 28,
"text": "With the help of lzma.LZMACompressor() method, we can get compressor to compress the bytes of string by using lzma.LZMACompressor() method."
},
{
"code": null,
"e"... |
Randomized Algorithms | Set 1 (Introduction and Analysis) | 28 Sep, 2020
An algorithm that uses random numbers to decide what to do next anywhere in its logic is called a Randomized Algorithm. For example, in Randomized Quick Sort, we use a random number to pick the next pivot (or we randomly shuffle the array). And in Karger’s algorithm, we randomly pick an edge.
Some rando... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n28 Sep, 2020"
},
{
"code": null,
"e": 349,
"s": 54,
"text": "An algorithm that uses random numbers to decide what to do next anywhere in its logic is called a Randomized Algorithm. For example, in Randomized Quick Sort, we use a random... |
Lexicographically smallest string formed by removing duplicates | 13 Jun, 2022
Given a string S consisting of lowercase alphabets, the task is to find the lexicographically smallest string that can be obtained by removing duplicates from the given string S.
Examples:
Input: S = “yzxyz”Output: xyzExplanation: Removing the duplicate characters at indices 0 and 1 in the given string, th... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 233,
"s": 54,
"text": "Given a string S consisting of lowercase alphabets, the task is to find the lexicographically smallest string that can be obtained by removing duplicates from the given strin... |
Recursive program to generate power set | Difficulty Level :
Medium
Given a set represented as a string, write a recursive code to print all subsets of it. The subsets can be printed in any order.
Examples:
Input : set = "abc"
Output : "", "a", "b", "c", "ab", "ac", "bc", "abc"
Input : set = "abcd"
Output : "" "a" "ab" "abc" "abcd" "abd" "ac" "acd"
... | [
{
"code": null,
"e": 26,
"s": 0,
"text": "Difficulty Level :\nMedium"
},
{
"code": null,
"e": 156,
"s": 26,
"text": "Given a set represented as a string, write a recursive code to print all subsets of it. The subsets can be printed in any order. "
},
{
"code": null,
"... |
Java Program to Calculate Difference Between Two Time Periods | 11 Dec, 2020
In this article, let’s explore the various methods to find the difference between the Two Time Periods in Java. For simplicity, let’s assume that the Time Period provided to us is in the format HH:MM:SS
Example
Input : 1st Time Period :- 18:00:00
2nd Time Period :- 21:00:00
Output: 3 hours 0 minutes an... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Dec, 2020"
},
{
"code": null,
"e": 231,
"s": 28,
"text": "In this article, let’s explore the various methods to find the difference between the Two Time Periods in Java. For simplicity, let’s assume that the Time Period provided to u... |
How to make browser to go back to previous page using JavaScript ? | 30 Sep, 2019
There is two popular way to make browsers go back to the previous page by clicking JavaScript event, both methods are described below:
Method 1: Using history.go() method: The go() method of the window.history object is used to load a page from the session history. It can be used to move forward or backwar... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n30 Sep, 2019"
},
{
"code": null,
"e": 188,
"s": 53,
"text": "There is two popular way to make browsers go back to the previous page by clicking JavaScript event, both methods are described below:"
},
{
"code": null,
"e": 72... |
K Means Clustering using PySpark on Big Data | by Angel Das | Towards Data Science | If you are not familiar with K Means clustering, I recommend going through the article below. This article focuses mostly on data parallelism and clustering, i.e. K Means clustering on Big Data.
towardsdatascience.com
Clustering is an unsupervised learning technique, in short, you are working on data, without having an... | [
{
"code": null,
"e": 367,
"s": 172,
"text": "If you are not familiar with K Means clustering, I recommend going through the article below. This article focuses mostly on data parallelism and clustering, i.e. K Means clustering on Big Data."
},
{
"code": null,
"e": 390,
"s": 367,
... |
Getting started with APIs in Python to Gather Data | by Nik Piepenbreier | Towards Data Science | APIs, or Application Programming Interfaces, provide easy ways to retrieve (and post) data. They are the interfaces provided by servers that you can use to, among others, retrieve and send data using code. In essence, they streamline complex instructions to provide back a request from a server. They can be compared to ... | [
{
"code": null,
"e": 856,
"s": 171,
"text": "APIs, or Application Programming Interfaces, provide easy ways to retrieve (and post) data. They are the interfaces provided by servers that you can use to, among others, retrieve and send data using code. In essence, they streamline complex instructions ... |
Stop worrying about configs with Gin | by Alexander Bailey | Towards Data Science | We’ve all been there, you’re modelling away and one by one the hyper-parameters start adding up. At first, you ignore the problem and tell yourself that you’ll go back later to sort it out but inevitably don’t. There are loads of bad ways to tackle the problem of project configuration they include but are by no means l... | [
{
"code": null,
"e": 503,
"s": 172,
"text": "We’ve all been there, you’re modelling away and one by one the hyper-parameters start adding up. At first, you ignore the problem and tell yourself that you’ll go back later to sort it out but inevitably don’t. There are loads of bad ways to tackle the pr... |
Fast I/O in Java in Competitive Programming - GeeksforGeeks | 14 Apr, 2022
Using Java in competitive programming is not something many people would suggest just because of its slow input and output, and well indeed it is slow.
In this article, we have discussed some ways to get around the difficulty and change the verdict from TLE to (in most cases) AC.
Example:
Input:
7 3
1
51
9... | [
{
"code": null,
"e": 24680,
"s": 24652,
"text": "\n14 Apr, 2022"
},
{
"code": null,
"e": 24832,
"s": 24680,
"text": "Using Java in competitive programming is not something many people would suggest just because of its slow input and output, and well indeed it is slow."
},
{
... |
8086 program to reverse a string - GeeksforGeeks | 17 Dec, 2021
Problem: Given a string we have to reverse the string and print the reversed string. Examples:
Input: String : "This is a sample string"
Output: gnirts elpmas a si sihT
Input: String : "Geeks for Geeks"
Output: skeeG rof skeeG
Explanation:
Create a stringTraverse through the stringPush the characters... | [
{
"code": null,
"e": 24725,
"s": 24697,
"text": "\n17 Dec, 2021"
},
{
"code": null,
"e": 24822,
"s": 24725,
"text": "Problem: Given a string we have to reverse the string and print the reversed string. Examples: "
},
{
"code": null,
"e": 24956,
"s": 24822,
"t... |
Quickly Compare Multiple Models. How to train and evaluate multiple... | by Cole Brendel | Towards Data Science | A question all data scientists must confront when working on any machine learning project is...
Which model architecture is going to best fit my data?
There are several theoretical considerations one should take into account. For example, if your features show strong linear relationships to your dependent variable (tar... | [
{
"code": null,
"e": 268,
"s": 172,
"text": "A question all data scientists must confront when working on any machine learning project is..."
},
{
"code": null,
"e": 323,
"s": 268,
"text": "Which model architecture is going to best fit my data?"
},
{
"code": null,
"e"... |
Python - IMAP | IMAP is an email retrieval protocol which does not download the emails. It just reads them and displays them. This is very useful in low bandwidth condition. Python’s client side library called imaplib is used for accessing emails over imap protocol.
IMAP stands for Internet Mail Access Protocol. It was first proposed ... | [
{
"code": null,
"e": 2577,
"s": 2326,
"text": "IMAP is an email retrieval protocol which does not download the emails. It just reads them and displays them. This is very useful in low bandwidth condition. Python’s client side library called imaplib is used for accessing emails over imap protocol."
... |
Advanced Morse Code Decoder in Python | by Kieran Tan Kah Wang | Towards Data Science | In one of my previous post, I’ve designed a simple Morse Code Decoder in Python which is capable of accepting user inputs and outputting them in their original alphanumerical form. One of the limitations of the decoder is that it does not allow the user to input sentences. Remember that we have chosen to represent each... | [
{
"code": null,
"e": 699,
"s": 172,
"text": "In one of my previous post, I’ve designed a simple Morse Code Decoder in Python which is capable of accepting user inputs and outputting them in their original alphanumerical form. One of the limitations of the decoder is that it does not allow the user t... |
Graham Scan Algorithm | The convex hull is the minimum closed area which can cover all given data points.
Graham’s Scan algorithm will find the corner points of the convex hull. In this algorithm, at first, the lowest point is chosen. That point is the starting point of the convex hull. Remaining n-1 vertices are sorted based on the anti-cloc... | [
{
"code": null,
"e": 1144,
"s": 1062,
"text": "The convex hull is the minimum closed area which can cover all given data points."
},
{
"code": null,
"e": 1549,
"s": 1144,
"text": "Graham’s Scan algorithm will find the corner points of the convex hull. In this algorithm, at first,... |
How to check whether a year or a vector of years is leap year or not in R? | Almost everyone knows that a leap has 366 instead of 365 days and it occurs once in four years. If we want to check whether a particular year is a leap year or in a range of years which years correspond to leap year then we can use leap_year function of leap year. The length function can be used with the year value and... | [
{
"code": null,
"e": 1496,
"s": 1062,
"text": "Almost everyone knows that a leap has 366 instead of 365 days and it occurs once in four years. If we want to check whether a particular year is a leap year or in a range of years which years correspond to leap year then we can use leap_year function of... |
Tryit Editor v3.6 - Show Node.js | var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
//Return the url part of the request object: | [
{
"code": null,
"e": 28,
"s": 0,
"text": "var http = require('http');"
},
{
"code": null,
"e": 30,
"s": 28,
"text": ""
},
{
"code": null,
"e": 70,
"s": 30,
"text": "http.createServer(function (req, res) {"
},
{
"code": null,
"e": 123,
"s": 70,... |
Work with $push in MongoDB | Let us create a collection with documents −
> db.demo738.insertOne({Subjects:["C","C++"]});
{
"acknowledged" : true,
"insertedId" : ObjectId("5ead696557bb72a10bcf0661")
}
> db.demo738.insertOne({Subjects:["MySQL","PL/SQL"]});
{
"acknowledged" : true,
"insertedId" : ObjectId("5ead696657bb72a10bcf0662")
}
Dis... | [
{
"code": null,
"e": 1106,
"s": 1062,
"text": "Let us create a collection with documents −"
},
{
"code": null,
"e": 1379,
"s": 1106,
"text": "> db.demo738.insertOne({Subjects:[\"C\",\"C++\"]});\n{\n \"acknowledged\" : true,\n \"insertedId\" : ObjectId(\"5ead696557bb72a10bcf06... |
How can we set the shortcut key to a JButton in Java? | A JButton is a subclass of AbstractButton and it can be used for adding platform-independent buttons to a Java Swing application. A JButon can generate an ActionListener interface when the button is pressed or clicked, it can also generate the MouseListener and KeyListener interfaces. We can also set the short cut keys... | [
{
"code": null,
"e": 1429,
"s": 1062,
"text": "A JButton is a subclass of AbstractButton and it can be used for adding platform-independent buttons to a Java Swing application. A JButon can generate an ActionListener interface when the button is pressed or clicked, it can also generate the MouseList... |
Tryit Editor v3.7 | CSS Style Images
Tryit: Create rounded image | [
{
"code": null,
"e": 26,
"s": 9,
"text": "CSS Style Images"
}
] |
C++ Arrays | C++ provides a data structure, the array, which stores a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.
Instead of declaring individual variables, such as numbe... | [
{
"code": null,
"e": 2582,
"s": 2318,
"text": "C++ provides a data structure, the array, which stores a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the ... |
How to extract strings that contains a particular substring in an R vector? | Suppose we have a vector that contains multiple string elements and we want to find out which string element has a particular substring. This can be done with the help of grep function. For example, if we have a vector called x that contains five string elements each of varying length then finding which of the elements... | [
{
"code": null,
"e": 1489,
"s": 1062,
"text": "Suppose we have a vector that contains multiple string elements and we want to find out which string element has a particular substring. This can be done with the help of grep function. For example, if we have a vector called x that contains five string... |
How to create a Java HashMap of user defined class type? - GeeksforGeeks | 04 Mar, 2019
Pre-requisite: Internal working of HashMap, HashMapIf we wish to create a HashMap of our own class, we need to ensure that the hashcode() of the key of HashMap doesn’t change as if it happens then it is impossible to get object value of the key from HashMap.
On runtime, JVM processes hash code for each obj... | [
{
"code": null,
"e": 25251,
"s": 25223,
"text": "\n04 Mar, 2019"
},
{
"code": null,
"e": 25510,
"s": 25251,
"text": "Pre-requisite: Internal working of HashMap, HashMapIf we wish to create a HashMap of our own class, we need to ensure that the hashcode() of the key of HashMap doe... |
Divide cuboid into cubes such that sum of volumes is maximum - GeeksforGeeks | 13 Apr, 2021
Given the length, breadth, height of a cuboid. The task is to divide the given cuboid in minimum number of cubes such that size of all cubes is same and sum of volumes of cubes is maximum. Examples:
Input : l = 2, b = 4, h = 6
Output : 2 6
A cuboid of length 2, breadth 4 and
height 6 can be divided into... | [
{
"code": null,
"e": 26275,
"s": 26247,
"text": "\n13 Apr, 2021"
},
{
"code": null,
"e": 26476,
"s": 26275,
"text": "Given the length, breadth, height of a cuboid. The task is to divide the given cuboid in minimum number of cubes such that size of all cubes is same and sum of vol... |
Node.js fs.appendFile() Function - GeeksforGeeks | 08 Oct, 2021
The fs.appendFile() method is used to asynchronously append the given data to a file. A new file is created if it does not exist. The options parameter can be used to modify the behavior of the operation.
Syntax:
fs.appendFile( path, data[, options], callback )
Parameters: This method accepts four paramete... | [
{
"code": null,
"e": 25869,
"s": 25841,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 26074,
"s": 25869,
"text": "The fs.appendFile() method is used to asynchronously append the given data to a file. A new file is created if it does not exist. The options parameter can be used... |
How to annotate a plot in ggplot2 in R ? - GeeksforGeeks | 29 Jun, 2021
In this article, we will discuss how to annotate plots in ggplot2 in R Programming Language.
An annotation can help the readability of a plot. It allows adding text to a plot or highlight a specific portion of the curve. The most common form of annotation is text. Let us first plot a regular plot without ... | [
{
"code": null,
"e": 26487,
"s": 26459,
"text": "\n29 Jun, 2021"
},
{
"code": null,
"e": 26581,
"s": 26487,
"text": "In this article, we will discuss how to annotate plots in ggplot2 in R Programming Language. "
},
{
"code": null,
"e": 26845,
"s": 26581,
"text... |
count_if() in C++ STL - GeeksforGeeks | 31 May, 2021
count_if() function returns the number of elements in a range that satisfy the condition.
Syntax:
template <class InputT, class UnaryPredicate>
typename iterator_traits <InputT> :: difference_type
count_if(InputT first, InputT last, UnaryPredicate p);
Examples:
Input: 0 1 2 3 4 5 6 7 8 9
Output: Tot... | [
{
"code": null,
"e": 25873,
"s": 25845,
"text": "\n31 May, 2021"
},
{
"code": null,
"e": 25963,
"s": 25873,
"text": "count_if() function returns the number of elements in a range that satisfy the condition."
},
{
"code": null,
"e": 25972,
"s": 25963,
"text": "... |
Python | FloatLayout in Kivy using .kv file - GeeksforGeeks | 07 Jul, 2020
Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications.
Kivy Tutorial – Learn Kivy with Examples.
Floatlayout provides us the ... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n07 Jul, 2020"
},
{
"code": null,
"e": 25773,
"s": 25537,
"text": "Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application... |
Python MySQL - Select Query - GeeksforGeeks | 06 Mar, 2020
Python Database API ( Application Program Interface ) is the Database interface for the standard Python. This standard is adhered to by most Python Database interfaces. There are various Database servers supported by Python Database such as MySQL, GadFly, mSQL, PostgreSQL, Microsoft SQL Server 2000, Inform... | [
{
"code": null,
"e": 42651,
"s": 42623,
"text": "\n06 Mar, 2020"
},
{
"code": null,
"e": 43090,
"s": 42651,
"text": "Python Database API ( Application Program Interface ) is the Database interface for the standard Python. This standard is adhered to by most Python Database interf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.