Aditya Chatterjee's Blog, page 48

March 9, 2023

How to detect if user changes tab in browser?

Introduction

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.

Solution

The Page Visibility API provides an event tha...

 •  0 comments  •  flag
Share on Twitter
Published on March 09, 2023 10:25

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.

Features

A feature is a me...

 •  0 comments  •  flag
Share on Twitter
Published on March 07, 2023 11:33

March 6, 2023

Web Sockets vs HTTP

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,...

 •  0 comments  •  flag
Share on Twitter
Published on March 06, 2023 14:02

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 NLP

NLP stands for Natural Language Processing, which is a branch of computer science, artif...

 •  0 comments  •  flag
Share on Twitter
Published on March 05, 2023 22:32

Maze Generator and Solver in Java

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.

Introduction

A 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 ...
 •  0 comments  •  flag
Share on Twitter
Published on March 05, 2023 10:12

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...

 •  0 comments  •  flag
Share on Twitter
Published on March 05, 2023 05:47

ACID and BASE model

In this article, we will cover the ACID and BASE model which is very important with respect to designing systems.
Table of contents:IntroductionACID MODELBASIC MODELComparison of ACID and BASE modelExamplesConclusion
IntroductionACID and BASE model

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...

 •  0 comments  •  flag
Share on Twitter
Published on March 05, 2023 05:17

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....

 •  0 comments  •  flag
Share on Twitter
Published on March 04, 2023 12:14

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 STATEMENT

Suppose 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.

EXAMPLE

Example 1:
Input: m = 2, n = 3, k ...

 •  0 comments  •  flag
Share on Twitter
Published on March 04, 2023 05:52

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 STATEMENT

The 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

EXAMPLE

Example 1:
Input: nums = [1,2,4,5,6], k = 3
Output: 1
Expla...

 •  0 comments  •  flag
Share on Twitter
Published on March 04, 2023 05:52