[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-04 Thread 'Mark S.' via TiddlyWiki
That's great. I'm glad you can make use of it. On Friday, December 4, 2020 at 7:27:11 PM UTC-8 TW Tones wrote: > Mark, > > I thought you would do this so well, and yes the power operator, I was > about to ask for it. > > Attached I have turned it into a macro that has different ways to pass the

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-04 Thread TW Tones
Mark, I thought you would do this so well, and yes the power operator, I was about to ask for it. Attached I have turned it into a macro that has different ways to pass the values and examples, needs pre-release 5.1.23. I hope I am not too heavy "standing on your shoulders"? Tones On

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-04 Thread 'Mark S.' via TiddlyWiki
I was about to explain that the reduce operator wouldn't help because we don't have a power operator when I thought to check ... and we do! So, great idea! And now we can forget recursive! <$vars myhex=""> <$vars

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-04 Thread TW Tones
Mark et all, I think the new reduce operator may simplify this with each byte being converted at a time, making use of the accumulator and index. Regards 'Tones On Thursday, 3 December 2020 at 17:46:07 UTC+11 TW Tones wrote: > Mark, > > I have followed your code through, More testing but it

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-02 Thread TW Tones
Mark, I have followed your code through, More testing but it seems to all make sense to me now, It would be great if we could turn such code into a hierarchy chart that also recognised the list re-iterations. The information is all there so automation would be possible. In this case I can use

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-02 Thread TW Tones
Testing, Nice work, It takes a bit to follow the code, but I am sure I will learn something, thanks so much. You may see it in a Unicode database soon. Tones On Thursday, 3 December 2020 at 16:53:47 UTC+11 Mark S. wrote: > Here's a recursive version that that can be any length of hex.

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-02 Thread 'Mark S.' via TiddlyWiki
Here's a recursive version that that can be any length of hex. Lightly tested. Hopefully it's working OK. \define hex2dec2(byte,mult:1) <$vars

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-02 Thread TW Tones
Mark, Good start. I was thinking how to get 16^0 16^1 16^2 and 16^3 and you have hard coded it. If moving to a recursive process we may be able to handle variable length hex. But it is a little mind bending. Tones On Thursday, 3 December 2020 at 08:41:11 UTC+11 Mark S. wrote: > Here's my

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-02 Thread 'Mark S.' via TiddlyWiki
Ok, cleaned it up a bit: \define hex2dec2(hex) <$vars myhex=<<__hex__>> myfilter="[split[]nthsearch-replace:g[A],[10]search-replace:g[B],[11]search-replace:g[C],[12]search-replace:g[D],[13]search-replace:g[E],[14]search-replace:g[F],[15]]"> <$list filter="1 2 3 4" variable="place"> <$list

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-02 Thread coda coder
10 is the sum of 1 2 3 4 On Wednesday, December 2, 2020 at 4:20:52 PM UTC-6 coda coder wrote: > Mark... I see it. You left some debugging in there: <> > > On Wednesday, December 2, 2020 at 4:17:21 PM UTC-6 saq.i...@gmail.com > wrote: > >> If it helps there is a pad[] operator in the

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-02 Thread coda coder
Mark... I see it. You left some debugging in there: <> On Wednesday, December 2, 2020 at 4:17:21 PM UTC-6 saq.i...@gmail.com wrote: > If it helps there is a pad[] operator in the pre-release. > > On Wednesday, December 2, 2020 at 10:41:11 PM UTC+1 Mark S. wrote: > >> Here's my first attempt. It

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-02 Thread Saq Imtiaz
If it helps there is a pad[] operator in the pre-release. On Wednesday, December 2, 2020 at 10:41:11 PM UTC+1 Mark S. wrote: > Here's my first attempt. It uses the 5.1.23 search-replace filter > operator. It requires the input to be padded to 4 bytes. > > Now that I've done it, I realize it

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-02 Thread coda coder
Mark - you're adding 10 (decimal) somewhere. -> 65545 -> 10 On Wednesday, December 2, 2020 at 3:41:11 PM UTC-6 Mark S. wrote: > Here's my first attempt. It uses the 5.1.23 search-replace filter > operator. It requires the input to be padded to 4 bytes. > > Now that I've done it, I

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-02 Thread 'Mark S.' via TiddlyWiki
Here's my first attempt. It uses the 5.1.23 search-replace filter operator. It requires the input to be padded to 4 bytes. Now that I've done it, I realize it could probably be written with a recursive loop and be open ended (not needing to be padded). \define hex2dec2(hex) <$vars

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-02 Thread TW Tones
Mark, On this occasion I need to convert a 4 digit Hex to a decimal, so that I can use it in the range widget, because we cant generate a range of hex numbers. Hence this issue https://github.com/Jermolene/TiddlyWiki5/issues/5177 I think I can do it but if you know how please share. Tones

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-12-01 Thread TiddlyTweeter
Ciao Tony Mark S.' reply indicates the hex-dec translate numbers might be derivable without Evan in vanilla TW. My main point was that dealing with Unicode code points you really need to be a hexadecimal :-). It is complicated in multiple ways. A major one being that UTF-16 breaks once beyond

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-11-30 Thread 'Mark S.' via TiddlyWiki
Just for fun. Convert 0-255 to Hex. *<$vars hexlist="0 1 2 3 4 5 6 7 8 9 A B C D E F">* *<$list filter="[range[31,40]]" variable=dec>* *<$list filter="[divide[16]trunc[]add[1]]" variable="byte">* *<$list filter="[remainder[16]add[1]]" variable="bit">* *<$list

[tw5] Re: Query: RANGE Operator. Does it only work in base-10?

2020-11-30 Thread TW Tones
TT, I found a decimal source, but a simple plugin could convert between the two, in fact it could even be written in wikitext. However I believe Evans formulae plugin may have the facility, it would be nice to have it just for dealing with entities and other Hex use cases. With 16 values per