title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
CAN Bus with Arduino | Communication protocols like UART (Serial), I2C and SPI are very popular because several peripherals can be interfaced with Arduino using these protocols. CAN (Controller Area Network) is another such protocol, which isn't very widely popular in general, but find several applications in the automotive domain.
While goi... | [
{
"code": null,
"e": 1373,
"s": 1062,
"text": "Communication protocols like UART (Serial), I2C and SPI are very popular because several peripherals can be interfaced with Arduino using these protocols. CAN (Controller Area Network) is another such protocol, which isn't very widely popular in general... |
Last duplicate element in a sorted array | 12 Jun, 2022
We have a sorted array with duplicate elements and we have to find the index of last duplicate element and print index of it and also print the duplicate element. If no such element found print a message. Examples:
Input : arr[] = {1, 5, 5, 6, 6, 7}
Output :
Last index: 4
Last duplicate item: 6
Input : ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n12 Jun, 2022"
},
{
"code": null,
"e": 270,
"s": 53,
"text": "We have a sorted array with duplicate elements and we have to find the index of last duplicate element and print index of it and also print the duplicate element. If no such ... |
if/else condition in CSS | 30 Jun, 2022
Given an HTML file and we need to apply using if-else conditions in CSS.No, We can not use if-else conditions in CSS as CSS doesn’t support logics. But we can use some alternatives to if-else which are discussed below:Method 1: In this method, we will use classes in HTML file to achieve this. We will defin... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Jun, 2022"
},
{
"code": null,
"e": 442,
"s": 52,
"text": "Given an HTML file and we need to apply using if-else conditions in CSS.No, We can not use if-else conditions in CSS as CSS doesn’t support logics. But we can use some altern... |
Genesys Interview Experience (On-Campus) | 20 Dec, 2018
Genesys is a networking based company. Most of the questions were from Networks, Operating Systems, C++ and Java. No questions were asked from Database.
Day 1:
Written Test: (2 hours)
5 sections of aptitude questions:
Correct answer: 2 marks, Wrong answer: -1 mark
Verbal – 5 questionsQuantitative – 10 ques... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Dec, 2018"
},
{
"code": null,
"e": 181,
"s": 28,
"text": "Genesys is a networking based company. Most of the questions were from Networks, Operating Systems, C++ and Java. No questions were asked from Database."
},
{
"code": ... |
Python | Ways to join pair of elements in list | 25 Jun, 2019
Given a list, the task is to join a pair of elements of the list. Given below are a few methods to solve the given task.
Method #1: Using zip() method
# Python code to demonstrate # how to join pair of elements of list # Initialising listini_list = ['a', 'b', 'c', 'd', 'e', 'f'] # Printing initial list p... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Jun, 2019"
},
{
"code": null,
"e": 149,
"s": 28,
"text": "Given a list, the task is to join a pair of elements of the list. Given below are a few methods to solve the given task."
},
{
"code": null,
"e": 179,
"s": 149... |
Scope Resolution operator in PHP | 21 Jul, 2021
The scope resolution operator also known as Paamayim Nekudotayim or more commonly known as the double colon is a token that allows access to static, constant, and overridden properties or methods of a class.
It is used to refer to blocks or codes in context to classes, objects, etc. An identifier is used w... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Jul, 2021"
},
{
"code": null,
"e": 236,
"s": 28,
"text": "The scope resolution operator also known as Paamayim Nekudotayim or more commonly known as the double colon is a token that allows access to static, constant, and overridden p... |
Batch Script - MOVE | This batch command moves files or directories between directories.
move [source] [destination]
The files will be copied from source to destination location.
The following example shows the different variants of the move command.
@echo off
Rem Moves the file list.txt to the directory c:\tp
move C:\lists.txt c:\tp
Rem R... | [
{
"code": null,
"e": 2370,
"s": 2303,
"text": "This batch command moves files or directories between directories."
},
{
"code": null,
"e": 2399,
"s": 2370,
"text": "move [source] [destination]\n"
},
{
"code": null,
"e": 2461,
"s": 2399,
"text": "The files will... |
MapReduce Program – Weather Data Analysis For Analyzing Hot And Cold Days | 23 Dec, 2021
Here, we will write a Map-Reduce program for analyzing weather datasets to understand its data processing programming model. Weather sensors are collecting weather information across the globe in a large volume of log data. This weather data is semi-structured and record-oriented.This data is stored in a l... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n23 Dec, 2021"
},
{
"code": null,
"e": 805,
"s": 54,
"text": "Here, we will write a Map-Reduce program for analyzing weather datasets to understand its data processing programming model. Weather sensors are collecting weather informatio... |
Multi-plot grid in Seaborn | 14 Jan, 2022
Prerequisites: Matplotlib, Seaborn
In this article, we are going to see multi-dimensional plot data, It is a useful approach to draw multiple instances of the same plot on different subsets of your dataset. It allows a viewer to quickly extract a large amount of information about a complex dataset. In Seab... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Jan, 2022"
},
{
"code": null,
"e": 63,
"s": 28,
"text": "Prerequisites: Matplotlib, Seaborn"
},
{
"code": null,
"e": 496,
"s": 63,
"text": "In this article, we are going to see multi-dimensional plot data, It is a... |
COBOL - Loop Statements | There are some tasks that need to be done over and over again like reading each record of a file till its end. The loop statements used in COBOL are −
Perform Thru
Perform Until
Perform Times
Perform Varying
Perform Thru is used to execute a series of paragraph by giving the first and last paragraph names in the sequen... | [
{
"code": null,
"e": 2307,
"s": 2156,
"text": "There are some tasks that need to be done over and over again like reading each record of a file till its end. The loop statements used in COBOL are −"
},
{
"code": null,
"e": 2320,
"s": 2307,
"text": "Perform Thru"
},
{
"cod... |
Working With the EditText in Android | 10 Jun, 2021
EditText is one of the basic UI widgets, which is used to take the input from the user. The EditText is derived or is the extension of the TextView in Android. This article its been discussed in detail about the EditText in Android. The article also contains some of the redirections to other articles, also... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Jun, 2021"
},
{
"code": null,
"e": 493,
"s": 28,
"text": "EditText is one of the basic UI widgets, which is used to take the input from the user. The EditText is derived or is the extension of the TextView in Android. This article it... |
Create a responsive navigation menu with CSS Media Queries | Media Queries is used when you need to set a style to different devices such as tablet, mobile, desktop, etc.
You can try to run the following code to create a responsive navigation menu with Media Queries:
Live Demo
<!DOCTYPE html>
<html lang = "en">
<head>
<meta charset = "utf-8">
<meta name = "viewpor... | [
{
"code": null,
"e": 1297,
"s": 1187,
"text": "Media Queries is used when you need to set a style to different devices such as tablet, mobile, desktop, etc."
},
{
"code": null,
"e": 1394,
"s": 1297,
"text": "You can try to run the following code to create a responsive navigation ... |
How to Add a Y-Axis Label to the Secondary Y-Axis in Matplotlib? | 30 Aug, 2021
Sometimes while analyzing any data through graphs we need two x or y-axis to get some more insights into the data. Matplotlib library of Python is the most popular data visualization library, and we can generate any type of plot in Matplotlib. We can create a plot that has two y-axes and can provide differ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Aug, 2021"
},
{
"code": null,
"e": 645,
"s": 28,
"text": "Sometimes while analyzing any data through graphs we need two x or y-axis to get some more insights into the data. Matplotlib library of Python is the most popular data visual... |
Define Node position in Sankey Diagram in plotly | 15 Feb, 2022
Plotly is a Python library which is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization library.
Sanke... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Feb, 2022"
},
{
"code": null,
"e": 330,
"s": 28,
"text": "Plotly is a Python library which is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot an... |
java.math.MathContext Class in Java | 22 Feb, 2021
The java.math.MathContext class provides immutable objects that encapsulate context settings and define those numerical operator rules, such as those that the BigDecimal class implements.
The base-independent configurations are as follows:
Precision: The number of digits to be used for an operation; this a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Feb, 2021"
},
{
"code": null,
"e": 216,
"s": 28,
"text": "The java.math.MathContext class provides immutable objects that encapsulate context settings and define those numerical operator rules, such as those that the BigDecimal class... |
How to handle SSL certificate error using Selenium WebDriver? | We can handle SSL certificate error using Selenium webdriver while we try to launch a web page based on HTTP. SSL certificate errors are encountered in multiple browsers like Chrome, Safari, and Firefox and so on.
SSL certificate error comes up if the site we are making an attempt to access has an outdated, invalid or ... | [
{
"code": null,
"e": 1401,
"s": 1187,
"text": "We can handle SSL certificate error using Selenium webdriver while we try to launch a web page based on HTTP. SSL certificate errors are encountered in multiple browsers like Chrome, Safari, and Firefox and so on."
},
{
"code": null,
"e": 16... |
Robot Framework - Introduction to Ride | Ride is a testing editor for Robot Framework. Further, we will write test cases in Ride. To start Ride, we need to run the command shown below.
ride.py
The above command will open the IDE as shown in the following screenshot −
In this chapter, we will walk through the editor to see what options and features are availa... | [
{
"code": null,
"e": 2447,
"s": 2303,
"text": "Ride is a testing editor for Robot Framework. Further, we will write test cases in Ride. To start Ride, we need to run the command shown below."
},
{
"code": null,
"e": 2456,
"s": 2447,
"text": "ride.py\n"
},
{
"code": null,
... |
Count distinct elements in an array | 29 Jun, 2022
Given an unsorted array, count all distinct elements in it.Examples:
Input : arr[] = {10, 20, 20, 10, 30, 10}
Output : 3
There are three distinct elements 10, 20 and 30.
Input : arr[] = {10, 20, 20, 10, 20}
Output : 2
A simple solution is to run two loops. For every element, check if it has appear... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 Jun, 2022"
},
{
"code": null,
"e": 123,
"s": 52,
"text": "Given an unsorted array, count all distinct elements in it.Examples: "
},
{
"code": null,
"e": 277,
"s": 123,
"text": "Input : arr[] = {10, 20, 20, 10,... |
Display Property in Bootstrap with Examples | 24 Jan, 2019
The display property in Bootstrap is used to set an element’s display property. The utilities such as block, inline etc are to set the element’s display property.
The display property classes of bootstrap help to directly set the CSS display property for an element.
The available classes are:
.d-block: Thi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Jan, 2019"
},
{
"code": null,
"e": 191,
"s": 28,
"text": "The display property in Bootstrap is used to set an element’s display property. The utilities such as block, inline etc are to set the element’s display property."
},
{
... |
TCL script to create FTP traffic over TCP | 09 Mar, 2021
In this article, we are going to know how to write a tool command script to simulate TCP connection between 2 nodes and pass FTP traffic between them in ns2. We will also know how to display throughput packets dropped, received and sent.
Introduction :The routing algorithm used in the program is the Dista... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Mar, 2021"
},
{
"code": null,
"e": 267,
"s": 28,
"text": "In this article, we are going to know how to write a tool command script to simulate TCP connection between 2 nodes and pass FTP traffic between them in ns2. We will also know... |
Program to print ASCII Value of a character | 30 Mar, 2022
Given a character, we need to print its ASCII value in C/C++/Java/Python.
Examples :
Input : a
Output : 97
Input : D
Output : 68
Here are few methods in different programming languages to print ASCII value of a given character :
Python code using ord function :ord() : It converts the given string of len... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Mar, 2022"
},
{
"code": null,
"e": 126,
"s": 52,
"text": "Given a character, we need to print its ASCII value in C/C++/Java/Python."
},
{
"code": null,
"e": 137,
"s": 126,
"text": "Examples :"
},
{
"code"... |
Python sorted containers | An Introduction | 11 May, 2020
Sorted Containers is an Apache2 licensed sorted collections library, written in pure-Python, and fast as C-extensions. It was created by Grant Jenks and is an open source library. It is a collection of containers that allow us to insert and remove elements very efficiently while maintaining sorted order.
F... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 May, 2020"
},
{
"code": null,
"e": 360,
"s": 54,
"text": "Sorted Containers is an Apache2 licensed sorted collections library, written in pure-Python, and fast as C-extensions. It was created by Grant Jenks and is an open source lib... |
Python Dictionary | Check if binary representations of two numbers are anagram | 27 Jul, 2020
Given two numbers you are required to check whether they are anagrams of each other or not in binary representation.
Examples:
Input : a = 8, b = 4
Output : Yes
Binary representations of both
numbers have same 0s and 1s.
Input : a = 4, b = 5
Output : No
We have existing solution for this problem please ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Jul, 2020"
},
{
"code": null,
"e": 145,
"s": 28,
"text": "Given two numbers you are required to check whether they are anagrams of each other or not in binary representation."
},
{
"code": null,
"e": 155,
"s": 145,
... |
BabelJS - Transpile ES7 features to ES5 | In this chapter, we will learn how to transpile ES7 features to ES5.
ECMA Script 7 has the following new features added to it −
Async-Await
Exponentiation Operator
Array.prototype.includes()
We will compile them to ES5 using babeljs. Depending on your project requirements, it is also possible to compile the code in any... | [
{
"code": null,
"e": 2164,
"s": 2095,
"text": "In this chapter, we will learn how to transpile ES7 features to ES5."
},
{
"code": null,
"e": 2223,
"s": 2164,
"text": "ECMA Script 7 has the following new features added to it −"
},
{
"code": null,
"e": 2235,
"s": 22... |
The Right Way to Access a Dictionary | by Radian Krisno | Towards Data Science | The dictionary is one of the data structures that are ready to use when programming in Python.
Dictionary is an unordered and unordered Python collection that maps unique keys to some values. In Python, dictionaries are written by using curly brackets {} . The key is separated from the key by a colon : and every key-va... | [
{
"code": null,
"e": 267,
"s": 172,
"text": "The dictionary is one of the data structures that are ready to use when programming in Python."
},
{
"code": null,
"e": 576,
"s": 267,
"text": "Dictionary is an unordered and unordered Python collection that maps unique keys to some va... |
Loading models into tensorflow.js via react.js | by Manfye Goh | Towards Data Science | You had trained your image classification model well in TensorFlow and you eagerly want to integrate it into production and use by your users. However, you found out the problem as below:
Due to privacy concern, your user doesn’t want to upload their photo into your server
You are poor and you don’t want to create a wh... | [
{
"code": null,
"e": 359,
"s": 171,
"text": "You had trained your image classification model well in TensorFlow and you eagerly want to integrate it into production and use by your users. However, you found out the problem as below:"
},
{
"code": null,
"e": 445,
"s": 359,
"text":... |
PHP | Interface - GeeksforGeeks | 03 Nov, 2018
An Interface allows the users to create programs, specifying the public methods that a class must implement, without involving the complexities and details of how the particular methods are implemented. It is generally referred to as the next level of abstraction. It resembles the abstract methods, resembl... | [
{
"code": null,
"e": 24483,
"s": 24455,
"text": "\n03 Nov, 2018"
},
{
"code": null,
"e": 25139,
"s": 24483,
"text": "An Interface allows the users to create programs, specifying the public methods that a class must implement, without involving the complexities and details of how ... |
Groovy - size() | Obtains the number of elements in this List.
int size()
None
The size of the list.
Following is an example of the usage of this method −
class Example {
static void main(String[] args) {
def lst = [11, 12, 13, 14];
println(lst.size);
}
}
When we run the above program, we will get the following resul... | [
{
"code": null,
"e": 2283,
"s": 2238,
"text": "Obtains the number of elements in this List."
},
{
"code": null,
"e": 2295,
"s": 2283,
"text": "int size()\n"
},
{
"code": null,
"e": 2300,
"s": 2295,
"text": "None"
},
{
"code": null,
"e": 2322,
"... |
SAP ABAP - Basic Syntax | ABAP source program consists of comments and ABAP statements. Every statement in ABAP begins with a keyword and ends with a period, and ABAP is ‘Not’ case sensitive.
The first non-comment line in a program begins with the word REPORT. The Report will always be the first line of any executable program created. The state... | [
{
"code": null,
"e": 3064,
"s": 2898,
"text": "ABAP source program consists of comments and ABAP statements. Every statement in ABAP begins with a keyword and ends with a period, and ABAP is ‘Not’ case sensitive."
},
{
"code": null,
"e": 3331,
"s": 3064,
"text": "The first non-co... |
Tryit Editor v3.6 - Show Python | mydb = mysql.connector.connect(
host="localhost",
user="myusername",
password="mypassword",
database="mydatabase"
)
mycursor = mydb.cursor() | [
{
"code": null,
"e": 57,
"s": 25,
"text": "mydb = mysql.connector.connect("
},
{
"code": null,
"e": 77,
"s": 57,
"text": " host=\"localhost\","
},
{
"code": null,
"e": 98,
"s": 77,
"text": " user=\"myusername\","
},
{
"code": null,
"e": 123,
... |
Swing Examples - Add Border to JLabel | Following example showcase how to add border to a JLabel in a Java Swing application.
We are using the following APIs.
BorderFactory.createLineBorder() − To create a line border.
BorderFactory.createLineBorder() − To create a line border.
JLabel.setBorder(border) − To set the desired border to the JLabel.
JLabel.setBor... | [
{
"code": null,
"e": 2125,
"s": 2039,
"text": "Following example showcase how to add border to a JLabel in a Java Swing application."
},
{
"code": null,
"e": 2158,
"s": 2125,
"text": "We are using the following APIs."
},
{
"code": null,
"e": 2218,
"s": 2158,
"... |
How to Simply Deploy a Smart Contract on Ethereum? - GeeksforGeeks | 06 Aug, 2021
Smart contracts are blocks of code that reside on the blockchain. It is like an Ethereum account but there is a critical difference between an external account and a smart contract. Unlike a smart contract, an external account can connect to multiple Ethereum networks (Rinkebey, Kovan, main, etc.) whereas ... | [
{
"code": null,
"e": 24247,
"s": 24219,
"text": "\n06 Aug, 2021"
},
{
"code": null,
"e": 24925,
"s": 24247,
"text": "Smart contracts are blocks of code that reside on the blockchain. It is like an Ethereum account but there is a critical difference between an external account and... |
How to view the complete output of tibble in R? | Tibbles are created when we analyze data using dplyr package and if the data size is large then only 10 values are printed in R. If we want to display the complete output of tibble then View function needs to be used. For example, if we want to perform calculation of counts then we should add View() at the end of the c... | [
{
"code": null,
"e": 1406,
"s": 1062,
"text": "Tibbles are created when we analyze data using dplyr package and if the data size is large then only 10 values are printed in R. If we want to display the complete output of tibble then View function needs to be used. For example, if we want to perform ... |
Rendering Static HTML page using Django - onlinetutorialspoint | 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, we will learn how to render... | [
{
"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,
... |
C Program to find whether a no is power of two - GeeksforGeeks | 19 Jul, 2021
Given a positive integer, write a function to find if it is a power of two or not.Examples :
Input : n = 4
Output : Yes
22 = 4
Input : n = 7
Output : No
Input : n = 32
Output : Yes
25 = 32
1. A simple method for this is to simply take the log of the number on base 2 and if you get an integer then numbe... | [
{
"code": null,
"e": 24539,
"s": 24511,
"text": "\n19 Jul, 2021"
},
{
"code": null,
"e": 24634,
"s": 24539,
"text": "Given a positive integer, write a function to find if it is a power of two or not.Examples : "
},
{
"code": null,
"e": 24732,
"s": 24634,
"tex... |
explode() function in PHP | The explode() function is used to split a string by string.
explode(delimiter, str, limit)
delimiter − The boundary string
delimiter − The boundary string
str − String to split
str − String to split
limit − Specifies the number of array elements to return.
limit − Specifies the number of array elements to return.
The f... | [
{
"code": null,
"e": 1122,
"s": 1062,
"text": "The explode() function is used to split a string by string."
},
{
"code": null,
"e": 1153,
"s": 1122,
"text": "explode(delimiter, str, limit)"
},
{
"code": null,
"e": 1185,
"s": 1153,
"text": "delimiter − The boun... |
Absolute distinct count in a sorted array - GeeksforGeeks | 02 Mar, 2022
Given a sorted array of integers, return the number of distinct absolute values among the elements of the array. The input can contain duplicates values. Examples:
Input: [-3, -2, 0, 3, 4, 5]
Output: 5
There are 5 distinct absolute values
among the elements of this array, i.e.
0, 2, 3, 4 and 5)
Input: ... | [
{
"code": null,
"e": 25181,
"s": 25153,
"text": "\n02 Mar, 2022"
},
{
"code": null,
"e": 25347,
"s": 25181,
"text": "Given a sorted array of integers, return the number of distinct absolute values among the elements of the array. The input can contain duplicates values. Examples:... |
H2O - Flow | In the last lesson, you learned to create H2O based ML models using command line interface. H2O Flow fulfils the same purpose, but with a web-based interface.
In the following lessons, I will show you how to start H2O Flow and to run a sample application.
The H2O installation that you downloaded earlier contains the h2... | [
{
"code": null,
"e": 1811,
"s": 1652,
"text": "In the last lesson, you learned to create H2O based ML models using command line interface. H2O Flow fulfils the same purpose, but with a web-based interface."
},
{
"code": null,
"e": 1908,
"s": 1811,
"text": "In the following lesson... |
Web Scraping Metacritic Reviews using BeautifulSoup | by Adeline Ong | Towards Data Science | I decided to scrape Metacritic Pokemon reviews because I wanted to topic model negative game reviews. I was intrigued by how the games were praised by critics but evaluated badly by most gamers. Why do gamers hate Pokemon? More about that in this post. In the meantime, here’s how I scraped the reviews from the site.
**... | [
{
"code": null,
"e": 365,
"s": 47,
"text": "I decided to scrape Metacritic Pokemon reviews because I wanted to topic model negative game reviews. I was intrigued by how the games were praised by critics but evaluated badly by most gamers. Why do gamers hate Pokemon? More about that in this post. In ... |
JavaScript Boolean valueOf() Method - GeeksforGeeks | 24 Nov, 2021
Below is the example of Boolean valueOf() method.
Example:
javascript
<script> // Here Boolean object obj // is created for the value 27 var obj = new Boolean(27); // Here boolean.valueOf() function is // used for the created object obj. document.write(obj.valueOf());
Output:
true
The boolean.... | [
{
"code": null,
"e": 29980,
"s": 29952,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 30032,
"s": 29980,
"text": "Below is the example of Boolean valueOf() method. "
},
{
"code": null,
"e": 30043,
"s": 30032,
"text": "Example: "
},
{
"code": null,... |
Moore's Voting Algorithm | Majority element in an array - onlinetutorialspoint | 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, we’ll learn about Moore’s v... | [
{
"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,
... |
Height of a complete binary tree (or Heap) with N nodes - GeeksforGeeks | 06 Jan, 2022
Consider a Binary Heap of size N. We need to find the height of it.Examples :
Input : N = 6
Output : 2
()
/ \
() ()
/ \ /
() () ()
Input : N = 9
Output :
()
/ \
() ()
/ \ / \
() () () ()
/ \
() ()
Let the size of heap b... | [
{
"code": null,
"e": 25022,
"s": 24994,
"text": "\n06 Jan, 2022"
},
{
"code": null,
"e": 25102,
"s": 25022,
"text": "Consider a Binary Heap of size N. We need to find the height of it.Examples : "
},
{
"code": null,
"e": 25305,
"s": 25102,
"text": "Input : N ... |
A friendly Guide for writing Recursive Functions with Python | by Eugenia Anello | Towards Data Science | At first, recursion can seem impossible to learn if it is explained very badly. I still remember how I found it challenging the first time I have met it. To understand it deeply, I needed to do many exercises.
It was hard since my mind instinctively solved the problems using iterations, like for loop and while. But wit... | [
{
"code": null,
"e": 382,
"s": 172,
"text": "At first, recursion can seem impossible to learn if it is explained very badly. I still remember how I found it challenging the first time I have met it. To understand it deeply, I needed to do many exercises."
},
{
"code": null,
"e": 593,
... |
Ruby | Enumerable partition() function - GeeksforGeeks | 05 Dec, 2019
The partition() of enumerable is an inbuilt method in Ruby returns two arrays, one containing the elements of the enumerable which return true, while the other contains the elements which returns false. It returns an enumerator if no block is passed.
Syntax enu.partition { |obj| block }
Parameters: The fun... | [
{
"code": null,
"e": 23297,
"s": 23269,
"text": "\n05 Dec, 2019"
},
{
"code": null,
"e": 23548,
"s": 23297,
"text": "The partition() of enumerable is an inbuilt method in Ruby returns two arrays, one containing the elements of the enumerable which return true, while the other con... |
How to push a Lua table as an argument? | We may want to push the Lua table as an argument to a code written in C++ which uses Lua as an embedded language and for that case we need to make use of the different API functions that the Lua library provides us with.
The Lua code will look something like the code shown below −
a = {
numb = 10,
create = functi... | [
{
"code": null,
"e": 1283,
"s": 1062,
"text": "We may want to push the Lua table as an argument to a code written in C++ which uses Lua as an embedded language and for that case we need to make use of the different API functions that the Lua library provides us with."
},
{
"code": null,
... |
Types of variable, it's graphical representation | Towards Data Science | “You can have data without information, but you cannot have information without data.” — Daniel Keys Moran
Data is the raw material for the information age. We can not think of modern technology without data. If we have data we are able to get tons of information about any incidence or space. Today’s world has quite a ... | [
{
"code": null,
"e": 279,
"s": 172,
"text": "“You can have data without information, but you cannot have information without data.” — Daniel Keys Moran"
},
{
"code": null,
"e": 562,
"s": 279,
"text": "Data is the raw material for the information age. We can not think of modern te... |
Integer Programming in Python | by Freddy Boulton | Towards Data Science | Integer Programming (IP) problems are optimization problems where all of the variables are constrained to be integers. IP problems are useful mathematical models for how to best allocate one’s resources. Let’s say you’re organizing a marketing campaign for a political candidate and you’re deciding which constituents to... | [
{
"code": null,
"e": 886,
"s": 171,
"text": "Integer Programming (IP) problems are optimization problems where all of the variables are constrained to be integers. IP problems are useful mathematical models for how to best allocate one’s resources. Let’s say you’re organizing a marketing campaign fo... |
Interface Arduino with Gas Sensor | In this article, we will see how to interface Arduino with the MQ-2 gas sensor. MQ2 gas sensor is used for detecting smoke and some flammable gases like LPG, Methane, etc. It changes its resistance depending on the type of the gas. This principle can be used to raise an alarm based on the concentration of the gas.
An i... | [
{
"code": null,
"e": 1378,
"s": 1062,
"text": "In this article, we will see how to interface Arduino with the MQ-2 gas sensor. MQ2 gas sensor is used for detecting smoke and some flammable gases like LPG, Methane, etc. It changes its resistance depending on the type of the gas. This principle can be... |
Tryit Editor v3.7 | Tryit: HTML image - error in source | [] |
Struts 2 - Interceptors | Interceptors are conceptually the same as servlet filters or the JDKs Proxy class. Interceptors allow for crosscutting functionality to be implemented separately from the action as well as the framework. You can achieve the following using interceptors −
Providing preprocessing logic before the action is called.
Provid... | [
{
"code": null,
"e": 2501,
"s": 2246,
"text": "Interceptors are conceptually the same as servlet filters or the JDKs Proxy class. Interceptors allow for crosscutting functionality to be implemented separately from the action as well as the framework. You can achieve the following using interceptors ... |
Group data.table by Multiple Columns in R - GeeksforGeeks | 23 Sep, 2021
In this article, we will discuss how to group data.table by multiple columns in R programming language.
The package data.table can be used to work with data tables and subsetting and organizing data. It can be downloaded and installed into the workspace using the following command :
library(data.table)
Th... | [
{
"code": null,
"e": 25242,
"s": 25214,
"text": "\n23 Sep, 2021"
},
{
"code": null,
"e": 25346,
"s": 25242,
"text": "In this article, we will discuss how to group data.table by multiple columns in R programming language."
},
{
"code": null,
"e": 25527,
"s": 25346,... |
C++ Program For Finding The Middle Element Of A Given Linked List - GeeksforGeeks | 08 Dec, 2021
Given a singly linked list, find the middle of the linked list. For example, if the given linked list is 1->2->3->4->5 then the output should be 3. If there are even nodes, then there would be two middle nodes, we need to print the second middle element. For example, if given linked list is 1->2->3->4->5->... | [
{
"code": null,
"e": 24176,
"s": 24148,
"text": "\n08 Dec, 2021"
},
{
"code": null,
"e": 24515,
"s": 24176,
"text": "Given a singly linked list, find the middle of the linked list. For example, if the given linked list is 1->2->3->4->5 then the output should be 3. If there are ev... |
8086 program for selection sort - GeeksforGeeks | 22 May, 2018
Problem – Write an assembly language program in 8086 microprocessor to sort a given array of n numbers using Selection Sort.
Assumptions – The number of elements in the array is stored at offset 500. The array starts from offset 501.
Example –
Algorithm –
We first find the smallest number in the array.Swap... | [
{
"code": null,
"e": 24858,
"s": 24830,
"text": "\n22 May, 2018"
},
{
"code": null,
"e": 24983,
"s": 24858,
"text": "Problem – Write an assembly language program in 8086 microprocessor to sort a given array of n numbers using Selection Sort."
},
{
"code": null,
"e": 2... |
Add a percentage (%) sign at the end to each value while using MySQL SELECT statement | To add percentage sign at the end, use CONCAT() function. Let us first create a table −
mysql> create table DemoTable
(
StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,
StudentName varchar(100),
StudentScore int
);
Query OK, 0 rows affected (0.68 sec)
Insert some records in the table using insert command −
m... | [
{
"code": null,
"e": 1150,
"s": 1062,
"text": "To add percentage sign at the end, use CONCAT() function. Let us first create a table −"
},
{
"code": null,
"e": 1325,
"s": 1150,
"text": "mysql> create table DemoTable\n(\n StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,\n St... |
Spring Boot MockMvc JUnit Test Example - onlinetutorialspoint | 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, we are going to write JUnit... | [
{
"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,
... |
Protobuf - Enums | enum is one of the composite datatypes of Protobuf. It translates to an enum in the languages that we use, for example, Java.
Continuing with our theater example, following is the syntax that we need to have to instruct Protobuf that we will be creating an enum −
syntax = "proto3";
package theater;
option java_package ... | [
{
"code": null,
"e": 2171,
"s": 2045,
"text": "enum is one of the composite datatypes of Protobuf. It translates to an enum in the languages that we use, for example, Java."
},
{
"code": null,
"e": 2309,
"s": 2171,
"text": "Continuing with our theater example, following is the sy... |
Practical Guide to Outlier Detection Methods | by A. Tayyip Saka | Towards Data Science | I am going to talk about the details of four outlier detection methodologies implemented in R Studio. I will be mentioning what the outlier is, why it is important and why outliers occur. These methods are as follows:
Tukey’s MethodTwitter Anomaly DetectionZ-score MethodMean Absolute Deviation(MADe) Method
Tukey’s Meth... | [
{
"code": null,
"e": 390,
"s": 172,
"text": "I am going to talk about the details of four outlier detection methodologies implemented in R Studio. I will be mentioning what the outlier is, why it is important and why outliers occur. These methods are as follows:"
},
{
"code": null,
"e": ... |
Modular Multiplication - GeeksforGeeks | 19 Dec, 2021
Below are some interesting properties of Modular Multiplication
(a x b) mod m = ((a mod m) x (b mod m)) mod m
(a x b x c) mod m = ((a mod m) x (b mod m) x (c mod m)) mod m
The same property holds for more than three numbers.
The above formula is the extended version of the following formula:
Exampl... | [
{
"code": null,
"e": 24932,
"s": 24904,
"text": "\n19 Dec, 2021"
},
{
"code": null,
"e": 24997,
"s": 24932,
"text": "Below are some interesting properties of Modular Multiplication "
},
{
"code": null,
"e": 25046,
"s": 24999,
"text": "(a x b) mod m = ((a mod m... |
Stack Data Structure in Javascript | A stack is an Abstract Data Type (ADT), commonly used in most programming languages. It is named stack as it behaves like a real-world stack, for example – a deck of cards or a pile of plates, etc.
A stack allows operations at one end only. This feature makes it LIFO data structure. LIFO stands for Last-in-first-out. H... | [
{
"code": null,
"e": 1260,
"s": 1062,
"text": "A stack is an Abstract Data Type (ADT), commonly used in most programming languages. It is named stack as it behaves like a real-world stack, for example – a deck of cards or a pile of plates, etc."
},
{
"code": null,
"e": 1574,
"s": 126... |
Conversion of whole String to uppercase or lowercase using STL in C++ - GeeksforGeeks | 06 Jul, 2017
Given a string, convert the whole string to uppercase or lowercase using STL in C++.
Examples:
For uppercase conversion
Input : s = "String"
Output : s = "STRING"
For lowercase conversion
Input : s = "String"
Output : s = "string"
Functions used :transform : Performs a transformation on given array/strin... | [
{
"code": null,
"e": 24798,
"s": 24770,
"text": "\n06 Jul, 2017"
},
{
"code": null,
"e": 24883,
"s": 24798,
"text": "Given a string, convert the whole string to uppercase or lowercase using STL in C++."
},
{
"code": null,
"e": 24893,
"s": 24883,
"text": "Examp... |
How to redirect if JavaScript is not enabled in a browser? | To redirect if JavaScript is not enabled in the web browser, add a script to the <noscript> tag. Let us say you need to redirect to index.php if JavaScript is not enabled.
Here’s how you can do this:
<!DOCTYPE html>
<html>
<head>
<title>HTML noscript Tag</title>
</head>
<body>
<script>
... | [
{
"code": null,
"e": 1235,
"s": 1062,
"text": "To redirect if JavaScript is not enabled in the web browser, add a script to the <noscript> tag. Let us say you need to redirect to index.php if JavaScript is not enabled. "
},
{
"code": null,
"e": 1263,
"s": 1235,
"text": "Here’s ho... |
Flatten a list of DataFrames - GeeksforGeeks | 02 Dec, 2020
In this article, we are going to see how to flatten a list of DataFrames. Flattening is defined as Converting or Changing data format to a narrow format. The advantage of the flattened list is Increases the computing speed and Good understanding of data.
Example:
Let consider, the data frame that contains ... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n02 Dec, 2020"
},
{
"code": null,
"e": 24547,
"s": 24292,
"text": "In this article, we are going to see how to flatten a list of DataFrames. Flattening is defined as Converting or Changing data format to a narrow format. The advan... |
How to create "Add to cart" button in Bootstrap ? - GeeksforGeeks | 15 Jul, 2021
Bootstrap includes a large variety of button styles, each having some common and some different attributes in them. The “add to cart” button acts as a container like a typical shopping cart in a mall, where you collect the stuff that you want to purchase. “Add to cart” buttons are usually provided on e-com... | [
{
"code": null,
"e": 25231,
"s": 25203,
"text": "\n15 Jul, 2021"
},
{
"code": null,
"e": 25624,
"s": 25231,
"text": "Bootstrap includes a large variety of button styles, each having some common and some different attributes in them. The “add to cart” button acts as a container li... |
Program to find longest path between two nodes of a tree in Python | Suppose we have a binary tree; we have to find the longest path between any two nodes in the
tree.
So, if the input is like
then the output will be 5
To solve this, we will follow these steps:
ans := 0
ans := 0
Define a function getMaxPath() . This will take node
Define a function getMaxPath() . This will take node
i... | [
{
"code": null,
"e": 1161,
"s": 1062,
"text": "Suppose we have a binary tree; we have to find the longest path between any two nodes in the\ntree."
},
{
"code": null,
"e": 1186,
"s": 1161,
"text": "So, if the input is like"
},
{
"code": null,
"e": 1214,
"s": 1186,... |
How to write a MySQL stored function that updates the values in a table? | As we know that function is best used when we want to return a result. Hence, when we will create stored functions for manipulating tables like to Insert or Update values then it would be more or less like stored procedures. In the following example, we are creating a stored function named ‘tbl_update’ which will updat... | [
{
"code": null,
"e": 1429,
"s": 1062,
"text": "As we know that function is best used when we want to return a result. Hence, when we will create stored functions for manipulating tables like to Insert or Update values then it would be more or less like stored procedures. In the following example, we... |
Here’s How Apache Flink Stores Your State data | by Kartik Khare | Towards Data Science | One of the significant features of Apache Flink is its ability to do stateful processing. The API to store and retrieve state data is simple which makes it a joy to use.
However, behind that API lies a system to manage your data while providing persistence guarantees and that’s what we’ll be understanding in this artic... | [
{
"code": null,
"e": 342,
"s": 172,
"text": "One of the significant features of Apache Flink is its ability to do stateful processing. The API to store and retrieve state data is simple which makes it a joy to use."
},
{
"code": null,
"e": 496,
"s": 342,
"text": "However, behind ... |
Groovy - Dates & Times compareTo() | Compares two Dates for ordering.
public int compareTo(Date anotherDate)
anotherDate – the Date to be compared.
Return Value − The value 0 if the argument Date is equal to this Date; a value less than 0 if this Date is before the Date argument; and a value greater than 0 if this Date is after the Date argument.
Followi... | [
{
"code": null,
"e": 2271,
"s": 2238,
"text": "Compares two Dates for ordering."
},
{
"code": null,
"e": 2311,
"s": 2271,
"text": "public int compareTo(Date anotherDate)\n"
},
{
"code": null,
"e": 2350,
"s": 2311,
"text": "anotherDate – the Date to be compared... |
Construct a linked list from 2D matrix (Iterative Approach) - GeeksforGeeks | 30 Dec, 2020
Given a matrix, the task is to construct a linked list matrix in which each node is connected to its right and down node.Example:
Input: [1 2 3
4 5 6
7 8 9]
Output:
1 -> 2 -> 3 -> NULL
| | |
v v v
4 -> 5 -> 6 -> NULL
| | |
v v v
7 -> 8 -> 9 -> NULL
| | |
v... | [
{
"code": null,
"e": 25016,
"s": 24988,
"text": "\n30 Dec, 2020"
},
{
"code": null,
"e": 25148,
"s": 25016,
"text": "Given a matrix, the task is to construct a linked list matrix in which each node is connected to its right and down node.Example: "
},
{
"code": null,
... |
WebGL - Translation | So far, we discussed how to draw various shapes and apply colors in them using WebGL. Here, in this chapter, we will take an example to show how to translate a triangle.
Translation is one of the affine transformations provided by WebGL. Using translation, we can move a triangle (any object) on the xyz plane. Suppose w... | [
{
"code": null,
"e": 2217,
"s": 2047,
"text": "So far, we discussed how to draw various shapes and apply colors in them using WebGL. Here, in this chapter, we will take an example to show how to translate a triangle."
},
{
"code": null,
"e": 2689,
"s": 2217,
"text": "Translation ... |
File.Exists() Method in C# with Examples | 11 Oct, 2021
File.Exists(String) is an inbuilt File class method that is used to determine whether the specified file exists or not. This method returns true if the caller has the required permissions and path contains the name of an existing file; otherwise, false. Also, if the path is null, then this method returns f... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Oct, 2021"
},
{
"code": null,
"e": 342,
"s": 28,
"text": "File.Exists(String) is an inbuilt File class method that is used to determine whether the specified file exists or not. This method returns true if the caller has the required... |
Python MongoDB – find_one Query | 04 Jul, 2022
This article focus on the find_one() method of the PyMongo library. find_one() is used to find the data from MongoDB.
Prerequisites: MongoDB Python Basics
Let’s begin with the find_one() method:
Importing PyMongo Module: Import the PyMongo module using the command:
from pymongo import MongoClient
If Mong... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Jul, 2022"
},
{
"code": null,
"e": 147,
"s": 28,
"text": "This article focus on the find_one() method of the PyMongo library. find_one() is used to find the data from MongoDB. "
},
{
"code": null,
"e": 185,
"s": 147,
... |
Count Strictly Increasing Subarrays | 04 Jun, 2022
Given an array of integers, count number of subarrays (of size more than one) that are strictly increasing. Expected Time Complexity : O(n) Expected Extra Space: O(1)
Examples:
Chapters
descriptions off, selected
captions settings, opens captions settings dialog
captions off, selected
English
This is a mod... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n04 Jun, 2022"
},
{
"code": null,
"e": 221,
"s": 54,
"text": "Given an array of integers, count number of subarrays (of size more than one) that are strictly increasing. Expected Time Complexity : O(n) Expected Extra Space: O(1)"
},
... |
PHP | pathinfo( ) Function | 25 Nov, 2021
The pathinfo() is an inbuilt function which is used to return information about a path using an associative array or a string. The returned array or string contains the following information:
Directory name
Basename
Extension
The path and options are sent as a parameters to the pathinfo() function and it... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Nov, 2021"
},
{
"code": null,
"e": 222,
"s": 28,
"text": "The pathinfo() is an inbuilt function which is used to return information about a path using an associative array or a string. The returned array or string contains the follow... |
Java Program to Make a File Read-Only | 21 Jul, 2021
Read-Only is the file attribute that the operating system assigns to the file. When the file is flagged as read-only, it means that it can only be opened or read, one cannot change the name of the file, can not rewrite or append the content of the file, and also cannot delete the file.
Method 1:
Using setL... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Jul, 2021"
},
{
"code": null,
"e": 315,
"s": 28,
"text": "Read-Only is the file attribute that the operating system assigns to the file. When the file is flagged as read-only, it means that it can only be opened or read, one cannot c... |
Python | Append multiple lists at once | 16 Aug, 2021
There can be an application requirement to append elements of 2-3 lists to one list. This kind of application has the potential to come into the domain of Machine Learning or sometimes in web development as well. Let’s discuss certain ways in which this particular task can be performed.
Method #1 : Using +... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Aug, 2021"
},
{
"code": null,
"e": 316,
"s": 28,
"text": "There can be an application requirement to append elements of 2-3 lists to one list. This kind of application has the potential to come into the domain of Machine Learning or ... |
Java Program to Display the ATM Transaction | 09 Nov, 2020
Lets Build a Java Program, to represent ATM Transaction, where a User has to choose input from the options displayed on the Screen. The available options on the Screen include operations such as Withdraw, deposit, balance.
Following are the basic operations available in the ATM
WithdrawDepositCheck Balance... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Nov, 2020"
},
{
"code": null,
"e": 251,
"s": 28,
"text": "Lets Build a Java Program, to represent ATM Transaction, where a User has to choose input from the options displayed on the Screen. The available options on the Screen include... |
How to use styles in ReactJS ? | 18 Oct, 2021
React is a Javascript front-end library that is used to build single-page applications (SPA). React apps can easily be styled by assigning the styles to the className prop.
There are various ways to style a react app. In this article, we are going to discuss the following four ways to style a react app.
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Oct, 2021"
},
{
"code": null,
"e": 202,
"s": 28,
"text": "React is a Javascript front-end library that is used to build single-page applications (SPA). React apps can easily be styled by assigning the styles to the className prop. "
... |
How to render HTML to an image ? | 21 Jun, 2020
HTML code can be converted into an image by different means such as html2canvas JavaScript library or sometimes by CSS as well it can be very helpful and useful for users who wish to share the image of the code but can’t share the exact code. The user will generate an image from the webpage and have an opt... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Jun, 2020"
},
{
"code": null,
"e": 403,
"s": 28,
"text": "HTML code can be converted into an image by different means such as html2canvas JavaScript library or sometimes by CSS as well it can be very helpful and useful for users who ... |
Reverse a path in BST using queue | 21 Jun, 2022
Given a binary search tree and a key, your task to reverse path of the binary tree.Prerequisite : Reverse path of Binary tree
Examples :
Input : 50
/ \
30 70
/ \ / \
20 40 60 80
k = 70
Output :
Inorder before reversal :
20 30 40 50 60 70 80
I... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 180,
"s": 54,
"text": "Given a binary search tree and a key, your task to reverse path of the binary tree.Prerequisite : Reverse path of Binary tree"
},
{
"code": null,
"e": 192,
"s... |
HTML | <button> formmethod Attribute | 14 Feb, 2022
The HTML button formmethod Attribute is used to specify the HTTP method used to send data while submitting the form. There are two kinds of HTTP methods, which are GET and POST. this Attribute is only used with the Button type=”submit”
Syntax:
<button type="submit" formmethod="get|post">
Attribute values:
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Feb, 2022"
},
{
"code": null,
"e": 264,
"s": 28,
"text": "The HTML button formmethod Attribute is used to specify the HTTP method used to send data while submitting the form. There are two kinds of HTTP methods, which are GET and POS... |
Regression using k-Nearest Neighbors in R Programming | 28 Jul, 2020
Machine learning is a subset of Artificial Intelligence that provides a machine with the ability to learn automatically without being explicitly programmed. The machine in such cases improves from the experience without human intervention and adjusts actions accordingly. It is primarily of 3 types:
Supervi... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n28 Jul, 2020"
},
{
"code": null,
"e": 354,
"s": 54,
"text": "Machine learning is a subset of Artificial Intelligence that provides a machine with the ability to learn automatically without being explicitly programmed. The machine in su... |
Heap’s Algorithm for generating permutations | 15 Jun, 2021
Heap’s algorithm is used to generate all permutations of n objects. The idea is to generate each permutation from the previous permutation by choosing a pair of elements to interchange, without disturbing the other n-2 elements. Following is the illustration of generating all the permutations of n given nu... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n15 Jun, 2021"
},
{
"code": null,
"e": 375,
"s": 52,
"text": "Heap’s algorithm is used to generate all permutations of n objects. The idea is to generate each permutation from the previous permutation by choosing a pair of elements to i... |
Teaching Learning based Optimization (TLBO) | 12 Apr, 2021
The process of finding optimal values for the specific parameters of a given system to fulfill all design requirements while considering the lowest possible cost is referred to as an optimization. Optimization problems can be found in all fields of science.
In general Optimization problem can be written as... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n12 Apr, 2021"
},
{
"code": null,
"e": 310,
"s": 52,
"text": "The process of finding optimal values for the specific parameters of a given system to fulfill all design requirements while considering the lowest possible cost is referred ... |
Puzzle | Minimum distance for Lizard | 19 Apr, 2021
A lizard is present on one corner of cube, It wants to reach diagonally opposite corner of cube. You have to calculate minimum distance lizard has to cover to reach its destination.Note : Lizard can’t fly, it moves along the wall.You are given a representing side of cube.you have to calculate minimum dista... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Apr, 2021"
},
{
"code": null,
"e": 397,
"s": 52,
"text": "A lizard is present on one corner of cube, It wants to reach diagonally opposite corner of cube. You have to calculate minimum distance lizard has to cover to reach its desti... |
Fix “Execution failed app:processDebugResources” in Android Studio | 23 Jun, 2021
Resources are the files and static content that the application’s code uses, such as animations, images, layouts, and string values. These files stored in the resource directory can be referenced from the application’s code but when a non-existent reference is called android throws an “Execution failed app... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Jun, 2021"
},
{
"code": null,
"e": 446,
"s": 28,
"text": "Resources are the files and static content that the application’s code uses, such as animations, images, layouts, and string values. These files stored in the resource directo... |
Type Annotations in Julia | 12 Oct, 2020
Julia is a dynamically typed language i.e. the type of the variable need not be declared in the program statically. Along with this, it also provides a technique to comment on the type of variable to the Just-in-Time (JIT) compiler at the runtime. Moreover, Julia supports both dynamic as well as static typ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Oct, 2020"
},
{
"code": null,
"e": 430,
"s": 28,
"text": "Julia is a dynamically typed language i.e. the type of the variable need not be declared in the program statically. Along with this, it also provides a technique to comment on... |
multiset find() function in C++ STL | 07 Jul, 2022
The multiset::find() is a built-in function in C++ STL which returns an iterator pointing to the lower_bound of the element which is searched in the multiset container. If the element is not found, then the iterator points to the position past the last element in the set.
Syntax:
multiset_name.find(elemen... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 327,
"s": 53,
"text": "The multiset::find() is a built-in function in C++ STL which returns an iterator pointing to the lower_bound of the element which is searched in the multiset container. If th... |
LocalDate minus() method in Java with Examples | 28 Jan, 2022
In LocalDate class, there are two types of minus() method depending upon the parameters passed to it.
minus() method of a LocalDate class used to Returns a copy of this LocalDate with the specified amount of unit subtracted to LocalDate.If it is not possible to subtract the amount, because the unit is not... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jan, 2022"
},
{
"code": null,
"e": 131,
"s": 28,
"text": "In LocalDate class, there are two types of minus() method depending upon the parameters passed to it. "
},
{
"code": null,
"e": 405,
"s": 131,
"text": "min... |
Print all sequences of given length | 11 Oct, 2021
Given two integers k and n, write a function that prints all the sequences of length k composed of numbers 1,2..n. You need to print these sequences in sorted order.Examples:
Input: k = 2, n = 3
Output:
1 1
1 2
1 3
2 1
2 2
2 3
3 1
3 2
3 3
Input: k = 3, n = 4
Output:
1 1 1
1 1 2
1 1 3
1 1 4
1 2 1
.... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Oct, 2021"
},
{
"code": null,
"e": 231,
"s": 54,
"text": "Given two integers k and n, write a function that prints all the sequences of length k composed of numbers 1,2..n. You need to print these sequences in sorted order.Examples:... |
How to use External Modules and NPM in a project ? | 17 Sep, 2021
Need for External Modules: For a large JavaScript application, it becomes difficult and messy to write the whole code in just one JavaScript file. This is where CommonJS comes into the picture and this CommonJS format defines a module format that can be used up for breaking your JS application into multipl... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Sep, 2021"
},
{
"code": null,
"e": 792,
"s": 28,
"text": "Need for External Modules: For a large JavaScript application, it becomes difficult and messy to write the whole code in just one JavaScript file. This is where CommonJS comes... |
Primitive Wrapper Classes are Immutable in Java | 12 Dec, 2021
In Java, an immutable class is a class (Integer, Byte, Long, Float, Double, Character, Boolean, and Short) which once created then its body can not be changed and the same applies to immutable objects which once created cannot be changed. Now the question arises that we do need the help of wrapper classes ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n12 Dec, 2021"
},
{
"code": null,
"e": 448,
"s": 52,
"text": "In Java, an immutable class is a class (Integer, Byte, Long, Float, Double, Character, Boolean, and Short) which once created then its body can not be changed and the same ap... |
Map of pairs in STL | 18 Oct, 2017
Map in STL is used to hash key and value. We generally see map being used for standard data types. We can also use map for pairs.
For example consider a simple problem, given a matrix and positions visited, print which positions are not visited.
// C++ program to demonstrate use of map// for pairs#include ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 Oct, 2017"
},
{
"code": null,
"e": 182,
"s": 52,
"text": "Map in STL is used to hash key and value. We generally see map being used for standard data types. We can also use map for pairs."
},
{
"code": null,
"e": 298,
... |
C | Operators | Question 1 | 08 May, 2017
#include "stdio.h"
int main()
{
int x, y = 5, z = 5;
x = y == z;
printf("%d", x);
getchar();
return 0;
}
(A) 0(B) 1(C) 5(D) Compiler Error
Answer: (B)
Explanation: The crux of the question lies in the statement x = y==z. The operator == is executed before = because precedence of comp... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 May, 2017"
},
{
"code": null,
"e": 178,
"s": 52,
"text": "#include \"stdio.h\"\nint main() \n{ \n int x, y = 5, z = 5; \n x = y == z; \n printf(\"%d\", x); \n \n getchar(); \n return 0; \n}\n"
},
{
"code": null,
"e... |
Calendar set() Method in Java with Examples | 21 Feb, 2019
The set(int calndr_field, int new_val) method in Calendar class is used to set the calndr_field value to a new_val. The older field of this calendar get replaced by a new field.
Syntax:
public void set(int calndr_field, int new_val)
Parameters: The method takes two parameters:
calndr_field: This is of Cale... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Feb, 2019"
},
{
"code": null,
"e": 206,
"s": 28,
"text": "The set(int calndr_field, int new_val) method in Calendar class is used to set the calndr_field value to a new_val. The older field of this calendar get replaced by a new fiel... |
Python – Multimode of List | 10 Feb, 2020
Sometimes, while working with Python lists we can have a problem in which we need to find mode in list i.e most frequently occurring character. But sometimes, we can have more than 1 modes. This situation is called multimode. Lets discuss certain ways in which this task can be performed.
Method #1 : Using ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Feb, 2020"
},
{
"code": null,
"e": 317,
"s": 28,
"text": "Sometimes, while working with Python lists we can have a problem in which we need to find mode in list i.e most frequently occurring character. But sometimes, we can have more... |
Python Program to find Sum of Negative, Positive Even and Positive Odd numbers in a List | 26 Nov, 2020
Given a list. The task is to find the sum of Negative, Positive Even, and Positive Odd numbers present in the List.
Examples:
Input: -7 5 60 -34 1
Output:
Sum of negative numbers is -41
Sum of even positive numbers is 60
Sum of odd positive numbers is 6
Input: 1 -1 50 -2 0 -3
Output:
Sum of negativ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Nov, 2020"
},
{
"code": null,
"e": 144,
"s": 28,
"text": "Given a list. The task is to find the sum of Negative, Positive Even, and Positive Odd numbers present in the List."
},
{
"code": null,
"e": 154,
"s": 144,
... |
Determine Period Index and Column for DataFrame in Pandas | 11 Jun, 2021
In Pandas to determine Period Index and Column for Data Frame, we will use the pandas.period_range() method. It is one of the general functions in Pandas that is used to return a fixed frequency PeriodIndex, with day (calendar) as the default frequency.
Syntax: pandas.to_numeric(arg, errors=’raise’, downca... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Jun, 2021"
},
{
"code": null,
"e": 308,
"s": 54,
"text": "In Pandas to determine Period Index and Column for Data Frame, we will use the pandas.period_range() method. It is one of the general functions in Pandas that is used to retu... |
How to insert element to arraylist for listview in Android? | This example demonstrate about How to insert element to arraylist for 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 = "ut... | [
{
"code": null,
"e": 1152,
"s": 1062,
"text": "This example demonstrate about How to insert element to arraylist for listview in Android"
},
{
"code": null,
"e": 1281,
"s": 1152,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all requi... |
Visualize sinusoidal waves using Python - GeeksforGeeks | 16 Sep, 2021
Sinusoidal waves are the most basic trigonometric periodic curves, which is also known as the sine curve. Here we will see how sine function is related to a circle. Even though the sine function is a trigonometric function, it has more to do with a circle rather than a triangle.
Consider a simple equation... | [
{
"code": null,
"e": 26207,
"s": 26179,
"text": "\n16 Sep, 2021"
},
{
"code": null,
"e": 26488,
"s": 26207,
"text": "Sinusoidal waves are the most basic trigonometric periodic curves, which is also known as the sine curve. Here we will see how sine function is related to a circle... |
Conditioning Plot - GeeksforGeeks | 24 Sep, 2021
A conditioning plot or co-plot or subset plot is a scatter plot of two variables when conditioned on a third variable. The third variable is called the conditioning variable. This variable can have both values either continuous or categorical. In the continuous variable, we created subsets by dividing them... | [
{
"code": null,
"e": 26095,
"s": 26067,
"text": "\n24 Sep, 2021"
},
{
"code": null,
"e": 26516,
"s": 26095,
"text": "A conditioning plot or co-plot or subset plot is a scatter plot of two variables when conditioned on a third variable. The third variable is called the conditionin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.