Skip to content

Archive / page 59

All articles

Every practical article from the Nalar archive, newest first.

Cybersecurity 08 Sep 2026 10 min read

Stop Secrets Before They Enter Version Control

A developer can remove an API key from the latest version of a file and still leave the key in version-control history. Once a real credential has been committed, deleting the visible line is therefore not enough: copies may remain in earlier commits, clones, caches, mirrors, build systems, or other places that observed the repository. This makes secret leakage a good problem to stop early. Instead of relying only on a later scan that reports credentials after they have entered repository history, a team can inspect changes at the boundary where they are about to be accepted and block likely secrets before that happens.

Artificial Intelligence 08 Sep 2026 9 min read

Stabilize Neural Network Weights with Exponential Moving Averages

A neural network’s parameters rarely move smoothly toward their final values. Mini-batch training produces noisy updates: one batch may push a weight in one direction, while the next pushes it partly back. The final checkpoint therefore represents one point on a noisy training path, not necessarily the most useful point near the end of that path. An exponential moving average (EMA) of model weights keeps a second set of parameters that changes more slowly than the actively trained model. Recent training states contribute more than old ones, but no single update immediately replaces the averaged weights.

Cybersecurity 08 Sep 2026 12 min read

Separate Credentials by Environment

A development environment often needs the same kinds of integrations as production: a database, an object store, an email provider, a payment sandbox, or an internal API. Reusing one credential across those environments can look convenient because there is only one value to provision and rotate. The cost appears when a lower-trust environment is compromised. If a credential copied into development also works against production, the attacker has crossed an environment boundary without defeating another authentication control. A secret that was intended to simplify configuration has become a bridge between systems with different risk.

Tech 08 Sep 2026 7 min read

Screen Mirroring vs Casting: What Your Device Actually Sends

Sending a video, photo, presentation, or phone screen to a television can look like one simple action. Yet two sessions that appear similar can behave very differently. In one, every movement on your phone also appears on the TV. In another, the TV keeps playing after you switch apps or even stop actively using the phone. The difference is often whether you are mirroring a screen or casting media. These terms are sometimes used loosely by apps and device makers, but they describe two useful mental models: mirroring sends a representation of what is happening on one device, while casting can hand media playback to another device.

Python 08 Sep 2026 11 min read

Run CPU-Bound Python Work with InterpreterPoolExecutor

Python has traditionally offered two familiar high-level choices for parallel work: threads and processes. Python 3.14 adds a third option to concurrent.futures: InterpreterPoolExecutor. It runs workers in separate Python interpreters inside one process. Each worker has its own interpreter state and its own Global Interpreter Lock (GIL), so pure Python code can execute on multiple CPU cores at the same time. That makes the executor interesting for CPU-bound workloads, but it is not a drop-in way to make arbitrary threaded code parallel. Interpreter isolation changes the programming model. Mutable Python objects are not simply shared between workers, submitted work crosses a serialization boundary, imports and module globals are interpreter-local, and extension compatibility deserves deliberate testing.

Go 08 Sep 2026 7 min read

Run Cleanup After Context Cancellation with context.AfterFunc

Cancellation often means more than telling a goroutine to stop. A blocked operation may need to be interrupted, a temporary resource may need cleanup, or some state may need to be released as soon as a request deadline expires. A common approach is to start another goroutine that waits on ctx.Done(). That works, but it adds lifecycle code every time you need cancellation-triggered behavior. Since Go 1.21, the standard context package provides context.AfterFunc for this job.

Artificial Intelligence 08 Sep 2026 13 min read

Rewrite RAG Queries Without Losing User Intent

A retrieval-augmented generation system often searches with the user’s latest message. That works for self-contained questions, but conversational questions frequently depend on earlier turns. Consider a support assistant. The user first asks about a failed database migration, discusses PostgreSQL for several turns, and then asks: Does the rollback command work on version 16 too? Searching that sentence literally may retrieve pages about unrelated rollback commands because the query does not say what is being rolled back. A query rewriter can turn the conversational message into a self-contained retrieval query such as:

Cybersecurity 08 Sep 2026 12 min read

Revoke Access When Identity Ownership Ends

