Skip to content

Archive / page 38

All articles

Every practical article from the Nalar archive, newest first.

Go 13 Sep 2026 4 min read

Compact Adjacent Slice Values with slices.CompactFunc in Go

slices.CompactFunc removes repeated values only when equivalent elements are adjacent. That detail makes it distinct from general deduplication: the function operates on runs, keeps the first element from each run, and leaves separated matches alone. The custom equality function also allows compaction for structs and for equivalence rules that differ from Go’s == operator. Compaction is based on neighboring values The function has this signature: func CompactFunc[S ~[]E, E any](s S, eq func(E, E) bool) S For each run in which neighboring elements satisfy eq, the first element remains in the result. Consider case-insensitive string comparison:

Go 13 Sep 2026 4 min read

Combine Slices with slices.Concat in Go

Concatenating several slices with repeated append calls can make ownership depend on spare capacity in the destination. slices.Concat takes a different contract: it returns a new slice containing all input elements in order. That makes the storage boundary explicit when a combined result must stand apart from its inputs. Added in Go 1.22, slices.Concat also defines the empty case precisely. If the total concatenation has no elements, the result is nil, even when one or more arguments are non-nil empty slices.

Artificial Intelligence 13 Sep 2026 6 min read

Clip Gradient Norms Before Optimizer Updates

A training update can become dominated by a gradient whose magnitude is far larger than the range seen in nearby iterations. Global norm clipping places a bound on that update signal before the optimizer consumes it. The operation is simple, but its behavior depends on what is included in the norm, where clipping occurs, and how it interacts with gradient accumulation and mixed-precision scaling. Norm clipping does not repair the source of unstable gradients. It changes the vector passed to the optimizer when its norm exceeds a chosen threshold.

Cybersecurity 13 Sep 2026 8 min read

Client Certificates Need an Identity Lifecycle

Client Certificates Need an Identity Lifecycle A service can reject every connection that lacks a trusted client certificate and still have a weak machine-identity boundary. The cryptographic handshake may be sound while the surrounding identity system quietly grants stale, ambiguous, or overly broad authority. Mutual TLS, commonly shortened to mTLS, gives both sides of a TLS connection a chance to authenticate with certificates. On the server side, this resembles familiar HTTPS authentication. On the client side, the server requests a certificate and verifies the presented chain and proof of private-key possession. That is a strong primitive. It does not, by itself, decide what the authenticated workload is allowed to be.

Software Engineering 13 Sep 2026 8 min read

Circuit Breakers Bound Failed Call Admission

A remote call can fail in a few milliseconds or consume its entire timeout budget before returning an error. If callers keep issuing equivalent requests while the dependency remains unable to serve them, each attempt spends resources on an outcome that recent evidence already suggests is unavailable. Retries can increase that pressure because one logical operation may create several physical calls. A circuit breaker changes call admission rather than the remote protocol. It records recent outcomes, moves between explicit states, and can reject new calls locally for a bounded period. After that period, it permits limited probes to test whether normal traffic can resume.

Cybersecurity 13 Sep 2026 7 min read

Certificate Transparency Turns Issuance Into Observable Evidence

Certificate Transparency Turns Issuance Into Observable Evidence A certificate authority can issue a perfectly valid TLS certificate for the wrong organization. The signature can verify, the chain can terminate at a trusted root, the hostname can match, and the certificate can still represent an issuance event the domain operator never intended. Certificate Transparency, commonly abbreviated CT, changes that failure from a largely private event into observable evidence. Publicly trusted certificate authorities submit certificate material to append-only logs, and clients can require evidence that a certificate has been recorded in suitable logs. Domain operators and security services can then watch those logs for names they control.

Cybersecurity 13 Sep 2026 6 min read

Certificate Transparency Turns Certificate Issuance Into an Observable Event

A certificate can be valid in every cryptographic sense and still be a security incident for the organization named in it. The issuing certificate authority may have followed its validation process, the signature may verify, and browsers may accept the chain. If the certificate was requested through a compromised account, an unintended validation path, or an infrastructure mistake, none of those properties establish that the domain operator expected it to exist.

Cybersecurity 13 Sep 2026 8 min read

Certificate Revocation Is a Distributed Freshness Problem

Certificate Revocation Is a Distributed Freshness Problem A private key can be exposed at 10:00, its certificate can be revoked at 10:15, and some clients can still face a harder question at 10:16: do they possess current enough evidence to reject it? That gap is easy to miss when revocation is described as a property attached to a certificate. X.509 certificates are signed objects with validity periods; changing the certificate after issuance would invalidate its signature. Revocation therefore lives outside the certificate itself. A relying party needs separate status information, needs that information to be sufficiently recent, and needs a policy for cases in which status cannot be obtained.

