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…
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…
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
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…
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…
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…
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…
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…
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…
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…