[tw5] Re: Selectively summing together field values?

2021-12-15 Thread Charlie Veniot
ARG!  I forgot to mention, that "regexp" bit might need some tweaking so 
that the pattern gets all, but only, the fields you are interested in.

On Wednesday, December 15, 2021 at 11:41:18 PM UTC-4 Charlie Veniot wrote:

> Hello Dave,
>
> That is no trivial thing you're trying to do.  Well, maybe somebody has a 
> trivial solution.
>
> But what a great "Brain Age" game !!!
>
> So in the meantime, download the attached and drag into tiddlywiki.com to 
> import the tiddlers and give you an opportunity to study what I've done.
>
> I've pasted the code below as reference for anything murky that needs some 
> serious explaining.
>
> It is not a trivial affair to require dynamic identification of fields 
> that need to be summed.
>
> Much easier to specify the exact fields.  Then you have a simple filter 
> like "[get[aaa1]] [get[aaa2]] ... etc. ... [get[aaaX]] +[sum[]]"
>
> Since we do not know the exact field names, then we have to dynamically 
> build that filter above.  (As per the *highlighted magic* in the code 
> below)
>
>
> Ignoring the starting and ending "pre" tags.  I'm trying that to see if 
> the code below shows up okay in TiddlyTalk (which is finicky with this kind 
> of stuff.)
>
> 
>
> \define p1() [get[
> \define p2() ]]
> \define p3() +[sum[]]
>
> <$list variable="thisField" filter="[fields[]regexp[aaa]]">
> sum of <> values:
> <$list filter="[getsum[]]">
> {{!!title}}
> 
> 
> *<$vars thisDynamicFilter={{{ 
> [fields[]regexp[aaa]addprefixaddsuffix] [] +[join[ ]] }}}>*
> <$list filter={{{ *[]* }}}>
> ''total:'' <>
> 
> 
>
> 
>
>
>
>
>
> On Wednesday, December 15, 2021 at 10:40:06 PM UTC-4 Dave Kor wrote:
>
>> Hello,  I am storing numeric data in tiddler fields and I'd like to 
>> select fields that start with lets say "aaa" and sum all their values 
>> together. I know I can use filters to select the fields i need using 
>> something like {{{ [[Data]fields[]prefix[aaa]] }}} and I can probably sum 
>> their values together using the sum[] operator. 
>>
>> However, I am stumped as to how I can get the field's value. I know the 
>> final filter would look something like {{{ =[[Data]fields[]prefix[aaa]???] 
>> +[sum[]] }}} I just do not know what operator to use to get the field 
>> values. 
>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/c949c3f0-94e5-4d22-a0cd-f5e7e0ee9694n%40googlegroups.com.


[tw5] Re: Selectively summing together field values?

2021-12-15 Thread Charlie Veniot
Hello Dave,

That is no trivial thing you're trying to do.  Well, maybe somebody has a 
trivial solution.

But what a great "Brain Age" game !!!

So in the meantime, download the attached and drag into tiddlywiki.com to 
import the tiddlers and give you an opportunity to study what I've done.

I've pasted the code below as reference for anything murky that needs some 
serious explaining.

It is not a trivial affair to require dynamic identification of fields that 
need to be summed.

Much easier to specify the exact fields.  Then you have a simple filter 
like "[get[aaa1]] [get[aaa2]] ... etc. ... [get[aaaX]] +[sum[]]"

Since we do not know the exact field names, then we have to dynamically 
build that filter above.  (As per the *highlighted magic* in the code below)


Ignoring the starting and ending "pre" tags.  I'm trying that to see if the 
code below shows up okay in TiddlyTalk (which is finicky with this kind of 
stuff.)



\define p1() [get[
\define p2() ]]
\define p3() +[sum[]]

<$list variable="thisField" filter="[fields[]regexp[aaa]]">
sum of <> values:
<$list filter="[getsum[]]">
{{!!title}}


*<$vars thisDynamicFilter={{{ 
[fields[]regexp[aaa]addprefixaddsuffix] [] +[join[ ]] }}}>*
<$list filter={{{ *[]* }}}>
''total:'' <>









On Wednesday, December 15, 2021 at 10:40:06 PM UTC-4 Dave Kor wrote:

> Hello,  I am storing numeric data in tiddler fields and I'd like to select 
> fields that start with lets say "aaa" and sum all their values together. I 
> know I can use filters to select the fields i need using something like {{{ 
> [[Data]fields[]prefix[aaa]] }}} and I can probably sum their values 
> together using the sum[] operator. 
>
> However, I am stumped as to how I can get the field's value. I know the 
> final filter would look something like {{{ =[[Data]fields[]prefix[aaa]???] 
> +[sum[]] }}} I just do not know what operator to use to get the field 
> values. 
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e867b554-ad7f-4024-89b6-18215d1b0c28n%40googlegroups.com.


SuperDuperSumming.json
Description: application/json


