alt.hn

1/29/2026 at 3:08:11 PM

Valanza – my Unix way for weight tracking and anlysis

https://github.com/paolomarrone/valanza

by lallero317

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

Nice idea, but "small composable programs" includes R scripts? That's great if you're already using R, a bit much to install if you're not.

You could simplify things by cribbing from the Hacker's Diet (https://www.fourmilab.ch/hackdiet/) and using an exponentially weighted moving average as your filter. 10% of today's weight + 90% yesterday's EWMA. That's almost a one-liner in awk or perl, or a simple function in bash.

Copilot suggests: awk 'BEGIN{alpha=0.1} NF>=2 { date=$1; w=$2; if (NR==1) ewma=w; else ewma=alpha*w + (1-alpha)*ewma; printf "%s\t%g\t%.6f\n", date, w, ewma }' input.txt

by criticas

2/2/2026 at 8:57:23 PM

For the giggles:

nice idea, but "small composable programs" includes perl scripts? That's great if you're already using perl, a bit much to install if you're not.

There shouldn't be any burden of portability for the one writing small tools like these. You're free to rewrite it, of course, but expecting someone to go out of their way to stay within the unix/posix/whatever environment seems a bit much given the context of an unpaid endeavor.

by ablob

2/2/2026 at 7:54:14 PM

I don't think "small" has ever been meant to include the runtime. Is R much more complex of a runtime than awk perl or bash?

by dooglius

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

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, |>, instead of the magrittr pipe, %>%.

by erikgahner

2/2/2026 at 8:36:40 PM

Note. In southern Italian lingos, "valanza" means "scale".

by notorandit

2/2/2026 at 8:51:26 PM

Same root as valence surely

by renewiltord

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

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

by hilti