Automate Java files formatting with IntelliJ IDEA

IntelliJ IDEA added one cool feature in their 2021.2 release: the ability to add actions when saving files. The most useful use-case is applying automatic reformatting and optimizing the imports. To enable that, go to Preferences -> Tools -> Actions on Save and select all required actions. Well-formatted code is a key factor in readability in large teams. Unless you are working alone on some pet project, you want consistency in code style across your codebase....

September 23, 2021
Me sitting on the chair in the forest

Finding project ideas in the forest

As daily work becomes routine, it can be hard to open your mind to fresh ideas. It was one of the reasons for me to take an unexpected vacation in the forest. I am currently in the process of finding a new pet project. And I changed my surroundings dramatically from the loud and quick city to the calm nature to boost the creative parts of my mind. I am not going to advocate for notifications-free vacation or other anti-technology ideas....

September 22, 2021

Parsing picture metadata in Java

If your system supports images, then most likely you need to extract some metadata from them on the back-end. Luckily for you, Drew Noakes has just the right library for that: metadata-extractor. Adding to dependencies Maven <dependency> <groupId>com.drewnoakes</groupId> <artifactId>metadata-extractor</artifactId> <version>2.16.0</version> </dependency> Gradle dependencies { implementation 'com.drewnoakes:metadata-extractor:2.16.0' } Example of fetching picture capture date and orientation public Date parseDateCaptured(byte[] pictureData) throws ImageProcessingException, IOException { var metadata = ImageMetadataReader.readMetadata(new ByteArrayInputStream(data)); var exifDirectory = metadata....

August 5, 2021

Java 16 release: non-LTS, incremental upgrade

Java 16 just got released. It is not a long-term support (LTS) version, so I don’t recommend upgrading your applications to this version, given LTS Java 17 will be available in late 2021. But I recommend at least getting familiar with the changelog since Java 17 will contain them as well. Most users won’t notice various internal improvements, so I’ve picked the following most interesting changes: Introduced Stream.toList() method which will simplify collecting the stream to list operation, which is very common and currently done via Stream....

March 20, 2021

SOLID Principles Explained

During the lifespan of software engineering, professionals created a lot of best practices and principles. Some of them were expressed as patterns, and some of them have evolved into abbreviations like DRY (Don’t Repeat Yourself). In this article, I will focus on SOLID: a set of 5 principles (mainly applicable to object-oriented programming) for articulating design issues and solutions. S - Single Responsibility Principle O - Open/Closed Principle L - Liskov’s Substitution Principle...

November 25, 2020
GitHub Actions logo

Trying GitHub Actions

A few months ago, GitHub rolled out their own CI solution called GitHub Actions. Since I host my PalermoPG and BrightonUM projects on GitHub, I decided to try it. What is CI? Continuous Integration (CI) is a development practice where developers integrate code into a shared repository frequently, preferably several times a day. It also involves verification by an automated build and tests. While automated testing is not strictly part of CI, it is typically implied....

October 18, 2020

Let's Encrypt introduces new certificates

Let’s Encrypt’s New Root and Intermediate Certificates We don’t hear updates on encryption technologies very often, but recently Let’s Encrypt, a major certificate authority (CA), has introduced new types of certificates. These certificates use ECDSA encryption algorithm instead of RSA. The main difference is size. RSA public key is about 256 bytes long when ECDSA P-384 public key is only about 48 bytes preserving the same level of security. Let’s Encrypt is provides free certificates with good tools for their refresh, that is why it is so popular....

September 21, 2020
PalermoPG logo

Introducing PaleromPG

https://github.com/ruslanlesko/palermopg Today I launch my second open-source project: PalermoPG. It is a server for the picture gallery. PalermoPG is also a back-end which powers AirPicHub. With PalermoPG you will be able to create a self-hosted picture gallery using your custom front-end solution (web or mobile). API is documented in the readme file on GitHub. PalermoPG is powered by Java and uses Vert.x as a web and asynchronous library. The database supported is MongoDB....

July 20, 2020
BrightonUM logo

BrightonUM project release

https://github.com/ruslanlesko/brightonum I have released BrightonUM as an open-source project on GitHub. It is a simple authentication and user management system, which was primarily developed for my other project - AirPicHub. Its main feature is that it is lightweight and simple. BrightonUM uses signed JWT access tokens for proving user authentication and does not support the OAuth2 protocol. I have created it specifically for such small projects which don’t require sophisticated features like OAuth2 support....

May 28, 2020

Java moves to native. Now with Project Leyden

Project Leyden Aims to Improve Java Startup Time Mark Reinhold, Java architect, recently proposed to start work on a new project to improve Java startup time and performance: Project Leyden. As we know, the best way to do that is to make Java apps run natively. GraalVM offers similar capabilities, but it is more about interoperability with other programming languages. I think the main goal of Project Leyden will be the ability to compile the application for a specific operating system, using its native libraries thus improving startup and runtime....

May 21, 2020