Date   

moderated Re: replace something with a tab (^T or \t) [7.2/fv] #bugs questionmark #bugs

John Shotsky
 

No problem! I remember when I forgot the backslash on \d in a class, and could not understand why the clip would not work-for hours...we all do that.
Regards,
John

-----Original Message-----
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> On Behalf Of hwitche via groups.io
Sent: Sunday, October 18, 2020 2:19 PM
To: Clips@Notetab.groups.io
Subject: Re: [NTB-Clps] replace something with a tab (^T or \t) [7.2/fv] #bugs questionmark

John,

thank you so much!
Now the whole story:
I couldn't believe the code was not working again in my setting, I finally found the mistake I made:
I absent-mindedly overlooked a replacement further down in my script, which invalidated the tab insertion, so my code was actually working too, but I stupidly reversed it.
I'm very sorry and I apologize to you and the community about my sloppiness to bother about it.
Thanks again!
All the best

hwitche


moderated Re: replace something with a tab (^T or \t) [7.2/fv] #bugs questionmark #bugs

hwitche
 

John,

thank you so much!
Now the whole story:
I couldn't believe the code was not working again in my setting, I finally found the mistake I made:
I absent-mindedly overlooked a replacement further down in my script, which invalidated the tab insertion, so my code was actually working too, but I stupidly reversed it.
I'm very sorry and I apologize to you and the community about my sloppiness to bother about it.
Thanks again!
All the best

hwitche


moderated Re: replace something with a tab (^T or \t) [7.2/fv] #bugs questionmark #bugs

John Shotsky
 

Assuming the original tab is present:
^!Replace "^Org:\b" >> "" ARSW
Assuming the original tab is not present, but wanted
^!Replace "^Org:\s*" >> "\t" ARSW
Regards,
John

-----Original Message-----
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> On Behalf Of hwitche via groups.io
Sent: Sunday, October 18, 2020 9:28 AM
To: Clips@Notetab.groups.io
Subject: [NTB-Clps] replace something with a tab (^T or \t) [7.2/fv] #bugs questionmark

Hi all,

I would like to replace the string

"Org:[here is a tab>>......]Northland Communications"

to: [tab>>......]Northland Communications"

with a tab.

Problem 1:
^!Replace "(Org:)" >> "" RAS eliminates the "Org:" but also the Tab, Why?

Problem 2:
For some unknown reason all replacements below do not work:

^!Replace "(Org:)" >> "^T" RAS

^!Replace "(Org:)" >> "\t" RAS

^!Replace "(Org:)" >> ">>......" RAS

I get only spaces. What is the right code?

Thank you for some advice

hwitche


moderated replace something with a tab (^T or \t) [7.2/fv] #bugs questionmark #bugs

hwitche
 

Hi all,

I would like to replace the string

"Org:[here is a tab>>......]Northland Communications"

to: [tab>>......]Northland Communications"

with a tab.

Problem 1:
^!Replace "(Org:)" >> "" RAS eliminates the "Org:" but also the Tab, Why?

Problem 2:
For some unknown reason all replacements below do not work:

^!Replace "(Org:)" >> "^T" RAS

^!Replace "(Org:)" >> "\t" RAS

^!Replace "(Org:)" >> ">>......" RAS

I get only spaces. What is the right code?

Thank you for some advice

hwitche


Re: [Clip] VanWeerthuizenian Expressions

flo.gehrke@...
 

Wayne wrote...

Is VanWeerthuizenian really a word? Wow.
I have taken the liberty of introducing this term with my message #23917 of 9/11/13. It refers to the "Performing Boolean Calculations" part in your tutorial.

I hope you won't hold that against me ;-)

If anyone wants to test the example in my message again he must note that GROUPS.IO spoiled the clipcode. For example, '\b' was replaced with '&#92;b'. Obviously, this happened with the transfer from Yahoo to GROUPS.IO.

Here is a correction:

