![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Horner formally leaves Red Bull with £52m pay-off
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
'Norris misses opportunity in chaotic qualifying'
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
How to follow Singapore Grand Prix on the BBC
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Left field
no other left field surprises in tomorrow’s strip early on patreon?
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Listen to our Singapore GP preview
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Alonso on ‘only question mark’ about Aston Martin F1 project
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Tsunoda's skills ‘in line with top drivers' says Permane
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
5 storylines we're excited about ahead of Singapore
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Hamilton pays tribute after his dog Roscoe dies
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Blocking detected when there shouldn’t be – Vivaldi Browser snapshot 3822.3
Changelog
- [Ad Blocker] Blocking detected when the blocker is disabled (VAB-11782)
- [Address field] Should prioritize search result when autocomplete disabled (VB-120142)
- [Address field] When using @tabs, switch tab instead of opening the link in the active tab (VB-120253)
- [Address field][Search] Hiding search engine nicknames in address bar breaks keyboard shortcuts (VB-120516)
- [Crash][Ad Blocker] When trying to login to X with blocker enabled (VAB-11756)
- [Linux][Wayland][Tabs] Drag outside window issues (VB-120222)
- [Mail] Apply new note editor style to composer toolbar (VB-120543)
- [Reader Mode] Read time is not properly detected (VB-81768)
- [Tabs][Tab Button] Add a “do not show again” for tips in new tab button (VB-120374)
- [Tabs][Tab Stacks] Displacement when moving a tab in accordion mode (VB-94576)
- [Updates] Update button briefly appears during checks (VB-120626)
Download (3822.3)
- Windows 10+ 64-bit
- Windows 10+ ARM64
- macOS 12+
- Linux 64-bit: DEB | RPM | TAR [*]
- Linux ARM64: DEB | RPM | TAR [*]
Main photo by Djordje Gajic.
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Hamilton announces passing of beloved dog Roscoe
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Wolff reveals extent of summer talks with Verstappen
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
A smart film about confronting outrageous stereotypes
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Some of music history’s most shocking stories revealed
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
CodeSOD: Contracting Space
A ticket came in marked urgent. When users were entering data in the header field, the spaces they were putting in kept getting mangled. This was in production, and had been in production for sometime.
Mike P picked up the ticket, and was able to track down the problem to a file called Strings.java
. Yes, at some point, someone wrote a bunch of string helper functions and jammed them into a package. Of course, many of the functions were re-implementations of existing functions: reinvented wheels, now available in square.
For example, the trim
function.
/**
* @param str
* @return The trimmed string, or null if the string is null or an empty string.
*/
public static String trim(String str) {
if (str == null) {
return null;
}
String ret = str.trim();
int len = ret.length();
char last = '\u0021'; // choose a character that will not be interpreted as whitespace
char c;
StringBuffer sb = new StringBuffer();
for (int i = 0; i < len; i++) {
c = ret.charAt(i);
if (c > '\u0020') {
if (last <= '\u0020') {
sb.append(' ');
}
sb.append(c);
}
last = c;
}
ret = sb.toString();
if ("".equals(ret)) {
return null;
} else {
return ret;
}
}
Now, Mike's complaint is that this function could have been replaced with a regular expression. While that would likely be much smaller, regexes are expensive- in performance and frequently in cognitive overhead- and I actually have no objections to people scanning strings.
But let's dig into what we're doing here.
They start with a null check, which sure. Then they trim the string; never a good sign when your homemade trim
method calls the built-in.
Then, they iterate across the string, copying characters into a StringBuffer
. If the current character is above unicode character 20- the realm of printable characters- and if the last character was a whitespace character, we copy a whitespace character into the output, and then the printable character into the output.
What this function does is simply replace runs of whitespace with single whitespace characters.
"This string"becomes
"This string"
Badly I should add. Because there are plenty of whitespace characters which appear above \u0020
- like the non-breaking space (\u00A0
), and many other control characters. While you might be willing to believe your users will never figure out how to type those, you can't guarantee that they'll never copy/paste them.
For me, however, this function does something far worse than being bad at removing extraneous whitespace. Because it has that check at the end- if I handed it a perfectly good string that is only whitespace, it hands me back a null.
I can see the argument- it's a bad input, so just give me back an objectively bad result. No IsNullOrEmpty
check, just a simple null check. But I still hate it- turning an actual value into a null
just bothers me, and seems like an easy way to cause problems.
In any case, the root problem with this bug was simply developer invented requirements: the users never wanted stray spaces to be automatically removed in the middle of the string. Trimmed yes, gutted no.
No one tried to use multiple spaces for most of the history of the application, thus no one noticed the problem. No one expected it to not work. Hence the ticket and the panic by users who didn't understand what was going on.
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
28sep2025
Kefir is an independent compiler for the C17/C23 programming language, developed by Jevgenij Protopopov.
Tracing Just-in-Time Compilation for Effects and Handlers (PDF), by Marcial Gaissert, CF Bolz-Tereick, and Jonathan Immanuel Brachthäuser.
Cap’n Web: a new RPC system for browsers and web servers, by Kenton Varda and Steve Faulkner.
ocrs is a Rust library and CLI tool for extracting text from images, also known as OCR (Optical Character Recognition). Uses a small neural network model.
The 100 MHz 6502, by Jürgen Müller. Same footprint as the original!
Writing an operating system kernel from scratch, by Uros Popovic. In Zig for RISC-V.
Ceu is a synchronous programming language that reconciles Structured Concurrency with Event-Driven Programming.
Jiff is a datetime library for Rust.
Some interesting stuff I found on IX LANs, by Benjojo.
The Naming of Tack Symbols in Unicode. Aggravating!
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Brewster Rockit - 2025-09-29
Comic strip for 2025/09/29