Mock an Autowired Value Field in Spring with Junit 5

Mock @Value In this example I am going to show you how to mock an autowired field in Spring boot framework with Junit 5. When you use @Value annotation in Spring beans to read the value from properties file and later when you want to perform Junit test then you also need to pass value for this autowired field value…

REST API CRUD Example in CodeIgniter 4 Framework

Here I am going to show you how to build REST web services in PHP based Codeigniter 4 framework. CodeIgniter 4 is the upcoming version of the framework and it is still under development, intended for use with PHP 7.2 or higher version. REST is an acronym that stands for Representational State Transfer (RESTful), which is an architectural style for…

How to merge multiple CSV files into one using Python

Introduction In this tutorial I am going to show you how to merge multiple CSV files into one in Python. I am using two CSV files for this example. You may need to merge multiple CSV files into one in some situations for your business requirements. Your different CSV files might have some common headers amongst them and when you…

Parallelism Example in Java Stream API

I am going to show you how to work with parallel stream in Java 8 or higher version of Java. In parallel computing a task is divided into sub-tasks and these sub-tasks are computed parallelly in each separate threads and finally the result of the solution for each sub-tasks is combined. One of the features for computing parallelism is to…

Spring Data JPA @NamedQuery and @NamedQueries Example

Introduction Spring Data JPA provides multiple ways of selecting or fetching data from database server and one of the ways is using @NamedQuery or @NamedQueries. @NamedQuery and @NamedQueries can be created using XML configuration, external properties file or using Java based annotation config. Spring Data JPA supports both JPQL and SQL native named queries. Here I am going to show…

How to use AJAX in React HTTP GET Request without using Third Party Library

Here I am going to show you how to use AJAX in React HTTP GET request without using Third Party library. To do this I am going to use XMLHttpRequest for fetching data instead of Fetch API (fetch()). AJAX is an acronym that stands for Asynchronous JavaScript and XML. The Fetch API provides an interface to fetch resources from the…

How to setup CodeIgniter 4 manually

Here I am going to show you how to setup CodeIgniter 4 manually in your local environment. CodeIgniter framework version 4 is still under development and its size has been reduced significantly from its previous version. CodeIgniter 4 framework is intended to work with minimum version of PHP 7.2. You can also check the installation guide for other ways. PHP…

Single and Multiple Files Upload Example in Django REST API

Most of the applications require at least one file needs to be upload for a reason, such as, for uploading bulk data or processing file data for business requirement. This example will show you how to upload single or multiple files using Django REST framework. REST is an acronym that stands for Representation State Transfer which works on http/https protocol….

How to avoid jQuery namespace collisions using noConflict() function

Here I am going to tell you how you can avoid namespace collision on the DOM (Document Object Model) page. You can load jQuery either via CDN (Content Delivery Network) link or by downloading the jQuery from the website and put it into your application and include in your web page. So whatever method you follow to use the jQuery…

What are jQuery selectors and how to cache jQuery selectors to improve performance of your web page

Every time you use a selector the elements in Document Object Model (DOM) are searched to match your query or selector. Doing this kind of works too often or repeatedly will decrease the performance of your web page. If you refer to a specific selector too often or repeatedly you should consider to add it to a cache by assigning…