^!Set %Lines%=^$GetTextLineCount$
^!Set %Row%=1

:Loop
^!Set %A%=0; %B%=0; %C%=0; %D%=0; %E%=0
^!Jump ^%Row%
; Condition #1: a string of 8 characters
^!If ^$StrPos("\b.{8}\b";"^$GetLine$";R)$>0 ^!Set %A%=1
; Condition #2: at least 2 upper characters in line
^!If ^$StrPos("[[:upper:]][[:alnum:]]*[[:upper:]]";"^$GetLine$";R)$>0 ^!Set %B%=1
; Condition #3: at least 2 lower letters in line
^!If ^$StrPos("[[:lower:]][[:alnum:]]*[[:lower:]]";"^$GetLine$";R)$>0 ^!Set %C%=1
; Condition #4: at least one digit in line
^!If ^$StrPos("[0-9]";"^$GetLine$";R)$>0 ^!Set %D%=1
; Condition #5: No punctuation characters or spaces in line
^!If ^$StrPos("[\x20\pP]";"^$GetLine$";R)$>0 ^!Set %E%=1
; Logical test of all conditions ***
^!If ^$Calc(MIN(^%A%;MIN(^%B;MIN(^%C%;MIN(^%D%;1-^%E%)))))$=1 Next Else Skip
; If whole expression is true then append line to %Hits%
^!Set %Hits%=^%Hits%^$GetLine$^P
^!Inc %Row%
^!If ^$GetRow$ < ^%Lines% Loop
; Output hits
^!Info [L]^%Hits%
^!ClearVariables

I hope it won't get spoiled again.

Your expressions were a stimulating intellectual game for me. Under certain conditions, this might still be an useful approach. Regarding that particular task, I would today rather solve it with RegEx:

^!Set %Lines%=^$GetDocListAll("^(?!.*[\x20\pP])(?=.*[0-9])(?=.*[[:upper:]][[:alnum:]]*[[:upper:]])(?=.*[[:lower:]][[:alnum:]]*[[:lower:]]).*";"$0\r\n")$
^!Info [L]^%Lines%

See https://regex101.com/r/uJczeL/1

Regards,
Flo


Re: [Clip] VanWeerthuizenian Expressions

Michael Gerholdt
 

Wayne email pmgerholdt@...


Best Regards,
Michael Gerholdt

________________________________
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> on behalf of Michael Gerholdt <pmgerholdt@...>
Sent: Friday, September 18, 2020 8:49:24 PM
To: Clips@Notetab.groups.io <Clips@Notetab.groups.io>
Subject: Re: [NTB-Clps] [Clip] VanWeerthuizenian Expressions

I have not changed it.

Certainly.


Best Regards,
Michael Gerholdt

________________________________
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> on behalf of Wayne VanWeerthuizen <waynemv@...>
Sent: Friday, September 18, 2020 8:36:31 PM
To: Clips@Notetab.groups.io <Clips@Notetab.groups.io>
Subject: Re: [NTB-Clps] [Clip] VanWeerthuizenian Expressions

Have you had to make any modifications to Project Manager over the years?
Can I get a copy of the version you're using to compare with what I have?


Re: [Clip] VanWeerthuizenian Expressions

Michael Gerholdt
 

I have not changed it.

Certainly.


Best Regards,
Michael Gerholdt

________________________________
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> on behalf of Wayne VanWeerthuizen <waynemv@...>
Sent: Friday, September 18, 2020 8:36:31 PM
To: Clips@Notetab.groups.io <Clips@Notetab.groups.io>
Subject: Re: [NTB-Clps] [Clip] VanWeerthuizenian Expressions

Have you had to make any modifications to Project Manager over the years?
Can I get a copy of the version you're using to compare with what I have?


Re: [Clip] VanWeerthuizenian Expressions

Wayne VanWeerthuizen
 

Have you had to make any modifications to Project Manager over the years?
Can I get a copy of the version you're using to compare with what I have?


