Sunday, February 1, 2026

Full Stack Development- Class 2 - Javascript Instructions

 Javascript Instructions

Key Components of JavaScript Instructions

JavaScript instructions are composed of several key elements:

Syntax: This refers to the rules that must be followed for the code to work correctly. Key rules include using keywords correctly, employing proper variable naming conventions, and utilizing semicolons to separate statements (though they are often optional, they are recommended for clarity).

Keywords: These are reserved words with specific meanings that identify a JavaScript action to be performed, such as var, let, const, if, for, function, and return.

Values and Variables: Instructions often involve working with data. Variables (declared with var, let, or const) are used to store data values.

Operators: These are special symbols used to perform operations on values and variables, such as arithmetic (+, -, *, /), assignment (=, +=), comparison (==, ===, >), and logical (&&, ||) operators.

Functions: These are reusable blocks of code that perform a specific task. They can be defined and then called (executed) when needed.

Control Flow: This determines the order in which statements are executed. It includes conditional statements (if/else, switch) and loops (for, while) that allow code to make decisions and repeat actions.

Objects and Arrays: JavaScript works extensively with objects (collections of properties and methods) and arrays (ordered lists of values).

Examples of JavaScript Instructions:

//Declaring a variable
let greeting = "Hello, world!";
//Comments: 
// A single-line comment
/*
   A multi-line comment
*/

// Declare a constant variable
const greeting = "Hello, World!"; 

// Declare a variable using 'let'
let number = 10;

// Use a built-in function to display an alert box
alert(greeting); 

// Use DOM manipulation to change the content of an HTML element with id="demo"
document.getElementById("demo").innerHTML = "I have " + number + " items.";
Variables can be declared by two ways:
var i = 5; 
let j = 7;
Here i is inferred to be an integer. and its function scoped if its declared inside the 
function. Otherwise if its declared globally its having global scope. 
Redeclaration allowed in the same scope.
Whereas let is a keyword that allows declaration of block scoped variables. These can
be hoisted, and result in ReferenceError if accessed before declaration.
While var declarations are hoisted and initialized as undefined, let and const are hoisted but remain uninitialized in a "Temporal Dead Zone," causing errors if accessed early.
There are various ways of manipulating the pages.
<html>
<head>
<title> Window Title </title>
<meta keywords="personal blog, full stack dev, devops">
<script> .. </script>
<style>...</style>
</head>
<body>
<h1>Header 1</h1>
</body>
</html>
...
...

<img src=""/>
<a href="link">Some text to click </a>
<audio>
<video>
<iframe>
<table></table>
Singleton tags like <img> do not have ending tag.
Tags have properties/attributes
We can define our own tags in frameworks like react.
The attributes of user defined tags are called props.

..
..
Javascript encountered in html is executed if in the form of statements or function calls. 
If 
functions are just defined without being called they just exist.
There is no single entry point for js like main in "c c++ and java".
The statements are executed from top to bottom in the order they are encountered.

This is how a function is defined in js
function add(a , b)
{
return a+b;
}

Full Stack Development- Class 1 - Introduction to Syllabus and MERN Stack

HTML - Hyper Text Markup Language

HTTP - Hyper Text Transfer Protocol

CSS - Cascading Style Sheets

JS - Javascript

WWW was invented by tim berners lee in 1989 innovating on key technologies like HTML, HTTP and URI.

URI stands for Uniform Resource Identifier.

This is the link to the first webpage ever on the WWW. (Link)

While the Internet grew rapidly after 1993 when CERN made the www software free to use, the launch of Windows 95 gave it an impetus that is felt even today.

World wide web grew rapidly and search engines like yahoo became the primary engines of web search. Google with its page rank algorithm provided an alternative search that rated popularity of search engines based on their reputation calculated by incoming links from other popular sites.

HTML pages were emitted by the servers and displayed in programs called the browser. The internet explorer, Netscape navigator, safari and Mozilla Firefox were some of the popular browsers.

Browsers were improving rapidly. Windows NT and Linux with several of its flavors were popular choices of server OS.

After around 30 years of the rise in popularity of the www, the landscape now is entirely different.

CSS was primarily used for styling. JS was used to modify the attributes of the HTML elements.

JavaScript was a language script embedded in the html and in the front end it made changes to pages by responding to events like for example, clicks or window resize, by doing some simple changes in properties of elements like for example, changing the color of visited pages from blue to red(to denote visited).

