Friday, May 29, 2026

Digital Twin- Whatsapp AI chatbot for Teachers

 Q: Increasing use of AI in human life has caused productivity gains and also increased the ease of subversion.. its easy to cheat in research, its easy to get past the hurdles erected for a cause.. I was wondering if AI can lead humans to work better.. I mean in the sense of redefining work and the measures to it

That's a genuinely fascinating question — and it cuts right to the heart of what work is for.

The Core Tension

AI doesn't just automate tasks — it dissolves the friction that many systems relied on as a proxy for quality. Essay word limits, research citation effort, interview preparation, code-from-scratch tests — these were never perfect measures, but they were correlated with the thing we actually cared about. AI breaks that correlation.

So the question becomes: were we measuring the right things, or just the measurable things?


Where AI Forces Better Definitions of Work

1. From output to judgment When anyone can generate a decent first draft, the scarce skill becomes knowing what good looks like — curation, critique, taste. A researcher who can evaluate 50 AI-generated hypotheses is more valuable than one who laboriously writes 5. Work shifts from production to discernment.

2. From compliance to contribution A lot of institutional work is really legibility theater — showing that you did the thing in the approved way. AI exposes how hollow this is. What survives is work that creates something genuinely new or contextually irreplaceable — local knowledge, relational trust, ethical judgment calls, embodied skill.

3. From individual heroics to system design If AI handles execution, humans become more responsible for framing the problem correctly. Bad prompts, bad briefs, bad questions — these become the bottleneck. This is actually a more intellectually honest form of work.

4. From gatekeeping to genuine standards Cheating in research is only easy if the gate was arbitrary to begin with. If the test was "can you write a literature review," AI breaks it. If the test is "can you defend your intellectual choices in a live conversation," it doesn't. AI pressure-tests which standards were real.


The Harder Problem: Institutional Lag

The risk isn't that humans can't work better — it's that institutions will patch rather than reimagine. Plagiarism detectors instead of better assessment. AI bans instead of AI-integrated workflows. The subversion you're describing is often a symptom of measures that were already gameable; AI just lowers the cost of gaming them.

The deeper question is whether institutions have the incentive to redefine work honestly — because better definitions often mean less control for the measurer, not more.


What "Working Better" Might Actually Look Like

  • Slower, richer evaluation — fewer deliverables, deeper accountability for each
  • Process transparency over output polish — showing your reasoning, not just your conclusion
  • Collaborative sense-making — humans + AI as a unit being evaluated, not humans pretending AI doesn't exist
  • Longitudinal trust — reputation built over time rather than performance in discrete assessments

The optimistic read is that AI could force a long-overdue reckoning: we've been measuring proxies for decades, and now those proxies are cheap. That's uncomfortable, but it's clarifying. The question is whether we use that clarity to build better systems — or just better-defended proxies.

What domain are you thinking about most — research, education, corporate work, something else? The answer shifts quite a bit depending on the context.

Q: education.. Here in India educators have tough time dealing with students and their inquisitive being.. they are distracted and short of rest, low attention span.. the same problems everyone is going through.. I was thinking of a personal chatbot interface that schedules a teachers itinerary.. students report their problems .. its converted to a form more palatable to the teacher and his plans of the day/week/semester etc. I have created an android app that initiates a chat with anonymous numbers without saving them.. via linking whatsapp with chrome in the machine where the app is installed. I want to take it further by responding autonomously.. and report to me if anything needs attention. Like a digital twin.

This is a really elegant idea — a digital twin for a teacher that absorbs the noise from students, filters and prioritizes it, and only surfaces what genuinely needs human attention. Let me think through this with you.


What You're Describing, Architecturally

Student (WhatsApp) → Your Android App → AI Layer → Teacher Dashboard
                                           ↓
                               Autonomous responses
                               + Escalation alerts
                               + Itinerary integration

The AI layer is doing four jobs:

  1. Receiving student messages (already solved by your app)
  2. Understanding intent — doubt, complaint, anxiety, scheduling, personal issue
  3. Responding autonomously where it can
  4. Escalating intelligently when it can't

The Classification Problem (Most Important)

The first thing the AI needs to do is triage every incoming message:

Category Example Action
Academic doubt "I don't understand chapter 4" Answer autonomously
Deadline/schedule "Can I submit late?" Check itinerary, respond
Emotional distress "I'm overwhelmed, can't cope" Flag immediately to teacher
Conflict/sensitive "Sir behaved unfairly" Escalate with full context
Logistics "What's tomorrow's topic?" Answer autonomously
Unclear/ambiguous Vague one-liners Ask a clarifying question