Re: [Clip] VanWeerthuizenian Expressions

Michael Gerholdt
 

"Wayne's Project Manager" has been a staple for me for many years.


Best Regards,
Michael Gerholdt

________________________________
From: Clips@Notetab.groups.io <Clips@Notetab.groups.io> on behalf of Wayne VanWeerthuizen <waynemv@...>
Sent: Friday, September 18, 2020 3:48:33 AM
To: Clips@Notetab.groups.io <Clips@Notetab.groups.io>
Subject: Re: [NTB-Clps] [Clip] VanWeerthuizenian Expressions

Is VanWeerthuizenian really a word? Wow.

What is the current state of your research on VanWeerthuizenian Expressions? I've been out of the loop regarding NoteTab stuff for several years.


Re: VanWeerthuizenian Expressions

Thomas Gruber Yahoo
 

Hi Waine, all,
OT:
unfortunately comma/semicolon is a very wide spread source of errors. If you ever worked in a mixed language environment like I do all the time (german/english) with things like Excel, you’ll know what I mean. In formulas, the german version uses semicolon as a separator between parameters, the english one uses comma. Luckily, unlike older versions Excel now translates this automatically when a file is opened in a different language installation. But when you’re writing a formula you always have to consider in which environment you are.

Thomas

Am 18.09.2020 um 09:54 schrieb Wayne VanWeerthuizen <waynemv@...>:

"Note that Wayne always uses a comma like 'MIN(A,B)' where a semicolon is needed!"

Sorry! I'll fix that in the next revision.

Funny how in that same tutorial I warned that using commas instead of semicolons is a common source of errors. Maybe I meant my own errors in particular, LOL.





Re: VanWeerthuizenian Expressions

Thomas Gruber Yahoo
 

Hi Wayne,
if you’re willing to continue/resume woorking on the tutorial, feel free to contact me as a tester or just for proofreading. 4 eyes often see more than 2. If this becomes a live project again, I’m happy to contribute to it if I can.
Kind regards
Thomas

Am 18.09.2020 um 09:54 schrieb Wayne VanWeerthuizen <waynemv@...>:

"Note that Wayne always uses a comma like 'MIN(A,B)' where a semicolon is needed!"

Sorry! I'll fix that in the next revision.

Funny how in that same tutorial I warned that using commas instead of semicolons is a common source of errors. Maybe I meant my own errors in particular, LOL.





Re: VanWeerthuizenian Expressions

Wayne VanWeerthuizen
 

"Note that Wayne always uses a comma like 'MIN(A,B)' where a semicolon is needed!"

Sorry! I'll fix that in the next revision.

Funny how in that same tutorial I warned that using commas instead of semicolons is a common source of errors. Maybe I meant my own errors in particular, LOL.


Re: [Clip] VanWeerthuizenian Expressions

Wayne VanWeerthuizen
 

Is VanWeerthuizenian really a word? Wow.

What is the current state of your research on VanWeerthuizenian Expressions? I've been out of the loop regarding NoteTab stuff for several years.


Re: Notetab Control Structures Tutorial - error #introclipwritingtutorial

Wayne VanWeerthuizen
 

"Wow. Someone read it? And in detail?"

At this point I don't know if I should laugh or cry at that sentiment. If the tutorial helped anyone, that makes me happy.

Anyway, looking back on it now, I see years ago I had never actually finished the document how I had intended. It has been so long, I don't remember if I had gotten discouraged from lack of interest, or if I just got busy with other things.
I may have written the "New Clip Commands" clipbook, around the same year, as a different approach to mitigating many of the issues I talked about in the tutorial. I think now that the tutorial outline, and the New Commands clipbook should have been distributed together in one ZIP file, and the tutorial should have added sections on how to use New Clip Commands.

Maybe we turn finishing these old projects of mine into a collaborative project. I'm really rusty and out of practice with lip programming.


Re: Notetab Control Structures Tutorial - error #introclipwritingtutorial

