Skip to content

Archive / page 48

All articles

Every practical article from the Nalar archive, newest first.

Artificial Intelligence 11 Sep 2026 11 min read

Clip Gradients Relative to Parameter Scale with AGC

Clip Gradients Relative to Parameter Scale with AGC A gradient can be large in absolute terms without being large for the parameter it updates. A gradient norm of 0.1 is modest next to a parameter norm of 10, but enormous next to a parameter norm of 0.001. Ordinary gradient clipping doesn’t see that distinction: it compares gradients with a fixed threshold. Adaptive gradient clipping (AGC) uses a different reference point. It compares a gradient’s norm with the norm of the parameter unit that gradient will update. If the gradient is too large relative to the parameter, AGC rescales it before the optimizer step.

Go 11 Sep 2026 5 min read

Check Exact Values in Go Slices with slices.Contains

Code often needs a simple membership check: is this status allowed, does this short list contain a requested format, or has this identifier already appeared in a small batch? slices.Contains answers that question directly for comparable values and returns a boolean. The operation is deliberately narrow. It checks exact equality, doesn’t return a position, and scans the slice until it finds a match or reaches the end. Those details make it a good fit for some lookups and a poor fit for others.

Go 11 Sep 2026 6 min read

Check Custom Slice Ordering in Go with slices.IsSortedFunc

Sometimes you need to know whether a slice is already in the right order, not sort it again. That comes up when validating API input, checking an invariant before binary search, or avoiding unnecessary work when records are expected to arrive ordered. For plain numbers and strings, slices.IsSorted handles the common case. When the elements are structs or the ordering is application-specific, slices.IsSortedFunc lets you define exactly what “sorted” means and returns a boolean without rearranging the slice.

Tech 11 Sep 2026 8 min read

Charge Limit vs Adaptive Charging: What Each Setting Does

Battery settings increasingly offer more than a simple choice between charging and not charging. Two common approaches are a charge limit, which stops or restricts charging near a chosen level, and adaptive charging, which changes the timing of charging based on expected use. They can serve a similar goal: reducing the amount of time a rechargeable battery spends at a very high state of charge. They don’t achieve that goal in the same way, and the difference affects how much battery is available when you unplug.

Software Engineering 11 Sep 2026 9 min read

Cache-Aside Consistency: Prevent Stale Overwrites

Cache-Aside Consistency: Prevent Stale Overwrites Cache-aside is attractive because the application controls a simple protocol. A read checks the cache first. On a miss, it reads the database and places the result in the cache. A write updates the database and then invalidates or refreshes the cache. Each step is easy to describe. Concurrency makes the combined behavior less obvious. A delayed cache fill can publish an older database value after a newer write has already completed. The database remains correct, yet later readers can receive stale data from the cache. This article develops the race precisely and presents practical designs that keep an old fill from replacing a newer state.

Artificial Intelligence 11 Sep 2026 10 min read

Build Prediction Sets with Conformal Prediction

Build Prediction Sets with Conformal Prediction A classifier usually returns one label even when several labels are plausible. That is convenient for software interfaces, but it can hide uncertainty exactly where mistakes are expensive. A document router might be unsure between billing and account, yet an argmax still emits one of them. Conformal prediction offers another interface: return a set of labels sized according to the evidence. Easy inputs can produce one label. Ambiguous inputs can produce several. Under specific assumptions, the procedure also gives a finite-sample coverage guarantee.

Cybersecurity 11 Sep 2026 9 min read

Bound Password Verification Work to Resist Resource Exhaustion

Password hashing is intentionally expensive. That cost makes each offline password guess more expensive after a verifier database is stolen. The same property creates an operational risk on a live login endpoint: an unauthenticated client can ask the server to perform costly password verification again and again. A service that treats every login attempt as unlimited work can exhaust CPU, memory, worker slots, or downstream capacity before an attacker needs a valid account. The defensive goal is not to make password hashing cheap. It is to preserve a suitable password-hashing cost while placing firm limits around how much verification work the service will accept at once.

Cybersecurity 11 Sep 2026 8 min read

Block Clickjacking with an Explicit Framing Policy

A sensitive web page can have sound authentication and authorization yet still be exposed through another site’s interface. If an attacker can place that page inside a transparent or disguised frame, a signed-in user may believe they are clicking one control while their click reaches a different control in the framed application. That attack class is clickjacking, also called UI redressing. The browser is doing what both pages request; the security failure is that the sensitive application allowed an untrusted page to become part of its user interface.

