title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
“Hello World” Smart Contract in Remix-IDE | 11 May, 2020
Smart contracts are self-executing contracts. The term was coined by Nick in 1994. Smart contracts are very different from traditional software programs. They are immutable once deployed on the blockchain. It was because of Ethereum the term smart contract became so popular and used in the Ethereum blockch... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n11 May, 2020"
},
{
"code": null,
"e": 801,
"s": 53,
"text": "Smart contracts are self-executing contracts. The term was coined by Nick in 1994. Smart contracts are very different from traditional software programs. They are immutable o... |
Node.js Moment Module | 08 Oct, 2021
The moment module is used for parsing, validating, manipulating, and displaying dates and times in JavaScript.
Feature of moment module:
It is easy to get started and easy to use.It is widely used and popular for formatting date and time.
It is easy to get started and easy to use.
It is widely used and pop... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 165,
"s": 54,
"text": "The moment module is used for parsing, validating, manipulating, and displaying dates and times in JavaScript."
},
{
"code": null,
"e": 191,
"s": 165,
"te... |
How to measure time with high-precision in Python? | To measure time with high precision, either use time.clock() or time.time() functions. The python docs state that this function should be used for benchmarking purposes.
import time
t0= time.clock()
print("Hello")
t1 = time.clock() - t0
print("Time elapsed: ", t1 - t0) # CPU seconds elapsed (floating point)
This will g... | [
{
"code": null,
"e": 1357,
"s": 1187,
"text": "To measure time with high precision, either use time.clock() or time.time() functions. The python docs state that this function should be used for benchmarking purposes."
},
{
"code": null,
"e": 1496,
"s": 1357,
"text": "import time\... |
cmp Command in Linux with examples | 25 May, 2022
cmp command in Linux/UNIX is used to compare the two files byte by byte and helps you to find out whether the two files are identical or not.
When cmp is used for comparison between two files, it reports the location of the first mismatch to the screen if difference is found and if no difference is found i... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n25 May, 2022"
},
{
"code": null,
"e": 194,
"s": 52,
"text": "cmp command in Linux/UNIX is used to compare the two files byte by byte and helps you to find out whether the two files are identical or not."
},
{
"code": null,
... |
Find points at a given distance on a line of given slope | 17 Jun, 2022
Given the co-ordinates of a 2-dimensional point p(x0, y0). Find the points at a distance L away from it, such that the line formed by joining these points has a slope of M.
Examples:
Input : p = (2, 1)
L = sqrt(2)
M = 1
Output :3, 2
1, 0
Explanation:
The two points are sqrt(2) dist... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n17 Jun, 2022"
},
{
"code": null,
"e": 225,
"s": 52,
"text": "Given the co-ordinates of a 2-dimensional point p(x0, y0). Find the points at a distance L away from it, such that the line formed by joining these points has a slope of M."
... |
Sorting of Vector of Tuple in C++ (Ascending Order) | 04 Jun, 2018
What is Vector of Tuple?A tuple is an object that can hold a number of elements and a vector containing multiple number of such tuple is called a vector of tuple. The elements can be of different data types. The elements of tuples are initialized as arguments in order in which they will be accessed.
// C++... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n04 Jun, 2018"
},
{
"code": null,
"e": 354,
"s": 53,
"text": "What is Vector of Tuple?A tuple is an object that can hold a number of elements and a vector containing multiple number of such tuple is called a vector of tuple. The element... |
What is Anonymous FTP (File Transfer Protocol)? | 24 Nov, 2021
AFTP (Anonymous File Transfer Protocol) is a network protocol used for transmitting files using TCP-based networks. Anonymous file transfer protocol lets a user move files anonymously from one computer to another.
Anonymous FTP operates at layer 7; anonymous FTP permits anonymous external computer users wi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 242,
"s": 28,
"text": "AFTP (Anonymous File Transfer Protocol) is a network protocol used for transmitting files using TCP-based networks. Anonymous file transfer protocol lets a user move files ano... |
Write one line functions for strcat() and strcmp() | 31 Jul, 2018
Recursion can be used to do both tasks in one line. Below are one line implementations for stracat() and strcmp().
/* my_strcat(dest, src) copies data of src to dest. To do so, it first reaches end of the string dest using recursive calls my_strcat(++dest, src). Once end of dest is reached, data is copie... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n31 Jul, 2018"
},
{
"code": null,
"e": 167,
"s": 52,
"text": "Recursion can be used to do both tasks in one line. Below are one line implementations for stracat() and strcmp()."
},
{
"code": "/* my_strcat(dest, src) copies data ... |
Program to split two strings to make palindrome using Python | Suppose we have two strings a and b whose length are same. We have to select an index and split both strings at that selected index, splitting a into two strings: a_pref and a_suff where a = a_pref | a_suff, and splitting b into two strings: b_pref | b_suff (| is concatenation operator) where b = b_pref + b_suff. Check... | [
{
"code": null,
"e": 1608,
"s": 1187,
"text": "Suppose we have two strings a and b whose length are same. We have to select an index and split both strings at that selected index, splitting a into two strings: a_pref and a_suff where a = a_pref | a_suff, and splitting b into two strings: b_pref | b_... |
Prime Factorization using Sieve O(log n) for multiple queries | 31 May, 2022
We can calculate the prime factorization of a number “n” in O(sqrt(n)) as discussed here. But O(sqrt n) method times out when we need to answer multiple queries regarding prime factorization.In this article, we study an efficient method to calculate the prime factorization using O(n) space and O(log n) tim... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n31 May, 2022"
},
{
"code": null,
"e": 404,
"s": 54,
"text": "We can calculate the prime factorization of a number “n” in O(sqrt(n)) as discussed here. But O(sqrt n) method times out when we need to answer multiple queries regarding pri... |
Thread functions in C/C++ | In this tutorial, we will be discussing a program to understand thread functions in C/C++.
Thread functions allow users to implement concurrent functions at the same time, which can either be dependent on each other for execution or independent.
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
void* func(voi... | [
{
"code": null,
"e": 1278,
"s": 1187,
"text": "In this tutorial, we will be discussing a program to understand thread functions in C/C++."
},
{
"code": null,
"e": 1433,
"s": 1278,
"text": "Thread functions allow users to implement concurrent functions at the same time, which can ... |
Pure Virtual Functions and Abstract Classes in C++ | A pure virtual function is a virtual function in C++ for which we need not to write any function definition and only we have to declare it. It is declared by assigning 0 in the declaration.
An abstract class is a class in C++ which have at least one pure virtual function.
Abstract class can have normal functions and va... | [
{
"code": null,
"e": 1377,
"s": 1187,
"text": "A pure virtual function is a virtual function in C++ for which we need not to write any function definition and only we have to declare it. It is declared by assigning 0 in the declaration."
},
{
"code": null,
"e": 1460,
"s": 1377,
"... |
Ruby | Numeric round() function | 06 Jan, 2020
The round() is an inbuilt method in Ruby returns a number rounded to a number nearest to the given number with a precision of the given number of digits after the decimal point. In case the number of digits is not given, the default value is taken to be zero.
Syntax: num.round(ndigits)
Parameters: The func... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Jan, 2020"
},
{
"code": null,
"e": 312,
"s": 52,
"text": "The round() is an inbuilt method in Ruby returns a number rounded to a number nearest to the given number with a precision of the given number of digits after the decimal poi... |
Recursion in Java | 30 May, 2022
What is Recursion? The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called as recursive function. Using recursive algorithm, certain problems can be solved quite easily. Examples of such problems are Towers of Hanoi (TOH), Inorder/Pre... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 May, 2022"
},
{
"code": null,
"e": 598,
"s": 52,
"text": "What is Recursion? The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called as recursive function. Usi... |
Extract and Add FLAC Audio Metadata using the mutagen module in Python - GeeksforGeeks | 01 Nov, 2020
Audio metadata is information embedded into audio files to identify and label audio files. Metadata includes information like artist, genre, album and track number. This information is very essential for making music players and other related applications. Streaming platforms also use metadata to categoriz... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n01 Nov, 2020"
},
{
"code": null,
"e": 24666,
"s": 24292,
"text": "Audio metadata is information embedded into audio files to identify and label audio files. Metadata includes information like artist, genre, album and track number... |
How to convert DOS/Windows newline (CRLF) to Unix newline (LF) in a Bash script? | When we transfer files between Windows and Unix systems, often we come across with issue relating to the end of line character. This is because the EOL character in windows is not recognized as a EOL character in Unix. SO to fix this issue when a file is transferred from Windows to Unix we need to follow one of the bel... | [
{
"code": null,
"e": 1394,
"s": 1062,
"text": "When we transfer files between Windows and Unix systems, often we come across with issue relating to the end of line character. This is because the EOL character in windows is not recognized as a EOL character in Unix. SO to fix this issue when a file i... |
How can we create a login form in Java?
| We can develop a login form in Java using Java Swing technology. In this example, we can create two labels username and password, two text fields for the user to enter valid credentials and finally one submit button. Once the user is able to enter the valid credentials in the two text fields, we can able to see Hello a... | [
{
"code": null,
"e": 1406,
"s": 1062,
"text": "We can develop a login form in Java using Java Swing technology. In this example, we can create two labels username and password, two text fields for the user to enter valid credentials and finally one submit button. Once the user is able to enter the v... |
Python 3 - List max() Method | The max() method returns the elements from the list with maximum value.
Following is the syntax for max() method −
max(list)
list − This is a list from which max valued element to be returned.
This method returns the elements from the list with maximum value.
The following example shows the usage of max() method.
#!/u... | [
{
"code": null,
"e": 2412,
"s": 2340,
"text": "The max() method returns the elements from the list with maximum value."
},
{
"code": null,
"e": 2455,
"s": 2412,
"text": "Following is the syntax for max() method −"
},
{
"code": null,
"e": 2466,
"s": 2455,
"text... |
Generate Piano Instrumental Music by Using Deep Learning | by Haryo Akbarianto Wibowo | Towards Data Science | Hello everyone! Finally, I can write again on my Medium and have free time to do some experiments on Artificial Intelligence (AI). This time, I am going to write and share about how to generate music notes by using Deep Learning. Unlike my previous article about generating lyrics, this time we will generate the notes o... | [
{
"code": null,
"e": 550,
"s": 172,
"text": "Hello everyone! Finally, I can write again on my Medium and have free time to do some experiments on Artificial Intelligence (AI). This time, I am going to write and share about how to generate music notes by using Deep Learning. Unlike my previous articl... |
Adding a new column to existing DataFrame in Pandas in Python | In this tutorial, we are going to learn how to add a new column to the existing DataFrame in pandas. We can have different methods to add a new column. Let's all of them.
We can add a new column using the list. Follow the steps to add a new column.
1. Create DataFrame using a dictionary.
2. Create a list containing new... | [
{
"code": null,
"e": 1233,
"s": 1062,
"text": "In this tutorial, we are going to learn how to add a new column to the existing DataFrame in pandas. We can have different methods to add a new column. Let's all of them."
},
{
"code": null,
"e": 1311,
"s": 1233,
"text": "We can add ... |
ReactJS componentDidCatch method | In this article, we are going to see how to execute a function in the commit phase if some error occurs in the Component.
This method is called when a component or any children component encounters some error during the React Component Lifecycle. This method allows us to handle the error boundaries of the application.
... | [
{
"code": null,
"e": 1184,
"s": 1062,
"text": "In this article, we are going to see how to execute a function in the commit phase if some error occurs in the Component."
},
{
"code": null,
"e": 1382,
"s": 1184,
"text": "This method is called when a component or any children compo... |
Logistic Regression classifier on Census Income Data | by Animesh Agarwal | Towards Data Science | In this blog, we will analyze the Census Dataset from the UCI Machine Learning Repository.
The dataset contains three files:
adult.data: the training dataset
adult.names: dataset description
adult.test: test dataset
We will use Logistic Regression to build the classifier. If you don’t know about Logistic Regression you... | [
{
"code": null,
"e": 138,
"s": 47,
"text": "In this blog, we will analyze the Census Dataset from the UCI Machine Learning Repository."
},
{
"code": null,
"e": 172,
"s": 138,
"text": "The dataset contains three files:"
},
{
"code": null,
"e": 205,
"s": 172,
"t... |
Spring Boot - Enabling HTTPS | By default, Spring Boot application uses HTTP 8080 port when the application starts up.
You need to follow the steps given below to configure the HTTPS and the port 443 in Spring Boot application −
Obtain the SSL certificate – Create a self-signed certificate or get one from a Certificate Authority
Obtain the SSL certi... | [
{
"code": null,
"e": 3113,
"s": 3025,
"text": "By default, Spring Boot application uses HTTP 8080 port when the application starts up."
},
{
"code": null,
"e": 3223,
"s": 3113,
"text": "You need to follow the steps given below to configure the HTTPS and the port 443 in Spring Boo... |
Jackson Annotations - @JsonProperty | @JsonProperty is used to mark non-standard getter/setter method to be used with respect to json property.
import java.io.IOException;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;
public class JacksonTester {
public static void main(String args[]) throws I... | [
{
"code": null,
"e": 2581,
"s": 2475,
"text": "@JsonProperty is used to mark non-standard getter/setter method to be used with respect to json property."
},
{
"code": null,
"e": 3272,
"s": 2581,
"text": "import java.io.IOException;\nimport com.fasterxml.jackson.annotation.JsonPro... |
SQL queries in Python. SQL is typically a go-to tool when you... | by Shubhi Asthana | Towards Data Science | SQL is typically a go-to tool when you need to get a quick look at some data and draw preliminary conclusions. However the data can be of various shapes and forms, stored across different tables, and not really ‘relational’. Additionally, if one is doing data science in python, they would want to be able to read data a... | [
{
"code": null,
"e": 428,
"s": 47,
"text": "SQL is typically a go-to tool when you need to get a quick look at some data and draw preliminary conclusions. However the data can be of various shapes and forms, stored across different tables, and not really ‘relational’. Additionally, if one is doing d... |
ReactJS – createRef() method | In this article, we are going to see how to create a reference to any DOM element in the functional component.
This method is used to access any DOM element in a component and it returns a mutable ref object which will be persisted as long as the component is placed in the DOM. If we pass a ref object to any DOM elemen... | [
{
"code": null,
"e": 1173,
"s": 1062,
"text": "In this article, we are going to see how to create a reference to any DOM element in the functional component."
},
{
"code": null,
"e": 1492,
"s": 1173,
"text": "This method is used to access any DOM element in a component and it ret... |
Passing parameters by references in C++ | We have discussed how we implement call by reference concept using pointers. Here is another example of call by reference which makes use of C++ reference −
#include <iostream>
using namespace std;
// function declaration
void swap(int& x, int& y);
int main () {
// local variable declaration:
int a = 100;
... | [
{
"code": null,
"e": 2475,
"s": 2318,
"text": "We have discussed how we implement call by reference concept using pointers. Here is another example of call by reference which makes use of C++ reference −"
},
{
"code": null,
"e": 3160,
"s": 2475,
"text": "#include <iostream>\nusin... |
Topic Modeling and Latent Dirichlet Allocation (LDA) in Python | by Susan Li | Towards Data Science | Topic modeling is a type of statistical modeling for discovering the abstract “topics” that occur in a collection of documents. Latent Dirichlet Allocation (LDA) is an example of topic model and is used to classify text in a document to a particular topic. It builds a topic per document model and words per topic model,... | [
{
"code": null,
"e": 529,
"s": 172,
"text": "Topic modeling is a type of statistical modeling for discovering the abstract “topics” that occur in a collection of documents. Latent Dirichlet Allocation (LDA) is an example of topic model and is used to classify text in a document to a particular topic... |
5 Smooth Python Web-Frameworks For The Modern Developer | by Emmett Boudreau | Towards Data Science | Around a month ago, I wrote a short article where I highlighted some of my favorite, old-fashioned and lightweight alternatives to Flask and Django that I like to use for deploying endpoints. Though this was certainly a list of some great web-frameworks, they were more light-weight-centric and old-fashioned than option... | [
{
"code": null,
"e": 924,
"s": 171,
"text": "Around a month ago, I wrote a short article where I highlighted some of my favorite, old-fashioned and lightweight alternatives to Flask and Django that I like to use for deploying endpoints. Though this was certainly a list of some great web-frameworks, ... |
jQuery | html() Method - GeeksforGeeks | 19 Feb, 2019
The html() Method in jQuery is used to set or return the innerHTML content of the selected element.
Syntax:
It returns the content of first matched element.$(selector).html()
$(selector).html()
It sets the content of matched element.$(selector).html(content)
$(selector).html(content)
It sets the content us... | [
{
"code": null,
"e": 42078,
"s": 42050,
"text": "\n19 Feb, 2019"
},
{
"code": null,
"e": 42178,
"s": 42078,
"text": "The html() Method in jQuery is used to set or return the innerHTML content of the selected element."
},
{
"code": null,
"e": 42186,
"s": 42178,
... |
How To Use Comments Effectively In Python | by Emmett Boudreau | Towards Data Science | There are many tools that a software engineer or data scientist might use in order to provide more expression to their code. There are many reasons that one might want to do this. For example, comments can be a valuable asset in a step-by-step process that needs to be taught. Comments can also provide valuable informat... | [
{
"code": null,
"e": 550,
"s": 172,
"text": "There are many tools that a software engineer or data scientist might use in order to provide more expression to their code. There are many reasons that one might want to do this. For example, comments can be a valuable asset in a step-by-step process tha... |
How to handle Child Threads in Node.js ? - GeeksforGeeks | 10 Sep, 2021
Node.js is a single-threaded language and uses the multiple threads in the background for certain tasks as I/O calls but it does not expose child threads to the developer.But node.js gives us ways to work around if we really need to do some work parallelly to our main single thread process.Child Process in... | [
{
"code": null,
"e": 25975,
"s": 25947,
"text": "\n10 Sep, 2021"
},
{
"code": null,
"e": 26445,
"s": 25975,
"text": "Node.js is a single-threaded language and uses the multiple threads in the background for certain tasks as I/O calls but it does not expose child threads to the de... |
Stationarity and Memory in Financial Markets | by Yves-Laurent Kom Samo, PhD | Towards Data Science | Stationarity and time series predictability, a special case of which is time series memory, are notions that are fundamental to the quantitative investment process. However, these are often misunderstood by practitioners and researchers alike, as attests Chapter 5 of the recent book Advances in Financial Machine Learni... | [
{
"code": null,
"e": 759,
"s": 172,
"text": "Stationarity and time series predictability, a special case of which is time series memory, are notions that are fundamental to the quantitative investment process. However, these are often misunderstood by practitioners and researchers alike, as attests ... |
Natural Language Processing — Dependency Parsing | by Shivanee Jaiswal | Towards Data Science | Dependency Parsing is the process to analyze the grammatical structure in a sentence and find out related words as well as the type of the relationship between them.
Each relationship:
Has one head and a dependent that modifies the head.Is labeled according to the nature of the dependency between the head and the depen... | [
{
"code": null,
"e": 337,
"s": 171,
"text": "Dependency Parsing is the process to analyze the grammatical structure in a sentence and find out related words as well as the type of the relationship between them."
},
{
"code": null,
"e": 356,
"s": 337,
"text": "Each relationship:"
... |
Iterate through Java Pair Tuple | The iteration through Pair in JavaTuples is the same as you may have seen in Java Arrays collection.
Let us first see what we need to work with JavaTuples. To work with Pair class in JavaTuples, you need to import the following package −
import org.javatuples.Pair;
Note − Steps to download and run JavaTuples program If... | [
{
"code": null,
"e": 1163,
"s": 1062,
"text": "The iteration through Pair in JavaTuples is the same as you may have seen in Java Arrays collection."
},
{
"code": null,
"e": 1300,
"s": 1163,
"text": "Let us first see what we need to work with JavaTuples. To work with Pair class in... |
How to see request logs in Postman console? | We can see request logs in the Postman console. Once a request has been sent, the Postman console records the header of request, variables, Response header and body, certificates, proxy settings, errors, scripts, output obtained from console.log, and so on.
The Console is obtained from the Postman application by follow... | [
{
"code": null,
"e": 1320,
"s": 1062,
"text": "We can see request logs in the Postman console. Once a request has been sent, the Postman console records the header of request, variables, Response header and body, certificates, proxy settings, errors, scripts, output obtained from console.log, and so... |
How to mask an array using another array in Python ? - GeeksforGeeks | 21 Apr, 2021
In this article, we will learn how to mask an array using another array in Python. When working with data arrays or data-frames masking can be extremely useful. Masks are an array that contains the list of boolean values for the given condition. The masked array is the arrays that have invalid or missing e... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n21 Apr, 2021"
},
{
"code": null,
"e": 24216,
"s": 23901,
"text": "In this article, we will learn how to mask an array using another array in Python. When working with data arrays or data-frames masking can be extremely useful. Ma... |
Merge Without Extra Space | Practice | GeeksforGeeks | Given two sorted arrays arr1[] and arr2[] of sizes n and m in non-decreasing order. Merge them in sorted order without using any extra space. Modify arr1 so that it contains the first N elements and modify arr2 so that it contains the last M elements.
Example 1:
Input:
n = 4, arr1[] = [1 3 5 7]
m = 5, arr2[] = [0 ... | [
{
"code": null,
"e": 493,
"s": 238,
"text": "Given two sorted arrays arr1[] and arr2[] of sizes n and m in non-decreasing order. Merge them in sorted order without using any extra space. Modify arr1 so that it contains the first N elements and modify arr2 so that it contains the last M elements. \n ... |
DAX Date & Time - NOW function | Returns the current date and time in datetime format.
NOW ()
No parameters for this function.
A date in datetime format.
DAX NOW function is useful when you need to display the current date and time on a worksheet or calculate a value based on the current date and time, and have that value updated each time you open ... | [
{
"code": null,
"e": 2055,
"s": 2001,
"text": "Returns the current date and time in datetime format."
},
{
"code": null,
"e": 2064,
"s": 2055,
"text": "NOW () \n"
},
{
"code": null,
"e": 2097,
"s": 2064,
"text": "No parameters for this function."
},
{
... |
Find the largest BST subtree in a given Binary Tree | Set 1 - GeeksforGeeks | 31 Jan, 2022
Given a Binary Tree, write a function that returns the size of the largest subtree which is also a Binary Search Tree (BST). If the complete Binary Tree is BST, then return the size of whole tree.Examples:
Input:
5
/ \
2 4
/ \
1 3
Output: 3
The following subtree is the maximum si... | [
{
"code": null,
"e": 25088,
"s": 25060,
"text": "\n31 Jan, 2022"
},
{
"code": null,
"e": 25296,
"s": 25088,
"text": "Given a Binary Tree, write a function that returns the size of the largest subtree which is also a Binary Search Tree (BST). If the complete Binary Tree is BST, th... |
How to print results of script in MongoDB? | We will use printjson() for this. Let us first create a collection with documents −
> dbprintResultScriptDemoinsertOne({"StudentName":"John","StudentAge":21});
{
"acknowledged" : true,
"insertedId" : ObjectId("5cf22c02b64a577be5a2bc0b")
}
> dbprintResultScriptDemoinsertOne({"StudentName":"Carol","StudentAge":20})... | [
{
"code": null,
"e": 1146,
"s": 1062,
"text": "We will use printjson() for this. Let us first create a collection with documents −"
},
{
"code": null,
"e": 1631,
"s": 1146,
"text": "> dbprintResultScriptDemoinsertOne({\"StudentName\":\"John\",\"StudentAge\":21});\n{\n \"acknowl... |
Set filtering conditions for nested array in MongoDB | To set filtering conditions, use $filter and $cond in MongoDB aggregate(). The $filter selects a subset of an array to return based on the specified condition. Let us create a collection with documents −
> db.demo725.insertOne(
... {
...
... "details": {
...
... "userMessages": [
... {
...... | [
{
"code": null,
"e": 1266,
"s": 1062,
"text": "To set filtering conditions, use $filter and $cond in MongoDB aggregate(). The $filter selects a subset of an array to return based on the specified condition. Let us create a collection with documents −"
},
{
"code": null,
"e": 2087,
"s... |
Construct the derivation tree for the string aabbabba. | Derive a derivation tree for the string aabbabba for the given context free grammar (CFG) −
S->aB|bA
A->a|aS|bAA
B->b|bS|aBB
Derivation is a sequence of production rules, which is used to get input strings.
It is a graphical representation for derivation of given production rules for a given CFG. It is also called as a... | [
{
"code": null,
"e": 1154,
"s": 1062,
"text": "Derive a derivation tree for the string aabbabba for the given context free grammar (CFG) −"
},
{
"code": null,
"e": 1187,
"s": 1154,
"text": "S->aB|bA\nA->a|aS|bAA\nB->b|bS|aBB"
},
{
"code": null,
"e": 1269,
"s": 118... |
Check if object contains all keys in JavaScript array | We are required to write a function containsAll() that takes in two arguments, first an object and
second an array of strings. It returns a boolean based on the fact whether or not the object
contains all the properties that are mentioned as strings in the array.
So, let’s write the code for this. We will iterate over ... | [
{
"code": null,
"e": 1326,
"s": 1062,
"text": "We are required to write a function containsAll() that takes in two arguments, first an object and\nsecond an array of strings. It returns a boolean based on the fact whether or not the object\ncontains all the properties that are mentioned as strings i... |
Binary Search in C++ Standard Template Library (STL) - GeeksforGeeks | 17 Feb, 2021
Binary search is a widely used searching algorithm that requires the array to be sorted before search is applied. The main idea behind this algorithm is to keep dividing the array in half (divide and conquer) until the element is found, or all the elements are exhausted.It works by comparing the middle ite... | [
{
"code": null,
"e": 24054,
"s": 24026,
"text": "\n17 Feb, 2021"
},
{
"code": null,
"e": 24659,
"s": 24054,
"text": "Binary search is a widely used searching algorithm that requires the array to be sorted before search is applied. The main idea behind this algorithm is to keep di... |
Exception Handling in C++ - GeeksQuiz | 22 Sep, 2021
Inside try
Exception Caught
After throw
After catch
Inside try
Exception Caught
After catch
Inside try
Exception Caught
Inside try
After throw
After catch
Remove error-handling code from the software's main line of code.A method writer can choose to handle certain exceptions and delegate others to the cal... | [
{
"code": null,
"e": 27530,
"s": 27502,
"text": "\n22 Sep, 2021"
},
{
"code": null,
"e": 27583,
"s": 27530,
"text": "Inside try\nException Caught\nAfter throw \nAfter catch"
},
{
"code": null,
"e": 27623,
"s": 27583,
"text": "Inside try\nException Caught\nAfte... |
AWK - Pretty Printing | So far we have used AWK's print and printf functions to display data on standard output. But printf is much more powerful than what we have seen before. This function is borrowed from the C language and is very helpful while producing formatted output. Below is the syntax of the printf statement −
printf fmt, expr-list... | [
{
"code": null,
"e": 2156,
"s": 1857,
"text": "So far we have used AWK's print and printf functions to display data on standard output. But printf is much more powerful than what we have seen before. This function is borrowed from the C language and is very helpful while producing formatted output. ... |
JavaScript BOM | Window Screen - GeeksforGeeks | 19 Feb, 2019
The Browser Object Model (BOM) is a browser-specific convention referring to all the objects exposed by the web browser. The BOM allows JavaScript to “interact with” the browser.The object of window represents a browser window and all its corresponding features. A window object is created automatically by ... | [
{
"code": null,
"e": 24907,
"s": 24879,
"text": "\n19 Feb, 2019"
},
{
"code": null,
"e": 25364,
"s": 24907,
"text": "The Browser Object Model (BOM) is a browser-specific convention referring to all the objects exposed by the web browser. The BOM allows JavaScript to “interact wit... |
How to convert DateTime to integer in Python | 30 Aug, 2021
Python provides a module called DateTime to perform all the operations related to date and time. It has a rich set of functions used to perform almost all the operations that deal with time. It needs to be imported first to use the functions and it comes along with python, so no need to install it separate... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n30 Aug, 2021"
},
{
"code": null,
"e": 365,
"s": 54,
"text": "Python provides a module called DateTime to perform all the operations related to date and time. It has a rich set of functions used to perform almost all the operations that... |
Specify Row Names when Reading Excel File in R | 31 Aug, 2021
In this article, we are going to specify the row names when reading Excel file in the R Programming language.
Specifying row names when reading a file using row.names argument of the read.xlsx2() function.
This is the easiest approach to specify the row names when reading a file in the R programming langua... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Aug, 2021"
},
{
"code": null,
"e": 138,
"s": 28,
"text": "In this article, we are going to specify the row names when reading Excel file in the R Programming language."
},
{
"code": null,
"e": 234,
"s": 138,
"text... |
How to Get the Tkinter Label Text? | 11 Dec, 2020
Prerequisite: Python GUI – Tkinter
Python offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with tkinter is the fastest and easies... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n11 Dec, 2020"
},
{
"code": null,
"e": 88,
"s": 53,
"text": "Prerequisite: Python GUI – Tkinter"
},
{
"code": null,
"e": 440,
"s": 88,
"text": "Python offers multiple options for developing a GUI (Graphical User Inte... |
Nagarro Interview Experience(On-Campus) | 02 Nov, 2020
Round 1(Online Test): It was MCQ test conducted on mettl. It consists of two parts 15 DSA / C++ MCQs and 25 MCQa of aptitude.
This was for 60 mins. The DSA section consists of the programming logic and space and time complexity. Property of graph and tree traversals and algorithms. It can be practiced on G... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Nov, 2020"
},
{
"code": null,
"e": 154,
"s": 28,
"text": "Round 1(Online Test): It was MCQ test conducted on mettl. It consists of two parts 15 DSA / C++ MCQs and 25 MCQa of aptitude."
},
{
"code": null,
"e": 349,
"s"... |
How to change the color of horizontal line (<hr> element) using CSS ? | 18 Nov, 2020
The HTML <hr> tag is used to insert a horizontal rule or a thematic break in an HTML page to divide or separate document sections. The color of the <hr> tag can be set by using the background-color property in CSS.
Example:
<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <style> ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Nov, 2020"
},
{
"code": null,
"e": 243,
"s": 28,
"text": "The HTML <hr> tag is used to insert a horizontal rule or a thematic break in an HTML page to divide or separate document sections. The color of the <hr> tag can be set by usin... |
Majority Element | 06 Jul, 2022
Write a function which takes an array and prints the majority element (if it exists), otherwise prints “No Majority Element”. A majority element in an array A[] of size n is an element that appears more than n/2 times (and hence there is at most one such element).
Examples :
Input : {3, 3, 4, 2, 4, 4, 2,... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Jul, 2022"
},
{
"code": null,
"e": 320,
"s": 54,
"text": "Write a function which takes an array and prints the majority element (if it exists), otherwise prints “No Majority Element”. A majority element in an array A[] of size n is ... |
Plot the power spectral density using Matplotlib – Python | 05 Jul, 2022
matplotlib.pyplot.psd() function is used to plot power spectral density. In the Welch’s average periodogram method for evaluating power spectral density (say, Pxx), the vector ‘x’ is divided equally into NFFT segments. Every segment is windowed by the function window and detrended by the function detrend. ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Jul, 2022"
},
{
"code": null,
"e": 530,
"s": 28,
"text": "matplotlib.pyplot.psd() function is used to plot power spectral density. In the Welch’s average periodogram method for evaluating power spectral density (say, Pxx), the vector... |
Ruby | Numeric divmod() function | 07 Jan, 2020
The divmod() is an inbuilt method in Ruby returns the integer quotient and modulus after performing the division.
Syntax: num1.divmod(num2)
Parameters: The function needs two numbers whose integer division is to be performed.
Return Value: It returns returns the integer quotient and modulus after performin... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Jan, 2020"
},
{
"code": null,
"e": 142,
"s": 28,
"text": "The divmod() is an inbuilt method in Ruby returns the integer quotient and modulus after performing the division."
},
{
"code": null,
"e": 168,
"s": 142,
"... |
How to Read Data from Firebase Firestore in Android? | 17 Jan, 2021
In the previous article, we have seen on How to Add Data to Firebase Firestore in Android. This is the continuation of this series. Now we will see How to Read this added data inside our Firebase Firestore. Now we will move towards the implementation of this reading data in Android Firebase.
We will be cr... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n17 Jan, 2021"
},
{
"code": null,
"e": 347,
"s": 53,
"text": "In the previous article, we have seen on How to Add Data to Firebase Firestore in Android. This is the continuation of this series. Now we will see How to Read this added dat... |
Format String Vulnerability and Prevention with Example | 10 Sep, 2018
A format string is an ASCII string that contains text and format parameters.
Example:
// A statement with format string
printf("my name is : %s\n", "Akash");
// Output
// My name is : Akash
There are several format strings that specify output in C and many other programming languages but our focus is on ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n10 Sep, 2018"
},
{
"code": null,
"e": 130,
"s": 53,
"text": "A format string is an ASCII string that contains text and format parameters."
},
{
"code": null,
"e": 139,
"s": 130,
"text": "Example:"
},
{
"code... |
std::set_union in C++ | 30 Oct, 2020
Union of two sorted ranges The union of two sets is formed by the elements that are present in either one of the sets, or in both. Elements from the second range that have an equivalent element in the first range are not copied to the resulting range.The elements are compared using operator< for the first ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Oct, 2020"
},
{
"code": null,
"e": 581,
"s": 52,
"text": "Union of two sorted ranges The union of two sets is formed by the elements that are present in either one of the sets, or in both. Elements from the second range that have an... |
Divide and Conquer Algorithm | Introduction | 23 Jun, 2022
In this article, we are going to discuss how Divide and Conquer technique is helpful and how we can solve the problem with the DAC technique approach. In this section, we will discuss the following topics.
1. Introduction to DAC.
2. Algorithms under DAC techniques.
3. Recurrence Relation for DAC algorithm... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Jun, 2022"
},
{
"code": null,
"e": 259,
"s": 52,
"text": "In this article, we are going to discuss how Divide and Conquer technique is helpful and how we can solve the problem with the DAC technique approach. In this section, we wil... |
How to Parse JSON in Golang? | 10 Jul, 2020
Golang provides multiple APIs to work with JSON including to and from built-in and custom data types using the encoding/json package. To parse JSON, we use the Unmarshal() function in package encoding/json to unpack or decode the data from JSON to a struct.
Syntax: func Unmarshal(data []byte, v interface{}... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n10 Jul, 2020"
},
{
"code": null,
"e": 311,
"s": 53,
"text": "Golang provides multiple APIs to work with JSON including to and from built-in and custom data types using the encoding/json package. To parse JSON, we use the Unmarshal() fu... |
What are the DML commands in DBMS? | The structured query language (SQL) commands deal with the manipulation of data present in the database that belongs to the DML or Data Manipulation Language. This includes most of the SQL statements.
The examples of DML in the Database Management System (DBMS) are as follows −
SELECT − Retrieve data from the database.... | [
{
"code": null,
"e": 1388,
"s": 1187,
"text": "The structured query language (SQL) commands deal with the manipulation of data present in the database that belongs to the DML or Data Manipulation Language. This includes most of the SQL statements."
},
{
"code": null,
"e": 1466,
"s": ... |
Python: Operations on Numpy Arrays | 30 Jan, 2020
NumPy is a Python package which means ‘Numerical Python’. It is the library for logical computing, which contains a powerful n-dimensional array object, gives tools to integrate C, C++ and so on. It is likewise helpful in linear based math, arbitrary number capacity and so on. NumPy exhibits can likewise b... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jan, 2020"
},
{
"code": null,
"e": 410,
"s": 28,
"text": "NumPy is a Python package which means ‘Numerical Python’. It is the library for logical computing, which contains a powerful n-dimensional array object, gives tools to integra... |
Take input from stdin in Python | 01 Jul, 2022
In this article, we will see How to Read from stdin in Python.
There are a number of ways in which we can take input from stdin in Python.
sys.stdin
input()
fileinput.input()
The sys module in python helps us to access the variables maintained by the interpreter. It also provides functions to interact wi... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n01 Jul, 2022"
},
{
"code": null,
"e": 116,
"s": 52,
"text": "In this article, we will see How to Read from stdin in Python. "
},
{
"code": null,
"e": 193,
"s": 116,
"text": "There are a number of ways in which we ca... |
How to Obtain the Connection Information Programmatically in Android? | 14 Oct, 2020
Sometimes it becomes challenging to find the network-related details, especially the device’s IP address, which could be needed to grant unique preferences through the modem software. Because of the variance in the information shown to the user across multiple Android devices (Samsung, Mi, Lava), we implem... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Oct, 2020"
},
{
"code": null,
"e": 576,
"s": 28,
"text": "Sometimes it becomes challenging to find the network-related details, especially the device’s IP address, which could be needed to grant unique preferences through the modem s... |
Vscan – Vulnerability Scanner Tool Using Nmap And NSE Scripts in Kali Linux | 07 Oct, 2021
Vscan is a free and open-source tool available on GitHub. Vscan has based nmap scanning techniques, the easiest and useful tool for reconnaissance. Vscan interface is very similar to Metasploit 1 and Metasploit 2. Vscan has its own modules that add additional value to the standard scanner which is nmap. Vs... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Oct, 2021"
},
{
"code": null,
"e": 1235,
"s": 28,
"text": "Vscan is a free and open-source tool available on GitHub. Vscan has based nmap scanning techniques, the easiest and useful tool for reconnaissance. Vscan interface is very si... |
How to Use SELECT With Aggregate Functions in SQL? | 14 Nov, 2021
In SQL, mainly five aggregate functions are provided. These help us to process the table data in the desired way. All these are illustrated below. For this article, we will be using the Microsoft SQL Server as our database.
Step 1: Create a Database. For this use the below command to create a database name... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 Nov, 2021"
},
{
"code": null,
"e": 278,
"s": 54,
"text": "In SQL, mainly five aggregate functions are provided. These help us to process the table data in the desired way. All these are illustrated below. For this article, we will b... |
C# program to find Union of two or more Lists | Firstly, create lists −
//three lists
var list1 = new List{3, 4, 5};
var list2 = new List{1, 2, 3, 4, 5};
var list3 = new List{5, 6, 7, 8};
Use the union method to get the union of list1 and list2 −
var res1 = list1.Union(list2);
var res2 = res1.Union(list3);
The following is the complete code −
Live Demo
using System... | [
{
"code": null,
"e": 1086,
"s": 1062,
"text": "Firstly, create lists −"
},
{
"code": null,
"e": 1202,
"s": 1086,
"text": "//three lists\nvar list1 = new List{3, 4, 5};\nvar list2 = new List{1, 2, 3, 4, 5};\nvar list3 = new List{5, 6, 7, 8};"
},
{
"code": null,
"e": 12... |
Tcl - If else Statement | An if statement can be followed by an optional else statement, which executes when the Boolean expression is false.
The syntax of an 'if...else' statement in Tcl language is −
if {boolean_expression} {
# statement(s) will execute if the boolean expression is true
} else {
# statement(s) will execute if the boole... | [
{
"code": null,
"e": 2317,
"s": 2201,
"text": "An if statement can be followed by an optional else statement, which executes when the Boolean expression is false."
},
{
"code": null,
"e": 2377,
"s": 2317,
"text": "The syntax of an 'if...else' statement in Tcl language is −"
},
... |
An Introduction to the worldfootballR R Package | by Jason Zivkovic | Towards Data Science | With the creation of the worldfootballR R package; a new R package to aid in the extraction of Football (Soccer) data from fbref.com, I will be trying to highlight ways the package can be used.
The package released is currently a development version and only available on GitHub, but will be made available on CRAN once ... | [
{
"code": null,
"e": 366,
"s": 172,
"text": "With the creation of the worldfootballR R package; a new R package to aid in the extraction of Football (Soccer) data from fbref.com, I will be trying to highlight ways the package can be used."
},
{
"code": null,
"e": 525,
"s": 366,
"... |
C++ Regex Library - regex_replace | It makes a copy of the target sequence (the subject) with all matches of the regular expression rgx (the pattern) replaced by fmt (the replacement). The target sequence is either s or the character sequence between first and last, depending on the version used.
Following is the declaration for std::regex_replace.
templ... | [
{
"code": null,
"e": 2865,
"s": 2603,
"text": "It makes a copy of the target sequence (the subject) with all matches of the regular expression rgx (the pattern) replaced by fmt (the replacement). The target sequence is either s or the character sequence between first and last, depending on the versi... |
CSS - font-variant | The font-variant property determines the use of one of two font faces to be used in the rendering of a given element's text.
normal − Specifies a normal font face; that is, whatever is the default face for the font in use.
normal − Specifies a normal font face; that is, whatever is the default face for the font in use.... | [
{
"code": null,
"e": 2751,
"s": 2626,
"text": "The font-variant property determines the use of one of two font faces to be used in the rendering of a given element's text."
},
{
"code": null,
"e": 2849,
"s": 2751,
"text": "normal − Specifies a normal font face; that is, whatever ... |
How to query MongoDB with “like”? | You can easily query MongoDB with “like”:
db.yourCollectionName.find({"yourFieldName" : /.*yourMatchingValue.*/}).pretty();
To understand the above syntax, let us create a collection with some documents. Here, we have
a collection with the name ‘employee’. The query is as follows:
> db.employee.insert({"EmployeeName":"... | [
{
"code": null,
"e": 1104,
"s": 1062,
"text": "You can easily query MongoDB with “like”:"
},
{
"code": null,
"e": 1186,
"s": 1104,
"text": "db.yourCollectionName.find({\"yourFieldName\" : /.*yourMatchingValue.*/}).pretty();"
},
{
"code": null,
"e": 1344,
"s": 1186... |
Neo4j - Backup & Restore | In real-time applications, we should take backup of our application database regularly, so that we can restore to some working condition at any failure point.
This rule is applicable for both RDBMS and NoSQL databases.
In this section, we are going to discuss about two important DBA tasks.
How to back up a Neo4j Databa... | [
{
"code": null,
"e": 2498,
"s": 2339,
"text": "In real-time applications, we should take backup of our application database regularly, so that we can restore to some working condition at any failure point."
},
{
"code": null,
"e": 2558,
"s": 2498,
"text": "This rule is applicable... |
How to change the Pandas datetime format in Python? - GeeksforGeeks | 11 Dec, 2020
Prerequisites: Pandas
The date-time default format is “YYYY-MM-DD”. Hence, December 8, 2020, in the date format will be presented as “2020-12-08”. The datetime format can be changed and by changing we mean changing the sequence and style of the format.
strftime() can change the date format in python.
Syn... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n11 Dec, 2020"
},
{
"code": null,
"e": 24314,
"s": 24292,
"text": "Prerequisites: Pandas"
},
{
"code": null,
"e": 24546,
"s": 24314,
"text": "The date-time default format is “YYYY-MM-DD”. Hence, December 8, 202... |
Vim - Remote File Editing | Many times we need to work with remote servers. And often we edit files from those remote servers. One of the obvious solution to edit those files is to log in to the remote sever and edit files. But sometimes it is convenient to edit those files from local machine because we might have installed and configured various... | [
{
"code": null,
"e": 2371,
"s": 1970,
"text": "Many times we need to work with remote servers. And often we edit files from those remote servers. One of the obvious solution to edit those files is to log in to the remote sever and edit files. But sometimes it is convenient to edit those files from l... |
Calculate average values of two given NumPy arrays - GeeksforGeeks | 20 Aug, 2020
Finding average of NumPy arrays is quite similar to finding average of given numbers. We just have to get the sum of corresponding array elements and then divide that sum with the total number of arrays.
Let’s see an example:
Example 1: Calculate average values of two given NumPy 1d-arrays
Python3
# import... | [
{
"code": null,
"e": 25491,
"s": 25463,
"text": "\n20 Aug, 2020"
},
{
"code": null,
"e": 25695,
"s": 25491,
"text": "Finding average of NumPy arrays is quite similar to finding average of given numbers. We just have to get the sum of corresponding array elements and then divide t... |
Inorder Successor in Binary Search Tree | 17 Jun, 2022
In Binary Tree, Inorder successor of a node is the next node in Inorder traversal of the Binary Tree. Inorder Successor is NULL for the last node in Inorder traversal.
In Binary Search Tree, Inorder Successor of an input node can also be defined as the node with the smallest key greater than the key of th... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n17 Jun, 2022"
},
{
"code": null,
"e": 223,
"s": 54,
"text": "In Binary Tree, Inorder successor of a node is the next node in Inorder traversal of the Binary Tree. Inorder Successor is NULL for the last node in Inorder traversal. "
},... |
Merge two binary Max Heaps | 04 Oct, 2021
Given two binary max heaps as arrays, merge the given heaps.Examples :
Input : a = {10, 5, 6, 2},
b = {12, 7, 9}
Output : {12, 10, 9, 2, 5, 7, 6}
The idea is simple. We create an array to store result. We copy both given arrays one by one to result. Once we have copied all elements, we c... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 Oct, 2021"
},
{
"code": null,
"e": 125,
"s": 52,
"text": "Given two binary max heaps as arrays, merge the given heaps.Examples : "
},
{
"code": null,
"e": 211,
"s": 125,
"text": "Input : a = {10, 5, 6, 2}, \n ... |
Python | pandas.to_markdown() in Pandas | 22 Apr, 2020
With the help of pandas.to_markdown() method, we can get the markdown table from the given dataframes by using pandas.to_markdown() method.
Syntax : pandas.to_markdown()
Return : Return the markdown table.
Example #1 :In this example we can see that by using pandas.to_markdown() method, we are able to get ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n22 Apr, 2020"
},
{
"code": null,
"e": 193,
"s": 53,
"text": "With the help of pandas.to_markdown() method, we can get the markdown table from the given dataframes by using pandas.to_markdown() method."
},
{
"code": null,
"e... |
Numpy ndarray.tobytes() function | Python | 22 Apr, 2020
numpy.ndarray.tobytes() function construct Python bytes containing the raw data bytes in the array.
Syntax : numpy.ndarray.tobytes(order=’C’)
Parameters :order : [{‘C’, ‘F’, None}, optional] Order of the data for multidimensional arrays: C, Fortran, or the same as for the original array.
Return : Python by... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Apr, 2020"
},
{
"code": null,
"e": 128,
"s": 28,
"text": "numpy.ndarray.tobytes() function construct Python bytes containing the raw data bytes in the array."
},
{
"code": null,
"e": 170,
"s": 128,
"text": "Syntax... |
numpy.sinc() in Python | 29 Nov, 2018
numpy.sinc(array) : This mathematical function helps user to calculate sinc function for all x(being the array elements).
Parameters :array : [array_like] elements are in radians. 2pi Radians = 36o degrees
Return :An array with sinc value of x for all x i.e. array elements.
Code #1 : Working
# Python3 prog... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Nov, 2018"
},
{
"code": null,
"e": 150,
"s": 28,
"text": "numpy.sinc(array) : This mathematical function helps user to calculate sinc function for all x(being the array elements)."
},
{
"code": null,
"e": 234,
"s": 15... |
VBA - UBound Function | The UBound Function returns the largest subscript of the specified array. Hence, this value corresponds to the size of the array.
UBound(ArrayName[,dimension])
ArrayName − A required parameter. This parameter corresponds to the name of the array.
ArrayName − A required parameter. This parameter corresponds to the name... | [
{
"code": null,
"e": 2199,
"s": 2069,
"text": "The UBound Function returns the largest subscript of the specified array. Hence, this value corresponds to the size of the array."
},
{
"code": null,
"e": 2230,
"s": 2199,
"text": "UBound(ArrayName[,dimension])\n"
},
{
"code"... |
authconfig - Unix, Linux Command | If --test action is specified, authconfig can be run by
users other then root, and any configuration changes are not saved but printed
instead.
If --update action is specified, authconfig must be run by
root (or through console helper), and configuration changes are saved.
The --probe action instructs authconfig to use... | [
{
"code": null,
"e": 11179,
"s": 10711,
"text": "\nIf --test action is specified, authconfig can be run by\nusers other then root, and any configuration changes are not saved but printed\ninstead.\nIf --update action is specified, authconfig must be run by\nroot (or through console helper), and conf... |
Count of distinct Strings possible by swapping prefixes of pairs of Strings from the Array | 20 Nov, 2020
Given an array string[] consisting of N numeric strings of length M, the task is to find the number of distinct strings that can be generated by selecting any two strings, say i and j from the array and swap all possible prefixes between them. Note: Since the answer can be very large, print modulo 10000000... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n20 Nov, 2020"
},
{
"code": null,
"e": 365,
"s": 54,
"text": "Given an array string[] consisting of N numeric strings of length M, the task is to find the number of distinct strings that can be generated by selecting any two strings, sa... |
Print path between any two nodes in a Binary Tree | 14 Jun, 2022
Given a Binary Tree of distinct nodes and a pair of nodes. The task is to find and print the path between the two given nodes in the binary tree.
For Example, in the above binary tree the path between the nodes 7 and 4 is 7 -> 3 -> 1 -> 4.
The idea is to find paths form root nodes to the two nodes and s... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 Jun, 2022"
},
{
"code": null,
"e": 201,
"s": 54,
"text": "Given a Binary Tree of distinct nodes and a pair of nodes. The task is to find and print the path between the two given nodes in the binary tree. "
},
{
"code": null,... |
How to create Video Player in ReactJS ? | 09 Nov, 2021
In this article, we are going to learn how we can create Video Player in ReactJS. A video player is a kind of media player for playing back digital video data.
React is a free and open-source front-end JavaScript library for building user interfaces or UI components. It is maintained by Facebook and a comm... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Nov, 2021"
},
{
"code": null,
"e": 188,
"s": 28,
"text": "In this article, we are going to learn how we can create Video Player in ReactJS. A video player is a kind of media player for playing back digital video data."
},
{
"... |
Prototype Design Pattern | 22 Sep, 2021
Prototype allows us to hide the complexity of making new instances from the client. The concept is to copy an existing object rather than creating a new instance from scratch, something that may include costly operations. The existing object acts as a prototype and contains the state of the object. The new... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n22 Sep, 2021"
},
{
"code": null,
"e": 979,
"s": 54,
"text": "Prototype allows us to hide the complexity of making new instances from the client. The concept is to copy an existing object rather than creating a new instance from scratch... |
How to validate confirm password using JavaScript ? | 05 Apr, 2022
In almost every modern website we have seen a login and signup feature, which is surely an important service for both client and service provider. When a user signs up for a certain website they have to put a username a password, in order to enter password websites ask them to enter a password two times, t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Apr, 2022"
},
{
"code": null,
"e": 518,
"s": 28,
"text": "In almost every modern website we have seen a login and signup feature, which is surely an important service for both client and service provider. When a user signs up for a c... |
How to use strptime with milliseconds in Python | 23 Aug, 2021
strptime() function in python converts the string into DateTime objects. The strptime() is a class method that takes two arguments :
string that should be converted to datetime object
format string used to parse the string.
These two string arguments are mandatory for converting a string into DateTime obj... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 162,
"s": 28,
"text": "strptime() function in python converts the string into DateTime objects. The strptime() is a class method that takes two arguments : "
},
{
"code": null,
"e": 213,... |
Unreachable Code Error in Java | 22 Oct, 2020
The Unreachable statements refers to statements that won’t get executed during the execution of the program are called Unreachable Statements. These statements might be unreachable because of the following reasons:
Have a return statement before them
Have an infinite loop before them
Any statements after... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Oct, 2020"
},
{
"code": null,
"e": 267,
"s": 52,
"text": "The Unreachable statements refers to statements that won’t get executed during the execution of the program are called Unreachable Statements. These statements might be unrea... |
Find row with maximum sum in a Matrix | 08 Jul, 2021
Given an N*N matrix. The task is to find the index of a row with the maximum sum. That is the row whose sum of elements is maximum.Examples:
Input : mat[][] = {
{ 1, 2, 3, 4, 5 },
{ 5, 3, 1, 4, 2 },
{ 5, 6, 7, 8, 9 },
{ 0, 6, 3, 4, 12 },
{ 9, 7, 12, 4, 3 },
};
... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n08 Jul, 2021"
},
{
"code": null,
"e": 196,
"s": 53,
"text": "Given an N*N matrix. The task is to find the index of a row with the maximum sum. That is the row whose sum of elements is maximum.Examples: "
},
{
"code": null,
... |
Traditional Methods for Text Data | by Dipanjan (DJ) Sarkar | Towards Data Science | We have covered various feature engineering strategies for dealing with structured data in the first two parts of this series. Check out Part-I: Continuous, numeric data and Part-II: Discrete, categorical data for a refresher. In this article, we will look at how to work with text data, which is definitely one of the m... | [
{
"code": null,
"e": 1092,
"s": 172,
"text": "We have covered various feature engineering strategies for dealing with structured data in the first two parts of this series. Check out Part-I: Continuous, numeric data and Part-II: Discrete, categorical data for a refresher. In this article, we will lo... |
How to disable windows firewall profiles using PowerShell? | There are 3 types of profiles that firewall supports. a) Domain b) Public and c) Private profile. You can check the same settings using the GUI in the Windows Firewall Advanced Security settings window as shown below.
You can check the above settings using the Get-NetFirewallProfile command.
Get-NetFirewallProfile | Se... | [
{
"code": null,
"e": 1280,
"s": 1062,
"text": "There are 3 types of profiles that firewall supports. a) Domain b) Public and c) Private profile. You can check the same settings using the GUI in the Windows Firewall Advanced Security settings window as shown below."
},
{
"code": null,
"e"... |
Scikit Learn - MultiTaskElasticNet | It is an Elastic-Net model that allows to fit multiple regression problems jointly enforcing the selected features to be same for all the regression problems, also called tasks. Sklearn provides a linear model named MultiTaskElasticNet, trained with a mixed L1, L2-norm and L2 for regularisation, which estimates sparse ... | [
{
"code": null,
"e": 2665,
"s": 2221,
"text": "It is an Elastic-Net model that allows to fit multiple regression problems jointly enforcing the selected features to be same for all the regression problems, also called tasks. Sklearn provides a linear model named MultiTaskElasticNet, trained with a m... |
Sort by Absolute Difference | Practice | GeeksforGeeks | Given an array of N elements and a number K. The task is to arrange array elements according to the absolute difference with K, i. e., element having minimum difference comes first and so on.
Note : If two or more elements are at equal distance arrange them in same sequence as in the given array.
Example 1:
Input: N ... | [
{
"code": null,
"e": 538,
"s": 238,
"text": "Given an array of N elements and a number K. The task is to arrange array elements according to the absolute difference with K, i. e., element having minimum difference comes first and so on.\nNote : If two or more elements are at equal distance arrange t... |
Print powers using Anonymous Function in Python | 30 Nov, 2017
Prerequisite : Anonymous function
In the program below, we have used anonymous (lambda) function inside the map() built-in function to find the powers of 2. In Python, anonymous function is defined without a name.While normal functions are defined using the def keyword, in Python anonymous functions are de... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Nov, 2017"
},
{
"code": null,
"e": 62,
"s": 28,
"text": "Prerequisite : Anonymous function"
},
{
"code": null,
"e": 435,
"s": 62,
"text": "In the program below, we have used anonymous (lambda) function inside the ... |
How to Copy a File to Multiple Directories in Linux | 23 Aug, 2021
in this article, we will discuss how to copy a file to multiple directories in Linux. xargs, find, tee, shell loop, and parallel are the commands that can help you to copy a File to Multiple Directories.
Suppose we have a file with the name “xyz.txt” and we want to copy it into 3 directories with the name ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 258,
"s": 54,
"text": "in this article, we will discuss how to copy a file to multiple directories in Linux. xargs, find, tee, shell loop, and parallel are the commands that can help you to copy a ... |
Java Program To Remove Duplicates From A Given String | 11 Dec, 2021
Given a string S, the task is to remove all the duplicates in the given string. Below are the different methods to remove duplicates in a string.
METHOD 1 (Simple)
Java
// Java program to remove duplicate character// from character array and print in sorted// orderimport java.util.*; class GFG { stati... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Dec, 2021"
},
{
"code": null,
"e": 174,
"s": 28,
"text": "Given a string S, the task is to remove all the duplicates in the given string. Below are the different methods to remove duplicates in a string."
},
{
"code": null,
... |
Maximum difference between two elements in an Array | 08 Feb, 2022
Given an array arr[] of N integers, the task is to find the maximum difference between any two elements of the array.Examples:
Input: arr[] = {2, 1, 5, 3} Output: 4 |5 – 1| = 4Input: arr[] = {-10, 4, -9, -5} Output: 14
Approach: The maximum absolute difference in the array will always be the absolute... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n08 Feb, 2022"
},
{
"code": null,
"e": 182,
"s": 53,
"text": "Given an array arr[] of N integers, the task is to find the maximum difference between any two elements of the array.Examples: "
},
{
"code": null,
"e": 276,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.