Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by George John
Page 30 of 79
How to actually work with HTML5 Canvas camera/viewport?
Working with an HTML5 Canvas camera/viewport allows you to display different portions of a larger game world or image. The camera/viewport acts like a window that shows only a specific region of your content, enabling features like scrolling backgrounds and following player characters. Using drawImage() for Viewport Implementation For viewport usage, use the drawImage() method with nine parameters to crop and display specific portions of your background image − Canvas Viewport Example ...
Read MoreInput type DateTime Value format with HTML
The datetime-local input type in HTML allows users to select both a date and time from a built-in browser picker. When the input field is clicked, a date-time picker popup appears. The value is stored in the format YYYY-MM-DDThh:mm, where T separates the date and time portions. Value Format The element uses the following ISO 8601-based format − YYYY-MM-DDThh:mm For example, 2025-03-15T14:30 represents March 15, 2025 at 2:30 PM. You can use this format to set a default value with the value attribute, or to set minimum and maximum allowed dates with min and max. Example: Basic ...
Read MoreBootstrap Collapsible in
The collapsible in class in Bootstrap is used to display the collapsible content.You can try to run the following code to implement the collapsible in class −Example Bootstrap Example Quiz Click below to toggle the button content. More Quizzes We have quizzes on Java, PHP, Ruby, Quantitative Aptitude, ASP.net, etc.
Read MoreChange the order of the Bootstrap grid columns
Use the .col-*-pull-* and .col-*-push-* classes in Bootstrap to change the order of the Bootstrap grid columns −Example Bootstrap Example Bootstrap Example 1 Right Left
Read MoreHow to find consonants in a given string using Java?
One way to find the vowels in a given String is to compare every character in it using the charAt() method with the vowel letters. Example public class FindingConsonants { public static void main(String args[]) { String str = new String("Hi Welcome to Tutorialspoint"); for(int i=0; i
Read MoreLongStream count() method in Java
The count() method of the LongStream class in Java is used to return the count of elements in this stream.The syntax is as follows.long count()To use the LongStream class in Java, import the following package.import java.util.stream.LongStream;Create a LongStream and add some elements.LongStream longStream = LongStream.of(50L, 30L, 80L, 40L, 15L, 60L);Now, get the count of elements.longStream.count()The following is an example to implement LongStream count() method in Java.Exampleimport java.util.stream.LongStream; public class Demo { public static void main(String[] args) { LongStream longStream = LongStream.of(50L, 30L, 80L, 40L, 15L, 60L); System.out.println("The number of elements in the stream ...
Read MoreThe indexOf() method of CopyOnWriteArrayList class in Java
The indexOf() method of the CopyOnWriteArrayList class is used to get the index of the first occurrence of an element. The method has two two forms. Let us see them one by oneindexOf(Object o) methodThe indexOf(Object o) is used to get the index of the first occurrence of an element.The syntax is as followsindexOf(Object o)Here, o is the element for which you want the index. To work with CopyOnWriteArrayList class, you need to import the following packageimport java.util.concurrent.CopyOnWriteArrayList;The following is an example to implement CopyOnWriteArrayList class indexOf() method in JavaExampleimport java.util.concurrent.CopyOnWriteArrayList; public class Demo { public static void main(String[] ...
Read MoreThe isEmpty() method of AbstractSequentialList in Java
The isEmpty() method of the AbstractSequentialList class is used to check whether the list is empty or not. If it is empty, then TRUE is returned, else FALSE.The syntax is as follows.public boolean isEmpty()To work with the AbstractSequentialList class in Java, you need to import the following package.import java.util.AbstractSequentialList;The following is an example to implement AbstractSequentialList isEmpty() method in Java.Exampleimport java.util.LinkedList; import java.util.AbstractSequentialList; public class Demo { public static void main(String[] args) { AbstractSequentialList absSequential = new LinkedList(); absSequential.add(110); absSequential.add(320); absSequential.add(400); absSequential.add(550); absSequential.add(600); absSequential.add(700); absSequential.add(900); System.out.println("Elements in ...
Read MoreDoubleStream parallel() method in Java
The parallel() method of the DoubleStream class returns an equivalent stream which is parallel.The syntax is as followsDoubleStream parallel()To use the DoubleStream class in Java, import the following packageimport java.util.stream.DoubleStream;The following is an example to implement DoubleStream parallel() method in JavaExampleimport java.util.*; import java.util.stream.DoubleStream; public class Demo { public static void main(String[] args) { DoubleStream doubleStream = DoubleStream.of(35.8, 14.9, 23.3, 67.8, 89.4, 45.6); System.out.println("Parallel DoubleStream = "); doubleStream.parallel().forEach(System.out::println); } }OutputParallel DoubleStream = 67.8 14.9 23.3 89.4 45.6 35.8
Read MoreDoubleStream sum() method in Java
The sum() method of the DoubleStream class in Java returns the sum of elements in this stream.The syntax is as followsdouble sum()To use the DoubleStream class in Java, import the following packageimport java.util.stream.DoubleStream;Create DoubleStream and add some elementsDoubleStream doubleStream = DoubleStream.of(23.6, 45.3, 59.6, 60.6, 73.6, 84.7, 94.8);Now, sum the elements of the streamdouble sum = doubleStream.sum(); The following is an example to implement DoubleStream sum() method in JavaExampleimport java.util.*; import java.util.stream.DoubleStream; public class Demo { public static void main(String[] args) { DoubleStream doubleStream = DoubleStream.of(23.6, 45.3, 59.6, 60.6, 73.6, 84.7, 94.8); ...
Read More