Software Engineering 13 Sep 2026 7 min read

Canonical Serialization Makes Byte Identity Explicit

Two serialized documents can represent the same application value and still differ byte for byte. An object member can appear in another order. A number can use a different textual form. Unicode text can contain distinct code-point sequences that render alike. Whitespace may be optional. A serializer can make any of these choices while remaining valid for its format. That flexibility is usually harmless when serialization is only a transport boundary. It becomes part of system semantics when bytes are hashed, signed, compared, cached by digest, or used as content addresses. At that point, logical equivalence is not enough. The operation consumes an exact byte sequence.

Software Engineering 13 Sep 2026 9 min read

Cancellation Is a Protocol, Not a Thread Kill

A caller can stop waiting for a result while the operation producing that result continues to run. The distinction is easy to miss because many APIs expose cancellation through a single method, token, context, or signal. That surface can look like a command to terminate work. In most cooperative designs, it is closer to a state transition: further work is no longer wanted. The gap matters once an operation owns resources, crosses process boundaries, or has already produced side effects. A cancelled HTTP request does not retroactively erase a committed database transaction. A task that notices a cancellation token between two writes cannot make the first write disappear. A parent that abandons a child computation also needs a rule for who observes the child’s eventual completion and who releases anything the child owns.

Artificial Intelligence 13 Sep 2026 5 min read

Calibrate Classifier Confidence with Temperature Scaling

A classifier can choose the correct class yet attach a probability that is too concentrated or too diffuse for the application using that score. Temperature scaling addresses this mismatch after model training by applying one positive scalar to the logits before softmax. The mechanism is deliberately narrow. It changes probability sharpness, not the information represented by the classifier. That boundary makes temperature scaling useful when class ranking is acceptable but confidence values need separate calibration.

Cybersecurity 13 Sep 2026 8 min read

Cache Keys Define a Security Boundary at Shared Proxies

A reverse proxy can receive two HTTP requests that look equivalent to its cache while the application behind it treats them as different. That disagreement is more than a performance bug. If an attacker can place a response generated from one request variant into a shared cache entry used by other clients, a request that originally affected one connection can acquire a much larger audience. This is the core security tension in web cache poisoning. The cache key defines which requests are considered interchangeable. The origin application defines which request properties can alter a response. Security depends on those two models staying aligned across proxies, frameworks, routing rules, and application code.

Cybersecurity 13 Sep 2026 7 min read

Cache Keys Are Security Boundaries at the HTTP Edge

Cache Keys Are Security Boundaries at the HTTP Edge A reverse proxy can receive two requests that an application considers different and still treat them as the same cache entry. That gap is enough to turn a response intended for one request context into a response served to many others. The issue is not caching in isolation. It is disagreement about identity. Applications make decisions from headers, query parameters, cookies, paths, host information, and sometimes values added by upstream infrastructure. A shared cache uses a smaller set of inputs to decide whether a stored response matches a later request. If an input changes application behavior but does not participate in the cache key, that input crosses a security boundary without being represented in cache identity.

Artificial Intelligence 13 Sep 2026 7 min read

Build Classification Sets with Split Conformal Prediction

A classifier normally returns one label or a vector of class scores. Neither output directly states how many labels should remain plausible when the system needs a controlled error rate. Split conformal prediction adds a calibration layer that turns those scores into prediction sets. The useful property is not that every individual set has a fixed probability of containing the correct label. Under the standard exchangeability assumption, split conformal methods target marginal coverage across new examples. That distinction shapes both implementation and interpretation.

Tech 13 Sep 2026 6 min read

Browser Cookies and Cached Files Serve Different Jobs

A browser can remove cached images and scripts without signing you out of a website, yet clearing site cookies can end a signed-in session even when the page files remain stored locally. Both actions are often grouped under “clear browsing data,” but they affect different parts of browser state. Cookies and the HTTP cache solve separate problems. Cookies let a site associate small pieces of state with later requests. The cache lets a browser reuse eligible responses instead of transferring the same representation again whenever a page needs it.

Go 13 Sep 2026 4 min read

Bound HTTP Request Bodies with http.MaxBytesReader in Go

