Simple algorithm for casting strings to double

This article describes a method for converting incorrectly formatted numeric strings in CSV files into doubles by replacing commas with dots and handling various input errors, complemented by a Java util class implementation and tests.

Continue reading

Posted in Solutions | Tagged , , , | Leave a comment

How to make multipart requests with file and object through autogenerated code defined in OpenAPI

This article explains creating a Spring Boot endpoint using OpenAPI to receive objects and, optionally, files through multipart form data, focusing on deserialization and validation of incoming objects.

Continue reading

Posted in Solutions | Tagged , , , , , , , , , , , , , | Leave a comment

How to make multipart requests with files through autogenerated code defined in OpenAPI

This article provides a clear tutorial on generating code infrastructure defined OpenAPI schema for your custom Spring Boot application and handling multipart file uploads through an autogenerated REST endpoint.

Continue reading

Posted in Solutions | Tagged , , , , , , | Leave a comment

How to compile and run Java files on Windows

From time to time, you get into a situation you need to compile and run your Java code, and instead of using any build tool or IDE, you need to do it manually. If you are engaged in software development or writing automated script writing, compiling and executing code from the Windows console should be straightforward and effortless.

Continue reading

Posted in Language basics | Tagged , | Leave a comment

Java concurrency interview conversation about passing shared variables to threads

During one interview, I got a pretty nice Java concurrency interview question. It was more or less a conversation between me and the interviewer about how Java handles Threads and passing references, plus ideas on solving concurrency pitfalls.

Let’s take a while and simulate such a conversation so you can be prepared for your next Java concurrency interview.

Continue reading

Posted in Java Concurrency | Tagged , , | Leave a comment

7 different ways how to get NumberFormatException in Java

If you get NumberFormatException in Java, it is highly probable because of the following reasons. This article will uncover the NumberFormatException, how you are getting it and what you should do to handle the exception properly.

Continue reading

Posted in Language basics | Tagged , , , | Leave a comment

How to figure out if a character in a string is a number

This article will show how to figure out if a character in a string is a number. You might be wondering how to do it. There are multiple ways to determine if an individual or series of characters in the string classify as a number. So let’s look at various approaches for determining if the character is a number.

Continue reading

Posted in Tips & tricks | Tagged , , , , , , | Leave a comment

Developer Notes 001

This article selects a few developer notes collected during the software development, which were unfortunately not enough for a self-standing article.

Continue reading

Posted in Tips & tricks | Tagged , , , , , , , , , , , | Leave a comment

How To Turn Number To String With Padded Space or Zeroes

This article will show us how to turn numbers into the String with padded space or numbers.

Continue reading

Posted in Tips & tricks | Tagged , , , | Leave a comment

Flattening Stream Collections in Java

This article is about Java 8 stream feature flatMap. If we have a List<List<Object>>, how can we turn the list of lists into a single list that contains all the elements from the lists in the same streamflow using the features of Java 8?

Continue reading

Posted in Language basics | Tagged , , | Leave a comment