Skip to content

Archive / page 39

All articles

Every practical article from the Nalar archive, newest first.

Tech 12 Sep 2026 8 min read

What a Bluetooth Audio Codec Changes

Two pairs of Bluetooth headphones can connect to the same phone yet use different methods to carry the audio. You may also see codec names in specifications or device settings and wonder whether changing one will transform the sound. A Bluetooth audio codec is the method used to encode audio into a form suitable for transmission and decode it again at the receiving device. It matters, but it is only one part of the listening chain. The codec can affect audio quality, delay, radio usage, and power requirements; it cannot compensate for poor speakers, a weak recording, or every limitation elsewhere in the system.

Tech 12 Sep 2026 5 min read

Virtual Memory and Storage Under Memory Pressure

A computer can keep several large applications open even when their combined memory demands exceed the amount of physical RAM available at that moment. The operating system manages this pressure by deciding which memory contents need to remain in RAM and which can be moved elsewhere or discarded and recreated later. Virtual memory is central to that process. It gives software an address space that is separate from the exact layout of physical RAM, allowing the operating system to map memory pages to different physical locations as conditions change.

Software Engineering 12 Sep 2026 8 min read

Vector Clocks and the Shape of Concurrent State

A single version number can state that one value came after another only when every update participates in the same ordered sequence. Replicated state breaks that assumption as soon as independent writers can accept changes without first agreeing on one global next version. Two replicas can each move forward from the same ancestor. Calling one state version 8 and the other version 9 creates an order, but that order may describe the numbering scheme rather than the causal relation between the writes. Vector clocks represent a different fact: which update history a state has observed.

Cybersecurity 12 Sep 2026 8 min read

Use CSP Nonces to Restrict Executable Scripts

Cross-site scripting becomes dangerous when attacker-controlled text reaches a browser in a form that the browser can execute. Context-aware output encoding and safe DOM APIs remain primary defenses because they stop data from becoming executable markup. A Content Security Policy can add another boundary: even if an injection flaw creates a script element, the browser can refuse to execute it unless the page explicitly grants that script permission. A nonce-based policy is a practical way to express that permission for server-rendered pages. The server creates an unpredictable value for one HTTP response, places it in the Content-Security-Policy header, and attaches the same value to script elements that the application intends to execute. A script inserted through an injection flaw does not possess the value and is blocked.

Cybersecurity 12 Sep 2026 7 min read

Use Certificate Transparency as a Detection Signal

A TLS certificate can be valid in every cryptographic sense and still be operationally unexpected. A forgotten staging host may receive a certificate through an automated pipeline. A vendor may issue for a delegated subdomain that the central security team did not know existed. More seriously, an attacker who gains control of a DNS validation path or a certificate-authority account may obtain a certificate for a name they should not control.

Tech 12 Sep 2026 8 min read

USB-C Charging: What Controls How Fast a Device Charges

A USB-C charger may have a large wattage number printed on it, yet a phone connected to it can still charge at a much lower rate. Swap the cable and the result may change again. This can make USB-C charging seem unpredictable when the connector looks identical in every case. The useful mental model is that charging speed is not chosen by the charger alone. The device, charger, cable, and supported charging method form a system. The fastest rate that system can use depends on what those parts can safely agree to provide and accept at that moment.

Tech 12 Sep 2026 6 min read

USB-C Cables Can Share a Connector but Not Capabilities

Two USB-C cables can fit the same phone, laptop, charger, and dock yet produce very different results. One may charge a laptop normally but move files slowly. Another may handle fast storage and an external monitor. A third may be intended mainly for basic charging and USB 2.0 data. The shared plug shape makes these cables look interchangeable. Electrically, they don’t have to provide the same set of capabilities. USB-C describes the connection, not one performance level USB-C defines a reversible connector system. It gives devices a common physical interface, but the connector alone doesn’t state a single data rate or charging capacity.

Artificial Intelligence 12 Sep 2026 11 min read

Understand Sparse Mixture-of-Experts Routing

Understand Sparse Mixture-of-Experts Routing A larger neural network can represent more functions, but using every parameter for every input makes each forward pass expensive. Sparse mixture-of-experts (MoE) models take a different approach: keep many parameter groups available, then activate only a small subset for each token. That sounds like a simple efficiency trick, but routing changes much more than arithmetic cost. It affects training stability, accelerator communication, memory requirements, batching, and the meaning of a model’s total parameter count.

