Skip to content

Archive / page 84

All articles

Every practical article from the Nalar archive, newest first.

Software Engineering 03 Sep 2026 8 min read

Creating Seams for Safer Code Changes

Some code is difficult to change for reasons that have little to do with the change itself. A function may read the clock directly, create its own network client, access a global configuration object, or write to a file in the middle of business logic. The requested change may be small, but verifying it safely becomes difficult because the code is tightly connected to things that are slow, unpredictable, or hard to reproduce.

Software Engineering 03 Sep 2026 8 min read

Controlling Mutation with Defensive Copies

A class can expose a small, carefully designed interface and still lose control of its own state. The problem appears when the class stores a mutable value that other code can also modify. Imagine an order object that accepts a list of line items. The constructor validates the list, calculates a total, and assumes the items will now change only through the order’s methods. If the caller still holds the same list, that assumption is false. The caller can modify the list directly, bypassing validation and leaving the order’s cached total inconsistent with its items.

Software Engineering 03 Sep 2026 6 min read

Choosing Test Doubles Without Hiding Design Problems

Test doubles are useful when a test needs control over a dependency that would otherwise be slow, unpredictable, expensive, or difficult to observe. They can also make a test suite fragile when every internal interaction is replaced and asserted. The goal is not to avoid test doubles. It is to use the least powerful double that gives the test the control or evidence it needs. Start with the reason for replacing a dependency Before introducing a double, identify what makes the real dependency unsuitable for this test.

Software Engineering 03 Sep 2026 9 min read

Choosing Composition Over Inheritance for Behavior Reuse

Reusing code can create a dependency that lasts much longer than the code being reused. A common example is inheritance: a new class extends an existing class because it needs some of its behavior. The first change is convenient, but later the subclass may inherit assumptions, state, and lifecycle rules that it never wanted. Composition offers a different relationship. Instead of saying that one type is a specialized form of another, an object receives or owns another object that provides a capability. The behavior can then be replaced without changing the object’s identity.

Cybersecurity 03 Sep 2026 8 min read

Choose Multi-Factor Authentication by Threat Model

Multi-factor authentication (MFA) reduces the damage caused by stolen passwords, but not every second factor provides the same protection. A one-time code, a push approval, and a hardware-backed credential all add another authentication step, yet they behave differently under phishing, malware, social engineering, and account recovery attacks. The useful question is therefore not simply whether MFA is enabled. It is whether the authentication method resists the threats that matter for the account being protected.

Artificial Intelligence 03 Sep 2026 8 min read

Choose Classification Thresholds with Precision and Recall

A binary classifier often produces a score rather than a final yes-or-no answer. An image model might estimate a 0.82 probability that a component is defective, while a moderation model might assign a 0.37 score to unwanted content. The classification threshold turns that continuous score into a decision. A threshold of 0.5 is common, but it is not automatically correct. The right threshold depends on which mistakes matter, how frequently the positive class occurs, and what happens after the model makes a prediction.

Artificial Intelligence 03 Sep 2026 6 min read

Choose Between Prompting, RAG, and Fine-Tuning

When an AI application produces weak results, teams often jump directly to fine-tuning. That can be the right choice, but many problems are cheaper and easier to solve with better prompting or retrieval-augmented generation (RAG). The three approaches change different parts of the system. Prompting changes the instructions and context given at inference time. RAG supplies relevant external information at inference time. Fine-tuning changes the model’s learned parameters through additional training.

Software Engineering 03 Sep 2026 8 min read

Characterization Tests for Safe Legacy Changes

Changing old code is difficult when nobody can say with confidence which behaviours are intentional and which are accidents. Documentation may be incomplete, the original authors may be unavailable, and existing tests may cover only a small part of the system. In that situation, writing tests for the design you wish the code had can be risky. Before improving the design, you first need evidence about what the software actually does today.

Software Engineering 03 Sep 2026 8 min read

Changing Interfaces Safely with Parallel Change