Artificial Intelligence 11 Sep 2026 9 min read

Adapt Language Models with Prefix Tuning

Adapt Language Models with Prefix Tuning Full fine-tuning changes a model’s weights for each task. That can be effective, but storing and serving a separate full checkpoint for every task becomes expensive as model size and task count grow. Prefix tuning offers a different arrangement: keep the pretrained model frozen and train a small set of task-specific states that participate in attention. This article builds a practical mental model for prefix tuning, shows how it differs from text prompts and low-rank weight adapters, and explains the trade-offs that matter when training or serving several task variants.

Tech 10 Sep 2026 8 min read

Why Your Voice Sounds Different on Calls Than Recordings

Record a voice memo on your phone and then call someone from the same device. Even with the same speaker, room, and microphone, the two versions of your voice may sound noticeably different. The recording might seem fuller and more natural, while the call sounds thinner, smoother, or less detailed. That difference does not necessarily mean the microphone changes quality between tasks. A microphone is only the beginning of an audio path. After it captures sound, software can process that sound, encode it for a particular purpose, send it through a network, and process it again before another person hears it.

Tech 10 Sep 2026 8 min read

Why Your Phone Screen Can Dim When the Device Gets Hot

You can turn a phone’s brightness slider all the way up and still watch the screen become noticeably dimmer. This often happens outdoors, during navigation, while gaming, when recording video, or while charging on a hot day. The confusing part is that the brightness setting may not appear to change. The phone is not necessarily ignoring your setting or developing a display fault. It may be applying a temporary thermal limit because the device is getting too hot.

Tech 10 Sep 2026 8 min read

Why Your Device Remembers Wi-Fi Networks and When to Forget One

You connect a phone or laptop to Wi-Fi once, enter the password, and then it may reconnect for months without asking again. That convenience comes from a saved Wi-Fi network: a stored connection profile that lets the device recognise a network and reuse the information needed to join it. A saved network is more than a remembered password, and forgetting one does more than disconnect you for a moment. Understanding the difference helps when a device keeps joining the wrong network, refuses to reconnect after router changes, or seems stuck with old connection settings.

Tech 10 Sep 2026 8 min read

Why Wi-Fi Can Be Connected Without Internet

Your phone or laptop shows a strong Wi-Fi signal, yet websites will not load. The device may even say Connected, no internet. That can seem contradictory, but the two messages describe different parts of the connection. Wi-Fi connects your device to a nearby wireless network. Internet access is a separate connection beyond that local network. One can work while the other fails. Once you separate those two layers, the message becomes useful rather than confusing. It also gives you a faster way to work out whether the problem is with one device, your home network, or the internet connection itself.

Tech 10 Sep 2026 7 min read

Why Some Key Combinations Do Not Register on a Keyboard

Most of the time, a keyboard seems simple: press a key and the computer receives it. The limitation becomes more visible when you hold several keys at once. Perhaps W and Shift work together, but adding another key makes one of them disappear. Another three-key combination may work perfectly. This can happen even when every key works on its own. The reason is often not typing speed or a slow computer. Many keyboards detect keys through a shared electrical arrangement, and the design determines which simultaneous presses can be identified reliably.

Tech 10 Sep 2026 8 min read

Why Powered USB Hubs Matter for Some Devices

A USB hub seems simple: plug one cable into a computer and gain several USB ports. Then an external drive disconnects when another device is attached, a phone charges unusually slowly, or a webcam works directly from the laptop but not through the hub. The missing piece is often power. A USB connection can carry both data and electrical power, and adding ports does not automatically create more power for the devices attached to them. Understanding that distinction makes it much easier to choose between a bus-powered hub and a powered USB hub, and to troubleshoot a setup that behaves unpredictably.

Tech 10 Sep 2026 8 min read

Why Photos of Screens Show Lines, Bands, and Strange Patterns

A screen can look perfectly normal to your eyes and strangely broken in a photo. Fine ripples appear across text, dark bands cross the image, or colours show up where the display looked neutral. Taking another photo may move the pattern or make it disappear. Usually, nothing is wrong with the screen. The camera and display are both sampling visual information in their own ways, and those systems do not always line up neatly. Two effects are especially common: interference between the screen’s pixel grid and the camera sensor’s pixel grid, and timing differences between the display and the camera’s exposure.

