Stream Collectors.joining import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; //———————— public class YourClass { public static void main(String[] args) { List list = Arrays.asList(“a”, “b”, “c”); String result = list.stream().collect(Collectors.joining(“,”)); System.out.println(result); } } Output: a,b,c String.join import java.util.Arrays; import java.util.List; public class MyClass { public static void main(String[] args) { List list = Arrays.asList(“a”,”b”,”c”); String result […]
Access Javascript Nested objects or Attributes safely
Access Javascript Nested objects or Attributes safely It is very likely to get run time exceptions on trying to read value of undefined or null objects in Javascript. There are two ways we can solve this common development issue. The optional chaining operator, also known as the safe navigation operator, is a feature of ECMAScript […]
What is ChatGPT
ChatGPT is a language model, which was created and trained by OpenAI . ChatGPT uses a type of neural network called a transformer model. This type of model is designed to process sequential data, such as natural language text, and generate output that resembles human-generated text. It does this by learning to predict the next […]
ASCII Table
American Standard Code for Information Interchange is referred to as ASCII. An ASCII code is the numerical representation of a character, such as “a” or “@,” or an action of some kind because computers can only interpret numbers. Since ASCII was created so long ago, non-printing characters are now seldom ever utilized for what they […]
How Does RSA Encryption Work
A popular public-key cryptosystem for secure data transfer is RSA (Rivest-Shamir-Adleman). In addition, it is among the oldest. The surnames of Ron Rivest, Adi Shamir, and Leonard Adleman, who first publicly published the algorithm in 1977, are the origin of the abbreviation “RSA.” The English mathematician Clifford Cocks created a comparable method in secret at […]
Whats New in Spring Boot 3.0.0-RC1
This release includes 135 enhancements, documentation improvements, dependency upgrades, and bug fixes. Now, without requiring any particular settings, you can convert your Spring Boot applications to native executables using the regular Spring Boot Maven or Gradle plugins. This release also provides a new section in the reference documentation that explains the concepts behind ahead-of-time processing […]
List All Users in MySQL Database
Login to the database as root user mysql -u root -p Once you have logged in as root user, run the following command to list the user, host and encrypted password SELECT User, Host, Password FROM mysql.user; output : MariaDB [(none)]> SELECT User, Host, Password FROM mysql.user; +———-+———–+——————————————-+ | User | Host | Password | […]
Install PM2 on Ubuntu
Using yarn: yarn global add pm2 Using npm npm install pm2 -g Using debian apt update && apt install sudo curl && curl -sL https://raw.githubusercontent.com/Unitech/pm2/master/packager/setup.deb.sh | sudo -E bash –
Bubble Sort in Java
In bubble sort ,an array is traversed from first element to last element. Then, current element is compared with the next element. If current element is greater than the next element, it is swapped. public class BubbleSortExample { static void bubbleSort(int[] arr) { int n = arr.length; int temp = 0; for(int i=0; i < […]
What’s New in Kali Linux 2022.3?
Things to know about the latest Kali release. 1. New Tools Here are all the new tools that come with the release. BruteShark – Network Analysis Tool DefectDojo – Open-source application vulnerability correlation and security orchestration tool phpsploit – Stealth post-exploitation framework shellfire – Exploiting LFI/RFI and command injection vulnerabilities SprayingToolkit – Password spraying attacks against Lync/S4B, OWA, and O365 […]