Skip to content

Archive / page 55

All articles

Every practical article from the Nalar archive, newest first.

Cybersecurity 09 Sep 2026 8 min read

Keep Session Cookies Bound to the Host That Needs Them

A web application can protect its session identifier with HTTPS and HttpOnly and still give more hosts influence over that session than intended. The problem is often the cookie’s Domain attribute. Suppose the authenticated application is app.example.com, while docs.example.com, status.example.com, and temporary preview hosts live under the same parent domain. If the session cookie is deliberately scoped to example.com, it can be sent to subdomains that do not need it. More broadly scoped cookies also make sibling subdomains part of the cookie’s integrity boundary: a sibling that can set cookies for the parent domain may be able to create a cookie with the same name and interfere with how the application interprets session state.

Cybersecurity 09 Sep 2026 10 min read

Keep Sensitive Data Out of Logs

Logs help developers diagnose failures and help security teams reconstruct important events. The same convenience can create a second problem: a log statement may copy passwords, session tokens, API keys, personal data, or confidential request contents into systems that were never meant to hold them. Once sensitive data reaches a log, it can spread to collectors, search indexes, dashboards, exports, support tools, and backups. Access controls on the original application no longer define every place where that data can be read. A credential that was protected in a secret store may become exposed through a much broader logging path.

Cybersecurity 09 Sep 2026 10 min read

Keep Security Logs Outside the System They Describe

Security logs often matter most after something has gone wrong. They help responders reconstruct which account acted, what changed, and when suspicious activity began. But there is a simple weakness in many logging designs: the system being investigated also controls the only copy of its own evidence. If an attacker gains enough privilege on that system, or if destructive failure affects its storage, local log files may be altered, deleted, or lost with the machine. The application may have recorded the right events and still leave responders with little useful history.

Cybersecurity 09 Sep 2026 10 min read

Keep Package Publishing Credentials Out of Untrusted Builds

A build job often needs to compile code, run tests, and create an artifact. It usually does not need permission to publish a new version that other people will install. That distinction matters because build systems process code and configuration that change frequently. A pull request, dependency update, test helper, build script, or compromised developer account can influence what runs during a build. If every such build also receives a long-lived package registry credential, code that only needed to be tested may inherit authority to release software.

Cybersecurity 09 Sep 2026 10 min read

Keep a Credential Inventory You Can Revoke

A service can have strong authentication and still accumulate a dangerous access problem: nobody can reliably answer which machine credentials are valid, who owns them, or which ones can be revoked. That uncertainty matters during routine maintenance and incidents. An old integration may disappear while its API key remains valid. A team may find a credential in a secret store but hesitate to disable it because the last known caller is unclear. If the credential is later exposed, its authority survives simply because nobody knows whether anything still depends on it.

Software Engineering 09 Sep 2026 8 min read

Isolating Hard-to-Test Code with a Humble Object

Some code is difficult to test for reasons that have little to do with the behavior you care about. A screen handler may require a UI framework. A file watcher may need operating-system events. A message consumer may only run inside a broker callback. Tests become slow or fragile because ordinary business decisions are trapped inside code that is expensive to execute in isolation. The Humble Object pattern addresses this by separating the difficult boundary from the logic behind it. The boundary object stays deliberately small: it translates an external event into plain data, calls ordinary code, then translates the result back. The decisions move into code that can be exercised without the framework or environment.

Python 09 Sep 2026 10 min read

Introspect Deferred Annotations with Python annotationlib

Python annotations are not only for static type checkers. Frameworks use them to build dependency graphs, validators inspect them to derive schemas, and documentation tools render them for humans. That makes annotation introspection part of the runtime behavior of many Python applications. Python 3.14 changes that behavior substantially. Annotations now use deferred evaluation by default, and the standard library adds annotationlib as the dedicated low-level interface for retrieving them. The important consequence is that annotation consumers should stop assuming there is one universally correct representation. Sometimes you want actual runtime values. Sometimes unresolved names must remain inspectable. Sometimes you only need readable text and should avoid resolving names entirely.

Software Engineering 09 Sep 2026 8 min read

Information Hiding: Design Modules Around Decisions

