Re: Speed up a slow loop

2022-03-07 Thread Neville Smythe via use-livecode
Jacque seems to have found a satisfactory solution to her problem with the help 
of the excellent suggestions we have seen here. Since there seems to have been 
a lot of interest, I thought I would take the opportunity to report on an 
alternative method I had been exploring with Jacque via email.

I believe there were two problems: a) the original search search algorithm was 
too slow, and b) when implemented on certain devices the app went into an 
unusable state. Both problems were caused by the wordlist being stored being 
too large (275K words for a file size of  2.5 MB). The second issue we are 
pretty sure was Virtual Memory swap space thrashing. 

Using Quentin’s why-didn’t-I-think-of-that filtering suggestion the wordlist 
can be reduced (in the vasty majority of cases) to a manageable size, say 20K 
words or less, and both problems solved very elegantly.

There are however edge cases where the filtered wordlist can still be huge, 
over 200K words, [ eg unused letters are JQXYZ  ]. Such cases are going to be 
very rare, so Jacque is going with the above solution. 

An alternative is to use an sqlite database, always an option which should be 
considered when handling large data. This completely removes the issue of 
having the wordlist in memory, and at the same time provides an extremely fast 
search engine, so was worth exploring as a solution to both problems.  Storing 
the words in a db single table with an index on initial letter and word length, 
or as lots of tables, one for each initial and length (!), both return a result 
for a search for a word in a small fraction of a millisecond, so definitely 
this would be a viable solution which would handle all letter distributions.

There is however a downside: both methods produce a db file size of 7.1 MB for 
the SOWPODS wordlist, which rather bloats the app footprint, even when you 
discount the text file version of the wordlist which no longer needs to be 
stored. If one was writing a crossword app, where you might be searching for 
words for which you know the 3rd and fifth letter for example, bread and butter 
for an sqlite query, this would definitely be the way to go, but probably 
overkill for Jacque’s app.

But now, speaking of databases, I have a question. I have an update to my 
nsScriptDatabase stack which I want to upload to the Sample Stacks. Because it 
really should be compiled to a standalone, I really need to upload a pair of 
stacks, a launch stack and one to hold data which can one modified by the user. 
But it would seem a sample stack must be a single item. What to do?

Neville
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: bug in Standalone Only

2022-03-07 Thread Bob Sneidar via use-livecode
Hi all. I found it. I have a handler that creates a temp database in the 
default folder. In a Mac standalone that folder is read only. Thankfully it is 
only something I use in the IDE and not in standalones, so I now test for the 
environment. 

Sent from my iPhone

> On Mar 7, 2022, at 17:48, J. Landman Gay via use-livecode 
>  wrote:
> 
> Remote debugging allows you to step through the script. But we do have an 
> error lookup utility that will tell you what the error codes mean.
> 
> 
> 
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
>> On March 7, 2022 6:17:28 PM Bob Sneidar via use-livecode 
>>  wrote:
>> 
>> Jacque, don't you have a utility that can debug standalones?
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: bug in Standalone Only

2022-03-07 Thread J. Landman Gay via use-livecode
Remote debugging allows you to step through the script. But we do have an 
error lookup utility that will tell you what the error codes mean.




--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On March 7, 2022 6:17:28 PM Bob Sneidar via use-livecode 
 wrote:



Jacque, don't you have a utility that can debug standalones?




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Monterey + Dark Mode + LC 9.6.6

2022-03-07 Thread Marty Knapp via use-livecode
I think I found the issue. I use Levure to build my apps (great framework - you 
should try it!) and it uses a a customized plist file. I compared that to a 
plist file from a normally complied app and notice it has has parameter that is 
needed:

NSRequiresAquaSystemAppearance


---
Marty Knapp

> On Mar 7, 2022, at 4:05 PM, Marty Knapp  wrote:
> 
> I just had a customer send a screen shot of my app (built with LC 9.6.6) 
> running on Mac Monterey in dark mode and buttons and fields are all messed 
> up. I don’t use dark mode and so tried it on my Mac and see the issue. I then 
> tried an app built with a previous version of LC (9.6.1 I believe) and it 
> looks fine. Anybody else seeing this?
> ---
> Marty Knapp


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: bug in Standalone Only