Access is often granted deliberately and removed accidentally. A developer joins a project and receives repository access. A contractor gets an administrative role for a migration. A service account is created for an integration. Months later, the person leaves, the project ends, or the integration is replaced, but some of the access remains. That leftover access is a security problem because its original justification has disappeared. A credential may still work, a group membership may still grant permissions, or an unattended service identity may still be able to call sensitive systems. If that identity or credential is later misused, the system may accept the request even though nobody can explain why the access still exists.

Artificial Intelligence 08 Sep 2026 11 min read

Retrieve Multi-Hop Evidence with Graph RAG

Retrieval-augmented generation (RAG) usually starts with a simple idea: find text chunks similar to a question, place the most relevant chunks in the model’s context, and ask the model to answer from that evidence. This works well when the answer is stated in one passage or in several passages that are independently easy to retrieve. Some questions are harder because the useful evidence is connected by relationships, not just by similar wording. A developer may need to answer, “Which service depends on the library maintained by the team that owns the payment API?” No single chunk has to contain all of those words. The answer may require following several links across services, libraries, teams, and APIs.

Cybersecurity 08 Sep 2026 11 min read

Restrict Outbound Connections to Limit Server-Side Request Risk

Applications often need to make outbound network requests. A webhook tester may fetch a URL, an image service may download a remote image, or a document processor may retrieve an external resource. The security problem begins when an attacker can influence the destination more than the application intended. If the server can reach internal services, management endpoints, or other networks that the attacker cannot reach directly, a server-side request can cross a trust boundary on the attacker’s behalf. Validating the requested URL is important, but URL parsing, redirects, name resolution, and changing network state make application-only defenses easy to overestimate.

Artificial Intelligence 08 Sep 2026 8 min read

Residual Connections in Deep Neural Networks

Making a neural network deeper gives it more transformations to work with, but depth alone does not make optimization easy. A stack of layers must learn useful transformations while gradients travel backward through every stage. As the stack grows, that optimization path can become difficult even when the deeper model has enough capacity to represent a good solution. Residual connections change what a block is asked to learn. Instead of making the block produce an entirely new representation, they let it learn a change to the representation it already received. The original input travels along a shortcut and is added back to the learned branch.

Software Engineering 08 Sep 2026 8 min read

Replacing Repeated Absence Checks with the Null Object Pattern

Optional collaborators often begin innocently. A service may have a notifier when notifications are enabled, a metrics recorder when monitoring is configured, or an audit sink in environments that need auditing. The first absence check is easy to understand. The twentieth can make the real behavior harder to see. The Null Object pattern is one way to remove that repetition. Instead of representing “no collaborator” with a null-like value and asking every caller to handle it, provide an object that implements the same contract with behavior appropriate for absence.

Artificial Intelligence 08 Sep 2026 9 min read

Regularize Residual Networks with Stochastic Depth

Deep residual networks can overfit even when their skip connections make optimization manageable. Standard dropout can regularize individual activations, but residual architectures offer another useful unit to randomize: the entire residual branch. Stochastic depth randomly removes selected residual branches during training while keeping the skip path intact. A training example may therefore pass through a slightly shallower effective network on one step and the full set of blocks on another. At inference time, every residual branch is normally active.

Software Engineering 08 Sep 2026 9 min read

Refactoring Feature Envy by Moving Behavior

A method belongs to InvoiceService, but most of its code asks an Invoice for fields, combines those fields according to invoice rules, and barely uses the service’s own state. Every time the invoice model changes, the service changes with it. This is a common design smell called feature envy: behavior lives in one place but depends heavily on the data or rules owned by another place. The name is less important than the maintenance problem. Knowledge that belongs together is split across a boundary, so one conceptual change requires coordinated edits.

Software Engineering 08 Sep 2026 9 min read

Reducing Test Combinations with Pairwise Testing

Configuration-heavy software creates a testing problem that grows faster than it first appears. A feature may behave differently by account type, payment method, region, browser mode, storage backend, or feature flag. Testing each choice separately can miss interaction bugs, while testing every combination can become impractical. Pairwise testing is a combinatorial test-design technique for this situation. Instead of requiring every complete combination, it constructs a set of tests in which every pair of parameter values appears together at least once.

Cybersecurity 08 Sep 2026 9 min read

Quarantine Compromised Accounts Without Destroying Evidence