A module can have a tidy directory, a small public API, and still be difficult to change. The problem often appears when callers know details that should have remained private: how an identifier is formatted, which algorithm selects a price, or which fields must be updated together. When those details change, callers change with them. Information hiding is a design principle for reducing that coupling. The idea is simple: identify a design decision that may change, place it behind a module boundary, and expose the capability callers need rather than the decision’s internal details.

Tech 09 Sep 2026 8 min read

How Variable Refresh Rate Keeps Games Looking Smoother

A game does not necessarily produce a new image at a perfectly steady pace. One scene may be easy for the graphics processor to draw, while the next contains more objects, lighting, or effects and takes longer. A traditional display, however, normally refreshes on a fixed schedule. That mismatch can produce visible problems such as a horizontal break in the image or uneven-looking motion. Variable refresh rate (VRR) is a display feature designed to reduce that mismatch. Instead of making every refresh happen at one fixed interval, a compatible display can adjust its timing to follow the rate at which the source is delivering frames.

Tech 09 Sep 2026 8 min read

How HDMI ARC and eARC Send TV Sound to a Soundbar

Connecting a streaming box or game console to a TV is easy to picture: the source sends video and audio toward the TV. A soundbar creates a less obvious problem. If the TV is receiving the sound, how does that sound travel back out through an HDMI cable to the soundbar? That is the job of Audio Return Channel, usually called ARC. Its newer counterpart, Enhanced Audio Return Channel (eARC), serves the same basic purpose while supporting more demanding audio formats and improving parts of the connection process.

Tech Updated 15 Sep 2026 7 min read

How Automatic Time Zone Works on Your Phone

Travel to another region and your phone will usually change its clock without you doing anything. That can make automatic time seem simple: the phone notices where it is and sets the clock. The real process has an important extra layer. A device needs to know both what time it is and which local time zone should be used to display that time. Those are related questions, but they are not the same question.

Software Engineering 09 Sep 2026 8 min read

Finding Seams for Safer Code Changes

Sometimes a small code change feels much larger than the requirement. You want to test one decision, replace one dependency, or alter one behavior, but the code gives you no place to do that without executing or editing a large surrounding block. A useful way to reason about this problem is to look for a seam: a place where you can change the behavior of a program without editing the code that uses that behavior. A seam might be a function parameter, an object boundary, a configurable callback, or another point where one implementation can be substituted for another.

Software Engineering 09 Sep 2026 9 min read

Feature Flags Need a Removal Plan

A feature flag can make a risky change easier to release. You deploy both the old and new behavior, choose which one runs at runtime, and change that choice without rebuilding the application. The same mechanism creates a maintenance problem. Every flag adds another condition the code may execute under. If the flag remains after the decision is settled, developers must keep reasoning about behavior that no longer needs to be optional.

Cybersecurity 09 Sep 2026 8 min read

Expire Sessions with Idle and Absolute Timeouts

A login session is convenient because a user does not need to authenticate on every request. The same property becomes a security problem when a session credential is copied: whoever possesses a usable credential may keep acting with the authority attached to it until the application stops accepting it. Expiration limits that window. But a single vague setting called “session timeout” is often not enough. Two different questions matter: how long may a session sit unused, and how long may it exist even if it stays active? These are the idle timeout and the absolute timeout.

Artificial Intelligence 09 Sep 2026 12 min read

Evaluate Sequence Models Beyond Training Length

A sequence model can score well on a random test split and still fail when an input is longer than the sequences it saw during training. This matters for language, symbolic reasoning, event sequences, and other tasks where production inputs do not have one fixed length. The problem is easy to hide. If training and test examples come from the same length distribution, an aggregate metric mostly measures performance on familiar lengths. It does not tell you whether the model learned a rule that extends to longer sequences or a strategy that works only inside the observed range.

Cybersecurity 09 Sep 2026 10 min read

Do Not Use Security Questions as Authenticators

An application can protect normal sign-in with a strong password or multi-factor authentication and then weaken the same account with one recovery question such as a pet name or birthplace. If answering that question is enough to reset a password or regain access, the question is effectively another authenticator. That matters because many personal facts are easier to discover, infer, reuse, or guess than a deliberately chosen authentication secret. The recovery path can therefore become easier to satisfy than the sign-in path it is meant to recover.

