title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Java Examples - Search a file in a directory | How to search for a file in a directory ?
Following example shows how to search for a particular file in a directory by making a Filefiter. Following example displays all the files having file names starting with 'b'.
import java.io.*;
public class Main {
public static void main(String[] args) {
File dir = n... | [
{
"code": null,
"e": 2110,
"s": 2068,
"text": "How to search for a file in a directory ?"
},
{
"code": null,
"e": 2286,
"s": 2110,
"text": "Following example shows how to search for a particular file in a directory by making a Filefiter. Following example displays all the files h... |
Find a triplet such that sum of two equals to third element - GeeksforGeeks | 06 Apr, 2022
Given an array of integers, you have to find three numbers such that the sum of two elements equals the third element.
Examples:
Input : {5, 32, 1, 7, 10, 50, 19, 21, 2}
Output : 21, 2, 19
Input : {5, 32, 1, 7, 10, 50, 19, 21, 0}
Output : no such triplet exist
Question source: Arcesium Interview Experien... | [
{
"code": null,
"e": 25164,
"s": 25136,
"text": "\n06 Apr, 2022"
},
{
"code": null,
"e": 25283,
"s": 25164,
"text": "Given an array of integers, you have to find three numbers such that the sum of two elements equals the third element."
},
{
"code": null,
"e": 25294,
... |
PHP | Superglobals - GeeksforGeeks | 29 Jun, 2021
We already have discussed about variables and global variables in PHP in the post PHP | Variables and Data Types. In this article, we will learn about superglobals in PHP.
These are specially-defined array variables in PHP that make it easy for you to get information about a request or its context. The sup... | [
{
"code": null,
"e": 40920,
"s": 40892,
"text": "\n29 Jun, 2021"
},
{
"code": null,
"e": 41092,
"s": 40920,
"text": "We already have discussed about variables and global variables in PHP in the post PHP | Variables and Data Types. In this article, we will learn about superglobals... |
How to convert a Python csv string to array? | Easiest way is to use the str.split method to split on every occurance of ',' and map every string to the strip method to remove any leading/trailing whitespace. For example,
>>> s = "1, John Doe, Boston, USA"
>>> print map(str.strip, s.split(','))
['1', 'John Doe', 'Boston', 'USA']
If you have a multi-line string with... | [
{
"code": null,
"e": 1237,
"s": 1062,
"text": "Easiest way is to use the str.split method to split on every occurance of ',' and map every string to the strip method to remove any leading/trailing whitespace. For example,"
},
{
"code": null,
"e": 1346,
"s": 1237,
"text": ">>> s =... |
C++ Program to Find GCD | The Greatest Common Divisor (GCD) of two numbers is the largest number that divides both of them.
For example: Let’s say we have two numbers are 45 and 27.
45 = 5 * 3 * 3
27 = 3 * 3 * 3
So, the GCD of 45 and 27 is 9.
A program to find the GCD of two numbers is given as follows.
Live Demo
#include <iostream>
using name... | [
{
"code": null,
"e": 1160,
"s": 1062,
"text": "The Greatest Common Divisor (GCD) of two numbers is the largest number that divides both of them."
},
{
"code": null,
"e": 1218,
"s": 1160,
"text": "For example: Let’s say we have two numbers are 45 and 27."
},
{
"code": null... |
Diameter of a Binary Tree | Practice | GeeksforGeeks | The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two end nodes. The diagram below shows two trees each with diameter nine, the leaves that form the ends of the longest path are shaded (note that there is more than one path in each tree of length nine, but no path lo... | [
{
"code": null,
"e": 634,
"s": 290,
"text": "The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two end nodes. The diagram below shows two trees each with diameter nine, the leaves that form the ends of the longest path are shaded (note that there ... |
Python program to right rotate n-numbers by 1 - GeeksforGeeks | 31 Dec, 2020
Given a number n. The task is to print n-integers n-times (starting from 1) and right rotate the integers by after each iteration.Examples:
Input : 6
Output :
1 2 3 4 5 6
2 3 4 5 6 1
3 4 5 6 1 2
4 5 6 1 2 3
5 6 1 2 3 4
6 1 2 3 4 5
Input : 3
Output :
1 2 3
2 3 1
3 1 2
Below is the implementation.
P... | [
{
"code": null,
"e": 24317,
"s": 24289,
"text": "\n31 Dec, 2020"
},
{
"code": null,
"e": 24459,
"s": 24317,
"text": "Given a number n. The task is to print n-integers n-times (starting from 1) and right rotate the integers by after each iteration.Examples: "
},
{
"code":... |
Count of triplets in an array that satisfy the given conditions - GeeksforGeeks | 14 May, 2021
Given an array arr[] of N elements, the task is to find the count of triplets (arr[i], arr[j], arr[k]) such that (arr[i] + arr[j] + arr[k] = L) and (L % arr[i] = L % arr[j] = L % arr[k] = 0.Examples:
Input: arr[] = {2, 4, 5, 6, 7} Output: 1 Only possible triplet is {2, 4, 6}Input: arr[] = {4, 4, 4, 4, 4}... | [
{
"code": null,
"e": 24796,
"s": 24768,
"text": "\n14 May, 2021"
},
{
"code": null,
"e": 24998,
"s": 24796,
"text": "Given an array arr[] of N elements, the task is to find the count of triplets (arr[i], arr[j], arr[k]) such that (arr[i] + arr[j] + arr[k] = L) and (L % arr[i] = L... |
Count Unique Values in R - GeeksforGeeks | 30 May, 2021
In this article, we will see how we can count unique values in R programming language.
Example:
Input: 1 2 3 2 4 5 1 6 8 9 8 6 6 6 6
Output: 8
Unique() function when provided with a list will give out only the unique ones from it. Later length() function can calculate the frequency.
Syntax:
length(unique... | [
{
"code": null,
"e": 25242,
"s": 25214,
"text": "\n30 May, 2021"
},
{
"code": null,
"e": 25329,
"s": 25242,
"text": "In this article, we will see how we can count unique values in R programming language."
},
{
"code": null,
"e": 25338,
"s": 25329,
"text": "Exa... |
Program to find first positive missing integer in range in Python | Suppose we have a list of sorted list of distinct integers of size n, we have to find the first positive number in range [1 to n+1] that is not present in the array.
So, if the input is like nums = [0,5,1], then the output will be 2, as 2 is the first missing number in range 1 to 5.
To solve this, we will follow these ... | [
{
"code": null,
"e": 1228,
"s": 1062,
"text": "Suppose we have a list of sorted list of distinct integers of size n, we have to find the first positive number in range [1 to n+1] that is not present in the array."
},
{
"code": null,
"e": 1346,
"s": 1228,
"text": "So, if the input... |
Difference between Virtual function and Pure virtual function in C++ - GeeksforGeeks | 16 Jun, 2021
Virtual Function in C++A virtual function is a member function which is declared within a base class and is re-defined(Overriden) by a derived class. When you refer to a derived class object using a pointer or a reference to the base class, you can call a virtual function for that object and execute the de... | [
{
"code": null,
"e": 24122,
"s": 24094,
"text": "\n16 Jun, 2021"
},
{
"code": null,
"e": 24468,
"s": 24122,
"text": "Virtual Function in C++A virtual function is a member function which is declared within a base class and is re-defined(Overriden) by a derived class. When you refe... |
PL/SQL - Comparison Operators | Comparison operators are used for comparing one expression to another. The result is always either TRUE, FALSE or NULL.
This program tests the LIKE operator. Here, we will use a small procedure() to show the functionality of the LIKE operator −
DECLARE
PROCEDURE compare (value varchar2, pattern varchar2 ) is
BEGIN ... | [
{
"code": null,
"e": 2185,
"s": 2065,
"text": "Comparison operators are used for comparing one expression to another. The result is always either TRUE, FALSE or NULL."
},
{
"code": null,
"e": 2310,
"s": 2185,
"text": "This program tests the LIKE operator. Here, we will use a smal... |
How to find the raise to the power of all values in an R vector? | Often, we need to find the power of a value or the power of all values in an R vector, especially in cases when we are dealing with polynomial models. This can be done by using ^ sign as we do in Excel. For example, if we have a vector x then the square of all values in x can be found as x^2.
Live Demo
x1<-1:10
x1
[1]... | [
{
"code": null,
"e": 1356,
"s": 1062,
"text": "Often, we need to find the power of a value or the power of all values in an R vector, especially in cases when we are dealing with polynomial models. This can be done by using ^ sign as we do in Excel. For example, if we have a vector x then the square... |
p5.js | storeItem() Function - GeeksforGeeks | 17 Jan, 2020
The storeItem() function is used to store a given value under a key name in the local storage of the browser. The local storage persists between browsing sessions and can store values even after reloading the page.
It can be used to save non-sensitive information, such as user preferences. Sensitive data l... | [
{
"code": null,
"e": 43692,
"s": 43664,
"text": "\n17 Jan, 2020"
},
{
"code": null,
"e": 43907,
"s": 43692,
"text": "The storeItem() function is used to store a given value under a key name in the local storage of the browser. The local storage persists between browsing sessions ... |
How to establish a connection with the database using the properties file in JDBC? | One of the variant of the getConnection() method of the DriverManager class accepts url of the database, (String format) a properties file and establishes connection with the database.
Connection con = DriverManager.getConnection(url, properties);
To establish a connection with a database using this method −
Set the Dr... | [
{
"code": null,
"e": 1247,
"s": 1062,
"text": "One of the variant of the getConnection() method of the DriverManager class accepts url of the database, (String format) a properties file and establishes connection with the database."
},
{
"code": null,
"e": 1310,
"s": 1247,
"text"... |
Network Programming in Python - DNS Look-up - GeeksforGeeks | 25 Oct, 2020
Domain Name System also known as DNS is a phonebook of the internet, which has related to the domain name. DNS translates the domain names to the respective IP address so that browsers can access the resources. Python provides DNS module which is used to handle this translation of domain names to IP addres... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n25 Oct, 2020"
},
{
"code": null,
"e": 24604,
"s": 24292,
"text": "Domain Name System also known as DNS is a phonebook of the internet, which has related to the domain name. DNS translates the domain names to the respective IP add... |
SLF4J - Hello world | In this chapter, we will see a simple basic logger program using SLF4J. Follow the steps described below to write a simple logger.
Since the slf4j.Logger is the entry point of the SLF4J API, first, you need to get/create its object
The getLogger() method of the LoggerFactory class accepts a string value representing a ... | [
{
"code": null,
"e": 1916,
"s": 1785,
"text": "In this chapter, we will see a simple basic logger program using SLF4J. Follow the steps described below to write a simple logger."
},
{
"code": null,
"e": 2017,
"s": 1916,
"text": "Since the slf4j.Logger is the entry point of the SL... |
HTML | <input type="file"> - GeeksforGeeks | 29 May, 2019
The HTML <input type=”file”> is used to specify the file select field and add a button to choose a file for upload to the form.
Syntax:
<input type="file">
Example:
<!DOCTYPE html> <html> <head> <title> HTML input type file </title> <style> h1 { color: green;... | [
{
"code": null,
"e": 24545,
"s": 24517,
"text": "\n29 May, 2019"
},
{
"code": null,
"e": 24673,
"s": 24545,
"text": "The HTML <input type=”file”> is used to specify the file select field and add a button to choose a file for upload to the form."
},
{
"code": null,
"e"... |
Python | Image Registration using OpenCV | 06 Sep, 2021
Image registration is a digital image processing technique that helps us align different images of the same scene. For instance, one may click the picture of a book from various angles. Below are a few instances that show the diversity of camera angles.Now, we may want to “align” a particular image to the ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Sep, 2021"
},
{
"code": null,
"e": 673,
"s": 52,
"text": "Image registration is a digital image processing technique that helps us align different images of the same scene. For instance, one may click the picture of a book from vari... |
Program to print DNA sequence | 22 Jun, 2022
Given the value of n i.e, the number of lobes. Print the double-helix structure of Deoxyribonucleic acid(DNA).
Input: n = 8
Output:
AT
T--A
A----T
T------A
T------A
G----C
T--A
GC
CG
C--G
A----T
A------T
T------A
A----T
A--T
GC
AT
C--G
T----A
C------G
C------G
T----A
G--C
... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 166,
"s": 54,
"text": "Given the value of n i.e, the number of lobes. Print the double-helix structure of Deoxyribonucleic acid(DNA). "
},
{
"code": null,
"e": 427,
"s": 166,
"t... |
Java Program to Sort LinkedHashMap By Values | 09 Jun, 2021
The LinkedHashMap is just like HashMap with an additional feature of maintaining an order of elements inserted into it. HashMap provided the advantage of quick insertion, search, and deletion, but it never maintained the track and order of insertion which the LinkedHashMap provides where the elements can b... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Jun, 2021"
},
{
"code": null,
"e": 373,
"s": 28,
"text": "The LinkedHashMap is just like HashMap with an additional feature of maintaining an order of elements inserted into it. HashMap provided the advantage of quick insertion, sear... |
Laplacian Filter using Matlab | 17 Mar, 2022
Laplacian filter is a second-order derivate filter used in edge detection, in digital image processing. In 1st order derivative filters, we detect the edge along with horizontal and vertical directions separately and then combine both. But using the Laplacian filter we detect the edges in the whole image a... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n17 Mar, 2022"
},
{
"code": null,
"e": 369,
"s": 54,
"text": "Laplacian filter is a second-order derivate filter used in edge detection, in digital image processing. In 1st order derivative filters, we detect the edge along with horizon... |
Program to cyclically rotate an array by one | 12 Jul, 2022
Given an array, cyclically rotate the array clockwise by one.
Examples:
Input: arr[] = {1, 2, 3, 4, 5}
Output: arr[] = {5, 1, 2, 3, 4}
Following are steps. 1) Store last element in a variable say x. 2) Shift all elements one position ahead. 3) Replace first element of array with x.
C++
C
Java
Python3
... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n12 Jul, 2022"
},
{
"code": null,
"e": 116,
"s": 53,
"text": "Given an array, cyclically rotate the array clockwise by one. "
},
{
"code": null,
"e": 128,
"s": 116,
"text": "Examples: "
},
{
"code": null,
... |
How to convert Excel column to vector in R ? | 17 Jun, 2021
In this article, we will be looking at the different approaches to convert the Excel columns to vector in R Programming language.
The approaches to convert Excel column to vector in the R language are listed as follows:
Using $-Operator with the column name.Using the method of Subsetting column.Using pull... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Jun, 2021"
},
{
"code": null,
"e": 158,
"s": 28,
"text": "In this article, we will be looking at the different approaches to convert the Excel columns to vector in R Programming language."
},
{
"code": null,
"e": 248,
... |
How to Remove the Last Character From a Table in SQL? | 18 Oct, 2021
Here we will see, how to remove the last characters from a table in SQL. We can do this task using the SUBSTRING() function.
SUBSTRING(): This function is used to find a part of the given string from the given position. It takes three parameters:
String: It is a required parameter. It is the string on wh... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Oct, 2021"
},
{
"code": null,
"e": 153,
"s": 28,
"text": "Here we will see, how to remove the last characters from a table in SQL. We can do this task using the SUBSTRING() function."
},
{
"code": null,
"e": 277,
"s":... |
Integrating TinyMCE with Django | 05 Sep, 2020
TinyMCE is a online rich text editor which is fully flexible and provides customisation. mostly used to get dynamic data such as articles in GFG and much more, their is no static database for posts
Installation –
To integrate it with Django web app or website you need to first install its pip library
pip i... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 Sep, 2020"
},
{
"code": null,
"e": 252,
"s": 54,
"text": "TinyMCE is a online rich text editor which is fully flexible and provides customisation. mostly used to get dynamic data such as articles in GFG and much more, their is no st... |
Find N distinct numbers whose Bitwise XOR is equal to K | 24 Feb, 2022
Given two positive integers N and X, the task is to construct N positive integers having Bitwise XOR of all these integers equal to K.
Examples:
Input: N = 4, K = 6Output: 1 0 2 5Explanation: Bitwise XOR the integers {1, 0, 2, 5} = 1 XOR 0 XOR 2 XOR 5 = 6(= K).
Input: N = 1, K = 1Output: 1
Approach: The id... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Feb, 2022"
},
{
"code": null,
"e": 189,
"s": 54,
"text": "Given two positive integers N and X, the task is to construct N positive integers having Bitwise XOR of all these integers equal to K."
},
{
"code": null,
"e": 19... |
Stack vs Heap Memory Allocation | 13 Jun, 2022
Memory in a C/C++/Java program can either be allocated on a stack or a heap.Prerequisite: Memory layout of C program.
Stack Allocation: The allocation happens on contiguous blocks of memory. We call it a stack memory allocation because the allocation happens in the function call stack. The size of memory t... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 170,
"s": 52,
"text": "Memory in a C/C++/Java program can either be allocated on a stack or a heap.Prerequisite: Memory layout of C program."
},
{
"code": null,
"e": 1086,
"s": 170,... |
Python | os.path.size() method | 22 May, 2019
OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. os.path module is submodule of OS module in Python used for common path name manipulatio... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 May, 2019"
},
{
"code": null,
"e": 338,
"s": 28,
"text": "OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of usin... |
Given a sorted dictionary of an alien language, find order of characters | 23 Jun, 2022
Given a sorted dictionary (array of words) of an alien language, find order of characters in the language.
Examples:
Input: words[] = {"baa", "abcd", "abca", "cab", "cad"}
Output: Order of characters is 'b', 'd', 'a', 'c'
Note that words are sorted and in the given language "baa"
comes before "abcd", t... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Jun, 2022"
},
{
"code": null,
"e": 159,
"s": 52,
"text": "Given a sorted dictionary (array of words) of an alien language, find order of characters in the language."
},
{
"code": null,
"e": 171,
"s": 159,
"text":... |
Double doubleValue() method in Java with examples | 09 Oct, 2018
The doubleValue() method of Double class is a built in method to return the value specified by the calling object as double after type casting.
Syntax:
DoubleObject.doubleValue()
Return Value: It return the value of DoubleObject as double.
Below programs illustrate doubleValue() method in Java:
Program 1:
... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n09 Oct, 2018"
},
{
"code": null,
"e": 197,
"s": 53,
"text": "The doubleValue() method of Double class is a built in method to return the value specified by the calling object as double after type casting."
},
{
"code": null,
... |
Little and Big Endian Mystery | 12 Jun, 2022
What are these? Little and big endian are two ways of storing multibyte data-types ( int, float, etc). In little endian machines, last byte of binary representation of the multibyte data-type is stored first. On the other hand, in big endian machines, first byte of binary representation of the multibyte da... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n12 Jun, 2022"
},
{
"code": null,
"e": 573,
"s": 52,
"text": "What are these? Little and big endian are two ways of storing multibyte data-types ( int, float, etc). In little endian machines, last byte of binary representation of the mu... |
Non-Contiguous Allocation in Operating System | 13 Jun, 2022
Prerequisite – Variable Partitioning, Fixed Partitioning Paging and Segmentation are the two ways that allow a process’s physical address space to be non-contiguous. It has the advantage of reducing memory wastage but it increases the overheads due to address translation. It slows the execution of the memo... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 414,
"s": 54,
"text": "Prerequisite – Variable Partitioning, Fixed Partitioning Paging and Segmentation are the two ways that allow a process’s physical address space to be non-contiguous. It has t... |
Integer intValue() Method in Java | 03 May, 2022
intValue() of Integer class that is present inside java.lang package is an inbuilt method in java that returns the value of this integer as an int which is inherited from Number Class. The package view is as follows:
--> java.lang Package
--> Integer Class
--> intValue() Method
Syntax:
pu... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n03 May, 2022"
},
{
"code": null,
"e": 270,
"s": 53,
"text": "intValue() of Integer class that is present inside java.lang package is an inbuilt method in java that returns the value of this integer as an int which is inherited from Num... |
How to Create a Programming Language using Python? | 10 Jul, 2020
In this article, we are going to learn how to create your own programming language using SLY(Sly Lex Yacc) and Python. Before we dig deeper into this topic, it is to be noted that this is not a beginner’s tutorial and you need to have some knowledge of the prerequisites given below.
Rough knowledge about c... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n10 Jul, 2020"
},
{
"code": null,
"e": 336,
"s": 52,
"text": "In this article, we are going to learn how to create your own programming language using SLY(Sly Lex Yacc) and Python. Before we dig deeper into this topic, it is to be noted... |
How to get the file name from page URL using JavaScript ? | 29 Jan, 2020
Suppose you have given an HTML page and the task is to get the file name of an HTML page with the help of JavaScript. There are two approaches that are discussed below:
Approach 1: In this approach, window.location.pathname returns the relative URL of the page. Use split() method to split the URL on “/” an... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Jan, 2020"
},
{
"code": null,
"e": 197,
"s": 28,
"text": "Suppose you have given an HTML page and the task is to get the file name of an HTML page with the help of JavaScript. There are two approaches that are discussed below:"
},
... |
Variadic function templates in C++ | 25 Nov, 2021
Variadic templates are class or function templates, that can take any variable(zero or more) number of arguments. In C++, templates can have a fixed number of parameters only that have to be specified at the time of declaration. However, variadic templates help to overcome this issue. Douglas Gregor and Ja... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n25 Nov, 2021"
},
{
"code": null,
"e": 406,
"s": 52,
"text": "Variadic templates are class or function templates, that can take any variable(zero or more) number of arguments. In C++, templates can have a fixed number of parameters only... |
Scala Sequence | 01 Jun, 2021
Sequence is an iterable collection of class Iterable. It is used to represent indexed sequences that are having a defined order of element i.e. guaranteed immutable. The elements of sequences can be accessed using their indexes. Method apply is used for the purpose of indexing. Sequences can also be access... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Jun, 2021"
},
{
"code": null,
"e": 960,
"s": 28,
"text": "Sequence is an iterable collection of class Iterable. It is used to represent indexed sequences that are having a defined order of element i.e. guaranteed immutable. The eleme... |
Different Ways To Declare And Initialize 2-D Array in Java | 29 Oct, 2021
An array with more than one dimension is known as a multi-dimensional array. The most commonly used multi-dimensional arrays are 2-D and 3-D arrays. We can say that any higher dimensional array is basically an array of arrays. A very common example of a 2D Array is Chess Board. A chessboard is a grid conta... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n29 Oct, 2021"
},
{
"code": null,
"e": 740,
"s": 53,
"text": "An array with more than one dimension is known as a multi-dimensional array. The most commonly used multi-dimensional arrays are 2-D and 3-D arrays. We can say that any highe... |
Mean Function in MATLAB | 29 Jun, 2021
Mean or average is the average of a sequence of numbers. In MATLAB, mean (A) returns the mean of the components of A along the first array dimension whose size doesn’t equal to 1. Suppose that A is a vector, then mean(A) returns the mean of the components. Now, if A is a Matrix form, then mean(A) returns a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Jun, 2021"
},
{
"code": null,
"e": 384,
"s": 28,
"text": "Mean or average is the average of a sequence of numbers. In MATLAB, mean (A) returns the mean of the components of A along the first array dimension whose size doesn’t equal t... |
SQL Joins | A JOIN clause is used to combine rows from two or more tables, based on
a related column between them.
Let's look at a selection from the "Orders" table:
Then, look at a selection from the "Customers" table:
Notice that the "CustomerID" column in the "Orders" table refers to the
"CustomerID" in the "Customers" table.... | [
{
"code": null,
"e": 104,
"s": 0,
"text": "A JOIN clause is used to combine rows from two or more tables, based on \na related column between them."
},
{
"code": null,
"e": 155,
"s": 104,
"text": "Let's look at a selection from the \"Orders\" table:"
},
{
"code": null,
... |
Cucumber - Ruby Testing | Ruby language has the following advantages −
It is easy to understand.
It is easy to understand.
It is an object-oriented language.
It is an object-oriented language.
It is a powerful class library.
It is a powerful class library.
It has massive online support.
It has massive online support.
Following is the step-by-st... | [
{
"code": null,
"e": 2007,
"s": 1962,
"text": "Ruby language has the following advantages −"
},
{
"code": null,
"e": 2033,
"s": 2007,
"text": "It is easy to understand."
},
{
"code": null,
"e": 2059,
"s": 2033,
"text": "It is easy to understand."
},
{
... |
Evaluating Model Performance | To evaluate the model performance, we call evaluate method as follows −
loss_and_metrics = model.evaluate(X_test, Y_test, verbose=2)
To evaluate the model performance, we call evaluate method as follows −
loss_and_metrics = model.evaluate(X_test, Y_test, verbose=2)
We will print the loss and accuracy using the followi... | [
{
"code": null,
"e": 2031,
"s": 1959,
"text": "To evaluate the model performance, we call evaluate method as follows −"
},
{
"code": null,
"e": 2092,
"s": 2031,
"text": "loss_and_metrics = model.evaluate(X_test, Y_test, verbose=2)"
},
{
"code": null,
"e": 2164,
"s... |
Describe pass by value and pass by reference in JavaScript? | In pass by value, a function is called by directly passing the value of the variable as the argument. Changing the argument inside the function doesn’t affect the variable passed from outside the function. Javascript always pass by value so changing the value of the variable never changes the underlying primitive (Stri... | [
{
"code": null,
"e": 1397,
"s": 1062,
"text": "In pass by value, a function is called by directly passing the value of the variable as the argument. Changing the argument inside the function doesn’t affect the variable passed from outside the function. Javascript always pass by value so changing the... |
PyQt5 - Different border color to lineedit part on mouse hover (for non editable Combobox) - GeeksforGeeks | 06 May, 2020
In this article we will see how we can set different border color to the line edit part of the combo box when mouse hover over the line edit part, line edit is the part of combo box which displays the selected item, it is editable by nature. In order to set and access the line edit object we use setLineEdi... | [
{
"code": null,
"e": 25086,
"s": 25058,
"text": "\n06 May, 2020"
},
{
"code": null,
"e": 25429,
"s": 25086,
"text": "In this article we will see how we can set different border color to the line edit part of the combo box when mouse hover over the line edit part, line edit is the... |
Program to find lexicographically smallest subsequence of size k in Python | Suppose we have a list of numbers called nums and another value k, we have to find the lexicographically smallest subsequence of size k.
So, if the input is like nums = [2, 3, 1, 10, 3, 4] k = 3, then the output will be [1, 3, 4]
To solve this, we will follow these steps −
l := size of nums, r := k - 1
out := a new lis... | [
{
"code": null,
"e": 1199,
"s": 1062,
"text": "Suppose we have a list of numbers called nums and another value k, we have to find the lexicographically smallest subsequence of size k."
},
{
"code": null,
"e": 1292,
"s": 1199,
"text": "So, if the input is like nums = [2, 3, 1, 10,... |
Creating React + GraphQL Serverless Web application using AWS Amplify | by Janitha Tennakoon | Towards Data Science | AWS Amplify is a service provided by Amazon Web Services where it gives the ability to create end to end solutions for mobile and web platforms with a more secure and scalable way using AWS services. AWS Amplify was initially launched in November 2018 and since then many developers have created and deployed their new a... | [
{
"code": null,
"e": 578,
"s": 172,
"text": "AWS Amplify is a service provided by Amazon Web Services where it gives the ability to create end to end solutions for mobile and web platforms with a more secure and scalable way using AWS services. AWS Amplify was initially launched in November 2018 and... |
Visualizing the Stock Market with Tableau | by Tony Yiu | Towards Data Science | Tableau is a critical data visualization tool that belongs in every data analyst’s and data scientist’s toolkit. Today we play around with stock market data in order to explore how Tableau can help us dissect and better understand our data.
We can grab stock market data from Quandl. We’re going to focus on the S&P 500,... | [
{
"code": null,
"e": 413,
"s": 172,
"text": "Tableau is a critical data visualization tool that belongs in every data analyst’s and data scientist’s toolkit. Today we play around with stock market data in order to explore how Tableau can help us dissect and better understand our data."
},
{
... |
queue::front() and queue::back() in C++ STL | In this article we will be discussing the working, syntax and examples of queue::front() and queue::back() functions in C++ STL.
Queue is a simple sequence or data structure defined in the C++ STL which does insertion and deletion of the data in FIFO(First In First Out) fashion. The data in a queue is stored in continu... | [
{
"code": null,
"e": 1191,
"s": 1062,
"text": "In this article we will be discussing the working, syntax and examples of queue::front() and queue::back() functions in C++ STL."
},
{
"code": null,
"e": 1605,
"s": 1191,
"text": "Queue is a simple sequence or data structure defined ... |
Clojure - Maps get | Returns the value mapped to key, not-found or nil if key is not present.
Following is the syntax.
(get hmap key)
Parameters − ‘hmap’ is the map of hash keys and values. ‘key’ is the key for which the value needs to be returned.
Return Value − Returns the value of the key passed to the get function.
Following is an exa... | [
{
"code": null,
"e": 2447,
"s": 2374,
"text": "Returns the value mapped to key, not-found or nil if key is not present."
},
{
"code": null,
"e": 2472,
"s": 2447,
"text": "Following is the syntax."
},
{
"code": null,
"e": 2488,
"s": 2472,
"text": "(get hmap key... |
.NET Core - Adding References to Library | In this chapter, we will discuss how to add references to your library. Adding references to library is like adding references to your other projects, like console project and UWP project.
You can now see that the PCL project has some references by default. You can also add other references as per your application need... | [
{
"code": null,
"e": 2575,
"s": 2386,
"text": "In this chapter, we will discuss how to add references to your library. Adding references to library is like adding references to your other projects, like console project and UWP project."
},
{
"code": null,
"e": 2708,
"s": 2575,
"t... |
Deep Dive Into Desision Trees and Random Forest | by Vardaan Bajaj | Towards Data Science | In this post, we’ll go through:
Terminology of Decision TreesWays of Measuring ImpurityCART AlgorithmConstruction of a Decision Tree by hand using CARTWhy choose Random Forest over Decision TreesDiversification of Decision Trees in Random ForestImproving Titanic Dataset classifier using Random Forest
Terminology of Dec... | [
{
"code": null,
"e": 204,
"s": 172,
"text": "In this post, we’ll go through:"
},
{
"code": null,
"e": 474,
"s": 204,
"text": "Terminology of Decision TreesWays of Measuring ImpurityCART AlgorithmConstruction of a Decision Tree by hand using CARTWhy choose Random Forest over Decis... |
How to Make a Process Monitor in Python? - GeeksforGeeks | 04 Jul, 2021
A process monitor is a tool that displays the system information like processes, memory, network, and other stuff. There are plenty of tools available, but we can make our own process monitor using Python. In Python, there is a module called psutil that we can use to grab various information about our syst... | [
{
"code": null,
"e": 24318,
"s": 24290,
"text": "\n04 Jul, 2021"
},
{
"code": null,
"e": 24628,
"s": 24318,
"text": "A process monitor is a tool that displays the system information like processes, memory, network, and other stuff. There are plenty of tools available, but we can ... |
Python - Chunks and Chinks | Chunking is the process of grouping similar words together based on the nature of the word. In the below example we define a grammar by which the chunk must be generated. The grammar suggests the sequence of the phrases like nouns and adjectives etc. which will be followed when creating the chunks. The pictorial output... | [
{
"code": null,
"e": 2935,
"s": 2587,
"text": " Chunking is the process of grouping similar words together based on the nature of the word. In the below example we define a grammar by which the chunk must be generated. The grammar suggests the sequence of the phrases like nouns and adjectives etc. w... |
Word Ladder in C++ | Suppose we have two words (beginWord and endWord), and we have dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, such that −
Only one letter can be converted at a time.
Only one letter can be converted at a time.
In each transformed word must exist in the word list. ... | [
{
"code": null,
"e": 1240,
"s": 1062,
"text": "Suppose we have two words (beginWord and endWord), and we have dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, such that −"
},
{
"code": null,
"e": 1284,
"s": 1240,
"text": "Only... |
Math.Abs() Method in C# | The Math.Abs() method in C# is used to return the absolute value of a specified number in C#. This specified number can be decimal, double, 16-bit signed integer, etc.
Let us now see an example to implement the Math.abs() method to return the absolute value of double number −
using System;
class Demo {
public static... | [
{
"code": null,
"e": 1230,
"s": 1062,
"text": "The Math.Abs() method in C# is used to return the absolute value of a specified number in C#. This specified number can be decimal, double, 16-bit signed integer, etc."
},
{
"code": null,
"e": 1339,
"s": 1230,
"text": "Let us now see... |
How to make an alert dialog fill 50% of screen size on Android devices using Kotlin? | This example demonstrates how to make an alert dialog fill 50% of screen size on Android devices 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="... | [
{
"code": null,
"e": 1173,
"s": 1062,
"text": "This example demonstrates how to make an alert dialog fill 50% of screen size on Android devices using Kotlin."
},
{
"code": null,
"e": 1302,
"s": 1173,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Proje... |
MongoDB - Projection | In MongoDB, projection means selecting only the necessary data rather than selecting whole of the data of a document. If a document has 5 fields and you need to show only 3, then select only 3 fields from them.
MongoDB's find() method, explained in MongoDB Query Document accepts second optional parameter that is list o... | [
{
"code": null,
"e": 2764,
"s": 2553,
"text": "In MongoDB, projection means selecting only the necessary data rather than selecting whole of the data of a document. If a document has 5 fields and you need to show only 3, then select only 3 fields from them."
},
{
"code": null,
"e": 3127,... |
Teradata - SubQueries | A subquery returns records from one table based on the values from another table. It is a SELECT query within another query. The SELECT query called as inner query is executed first and the result is used by the outer query. Some of its salient features are −
A query can have multiple subqueries and subqueries may cont... | [
{
"code": null,
"e": 2890,
"s": 2630,
"text": "A subquery returns records from one table based on the values from another table. It is a SELECT query within another query. The SELECT query called as inner query is executed first and the result is used by the outer query. Some of its salient features... |
Count quadruples from four sorted arrays whose sum is equal to a given value x - GeeksforGeeks | 28 Jun, 2021
Given four sorted arrays each of size n of distinct elements. Given a value x. The problem is to count all quadruples(group of four numbers) from all the four arrays whose sum is equal to x.Note: The quadruple has an element from each of the four arrays.
Examples:
Input : arr1 = {1, 4, 5, 6},
arr2... | [
{
"code": null,
"e": 25156,
"s": 25128,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 25411,
"s": 25156,
"text": "Given four sorted arrays each of size n of distinct elements. Given a value x. The problem is to count all quadruples(group of four numbers) from all the four arra... |
Gesture Recognition for Beginners with CNN | by That Data Bloke | Towards Data Science | The CNN or convolutional neural networks are the most commonly used algorithms for image classification problems. An image classifier takes a photograph or video as an input and classifies it into one of the possible categories that it was trained to identify. They have applications in various fields like driver less c... | [
{
"code": null,
"e": 703,
"s": 172,
"text": "The CNN or convolutional neural networks are the most commonly used algorithms for image classification problems. An image classifier takes a photograph or video as an input and classifies it into one of the possible categories that it was trained to iden... |
Bootstrap - Dropdown Plugin | Using Dropdown plugin you can add dropdown menus to any components like navbars, tabs, pills and buttons.
You can toggle the dropdown plugin's hidden content −
Via data attributes − Add data-toggle = "dropdown" to a link or button to toggle a dropdown as shown below −
Via data attributes − Add data-toggle = "dropdown" ... | [
{
"code": null,
"e": 3437,
"s": 3331,
"text": "Using Dropdown plugin you can add dropdown menus to any components like navbars, tabs, pills and buttons."
},
{
"code": null,
"e": 3491,
"s": 3437,
"text": "You can toggle the dropdown plugin's hidden content −"
},
{
"code": ... |
Difference between normal links and active links - GeeksforGeeks | 10 Oct, 2021
Websites are designed to point you to different resources. You can move from one website to another through links. Links help you to get information from different resources. Links are established in simple HTML web pages through <a> tag.Links are categorized into three types. Typically a Link is displayed... | [
{
"code": null,
"e": 24858,
"s": 24830,
"text": "\n10 Oct, 2021"
},
{
"code": null,
"e": 25212,
"s": 24858,
"text": "Websites are designed to point you to different resources. You can move from one website to another through links. Links help you to get information from different... |
NGBoost Explained. Stanford ML Group recently published a... | by Kyosuke Morita | Towards Data Science | Stanford ML Group recently published a new algorithm in their paper, [1] Duan et al., 2019 and its implementation called NGBoost. This algorithm includes uncertainty estimation into the gradient boosting by using the Natural gradient. This post tries to understand this new algorithm and comparing with other popular boo... | [
{
"code": null,
"e": 564,
"s": 172,
"text": "Stanford ML Group recently published a new algorithm in their paper, [1] Duan et al., 2019 and its implementation called NGBoost. This algorithm includes uncertainty estimation into the gradient boosting by using the Natural gradient. This post tries to u... |
C++ Program to Convert Binary Number to Decimal and vice-versa | In a computer system, the binary number is expressed in the binary numeral system while the decimal number is in the decimal numeral system. The binary number is in base 2 while the decimal number is in base 10.
Examples of decimal numbers and their corresponding binary numbers are as follows −
A program that converts ... | [
{
"code": null,
"e": 1274,
"s": 1062,
"text": "In a computer system, the binary number is expressed in the binary numeral system while the decimal number is in the decimal numeral system. The binary number is in base 2 while the decimal number is in base 10."
},
{
"code": null,
"e": 1358... |
C library macro - va_arg() | The C library macro type va_arg(va_list ap, type) retrieves the next argument in the parameter list of the function with type. This does not determine whether the retrieved argument is the last argument passed to the function.
Following is the declaration for va_arg() macro.
type va_arg(va_list ap, type)
ap − This is t... | [
{
"code": null,
"e": 2234,
"s": 2007,
"text": "The C library macro type va_arg(va_list ap, type) retrieves the next argument in the parameter list of the function with type. This does not determine whether the retrieved argument is the last argument passed to the function."
},
{
"code": null... |
How to convert an integer to string with padding zero in C#? | There are several ways to convert an integer to a string in C#.
PadLeft − Returns a new string of a specified length in which the beginning of the current string is padded with spaces or with a specified Unicode character
ToString − Returns a string that represents the current object.
String Interpolation − The $ speci... | [
{
"code": null,
"e": 1126,
"s": 1062,
"text": "There are several ways to convert an integer to a string in C#."
},
{
"code": null,
"e": 1284,
"s": 1126,
"text": "PadLeft − Returns a new string of a specified length in which the beginning of the current string is padded with space... |
How to use an enum with switch case in Java?
| Enumeration (enum) in Java is a datatype which stores a set of constant values. You can use enumerations to store fixed values such as days in a week, months in a year etc.
enum Days {
SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY
}
You can also define an enumeration with custom values to the constants... | [
{
"code": null,
"e": 1235,
"s": 1062,
"text": "Enumeration (enum) in Java is a datatype which stores a set of constant values. You can use enumerations to store fixed values such as days in a week, months in a year etc."
},
{
"code": null,
"e": 1312,
"s": 1235,
"text": "enum Days... |
List Comprehensions vs. For Loops: It is not what you think | Towards Data Science | Usual articles will perform the following case: create a list using a for loop versus a list comprehension. So let’s do it and time it.
import timeiterations = 100000000start = time.time()mylist = []for i in range(iterations): mylist.append(i+1)end = time.time()print(end - start)>> 9.90 secondsstart = time.time()myl... | [
{
"code": null,
"e": 308,
"s": 172,
"text": "Usual articles will perform the following case: create a list using a for loop versus a list comprehension. So let’s do it and time it."
},
{
"code": null,
"e": 581,
"s": 308,
"text": "import timeiterations = 100000000start = time.time... |
Introduction to Pandas DataFrames | by Rebecca Vickery | Towards Data Science | Pandas is a python package designed for fast and flexible data processing, manipulation and analysis. Pandas has a number of fundamental data structures (a data management and storage format). If you are working with two-dimensional labelled data, which is data that has both columns and rows with row headers — similar ... | [
{
"code": null,
"e": 587,
"s": 171,
"text": "Pandas is a python package designed for fast and flexible data processing, manipulation and analysis. Pandas has a number of fundamental data structures (a data management and storage format). If you are working with two-dimensional labelled data, which i... |
Different Types of Recursion in Golang - GeeksforGeeks | 10 Jul, 2020
Recursion is a concept where a function calls itself by direct or indirect means. Each call to the recursive function is a smaller version so that it converges at some point. Every recursive function has a base case or base condition which is the final executable statement in recursion and halts further ca... | [
{
"code": null,
"e": 24083,
"s": 24055,
"text": "\n10 Jul, 2020"
},
{
"code": null,
"e": 24395,
"s": 24083,
"text": "Recursion is a concept where a function calls itself by direct or indirect means. Each call to the recursive function is a smaller version so that it converges at ... |
Remove minimum elements from array so that max <= 2 * min | 27 Dec, 2019
Given an array arr, the task is to remove minimum number of elements such that after their removal, max(arr) <= 2 * min(arr).
Examples:
Input: arr[] = {4, 5, 3, 8, 3}Output: 1Remove 8 from the array.
Input: arr[] = {1, 2, 3, 4}Output: 1Remove 1 from the array.
Approach: Let us fix each value as the minimum... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n27 Dec, 2019"
},
{
"code": null,
"e": 180,
"s": 54,
"text": "Given an array arr, the task is to remove minimum number of elements such that after their removal, max(arr) <= 2 * min(arr)."
},
{
"code": null,
"e": 190,
"s... |
Java Program to Read a File to String | 16 Jun, 2022
There are multiple ways of writing and reading a text file. This is required while dealing with many applications. There are several ways to read a plain text file in Java e.g. you can use FileReader, BufferedReader or Scanner to read a text file.
Given a text file, the task is to read the contents of a fi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Jun, 2022"
},
{
"code": null,
"e": 276,
"s": 28,
"text": "There are multiple ways of writing and reading a text file. This is required while dealing with many applications. There are several ways to read a plain text file in Java e.g... |
Difference between Insertion sort and Selection sort | 29 Mar, 2022
In this article, we will discuss the difference between the Insertion sort and the Selection sort:
Insertion sort is a simple sorting algorithm that works similar to the way you sort playing cards in your hands. The array is virtually split into a sorted and an unsorted part. Values from the unsorted part ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Mar, 2022"
},
{
"code": null,
"e": 127,
"s": 28,
"text": "In this article, we will discuss the difference between the Insertion sort and the Selection sort:"
},
{
"code": null,
"e": 401,
"s": 127,
"text": "Inserti... |
java.lang.Math.atan2() in Java | 20 Jun, 2021
atan2() is an inbuilt method in Java that is used to return the theta component from the polar coordinate. The atan2() method returns a numeric value between –and representing the angle of a (x, y) point and the positive x-axis. It is the counterclockwise angle, measured in radian, between the positive X-a... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n20 Jun, 2021"
},
{
"code": null,
"e": 397,
"s": 52,
"text": "atan2() is an inbuilt method in Java that is used to return the theta component from the polar coordinate. The atan2() method returns a numeric value between –and representin... |
Program for nth Catalan Number | 07 Jul, 2022
Catalan numbers are a sequence of natural numbers that occurs in many interesting counting problems like following.
Count the number of expressions containing n pairs of parentheses which are correctly matched. For n = 3, possible expressions are ((())), ()(()), ()()(), (())(), (()()).Count the number of p... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 170,
"s": 54,
"text": "Catalan numbers are a sequence of natural numbers that occurs in many interesting counting problems like following."
},
{
"code": null,
"e": 680,
"s": 170,
... |
How to check pointer or interface is nil or not in Golang? | 10 May, 2020
In Golang, nil check is frequently seen in GoLang code especially for error check. In most cases, nil check is straight forward, but in interface case, it’s a bit different and special care needs to be taken.
Here the task is to check pointer or interface is nil or not in Golang, you can check with the fol... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 May, 2020"
},
{
"code": null,
"e": 237,
"s": 28,
"text": "In Golang, nil check is frequently seen in GoLang code especially for error check. In most cases, nil check is straight forward, but in interface case, it’s a bit different an... |
CMSmap – Open Source CMS Scanner | 14 Sep, 2021
CMSmap is a Python open source CMS scanner that automates the method of detecting security flaws of the foremost popular CMSs. The main purpose of this tool is to integrate common vulnerabilities for different types of CMSs into a single tool. at the instant, there’s support for WordPress, Joomla, Drupal, ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 649,
"s": 28,
"text": "CMSmap is a Python open source CMS scanner that automates the method of detecting security flaws of the foremost popular CMSs. The main purpose of this tool is to integrate co... |
Union process in DFA | 20 Nov, 2019
Prerequisite – Designing finite automataLet’s understand the Union process in Deterministic Finite Automata (DFA) with the help of below example.
Designing a DFA for the set of string over {a, b} such that string of the language start and end with different symbols. There two desired language will be forme... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n20 Nov, 2019"
},
{
"code": null,
"e": 199,
"s": 53,
"text": "Prerequisite – Designing finite automataLet’s understand the Union process in Deterministic Finite Automata (DFA) with the help of below example."
},
{
"code": null,
... |
Python | Merge, Join and Concatenate DataFrames using Panda | 19 Jun, 2018
A dataframe is a two-dimensional data structure having multiple rows and columns. In a dataframe, the data is aligned in the form of rows and columns only. A dataframe can perform arithmetic as well as conditional operations. It has mutable size.
Below is the implementation using Numpy and Pandas.
Modules ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n19 Jun, 2018"
},
{
"code": null,
"e": 300,
"s": 53,
"text": "A dataframe is a two-dimensional data structure having multiple rows and columns. In a dataframe, the data is aligned in the form of rows and columns only. A dataframe can pe... |
Python – Convert list of dictionaries to dictionary of lists | 07 Jan, 2022
In this article, we will discuss how to convert a list of dictionaries to a dictionary of lists.
By iterating based on the first key we can convert list of dict to dict of list. Python program to create student list of dictionaries
Python3
# create a list of dictionaries# with student datadata = [ {'nam... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Jan, 2022"
},
{
"code": null,
"e": 125,
"s": 28,
"text": "In this article, we will discuss how to convert a list of dictionaries to a dictionary of lists."
},
{
"code": null,
"e": 260,
"s": 125,
"text": "By iterat... |
Create Indian Flag using HTML and CSS | 24 Oct, 2021
In this article, we will design an animated flag of India using HTML and CSS. As we know that our Indian flag has three colors saffron, white and green and there is also a wheel at the center of the white part. So let’s build the Indian flag. Here we will also create a stick of the flag. So first create a ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Oct, 2021"
},
{
"code": null,
"e": 443,
"s": 54,
"text": "In this article, we will design an animated flag of India using HTML and CSS. As we know that our Indian flag has three colors saffron, white and green and there is also a wh... |
map emplace() in C++ STL | 22 Mar, 2022
The map::emplace() is a built-in function in C++ STL which inserts the key and its element in the map container. It effectively increases the container size by one. If the same key is emplaced more than once, the map stores the first element only as the map is a container which does not store multiple keys... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n22 Mar, 2022"
},
{
"code": null,
"e": 391,
"s": 54,
"text": "The map::emplace() is a built-in function in C++ STL which inserts the key and its element in the map container. It effectively increases the container size by one. If the sa... |
How to Read Text Files with Pandas? | 28 Nov, 2021
In this article, we will discuss how to read text files with pandas in python. In python, the pandas module allows us to load DataFrames from external files and work on them. The dataset can be in different types of files.
Text File Used:
We will read the text file with pandas using the read_csv() function... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Nov, 2021"
},
{
"code": null,
"e": 251,
"s": 28,
"text": "In this article, we will discuss how to read text files with pandas in python. In python, the pandas module allows us to load DataFrames from external files and work on them. ... |
Point Clipping Algorithm in Computer Graphics | 20 Apr, 2022
Clipping: In computer graphics our screen act as a 2-D coordinate system. it is not necessary that each and every point can be viewed on our viewing pane(i.e. our computer screen). We can view points, which lie in particular range (0,0) and (Xmax, Ymax). So, clipping is a procedure that identifies those po... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n20 Apr, 2022"
},
{
"code": null,
"e": 609,
"s": 53,
"text": "Clipping: In computer graphics our screen act as a 2-D coordinate system. it is not necessary that each and every point can be viewed on our viewing pane(i.e. our computer sc... |
GATE | GATE CS 2012 | Question 65 | 22 Jul, 2021
Consider the 3 processes, P1, P2 and P3 shown in the table.
Process Arrival time Time Units Required
P1 0 5
P2 1 7
P3 3 4
The completion order of the 3 processes u... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n22 Jul, 2021"
},
{
"code": null,
"e": 114,
"s": 54,
"text": "Consider the 3 processes, P1, P2 and P3 shown in the table."
},
{
"code": null,
"e": 320,
"s": 114,
"text": "Process Arrival time Time U... |
How to add Statefull component without constructor class in React? | 11 Feb, 2022
Generally, we set the initial state of the component inside the constructor class and change the state using the setState method. In React basically, we write HTML-looking code called JSX. JSX is not a valid JavaScript code but to make the developer’s life easier BABEL takes all the responsibility to conve... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n11 Feb, 2022"
},
{
"code": null,
"e": 771,
"s": 53,
"text": "Generally, we set the initial state of the component inside the constructor class and change the state using the setState method. In React basically, we write HTML-looking co... |
Java Program to Add two Complex Numbers | 15 Dec, 2020
Complex numbers are numbers that consist of two parts — a real number and an imaginary number. Complex numbers are the building blocks of more intricate math, such as algebra. The standard format for complex numbers is a + bi, with the real number first and the imaginary number last.
General form for any c... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n15 Dec, 2020"
},
{
"code": null,
"e": 339,
"s": 54,
"text": "Complex numbers are numbers that consist of two parts — a real number and an imaginary number. Complex numbers are the building blocks of more intricate math, such as algebra... |
PostgreSQL – NTILE Function | 08 Oct, 2021
In PostgreSQL, the NTILE() function is used to divide ordered rows in the partition into a specified number of ranked buckets. Buckets are nothing but ranked groups.
The syntax of the NTILE() looks like below:
Syntax:
NTILE(buckets) OVER (
[PARTITION BY partition_expression, ... ]
[ORDER BY sort_ex... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 194,
"s": 28,
"text": "In PostgreSQL, the NTILE() function is used to divide ordered rows in the partition into a specified number of ranked buckets. Buckets are nothing but ranked groups."
},
{... |
Program to add two binary strings | 30 Jun, 2022
Given two binary strings, return their sum (also a binary string).
Example:
Input: a = "11", b = "1"
Output: "100"
We strongly recommend you to minimize your browser and try this yourself first
The idea is to start from the last characters of two strings and compute the digit sum one by one. If the sum... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n30 Jun, 2022"
},
{
"code": null,
"e": 121,
"s": 54,
"text": "Given two binary strings, return their sum (also a binary string)."
},
{
"code": null,
"e": 131,
"s": 121,
"text": "Example: "
},
{
"code": null,
... |
HIVE Overview | 03 Oct, 2019
From the beginning of the Internet’s conventional breakout, many search engine provider companies and e-commerce companies/organizations struggled with regular growth in data day by day. Even some social networking sites like Facebook, Twitter, Instagram, etc. also undergo the same problem. Today, numerous... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Oct, 2019"
},
{
"code": null,
"e": 1684,
"s": 28,
"text": "From the beginning of the Internet’s conventional breakout, many search engine provider companies and e-commerce companies/organizations struggled with regular growth in data... |
PostgreSQL – Temporary Table | 28 Aug, 2020
A temporary table, as the name implies, is a short-lived table that exists for the duration of a database session. PostgreSQL automatically drops the temporary tables at the end of a session or a transaction.
Syntax:
CREATE TEMPORARY TABLE temp_table(
...
);
or,
CREATE TEMP TABLE temp_table(
...
);... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Aug, 2020"
},
{
"code": null,
"e": 237,
"s": 28,
"text": "A temporary table, as the name implies, is a short-lived table that exists for the duration of a database session. PostgreSQL automatically drops the temporary tables at the e... |
Python | os.pipe() method | 29 Jul, 2019
OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality.
All functions in os module raise OSError in the case of invalid or inaccessible file nam... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Jul, 2019"
},
{
"code": null,
"e": 247,
"s": 28,
"text": "OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of usin... |
Extending a Class in Scala | 29 Mar, 2019
Extending a class in Scala user can design an inherited class. To extend a class in Scala we use extends keyword. there are two restrictions to extend a class in Scala :
To override method in scala override keyword is required.
Only the primary constructor can pass parameters to the base constructor.
Synta... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Mar, 2019"
},
{
"code": null,
"e": 198,
"s": 28,
"text": "Extending a class in Scala user can design an inherited class. To extend a class in Scala we use extends keyword. there are two restrictions to extend a class in Scala :"
},... |
How to divide text into two columns layout using CSS ? | 01 Sep, 2020
The purpose of this article is to divide the text into two columns by using the CSS column property. This property is used to set the number of columns and the width of these columns.
Syntax:
columns: column-width columns-count | auto | initial | inherit;
Example:
HTML
<!DOCTYPE html><html> <head> ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Sep, 2020"
},
{
"code": null,
"e": 212,
"s": 28,
"text": "The purpose of this article is to divide the text into two columns by using the CSS column property. This property is used to set the number of columns and the width of these ... |
How to use *ngIf else in AngularJS ? | 05 Jun, 2020
Introduction: The ngIf directive is used to show or hide parts of an angular application. It can be added to any tags, it is a normal HTML tag, template, or selectors. It is a structural directive meaning that it includes templates based on a condition constrained to boolean. When the expression evaluates ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Jun, 2020"
},
{
"code": null,
"e": 566,
"s": 28,
"text": "Introduction: The ngIf directive is used to show or hide parts of an angular application. It can be added to any tags, it is a normal HTML tag, template, or selectors. It is a... |
Hashing in Java | 18 Nov, 2021
In hashing there is a hash function that maps keys to some values. But these hashing function may lead to collision that is two or more keys are mapped to same value. Chain hashing avoids collision. The idea is to make each cell of hash table point to a linked list of records that have same hash function v... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n18 Nov, 2021"
},
{
"code": null,
"e": 987,
"s": 54,
"text": "In hashing there is a hash function that maps keys to some values. But these hashing function may lead to collision that is two or more keys are mapped to same value. Chain h... |
String concatenation in Julia | 25 Aug, 2020
String concatenation in Julia is a way of appending two or more strings into a single string whether it is character by character or using some special characters end to end. There are many ways to perform string concatenation.
Example:
Input: str1 = 'Geeks'
str2 = 'for'
str3 = 'Geeks'
Output: 'Geeksfor... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Aug, 2020"
},
{
"code": null,
"e": 256,
"s": 28,
"text": "String concatenation in Julia is a way of appending two or more strings into a single string whether it is character by character or using some special characters end to end. ... |
Calculate Number of Cycles and Average Operand Fetch Rate of the Machine | 04 Oct, 2021
In this article, we will know how to calculate the average operand fetch rate of the machine when the machine uses different operand accessing modes.
Example-1 : Consider a hypothetical machine that uses different operand accessing mode is given below. Assume the 3 clock cycles consumed for memory access,... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n04 Oct, 2021"
},
{
"code": null,
"e": 205,
"s": 54,
"text": "In this article, we will know how to calculate the average operand fetch rate of the machine when the machine uses different operand accessing modes. "
},
{
"code": n... |
Program to check if water tank overflows when n solid balls are dipped in the water tank | 22 Jun, 2022
Given the dimensions of cylindrical water tank, spherical solid balls and the amount of water present in the tank check if water tank will overflow when balls are dipped in the water tank. Examples :
input : H = 10, r = 5
h = 5
N = 2, R = 2
output : Not in overflow state
Explanation :
wa... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 254,
"s": 52,
"text": "Given the dimensions of cylindrical water tank, spherical solid balls and the amount of water present in the tank check if water tank will overflow when balls are dipped in t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.