Aditya Chatterjee's Blog, page 127
January 16, 2022
System Design of YouTube
In this article, we have explored the System Design of YouTube which is a video hosting and sharing platform with over 1 Billion active users. It is the second most used web application just after Google Search.
Table of contents:
Introduction to YouTubeHave you ever wondered how YouTube actually works?Requirements of the SystemThe system's capacityAPIs of YouTubeDesign at the highest levelDatabase of YouTubeShardingCachingLoad BalancingContent Delivery Network (CDN)Tolerance for Fau...Reverse Deque in C++ STL
In this article, we have presented different ways to Reverse Deque in C++ STL. This involve the use of reverse iterator of Deque or the Reverse method in C++ STL.
Table of contents:
Introduction to Deque in C++ STLMethod 1: Make use of rbegin() and rend()Method 2: Using deque's reverse () functionPre-requisites:
Deque in C++ STLDifferent ways to initialize Deque in C++ STLIntroduction to Deque in C++ STLThe DEQUE acts like a double-ended queue and its size is dynamic and handled by STL...
January 15, 2022
Sed command in Linux
In this article, we discuss the linux sed command, a non-interactive editor which reads a set of commands and executes them in a given file.
Table of contents.Introduction.Syntax.Options.Commands.Characters.Regular expressions.Addresses.Question.Summary.References.Introduction.The sed command is a very useful stream editor for filtering and transforming text.
It performs text transformations on an input stream by making only one pass over the input(s).
Awk command in Linux
In this article, we discuss awk, a powerful scripting language for advanced text processing
Table of contents.Introduction.Syntax.Processing file contents.Processing columns.Processing Column Lines.Processing lines with specific patterns.Regex matching with awk.Arithmetic with awk.Filtering with awk.Comparisons with awk.Loops in awk.Summary.References.Introduction.Awk can be viewed as a general-purpose scripting language built for advanced text processing.
It is data-driven mean...
Compiling logic programs
In this article, we discuss the general compilation technique for a full recursive backtracking search over clauses combined with a full unification of terms.
Table of contents.Introduction.List procedures.Assert and retract predicates.The 'cut' operator.Optimizing clause selection.Compiled clause search and unification.Summary.References.PrerequisiteIntroductionEven though the compilation of a full backtracking search over clauses and of unification of t...
Introduction to Logic programming model
In this article, we discuss the logic programming model which finds many application areas involving facts and computing relations between them.
Introduction.Logic programming is a computer programming paradigm based on logic where program statements express facts and rules about a problem within a system of formal logic.
Examples of logic programming languages are, Prolog, Datalog, Alice, Ciao, ASP, Twelf.
It is based on the specification of a relationship between terms, facts and using these,...
Run-time environment: Accessing non-local data on Stack
In this article, we take a look at how a procedure accesses data used within it but doesn't belong to it.
Table of contents.Introduction.Data access without nested procedures.Issues with nested procedures.Nested procedure declarationsNesting depth.Access links.Manipulation of access links.Access links for procedure parameters.Displays.Prerequisites.Stack AllocationIntroduction.In this article we shall first take a look at how access of non-local on the stack is done in the C pro...
Trace-Based garbage collection
In this article, we discuss trace-based garbage collection, a type of garbage collection whereby garbage is collected at intervals triggered by conditions during program execution.
Table of contents.Introduction.Mark-and-sweep algorithm.Baker's mark-and-sweep algorithm.Mark-and-compact algorithm.Cheney's copying collectors algorithm.Summary.References.Prerequisite.Introduction.Garbage collection involves collecting garbage as it is being created, trace-based collectio...
January 14, 2022
Heap allocation in Compilers
Stack allocations are often restrictive and we may want resizable arrays which can survive function invocations, in this article we discuss heap allocation in compilers.
Table of contents.Introduction.Memory management.Computer memory hierarchy.Program locality.Reducing fragmentation.Summary.References.Pre-requisites:
Stack allocation in CompilersMemory managementIntroduction.The heap is used for dynamically allocated memory.
It is useful for deallocation and allocation operations...
Stack allocation in Compilers
Stack allocation is a runtime storage management mechanism for the compiler whereby activation records are pushed and popped onto thee stack as activations begin and end by use of predefined routines in the compiler.
Table of contents.Introduction.Activation trees and records.Allocation of variable-length data.Calling sequences.Summary.References.Prerequisites
Memory managementHeap allocation in CompilersIntroduction.Compiling languages using procedures, functions or methods as uni...