Artificial Intelligence 09 Sep 2026 11 min read

Diversify RAG Retrieval with Maximum Marginal Relevance

A retrieval-augmented generation (RAG) system can retrieve highly relevant chunks and still build a poor context. The problem is redundancy. Imagine a support assistant answering a question about an API timeout. Vector search returns five chunks, but four are slightly different copies of the same timeout definition. The fifth useful chunk about retry behavior never reaches the model. Each result looked relevant in isolation, yet the set wastes most of its context budget repeating one idea.

Artificial Intelligence 09 Sep 2026 10 min read

Diagnose Embedding Anisotropy Before Tuning Vector Search

Diagnose Embedding Anisotropy Before Tuning Vector Search A vector search system can behave strangely even when its indexing code and similarity calculation are correct. Unrelated items may receive surprisingly high cosine similarities, score differences may look compressed, or many embeddings may point in broadly similar directions. One possible cause is embedding anisotropy: the vectors occupy some directions much more strongly than others instead of being distributed evenly through the representation space. Anisotropy is a property of the embedding geometry, not proof that retrieval is broken. The useful question is whether that geometry is hurting the decisions your system makes.

Artificial Intelligence 09 Sep 2026 9 min read

Diagnose and Prevent Dying ReLU Units

ReLU is one of the simplest neural-network activation functions: negative inputs become zero and positive inputs pass through unchanged. That simplicity makes optimization efficient, but it creates a failure mode that can quietly waste model capacity. A unit can move into a state where its pre-activation is negative for every relevant training example, so its ReLU output stays zero and the unit stops receiving a useful gradient through that activation.

Artificial Intelligence 09 Sep 2026 10 min read

Detect Representation Collapse in Self-Supervised Learning

Self-supervised learning can train an encoder without manually assigning a class label to every example. But removing labels also removes an obvious force that tells different examples to occupy meaningfully different parts of representation space. A badly designed objective can therefore admit a trivial solution: the encoder maps many or all inputs to essentially the same representation. This failure is called representation collapse. The training loss may even look good, because a model that emits the same vector for two augmented views of every input has achieved perfect agreement without learning useful distinctions.

Python 09 Sep 2026 14 min read

Detect Python Packages with inspect.ispackage

Python tools often need to answer a deceptively simple question: is this imported object a package or an ordinary module? That distinction matters to plugin loaders, documentation generators, test discovery systems, command-line frameworks, code indexers, and developer tools. A package can contain importable children. An ordinary module cannot be traversed in the same way. Python 3.14 adds inspect.ispackage(), a small predicate that gives this question a standard-library name. import inspect import json import pathlib print(inspect.ispackage(json)) # True print(inspect.ispackage(pathlib)) # False The API is tiny. The surrounding import semantics are not.

Software Engineering 09 Sep 2026 9 min read

Designing Operations to Avoid Partial State

A function can report an error and still leave trouble behind. The first few steps may have changed state before a later step failed, so the caller receives a failure while the system now contains a mixture of old and new values. This is partial state: an operation did not complete, but some of its intended changes became visible. Partial state makes retrying, debugging, and reasoning about invariants harder because “the operation failed” no longer tells you what state remains.

Cybersecurity 09 Sep 2026 9 min read

Design User Identifiers to Resist Visual Spoofing

Two account identifiers can be different to software while looking almost identical to a person. That gap matters anywhere people use a displayed identifier to decide whom they are trusting: administrator consoles, collaboration tools, package registries, marketplaces, support systems, or internal approval workflows. If an application treats visual appearance as irrelevant, an attacker may be able to register an identifier that resembles a trusted account closely enough to mislead another user. The database still sees two distinct strings. The human may not.

Cybersecurity 09 Sep 2026 9 min read

Design Security Notifications as Alerts, Not Authentication

A security notification can help a user notice that something important happened to an account: a password changed, a new authenticator was added, a recovery address changed, or a new session appeared. The notification is useful because it creates a second observation path outside the action that caused the event. That benefit can disappear if the notification itself becomes an authentication shortcut. A convenient link that immediately reverses a sensitive change may effectively become a bearer credential: anyone who obtains the link can exercise the authority embedded in it.