2022-03-07 Thread Tom Glod via use-livecode
Hi Bob, sometimes it helps to look up the error using the
scriptexecutionerrors function

The first number that you see in each line is the error number.

So "put line x of the scriptExecutionErrors" should tell you exactly what
the error is, and that is often a good hint of where to look.

Hope that helps.

On Mon, Mar 7, 2022 at 7:16 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi all. There is a bug in my app which only rears it's ugly head when I
> create a standalone. When I am in the IDE it never happens. I get an error
> dialog but the numbers in the dialog do not make any sense. I email myself
> an error report, but where it says the error is happening is NOT where it
> is happening. I know this because when I search for the line that is
> creating the error in the script it says it's happening in, I put answer
> dialogs just before the two lines I find. In the standalone I never see the
> answer dialogs.
>
> Jacque, don't you have a utility that can debug standalones?
>
> Bob S
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


bug in Standalone Only

2022-03-07 Thread Bob Sneidar via use-livecode
Hi all. There is a bug in my app which only rears it's ugly head when I create 
a standalone. When I am in the IDE it never happens. I get an error dialog but 
the numbers in the dialog do not make any sense. I email myself an error 
report, but where it says the error is happening is NOT where it is happening. 
I know this because when I search for the line that is creating the error in 
the script it says it's happening in, I put answer dialogs just before the two 
lines I find. In the standalone I never see the answer dialogs. 

Jacque, don't you have a utility that can debug standalones? 

Bob S


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Monterey + Dark Mode + LC 9.6.6

2022-03-07 Thread Marty Knapp via use-livecode
I just had a customer send a screen shot of my app (built with LC 9.6.6) 
running on Mac Monterey in dark mode and buttons and fields are all messed up. 
I don’t use dark mode and so tried it on my Mac and see the issue. I then tried 
an app built with a previous version of LC (9.6.1 I believe) and it looks fine. 
Anybody else seeing this?
---
Marty Knapp
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sign In with Apple and Google

2022-03-07 Thread Rick Harrison via use-livecode
Do it in a webpage.  I doubt there is a plug-in or a better way.

Personally whenever I see any website that tells me to
login with my google, facebook, or apple account, I
immediately view that website as being suspicious.

If there is a standard login using a Login ID and
password that I set up, then I always elect to do
things that way.

Good luck!

Rick

> On Mar 7, 2022, at 5:39 PM, Dan Friedman via use-livecode 
>  wrote:
> 
> Hey all... does anyone have a method to do user sign-ins with Apple and 
> Google (on iOS AND Android)?  I know we could do it in a webpage, but 
> wondered if there was a plug-in or better method to handle it.   Any advice 
> on this?
> 
> Thanks in advance,
> -Dan
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Sign In with Apple and Google

2022-03-07 Thread Dan Friedman via use-livecode
Hey all... does anyone have a method to do user sign-ins with Apple and Google 
(on iOS AND Android)?  I know we could do it in a webpage, but wondered if 
there was a plug-in or better method to handle it.   Any advice on this?

Thanks in advance,
-Dan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Speed up a slow loop

2022-03-07 Thread J. Landman Gay via use-livecode

On 3/7/22 12:30 PM, Alex Tweedly via use-livecode wrote:


The boardwalk will find all valid words on the board. So that list of words can be used as the 
"dictionary" for the user's guesses - and now you have a "dictionary" of only a few hundred 
words, rather than than the many thousands of either the original or the filtered dictionaries.


And it's worth saying that the fast boardwalk only explores those potential words that are on 
the board, so there's no need to filter the dictionary for it.


The caveat - a user guess which isn't in the word list found by the boardwalk can be either 
"not a word" or "a word, but not present on the board", and you don't know which. If your UI 
needs to distinguish between those cases, you'd need to do another step of checking these 
(hopefully very few) failure cases against the full dictionary.


