Announcing Digestwave development

https://github.com/ruslanlesko/digestwave As you may remember from one of my previous articles, I was looking to start a new pet project. Now I am happy to announce that I am starting Digestwave: a news aggregator which doesn’t spy on you and allows adding new sources by committing into the source code. The goal of the project I am starting Digestwave to create a news aggregator which will include articles from websites I follow. Unfortunately, Flipboard or Apple News do not support any news sites from Ukraine. The solution should allow adding any website by publishing Pull Requests. Feel free to follow its development on the GitHub repo. Eventually, it will be available on this website: https://digestwave.com ...

October 6, 2021

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. With that in mind, I highly recommend this feature for all Java developers. ...

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. Indeed, I think that smartphones and other tech do make our vacation experience better when used appropriately. By appropriately, I mean not endlessly scrolling social media in an attempt to find some new memes. But it simplifies life a lot when you can carry only your phone to pay in the restaurant, take pictures in the forest or have a video call with relatives from a boat. ...

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.getFirstDirectoryOfType(ExifSubIFDDirectory.class); return exifDirectory.getDate(ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL); } public int parseOrientationDegrees(byte[] pictureData) throws ImageProcessingException, IOException { var metadata = ImageMetadataReader.readMetadata(new ByteArrayInputStream(data)); var exifDirectory = metadata.getFirstDirectoryOfType(ExifSubIFDDirectory.class); return exifDirectory.getInt(ExifIFD0Directory.TAG_ORIENTATION); } The examples above are very straightforward and do not perform any data validation. In the production code, you definitely should check the presence of required tags before extracting these attributes. ...

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.collect(Collectors.toList()) construction. ...

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 I - Interface Segregation Principle D - Dependency Inversion 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. And this blog is also protected by certificates issued by Let’s Encrypt (at the time this article was written). By upgrading to ECDSA Let’s Encrypt will be able to instantly upgrade lots of websites and services at once to the new standard. ...

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. Pet projects could also benefit from BrightonUM. ...

May 28, 2020