George John has Published 1081 Articles

Usage of cubic-bezier() CSS function

George John

George John

Updated on 25-Jun-2020 13:09:09

253 Views

To define a Cubic Bezier curve, use the cubic-bezier() function. You can try to run the following code to implement the cubic-bezier() functionExampleLive Demo                    div {             width: 100px;             height: 100px;             background: yellow;             transition: width 3s;             transition-timing-function: cubic-bezier(0.3, 0.3, 2.0, 0.9);          }          div:hover {             width:200px;          }                     Hover over the below container:          

Change column-rule-width property with CSS Animations

George John

George John

Updated on 25-Jun-2020 13:01:46

177 Views

To implement animation on column-rule-width property with CSS, you can try to run the following codeExampleLive Demo                    div {             width: 600px;             height: 300px;         ... Read More

MySQL concatenation operator?

George John

George John

Updated on 25-Jun-2020 12:59:12

474 Views

You can use in-built function CONCAT() from MySQL. The syntax is as follows −SELECT CONCAT(('(', yourColumnName1, ', ', yourColumnName2, ', ', yourColumnName3, ...N')')as anyVariableName from yourTableName;To understand the above syntax, let us first create a table. The query to create a table is as follows −mysql> create table Concatenation_OperatorDemo -> ... Read More

Sieve of Eratosthenes in java

George John

George John

Updated on 25-Jun-2020 12:55:11

5K+ Views

Sieve of Eratosthenes is the ancient algorithm to find prime numbers up to a given number.Algorithm1. Generate integers from 2 to n (Given number).2. Counting from 2 mark every 2nd integer. (multiples of 2)3. Now, starting from 3 mark every third integer. (multiples of 3)4. Finally, marking from 5 mark ... Read More

Legendre’s Formula in java

George John

George John

Updated on 25-Jun-2020 12:46:49

249 Views

You can calculate the exponent of the largest power of a PrimeNumber that divides the factorial n! using Legendre's formula.Programimport java.util.Scanner; public class LegendresFormula {    static int Largestpower(int n, int p) {       int ans = 0;       while (n > 0) {   ... Read More

Java Program to implement Binary Search on an array

George John

George John

Updated on 25-Jun-2020 12:34:59

416 Views

Binary search can be implemented on an array by using the method java.util.Arrays.binarySearch(). This method returns the index of the required element if it is available in the array, otherwise it returns (- (insertion point) - 1) where the insertion point is the position at which the element would be ... Read More

Modular Exponentiation (Power in Modular Arithmetic) in java

George John

George John

Updated on 25-Jun-2020 12:34:08

1K+ Views

The java.math.BigInteger.modPow(BigInteger exponent, BigInteger m) returns a BigInteger whose value is (thisexponent mod m). Unlike pow, this method permits negative exponents. You can calculate the modular Exponentiation using this method.ProgramLive Demoimport java.math.*; public class BigIntegerDemo {    public static void main(String[] args) {       // create 3 ... Read More

k-th prime factor of a given number in java

George John

George John

Updated on 25-Jun-2020 12:18:39

384 Views

Following is the Java program which prints the kth prime factor of a number n, when k and n are given.Programimport java.util.Scanner; public class KthPrimeFactor {    public static void main(String args[]) {       int number, k, factor = 0;       Scanner sc = new ... Read More

Compare two-byte arrays in a single line in Java

George John

George John

Updated on 25-Jun-2020 12:16:20

173 Views

Two byte arrays can be compared in Java using the java.util.Arrays.equals() method. This method returns true if the arrays are equal and false otherwise. The two arrays are equal if they contain the same number of elements in the same order. A program that compares two byte arrays using the ... Read More

Create new instance of an Array with Java Reflection Method

George John

George John

Updated on 25-Jun-2020 12:11:22

473 Views

A new instance of an Array can be created using the java.lang.reflect.Array.newInstance() method. This method basically creates a new array with the required component type as well as length.A program that demonstrates the creation of an array using the Array.newInstance() method is given as follows −Example Live Demoimport java.lang.reflect.Array; public class ... Read More

Advertisements