Skip to content

Archive / page 87

All articles

Every practical article from the Nalar archive, newest first.

Tech 02 Sep 2026 7 min read

How Phone Hotspots Share Mobile Internet

A phone can do more than use its own mobile data connection. With a mobile hotspot, it can also share that connection with a laptop, tablet, or another device. This is useful when normal Wi-Fi is unavailable, but a hotspot is not simply a miniature replacement for a home broadband connection. Its performance depends on both the phone’s cellular link and the local connection between the phone and the device using it.

Tech Updated 15 Sep 2026 8 min read

How Bluetooth Audio Codecs Affect Wireless Listening

Wireless headphones often advertise support for audio codecs such as SBC, AAC, aptX, or LDAC. These names can make Bluetooth audio seem more complicated than it needs to be. A codec is simply part of the process used to represent audio efficiently enough to send it over a Bluetooth connection. Codec support can influence sound quality, latency, bandwidth use, and connection stability, but the codec name alone does not determine how good a pair of headphones will sound.

Tech Updated 15 Sep 2026 7 min read

How Adaptive Brightness Works on Phones and Laptops

Modern phones and many laptops can change screen brightness automatically as lighting conditions change. Walk from a dim room into bright daylight and the display may become brighter; return indoors and it may gradually dim again. This feature is commonly called adaptive brightness, automatic brightness, or a similar name. It can make a display easier to see while reducing unnecessary power use, but it does not simply choose one fixed brightness for every room.

Cloud Computing 02 Sep 2026 5 min read

Graceful Shutdown and Connection Draining for Cloud Services

Cloud services are stopped routinely: deployments replace instances, autoscalers remove capacity, hosts reboot, and schedulers reschedule workloads. If a process exits immediately when it receives a termination signal, in-flight requests can fail even when the service is otherwise healthy. Graceful shutdown is a small lifecycle protocol: stop taking new work, allow useful work already in progress to finish within a deadline, then release resources and exit. Separate readiness from process health A process that is shutting down may still be alive but should no longer receive new traffic.

Software Engineering 02 Sep 2026 6 min read

Feature Flags Without Permanent Complexity

Feature flags let teams separate deploying code from exposing behavior. A change can reach production while remaining disabled, then be enabled for internal users, a small percentage of traffic, or a selected customer group. That flexibility reduces release risk, but every flag also creates another possible execution path. If flags are added casually and never removed, the codebase accumulates conditional behavior that becomes difficult to reason about and test. The engineering goal is therefore not to maximize the number of flags. It is to use flags as temporary control points with explicit ownership and a planned end state.

Artificial Intelligence 02 Sep 2026 7 min read

Embeddings and Similarity Search

Many AI applications need to find items by meaning rather than by exact words. A user may search for “reset my password” while the relevant document says “recover account access.” Traditional keyword matching can miss that relationship because the phrases share few terms. Embeddings provide another representation. An embedding model converts an input such as text into a numeric vector. Inputs with related meaning are often placed near one another in that vector space, making it possible to retrieve semantically similar items with mathematical distance or similarity measures.

Linux 02 Sep 2026 4 min read

Diagnosing File Descriptor Leaks on Linux with procfs

A Linux process uses file descriptors for more than ordinary files. Network sockets, pipes, event descriptors, terminals, and many other kernel objects appear through the same integer-based interface. When a service slowly accumulates descriptors, it may eventually fail with Too many open files, stop accepting connections, or behave unpredictably under load. Linux procfs provides enough information to investigate many descriptor leaks without installing extra tools. Start by counting descriptors For a known process ID:

Software Engineering 02 Sep 2026 10 min read

Designing Structured Logs for Production Debugging

Production debugging often starts with a deceptively simple question: what happened to this request? Plain-text logs can answer that question in small systems, but they become difficult to search reliably when message wording changes, multiple services participate in one operation, or operators need to aggregate millions of records. Structured logging addresses that problem by representing important context as named fields instead of embedding everything in prose. The goal is not to turn every variable into a log field. A useful log schema captures stable facts about an event, preserves enough correlation context to connect related work, and avoids recording data that creates security or privacy risk.

