Posted in Kotlin

Finding Start and End Index of an element in a sorted Array using Kotlin

Finding start and end index of an element in a sorted array using Kotlin programming language will be shown here. The array may contain duplicate elements and we will see how to find a start and end index for an element in this array elements. We may design the algorithm for finding start and end index of an element in…

Continue Reading... Finding Start and End Index of an element in a sorted Array using Kotlin
Posted in Liquibase Spring Boot

How to setup Liquibase in Spring for Multiple DataSources

Introduction In this tutorial I will show you how to setup Liquibase in Spring for multiple datasources. In my previous tutorial I had shown how to setup multiple datadources in Spring Boot application. Here also I am going to create a Spring Boot application to define multiple datasources and will use these datasources into Liquibase. I had created examples using XML…

Continue Reading... How to setup Liquibase in Spring for Multiple DataSources
Posted in Design Pattern Java

SOLID Design Principle Explained with Java

Introduction SOLID design principle is one of the most popular set of design principles in object-oriented software development. It’s a mnemonic acronym for the following five design principles: S – Single Responsiblity Principle O – Open Closed Principle L – Liskov Substitution Principle I – Interface Segregation Principle D – Dependency Inversion Principle

Continue Reading... SOLID Design Principle Explained with Java
Posted in Python

Real Time Face Detection in Webcam using Python 3

Introduction Real time face detection in webcam using Python 3 will show you how your working webcam detects your face and draws a rectangle around your face. In my previous tutorial we have seen how you see yourself in webcam using Python. The similar tutorial we will use here to detect your face and draw a rectangle around it to…

Continue Reading... Real Time Face Detection in Webcam using Python 3
Posted in Spring Boot Spring JDBC

Define Multiple DataSources in Spring Boot

Introduction This tutorial will show you how you can define multiple datasources in Spring Boot application. I had shown how to define multiple datasources in Spring application, but here I will define multiple datasources in Spring Boot application. There may be situations where you need to define multiple datasources in Spring Boot application. For instance, you may need to define…

Continue Reading... Define Multiple DataSources in Spring Boot
Posted in Junit

Mock ObjectMapper.readValue() using Junit Mockito

Introduction This example will show you how to mock ObjectMapper.readValue() using Junit Mockito. When we write Junit test cases or classes, we generally do not test on real object that are injected into the class that has to be tested using Junit to avoid any test case failure at some point, instead we want to test the business logic out…

Continue Reading... Mock ObjectMapper.readValue() using Junit Mockito
Posted in Python

See Yourself in Webcam using Python 3

Introduction The tutorial, see yourself in webcam using Python 3, will show yourself in front of the webcam as a video motion. In this example we will capture the video in front camera in the same way you see yourself in front of the mirror. Make sure you do have the camera installed in your system in order to see…

Continue Reading... See Yourself in Webcam using Python 3
Posted in Junit

Mock an Autowired @Value field in Spring with Junit Mockito

Mock @Value Field The below example will show you how to mock an Autowired @Value field in Spring with Junit Mockito. Generally you read some configuration values from properties file into Spring bean or component class using @Value annotated attributes but when you want to test such service or component class using Junit test class then it is required to…

Continue Reading... Mock an Autowired @Value field in Spring with Junit Mockito
Posted in MySQL Python

Call Stored Procedure using Python

Introduction This tutorial will show you how to call stored procedure using Python programming language. Here I will use MySQL database server to store the data for this example. You may also want to read How to call stored procedure using Codeigniter framework. A stored procedure is a set of Structured Query Language (SQL) statements with a given name so…

Continue Reading... Call Stored Procedure using Python
Posted in Gradle Spring Boot

Utility classes should not have a public or default constructor – Spring Boot

Introduction The error, utility classes should not have a public or default constructor, you notice mainly in utility classes where you have declared your class method(s) as public static and your class does not have private constructor as well as your class cannot be made as final. This error occurs due to the checkstyle rules defined generally in checkstyle.xml that is…

Continue Reading... Utility classes should not have a public or default constructor – Spring Boot