Re: Contains vs is in

2017-01-04 Thread hh
Please forget my last two posts, they contain wrong statements. Haven't seen that this is already implemented using the term "subsequence of elements": >From the dictionary. Target contains Needle if and only if the elements of Needle occur as a _subsequence of the elements_ of Target. So I sho

Re: Contains vs is in

2017-01-04 Thread hh
(LC Builder 'contains' vs 'is in') = Ali, are the following TRUE statements? 1. Every list "contains" the empty list. 2. [x] "contains" [x, x]. 3. nothing "is in" the empty list. > (Corrected in line 5 contains

Re: Contains vs is in

2017-01-04 Thread hh
(LC Builder 'contains' vs 'is in') = TMHO this abstract writing of Ali's examples is easy to remember, the different "level" of the comparison is visible by the brackets. x "is in" A if and only if A "contains&qu

Re: Contains vs is in

2017-01-04 Thread Ali Lloyd
As an example, consider a list ["a", "b", "c"]. "a" is in the list. But the list ["a", "b"] is *not* in the list, as it is not an element of the list - all the elements of the list are strings, and ["a", "b"] is a list. However, ["a", "b", "c"] *does* contain ["a", "b"] as the latter occurs as a 's

Re: Contains vs is in

2017-01-04 Thread Mike Kerner
WHAT? There is some subtlety that I am missing, Ali. On Wed, Jan 4, 2017 at 5:22 AM, Ali Lloyd wrote: > Peter has pointed out that I am technically using the word 'subsequence' in > error, and should probably have used 'substring' instead! > (cf https://en.wikipedia.org/wiki/Subsequence vs > htt

Re: Contains vs is in

2017-01-04 Thread Ali Lloyd
Peter has pointed out that I am technically using the word 'subsequence' in error, and should probably have used 'substring' instead! (cf https://en.wikipedia.org/wiki/Subsequence vs https://en.wikipedia.org/wiki/Substring) On Wed, Jan 4, 2017 at 10:16 AM Ali Lloyd wrote: > 'contains' and 'is in

Re: Contains vs is in

2017-01-04 Thread Ali Lloyd
'contains' and 'is in' are implemented exactly the same in LiveCode Script, so there shouldn't be any difference. However there is an interesting subtlety that emerges when you consider what these two bits of syntax should do, which explains why they are different in LCB. When we say 'A contains B

Re: Contains vs is in

2017-01-03 Thread Bob Sneidar
I interact with copier interfaces quite a lot and the process of backing up the data involves going through various pages and typing what I see there into a text file. I have always thought it would be great to write an app that can do it for me, but I have never been able to scrape anything mor

Re: Contains vs is in

2017-01-03 Thread Mike Kerner
the short answer is "yes", but it can be more complicated as it may require some javascript execution to pull the data from the server. It depends on the site you are scraping. You can also (possibly) use a service that can yank that for you. On Tue, Jan 3, 2017 at 4:05 PM, Bob Sneidar wrote:

Re: Contains vs is in

2017-01-03 Thread Bob Sneidar
Speaking of which, is it possible to scrape values from web controls like menus and check boxes? Bob S On Jan 3, 2017, at 12:12 , Mike Kerner mailto:mikeker...@roadrunner.com>> wrote: I mean if you do web scraping and use LC to analyze the results, a million is a small number. __

Re: Contains vs is in

2017-01-03 Thread Richard Gaskin
Thanks. I've been accused of over-obsessing about performance so often that it didn't occur to me my comment could be seen as erring the other way. :) I've done scraping, but fortunately here the simplest syntax is also the more efficient. And even in tasks requiring fewer than a million ite

Re: Contains vs is in

2017-01-03 Thread Mike Kerner
I mean if you do web scraping and use LC to analyze the results, a million is a small number. On Tue, Jan 3, 2017 at 2:34 PM, hh wrote: > I think he means > > 10% of 1/100 of 1,000,000 iterations of a nano-million-dollar are 1 dollar. > > > Richard Gaskin wrote: > > ? > >> Mike Kerner wrote: > >

Re: Contains vs is in

2017-01-03 Thread hh
I think he means 10% of 1/100 of 1,000,000 iterations of a nano-million-dollar are 1 dollar. > Richard Gaskin wrote: > ? >> Mike Kerner wrote: >> > says the guy who doesn't scrape. >> > >> > On Mon, Jan 2, 2017 at 6:14 PM, Richard Gaskin wrote: >> > >> >> hh wrote: >> >> >> >> > I wasn't aware of

Re: Contains vs is in

2017-01-03 Thread Richard Gaskin
? -- Richard Gaskin Fourth World Systems Mike Kerner wrote: says the guy who doesn't scrape. On Mon, Jan 2, 2017 at 6:14 PM, Richard Gaskin wrote: hh wrote: > I wasn't aware of that, good to know, "is in"/"contains" is 10% > faster than "offset() > 0". But as with many benchmarks, it's

Re: Contains vs is in

2017-01-02 Thread Mike Kerner
says the guy who doesn't scrape. On Mon, Jan 2, 2017 at 6:14 PM, Richard Gaskin wrote: > hh wrote: > > > I wasn't aware of that, good to know, "is in"/"contains" is 10% > > faster than "offset() > 0". > > But as with many benchmarks, it's helpful to keep the absolute times in > mind. > > In my q

Re: Contains vs is in

2017-01-02 Thread Richard Gaskin
hh wrote: > I wasn't aware of that, good to know, "is in"/"contains" is 10% > faster than "offset() > 0". But as with many benchmarks, it's helpful to keep the absolute times in mind. In my quickie test script I had to use 1,000,000 iterations just to get any appreciable duration to test.

Re: Contains vs is in

2017-01-02 Thread hh
But there is interestingly the fact that both are faster than put offset("foo","this is a string with foo in it") > 0 into r3 (seen by 'enlarging' your test). Quite clear because "is in" and "contains" do the ">0" test in the engine, while the above needs a further comparison of two numbers: pu

Re: Contains vs is in

2017-01-02 Thread J. Landman Gay
On 1/2/17 4:44 PM, Richard Gaskin wrote: hh wrote: There is a "contains"-repeat and a "is in"-repeat. If I use one as first and the other as second repeat loop I get that the one that is called first is a little bit faster ... Isn't it that deep in the stomach of LC both use the same offset(su

Re: Contains vs is in

2017-01-02 Thread Richard Gaskin
hh wrote: > There is a "contains"-repeat and a "is in"-repeat. > If I use one as first and the other as second repeat loop I get that > the one that is called first is a little bit faster ... > > Isn't it that deep in the stomach of LC both use the same > offset(substring, string) routine? I wou

Re: Contains vs is in

2017-01-02 Thread hh
[There is always some crazy time overcrossing here, I posted half an hour before you.] I have here the following result with your code (in average). There is a "contains"-repeat and a "is in"-repeat. If I use one as first and the other as second repeat loop I get that the one that is called fir

Re: Contains vs is in

2017-01-02 Thread Richard Gaskin
Mark Talluto wrote: >> On Dec 30, 2016, at 2:32 PM, J. Landman Gay wrote: >> >> Did someone once say that between "contains" and "is in", >> one is faster than the other? > > This is a great question. One of the engineers on the LC team would > be needed to answer this one. Or you could test it:

Re: Contains vs is in

2017-01-02 Thread hh
> Jacqueline L.G. wrote: > > Did someone once say that between "contains" and "is in", one is faster > > than the other? Mark T. wrote: > This is a great question. One of the engineers on the LC team would be > needed to answer this one. There is a real big difference: "is in" are 5 chars and "co

Re: Contains vs is in

2017-01-02 Thread Mark Talluto
> On Dec 30, 2016, at 2:32 PM, J. Landman Gay wrote: > > Did someone once say that between "contains" and "is in", one is faster than > the other? This is a great question. One of the engineers on the LC team would be needed to answer this one. Best regards, Mark Talluto livecloud.io canelas

Contains vs is in

2016-12-30 Thread J. Landman Gay
Did someone once say that between "contains" and "is in", one is faster than the other? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-livecode mailing list us