Display Seconds in SS Format (01:02) in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

143 Views

The ss format for seconds is like representing seconds 01, 02, 03, 04, etc. We will use it like this.SimpleDateFormat("ss");Let us see an example −// displaying seconds in ss format simpleformat = new SimpleDateFormat("ss"); String strSeconds = simpleformat.format(new Date()); System.out.println("Seconds in ss format = "+strSeconds);Above, we have used the SimpleDateFormat class, therefore the following package is imported −import java.text.SimpleDateFormat;The following is an example −Example Live Demoimport java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; public class Demo { public static void main(String[] args) throws Exception { // displaying current date and time ... Read More

MySQL Query a List of Values

Ankith Reddy
Updated on 30-Jul-2019 22:30:24

6K+ Views

To query a list of values, you can use IN operator. The syntax is as follows −SELECT * FROM yourTableName WHERE yourColumnName IN(Value1, Value2, ...N) ORDER BY FIELD(yourColumnName, Value1, Value2, ...N);To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table ListOfValues    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> Name varchar(30),    -> Age int,    -> PRIMARY KEY(Id)    -> ); Query OK, 0 rows affected (0.72 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert ... Read More

Know the Right Time to Start Your Own Business

Ridhi Arora
Updated on 30-Jul-2019 22:30:24

177 Views

A year ago, I had shifted to a new city (and even a new state) of the country. Having been born and brought up in North India, I was not very familiar with this city in South India. Climate, people, culture everything was way different than where I used to live, but it was still a place where I had to stay.Restaurant ReviewingEverything can be adjusted, but the food is actually an offering to the soul and it is difficult to manage cooking along with a job. So, I resorted exploring food in the new city. Trying restaurants and then ... Read More

Geographical Plotting Using Python Plotly

Samual Sam
Updated on 30-Jul-2019 22:30:24

424 Views

Python provides various libraries to handle geographical and graph data. Python plotly is one of those libraries which are used to draw geographical graphs. Plotly is a free and open source library. Plotly helps to plot various kinds of graphs like Line charts, Horizontal bar charts, bar charts, dashboards, scatter plots, bubble charts, pie charts and many more.# Import important python geographical libraries. import plotly.plotly as py import plotly.graph_objs as go import pandas as pd # Must enable in order to use plotly off-line. from plotly.offline import download_plotlyjs, init_notebook_mode, iplot, plot # To establish connection init_notebook_mode() # type defined is ... Read More

Get the Type of a Variable in MySQL

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

1K+ Views

You cannot get the type of variable in MySQL. Cast the type of variable into another using CAST operator. The syntax is as follows −SET @yourVariableName:=’anyValue’Use the CAST operator to cast to another type. The syntax is as follows −SELECT CAST( @yourVariableName AS SIGNED);To understand the above syntax, let us cast to another type.Case 1: String to unsigned −mysql> set @StringToInt:='12345'; Query OK, 0 rows affected (0.00 sec)The query is as follows to another type −mysql> select CAST(@StringToInt as UNSIGNED);The following is the output −+--------------------------------+ | CAST(@StringToInt as UNSIGNED) | +--------------------------------+ | 12345               ... Read More

What is Recruitment Cycle and How Companies Perform It

Rashmi Iyer
Updated on 30-Jul-2019 22:30:24

129 Views

Recruitment is the process of searching employees and encouraging them to apply for the vacancy in the organization. Recruitment is a very important component of HR Management because it is extremely important to find dedicated people who can work with commitment in an organization. It is a prerequisite to have an effective workforce and strong work culture in the organization.To quote Stahl, ‘Recruitment is the cornerstone of the whole personnel structure. Unless the recruitment policy is soundly conceived, there can be little hope of building a first-rate staff.’Following are the steps involved in the effective and sound recruitment cycle followed ... Read More

Resolve MySQL SQL Syntax Error

George John
Updated on 30-Jul-2019 22:30:24

4K+ Views

To avoid this type of error in MySQL stored procedure, you need to change the delimiter ; to //.Suppose if you are using stored procedure or triggers or even function then you need to change the delimiter. The syntax is as follows.DELIMITER // CREATE PROCEDURE yourProcedureName() BEGIN Statement1, . . N END; // DELIMITER ;To understand the above syntax, let us create a stored procedure. The query to create a stored procedure is ... Read More

Remove Element from IdentityHashMap in Java

Chandu yadav
Updated on 30-Jul-2019 22:30:24

173 Views

Use the remove() method to remove an element from IdentityHashMap.Let us create IdentityHashMap and add some elementsMap m = new IdentityHashMap(); m.put("1", 100); m.put("2", 200); m.put("3", 300); m.put("4", 150); m.put("5", 110); m.put("6", 50); m.put("7", 90); m.put("8", 250); m.put("9", 350); m.put("10", 450);Let’s say you need to remove 2 from the Map. For that, use the remove() methodm.remove("2");The following is an example to remove an element from Java IdentityHashMapExample Live Demoimport java.util.*; public class Demo {    public static void main(String[] args) {       Map m = new IdentityHashMap(); m.put("1", 100); ... Read More

Performing MySQL-like Comparison on an INT Field

George John
Updated on 30-Jul-2019 22:30:24

738 Views

You need to use cast() method to perform comparison on an INT field. The syntax is as follows −SELECT yourColumnName1, yourColumnName2, ......N yourTableName WHERE CAST(yourColumnName as CHAR) LIKE ‘%yourIntegerValue%’;To understand the above syntax, let us create a table. The following is the query to create a table for performing a LIKE comparison on INT field −mysql> create table ComparisonOnIntField    -> (    -> StudentId int NOT NULL,    -> StudentName varchar(20),    -> StudentAge int    -> ); Query OK, 0 rows affected (1.00 sec)Insert some records in the table to perform a MySQL LIKE comparison on an INT ... Read More

Maximize Learning in Boring or Difficult Classes

Ridhi Arora
Updated on 30-Jul-2019 22:30:24

124 Views

Students often run away from the subjects or classes they find boring or difficult. While the subject that they dislike differs from student to student. It becomes very difficult to be mentally present in a class where a boring subject is taught or when the way of teaching the teacher is either boring or complex. Here are some tips to make learning an enjoyable experience even if the subject lacks interest or the teacher does not know how to add interest.Know that It Is Still A Part Of SyllabusNo matter how boring the subject is, it is still going to ... Read More

Advertisements