An HTTP handler that decodes a request body without a byte limit can consume far more input than its application-level schema suggests. A JSON object with three fields may still arrive inside a multi-gigabyte body. Decoder validation controls structure; it does not establish a transport-sized boundary. Go’s http.MaxBytesReader places that boundary directly around the request body. It returns an io.ReadCloser that permits reads up to a configured limit and reports an error when code attempts to read beyond it.

Artificial Intelligence 13 Sep 2026 8 min read

Balance Sparse Mixture-of-Experts Routing Under Capacity Limits

A sparse mixture-of-experts layer does not send every token through every parameter block. A router scores the available experts, selects a small subset for each token, and dispatches token representations only to those selected experts. That conditional computation is the main attraction of sparse MoE designs, but it also creates a resource-allocation problem inside the model. The router can prefer the same experts for many tokens. Hardware, meanwhile, has finite buffers and communication capacity. A routing policy that looks reasonable from token scores alone can therefore create overloaded experts, idle experts, uneven communication, or discarded assignments.

Software Engineering 12 Sep 2026 8 min read

Write-Ahead Logging and the Meaning of Commit

A database can report a transaction as committed while the data pages touched by that transaction are still absent from their final locations on disk. That behavior is not a contradiction. In systems built around write-ahead logging, durability is established by the log before the modified pages need to reach durable storage. The distinction matters because a transaction changes several kinds of state at once. It changes the logical database, it changes in-memory page images, and it creates recovery information. Treating those as a single physical write obscures the mechanism that gives commit its meaning after a crash.

Tech 12 Sep 2026 6 min read

Wi-Fi Channel Width and Home Network Capacity

A router can offer several Wi-Fi channel widths even though the radio band stays the same. Selecting a wider channel gives a compatible link more radio spectrum to use, but it also occupies a larger slice of the band. That distinction matters in homes where nearby networks compete for the same frequencies. Channel width is therefore not a simple speed control. Its effect depends on the band, client support, signal conditions, nearby activity, and the channels that are actually available.

Tech 12 Sep 2026 9 min read

What Shutter Speed Changes in Phone Photos

A moving person can look crisp in one phone photo and blurred in the next, even when both shots seem well focused. The difference often comes from shutter speed: the amount of time the camera gathers light for an exposure. Shutter speed affects more than brightness. It also determines how much movement can be recorded while the image is being captured. Once that connection is clear, many familiar camera behaviors make more sense, from blurry indoor photos to night shots that ask you to hold the phone still.

Tech 12 Sep 2026 8 min read

What Refresh Rate Changes on a Screen

A phone or monitor may offer settings such as 60 Hz, 90 Hz, 120 Hz, or higher. The larger number can make scrolling and animation look smoother, but it doesn’t make every part of a device run at that speed or guarantee that every video will show more detail. Refresh rate is the number of times a display can update its image each second. It is measured in hertz (Hz). A 60 Hz display can present up to 60 screen updates per second, while a 120 Hz display can present up to 120. That simple definition becomes more useful once you separate the display’s updates from the content being sent to it.

Tech 12 Sep 2026 8 min read

What NFC Does When You Tap Your Phone

Tapping a phone against a payment terminal, transit gate, accessory, or small tag can trigger an action almost instantly. It feels simpler than joining Wi-Fi or pairing a Bluetooth device because there may be no network name, password, or visible connection process. The technology behind many of these taps is Near Field Communication (NFC). The useful mental model is that NFC creates a very short-range radio interaction between compatible devices. The tap itself is not transferring information through physical contact. Bringing the devices close together puts their NFC antennas in a position where radio communication can take place.

Tech 12 Sep 2026 8 min read

What Dynamic Range Compression Changes in Everyday Audio

A film can have dialogue that feels too quiet, then jump to an action scene that sends you reaching for the volume control. Music, podcasts, games, televisions, and audio apps can produce similar changes. One feature that can reduce those jumps is dynamic range compression. Dynamic range compression changes the relationship between quieter and louder parts of an audio signal. It can make loud moments less far removed from the rest of the programme, which is useful when listening at low volume or in a noisy room. It is not the same as simply turning the volume down, and it is not the same as loudness normalization.

Tech 12 Sep 2026 6 min read

What Browser Profiles Separate on a Shared Computer

A browser can open with one person’s bookmarks, signed-in sites, and preferences, then switch to another profile and show a different set. The computer has not changed users, yet the browser behaves as if it has a separate workspace. Browser profiles provide that separation inside the browser. They can be useful when several people use one computer, or when one person wants distinct work and personal browsing contexts. The boundary is narrower than a separate operating-system account, however, and treating the two as equivalent can create false expectations about privacy.