title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
C++ Program to Implement Sorting containers in STL | In this C++ program, we implement Sorting containers in STL.
Functions used here:
l.push_back() = It is used to push elements into a list from the front.
l.sort() = Sorts the elements of the list.
Where l is a list object.
#include <iostream>
#include <list>
#include <string>
#include <cstdlib>
using namespace... | [
{
"code": null,
"e": 1123,
"s": 1062,
"text": "In this C++ program, we implement Sorting containers in STL."
},
{
"code": null,
"e": 1294,
"s": 1123,
"text": "Functions used here:\n l.push_back() = It is used to push elements into a list from the front.\n l.sort() = Sorts the... |
Set unique index in MongoDB | To set unique index in MongoDB, use unique:true. Let us create a collection with documents −
> db.demo257.ensureIndex({Name:1},{unique:true});
{
"createdCollectionAutomatically" : true,
"numIndexesBefore" : 1,
"numIndexesAfter" : 2,
"ok" : 1
}
> db.demo257.insertOne({Name:"Chris"});
{
"acknowledged" : tr... | [
{
"code": null,
"e": 1155,
"s": 1062,
"text": "To set unique index in MongoDB, use unique:true. Let us create a collection with documents −"
},
{
"code": null,
"e": 2296,
"s": 1155,
"text": "> db.demo257.ensureIndex({Name:1},{unique:true});\n{\n \"createdCollectionAutomatically... |
How to detect and deal with Multicollinearity | by Sushmitha Pulagam | Towards Data Science | Multicollinearity is one of the main assumptions that need to be ruled out to get a better estimation of any regression model ✌️
In this article, I’ll go through the impact of multicollinearity, how to identify, and when to fix this issue with a sample dataset.
👉 What is correlation?
The correlation between two variab... | [
{
"code": null,
"e": 300,
"s": 171,
"text": "Multicollinearity is one of the main assumptions that need to be ruled out to get a better estimation of any regression model ✌️"
},
{
"code": null,
"e": 433,
"s": 300,
"text": "In this article, I’ll go through the impact of multicolli... |
Apache Presto - substr(string,start,length) | presto:default> select substr('tutorialspoint',10,2) as substring;
substring
-----------
po
46 Lectures
3.5 hours
Arnab Chakraborty
23 Lectures
1.5 hours
Mukund Kumar Mishra
16 Lectures
1 hours
Nilay Mehta
52 Lectures
1.5 hours
Bigdata Engineer
14 Le... | [
{
"code": null,
"e": 2074,
"s": 2006,
"text": "presto:default> select substr('tutorialspoint',10,2) as substring; "
},
{
"code": null,
"e": 2107,
"s": 2074,
"text": " substring \n----------- \n po\n"
},
{
"code": null,
"e": 2142,
"s": 2107,
"text": "\n 4... |
Java Program for N Queen Problem | Backtracking-3 - GeeksforGeeks | 11 Oct, 2021
The N Queen is the problem of placing N chess queens on an N×N chessboard so that no two queens attack each other. For example, the following is a solution for 4 Queen problem.
The expected output is a binary matrix which has 1s for the blocks where queens are placed. For example, following is the output m... | [
{
"code": null,
"e": 24357,
"s": 24329,
"text": "\n11 Oct, 2021"
},
{
"code": null,
"e": 24534,
"s": 24357,
"text": "The N Queen is the problem of placing N chess queens on an N×N chessboard so that no two queens attack each other. For example, the following is a solution for 4 Q... |
Wildcards in column name for MySQL? | To work with wildcards in column name for MySQL, first, you need to select column_name and then apply LIKE operator to the wildcard.
The syntax is as follows −
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = ’yourTableName’
AND COLUMN_NAME LIKE 'yourWildCards%';
To understand the above syntax, let... | [
{
"code": null,
"e": 1195,
"s": 1062,
"text": "To work with wildcards in column name for MySQL, first, you need to select column_name and then apply LIKE operator to the wildcard."
},
{
"code": null,
"e": 1222,
"s": 1195,
"text": "The syntax is as follows −"
},
{
"code": ... |
Recursive Programs to find Minimum and Maximum elements of array - GeeksforGeeks | 23 Apr, 2021
Given an array of integers arr, the task is to find the minimum and maximum element of that array using recursion.
Examples :
Input: arr = {1, 4, 3, -5, -4, 8, 6};
Output: min = -5, max = 8
Input: arr = {1, 4, 45, 6, 10, -8};
Output: min = -8, max = 45
Recursive approach to find the Minimum element in th... | [
{
"code": null,
"e": 24430,
"s": 24402,
"text": "\n23 Apr, 2021"
},
{
"code": null,
"e": 24545,
"s": 24430,
"text": "Given an array of integers arr, the task is to find the minimum and maximum element of that array using recursion."
},
{
"code": null,
"e": 24557,
... |
How to save a vector in R as CSV file? | To save a vector in R as CSV file, we can follow the below steps −
First of all, create a vector.
Then, use write.csv function to save the vector in CSV file.
Let’s create a vector as shown below −
Live Demo
x<-rnorm(20)
x
On executing, the above script generates the below output(this output will vary on your system d... | [
{
"code": null,
"e": 1129,
"s": 1062,
"text": "To save a vector in R as CSV file, we can follow the below steps −"
},
{
"code": null,
"e": 1160,
"s": 1129,
"text": "First of all, create a vector."
},
{
"code": null,
"e": 1221,
"s": 1160,
"text": "Then, use wri... |
OpenCV - Sobel Operator | Using the sobel operation, you can detect the edges of an image in both horizontal and vertical directions. You can apply sobel operation on an image using the method sobel(). Following is the syntax of this method −
Sobel(src, dst, ddepth, dx, dy)
This method accepts the following parameters −
src − An object of the ... | [
{
"code": null,
"e": 3221,
"s": 3004,
"text": "Using the sobel operation, you can detect the edges of an image in both horizontal and vertical directions. You can apply sobel operation on an image using the method sobel(). Following is the syntax of this method −"
},
{
"code": null,
"e":... |
How to use shared preferences in Android using Kotlin? | This example demonstrates how to use shared preferences in Android using Kotlin.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8"?>
<Re... | [
{
"code": null,
"e": 1143,
"s": 1062,
"text": "This example demonstrates how to use shared preferences in Android using Kotlin."
},
{
"code": null,
"e": 1272,
"s": 1143,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required detai... |
Find possible numbers in array that can sum to a target value JavaScript | We are required to write a JavaScript function that takes in an array of numbers as the first argument and a single number as the second argument.
The function should pick such elements from the array that when added gives the sum specified by the second argument of the array. The function should return an array of all... | [
{
"code": null,
"e": 1209,
"s": 1062,
"text": "We are required to write a JavaScript function that takes in an array of numbers as the first argument and a single number as the second argument."
},
{
"code": null,
"e": 1449,
"s": 1209,
"text": "The function should pick such eleme... |
Reduce the fraction to its lowest form in C++ | Given two integers Num1 and Num2 as input. The integers can be represented as fraction Num1/Num2. The goal is to reduce this fraction to its lowest form.
We will calculate the greatest common divisor of both numbers.
We will calculate the greatest common divisor of both numbers.
Divide both numbers by that gcd
Divide b... | [
{
"code": null,
"e": 1216,
"s": 1062,
"text": "Given two integers Num1 and Num2 as input. The integers can be represented as fraction Num1/Num2. The goal is to reduce this fraction to its lowest form."
},
{
"code": null,
"e": 1279,
"s": 1216,
"text": "We will calculate the greate... |
Evaluation of Prefix Expressions in C++ | In this article, we will discuss the evaluation of prefix Expression.
In this notation, operator is prefixed to operands, i.e. operator is written ahead of operands. For example, +ab. This is equivalent to its infix notation a + b. Prefix notation is also known as Polish Notation.
For more read.
* + 6 9 - 3 1
Prefix e... | [
{
"code": null,
"e": 1133,
"s": 1062,
"text": "In this article, we will discuss the evaluation of prefix Expression. "
},
{
"code": null,
"e": 1345,
"s": 1133,
"text": "In this notation, operator is prefixed to operands, i.e. operator is written ahead of operands. For example, +a... |
Calculating distance between two geo-locations in Python | by Ashutosh Bhardwaj | Towards Data Science | A few months back I was working on a freelance project of visualizing geo-location data(i.e. latitude and longitude) in which I have to visualize central facilities and customers location on a map. As per one of the client’s requirements, I have to find all the customers locations that are within the range of 3 km from... | [
{
"code": null,
"e": 769,
"s": 172,
"text": "A few months back I was working on a freelance project of visualizing geo-location data(i.e. latitude and longitude) in which I have to visualize central facilities and customers location on a map. As per one of the client’s requirements, I have to find a... |
Encoding and Decoding Custom Objects in Python-JSON - GeeksforGeeks | 10 Jul, 2020
JSON as we know stands for JavaScript Object Notation. It is a lightweight data-interchange format and has become the most popular medium of exchanging data over the web. The reason behind its popularity is that it is both human-readable and easy for machines to parse and generate. Also, it’s the most wide... | [
{
"code": null,
"e": 24318,
"s": 24290,
"text": "\n10 Jul, 2020"
},
{
"code": null,
"e": 24659,
"s": 24318,
"text": "JSON as we know stands for JavaScript Object Notation. It is a lightweight data-interchange format and has become the most popular medium of exchanging data over t... |
Python Blockchain - Transaction Class | In this chapter, let us create a Transaction class so that a client will be able to send money to somebody. Note that a client can be both a sender or a recipient of the money. When you want to receive money, some other sender will create a transaction and specify your public address in it. We define the initialization... | [
{
"code": null,
"e": 2352,
"s": 1995,
"text": "In this chapter, let us create a Transaction class so that a client will be able to send money to somebody. Note that a client can be both a sender or a recipient of the money. When you want to receive money, some other sender will create a transaction ... |
What data type to use for hashed password field in MySQL? | The hashed password data type depends upon which hashing algorithm we are using. The hashing algorithm does not depends upon the input size because it produces a result of the same length. It gives the result in a series of hexadecimal digits, and we can reduce the hexadecimal digits by half with the help of UNHEX() fu... | [
{
"code": null,
"e": 1390,
"s": 1062,
"text": "The hashed password data type depends upon which hashing algorithm we are using. The hashing algorithm does not depends upon the input size because it produces a result of the same length. It gives the result in a series of hexadecimal digits, and we ca... |
XAML - GridPanel | A Grid panel provides a flexible area which consists of rows and columns. In a Grid, child elements can be arranged in a tabular form. Elements can be added to any specific row and column by using the Grid.Row and Grid.Column properties.
By default, a Grid panel is created with one row and one column. Multiple rows and... | [
{
"code": null,
"e": 2161,
"s": 1923,
"text": "A Grid panel provides a flexible area which consists of rows and columns. In a Grid, child elements can be arranged in a tabular form. Elements can be added to any specific row and column by using the Grid.Row and Grid.Column properties."
},
{
"... |
Java Program to Convert Enum to String - GeeksforGeeks | 17 Jun, 2021
Given an enum containing a group of constants, the task is to convert the enum to a String.
Methods:
We can solve this problem using two methods:
Using name() MethodUsing toString() Method
Using name() Method
Using toString() Method
Let us discuss both of them in detail and implementing them to get a bette... | [
{
"code": null,
"e": 23557,
"s": 23529,
"text": "\n17 Jun, 2021"
},
{
"code": null,
"e": 23649,
"s": 23557,
"text": "Given an enum containing a group of constants, the task is to convert the enum to a String."
},
{
"code": null,
"e": 23658,
"s": 23649,
"text":... |
java.util.regex.Pattern.matcher() Method | The java.util.regex.Pattern.matcher(CharSequence input) method creates a matcher that will match the given input against this pattern.
Following is the declaration for java.util.regex.Pattern.matcher(CharSequence input) method.
public Matcher matcher(CharSequence input)
input − The character sequence to be matched.
in... | [
{
"code": null,
"e": 2259,
"s": 2124,
"text": "The java.util.regex.Pattern.matcher(CharSequence input) method creates a matcher that will match the given input against this pattern."
},
{
"code": null,
"e": 2352,
"s": 2259,
"text": "Following is the declaration for java.util.rege... |
Convert string (varchar) to timestamp format in MySQL? | To convert string to timestamp format, use STR_TO_DATE() along with DATE_FORMAT(). Let us first create a table −
mysql> create table DemoTable1602
-> (
-> ReportingDate varchar(40)
-> );
Query OK, 0 rows affected (0.51 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable160... | [
{
"code": null,
"e": 1175,
"s": 1062,
"text": "To convert string to timestamp format, use STR_TO_DATE() along with DATE_FORMAT(). Let us first create a table −"
},
{
"code": null,
"e": 1295,
"s": 1175,
"text": "mysql> create table DemoTable1602\n -> (\n -> ReportingDate varch... |
Add 1 to a number represented as linked list - GeeksforGeeks | 04 Feb, 2022
Number is represented in linked list such that each digit corresponds to a node in linked list. Add 1 to it. For example 1999 is represented as (1-> 9-> 9 -> 9) and adding 1 to it should change it to (2->0->0->0)
Below are the steps :
Reverse given linked list. For example, 1-> 9-> 9 -> 9 is converted to... | [
{
"code": null,
"e": 24520,
"s": 24492,
"text": "\n04 Feb, 2022"
},
{
"code": null,
"e": 24734,
"s": 24520,
"text": "Number is represented in linked list such that each digit corresponds to a node in linked list. Add 1 to it. For example 1999 is represented as (1-> 9-> 9 -> 9) an... |
Reduce the string by removing K consecutive identical characters - GeeksforGeeks | 29 Nov, 2021
Given a string str and an integer K, the task is to reduce the string by applying the following operation any number of times until it is no longer possible:
Choose a group of K consecutive identical characters and remove them from the string.
Finally, print the reduced string.
Examples:
Input: K = 2, st... | [
{
"code": null,
"e": 26753,
"s": 26725,
"text": "\n29 Nov, 2021"
},
{
"code": null,
"e": 26911,
"s": 26753,
"text": "Given a string str and an integer K, the task is to reduce the string by applying the following operation any number of times until it is no longer possible:"
},... |
Boolean Operators - Django Template Tags - GeeksforGeeks | 02 Dec, 2021
A Django template is a text document or a Python string marked-up using the Django template language. Django being a powerful Batteries included framework provides convenience to rendering data in a template. Django templates not only allow passing data from view to template, but also provides some limited... | [
{
"code": null,
"e": 25575,
"s": 25547,
"text": "\n02 Dec, 2021"
},
{
"code": null,
"e": 26280,
"s": 25575,
"text": "A Django template is a text document or a Python string marked-up using the Django template language. Django being a powerful Batteries included framework provides... |
C# | Check if the Hashtable contains a specific Value - GeeksforGeeks | 01 Feb, 2019
The Hashtable class represents a collection of key-and-value pairs that are organized based on the hash code of the key. The key is used to access the items in the collection. Hashtable.ContainsValue(Object) Method is used to check whether the Hashtable contains a specific value or not.
Syntax:
public virt... | [
{
"code": null,
"e": 25547,
"s": 25519,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 25835,
"s": 25547,
"text": "The Hashtable class represents a collection of key-and-value pairs that are organized based on the hash code of the key. The key is used to access the items in the... |
Generate an Array by multiplying each element of given Array by K - GeeksforGeeks | 19 Jan, 2022
Given an array arr[] of size N and an integer K. The task is to multiply each element of the array by K.
Examples :
Input: arr[] = { 3, 4 }, K = 2Output: 6 8Explanation: The elements become 3*2 = 6 and 4*2 = 8.
Input: arr[] = { 0, 1, 2 }, K = 7Output: { 0, 7, 14 }
Approach: The given problem can be solved ... | [
{
"code": null,
"e": 26176,
"s": 26148,
"text": "\n19 Jan, 2022"
},
{
"code": null,
"e": 26281,
"s": 26176,
"text": "Given an array arr[] of size N and an integer K. The task is to multiply each element of the array by K."
},
{
"code": null,
"e": 26292,
"s": 26281... |
Using Deep Learning for End to End Multiclass Text Classification | by Rahul Agarwal | Towards Data Science | Have you ever thought about how toxic comments get flagged automatically on platforms like Quora or Reddit? Or how mail gets marked as spam? Or what decides which online ads are shown to you?
All of the above are examples of how text classification is used in different areas. Text classification is a common task in nat... | [
{
"code": null,
"e": 364,
"s": 172,
"text": "Have you ever thought about how toxic comments get flagged automatically on platforms like Quora or Reddit? Or how mail gets marked as spam? Or what decides which online ads are shown to you?"
},
{
"code": null,
"e": 606,
"s": 364,
"te... |
Depth of an N-Ary tree in C++ Program | In this tutorial, we are going to learn how to find the depth of the n-ary tree.
An n-ary tree is a tree in which each node of the tree has no more than n child nodes.
We have to find the depth of the n-ary tree. We will be using the vector to store the children of each node in the tree.
Let's see the steps to solve th... | [
{
"code": null,
"e": 1143,
"s": 1062,
"text": "In this tutorial, we are going to learn how to find the depth of the n-ary tree."
},
{
"code": null,
"e": 1230,
"s": 1143,
"text": "An n-ary tree is a tree in which each node of the tree has no more than n child nodes."
},
{
... |
Dart Programming - Debugging | Every now and then, developers commit mistakes while coding. A mistake in a program is referred to as a bug. The process of finding and fixing bugs is called debugging and is a normal part of the development process. This section covers tools and techniques that can help you with debugging tasks.
The WebStorm editor en... | [
{
"code": null,
"e": 2823,
"s": 2525,
"text": "Every now and then, developers commit mistakes while coding. A mistake in a program is referred to as a bug. The process of finding and fixing bugs is called debugging and is a normal part of the development process. This section covers tools and techni... |
All possible permutations of N lists in Python | If we have two lists and we need to combine each element of the first element with each element of the second list, then we have the below approaches.
In this straight forward approach we create a list of lists containing the permutation of elements from each list. we design a for loop within another for loop. The inne... | [
{
"code": null,
"e": 1213,
"s": 1062,
"text": "If we have two lists and we need to combine each element of the first element with each element of the second list, then we have the below approaches."
},
{
"code": null,
"e": 1462,
"s": 1213,
"text": "In this straight forward approa... |
Move rows from one table to another in MySQL? | You can move rows from one table to another with the help of INSERT INTO SELECT statement.
The syntax is as follows −
insert into yourDestinationTableName select *from yourOriginalTable where someCondition
To understand the above syntax. let us create a table. The following is the query to create a table −
mysql> creat... | [
{
"code": null,
"e": 1153,
"s": 1062,
"text": "You can move rows from one table to another with the help of INSERT INTO SELECT statement."
},
{
"code": null,
"e": 1180,
"s": 1153,
"text": "The syntax is as follows −"
},
{
"code": null,
"e": 1268,
"s": 1180,
"t... |
Python | Named Entity Recognition (NER) using spaCy - GeeksforGeeks | 18 Jun, 2019
Named Entity Recognition (NER) is a standard NLP problem which involves spotting named entities (people, places, organizations etc.) from a chunk of text, and classifying them into a predefined set of categories. Some of the practical applications of NER include:
Scanning news articles for the people, orga... | [
{
"code": null,
"e": 24352,
"s": 24324,
"text": "\n18 Jun, 2019"
},
{
"code": null,
"e": 24616,
"s": 24352,
"text": "Named Entity Recognition (NER) is a standard NLP problem which involves spotting named entities (people, places, organizations etc.) from a chunk of text, and clas... |
Sentiment analysis using RNNs(LSTM) | by Manish Chablani | Towards Data Science | Here we use the example of reviews to predict sentiment (even though it can be applied more generically to other domains for example sentiment analysis for tweets, comments, customer feedback, etc). Whole idea here is that movie reviews are made of sequence of words and order of words encode lot of information that is ... | [
{
"code": null,
"e": 745,
"s": 172,
"text": "Here we use the example of reviews to predict sentiment (even though it can be applied more generically to other domains for example sentiment analysis for tweets, comments, customer feedback, etc). Whole idea here is that movie reviews are made of sequen... |
Selects all <p> elements where the parent is a <div> element with CSS | Use the element > element selector to select an element with a parent element.
You can try to run the following code to select all <p> elements where the parent is a <div> element,
Live Demo
<!DOCTYPE html>
<html>
<head>
<style>
div > p {
color: white;
background-color: blue;
... | [
{
"code": null,
"e": 1141,
"s": 1062,
"text": "Use the element > element selector to select an element with a parent element."
},
{
"code": null,
"e": 1243,
"s": 1141,
"text": "You can try to run the following code to select all <p> elements where the parent is a <div> element,"
... |
12 Ways to Apply a Function to Each Row in Pandas DataFrame | Towards Data Science | Applying a function to all rows in a Pandas DataFrame is one of the most common operations during data wrangling. Pandas DataFrame apply function is the most obvious choice for doing it. It takes a function as an argument and applies it along an axis of the DataFrame. However, it is not always the best choice.
In this ... | [
{
"code": null,
"e": 483,
"s": 171,
"text": "Applying a function to all rows in a Pandas DataFrame is one of the most common operations during data wrangling. Pandas DataFrame apply function is the most obvious choice for doing it. It takes a function as an argument and applies it along an axis of t... |
How to set the output directory of TestNG @BeforeTest? | TestNG supports default report generation when a user runs testng.xml, either from an IDE or the command line. By default, all reports are generated at the Project -> test-output folder. If the test-output folder is not present, then TestNG creates it at runtime and saves all the files related to the result.
However, t... | [
{
"code": null,
"e": 1372,
"s": 1062,
"text": "TestNG supports default report generation when a user runs testng.xml, either from an IDE or the command line. By default, all reports are generated at the Project -> test-output folder. If the test-output folder is not present, then TestNG creates it a... |
Number of subsets with zero sum - GeeksforGeeks | 13 May, 2021
Given an array ‘arr’ consisting of integers, the task is to find the number of subsets such that their sum is equal to zero. Empty subset should also be considered.
Examples:
Input : arr[] = {2, 2, -4} Output : 2 All possible subsets: {} = 0 {2} = 2 {2} = 2 {-4} = -4 {2, 2} = 4 {2, -4} = -2 {2, -4} = -4 {... | [
{
"code": null,
"e": 24820,
"s": 24792,
"text": "\n13 May, 2021"
},
{
"code": null,
"e": 24985,
"s": 24820,
"text": "Given an array ‘arr’ consisting of integers, the task is to find the number of subsets such that their sum is equal to zero. Empty subset should also be considered... |
C++ 2-D Arrays | Set-1 | Practice | GeeksforGeeks | Given an 2-d array ofintegers havingN*Nelements, print the transpose of the array.
Example 1:
Input : arr[] = {{1,2,3}, {4,5,6}, {7,8,9}} and N = 3Output : 1 4 7 2 5 8 3 6 9Explanation:1 2 3 1 4 74 5 6 ----> 2 5 87 8 9 3 6 9Transpose of array.
Example 2:
Input : arr[ ] = {{1, 2}, {1, 2}} and N = 2 O... | [
{
"code": null,
"e": 309,
"s": 226,
"text": "Given an 2-d array ofintegers havingN*Nelements, print the transpose of the array."
},
{
"code": null,
"e": 320,
"s": 309,
"text": "Example 1:"
},
{
"code": null,
"e": 490,
"s": 320,
"text": "Input : arr[] = {{1,2,3... |
How to use Hidden Component in ReactJS? | 20 Jun, 2022
Hidden component quickly and responsively toggles the visibility value of components and more with the hidden utilities. Material UI for React has this component available for us and it is very easy to integrate. We can use the Hidden component in ReactJS using the following approach.
Creating React Applic... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Jun, 2022"
},
{
"code": null,
"e": 314,
"s": 28,
"text": "Hidden component quickly and responsively toggles the visibility value of components and more with the hidden utilities. Material UI for React has this component available for... |
Python | Maximum and Minimum in a Set | 28 Dec, 2017
In this article, we will learn how to get the maximum and minimum element in a set in Python, using the built-in functions of Python.Examples:
Input : set = ([8, 16, 24, 1, 25, 3, 10, 65, 55])
Output : max is 65
Input : set = ([4, 12, 10, 9, 4, 13])
Output : min is 4
max() in a Set
The built-in function ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n28 Dec, 2017"
},
{
"code": null,
"e": 196,
"s": 53,
"text": "In this article, we will learn how to get the maximum and minimum element in a set in Python, using the built-in functions of Python.Examples:"
},
{
"code": null,
... |
Generate all palindromic numbers less than n | 24 Jan, 2022
Find all numbers less than n, which are palindromic. Numbers can be printed in any order.
Examples :
Input : n = 12
Output : 1, 2, 3, 4, 5, 6, 7, 8, 9, 11
Input : n = 104
Output : 1, 2, 3, 4, 5, 6, 7, 8, 9, 11,
22, 33, 44, 55, 66, 77, 88, 99, 101
[Note that below program prints these numbers
i... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Jan, 2022"
},
{
"code": null,
"e": 144,
"s": 54,
"text": "Find all numbers less than n, which are palindromic. Numbers can be printed in any order."
},
{
"code": null,
"e": 156,
"s": 144,
"text": "Examples : "
... |
Maximum possible XOR of every element in an array with another array | 08 Jul, 2021
Two arrays A and B consisting of N elements are given. The task is to compute the maximum possible XOR of every element in array A with array B.
Examples:
Input :
A : 7 3 9 12
B : 1 3 5 2
Output : 6 6 12 15
Explanation : 1 xor 7 = 6, 5 xor 3 = 6, 5
xor 9 = 12, 3 xor 12 = 15.
A naive approach to solve thi... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Jul, 2021"
},
{
"code": null,
"e": 199,
"s": 54,
"text": "Two arrays A and B consisting of N elements are given. The task is to compute the maximum possible XOR of every element in array A with array B."
},
{
"code": null,
... |
How to get value from address in Python ? | 23 Aug, 2021
In this article, we will discuss how to get the value from the address in Python. First, we have to calculate the memory address of the variable or python object which can be done by using the id() function.
Syntax:
id(python_object)
where, python_object is any python variable or data structure like list, ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 236,
"s": 28,
"text": "In this article, we will discuss how to get the value from the address in Python. First, we have to calculate the memory address of the variable or python object which can be ... |
Python Program for Linear Search | 22 Jun, 2022
Problem: Given an array arr[] of n elements, write a function to search a given element x in arr[].
Examples :
Input : arr[] = {10, 20, 80, 30, 60, 50,
110, 100, 130, 170}
x = 110;
Output : 6
Element x is present at index 6
Input : arr[] = {10, 20, 80, 30, 60, 50,
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 153,
"s": 52,
"text": "Problem: Given an array arr[] of n elements, write a function to search a given element x in arr[]. "
},
{
"code": null,
"e": 164,
"s": 153,
"text": "Exam... |
fc Command in Linux with Examples | 15 May, 2019
As we all know that LINUX is command friendly and while working on LINUX, you may deal with very long commands that may include long paths or really difficult syntax, and imagine what if working with such commands you do a minor mistake which will require re-writing of the entire command synopsis and its a... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n15 May, 2019"
},
{
"code": null,
"e": 699,
"s": 53,
"text": "As we all know that LINUX is command friendly and while working on LINUX, you may deal with very long commands that may include long paths or really difficult syntax, and ima... |
Set Cover Problem | Set 1 (Greedy Approximate Algorithm) | 22 Mar, 2017
Given a universe U of n elements, a collection of subsets of U say S = {S1, S2...,Sm} where every subset Si has an associated cost. Find a minimum cost subcollection of S that covers all elements of U.
Example:
U = {1,2,3,4,5}
S = {S1,S2,S3}
S1 = {4,1,3}, Cost(S1) = 5
S2 = {2,5}, Co... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n22 Mar, 2017"
},
{
"code": null,
"e": 256,
"s": 54,
"text": "Given a universe U of n elements, a collection of subsets of U say S = {S1, S2...,Sm} where every subset Si has an associated cost. Find a minimum cost subcollection of S tha... |
How to create a simple Responsive Footer in React JS ? | 26 Feb, 2021
A footer is an important element of a website’s design since it signals to the user that they have reached the end of the webpage and provides useful links to other areas of the website that the user may want to visit.
Problem Statement: Create a responsive footer using React styled-components and compound... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n26 Feb, 2021"
},
{
"code": null,
"e": 271,
"s": 52,
"text": "A footer is an important element of a website’s design since it signals to the user that they have reached the end of the webpage and provides useful links to other areas of ... |
PostgreSQL – INNER JOIN | 28 Aug, 2020
In PostgreSQL the INNER JOIN keyword selects all rows from both the tables as long as the condition satisfies. This keyword will create the result-set by combining all rows from both the tables where the condition satisfies i.e value of the common field will be the same.
Syntax:
SELECT table1.column1, tabl... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Aug, 2020"
},
{
"code": null,
"e": 300,
"s": 28,
"text": "In PostgreSQL the INNER JOIN keyword selects all rows from both the tables as long as the condition satisfies. This keyword will create the result-set by combining all rows fr... |
Univariate Linear Regression in Python | 29 Sep, 2021
Univariate data is the type of data in which the result depends only on one variable. For instance, dataset of points on a line can be considered as a univariate data where abscissa can be considered as input feature and ordinate can be considered as output/result.For example:For line Y = 2X + 3;Input feat... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Sep, 2021"
},
{
"code": null,
"e": 401,
"s": 54,
"text": "Univariate data is the type of data in which the result depends only on one variable. For instance, dataset of points on a line can be considered as a univariate data where a... |
Program to calculate area of a rhombus whose one side and diagonal are given | 19 Mar, 2022
Given the length of diagonal ‘d1’ of a rhombus and a side ‘a’, the task is to find the area of that rhombus.
A rhombus is a polygon having 4 equal sides in which both the opposite sides are parallel, and opposite angles are equal.
Examples:
Input: d = 15, a = 10
Output: 99.21567416492215
Input: d = 2... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n19 Mar, 2022"
},
{
"code": null,
"e": 164,
"s": 54,
"text": "Given the length of diagonal ‘d1’ of a rhombus and a side ‘a’, the task is to find the area of that rhombus. "
},
{
"code": null,
"e": 286,
"s": 164,
"tex... |
Creating a Pandas DataFrame | 22 Jun, 2021
In the real world, a Pandas DataFrame will be created by loading the datasets from existing storage, storage can be SQL Database, CSV file, and Excel file. Pandas DataFrame can be created from the lists, dictionary, and from a list of dictionary etc.
A Dataframe is a two-dimensional data structure, i.e.,... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Jun, 2021"
},
{
"code": null,
"e": 305,
"s": 52,
"text": "In the real world, a Pandas DataFrame will be created by loading the datasets from existing storage, storage can be SQL Database, CSV file, and Excel file. Pandas DataFrame c... |
Int16.CompareTo() Method in C# | The Int16.CompareTo() method in C# is used to compare this instance to a specified object or another Int16 instance and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object or the other Int16 instance.
Following is the syntax −
pu... | [
{
"code": null,
"e": 1354,
"s": 1062,
"text": "The Int16.CompareTo() method in C# is used to compare this instance to a specified object or another Int16 instance and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specifi... |
Enrich your train fold with a custom sampler inside an imblearn pipeline | by Nils Flaschel | Towards Data Science | When it comes to small data sets, life can get complicated. In medicine, a data set can easily consist of less than 100 patients/rows. But in the other dimension it can become pretty large — easily over 3000 features.
However, sometimes you will find a way to augment your data, which — in my case — means that you multi... | [
{
"code": null,
"e": 390,
"s": 172,
"text": "When it comes to small data sets, life can get complicated. In medicine, a data set can easily consist of less than 100 patients/rows. But in the other dimension it can become pretty large — easily over 3000 features."
},
{
"code": null,
"e": ... |
How to get full path of current file's directory in Python? | To know the complete path to current file use the os module.
>>> import os
>>> print(os.path.realpath(__file__))
/home/ayush/qna/path.py | [
{
"code": null,
"e": 1123,
"s": 1062,
"text": "To know the complete path to current file use the os module."
},
{
"code": null,
"e": 1199,
"s": 1123,
"text": ">>> import os\n>>> print(os.path.realpath(__file__))\n/home/ayush/qna/path.py"
}
] |
Python’s Dictionary In Details: Python Programming | by Rashida Nasrin Sucky | Towards Data Science | Dictionary is a composite datatype in the Python programming language. In a way, it is similar to lists. Lists are a collection of elements. Dictionaries are a collection of key, value pairs. Solutions to many programming problems can be easy and more concise with dictionaries. Here I am going to explain all the import... | [
{
"code": null,
"e": 562,
"s": 172,
"text": "Dictionary is a composite datatype in the Python programming language. In a way, it is similar to lists. Lists are a collection of elements. Dictionaries are a collection of key, value pairs. Solutions to many programming problems can be easy and more con... |
Find Harmonic mean using Arithmetic mean and Geometric mean using C++. | Here we will see how to get the Harmonic mean using the arithmetic mean and the geometric mean. The formula for these three means are like below −
Arithmetic Mean − (a + b)/2
Geometric Mean − ⟮a∗b⟯
Harmonic Mean − 2ab/(a+b)
The Harmonic Mean can be expressed using arithmetic mean and geometric mean using this formula −... | [
{
"code": null,
"e": 1209,
"s": 1062,
"text": "Here we will see how to get the Harmonic mean using the arithmetic mean and the geometric mean. The formula for these three means are like below −"
},
{
"code": null,
"e": 1237,
"s": 1209,
"text": "Arithmetic Mean − (a + b)/2"
},
... |
Pytorch [Basics] — Intro to RNN. This blog post takes you through the... | by Akshaj Verma | Towards Data Science | This blog post takes you through the implementation of Vanilla RNNs, Stacked RNNs, Bidirectional RNNs, and Stacked Bidirectional RNNs in PyTorch by predicting a sequence of numbers.
import numpy as npimport torchimport torch.nn as nnimport torch.optim as optimfrom torch.utils.data import Dataset, DataLoader
RNNs are ma... | [
{
"code": null,
"e": 354,
"s": 172,
"text": "This blog post takes you through the implementation of Vanilla RNNs, Stacked RNNs, Bidirectional RNNs, and Stacked Bidirectional RNNs in PyTorch by predicting a sequence of numbers."
},
{
"code": null,
"e": 481,
"s": 354,
"text": "impo... |
How to return table from MySQL function? | You cannot return table from MySQL function. The function can return string, integer, char etc. To return table from MySQL, use stored procedure, not function.
Let us first create a table −
mysql> create table DemoTable696 (
Id int,
Name varchar(100)
);
Query OK, 0 rows affected (0.77 sec)
Insert some records in ... | [
{
"code": null,
"e": 1222,
"s": 1062,
"text": "You cannot return table from MySQL function. The function can return string, integer, char etc. To return table from MySQL, use stored procedure, not function."
},
{
"code": null,
"e": 1252,
"s": 1222,
"text": "Let us first create a ... |
SQLAlchemy - Quick Guide | SQLAlchemy is a popular SQL toolkit and Object Relational Mapper. It is written in Python and gives full power and flexibility of SQL to an application developer. It is an open source and cross-platform software released under MIT license.
SQLAlchemy is famous for its object-relational mapper (ORM), using which, classe... | [
{
"code": null,
"e": 2580,
"s": 2340,
"text": "SQLAlchemy is a popular SQL toolkit and Object Relational Mapper. It is written in Python and gives full power and flexibility of SQL to an application developer. It is an open source and cross-platform software released under MIT license."
},
{
... |
Accenture Interview Experience (On-Campus) - GeeksforGeeks | 27 Nov, 2020
I recently appeared for the Accenture recruitment process. They were offering 2 profile roles:
Associate Software Engineer.Software Engineer/Full Stack Engineer.
Associate Software Engineer.
Software Engineer/Full Stack Engineer.
This was a Pool Campus Recruitment process.
Additional Requirements along wit... | [
{
"code": null,
"e": 25214,
"s": 25186,
"text": "\n27 Nov, 2020"
},
{
"code": null,
"e": 25309,
"s": 25214,
"text": "I recently appeared for the Accenture recruitment process. They were offering 2 profile roles:"
},
{
"code": null,
"e": 25376,
"s": 25309,
"tex... |
How can we use a MySQL subquery with FROM clause? | Subqueries can work well in a SELECT statement FROM clause. Following is the syntax for the same −
SELECT ... FROM(subquery) [AS] name ...
To make it understand we are using the following data from table ‘cars’ −
mysql> Select * from Cars;
+------+--------------+---------+
| ID | Name | Price |
+------+----... | [
{
"code": null,
"e": 1161,
"s": 1062,
"text": "Subqueries can work well in a SELECT statement FROM clause. Following is the syntax for the same −"
},
{
"code": null,
"e": 1201,
"s": 1161,
"text": "SELECT ... FROM(subquery) [AS] name ..."
},
{
"code": null,
"e": 1275,
... |
Productivity Tips for Jupyter Users | by Shinichi Okada | Towards Data Science | Table of ContentsIntroduction1. Startup files2. Auto reload3. Multi-cursor4. Exit confirmation5. Update you python packages6. Copying cells from another file
To be an efficient Jupyter user, there are few things you need to know. In this article, I am going through six tips that will improve your productivity. These ti... | [
{
"code": null,
"e": 205,
"s": 47,
"text": "Table of ContentsIntroduction1. Startup files2. Auto reload3. Multi-cursor4. Exit confirmation5. Update you python packages6. Copying cells from another file"
},
{
"code": null,
"e": 417,
"s": 205,
"text": "To be an efficient Jupyter us... |
Commonly Asked C Programming Interview Questions | Set 2 - GeeksforGeeks | 28 Jun, 2021
This post is second set of Commonly Asked C Programming Interview Questions | Set 1What are main characteristics of C language? C is a procedural language. The main features of C language include low-level access to memory, simple set of keywords, and clean style. These features make it suitable for system... | [
{
"code": null,
"e": 24552,
"s": 24524,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24920,
"s": 24552,
"text": "This post is second set of Commonly Asked C Programming Interview Questions | Set 1What are main characteristics of C language? C is a procedural language. The mai... |
DAX Aggregation SELECTCOLUMNS function | Adds calculated columns to the given table or table expression. DAX SELECTCOLUMNS function is new in Excel 2016.
SELECTCOLUMNS (<table>, <name>, <scalar_expression>, [<name>, <scalar_expression>] ...)
table
Table or a DAX expression that returns a table.
name
The name given to the column, enclosed in double quotes.
s... | [
{
"code": null,
"e": 2114,
"s": 2001,
"text": "Adds calculated columns to the given table or table expression. DAX SELECTCOLUMNS function is new in Excel 2016."
},
{
"code": null,
"e": 2204,
"s": 2114,
"text": "SELECTCOLUMNS (<table>, <name>, <scalar_expression>, [<name>, <scalar... |
shutdown - Unix, Linux Command | If shutdown is called with a delay, it creates the advisory file
/etc/nologin which causes programs such as login(1) to not allow new user
logins. Shutdown removes this file if it is stopped before it
can signal init (i.e. it is cancelled or something goes wrong).
It also removes it before calling init to change the ru... | [
{
"code": null,
"e": 10907,
"s": 10577,
"text": "\nIf shutdown is called with a delay, it creates the advisory file\n/etc/nologin which causes programs such as login(1) to not allow new user\nlogins. Shutdown removes this file if it is stopped before it\ncan signal init (i.e. it is cancelled or some... |
Java 9 - REPL (JShell) | REPL stands for Read-Eval-Print Loop. With JShell, java has REPL capability. Using REPL, we can code and test java based logic without compiling using javac and see the result of calculations directly.
Open command prompt and type jshell.
$ jshell
| Welcome to JShell -- Version 9-ea
| For an introduction type: /help ... | [
{
"code": null,
"e": 2311,
"s": 2109,
"text": "REPL stands for Read-Eval-Print Loop. With JShell, java has REPL capability. Using REPL, we can code and test java based logic without compiling using javac and see the result of calculations directly."
},
{
"code": null,
"e": 2348,
"s":... |
C program to calculate distance between three points in 3D | Given with the 3-D plane and hence three coordinates and the task is to find the distance between the given points and display the result.
In a three dimension plane there are three axis that are x-axis with its coordinates as (x1, y1, z1), y-axis with its coordinates as (x2, y2, z2) and z-axis with its coordinates as ... | [
{
"code": null,
"e": 1201,
"s": 1062,
"text": "Given with the 3-D plane and hence three coordinates and the task is to find the distance between the given points and display the result."
},
{
"code": null,
"e": 1481,
"s": 1201,
"text": "In a three dimension plane there are three ... |
How to use useState in arrow function instead of hook ? - GeeksforGeeks | 24 Mar, 2021
The useState hook is used to update the state in a React component. It is a hook that takes the initial state as an argument and returns an array of two entries. It can be used in a React class based component as well as a functional component (declared using the function or const keyword). The functional ... | [
{
"code": null,
"e": 26097,
"s": 26069,
"text": "\n24 Mar, 2021"
},
{
"code": null,
"e": 26740,
"s": 26097,
"text": "The useState hook is used to update the state in a React component. It is a hook that takes the initial state as an argument and returns an array of two entries. I... |
Create a balanced BST using vector in C++ STL - GeeksforGeeks | 29 Dec, 2021
Given an unsorted vector arr, the task is to create a balanced binary search tree using the elements of the array.
Note: There can be more than one balanced BST. Forming any is acceptable
Examples:
Input: arr[] = { 2, 1, 3}Output: 2 1 3Explanation: The tree formed is show below. The preorder traversal is... | [
{
"code": null,
"e": 26236,
"s": 26208,
"text": "\n29 Dec, 2021"
},
{
"code": null,
"e": 26351,
"s": 26236,
"text": "Given an unsorted vector arr, the task is to create a balanced binary search tree using the elements of the array."
},
{
"code": null,
"e": 26424,
... |
VB.Net - Arithmetic Operators | Following table shows all the arithmetic operators supported by VB.Net. Assume variable A holds 2 and variable B holds 7, then −
Try the following example to understand all the arithmetic operators available in VB.Net −
Module operators
Sub Main()
Dim a As Integer = 21
Dim b As Integer = 10
Dim p A... | [
{
"code": null,
"e": 2429,
"s": 2300,
"text": "Following table shows all the arithmetic operators supported by VB.Net. Assume variable A holds 2 and variable B holds 7, then −"
},
{
"code": null,
"e": 2520,
"s": 2429,
"text": "Try the following example to understand all the arith... |
Pair Class in JavaTuples - GeeksforGeeks | 05 Aug, 2021
A Pair is a Tuple from JavaTuples library that deals with 2 elements. Since this Pair is a generic class, it can hold any type of value in it.Since Pair is a Tuple, hence it also has all the characteristics of JavaTuples:
They are Typesafe
They are Immutable
They are Iterable
They are Serializable
They ar... | [
{
"code": null,
"e": 24284,
"s": 24256,
"text": "\n05 Aug, 2021"
},
{
"code": null,
"e": 24507,
"s": 24284,
"text": "A Pair is a Tuple from JavaTuples library that deals with 2 elements. Since this Pair is a generic class, it can hold any type of value in it.Since Pair is a Tuple... |
Find the fractional (or n/k - th) node in linked list - GeeksforGeeks | 07 Feb, 2022
Given a singly linked list and a number k, write a function to find the (n/k)-th element, where n is the number of elements in the list. We need to consider ceil value in case of decimals.Examples:
Input : list = 1->2->3->4->5->6
k = 2
Output : 3
Since n = 6 and k = 2, we print (6/2)-th node
wh... | [
{
"code": null,
"e": 32806,
"s": 32778,
"text": "\n07 Feb, 2022"
},
{
"code": null,
"e": 33006,
"s": 32806,
"text": "Given a singly linked list and a number k, write a function to find the (n/k)-th element, where n is the number of elements in the list. We need to consider ceil v... |
Convert Adjacency List to Adjacency Matrix representation of a Graph - GeeksforGeeks | 30 Jun, 2021
Given an adjacency list representation of a Graph, the task is to convert the given Adjacency List to Adjacency Matrix representation.
Examples:
Input: adjList[] = {{0 –> 1 –> 3}, {1 –> 2}, {2 –> 3}} Output: 0 1 0 10 0 1 00 0 0 10 0 0 0
Input: adjList[] = {{0 –> 1 –> 4}, {1 –> 0 –> 2 –> 3 –> 4}, {2 –> 1 ... | [
{
"code": null,
"e": 26743,
"s": 26715,
"text": "\n30 Jun, 2021"
},
{
"code": null,
"e": 26878,
"s": 26743,
"text": "Given an adjacency list representation of a Graph, the task is to convert the given Adjacency List to Adjacency Matrix representation."
},
{
"code": null,
... |
Using Machine Learning to Predict if a F1 Driver Will Score | by Caio Santos Pedroso | Towards Data Science | I’m a huge fan of Formula One, all the technology, the mechanics, how fast everything evolves, the amount of investment in research, all these characteristics make me being fascinated about this world, and recently surfing the web I’ve found this dataset in kaggle with compiled data from 1950 to 2020, so I decide to pl... | [
{
"code": null,
"e": 674,
"s": 171,
"text": "I’m a huge fan of Formula One, all the technology, the mechanics, how fast everything evolves, the amount of investment in research, all these characteristics make me being fascinated about this world, and recently surfing the web I’ve found this dataset ... |
Pair with given sum in a sorted array | Practice | GeeksforGeeks | You are given an array Arr of size N. You need to find all pairs in the array that sum to a number K. If no such pair exists then output will be -1. The elements of the array are distinct and are in sorted order.
Note: (a,b) and (b,a) are considered same. Also, an element cannot pair with itself, i.e., (a,a) is invalid... | [
{
"code": null,
"e": 548,
"s": 226,
"text": "You are given an array Arr of size N. You need to find all pairs in the array that sum to a number K. If no such pair exists then output will be -1. The elements of the array are distinct and are in sorted order.\nNote: (a,b) and (b,a) are considered same... |
How to find out which character key is pressed using JavaScript? | 06 Sep, 2019
Here, the task is to get the character key, which is pressed. In the code written below, an event triggered when any key is pressed and it calls a function then that function identifies it.
Approach:
Attach an event to the input box. like onkeypress event.
Call a function when that event happens and pass t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Sep, 2019"
},
{
"code": null,
"e": 218,
"s": 28,
"text": "Here, the task is to get the character key, which is pressed. In the code written below, an event triggered when any key is pressed and it calls a function then that function ... |
How to use hide() method on button click using jQuery ? | 10 Aug, 2021
jQuery has a lot of handy methods to get the work done easily. In this article, we will discuss one of them which is the hide() method. We can use this method for various purposes on our webpage and get an efficient result.
The very first step will be creating an HTML file and link the jQuery library file ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n10 Aug, 2021"
},
{
"code": null,
"e": 278,
"s": 54,
"text": "jQuery has a lot of handy methods to get the work done easily. In this article, we will discuss one of them which is the hide() method. We can use this method for various pur... |
LRU Cache implementation using Double Linked Lists | 01 Sep, 2021
Given a pre define size of a list N and an array Arr. The task is to implement Least Recently Used(LRU) algorithm using Double Linked Lists. The program takes two sets of inputs. First, The size of the linked list. Second, The element to search in the linked list.Examples:
Input: N = 3, Arr = { 1, 2, 3 } ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Sep, 2021"
},
{
"code": null,
"e": 303,
"s": 28,
"text": "Given a pre define size of a list N and an array Arr. The task is to implement Least Recently Used(LRU) algorithm using Double Linked Lists. The program takes two sets of inpu... |
FORMAT() Function in SQL Server | 04 Oct, 2021
The FORMAT() function is one of the String Functions, which is used to format the specified value in the given format.
Syntax :
FORMAT(value, format, culture)
Parameter:
This method accepts three parameters as mentioned above and described below:
Value: It is the value to do formatting. It should be ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Oct, 2021"
},
{
"code": null,
"e": 148,
"s": 28,
"text": "The FORMAT() function is one of the String Functions, which is used to format the specified value in the given format. "
},
{
"code": null,
"e": 158,
"s": 148,... |
Lodash_.shuffle() Method | 01 Oct, 2020
The _.shuffle() method shuffles of collection by returning the new array.
Syntax:
_.shuffle(collection)
Parameters: This method accepts a single parameter as mentioned above and described below:
collection: This parameter holds the collection to inspect.
Return Value: This method returns the new array af... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Oct, 2020"
},
{
"code": null,
"e": 102,
"s": 28,
"text": "The _.shuffle() method shuffles of collection by returning the new array."
},
{
"code": null,
"e": 111,
"s": 102,
"text": "Syntax: "
},
{
"code": n... |
Generating all possible Subsequences using Recursion including the empty one. | 25 May, 2022
Given an array. The task is to generate and print all of the possible subsequences of the given array using recursion.
Examples:
Input : [1, 2, 3]
Output : [3], [2], [2, 3], [1], [1, 3], [1, 2], [1, 2, 3], []
Input : [1, 2]
Output : [2], [1], [1, 2], []
Approach: For every element in the array, there a... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n25 May, 2022"
},
{
"code": null,
"e": 171,
"s": 52,
"text": "Given an array. The task is to generate and print all of the possible subsequences of the given array using recursion."
},
{
"code": null,
"e": 182,
"s": 171,... |
Python – Network Interface | 24 Nov, 2020
Network interface is nothing but interconnection between two hardware equipment or protocol layers in a computer network. A network interface usually has some form of the network address. It is generally a network interface card that does not have any physical existence. It can be implemented in a software... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Nov, 2020"
},
{
"code": null,
"e": 347,
"s": 28,
"text": "Network interface is nothing but interconnection between two hardware equipment or protocol layers in a computer network. A network interface usually has some form of the netw... |
Tabs With Dropdown Bootstrap Example | To create tabs with Bootstrap, use the .nav and .nav-tabs classes. With that use the .dropdown-menu class.
Start with a basic unordered list with the base class of .nav
Add the class .nav-tabs.
Now add an unordered list with a .dropdown-menu class.
You can try to run the following code to create tabs with drop-down −
... | [
{
"code": null,
"e": 1169,
"s": 1062,
"text": "To create tabs with Bootstrap, use the .nav and .nav-tabs classes. With that use the .dropdown-menu class."
},
{
"code": null,
"e": 1231,
"s": 1169,
"text": "Start with a basic unordered list with the base class of .nav"
},
{
... |
CSS overflow-y Property - GeeksforGeeks | 09 Aug, 2019
The overflow-y property of CSS specifies the behavior of content when it overflows a block-level element’s top and bottom edges. The content may be clipped, hidden or a scrollbar may be displayed accordingly based on the value assigned to the overflow-y property.
Syntax:
overflow-y: scroll | hidden | visib... | [
{
"code": null,
"e": 22782,
"s": 22754,
"text": "\n09 Aug, 2019"
},
{
"code": null,
"e": 23046,
"s": 22782,
"text": "The overflow-y property of CSS specifies the behavior of content when it overflows a block-level element’s top and bottom edges. The content may be clipped, hidden... |
JavaScript Data Types | JavaScript variables can hold different data types: numbers,
strings, objects and more:
In programming, data types is an important concept.
To be able to operate on variables, it is important to know something about
the type.
Without data types, a computer cannot safely solve this:
Does it make any sense to add "Volv... | [
{
"code": null,
"e": 89,
"s": 0,
"text": "JavaScript variables can hold different data types: numbers, \nstrings, objects and more:"
},
{
"code": null,
"e": 141,
"s": 89,
"text": "In programming, data types is an important concept."
},
{
"code": null,
"e": 228,
"s... |
Submitting your MATLAB jobs using Slurm to High-Performance Clusters | by Rahul Bhadani | Towards Data Science | In my previous article, I wrote about using PBS job schedulers for submitting jobs to High-Performance Clusters (HPC) to meet our computation need. However, not all HPC support PBS jobs. Recently my institution also decided to use another kind of job scheduler called Slurm for its newly installed clusters.
medium.com
T... | [
{
"code": null,
"e": 480,
"s": 172,
"text": "In my previous article, I wrote about using PBS job schedulers for submitting jobs to High-Performance Clusters (HPC) to meet our computation need. However, not all HPC support PBS jobs. Recently my institution also decided to use another kind of job sche... |
Convert vowels from upper to lower or lower to upper using C program | An array of characters is called a string.
Following is the declaration for an array −
char stringname [size];
For example − char a[50]; string of length 50 characters
Using single character constant −
char a[10] = { ‘H’, ‘e’, ‘l’, ‘l’, ‘o’ ,‘\0’}
Using string constants −
char a[10] = "Hello":;
There is a control strin... | [
{
"code": null,
"e": 1105,
"s": 1062,
"text": "An array of characters is called a string."
},
{
"code": null,
"e": 1149,
"s": 1105,
"text": "Following is the declaration for an array −"
},
{
"code": null,
"e": 1173,
"s": 1149,
"text": "char stringname [size];"... |
What is Network Analysis?. A brief introduction with examples | by Mengsay Loem | Towards Data Science | If you are using any social media applications, you may have experienced the friend or follower suggestions functions. Have you ever wondered how these functions work? One common technology used in these cases is Network Analysis.
A network refers to a structure representing a group of objects/people and relationships ... | [
{
"code": null,
"e": 403,
"s": 172,
"text": "If you are using any social media applications, you may have experienced the friend or follower suggestions functions. Have you ever wondered how these functions work? One common technology used in these cases is Network Analysis."
},
{
"code": nu... |
list push_back() function in C++ STL | 13 Jun, 2022
The list:push_back() function in C++ STL is used to add a new element to an existing list container. It takes the element to be added as a parameter and adds it to the list container.Syntax:
list_name.push_back(value)
Parameters: This function accepts a single parameter which is mandatory value. This re... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 246,
"s": 53,
"text": "The list:push_back() function in C++ STL is used to add a new element to an existing list container. It takes the element to be added as a parameter and adds it to the list c... |
Delete all occurrences of a given key in a linked list | 03 Jul, 2022
Given a singly linked list, delete all occurrences of a given key in it. For example, consider the following list.
Example:
Input: 2 -> 2 -> 1 -> 8 -> 2 -> 3 -> 2 -> 7
Key to delete = 2
Output: 1 -> 8 -> 3 -> 7
This is mainly an extension of this post which deletes the first occurrence of a given... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n03 Jul, 2022"
},
{
"code": null,
"e": 167,
"s": 52,
"text": "Given a singly linked list, delete all occurrences of a given key in it. For example, consider the following list."
},
{
"code": null,
"e": 176,
"s": 167,
... |
Eigenspace and Eigenspectrum Values in a Matrix | 15 Jan, 2020
Prerequisites:
Mathematics | Eigen Values and Eigen Vectors
Matrix Multiplication
Null Space and Nullity of a Matrix
For a given matrix A the set of all eigenvectors of A associated with an eigenvalue spans a subspace, which is called the Eigenspace of A with respect to and is denoted by . The set of all... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Jan, 2020"
},
{
"code": null,
"e": 43,
"s": 28,
"text": "Prerequisites:"
},
{
"code": null,
"e": 88,
"s": 43,
"text": "Mathematics | Eigen Values and Eigen Vectors"
},
{
"code": null,
"e": 110,
"s"... |
K-th Lexicographically smallest binary string with A 0s and B 1s | 05 Oct, 2021
Given three positive integers A, B, and K, the task is to find the Kth lexicographically smallest binary string that contains exactly A number of 0s and B number of 1s.
Example:
Input: A = 2, B = 2, K = 4Output: 1001Explanation: The lexicographic order of the strings is 0011, 0101, 0110, 1001.
Input: A = 3... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Oct, 2021"
},
{
"code": null,
"e": 197,
"s": 28,
"text": "Given three positive integers A, B, and K, the task is to find the Kth lexicographically smallest binary string that contains exactly A number of 0s and B number of 1s."
},
... |
Scala – Vector | 03 Jul, 2020
Scala is an object-oriented programming language with functional and multi-paradigm support. Scala generates byte code and runs on Java Virtual Machine. Vectors in scala are immutable data structures providing random access for elements and is similar to the list. But, the list has incompetence of random a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Jul, 2020"
},
{
"code": null,
"e": 440,
"s": 28,
"text": "Scala is an object-oriented programming language with functional and multi-paradigm support. Scala generates byte code and runs on Java Virtual Machine. Vectors in scala are i... |
How can we call the invokeLater() method in Java?
| An invokeLater() method is a static method of the SwingUtilities class and it can be used to perform a task asynchronously in the AWT Event dispatcher thread. The SwingUtilities.invokeLater() method works like SwingUtilities.invokeAndWait() except that it puts the request on the event queue and returns immediately. An ... | [
{
"code": null,
"e": 1617,
"s": 1187,
"text": "An invokeLater() method is a static method of the SwingUtilities class and it can be used to perform a task asynchronously in the AWT Event dispatcher thread. The SwingUtilities.invokeLater() method works like SwingUtilities.invokeAndWait() except that ... |
How to Use COIL Image Loader Library in Android Apps? | 23 Dec, 2020
COIL is an acronym for Coroutine Image Loader. COIL is one of the famous image loading libraries from URLs in Android. It is a modern library for loading images from the server. This library is used to load images from servers, assets folder as well as from the drawable folder in Android project. The impor... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Dec, 2020"
},
{
"code": null,
"e": 497,
"s": 28,
"text": "COIL is an acronym for Coroutine Image Loader. COIL is one of the famous image loading libraries from URLs in Android. It is a modern library for loading images from the serve... |
Fromordinal() Function Of Datetime.date Class In Python | 29 Aug, 2021
The fromordinal() function is used to return the Gregorian date corresponding to a specified Gregorian ordinal. This is the opposite of the toordinal() function that is used to convert a Gregorian date to a Gregorian ordinal. When a negative ordinal value or an ordinal beyond the value returned by the date... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Aug, 2021"
},
{
"code": null,
"e": 443,
"s": 28,
"text": "The fromordinal() function is used to return the Gregorian date corresponding to a specified Gregorian ordinal. This is the opposite of the toordinal() function that is used t... |
How to send HTTP response code in PHP? | 26 Mar, 2019
HTTP Response code: There are three approaches to accomplish the above requirement, depending on the version.
For PHP versions 4.0: In order to send the HTTP response code, we need to assemble the response code. To achieve this, use header() function. The header() function contains a special use-case which... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Mar, 2019"
},
{
"code": null,
"e": 138,
"s": 28,
"text": "HTTP Response code: There are three approaches to accomplish the above requirement, depending on the version."
},
{
"code": null,
"e": 404,
"s": 138,
"text... |
How to get element at specific position in List in C++ | 01 Dec, 2020
The list doesn’t have random access operator [] to access elements by indices, because std::list internally store elements in a doubly-linked list. So, to access an element at any Kth location, the idea is to iterate one by one from beginning to Kth element. Instead of iterating for K times. For this, an S... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n01 Dec, 2020"
},
{
"code": null,
"e": 421,
"s": 52,
"text": "The list doesn’t have random access operator [] to access elements by indices, because std::list internally store elements in a doubly-linked list. So, to access an element a... |
Difference between TreeMap and TreeSet in Java | 28 Jan, 2021
TreeSet is mainly an implementation of SortedSet in java where duplication is not allowed and objects are stored in sorted and ascending order.
Some important features of the TreeSet are:
In TreeSet duplicate values are not allowed because it implements the SortedSet interface.
Objects in a TreeSet are sto... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jan, 2021"
},
{
"code": null,
"e": 172,
"s": 28,
"text": "TreeSet is mainly an implementation of SortedSet in java where duplication is not allowed and objects are stored in sorted and ascending order."
},
{
"code": null,
... |
SciPy – Spatial Distance Matrix | 17 Nov, 2021
A distance matrix contains the distances computed pairwise between the vectors of matrix/ matrices. scipy.spatial package provides us distance_matrix() method to compute the distance matrix. Generally matrices are in the form of 2-D array and the vectors of the matrix are matrix rows ( 1-D array).
Syntax: ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Nov, 2021"
},
{
"code": null,
"e": 327,
"s": 28,
"text": "A distance matrix contains the distances computed pairwise between the vectors of matrix/ matrices. scipy.spatial package provides us distance_matrix() method to compute the d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.