Display Date in User-Specified Format in MySQL

Daniol Thomas
Updated on 20-Jun-2020 05:54:16

119 Views

We need to use DATE_FORMAT() function to display the date in other formats. There would be two arguments of this function, first would be the date and second would be the format string.Example − Suppose in the table ‘date_testing we have three dates in the following formatmysql> Select * from date_testing; +------------+ | Date       | +------------+ | 2017-03-15 | | 2017-03-25 | | 2017-04-05 | +------------+ 3 rows in set (0.00 sec)Now DATE_FORMAT() function will change the format of the above dates in the format given by the user as follows −mysql> Select DATE_FORMAT(Date, '%W %D ... Read More

Add Multiple Columns to Existing MySQL Table

Rama Giri
Updated on 20-Jun-2020 05:53:09

8K+ Views

We can also add multiple columns to an existing table with the help of ALTER command. The syntax for it would be as follows −SyntaxAlter table table-name ADD (column-name1 datatype, column-name2 datatype,… column-nameN datatype);ExampleIn the example below, with the help of ALTER Command, columns ‘Address’, ‘Phone’ and ‘Email’ are added to the table ‘Student’.mysql> Alter Table Student ADD(Address Varchar(25), Phone INT, Email Varchar(20)); Query OK, 5 rows affected (0.38 sec) Records: 5 Duplicates: 0 Warnings: 0

Flip Out Y Animation Effect with CSS

George John
Updated on 19-Jun-2020 16:51:46

98 Views

To implement Flip Out Y Animation effect with CSS, you can try to run the following codeLive Demo                    .animated {             background-image: url(/css/images/logo.png);             background-repeat: no-repeat;             background-position: left top;             padding-top:95px;             margin-bottom:60px;             -webkit-animation-duration: 1s;             animation-duration: 1s;             -webkit-animation-fill-mode: both;             animation-fill-mode: both;          }          @-webkit-keyframes flipOutY {             0% {                -webkit-transform: perspective(400px) rotateY(0deg);                opacity: 1;             }             100% {                -webkit-transform: perspective(400px) rotateY(90deg);                opacity: 0;             }          }          @keyframes flipOutY {             0% {                transform: perspective(400px) rotateY(0deg);                   opacity: 1;             }             100% {                transform: perspective(400px) rotateY(90deg);                opacity: 0;             }          }          .flipOutY {             -webkit-backface-visibility: visible !important;             -webkit-animation-name: flipOutY;             backface-visibility: visible !important;             animation-name: flipOutY;          }                           Reload page                      function myFunction() {             location.reload();          }          

CSS Speech Rate Property

Ankith Reddy
Updated on 19-Jun-2020 16:38:17

108 Views

The speech-rate property specifies the speaking rate. Note that both absolute and relative keyword values are allowed.The possible values are -number − Specifies the speaking rate in words per minute.x-slow − Same as 80 words per minute.slow − Same as 120 words per minute.medium − Same as 180 - 200 words per minute.fast − Same as 300 words per minute.x-fast − Same as 500 words per minute.faster − Adds 40 words per minute to the current speech rateslower − Subtracts 40 words per minutes from the current speech rate.

CSS3 Rounded Corners

Rishi Rathor
Updated on 19-Jun-2020 16:37:37

150 Views

CSS3 Rounded corners are used to add a special colored corner to body or text by using the border-radius property.A simple syntax of rounded corners is as follows −#rcorners {    border-radius: 60px/15px;    background: #FF0000;    padding: 20px;    width: 200px;    height: 150px; }The following table shows the possible values for Rounded corners as follows:ValuesDescriptionborder-radiusUse this element for setting four border radius propertyborder-top-left-radiusUse this element for setting the border of top left cornerborder-top-right-radiusUse this element for setting the border of top right cornerborder-bottom-right-radiusUse this element for setting the border of bottom right cornerborder-bottom-left-radiusUse this element for setting the ... Read More

Add Given Time to a Particular Date in Java

Samual Sam
Updated on 19-Jun-2020 14:58:38

131 Views

Following is an example to add a given time to a particular date.ProgramLive Demoimport java.util.*; public class Main {    public static void main(String[] args) throws Exception {       Date d1 = new Date();       Calendar cl = Calendar. getInstance();       cl.setTime(d1);       System.out.println("today is " + d1.toString());       cl. add(Calendar.MONTH, 1);       System.out.println("date after a month will be " + cl.getTime().toString() );       cl. add(Calendar.HOUR, 70);       System.out.println("date after 7 hrs will be " + cl.getTime().toString() );       cl. add(Calendar.YEAR, ... Read More

Calculate Mean of Given Numbers in Java

Ankith Reddy
Updated on 19-Jun-2020 14:54:39

6K+ Views

Mean is an average value of given set of numbers. It is calculated similarly to that of the average value. Adding all given number together and then dividing them by the total number of values produces mean.For Example Mean of 3, 5, 2, 7, 3 is (3 + 5 + 2 + 7 + 3) / 5 = 4AlgorithmTake an integer set A of n values.Add all values of A together.Divide result of Step 2 by n.The result is mean of A's values.Programpublic class CaculatingMean {    public static void main(String args[]){       float mean;       int ... Read More

Find Cube Root of a Given Number in Java

George John
Updated on 19-Jun-2020 14:51:46

2K+ Views

Following is an example to find the cube root of a given number.Programimport java.util.Scanner; public class FindingCubeRoot {    public static void main(String args[]){       double i, precision = 0.000001;       System.out.println("Enter a number ::");       Scanner sc = new Scanner(System.in);       int num = sc.nextInt();       for(i = 1; (i*i*i)

CopyOnWriteArraySet Class in Java

Samual Sam
Updated on 19-Jun-2020 14:45:11

710 Views

Class declarationpublic class CopyOnWriteArraySet    extends AbstractSet implements SerializableCopyOnWriteArraySet class uses CopyOnWriteArrayList internally for all of its operations and thus possesses the basic properties of CopyOnWriteArrayList.CopyOnWriteArraySet is a thread-safe.CopyOnWriteArraySet is to be used in Thread based environment where read operations are very frequent and update operations are rare.Iterator of CopyOnWriteArraySet will never throw ConcurrentModificationException.Any type of modification to CopyOnWriteArraySet will not reflect during iteration since the iterator was created.Set modification methods like remove, set and add are not supported in the iteration. This method will throw UnsupportedOperationException.CopyOnWriteArraySet MethodsFollowing is the list of important methods available in the CopyOnWriteArraySet class.Sr.No.Method & ... Read More

CopyOnWriteArrayList Class in Java

karthikeya Boyini
Updated on 19-Jun-2020 14:41:11

5K+ Views

Class declarationpublic class CopyOnWriteArrayList    extends Object implements List, RandomAccess, Cloneable, SerializableCopyOnWriteArrayList is a thread-safe variant of ArrayList where operations which can change the ArrayList (add, update, set methods) creates a clone of the underlying array.CopyOnWriteArrayList is to be used in a Thread based environment where read operations are very frequent and update operations are rare.Iterator of CopyOnWriteArrayList will never throw ConcurrentModificationException.Any type of modification to CopyOnWriteArrayList will not reflect during iteration since the iterator was created.List modification methods like remove, set and add are not supported in the iteration. This method will throw UnsupportedOperationException.null can be added to the ... Read More

Advertisements