[tw5] Selectively summing together field values?

2021-12-15 Thread Dave Kor
Hello,  I am storing numeric data in tiddler fields and I'd like to select 
fields that start with lets say "aaa" and sum all their values together. I 
know I can use filters to select the fields i need using something like {{{ 
[[Data]fields[]prefix[aaa]] }}} and I can probably sum their values 
together using the sum[] operator. 

However, I am stumped as to how I can get the field's value. I know the 
final filter would look something like {{{ =[[Data]fields[]prefix[aaa]???] 
+[sum[]] }}} I just do not know what operator to use to get the field 
values. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d2be168e-6175-4985-85af-f07032d9df5bn%40googlegroups.com.


[tw5] Re: assigning macro output to a variable

2021-12-15 Thread Charlie Veniot
G'day,

You might be getting into some paralysis by analysis or analysis by 
paralysis (which is how I operate),
or maybe you have some programming experience that is interfering with the 
"TiddlyWiki Way" (I'm a systems analyst and software developer, and I keep 
falling into the trap of seeing macros as functions),
or I might be totally out in left field, which happens frequently.

Just to get a baseline for discussion, download the attached, drag it into 
tiddlywiki.com to import the tiddlers, and give the imported tiddlers a 
look.

Do the queries in the "Query systems" tiddler make sense?

On Wednesday, December 15, 2021 at 3:02:08 PM UTC-4 CarloGgi wrote:

> Hi everybody,
> the struggle to get TW do what I want it to do goes on hopelessly.
> I have a database of systems described by one data tiddler each, like this:
>
> system_1
>   tag: system
>   feature 11: Y/N
>   feature 12: Y/N
>   feature 13: Y/N
>   feature 14: Y/N
>
> system_2
>   tag: system
>   feature 21: Y/N
>   feature 22: Y/N
>   feature 23: Y/N
>   feature 24: Y/N
>
> as you can easily guess, the tiddlers record what features system X 
> supports or not.
> Now I want to flexibly query my database for a certain feature, so I came 
> up with this code:
>
> \define check_feature(feature) [getindex[$feature$]trim[]match[Y]]
>
> <$set name="has_feature" value=<$macrocall $name='check_feature' 
> feature='IFTTT'/> >
>   
>   <$list filter="[tag[system]filter]" variable="sys">
><$link to=<>> <>  
>   
>   
>
> 
>
> (in the example above I'm checking which systems are supported by IFTTT as 
> you can imagine...). Fair enough, the above code DOESN'T work, because you 
> cannot put a <$macrocall> widget as right-side element of the 'value' 
> element of a <$set> widget. Ok, so how do I go? I know I could instead 
> write:
>
> <$set name="has_feature" value=<> >
>
> and that would work, but I need to use the <$macrocall> widget because the 
> next step is to make the 'feature' parameter dynamically chosen via a 
> <$select> instruction, so I would need to call the macro as below:
>
> <$macrocall $name='check_feature' feature={{!!current_chosen_feature}}/>
>
> where of course field 'current_chosen_feature' wouldbe set by the 
> <$select> widget.
>
>
> Thanks in advance for helping. More and more TW seems to me like a too 
> much beautiful, too much independent woman: you love her but you cannot 
> make her listen to you...
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8630659e-aab9-48d1-92a1-0650c858c3c2n%40googlegroups.com.


QueryingSystemsDB_TW.json
Description: application/json


[tw5] assigning macro output to a variable

2021-12-15 Thread CarloGgi
Hi everybody,
the struggle to get TW do what I want it to do goes on hopelessly.
I have a database of systems described by one data tiddler each, like this:

system_1
  tag: system
  feature 11: Y/N
  feature 12: Y/N
  feature 13: Y/N
  feature 14: Y/N

system_2
  tag: system
  feature 21: Y/N
  feature 22: Y/N
  feature 23: Y/N
  feature 24: Y/N

as you can easily guess, the tiddlers record what features system X 
supports or not.
Now I want to flexibly query my database for a certain feature, so I came 
up with this code:

\define check_feature(feature) [getindex[$feature$]trim[]match[Y]]

<$set name="has_feature" value=<$macrocall $name='check_feature' 
feature='IFTTT'/> >
  
  <$list filter="[tag[system]filter]" variable="sys">
   <$link to=<>> <>  
  
  



(in the example above I'm checking which systems are supported by IFTTT as 
you can imagine...). Fair enough, the above code DOESN'T work, because you 
cannot put a <$macrocall> widget as right-side element of the 'value' 
element of a <$set> widget. Ok, so how do I go? I know I could instead 
write:

<$set name="has_feature" value=<> >

and that would work, but I need to use the <$macrocall> widget because the 
next step is to make the 'feature' parameter dynamically chosen via a 
<$select> instruction, so I would need to call the macro as below:

<$macrocall $name='check_feature' feature={{!!current_chosen_feature}}/>