Changing a shared interface often looks simple in the code that owns it. Rename a method, replace a parameter, or return a richer result, then update the callers. The difficulty appears when many callers cannot change at the same moment. They may live in different modules, be maintained by different teams, or be deployed independently. A change that is correct in isolation can then create a period where old callers and new code cannot work together.

Artificial Intelligence 03 Sep 2026 10 min read

Calibrate Classifier Confidence for Better Decisions

A classifier can predict the correct label often and still produce confidence scores that are difficult to trust. Suppose a model marks 1,000 transactions as fraudulent with confidence near 0.9. If that confidence behaves like a useful probability, roughly 90% of comparable predictions should actually be fraud. If only 65% are, the model is overconfident. If nearly all are fraud, it is underconfident. This distinction matters whenever a system uses model scores to make decisions: escalating cases to humans, approving automated actions, ranking alerts, or choosing a threshold based on expected risk. Accuracy tells you how often predictions are correct. Calibration asks whether predicted probabilities match observed frequencies.

Python 03 Sep 2026 10 min read

Building Memory-Efficient Iterator Pipelines with Python itertools

Python programs often transform data in stages: read records, discard unwanted items, reshape values, group adjacent entries, and stop after enough output has been produced. A straightforward implementation may build a new list after every stage. That is easy to understand, but it can also allocate intermediate collections that the next stage immediately consumes. Iterator pipelines offer another model. Each stage requests values from the stage before it as needed. Python’s itertools module provides building blocks for this style, including tools for chaining inputs, taking slices from streams, computing running values, grouping consecutive records, and duplicating an iterator when two consumers genuinely need it.

Cybersecurity 03 Sep 2026 7 min read

Build a Practical Incident Response Process

Security incidents become harder to manage when teams make every decision for the first time under pressure. A practical incident response process reduces that uncertainty by defining how to assess an event, limit damage, preserve useful evidence, restore service, and learn from what happened. The goal is not to create a perfect procedure for every possible attack. It is to establish a reliable decision framework that works when information is incomplete and time matters.

Software Engineering 03 Sep 2026 6 min read

Branch by Abstraction for Incremental Change

Large replacements are tempting because they promise a clean boundary between the old design and the new one. In practice, a long-running replacement branch accumulates integration risk while the main codebase continues to change. Branch by abstraction offers a different approach. Instead of separating the work primarily with a source-control branch, engineers introduce an abstraction around the behaviour being replaced. The old implementation remains usable while a new implementation is developed and adopted behind the same boundary.

Artificial Intelligence 03 Sep 2026 9 min read

Beam Search for Sequence Generation

A model that generates text or another sequence makes a series of local decisions. At each step, it assigns scores or probabilities to possible next tokens. The simplest decoder chooses the most likely token, appends it, and repeats. That strategy is called greedy decoding. It is cheap and easy to understand, but an early choice that looks best by itself can lead to a worse complete sequence. Once greedy decoding commits to that choice, it cannot reconsider it.

Artificial Intelligence 03 Sep 2026 9 min read

Batch LLM Inference for Better Throughput

An LLM server can receive many requests at the same time, yet processing every request independently is often an inefficient way to use an accelerator. GPUs and similar hardware are designed to perform large amounts of parallel numerical work. A single small request may leave part of that capacity unused. Batching combines work from multiple requests so the model can process more of it together. This can improve total throughput, but it introduces an important trade-off: waiting to form a batch can delay individual requests, and requests with different sequence lengths do not all consume the same amount of work.

Cybersecurity 03 Sep 2026 9 min read

Authenticate Webhooks with Signed Requests

A webhook endpoint is often intentionally reachable from the internet. That makes delivery convenient, but it also means the endpoint cannot assume that every request came from the service it trusts. If an application processes an unsigned webhook simply because it arrived at the correct URL, anyone who discovers that URL may be able to submit lookalike events. Depending on the integration, a forged event could trigger account changes, fulfilment, notifications, billing workflows, or other automated actions.

