Posts

Running a Maven Web Application in IntelliJ with Tomcat

Image
Running a Maven Web Application in IntelliJ with Tomcat Running a Maven Web Application in IntelliJ with Tomcat Step 1: Configure Tomcat in IntelliJ Go to File → Settings → Build, Execution, Deployment → Application Servers . Click + → Select Tomcat Server (Local) . Point IntelliJ to your Tomcat installation folder. Step 2: Create a Run/Debug Configuration Go to Run → Edit Configurations . Click + → Select Tomcat Server → Local . Under Deployment , click + → select Artifact . Choose your WAR file ( dbsample:war exploded ) → OK. Name the configuration (e.g., Tomcat-dbsample ). Step 3: Run the Application Click the green Run ▶️ (or Debug 🐞) button. IntelliJ will start Tomcat and deploy your dbsample app automatically. Open your browser and go to: http://localhost:8080/dbsample ✅ That’s it! You now have your Maven Webap...

How to Remove a File or Folder from Git Without Losing It Locally

How to Remove a File or Folder from Git Without Losing It Locally How to Remove a File or Folder from Git Without Losing It Locally Safely untrack sensitive or noisy files (like .env ) from your repository while keeping them on your machine. When working on projects, you often have files that shouldn’t be tracked by Git , such as .env files containing sensitive credentials or configuration data. Committing these files can expose secrets and clutter your repository. But what if they are already tracked? You can safely remove them from Git while keeping them on your local machine . Here’s how. Remove the file from Git index Use the --cached option to untrack the file: Copy git rm --cached .env --cached tells Git to remove the file from version co...

Go lang beginner

 Refer this gemini ai chat  https://g.co/gemini/share/94543a909b60

Flutter beginner roadmap

  📘 Step 2: Learn Dart Fundamentals You can try this in an online DartPad: https://dartpad.dev/ 🔹 Basic Concepts: Variables & Data types Functions Conditionals and Loops Classes and Objects Null safety Collections (List, Set, Map) Would you like me to start with Dart basics now? 📱 Step 3: Learn Flutter Basics After Dart: Understand widgets ( StatelessWidget , StatefulWidget ) Layouts: Column , Row , Container , Padding Navigation between screens Forms & Input handling HTTP calls & local storage 🔁 Step-by-Step Practice Plan Day Topic Outcome 1 Dart Basics Variables, Loops, Functions 2 OOP in Dart Classes, Constructors 3 Flutter Setup + Hello World First app on emulator 4 Widgets & Layouts Design simple UI 5 State Management (setState) Counter app, input fields 6 Navigation + Routes Multi-screen app 7 API Calls (http) Fetch & display data 8+ Project/Component Development Build real features

Creating and Publishing the text2numR Package: Step-by-Step Guide

Image
I recently tried creating a simple R package— text2numR —with the help of ChatGPT. The process was surprisingly smooth and educational, especially for someone new to R package development. You can check out the finished project here: hasindu-k/text2numR . Let’s walk through how it was done, step by step:   🔧 Step 1: Start a New Package Project Open RStudio Navigate to: File > New Project > New Directory > R Package Choose a name for your package (e.g., text2numR ) Click "Create Project" 🖋️ Step 2: Add Your Functions Create your R function files inside the /R folder: encode_text.R #' Encode a string into numeric positions #' #' @param text A character string #' @return A numeric vector #' @export encode_text <- function(text) { chars <- strsplit(tolower(text), "")[[1]] match(chars, letters) } decode_text.R #' Decode numeric positions into a string #' #' @param nums A numeric vector #' @return A character strin...

Terminal commands relared to files in the Ubuntu

 🔍 Viewing and Navigating Files Command Description ls List files and directories in the current directory ls -l Long listing (with permissions, size, date, etc.) ls -a Show hidden files (those starting with . ) cd [directory] Change directory pwd Print current working directory tree View directory structure in tree form (may need sudo apt install tree ) 📁 Creating and Managing Files Command Description touch filename Create a new empty file nano filename Edit a file using nano text editor cat filename View file contents more filename / less filename Scroll through file contents cp file1 file2 Copy a file mv oldname newname Rename or move a file rm filename Delete a file rm -i filename Delete with confirmation rm -f filename Force delete without confirmation 📂 Working with Directories Command Description mkdir directory_name Create a directory mkdir -p path/to/directory Create nested directories rmdir directory_name Remove empty directory rm -r directory_name Remove direc...

Development-Testing Workflow

Follow this cycle during development: When creating a new feature : First write the factory for any new models Then write the feature test (even before the controller) Implement the controller to make the test pass When modifying a feature : First update the relevant factory if model changes Then update/add tests for the new behavior Finally implement the code changes