<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ashok Ram on Medium]]></title>
        <description><![CDATA[Stories by Ashok Ram on Medium]]></description>
        <link>https://medium.com/@ashokramsi?source=rss-8d494d4b6ba1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*IDuivSOXibQTEdM1bwj9zw.jpeg</url>
            <title>Stories by Ashok Ram on Medium</title>
            <link>https://medium.com/@ashokramsi?source=rss-8d494d4b6ba1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 06:04:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ashokramsi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[When the First Row Decides for Everyone]]></title>
            <link>https://medium.com/@ashokramsi/when-the-first-row-decides-for-everyone-19db7ba2e77a?source=rss-8d494d4b6ba1------2</link>
            <guid isPermaLink="false">https://medium.com/p/19db7ba2e77a</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Ashok Ram]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 05:32:21 GMT</pubDate>
            <atom:updated>2026-11-24T05:32:21.765Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Quick note: I wrote this with help from an AI writing tool. Every fact in it comes from the pull request and its review on GitHub.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aGmO5ZZqI8S5SohH.png" /></figure><p>On the first morning of a workshop, the organiser prints name tags as people arrive. The first person through the door is called Al, and the organiser decides every tag will be just big enough for “Al”. By the time Maximiliana walks in, the tags are wrong for most of the room.</p><p>That, more or less, is what was happening inside Grafana’s tables.</p><p>Grafana is an open source tool people use to build dashboards: charts, graphs and tables that show what’s going on in their systems. One kind of table cell is a gauge, a bar with the number written beside it. The rule is simple. Bigger number, longer bar.</p><p>A user named seriych reported that the rule had broken. Given 1, 8.88, 9 and 9.22, the longest bar went to 9. In a second example, the same two numbers sorted in opposite orders gave different bars in each column, and both were wrong. That’s <a href="https://github.com/grafana/grafana/issues/113304">issue #113304</a>. I picked it up, and my fix became <a href="https://github.com/grafana/grafana/pull/136236">grafana/grafana#136236</a>.</p><h3>Room for words, room for bars</h3><p>A gauge cell is only so wide, and the bar and its text split that width between them. For a fair comparison, the text area has to be identical in every cell of the column, and wide enough for its longest number. The bar gets whatever is left.</p><p>Grafana finds that longest number by looking ahead through the column. Reading that look ahead is where it clicked for me. It was meant to keep the longest value it came across, but the comparison was written the wrong way round. It reacted to shorter values instead of longer ones, and when it reacted, it simply wrote back the value it already had. So it never got past the first row.</p><p>The first row was “1”, a single character, so the room for text started out one character wide. Later cells could still stretch it a little, depending on when each one was drawn. In the end, cells saved different amounts of room, and the bars no longer told you anything about the numbers.</p><p>In code, the whole problem sat in one character, a &gt; where a &lt; belonged:</p><pre>if (formattedValueToString(alignmentFactor).length &gt; formattedValueToString(nextDisplayValue).length) {</pre><p>The surprising part: two of the existing tests expected the wrong answer. They checked that the longest of 1, 22, 333 and 4444 was “1”. The bug had been written down as the expected behaviour, so my fix had to correct those tests as well.</p><h3>Correct, but not finished</h3><p>My first version turned the comparison around and copied the longer value whenever it found one. The reviewer, fastfrwrd, agreed it was correct and still asked for changes. Each copy was a new object in memory, and up to 999 of them could be made and thrown away in one scan, in a part of the table where that kind of waste matters a great deal for how responsive it feels. The better way was to remember which value was longest and how long it was, then make one copy at the very end.</p><p>I reworked it that way and added a test that each row is formatted only once. fastfrwrd approved it and merged it.</p><h3>What it taught me</h3><p>Order quietly matters. When code lets the first thing it sees set the rules, whatever happens to arrive first wins, and the bug changes shape when the data is sorted differently. That’s exactly what made this one look so strange from the outside.</p><p>Tests can carry bugs too. A test is only as right as the expectation someone wrote into it.</p><p>And a review can keep going after “it works”. Code that runs for every cell on the screen deserves one more question: what does each pass cost?</p><p>What’s the strangest thing you’ve found an old test expecting?</p><p>The full story, with all the code, is on my blog: <a href="https://ashokramsi.hashnode.dev/grafana-tableng-alignment">https://ashokramsi.hashnode.dev/grafana-tableng-alignment</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19db7ba2e77a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Settings File That Arrived One Step Too Late]]></title>
            <link>https://medium.com/@ashokramsi/the-settings-file-that-arrived-one-step-too-late-dc0451ebd0f7?source=rss-8d494d4b6ba1------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc0451ebd0f7</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ashok Ram]]></dc:creator>
            <pubDate>Mon, 23 Nov 2026 05:24:05 GMT</pubDate>
            <atom:updated>2026-11-23T05:24:05.040Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Quick note: I wrote this with help from an AI writing tool. Every fact in it comes from the pull request and its review on GitHub.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uzHqC4l44jFpq7OP.png" /></figure><p>Some bugs don’t crash anything. They just quietly do less than you asked.</p><p>A developer, yersan, had a Java project built with Quarkus, a framework for building web services. The project used gRPC, a way for programs to call each other over the network, and it asked Quarkus to generate Java code from message definitions kept in a shared library. That request lived in a single line of the app’s settings file. When yersan built the project the normal way, the generated code showed up. When they started Quarkus’s dev mode, the mode that runs the app and reloads it as you edit, the code never appeared. The report is <a href="https://github.com/quarkusio/quarkus/issues/57633">issue #57633</a>. I picked it up, and my fix is <a href="https://github.com/quarkusio/quarkus/pull/57866">quarkusio/quarkus#57866</a>.</p><h3>An actor with no props</h3><p>The report already held the key clue, right in the build log. Two steps ran in this order: first “generate code”, then “copy resources”. That second step is the one that puts the settings file where the code generator reads it.</p><p>So the generator walked on stage before the props were set. It reached for its settings, found an empty table, and carried on with nothing to generate. The build didn’t stop. The classes just weren’t there.</p><p>The interesting question was why the order flipped only in dev mode.</p><h3>Who decides what goes first</h3><p>Quarkus projects are built with Maven, Java’s long standing build tool. Maven splits a build into stages, and several small jobs can share a stage. When two jobs share one, Maven follows a quiet rule: each job carries a priority number, and the lower number goes first. For Quarkus projects, that rule puts “copy resources” ahead of “generate code”. I ran plain Maven on a small test app to be sure, and it got the order right.</p><p>Dev mode works differently. It takes those early jobs into its own hands. Reading that part of the code is where it clicked for me: dev mode lined the jobs up in the order their plugins are declared in the project, and never looked at the priority at all. The Quarkus plugin is written in the project file by hand, while the resources plugin is something Maven supplies automatically, and it lands later in the list. So code generation went first, every single time.</p><h3>Following the rule instead of the symptom</h3><p>The tempting fix was to special case gRPC, or to nudge one job ahead of the other. But the real problem was bigger than gRPC: dev mode was doing part of Maven’s work without using Maven’s rule. So the fix was to sort each stage’s jobs by priority, just as Maven does:</p><pre>executions.sort(Comparator.comparingInt(pe -&gt; pe.execution.getPriority()));</pre><p>In words: line the jobs up by their priority number. Jobs with the same number keep their old order, so nothing else gets shuffled. Because the rule is general, the same mismatch on the testing side went away too, without any extra work.</p><p>Review made it better. My first version still had an older trick that pushed one special job to the front of the line, on top of giving it the lowest priority. cescoffier asked why I was keeping it. Fair question: two mechanisms were doing one job, so the old one went. aloubyansky then wanted to know what that special priority was for in the first place. The answer, that without it compiling could start before the generated code existed, went into the review thread rather than the code. gsmet approved as well, and aloubyansky merged the change.</p><h3>What it taught me</h3><p>When one piece of software stands in for another, it has to follow the same rules, including the ones nobody writes on the front page. Ordering rules are the easiest to miss, because things often work fine in whatever order they happen to arrive.</p><p>And a good review question is often about taking something away. “Why keep this?” made the change smaller and easier to read.</p><p>When did a shortcut in one of your tools last surprise you, and what gave it away?</p><p>The full story, with all the code, is on my blog: <a href="https://ashokramsi.hashnode.dev/quarkus-dev-mode-goal-order">https://ashokramsi.hashnode.dev/quarkus-dev-mode-goal-order</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc0451ebd0f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Asked for Everything and Got Nothing Back]]></title>
            <link>https://medium.com/@ashokramsi/i-asked-for-everything-and-got-nothing-back-ba3639e56440?source=rss-8d494d4b6ba1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba3639e56440</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[julia]]></category>
            <dc:creator><![CDATA[Ashok Ram]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 04:15:53 GMT</pubDate>
            <atom:updated>2026-11-22T04:15:53.613Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Quick note: I wrote this with help from an AI writing tool. Every fact in it comes from the pull request and its review on GitHub.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iFn3gTXsI3iThWfe.png" /></figure><p>There’s a little trick programmers use all the time. When a function wants to know “how many?” and the honest answer is “all of them”, you hand it the biggest number the language can hold. No limit, problem solved.</p><p>In Julia, a programming language used a lot in science and data work, that number is called typemax(Int). It&#39;s a 19 digit number, far bigger than any text you&#39;ll ever have. So asking for the first typemax(Int) characters of a string should give you the whole string back. Usually it did. But a bug report, <a href="https://github.com/JuliaLang/julia/issues/64143">issue #64143</a> from MilesCranmerBot, showed that if the text contained a single é, you got back an empty string instead. The word &quot;abc&quot; came back fine. The letter &quot;é&quot; vanished.</p><p>I picked it up, and the fix became <a href="https://github.com/JuliaLang/julia/pull/64370">JuliaLang/julia#64370</a>.</p><h3>A letter that takes up two seats</h3><p>The first clue is how computers store text. An ordinary English letter fits in one byte. A letter like é needs two. Julia keeps track of positions in a string by byte, so “é” is one letter sitting in two seats.</p><p>To find where the first so many letters end, Julia walks along the string one seat at a time, counting down each time a new letter starts. If it runs out of string before it runs out of count, it adds the leftover count to where it stopped. That’s deliberate: past the end, each extra step just moves one seat further.</p><p>With “abc”, every letter is one seat, so the count shrinks at every step, and the final sum lands exactly on the biggest number. With “é”, the second seat isn’t a new letter, so the count shrinks one step less. The final sum comes out one higher than the biggest number.</p><h3>The odometer moment</h3><p>This is the part that explains everything. A whole number like this one in Julia has a fixed size, like the dials on an old car odometer. When you push it one past the top, it doesn’t grow. It rolls over. And in this case it rolls over to the most negative number possible.</p><p>So Julia was told to stop cutting at a huge negative position. Cutting a string from the start to a negative position gives you nothing. That’s the empty string.</p><p>The fix was to make that one sum stop at the top instead of rolling over. Programmers call that saturating, the way a volume knob stops at its maximum:</p><pre>return n &gt; typemax(Int) - i ? typemax(Int) : i + n</pre><p>In words: if adding would go past the biggest number, just answer with the biggest number. Because the fix sits in the shared counting step, it also repaired a second feature that splits text into chunks and had been failing on the same input.</p><p>vtjnash approved the change and left a note on where this counting past the end came from in Julia’s early design. IanButterworth merged it.</p><h3>What it taught me</h3><p>Two things I’m taking from this one.</p><p>A stand in for infinity is still a finite number. It works perfectly until something adds to it, and then it fails in a confusing way: quietly, with an answer that looks plausible. An empty string doesn’t scream “overflow”.</p><p>And the bug hid behind ordinary English. Any example with plain letters worked, because plain letters happened to keep the sum exactly at the edge. It took one accented letter to push it over. If your users write in more than one language, so should your tests.</p><p>Have you ever used a “biggest possible number” as a shortcut and had it come back to bite you?</p><p>The full story, with all the code, is on my blog: <a href="https://ashokramsi.hashnode.dev/julia-nextind-saturate">https://ashokramsi.hashnode.dev/julia-nextind-saturate</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba3639e56440" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Space That Changed the Math]]></title>
            <link>https://medium.com/@ashokramsi/a-minus-sign-before-an-scss-interpolation-that-biome-read-as-math-8c23b0396c49?source=rss-8d494d4b6ba1------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c23b0396c49</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[sass]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Ashok Ram]]></dc:creator>
            <pubDate>Fri, 20 Nov 2026 03:40:00 GMT</pubDate>
            <atom:updated>2026-11-23T07:26:18.148Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Quick note: I wrote this with help from an AI writing tool. Every fact in it comes from the pull request and its review on GitHub.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8XrtPFzDCmRlzA18.png" /></figure><p>A code formatter is one of the quietest helpers in programming. You hand over messy code, and you get the same code back with neat spacing. The deal is that only the look changes. If a formatter ever changes what your code does, something has gone wrong.</p><p>That’s what happened in Biome, which tidies and checks code for websites. A developer named ogardner-stackcx noticed it in a stylesheet and reported it as <a href="https://github.com/biomejs/biome/issues/12957">issue #12957</a>. I picked it up, and the fix was merged as <a href="https://github.com/biomejs/biome/pull/12983">biomejs/biome#12983</a>.</p><h3>Three margins and a space</h3><p>The stylesheet was written in SCSS, a version of CSS that adds things like variables. Before a browser can use it, Sass compiles it down to ordinary CSS. The reporter had stored a size, 8px, in a variable and wanted three negative margins of that size, followed by auto.</p><p>Biome added a space after two of the minus signs. To the eye, nothing changed. To Sass, everything did. The original became three negative values and auto, exactly as intended. Biome&#39;s version became one long subtraction, which Sass squashed into -8px-8px-8px. That isn&#39;t valid CSS, so the browser threw away the line, and the element lost its margin.</p><p>Think of a weather forecast that lists the next three nights as -5 -3 -1. Anyone reading it sees three temperatures. Now imagine an overeager editor tidying the spacing to -5 - 3 - 1. It looks almost the same, but it now reads as a sum that comes to minus nine. The numbers are all there. The meaning is gone.</p><h3>Reading before writing</h3><p>The real story is where the bug lived. Biome doesn’t format text directly. First it reads the code and builds a structure saying what every piece means: this is a value, this is a list, this minus is subtraction. Programmers call that step parsing. Only then does it print the structure back out, neatly.</p><p>The printing step was blameless. It received a structure that said “subtraction” and printed a subtraction, spaces and all. The reading step had made the call: it treated a minus sign that followed a space and sat right against the next value as subtraction, when Sass treats it as the start of a new item in the list.</p><p>So the fix went into the reading step. When Biome sees a minus with a space before it and an interpolation, written #{, directly after it, it now reads that minus as the start of the next value:</p><pre>if !p.at_ts(SCSS_BINARY_OPERATOR_TOKEN_SET) || is_at_scss_negated_interpolation_list_item(p) {</pre><p>In plain words: if this isn’t an operator at all, or it’s one of these list item minus signs, don’t treat it as math.</p><h3>Seventeen more in the tests</h3><p>When I ran the parser’s whole test suite, one saved result changed. It held a long list of subtraction examples, and 17 of them had the same shape as the bug. I checked each against Sass’s official tests, and Sass reads all 17 as separate values, not subtraction. So the fix corrected those too.</p><p>The review was quick: ematipico merged it within the hour, and Biome 2.6.6, released the same day, included it.</p><h3>What it taught me</h3><p>When a tool that’s supposed to preserve meaning changes it, look at how the input was understood, not at how the output was written. In this case, the writer was faithfully writing down a misunderstanding.</p><p>And small symbols carry a lot of weight. A space, in the wrong place, is the difference between a list and a sum.</p><p>Has a tool ever “tidied” something of yours and quietly changed what it meant?</p><p>The full story, with all the code, is on my blog: <a href="https://ashokramsi.hashnode.dev/biome-scss-negative-interpolation">https://ashokramsi.hashnode.dev/biome-scss-negative-interpolation</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c23b0396c49" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Folder That Hid Itself]]></title>
            <link>https://medium.com/@ashokramsi/one-in-taurignore-and-tauri-dev-watched-nothing-5517cdb7ee8b?source=rss-8d494d4b6ba1------2</link>
            <guid isPermaLink="false">https://medium.com/p/5517cdb7ee8b</guid>
            <category><![CDATA[tauri]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ashok Ram]]></dc:creator>
            <pubDate>Thu, 19 Nov 2026 20:41:23 GMT</pubDate>
            <atom:updated>2026-11-23T07:24:09.313Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Quick note: I wrote this with help from an AI writing tool. Every fact in it comes from the pull request and its review on GitHub.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*442WmzwQFkO7pIDB.png" /></figure><p>Every developer tool has a part you forget about until it quietly stops working. For people building desktop apps with Tauri, that part is the file watcher.</p><p>Tauri turns a web page and some Rust code into a desktop app. While you build, a command called tauri dev runs your app and watches your files. Save a change, and it rebuilds and restarts the app for you. You stop thinking about it after the first day.</p><p>In March 2024, a developer named anatawa12 opened <a href="https://github.com/tauri-apps/tauri/issues/9163">issue #9163</a> about exactly that kind of silence. They’d written a small settings file called .taurignore to tell the watcher which files to skip, and with that file in place, saving their code no longer triggered a rebuild.</p><p>That one became mine to fix, and the change was merged as <a href="https://github.com/tauri-apps/tauri/pull/16398">tauri-apps/tauri#16398</a>.</p><h3>A box marked “toss everything except the photos”</h3><p>The reporter’s file was an allow list. Instead of naming the few things to skip, it skipped everything at the top of the app folder, then named the few things to bring back: the source code and a few project files. The first line, /*, is the &quot;skip everything&quot; part.</p><p>Imagine labelling a moving box “toss everything in here except the photos”, then coming back to find the whole box out by the bin, photos and all. That’s what happened. The rule was meant to apply to the contents. The tool applied it to the container too.</p><p>The best clue was already in the report. The same lines, used as a .gitignore (the file that tells git what to leave out), behaved exactly as intended. So the question became: what does git do differently?</p><h3>The answer</h3><p>Git’s rules only ever reach the things inside an ignore file’s folder, never the folder itself.</p><p>Tauri’s watcher had an extra step: it checked each folder it was about to watch against the rules first. The library it uses reads every pattern relative to the ignore file’s own folder. Asked about that very folder, there’s nothing left to compare, just an empty path, and the “skip everything” pattern happens to match an empty path too. The app folder was written off before anyone looked inside it for the things the file had brought back.</p><h3>Two fixes</h3><p>So my first fix made Tauri copy git: an ignore file no longer got a say about its own folder. It worked, and a test built from the reporter’s own file proved it.</p><p>Legend-Master, one of the people who look after Tauri, asked for changes. In his view a special case for that one pattern didn’t make sense here, and he raised a different possibility: keep watching the folders no matter what, and throw away unwanted change events when they show up.</p><p>That suggestion changed the shape of the fix. I’d been making a question give the right answer. His idea meant the question didn’t need asking. A folder you tell Tauri to watch should be watched. The ignore rules are about what’s in it. I reworked the PR that way: Tauri now always walks its watch folders, watches whatever inside them the rules allow, and keeps filtering each change as it arrives. Both he and FabianLars signed off, and it reached users in release 2.12.5 of Tauri’s command line tool.</p><h3>What it taught me</h3><p>When something works in one tool and not in another, the difference between the two is usually where the bug lives. Asking “what does git do here?” pointed straight at the folder.</p><p>And when a fix makes a tricky check smarter, it’s worth asking whether the check should exist. My first version worked. The merged one was simpler, because the question that caused the bug isn’t asked anymore.</p><p>Have you ever had a review make a fix simpler by taking a check away instead of adding one?</p><p>The full story, with all the code, is on my blog: <a href="https://ashokramsi.hashnode.dev/one-in-taurignore-and-tauri-dev-watched-nothing">https://ashokramsi.hashnode.dev/one-in-taurignore-and-tauri-dev-watched-nothing</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5517cdb7ee8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>