Karthikeya Boyini has Published 2193 Articles

Animating canvas to infinitely animate the noise to give the appearance of movement in HTML

karthikeya Boyini

karthikeya Boyini

Updated on 04-Mar-2020 06:28:48

127 Views

The putImageData() method places the image data onto the canvas. To animate canvas, we create a reusable ImageData object outside the main loop, var ct = c.getContext("2d", {alpha: false});       // context without alpha channel. var a = ct.createImageData(c.width, c.height);   var buffer = new Uint32Array(a.data.buffer);   ... Read More

How do I get an address latitude-longitude using HTML5 Geolocation or Google API?

karthikeya Boyini

karthikeya Boyini

Updated on 04-Mar-2020 06:20:17

505 Views

In order to get latitude and longitude using an HTML5 Geolocation or any Google API, we need to add JavaScript for this. The script is as follows −if (navigator.geolocation) {    /*  If current position is obtained then there is success otherwise there is failure.    On failure, separate error ... Read More

HTML5 Canvas and select / drag-and-drop features in a JS library?

karthikeya Boyini

karthikeya Boyini

Updated on 04-Mar-2020 06:14:29

705 Views

If you want to use HTML5 canvas to draw shapes, texts and curves and also want to attach traditional DOM events like onClick or drag and drop functions, a crossbar framework Raphael is used for doing drag and drop or touch events.This technology uses SVG and XML for older versions ... Read More

How to loop through an array in Java?

karthikeya Boyini

karthikeya Boyini

Updated on 26-Feb-2020 10:12:36

519 Views

To process array elements, we often use either for loop or for each loop because all of the elements in an array are of the same type and the size of the array is known. Suppose we have an array of 5 elements we can print all the elements of ... Read More

C++ Program to Compute Cross Product of Two Vectors

karthikeya Boyini

karthikeya Boyini

Updated on 26-Feb-2020 09:17:44

8K+ Views

This is a C++ program to compute Cross Product of Two Vectors.Let us suppose, M = m1 * i + m2 * j + m3 * kN = n1 * i + n2 * j + n3 * k.So, cross product = (m2 * n3 – m3 * n2) * ... Read More

What is the difference between checked and unchecked exceptions in Java?

karthikeya Boyini

karthikeya Boyini

Updated on 25-Feb-2020 10:45:28

925 Views

A checked exception is an exception that occurs at the compile time, these are also called as compile time exceptions. These exceptions cannot simply be ignored at the time of compilation; the programmer should take care of (handle) these exceptions.ExampleIf you use FileReader class in your program to read data ... Read More

What does the method fill(obj[], int fromIndex, int toIndex, int val) do in java?

karthikeya Boyini

karthikeya Boyini

Updated on 25-Feb-2020 08:21:52

158 Views

The fill(object[] a, int fromIndex, int toIndex, object val) method of the class java.util.Arrays assign the specified Object reference to each element of the specified range of the specified array of objects. The range to be filled extends from index fromIndex, inclusive, to index toIndex, exclusive. (If fromIndex==toIndex, the range to be ... Read More

What does the method sort(int[] a, int fromIndex, int toIndex) do in java?

karthikeya Boyini

karthikeya Boyini

Updated on 20-Feb-2020 12:33:49

135 Views

The sort(int[] a, int fromIndex, int toIndex) method of the java.util.Arrays class sorts the specified range of the specified array of integer value into ascending numerical order. The range to be sorted extends from index fromIndex, inclusive, to index toIndex, exclusive.Exampleimport java.util.Arrays; public class ArrayDemo {    public static void ... Read More

What is the type conversion operator ( ) in Java and how to use it?

karthikeya Boyini

karthikeya Boyini

Updated on 20-Feb-2020 10:09:52

951 Views

Cast operator in java is used to convert one data type to other.Examplepublic class Sample {    public static void main(String args[]) {       double d = 20.3;       int i = (int)d;       System.out.println(i);    } }Output20

How to perform sort using Java?

karthikeya Boyini

karthikeya Boyini

Updated on 20-Feb-2020 09:52:19

123 Views

You can sort an array using sort() method of the Arrays class.ExampleLive Demoimport java.util.Arrays; public class MainClass {    public static void main(String args[]) throws Exception {       int array[] = { 2, 5, -2, 6, -3, 8, 0, -7, -9, 4 };       Arrays.sort(array);   ... Read More

Advertisements