Chandu yadav

Chandu yadav

810 Articles Published

Articles by Chandu yadav

810 articles

Facing Problem in retrieving HTML5 video duration

Chandu yadav
Chandu yadav
Updated on 12-Mar-2026 503 Views

A common problem when working with HTML5 video is that the duration property returns NaN (Not a Number) when you try to access it before the browser has finished loading the video's metadata. This happens because the video file's metadata (which contains the duration, dimensions, etc.) is not available immediately after the page loads. Why Does video.duration Return NaN? The HTML5 element has a readyState attribute that indicates how much data the browser has loaded. It has values from 0 to 4 − 0 (HAVE_NOTHING) − No data available yet. 1 (HAVE_METADATA) − Metadata (duration, dimensions) is loaded. ...

Read More

Are new HTML5 elements like <section> and <article> useless?

Chandu yadav
Chandu yadav
Updated on 12-Mar-2026 186 Views

No, HTML5 semantic elements like and are not useless. They are extremely useful for screen readers and assistive technologies, helping visually impaired users navigate and understand the structure of your web page. They are also beneficial for eBook readers, search engines, and any tool that parses HTML for meaning. While you could use generic tags for everything, semantic elements convey the purpose of the content to both browsers and developers, making your code more readable and accessible. The Element The element represents a thematic grouping of content, typically with a heading. Use it to divide ...

Read More

Represent Int64 as a Hexadecimal String in C#

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 2K+ Views

To represent Int64 as a Binary string in C#, use the ToString() method and set the base as the ToString() method’s second parameter i.e.16 for Hexadecimal.Int64 represents a 64-bit signed integer.Firstly, set an Int64 variable.long val = 947645;Now, convert it to a hex string by including 16 as the second parameter.Convert.ToString(val, 16)Exampleusing System; class Demo {    static void Main() {       long val = 947645;       Console.WriteLine("Long: "+val);       Console.Write("Hex String: "+Convert.ToString(val, 16));    } }OutputLong: 947645 Hex String: e75bd

Read More

Java Program to Check if a String is Numeric

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 381 Views

ExampleYou can check if a given string is Numeric as shown in the following program.import java.util.Scanner; public class StringNumeric {    public static void main(String[] args) {       Scanner sc = new Scanner(System.in);       System.out.println("Enter a string ::");       String str = sc.next();       boolean number = str.matches("-?\d+(\.\d+)?");       if(number) {          System.out.println("Given string is a number");       } else {          System.out.println("Given string is not a number");       }    } }OutputEnter a string :: 4245 Given string is a number

Read More

Which element is used to add special style to the first letter of the text in a selector with CSS

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 140 Views

Use the :first-letter element to add special effects to the first letter of elements in the document. You can try to run the following code to add special styles to the first letter of text −Example                    p:first-letter {             font-size: 5em;          }          p.normal:first-letter {             font-size: 10px;          }                     First character of this paragraph will be normal ...

Read More

Give the object a sine wave distortion to make it look wave with CSS

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 574 Views

Wave effect is used to give the object a sine wave distortion to make it look wavy.The following parameters can be used in this filterS.NoParameter & Description1AddA value of 1 adds the original image to the waved image, 0 does not.2FreqThe number of waves.3LightThe strength of the light on the wave (from 0 to 100).4PhaseAt what degree the sine wave should start (from 0 to 100).5StrengthThe intensity of the wave effect.ExampleYou can try to run the following code to set wave effect −                         Text Example:       CSS Tutorials    

Read More

Set Bordered Form Inputs with CSS

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 212 Views

To set border to form inputs, use the CSS border property.You can try to run the following code to add borderExample                    input[type = text] {             width: 100%;             padding: 10px 15px;             margin: 5px 0;             box-sizing: border-box;             border: 3px inset orange;          }                     Fill the below form,                Subject                    Student                    

Read More

Java program to calculate mode in Java

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 16K+ Views

In statistics math, a mode is a value that occurs the highest numbers of time. For Example, assume a set of values 3, 5, 2, 7, 3. The mode of this value set is 3 as it appears more than any other number.Algorithm1.Take an integer set A of n values. 2.Count the occurrence of each integer value in A. 3.Display the value with the highest occurrence.Examplepublic class Mode {    static int mode(int a[], int n) {       int maxValue = 0, maxCount = 0, i, j;       for (i = 0; i < n; ...

Read More

IntStream peek() method in Java

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 770 Views

The peek() method in the IntStream class in Java returns a stream consisting of the elements of this stream. It additionally performs the provided action on each element as elements are consumed from the resulting stream.The syntax is as followsIntStream peek(IntConsumer action)Here, the parameter action is a non-interfering action to perform on the elements as they are consumed from the stream. The IntConsumer represents an operation that accepts a single int-valued argument and returns no result.The following is an example to implement IntStream peek() method in JavaExampleimport java.util.*; import java.util.stream.IntStream; public class Demo { public static void ...

Read More

IntStream forEachOrdered() method in Java

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 433 Views

The forEachOrdered() method in Java assures that each element is processed in order for streams that have a defined encounter order.The syntax is as followsvoid forEachOrdered(IntConsumer action)Here, the action parameter is a non-interfering action to be performed on the elements.Create an IntStream and add elements to the streamIntStream intStream = IntStream.of(50, 70, 80, 100, 130, 150, 200);Now, use the forEachOrdered() method to display the stream elements in orderintStream.forEachOrdered(System.out::println);The following is an example to implement IntStream forEachOrdered() method in JavaExampleimport java.util.*; import java.util.stream.IntStream; public class Demo { public static void main(String[] args) { ...

Read More
Showing 1–10 of 810 articles
« Prev 1 2 3 4 5 81 Next »
Advertisements