Wow, that's something else that didn't occur to me. I do, of course, have the word list from 
your board walk. At present I use it to provide a hint on demand if the user gets stuck. It's 
cheating, but hey, this is a one-person game and you're only cheating yourself. Nobody says you 
have to click that button.


I do need to discriminate between non-words and words not on the board, but the dictionary 
check is now so fast that it isn't a problem. The most time-consuming part is now the 
boardwalk, but it will be instant when I check the word list your script creates.


Have you heard the joke about how a camel is a horse created by a committee? That's not always 
true. This game is getting better and better.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Speed up a slow loop

2022-03-07 Thread Alex Tweedly via use-livecode



On 06/03/2022 22:56, J. Landman Gay via use-livecode wrote:


The board walk took 179 ms for all 108 words because I ditched my old, 
juvenile, inefficient code and swiped yours. :) As Bill requested, 
I've marked all the stuff I used with credits for the people who 
suggested or provided code, so you're in there. The two most impactful 
changes were your board walk and Quentin's filtered dictionary idea, 
but there are also other improvements.


Oh, well, if you've got the fast boardwalk code in there anyway, that 
opens up another possibility (with one caveat).


The boardwalk will find all valid words on the board. So that list of 
words can be used as the "dictionary" for the user's guesses - and now 
you have a "dictionary" of only a few hundred words, rather than than 
the many thousands of either the original or the filtered dictionaries.


And it's worth saying that the fast boardwalk only explores those 
potential words that are on the board, so there's no need to filter the 
dictionary for it.


The caveat - a user guess which isn't in the word list found by the 
boardwalk can be either "not a word" or "a word, but not present on the 
board", and you don't know which. If your UI needs to distinguish 
between those cases, you'd need to do another step of checking these 
(hopefully very few) failure cases against the full dictionary.


Alex.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: A question about the compiler to come

2022-03-07 Thread Mike Kerner via use-livecode
I have tried on several occasions to appreciate LCB, but I just don't, so,
being able to write widgets with LCS would be great. Maybe for tmc4,
because i don't think it will be in time for tmc3