Around 2008 java script has started to be used to run the backend server. NodeJS made its entry into the programming world where writing servers in JavaScript became possible. Popularity of JS grew by leaps and bounds because people saw value in it. They wanted to learn how to program the front end animations and styling changes.

Technologies like AJAX(Asynchronous JavaScript and XML) made updating parts of the website easier without entire page refreshing. Progressive Web Apps were installable on desktops and didn't need separate development on various platforms. Single page applications a type of web application that loads a single HTML page and dynamically updates content via JavaScript as the user interacts with it, eliminating full page reloads.

Front end frameworks like Vue JS, React JS and Angular JS gave birth to a new breed/designation of front end engineers. AngularJS has lost preeminence to react-js though.

Flutter framework from google programmed in Dart gained popularity as it provided native UI experience on android and allowed people to design front end once and run on a variety of devices/browsers/mobiles from a single code base.

MERN stack is an acronym for MongoDB, ExpressJS, ReactJS and NodeJS. MongoDB is a NoSQL database technology relying its own specialized binary representation of JSON called BSON (Binary JSON) as its native data format for storing data on disk, in memory, and over the network.

MongoDB supports GraphQL as a query language. ReactJS is the front end framework that has features like hot reload, server side rendering, virtual dom, dom diffing etc.

Node.js is an open-source, cross-platform JavaScript runtime environment letting developers run JavaScript in server and have a development environment in the frontend.

Saturday, January 24, 2026

Getting Engineering Jobs Without the Engineering College Grind

 Engineering jobs reward skills, proof of work, and learning velocity—not degrees alone.

College is one path, not the path.
  • Engineering Jobs Without the Engineering College Grind: A Skills-First Roadmap
  • Do You Really Need an Engineering Degree to Be an Engineer
syllabus ≠ industry

4 years for 20% usable skills

smart students burning out, average ones memorizing

“The industry quietly moved on. Hiring didn’t wait.”

What Engineering Jobs Actually Require
  • Ability to learn fast

  • Problem-solving under ambiguity

  • Reading documentation

  • Debugging, not memorizing

  • Communicating technical ideas

None of these are exclusive to college.

Where the College Grind Fails (and where it still helps)

Fails at:
  • Keeping pace with tech change

  • Teaching real debugging

  • Portfolio building

  • Career guidance

Still helps with:

  • Structured exposure

  • Peer competition

  • Access to labs (sometimes)

  • Signaling for certain companies

Alternative Paths That Actually Work

1. Self-Directed Learning + Portfolio

  • Open-source contributions

  • GitHub projects with READMEs

  • Problem logs

2. Online Programs & Micro-Credentials

  • MOOCs (not certificates—outcomes)

  • Bootcamps (only if project-heavy)

  • Industry toolchains (cloud, CI/CD, data)

3. Apprenticeships & Internships

  • Start small, even unpaid (ethically framed)

  • Local startups > brand companies

  • Freelancing as proof of competence

4. Community Learning

  • Hackathons

  • Developer forums

  • Discord / Reddit / local meetups

Hiring Reality Check

  • Some companies will filter by degree

  • Many don’t—especially startups, product firms, global remote teams

  • Referrals + proof of work beat resumes

“Companies hire risk-reduction, not qualifications.”

A Practical Roadmap (6–18 months)

Example:

  • Months 1–3: Fundamentals + one small project

  • Months 4–6: One serious project + GitHub discipline

  • Months 7–12: Internships, freelancing, open source

  • Months 12–18: Job-ready specialization

Who Should Not Skip College

  • Those who need heavy structure

  • Those aiming for regulated roles

  • Those who thrive in academic environments

My Approach is

  • Practical, not motivational fluff

  • Respectful to teachers, critical of systems

  • Skills > certificates > colleges


These are the ideas that you might like:
  • engineering jobs without degree

  • computer science education alternatives

  • skills vs degree in engineering

  • how to become software engineer without college


“Skipping the college grind doesn’t mean skipping the grind.
It means choosing where you grind—and why.”


Saturday, November 15, 2025

What are the ways a person can collect evidence of wrong doing of his colleague.. in an academic setting

When dealing with suspected wrongdoing by a colleague—especially in an academic setting—you must avoid illegal, invasive, or unethical surveillance. But there are legitimate, safe, and institutionally appropriate ways to document concerns.

Here are legal, ethical, and academically accepted methods:


✅ 1. Keep a Detailed, Dated Written Record

