Re: Speaking of Filter and Match...

2022-03-12 Thread Terry Judd via use-livecode
There are sure to be more elegant ways but you could just rebuild the list 
skipping the duplicates as you go

# tList1 contains original list
put cr into tList2
repeat for each line x in tList1
if tList2 contains cr&x&cr then # ensures you check whole not partial lines
# do nothing
   else
put x&cr after tList2
end if
end repeat
put char 2 to -2 of tList2 into tList2 # delete the leading and trailing returns

If you need to retain line specific formatting in the field though you’ll need 
a different approach.

Terry…

Terry Judd | Senior Lecturer in Medical Education
Department of Medical 
Education
The University of Melbourne
M: 61-435 961 594
E: terry.j...@unimelb.edu.au
Publications


From: use-livecode  on behalf of Roger 
Guay via use-livecode 
Date: Sunday, 13 March 2022 at 1:55 pm
To: use-livecode@lists.runrev.com 
Cc: Roger Guay 
Subject: Speaking of Filter and Match...
I have a field with about a thousand lines with many duplicate lines, and I 
want to delete the duplicates. Seems like this should be simple but I am 
running around in circles. Can anyone help me with this?

Thanks,
Roger
___
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


Speaking of Filter and Match...

2022-03-12 Thread Roger Guay via use-livecode
I have a field with about a thousand lines with many duplicate lines, and I 
want to delete the duplicates. Seems like this should be simple but I am 
running around in circles. Can anyone help me with this?

Thanks,
Roger
___
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: Problems with Filter?

2022-03-12 Thread Rick Harrison via use-livecode
Ok, that straightened out my confusion.

Thanks!

> On Mar 12, 2022, at 5:40 PM, Mark Wieder via use-livecode 
>  wrote:
> 
> Exactly. You want matchtext, not filter.
> 
> There is a way to finesse this if you really need to use filter:
> 
>   local tSubString, tTarget, tLargeTextString
>   local tResult
> 
>   put "*THIS*FIND*" into tTarget
>   put "abcdef&cr&ghijkTHISISMYTEXTTOFINDlmnopq&cr&rstuvwxyz" into 
> tLargeTextString
> 
>   filter tLargeTextString with tTarget
>   set the itemDelimiter to "THIS"
>   put item 2 of tLargeTextString into tSubString
>   set the itemDelimiter to "FIND"
>   put item 1 of tSubString into tResult

___
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: Problems with Filter?

2022-03-12 Thread Mark Wieder via use-livecode

On 3/12/22 14:21, Rick Harrison via use-livecode wrote:


So what did it filter?  It’s the same string I started with.


Exactly. You want matchtext, not filter.

There is a way to finesse this if you really need to use filter:

   local tSubString, tTarget, tLargeTextString
   local tResult

   put "*THIS*FIND*" into tTarget
   put "abcdef&cr&ghijkTHISISMYTEXTTOFINDlmnopq&cr&rstuvwxyz" into 
tLargeTextString


   filter tLargeTextString with tTarget
   set the itemDelimiter to "THIS"
   put item 2 of tLargeTextString into tSubString
   set the itemDelimiter to "FIND"
   put item 1 of tSubString into tResult

--
 Mark Wieder
 ahsoftw...@gmail.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: Problems with Filter?

2022-03-12 Thread Brian Milby via use-livecode
Your source was only one line.  The default for filter is to work by line.  It 
returns all lines that match, hence the same string you started with.

Sent from my iPhone

> On Mar 12, 2022, at 5:22 PM, Rick Harrison via use-livecode 
>  wrote:
> 
> 
> put "THIS*FIND" into tTarget
> 
> put “abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz” into tLargeTextString
> 
> put tLargeTextString into pText
> 
> 
> — Adding your code here Mark:
> put ".*THIS.*FIND.*" into tTarget
> 
> filter pText with regex pattern tTarget into tFilteredTextResult
> 
> answer "tFilteredTextResult = " & tFilteredTextResult
> 
> yields: 
> 
> tFilteredTextResult = "abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz”
> 
> So what did it filter?  It’s the same string I started with.
> 
> Rick
> 
>> On Mar 12, 2022, at 3:43 PM, Mark Wieder via use-livecode 
>>  wrote:
>> 
>> or
>>   put ".*THIS.*FIND.*" into tTarget
>>   filter pText with regex pattern tTarget into tFilteredTextResult
> 
> ___
> 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: Problems with Filter?

