Unified JVM Logging in Java 9

Alshifa Hasnain
Updated on 16-Jun-2025 16:36:39

537 Views

In this article, we will learn about the unified JVM logging in Java 9. Logging in the JVM is a great tool for performing root cause analysis, and it is a part of the JDK(Java Development Kit). Starting from JDK 9, the JVM maintainers chose to rebuild the way the JVM logs things. What is Unified JVM Logging? Java 9 can provide a common logging system for JVM components with a detailed level. By using a new command-line option: -Xlog for all logging settings, and unified JVM logging, gives us an easy-to-configure tool to do a root cause analysis (RCA) ... Read More

Access Each Stack Element of StackWalker in Java 9

Alshifa Hasnain
Updated on 16-Jun-2025 16:35:18

248 Views

In this article, we will learn to access each stack element of StackWalker in Java 9. We will learn about the StackWalker API and its methods, and use of getStackTrace() method for accessing each stack element. StackWalker API StackWalker API allows easy filtering and lazy access to execute tasks within any method. It is an efficient API for obtaining stack trace information in Java 9. StackWalker API is an alternative to Thread.getStackTrace() or Throwable.getStackTrace() and SecurityManager.getClassContext(). This API targets a mechanism to traverse and materialize required stack frames, allowing efficient lazy access to additional stack frames when required. The following ... Read More

Use of the toEpochSecond Method in Java 9

Alshifa Hasnain
Updated on 16-Jun-2025 16:33:50

850 Views

In this article, we will learn about the use of the toEpochSecond() method in Java 9. First, we will learn about the LocalDate class, its methods, then we will know about the Epoch Time and the toEpochSecond() method with its uses and example in Java. LocalDate Class The LocalDate class is a part of java.time package. LocalDate class represents a date without a time-zone in the ISO-8601 calendar system, such as 2020-10-14. This class represents a date in the format yyyy-MM-dd. The following are some of the common methods of the LocalDate Class getDayOfMonth(): This ... Read More

When to Use the DelayedExecutor Method of CompletableFuture in Java 9

Alshifa Hasnain
Updated on 16-Jun-2025 16:32:44

4K+ Views

In this article, we will learn to use the delayedExecutor() method of CompletableFuture in Java 9. We're gonna know about the delayedExecutor() method and also the CompletableFuture class, as this method belongs to this class, and we're gonna know the uses of the delayedExecutor() method along with an example. CompletableFuture Class The CompletableFuture Class was introduced in Java 8. CompletableFuture is a class in java.util.concurrent package that implements the Future and CompletionStage Interface. CompletableFuture provides a powerful and flexible way to write asynchronous, non-blocking code. It supports delays and timeouts. The delayedExecutor() Method The delayedExecutor() method has been added ... Read More

Find Element with Minimum Value in Python List

Nikitasha Shrivastava
Updated on 16-Jun-2025 16:11:33

3K+ Views

A list is one of the most commonly used data structures in Python. It is mutable and has an ordered sequence of elements. In this article, we will find the element from a given list with the minimum value. We will see different examples and different ways to do this. But first, let us see how do define a list in Python. Defining a List Following is a list of integer values - lis= [12, 22, 32, 54, 15] print(lis) When you run the program, it will show this output - [12, 22, 32, 54, 15] In this article, ... Read More

Get ISO 8601 Date in String Format in Python

SaiKrishna Tavva
Updated on 16-Jun-2025 15:47:20

64K+ Views

The ISO 8601 standard defines an internationally recognised format for representing dates and times. ISO 8601 is a date and time format that helps remove different forms of the day, date, and time conventions worldwide. In this article, we will discuss several methods to get an ISO 8601 date in string format in Python. ISO 8601 Date Format In Python,  ISO 8601 date is represented as "YYYY-MM-DDTHH:MM:SS.mmmmmm" format. For example, August 25, 2023, is represented as 2023-08-25T14:35:45.123456. YYYY: Year (four digits) MM: Month (from 1-12) DD: Days (from ... Read More

Convert a List into a Tuple in Python

Nikitasha Shrivastava
Updated on 16-Jun-2025 15:01:33

27K+ Views

List and Tuple in Python are classes of data structures. The list is dynamic, whereas the tuple has static characteristics. In this article, we will convert a list into a tuple by using a few methods. Each of these methods is discussed below. Converting List into Tuple using tuple() We can convert a list into a tuple using the tuple() function. This function accepts a list as a parameter, converts into a tuple and returns the result.Example 1 In the following program, we convert a list to a tuple using the tuple() function. # using tuple() built-in function list_names=['Meredith', 'Kristen', 'Wright', ... Read More

Optimize Performance of Python Regular Expression

Nikitasha Shrivastava
Updated on 16-Jun-2025 12:58:23

4K+ Views

Python provides a regular expression-specific built-in library named "re". You only need to import it to use its features (such as search, match, findall, etc.). They'll provide you back a Match object with helpful techniques for modifying your outcomes. According to Wikipedia, regular expressions (also known as regexp) are collections of characters that specify a search pattern. It is a tool that enables you to filter, extract, or alter a series of characters. It has also been discovered that regular expressions function more quickly when the "in" operator is used. Regular expressions have performance difficulties and are generally difficult to debug and maintain. ... Read More

Match Date String Using Python Regular Expression

Nikitasha Shrivastava
Updated on 16-Jun-2025 12:32:16

7K+ Views

Regular expressions, or regex, are useful in Python when you need to find patterns in text. If you want to perform verification for a string that contains a date, in this case regex is useful. In this article, we will learn simple ways to match date strings using Python regex in the coming sections. Dates can come in many formats, like - YYYY-MM-DD YYYY/MM/DD YYYY.MM.DD YYYYMMDD DD-MM-YYYY DD/MM/YYYY Regular expression helps us find these patterns easily, so we can validate or extract dates from the given text. There are several ways to match a date string ... Read More

Raw String Notation in Python Regular Expression

Nikitasha Shrivastava
Updated on 16-Jun-2025 12:27:36

6K+ Views

This article will discuss what raw string notation is in Python regular expressions. Regex is a set of characters that specifies a search pattern and is mostly used in text processors and search engines to execute find and replace operations.In Python,  regular expressions are used to find patterns in text. But some characters (like and \t) may create problems. Raw string notation (r'') can be useful here! This allows Python to treat backslashes as normal characters, which makes regex patterns easy to create and interpret. Python uses "" to escape characters in raw strings. This can change your regex pattern, ... Read More

Advertisements