Artificial Intelligence 03 Sep 2026 8 min read

Activation Functions in Transformer Feed-Forward Networks

Attention gets much of the attention in transformer explanations, but every transformer layer also contains a feed-forward network that performs substantial computation on each token representation. The activation function inside that network is a small-looking design choice with an important job: it introduces nonlinearity so the network can learn transformations that stacked linear projections alone cannot express. The feed-forward block matters when reading model architectures, comparing implementations, estimating parameter and compute costs, or deciding whether two designs are actually equivalent.

Tech 02 Sep 2026 5 min read

Why USB-C Cables Do Not All Work the Same Way

USB-C makes connectors simpler because the plug is reversible and the same shape appears on phones, laptops, tablets, monitors, chargers, storage devices, and many accessories. The confusing part is that the connector shape does not tell you everything the cable can do. Two USB-C cables can look almost identical while supporting very different charging power, data speeds, or display features. One may be suitable only for basic charging, while another can handle fast external storage, a high-resolution monitor, and laptop charging.

Tech 02 Sep 2026 8 min read

Why Ethernet Can Be More Reliable Than Wi-Fi

Wi-Fi makes it easy to connect phones, laptops, televisions, and other devices without running cables through every room. For many everyday tasks, a good wireless connection is more than fast enough. Ethernet serves a different purpose. It carries network traffic over a physical cable, usually between a device and a router, network switch, or wall socket connected to the local network. That wired path can make performance more predictable, especially for devices that stay in one place.

Tech Updated 15 Sep 2026 8 min read

Why Bluetooth Connections Drop and How to Improve Reliability

Bluetooth is designed for convenient short-range wireless connections, but it is not immune to interference, distance, software problems, or weak batteries. Headphones can stutter, a keyboard can stop responding briefly, or a game controller can disconnect even when pairing originally worked without difficulty. Many of these problems come from ordinary radio or software conditions rather than a failed device. Testing the connection methodically makes it easier to separate signal issues, competing connections, software state, and hardware faults.

Tech 02 Sep 2026 8 min read

What Screen Resolution Means and When More Pixels Help

Screen specifications often include numbers such as 1920 × 1080, 2560 × 1440, or 3840 × 2160. These numbers describe the display’s pixel resolution: the number of addressable picture elements arranged horizontally and vertically. More pixels can produce sharper text and finer image detail, but resolution alone does not tell you how large things will appear, how much workspace you will have, or whether the difference will be obvious in everyday use.

Tech 02 Sep 2026 8 min read

What Screen Refresh Rate Means in Everyday Use

A display specification may list a refresh rate such as 60 Hz, 90 Hz, 120 Hz, or 144 Hz. The number describes how many times per second the display can refresh the image it shows. A higher refresh rate can make motion look smoother and controls feel more immediate, but it does not automatically improve image sharpness or guarantee that every app will run at the display’s maximum rate. Understanding refresh rate is easier when you separate what the screen can display from how quickly the device can produce new frames.

Tech 02 Sep 2026 8 min read

What RAM Does and How Much Memory You Actually Need

Random-access memory, usually shortened to RAM, is one of the specifications people see when buying a computer, tablet, or phone. A device might have 8 GB, 16 GB, 32 GB, or more, but the number is easy to misunderstand. RAM is not the same as permanent storage. It is fast working memory that the system uses while applications, documents, browser tabs, and background services are active. More RAM can make a device handle heavier workloads more comfortably, but adding memory does not automatically make every task faster. The useful question is whether your workload regularly needs more memory than the device can provide efficiently.

Tech 02 Sep 2026 7 min read

What DNS Does and Why It Can Affect Browsing

When you enter a website address into a browser, your device usually needs to discover which network address belongs to that name before it can connect. The system that performs this translation is the Domain Name System, or DNS. DNS normally works quietly in the background. Because it is involved near the beginning of many internet connections, however, a DNS problem can make a healthy connection feel broken. A website may fail to open even though Wi-Fi is connected and other network services still work.