Daniol Thomas has Published 212 Articles

C++ Program to Compute DFT Coefficients Directly

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

196 Views

In discrete Fourier transform (DFT), a finite list is converted of equally spaced samples of a function into the list of coefficients of a finite combination of complex sinusoids. They ordered by their frequencies, that has those same sample values, to convert the sampled function from its original domain (often ... Read More

What is a RowSet object explain using a JDBC program?

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

210 Views

A RowSet is a wrapper around a ResultSet Object. It can be connected, disconnected from the database and can be serialized. It maintains a JavaBean component by setting the properties. You can pass a RowSet object over the network. By default, RowSet object is scrollable and updatable and it is ... Read More

How to update the contents of a ResultSet using a JDBC program?

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

81 Views

To update the contents of the ResultSet you need to create a statement by passing the ResultSet type updatable, as://Creating a Statement object Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);Just like getXXX() and setXXX() methods ResultSet interface also provides methods to update the contents of a row in a result set updateXXX().These ... Read More

Java Program to check for the supported attribute via java.nio.file.FileStore

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

59 Views

Following is our file:Path p = Paths.get("E:/input.txt"); FileStore file = Files.getFileStore(p);Now, check for the supported attributes one by one:FileAttributeView = file.supportsFileAttributeView(FileAttributeView.class) PosixFileAttributeView = file.supportsFileAttributeView(PosixFileAttributeView.class) BasicFileAttributeView = file.supportsFileAttributeView(BasicFileAttributeView.class)Exampleimport java.nio.file.FileStore; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.attribute.BasicFileAttributeView; import java.nio.file.attribute.FileAttributeView; import java.nio.file.attribute.FileOwnerAttributeView; import java.nio.file.attribute.PosixFileAttributeView; public class Demo {    public static void ... Read More

Java Program to format date as Apr 19, 2019, 1:27 PM

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

138 Views

To format and display datetime, you need to use DateTimeFormatter. The format style is MEDIUM and SHORT:DateTimeFormatter formatter = DateTimeFormatter .ofLocalizedDateTime(FormatStyle.MEDIUM, FormatStyle.SHORT);Display the formatted date:formatter.format(LocalDateTime.now()Exampleimport java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.time.format.FormatStyle; public class Demo {    public static void main(String[] args) {       DateTimeFormatter formatter = DateTimeFormatter .ofLocalizedDateTime(FormatStyle.MEDIUM, FormatStyle.SHORT); ... Read More

Java Program to format date as Apr 14 2019 01:35 PM IST

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

64 Views

To format and display datetime, you need to use DateTimeFormatter and use the pattern as:DateTimeFormatter dtFormat = DateTimeFormatter.ofPattern("MMM dd yyyy hh:mm a z");Above, the z is the timezone:MMM dd yyyy hh:mm a zNow, use the following for zone:ZonedDateTime dateTime = ZonedDateTime.now();Exampleimport java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; public class Demo {    public ... Read More

How to format Java LocalDateTime as ISO_DATE_TIME format

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

3K+ Views

At first, set the date:LocalDateTime dateTime = LocalDateTime.of(2019, Month.JULY, 9, 10, 20);Now, format the datetime as ISO_DATE_TIME format:String str = dateTime.format(DateTimeFormatter.ISO_DATE_TIME);Exampleimport java.time.LocalDateTime; import java.time.Month; import java.time.format.DateTimeFormatter; public class Demo {    public static void main(String[] args) {       LocalDateTime dateTime = LocalDateTime.of(2019, Month.JULY, 9, 10, 20);     ... Read More

Java Program to format LocalDateTime as ISO_WEEK_DATE format

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

118 Views

At first, set the date:LocalDateTime dateTime = LocalDateTime.of(2019, Month.SEPTEMBER, 9, 10, 20);Now, format the datetime as ISO_WEEK_DATE format:String str = dateTime.format(DateTimeFormatter.ISO_WEEK_DATE);Exampleimport java.time.LocalDateTime; import java.time.Month; import java.time.format.DateTimeFormatter; public class Demo {    public static void main(String[] args) {       LocalDateTime dateTime = LocalDateTime.of(2019, Month.SEPTEMBER, 9, 10, 20);     ... Read More

IntStream mapToObj() method in Java

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

2K+ Views

The mapToObj() method in the IntStream class returns an object-valued Stream consisting of the results of applying the given function to the elements of this stream.The syntax is as follows. StreammapToObj(IntFunction

IntStream mapToLong() method in Java

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

493 Views

The mapToLong() function in IntStream class returns a LongStream consisting of the results of applying the given function to the elements of this stream.The syntax is as follows.LongStream mapToLong(IntToLongFunction mapper)Here, the parameter mapper is a stateless function to apply to each element.Create an IntStream with some elements in the Stream.IntStream ... Read More

Advertisements