Cybersecurity 02 Sep 2026 6 min read

Design Security Logs for Incident Detection

Security logging is not simply collecting more application output. Its purpose is to leave reliable evidence of security-relevant activity so that suspicious behaviour can be detected, investigated, and explained. Useful logs answer practical questions: what happened, when did it happen, which identity or client was involved, what resource was affected, and what was the result? Log security decisions, not every detail Start with events that represent changes in identity, authority, access, or security state.

Cybersecurity 02 Sep 2026 5 min read

Design Secure Password Reset Flows

Password reset is an authentication mechanism. Anyone who can complete the reset flow can usually take control of the account, so recovery deserves protections comparable to login. A secure design must prevent token guessing, account enumeration, replay, accidental disclosure, and long-lived takeover opportunities. Return the same public response A reset form often accepts an email address or username. Do not reveal whether that identifier exists. Prefer a response such as:

JavaScript 02 Sep 2026 4 min read

Deep Cloning in JavaScript with structuredClone

Copying JavaScript objects looks simple until values contain nested arrays, dates, maps, sets, typed arrays, or circular references. A shallow spread copies only the first level, while the old JSON.stringify and JSON.parse pattern changes or rejects several legitimate JavaScript values. structuredClone provides a standard deep-cloning operation based on the structured clone algorithm used by browser messaging APIs. Shallow copies keep nested references A spread expression creates a new outer object:

CSS 02 Sep 2026 4 min read

CSS Logical Properties for International and Reusable Layouts

Traditional CSS often describes layout with physical directions: left, right, top, and bottom. That is intuitive until the same component must work in a right-to-left language or a different writing mode. Logical properties describe layout relative to the flow of text. Instead of saying “left padding,” you can say “padding at the inline start.” The browser maps that intent to the correct physical edge. Think in block and inline axes CSS logical layout uses two axes:

Database 02 Sep 2026 5 min read

Covering Indexes and Index-Only Scans for Faster Database Reads

An index normally helps a database find rows. A covering index can go further: it contains all columns needed by a query, allowing the database engine to answer some reads without fetching every matching row from the table. That can reduce random I/O for read-heavy workloads, but it also makes indexes larger and writes more expensive. Covering is a workload-specific optimization, not a reason to copy every selected column into every index.

Artificial Intelligence 02 Sep 2026 5 min read

Control LLM Randomness with Temperature and Top-p

Large language models usually generate text one token at a time. At each step, the model assigns scores to possible next tokens, those scores become probabilities, and a decoding strategy chooses what comes next. Two common controls in that process are temperature and top-p. They are often described as creativity settings, but that description is incomplete. They change how the model samples from its probability distribution, which affects repeatability, diversity, and the chance of selecting lower-probability tokens.

Cybersecurity 02 Sep 2026 7 min read

Constant-Time Comparison for Authentication Tags and Secret Values

Security-sensitive verification often ends with a simple question: does an untrusted value equal the value the server expected? For ordinary application data, a normal equality operator is appropriate. For authentication tags and some secret values, however, an equality operation that stops at the first mismatch can expose information through execution time. Timing-safe comparison APIs reduce that risk by avoiding content-dependent short-circuit behavior. They are small tools, but using them correctly requires more than replacing one equality operator.

Software Engineering 02 Sep 2026 8 min read

Code Reviews That Improve Change Quality

Code review is one of the few engineering practices that can improve a change before it reaches production while also spreading knowledge across a team. It can catch defects, expose unclear assumptions, improve maintainability, and help engineers understand parts of the system they did not write. It can also become slow and frustrating when reviewers focus on preferences, authors submit changes that are too large to reason about, or nobody is clear about what approval means.

Python 02 Sep 2026 4 min read

Cache Pure Work in Python with functools.cache and lru_cache

Caching can turn repeated expensive work into a dictionary lookup, but it can also return stale data or grow memory without bound. Python’s functools module provides two convenient memoization decorators: lru_cache and cache. functools.cache has been available since Python 3.9. It is effectively an unbounded memoization cache. lru_cache adds a configurable size limit and eviction behavior. Cache functions, not arbitrary side effects Memoization works best when a function behaves like a pure function: the result depends only on its arguments.

