03-31-2021, 10:09 AM | #1 |
Custom User Title
Posts: 9,338
Karma: 63297233
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Templates: various questions not worth their own thread
I'll try to use this thread for smaller questions to avoid spamming up this section even more.
Is there any semantic difference between Code:
"foobar" in #column Code:
#column in "foobar" |
03-31-2021, 11:45 AM | #2 | |
Grand Sorcerer
Posts: 11,950
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
#column == 'foobar is a strange word' If in your situation the two always both succeed then you probably should be using '==' instead of 'in'. EDIT: Or one of the list operators. Last edited by chaley; 03-31-2021 at 02:43 PM. |
|
Advert | |
|
03-31-2021, 04:33 PM | #3 |
Custom User Title
Posts: 9,338
Karma: 63297233
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
In my case, I was doing this:
Code:
&& publisher == '(Archive of Our Own|FanFiction.net)' Code:
&& publisher in '(Archive of Our Own|FanFiction.net)' Code:
&& '(Archive of Our Own|FanFiction.net)' in publisher |
03-31-2021, 04:47 PM | #4 | |
Grand Sorcerer
Posts: 11,950
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
It seems like you are checking if some string matches some item in a list. In that case you probably should use list_contains() instead of 'in'. Something like: Code:
list_contains($publisher, ',', '^(Archive of Our Own|FanFiction.net)$', 1, '') |
|
03-31-2021, 09:59 PM | #5 |
Custom User Title
Posts: 9,338
Karma: 63297233
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I had assigned publisher = $publisher;
Also, what is the name used for these things used to avoid typing the same thing over and over again? e.g. Code:
status = $#fanficstatus; publisher = $publisher; ids = $identifiers; u = select(ids, 'url'); a = select(ids, 'ao3'); f = select(ids, 'ffnet'); |
Advert | |
|
04-01-2021, 06:53 AM | #6 | |
Grand Sorcerer
Posts: 11,950
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I should have noticed that.
Quote:
|
|
04-01-2021, 06:57 AM | #7 |
Custom User Title
Posts: 9,338
Karma: 63297233
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
"local variables" would probably work well for this.
|
04-01-2021, 08:30 AM | #8 |
null operator (he/him)
Posts: 20,948
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Grace Hopper would have called it: WORKING STORAGE
BR |
04-01-2021, 03:40 PM | #9 | |
Custom User Title
Posts: 9,338
Karma: 63297233
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question:
Quote:
|
|
04-01-2021, 04:01 PM | #10 |
Grand Sorcerer
Posts: 12,637
Karma: 74500000
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
|
04-01-2021, 04:19 PM | #11 | |
Grand Sorcerer
Posts: 11,950
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
That notation describes the "form" of valid calls of the function. It uses 'placeholders' to distinguish between different values. The notation "[, something]" says that the ", something" is optional: zero or one occurrence of what is between the brackets. The notation "[, something]*" says that it is optional but you can have zero to "a lot" of occurrences. Often "somethings" with the same name are the same thing, while "somethings" with different names are not necessarily the same thing. The notation is an approximation of a formal grammar. I tend to use approximations of EBNF grammars. In this formal system, things that are literal would be in quotes. In that case, what you referenced should be formally written Code:
'strcat' '(' expression [ ',' expression ]* ')' This template language grammar is intended to be formal. I think it is correct but I haven't put it through a grammar verifier to be sure. Taking all the above together, "strcat(a, [, b]*)" says that the literal 'strcat' is followed by:
|
|
04-02-2021, 04:11 PM | #12 |
Custom User Title
Posts: 9,338
Karma: 63297233
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Just curious: is the term "composite column" used anywhere in the Calibre UI? In the column dropdown itself, it's "columns built from other columns."
|
04-02-2021, 04:17 PM | #13 | |
Grand Sorcerer
Posts: 11,950
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
04-02-2021, 05:56 PM | #14 |
Custom User Title
Posts: 9,338
Karma: 63297233
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
|
04-03-2021, 04:57 AM | #15 |
Custom User Title
Posts: 9,338
Karma: 63297233
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
When using a template in Action Chains to set a boolean column, should I use "Yes/No" or "True/False"?
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Library Management: various questions not worth their own thread | ownedbycats | Library Management | 156 | 07-23-2024 11:45 PM |
[Metadata Source Plugin] Questions regarding parse select, docs and ref templates | Boilerplate4U | Development | 13 | 07-07-2020 02:35 AM |
Questions on Kobo [Interfered with another thread topic] | spdavies | Kobo Reader | 8 | 10-12-2014 11:37 AM |
[OLD Thread] Some questions before buying the fire. | darthreader13 | Kindle Fire | 7 | 05-10-2013 09:19 PM |
Thread management questions | meme | Feedback | 6 | 01-31-2011 05:07 PM |