Go 12 Sep 2026 4 min read

Traverse Slices in Reverse with slices.Backward in Go

Reverse traversal does not require reversing a slice. Since Go 1.23, slices.Backward exposes the existing elements as an iterator that emits index-value pairs from the last element toward index zero. That distinction matters when element order must stay intact. slices.Reverse changes the slice in place, while a hand-written descending loop couples traversal to index arithmetic. slices.Backward expresses reverse iteration without changing the source. The iterator keeps original indexes The function has this signature:

Software Engineering 12 Sep 2026 7 min read

Transactional Outbox: Moving Publication Across the Commit Boundary

Transactional Outbox: Moving Publication Across the Commit Boundary A service that changes database state and publishes a message has two distinct side effects. A local transaction can make the database change atomic, and a broker can accept the message durably, but those facts do not make the pair atomic. The awkward interval sits between them. If the database commit succeeds and publication does not, durable state exists without the corresponding message. Reversing the order only reverses the exposure: a message can become visible before the database commit succeeds.

Software Engineering 12 Sep 2026 9 min read

Transactional Outbox at the Database-Broker Boundary

Transactional Outbox at the Database-Broker Boundary A database commit and a broker publish are two separate state transitions. An application can complete either one first, but unless both systems participate in a common transaction protocol, there is an interval in which one side has changed and the other has not. That interval is the central problem behind the transactional outbox pattern. The pattern does not make a database and broker commit atomically. Instead, it moves the durable publication decision into the same database transaction as the application state change. A separate publisher later converts that recorded intent into a broker message.

Go 12 Sep 2026 4 min read

Track Goroutine Lifetimes with sync.WaitGroup.Go in Go

sync.WaitGroup.Go combines goroutine creation with task accounting. Added in Go 1.25, the method removes a small but consequential gap between incrementing a wait-group counter and starting the goroutine that will eventually decrement it. The method does not change what a WaitGroup represents. It still tracks a set of tasks and lets another goroutine block until that set is complete. The difference is that registration and goroutine launch now share one operation.

Tech 12 Sep 2026 5 min read

Touchpad Scroll Direction Changes What Your Fingers Control

Move two fingers upward on a touchpad and a page may move up on one computer but down on another. The hardware can be working normally in both cases. A scroll-direction setting changes how the operating system maps the same finger motion to a scrolling command. That distinction matters because touchpad scrolling has two separate parts: detecting a gesture and deciding what that gesture means. Reversing the direction changes the second part. It doesn’t turn a touchpad into a different kind of input device or alter the document itself.

Cybersecurity 12 Sep 2026 9 min read

Throttle Authentication Attempts Without Locking Out Users

Password authentication exposes a public decision point: a client submits a claimed identity and a secret, then the server accepts or rejects the pair. Attackers can automate that decision point at a scale no human user can match. A simple request limit helps, but authentication traffic has unusual constraints. A limit tied only to an IP address can punish thousands of legitimate users behind one gateway. A limit tied only to an account lets an attacker deliberately block a victim from signing in. A permanent account lock can turn a guessing defense into a denial-of-service primitive.

Software Engineering 12 Sep 2026 8 min read

The ABA Problem Behind Successful Compare-and-Swap

A compare-and-swap operation answers a narrow question: does a memory location contain the expected bit pattern at the instant of the atomic operation? If it does, the replacement can proceed. The operation does not establish that the location remained unchanged between an earlier read and the later comparison. That distinction creates the ABA problem. A thread observes value A, pauses, and later performs a compare-and-swap expecting A. During the pause, other work changes the location from A to B and then back to A. The comparison succeeds because the current representation matches the expected representation, even though the shared state passed through a transition that may invalidate assumptions attached to the first observation.

Artificial Intelligence 12 Sep 2026 8 min read

Test Transformer Circuits with Activation Patching

A transformer can expose a clear internal pattern without that pattern being responsible for the output under inspection. Activation patching addresses this gap by changing an internal state and measuring the downstream effect. Instead of asking whether a feature is visible at a layer, it asks whether replacing a selected state changes a defined model behavior. The method is simple in form but sensitive to experimental design. A patch has meaning only relative to the paired inputs, the patched location, the replacement value, and the output metric. Changing any of those can change the causal question being tested.

Artificial Intelligence 12 Sep 2026 9 min read

Stream Long LLM Sessions with Attention Sinks