Maintain a journal or log that includes:

  • What happened

  • When it happened (date/time)

  • Where it happened

  • Who else was present

  • Exact words/actions if possible

This becomes valuable evidence because it establishes a timeline and pattern of behavior.


✅ 2. Preserve Written Communication

If wrongdoing appears in:

  • Emails

  • Messages

  • Official memos

  • Collaboration tools (Slack, Teams, LMS, GitHub comments)

…you can keep copies.
Do NOT intercept private communication — only save things you legally received.


✅ 3. Save Work-Related Artifacts

In academics, wrongdoing often appears in:

  • Plagiarized assignments

  • Fabricated lab data

  • Manipulated research results

  • Improper grading behavior

  • Misuse of institutional resources

You may store:

  • Copies of submitted work

  • Screenshots of shared documents

  • Version histories (Google Docs, Git, Overleaf)

  • Lab notebook discrepancies

Again: only what you legitimately have access to as part of your job or role.


✅ 4. Collect Witness Statements (Informally or Formally)

If others have seen the same behavior:

  • Ask them to write down what they observed

  • Or ask them if they’re willing to speak to an official

  • Never pressure or coordinate stories

Multiple independent accounts strengthen credibility.


✅ 5. Follow Internal Academic Procedures

Universities have structures created exactly for this:

  • Academic Integrity officer

  • Ombudsperson

  • Department chair

  • Ethics committee

  • HR office (for staff)

  • Mentor or advisor (for students)

They may also guide you on what types of information you may or may not collect legally.


✅ 6. Preserve Physical Evidence (If Relevant)

Examples:

  • Altered documents

  • Suspicious lab equipment logs

  • Hard copies with forged signatures

  • Improperly accessed files (if you find signs, not by snooping)

Always keep originals if possible; otherwise store copies.


⚠️ What You Should Not Do

To protect yourself legally:

❌ Secret audio/video recording (illegal in many jurisdictions without consent)
❌ Accessing their email or files without permission
❌ Installing monitoring software or cameras
❌ Hacking, intercepting network traffic
❌ Pretending to be someone else to “catch” them
❌ Gathering information in private spaces (office drawers, personal devices)

These can backfire and lead to serious consequences for you.


⭐ A Safe, Effective Approach

If the wrongdoing could impact academics (plagiarism, fraud, harassment, sabotage, etc.):

  1. Write down everything clearly

  2. Keep any evidence you already legally have

  3. Check your institution’s official reporting procedure

  4. Submit the evidence only to trusted authorities


If you want, you can tell me:

  • the type of wrongdoing (plagiarism? harassment? data fraud? misuse of power?)

  • whether you are a student, TA, faculty, or staff

…and I can suggest the exact appropriate steps and what kind of evidence is acceptable in that specific scenario.

Tuesday, November 11, 2025

Region Growing-stopping rule

Descriptors alone can yield misleading results if connectivity properties are not used in the region growing process. 
For example: Visualize a random arrangement of pixels that have three distinct intensity values.

Grouping pixels with the same intensity values to form a region, without paying attention to connectivity, would yield a segmentation fault that is meaning less in the context of this discussion.

Another problem in region growing is the formulation of a stopping rule: 
Region growing has to stop when no more pixels satisfy the criteria for inclusion in that region.

Criteria such as intensity value, texture and color are local in nature and do not take into account the history of region growth.
Additional criteria that can increase the power of a region-growing algorithm utilize the concept of size, likeness between a candidate pixel and the pixels grown so far(such as comparison of the intensity of a candidate and the average intensity of the grown region) and the shape of the region being grown.

Let f(x,y) denote an input image; S(x,y) denote a seed array containing 1's at the locations of seed points and 0's elsewhere; Q denote a predicate to be applied at each location(x,y). Arrays f and S are assumed to be of the same size.

1. Find all connected components in S(x,y) and reduce each connected component to one pixel; label all such pixels found as 1. All other pixels in S are labeled 0.

2. Form an image fQ such that, at each point (x,y), fQ(x,y)=1 if the input image satisfies a given predicate, Q, at those coordinates, and fQ(x,y)=0otherwise.

3. Let gg be an image formed by appending to each seed point in S all the 1-valued points in fQ that are 8-connected to that seed point.

4. Label each connected component in g with a different region label (e.g., integers or letters). This is the segmented image obtained by region growing.


Segmentation by region growing

Computer Vision- Segmentation by Region Growing and by Region Splitting and Merging

 Objective: Partition an image into regions

