Animate CSS Column Rule Property

mkotla
Updated on 25-Jun-2020 13:00:56

255 Views

To implement animation on the column-rule property with CSS, you can try to run the following code:ExampleLive Demo                    div {             width: 600px;             height: 300px;             background: white;             border: 10px solid red;             animation: myanim 3s infinite;             bottom: 30px;             position: absolute;             column-count: 4;   ... Read More

Pollard's Rho Algorithm for Prime Factorization in Java

Ankith Reddy
Updated on 25-Jun-2020 12:59:32

328 Views

It is an algorithm to perform factorization on given integers. Following is the program implementing the Rho Algorithm for Prime Factorization.ProgramLive Demopublic class PollardsRho {    int num = 65;    public int gcd(int a, int b) {       int gcd = 0;       for(int i = 1; i

MySQL Concatenation Operator

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

502 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 -> ( -> -> VendorId int, -> VendorName varchar(100), -> VendorCountry varchar(100) -> ); Query OK, 0 rows affected (0.69 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into Concatenation_OperatorDemo values(101, 'Carol', 'US'); Query OK, 1 row affected (0.19 sec) mysql> insert ... Read More

Set Top Left Corner Border with CSS

varun
Updated on 25-Jun-2020 12:58:12

267 Views

Use the border-top-left-radius property to set the border of the top left corner. You can try to run the following code to implement border-left-radius property:ExampleLive Demo                    #rcorner {             border-radius: 25px;             border-top-left-radius: 45px;             background: #FADBD8;             padding: 20px;             width: 300px;             height: 150px;          }                     Rounded top-left corner!    

Count on a MySQL Union Query

Ankith Reddy
Updated on 25-Jun-2020 12:57:18

7K+ Views

To do a count on a union i.e. to get the count of the UNION result, use the below syntax −SELECT COUNT(*) FROM ( SELECT yourColumName1 from yourTableName1 UNION SELECT yourColumName1 from yourTableName2 ) anyVariableName;To understand the above syntax, let us create two tables with some records. The query to create a table is as follows −mysql> create table union_Table1 -> ( -> UserId int -> ); Query OK, 0 rows affected (0.47 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into union_Table1 values(1); Query OK, 1 row affected (0.18 sec) ... Read More

parseInt Function in JavaScript

Samual Sam
Updated on 25-Jun-2020 12:56:34

587 Views

The parseInt() function accepts two parameters one is a string representing a number and another is a number representing the radix and returns an integer of the given radix.SyntaxIts Syntax is as followsnum.parseInt('4524', 8);Example Live Demo    JavaScript Example           var result = parseInt('4524', 8);       document.write("Result: " + result);     OutputResult: 2388Example Live Demo    JavaScript Example           var result1 = parseInt('4524', 8);       document.write("Result: " + result1);       document.write("");       var result2 = parseInt('4524', 10);       document.write("Result: " + result2);       document.write("");       var result3 = parseInt('4524', 16);       document.write("Result: " + result3);     OutputResult: 2388 Result: 4524 Result: 17700

parseFloat Function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 12:55:38

188 Views

The parseFloat() function accepts two parameters one is a string representing a number and another is a number representing the radix and returns an integer of the given radix.SyntaxIts Syntax is as followsnum.parseFloat('4524', 8);Example Live Demo    JavaScript Example           var result1 = parseFloat(Math.PI);       document.write("Result: "+result1);       document.write('');       var result2 = parseFloat("245.12@welcome");       document.write("Result: "+result2);       document.write('');       var result3 = parseFloat("11111100.010");       document.write("Result: "+result3);     OutputResult: 3.141592653589793 Result: 245.12 Result: 11111100.01

Sieve of Eratosthenes in Java

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 every 5th integer.(multiples of 5)Programimport java.util.Scanner; public class SievePrimeFactors  {    public static void main(String args[]) {       Scanner sc = new Scanner(System.in);       System.out.println("Enter a number");       int num = sc.nextInt();       boolean[] bool = new boolean[num];       ... Read More

Set Size Property in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 12:54:46

411 Views

The size property of the Set object returns number representing the number of elements in the current set object.SyntaxIts Syntax is as followsObj.size();Example Live Demo    JavaScript Example           const setObj = new Set();       setObj.add('Java');       setObj.add('JavaFX');       setObj.add('JavaScript');       setObj.add('HBase');       document.write("Size of the Set object: "+setObj.size);     OutputSize of the Set object: 4

Work with getDeclaringClass in Java

Anvi Jain
Updated on 25-Jun-2020 12:54:34

147 Views

The getDeclaringClass() method returns the Class object for the class in which the object was declared. This happens only if the Class of the Class object is a member of another class. Otherwise this method returns null.Also, if a primitive type, array class, void etc. are represented by the Class object, then the getDeclaringClass() method returns null.A program that demonstrates the getDeclaringClass() method is given as follows −Example Live Demopackage Test; import java.lang.reflect.*; public class Demo {    public static void main(String[] args) {       Method[] m = String.class.getMethods();       for(int i = 0; i < m.length; ... Read More

Advertisements