On Sat, Mar 5, 2022 at 1:16 AM Mark Smith via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I also asked about building widgets from LC script. The response was, this
> could be a step along that path.
>
> Sent from my iPhone
>
> > On Mar 4, 2022, at 2:54 PM, Mike Kerner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > It's nice that aCompileIt!/Double-XX replacement is finally coming to
> > LiveCode, maybe, but it is pretty expensive, at $499/year.
> > The old timers may remember both of those products, from Heizer Software,
> > allowed you to compile HyperCard stacks (and build XCMD's and XFCN's).
> > We will see how smooth the path will be. I did post $500, but I think it
> > will be a rocky transition.
> >
> >
> >> On Thu, Mar 3, 2022 at 8:19 PM Tom Glod via use-livecode <
> >> use-livecode@lists.runrev.com> wrote:
> >>
> >> I meant to include link to this:
> >> https://livecode.com/script-compiler-project-page/
> >>
> >>> On Thu, Mar 3, 2022 at 8:13 PM Tom Glod  wrote:
> >>>
> >>> Hi Sean, one the page for the compiler project and Kevin talks about
> the
> >>> nature of Livecode being interpreted . currently the script in
> memory
> >>> is just obfuscated, and a sufficiently motivated person or group of
> >> people
> >>> could eventually find what they want to find.  script passwords are
> >> useful
> >>> too, but also have their limit.
> >>>
> >>> "By compiling scripts fully, standalones become even more secure. We’ve
> >>> put a lot of work into making standalones secure at present but there
> are
> >>> still limitations on the existing approach that are fundamental to how
> an
> >>> interpreter like LiveCode operates. Compiled code does not leave any
> >> trace
> >>> of the original script text."
> >>>
> >>> Cheers,
> >>>
> >>> Tom
> >>>
> >>> On Thu, Mar 3, 2022 at 5:22 PM Sean Cole via use-livecode <
> >>> use-livecode@lists.runrev.com> wrote:
> >>>
>  Tom
>  What security imp[lications do you perceive it to overcome?
> 
>  Sean
> 
>  On Thu, 3 Mar 2022 at 21:07, Tom Glod via use-livecode <
>  use-livecode@lists.runrev.com> wrote:
> 
> > Pardon my lingo  but this is f#%%ing huge Just last week, I
> >> was
> > thinking about the nature of livecode and that it comes with some
> >> pretty
> > profound security implications.
> > I'm sSuper happy to see this machine code compiler coming to
> livecode.
> > This is likely to directly influence the amount of sleep I get in
> this
> > upcoming decade of work :)
> > Great decision by the team to go ahead with this.
> > (y)
> >
> >
> > On Thu, Mar 3, 2022 at 3:03 PM Tom Glod  wrote:
> >
> >> Interesting.
> >> I cannot find  this email from Kevin, can someone please forward it
>  to me
> >> or direct me to where I can read it?
> >>
> >> Thanks,
> >>
> >> Tom
> >>
> >> On Thu, Mar 3, 2022 at 10:10 AM Rick Harrison via use-livecode <
> >> use-livecode@lists.runrev.com> wrote:
> >>
> >>> According to Kevin’s email:
> >>>
> >>> Would this script compiler work on all platforms?
> >>> All platforms will benefit. Code will run faster and readable
> >> scripts
> >>> will be removed whatever platform you are targeting.
> >>> Rick
> >>>
>  On Mar 3, 2022, at 9:33 AM, francois.chaplais via use-livecode <
> >>> use-livecode@lists.runrev.com> wrote:
> 
>  Dear all
> 
>  You probably have received some mail asking for funding
> >> concerning
>  a
> >>> compiler to come.
> 
>  I would like to know if this compiler can target MacOS/ARM
>  processor
> > on
> >>> the desktop.
> 
>  Best regards,
> 
>  François
>  ___
>  use-livecode mailing list
>  use-livecode@lists.runrev.com
>  Please visit this url to subscribe, unsubscribe and manage your
> >>> subscription preferences:
>  http://lists.runrev.com/mailman/listinfo/use-livecode
> >>>
> >>> ___
> >>> use-livecode mailing list
> >>> use-livecode@lists.runrev.com
> >>> Please visit this url to subscribe, unsubscribe and manage your
> >>> subscription preferences:
> >>> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>>
> >>
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
>  _

Re: use-livecode Digest, Vol 222, Issue 8

2022-03-07 Thread J. Landman Gay via use-livecode
Funny you should bring this up, as I was playing with it last night. Turns 
out that multiple filters do slow down on the Pixel so I was looking for 
the One True Regex.


I'm not great at this so would like verification from those who know if 
this is what I need:


put "[" & tUnusedLetters & "]" into tRegex
filter tHugeDict without regex pattern tRegex

It seems to work but I'm not positive. Does that look right?

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On March 7, 2022 3:01:19 AM Quentin Long via use-livecode 
 wrote:



My first attempt at the regex is…
filter lines of WordList without "*[AbsentChars]*"
However, that will remove all words that contain at least one letter in the 
specific character string "absentchars", which is not what I want. So, 
bring out the "do" keyword…
do ("filter lines of WordList without" && quote & "*" & AbsentChars & "*" & 
quote)





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: use-livecode Digest, Vol 222, Issue 8

2022-03-07 Thread Andy Marshman via use-livecode
Hi Mark,

In regex the full stop stands for any single character whereby the * means
any other characters. If you want to only find things that begin with a
character put a ^ infront of the character you are searching for. So ^a.
should only return apple in your example.


Regards

Andy

On Mon, 7 Mar 2022, 16:46 Mark Smith via use-livecode, <
use-livecode@lists.runrev.com> wrote:

> So, playing around a bit more I discovered “a.*” does not return words
> that “start with”, but rather words that “contain” the letter. So that
> explains “apple, banana”. What isn’t clear to me is I get the exact same
> result using “a.” with no asterisk, but if I search for “y.” it returns
> nothing rather than cherry. Consequentially I realize my confusion is due
> to a limitation of what these characters mean to regex. Can anyone clarify
> for me what the “.” and “*” are doing to change the filter?
>
> Thanks
>
> > On Mar 7, 2022, at 11:05 AM, Mark Smith  wrote:
> >
> > I am not an expert in regex or filtering by any means so Quentin’s
> message prompted me to take a closer look. I started with the dictionary
> entry for filter and I found this simple example:
> > filter items of "apple,banana,cherry" with regex pattern "b.*"
> >
> > Since we are not specifying a destination, the result is going into the
> “it" variable. I tried that and got the expected result “banana”. Next I
> tried “c.*” and got cherry and “d.*’ and got nothing. All good. Finally I
> tried “a.*” and got “apple, banana”. I was a bit surprised by that. Does
> anyone know why “a.*” breaks the pattern of returning a single item? Does
> it have something to do with the item being in the first position in the
> string?
> >
> > BTW, I did try putting the result into a variable and displaying that (…
> into temp; put temp) and got the same result.
> >
> > Also, I thought I might try a few experiments using “without regex
> pattern” and using “a.*” as the argument returned “cherry” so at least
> whatever it is doing it is consistent.
> >
> > Mark
> >
> >
> >> On Mar 7, 2022, at 8:58 AM, Quentin Long via use-livecode <
> use-livecode@lists.runrev.com >
> wrote:
> >>
> >> sez j. landman gay:
> >>> Interesting idea. There are 25 letters on each board, some are always
> repeats. I think I'd need
> >>> a good regex so I wouldn't have to run the filter command multiple
> times. How's your regex?
> >>
> >> I see you've already implemented something, but just for grins, here's
> my thought re: the One True Regex for this situation:
> >> AbsentChars is the name of a variable which contains all the letters
> that *aren't* on the board. My first attempt at the regex is…
> >> filter lines of WordList without "*[AbsentChars]*"
> >> However, that will remove all words that contain at least one letter in
> the specific character string "absentchars", which is not what I want. So,
> bring out the "do" keyword…
> >> do ("filter lines of WordList without" && quote & "*" & AbsentChars &
> "*" & quote)
> >>
> >> "Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length" Read the
> webcomic at [ http://www.atarmslength.net 
> ]! If you like "At Arm's Length", support it at [
> http://www.patreon.com/DarkwingDude 
> ].
> >> ___
> >> use-livecode mailing list
> >> use-livecode@lists.runrev.com 
> >> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: use-livecode Digest, Vol 222, Issue 8

2022-03-07 Thread Mark Smith via use-livecode
So, playing around a bit more I discovered “a.*” does not return words that 
“start with”, but rather words that “contain” the letter. So that explains 
“apple, banana”. What isn’t clear to me is I get the exact same result using 
“a.” with no asterisk, but if I search for “y.” it returns nothing rather than 
cherry. Consequentially I realize my confusion is due to a limitation of what 
these characters mean to regex. Can anyone clarify for me what the “.” and “*” 
are doing to change the filter? 

Thanks