Region Growing- As the name implies, Region Growing is a procedure that groups pixels or subregions into larger regions based on predefined criteria for growth.

Basic Approach: Start with a set of "seed" points, and from these grow regions by appending to each seed those neighboring pixels that have predefined properties similar to the seed(such as ranges of intensity or color)

How many seeds? Which ones?

The procedure is to compute at every pixel the same set of properties that ultimately will be used to assign pixels to regions during the growing process. If the result of these computations shows clusters of values, pixels whose properties place them near the centroid of these clusters can be used as seeds.

Example: Land use satellite imagery

We need to do region analysis with a set of descriptors based on intensity levels and spatial properties(such as moments or texture). Descriptors alone can yield misleading results if connectivity properties are not used in the region growing process.

Thursday, November 6, 2025

Create Data Preservation Library

Question: Can I create a library that preserves data before its deleted/discarded from applications like in python app if list.clear() is called I will modify behavior of clear to store the cleared data locally until such time that it can be backed up in a remote server. So that applications don't lose data. 

That’s an excellent and very advanced idea — and yes, it’s definitely possible to build a Python library that intercepts data-deletion or mutation calls (like list.clear(), dict.pop(), del, etc.) and preserves data before it’s lost.

Let’s break it down step-by-step so you understand what’s involved.


🧩 Core Concept

You can override or wrap built-in data structures (like list, dict, set, etc.) with custom subclasses that:

  • Intercept destructive operations (clear, pop, remove, slicing assignments, etc.)

  • Log or copy the data before the operation

  • Store it temporarily in a local cache or file

  • Optionally send it later to a backup/remote server


⚙️ Example: SafeList

Here’s a minimal prototype:

import json
from datetime import datetime

class SafeList(list):
    def __init__(self, *args, backup_handler=None, **kwargs):
        super().__init__(*args, **kwargs)
        self.backup_handler = backup_handler or self.default_backup

    def default_backup(self, data):
        # Simple file-based backup
        with open("backup_log.jsonl", "a") as f:
            json.dump({
                "timestamp": datetime.now().isoformat(),
                "data": data
            }, f)
            f.write("\n")

    def clear(self):
        if self:
            self.backup_handler(list(self))
        super().clear()

    def pop(self, index=-1):
        value = super().pop(index)
        self.backup_handler([value])
        return value

    def __delitem__(self, index):
        value = self[index]
        self.backup_handler([value])
        super().__delitem__(index)

Usage:

x = SafeList([1, 2, 3, 4])
x.clear()  # backup before clearing

This will save the data to a file before deletion.


🧠 Extending the Concept

You can generalize this into a library that:

  • Wraps multiple container types (SafeDict, SafeSet, etc.)

  • Hooks into all destructive methods

  • Supports pluggable backup handlers (e.g. local cache, SQLite, HTTP endpoint)

  • Optionally tracks who triggered the deletion (stack trace)

  • Provides automatic periodic upload of backup data to a remote service


🔥 Advanced Ideas

  1. Monkey patch built-ins (⚠ risky, but doable):

    import builtins
    builtins.list = SafeList
    

    → All new lists created in the program become “safe.”

    But this can break libraries that expect a real list, so it should be optional or done via context managers.

  2. Proxy Layer (non-invasive)
    Wrap existing objects dynamically:

    safe_obj = make_safe(existing_list)
    

    where make_safe() detects the type and returns the corresponding safe wrapper.

  3. Transparent Auto-Backup Middleware
    Hook into serialization layers or database ORMs to back up critical structures before deletion.

  4. Undo/Versioning
    Each change could generate a diff or a version history entry so that you can roll back changes — similar to a mini Git for runtime data.


🚧 Design Challenges

  • You must handle nested data (list of dicts, dict of lists, etc.)

  • Performance overhead can be significant

  • Need to decide when to purge backups

  • Multithreading or multiprocessing synchronization for data safety


🪄 Prototype Architecture for Your Library

safe_data/
├── __init__.py
├── base.py          # Base class for safe containers
├── safe_list.py     # Implements SafeList
├── safe_dict.py     # Implements SafeDict
├── backup.py        # Backup handler (local/remote)
├── scheduler.py     # Handles periodic backup flushes
└── config.py        # Configurations (e.g. backup paths, thresholds)

Would you like me to show you how to design this as a Python package (with modules, classes, and a pluggable backup system)?
That would make it easy to install and import as import safe_data and wrap any object safely.