where of course field 'current_chosen_feature' wouldbe set by the <$select> 
widget.


Thanks in advance for helping. More and more TW seems to me like a too much 
beautiful, too much independent woman: you love her but you cannot make her 
listen to you...


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/83ace303-f3cd-4714-bbfe-b4f1bf0b8660n%40googlegroups.com.


[tw5] Re: If your CSS isn't working ...

2021-12-15 Thread Télumire
(sorry for the double post)

@Mat : Things to look out for with inline style (that I know of) : 

   - Space after the opening 

[tw5] Re: If your CSS isn't working ...

2021-12-15 Thread Télumire
Relevant GitHub issue, for anyone willing to solve this : #6176 


*TL;DR*

This happens because tiddlywiki put all the css in one 

[tw5] Re: Need a little assistance with adjusting how tiddlers are laid out

2021-12-15 Thread Télumire
I noticed that when the preview is closed, the toolbar come back to the 
top. This is because Tiddlywiki use two containers, one for the editor 
without the preview, and the second to display the editor with the preview.

If you want the layout to stay the same with and without preview, use this :

.tc-dropzone-editor>.tc-reveal,.tc-tiddler-preview{
display:flex;
flex-direction:column-reverse;
}

.tc-tiddler-preview>*
{
margin:0!important;
width:auto!important;
}

/*optional : prevent scroll bar in the text editor*/
.tc-edit-texteditor {
object-fit: contain;
overflow-y:hidden;
}


And if you want to support the code mirror addon too, use this :

.tc-dropzone-editor>.tc-reveal,.tc-tiddler-preview, 
.tc-edit-tags~.tc-reveal{
display:flex;
flex-direction:column-reverse;
}

.tc-tiddler-preview>p {
display:contents;
}

.tc-tiddler-preview>*,.tc-tiddler-preview>p>*{
margin:0!important;
width:100%!important;
}

/*optional : prevent scroll bar in the text editor*/
.tc-edit-texteditor {
object-fit: contain;
overflow-y:hidden;
}

Le mardi 14 décembre 2021 à 14:36:32 UTC+1, justin.hu...@gmail.com a écrit :

> perfect! thank you :D
>
> On Sunday, December 12, 2021 at 4:48:23 PM UTC-5 Télumire wrote:
>
>> You can use this style : 
>>
>> .tc-tiddler-preview{
>> display:flex;
>> flex-direction:column-reverse;
>> }
>>
>> .tc-tiddler-preview>*
>> {
>> margin:0!important;
>> width:100%!important;
>> }
>>
>> In a tiddler with the tag $:/tags/Stylesheet.
>> Enjoy ! :)
>> Le samedi 11 décembre 2021 à 11:31:04 UTC+1, justin.hu...@gmail.com a 
>> écrit :
>>
>>> I'm currently using the very basic version of JD's Mobile plugin, as I 
>>> aim to use my TW from my phone, but I'm not sure what I need to do in order 
>>> to achieve what I've mocked up below.
>>>
>>> I'd like to just figure out  a way to make a separate stylesheet to 
>>> apply these changes without having to make any changes to JD's plugin if 
>>> possible.
>>>
>>> any help with this would be greatly appreciated!
>>>
>>> [image: Before.PNG][image: After.PNG]
>>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/c5b0528e-3aea-42b1-a294-ac9ae7db0915n%40googlegroups.com.


[tw5] Re: If your CSS isn't working ...

2021-12-15 Thread Mat
LOL, yeah, as PMario points out, a new feature was just introduced for 
*exactly* that.

Another CSS hair-puller is when I sometimes test styling by using local 
styleblocks. A local styleblock is obviously superior to avoid going back 
and forth between a dedicated stylesheet tiddler. Well, on some occasions 
things mysteriously don't work... and, much hair later, it turns out the 
styling *demands *a dedicated stylesheet to work. It makes no sense to me, 
but OK, c'est la vie. Just like baldness. My avatar indicates how much CSS 
I've fumbled around with.

<:-)
On Tuesday, December 14, 2021 at 6:05:25 PM UTC+1 cj.v...@gmail.com wrote:

> I just spent the last hour trying to figure out why some CSS  wasn't 
> working.
>
> My TiddlyWiki has 3 CSS tiddlers.
>
> The CSS in "Tiddler B" has nothing wrong with it at all.
>
> Turns out that the CSS in "Tiddler B" was not getting applied because the 
> last line of CSS in "Tiddler A" was missing a lousy "}".  So all of the 
> styling in Tiddler A was being applied, but the styling in Tiddler B was 
> not happening because of the missing "}" at the end of Tiddler A.
>
> So heads up.  What may seem like a problem with CSS in one tiddler may 
> actually be an issue with the CSS in some other tiddler.
>
> Now, how to reattach all of this hair ...
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d2a886e1-b5ba-4980-8c96-cded5ece11dfn%40googlegroups.com.