Stream Long LLM Sessions with Attention Sinks Long-running LLM sessions create a simple resource problem: every generated token can add keys and values to the attention cache. Keep the entire history and memory use keeps growing. Keep only the newest tokens and some transformer models degrade sharply once older cache entries disappear. Attention sinks provide a useful middle ground for compatible models. Instead of retaining the full KV cache, keep a small group of initial tokens plus a moving window of recent tokens. The cache stays bounded, yet the model can remain much more stable than with a recent-token window alone.

Artificial Intelligence 12 Sep 2026 9 min read

Stabilize Image Model Predictions with Test-Time Augmentation

Stabilize Image Model Predictions with Test-Time Augmentation An image classifier can give slightly different answers when the same subject is cropped, mirrored, or resized in a way that preserves its meaning. If those transformations are valid for the task, relying on one view leaves useful evidence unused. Test-time augmentation (TTA) runs inference on several valid views of one input and combines their predictions into a final result. TTA is simple to describe, but safe use depends on details that are easy to miss. A transformation must preserve the target, structured outputs may need to be mapped back before aggregation, probability averaging can affect calibration, and every extra view consumes inference capacity.

Cybersecurity 12 Sep 2026 7 min read

SSRF Controls Must Follow the Connection

A link-preview service can reject localhost, block private IPv4 ranges, accept an ordinary public hostname, and still connect to an internal address. The gap appears when validation is treated as a property of the submitted string while the actual network request is allowed to evolve after that check. Server-side request forgery, commonly shortened to SSRF, exploits that gap. The application becomes a network client acting with its own reachability, credentials, protocol support, and trust relationships. A request that looks harmless at the HTTP boundary can acquire a very different destination through name resolution or redirection before a socket is opened.

Tech 12 Sep 2026 7 min read

SSD TRIM and Deleted Storage Space

Deleting a large file can make free space appear immediately in an operating system, yet the solid-state drive underneath may still contain the old data in flash cells for some time. The file system and the SSD are tracking different things. The file system knows which logical blocks are no longer needed; the drive manages where those blocks physically reside in flash. TRIM connects those two views. It lets an operating system tell an SSD that specified logical block addresses no longer contain data that must be preserved. The command does not act like a file shredder, and it does not directly erase every affected flash cell at the moment a file disappears.

Artificial Intelligence 12 Sep 2026 7 min read

Speculative Decoding Depends on Draft Acceptance

Autoregressive generation normally commits one token after each model pass, creating a serial dependency across the output sequence. Speculative decoding changes that execution pattern. A cheaper draft process proposes several future tokens, then the target model evaluates those proposals together and determines which tokens can be committed. The attraction is fewer serial target-model iterations per generated token. That does not make speculative decoding an automatic latency reduction. Its useful operating point depends on how cheaply candidates are produced, how many survive verification, and how much extra work the target model performs while checking them.

Go 12 Sep 2026 7 min read

Sort Go Struct Slices with slices.SortFunc

Sorting a slice of structs usually starts with a field: priority, timestamp, name, score, or some combination of them. slices.Sort can’t handle a struct because a struct has no built-in ordering relation. slices.SortFunc fills that gap by taking a comparator that defines the order for the element type. The call is compact, but the comparator is part of the program’s correctness. It has to describe a consistent ordering, and equal comparisons need deliberate handling when records have multiple fields. This article builds that comparator from simple cases to multi-field ordering and covers the mutation and stability details that tend to cause surprises.

Go 12 Sep 2026 6 min read

Sort Go Slices in Place with slices.Sort

A slice arrives out of order, and all you need is ascending numbers or strings. You don’t need a comparator or a wrapper type for that case. slices.Sort handles ordered element types directly and changes the existing slice into ascending order. That directness is useful, but the in-place behavior deserves attention. Sorting a slice can also change what another slice sees when both share the same backing array. This article covers the straightforward call first, then the details that matter once slices move between functions and components.

Artificial Intelligence 12 Sep 2026 7 min read

Soften Classification Targets with Label Smoothing

A classifier trained with one-hot targets receives a strong signal to push the target class probability toward one and every other class probability toward zero. Cross-entropy supports that behavior even after the predicted class is already correct: making the target probability more extreme can still reduce the loss. Label smoothing changes the target distribution before cross-entropy is computed. Instead of assigning all target mass to one class, it reserves a small amount for the remaining classes. This alters the gradient applied to the logits and reduces pressure toward extreme output distributions.