coding

useReducer and how it is different from useState

useReducer and how it is different from useState

Table of Contents Introduction When to Use useState When to Use useReducer Example 1: Counter App with useState Example 2: Counter App with useReducer Example 3: Form Input Handling with useReducer Example 4: Building a quiz app with useReducer Comparison Between useState and useReducer Conclusion React offers two key hooks for managing state: useState and useReducer. While both are designed to handle state in functional components, they are used in different scenarios. This article explores the differences between the two and highlights when you should use each, with examples for better understanding useState is a simple and effective hook for…
Read More
This is why i hate project based learning

This is why i hate project based learning

I've been programming for about two years at university, but I've been coding since before then. I used to think that project-based learning was the best way to learn quickly—after all, it teaches you to build things in a "real" and fast way. But over time, I've come to realize that this approach has its downsides. The Problem with Project-Based Learning In project-based courses, you often end up building the same type of projects as everyone else, following similar tutorials and structures. This means you’re learning how to build the same things that thousands of others are building, rather than…
Read More
Thunder Client Guide: The Ultimate Guide to Mastering Thunder Client CLI

Thunder Client Guide: The Ultimate Guide to Mastering Thunder Client CLI

In 2021, API testing was revolutionized with the launch of the Thunder Client extension for VS Code. This innovative tool was the first to introduce a GUI-based API client directly within VS Code, significantly improving the API testing experience. Building on that success, the Thunder Client CLI was introduced, a powerful command-line tool that further streamlines API testing for developers. Key Features of Thunder Client CLI Thunder Client CLI, available only in the paid version, offers an array of advanced features: Simple & Easy to Use: A straightforward CLI tool. Seamless Integration: Works seamlessly with the Thunder Client Extension. Run…
Read More
From Headlines to YouTube: Crafting an AI-Powered News Video Generator

From Headlines to YouTube: Crafting an AI-Powered News Video Generator

As content creation becomes more dynamic and competitive, automation tools powered by artificial intelligence (AI) are transforming the way creators, publishers, and news agencies generate media. In this tutorial, we’ll walk through how to build an AI-driven news video generator using SwarmZero AI and Livepeer AI. This system automates the process of fetching news, narrating it, generating visuals, and uploading engaging video summaries to YouTube. With a seamless pipeline that incorporates news aggregation, audio narration, image generation, and video editing, this project provides a versatile tool for creators looking to produce informative content with minimal manual effort. Overview of Our…
Read More
VS Code Just Made GitHub Copilot Even Smarter: Just Drag And Drop File

VS Code Just Made GitHub Copilot Even Smarter: Just Drag And Drop File

GitHub Copilot Chat in VS Code has received a significant usability upgrade that streamlines how developers can share code context.You can now simply drag and drop files directly into the chat - no more copy-pasting or typing file paths! What's New?The latest VS Code update introduces a drag-and-drop functionality for GitHub Copilot Chat.This feature allows you to: Drag individual files into chat Drop entire folder for context Get immediate code analysis and suggestions based on the dropped content Why This MattersPreviously or before this feature, sharing code context with Copilot Chat requires either: Manually copying and pasting code snippets Using…
Read More
Abstraction: Decoding Abstract Classes in Java

Abstraction: Decoding Abstract Classes in Java

In this post, we explore Abstract Classes, an essential part of abstraction in Java. We'll build on concepts discussed earlier and examine how abstraction simplifies complex systems. Abstract classes serve as a blueprint for other classes, allowing us to focus only on relevant details while hiding unnecessary complexity. Let’s dive deeper into what abstract classes are, why they exist, and how they are used. What is an Abstract Class? An abstract class is a class that cannot be instantiated on its own. It’s designed to be extended by subclasses that provide concrete implementations for its abstract methods. In other words,…
Read More
Update the Latest Data in a CSV File to the Database #eg66

Update the Latest Data in a CSV File to the Database #eg66

Problem description & analysis Below is CSV file emp.csv: EMPID,FIRSTNAME,LASTNAME,EMAIL,UPDATEDATE 123,John,Smith,john.smith01@email.com,01/01/2020 234,Bruce,Waye,bruce.wayne@wayneenterprises.com,02/02/2020 123,John,Smith,john.smith02@email.com,02/15/2020 345,Clark,Kent,clark.kent@dailyplanet.com,02/16/2020 123,John,Smith,john.smith03@email.com,02/20/2020 In the above file, UPADATEDATE field is ordered and EMPID field contains duplicates. We are trying to divide records in the CSV file into two parts: Write the newest employee records, which are those with the latest UPDATEDATE values after the file is grouped by EMPID, to EMP table; Write the rest of the records, which are the difference, to EMP_HIS table according to the original order. Solution Write the following script p1.dfx in esProc: Explanation: A1  Import data from the CSV file, during which…
Read More
Deploying a Spring Boot Banking Application with Docker

Deploying a Spring Boot Banking Application with Docker

Containerizing applications is becoming increasingly important. In this guide, I'll walk you through deploying a Spring Boot banking application using Docker, first manually and then with Docker Compose. We'll cover everything from setting up the environment to running the application in containers. Prerequisites Before we begin, make sure you have: An AWS Account An Ubuntu EC2 instance (t2.medium) Docker installed Docker Compose installed Basic understanding of Spring Boot and MySQL (I already used vagrant box my local environment) Project Overview Our banking application is built with: Spring Boot (Java) MySQL Database Maven for build management Docker for containerization Setup My…
Read More
Desktop Shortcut for Adjust ClearType Text in Windows 11

Desktop Shortcut for Adjust ClearType Text in Windows 11

Adjust ClearType Text in Windows 11 is a useful feature from Microsoft that fine-tunes the fonts when connected to an external display for Screen Mirroring, Extended Displays , etc. Whether you are connecting your Windows 11 Laptop or PC to a Dell, HP, or Asus Monitor or Sony, Samsung LCD, or LED TV , Adjust ClearType Text can sharpen and smoothen the Fonts as per the user’s convenience. In this article, we will check out How to create a Desktop Shortcut for Adjust ClearType Text in Windows 11 using simple steps. We have an article explaining ClearType Text in Windows…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.