title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Count ways to represent a number as sum of perfect squares - GeeksforGeeks | 06 Jul, 2021
Given an integer N, the task is to find the number of ways to represent the number N as sum of perfect squares.
Examples:
Input: N = 9Output: 4Explanation:There are four ways to represent 9 as the sum of perfect squares:1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 91 + 1 + 1 + 1 + 1 + 4 = 91 + 4 + 4 = 99 = 9
Input:... | [
{
"code": null,
"e": 24301,
"s": 24273,
"text": "\n06 Jul, 2021"
},
{
"code": null,
"e": 24413,
"s": 24301,
"text": "Given an integer N, the task is to find the number of ways to represent the number N as sum of perfect squares."
},
{
"code": null,
"e": 24423,
"s"... |
Want to use BigQuery? Read this. I recently started to use BigQuery and... | by Lorenzo Peppoloni | Towards Data Science | I recently started to use BigQuery and I must admit I fell in love with the DB...This article is my attempt to explain the technology behind it, which is a requirement to efficiently utilise the DB in terms of cost and performance.
BigQuery is the public implementation of Dremel that was launched by Google to general a... | [
{
"code": null,
"e": 404,
"s": 172,
"text": "I recently started to use BigQuery and I must admit I fell in love with the DB...This article is my attempt to explain the technology behind it, which is a requirement to efficiently utilise the DB in terms of cost and performance."
},
{
"code": n... |
Char.TryParse() Method in C# | The Char.TryParse() method in C# is used to convert the value of the specified string to its equivalent Unicode character.
public static bool TryParse (string str, out char res);
Let us now see an example to implement the Char.TryParse () method −
using System;
public class Demo {
public static void Main(){
bo... | [
{
"code": null,
"e": 1185,
"s": 1062,
"text": "The Char.TryParse() method in C# is used to convert the value of the specified string to its equivalent Unicode character."
},
{
"code": null,
"e": 1241,
"s": 1185,
"text": "public static bool TryParse (string str, out char res);"
... |
Implementation of Queue in JavaScript | Following is the code to implement queue in JavaScript.
Live Demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
body {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
... | [
{
"code": null,
"e": 1118,
"s": 1062,
"text": "Following is the code to implement queue in JavaScript."
},
{
"code": null,
"e": 1129,
"s": 1118,
"text": " Live Demo"
},
{
"code": null,
"e": 3316,
"s": 1129,
"text": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\... |
Connect to MySQL database from command line | Let us understand how MySQL can be connected to the database using the command-line. This is done for clients like mysql or mysqldump.
The below command invokes mysql without specifying any explicit connection parameters −
mysql
Since there are no parameter options, the default values will be applied −
The default host... | [
{
"code": null,
"e": 1197,
"s": 1062,
"text": "Let us understand how MySQL can be connected to the database using the command-line. This is done for clients like mysql or mysqldump."
},
{
"code": null,
"e": 1285,
"s": 1197,
"text": "The below command invokes mysql without specify... |
Python program to check if a string contains all unique characters | In this article, we will learn about the solution and approach to solve the given problem statement.
Given a sring input, we need to find whether a string contains all unique characters or not.
We will create an array of boolean values, where the variable flag at the index i indicates that whether character i in the al... | [
{
"code": null,
"e": 1163,
"s": 1062,
"text": "In this article, we will learn about the solution and approach to solve the given problem statement."
},
{
"code": null,
"e": 1256,
"s": 1163,
"text": "Given a sring input, we need to find whether a string contains all unique charact... |
Java Program to convert first character uppercase in a sentence | In order to convert first character as upper case in a sentence we have to first separate each word of sentence and then make first character of each word in upper case.After which we have to again join each word separated by space to make again sentence.
Now let take each task one by one.First in order to get each wor... | [
{
"code": null,
"e": 1318,
"s": 1062,
"text": "In order to convert first character as upper case in a sentence we have to first separate each word of sentence and then make first character of each word in upper case.After which we have to again join each word separated by space to make again sentenc... |
Access Super Class Methods and Instance Variables Without super Keyword in Java - GeeksforGeeks | 20 Nov, 2020
A class describes the property and the attributes of the object. A class contains mainly includes the following components.
Modifiers: The keywords in java which provide a set of restriction on the class and its members and methods.Class keyword: The initialization of the class is done by class reserved w... | [
{
"code": null,
"e": 23948,
"s": 23920,
"text": "\n20 Nov, 2020"
},
{
"code": null,
"e": 24073,
"s": 23948,
"text": "A class describes the property and the attributes of the object. A class contains mainly includes the following components."
},
{
"code": null,
"e": 2... |
BigQuery, PII, and Cloud Data Loss Prevention (DLP): Take it to the next level with Data Catalog | by Marcelo Costa | Towards Data Science | Do you know what kind of sensitive data your organization holds? Are you keeping track of every change applied across all your tables and columns? Are you confident to answer questions an auditor may have on data regulations?
Having an auditor knocking in your door is not the scariest thing, data breaches can be way sc... | [
{
"code": null,
"e": 397,
"s": 171,
"text": "Do you know what kind of sensitive data your organization holds? Are you keeping track of every change applied across all your tables and columns? Are you confident to answer questions an auditor may have on data regulations?"
},
{
"code": null,
... |
Cross Validation in Machine Learning | 07 Jan, 2020
In machine learning, we couldn’t fit the model on the training data and can’t say that the model will work accurately for the real data. For this, we must assure that our model got the correct patterns from the data, and it is not getting up too much noise. For this purpose, we use the cross-validation tec... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n07 Jan, 2020"
},
{
"code": null,
"e": 367,
"s": 52,
"text": "In machine learning, we couldn’t fit the model on the training data and can’t say that the model will work accurately for the real data. For this, we must assure that our mod... |
Why require_once() function is so bad to use in PHP ? | 15 Nov, 2019
The require_once() function is an inbuilt function in PHP which is useful in case if we want to include a PHP file in another one i.e. when we need to include a file more than once in PHP script. It is used to check if the file is included more than once or not as it ignores all the inclusions while runnin... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Nov, 2019"
},
{
"code": null,
"e": 381,
"s": 28,
"text": "The require_once() function is an inbuilt function in PHP which is useful in case if we want to include a PHP file in another one i.e. when we need to include a file more than... |
Java Program to Print Spiral Pattern of Numbers | 09 Mar, 2021
Given a number n as the size of the matrix, the task is to print a spiral pattern of size n.
Examples:
Input : n = 4
Output: 1 2 3 4
12 13 14 5
11 16 15 6
10 9 8 7
Preview of the Spiral Pattern:
Java
public class GFG { public static void printSpiral(int size) { // Creat... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n09 Mar, 2021"
},
{
"code": null,
"e": 147,
"s": 54,
"text": "Given a number n as the size of the matrix, the task is to print a spiral pattern of size n."
},
{
"code": null,
"e": 157,
"s": 147,
"text": "Examples:"
... |
Smallest Difference pair of values between two unsorted Arrays | 11 Jun, 2022
Given two arrays of integers, compute the pair of values (one value in each array) with the smallest (non-negative) difference. Return the difference.
Examples :
Input : A[] = {l, 3, 15, 11, 2}
B[] = {23, 127, 235, 19, 8}
Output : 3
That is, the pair (11, 8)
Input : A[] = {l0, 5, 40}
... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Jun, 2022"
},
{
"code": null,
"e": 205,
"s": 54,
"text": "Given two arrays of integers, compute the pair of values (one value in each array) with the smallest (non-negative) difference. Return the difference."
},
{
"code": n... |
SQL | EQUI Join and NON EQUI JOIN | 08 Sep, 2020
Types of SQL Joins are explained in left, right, and full join and SQL | Join (Cartesian Join & Self Join). And Remaining EQUI Join and NON-EQUI will discuss in this article. Let’s discuss one by one.
SQL JOINS :
EQUI Join
NON-EQUI Join
Example –
Let’s Consider the two tables given below.
Table name — Stu... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Sep, 2020"
},
{
"code": null,
"e": 253,
"s": 52,
"text": "Types of SQL Joins are explained in left, right, and full join and SQL | Join (Cartesian Join & Self Join). And Remaining EQUI Join and NON-EQUI will discuss in this article.... |
Thread Priority in Kotlin & Android | 25 Jun, 2020
Every thread in a process has a Priority. They are in the range of 1 to 10. Threads are scheduled according to their priorities with the help of a Thread Scheduler.There can be 3 priority constant set for a Thread which are:
MIN_PRIORITY which equals to 1
MAX_PRIORITY which equals to 10
NORM_PRIORITY which... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Jun, 2020"
},
{
"code": null,
"e": 253,
"s": 28,
"text": "Every thread in a process has a Priority. They are in the range of 1 to 10. Threads are scheduled according to their priorities with the help of a Thread Scheduler.There can b... |
JavaScript Array from() Method | 25 May, 2022
Below is the example of the Array from() method.
Example:
JavaScript
<script> document.write(Array.from("This is JavaScript Array "+ "from() Method"));</script>
Output:
T,h,i,s, ,i,s, ,J,a,v,a,S,c,r,i,p,t, ,A,r,r,a,y,
,f,r,o,m,(,), ,... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n25 May, 2022"
},
{
"code": null,
"e": 103,
"s": 54,
"text": "Below is the example of the Array from() method."
},
{
"code": null,
"e": 113,
"s": 103,
"text": "Example: "
},
{
"code": null,
"e": 124,
... |
JavaScript Interview Questions and Answers | Set 3 | 22 Dec, 2021
We have already discussed some interview questions based on JavaScript.
JavaScript Interview Questions and Answers | Set-1
JavaScript Interview Questions and Answers | Set-2
Below are some more related questions:
What is the ‘Strict’ mode in JavaScript and how can it be enabled?Strict Mode is a new feature... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n22 Dec, 2021"
},
{
"code": null,
"e": 126,
"s": 54,
"text": "We have already discussed some interview questions based on JavaScript."
},
{
"code": null,
"e": 177,
"s": 126,
"text": "JavaScript Interview Questions an... |
p5.js | splitTokens() function | 10 Feb, 2021
The splitTokens() function in p5.js is used to break the input string into pieces of data using a delimiter. This delimiter could be any string or symbol used between each piece of the input string. Syntax:
splitTokens( string, delimiter )
Parameters: This function accepts two parameters as mentioned abo... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Feb, 2021"
},
{
"code": null,
"e": 237,
"s": 28,
"text": "The splitTokens() function in p5.js is used to break the input string into pieces of data using a delimiter. This delimiter could be any string or symbol used between each pie... |
PHP | hash_hmac() Function | 29 Oct, 2018
The hash_hmac() function is an inbuilt function in PHP which is used to generate the keyed hash value using the HMAC method.
Syntax:
string hash_hmac( $algo, $msg, $key, $raw_opt )
Parameters: This function accepts four parameters as mention above and describe below.
$algo: It is the required parameter whi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Oct, 2018"
},
{
"code": null,
"e": 153,
"s": 28,
"text": "The hash_hmac() function is an inbuilt function in PHP which is used to generate the keyed hash value using the HMAC method."
},
{
"code": null,
"e": 161,
"s":... |
What is shallow copy and deep copy in JavaScript ? | 14 Feb, 2022
JavaScript is a high level, dynamically typed client side scripting language. JavaScript adds functionality to static HTML pages. Like most other programming languages JavaScript allows supports the concept of deep copy and shallow copy.
Shallow Copy: When a reference variable is copied into a new referen... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Feb, 2022"
},
{
"code": null,
"e": 267,
"s": 28,
"text": "JavaScript is a high level, dynamically typed client side scripting language. JavaScript adds functionality to static HTML pages. Like most other programming languages JavaScr... |
map insert() in C++ STL | In this article we will be discussing the working, syntax and examples of map::insert() function in C++ STL.
Maps are the associative container, which facilitates to store the elements formed by a combination of key value and mapped value in a specific order. In a map container the data is internally always sorted with... | [
{
"code": null,
"e": 1296,
"s": 1187,
"text": "In this article we will be discussing the working, syntax and examples of map::insert() function in C++ STL."
},
{
"code": null,
"e": 1606,
"s": 1296,
"text": "Maps are the associative container, which facilitates to store the elemen... |
Python program to print the elements of an array in reverse order | When it is required to print the elements of an array in reverse order, the list can be iterated over from the end.
Below is a demonstration of the same −
Live Demo
my_list = [21, 32, 43, 54, 75]
print("The list is : ")
for i in range(0, len(my_list)):
print(my_list[i])
print("The list after reversal is : ")
for i ... | [
{
"code": null,
"e": 1303,
"s": 1187,
"text": "When it is required to print the elements of an array in reverse order, the list can be iterated over from the end."
},
{
"code": null,
"e": 1342,
"s": 1303,
"text": "Below is a demonstration of the same −"
},
{
"code": null,... |
Practice questions for Linked List and Recursion | 24 Jun, 2022
Assume the structure of a Linked List node is as follows.
C++
C
Java
Python3
C#
Javascript
struct Node{ int data; struct Node *next;}; // This code is contributed by SHUBHAMSINGH10
struct Node{ int data; struct Node *next;};
static class Node { int data; Node next;}; // This code is contribute... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Jun, 2022"
},
{
"code": null,
"e": 111,
"s": 52,
"text": "Assume the structure of a Linked List node is as follows. "
},
{
"code": null,
"e": 115,
"s": 111,
"text": "C++"
},
{
"code": null,
"e": 117,
... |
How to add a frame to a seaborn heatmap figure in Python? - GeeksforGeeks | 03 Jan, 2021
A heatmap is a graphical representation of data where values are depicted by color. They make it easy to understand complex data at a glance. Heatmaps can be easily drawn using seaborn in python. In this article, we are going to add a frame to a seaborn heatmap figure in Python.
Syntax: seaborn.heatmap(dat... | [
{
"code": null,
"e": 28005,
"s": 27977,
"text": "\n03 Jan, 2021"
},
{
"code": null,
"e": 28285,
"s": 28005,
"text": "A heatmap is a graphical representation of data where values are depicted by color. They make it easy to understand complex data at a glance. Heatmaps can be easil... |
BootStrap Introduction and Installation - GeeksforGeeks | 05 May, 2022
To begin Web development you may go through this article first.
Grid SystemButtons, Glyphicons, TablesVertical Forms, Horizontal Forms, Inline FormsDropDowns and Responsive TabsProgress Bar and Jumbotron
Grid System
Buttons, Glyphicons, Tables
Vertical Forms, Horizontal Forms, Inline Forms
DropDowns and Re... | [
{
"code": null,
"e": 29711,
"s": 29683,
"text": "\n05 May, 2022"
},
{
"code": null,
"e": 29775,
"s": 29711,
"text": "To begin Web development you may go through this article first."
},
{
"code": null,
"e": 29915,
"s": 29775,
"text": "Grid SystemButtons, Glyphi... |
Python Dictionary Methods - GeeksforGeeks | 04 Aug, 2021
Python Dictionary is like a map that is used to store data in the form of a key:value pair. Python provides various in-built functions to deal with dictionaries. In this article, we will see a list of all the functions provided by the Python to work with dictionaries.
Below functions can be used to access ... | [
{
"code": null,
"e": 24314,
"s": 24286,
"text": "\n04 Aug, 2021"
},
{
"code": null,
"e": 24583,
"s": 24314,
"text": "Python Dictionary is like a map that is used to store data in the form of a key:value pair. Python provides various in-built functions to deal with dictionaries. I... |
How to send button value to PHP backend via POST using ajax ? - GeeksforGeeks | 24 May, 2021
The purpose of this article is to send the value of the button to PHP back-end using AJAX in an HTML document.
Approach: Create a button in HTML document and assign an Id to it. In JavaScript file add an event listener to button i.e click. Then the request is made to PHP file using jQuery Ajax.
HTML code:
... | [
{
"code": null,
"e": 26634,
"s": 26606,
"text": "\n24 May, 2021"
},
{
"code": null,
"e": 26745,
"s": 26634,
"text": "The purpose of this article is to send the value of the button to PHP back-end using AJAX in an HTML document."
},
{
"code": null,
"e": 26930,
"s":... |
Amazon Web Services - Denying Access using IAM policy for EC2 and EBS Instance - GeeksforGeeks | 28 Feb, 2021
In this article, we will look into how to use AWS identity and access management policy conditions to create an IAM policy that denies access to create amazon elastic compute cloud instances and amazon elastic block store volumes when the required tags are not passed along with the creation request.
We wil... | [
{
"code": null,
"e": 26517,
"s": 26489,
"text": "\n28 Feb, 2021"
},
{
"code": null,
"e": 26818,
"s": 26517,
"text": "In this article, we will look into how to use AWS identity and access management policy conditions to create an IAM policy that denies access to create amazon elas... |
MergeSort - GeeksforGeeks | 30 Jul, 2021
MergeSort is a Divide and Conquer algorithm. It divides input array in two halves, calls itself for the two halves and then merges the two sorted halves. The merg() function is used for merging two halves. The merge(arr, l, m, r) is key process that assumes ... More on Merge Sort
Selection sort makes O(n)... | [
{
"code": null,
"e": 28855,
"s": 28827,
"text": "\n30 Jul, 2021"
},
{
"code": null,
"e": 29137,
"s": 28855,
"text": "MergeSort is a Divide and Conquer algorithm. It divides input array in two halves, calls itself for the two halves and then merges the two sorted halves. The merg(... |
Count Non-Leaf nodes in a Binary Tree - GeeksforGeeks | 18 Jun, 2021
Given a Binary tree, count total number of non-leaf nodes in the treeExamples:
Input :
Output :2
Explanation
In the above tree only two nodes 1 and 2 are non-leaf nodes
We recursively traverse the given tree. While traversing, we count non-leaf nodes in left and right subtrees and add 1 to the result.
C... | [
{
"code": null,
"e": 26183,
"s": 26155,
"text": "\n18 Jun, 2021"
},
{
"code": null,
"e": 26264,
"s": 26183,
"text": "Given a Binary tree, count total number of non-leaf nodes in the treeExamples: "
},
{
"code": null,
"e": 26272,
"s": 26264,
"text": "Input :"
... |
Singleton and Prototype Bean Scopes in Java Spring - GeeksforGeeks | 23 Aug, 2021
Bean Scopes refers to the lifecycle of Bean that means when the object of Bean will be instantiated, how long does that object live, and how many objects will be created for that bean throughout. Basically, it controls the instance creation of the bean and it is managed by the spring container.Bean Scopes ... | [
{
"code": null,
"e": 25511,
"s": 25483,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 26114,
"s": 25511,
"text": "Bean Scopes refers to the lifecycle of Bean that means when the object of Bean will be instantiated, how long does that object live, and how many objects will be c... |
Python | How to get the last element of list - GeeksforGeeks | 20 Nov, 2018
List, being an essential python container is used in day-day programming and also in web-development. Knowledge of its operations is necessary.
Let’s see all the different ways of accessing the last element of a list.
Method #1 : Naive Method
There can be 2-naive methods to get the last element of the list... | [
{
"code": null,
"e": 25741,
"s": 25713,
"text": "\n20 Nov, 2018"
},
{
"code": null,
"e": 25885,
"s": 25741,
"text": "List, being an essential python container is used in day-day programming and also in web-development. Knowledge of its operations is necessary."
},
{
"code... |
Print nodes between two given level numbers of a binary tree - GeeksforGeeks | 24 Feb, 2022
Given a binary tree and two level numbers ‘low’ and ‘high’, print nodes from level low to level high.
For example consider the binary tree given in below diagram.
Input: Root of below tree, low = 2, high = 4
Output:
8 22
4 12
10 14
A Simple Method is to first write a recursive function that prints no... | [
{
"code": null,
"e": 26549,
"s": 26521,
"text": "\n24 Feb, 2022"
},
{
"code": null,
"e": 26652,
"s": 26549,
"text": "Given a binary tree and two level numbers ‘low’ and ‘high’, print nodes from level low to level high. "
},
{
"code": null,
"e": 26785,
"s": 26652,
... |
Java Program To Check For Balanced Brackets In An Expression (Well-Formedness) Using Stack - GeeksforGeeks | 14 Dec, 2021
Given an expression string exp, write a program to examine whether the pairs and the orders of “{“, “}”, “(“, “)”, “[“, “]” are correct in exp.
Example:
Input: exp = “[()]{}{[()()]()}” Output: Balanced
Input: exp = “[(])” Output: Not Balanced
Algorithm:
Declare a character stack S.
Now traverse the expr... | [
{
"code": null,
"e": 26185,
"s": 26157,
"text": "\n14 Dec, 2021"
},
{
"code": null,
"e": 26329,
"s": 26185,
"text": "Given an expression string exp, write a program to examine whether the pairs and the orders of “{“, “}”, “(“, “)”, “[“, “]” are correct in exp."
},
{
"code... |
How to add Skeleton Loading in NextJS ? - GeeksforGeeks | 15 Dec, 2021
In this article, we are going to learn how we can add Skeleton Loading in NextJS. NextJS is a React-based framework. It has the power to Develop beautiful Web applications for different platforms like Windows, Linux, and mac.
Approach: To add our skeleton loading we are going to use the react-loading-skele... | [
{
"code": null,
"e": 26181,
"s": 26153,
"text": "\n15 Dec, 2021"
},
{
"code": null,
"e": 26407,
"s": 26181,
"text": "In this article, we are going to learn how we can add Skeleton Loading in NextJS. NextJS is a React-based framework. It has the power to Develop beautiful Web appl... |
ASP.NET Core - Authorize Attribute | In this chapter, we will discuss the Authorize Attribute. So far in our application, we have allowed anonymous users to do anything. They can edit employee details, and view details, but we don’t have the functionality to create a new employee. Let us first add the create feature and then we will restrict the user acce... | [
{
"code": null,
"e": 2811,
"s": 2461,
"text": "In this chapter, we will discuss the Authorize Attribute. So far in our application, we have allowed anonymous users to do anything. They can edit employee details, and view details, but we don’t have the functionality to create a new employee. Let us f... |
Longest Bitonic Subsequence | DP-15 | 12 Jan, 2022
Given an array arr[0 ... n-1] containing n positive integers, a subsequence of arr[] is called Bitonic if it is first increasing, then decreasing. Write a function that takes an array as argument and returns the length of the longest bitonic subsequence. A sequence, sorted in increasing order is considered... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n12 Jan, 2022"
},
{
"code": null,
"e": 509,
"s": 54,
"text": "Given an array arr[0 ... n-1] containing n positive integers, a subsequence of arr[] is called Bitonic if it is first increasing, then decreasing. Write a function that takes... |
How to add new colors to tailwind-css and keep the originals ones ? | 18 Jun, 2021
You can easily add new colors to Tailwind CSS and keep the originals ones using customization configuration. You can configure your colors under the colors key in the theme section of your tailwind.config.js file.
Follow the below step to add the tailwind.config.js file in your folder.
Step 1: Run the bel... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Jun, 2021"
},
{
"code": null,
"e": 243,
"s": 28,
"text": "You can easily add new colors to Tailwind CSS and keep the originals ones using customization configuration. You can configure your colors under the colors key in the theme se... |
SQL Query to find an employee whose salary is equal to or greater than a specific number | 07 Apr, 2021
In this article, we will discuss the overview of SQL query and our main focus will be on how to Find an Employee whose salary is equal to or greater than a specific number in SQL with the help of examples. Let’s discuss it one by one.
Introduction :SQL (Structured Query Language ) is used to maintain struc... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Apr, 2021"
},
{
"code": null,
"e": 263,
"s": 28,
"text": "In this article, we will discuss the overview of SQL query and our main focus will be on how to Find an Employee whose salary is equal to or greater than a specific number in ... |
TestNG - Basic Annotations - Parameters | @Parameters describes how to pass parameters to a @Test method. There are mainly two ways through which we can provide parameter values to test-methods:
Through testng XML configuration file
Through testng XML configuration file
Through DataProviders
Through DataProviders
The following is a list of attributes supported... | [
{
"code": null,
"e": 2347,
"s": 2194,
"text": "@Parameters describes how to pass parameters to a @Test method. There are mainly two ways through which we can provide parameter values to test-methods:"
},
{
"code": null,
"e": 2385,
"s": 2347,
"text": "Through testng XML configurat... |
How to insert a scale bar in a map in Matplotlib? | To insert a scale bar in a map in matplotlib, we can use AnchoredBar() class to instantiate the scalebar object.
Set the figure size and adjust the padding between and around the subplots.
Set the figure size and adjust the padding between and around the subplots.
Create random data using numpy.
Create random data usin... | [
{
"code": null,
"e": 1300,
"s": 1187,
"text": "To insert a scale bar in a map in matplotlib, we can use AnchoredBar() class to instantiate the scalebar object."
},
{
"code": null,
"e": 1376,
"s": 1300,
"text": "Set the figure size and adjust the padding between and around the sub... |
Separators in Java | 25 Sep, 2021
Be it a programmer who is unaware of this concept but is indulging in every program. Separators help us defining the structure of a program. In Java, There are few characters used as separators. The most commonly used separator in java is a semicolon(;). Let us explore more with the help of an illustration... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n25 Sep, 2021"
},
{
"code": null,
"e": 428,
"s": 53,
"text": "Be it a programmer who is unaware of this concept but is indulging in every program. Separators help us defining the structure of a program. In Java, There are few characters... |
D3.js schemeSet2 Method | 23 Aug, 2020
The d3.schemeSet2 Method in D3.js is used to return an array of eight categorical colors which is returned as RGB hexadecimal strings.
Syntax:
d3.schemeSet2
Parameters: This method does not accept any parameter.
Return Values: It returns an RGB hexadecimal string.
Example 1:
HTML
<!DOCTYPE html><html> <he... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Aug, 2020"
},
{
"code": null,
"e": 163,
"s": 28,
"text": "The d3.schemeSet2 Method in D3.js is used to return an array of eight categorical colors which is returned as RGB hexadecimal strings."
},
{
"code": null,
"e": 171... |
Java if-else-if ladder with Examples | 01 Apr, 2022
Decision Making in Java helps to write decision driven statements and execute a particular set of code based on certain conditions.Java if-else-if ladder is used to decide among multiple options. The if statements are executed from the top down. As soon as one of the conditions controlling the if is true, ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n01 Apr, 2022"
},
{
"code": null,
"e": 535,
"s": 53,
"text": "Decision Making in Java helps to write decision driven statements and execute a particular set of code based on certain conditions.Java if-else-if ladder is used to decide am... |
How to select text input fields using CSS selector ? | 08 Mar, 2019
CSS attribute selector is used to targeting an input text fields. The input text fields of type ‘text’ can be targeting by using input[type=text].
Note: It is specified that the default attribute values may not always be selectable with attribute selectors, one could try to cover other cases of markup for ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Mar, 2019"
},
{
"code": null,
"e": 175,
"s": 28,
"text": "CSS attribute selector is used to targeting an input text fields. The input text fields of type ‘text’ can be targeting by using input[type=text]."
},
{
"code": null,
... |
Output of Java Program | Set 4 | 27 Sep, 2018
Predict the output of following Java Programs:
Question 1
// file name: Main.java class Base { protected void foo() {}} class Derived extends Base { void foo() {}} public class Main { public static void main(String args[]) { Derived d = new Derived(); d.foo(); }}
Output: Compiler... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n27 Sep, 2018"
},
{
"code": null,
"e": 101,
"s": 54,
"text": "Predict the output of following Java Programs:"
},
{
"code": null,
"e": 112,
"s": 101,
"text": "Question 1"
},
{
"code": "// file name: Main.java ... |
PLSQL | TRIM Function | 27 Sep, 2019
The PLSQL TRIM function is used for removing all specified characters either from the beginning or the end of a string.The TRIM function accepts three parameters among which the first parameter can either have one of the values ‘LEADING’, ‘TRAILING’, ‘Both’ and Trim_character and input_string.
If LEADING i... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n27 Sep, 2019"
},
{
"code": null,
"e": 348,
"s": 53,
"text": "The PLSQL TRIM function is used for removing all specified characters either from the beginning or the end of a string.The TRIM function accepts three parameters among which ... |
SQL | UPDATE Statement | 09 Jan, 2019
The UPDATE statement in SQL is used to update the data of an existing table in database. We can update single columns as well as multiple columns using UPDATE statement as per our requirement.
Basic Syntax
UPDATE table_name SET column1 = value1, column2 = value2,...
WHERE condition;
table_name: name of t... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Jan, 2019"
},
{
"code": null,
"e": 245,
"s": 52,
"text": "The UPDATE statement in SQL is used to update the data of an existing table in database. We can update single columns as well as multiple columns using UPDATE statement as pe... |
Python list() Function | 11 Nov, 2021
Python list() function takes any iterable as a parameter and returns a list. In Python iterable is the object you can iterate over. Some examples of iterables are tuples, strings, and lists.
Syntax:
list(iterable)
Parameter:
iterable: an object that could be a sequence (string, tuples) or collection (set,... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n11 Nov, 2021"
},
{
"code": null,
"e": 243,
"s": 52,
"text": "Python list() function takes any iterable as a parameter and returns a list. In Python iterable is the object you can iterate over. Some examples of iterables are tuples, str... |
LocalDate withDayOfMonth() method in Java with Examples | 07 Dec, 2018
The withDayOfMonth() method of LocalDate class in Java returns a copy of this LocalDate with the day-of-month altered.
Syntax:
public LocalDate withDayOfMonth(int dayOfMonth)
Parameter: This method accepts a mandatory parameter dayOfMonth whicthe day-of-month to set in the result, from 1 to 28-31.
Returns:... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Dec, 2018"
},
{
"code": null,
"e": 147,
"s": 28,
"text": "The withDayOfMonth() method of LocalDate class in Java returns a copy of this LocalDate with the day-of-month altered."
},
{
"code": null,
"e": 155,
"s": 147,
... |
Program to find volume and surface area of pentagonal prism | 28 Jun, 2022
A prism that has 5 rectangular faces and 2 parallel pentagonal bases is a pentagonal prism. So you are given the apothem length(a), base length(b) and height(h) of the pentagonal prism. you have to find the surface area and the volume of the Pentagonal Prism.Examples:
Input : a=3, b=5, h=6
Output :surfac... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jun, 2022"
},
{
"code": null,
"e": 299,
"s": 28,
"text": "A prism that has 5 rectangular faces and 2 parallel pentagonal bases is a pentagonal prism. So you are given the apothem length(a), base length(b) and height(h) of the pentago... |
Treap | Set 2 (Implementation of Search, Insert and Delete) | 28 Feb, 2022
We strongly recommend to refer set 1 as a prerequisite of this post.Treap (A Randomized Binary Search Tree)In this post, implementations of search, insert and delete are discussed.Search: Same as standard BST search. Priority is not considered for search.
CPP
// C function to search a given key in a give... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Feb, 2022"
},
{
"code": null,
"e": 310,
"s": 52,
"text": "We strongly recommend to refer set 1 as a prerequisite of this post.Treap (A Randomized Binary Search Tree)In this post, implementations of search, insert and delete are disc... |
Replace ‘?’ in a string such that no two adjacent characters are same | 16 Jul, 2021
Given a string S of length N consisting of “?” and lowercase letters, the task is to replace “?” with lowercase letters such that no adjacent characters are the same. If more than one possible combination exists, print any one of them.
Examples:
Input: S = “?a?a”Output: babaExplanation:Replacing all ‘?’s w... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n16 Jul, 2021"
},
{
"code": null,
"e": 288,
"s": 52,
"text": "Given a string S of length N consisting of “?” and lowercase letters, the task is to replace “?” with lowercase letters such that no adjacent characters are the same. If more... |
Input Groups in Bootstrap with Examples | 22 Nov, 2021
Input Groups in Bootstrap are used to extend the default form controls by adding text or buttons on either side of textual inputs, custom file selectors or custom inputs.Basic input groups: The following classes are the base classes that are used to add the groups to either sides of the input boxes.
The ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Nov, 2021"
},
{
"code": null,
"e": 331,
"s": 28,
"text": "Input Groups in Bootstrap are used to extend the default form controls by adding text or buttons on either side of textual inputs, custom file selectors or custom inputs.Basic... |
How to make Triangle in Python Turtle using onscreenclick? | 21 Jun, 2022
“Turtle” is a Python feature like a drawing board, which lets us command a turtle to draw all over it! We can use functions like turtle.forward(...) and turtle.right(...) which can move the turtle around. Turtle is also Known as Logo Programming language which commands for movement and drawing produced lin... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 413,
"s": 28,
"text": "“Turtle” is a Python feature like a drawing board, which lets us command a turtle to draw all over it! We can use functions like turtle.forward(...) and turtle.right(...) whic... |
Check if a string is substring of another | 02 Jun, 2022
Given two strings s1 and s2, find if s1 is a substring of s2. If yes, return the index of the first occurrence, else return -1.
Examples :
Input: s1 = “for”, s2 = “geeksforgeeks”Output: 5Explanation: String “for” is present as a substring of s2.
Input: s1 = “practice”, s2 = “geeksforgeeks”Output: -1.Expla... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n02 Jun, 2022"
},
{
"code": null,
"e": 182,
"s": 54,
"text": "Given two strings s1 and s2, find if s1 is a substring of s2. If yes, return the index of the first occurrence, else return -1."
},
{
"code": null,
"e": 194,
... |
Item-to-Item Based Collaborative Filtering | 16 Jul, 2020
Collaborative Filtering is a technique or a method to predict a user’s taste and find the items that a user might prefer on the basis of information collected from various other users having similar tastes or preferences. It takes into consideration the basic fact that if person X and person Y have a certa... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Jul, 2020"
},
{
"code": null,
"e": 421,
"s": 28,
"text": "Collaborative Filtering is a technique or a method to predict a user’s taste and find the items that a user might prefer on the basis of information collected from various oth... |
Python | Pandas MultiIndex.reorder_levels() | 24 Dec, 2018
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.
Pandas MultiIndex.reorder_levels() function is used to rearrange levels using input order. It... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Dec, 2018"
},
{
"code": null,
"e": 242,
"s": 28,
"text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes imp... |
Closest (or Next) smaller and greater numbers with same number of set bits | 09 Sep, 2021
Given a positive integer n, print the next smallest and the previous largest number that has the same number of 1 bit in their binary representation.
Examples:
Input : n = 5
Output : Closest Greater = 6
Closest Smaller = 3
Note that 5, 6 and 3 have same number of
set bits.
Input : n = 11
Outpu... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Sep, 2021"
},
{
"code": null,
"e": 202,
"s": 52,
"text": "Given a positive integer n, print the next smallest and the previous largest number that has the same number of 1 bit in their binary representation."
},
{
"code": nu... |
Mongoose | remove() Function | 20 May, 2020
The remove() function is used to remove the documents from the database according to the condition.
Installation of mongoose module:
You can visit the link to Install mongoose module. You can install this package by using this command.npm install mongooseAfter installing mongoose module, you can check your... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 May, 2020"
},
{
"code": null,
"e": 128,
"s": 28,
"text": "The remove() function is used to remove the documents from the database according to the condition."
},
{
"code": null,
"e": 161,
"s": 128,
"text": "Instal... |
pwnedOrNot – OSINT Tool to Find Passwords for Compromised Email Addresses | 28 Jul, 2021
pwnedOrNot is an OSINT tool written in Python which checks the email account that has been compromised in a data breach and finds the password of the compromised account.
Name of Breach
Domain Name
Date of Breach
Fabrication status
Verification Status
Retirement status
Spam Status
First clone the tool from... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jul, 2021"
},
{
"code": null,
"e": 199,
"s": 28,
"text": "pwnedOrNot is an OSINT tool written in Python which checks the email account that has been compromised in a data breach and finds the password of the compromised account."
}... |
How place a checkbox into the center of a table cell? | 23 Jun, 2020
A checkbox can be placed in the center of the table cell by either using the plain CSS stylesheet or with the help of bootstrap. Here we will be seeing different ways to center the checkbox in a cell of the table using pure CSS.
Method 1:
In this method, we are using the display FlexBox property to center ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Jun, 2020"
},
{
"code": null,
"e": 257,
"s": 28,
"text": "A checkbox can be placed in the center of the table cell by either using the plain CSS stylesheet or with the help of bootstrap. Here we will be seeing different ways to cente... |
Apache HttpClient - Using Proxy | A Proxy server is an intermediary server between the client and the internet. Proxy servers offer the following basic functionalities −
Firewall and network data filtering
Firewall and network data filtering
Network connection sharing
Network connection sharing
Data caching
Data caching
Using HttpClient library, you ca... | [
{
"code": null,
"e": 1963,
"s": 1827,
"text": "A Proxy server is an intermediary server between the client and the internet. Proxy servers offer the following basic functionalities −"
},
{
"code": null,
"e": 1999,
"s": 1963,
"text": "Firewall and network data filtering"
},
{
... |
How to define an array of different generic types in TypeScript ? - GeeksforGeeks | 26 Jul, 2021
In typescript, an array is a data type that can store multiple values of different data types sequentially. Similar to JavaScript, Typescript supports array declaration and there are multiple ways to do it.
Declaring and Initializing Arrays:
We can either use var or let for declaring an array.
The differen... | [
{
"code": null,
"e": 24894,
"s": 24866,
"text": "\n26 Jul, 2021"
},
{
"code": null,
"e": 25101,
"s": 24894,
"text": "In typescript, an array is a data type that can store multiple values of different data types sequentially. Similar to JavaScript, Typescript supports array declar... |
COVID-19, Bayes’ theorem and taking probabilistic decisions. | by Archit Ranjan | Towards Data Science | Note from the editors: Towards Data Science is a Medium publication primarily based on the study of data science and machine learning. We are not health professionals or epidemiologists, and the opinions of this article should not be interpreted as professional advice. To learn more about the coronavirus pandemic, you ... | [
{
"code": null,
"e": 508,
"s": 172,
"text": "Note from the editors: Towards Data Science is a Medium publication primarily based on the study of data science and machine learning. We are not health professionals or epidemiologists, and the opinions of this article should not be interpreted as profes... |
exit() vs _Exit() in C/C++ - GeeksforGeeks | 13 Jan, 2022
exit() and _Exit() in C/C++ are very similar in functionality. However, there is one difference between exit() and _Exit() and it is that exit() function performs some cleaning before termination of the program like connection termination, buffer flushes etc.
In C, exit() terminates the calling process wit... | [
{
"code": null,
"e": 24578,
"s": 24550,
"text": "\n13 Jan, 2022"
},
{
"code": null,
"e": 24838,
"s": 24578,
"text": "exit() and _Exit() in C/C++ are very similar in functionality. However, there is one difference between exit() and _Exit() and it is that exit() function performs ... |
Hazelcast - Monitoring | Hazelcast provides multiple ways to monitor the cluster. We will look into how to monitor via REST API and via JMX. Let's first look into REST API.
To monitor health of the cluster or member state via REST API, one has to enable REST API based communication to the members. This can be done by configuration and also pro... | [
{
"code": null,
"e": 2111,
"s": 1963,
"text": "Hazelcast provides multiple ways to monitor the cluster. We will look into how to monitor via REST API and via JMX. Let's first look into REST API."
},
{
"code": null,
"e": 2298,
"s": 2111,
"text": "To monitor health of the cluster o... |
Write a program to reverse digits of a number in C++ | A program to reverse digits of a number will interchange the position of the digits and reverse there order.
Let’s suppose be a number abcde the reverse will be edcba.
Let’s take an example to understand the problem,
n = 786521
125687
To reverse digits of the number, we will take each digit of the number from MSB(unit ... | [
{
"code": null,
"e": 1171,
"s": 1062,
"text": "A program to reverse digits of a number will interchange the position of the digits and reverse there order."
},
{
"code": null,
"e": 1230,
"s": 1171,
"text": "Let’s suppose be a number abcde the reverse will be edcba."
},
{
... |
Explain secure password Encryption with PowerShell. | Many times we need to use passwords in PowerShell and need to pass it to the credential parameter and a password should be always a secure string, not a plain text. There are few methods to encrypt the password as mentioned below.
We have one method where we can store the username and password is through cmdlet Get-Cre... | [
{
"code": null,
"e": 1293,
"s": 1062,
"text": "Many times we need to use passwords in PowerShell and need to pass it to the credential parameter and a password should be always a secure string, not a plain text. There are few methods to encrypt the password as mentioned below."
},
{
"code": ... |
Remove Nth Node From End of List in Python | Suppose we have a linked list. We have to remove the Nth node from the end of the list, then return its head. So if the list is like [1, 2, 3, 4, 5, 6] and n = 3, then the returned list will be [1, 2, 3, 5, 6].
To solve this, we will follow these steps −
If there is no node after head, then return None
front := head, b... | [
{
"code": null,
"e": 1273,
"s": 1062,
"text": "Suppose we have a linked list. We have to remove the Nth node from the end of the list, then return its head. So if the list is like [1, 2, 3, 4, 5, 6] and n = 3, then the returned list will be [1, 2, 3, 5, 6]."
},
{
"code": null,
"e": 1317,... |
Event scheduler in Python | Python gives us a generic scheduler to run tasks at specific times. We will use a module called schedule. In this module we use the every function to get the desired schedules. Below is the features available with the every function..
Schedule.every(n).[timeframe]
Here n is the time interval.
Timeframe can be – seconds... | [
{
"code": null,
"e": 1297,
"s": 1062,
"text": "Python gives us a generic scheduler to run tasks at specific times. We will use a module called schedule. In this module we use the every function to get the desired schedules. Below is the features available with the every function.."
},
{
"cod... |
HTML5 - Web Storage | HTML5 introduces two mechanisms, similar to HTTP session cookies, for storing structured data on the client side and to overcome following drawbacks.
Cookies are included with every HTTP request, thereby slowing down your web application by transmitting the same data.
Cookies are included with every HTTP request, there... | [
{
"code": null,
"e": 2758,
"s": 2608,
"text": "HTML5 introduces two mechanisms, similar to HTTP session cookies, for storing structured data on the client side and to overcome following drawbacks."
},
{
"code": null,
"e": 2877,
"s": 2758,
"text": "Cookies are included with every ... |
DAX Basics in Power BI | In this chapter, you will learn how to use various DAX functions in Power BI.
DAX (Data Analysis Expressions) is a formula expression language and can be used in different BI and visualization tools. DAX is also known as function language, where the full code is kept inside a function. DAX programming formula contains ... | [
{
"code": null,
"e": 2017,
"s": 1939,
"text": "In this chapter, you will learn how to use various DAX functions in Power BI."
},
{
"code": null,
"e": 2394,
"s": 2017,
"text": "DAX (Data Analysis Expressions) is a formula expression language and can be used in different BI and vis... |
How to delete a column from an existing table in a database using JDBC API? | You can delete a column in a table using the ALTER TABLE command.
ALTER TABLE table_name DROP COLUMN column_name;
Assume we have a table named Sales in the database with 7 columns namely id, CustomerName, DispatchDate, DeliveryTime, Price and, Location as shown below:
+----+-------------+--------------+--------------+-... | [
{
"code": null,
"e": 1128,
"s": 1062,
"text": "You can delete a column in a table using the ALTER TABLE command."
},
{
"code": null,
"e": 1176,
"s": 1128,
"text": "ALTER TABLE table_name DROP COLUMN column_name;"
},
{
"code": null,
"e": 1331,
"s": 1176,
"text"... |
Display the limits of DataTypes in Java | Every data type in Java has a minimum as well as maximum range, for example, for Integer.
Minimum = -2147483648
Maximum = 2147483647
Let’s say for Integer, if the value extends the maximum range display above, it leads to Overflow. However, if the value is less than the minimum range displayed above, it leads to Underf... | [
{
"code": null,
"e": 1152,
"s": 1062,
"text": "Every data type in Java has a minimum as well as maximum range, for example, for Integer."
},
{
"code": null,
"e": 1195,
"s": 1152,
"text": "Minimum = -2147483648\nMaximum = 2147483647"
},
{
"code": null,
"e": 1387,
"... |
Design and Analysis Vertex Cover | A vertex-cover of an undirected graph G = (V, E) is a subset of vertices V' ⊆ V such that if edge (u, v) is an edge of G, then either u in V or v in V' or both.
Find a vertex-cover of maximum size in a given undirected graph. This optimal vertexcover is the optimization version of an NP-complete problem. However, it i... | [
{
"code": null,
"e": 2761,
"s": 2599,
"text": "A vertex-cover of an undirected graph G = (V, E) is a subset of vertices V' ⊆ V such that if edge (u, v) is an edge of G, then either u in V or v in V' or both."
},
{
"code": null,
"e": 2979,
"s": 2761,
"text": "Find a vertex-cover ... |
How can I generate random numbers in a given range in Android using Kotlin? | This example demonstrates how to generate random numbers in a given range 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... | [
{
"code": null,
"e": 1160,
"s": 1062,
"text": "This example demonstrates how to generate random numbers in a given range in Android using Kotlin"
},
{
"code": null,
"e": 1289,
"s": 1160,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill a... |
Functional Programming with Java - Parallelism | Parallelism is a key concept of functional programming where a big task is accomplished by breaking in smaller independent tasks and then these small tasks are completed in a parallel fashion and later combined to give the complete result. With the advent of multi-core processors, this technique helps in faster code ex... | [
{
"code": null,
"e": 2708,
"s": 2089,
"text": "Parallelism is a key concept of functional programming where a big task is accomplished by breaking in smaller independent tasks and then these small tasks are completed in a parallel fashion and later combined to give the complete result. With the adve... |
How to execute a Python file in Python shell? | To execute a Python file in the python shell, you could use either the execfile method or the exec method.
For example, you want to run a script called my_script.py that only contains the line:
print("Greetings from my_script")
from the python shell, you could simply enter:
>>> execfile('my_script.py')
Greetings from m... | [
{
"code": null,
"e": 1169,
"s": 1062,
"text": "To execute a Python file in the python shell, you could use either the execfile method or the exec method."
},
{
"code": null,
"e": 1256,
"s": 1169,
"text": "For example, you want to run a script called my_script.py that only contain... |
Understanding blocking and unblocking of code execution in Node | Now, we have a file writing function writeFileSync in fs module as shown below −
const requestBody = [];
req.on('data', (chunks)=>{
requestBody.push(chunks);
});
return req.on('end', ()=>{
const parsedData = Buffer.concat(requestBody).toString();
const username = parsedData.split('=')[1];
fs.writeFileSync('... | [
{
"code": null,
"e": 1143,
"s": 1062,
"text": "Now, we have a file writing function writeFileSync in fs module as shown below −"
},
{
"code": null,
"e": 1501,
"s": 1143,
"text": "const requestBody = [];\nreq.on('data', (chunks)=>{\n requestBody.push(chunks);\n});\nreturn req.on... |
Python datetime.tzname() Method with Example - GeeksforGeeks | 23 Aug, 2021
tzname() method is used in the DateTime class of module DateTime. This method is used to return the time zone name of the DateTime object passed, as a string.
Syntax:
tzname()
Return type:
It will return the time zone name of the DateTime object passed, as a string.
So first we need to import the module Da... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 25696,
"s": 25537,
"text": "tzname() method is used in the DateTime class of module DateTime. This method is used to return the time zone name of the DateTime object passed, as a string."
}... |
Builtin functions of GCC compiler - GeeksforGeeks | 13 Oct, 2021
These are four important built-in functions in GCC compiler:
__builtin_popcount(x): This function is used to count the number of one’s(set bits) in an integer. Example:
__builtin_popcount(x): This function is used to count the number of one’s(set bits) in an integer. Example:
if x = 4
binary value of... | [
{
"code": null,
"e": 26527,
"s": 26499,
"text": "\n13 Oct, 2021"
},
{
"code": null,
"e": 26590,
"s": 26527,
"text": "These are four important built-in functions in GCC compiler: "
},
{
"code": null,
"e": 26700,
"s": 26590,
"text": "__builtin_popcount(x): This... |
Create multiple barplots in R side by side - GeeksforGeeks | 30 May, 2021
In R programming language, barplot is a graphical representation of linear data which is one-dimensional. Bar plot is used for statistical analysis for easy understanding of the data. It represents the given data in the form of bars. It can give bar graphs along x-axis and y-axis. Where x-axis represents t... | [
{
"code": null,
"e": 25707,
"s": 25679,
"text": "\n30 May, 2021"
},
{
"code": null,
"e": 26096,
"s": 25707,
"text": "In R programming language, barplot is a graphical representation of linear data which is one-dimensional. Bar plot is used for statistical analysis for easy unders... |
Sort a given Array by swapping only pairs with GCD as 1 - GeeksforGeeks | 16 Dec, 2021
Given an array arr[], the task is to check if it is possible to sort the given array using any number of operations where at each operation, two elements arr[i] and arr[j] can be swapped if GCD of arr[i] and arr[j] is 1.
Example:
Input: a = {3, 2, 1}Output: PossibleExplanation: The given array can be sorte... | [
{
"code": null,
"e": 26041,
"s": 26013,
"text": "\n16 Dec, 2021"
},
{
"code": null,
"e": 26262,
"s": 26041,
"text": "Given an array arr[], the task is to check if it is possible to sort the given array using any number of operations where at each operation, two elements arr[i] an... |
Output of C Programs | Set 2 - GeeksforGeeks | 23 Sep, 2020
Predict the output of below programs. Question 1
c
#include<stdio.h>char *getString(){ char str[] = "Will I be printed?"; return str;}int main(){ printf("%s", getString()); getchar();}
Output: Some garbage value The above program doesn’t work because array variables are stored in Stack Sect... | [
{
"code": null,
"e": 25235,
"s": 25207,
"text": "\n23 Sep, 2020"
},
{
"code": null,
"e": 25285,
"s": 25235,
"text": "Predict the output of below programs. Question 1 "
},
{
"code": null,
"e": 25287,
"s": 25285,
"text": "c"
},
{
"code": "#include<stdio.... |
Maximum AND value of a pair in an array - GeeksforGeeks | 09 May, 2022
We are given an array of n positive elements. we need to find the maximum AND value generated by any pair of element from the array. AND is bitwise & operator.
Examples:
Input : arr[] = {4, 8, 12, 16}
Output : Maximum AND value = 8
Input : arr[] = {4, 8, 16, 2}
Output : Maximum AND value = 0
Naive Approa... | [
{
"code": null,
"e": 26171,
"s": 26143,
"text": "\n09 May, 2022"
},
{
"code": null,
"e": 26331,
"s": 26171,
"text": "We are given an array of n positive elements. we need to find the maximum AND value generated by any pair of element from the array. AND is bitwise & operator."
... |
How to use bootstrap 4 in angular 2? - GeeksforGeeks | 28 Apr, 2020
Bootstrap is an open-source toolkit for developing with HTML, CSS, and JS. The Bootstrap framework can be used together with modern JavaScript web & mobile frameworks like Angular.
Bootstrap 4 is the newest version of Bootstrap, which is the most popular HTML, CSS, and JavaScript framework. This article is... | [
{
"code": null,
"e": 26865,
"s": 26837,
"text": "\n28 Apr, 2020"
},
{
"code": null,
"e": 27046,
"s": 26865,
"text": "Bootstrap is an open-source toolkit for developing with HTML, CSS, and JS. The Bootstrap framework can be used together with modern JavaScript web & mobile framewo... |
PHP Full Form - GeeksforGeeks | 22 Nov, 2021
PHP is the abbreviation of Hypertext Preprocessor and earlier it was abbreviated as Personal Home Page. It is a general-purpose programming language used to design a website or web application. It is the server-side scripting language embedded with HTML to develop Static website, Dynamic website, or Web ap... | [
{
"code": null,
"e": 42165,
"s": 42137,
"text": "\n22 Nov, 2021"
},
{
"code": null,
"e": 42663,
"s": 42165,
"text": "PHP is the abbreviation of Hypertext Preprocessor and earlier it was abbreviated as Personal Home Page. It is a general-purpose programming language used to design... |
How to set focus on input field automatically on page load in AngularJS ? - GeeksforGeeks | 03 Jun, 2021
We can focus on any input field automatically using the angular directives. Here we create a custom directive that can auto-focus on any field in the form.
Creating a custom directive is just like creating an Angular component. To create a custom directive we have to replace @Component decorator with @Dire... | [
{
"code": null,
"e": 26172,
"s": 26144,
"text": "\n03 Jun, 2021"
},
{
"code": null,
"e": 26328,
"s": 26172,
"text": "We can focus on any input field automatically using the angular directives. Here we create a custom directive that can auto-focus on any field in the form."
},
... |
How to Set the Gap Between Text and Underlining using CSS ? - GeeksforGeeks | 11 Jun, 2021
Introduction: CSS is used to make the website visually more appealing and more readable. It can be used to format the text on the website in various ways like color, font-size, font-family, etc. In this article, we are going to see how in the case of underlined text, increase the gap between text and under... | [
{
"code": null,
"e": 26599,
"s": 26571,
"text": "\n11 Jun, 2021"
},
{
"code": null,
"e": 27248,
"s": 26599,
"text": "Introduction: CSS is used to make the website visually more appealing and more readable. It can be used to format the text on the website in various ways like colo... |
What are C++ Character Constants? | Character constants are one or more members of the “source character set,” the character set in which a program is written, surrounded by single quotation marks ('). They are used to represent characters in the “execution character set,” the character set on the machine where the program executes. These are sometimes a... | [
{
"code": null,
"e": 1413,
"s": 1062,
"text": "Character constants are one or more members of the “source character set,” the character set in which a program is written, surrounded by single quotation marks ('). They are used to represent characters in the “execution character set,” the character s... |
Rexx - Arithmetic Operators | The Rexx language supports the normal Arithmetic Operators as any the language. Following are the Arithmetic Operators available in Rexx.
The following program shows how the various operators can be used.
/* Main program*/
X = 40
Y = 50
Res1 = X + Y
Res2 = X - Y
Res3 = X * Y
Res4 = X / Y
Res5 = X % Y
Res6 = X ... | [
{
"code": null,
"e": 2477,
"s": 2339,
"text": "The Rexx language supports the normal Arithmetic Operators as any the language. Following are the Arithmetic Operators available in Rexx."
},
{
"code": null,
"e": 2544,
"s": 2477,
"text": "The following program shows how the various ... |
Angular Material - Cards | The md-card, an Angular Directive, is a container directive and is used to draw cards in the angularjs application. The following table lists down the angular directives and classes used in md-card.
<md-card-header>
Header for the card, holds avatar, text and squared image.
<md-card-avatar>
Card avatar.
md-user-avatar
... | [
{
"code": null,
"e": 2389,
"s": 2190,
"text": "The md-card, an Angular Directive, is a container directive and is used to draw cards in the angularjs application. The following table lists down the angular directives and classes used in md-card."
},
{
"code": null,
"e": 2406,
"s": 23... |
Program to convert Linked list representing binary number to decimal integer in Python | Suppose we have a singly linked list. the linked list is representing a binary number with most significant digits first, we have to return it as decimal number.
So, if the input is like [1,0,1,1,0], then the output will be 22
To solve this, we will follow these steps −
l := a new list
while node is not null, doinsert ... | [
{
"code": null,
"e": 1224,
"s": 1062,
"text": "Suppose we have a singly linked list. the linked list is representing a binary number with most significant digits first, we have to return it as decimal number."
},
{
"code": null,
"e": 1289,
"s": 1224,
"text": "So, if the input is ... |
Minimum time required to rot all oranges | Dynamic Programming - GeeksforGeeks | 02 Jun, 2021
Given a matrix of dimension m * n where each cell in the matrix can have values 0, 1 or 2 which has the following meaning:
0: Empty cell
1: Cells have fresh oranges
2: Cells have rotten oranges
So the task is to determine what is the minimum time required so that all the oranges become rotten. A rotten ... | [
{
"code": null,
"e": 26313,
"s": 26285,
"text": "\n02 Jun, 2021"
},
{
"code": null,
"e": 26437,
"s": 26313,
"text": "Given a matrix of dimension m * n where each cell in the matrix can have values 0, 1 or 2 which has the following meaning: "
},
{
"code": null,
"e": 26... |
Most Useful Date Manipulation Functions in Spark | by Sivakar Sivarajah | Towards Data Science | Pyspark and Spark SQL provide many built-in functions. The functions such as the date and time functions are useful when you are working with DataFrame which stores date and time type values. Sometimes you may be tempted to write a UDF(user-defined functions) only later to realize that it would have been better to chec... | [
{
"code": null,
"e": 647,
"s": 172,
"text": "Pyspark and Spark SQL provide many built-in functions. The functions such as the date and time functions are useful when you are working with DataFrame which stores date and time type values. Sometimes you may be tempted to write a UDF(user-defined functi... |
Constants of Maths in Python - GeeksforGeeks | 17 May, 2020
Math module is a standard in-built module in Python that can be used for performing the mathematical tasks. The math module has a set of methods and constants.
Note: For more information, refer to Math-library-functions
1. Python math.e constant: The math.e constant returns the Euler’s number: 2.7182818284... | [
{
"code": null,
"e": 24416,
"s": 24388,
"text": "\n17 May, 2020"
},
{
"code": null,
"e": 24576,
"s": 24416,
"text": "Math module is a standard in-built module in Python that can be used for performing the mathematical tasks. The math module has a set of methods and constants."
... |
Build a To-do List Web Application Powered by Blockchain - GeeksforGeeks | 11 Oct, 2021
Here, we are going to build a to-do list application that will save the data in the blockchain. The blockchain part of this application can also be understood as a database. First, we’ll create a smart contract and in the subsequent the web application itself. We’ll use Bloc as the application name but fir... | [
{
"code": null,
"e": 24502,
"s": 24474,
"text": "\n11 Oct, 2021"
},
{
"code": null,
"e": 24843,
"s": 24502,
"text": "Here, we are going to build a to-do list application that will save the data in the blockchain. The blockchain part of this application can also be understood as a... |
Objective-C Protocols | Objective-C allows you to define protocols, which declare the methods expected to be used for a particular situation. Protocols are implemented in the classes conforming to the protocol.
A simple example would be a network URL handling class, it will have a protocol with methods like processCompleted delegate method th... | [
{
"code": null,
"e": 2747,
"s": 2560,
"text": "Objective-C allows you to define protocols, which declare the methods expected to be used for a particular situation. Protocols are implemented in the classes conforming to the protocol."
},
{
"code": null,
"e": 2960,
"s": 2747,
"tex... |
Modeling Stock Portfolios with Python | Towards Data Science | When I first began learning Python, one of my goals was to understand how to better evaluate the financial performance of my stock portfolio. I came across a great article by Kevin Boller where he used python to compare a portfolio against the S&P 500. I highly recommend spending a few minutes reading through it to bet... | [
{
"code": null,
"e": 451,
"s": 47,
"text": "When I first began learning Python, one of my goals was to understand how to better evaluate the financial performance of my stock portfolio. I came across a great article by Kevin Boller where he used python to compare a portfolio against the S&P 500. I h... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.