Karthikeya Boyini has Published 1698 Articles

JavaTuples setAt1() method for Triplet class

karthikeya Boyini

karthikeya Boyini

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

110 Views

The setAt1() method is used to set the Triplet value in JavaTuples and a copy with a new value at the specified index i.e. index 1 here.Let us first see what we need to work with JavaTuples. To work with Triplet class in JavaTuples, you need to import the following ... Read More

Java Program to get the value stored in a byte as an unsigned integer

karthikeya Boyini

karthikeya Boyini

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

319 Views

Let us first create signed byte −byte signedVal = -100;Now convert a byte to an unsigned integer −int unsignedVal = Byte.toUnsignedInt(signedVal);Examplepublic class Demo {    public static void main(String[] args) {       byte signedVal = -100;       int unsignedVal = Byte.toUnsignedInt(signedVal);       System.out.println("Signed value ... Read More

Is there a built-in function for week of the month in MySQL?

karthikeya Boyini

karthikeya Boyini

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

912 Views

There is no standard function to get week of month in MySQL. You need to use the following syntax −SELECT WEEK(yourDateColumnName, 5) - WEEK(DATE_SUB(yourDateColumnName, INTERVAL DAYOFMONTH(yourDateColumnName) - 1 DAY), 5) + 1 AS anyAliasName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a ... Read More

ShortBuffer asReadOnlyBuffer() method in Java

karthikeya Boyini

karthikeya Boyini

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

145 Views

A read-only short buffer can be created using the contents of a buffer with the method asReadOnlyBuffer() in the class java.nio.ShortBuffer. The new buffer cannot have any modifications as it is a read-only buffer. However, the capacity, positions, limits etc. of the new buffer are the same as the previous ... Read More

Search a value in Java Unit Tuple

karthikeya Boyini

karthikeya Boyini

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

127 Views

To search a value in Unit class in JavaTuples, use the contains() method.Let us first see what we need to work with JavaTuples. To work with the Unit class in JavaTuples, you need to import the following package −import org.javatuples.Unit;Note − Steps to download and run JavaTuples program If you ... Read More

MySQL Order By date column and integer column, but specify ordering rules of integer column? Is it possible?

karthikeya Boyini

karthikeya Boyini

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

227 Views

You can achieve this with the help of ORDER BY CASE statement. The syntax is as follows −SELECT *FROM yourTableName ORDER BY CASE yourIntegerColumnName1 WHEN 2 THEN 1 ELSE 0 END DESC ,yourDateColumnName ASC;To understand the above syntax, let us create a table. The query to create a table is ... Read More

Iterate through Quintet class in Java Tuples

karthikeya Boyini

karthikeya Boyini

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

151 Views

You can iterate through Quintet class using a loop, like arrays in Java.Let us first see what we need to work with JavaTuples. To work with Quintet class in JavaTuples, you need to import the following package −import org.javatuples.Quintet;Note − Steps to download and run JavaTuples program If you are ... Read More

Java Program to get Temporal Queries precision

karthikeya Boyini

karthikeya Boyini

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

171 Views

To get Temporal Queries precision, use the TemporalQuery interface with the precision() method of the TemporalQueries −TemporalQueryprecision = TemporalQueries.precision(); Get the precision for LocalDate: LocalDate.now().query(precision) Get the precision for LocalTime: LocalTime.now().query(precision) Get the precision for YearMonth: YearMonth.now().query(precision) Get the precision for Year: Year.now().query(precision)Exampleimport java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.Year; ... Read More

Why SHOW DBS does not show my databases in MongoDB?

karthikeya Boyini

karthikeya Boyini

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

4K+ Views

This SHOW DBS command won’t show the databases because you may have not created a document for a collection. If you will create document for a collection then the created database will be visible.Let us implement the above concept and create a database −> use web; switched to db webFollowing ... Read More

Change max_heap_table_size value in MySQL?

karthikeya Boyini

karthikeya Boyini

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

2K+ Views

The max_heap_table_size is a system variable that has both read/write property.Initially, max_heap_table_size has size 16 MB. First, check the value of max_heap_table_size, which is in bytes.The query is as follows −mysql> select @@max_heap_table_size;The following is the output −+-----------------------+ | @@max_heap_table_size | +-----------------------+ | 16777216 ... Read More

Advertisements