2022-03-12 Thread Rick Harrison via use-livecode

put "THIS*FIND" into tTarget

put “abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz” into tLargeTextString

put tLargeTextString into pText


— Adding your code here Mark:
put ".*THIS.*FIND.*" into tTarget

filter pText with regex pattern tTarget into tFilteredTextResult

answer "tFilteredTextResult = " & tFilteredTextResult

yields: 

tFilteredTextResult = "abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz”

So what did it filter?  It’s the same string I started with.

Rick

> On Mar 12, 2022, at 3:43 PM, Mark Wieder via use-livecode 
>  wrote:
> 
> or
>put ".*THIS.*FIND.*" into tTarget
>filter pText with regex pattern tTarget into tFilteredTextResult

___
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: LC Player buffering data

2022-03-12 Thread J. Landman Gay via use-livecode
Someone who does a lot of audio work would know more than I do about it, but it used to be that 
files could be saved in either "normal" mode or "streaming" mode. I didn't make the files I 
used in a particular app, but they all streamed and playback started immediately while the rest 
loaded in the background. If things haven't changed, maybe the file format is the culprit?


On 3/12/22 12:35 AM, Peter Bogdanoff via use-livecode wrote:

I should have said, the audio files being played are typically 30MB to 100MB, 
and the freezing happens as soon as the filename URL is set and play is 
supposed to begin.



On Mar 11, 2022, at 10:28 PM, Peter Bogdanoff via use-livecode 
 wrote:

Hi, this is probably a question for Panos.

My application plays audio files from a server using the player. Some users in 
a academic environment are experiencing the application freezing when they play 
audio. These are people in a university in China, where it seems the wireless 
network gets choked up with simultaneous users doing things. When classes are 
over, all works well. Also using a cellular connection works normally (but data 
there is very expensive $$$ to use). Their Wifi seems to be underpowered. These 
are files typically 30K to 100K.

1. Does the player buffer data such that it allows the playing to start before 
the entire file is loaded?

2. If so, would reducing the minimum amount of buffering help with this issue?

3. If so, could there be a player setting to set the amount of required data 
before playing begins?

Thanks!

Peter Bogdanoff
ArtsInteractive
___
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



--
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: Problems with Filter?

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

On 3/12/22 2:29 PM, Brian Milby via use-livecode wrote:

Filter removes non-matching lines.


Unless you use "filter x without y".

--
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-12 Thread J. Landman Gay via use-livecode
I have to thank everyone who helped me figure out my Boggle game. I've put the current file on 
Google Drive for anyone who wants to take a look. The scripts are open and I think I've removed 
all the testing cruft that accumulated over the last couple of weeks.


I'd be interested in any feedback or improvements. There's a Read Me in the zip file with more 
info.




Thanks so much to all! Contributors have been credited in the scripts.

Jacque

--
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: Problems with Filter?

2022-03-12 Thread Mark Wieder via use-livecode

On 3/12/22 12:06, Rick Harrison via use-livecode wrote:

Hi Mark,

matchText works fine.

That doesn’t explain why “filter” doesn’t work though.


Yes. It does. Filter won't give you a substring.

You can use filter to get the whole line of text, but you'll still have 
to dig out the substring if that's what you're after.


In your original code, change to
put "*THIS*FIND*" into tTarget
filter pText with tTarget into tFilteredTextResult
or
put ".*THIS.*FIND.*" into tTarget
filter pText with regex pattern tTarget into tFilteredTextResult

--
 Mark Wieder
 ahsoftw...@gmail.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: Problems with Filter?

2022-03-12 Thread Brian Milby via use-livecode
Filter removes non-matching lines.

On Sat, Mar 12, 2022 at 3:07 PM Rick Harrison via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Mark,
>
> matchText works fine.
>
> That doesn’t explain why “filter” doesn’t work though.
>
> Thanks!
>
> Rick
>
> > On Mar 12, 2022, at 2:05 PM, Mark Wieder via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Try matchtext rather than filter:
> >
> > local tTextt, tFound?
> > put matchtext(tLargeTextString, ".*THIS(.*)FIND.*", tText) into tFound?
>
> ___
> 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: Problems with Filter?

2022-03-12 Thread Rick Harrison via use-livecode
Hi Mark,

