Aditya Chatterjee's Blog, page 48
March 9, 2023
How to detect if user changes tab in browser?
As a web developer, it's important to know when a user changes tabs or minimizes the browser window. This information can be useful for analytics, user engagement, and other purposes. However, traditional JavaScript event listeners are not sufficient for detecting tab changes, which can be a challenge for developers. In this article, we will discuss how to use the Page Visibility API to detect tab changes in HTML and JavaScript.
SolutionThe Page Visibility API provides an event tha...
March 7, 2023
Feature, vector and embedding space
In machine learning, data is everything. However, data in its raw form cannot be directly fed into a machine learning model. It needs to be converted into a numerical representation that the model can understand. This is where feature extraction comes in. Features are numerical representations of raw data that can be used for machine learning. In this article, we will discuss the concepts of feature, vector, and embedding space and their importance in machine learning.
FeaturesA feature is a me...
March 6, 2023
Web Sockets vs HTTP

In this article, we will dive deep into the world of 2 protocols that are the base communication of a lot of websites nowadays, what is a web socket? What is HTTP/HTTPS? What is the difference between web sockets and HTTP? How and where should I use them?
What is HTTP?HTTP stands for Hypertext Transfer Protocol, pretty much every basic server that doesn’t have a very especific special need uses a HTTP protocol. So what is HTTPS protocol? When you search for a website and the website is loaded,...
March 5, 2023
Lemmatization in NLP
In this article, we have explored about Lemmatization approaches in NLP in depth and presented Lemmatization approaches in Python with code examples.
Some of the text preprocessing techniques we have covered are:
NLPLemmatizationNeed of LemmatizationApproaches to LemmatizationWordNetWordNet (with POS tag)TextBlobTextBlob (with POS tag)spaCyTreeTaggerPatternGensimStanford CoreNLPWhat is NLPNLP stands for Natural Language Processing, which is a branch of computer science, artif...
Maze Generator and Solver in Java

In this article, we will develop a Java program that generates a Maze and solves it using Depth-First Search with help of Backtracking. This is a strong profile for SDE portfolio.
IntroductionA Maze is a complex network of paths or passages, with many branching points and dead ends.
Maze generation and solving algorithms have been a topic of interest in computer science and game development for decades.The goal of a maze generator is to create a complex, yet solvable maze that can challenge ...Empty / Undefined / Null in JavaScript
In this article, we will learn the concept of empty, undefined and null in JavaScript and how to use JavaScript to check the Empty, Null and Undefined string on the client/user side for authentication purpose.
This is functional to have accurate and consistent data before forwarding it to the server. We can assume that the main purpose of this function is to validate the values input by the users either empty or filled.
In formal language theory, the empty string, or empty word, is the unique st...
ACID and BASE model
Table of contents:IntroductionACID MODELBASIC MODELComparison of ACID and BASE modelExamplesConclusion
Introduction

So we all have been learning ACID and BASE since our high school which is combining them will give you salt and water which is very important for our life.
Although this is correct but the concept I am talking about is entirely different.
So what is ACID an...
March 4, 2023
User Input in JavaScript
JavaScript is a popular programming language used for building interactive web applications. One of the key features that make JavaScript so powerful is its ability to receive input from users. In this article, we will explore the basics of user input in JavaScript and how it can be used to create dynamic and interactive web applications.
User input can be defined as any information that a user provides to a web application. This can include text, numbers, dates, images, and other types of data....
K-th Smallest Number in Multiplication Table [Solved]
In this article, we have solved the problem of finding the K-th Smallest Number in Multiplication Table. This involve the concept of Binary Search.
PROBLEM STATEMENTSuppose we have an m x n matrix named mat, which represents the multiplication table of integers from 1 to m and 1 to n. The element at row i and column j in mat is the product of i and j.
Given three positive integers m, n, and k, find and return the kth smallest element in the matrix mat.
EXAMPLEExample 1:
Input: m = 2, n = 3, k ...
Find K-th Smallest Pair Distance [Solved]
In this article, we have solved the problem of finding the K-th smallest pair distance. This involve the concept of Binary Search.
PROBLEM STATEMENTThe kth smallest distance between a pair of integers a and b can be defined as the absolute difference between a and b.
Suppose you have an array of integers called nums and an integer k. Your task is to find the kth smallest distance among all the pairs nums[i] and nums[j] where 0
EXAMPLEExample 1:
Input: nums = [1,2,4,5,6], k = 3
Output: 1
Expla...