Mozilla Thunderbird - Message Filters - email

In Thunderbird you have a field after each rule like:
"Subject" - "Contains" - "Value Field"
I tried searching for a documentation of some sorts but failed. What exactly is the Value Field? In the sense that if I type in "P a r t y" will it match the subject "Hello this is a P a r t y" or will it match any subject containing letters "P" , "a" , "r" , "t" and "y"?

Only "Hello this is a P a r t y". Value field is intended without quotes when you define the filter.

Related

kdb/q: generate all possible "strings" of length N

in KDB/Q, how do I generate all combinations given an alphabet universe (doesn't have to be string, could be like a list of numbers) for a given size n?
What I am looking for is similar to this in python, but in q.
How to generate all possible strings in python?
Using cross would be the easiest method:
q){y(x cross)/x}["ABC";1]
"AA"
"AB"
"AC"
"BA"
"BB"
"BC"
"CA"
"CB"
"CC"
q){y(x cross)/x}["ABC";2]
"AAA"
"AAB"
"AAC"
...

Word mail merge errors in "by category"

Please see the attachments for the mail merge issue. The result expected by me should have been:
But it turns out to be:
I believe the error is caused by the comparison in the field codes (i.e. <>) but I couldn't figure out where the error is. If I make a change to the data,
1A --> F1A
OR
1A --> A1
The error disappears. Here are the field codes:
Thanks for any help in advance!
You need to put double quotation marks around { Place2 } and { Place1 }, e.g.
"{ Place2 }"
As it is, when word does the comparison, it will evaluate values such as 1A, 2D etc. as the numbers 1 , 2 etc. Since your list starts with 1A, 1C, the comparison will be { IF 1 <> 1 } so the transition from 1A to 1C will be missed.
If you want to ensure that Word does a textual comparison, this is one reason. In fact in this scenario Word treats things that look like simple arithmetic expressions as such so if Place1 was called "2*4" and Place2 was called "8", you would get a match if you did not include the quotation marks.
There are other reasons why it is advisable to quote the comparands in an IF field when you want them to be treated as text. For example if you have the following, X is definitely "abc" and Y is definitely "def" .
{ SET X "abc" }{ SET abc "def" }{ SET Y "def" }{ X }{ Y }
But this will return "equal"
{ IF { X } = { Y } "equal" "not equal" }
whereas this will return "not equal"
{ IF "{ X }" = "{ Y }" "equal" "not equal" }
In other words, if a comparand is not quoted and evaluates to the name of a bookmark in the document, it is treated as a reference to the bookmark value and is dereferenced.

Searching for a Name in a Global using a Partial Name

I created a name global and I am trying to print out a matching name by using only using the same characters that the name starts with. Example: Enter Sm and return the value Smith, John A.
I created this:
N prompt,val
S prompt="Enter a name (LAST,FIRST MI): "
F W !,prompt R val Q:val="" D
. I val'?1.A1",".1" "1.A.1(1" "1A) W !,"Invalid name"
. E S ^ZNAME(val)=""
F S val=$O(^ZNAME(val)) Q:val="" D
. W !,"You entered: ",val
Q
I entered two names and got the desired result.^ZNAME("MITCHELL, DAVID J")^ZNAME ("SMITH, JOHN A").
I want to to be able to read a partial name and it search the ^ZNAME and return the value it matches. In this case read "Sm" and return "Smith, John A."
N partial,val
S partial="Enter a name or partial name: "
F W !,partial R val Q:val="" D
. W !,$O(^ZNAME("val"))
Q
When I enter "Sm" from the read command it loops back to Enter a name or partial name instead of giving me the desired result of Smith, John A. I am missing something I know it, but a little burnt out. Any help will be great thank you!
You've got double quotes around val:
. W !,$O(^ZNAME("val"))
Q
So it is trying to write the value at ^ZNAME("val") which there isn't one. Remove the double quotes and it should work.

Using regexp_replace how do t replace a string with an exception

How do I replace all occurrences of ' sub.*' with the exception of ' substation.*'?
regexp_replace("CleanString",' sub.*',' ', 'ig')
I have tried using various combinations of groupings () but still not getting it.
Using postgres regexp_replace()
A regular expression normally matches only things that are there, not things that are not there - you cannot simply put an "if-then-else" in there.
However, Postgres's regex support, the manual page for which is here includes "lookahead" and "lookbehind" expressions.
In your case, you want a *negative lookahead":
(?!re) negative lookahead matches at any point where no substring matching re begins (AREs only)
It's important to note the phrase "at any point" - lookarounds are "zero width", so (?!station) doesn't mean "something other than station", it means "a position in the string where station isn't coming next".
You can therefore construct your query like this:
' sub(?!station).*'
That will match any of "sub", "foo sub", " subbar", or "foo subbar", but not any of "substation", "foo substation", " substationbar", or "foo substationbar". Since the (?!station) is zero-width, and the next token is .*, it's fine for nothing to come after " sub".
If you want there to be something after the "sub", you could instead write:
' sub(?!station).+'
The .+ means "at least one of something", so it will still match " subbar" and "foo subbar", but will no longer match " sub" or "foo sub".

Alphabetizing a List

I'm looking for a way to truly alphabetize a list. Assuming it's a list of basic words, such as:BlackGreenThe RedBlueWaxyLivingPorousSolidLiquidVioletIs there a way to modify this code to alphabetize the list where "The Red" comes before "Solid"? Here's what I have so far:
SaveVar=%ClipboardAll%
Clipboard=
Send ^c
ClipWait, 0.5
Sort clipboard, CL
;Process exceptions
Sort := RegExOmit (Sort, "The")
Send ^v
Sleep 100
Clipboard=%SaveVar%
SaveVar=
return
Write a custom comparison function that ignores the starting "The " substring.
list = Black`nGreen`nThe Red`nBlue`nWaxy`nLiving`nPorous`nSolid`nLiquid`nViolet`nThe Azure
Sort , list , F Compare
MsgBox, %list%
Compare( a , b )
{
arem := RegExReplace(a, "A)The " , "" )
brem := RegExReplace(b, "A)The " , "" )
return arem > brem ? 1 : arem < brem ? -1 : 0
}
Regular expressions are used to remove the substring "The " from the string and the result stored in a temporary string, which is then used for comparison.
The substring must start at the beginning of the string, regex option A), and must include a space immediately after The.