
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 33676 Articles for Programming

186 Views
The size() method of the AbstractCollection class returns the numbers of elements in the collection. The method returns Integer.MAX_VALUE if the total number of elemnts in the collection exceeds the Interger.MAX_VALUE.The syntax is as follows:public abstract int size()To work with AbstractCollection class in Java, import the following package:import java.util.AbstractCollection;The following is an example to implement AbstractCollection size() method in Java:Example Live Demoimport java.util.ArrayList; import java.util.AbstractCollection; public class Demo { public static void main(String[] args) { AbstractCollection absCollection = new ArrayList(); absCollection.add("Laptop"); absCollection.add("Tablet"); absCollection.add("Mobile"); absCollection.add("E-Book Reader"); ... Read More

497 Views
Python pygmaps library provides a wrapper for the google maps javascript api. With this library python users can create a matplotlib like interface to generate the html and javascript and then can depicts all the additional information user’s would like to add on top of Google Maps.Required libraryWe are only going to use the pygmaps library/package. You can install the pygmaps library using pip, like:$pip install pygmaps (windows os) $sudo pip3 install pygmaps (linux os)We are going to write a program which will display -Create a map using pygmaps by providing long, lat & zoom level.Set grids on map by ... Read More

244 Views
The length() method of the StringJoiner class in Java 8 is used to get the length of the current value of StringJoiner.To work with the StringJoiner in Java 8, import the following package:import java.util.StringJoiner;The syntax is as follows:public int length()First, create a StringJoiner:StringJoiner strJoin = new StringJoiner(", "); strJoin.add("US"); strJoin.add("India"); strJoin.add("Netherlands"); strJoin.add("Australia");Now, find the length of the StringJoiner i.e. the number of elements in it using the length() method:strJoin.length());The following is an example to implement StringJoiner length() method in Java:Example Live Demoimport java.util.StringJoiner; public class Demo { public static void main(String[] args) { // StringJoiner ... Read More

154 Views
An Octetclass is a Tuple of 8 element. It is in the JavaTuples library. The following is the declaration of the Octet class:public final class Octet extends Tuple implements IValue0, IValue1, IValue2, IValue3, IValue4, IValue5, IValue6, IValue7Let us first see what we need to work with JavaTuples. To work with Octet class in JavaTuples, you need to import the following package:import org.javatuples.Octet;Some of its features include:TypesafeSerializableComparableIterableImmutableNote: Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project → Properties → Java Build Path → Add External Jars and upload the downloaded JavaTuples jar ... Read More

402 Views
What is phyllotaxis pattern?When we go back, in our botany classes and the plant world, phyllotaxis means the arrangement of flowers, leaves or seeds on a plant stem, similar to the one found in Fibonacci spiral. Based on Fibonacci sequence, the Fibonacci spiral is a set of numbers that follows a pattern similar on pascal’s triangle. The Fibonacci sequence numbers are something like - 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, etc. So the Fibonacci sequence number is the sum of its previous numbers.Fibonacci spiralsWe generally look for symmetry and patterns to understand the objects ... Read More

391 Views
In this we are going to write python program which is going to analyse the images taken from the webcam and try to detect the movement and store the time-interval of the webcam video in a csv file.Required LibraryWe are going to use the OpenCV & pandas library for that. If it’s not already installed, you can install it using pip, with something like:$pip install opencv2, pandasExample Code#Import required libraries import cv2 import pandas as pd import time from datetime import datetime #Initialise variables stillImage = None motionImage = [ None, None ] time = [] # Initializing ... Read More

473 Views
If you want to remove an element from the AbstractCollection classs, use the remove() method. It returns TRUE if the elements requested to be removed is successfully removed from the collection.The syntax is as follows:public boolean remove(Object ob)Here, ob is the element to be removed the from this Collection. Whereas, the class Object is the root of the class hierarchy.To work with AbstractCollection class in Java, import the following package:import java.util.AbstractCollection;The following is an example to implement AbstractCollection remove() method in Java:Example Live Demoimport java.util.Iterator; import java.util.ArrayList; import java.util.AbstractCollection; public class Demo { public static void main(String[] args) { ... Read More

139 Views
Git is the most popular version control system, where millions of developers manage their project or files (code). In this we will try to fetch top 10 most starred repositories within a month.As we are mainly scraping the GitHub repositories, we are going to use mainly the, Requests & BeautifulSoup library to fetch the repositories.We will store the result in a file & display it. It will show the result based on position (stars) with name & repos.Below is the code to implement it:import requests from bs4 import BeautifulSoup r = requests.get('https://github.com/trending/lua?since=monthly') bs = BeautifulSoup(r.text, 'lxml') lista_repo = bs.find_all('ol', class_='repo-list') ... Read More

316 Views
The merge() method of the StringJoiner class in Java 8 is used to merge the contents of the StringJoiner str, which is passed as a parameter. The content gets added as the next element.The syntax is as follows:public StringJoiner merge(StringJoiner str)Here, str is the StringJoiner content to be merged.To work with the StringJoiner in Java 8, import the following package:import java.util.StringJoiner;The following is an example to implement StringJoiner merge() method in Java:Example Live Demoimport java.util.StringJoiner; public class Demo { public static void main(String[] args) { // StringJoiner 1 StringJoiner strJoin1 = new StringJoiner(" "); ... Read More

147 Views
To insert element into the stream, you need to use the add() method of the IntStream.Builder.The syntax is as follows:default IntStream.Builder add(int t)Here, parameter t is the element to be inserted.Declare IntStream.Builder:IntStream.Builder builder = IntStream.builder();Add some elements to the Builder using add() method:builder.add(10); builder.add(25); builder.add(33); builder.add(42);The following is an example to implement IntStream.Builder add() method in JavaExample Live Demoimport java.util.stream.IntStream; public class Demo { public static void main(String[] args) { IntStream.Builder builder = IntStream.builder(); System.out.println("Elements in the stream..."); builder.add(10); builder.add(25); builder.add(33); builder.add(42); ... Read More