Getting this classification right is the core of the system.


Building on What You Have

Since you already have the WhatsApp↔Chrome bridge and anonymous number handling, the next layer is essentially a webhook + AI pipeline:

  1. Message comes in → your app captures it
  2. POST to a small backend (could be a simple Python Flask/FastAPI server)
  3. Backend calls Claude API with:
    • The message
    • The teacher's current itinerary/context
    • Conversation history for that anonymous number
    • Classification instructions
  4. Claude returns: category + suggested response + escalation flag
  5. If no escalation: reply goes back through WhatsApp automatically
  6. If escalation: you get a summary notification (WhatsApp/email/dashboard)

The "Digital Twin" Depth

The richer the teacher's context you feed it, the better it behaves:

  • Syllabus + weekly plan → it knows what's been taught and what's coming
  • Past escalations → it learns what this teacher considers important
  • Time of day/week → it knows not to promise "I'll discuss tomorrow" on a Friday
  • Exam proximity → it raises the sensitivity threshold as exams approach

This is essentially a RAG (Retrieval Augmented Generation) setup where the teacher's world is the knowledge base.


What Would You Want to Build First?

A few natural starting points depending on your comfort:

  • The classification + auto-response engine — pure API work, buildable today
  • A simple teacher dashboard — shows all conversations, flagged ones highlighted
  • The itinerary integration — Google Calendar or a simple JSON the teacher updates
  • The escalation reporter — daily digest: "Here's what happened, here's what I handled"

What's your current stack? (The Android app — is it Java/Kotlin? And are you comfortable with Python on the backend side?) That'll shape what's fastest to build next.

Tuesday, May 26, 2026

Constraint Solver in C-Layout (CLAY) as a morphing tool

 Q:I have dipped fingers in multiple tasks and come cropper in many.. I have a new one. I was watching the CLAY layout software tutorials and had my own ideas about how transitions should be handled in websites. I feel loading a page when user blanks out should be minimized. There are multiple(or at least 3 passes) in CLAY where the iterations are performed and only then sizing is determined. I want some part of this to appear as morphing during rendering.. so that viewers have a good idea of what is coming next. I also want important part of the view to display early.

This is a genuinely interesting idea. You're essentially describing a philosophy where the browser's natural multi-pass layout process (which CLAY makes explicit) becomes visible as a feature — a kind of "honest rendering" that guides the user's eye before the final frame settles.

Let me build a live demo that shows this concept in action: important content surfaces first (priority rendering), then secondary elements morph into their final positions as layout resolves.Hit run layout passes to see it animate. Here's what the demo is expressing:



Pass 0 — measure only. Like CLAY's first iteration, the browser is figuring out constraints. Nothing is committed yet — everything is skeletons. This is where you'd do your "blank out" detection too: if the user isn't looking, you can safely defer.

Pass 1 — priority surfaces. The hero title and body text appear first, before images or secondary panels. Readers orient to what the page is about before anything else settles. This is the key insight — the visual hierarchy signals intent early.

Pass 2 — secondary structure. Sidebar items morph in with a slight slide. They were always going to be there — now the layout tells the user that before the full weight of images has loaded.

Pass 3 — tertiary cards settle. These could even be deferred behind requestIdleCallback — they're low priority, and by the time they resolve the user has already understood the page.