Wayne VanWeerthuizen
 

Thomas. you've encouraged me, seventeen years after I first shared it, to release a updated version of the tutorial.

Mainly, I want to update my contact information in it. Also, fix the error you mentioned. I'll retest all the examples using NoteTab Pro 7.2. Not sure if I'll actually add any new content.

Thanks for your feedback. Please, let me know any other ways I can improve the tutorial. I am not giving myself any deadline for this, so it may be days or weeks before I have the new version uploaded.


Re: Notetab Control Structures Tutorial - error #introclipwritingtutorial

Wayne VanWeerthuizen
 

Anything I can help with? I've not looked at that file for years, but I could give it another look and see what needs revised.

"I like the approach of using a meta-language with common programming concepts and then showing how this can be translated into clip language."

It makes me happy that you appreciated what I was trying to do. The lack of better control flow statements within the clip language had really annoyed me back then. I had intended the "meta-language" as a proof of concept (for Erik to see). My hope was that eventually Erik would add the new control flow commands I suggested into NoteTab natively and make my meta-language obsolete. Sadly, I don't think that ever happened.


Re: Characters to HTML

Marcelo Bastos
 

On 02/09/2020 22:04, Axel Berger wrote:

numeric entity, that is, either &#381; / &#382; (in decimal)
But can I rely on those being supported everywhere and are they part of the
HTML 4 standard? I was not sure about that and preferred to fall back to
the safe side.
Yes, they are. Numeric entities are enshrined in the HTML 4.01 standard,
but they actually come from way back in SGML.

https://www.w3.org/TR/html4/charset.html#entities

The HTML 3.2 standard, in fact, *uses* numeric entities to *define* the
named entities:

https://www.w3.org/TR/2018/SPSD-html32-20180315/#latin1

TLDR: Numeric entities ALWAYS work. Probably work even in HTML 0.9.


--
MCBastos

This message has been protected with the 2ROT13 algorithm. Unauthorized use will be prosecuted under the DMCA.


--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


Re: Characters to HTML

Axel Berger
 

Marcelo Bastos wrote:
if you want to take a Win-1252-encoded page and
convert to a ISO-8859-1 code in HTML.
Actually all my own pages are US-ASCII, the most basic variant. All those
characters, if I encounter them at all, come from copy/pasting or saving
text written by others.

However, two of your lines are not
quite right -- the ones dealing with the "Z with a caron" character
(both cases).
Yes, I was quite aware of that. The basic unaccented letter was the best I
could come up with and better than nothing.

but those appear to have only been standardized on HTML5,
Exactly. I write and specify HTML 4.01 Transitional .

numeric entity, that is, either &#381; / &#382; (in decimal)
But can I rely on those being supported everywhere and are they part of the
HTML 4 standard? I was not sure about that and preferred to fall back to
the safe side.

Second, "&#65533;" is *already* a valid HTML numeric character entity
It is, but it's not what I wrote. You must be aware that this list often
munges posts. I had expected that but assumed that from my logically
ascending list readers would be able to restore the original where broken.
By the way, the rest of my post looks alright, but what you quoted back at
me is transferred to UTF-8. Copied from your post not a single one of those
replacements will work.

I have also ran into HTML pages (mostly old, poorly-maintained ones)
with invalid numeric references pointing to Win-1252 values in the
128-159 range;
I find that even in many new and current pages. I have another clip for
many (most) things in the range from &#32; to &#255; In my case I convert
everything to cp-1252, as not everything (or few things) I saved as or from
HTML are meant to be used as such. A sample line reads

^!Replace "(&\#128;|&euro;|&\#8364;)" >> "€" HRAST

That clip is one of the things in my clip bar.

I wouldn't use the "I" flag for this kind of replacement,
Absolutely right! I should have spooted that one myself. Thanks.


--
/¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067
\ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069
 X in | D-50829 Köln-Ossendorf http://berger-odenthal.de
/ \ Mail | -- No unannounced, large, binary attachments, please! --


