[Remind-Fans] daily MSG at 11am | randomly suppress it -- on 80% of the days?

Tim Chase remind at tim.thechases.com
Wed Mar 8 21:30:23 EST 2023


On 2023-03-08 19:17, remind-fans--- via Remind-fans wrote:
> How might I schedule a MSG daily at 11am, such that it only appears
> say 20% of the days, and have this be random?

Remind doesn't do randomness well since it would vary from run-to-run.

But you might do some sort of hard-to-detect-pattern.  I'd wanted
something similar, to have an event that repeated every N days, but
would shift around that Nth day by a "random" amount.  This is what
I used (hackish):

  # can happen up to `swing` days before d
  # 3 & 11 are relatively prime so should be harder
  # to spot repetition
  FSET jostle(d, swing) d + (( \
    wkdaynum(d) \
    + 3*(d - date(baseyr(), 1, 1)) \
    + 11*(d - date(year(d), 1, 1)) \
    ) % (1 + swing) \
    ) - swing
  REM Jan 9 2023 *10 MSG Every 10th day exactly
  REM [jostle($T, 3)] MSG Shifted forward "randomly" by up to 3 days

My goal was to check in on a friend at a regular interval without
it feeling-to-them like every N days or the Mth of each month.  By
doing this, I can have a reminder to check in on them roughly every
20 days, while still not feeling mechanical.

So you might be able to modify that to generate some
non-obvious-yet-determinatistic number, something like

  FSET pseudorandom(d) (( \
    wkdaynum(d) \
    + 11*(d - date(baseyr(), 1, 1)) \
    + 13*(d - date(year(d), 1, 1)) \
    ) % 100)

  FSET pct(d, p) pseudorandom(d) < p

  #REM MSG today [pseudorandom($T)]

  # show this on roughly 20% of days
  REM AT 11:00am SATISFY [pct($T, 20)] MSG my event

It's ugly.  It's a hack.  It's not exactly random.  It's fragile.
But it met my needs. :-)

-tim







More information about the Remind-fans mailing list