![]() |
#1 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,104
Karma: 62844063
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" |
![]() |
![]() |
![]() |
#2 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,870
Karma: 7036359
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 | |
|
![]() |
#3 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,104
Karma: 62844063
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 |
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,870
Karma: 7036359
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, '') |
|
![]() |
![]() |
![]() |
#5 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,104
Karma: 62844063
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 | |
|
![]() |
#6 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,870
Karma: 7036359
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
#7 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,104
Karma: 62844063
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
"local variables" would probably work well for this.
|
![]() |
![]() |
![]() |
#8 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 20,798
Karma: 27405122
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Grace Hopper would have called it: WORKING STORAGE
![]() BR |
![]() |
![]() |
![]() |
#9 | |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,104
Karma: 62844063
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question:
Quote:
|
|
![]() |
![]() |
![]() |
#10 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,528
Karma: 74358018
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
|
![]() |
![]() |
![]() |
#11 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,870
Karma: 7036359
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:
|
|
![]() |
![]() |
![]() |
#12 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,104
Karma: 62844063
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."
|
![]() |
![]() |
![]() |
#13 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,870
Karma: 7036359
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#14 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,104
Karma: 62844063
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
|
![]() |
![]() |
![]() |
#15 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,104
Karma: 62844063
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 | 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 |