title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
GATE | GATE-CS-2017 (Set 2) | Question 49 | 28 Jun, 2021
Consider the following C function.
int fun(int n)
{
int i, j;
for (i = 1; i <= n ; i++)
{
for (j = 1; j < n; j += i)
{
printf("%d %d", i, j);
}
}
}
Time complexity of fun in terms of θ notation is:(A) θ(n √n)(B) θ(n2)(C) θ(n log n)(D) θ(n 2 log n)
Answe... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 89,
"s": 54,
"text": "Consider the following C function."
},
{
"code": null,
"e": 256,
"s": 89,
"text": "int fun(int n)\n{\n int i, j;\n for (i = 1; i <= n ; i++)\n {\n... |
p5.js Introduction | 24 Dec, 2021
p5.js is a JavaScript library used for creative coding. It is based on Processing which is a creative coding environment. The main focus of processing is to make it easy as possible for beginners to learn how to program interactive, graphical applications, to make a programming language more user-friendly ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Dec, 2021"
},
{
"code": null,
"e": 870,
"s": 52,
"text": "p5.js is a JavaScript library used for creative coding. It is based on Processing which is a creative coding environment. The main focus of processing is to make it easy as p... |
Python theHarvester – How to use it? | 13 Jan, 2022
theHarvester is another tool like sublist3r which is developed using Python. This tool can be used by penetration testers for gathering information of emails, sub-domains, hosts, employee names, open ports, and banners from different public sources like search engines, PGP key servers, and SHODAN computer ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Jan, 2022"
},
{
"code": null,
"e": 474,
"s": 28,
"text": "theHarvester is another tool like sublist3r which is developed using Python. This tool can be used by penetration testers for gathering information of emails, sub-domains, hos... |
Generalized Lambda Expressions in C++14 | 20 Dec, 2017
Lambda expressions were introduced in C++11. They are basically snippets of code that can be nested inside other functions and even function call statements. By combining a lambda expression with the auto keyword these expressions can then be later used in the program.
We have discussed lambda expressions ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n20 Dec, 2017"
},
{
"code": null,
"e": 324,
"s": 54,
"text": "Lambda expressions were introduced in C++11. They are basically snippets of code that can be nested inside other functions and even function call statements. By combining a l... |
Gerrit - Download Examples Using Git | You can download the example using Git along with the source code of any project organized at gerrit.wikimedia.org using the following Git Bash command.
$ git clone
ssh://<user_name>@gerrit.wikimedia.org:29418/sandbox
The git clone command clones a directory into a new directory; in other words gets a copy of an exis... | [
{
"code": null,
"e": 2391,
"s": 2238,
"text": "You can download the example using Git along with the source code of any project organized at gerrit.wikimedia.org using the following Git Bash command."
},
{
"code": null,
"e": 2458,
"s": 2391,
"text": "$ git clone \nssh://<user_nam... |
Top Data Science Misconceptions I Learned in 2021 | Towards Data Science | IntroductionAB Testing is Only About SignificanceOnly Looking at Model Error & AccuracyYou Won’t Use SQLSummaryReferences
Introduction
AB Testing is Only About Significance
Only Looking at Model Error & Accuracy
You Won’t Use SQL
Summary
References
Data scientists have a lot of expectations from companies as well as ex... | [
{
"code": null,
"e": 294,
"s": 172,
"text": "IntroductionAB Testing is Only About SignificanceOnly Looking at Model Error & AccuracyYou Won’t Use SQLSummaryReferences"
},
{
"code": null,
"e": 307,
"s": 294,
"text": "Introduction"
},
{
"code": null,
"e": 345,
"s": ... |
Construct a tree from Inorder and Level order traversals | Set 1 - GeeksforGeeks | 21 Feb, 2022
Given inorder and level-order traversals of a Binary Tree, construct the Binary Tree. Following is an example to illustrate the problem.
Input: Two arrays that represent Inorder
and level order traversals of a
Binary Tree
in[] = {4, 8, 10, 12, 14, 20, 22};
level[] = {20, 8, 22, 4, 12, 10,... | [
{
"code": null,
"e": 37758,
"s": 37730,
"text": "\n21 Feb, 2022"
},
{
"code": null,
"e": 37895,
"s": 37758,
"text": "Given inorder and level-order traversals of a Binary Tree, construct the Binary Tree. Following is an example to illustrate the problem."
},
{
"code": null... |
Java program to display Hostname and IP address | To display Hostname and IP address in Java, the code is as follows −
Live Demo
import java.net.*;
public class Demo{
public static void main(String[] args){
try{
InetAddress my_address = InetAddress.getLocalHost();
System.out.println("The IP address is : " + my_address.getHostAddress());
... | [
{
"code": null,
"e": 1131,
"s": 1062,
"text": "To display Hostname and IP address in Java, the code is as follows −"
},
{
"code": null,
"e": 1142,
"s": 1131,
"text": " Live Demo"
},
{
"code": null,
"e": 1585,
"s": 1142,
"text": "import java.net.*;\npublic clas... |
How to display current connection info in MySQL? | MySQL provides many functions that give the current connection information. For instance, to know about the current user, use the user() function.
mysql> SELECT CURRENT_USER();
Here is the output that displays the name of the current user.
+----------------+
| CURRENT_USER() |
+----------------+
| root@% |
+--... | [
{
"code": null,
"e": 1209,
"s": 1062,
"text": "MySQL provides many functions that give the current connection information. For instance, to know about the current user, use the user() function."
},
{
"code": null,
"e": 1240,
"s": 1209,
"text": "mysql> SELECT CURRENT_USER();\n"
... |
Distributed Cache in Hadoop MapReduce - GeeksforGeeks | 19 May, 2019
Hadoop’s MapReduce framework provides the facility to cache small to moderate read-only files such as text files, zip files, jar files etc. and broadcast them to all the Datanodes(worker-nodes) where MapReduce job is running. Each Datanode gets a copy of the file(local-copy) which is sent through Distribut... | [
{
"code": null,
"e": 24372,
"s": 24344,
"text": "\n19 May, 2019"
},
{
"code": null,
"e": 24758,
"s": 24372,
"text": "Hadoop’s MapReduce framework provides the facility to cache small to moderate read-only files such as text files, zip files, jar files etc. and broadcast them to a... |
Align a flex item at the end in Bootstrap 4 | Use the .align-self-end class to align flex item at the end in Bootstrap 4.
The following is my div −
<div class="d-flex bg-info" style="height:200px">
Now you need to set the flex items, wherein I am aligning the 3rd flex item −
<div class="d-flex bg-info" style="height:200px">
<div class="p-2 border">Item 1</div>
... | [
{
"code": null,
"e": 1138,
"s": 1062,
"text": "Use the .align-self-end class to align flex item at the end in Bootstrap 4."
},
{
"code": null,
"e": 1164,
"s": 1138,
"text": "The following is my div −"
},
{
"code": null,
"e": 1214,
"s": 1164,
"text": "<div clas... |
JavaScript String - substr() Method | This method returns the characters in a string beginning at the specified location through the specified number of characters.
The syntax to use substr() is as follows −
string.substr(start[, length]);
start − Location at which to start extracting characters (an integer between 0 and one less than the length of the st... | [
{
"code": null,
"e": 2593,
"s": 2466,
"text": "This method returns the characters in a string beginning at the specified location through the specified number of characters."
},
{
"code": null,
"e": 2636,
"s": 2593,
"text": "The syntax to use substr() is as follows −"
},
{
... |
Sort an array which contain 1 to n values - GeeksforGeeks | CoursesFor Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore MoreFor StudentsLIVECompetitive ProgrammingData Structures with C++Data ScienceExplore MoreSelf-PacedDSA- Self PacedCIPJAVA / Python / C+... | [
{
"code": null,
"e": 407,
"s": 0,
"text": "CoursesFor Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore MoreFor StudentsLIVECompetitive ProgrammingData Structures with C++Data Sc... |
Java String codePointBefore() Method | ❮ String Methods
Return the Unicode of the first character in a string (the Unicode value
of "H" is 72):
String myStr = "Hello";
int result = myStr.codePointBefore(1);
System.out.println(result);
Try it Yourself »
The codePointBefore() method returns the Unicode
value of the character before the specified index ... | [
{
"code": null,
"e": 19,
"s": 0,
"text": "\n❮ String Methods\n"
},
{
"code": null,
"e": 110,
"s": 19,
"text": "Return the Unicode of the first character in a string (the Unicode value \n of \"H\" is 72):"
},
{
"code": null,
"e": 201,
"s": 110,
"text": "String... |
JSTL - fn:replace() Function | The fn:replace() function replaces all occurrences of a string with another string.
The fn:replace () function has the following syntax −
boolean replace(java.lang.String, java.lang.String, java.lang.String)
Following is the example to explain the functionality of the fn:replace() function −
<%@ taglib uri = "http://j... | [
{
"code": null,
"e": 2323,
"s": 2239,
"text": "The fn:replace() function replaces all occurrences of a string with another string."
},
{
"code": null,
"e": 2377,
"s": 2323,
"text": "The fn:replace () function has the following syntax −"
},
{
"code": null,
"e": 2448,
... |
Notify with Python. Make life easier with Python built... | by James Briggs | Towards Data Science | Working in Python, I often run data processing, transfer, and model training scripts. Now, with any reasonable degree of complexity and/or big data, this can take some time.
Although often enough we all have some other work to be done whilst waiting for these processing to complete, occasionally, we don’t.
For this pur... | [
{
"code": null,
"e": 221,
"s": 47,
"text": "Working in Python, I often run data processing, transfer, and model training scripts. Now, with any reasonable degree of complexity and/or big data, this can take some time."
},
{
"code": null,
"e": 355,
"s": 221,
"text": "Although ofte... |
Bitwise Hacks for Competitive Programming - GeeksforGeeks | 23 Feb, 2022
It is recommended to refer Interesting facts about Bitwise Operators as a prerequisite.1. How to set a bit in the number ‘num’ :If we want to set a bit at nth position in number ‘num’ ,it can be done using ‘OR’ operator( | ).
First we left shift ‘1’ to n position via (1<<n)
Then, use ‘OR’ operator to set... | [
{
"code": null,
"e": 24282,
"s": 24254,
"text": "\n23 Feb, 2022"
},
{
"code": null,
"e": 24510,
"s": 24282,
"text": "It is recommended to refer Interesting facts about Bitwise Operators as a prerequisite.1. How to set a bit in the number ‘num’ :If we want to set a bit at nth posi... |
Program to find minimum swaps required to make given anagram in python | Suppose we have two strings S and T and they are anagrams of each other. We have to find the minimum number of swaps required in S to make it same as T.
So, if the input is like S = "kolkata" T = "katloka", then the output will be 3, as can swap in this sequence [katloka (given), kotlaka, koltaka, kolkata].
To solve th... | [
{
"code": null,
"e": 1215,
"s": 1062,
"text": "Suppose we have two strings S and T and they are anagrams of each other. We have to find the minimum number of swaps required in S to make it same as T."
},
{
"code": null,
"e": 1371,
"s": 1215,
"text": "So, if the input is like S = ... |
Python MongoDB - Limit | While retrieving the contents of a collection you can limit the number of documents in the result using the limit() method. This method accepts a number value representing the number of documents you want in the result.
Following is the syntax of the limit() method −
>db.COLLECTION_NAME.find().limit(NUMBER)
Assume we ... | [
{
"code": null,
"e": 3425,
"s": 3205,
"text": "While retrieving the contents of a collection you can limit the number of documents in the result using the limit() method. This method accepts a number value representing the number of documents you want in the result."
},
{
"code": null,
"... |
How can we import data from .CSV file into MySQL table? | Actually.CSV is also a text file in which the values are separated by commas or in other words we can say that text file with CSV(comma separated values). We need to use FIELDS SEPARATED OPTION with LOAD DATA INFILE statement while importing the data from .CSV file to MySQL table. We are considering the following examp... | [
{
"code": null,
"e": 1409,
"s": 1062,
"text": "Actually.CSV is also a text file in which the values are separated by commas or in other words we can say that text file with CSV(comma separated values). We need to use FIELDS SEPARATED OPTION with LOAD DATA INFILE statement while importing the data fr... |
Classical Neural Network: What really are Nodes and Layers? | by Michael Chan | Towards Data Science | We have spoken previously about activation functions, and as promised we will explain its link with the layers and the nodes in an architecture of neural networks.
Note that this is an explanation for classical Neural Network and not specialized ones. This knowledge will despite it, be of use when studying specific neu... | [
{
"code": null,
"e": 336,
"s": 172,
"text": "We have spoken previously about activation functions, and as promised we will explain its link with the layers and the nodes in an architecture of neural networks."
},
{
"code": null,
"e": 506,
"s": 336,
"text": "Note that this is an e... |
Compressing string in JavaScript | We are required to write a JavaScript function that takes in a string that might contain some continuous repeating characters.
The function should compress the string like this −
'wwwaabbbb' -> 'w3a2b4'
'kkkkj' -> 'k4j'
And if the length of the compressed string is greater than or equal to the original string we should... | [
{
"code": null,
"e": 1189,
"s": 1062,
"text": "We are required to write a JavaScript function that takes in a string that might contain some continuous repeating characters."
},
{
"code": null,
"e": 1241,
"s": 1189,
"text": "The function should compress the string like this −"
... |
Scope of Variables in C# | The scope of a variable is a region of code that indicates where the variables are being accessed.
For a variable, it has the following levels −
Variable declared inside a method is a local variable.
Variable declared inside a class is a local variable are class member variables.
Let us see an example of scope of varia... | [
{
"code": null,
"e": 1161,
"s": 1062,
"text": "The scope of a variable is a region of code that indicates where the variables are being accessed."
},
{
"code": null,
"e": 1207,
"s": 1161,
"text": "For a variable, it has the following levels −"
},
{
"code": null,
"e": ... |
Spring Boot - Database Handling | Spring Boot provides a very good support to create a DataSource for Database. We need not write any extra code to create a DataSource in Spring Boot. Just adding the dependencies and doing the configuration details is enough to create a DataSource and connect the Database.
In this chapter, we are going to use Spring Bo... | [
{
"code": null,
"e": 3299,
"s": 3025,
"text": "Spring Boot provides a very good support to create a DataSource for Database. We need not write any extra code to create a DataSource in Spring Boot. Just adding the dependencies and doing the configuration details is enough to create a DataSource and c... |
TypeScript - Array every() | every() method tests whether all the elements in an array passes the test implemented by the provided function.
array.every(callback[, thisObject]);
callback − Function to test for each element.
callback − Function to test for each element.
thisObject − Object to use as this when executing callback.
thisObject − Objec... | [
{
"code": null,
"e": 2160,
"s": 2048,
"text": "every() method tests whether all the elements in an array passes the test implemented by the provided function."
},
{
"code": null,
"e": 2198,
"s": 2160,
"text": "array.every(callback[, thisObject]);\n"
},
{
"code": null,
... |
Spring Boot Example Tutorials | Spring Boot Hello World Example Online TutorialsPoint | PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC
EXCEPTIONS
COLLECTIONS
SWING
JDBC
JAVA 8
SPRING
SPRING BOOT
HIBERNATE
PYTHON
PHP
JQUERY
PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
In this tutorial, I am going to show you the ... | [
{
"code": null,
"e": 158,
"s": 123,
"text": "PROGRAMMINGJava ExamplesC Examples"
},
{
"code": null,
"e": 172,
"s": 158,
"text": "Java Examples"
},
{
"code": null,
"e": 183,
"s": 172,
"text": "C Examples"
},
{
"code": null,
"e": 195,
"s": 183,
... |
Top Python Libraries Used In Data Science | by Tanu N Prabhu | Towards Data Science | Let us understand what are the most important and useful python libraries that can be used in data science.
Data Science, as you all know, it is the process involved in studying the data. Yes, all you got to do is study the data and get new insights from the data. Here there is no need to focus on applying from scratch... | [
{
"code": null,
"e": 279,
"s": 171,
"text": "Let us understand what are the most important and useful python libraries that can be used in data science."
},
{
"code": null,
"e": 1179,
"s": 279,
"text": "Data Science, as you all know, it is the process involved in studying the dat... |
Maximum prefix sum for a given range | Practice | GeeksforGeeks | Given an array of N integers and Q queries, each query having a range from index L to R. Find the maximum prefix-sum for the range L to R.
Note: Assume 0 based indexing.
Example 1:
Input:
a[ ] = {-1, 2, 3, -5}
Q = 2
L1 = 0, R1 = 3
L2 = 1, R2 = 3
Output:
4 5
Explanation:
The range (0, 3) in the 1st query is {-1, 2, 3,... | [
{
"code": null,
"e": 408,
"s": 238,
"text": "Given an array of N integers and Q queries, each query having a range from index L to R. Find the maximum prefix-sum for the range L to R.\nNote: Assume 0 based indexing."
},
{
"code": null,
"e": 419,
"s": 408,
"text": "Example 1:"
}... |
Django model data to JSON data in 2 lines | In this article, we are going to learn a handy trick to convert Django model data directly to JSON data. Sometimes, we need to return model data in JSON format; it can also be used in making API or just showing simple data to our frontend in JSON format. JSON is easy to access so it is really handful.
Create a Django p... | [
{
"code": null,
"e": 1365,
"s": 1062,
"text": "In this article, we are going to learn a handy trick to convert Django model data directly to JSON data. Sometimes, we need to return model data in JSON format; it can also be used in making API or just showing simple data to our frontend in JSON format... |
XSLT <template> | <xsl:template> defines a way to reuse templates in order to generate the desired output for nodes of a particular type/context.
Following is the syntax declaration of <xsl:template> element.
<xsl:template
name = Qname
match = Pattern
priority = number
mode = QName >
</xsl:template>
name
Name of the ele... | [
{
"code": null,
"e": 1887,
"s": 1759,
"text": "<xsl:template> defines a way to reuse templates in order to generate the desired output for nodes of a particular type/context."
},
{
"code": null,
"e": 1950,
"s": 1887,
"text": "Following is the syntax declaration of <xsl:template> ... |
CSS3 - Colors | CSS3 has Supported additional color properties as follows −
RGBA colors
HSL colors
HSLA colors
Opacity
RGBA stands for Red Green Blue Alpha.It is an extension of CSS2,Alpha specifies the opacity of a color and parameter number is a numerical between 0.0 to 1.0. A Sample syntax of RGBA as shown below −
#d1 {background-c... | [
{
"code": null,
"e": 2686,
"s": 2626,
"text": "CSS3 has Supported additional color properties as follows −"
},
{
"code": null,
"e": 2698,
"s": 2686,
"text": "RGBA colors"
},
{
"code": null,
"e": 2709,
"s": 2698,
"text": "HSL colors"
},
{
"code": null,
... |
Organizing Tournament Problem - GeeksforGeeks | 12 Aug, 2021
Given a positive integer N representing the count of players playing the game. The game is played between two teams such that each team consists of at least one player but the total count of players in the game must be N. The game lasts in exactly 30 minutes, the task is to check if all players will play t... | [
{
"code": null,
"e": 26073,
"s": 26045,
"text": "\n12 Aug, 2021"
},
{
"code": null,
"e": 26584,
"s": 26073,
"text": "Given a positive integer N representing the count of players playing the game. The game is played between two teams such that each team consists of at least one pl... |
plotly.express.line() function in Python - GeeksforGeeks | 20 Jul, 2020
Plotly library of Python can be very useful for data visualization and understanding the data simply and easily. Plotly graph objects are a high-level interface to plotly which are easy to use.
This function is used to create a line plot. It can also be created using the pandas dataframe where each row of ... | [
{
"code": null,
"e": 26301,
"s": 26273,
"text": "\n20 Jul, 2020"
},
{
"code": null,
"e": 26495,
"s": 26301,
"text": "Plotly library of Python can be very useful for data visualization and understanding the data simply and easily. Plotly graph objects are a high-level interface to... |
C Program for focal length of a lens | Given two floating values; image distance and object distance from a lens; the task is to print the focal length of the lens.
What is focal length?
Focal length of an optical system is the distance between the center of lens or curved mirror and its focus.
Let’s understand with the help of figure given below −
In the a... | [
{
"code": null,
"e": 1188,
"s": 1062,
"text": "Given two floating values; image distance and object distance from a lens; the task is to print the focal length of the lens."
},
{
"code": null,
"e": 1210,
"s": 1188,
"text": "What is focal length?"
},
{
"code": null,
"e... |
C/C++ Program to find sum of elements in a given array - GeeksforGeeks | 28 Aug, 2018
Given an array of integers, find sum of its elements.
Examples :
Input : arr[] = {1, 2, 3}
Output : 6
1 + 2 + 3 = 6
Input : arr[] = {15, 12, 13, 10}
Output : 50
/* CPP Program to find sum of elements in a given array */#include <bits/stdc++.h> // function to return sum of elements// in an array of size ... | [
{
"code": null,
"e": 26200,
"s": 26172,
"text": "\n28 Aug, 2018"
},
{
"code": null,
"e": 26254,
"s": 26200,
"text": "Given an array of integers, find sum of its elements."
},
{
"code": null,
"e": 26265,
"s": 26254,
"text": "Examples :"
},
{
"code": nul... |
Different Media Types in CSS | CSS Media Types are the device types on which the document is rendered and specific styles can be defined for every media type.
Following are the Media Types in CSS3 and Media Queries 4 −
NOTE −Several media types (such as aural, braille, embossed, handheld, projection, ttv and tv) are deprecated in Media Queries 4 and... | [
{
"code": null,
"e": 1190,
"s": 1062,
"text": "CSS Media Types are the device types on which the document is rendered and specific styles can be defined for every media type."
},
{
"code": null,
"e": 1250,
"s": 1190,
"text": "Following are the Media Types in CSS3 and Media Querie... |
Difference Between NFD, NFC, NFKD, and NFKC Explained with Python Code | by Xu LIANG | Towards Data Science | Recently I am working on an NLP task in Japanese, one problem is to convert special characters to a normalized form. So I have done a little research and write this post for anyone who has the same need.
Japanese contains different forms of the character, for example, Latin has two forms, full-width form, and half-widt... | [
{
"code": null,
"e": 376,
"s": 172,
"text": "Recently I am working on an NLP task in Japanese, one problem is to convert special characters to a normalized form. So I have done a little research and write this post for anyone who has the same need."
},
{
"code": null,
"e": 495,
"s": ... |
Create a Pivot Table with multiple columns – Python Pandas | We can create a Pivot Table with multiple columns. To create a Pivot Table, use the pandas.pivot_table to create a spreadsheet-style pivot table as a DataFrame.
At first, import the required library −
import pandas as pd
Create a DataFrame with Team records −
dataFrame = pd.DataFrame({'Team ID': {0: 5, 1: 9, 2: 6, 3: 1... | [
{
"code": null,
"e": 1223,
"s": 1062,
"text": "We can create a Pivot Table with multiple columns. To create a Pivot Table, use the pandas.pivot_table to create a spreadsheet-style pivot table as a DataFrame."
},
{
"code": null,
"e": 1263,
"s": 1223,
"text": "At first, import the ... |
Machine Learning For Genomics. How to transform your genomics data to... | by Anuradha Wickramarachchi | Towards Data Science | Machine learning has become popular. However, it is not a common use case in the field of Bioinformatics and Computational Biology. There are very few tools that use machine learning techniques. Most of the tools are developed on top of deterministic approaches and algorithms. In this article, I will present how we can... | [
{
"code": null,
"e": 577,
"s": 171,
"text": "Machine learning has become popular. However, it is not a common use case in the field of Bioinformatics and Computational Biology. There are very few tools that use machine learning techniques. Most of the tools are developed on top of deterministic appr... |
Pygame - surface.blit() function - GeeksforGeeks | 23 May, 2021
surface.blit() function draws a source Surface onto this Surface. The draw can be positioned with the dest argument. The dest argument can either be a pair of coordinates representing the position of the upper left corner of the blit or a Rect, where the upper left corner of the rectangle will be used as t... | [
{
"code": null,
"e": 25561,
"s": 25533,
"text": "\n23 May, 2021"
},
{
"code": null,
"e": 25958,
"s": 25561,
"text": "surface.blit() function draws a source Surface onto this Surface. The draw can be positioned with the dest argument. The dest argument can either be a pair of coor... |
Node.js Automatic restart Node.js server with nodemon - GeeksforGeeks | 14 Oct, 2021
We generally type following command for starting NodeJs server:
node server.js
In this case, if we make any changes to the project then we will have to restart the server by killing it using CTRL+C and then typing the same command again.
node server.js
It is a very hectic task for the development process.
... | [
{
"code": null,
"e": 26287,
"s": 26259,
"text": "\n14 Oct, 2021"
},
{
"code": null,
"e": 26351,
"s": 26287,
"text": "We generally type following command for starting NodeJs server:"
},
{
"code": null,
"e": 26366,
"s": 26351,
"text": "node server.js"
},
{
... |
pthread_self() in C with Example - GeeksforGeeks | 28 Oct, 2019
Prerequisite : Multithreading in C
Syntax :- pthread_t pthread_self(void);The pthread_self() function returns the ID of the thread in which it is invoked.
// C program to demonstrate working of pthread_self()#include <stdio.h>#include <stdlib.h>#include <pthread.h>void* calls(void* ptr){ // using pthrea... | [
{
"code": null,
"e": 25893,
"s": 25865,
"text": "\n28 Oct, 2019"
},
{
"code": null,
"e": 25928,
"s": 25893,
"text": "Prerequisite : Multithreading in C"
},
{
"code": null,
"e": 26048,
"s": 25928,
"text": "Syntax :- pthread_t pthread_self(void);The pthread_self... |
Introduction to Iterators in C++ - GeeksforGeeks | 28 Apr, 2022
An iterator is an object (like a pointer) that points to an element inside the container. We can use iterators to move through the contents of the container. They can be visualized as something similar to a pointer pointing to some location and we can access the content at that particular location using th... | [
{
"code": null,
"e": 25623,
"s": 25595,
"text": "\n28 Apr, 2022"
},
{
"code": null,
"e": 26552,
"s": 25623,
"text": "An iterator is an object (like a pointer) that points to an element inside the container. We can use iterators to move through the contents of the container. They ... |
StringBuffer reverse() Method in Java with Examples - GeeksforGeeks | 13 Dec, 2021
The Java.lang.StringBuffer.reverse() is an inbuilt method which is used to reverse the characters in the StringBuffer. The method causes this character sequence to be replaced by the reverse of the sequence. Syntax :
public StringBuffer reverse()
Parameters : The method does not take any parameter .Return... | [
{
"code": null,
"e": 25754,
"s": 25726,
"text": "\n13 Dec, 2021"
},
{
"code": null,
"e": 25972,
"s": 25754,
"text": "The Java.lang.StringBuffer.reverse() is an inbuilt method which is used to reverse the characters in the StringBuffer. The method causes this character sequence to... |
Node.js os.totalmem() Method - GeeksforGeeks | 13 Oct, 2021
The os.totalmem() method is an inbuilt application programming interface of the os module which is used to get amount of total system memory in bytes.
Syntax:
os.totalmem()
Parameters: This method does not accept any parameters.
Return Value: This method returns an integer value that specifies the amount o... | [
{
"code": null,
"e": 25607,
"s": 25579,
"text": "\n13 Oct, 2021"
},
{
"code": null,
"e": 25758,
"s": 25607,
"text": "The os.totalmem() method is an inbuilt application programming interface of the os module which is used to get amount of total system memory in bytes."
},
{
... |
Java Program to Rotate an Image - GeeksforGeeks | 25 Nov, 2021
The problem statement is to rotate an image clockwise 90 degrees for which here we will be using some in-built methods of BufferedImage class and Color c
Classes required to perform the operation is as follows:
To read and write an image file we have to import the File class. This class represents file and... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n25 Nov, 2021"
},
{
"code": null,
"e": 25379,
"s": 25225,
"text": "The problem statement is to rotate an image clockwise 90 degrees for which here we will be using some in-built methods of BufferedImage class and Color c"
},
{... |
numpy.power() in Python - GeeksforGeeks | 29 Nov, 2018
numpy.power(arr1, arr2, out = None, where = True, casting = ‘same_kind’, order = ‘K’, dtype = None) :Array element from first array is raised to the power of element from second element(all happens element-wise). Both arr1 and arr2 must have same shape and each element in arr1 must be raised to correspondi... | [
{
"code": null,
"e": 25321,
"s": 25293,
"text": "\n29 Nov, 2018"
},
{
"code": null,
"e": 25702,
"s": 25321,
"text": "numpy.power(arr1, arr2, out = None, where = True, casting = ‘same_kind’, order = ‘K’, dtype = None) :Array element from first array is raised to the power of eleme... |
How to check whether the elements of a given NumPy array is non-zero? - GeeksforGeeks | 29 Aug, 2020
In NumPy with the help of any() function, we can check whether any of the elements of a given array in NumPy is non-zero. We will pass an array in the any() function if it returns true then any of the element of the array is non zero if it returns false then all the elements of the array are zero.
Syntax: ... | [
{
"code": null,
"e": 26521,
"s": 26493,
"text": "\n29 Aug, 2020"
},
{
"code": null,
"e": 26820,
"s": 26521,
"text": "In NumPy with the help of any() function, we can check whether any of the elements of a given array in NumPy is non-zero. We will pass an array in the any() functi... |
rand() and srand() in C/C++ - GeeksforGeeks | 13 May, 2022
rand ()
The rand() function is used in C/C++ to generate random numbers in the range [0, RAND_MAX).
Note: If random numbers are generated with rand() without first calling srand(), your program will create the same sequence of numbers each time it runs.
Syntax:
int rand(void):
returns a pseudo-random ... | [
{
"code": null,
"e": 26073,
"s": 26045,
"text": "\n13 May, 2022"
},
{
"code": null,
"e": 26081,
"s": 26073,
"text": "rand ()"
},
{
"code": null,
"e": 26174,
"s": 26081,
"text": "The rand() function is used in C/C++ to generate random numbers in the range [0, R... |
Python | Scipy stats.halfgennorm.isf() method - GeeksforGeeks | 06 Feb, 2020
With the help of stats.halfgennorm.isf() method, we can get the value of inverse survival function which is inverse(1 – cdf) by using stats.halfgennorm.isf() method.
Syntax : stats.halfgennorm.isf(x, beta)Return : Return the value of inverse survival function.
Example #1 :In this example we can see that by... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n06 Feb, 2020"
},
{
"code": null,
"e": 25703,
"s": 25537,
"text": "With the help of stats.halfgennorm.isf() method, we can get the value of inverse survival function which is inverse(1 – cdf) by using stats.halfgennorm.isf() metho... |
Retrieving HTML From data using Flask - GeeksforGeeks | 16 Jul, 2020
Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. It began as a simple wrapper around Werkzeug and Jinja and has become one of the most popular Python web application frameworks.
Read this arti... | [
{
"code": null,
"e": 25691,
"s": 25663,
"text": "\n16 Jul, 2020"
},
{
"code": null,
"e": 25984,
"s": 25691,
"text": "Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications.... |
Express.js express.urlencoded() Function - GeeksforGeeks | 05 May, 2021
The express.urlencoded() function is a built-in middleware function in Express. It parses incoming requests with urlencoded payloads and is based on body-parser.Syntax:
express.urlencoded( [options] )
Parameter: The options parameter contains various property like extended, inflate, limit, verify etc.Ret... | [
{
"code": null,
"e": 30835,
"s": 30807,
"text": "\n05 May, 2021"
},
{
"code": null,
"e": 31006,
"s": 30835,
"text": "The express.urlencoded() function is a built-in middleware function in Express. It parses incoming requests with urlencoded payloads and is based on body-parser.Sy... |
Python | Set Difference in list of dictionaries - GeeksforGeeks | 26 Feb, 2019
The difference of two lists have been discussed many a times, but sometimes we have a large number of data and we need to find the difference i.e the elements in dict2 not in 1 to reduce the redundancies. Let’s discuss certain ways in which this can be done.
Method #1 : Using list comprehensionThe naive me... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n26 Feb, 2019"
},
{
"code": null,
"e": 25796,
"s": 25537,
"text": "The difference of two lists have been discussed many a times, but sometimes we have a large number of data and we need to find the difference i.e the elements in d... |
Python | Pandas dataframe.sem() - GeeksforGeeks | 23 Nov, 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 dataframe.sem() function return unbiased standard error of the mean over requested axi... | [
{
"code": null,
"e": 26059,
"s": 26031,
"text": "\n23 Nov, 2018"
},
{
"code": null,
"e": 26273,
"s": 26059,
"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 a... |
Largest square formed in a matrix | Practice | GeeksforGeeks | Given a binary matrix mat of size n * m, find out the maximum size square sub-matrix with all 1s.
Example 1:
Input: n = 2, m = 2
mat = {{1, 1},
{1, 1}}
Output: 2
Explaination: The maximum size of the square
sub-matrix is 2. The matrix itself is the
maximum sized sub-matrix in this case.
Example 2:
Input: n = 2... | [
{
"code": null,
"e": 336,
"s": 238,
"text": "Given a binary matrix mat of size n * m, find out the maximum size square sub-matrix with all 1s."
},
{
"code": null,
"e": 347,
"s": 336,
"text": "Example 1:"
},
{
"code": null,
"e": 535,
"s": 347,
"text": "Input: n... |
How can I test if a string starts with a capital letter using Python? | To be precise, above string four words starting with uppercase character. This, Delhi, City and India.
Two string functions should be used for this purpose. Assuming that words in the string are separated by single space character, split() function gives list of words.
Secondly to check if first character of each word ... | [
{
"code": null,
"e": 1165,
"s": 1062,
"text": "To be precise, above string four words starting with uppercase character. This, Delhi, City and India."
},
{
"code": null,
"e": 1332,
"s": 1165,
"text": "Two string functions should be used for this purpose. Assuming that words in th... |
MFC - Windows Resources | A resource is a text file that allows the compiler to manage objects such as pictures, sounds, mouse cursors, dialog boxes, etc. Microsoft Visual Studio makes creating a resource file particularly easy by providing the necessary tools in the same environment used to program. This means, you usually do not have to use a... | [
{
"code": null,
"e": 2512,
"s": 2067,
"text": "A resource is a text file that allows the compiler to manage objects such as pictures, sounds, mouse cursors, dialog boxes, etc. Microsoft Visual Studio makes creating a resource file particularly easy by providing the necessary tools in the same enviro... |
Argument Index in Java | Argument indices allow programmers to reorder the output. Let us see an example.
Live Demo
public class Demo {
public static void main(String[] args) {
System.out.printf("Before reordering = %s %s %s %s %s %s\n", "one", "two", "three", "four", "five", "six" );
System.out.printf("After reordering = %6$s ... | [
{
"code": null,
"e": 1143,
"s": 1062,
"text": "Argument indices allow programmers to reorder the output. Let us see an example."
},
{
"code": null,
"e": 1154,
"s": 1143,
"text": " Live Demo"
},
{
"code": null,
"e": 1618,
"s": 1154,
"text": "public class Demo {... |
How to find an element using the “CSS Selector” in Selenium? | We can find an element using the css locator with Selenium webdriver. To identify the element with css, the expression should be tagname[attribute='value'].
We can also specifically use the id attribute to create a css expression.
With id, the format of a css expression should be tagname#<id>. For example,input#txt [he... | [
{
"code": null,
"e": 1219,
"s": 1062,
"text": "We can find an element using the css locator with Selenium webdriver. To identify the element with css, the expression should be tagname[attribute='value']."
},
{
"code": null,
"e": 1293,
"s": 1219,
"text": "We can also specifically ... |
JavaFX | FlowPane Class - GeeksforGeeks | 12 Sep, 2018
FlowPane class is a part of JavaFX. Flowpane lays out its children in such a way that wraps at the flowpane’s boundary. A horizontal flowpane (the default) will layout nodes in rows, wrapping at the flowpane’s width. A vertical flowpane lays out nodes in columns, wrapping at the flowpane’s height. FlowPane... | [
{
"code": null,
"e": 23557,
"s": 23529,
"text": "\n12 Sep, 2018"
},
{
"code": null,
"e": 23892,
"s": 23557,
"text": "FlowPane class is a part of JavaFX. Flowpane lays out its children in such a way that wraps at the flowpane’s boundary. A horizontal flowpane (the default) will la... |
How to plot CSV data using Matplotlib and Pandas in Python? | To plot CSV data using Matplotlib and Pandas in Python, we can take the following steps −
Set the figure size and adjust the padding between and around the subplots.
Make a list of headers of the .CSV file.
Read the CSV file with headers.
Set the index and plot the dataframe.
To display the figure, use show() method.
i... | [
{
"code": null,
"e": 1152,
"s": 1062,
"text": "To plot CSV data using Matplotlib and Pandas in Python, we can take the following steps −"
},
{
"code": null,
"e": 1228,
"s": 1152,
"text": "Set the figure size and adjust the padding between and around the subplots."
},
{
"c... |
How to create focusable editText inside ListView on Android? | This example demonstrates how do I create a focusable editText inside ListView in android.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8... | [
{
"code": null,
"e": 1153,
"s": 1062,
"text": "This example demonstrates how do I create a focusable editText inside ListView in android."
},
{
"code": null,
"e": 1282,
"s": 1153,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all requ... |
Machine Learning : Linear Regression using Pyspark | by Somesh Routray | Towards Data Science | Introduction:
PySpark is the Python API written in python to support Apache Spark. Apache Spark is a distributed framework that can handle Big Data analysis. Spark is written in Scala and can be integrated with Python, Scala, Java, R, SQL languages. Spark is basically a computational engine, that works with huge sets o... | [
{
"code": null,
"e": 186,
"s": 172,
"text": "Introduction:"
},
{
"code": null,
"e": 639,
"s": 186,
"text": "PySpark is the Python API written in python to support Apache Spark. Apache Spark is a distributed framework that can handle Big Data analysis. Spark is written in Scala an... |
C++ Program to Find Inverse of a Graph Matrix | This is a C++ program to Find Inverse of a Graph Matrix. Inverse of a matrix exists only if the matrix is non-singular i.e., determinant should not be 0. Inverse of a matrix can find out in many ways. Here we find out inverse of a graph matrix using adjoint matrix and its determinant. Steps involved in the Example
Begi... | [
{
"code": null,
"e": 1503,
"s": 1187,
"text": "This is a C++ program to Find Inverse of a Graph Matrix. Inverse of a matrix exists only if the matrix is non-singular i.e., determinant should not be 0. Inverse of a matrix can find out in many ways. Here we find out inverse of a graph matrix using adj... |
Program to calculate gross salary of a person | 16 Apr, 2021
Given an integer basic and a character grade which denotes the basic salary and grade of a person respectively, the task is to find the gross salary of the person.
Gross Salary: The final salary computed after the additions of DA, HRA and other allowances. The formula for Gross Salary is defined as below:
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Apr, 2021"
},
{
"code": null,
"e": 192,
"s": 28,
"text": "Given an integer basic and a character grade which denotes the basic salary and grade of a person respectively, the task is to find the gross salary of the person."
},
{
... |
zlib.crc32() in python | 23 Mar, 2020
With the help of zlib.crc32() method, we can compute the checksum for crc32 (Cyclic Redundancy Check) to a particular data. It will give 32-bit integer value as a result by using zlib.crc32() method.
Syntax : zlib.crc32(s)Return : Return the unsigned 32-bit checksum integer.
Example #1 :In this example we ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Mar, 2020"
},
{
"code": null,
"e": 228,
"s": 28,
"text": "With the help of zlib.crc32() method, we can compute the checksum for crc32 (Cyclic Redundancy Check) to a particular data. It will give 32-bit integer value as a result by us... |
Batch Script - CMD | This batch command invokes another instance of command prompt.
cmd
@echo off
cmd
Another instance of command prompt will be invoked. | [
{
"code": null,
"e": 2366,
"s": 2303,
"text": "This batch command invokes another instance of command prompt."
},
{
"code": null,
"e": 2371,
"s": 2366,
"text": "cmd\n"
},
{
"code": null,
"e": 2386,
"s": 2371,
"text": "@echo off \ncmd"
}
] |
How to add timestamp to CSV file in Python | 23 Aug, 2021
Prerequisite: Datetime module
In this example, we will learn How to add timestamp to CSV files in Python. We can easily add timestamp to CSV files with the help of datetime module of python. Let’s the stepwise implementation for adding timestamp to CSV files in Python.
Import csv and datetime module. We wi... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 84,
"s": 54,
"text": "Prerequisite: Datetime module"
},
{
"code": null,
"e": 324,
"s": 84,
"text": "In this example, we will learn How to add timestamp to CSV files in Python. W... |
Solving multiplexer circuit | 14 May, 2020
The procedure for solving and finding the output function of the given multiplexer is quite simple. Firstly we will discuss the procedure and then illustrate it with examples.
Procedure:
Firstly truth table is constructed for the given multiplexer.
Select lines in multiplexer are considered as input for th... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 May, 2020"
},
{
"code": null,
"e": 230,
"s": 54,
"text": "The procedure for solving and finding the output function of the given multiplexer is quite simple. Firstly we will discuss the procedure and then illustrate it with examples... |
Python | Pandas Series.nlargest() | 11 Feb, 2019
Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index.
Pandas Series.nlargest() function return the n lar... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Feb, 2019"
},
{
"code": null,
"e": 285,
"s": 28,
"text": "Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based index... |
Send multiple data with ajax in PHP | Data can be sent through JSON or via normal POST. Following is an example showing data sent through JSON −
var value_1 = 1;
var value_2 = 2;
var value_3 = 3;
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "your_url_goes_here",
data: { data_1: value_1, data_2: value_2, data_3: va... | [
{
"code": null,
"e": 1294,
"s": 1187,
"text": "Data can be sent through JSON or via normal POST. Following is an example showing data sent through JSON −"
},
{
"code": null,
"e": 1590,
"s": 1294,
"text": "var value_1 = 1;\nvar value_2 = 2;\nvar value_3 = 3;\n$.ajax({\n type: \"... |
Flutter – Installation on macOS | 24 Sep, 2021
In this article, we are going to take a look at Flutter installation of macOS. In this article, we will see what are the system requirement for it to work with flutter, how to set an environment variable, how to install flutter SDK and Dart SDK. We will understand how to use flutter doctor, how to install... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Sep, 2021"
},
{
"code": null,
"e": 469,
"s": 28,
"text": "In this article, we are going to take a look at Flutter installation of macOS. In this article, we will see what are the system requirement for it to work with flutter, how t... |
What does enumerable property mean in JavaScript? | 04 Jun, 2020
An enumerable property in JavaScript means that a property can be viewed if it is iterated using the for...in loop or Object.keys() method. All the properties which are created by simple assignment or property initializer are enumerable by default.
Example 1:
<script>// Creating a student objectconst stude... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Jun, 2020"
},
{
"code": null,
"e": 277,
"s": 28,
"text": "An enumerable property in JavaScript means that a property can be viewed if it is iterated using the for...in loop or Object.keys() method. All the properties which are create... |
How to rearrange columns of a 2D NumPy array using given index positions? | 05 Sep, 2020
In this article, we will learn how to rearrange columns of a given numpy array using given index positions. Here the columns are rearranged with the given indexes. For this, we can simply store the columns values in lists and arrange these according to the given index list but this approach is very costly.... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Sep, 2020"
},
{
"code": null,
"e": 423,
"s": 28,
"text": "In this article, we will learn how to rearrange columns of a given numpy array using given index positions. Here the columns are rearranged with the given indexes. For this, w... |
Sphenic Number | 23 Jun, 2022
A Sphenic Number is a positive integer n which is product of exactly three distinct primes. The first few sphenic numbers are 30, 42, 66, 70, 78, 102, 105, 110, 114, ... Given a number n, determine whether it is a Sphenic Number or not.
Examples:
Input : 30
Output : Yes
Explanation : 30 is the smallest S... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Jun, 2022"
},
{
"code": null,
"e": 290,
"s": 52,
"text": "A Sphenic Number is a positive integer n which is product of exactly three distinct primes. The first few sphenic numbers are 30, 42, 66, 70, 78, 102, 105, 110, 114, ... Give... |
Difference between Array and Pointers in C. | Array in C is used to store elements of same types whereas Pointers are address varibles which stores the address of a variable. Now array variable is also having a address which can be pointed by a pointer and array can be navigated using pointer.r Benefit of using pointer for array is two folds, first, we store the a... | [
{
"code": null,
"e": 1678,
"s": 1187,
"text": "Array in C is used to store elements of same types whereas Pointers are address varibles which stores the address of a variable. Now array variable is also having a address which can be pointed by a pointer and array can be navigated using pointer.r Ben... |
Create and save animated GIF with Python – Pillow | 24 Feb, 2021
Prerequisites: pillow
In this article, we are going to use a pillow library to create and save gifs.
GIFs: The Graphics Interchange Format(gif) is a bitmap image format that was developed by a team at the online services provider CompuServe led by American computer scientist Steve Wilhite on 15 June 1987.
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Feb, 2021"
},
{
"code": null,
"e": 50,
"s": 28,
"text": "Prerequisites: pillow"
},
{
"code": null,
"e": 129,
"s": 50,
"text": "In this article, we are going to use a pillow library to create and save gifs."
},
... |
How to create multiple subplots in Matplotlib in Python? | 16 Dec, 2020
To create multiple plots use matplotlib.pyplot.subplots method which returns the figure along with Axes object or array of Axes object. nrows, ncols attributes of subplots() method determine the number of rows and columns of the subplot grid.
By default, it returns a figure with a single plot. For each axe... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Dec, 2020"
},
{
"code": null,
"e": 271,
"s": 28,
"text": "To create multiple plots use matplotlib.pyplot.subplots method which returns the figure along with Axes object or array of Axes object. nrows, ncols attributes of subplots() m... |
Count of subsequence of an Array having all unique digits | 30 Nov, 2021
Given an array A containing N positive integers, the task is to find the number of subsequences of this array such that in each subsequence , no digit is repeated twice, i.e. all the digits of the subsequences must be unique.Examples:
Input: A = [1, 12, 23, 34] Output: 7 The subsequences are: {1}, {12}, {... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Nov, 2021"
},
{
"code": null,
"e": 288,
"s": 52,
"text": "Given an array A containing N positive integers, the task is to find the number of subsequences of this array such that in each subsequence , no digit is repeated twice, i.e.... |
Rust – Strings | 01 Jun, 2021
String data type makes a very important part of any programming language. Rust handles strings a bit differently from other languages.
The String data type in Rust is of two types:
String Literal (&str)
String Object (String)
String Literal or &str are called ‘string slices’, which always point to a legi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Jun, 2021"
},
{
"code": null,
"e": 165,
"s": 28,
"text": "String data type makes a very important part of any programming language. Rust handles strings a bit differently from other languages. "
},
{
"code": null,
"e": 2... |
Scanner hasNextInt() method in Java with Examples | 02 Dec, 2021
The hasNextInt() method of java.util.Scanner class returns true if the next token in this scanner’s input can be assumed as a Int value of the given radix. The scanner does not advance past any input. In case no radix is passed as a parameter, the function interpretes the radix to be default radix and func... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n02 Dec, 2021"
},
{
"code": null,
"e": 378,
"s": 52,
"text": "The hasNextInt() method of java.util.Scanner class returns true if the next token in this scanner’s input can be assumed as a Int value of the given radix. The scanner does n... |
Ruby | Array append() function | 07 Jan, 2020
Array#append() is an Array class method which add elements at the end of the array.
Syntax: Array.append()
Parameter: – Arrays for adding elements.– elements to add
Return: Array after adding the elements at the end.
Example #1 :
# Ruby code for append() method# adding elements at the end # declaring ar... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Jan, 2020"
},
{
"code": null,
"e": 112,
"s": 28,
"text": "Array#append() is an Array class method which add elements at the end of the array."
},
{
"code": null,
"e": 135,
"s": 112,
"text": "Syntax: Array.append()... |
Python PIL | BoxBlur() method | 14 Sep, 2021
PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The ImageFilter module contains definitions for a pre-defined set of filters, which can be used with the Image.filter() method.PIL.ImageFilter.BoxBlur() Blurs the image by setting each pixel to the aver... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 575,
"s": 28,
"text": "PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The ImageFilter module contains definitions for a pre-defined set of f... |
Program to find lowest possible integer that is missing in the array in Python | Suppose we have a list of numbers called nums, we have to find the first missing positive number. In other words, the lowest positive number that does not present in the array. The array can contain duplicates and negative numbers as well.
So, if the input is like nums = [0,3,1], then the output will be 2
To solve this... | [
{
"code": null,
"e": 1427,
"s": 1187,
"text": "Suppose we have a list of numbers called nums, we have to find the first missing positive number. In other words, the lowest positive number that does not present in the array. The array can contain duplicates and negative numbers as well."
},
{
... |
Scrapy – Selectors | 24 Jun, 2021
Scrapy Selectors as the name suggest are used to select some things. If we talk of CSS, then there are also selectors present that are used to select and apply CSS effects to HTML tags and text.
In Scrapy we are using selectors to mention the part of the website which is to be scraped by our spiders. Hence... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Jun, 2021"
},
{
"code": null,
"e": 223,
"s": 28,
"text": "Scrapy Selectors as the name suggest are used to select some things. If we talk of CSS, then there are also selectors present that are used to select and apply CSS effects to ... |
Python | os.stat() method | 26 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.stat() method in Python performs stat() system call on the specified path. This metho... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 May, 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... |
Minimum elements to be removed such that sum of adjacent elements is always even | 15 Apr, 2021
Given an array of N integers. The task is to eliminate the minimum number of elements such that in the resulting array the sum of any two adjacent values is even.
Examples:
Input : arr[] = {1, 2, 3}
Output : 1
Remove 2 from the array.
Input : arr[] = {1, 3, 5, 4, 2}
Output : 2
Remove 4 and 2.
Approach: T... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n15 Apr, 2021"
},
{
"code": null,
"e": 216,
"s": 53,
"text": "Given an array of N integers. The task is to eliminate the minimum number of elements such that in the resulting array the sum of any two adjacent values is even."
},
{
... |
Python OpenCV – Smoothing and Blurring | 05 Jan, 2022
In this article, we are going to learn about smoothing and blurring with python-OpenCV.
When we are dealing with images at some points the images will be crisper and sharper which we need to smoothen or blur to get a clean image, or sometimes the image will be with a really bad edge which also we need to s... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Jan, 2022"
},
{
"code": null,
"e": 116,
"s": 28,
"text": "In this article, we are going to learn about smoothing and blurring with python-OpenCV."
},
{
"code": null,
"e": 473,
"s": 116,
"text": "When we are dealin... |
Python – tensorflow.constant() | 26 Jun, 2020
TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning neural networks.
constant() is used to create a Tensor from tensor like objects like list.
Syntax: tensorflow.constant( value, dtype, shape, name )
Parameters:
value: It is the value that neede... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Jun, 2020"
},
{
"code": null,
"e": 159,
"s": 28,
"text": "TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning neural networks."
},
{
"code": null,
"e": 233,
... |
Plotly with Pandas and Cufflinks | Pandas is a very popular library in Python for data analysis. It also has its own plot function support. However, Pandas plots don't provide interactivity in visualization. Thankfully, plotly's interactive and dynamic plots can be built using Pandas dataframe objects.
We start by building a Dataframe from simple list o... | [
{
"code": null,
"e": 2629,
"s": 2360,
"text": "Pandas is a very popular library in Python for data analysis. It also has its own plot function support. However, Pandas plots don't provide interactivity in visualization. Thankfully, plotly's interactive and dynamic plots can be built using Pandas dat... |
Custom Coloring Dendrogram Ends in R | by Matt Selensky | Towards Data Science | As a graduate student studying microbial community data, most of the projects I work on involve some sort of clustering analysis. For one of them, I wanted to color the ends of a dendrogram by a variable from my metadata, to visualize whether that variable followed the clustering as part of another figure. There exist ... | [
{
"code": null,
"e": 677,
"s": 172,
"text": "As a graduate student studying microbial community data, most of the projects I work on involve some sort of clustering analysis. For one of them, I wanted to color the ends of a dendrogram by a variable from my metadata, to visualize whether that variabl... |
Program to Divide two 8 Bit numbers in 8051 Microprocessor | Here we will see the division operation. This operation will be used to divide two 8-bit numbers using this 8051 microcontroller. The register A and B will be used in this operation. No other registers can be used for division. The result of the division has two parts. The quotient part and the remainder part. Register... | [
{
"code": null,
"e": 1441,
"s": 1062,
"text": "Here we will see the division operation. This operation will be used to divide two 8-bit numbers using this 8051 microcontroller. The register A and B will be used in this operation. No other registers can be used for division. The result of the divisio... |
How to interactively validate an Entry widget content in tkinter? | Validating the content is a necessary part of any featured application where we allow only the required data to be processed. An Entry Widget in tkinter is used to display single line text Input. However, we can validate the Entry widget to accept only digits or alphabets.
Let us first create an Entry widget that accep... | [
{
"code": null,
"e": 1336,
"s": 1062,
"text": "Validating the content is a necessary part of any featured application where we allow only the required data to be processed. An Entry Widget in tkinter is used to display single line text Input. However, we can validate the Entry widget to accept only ... |
base64.b85encode() in Python - GeeksforGeeks | 26 Mar, 2020
With the help of base64.b85encode() method, we can encode the string by using base85 alphabet into the binary form.
Syntax : base64.b85encode(string)
Return : Return the encoded string.
Example #1 :In this example we can see that by using base64.b85encode() method, we are able to get the encoded string whi... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n26 Mar, 2020"
},
{
"code": null,
"e": 24408,
"s": 24292,
"text": "With the help of base64.b85encode() method, we can encode the string by using base85 alphabet into the binary form."
},
{
"code": null,
"e": 24442,
... |
WPF - Interaction | In WPF, an interaction shows how a view interacts with controls located in that view. The most commonly known interactions are of two types −
Behaviors
Drag and Drop
Behaviors were introduced with Expression Blend 3 which can encapsulate some of the functionality into a reusable component. To add additional behaviors, ... | [
{
"code": null,
"e": 2162,
"s": 2020,
"text": "In WPF, an interaction shows how a view interacts with controls located in that view. The most commonly known interactions are of two types −"
},
{
"code": null,
"e": 2172,
"s": 2162,
"text": "Behaviors"
},
{
"code": null,
... |
How to replace a character at a particular index in JavaScript ? - GeeksforGeeks | 28 Nov, 2019
To replace a character from a string there are popular methods available, the two most popular methods we are going to describe in this article. The first method is by using the substr() method. And in the second method, we will convert the string to an array and replace the character at the index. Both me... | [
{
"code": null,
"e": 25111,
"s": 25083,
"text": "\n28 Nov, 2019"
},
{
"code": null,
"e": 25445,
"s": 25111,
"text": "To replace a character from a string there are popular methods available, the two most popular methods we are going to describe in this article. The first method i... |
How do I send a DELETE keystroke to a text field using Selenium with Python? | We can send a DELETE keystroke to a text field using Selenium webdriver with Python. First of all, we have to identify the text field with the help of any locators like xpath, css, id, and so on.
We can enter a text in the text field with the send_keys method. The value to be entered is passed as parameter to the metho... | [
{
"code": null,
"e": 1258,
"s": 1062,
"text": "We can send a DELETE keystroke to a text field using Selenium webdriver with Python. First of all, we have to identify the text field with the help of any locators like xpath, css, id, and so on."
},
{
"code": null,
"e": 1469,
"s": 1258,... |
Calculating Factorials using Stirling Approximation - GeeksforGeeks | 07 Apr, 2021
We are aware of calculating factorials using loops or recursion, but if we are asked to calculate factorial without using any loop or recursion. Yes, this is possible through a well-known approximation algorithm known as Stirling approximation. Examples:
Input : n = 6
Output : 720
Input : n = 2
Output :... | [
{
"code": null,
"e": 24718,
"s": 24690,
"text": "\n07 Apr, 2021"
},
{
"code": null,
"e": 24975,
"s": 24718,
"text": "We are aware of calculating factorials using loops or recursion, but if we are asked to calculate factorial without using any loop or recursion. Yes, this is possi... |
Difference Between Running and Runnable States of a Thread in Java - GeeksforGeeks | 22 Nov, 2021
Thread is the backbone of multithreading in java. Multithreading is a feature that allows concurrent execution of two or more parts of the program for the maximum utilization of CPU. Each part of such a program is called a thread. So threads are light-weighted processes within a process.
A thread can have... | [
{
"code": null,
"e": 24858,
"s": 24830,
"text": "\n22 Nov, 2021"
},
{
"code": null,
"e": 25148,
"s": 24858,
"text": "Thread is the backbone of multithreading in java. Multithreading is a feature that allows concurrent execution of two or more parts of the program for the maximum ... |
Gerrit - Quick Guide | Gerrit is a web based code review tool which is integrated with Git and built on top of Git version control system (helps developers to work together and maintain the history of their work). It allows to merge changes to Git repository when you are done with the code reviews.
Gerrit was developed by Shawn Pearce at Goo... | [
{
"code": null,
"e": 2515,
"s": 2238,
"text": "Gerrit is a web based code review tool which is integrated with Git and built on top of Git version control system (helps developers to work together and maintain the history of their work). It allows to merge changes to Git repository when you are done... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.