- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Samual Sam has Published 2492 Articles
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
500 Views
To extract filenames from a path MySQL, you can use SUBSTRING_INDEX(). The syntax is as follows −SELECT SUBSTRING_INDEX(ypurColumnName, '\', -1) as anyAliasName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table ExtractFileNameDemo -> ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
61 Views
A duplicate buffer of a buffer can be created using the method duplicate() in the class java.nio.ShortBuffer. This duplicate buffer is identical to the original buffer. The method duplicate() returns the duplicate buffer that was created.A program that demonstrates this is given as follows −Example Live Demoimport java.nio.*; import java.util.*; public ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
139 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
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
144 Views
Let us get the timezone id strings for timezone America. For this, use the get.AvailableZoneIds() method −ZoneId.getAvailableZoneIds().stream().filter(s ->s.startsWith("America")) .forEach(System.out::println);With that, we have used the forEach to display all the timezones in America −America/Cuiaba America/Marigot America/El_Salvador America/Guatemala America/Belize America/Panama America/Managua America/Indiana/Petersburg America/Chicago America/Tegucigalpa America/Eirunepe America/Miquelon . . .Exampleimport java.time.ZoneId; public class ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
57 Views
A buffer can be compared with another buffer using the method compareTo() in the class java.nio.ShortBuffer. This method returns a negative integer if the buffer is less than the given buffer, zero if the buffer is equal to the given buffer and a positive integer if the buffer is greater ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
139 Views
A Pair class in JavaTuples can only have 2 elements. The JavaTuples library includes the Pair class.The following is the declaration −public final class Pair extends Tuple implements IValue0, IValue1Let us first see what we need to work with JavaTuples. To work with Pair class in JavaTuples, you need to ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
402 Views
To get the seconds since the beginning of epochs, you need to use Instant. The method here used is ofEpochSecond() method. The epoch is the number of seconds that have elapsed since 00::00:00 Thursday, 1 January 1970.Get the seconds with ChronoUnit.SECONDS −long seconds = Instant.ofEpochSecond(0L).until(Instant.now(), ChronoUnit.SECONDS);Exampleimport java.time.Instant; import java.time.temporal.ChronoUnit; public ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
2K+ Views
You can achieve this with the help of CONCAT() along with REPLACE() function. To find the first occurrences you need to use INSTR() function.The syntax is as follows −UPDATE yourTableName SET UserPost = CONCAT(REPLACE(LEFT(yourColumnName, INSTR(yourColumnName, 'k')), 'k', 'i'), SUBSTRING(yourColumnName, INSTR(yourColumnName, 'k') + 1));To understand the above syntax, let us create ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
306 Views
Too return a specific field, use the find() method in MongoDB. Let us first create a collection with documents −> db.specificFieldDemo.insertOne({"FirstName":"John", "LastName":"Doe"}); { "acknowledged" : true, "insertedId" : ObjectId("5cb8019a623186894665ae31") } > db.specificFieldDemo.insertOne({"FirstName":"John", "LastName":"Smith"}); { "acknowledged" : true, "insertedId" : ObjectId("5cb801ab623186894665ae32") } > db.specificFieldDemo.insertOne({"FirstName":"David", "LastName":"Miller"}); { ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
63 Views
A Septet class is a Tuple of seven elements. It is part of the JavaTuples library.The following is the declaration −public final class Septet extends Tuple implements IValue1, IValue2, IValue3, IValue4, IValue5, IValue6, IValue7Let us first see what we need to work with JavaTuples. To work with Septet class in ... Read More