Author: Editorial Team
-
Kafka Producer Acknowledgement Explained – with Spring Boot Configuration
Introduction When developing applications that communicate with Apache Kafka, it’s essential to understand how message delivery works, especially when reliability and durability are important. Kafka provides a range of options that allow you to fine-tune how the producer waits for acknowledgements from the brokers. This tutorial dives deep into how acknowledgements work in Kafka and…
-
Spring Security and React – Form Login
Introduction In this tutorial, we’ll create a React application and a login form. We’ll use this login form with Spring Boot application with security to login the application. Create Spring Boot Project Following is the Spring Boot project structure: SecurityConfig.java LoginRequest.java AuthController.java Create a React application Create your React application. Following are the important components:…
-
Login with Github with Spring Boot and React JS
Introduction In today’s digital landscape, allowing users to log in using their existing Google or GitHub accounts can greatly enhance the user experience while improving security. In this tutorial, we’ll walk you through integrating OAuth2 login with Google and GitHub in a full-stack application using Spring Boot for the backend and React JS for the…
-
Iterator Design Pattern in Java
What is the Iterator Pattern? The Iterator Design Pattern provides a way to access the elements of a collection sequentially without exposing the underlying representation (e.g., list, stack, tree, etc.). It falls under the Behavioral Design Patterns category. Provide a standard way to traverse through a collection of objects one at a time without exposing…
-
Merge Sorted Array
Problem Statement You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively. Merge nums1 and nums2 into a single array sorted in non-decreasing order. The final sorted array should not be returned by the function, but instead be stored inside the array nums1. To accommodate this, nums1 has a length of m + n, where the first m elements…
-
Java ArrayDeque
What is ArrayDeque? ArrayDeque (Array Double Ended Queue) is a resizable-array implementation of the Deque interface in Java. Key Features: Where is it defined? It is part of the Java Collections Framework, available since Java 6. Class Declaration Constructors Constructor Description ArrayDeque() Creates an empty deque with initial capacity 16 ArrayDeque(int numElements) Creates a deque…
-
Queue Data Structure
What is an Abstract Data Type? An abstract data type (ADT) defines the behavior of a data structure—what operations it supports and how they behave—but it doesn’t define how it’s implemented. For example, a Queue ADT can be implemented using: So think of ADT as a blueprint or a contract that can be implemented in…
-
How to avoid deadlocks in database transaction?
What is a Deadlock? A deadlock occurs when two or more transactions are waiting for each other to release locks, and neither can proceed. Oracle automatically detects deadlocks and kills one transaction, but that’s a last resort. Example of a Deadlock: They’re both stuck — deadlock. Best Practices to Avoid Deadlocks in Oracle 1. Always…
-
useLayoutEffect
useLayoutEffect is a version of useEffect that fires before the browser repaints the screen. useLayoutEffect can hurt performance. Prefer useEffect when possible. References useLayoutEffect(setup, dependencies?) Call useLayoutEffect to perform the layout measurements before the browser repaints the screen. Parameters Returns useLayoutEffect returns undefined. Caveats Use Cases for useLayoutEffect Here are common and practical scenarios where…
-
What is Windowing Technique in React?
When building React applications that deal with large lists, rendering every item at once can lead to poor performance, sluggish UI, and high memory consumption. This is where the windowing technique comes in. Windowing is a performance optimization technique that only renders a subset of items visible in the viewport and a small buffer (the…