matchText works fine.

That doesn’t explain why “filter” doesn’t work though.

Thanks!

Rick

> On Mar 12, 2022, at 2:05 PM, Mark Wieder via use-livecode 
>  wrote:
> 
> Try matchtext rather than filter:
> 
> local tTextt, tFound?
> put matchtext(tLargeTextString, ".*THIS(.*)FIND.*", tText) into tFound?

___
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: Problems with Filter?

2022-03-12 Thread Mark Wieder via use-livecode

On 3/12/22 08:43, Rick Harrison via use-livecode wrote:

Good Morning!

I’m trying to get filter to work with some text and so far no success at all.

Given large string:  abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz

I want the text between THIS and FIND which could be anything like ISLJFKKDKLS

It’s OK to include the THIS and FIND in my result.

I’m thinking I need a wildcard character like * to get the information.


So if I try:
put "THIS*FIND" into tTarget

put “abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz” into tLargeTextString

put tLargeTextString into pText

filter pText with regex tTarget into tFilteredTextResult

answer "tFilteredTextResult = " & tFilteredTextResult

One might think this would work, but it doesn’t, and I get nothing for 
tFilteredTextResult

Suggestions?


Try matchtext rather than filter:

local tTextt, tFound?
put matchtext(tLargeTextString, ".*THIS(.*)FIND.*", tText) into tFound?

--
 Mark Wieder
 ahsoftw...@gmail.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: Problems with Filter?

2022-03-12 Thread Jim Lambert via use-livecode
Try:

put "*THISISMYTEXTTOFIND*" into tTarget
put “abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz” into tLargeTextString

put tLargeTextString into pText

filter pText with tTarget into tFilteredTextResult

answer "tFilteredTextResult = " & tFilteredTextResult

Or more simply:
filter tLargeTextString with "*THISISMYTEXTTOFIND*" into tFilteredTextResult


___
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


Problems with Filter?

2022-03-12 Thread Rick Harrison via use-livecode
Good Morning!

I’m trying to get filter to work with some text and so far no success at all.

Given large string:  abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz

I want the text between THIS and FIND which could be anything like ISLJFKKDKLS

It’s OK to include the THIS and FIND in my result.

I’m thinking I need a wildcard character like * to get the information.


So if I try:
put "THIS*FIND" into tTarget

put “abcdefghijkTHISISMYTEXTTOFINDlmnopqrstuvwxyz” into tLargeTextString

put tLargeTextString into pText

filter pText with regex tTarget into tFilteredTextResult

answer "tFilteredTextResult = " & tFilteredTextResult

One might think this would work, but it doesn’t, and I get nothing for 
tFilteredTextResult

Suggestions?


___
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: LC Player buffering data

2022-03-12 Thread panagiotis m via use-livecode
Hello Peter,

Off the top of my head, I think there is a related read-only property
("loadState") but this is for the iOS mobile player. So you can get the
value of this property using the mobileControlGet command, and start the
video playback accordingly. However, if I remember correctly, your app runs
on Mac and Windows. is that correct?

I suggest you file an enhancement request, my guess is that it shouldn't be
too tricky to add such a property, at least for the Mac player.

Cheers,
Panos
--

On Sat, 12 Mar 2022 at 08:36, Peter Bogdanoff via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I should have said, the audio files being played are typically 30MB to
> 100MB, and the freezing happens as soon as the filename URL is set and play
> is supposed to begin.
>
>
> > On Mar 11, 2022, at 10:28 PM, Peter Bogdanoff via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Hi, this is probably a question for Panos.
> >
> > My application plays audio files from a server using the player. Some
> users in a academic environment are experiencing the application freezing
> when they play audio. These are people in a university in China, where it
> seems the wireless network gets choked up with simultaneous users doing
> things. When classes are over, all works well. Also using a cellular
> connection works normally (but data there is very expensive $$$ to use).
> Their Wifi seems to be underpowered. These are files typically 30K to 100K.
> >
> > 1. Does the player buffer data such that it allows the playing to start
> before the entire file is loaded?
> >
> > 2. If so, would reducing the minimum amount of buffering help with this
> issue?
> >
> > 3. If so, could there be a player setting to set the amount of required
> data before playing begins?
> >
> > Thanks!
> >
> > Peter Bogdanoff
> > ArtsInteractive
> > ___
> > 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