Posts
Checking if the nth bit is set
Understanding Bitwise Operations in Golang: Checking if the nth Bit is Set Bitwise operations are a fundamental tool in programming, allowing you to manipulate individual bits of data efficiently. In this blog post, we’ll explore how to check if the nth bit of an integer is set (i.e., whether it is 1 or 0) using a simple and effective bitwise operation in Golang. We’ll break down the process step by step and provide examples to clarify the concept.
read morePosts
Mastering Bitwise Operators in Golang: A Comprehensive Guide with Examples
Introduction Bitwise operators are powerful tools in any programming language that allow developers to perform operations at the bit level. They are essential for tasks that require direct manipulation of individual bits within an integer type. In this post, we’ll explore the different types of bitwise operators available in Golang. See some example code, and walk through each example to understand how these operators work.
Types of Bitwise Operators Golang supports several bitwise operators:
read morePosts
Trie
What is a Trie? A Trie, also known as a prefix tree or digital tree, is a tree-like data structure that is used to efficiently store and retrieve keys in a dataset of strings. The Trie is especially useful when dealing with dynamic sets of strings and allows for fast searching, insertion, and deletion of keys.
Components of a Trie Nodes: Each node represents a single character of a string or a key.
read morePosts
Monotonic Stack
What is a monotonic function? A monotonic function is a function that is either entirely non-increasing or non-decreasing. In other words, the function preserves the given order of the input values.
Monotonically Increasing (Non-decreasing) A function \(f\) is called monotonically increasing if \[for\ all\ x \leq y , f(x) \leq f(y)\] This means that as the input values increase, the output values either increase or stay the same. For example:
read morePosts
Understanding the CAP Theorem: Consistency, Availability, and Partition Tolerance in Distributed Systems
What is CAP Theorem? The CAP theorem, also known as Brewer’s theorem, states that in any distributed data store, it is impossible to simultaneously guarantee Consistency, Availability, and Partition tolerance.
Consistency, Availability, and Partition Tolerance Explained Consistency Every read receives the most recent write or an error. All nodes in a distributed system see the same data at the same time. After a write operation, all subsequent reads will return the same data.
read morePosts
Why Blockchains Are Designed to Be Deterministic?
Blockchain technology has revolutionized the way we think about digital transactions and data security. By providing a decentralized, transparent, and secure method for recording transactions, blockchains have found applications in various industries, from finance to supply chain management. One of the fundamental principles that make blockchain technology reliable and trustworthy is determinism.
What is a blockchain? A blockchain is like a digital ledger or a record book shared across multiple computers.
read morePosts
Issue with CSS Not Loading for a Hugo Website Deployed with GitHub Pages
Deploying a Hugo website on GitHub Pages is a seamless process, thanks to the comprehensive documentation provided here. However, I recently encountered an issue where my Hugo website launched successfully but failed to load the CSS.
The Problem Upon checking the developer console, I noticed the following error:
https://namanattri.dev/namanattri.dev/ananke/css/main.min.css 404 It was clear that the path to the CSS was incorrect. The generated HTML included the following line:
<link rel="stylesheet" href="/namanattri.
read morePosts
About Naman
Introduction Naman is a professional coder inspired by his passion for problem-solving & system design. He has a keen interest in working with technologies such as Javascript, Typescript, React, Nodejs, Golang, Blockchain, Ethereum, Distributed Systems, Docker, Kubernetes, Infrastructure as Code (Terraform), and cloud computing.
In his career, Naman has tackled various challenging problems, design complex system, continuously enhancing his skills and knowledge. He stays updated with the latest technological trends by reading books, tech blogs, and engaging in discussions with his peers.
read more