Re: Characters to HTML

Marcelo Bastos
 

On 02/09/2020 18:34, Axel Berger wrote:
I don't know if this has been mentioned here before, but I only just found
out that the menu function

Characters to HTML --> Extendended Characters

which I use often as one step in clips is broken. All those 32 characters
that are part of cp-1252 but not ISO-8859-1 are not converted. I have just
added the following to my clip:
^!Replace "€" >> "&euro;" HASTI
^!Replace "‚" >> "&sbquo;" HASTI
^!Replace "ƒ" >> "&fnof;" HASTI
^!Replace "„" >> "&bdquo;" HASTI
^!Replace "…" >> "&hellip;" HASTI
^!Replace "†" >> "&dagger;" HASTI
^!Replace "‡" >> "&Dagger;" HASTI
^!Replace "ˆ" >> "&circ;" HASTI
^!Replace "‰" >> "&permil;" HASTI
^!Replace "Š" >> "&Scaron;" HASTI
^!Replace "‹" >> "&lsaquo;" HASTI
^!Replace "Œ" >> "&OElig;" HASTI
^!Replace "&#65533;" >> "Z" HASTI
^!Replace "‘" >> "&lsquo;" HASTI
^!Replace "’" >> "&rsquo;" HASTI
^!Replace "“" >> "&ldquo;" HASTI
^!Replace "”" >> "&rdquo;" HASTI
^!Replace "•" >> "&bull;" HASTI
^!Replace "–" >> "&ndash;" HASTI
^!Replace "—" >> "&mdash;" HASTI
^!Replace "˜" >> "&tilde;" HASTI
^!Replace "™" >> "&trade;" HASTI
^!Replace "š" >> "&scaron;" HASTI
^!Replace "›" >> "&rsaquo;" HASTI
^!Replace "œ" >> "&oelig;" HASTI
^!Replace "ž" >> "z" HASTI
^!Replace "Ÿ" >> "&Yuml;" HASTI
That's... _mostly_ OK, if you want to take a Win-1252-encoded page and
convert to a ISO-8859-1 code in HTML. However, two of your lines are not
quite right -- the ones dealing with the "Z with a caron" character
(both cases).

First, replacing them with a plain "z" is suboptimal; if you happen to
be dealing with a language where z-with-a-caron is a real character,
like a few of the Balkans languages, you would end up with incorrect
spelling. Better choices would be to use &Zcaron; / &zcaron;, but those
appear to have only been standardized on HTML5, and are not supported in
earlier versions of HTML. So the best is to use the appropriate Unicode
numeric entity, that is, either &#381; / &#382; (in decimal) or &#x17D;
/ &#x17E; (hexadecimal).

Second,  "&#65533;" is *already* a valid HTML numeric character entity
that should work in any encoding, so it doesn't require conversion.
Also, it's *not* the code for "capital-Z-with-a-caron" (which is
Win-1252 character 142); rather, it is the code for "replacement
character", that is, that diamond shape with a question mark inside
which shows up when your computer does not have an appropriate font for
a particular Unicode code point.

So, I would suggest the following lines instead:

^!Replace "Ž" >> "&#381;" HAST
^!Replace "ž" >> "&zcaron;" HAST

I have also ran into HTML pages (mostly old, poorly-maintained ones) with invalid numeric references pointing to Win-1252 values in the 128-159 range; I find it useful to replace them with named character entities or the correct numeric entities, like so:

