How to create Custom Immutable Class in Java

Introduction In this tutorial I am going to show you how to create a custom immutable class in Java programming language. Immutable objects are those objects whose states cannot be changed. For example, you can change the state of an object by changing its attribute’s or field’s value. String is an example of the immutable class in Java. There are other examples of immutable class in Java, such as, all primitive wrapper classes are immutable classes – Integer, Byte, Long, Float, Double, Character, Boolean, Short. In Java 8, the Date…

Continue

How to deal with Whitelabel Error Page in Spring Boot Applications

In this tutorial I am going to discuss about what is Whitelabel Error Page and how to deal with Whitelabel Error Page in Spring Boot applications. Spring boot allows you to setup a Spring based application with minimal configurations. Spring MVC applications provide no default (fall-back) error page out of the box but Spring Boot based applications provide a fall-back error page for handling errors. If you want to handle error in Spring based application then you have to set the default error page using SimpleMappingExceptionResolver. When an error or…

Continue

CodeIgniter 4 Transaction Example

Introduction Here I am going to show you an example on CodeIgniter 4 transaction using MySQL database server. You know that transaction is an important part of persistence storage system because you may save, update or delete data from persistence storage any time. When you perform execution of multiple statement across different database or tables or any external system then it is recommended to use transaction otherwise your data may be saved in an inconsistent state. For example, in database you may need to update multiple tables or you may…

Continue

How to display WordPress Popular Posts based on Views

You may want to display popular posts widget in your WordPress site. It serves as a great way to introduce your readers to the most popular contents. The contents you want to show may be posts or pages. Here I am going to show you how you can track and display most popular posts. Having most popular posts displayed on your sidebar widget, it increases the page views and reduces the bounce rate. There are number of plugins available for WordPress CMS (content management system) but there are number of…

Continue

Spring Cloud Bus Example

Here I am going to build an application to show how to use Spring Cloud Bus. Let’s say you have multiple applications reading properties using Spring Cloud Config from centralized configuration files (for example, from Git repository). Spring Cloud Config is where you can have not only your all configurations centrally managed but also you can refresh them dynamically and which in turn can be picked by your referencing applications from the very next moment. So in central configurations using Spring Cloud Config, for each module if there is any…

Continue

React CRUD Example with CodeIgniter 4 and MySQL 8

In this tutorial I am going to show you how to build CRUD application using CodeIgniter 4, MySQL and React JS framework. CRUD is an acronym that stands for Create, Read, Update and Delete operations in a particular application. So you are basically creating a record, reading single or all records, updating the existing record and deleting the existing record. In this React CRUD example with Codeigniter 4 and MySQL, I am using React JS as a front-end technology used for building the UI (User Interface), PHP based CodeIgniter 4…

Continue

How to encrypt PDF as Password Protected File in Python

Here I am going to show you an example how to encrypt PDF to make it password protected using PyPDF2 module in Python programming language. I am not going to show you how to create a new PDF file in this example and I am going to read the existing PDF file and making this PDF file password protected. It is a good idea to make the PDF password protected when you want to send some sensitive data into the PDF file over the network, such as, email or you…

Continue

How to watermark Image with Text using Python

Introduction In this tutorial I am going to show you an example on how to watermark image with text using Python. You might have seen somewhere online portal or social network portals that some images are watermarked, because the owners of the images want to prevent misuse of the images. Here I am going to show you how you can place the text watermark on different places, for example: right bottom, center, on top of the image. I will also show how to change the color of the watermarked text…

Continue

Online Visitor Tracking System using CodeIgniter 4, MySQL 8 and AJAX

In this tutorial I am going to show you how you can build an online visitor tracking system using PHP based framework CodeIgniter 4, MySQL 8 and AJAX technique. The similar system for tracking online visitors on web site, I built in past, using CodeIgniter 3 framework. As a web site owner you would like to the progress to the count of your visitors, page views, etc. because, it gives you overall idea on the website’s analytical measurements. It will also give you how you can make improvements to your…

Continue