Samual Sam has Published 2310 Articles

How to check index within a string of a specified substring in JSP?

Samual Sam

Samual Sam

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

525 Views

The fn:indexOf() function returns the index within a string of a specified substring.SyntaxThe fn:indexOf() function has the following syntax −int indexOf(java.lang.String, java.lang.String)ExampleFollowing is the example to explain the functionality of the fn:indexOf() function − Using JSTL Functions ... Read More

Reserving MySQL auto-incremented IDs?

Samual Sam

Samual Sam

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

382 Views

To reserve MySQL auto-incremented IDs, the syntax is as follows −START TRANSACTION; insert into yourTableName values(), (), (), (); ROLLBACK; SELECT LAST_INSERT_ID() INTO @anyVariableName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table reservingAutoIncrementDemo    -> (   ... Read More

FloatBuffer arrayOffset() method in Java

Samual Sam

Samual Sam

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

101 Views

The offset of the first element of the buffer inside the buffer array is obtained using the method arrayOffset() in the class java.nio.FloatBuffer. If the buffer backed by the array is read-only, then the ReadOnlyBufferException is thrown.A program that demonstrates this is given as follows −Example Live Demoimport java.nio.*; import java.util.*; ... Read More

Duration plusMillis() method in Java

Samual Sam

Samual Sam

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

81 Views

An immutable copy of a duration where some milliseconds are added to it can be obtained using the plusMillis() method in the Duration class in Java. This method requires a single parameter i.e. the number of milliseconds to be added and it returns the duration with the added milliseconds.A program ... Read More

FloatBuffer slice() method in Java

Samual Sam

Samual Sam

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

140 Views

A new FloatBuffer with the content as a shared subsequence of the original FloatBuffer can be created using the method slice() in the class java.nio.FloatBuffer. This method returns the new FloatBuffer that is read-only if the original buffer is read-only and direct if the original buffer is direct.A program that ... Read More

AlgorithmParameterGenerator getProvider() method in Java

Samual Sam

Samual Sam

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

94 Views

The provider of the generator object can be obtained using the method getProvider() in the class java.security.AlgorithmParameterGenerator. This method requires no parameters and it returns the provider of the generator object.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public ... Read More

Duration plusMinutes() method in Java

Samual Sam

Samual Sam

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

136 Views

An immutable copy of a duration where some minutes are added to it can be obtained using the plusMinutes() method in the Duration class in Java. This method requires a single parameter i.e. the number of minutes to be added and it returns the duration with the added minutes.A program ... Read More

How to listdown all the symbols in a .so file in C++

Samual Sam

Samual Sam

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

822 Views

To read a .so file in elf format, use readelfreadelf -Ws libName.soIt helps to extract symbol from binary.The standard tool used for listing all symbol is, nmnm -g libName.so

FloatBuffer wrap() method in Java

Samual Sam

Samual Sam

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

156 Views

A float array can be wrapped into a buffer using the method wrap() in the class java.nio.FloatBuffer. This method requires a single parameter i.e. the array to be wrapped into a buffer and it returns the new buffer created. If the returned buffer is modified, then the contents of the ... Read More

Duration minusHours() method in Java

Samual Sam

Samual Sam

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

86 Views

An immutable copy of a duration where some hours are removed from it can be obtained using the minusHours() method in the Duration class in Java. This method requires a single parameter i.e. the number of hours to be subtracted and it returns the duration with the subtracted hours.A program ... Read More

Advertisements