title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Python | Create list of numbers with given range | 20 Nov, 2019
Given two numbers r1 and r2 (which defines the range), write a Python program to create a list with the given range (inclusive).
Examples:
Input : r1 = -1, r2 = 1
Output : [-1, 0, 1]
Input : r1 = 5, r2 = 9
Output : [5, 6, 7, 8, 9]
Let’s discuss a few approaches to do this task.
Approach #1 : Naive Approa... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n20 Nov, 2019"
},
{
"code": null,
"e": 182,
"s": 53,
"text": "Given two numbers r1 and r2 (which defines the range), write a Python program to create a list with the given range (inclusive)."
},
{
"code": null,
"e": 192,
... |
How to Calculate MAPE in Python? | 28 Nov, 2021
In this article, we will see how to compute one of the methods to determine forecast accuracy called the Mean. Absolute Percentage Error (or simply MAPE) also known as Mean Absolute Percentage Deviation (MAPD) in python. The MAPE term determines how better accuracy does our forecast gives. The ‘M’ in MAPE ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Nov, 2021"
},
{
"code": null,
"e": 700,
"s": 28,
"text": "In this article, we will see how to compute one of the methods to determine forecast accuracy called the Mean. Absolute Percentage Error (or simply MAPE) also known as Mean Ab... |
How to Install Go on Windows? | 05 Oct, 2021
Before, we start with the process of Installing Golang on our System. We must have first-hand knowledge of What the Go Language is and what it actually does? Go is an open-source and statically typed programming language developed in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson at Google but launch... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n05 Oct, 2021"
},
{
"code": null,
"e": 577,
"s": 52,
"text": "Before, we start with the process of Installing Golang on our System. We must have first-hand knowledge of What the Go Language is and what it actually does? Go is an open-so... |
Ruby | String chars() Method | 17 Dec, 2019
chars is a String class method in Ruby which is used to return an array of characters in str.
Syntax: str.chars
Parameters: Here, str is the given string
Returns: An array of the characters.
Example 1:
# Ruby program to demonstrate # the chars method # Taking a string and # using the method puts "Ru... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Dec, 2019"
},
{
"code": null,
"e": 122,
"s": 28,
"text": "chars is a String class method in Ruby which is used to return an array of characters in str."
},
{
"code": null,
"e": 140,
"s": 122,
"text": "Syntax: str.... |
Input-output system calls in C | Create, Open, Close, Read, Write | 28 Oct, 2021
Important Terminology
What is the File Descriptor?File descriptor is integer that uniquely identifies an open file of the process.
File Descriptor table: File descriptor table is the collection of integer array indices that are file descriptors in which elements are pointers to file table entries. One uniq... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n28 Oct, 2021"
},
{
"code": null,
"e": 76,
"s": 54,
"text": "Important Terminology"
},
{
"code": null,
"e": 185,
"s": 76,
"text": "What is the File Descriptor?File descriptor is integer that uniquely identifies an op... |
An Introduction to Time Series Analysis with ARIMA | by Taha Binhuraib | Towards Data Science | Time series forecasting focuses on analyzing data changes across equally spaced time intervals. Time series analysis is used in a wide variety of domains, ranging from econometrics to geology and earthquake prediction; it’s also used in almost all applied sciences and engineering. Examples of time series data include S... | [
{
"code": null,
"e": 1054,
"s": 172,
"text": "Time series forecasting focuses on analyzing data changes across equally spaced time intervals. Time series analysis is used in a wide variety of domains, ranging from econometrics to geology and earthquake prediction; it’s also used in almost all applie... |
Geoparsing with Python. Geoparsing refers to the process of... | by Michael Eby | Towards Data Science | Geoparsing refers to the process of extracting place-names from text and matching those names unambiguously with proper nouns and spatial coordinates. These coordinates can then be plotted on a map in order to visualize the spatial footprint of the text in question. Geoparsing is a specific kind of procedure known in g... | [
{
"code": null,
"e": 1100,
"s": 172,
"text": "Geoparsing refers to the process of extracting place-names from text and matching those names unambiguously with proper nouns and spatial coordinates. These coordinates can then be plotted on a map in order to visualize the spatial footprint of the text ... |
Can we sort a list with Lambda in Java? | Yes, we can sort a list with Lambda. Let us first create a String List:
List<String> list = Arrays.asList("LCD","Laptop", "Mobile", "Device", "LED", "Tablet");
Now, sort using Lambda, wherein we will be using compareTo():
Collections.sort(list, (String str1, String str2) -> str2.compareTo(str1));
The following is an ex... | [
{
"code": null,
"e": 1134,
"s": 1062,
"text": "Yes, we can sort a list with Lambda. Let us first create a String List:"
},
{
"code": null,
"e": 1222,
"s": 1134,
"text": "List<String> list = Arrays.asList(\"LCD\",\"Laptop\", \"Mobile\", \"Device\", \"LED\", \"Tablet\");"
},
{
... |
How to add custom adapter for my listView on Android? | This example demonstrates how do I add custom adapter for my listView 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"?>
<Line... | [
{
"code": null,
"e": 1144,
"s": 1062,
"text": "This example demonstrates how do I add custom adapter for my listView in android."
},
{
"code": null,
"e": 1273,
"s": 1144,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required deta... |
Elasticsearch - Installation | In this chapter, we will understand the installation procedure of Elasticsearch in detail.
To install Elasticsearch on your local computer, you will have to follow the steps given below −
Step 1 − Check the version of java installed on your computer. It should be java 7 or higher. You can check by doing the following −... | [
{
"code": null,
"e": 2672,
"s": 2581,
"text": "In this chapter, we will understand the installation procedure of Elasticsearch in detail."
},
{
"code": null,
"e": 2769,
"s": 2672,
"text": "To install Elasticsearch on your local computer, you will have to follow the steps given be... |
What are named parameters in C#? | Named parameters provides us the relaxation to remember or to look up the order of parameters in the parameter lists of called methods. The parameter for each argument can be specified by parameter name.
NamedParameterFunction(firstName: "Hello", lastName: "World")
Using named parameters in C#, we can put any parameter... | [
{
"code": null,
"e": 1266,
"s": 1062,
"text": "Named parameters provides us the relaxation to remember or to look up the order of parameters in the parameter lists of called methods. The parameter for each argument can be specified by parameter name."
},
{
"code": null,
"e": 1328,
"s... |
Augmentation Methods Using Albumentations And PyTorch | by Varun Dutt | Towards Data Science | Ever since the Deep Neural Net's rise to fame in the late 1990s, limited data has been a stumbling block. Lack of data results in overfitting, especially for architectures with a lot of parameters. Luckily, augmentation has turned out to be a revelation for machine learning tasks with limited data. It offers two major ... | [
{
"code": null,
"e": 503,
"s": 171,
"text": "Ever since the Deep Neural Net's rise to fame in the late 1990s, limited data has been a stumbling block. Lack of data results in overfitting, especially for architectures with a lot of parameters. Luckily, augmentation has turned out to be a revelation f... |
Find all combinations that add upto given number using C++ | Suppose we have a positive number n. We have to find all combinations of positive numbers, that adds up to that number. Here we want only combinations, not the permutations. For the value n = 4, there will be [1, 1, 1, 1], [1, 1, 2], [2, 2], [1, 3], [4]
We will solve this using recursion. We have an array to store comb... | [
{
"code": null,
"e": 1316,
"s": 1062,
"text": "Suppose we have a positive number n. We have to find all combinations of positive numbers, that adds up to that number. Here we want only combinations, not the permutations. For the value n = 4, there will be [1, 1, 1, 1], [1, 1, 2], [2, 2], [1, 3], [4]... |
Swift - Generics | Swift 4 language provides 'Generic' features to write flexible and reusable functions and types. Generics are used to avoid duplication and to provide abstraction. Swift 4 standard libraries are built with generics code. Swift 4s 'Arrays' and 'Dictionary' types belong to generic collections. With the help of arrays and... | [
{
"code": null,
"e": 2671,
"s": 2253,
"text": "Swift 4 language provides 'Generic' features to write flexible and reusable functions and types. Generics are used to avoid duplication and to provide abstraction. Swift 4 standard libraries are built with generics code. Swift 4s 'Arrays' and 'Dictionar... |
Convert BST to Max Heap in C++ | In this tutorial, we will be discussing a program to convert a binary search tree to a max heap.
For this we will be provided with a binary search tree. Our task is to convert the given binary search tree into a max heap such that following the condition of the binary search tree when elements are compared with themsel... | [
{
"code": null,
"e": 1159,
"s": 1062,
"text": "In this tutorial, we will be discussing a program to convert a binary search tree to a max heap."
},
{
"code": null,
"e": 1387,
"s": 1159,
"text": "For this we will be provided with a binary search tree. Our task is to convert the gi... |
How to add empty border to JPanel in Java? | To add empty border, use the createEmtyBorder() method. Let us first create a new JLabel −
JLabel label;
label = new JLabel("Label with empty border!");
Now, set empty border using the setBorder() method −
label.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
The following is an example to add empty border... | [
{
"code": null,
"e": 1153,
"s": 1062,
"text": "To add empty border, use the createEmtyBorder() method. Let us first create a new JLabel −"
},
{
"code": null,
"e": 1216,
"s": 1153,
"text": "JLabel label;\n\nlabel = new JLabel(\"Label with empty border!\");"
},
{
"code": nu... |
An Easy Way to Get Started with Databases on Your Own Computer | by Byron Dolon | Towards Data Science | SQL is the third most popular language for developers, based on the StackOverflow 2020 Developer Survey. Everyone knows that you should learn to use SQL, but what about actually creating and managing a database?
While you can follow courses that let you play with SQL on a browser with predefined tables (which is not a ... | [
{
"code": null,
"e": 383,
"s": 171,
"text": "SQL is the third most popular language for developers, based on the StackOverflow 2020 Developer Survey. Everyone knows that you should learn to use SQL, but what about actually creating and managing a database?"
},
{
"code": null,
"e": 608,
... |
Building A Collaborative Filtering Recommender System with TensorFlow | by Susan Li | Towards Data Science | Therefore, collaborative filtering is not a suitable model to deal with cold start problem, in which it cannot draw any inference for users or items about which it has not yet gathered sufficient information.
But once you have relative large user — item interaction data, then collaborative filtering is the most widely ... | [
{
"code": null,
"e": 381,
"s": 172,
"text": "Therefore, collaborative filtering is not a suitable model to deal with cold start problem, in which it cannot draw any inference for users or items about which it has not yet gathered sufficient information."
},
{
"code": null,
"e": 624,
... |
Check if the number formed by the last digits of N numbers is divisible by 10 or not - GeeksforGeeks | 13 Mar, 2022
Given an array arr[] of size N consisting of non-zero positive integers. The task is to determine whether the number that is formed by selecting the last digits of all the numbers is divisible by 10 or not. If the number is divisible by 10, then print Yes otherwise print No.Examples:
Input: arr[] = {12, ... | [
{
"code": null,
"e": 24301,
"s": 24273,
"text": "\n13 Mar, 2022"
},
{
"code": null,
"e": 24588,
"s": 24301,
"text": "Given an array arr[] of size N consisting of non-zero positive integers. The task is to determine whether the number that is formed by selecting the last digits of... |
Batch Script - String Interpolation | String interpolation is a way to construct a new String value from a mix of constants, variables, literals, and expressions by including their values inside a string literal.
In DOS scripting, the string interpolation can be done using the set command and lining up the numeric defined variables or any other literals in... | [
{
"code": null,
"e": 2344,
"s": 2169,
"text": "String interpolation is a way to construct a new String value from a mix of constants, variables, literals, and expressions by including their values inside a string literal."
},
{
"code": null,
"e": 2527,
"s": 2344,
"text": "In DOS ... |
C++ Class Access Modifiers | Data hiding is one of the important features of Object Oriented Programming which allows preventing the functions of a program to access directly the internal representation of a class type. The access restriction to the class members is specified by the labeled public, private, and protected sections within the class ... | [
{
"code": null,
"e": 2718,
"s": 2318,
"text": "Data hiding is one of the important features of Object Oriented Programming which allows preventing the functions of a program to access directly the internal representation of a class type. The access restriction to the class members is specified by th... |
Scala short ==(x: Int): Boolean - GeeksforGeeks | 14 Jan, 2020
Short, a 16-bit signed integer (equivalent to Java’s short primitive type) is a subtype of scala.AnyVal. The ==(x: Int) method is utilized to return true if this value is equal to x, false otherwise.
Method Definition: def ==(x: Int): Boolean
Return Type: It returns true if this value is equal to x, otherw... | [
{
"code": null,
"e": 24212,
"s": 24184,
"text": "\n14 Jan, 2020"
},
{
"code": null,
"e": 24412,
"s": 24212,
"text": "Short, a 16-bit signed integer (equivalent to Java’s short primitive type) is a subtype of scala.AnyVal. The ==(x: Int) method is utilized to return true if this v... |
Quick Semantic Search using Siamese-BERT Networks | by Aneesha Bakharia | Towards Data Science | I’ve been working on a tool that needed to embed semantic search based on BERT. The idea was simple: get BERT encodings for each sentence in the corpus and then use cosine similarity to match to a query (either a word or another short sentence). Depending upon the size of the corpus returning a BERT embedding for each ... | [
{
"code": null,
"e": 1072,
"s": 172,
"text": "I’ve been working on a tool that needed to embed semantic search based on BERT. The idea was simple: get BERT encodings for each sentence in the corpus and then use cosine similarity to match to a query (either a word or another short sentence). Dependin... |
What are the member variables of a class in C#? | A class is a blueprint that has member variables and functions in C#. This describes the behavior of an object.
Let us see the syntax of a class to learn what are member variables −
<access specifier> class class_name {
// member variables
<access specifier> <data type> variable1;
<access specifier> <data type... | [
{
"code": null,
"e": 1174,
"s": 1062,
"text": "A class is a blueprint that has member variables and functions in C#. This describes the behavior of an object."
},
{
"code": null,
"e": 1244,
"s": 1174,
"text": "Let us see the syntax of a class to learn what are member variables −"... |
Learning Rate Schedules and Adaptive Learning Rate Methods for Deep Learning | by Suki Lau | Towards Data Science | When training deep neural networks, it is often useful to reduce learning rate as the training progresses. This can be done by using pre-defined learning rate schedules or adaptive learning rate methods. In this article, I train a convolutional neural network on CIFAR-10 using differing learning rate schedules and adap... | [
{
"code": null,
"e": 556,
"s": 172,
"text": "When training deep neural networks, it is often useful to reduce learning rate as the training progresses. This can be done by using pre-defined learning rate schedules or adaptive learning rate methods. In this article, I train a convolutional neural net... |
C++ Library - <ostream> | It is an output stream objects can write sequences of characters and represent other kinds of data. Specific members are provided to perform these output operations.
Below is definition of std::ostream.
typedef basic_ostream<char> ostream;
charT − Character type.
charT − Character type.
traits − Character traits class ... | [
{
"code": null,
"e": 2769,
"s": 2603,
"text": "It is an output stream objects can write sequences of characters and represent other kinds of data. Specific members are provided to perform these output operations."
},
{
"code": null,
"e": 2806,
"s": 2769,
"text": "Below is definit... |
Mastering Random Sampling in Python | by Sadrach Pierre, Ph.D. | Towards Data Science | Python provides many useful tools for random sampling as well as functions for generating random numbers. Random sampling has applications in statistics where often times a random subset of a population is observed and used to make inferences about the overall population. Further, random number generation has many appl... | [
{
"code": null,
"e": 741,
"s": 171,
"text": "Python provides many useful tools for random sampling as well as functions for generating random numbers. Random sampling has applications in statistics where often times a random subset of a population is observed and used to make inferences about the ov... |
How to check a key exists in JavaScript object? - GeeksforGeeks | 26 Jul, 2021
There are mainly two methods to check the existence of a key in JavaScript Object. The first one is using “in operator” and the second one is using “hasOwnProperty() method”.
Method 1: Using ‘in’ operator: The in operator returns a boolean value if the specified property is in the object.
Syntax:
propertyN... | [
{
"code": null,
"e": 24722,
"s": 24694,
"text": "\n26 Jul, 2021"
},
{
"code": null,
"e": 24897,
"s": 24722,
"text": "There are mainly two methods to check the existence of a key in JavaScript Object. The first one is using “in operator” and the second one is using “hasOwnProperty... |
How to merge table columns in HTML? | To merge table columns in HTML use the colspan attribute in <td> tag. With this, merge cells with each other. For example, if your table is having 4 rows and 4 columns, then with colspan attribute, you can easily merge 2 or even 3 of the table cells.
You can try to run the following code to merge table column in HTML. ... | [
{
"code": null,
"e": 1313,
"s": 1062,
"text": "To merge table columns in HTML use the colspan attribute in <td> tag. With this, merge cells with each other. For example, if your table is having 4 rows and 4 columns, then with colspan attribute, you can easily merge 2 or even 3 of the table cells."
... |
Linear Regression using Gradient Descent | by Adarsh Menon | Towards Data Science | In this tutorial you can learn how the gradient descent algorithm works and implement it from scratch in python. First we look at what linear regression is, then we define the loss function. We learn how the gradient descent algorithm works and finally we will implement it on a given data set and make predictions.
This... | [
{
"code": null,
"e": 363,
"s": 47,
"text": "In this tutorial you can learn how the gradient descent algorithm works and implement it from scratch in python. First we look at what linear regression is, then we define the loss function. We learn how the gradient descent algorithm works and finally we ... |
How to deploy web applications using Nginx on Remote server (Ubuntu based) - Set 2 - GeeksforGeeks | 01 Aug, 2021
In the last article, we got the idea about Nginx and how we can leverage its benefits, further we installed it on our device or remote server. In this article, we will see how to deploy a web application stored in the remote server using Nginx.
We need to follow the given steps in order to deploy web appl... | [
{
"code": null,
"e": 24916,
"s": 24888,
"text": "\n01 Aug, 2021"
},
{
"code": null,
"e": 25162,
"s": 24916,
"text": "In the last article, we got the idea about Nginx and how we can leverage its benefits, further we installed it on our device or remote server. In this article, we... |
AbstractMap put() Method in Java with Examples - GeeksforGeeks | 26 Oct, 2018
The AbstractMap.put() method of AbstractMap is used to insert a mapping into a map. This means we can insert a specific key and the value it is mapping to, into a particular map. If an existing key is passed, then the previous value gets replaced by the new value. If a new pair is passed, then the pair get... | [
{
"code": null,
"e": 23948,
"s": 23920,
"text": "\n26 Oct, 2018"
},
{
"code": null,
"e": 24278,
"s": 23948,
"text": "The AbstractMap.put() method of AbstractMap is used to insert a mapping into a map. This means we can insert a specific key and the value it is mapping to, into a ... |
HTML DOM getElementsByTagName() method | The HTML DOM getElementsByTagName() method is used for getting the collection of all the elements in the document having a given tag name. It returns all the given elements as a NodeList object. You can access any element in the returned object using the index number.
The HTMLcollection returned stays sync with the DOM... | [
{
"code": null,
"e": 1331,
"s": 1062,
"text": "The HTML DOM getElementsByTagName() method is used for getting the collection of all the elements in the document having a given tag name. It returns all the given elements as a NodeList object. You can access any element in the returned object using th... |
Prototyping a Recommender System Step by Step Part 1: KNN Item-Based Collaborative Filtering | by Kevin Liao | Towards Data Science | Part 2 of recommender systems can be found here
Most internet products we use today are powered by recommender systems. Youtube, Netflix, Amazon, Pinterest, and long list of other internet products all rely on recommender systems to filter millions of contents and make personalized recommendations to their users. Recom... | [
{
"code": null,
"e": 95,
"s": 47,
"text": "Part 2 of recommender systems can be found here"
},
{
"code": null,
"e": 677,
"s": 95,
"text": "Most internet products we use today are powered by recommender systems. Youtube, Netflix, Amazon, Pinterest, and long list of other internet ... |
What is the Mutex class in C#? | The Mutex class in C# is a synchronization primitive that can also be used for interprocess synchronization.
Let us see how to create a new Mutex.
private static Mutex m = new Mutex();
Let us now see how to initialize a new instance of the Mutex class with a Boolean value.
private static Mutex m = new Mutex(true);
Now ... | [
{
"code": null,
"e": 1171,
"s": 1062,
"text": "The Mutex class in C# is a synchronization primitive that can also be used for interprocess synchronization."
},
{
"code": null,
"e": 1209,
"s": 1171,
"text": "Let us see how to create a new Mutex."
},
{
"code": null,
"e"... |
Matrix Computation With NumPy | Towards Data Science | Performance is really an important aspect when we are solving problems using Machine Learning, especially Deep Learning. Using a neural network for calculating things can become a complex calculation because it involves matrix and vectors to it.
Suppose we want to calculate a 25 x 25 matrix that is being multiplied by ... | [
{
"code": null,
"e": 418,
"s": 172,
"text": "Performance is really an important aspect when we are solving problems using Machine Learning, especially Deep Learning. Using a neural network for calculating things can become a complex calculation because it involves matrix and vectors to it."
},
{... |
Xamarin - Permissions | In Android, by default, no application has permissions to perform any operations that would have an effect on the user or the operating system. In order for an App to perform a task, it must declare the permissions. The App cannot perform the task until the permission are granted by the Android system. This mechanism o... | [
{
"code": null,
"e": 2369,
"s": 1964,
"text": "In Android, by default, no application has permissions to perform any operations that would have an effect on the user or the operating system. In order for an App to perform a task, it must declare the permissions. The App cannot perform the task until... |
C# Program to Print the Current Assembly Name Using GetExecutingAssembly() Method - GeeksforGeeks | 16 Nov, 2021
In C#, GetExecutingAssembly() method is the method of Assembly class. This method returns the assembly that contains the code that is currently executing. To use this method we have to use System.Reflection in our program.
Syntax:
public static System.Reflection.Assembly GetExecutingAssembly ();
It will re... | [
{
"code": null,
"e": 23935,
"s": 23907,
"text": "\n16 Nov, 2021"
},
{
"code": null,
"e": 24158,
"s": 23935,
"text": "In C#, GetExecutingAssembly() method is the method of Assembly class. This method returns the assembly that contains the code that is currently executing. To use t... |
WebGL - Rotation | In this chapter, we will take an example to demonstrate how to rotate a triangle using WebGL.
The following program shows how to rotate a triangle using WebGL.
<!doctype html>
<html>
<body>
<canvas width = "400" height = "400" id = "my_Canvas"></canvas>
<script>
/*=================Creating a ca... | [
{
"code": null,
"e": 2141,
"s": 2047,
"text": "In this chapter, we will take an example to demonstrate how to rotate a triangle using WebGL."
},
{
"code": null,
"e": 2207,
"s": 2141,
"text": "The following program shows how to rotate a triangle using WebGL."
},
{
"code": ... |
How to declare Java array with array size dynamically? | To declare array size dynamically read the required integer value from the user using Scanner class and create an array using the given value:
import java.util.Arrays;
import java.util.Scanner;
public class PopulatingAnArray {
public static void main(String args[]) {
System.out.println("Enter the required siz... | [
{
"code": null,
"e": 1205,
"s": 1062,
"text": "To declare array size dynamically read the required integer value from the user using Scanner class and create an array using the given value:"
},
{
"code": null,
"e": 1759,
"s": 1205,
"text": "import java.util.Arrays;\nimport java.u... |
How to input multiple values from user in one line in Python? | To read multiple variables in language C, we write something like −
//Read three variable in one line
scanf(“%d %d %d”, &x, &y, &z)
Currently python does not have an equivalent to scanf(). However, python provides regular expressions which are more powerful and verbose than scanf() format strings. In Python, to provide... | [
{
"code": null,
"e": 1130,
"s": 1062,
"text": "To read multiple variables in language C, we write something like −"
},
{
"code": null,
"e": 1194,
"s": 1130,
"text": "//Read three variable in one line\nscanf(“%d %d %d”, &x, &y, &z)"
},
{
"code": null,
"e": 1423,
"s... |
A step-by-step introduction to Cohort Analysis in Python | by Eryk Lewinson | Towards Data Science | Cohort Analysis is a very useful and relatively simple technique that helps in getting valuable insights about the behavior of any business’ customers/users. For the analysis, we can focus on different metrics (dependent on the business model) — conversion, retention, generated revenue, etc.
In this article, I provide ... | [
{
"code": null,
"e": 465,
"s": 172,
"text": "Cohort Analysis is a very useful and relatively simple technique that helps in getting valuable insights about the behavior of any business’ customers/users. For the analysis, we can focus on different metrics (dependent on the business model) — conversio... |
Count occurrences of a substring recursively in Java | Given two strings str_1 and str_2. The goal is to count the number of occurrences of substring str2 in string str1 using a recursive process.
A recursive function is the one which has its own call inside it’s definition.
If str1 is “I know that you know that i know” str2=”know”
Count of occurences is − 3
Let us underst... | [
{
"code": null,
"e": 1204,
"s": 1062,
"text": "Given two strings str_1 and str_2. The goal is to count the number of occurrences of substring str2 in string str1 using a recursive process."
},
{
"code": null,
"e": 1283,
"s": 1204,
"text": "A recursive function is the one which ha... |
Pull to Refresh with RecyclerView in Android with Example - GeeksforGeeks | 01 Oct, 2021
The SwipeRefreshLayout widget is used for implementing a swipe-to-refresh user interface design pattern. Where the user uses the vertical swipe gesture to refresh the content of the views. The vertical swipe is detected by the SwipeRefreshLayout widget and it displays a distinct progress bar and triggers t... | [
{
"code": null,
"e": 25038,
"s": 25010,
"text": "\n01 Oct, 2021"
},
{
"code": null,
"e": 25975,
"s": 25038,
"text": "The SwipeRefreshLayout widget is used for implementing a swipe-to-refresh user interface design pattern. Where the user uses the vertical swipe gesture to refresh ... |
D3.js selection.merge() Function - GeeksforGeeks | 23 Aug, 2020
The selection.merge() function in d3.js is used to merge the two given selections into one and return the new selection after merging them. The selection which is returned has the same number of groups and the same parents as this selection.
Syntax:
selection.merge(other);
Parameters: This function accepts... | [
{
"code": null,
"e": 25220,
"s": 25192,
"text": "\n23 Aug, 2020"
},
{
"code": null,
"e": 25462,
"s": 25220,
"text": "The selection.merge() function in d3.js is used to merge the two given selections into one and return the new selection after merging them. The selection which is ... |
Comprehensions in Python | We can create new sequences using a given python sequence. This is called comprehension. It basically a way of writing a concise code block to generate a sequence which can be a list, dictionary, set or a generator by using another sequence. It may involve multiple steps of conversion between different types of sequenc... | [
{
"code": null,
"e": 1386,
"s": 1062,
"text": "We can create new sequences using a given python sequence. This is called comprehension. It basically a way of writing a concise code block to generate a sequence which can be a list, dictionary, set or a generator by using another sequence. It may invo... |
TypeScript Arrays - GeeksforGeeks | 11 Jun, 2021
An array is a user-defined data type. An array is a homogeneous collection of similar types of elements that have a contiguous memory location and which can store multiple values of different data types.An array is a type of data structure that stores the elements of similar data type and consider it as an... | [
{
"code": null,
"e": 24073,
"s": 24045,
"text": "\n11 Jun, 2021"
},
{
"code": null,
"e": 24680,
"s": 24073,
"text": "An array is a user-defined data type. An array is a homogeneous collection of similar types of elements that have a contiguous memory location and which can store ... |
Image Stitching Using OpenCV. As you know, the Google photos app has... | by Vagdevi Kommineni | Towards Data Science | As you know, the Google photos app has stunning automatic features like video making, panorama stitching, collage making, sorting out pic based on the presence of the person in the photo, and many more. I always wondered how come all these are possible. But one day, I felt extremely cool about making panorama stitching... | [
{
"code": null,
"e": 504,
"s": 172,
"text": "As you know, the Google photos app has stunning automatic features like video making, panorama stitching, collage making, sorting out pic based on the presence of the person in the photo, and many more. I always wondered how come all these are possible. B... |
How to get max(id) of row data in MySQL? | To get max(id), use MAX() method in MySQL. Following is the syntax −
select MAX(yourColumnName) AS anyAliasName from yourTableName;
Let us first create a table −
mysql> create table DemoTable710 (Id int);
Query OK, 0 rows affected (0.53 sec)
Insert some records in the table using insert command −
mysql> insert into Dem... | [
{
"code": null,
"e": 1131,
"s": 1062,
"text": "To get max(id), use MAX() method in MySQL. Following is the syntax −"
},
{
"code": null,
"e": 1194,
"s": 1131,
"text": "select MAX(yourColumnName) AS anyAliasName from yourTableName;"
},
{
"code": null,
"e": 1224,
"s"... |
Different ways to traverse an Array in Java? | In general, arrays are the containers that store multiple variables of the same datatype. These are of fixed size and the size is determined at the time of creation. Each element in an array is positioned by a number starting from 0.
You can access the elements of an array using name and position as −
System.out.printl... | [
{
"code": null,
"e": 1296,
"s": 1062,
"text": "In general, arrays are the containers that store multiple variables of the same datatype. These are of fixed size and the size is determined at the time of creation. Each element in an array is positioned by a number starting from 0."
},
{
"code... |
Java Examples - Getting connected to Server | How to get connected with web server ?
Following example demonstrates how to get connected with web server by using sock.getInetAddress() method of net.Socket class.
import java.net.InetAddress;
import java.net.Socket;
public class WebPing {
public static void main(String[] args) {
try {
InetAddress ... | [
{
"code": null,
"e": 2107,
"s": 2068,
"text": "How to get connected with web server ?"
},
{
"code": null,
"e": 2234,
"s": 2107,
"text": "Following example demonstrates how to get connected with web server by using sock.getInetAddress() method of net.Socket class."
},
{
"c... |
Compare popular AutoML frameworks on 10 tabular Kaggle competitions | by Piotr Płoński | Towards Data Science | Have you ever lost your evening juggling different many Machine Learning algorithms and packages, switching hyperparameters values and trying different preprocessing methods? Building a good Machine Learning pipeline requires a lot of try-and-error work. Thus, it’s very time-consuming and can be exhausting.
The Automat... | [
{
"code": null,
"e": 481,
"s": 172,
"text": "Have you ever lost your evening juggling different many Machine Learning algorithms and packages, switching hyperparameters values and trying different preprocessing methods? Building a good Machine Learning pipeline requires a lot of try-and-error work. ... |
Machine Learning Model Regularization in Practice: an example with Keras and TensorFlow 2.0 | by B. Chen | Towards Data Science | In this article, we will focus on incorporating regularization into our machine learning model and look at an example of how we do this in practice with Keras and TensorFlow 2.0.
Turns out many people are afraid of Maths, especially beginners and people changing career paths to data science.
Let’s avoid Maths and try t... | [
{
"code": null,
"e": 350,
"s": 171,
"text": "In this article, we will focus on incorporating regularization into our machine learning model and look at an example of how we do this in practice with Keras and TensorFlow 2.0."
},
{
"code": null,
"e": 464,
"s": 350,
"text": "Turns o... |
Dart Programming - Loops | At times, certain instructions require repeated execution. Loops are an ideal way to do the same. A loop represents a set of instructions that must be repeated. In a loop’s context, a repetition is termed as an iteration.
The following figure illustrates the classification of loops −
Let’s start the discussion with Def... | [
{
"code": null,
"e": 2747,
"s": 2525,
"text": "At times, certain instructions require repeated execution. Loops are an ideal way to do the same. A loop represents a set of instructions that must be repeated. In a loop’s context, a repetition is termed as an iteration."
},
{
"code": null,
... |
Java.util.concurrent.Phaser class in Java with Examples | 19 Feb, 2021
Phaser’s primary purpose is to enable synchronization of threads that represent one or more phases of activity. It lets us define a synchronization object that waits until a specific phase has been completed. It then advances to the next phase until that phase concludes. It can also be used to synchronize ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Feb, 2021"
},
{
"code": null,
"e": 430,
"s": 52,
"text": "Phaser’s primary purpose is to enable synchronization of threads that represent one or more phases of activity. It lets us define a synchronization object that waits until a ... |
How to Set the X and the Y Limit in Matplotlib with Python? | 02 Dec, 2020
Prerequisites : Matplotlib
In this article, we will learn how to set the X limit and Y limit in matplotlib with Python. Before that some concepts need to be familiarized with:
Python : Python is a high-level, general-purpose and a very popular programming language. It is being used in web development, Mach... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Dec, 2020"
},
{
"code": null,
"e": 55,
"s": 28,
"text": "Prerequisites : Matplotlib"
},
{
"code": null,
"e": 204,
"s": 55,
"text": "In this article, we will learn how to set the X limit and Y limit in matplotlib w... |
Operators in Dart | 08 Mar, 2022
The operators are special symbols that are used to carry out certain operations on the operands. The Dart has numerous built-in operators which can be used to carry out different functions, for example, ‘+’ is used to add two operands. Operators are meant to carry operations on one or two operands.
The fo... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n08 Mar, 2022"
},
{
"code": null,
"e": 354,
"s": 53,
"text": "The operators are special symbols that are used to carry out certain operations on the operands. The Dart has numerous built-in operators which can be used to carry out diffe... |
How to Add All Items From a Collection to an ArrayList in Java? | 18 Nov, 2021
Given a Collection with some values, the task is to add all the items of this Collection to an ArrayList in Java.
Illustrations:
Input: Collection = [1, 2, 3]
Output: ArrayList = [1, 2, 3]
Input: Collection = [GFG, Geek, GeeksForGeeks]
Output: ArrayList = [GFG, Geek, GeeksForGeeks]
Approach:
Get the Co... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Nov, 2021"
},
{
"code": null,
"e": 142,
"s": 28,
"text": "Given a Collection with some values, the task is to add all the items of this Collection to an ArrayList in Java."
},
{
"code": null,
"e": 158,
"s": 142,
"... |
Create MySQL Tables | To begin with, the table creation command requires the following details −
Name of the table
Name of the fields
Definitions for each field
Here is a generic SQL syntax to create a MySQL table −
CREATE TABLE table_name (column_name column_type);
Now, we will create the following table in the TUTORIALS database.
create ... | [
{
"code": null,
"e": 2516,
"s": 2441,
"text": "To begin with, the table creation command requires the following details −"
},
{
"code": null,
"e": 2534,
"s": 2516,
"text": "Name of the table"
},
{
"code": null,
"e": 2553,
"s": 2534,
"text": "Name of the fields... |
How to play a notification sound on websites? | 05 Jun, 2020
There are various ways to play a notification sound on a website. IN this article we will play the notification sound in three different ways:
Using Onclick Event in JavaScript
Using Audio class in Javascript
Using pure Jquery:
Below all the procedures are explained in details with the exxampl code:
Using ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Jun, 2020"
},
{
"code": null,
"e": 171,
"s": 28,
"text": "There are various ways to play a notification sound on a website. IN this article we will play the notification sound in three different ways:"
},
{
"code": null,
... |
PHP | shell_exec() vs exec() Function | 31 Jul, 2021
shell_exec() Function
The shell_exec() function is an inbuilt function in PHP which is used to execute the commands via shell and return the complete output as a string. The shell_exec is an alias for the backtick operator, for those used to *nix. If the command fails return NULL and the values are not rel... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Jul, 2021"
},
{
"code": null,
"e": 50,
"s": 28,
"text": "shell_exec() Function"
},
{
"code": null,
"e": 361,
"s": 50,
"text": "The shell_exec() function is an inbuilt function in PHP which is used to execute the c... |
How to find all elements in a given array except for the first one using JavaScript ? | 18 Aug, 2021
In this article, we will learn how to find all elements in a given array except for the first one.
Method 1: Using for loopIn this method, we will use a for loop to grab all the elements except first. We know that in an array the first element is present at index ‘0’. We will run a loop from 1 to array.len... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n18 Aug, 2021"
},
{
"code": null,
"e": 153,
"s": 54,
"text": "In this article, we will learn how to find all elements in a given array except for the first one."
},
{
"code": null,
"e": 419,
"s": 153,
"text": "Method... |
Latent Dirichlet Allocation | 06 Jun, 2021
Topic modeling is a way of abstract modeling to discover the abstract ‘topics’ that occur in the collections of documents. The idea is that we will perform unsupervised classification on different documents, which find some natural groups in topics. We can answer the following question using topic modeling... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Jun, 2021"
},
{
"code": null,
"e": 337,
"s": 28,
"text": "Topic modeling is a way of abstract modeling to discover the abstract ‘topics’ that occur in the collections of documents. The idea is that we will perform unsupervised classi... |
Difference between mysqli_fetch_array() & mysqli_fetch_object() in PHP | 28 Apr, 2022
In this article, we will see the mysqli_fetch_array() & mysqli_fetch_object() function in PHP. The mysqli_fetch_object() function returns objects from the database, whereas mysqli_fetch_array() function delivers an array of results. This will allow field names to be used to access the data.
mysqli_fetch_o... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Apr, 2022"
},
{
"code": null,
"e": 321,
"s": 28,
"text": "In this article, we will see the mysqli_fetch_array() & mysqli_fetch_object() function in PHP. The mysqli_fetch_object() function returns objects from the database, whereas m... |
Python PIL | getcolors() Method | 02 Aug, 2019
PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The Image module provides a class with the same name which is used to represent a PIL image. The module also provides a number of factory functions, including functions to load images from files, and to... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n02 Aug, 2019"
},
{
"code": null,
"e": 380,
"s": 53,
"text": "PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The Image module provides a class with the same name which is used to... |
How to Create Image Hovered Detail using HTML & CSS ? | 12 May, 2021
In this article, we will learn how to create a type of hover effect over an image to get its complete detail. This is can be achieved by using simple HTML & CSS.
Overview Of Our Project:
Approach:
We will first create an HTML file in which we are going to add an image for our image hanger.
We will then cre... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 May, 2021"
},
{
"code": null,
"e": 190,
"s": 28,
"text": "In this article, we will learn how to create a type of hover effect over an image to get its complete detail. This is can be achieved by using simple HTML & CSS."
},
{
... |
Expression Evaluation | 21 Jun, 2022
Evaluate an expression represented by a String. The expression can contain parentheses, you can assume parentheses are well-matched. For simplicity, you can assume only binary operations allowed are +, -, *, and /. Arithmetic Expressions can be written in one of three forms:
Infix Notation: Operators are w... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 330,
"s": 54,
"text": "Evaluate an expression represented by a String. The expression can contain parentheses, you can assume parentheses are well-matched. For simplicity, you can assume only binar... |
Query Optimization in Relational Algebra | 04 Jul, 2022
Query: A query is a request for information from a database.
Query Plans: A query plan (or query execution plan) is an ordered set of steps used to access data in a SQL relational database management system.
Query Optimization: A single query can be executed through different algorithms or re-written in ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n04 Jul, 2022"
},
{
"code": null,
"e": 116,
"s": 54,
"text": "Query: A query is a request for information from a database. "
},
{
"code": null,
"e": 264,
"s": 116,
"text": "Query Plans: A query plan (or query executi... |
SQL Query to Remove Decimal Values | 23 Sep, 2021
Decimal values are those values that have “float” as a datatype.
There are various methods to remove decimal values in SQL:
Using ROUND() function: This function in SQL Server is used to round off a specified number to a specified decimal places
Using FLOOR() function: It returns the largest integer value ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Sep, 2021"
},
{
"code": null,
"e": 93,
"s": 28,
"text": "Decimal values are those values that have “float” as a datatype."
},
{
"code": null,
"e": 152,
"s": 93,
"text": "There are various methods to remove decimal... |
How to Fix: NameError name ‘pd’ is not defined | 28 Nov, 2021
In this article we will discuss how to fix NameError pd is not defined in Python.
When we imported pandas module without alias and used pd in the code, the error comes up.
Example: Code to depict error
Python3
# import pandas moduleimport pandas # create dataframedata = pd.DataFrame({'a': [1, 2], 'b': [3,... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Nov, 2021"
},
{
"code": null,
"e": 110,
"s": 28,
"text": "In this article we will discuss how to fix NameError pd is not defined in Python."
},
{
"code": null,
"e": 200,
"s": 110,
"text": "When we imported pandas ... |
How to Find Size of an Array in C/C++ Without Using sizeof() Operator? | 23 May, 2022
In C++, we use sizeof() operator to find the size of desired data type, variables, and constants. It is a compile-time execution operator. We can find the size of an array using the sizeof() operator as shown:
// Finds size of arr[] and stores in 'size'
int size = sizeof(arr)/sizeof(arr[0]);
Can we do the ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 May, 2022"
},
{
"code": null,
"e": 262,
"s": 52,
"text": "In C++, we use sizeof() operator to find the size of desired data type, variables, and constants. It is a compile-time execution operator. We can find the size of an array us... |
numpy.ndarray.itemsize() method | Python | 26 Mar, 2020
numpy.ndarray.itemsize() function return the length of one array element in bytes.
Syntax : numpy.ndarray.itemsize(arr)
Parameters :arr : [array_like] Input array.
Return : [int] The length of one array element in bytes
Code #1 :
# Python program explaining# numpy.ndarray.itemsize() function # importing n... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Mar, 2020"
},
{
"code": null,
"e": 111,
"s": 28,
"text": "numpy.ndarray.itemsize() function return the length of one array element in bytes."
},
{
"code": null,
"e": 148,
"s": 111,
"text": "Syntax : numpy.ndarray.... |
GATE | GATE-CS-2015 (Set 1) | Question 20 - GeeksforGeeks | 28 Jun, 2021
Which of the following is/are correct inorder traversal sequence(s) of binary search tree(s)?
1. 3, 5, 7, 8, 15, 19, 25
2. 5, 8, 9, 12, 10, 15, 25
3. 2, 7, 10, 8, 14, 16, 20
4. 4, 6, 7, 9, 18, 20, 25
(A) 1 and 4 only(B) 2 and 3 only(C) 2 and 4 only(D) 2 onlyAnswer: (A)Explanation: An Inorder traversal of ... | [
{
"code": null,
"e": 25695,
"s": 25667,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 25789,
"s": 25695,
"text": "Which of the following is/are correct inorder traversal sequence(s) of binary search tree(s)?"
},
{
"code": null,
"e": 25896,
"s": 25789,
"text... |
Higher Order Functions in Python - GeeksforGeeks | 30 Jan, 2020
A function is called Higher Order Function if it contains other functions as a parameter or returns a function as an output i.e, the functions that operate with another function are known as Higher order Functions. It is worth knowing that this higher order function is applicable for functions and methods ... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n30 Jan, 2020"
},
{
"code": null,
"e": 25983,
"s": 25537,
"text": "A function is called Higher Order Function if it contains other functions as a parameter or returns a function as an output i.e, the functions that operate with an... |
How to get median of an array of numbers in JavaScript ? - GeeksforGeeks | 22 Apr, 2021
In this article, we will see how to find the median of an array using JavaScript.
Examples:
Input arr1 : [1 4 7 9]
Output : 5.5
Explanation : The median of the two sorted array is
the middle elements which is 5 if the
arrayLength =arr1.length + arr2.length is odd
... | [
{
"code": null,
"e": 39215,
"s": 39187,
"text": "\n22 Apr, 2021"
},
{
"code": null,
"e": 39297,
"s": 39215,
"text": "In this article, we will see how to find the median of an array using JavaScript."
},
{
"code": null,
"e": 39307,
"s": 39297,
"text": "Examples... |
COVID-19 Data Visualization using matplotlib in Python - GeeksforGeeks | 14 Feb, 2022
It feels surreal to imagine how the virus began to spread from one person that is patient zero to four million today. It was possible because of the transport system. Earlier back in the days, we didn’t have a fraction of the transportation system we have today.
Well, what good practices you can follow for... | [
{
"code": null,
"e": 31572,
"s": 31544,
"text": "\n14 Feb, 2022"
},
{
"code": null,
"e": 31835,
"s": 31572,
"text": "It feels surreal to imagine how the virus began to spread from one person that is patient zero to four million today. It was possible because of the transport syst... |
Basics of Docker Networking - GeeksforGeeks | 31 Oct, 2020
Docker Networking allows you to create a Network of Docker Containers managed by a master node called the manager. Containers inside the Docker Network can talk to each other by sharing packets of information. In this article, we will discuss some basic commands that would help you get started with Docker ... | [
{
"code": null,
"e": 25493,
"s": 25465,
"text": "\n31 Oct, 2020"
},
{
"code": null,
"e": 25812,
"s": 25493,
"text": "Docker Networking allows you to create a Network of Docker Containers managed by a master node called the manager. Containers inside the Docker Network can talk to... |
How to create Hex color generator using HTML CSS and JavaScript ? - GeeksforGeeks | 03 Feb, 2021
Hex color is a six-digit code representing the amount of red, green, and blue that makes up the color. Hex color generator gives the hex code of selected color.
Approach:
To select a color, we will use <input type=”color”> which creates a color picker.Get the value returned by color picker.(Color picker re... | [
{
"code": null,
"e": 26621,
"s": 26593,
"text": "\n03 Feb, 2021"
},
{
"code": null,
"e": 26782,
"s": 26621,
"text": "Hex color is a six-digit code representing the amount of red, green, and blue that makes up the color. Hex color generator gives the hex code of selected color."
... |
Get Enumeration Over Java ArrayList - GeeksforGeeks | 13 Jan, 2021
ArrayList class is a re-sizeable array that is present in java.util package. Unlike the built-in arrays, ArrayList can change their size dynamically where elements can be added and removed from an ArrayList.
In java version 1, enum was not present. With advancement to version, 1.5 enum was introduced in j... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n13 Jan, 2021"
},
{
"code": null,
"e": 25434,
"s": 25225,
"text": "ArrayList class is a re-sizeable array that is present in java.util package. Unlike the built-in arrays, ArrayList can change their size dynamically where elements... |
Check if alphabetical order sum of given strings are equal or not - GeeksforGeeks | 06 Jan, 2022
Given two strings s1 and s2, the task is to check if the alphabetical order sum of characters of two given strings are equal or notExamples:
Input: s1= “geek”, s2=”abcdefg”Output: TrueExplanation: Alphabetical order sum of characters of both the strings are:
s1= 7+5+5+11 = 28
s2= 1+2+3+4+5+6+7 = 28
Input... | [
{
"code": null,
"e": 25464,
"s": 25436,
"text": "\n06 Jan, 2022"
},
{
"code": null,
"e": 25605,
"s": 25464,
"text": "Given two strings s1 and s2, the task is to check if the alphabetical order sum of characters of two given strings are equal or notExamples:"
},
{
"code": ... |
How to Remove All Directories and Files in Golang? - GeeksforGeeks | 23 Mar, 2020
In Go language, you are allowed to remove all the directories and files from a directory or folder with the help of RemoveAll() function. This function removes all the directories and files from the path you will pass to this function. It will remove everything from the specified path, but returns the firs... | [
{
"code": null,
"e": 25466,
"s": 25438,
"text": "\n23 Mar, 2020"
},
{
"code": null,
"e": 26053,
"s": 25466,
"text": "In Go language, you are allowed to remove all the directories and files from a directory or folder with the help of RemoveAll() function. This function removes all... |
Sapient Interview Experience - GeeksforGeeks | 31 Oct, 2019
Sapient was hiring for Java Developer/Microservice. The best part is that they provide pick up and drop service.
Round 1 Telephonic Round: MCQs based questions by HR on Core Java
Round 2 Case Study Round: A problem statement will be given and we have to make a microservice API using our tech stack in 120 m... | [
{
"code": null,
"e": 26369,
"s": 26341,
"text": "\n31 Oct, 2019"
},
{
"code": null,
"e": 26482,
"s": 26369,
"text": "Sapient was hiring for Java Developer/Microservice. The best part is that they provide pick up and drop service."
},
{
"code": null,
"e": 26548,
"s... |
How to pass/access node.js variable to an html file/template ? - GeeksforGeeks | 07 Apr, 2021
The following approach covers how to pass/access node.js variable to an HTML file/template. We will build a basic Node.js application that will let you show dynamic content on an HTML page, i.e. your name and age. For adding the name and age values to our HTML template, we’ll be using the pug package.
Pug... | [
{
"code": null,
"e": 26267,
"s": 26239,
"text": "\n07 Apr, 2021"
},
{
"code": null,
"e": 26571,
"s": 26267,
"text": "The following approach covers how to pass/access node.js variable to an HTML file/template. We will build a basic Node.js application that will let you show dynami... |
Java Swing | JWindow with examples - GeeksforGeeks | 06 Jun, 2018
JWindow is a part of Java Swing and it can appear on any part of the users desktop. It is different from JFrame in the respect that JWindow does not have a title bar or window management buttons like minimize, maximize, and close, which JFrame has. JWindow can contain several components such as buttons and... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n06 Jun, 2018"
},
{
"code": null,
"e": 25570,
"s": 25225,
"text": "JWindow is a part of Java Swing and it can appear on any part of the users desktop. It is different from JFrame in the respect that JWindow does not have a title b... |
Find the number of pairs (a, b) such that a % b = K - GeeksforGeeks | 25 May, 2021
Given two integers N and K where N, K > 0, the task is to find the total number of pairs (a, b) where 1 ≤ a, b ≤ N such that a % b = K.Examples:
Input: N = 4, K = 2 Output: 2 Only valid pairs are (2, 3) and (2, 4).Input: N = 11, K = 5 Output: 7
Naive approach: Run two loop from 1 to n and count all t... | [
{
"code": null,
"e": 25941,
"s": 25913,
"text": "\n25 May, 2021"
},
{
"code": null,
"e": 26088,
"s": 25941,
"text": "Given two integers N and K where N, K > 0, the task is to find the total number of pairs (a, b) where 1 ≤ a, b ≤ N such that a % b = K.Examples: "
},
{
"c... |
Longest subarray in which absolute difference between any two element is not greater than X | 30 Jun, 2022
Given an integer array arr[] of size N and an integer X, the task is to find the longest sub-array where the absolute difference between any two elements is not greater than X. Examples:
Input: arr = { 8, 4, 2, 6, 7 }, X = 4 Output: 4 2 6 Explanation: The sub-array described by index [1, 3], i.e, { 4, 2,... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Jun, 2022"
},
{
"code": null,
"e": 241,
"s": 52,
"text": "Given an integer array arr[] of size N and an integer X, the task is to find the longest sub-array where the absolute difference between any two elements is not greater than ... |
Draw a line on an image using OpenCV | In this program, we will draw a simple line on an image using the OpenCV function line().
Step 1: Import cv2.
Step 2: Read the image using imread().
Step 3: Get the dimensions of the image using the image.shape method.
Step 4: Define starting point of the line.
Step 5: Define the end point of the line.
Step 6: Define t... | [
{
"code": null,
"e": 1152,
"s": 1062,
"text": "In this program, we will draw a simple line on an image using the OpenCV function line()."
},
{
"code": null,
"e": 1501,
"s": 1152,
"text": "Step 1: Import cv2.\nStep 2: Read the image using imread().\nStep 3: Get the dimensions of t... |
Maximum sum subsequence of any size which is decreasing-increasing alternatively - GeeksforGeeks | 11 Jan, 2022
Given an array of integers arr[], find the subsequence with maximum sum whose elements are first decreasing, then increasing, or vice versa, The subsequence can start anywhere in the main sequence, not necessarily at the first element of the main sequence.
A sequence {x1, x2, .. xn} is an alternating seque... | [
{
"code": null,
"e": 24820,
"s": 24792,
"text": "\n11 Jan, 2022"
},
{
"code": null,
"e": 25077,
"s": 24820,
"text": "Given an array of integers arr[], find the subsequence with maximum sum whose elements are first decreasing, then increasing, or vice versa, The subsequence can st... |
Visualizing intermediate activation in Convolutional Neural Networks with Keras | by Gabriel Pierobon | Towards Data Science | In this article we’re going to train a simple Convolutional Neural Network using Keras with Python for a classification task. For that we will use a very small and simple set of images consisting of 100 pictures of circle drawings, 100 pictures of squares and 100 pictures of triangles which I found here in Kaggle. Thes... | [
{
"code": null,
"e": 468,
"s": 46,
"text": "In this article we’re going to train a simple Convolutional Neural Network using Keras with Python for a classification task. For that we will use a very small and simple set of images consisting of 100 pictures of circle drawings, 100 pictures of squares ... |
How To Encode And Decode A Message using Python? - GeeksforGeeks | 01 Oct, 2020
Encryption is the process of converting a normal message (plain text) into a meaningless message (Ciphertext). Whereas, Decryption is the process of converting a meaningless message (Cipher text) into its original form (Plain text). In this article, we will take forward the idea of encryption and decryptio... | [
{
"code": null,
"e": 24316,
"s": 24288,
"text": "\n01 Oct, 2020"
},
{
"code": null,
"e": 24653,
"s": 24316,
"text": "Encryption is the process of converting a normal message (plain text) into a meaningless message (Ciphertext). Whereas, Decryption is the process of converting a m... |
Using User-Defined Variables in MySQL | Let us understand what user variables are and how they can be used in MySQL. We will also see the rules −
User variables are written as @var_name. Here, the ‘var_name’ refers to variable name, which consists of alphanumeric characters, ., _, and $.
User variables are written as @var_name. Here, the ‘var_name’ refers to... | [
{
"code": null,
"e": 1168,
"s": 1062,
"text": "Let us understand what user variables are and how they can be used in MySQL. We will also see the rules −"
},
{
"code": null,
"e": 1311,
"s": 1168,
"text": "User variables are written as @var_name. Here, the ‘var_name’ refers to vari... |
TypeScript String - GeeksforGeeks | 11 Jul, 2019
In TypeScript, the string is sequence of char values and also considered as an object. It is a type of primitive data type that is used to store text data. The string values are used between single quotation marks or double quotation marks, and also array of characters works same as a string. TypeScript st... | [
{
"code": null,
"e": 23971,
"s": 23943,
"text": "\n11 Jul, 2019"
},
{
"code": null,
"e": 24318,
"s": 23971,
"text": "In TypeScript, the string is sequence of char values and also considered as an object. It is a type of primitive data type that is used to store text data. The str... |
How to listen volume buttons in Android background service? | This example demonstrates how do I listen volume buttons in android background service.
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"?>... | [
{
"code": null,
"e": 1150,
"s": 1062,
"text": "This example demonstrates how do I listen volume buttons in android background service."
},
{
"code": null,
"e": 1279,
"s": 1150,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all require... |
Difference between datetime and datetime-local in HTML5 | A date and time (year, month, day, hour, minute, second, fractions of a second) encoded according to ISO 8601 with the time zone set to UTC.
Let us see an example:
<!DOCTYPE HTML>
<html>
<body>
<form action = "/cgi-bin/html5.cgi" method = "get">
Date and Time : <input type = "datetime" name = "newinpu... | [
{
"code": null,
"e": 1203,
"s": 1062,
"text": "A date and time (year, month, day, hour, minute, second, fractions of a second) encoded according to ISO 8601 with the time zone set to UTC."
},
{
"code": null,
"e": 1226,
"s": 1203,
"text": "Let us see an example:"
},
{
"cod... |
How to check if a file already exists in R ? - GeeksforGeeks | 08 May, 2021
In this article, we will discuss how to check if a file already exists or not using R Programming Languague.
Directory in use:
The function file.exists() returns a logical vector indicating whether the file mentioned in the function existing or not.
Note: Make sure that to provide a file path for those, n... | [
{
"code": null,
"e": 25162,
"s": 25134,
"text": "\n08 May, 2021"
},
{
"code": null,
"e": 25271,
"s": 25162,
"text": "In this article, we will discuss how to check if a file already exists or not using R Programming Languague."
},
{
"code": null,
"e": 25289,
"s": 2... |
Predecessor and Successor | Practice | GeeksforGeeks | There is BST given with root node with key part as integer only. You need to find the inorder successor and predecessor of a given key. In case, if the either of predecessor or successor is not found print -1.
Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases foll... | [
{
"code": null,
"e": 448,
"s": 238,
"text": "There is BST given with root node with key part as integer only. You need to find the inorder successor and predecessor of a given key. In case, if the either of predecessor or successor is not found print -1."
},
{
"code": null,
"e": 706,
... |
An Overview of Methods to Address the Multiple Comparison Problem | by Paulina Zheng | Towards Data Science | As data scientists, we are uniquely positioned to assess relationships between variables within a larger context and ultimately, tell stories with statistics.
In short, we use hypothesis testing to prove some hypothesis about our data.
This is a fairly straightforward process until we want to test a set of hypotheses s... | [
{
"code": null,
"e": 330,
"s": 171,
"text": "As data scientists, we are uniquely positioned to assess relationships between variables within a larger context and ultimately, tell stories with statistics."
},
{
"code": null,
"e": 407,
"s": 330,
"text": "In short, we use hypothesis... |
EasyGUI – Text Box - GeeksforGeeks | 14 Mar, 2022
Text Box : It is used to show and get the text to/from the user, text can be edited using any keyboard input, it takes input in form of string. It displays the title, message to be displayed, place to alter the given text and a pair of “Ok”, “Cancel” button which is used confirm the text. It is similar to ... | [
{
"code": null,
"e": 24397,
"s": 24369,
"text": "\n14 Mar, 2022"
},
{
"code": null,
"e": 24816,
"s": 24397,
"text": "Text Box : It is used to show and get the text to/from the user, text can be edited using any keyboard input, it takes input in form of string. It displays the tit... |
LISP - CLOS | Common LISP predated the advance of object-oriented programming by couple of decades. However, it object-orientation was incorporated into it at a later stage.
The defclass macro allows creating user-defined classes. It establishes a class as a data type. It has the following syntax −
(defclass class-name (superclass-n... | [
{
"code": null,
"e": 2220,
"s": 2060,
"text": "Common LISP predated the advance of object-oriented programming by couple of decades. However, it object-orientation was incorporated into it at a later stage."
},
{
"code": null,
"e": 2346,
"s": 2220,
"text": "The defclass macro all... |
How to merge rows in MySQL? | To merge rows in MySQL, use GROUP_CONCAT().
Let us first create a table−
mysql> create table DemoTable734 (
Id int,
Name varchar(100)
);
Query OK, 0 rows affected (0.73 sec)
Insert some records in the table using insert command−
mysql> insert into DemoTable734 values(101,'John');
Query OK, 1 row affected (0.23 se... | [
{
"code": null,
"e": 1106,
"s": 1062,
"text": "To merge rows in MySQL, use GROUP_CONCAT()."
},
{
"code": null,
"e": 1135,
"s": 1106,
"text": "Let us first create a table−"
},
{
"code": null,
"e": 1242,
"s": 1135,
"text": "mysql> create table DemoTable734 (\n ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.