Tech 10 Sep 2026 8 min read

Why Moving a Large File Can Be Instant or Take Minutes

Move a 20 GB video from one folder to another and it may finish almost immediately. Move the same file to an external drive and suddenly there is a progress bar, sustained disk activity, and a long wait. The difference is not mainly the file’s size. It is whether the move can be handled as a change to the file system’s records or whether the file’s actual contents must travel to another storage location.

Tech 10 Sep 2026 7 min read

Why Holding the Power Button Is Different From a Normal Shutdown

When a computer stops responding, holding its power button until the screen goes dark can get you unstuck. It can look like a faster version of choosing Shut down from the operating system, but the two actions are not equivalent. A normal shutdown gives software time to finish work and put the system into an orderly state before power is removed. A forced shutdown is an emergency exit: it ends the current session without relying on that normal sequence. That distinction explains both why holding the button can rescue a frozen computer and why it should not be your routine way to turn one off.

Tech 10 Sep 2026 8 min read

Why Downloads Usually Stop When Your Computer Sleeps

You start a large download, close the laptop lid, and return later expecting it to be finished. Instead, the download has barely moved or has failed. The internet connection may have been perfectly fine. The computer simply stopped doing the work while it was asleep. For most ordinary desktop applications, computer sleep is not the same as leaving the machine running with its screen off. Sleep is a low-power state in which normal application work is suspended. That distinction explains why downloads usually stop, why some seem to continue after waking, and why a few devices can still perform selected network tasks while apparently asleep.

Tech 10 Sep 2026 8 min read

Why Display Scaling Changes Size Without Changing Screen Resolution

A high-resolution laptop can have a sharp screen yet make text and buttons uncomfortably small. Increasing display scaling often fixes the problem without lowering the screen’s resolution. That can sound contradictory: if the same pixels are still there, how can everything become larger? The key is that modern interfaces don’t have to treat one software-sized unit as one physical screen pixel. The operating system can give text, icons, buttons, and windows more physical pixels while keeping the display at its native pixel resolution.

Tech 10 Sep 2026 7 min read

Why a Longer Charging Cable Can Charge More Slowly

A longer charging cable is convenient when the wall socket is far from a desk, bed, or sofa. Yet replacing a short cable with a long one can sometimes make a phone or other device charge more slowly, even when the charger itself has not changed. Length can contribute to that difference, but it is not the whole story. A cable carries electrical current through conductors that have resistance. Making those conductors longer generally increases their resistance, which increases voltage loss and heat for a given current. Cable construction, connector quality, supported charging standards, and the device’s own charging controls matter too.

Artificial Intelligence 10 Sep 2026 10 min read

Whiten Embeddings Without Breaking Vector Search

Whiten Embeddings Without Breaking Vector Search Embedding search can produce a vector space whose dimensions are strongly correlated or whose variance is concentrated in a few directions. When that geometry interferes with retrieval, embedding whitening is one possible post-processing step: center the vectors, rotate them into uncorrelated directions, and rescale those directions to comparable variance. The transformation is simple to describe but easy to misuse. Whitening changes the geometry that your similarity function sees. If you fit it on the wrong data, transform only one side of retrieval, or keep unstable low-variance directions, search quality can get worse even though the transformed covariance looks cleaner.

Cybersecurity 10 Sep 2026 10 min read

Validate JWTs for the Context That Will Use Them

A service receives a JSON Web Token, verifies its signature successfully, reads the user identifier, and accepts the request. That sounds reasonable, but one question is still unanswered: was this token issued for this service and this purpose? A valid signature proves something narrow. Under the expected cryptographic scheme and key, it shows that the protected token content has not been changed since it was signed by whoever controls that signing key. It does not by itself prove that your API is an intended recipient, that the token is still within its accepted lifetime, or that a token created for one workflow should be accepted by another.

Cybersecurity 10 Sep 2026 8 min read

Use Password Managers as a Phishing Signal

A phishing page can copy a real login screen closely enough that visual inspection is unreliable. The logo, wording, colours, and layout may all look familiar while the page is hosted somewhere the legitimate service does not control. If a user types a password there, the look of the page has done nothing to protect the credential. A password manager can add a different kind of signal. Instead of deciding from appearance alone, it can associate a saved credential with the website where that credential belongs and offer it only when its matching rules are satisfied. When a familiar login page appears but the expected credential is not offered, that mismatch can be a reason to stop and inspect the destination before entering anything.