Artificial Intelligence 02 Sep 2026 5 min read

Budget LLM Context Windows Without Losing Critical Instructions

Large-language-model applications rarely fail because a prompt is one token too long. They fail because context growth is handled without priorities. Chat history expands, retrieval returns more passages, tool results become verbose, and eventually the application truncates whichever text happens to be easiest to cut. A safer design treats the context window as a budget with explicit allocations. The goal is not to fill every available token. The goal is to preserve the information that controls behavior while leaving enough room for a complete answer.

Data Science 02 Sep 2026 5 min read

Bootstrap Confidence Intervals with Resampling

A point estimate hides uncertainty. Reporting that median latency is 180 ms or a conversion-rate difference is 1.4 percentage points does not show how much that estimate might move if another sample were collected. Bootstrap resampling is a practical way to estimate sampling uncertainty when deriving an analytic formula is difficult or when the statistic is not a simple mean. The bootstrap idea Given an observed sample of size n:

JavaScript 02 Sep 2026 4 min read

Async Iteration and Backpressure with for await...of

JavaScript promises represent one future result. Many systems produce a sequence of future results instead: paginated records, stream chunks, queue messages, or events from an asynchronous source. Async iteration models that shape directly. An async iterable exposes values over time, and for await...of consumes them one at a time. A minimal async generator An async generator can yield values after asynchronous work: async function* pages() { for (let page = 1; page <= 3; page++) { const response = await fetch(`https://example.com/api/items?page=${page}`); if (!response.ok) { throw new Error(`HTTP ${response.status}`); } yield await response.json(); } } for await (const page of pages()) { console.log(page); } The consumer does not need to know how pagination is implemented. It only sees an asynchronous sequence.

Software Engineering 02 Sep 2026 5 min read

Architecture Decision Records That Stay Useful

Software systems accumulate decisions that are obvious at the time and mysterious six months later. A database was chosen for a reason, a synchronous call became asynchronous for a reason, and a service boundary exists because some trade-off mattered. Architecture Decision Records, or ADRs, preserve that reasoning in small documents close to the code. Record decisions, not meetings An ADR should answer a future engineer’s practical questions: What problem were we solving? What constraints mattered? What did we decide? Which alternatives were considered? What consequences did we accept? Has this decision been replaced? It does not need to reproduce a design meeting transcript.

Cybersecurity 02 Sep 2026 6 min read

Apply Least Privilege to Application Access

Least privilege is the practice of giving an identity only the access required to perform its current job. The identity may be a person, application, service account, CI job, or automated process. The principle sounds simple, but useful implementations go beyond creating a few roles. Permissions change over time, applications accumulate capabilities, and emergency exceptions often become permanent. Least privilege therefore needs both careful design and regular maintenance. Start from required actions, not convenient roles A common mistake is to begin with a broad role such as admin, editor, or operator and assign it because it makes an application work quickly.

Tech Updated 15 Sep 2026 5 min read

2.4 GHz vs 5 GHz vs 6 GHz Wi-Fi: Which Band Should You Use?

Modern Wi-Fi routers often advertise two or three frequency bands: 2.4 GHz, 5 GHz, and, on newer equipment, 6 GHz. They all carry network traffic wirelessly, but they behave differently when it comes to range, speed, congestion, and compatibility. There is no single “best” band for every device. A phone in the same room as the router has different needs from a smart plug two walls away. The useful choice depends on the trade-off between coverage, available capacity, congestion, and device support.

Artificial Intelligence 01 Sep 2026 4 min read

Version Embeddings for Safe Semantic Search Migrations

Semantic search systems often look simple from the outside: encode a document, store its vector, encode a query, and compare the vectors. The operational difficulty appears later, when the embedding model changes. Two models can produce vectors with the same dimension and still define completely different coordinate spaces. Mixing vectors from model A with query vectors from model B can silently destroy ranking quality without producing an obvious error. The safe approach is to treat an embedding model as a versioned data dependency, not a drop-in function.