The core mechanism you'd implement for real:

  • Intersection Observer + document.visibilityState to detect blanking out, and pause/defer non-priority loading
  • Skeleton → morph via CSS transitions on opacity + transform: translateY — not abrupt swaps
  • A priority attribute on your layout nodes (inspired by CLAY's constraint model) that determines which pass a block belongs to
  • Optionally: expose the pass-coloring as a dev overlay (like CLAY does) so you can see the layout budget at a glance

Want me to build this out as actual implementable JS/CSS — something you could drop into a real page?

Sunday, May 10, 2026

Pacman Net

 

Pacman Net

A distributed Pacman game implementation with a Qt/C++ client, a C++ server,

RabbitMQ message queuing, and Google Protocol Buffers for event serialization.

🎮 Built a distributed Pacman game from scratch — C++ server, Qt OpenGL client, RabbitMQ + Protocol Buffers over the network.

The idea started simple: take a classic OpenGL Pacman game and split it into a headless game server and a remote viewer. The server runs all the ghost AI and physics at 60fps, serializes the full game state using Google Protocol Buffers, and publishes it to a RabbitMQ fanout exchange. Any client that connects gets a live stream of the game and can send keystrokes back.

Stack:

→ C++ server (no Qt, no display)

→ Qt 6.4 + QOpenGLWidget client with legacy fixed-function OpenGL

→ RabbitMQ (Docker) as the message broker

→ Google Protobuf v3.21 for binary serialization

→ Custom blocking TCP handler for AMQP-CPP (no Boost/libuv)

→ CMake + MinGW on Windows


The build journey was its own adventure — MinGW ABI mismatches, protobuf abseil dependency hell, Winsock header ordering, and PATH conflicts between three different gcc installations. Hard lessons learned about keeping compilers consistent across all dependencies.


Code on GitHub(link below)

#CPlusPlus #OpenGL #Qt #RabbitMQ #Protobuf #GameDev #DistributedSystems #ComputerGraphics



- `client/` runs the Pacman game UI, publishes game events to RabbitMQ, and sends
    user input/events to the server.
- `server/` logs events from message queues and can process game-related messages.
- `proto/` contains the Protocol Buffers schema and generated C++ protobuf sources.
- `shared/` contains shared game constants and logic used by both client and server.

This is the game running:


Github link: LINK

 Note: some paths are hardcoded so it won't clone-and-run immediately, but the architecture and all source files are there.


Tuesday, March 31, 2026

Vertex Shader vs Fragment Shader Explained (With Simple Example)

 Introduction

Vertex and fragment shaders are essential, programmable GPU stages in modern 3D graphics pipelines. Vertex shaders manipulate geometry (position, deformation), while fragment shaders determine pixel color, lighting, and textures. They are necessary for creating custom visual effects, dynamic lighting, and efficient, GPU-accelerated rendering.

Vertex Shaders (Geometry Manipulation)
  • Necessity: Transform 3D model vertices from object space to screen space (clip space) for rendering.
  • Applications: Modifying geometry, such as vertex animation (e.g., cloth simulation, waving water), transforming models (rotation, scaling), and passing data to the fragment shader.
  • Example: A shader that makes a mesh wave by altering vertex positions based on a sine function
Fragment Shaders (Per-Pixel Coloring)
  • Necessity: Determine the final color (pixel value) of every rendered object pixel, handling lighting and textures.
  • Applications: Lighting calculations (Phong/Blinn-Phong), applying textures (UV mapping), transparency, and special effects like bloom or sepia tones.
  • Example: Calculating per-pixel lighting to make a surface appear smooth rather than faceted.
Why Both Are Necessary
  • Pipeline Flow: The vertex shader prepares raw shape geometry, while the fragment shader colors those shapes.
  • Efficiency: Vertex shaders run per-vertex (few), while fragment shaders run per-pixel (many), allowing for complex visual effects without stalling the GPU.
  • Data Passing: The vertex shader can calculate data (like vertex colors or normals) and pass them to the fragment shader, which interpolates this data for smooth gradients or precise lighting.

Shaders are where most beginners get stuck in OpenGL.

You see words like:

  • Vertex Shader
  • Fragment Shader

…and it feels confusing.

Let’s break it down in the simplest way possible.

Core Idea

Vertex Shader = decides POSITION
Fragment Shader = decides COLOR

That’s it.

Visual Explanation

Think of a triangle:

  • Vertex Shader → places the 3 corners
  • Fragment Shader → fills the color inside

Vertex Shader Example

attribute vec4 vPosition;

void main() {
gl_Position = vPosition;
}

👉 It controls where things appear on screen


Fragment Shader Example

precision mediump float;

void main() {
gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
}

👉 It controls what color they are


Real Analogy

Think of painting:

  • Vertex Shader = drawing outline
  • Fragment Shader = filling color

Common Mistakes

1. Mixing Responsibilities

Trying to set color in vertex shader → confusion

2. Precision Missing

precision mediump float;

👉 Required in fragment shader


Next Step

Try:

  • Changing color dynamically
  • Passing color from vertex → fragment
  • Creating gradients

Final Insight

Shaders are not complex—you just need to see them as:
👉 Position + Color pipeline

Once that clicks, graphics becomes much easier.

If you want to explore further I have another post where I draw a triangle.

https://cglabprojects.blogspot.com/2018/07/drawing-triangle-in-android-app-using.html

Saturday, November 15, 2025

Connect Four

Connect Four (You = Red)

Your turn

Othello(Reversi)

Reversi / Othello (Player = Black)

Your turn

Macala(Kalah) played against the computer