On 11 Sep 2019, at 08:47, Mohammad Rahmani <mohammad...@gmail.com> wrote:As there is no random filter (I expect to have it with math operators) in TW core, is it possible using machine clock and TW 5.1.20+ math ops create a macro to generate random numbers?
Best wishesMohammad--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/CAAV1gMA6b-EtuP4KjSWfir9jy2eAh65c-QwnvTL9kQH43qYNCw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/3DDED8BE-E801-4568-96A6-878A3B88594F%40gmail.com.
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/1453f18b-ec21-4e92-a555-34838aff3574%40googlegroups.com.
Hi Mohammad
On 11 Sep 2019, at 08:47, Mohammad Rahmani <mohamma...@gmail.com> wrote:As there is no random filter (I expect to have it with math operators) in TW core, is it possible using machine clock and TW 5.1.20+ math ops create a macro to generate random numbers?This has come up before, it might be helpful to dig up the old references.The reason there is not a simple [random[]] operator is that filter operators are supposed to be deterministic: they must return the same results for the same inputs, regardless of when they are called. This property is required for the refresh mechanism to operate correctly. In particular, using a non-deterministic filter with the list widget will cause thrashing on every refresh cycle.To make it work, one needs to add a seed operand, and initialise that value via a new action widget that can assign a random value to a tiddler. I think somebody made a plugin a few years ago to do this.Best wishesJeremy
Best wishesMohammad--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/b401dd79-e59a-4741-ac0e-3e256646d6de%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/b401dd79-e59a-4741-ac0e-3e256646d6de%40googlegroups.com.
<$button>
<$action-setfield $tiddler="$:/temp/shuffle/example" $field="state" $value=<<now "0hh:0mm:0ss">>/>
Change Order
</$button>
<$list filter="1 2 3 4 5 +[shuffle{$:/temp/shuffle/example!!state}]">
</$list>
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f0ab0dda-d31c-4cd0-8863-f6806490cbe8%40googlegroups.com.
<<now "xxx">>
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/9a97a046-3e7a-4718-afea-8c4a7a8a697a%40googlegroups.com.
<<now "xxx">>should probably be enough in many cases. It's more or less a random number between 0 and 999.
<<now XXX>>
All, I've updated my PR (https://github.com/Jermolene/TiddlyWiki5/pull/3712) to be always deterministic, using first the operand (so you can trigger updates with buttons) next a seed set to the time at startup by startup tiddler, falling back to a static/hardcoded seed.@Jeremy, there's a question on that PR for you regarding where you want that startup tiddler to belong in the core.Here's hoping we can get this over the finishline for 5.1.22!
I think, we should talk a little bit more about the specification and then about the implementation.
PMario wrote:I think, we should talk a little bit more about the specification and then about the implementation.I can't help technically.But I can comment on how I could use it...
1 - To select a number between 0000 and 3999 (use for the random showing of an external image library where images are named 0000fw.jpg through to 3999fw.jpg) .Click and next random loads. PS: There are no tiddlers for the images, its simply invocation of an external filename in a gallery.
2 - Rotation. To provide fresh content on start-up randomly loading 1 of 30 different tiddlers tagged "startup-30". They may have any title.
PMario wrote:I think, we should talk a little bit more about the specification and then about the implementation.I can't help technically.
But I can comment on how I could use it...
So, I can't help with the random number generator, my shuffle filter isn't designed to handle that.
Leading zeros using range are possible. Increment a number like 0.0001 by 0.0001 and remove the prefix "0."
hours would be 0.01
Regards
Toby
Perhaps a custom operator would help.
Regards
Tony