Hacker News Viewer

Valanza – my Unix way for weight tracking and anlysis

by lallero317 on 1/29/2026, 3:08:11 PM

https://github.com/paolomarrone/valanza

Comments

by: criticas

Nice idea, but &quot;small composable programs&quot; includes R scripts? That&#x27;s great if you&#x27;re already using R, a bit much to install if you&#x27;re not.<p>You could simplify things by cribbing from the Hacker&#x27;s Diet (<a href="https:&#x2F;&#x2F;www.fourmilab.ch&#x2F;hackdiet&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.fourmilab.ch&#x2F;hackdiet&#x2F;</a>) and using an exponentially weighted moving average as your filter. 10% of today&#x27;s weight + 90% yesterday&#x27;s EWMA. That&#x27;s almost a one-liner in awk or perl, or a simple function in bash.<p>Copilot suggests: awk &#x27;BEGIN{alpha=0.1} NF&gt;=2 { date=$1; w=$2; if (NR==1) ewma=w; else ewma=alpha*w + (1-alpha)*ewma; printf &quot;%s\t%g\t%.6f\n&quot;, date, w, ewma }&#x27; input.txt

2/2/2026, 5:58:16 PM


by: MisterTea

A friend did similar using rc on Plan 9: <a href="https:&#x2F;&#x2F;shithub.us&#x2F;rodri&#x2F;rcfitness&#x2F;HEAD&#x2F;info.html" rel="nofollow">https:&#x2F;&#x2F;shithub.us&#x2F;rodri&#x2F;rcfitness&#x2F;HEAD&#x2F;info.html</a>

2/2/2026, 6:09:00 PM


by: erikgahner

Great stuff! You can make minor adjustments to the R-script so you do not need to rely on {dplyr} and {tidyr}. For example, use merge() instead of left_join() and use the base pipe, |&gt;, instead of the magrittr pipe, %&gt;%.

2/2/2026, 6:02:14 PM


by: hilti

Love your approach: small, composable programs working together through pipes!

2/2/2026, 4:55:46 PM