When an account appears compromised, the fastest reaction is often to delete it. That can stop some activity, but deletion can also remove identity records, group memberships, session metadata, ownership information, and other state that responders need to understand what happened. It may also make recovery harder if resources still depend on that identity. A better incident-response mental model is to separate containment from destruction. Containment removes or sharply limits the account’s ability to cause new harm. Preservation keeps the relevant identity and evidence available long enough to investigate, recover, and make deliberate cleanup decisions.

Python 08 Sep 2026 12 min read

Process Template Strings Safely with Python T-Strings

Python’s f-strings are excellent when the desired result is immediately a string. That same immediacy becomes a limitation when an application needs to inspect interpolated values before deciding how they should be represented. Python 3.14 adds template string literals, usually called t-strings, for that boundary. A t-string looks much like an f-string, but it does not immediately collapse its literal text and interpolated values into one str. Instead, it produces a structured Template object from string.templatelib.

Cybersecurity 08 Sep 2026 11 min read

Prevent Log Forging with Structured Events

Security logs are useful only if responders can trust what an event means. That trust can fail when an application builds log records by joining trusted text with untrusted values. A username, request parameter, filename, or external error message may contain line breaks, delimiters, terminal control characters, or text that resembles the application’s own log format. If that value is inserted directly into a text record, it can make one event appear to be several events, hide where fields begin and end, or mislead a person reading the log.

Python 08 Sep 2026 8 min read

Parse TOML Configuration Safely with Python tomllib

Python 3.11 added tomllib, giving applications a standard-library parser for TOML configuration files. That removes a dependency for a common task, but parsing is only one part of loading configuration correctly. A configuration loader still needs to decide how large an input may be, what keys and types are accepted, whether floating-point values require exact decimal semantics, and how syntax errors should be reported. It also needs to remember that tomllib reads TOML; it is not a TOML writer or a schema validator.

Software Engineering 08 Sep 2026 8 min read

Parse Inputs into Trusted Data at System Boundaries

Input validation often begins as a few sensible checks and slowly spreads through a codebase. A controller checks that an amount is positive. A service checks it again. A helper receives the same primitive value and checks it a third time because it cannot tell whether the earlier checks ran. The problem is not that validation is useless. The problem is that the program keeps carrying data in a form that does not record what has already been established.

Cybersecurity 08 Sep 2026 9 min read

Monitor Certificate Transparency for Unexpected Certificates

A public TLS certificate can make a server appear to belong to your domain. If a certificate is issued when you did not expect one, the cause may be harmless automation, an undocumented service, or a mistake. It may also indicate that someone obtained certificate issuance through a path you did not intend to authorize. Looking only at certificates deployed on your own servers is not enough. An unexpected certificate may never appear on infrastructure you control.

Artificial Intelligence 08 Sep 2026 10 min read

Model Soups for Combining Fine-Tuned Models

A hyperparameter sweep often leaves you with several fine-tuned models that are individually useful. The usual workflow keeps the checkpoint with the best validation score and discards the rest. An ensemble can use several checkpoints, but then every request may require multiple model evaluations, increasing inference cost and operational complexity. A model soup offers a third option: average the parameters of compatible fine-tuned models and deploy the resulting parameter set as one model. The technique is simple, but its simplicity can be misleading. Parameter averaging is meaningful only when the checkpoints are sufficiently compatible, and the averaged model still needs independent evaluation.

Artificial Intelligence 08 Sep 2026 12 min read

Migrate Embedding Models Without Breaking Retrieval

Changing an embedding model can look like a routine dependency upgrade. Replace the model identifier, deploy the service, and continue querying the existing vector index. That approach can silently damage retrieval. An embedding is meaningful relative to the representation space produced by its model. If stored document vectors came from one model while new query vectors come from another, their coordinates generally do not have a shared meaning. Matching dimensions are not enough to make the vectors compatible.

Software Engineering 08 Sep 2026 10 min read

Metamorphic Testing When Exact Answers Are Hard

Some software is easy to test because the expected answer is obvious. If a function adds two numbers, a test can call it with 2 and 3 and assert that the result is 5. Other software has outputs that are expensive or awkward to predict. A route planner may examine thousands of possible paths. A search ranker may score hundreds of candidates. A numerical routine may produce a result that is difficult to calculate independently without reimplementing the same algorithm.