^!Replace "&#128;" >> "&euro;" TWSA
^!Replace "&#130;" >> "&sbquo;" TWSA
^!Replace "&#131;" >> "&fnof;" TWSA
^!Replace "&#132;" >> "&bdquo;" TWSA
^!Replace "&#133;" >> "&hellip;" TWSA
^!Replace "&#134;" >> "&dagger;" TWSA
^!Replace "&#135;" >> "&Dagger;" TWSA
^!Replace "&#136;" >> "&circ;" TWSA
^!Replace "&#137;" >> "&permil;" TWSA
^!Replace "&#138;" >> "&Scaron;" TWSA
^!Replace "&#139;" >> "&lsaquo;" TWSA
^!Replace "&#140;" >> "&OElig;" TWSA
^!Replace "&#142;" >> "&#381;" TWSA
^!Replace "&#145;" >> "&lsquo;" TWSA
^!Replace "&#146;" >> "&rsquo;" TWSA
^!Replace "&#147;" >> "&ldquo;" TWSA
^!Replace "&#148;" >> "&rdquo;" TWSA
^!Replace "&#149;" >> "&bull;" TWSA
^!Replace "&#150;" >> "&ndash;" TWSA
^!Replace "&#151;" >> "&mdash;" TWSA
^!Replace "&#152;" >> "&tilde;" TWSA
^!Replace "&#153;" >> "&trade;" TWSA
^!Replace "&#154;" >> "&scaron;" TWSA
^!Replace "&#155;" >> "&rsaquo;" TWSA
^!Replace "&#156;" >> "&oelig;" TWSA
^!Replace "&#158;" >> "&#382;" TWSA
^!Replace "&#159;" >> "&Yuml;" TWSA

I wouldn't use the "I" flag for this kind of replacement, since we are going for specific character replacements, not "letter" replacements, and some of the replaced characters are technically uppercase/lowercase pairs, which the "I" would treat as the same (at least in theory; it may be that the regexp engine in Notetab does not include an upper/lowercase table for Eastern Europe alphabets). And I prefer to use "W" instead of "H" in this case, because, well, in my use cases, those characters/entities will cause trouble *wherever* they are in the document, so I don't want to leave any stragglers behind if I happen to select only part of the document.

--
MCBastos

This message has been protected with the 2ROT13 algorithm. Unauthorized use will be prosecuted under the DMCA.


--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


Characters to HTML

Axel Berger
 

I don't know if this has been mentioned here before, but I only just found
out that the menu function

Characters to HTML --> Extendended Characters

which I use often as one step in clips is broken. All those 32 characters
that are part of cp-1252 but not ISO-8859-1 are not converted. I have just
added the following to my clip:

^!Replace "€" >> "&euro;" HASTI
^!Replace "‚" >> "&sbquo;" HASTI
^!Replace "ƒ" >> "&fnof;" HASTI
^!Replace "„" >> "&bdquo;" HASTI
^!Replace "…" >> "&hellip;" HASTI
^!Replace "†" >> "&dagger;" HASTI
^!Replace "‡" >> "&Dagger;" HASTI
^!Replace "ˆ" >> "&circ;" HASTI
^!Replace "‰" >> "&permil;" HASTI
^!Replace "Š" >> "&Scaron;" HASTI
^!Replace "‹" >> "&lsaquo;" HASTI
^!Replace "Œ" >> "&OElig;" HASTI
^!Replace "&#65533;" >> "Z" HASTI
^!Replace "‘" >> "&lsquo;" HASTI
^!Replace "’" >> "&rsquo;" HASTI
^!Replace "“" >> "&ldquo;" HASTI
^!Replace "”" >> "&rdquo;" HASTI
^!Replace "•" >> "&bull;" HASTI
^!Replace "–" >> "&ndash;" HASTI
^!Replace "—" >> "&mdash;" HASTI
^!Replace "˜" >> "&tilde;" HASTI
^!Replace "™" >> "&trade;" HASTI
^!Replace "š" >> "&scaron;" HASTI
^!Replace "›" >> "&rsaquo;" HASTI
^!Replace "œ" >> "&oelig;" HASTI
^!Replace "ž" >> "z" HASTI
^!Replace "Ÿ" >> "&Yuml;" HASTI


--
/¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067
\ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069
 X in | D-50829 Köln-Ossendorf http://berger-odenthal.de
/ \ Mail | -- No unannounced, large, binary attachments, please! --