> On Mar 7, 2022, at 11:05 AM, Mark Smith  wrote:
> 
> I am not an expert in regex or filtering by any means so Quentin’s message 
> prompted me to take a closer look. I started with the dictionary entry for 
> filter and I found this simple example:
> filter items of "apple,banana,cherry" with regex pattern "b.*"
> 
> Since we are not specifying a destination, the result is going into the “it" 
> variable. I tried that and got the expected result “banana”. Next I tried 
> “c.*” and got cherry and “d.*’ and got nothing. All good. Finally I tried 
> “a.*” and got “apple, banana”. I was a bit surprised by that. Does anyone 
> know why “a.*” breaks the pattern of returning a single item? Does it have 
> something to do with the item being in the first position in the string? 
> 
> BTW, I did try putting the result into a variable and displaying that (… into 
> temp; put temp) and got the same result. 
> 
> Also, I thought I might try a few experiments using “without regex pattern” 
> and using “a.*” as the argument returned “cherry” so at least whatever it is 
> doing it is consistent.
> 
> Mark
> 
> 
>> On Mar 7, 2022, at 8:58 AM, Quentin Long via use-livecode 
>> mailto:use-livecode@lists.runrev.com>> wrote:
>> 
>> sez j. landman gay:
>>> Interesting idea. There are 25 letters on each board, some are always 
>>> repeats. I think I'd need 
>>> a good regex so I wouldn't have to run the filter command multiple times. 
>>> How's your regex?
>> 
>> I see you've already implemented something, but just for grins, here's my 
>> thought re: the One True Regex for this situation:
>> AbsentChars is the name of a variable which contains all the letters that 
>> *aren't* on the board. My first attempt at the regex is…
>> filter lines of WordList without "*[AbsentChars]*"
>> However, that will remove all words that contain at least one letter in the 
>> specific character string "absentchars", which is not what I want. So, bring 
>> out the "do" keyword…
>> do ("filter lines of WordList without" && quote & "*" & AbsentChars & "*" & 
>> quote)
>> 
>> "Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length" Read the 
>> webcomic at [ http://www.atarmslength.net  ]! 
>> If you like "At Arm's Length", support it at [ 
>> http://www.patreon.com/DarkwingDude  ].
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com 
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: use-livecode Digest, Vol 222, Issue 8

2022-03-07 Thread Mark Smith via use-livecode
I am not an expert in regex or filtering by any means so Quentin’s message 
prompted me to take a closer look. I started with the dictionary entry for 
filter and I found this simple example:
filter items of "apple,banana,cherry" with regex pattern "b.*"

Since we are not specifying a destination, the result is going into the “it" 
variable. I tried that and got the expected result “banana”. Next I tried “c.*” 
and got cherry and “d.*’ and got nothing. All good. Finally I tried “a.*” and 
got “apple, banana”. I was a bit surprised by that. Does anyone know why “a.*” 
breaks the pattern of returning a single item? Does it have something to do 
with the item being in the first position in the string? 

BTW, I did try putting the result into a variable and displaying that (… into 
temp; put temp) and got the same result. 

Also, I thought I might try a few experiments using “without regex pattern” and 
using “a.*” as the argument returned “cherry” so at least whatever it is doing 
it is consistent.

Mark


> On Mar 7, 2022, at 8:58 AM, Quentin Long via use-livecode 
>  wrote:
> 
> sez j. landman gay:
>> Interesting idea. There are 25 letters on each board, some are always 
>> repeats. I think I'd need 
>> a good regex so I wouldn't have to run the filter command multiple times. 
>> How's your regex?
> 
> I see you've already implemented something, but just for grins, here's my 
> thought re: the One True Regex for this situation:
> AbsentChars is the name of a variable which contains all the letters that 
> *aren't* on the board. My first attempt at the regex is…
> filter lines of WordList without "*[AbsentChars]*"
> However, that will remove all words that contain at least one letter in the 
> specific character string "absentchars", which is not what I want. So, bring 
> out the "do" keyword…
> do ("filter lines of WordList without" && quote & "*" & AbsentChars & "*" & 
> quote)
> 
> "Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length" Read the 
> webcomic at [ http://www.atarmslength.net ]! If you like "At Arm's Length", 
> support it at [ http://www.patreon.com/DarkwingDude ].
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: use-livecode Digest, Vol 222, Issue 8

2022-03-07 Thread Quentin Long via use-livecode
sez j. landman gay:
> Interesting idea. There are 25 letters on each board, some are always 
> repeats. I think I'd need 
> a good regex so I wouldn't have to run the filter command multiple times. 
> How's your regex?

I see you've already implemented something, but just for grins, here's my 
thought re: the One True Regex for this situation:
AbsentChars is the name of a variable which contains all the letters that 
*aren't* on the board. My first attempt at the regex is…
filter lines of WordList without "*[AbsentChars]*"
However, that will remove all words that contain at least one letter in the 
specific character string "absentchars", which is not what I want. So, bring 
out the "do" keyword…
do ("filter lines of WordList without" && quote & "*" & AbsentChars & "*" & 
quote)

"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length" Read the 
webcomic at [ http://www.atarmslength.net ]! If you like "At Arm's Length", 
support it at [ http://www.patreon.com/DarkwingDude ].
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode