Re: Speed up a slow loop

2022-03-09 Thread J. Landman Gay via use-livecode
My memory checks on the Pixel 5 had a maximum app memory use of about 375 
MB of RAM. I think that was before I removed the duplicate copy of the 
dictionary data though, which if so would bring the total down.


That said, other apps had more. Chrome browser used over 300 MB, Play Store 
411 MB,  my mail client 211MB. Those do okay on the phone. And I still 
don't understand why my cheap tablet with half the RAM handled anything I 
threw at it, including SOWPODS, without blinking.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On March 9, 2022 6:53:46 PM Neville Smythe via use-livecode 
 wrote:



After button 2, the real memory used is 121 MB (second run 131 MB)
   So splitting a 2.5 MB file into an array with 275 K keys required 75 MB 
   (this figure was duplicated in the second run)




___
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-09 Thread Neville Smythe via use-livecode
I just ran a test to try to find out how much RAM is used when you create a 
large array; the result is rather surprising.

 BTW Bob: I did not imply that an array is implemented in LC as a database. 
Merely that to work its magic it must be indexing keys somehow. 

I had suggested a 2.5 MB list of 275K words might expand to no worse than 10MB 
when split into an array. Not quite, as it turns out.

I wrote a very simple stack which just has two buttons. 

The first reads SOWPODS.txt into a global variable gWordlist. Don’t try putting 
that variable into the msg box — LC becomes unusable with the Beachball of Hope 
spinning for a few seconds whenever you do anything. Aha, it is the LC engine 
that is having problems with large data (in this case displayed in a field of 
course, not in the variable itself)

The second button puts gWordlist into aa, and splits aa by CR  as a set.

I then turned the stack into a standalone and looked at the memory used in the 
Mac Console

. When the stack launches, real memory used is 29.8 MB (in a second run 45 MB)
That’s the basic LC engine + 18 MB of Mac OS stuff which is shared with 
all apps, the stack itself would be tiny

. after button 1, reading in the 2.5 MB file, the real memory used is 46 MB 
(second run 56 MB)
So 16 MB to store a 2.5 MB file in a variable (in the second run 11 MB, 
I guess 5 MB of engine code was garbage collected)

. After button 2, the real memory used is 121 MB (second run 131 MB)
So splitting a 2.5 MB file into an array with 275 K keys required 75 MB 
(this figure was duplicated in the second run)

We are now talking pretty large amounts of memory that the LC engine has to 
move around, for example probably making copies in its procedure stacks (that's 
stack in the coding sense).

I'm not surprised that LC might be getting indigestion with variables of this 
size on a small device. I seem to remember running into RAM allocations for an 
iOS app measured in the low hundreds of MB.

Neviille
___
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-09 Thread Alex Tweedly via use-livecode

Hmmm - I have to correct myself :-)

It's not 110; there are 144 digraphs on a 5x5 board

 - nine centre tiles each have 8 neighbours

 - four corner tiles each have 3 neighbours

 - twelve remaining edge tiles each have 5 neighbours

giving 72 + 12 + 60 - so 144 pairs (already including both directions 
for each adjacency).


Now if you allow edge-to-edge wrapping (i.e. from the top right tile you 
can move to the right - and find yourself back on the top left, etc.) 
then there are simply 25 * 8 pairs - but then you've moved a long way 
from genuine Boggle rules :-)


Alex.

On 09/03/2022 23:09, Alex Tweedly via use-livecode wrote:
Yes, Quentin's allowing for diagonals (that's how the number of 
digraphs on a 5x5 board gets up to 110).


And it's probably a good idea, allowing an even finer filter - if you 
aren't doing the boardwalk method..


If you do use the boardwalk to generate the exact list of words, you 
get no benefit from single-letter or digraph filtering, because the 
tree-walk is constrained to only those valid "next char"s, and so 
implicitly avoids using those non-present digraphs.


Oh - so many different ways to do things, all interesting, and all 
good for some variation of the problem.



btw - that reminds me - back when I used to play real, physical Boggle 
with friends, we often played variants of the word rules; either


 - you can reuse the same tile later in a word (e.g.
Y  L  A
X  E  T

would allow "lately" as a word.

OR

- you can double-up on a tile (e.g. M I L would allow 'mill')
(more important if you're British than if you're American :-)

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


___
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-09 Thread Alex Tweedly via use-livecode
Yes, Quentin's allowing for diagonals (that's how the number of digraphs 
on a 5x5 board gets up to 110).


And it's probably a good idea, allowing an even finer filter - if you 
aren't doing the boardwalk method..


If you do use the boardwalk to generate the exact list of words, you get 
no benefit from single-letter or digraph filtering, because the 
tree-walk is constrained to only those valid "next char"s, and so 
implicitly avoids using those non-present digraphs.


Oh - so many different ways to do things, all interesting, and all good 
for some variation of the problem.



btw - that reminds me - back when I used to play real, physical Boggle 
with friends, we often played variants of the word rules; either


 - you can reuse the same tile later in a word (e.g.
Y  L  A
X  E  T

would allow "lately" as a word.

OR

- you can double-up on a tile (e.g. M I L would allow 'mill')
(more important if you're British than if you're American :-)

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: use-livecode Digest, Vol 222, Issue 8

2022-03-09 Thread doc hawk via use-livecode


jacqui juggled,
> 
> 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.


Something like


^[manl]\{2,5\}$

which matches all strings of length 2 to 5 composed exclusively of the letters 
m, a, n, & l ?

[this assumes one word per line, of course]

___
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


[ANN] SpreadLib ordering is back online

2022-03-09 Thread Curry Kenworthy via use-livecode



The SpreadLib order page is back up:

http://livecodeaddons.com/spreadlib.html
http://livecodeaddons.com/buy-spreadlib

This is NOT a new version! Just the "store restored"
after going offline when eSellerate died.
(I've marked the price down a bit, though, at SendOwl.)

We have a MUCH newer private release made for 2020,
but COVID nuked my productivity those last two years,
so it never got the License keys for a public release.

That's a priority this year, therefore

Here's the SpreadLib for 2022 Plan:

- Public release during Summer.
- New backend integration for more frequent updates.
- Newer Mac improvements.
- Multi-sheet handling.
- Updated and expanded Documentation.
- Many more improvements done before 2020.

(Meanwhile, WordLib is first in line again,
with a minor version coming up around Easter
for supercharged MS Word Comments.)

Happy coding! More news soon

Best wishes,

Curry Kenworthy

SpreadLib: Excel files to LC fields in 1 script line!
"Excel-lent spreadsheet import and export for LiveCode"
http://livecodeaddons.com/spreadlib.html

Innovative Christian LiveCode Training and Consulting
"Better Methods, Better Results"
http://livecodeconsulting.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-09 Thread J. Landman Gay via use-livecode
I'm not sure I followed all that, but did you account for diagonals? It sounds like you'd need 
to calculate all the possible polygons in a 5x5 grid, starting from anywhere, and sometimes 
wrapping around itself.


I don't have the math skills to do that but when I get this thing presentable you could take a 
look and see what you think.



On 3/8/22 8:32 PM, Quentin Long via use-livecode wrote:

It occurs to me that any word which is valid in Boggle must consist of an 
uninterrupted run of letters which are *right next to each other* on the board. 
Hence, any digraph which *doesn't* consist of a pair of neighboring letters, 
*cannot* occur in any valid word.
Since the "filter out all words with LettersNotOnTheBoard" idea worked, it may be that an 
analogous "filter out" operation can speed things up more. When setting up a new board...
-- Construct a list of all 576 ( = 26x26 ) digraphs—"aa,ab,ac, … zx,zy,zz". Or, more likely, 
construct that list ahead of time, and store the list in a stack property.-- Remove all digraphs which 
contain at least one letter that's not on the board.-- Make a list of all pairs of neighboring letters on the 
board. Since you don't know which direction an arbitrary digraph is running in, you'll want to include ZA as 
well as AZ.-- Remove all the digraphs present on the board from the ListOfAllDigraphs.-- Replace all the 
"," in the ListOfAllDigraphs with "|". (i.e., replace commas with pipes)
-- Put "[" & ListOfAllAbsentDigraphs & "]" into RegexPattern.-- Filter WordList 
without RegexPattern.-- ???-- Profit.
Hmmm... since this starts out with a complete list of all 576 digraphs, there's 
no need to do a separate regex filter on individual letters; filtering out the 
full list of unused digraphs should encompass filtering out unused letters. 
Hence, just one regex filter should do the job. I think.
On a 4x4 Boggle board, there are 72 neighboring pairs, hence a maximum of 144 
valid digraphs; on a 5x5 board, there are 110 neighing pairs, hence a max of 
220 digraphs. Hopefully, this won't add too much overhead to board setup.

"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



--
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-09 Thread J. Landman Gay via use-livecode

On 3/8/22 5:56 PM, Neville Smythe via use-livecode wrote:

reducing the list to around 20K words evidently removes the issue, which 
suggests multiple copies of the array are being created somewhere in (Jacque’s 
original ) search algorithm.


Yeah, I was keeping two copies without realizing it. Once I cleared unused variables I was able 
to reduce the amount of RAM being used by about 5MB.


--
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: Requirements for display PDF in a browser on Windows?

2022-03-09 Thread Klaus major-k via use-livecode
Hi Tom,

> Am 09.03.2022 um 20:20 schrieb Tom Glod via use-livecode 
> :
> 
> (y) That I do not know unfortunately. Can't test I don't have windows 7
> anywhere.

OK, so I guess it will work on Win 10, if that is what you are running, right?

Someone else knows if this works on Win >= 7?
Don't be shy. :-)

> On Wed, Mar 9, 2022 at 1:45 PM Klaus major-k via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Hi Tom,
>> 
>>> Am 09.03.2022 um 19:40 schrieb Tom Glod via use-livecode <
>> use-livecode@lists.runrev.com>:
>>> 
>>> i use the widget.  Yes it can.
>> 
>> this is very good news, thank you! :-)
>> 
>> And what Windows version is neccessary for this to work?
>> All versions >= 7?

Best

Klaus
--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
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: Requirements for display PDF in a browser on Windows?

2022-03-09 Thread Tom Glod via use-livecode
(y) That I do not know unfortunately. Can't test I don't have windows 7
anywhere.

On Wed, Mar 9, 2022 at 1:45 PM Klaus major-k via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Tom,
>
> > Am 09.03.2022 um 19:40 schrieb Tom Glod via use-livecode <
> use-livecode@lists.runrev.com>:
> >
> > i use the widget.  Yes it can.
>
> this is very good news, thank you! :-)
>
> And what Windows version is neccessary for this to work?
> All versions >= 7?
>
> > On Wed, Mar 9, 2022 at 1:10 PM Klaus major-k via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> >> Hi Jaques,
> >>
> >>> Am 09.03.2022 um 19:01 schrieb J. Landman Gay via use-livecode <
> >> use-livecode@lists.runrev.com>:
> >>>
> >>> I believe it's the Chromium engine.
> >> thanks!
> >> But can it open PDFs out of the box?
>
> Best
>
> Klaus
>
> --
> Klaus Major
> https://www.major-k.de
> https://www.major-k.de/bass
> kl...@major-k.de
>
>
> ___
> 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: Requirements for display PDF in a browser on Windows?

2022-03-09 Thread Klaus major-k via use-livecode
Hi Tom,

> Am 09.03.2022 um 19:40 schrieb Tom Glod via use-livecode 
> :
> 
> i use the widget.  Yes it can.

this is very good news, thank you! :-)

And what Windows version is neccessary for this to work?
All versions >= 7?

> On Wed, Mar 9, 2022 at 1:10 PM Klaus major-k via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Hi Jaques,
>> 
>>> Am 09.03.2022 um 19:01 schrieb J. Landman Gay via use-livecode <
>> use-livecode@lists.runrev.com>:
>>> 
>>> I believe it's the Chromium engine.
>> thanks!
>> But can it open PDFs out of the box?

Best

Klaus

--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
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: Requirements for display PDF in a browser on Windows?

2022-03-09 Thread Tom Glod via use-livecode
i use the widget.  Yes it can.

On Wed, Mar 9, 2022 at 1:10 PM Klaus major-k via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Jaques,
>
> > Am 09.03.2022 um 19:01 schrieb J. Landman Gay via use-livecode <
> use-livecode@lists.runrev.com>:
> >
> > I believe it's the Chromium engine.
>
> thanks!
>
> But can it open PDFs out of the box?
>
> > --
> > Jacqueline Landman Gay | jac...@hyperactivesw.com
> > HyperActive Software | http://www.hyperactivesw.com
> > On March 9, 2022 4:47:26 AM Klaus major-k via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> >>> Is "Chrome" the web engine that LC is unsing in the "browser widget"
> on Windows?
>
> Best
>
> Klaus
>
> --
> Klaus Major
> https://www.major-k.de
> https://www.major-k.de/bass
> kl...@major-k.de
>
>
> ___
> 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: Requirements for display PDF in a browser on Windows?

2022-03-09 Thread Klaus major-k via use-livecode
Hi Jaques,

> Am 09.03.2022 um 19:01 schrieb J. Landman Gay via use-livecode 
> :
> 
> I believe it's the Chromium engine.

thanks!

But can it open PDFs out of the box?

> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> On March 9, 2022 4:47:26 AM Klaus major-k via use-livecode 
>  wrote:
> 
>>> Is "Chrome" the web engine that LC is unsing in the "browser widget" on 
>>> Windows?

Best

Klaus

--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
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: Requirements for display PDF in a browser on Windows?

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

I believe it's the Chromium engine.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On March 9, 2022 4:47:26 AM Klaus major-k via use-livecode 
 wrote:


Is "Chrome" the web engine that LC is unsing in the "browser widget" on 
Windows?





___
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-09 Thread Mike Kerner via use-livecode
throw up an issue and/or a pull request in the repo.

On Mon, Mar 7, 2022 at 8:10 PM Marty Knapp via use-livecode <
use-livecode@lists.runrev.com> wrote:

> 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
>


-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
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-09 Thread Bob Sneidar via use-livecode
Hmmm... I think I misread you to say that arrays are indexed. If that were the 
case, then the devs *should* be able to create functions for querying them and 
getting a subset of keys. I think then that this is NOT the case. 

Bob S


> On Mar 9, 2022, at 07:57 , Bob Sneidar via use-livecode 
>  wrote:
> 
> Then why isn't there a method to query an array? That was precicely why I 
> wrote the routines to convert an array to a database. 
> 
> Bob S
> 
> 
>> On Mar 8, 2022, at 15:56 , Neville Smythe via use-livecode 
>>  wrote:
>> 
>> Turning the list into an array will add indexing overhead very similar to 
>> what using a database would do (I suspect extremely similar in fact!)


___
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-09 Thread Bob Sneidar via use-livecode
Then why isn't there a method to query an array? That was precicely why I wrote 
the routines to convert an array to a database. 

Bob S


> On Mar 8, 2022, at 15:56 , Neville Smythe via use-livecode 
>  wrote:
> 
> Turning the list into an array will add indexing overhead very similar to 
> what using a database would do (I suspect extremely similar in fact!)


___
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: Requirements for display PDF in a browser on Windows?

2022-03-09 Thread Klaus major-k via use-livecode
Hi Tom,

> Am 08.03.2022 um 23:55 schrieb Tom Glod via use-livecode 
> :
> 
> I have definitely opened PDF in the browser in the past  and it opened
> the default "chrome html 5" pdf reader.
> everything seems to have worked.
> And I don't see why it would no longer work now.

thank you for your answers, which leaves some question however.

Is "Chrome" the web engine that LC is unsing in the "browser widget" on Windows?
Or do you create that browser with "revbrowseropen..."?

> you can google "browser test" from within the browser and it will tell you
> some info about the chromium based browser.
> Some of it may shock you.

Ha, I highly doubt that! :-D

> Cheers
> 
> On Tue, Mar 8, 2022 at 3:08 PM Klaus major-k via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Hi,
>> 
>>> Am 08.03.2022 um 19:54 schrieb Klaus major-k via use-livecode <
>> use-livecode@lists.runrev.com>:
>>> 
>>> Hi all,
>>> 
>>> the subject says it all, of course in regard of LC.
>>> 
>>> Is the web-plugin of Acrobat reader still neccessary?
>>> Or do current Windows Browser display PDF files out of the box?
>> 
>> and/or more important, what web engine is the browser widget using on
>> Windows?

Best

Klaus

--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
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