Re: How do you view lcdoc files after editing/changing)

2019-08-05 Thread Matthias Rebbe via use-livecode
Wow, that´s an awesome helper.

Btw.: did you announce it to the list? I cannot remember to have seen an 
announcement. 

Thanks. This makes editing/correcting much easier.

Matthias

Matthias Rebbe

free tools for Livecoders:
InstaMaker 
WinSignMaker Mac 

> Am 06.08.2019 um 03:37 schrieb Brian Milby via use-livecode 
> mailto:use-livecode@lists.runrev.com>>:
> 
> Check out this stack:
> https://github.com/bwmilby/DocEditorPlus 
> 
> 
> On Mon, Aug 5, 2019 at 7:33 PM Matthias Rebbe via use-livecode <
> use-livecode@lists.runrev.com > wrote:
> 
>> Hi,
>> i am currently trying to edit/modify a lcdoc file of a built in lc
>> library. The lcdoc is not displayed correctly in the dictionary. Some text
>> is missing, in this case text like  is not visible.
>> 
>> Do i really have to restart LC and open the dictionary again after every
>> change?
>> 
>> Are there others here in the list who create such lcdoc files? If so, how
>> do you check if the formatting is correct?
>> 
>> 
>> Regards,
>> 
>> Matthias
>> 
>> 
>> 
>> Matthias Rebbe
>> 
>> free tools for Livecoders:
>> InstaMaker > >
>> WinSignMaker Mac > >
>> ___
>> 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 
> 


Matthias Rebbe

free tools for Livecoders:
InstaMaker 
WinSignMaker Mac 
___
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: How do you view lcdoc files after editing/changing)

2019-08-05 Thread Brian Milby via use-livecode
Check out this stack:
https://github.com/bwmilby/DocEditorPlus

On Mon, Aug 5, 2019 at 7:33 PM Matthias Rebbe via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi,
> i am currently trying to edit/modify a lcdoc file of a built in lc
> library. The lcdoc is not displayed correctly in the dictionary. Some text
> is missing, in this case text like  is not visible.
>
> Do i really have to restart LC and open the dictionary again after every
> change?
>
> Are there others here in the list who create such lcdoc files? If so, how
> do you check if the formatting is correct?
>
>
> Regards,
>
> Matthias
>
>
>
> Matthias Rebbe
>
> free tools for Livecoders:
> InstaMaker 
> WinSignMaker Mac 
> ___
> 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: Help with an algorithm...

2019-08-05 Thread Mark Wieder via use-livecode

On 8/5/19 3:20 PM, dsc--- via use-livecode wrote:

Children are sub-arrays of parents.

Ain't that the truth.

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


How do you view lcdoc files after editing/changing)

2019-08-05 Thread Matthias Rebbe via use-livecode
Hi,
i am currently trying to edit/modify a lcdoc file of a built in lc library. The 
lcdoc is not displayed correctly in the dictionary. Some text is missing, in 
this case text like  is not visible.  

Do i really have to restart LC and open the dictionary again after every change?

Are there others here in the list who create such lcdoc files? If so, how do 
you check if the formatting is correct?


Regards,

Matthias



Matthias Rebbe

free tools for Livecoders:
InstaMaker 
WinSignMaker Mac 
___
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: Help with an algorithm...

2019-08-05 Thread dsc--- via use-livecode
I fixed this to use lists... Maybe.

put parentArray( LISTNEW ) into aNew
put parentArray( LISTOLD )  into aOld
intersect aNew with aOld  -- Remove from aOld that which is not in aNew
union aOld with aNew recursively -- Leaves aNew unchanged except that children 
in aOld are brought in. I think.
put parentList(  aNew ) into LISTNEW

Parents and children are keys in the arrays built. Children are sub-arrays of 
parents.

> On Aug 5, 2019, at 12:31 PM, Dar Scott Consulting via use-livecode 
>  wrote:
> 
> I'm pretty sure I goofed somewhere, but maybe something like this?
> 
> intersect ARRAYNEW with ARRAYOLD into temp
> union temp with ARRAYNEW recursively
> 
> 
>> On Aug 5, 2019, at 9:53 AM, Paul Dupuis via use-livecode 
>>  wrote:
>> 
>> Today is not my coding day. I have a problem I should be able to design a 
>> solution for an am struggling. Clearly I am missing "something"
>> 
>> I have 2 lists (LISTNEW and LISTOLD) of the following format:
>> 
>> ParentA
>> Child 1
>> Child 2
>> etc.
>> ParentB
>> Child 1
>> etc.
>> etc.
>> 
>> The parents are in alphabetical sorted order, the children may not be in 
>> sorted order
>> 
>> I need to hunt through LISTOLD comparing the LISTOLD Parents to the LISTNEW 
>> Parents
>>  FOR any LISTOLD Parent present in LISTNEW, check the Children of the 
>> matching Parents and add any Child for the LISTOLD Parent that is not 
>> already under its matching LISTNEW Parent
>>  FOR any LISTOLD Parent NOT in LISTNEW, I can ignore the Parent and its 
>> Children
>> 
>> I can not seem to write an approach to solve this today. Does any body have 
>> some code so solve this they may be willing to share?
>> 
>> ___
>> 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: Help with an algorithm...

2019-08-05 Thread Dar Scott Consulting via use-livecode
I know this does not attend to the question, but my feelings are like this: if 
one has control, go back and use arrays from the start.

Now, to your comments on robustness in parsing the files. I suppose any 
whitespace at the start of a line could be considered a child.  Also, it is an 
error if the first line is a child.

> On Aug 5, 2019, at 3:59 PM, dunbarxx via use-livecode 
>  wrote:
> 
> Hmmm. I had mentioned earlier:
> 
> "You cannot just find matching lines between the two lists, because some
> children 
> AND some parents may be present in both...
> 
> The discussion has focused on array lore, and that is fine, but are we all
> in agreement that the main task is to isolate the parents, regardless of
> whether the names of those parents might be duplicated?  I mention this
> because everything depends on the reliability of those spaces. The parsing
> of parent "groups", in one way or another, is essential.
> 
> Craig
> 
> 
> 
> --
> Sent from: 
> http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html
> 
> ___
> 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: Help with an algorithm...

2019-08-05 Thread dunbarxx via use-livecode
Hmmm. I had mentioned earlier:

"You cannot just find matching lines between the two lists, because some
children 
AND some parents may be present in both...

 The discussion has focused on array lore, and that is fine, but are we all
in agreement that the main task is to isolate the parents, regardless of
whether the names of those parents might be duplicated?  I mention this
because everything depends on the reliability of those spaces. The parsing
of parent "groups", in one way or another, is essential.

Craig



--
Sent from: 
http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

___
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: [OT] Weighted distribution of Numbers

2019-08-05 Thread Stephen Barncard via use-livecode
This is the kind of math I use every day, without knowing what I’m doing.

On Mon, Aug 5, 2019 at 09:21 Mark Wieder via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 8/5/19 9:00 AM, Mark Wieder via use-livecode wrote:
> > have to weight the measured values to determine the maximum (and the Q
> > as desired).
>
> Urk. Now it's my turn to have misspoken.
> The maximum is easy to measure.
> But looking at the clustering of values to determine the Q of the
> bandpass filter requires a different calculation.
>
> --
>   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
>
-- 
--
Stephen Barncard - Sebastopol Ca. USA -
mixstream.org
___
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: Help with an algorithm...

2019-08-05 Thread Dar Scott Consulting via use-livecode
My mistake. I was thinking arrays.

> On Aug 5, 2019, at 3:34 PM, Mark Wieder via use-livecode 
>  wrote:
> 
> On 8/5/19 2:24 PM, Dar Scott Consulting via use-livecode wrote:
>> Yikes! I wasn't aware of duplicate keys being a problem. How does that 
>> happen?
> 
> Marx
> Groucho
> Chico
> etc.
> Marx
> Karl
> etc.
> 
> -- 
> 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


___
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: Help with an algorithm...

2019-08-05 Thread Mark Wieder via use-livecode

On 8/5/19 2:24 PM, Dar Scott Consulting via use-livecode wrote:

Yikes! I wasn't aware of duplicate keys being a problem. How does that happen?


Marx
Groucho
Chico
etc.
Marx
Karl
etc.

--
 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: Help with an algorithm...

2019-08-05 Thread Dar Scott Consulting via use-livecode
Yikes! I wasn't aware of duplicate keys being a problem. How does that happen?

> On Aug 5, 2019, at 2:28 PM, Alex Tweedly via use-livecode 
>  wrote:
> 
> I'm a great fan of, and user of, arrays - but we always need to be careful of 
> losing data with duplicated keys.
> 
> You haven't said that the parent names in LISTNEW are guaranteed to be 
> unique. This simple code assumes they are - if they're not, it's easy to add 
> a check ...  (And it also assumes the inputs are properly formatted!!)
> 
> (inputs are in fields "FNew" and "FOld", output in field "FOut")
> 
> on mouseUp
>local tOld, tNew, tOut
>local tA
>local tLastParent
> 
>put the text of fld "FNew" into tNew
>repeat for each line L in tNew  -- convert to array
>   if L begins with space then -- a child
>  put L &CR after tA[tLastParent]
>   else
>  put L into tLastParent
>   end if
>end repeat
> 
>put the text of fld "FOld" into tOld
>put empty into tLastParent
>repeat for each line L in tOld
>   if L begins with space then -- a child
>  if (tLastParent is not empty) \
> AND (L is not among the lines of tA[tLastParent]) then
> put L &CR after tA[tLastParent]
>  end if
>   else
>  if L is among the keys of tA then -- a Parent we need to deal with
> put L into tLastParent
>  else
> put empty into tLastParent
>  end if
>   end if
>end repeat
> 
>-- and then collect the expanded outptu
>local tKeys
>put the keys of tA into tKeys
>sort lines of tKeys
>repeat for each line K in tKeys
>   put K &CR & tA[K] after tOut
>end repeat
>put tOut into fld "fOut"
> end mouseUp
> 
> Alex.
> 
> 
> On 05/08/2019 16:53, Paul Dupuis via use-livecode wrote:
>> Today is not my coding day. I have a problem I should be able to design a 
>> solution for an am struggling. Clearly I am missing "something"
>> 
>> I have 2 lists (LISTNEW and LISTOLD) of the following format:
>> 
>> ParentA
>> Child 1
>> Child 2
>> etc.
>> ParentB
>> Child 1
>> etc.
>> etc.
>> 
>> The parents are in alphabetical sorted order, the children may not be in 
>> sorted order
>> 
>> I need to hunt through LISTOLD comparing the LISTOLD Parents to the LISTNEW 
>> Parents
>>   FOR any LISTOLD Parent present in LISTNEW, check the Children of the 
>> matching Parents and add any Child for the LISTOLD Parent that is not 
>> already under its matching LISTNEW Parent
>>   FOR any LISTOLD Parent NOT in LISTNEW, I can ignore the Parent and its 
>> Children
>> 
>> I can not seem to write an approach to solve this today. Does any body have 
>> some code so solve this they may be willing to share?
>> 
>> ___
>> 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: Help with an algorithm...

2019-08-05 Thread Alex Tweedly via use-livecode
I'm a great fan of, and user of, arrays - but we always need to be 
careful of losing data with duplicated keys.


You haven't said that the parent names in LISTNEW are guaranteed to be 
unique. This simple code assumes they are - if they're not, it's easy to 
add a check ...  (And it also assumes the inputs are properly formatted!!)


(inputs are in fields "FNew" and "FOld", output in field "FOut")

on mouseUp
   local tOld, tNew, tOut
   local tA
   local tLastParent

   put the text of fld "FNew" into tNew
   repeat for each line L in tNew  -- convert to array
  if L begins with space then -- a child
 put L &CR after tA[tLastParent]
  else
 put L into tLastParent
  end if
   end repeat

   put the text of fld "FOld" into tOld
   put empty into tLastParent
   repeat for each line L in tOld
  if L begins with space then -- a child
 if (tLastParent is not empty) \
    AND (L is not among the lines of tA[tLastParent]) then
    put L &CR after tA[tLastParent]
 end if
  else
 if L is among the keys of tA then -- a Parent we need to deal with
    put L into tLastParent
 else
    put empty into tLastParent
 end if
  end if
   end repeat

   -- and then collect the expanded outptu
   local tKeys
   put the keys of tA into tKeys
   sort lines of tKeys
   repeat for each line K in tKeys
  put K &CR & tA[K] after tOut
   end repeat
   put tOut into fld "fOut"
end mouseUp

Alex.


On 05/08/2019 16:53, Paul Dupuis via use-livecode wrote:
Today is not my coding day. I have a problem I should be able to 
design a solution for an am struggling. Clearly I am missing "something"


I have 2 lists (LISTNEW and LISTOLD) of the following format:

ParentA
Child 1
Child 2
etc.
ParentB
Child 1
etc.
etc.

The parents are in alphabetical sorted order, the children may not be 
in sorted order


I need to hunt through LISTOLD comparing the LISTOLD Parents to the 
LISTNEW Parents
  FOR any LISTOLD Parent present in LISTNEW, check the Children of the 
matching Parents and add any Child for the LISTOLD Parent that is not 
already under its matching LISTNEW Parent
  FOR any LISTOLD Parent NOT in LISTNEW, I can ignore the Parent and 
its Children


I can not seem to write an approach to solve this today. Does any body 
have some code so solve this they may be willing to share?


___
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

SOLVED: Help with an algorithm...

2019-08-05 Thread Paul Dupuis via use-livecode

On 8/5/2019 11:53 AM, Paul Dupuis via use-livecode wrote:
Today is not my coding day. I have a problem I should be able to 
design a solution for an am struggling. Clearly I am missing "something"


I have 2 lists (LISTNEW and LISTOLD) of the following format:

ParentA
Child 1
Child 2
etc.
ParentB
Child 1
etc.
etc.

The parents are in alphabetical sorted order, the children may not be 
in sorted order


I need to hunt through LISTOLD comparing the LISTOLD Parents to the 
LISTNEW Parents
  FOR any LISTOLD Parent present in LISTNEW, check the Children of the 
matching Parents and add any Child for the LISTOLD Parent that is not 
already under its matching LISTNEW Parent
  FOR any LISTOLD Parent NOT in LISTNEW, I can ignore the Parent and 
its Children


I can not seem to write an approach to solve this today. Does any body 
have some code so solve this they may be willing to share?




Thank you everyone who responded. Apparently, I really just needed a 
nudge, which Craig's first response provided. All replies helped though. 
Routine is now coded, tested, and working correctly.


___
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: Help with an algorithm...

2019-08-05 Thread Dar Scott Consulting via use-livecode
I'm pretty sure I goofed somewhere, but maybe something like this?

intersect ARRAYNEW with ARRAYOLD into temp
union temp with ARRAYNEW recursively


> On Aug 5, 2019, at 9:53 AM, Paul Dupuis via use-livecode 
>  wrote:
> 
> Today is not my coding day. I have a problem I should be able to design a 
> solution for an am struggling. Clearly I am missing "something"
> 
> I have 2 lists (LISTNEW and LISTOLD) of the following format:
> 
> ParentA
> Child 1
> Child 2
> etc.
> ParentB
> Child 1
> etc.
> etc.
> 
> The parents are in alphabetical sorted order, the children may not be in 
> sorted order
> 
> I need to hunt through LISTOLD comparing the LISTOLD Parents to the LISTNEW 
> Parents
>   FOR any LISTOLD Parent present in LISTNEW, check the Children of the 
> matching Parents and add any Child for the LISTOLD Parent that is not already 
> under its matching LISTNEW Parent
>   FOR any LISTOLD Parent NOT in LISTNEW, I can ignore the Parent and its 
> Children
> 
> I can not seem to write an approach to solve this today. Does any body have 
> some code so solve this they may be willing to share?
> 
> ___
> 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-list formatting (was Re: Help with an algorithm...)

2019-08-05 Thread Dar Scott Consulting via use-livecode
I agree that the lack of formatting makes it hard to communicate. I would favor 
changing the list settings to allow for it. I don't think we have a spam 
problem that would discourage that.

And to help support this, LC copy should include types easily pasted into mail 
clients. 

> On Aug 5, 2019, at 11:49 AM, dunbarxx via use-livecode 
>  wrote:
> 
> I really do not like the use-list. It is difficult to format one's answers.

___
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: Help with an algorithm...

2019-08-05 Thread dunbarxx via use-livecode
I saw your post preceded my second one.

Besides the fact that this works as well and is faster:

   repeat for each line tLine in tAll
  put tLine into myArray[ tLine]
   end repeat

The array thing is the easy part. The real working of this gadget depends on
being able to isolate the children, and the only way I can see doing that
easily to rely on those spaces. This may be fragile, depending on how
consistent that format sticks.

You cannot find matching lines between the two lists, because some children
AND some parents may be present in both, and you would not know which
"class" of data you were dealing with. I would format such lists in the
future more robustly, perhaps with tabs.

Craig



--
Sent from: 
http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

___
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: Help with an algorithm...

2019-08-05 Thread Dar Scott Consulting via use-livecode
I'd tend to look for ways to do this with functions that work on whole 
collections and avoid loops. 

If that is not found, or is hard to work with, I'd change the lists to be 
arrays.

Each array is is keyed by parents. Each parent is an array of children. 
Children can be represented as an arrayed indexed by children. The elements of 
those might be ignored or have data.  

Loop on keys in LISTNEW...

> On Aug 5, 2019, at 9:53 AM, Paul Dupuis via use-livecode 
>  wrote:
> 
> Today is not my coding day. I have a problem I should be able to design a 
> solution for an am struggling. Clearly I am missing "something"
> 
> I have 2 lists (LISTNEW and LISTOLD) of the following format:
> 
> ParentA
> Child 1
> Child 2
> etc.
> ParentB
> Child 1
> etc.
> etc.
> 
> The parents are in alphabetical sorted order, the children may not be in 
> sorted order
> 
> I need to hunt through LISTOLD comparing the LISTOLD Parents to the LISTNEW 
> Parents
>   FOR any LISTOLD Parent present in LISTNEW, check the Children of the 
> matching Parents and add any Child for the LISTOLD Parent that is not already 
> under its matching LISTNEW Parent
>   FOR any LISTOLD Parent NOT in LISTNEW, I can ignore the Parent and its 
> Children
> 
> I can not seem to write an approach to solve this today. Does any body have 
> some code so solve this they may be willing to share?
> 
> ___
> 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: Help with an algorithm...

2019-08-05 Thread dunbarxx via use-livecode
I really do not like the use-list. It is difficult to format one's answers.

Here is a handler that places a few pieces of data into two variables. These
would be the two isolated lists of children derived from the parents as
described earlier. There is one difference between the two lists, the child
"xxx'.

on mouseUp
   put "aaa" & return & "bbb" & return & "ccc" into tNew
   put "aaa" & return & "xxx" & return & "ccc" into tOld
   put tOld & return & tnew into tAll
   
   repeat with y = 1 to the number of lines of tAll
  put line y of tAll into myArray[ line y of tAll]
   end repeat
  breakpoint
end mouseUp

Straightforward array stuff. The final list has four children, "xxx" being
added to the mix, as can be seen in the debugger at the breakpoint.

Craig




--
Sent from: 
http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

___
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: Help with an algorithm...

2019-08-05 Thread Paul Dupuis via use-livecode
I had not considered using arrays. I have no idea why, as it provides a 
mechanism. Just not thinking well today. Thanks for the tip!



On 8/5/2019 1:40 PM, dunbarx--- via use-livecode wrote:

Hi.
This seems like a good case for arrays (pseudo):
You have to create an array for each parent. The only way i see to find those 
is to go through the list looking for lines that DO NOT start with a space. If 
you work from the bottom up, since children are always at the bottom and they 
always have spaces in front, you can find the lastMost parent.
Set the itemDel to that parent, and isolate the last item. This will be a list 
of children of that parent.
See if there is a corresponding parent in the new list, and isolate that "item" 
list of children.
Run through the children of the old list and see if they live in the new list. 
If they do, add them:The array part is something like:
put oldChildren & return & newChildren into allChildrenrepeat for each line 
tLine in allChildrenput tLine into myArray[tLine]

Delete the last item of the old list and do it again. This way the last item 
can be isolated directly.
Craig

-Original Message-
From: Paul Dupuis via use-livecode 
To: How to use LiveCode 
Cc: Paul Dupuis 
Sent: Mon, Aug 5, 2019 11:53 am
Subject: Help with an algorithm...

Today is not my coding day. I have a problem I should be able to design
a solution for an am struggling. Clearly I am missing "something"

I have 2 lists (LISTNEW and LISTOLD) of the following format:

ParentA
Child 1
Child 2
etc.
ParentB
Child 1
etc.
etc.

The parents are in alphabetical sorted order, the children may not be in
sorted order

I need to hunt through LISTOLD comparing the LISTOLD Parents to the
LISTNEW Parents
    FOR any LISTOLD Parent present in LISTNEW, check the Children of the
matching Parents and add any Child for the LISTOLD Parent that is not
already under its matching LISTNEW Parent
    FOR any LISTOLD Parent NOT in LISTNEW, I can ignore the Parent and
its Children

I can not seem to write an approach to solve this today. Does any body
have some code so solve this they may be willing to share?

___
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: Help with an algorithm...

2019-08-05 Thread dunbarx--- via use-livecode
Hi.
This seems like a good case for arrays (pseudo):
You have to create an array for each parent. The only way i see to find those 
is to go through the list looking for lines that DO NOT start with a space. If 
you work from the bottom up, since children are always at the bottom and they 
always have spaces in front, you can find the lastMost parent.
Set the itemDel to that parent, and isolate the last item. This will be a list 
of children of that parent.
See if there is a corresponding parent in the new list, and isolate that "item" 
list of children.
Run through the children of the old list and see if they live in the new list. 
If they do, add them:The array part is something like:
put oldChildren & return & newChildren into allChildrenrepeat for each line 
tLine in allChildrenput tLine into myArray[tLine]

Delete the last item of the old list and do it again. This way the last item 
can be isolated directly.
Craig

-Original Message-
From: Paul Dupuis via use-livecode 
To: How to use LiveCode 
Cc: Paul Dupuis 
Sent: Mon, Aug 5, 2019 11:53 am
Subject: Help with an algorithm...

Today is not my coding day. I have a problem I should be able to design 
a solution for an am struggling. Clearly I am missing "something"

I have 2 lists (LISTNEW and LISTOLD) of the following format:

ParentA
Child 1
Child 2
etc.
ParentB
Child 1
etc.
etc.

The parents are in alphabetical sorted order, the children may not be in 
sorted order

I need to hunt through LISTOLD comparing the LISTOLD Parents to the 
LISTNEW Parents
   FOR any LISTOLD Parent present in LISTNEW, check the Children of the 
matching Parents and add any Child for the LISTOLD Parent that is not 
already under its matching LISTNEW Parent
   FOR any LISTOLD Parent NOT in LISTNEW, I can ignore the Parent and 
its Children

I can not seem to write an approach to solve this today. Does any body 
have some code so solve this they may be willing to share?

___
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: Weighted distribution of Numbers

2019-08-05 Thread Douglas Ruisaard via use-livecode
Opps.. correction to: "... When I look at the graph of this function using a 
"k" value of 5 and above, I *thinK* it starts to simulate your desired 
mapping"

That should read " ... When I look at the graph of this function using a 'k' 
value of 3 down to close to zero I *think* starts to simulate your desired 
mapping"

Douglas Ruisaard
Trilogy Software
(250) 573-3935


> -Original Message-
> From: Douglas Ruisaard [mailto:do...@telus.net]
> Sent: Monday, August 05, 2019 8:51 AM
> To: 'use-livecode@lists.runrev.com'
> Subject: RE: Weighted distribution of Numbers
> 
> Ralph:
> Although several persons have responded... most far above my "pay-scale" ... 
> Your mention of the audio
> taper rang bell for me.  In the process of simulating an analog audio 
> potentiometer using a digital
> one... I needed to find a formula for an inverse audio taper... and it DID 
> take a math professor to
> finally provide a solution:
> 
> 
>   kx - 1 + sqrt((1 - kx)^2 + 4kx^2)
> 
>   y = -
> 
>2kx
> 
> Now referencing the potentiometer "model"...
> "x" is the amount of "rotation" .. from near zero (since dividing by zero is 
> verboten) to 100%.. i.e.
> 360 degrees (which a real analog pot never actually achieves.
> "k" is the "weight" factor ... increasing "k" increases the "severity" of the 
> taper ... more or less
> flattening the higher range which, in turn, causing the "higher" rotation 
> values to have less
> differentiated output values "y" is the output ... in the case of a pot, the 
> resistance
> 
> When I look at the graph of this function using a "k" value of 5 and above, I 
> *thinK* it starts to
> simulate your desired mapping.
> 
> Hope this helps ... quadratic formulae are NOT my thing.  Your mission is to 
> fit this formula into you
> app and data set
> 
> Cheers!
> Douglas Ruisaard
> Trilogy Software
> (250) 573-3935
> 
> 
> >
> > Message: 12
> > Date: Sun, 4 Aug 2019 14:49:09 -0400
> > From: "Ralph DiMola" 
> > To: "'How to use LiveCode'" 
> > Subject: [OT] Weighted distribution of Numbers
> > Message-ID: <003701d54af5$4f8cd410$eea67c30$@net>
> > Content-Type: text/plain;   charset="us-ascii"
> >
> > I have a set of raw numbers(6,000 of them from 0 to 800 or so). It was
> > easy to normalize these numbers from 0 to 100. But as I look at the
> > results I see that there is one at to top(100) and a few in the 90s
> > and many more in the 70s and 80s. I need to make these numbers more
> > evenly distributed and weighted towards the top(so the top few are
> > 100) based on the current distribution of the raw numbers. I'm not a
> > math whiz and not afraid to admit that going beyond linier equations
> > is way over my head. From some searches I see the some sort of
> > nonlinear regression is in order(I think)? Or a apply a log (like an
> > audio log taper of a potentiometer)? I don't know... Can anyone point me in 
> > the in the right
> direction?
> >
> > Thanks!
> >
> > Ralph DiMola
> > IT Director
> > Evergreen Information Services
> > rdim...@evergreeninfo.net
> >
> >
> >
> >


___
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: [OT] Weighted distribution of Numbers

2019-08-05 Thread Mark Wieder via use-livecode

On 8/5/19 9:00 AM, Mark Wieder via use-livecode wrote:
have to weight the measured values to determine the maximum (and the Q 
as desired).


Urk. Now it's my turn to have misspoken.
The maximum is easy to measure.
But looking at the clustering of values to determine the Q of the 
bandpass filter requires a different calculation.


--
 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: [OT] Weighted distribution of Numbers

2019-08-05 Thread Mark Wieder via use-livecode

On 8/5/19 1:48 AM, hh via use-livecode wrote:

[@Mark: A (weighted) mean is a location parameter, one number.]


Yes, exactly.


In sum, Dagobert wants to change the method on base of the raw
data or change the raw data such that the results are the wished
ones. (Honi soit qui mal y pense ...)


Respectfully, I think you're looking at a different problem.

Let's say that I have a bandpass filter with a range of 2kHz<->20kHz. If 
I'm just looking at the frequencies I would say the center is at ~10kHz. 
But since the parameters of the bandpass filter can be changed I would 
have to weight the measured values to determine the maximum (and the Q 
as desired).


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


Help with an algorithm...

2019-08-05 Thread Paul Dupuis via use-livecode
Today is not my coding day. I have a problem I should be able to design 
a solution for an am struggling. Clearly I am missing "something"


I have 2 lists (LISTNEW and LISTOLD) of the following format:

ParentA
Child 1
Child 2
etc.
ParentB
Child 1
etc.
etc.

The parents are in alphabetical sorted order, the children may not be in 
sorted order


I need to hunt through LISTOLD comparing the LISTOLD Parents to the 
LISTNEW Parents
  FOR any LISTOLD Parent present in LISTNEW, check the Children of the 
matching Parents and add any Child for the LISTOLD Parent that is not 
already under its matching LISTNEW Parent
  FOR any LISTOLD Parent NOT in LISTNEW, I can ignore the Parent and 
its Children


I can not seem to write an approach to solve this today. Does any body 
have some code so solve this they may be willing to share?


___
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: Weighted distribution of Numbers

2019-08-05 Thread Douglas Ruisaard via use-livecode
Ralph:
Although several persons have responded... most far above my "pay-scale" ... 
Your mention of the audio taper rang bell for me.  In the process of simulating 
an analog audio potentiometer using a digital one... I needed to find a formula 
for an inverse audio taper... and it DID take a math professor to finally 
provide a solution:


  kx - 1 + sqrt((1 - kx)^2 + 4kx^2)

  y = -

   2kx

Now referencing the potentiometer "model"...
"x" is the amount of "rotation" .. from near zero (since dividing by zero is 
verboten) to 100%.. i.e. 360 degrees (which a real analog pot never actually 
achieves.
"k" is the "weight" factor ... increasing "k" increases the "severity" of the 
taper ... more or less flattening the higher range which, in turn, causing the 
"higher" rotation values to have less differentiated output values
"y" is the output ... in the case of a pot, the resistance

When I look at the graph of this function using a "k" value of 5 and above, I 
*thinK* it starts to simulate your desired mapping.

Hope this helps ... quadratic formulae are NOT my thing.  Your mission is to 
fit this formula into you app and data set
 
Cheers!
Douglas Ruisaard
Trilogy Software
(250) 573-3935


> 
> Message: 12
> Date: Sun, 4 Aug 2019 14:49:09 -0400
> From: "Ralph DiMola" 
> To: "'How to use LiveCode'" 
> Subject: [OT] Weighted distribution of Numbers
> Message-ID: <003701d54af5$4f8cd410$eea67c30$@net>
> Content-Type: text/plain; charset="us-ascii"
> 
> I have a set of raw numbers(6,000 of them from 0 to 800 or so). It was easy
> to normalize these numbers from 0 to 100. But as I look at the results I see
> that there is one at to top(100) and a few in the 90s and many more in the
> 70s and 80s. I need to make these numbers more evenly distributed and
> weighted towards the top(so the top few are 100) based on the current
> distribution of the raw numbers. I'm not a math whiz and not afraid to admit
> that going beyond linier equations is way over my head. From some searches I
> see the some sort of nonlinear regression is in order(I think)? Or a apply a
> log (like an audio log taper of a potentiometer)? I don't know... Can anyone
> point me in the in the right direction?
> 
> Thanks!
> 
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
> 
> 
> 
> 


___
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] This week in LiveCode 188

2019-08-05 Thread panagiotis merakos via use-livecode
Hi all,

Read about new developments in LiveCode open source and the open source
community in today's edition of the "This Week in LiveCode" newsletter!

Read issue #188 here: http://bit.ly/33dSA1S

This is a weekly newsletter about LiveCode, focussing on what's been
going on in and around the open source project. New issues will be
released weekly on Mondays. We have a dedicated mailing list that will
deliver each issue directly to you e-mail, so you don't miss any!

If you have anything you'd like mentioned (a project, a discussion
somewhere, an upcoming event) then please get in touch.

-- 
Panagiotis Merakos 
LiveCode Software Developer

Everyone Can Create Apps 
___
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


Should the scope of WholeMatches be expanded?

2019-08-05 Thread Paul Dupuis via use-livecode
Is it just me or would anyone else like to see the scope of the 
wholeMatches property expanded beyond just wordOffset, itemOffset, and 
lineOffset.


I'd like to see wholeMatches apply to:

Replace
Replace in field
Contains (as in if X contains Y)

With wholeMatches meaning test at white space (space,line break, tab, 
etc.) boundaries for all three of these.


Yes, I know I can do the replace using the replaceText function and regex.

I have a heavily formatted field and would LOVE to use the "new" replace 
... in field preserving styles, but I have to ensure that I only match 
and replace whole strings (bounded by white space/line breaks) and don't 
accidentally replace part of a string.


___
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: [OT] Weighted distribution of Numbers

2019-08-05 Thread hh via use-livecode
When computing limits for distribution categories given
frequencies the following may be useful:

A number q is a p%-quantile of a data set
If  the percentage of data nums <= q is >= p%
and the percentage of data nums >= q is >= (100-p)%

For each percentage p there is an interval
[lowerV,upperV] so that each number from that interval
is p%-quantile of the data set.

To make it unique some use in case lowerV < upperV the
average of lowerV and upperV.

-- d=data in lines, sorted ascending numeric
-- p=percentage (num in range 0-100)
function quantile p,d
  put the num of lines of d into N
  put N*p/100 into m0
  put line ceil(N*p/100) of d into lowerV
  put line N+1 - ceil(N*(100-p)/100) of d into upperV
  -- return avg(lowerV,upperV) --> unique variant
  if lowerV=upperV then return lowerV
  else return lowerV,upperV
end quantile

For example quantile(50,d) returns the median of a data set,
quantile(25,d), quantile(50,d), quantile(75,d) the quartiles.

___
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


new keyboardstypes mobile seem not to work LC950

2019-08-05 Thread JJS via use-livecode

Hi,


anyone already tested the new keyboard commands for mobile(Android)?

mobileSetKeyboardReturnKey "done"
  mobileSetKeyboardDisplay "over"
  set the keyboardType of me to "email"

these seem not to work, and even do not bring up the keyboard as wanted.

so i use as normal this one: mobileSetKeyboardType "email" for a single 
field as it has a V instead of a return.


Now as i'm not using the native field input, because i can't get the 
text positioned correctin the field(chopped off). And i dislike the 
orange square around the field.


I could use the mobilecreate input of course, but still i like the way 
i'm using the ASK command for a single line input.


Now i put a empty image over the regurlar field and in the iamge i put 
the script. Maybe a bit more work but i like the way it works with ask.



I also tested these commands without the empty image over the field and 
thus directly in the fields script. It does not work.


Anyone tried yet?


Thanks.

Sphere


___
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: [OT] Weighted distribution of Numbers

2019-08-05 Thread hh via use-livecode
> I wrote:
> In order to find these limits simply sort the random data (a random
> sample drawn out of the raw data) and take the values that have
> approximately 30% or 80% of the values below them (no scaling needed
> for that). In statistical terms: Find the 30% and 80% quantiles.

Please forget my last correction (I'm tired), was:
> Sorry, read here 70% instead of 80% to relate correctly to the example
> 0-30 = bad, 31-70 = neutral, 71-100 = good.

"In order ..." relates correctly to the example
> ... expected to have frequencies of say 30%, 50%, 20%.


___
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: [OT] Weighted distribution of Numbers

2019-08-05 Thread hh via use-livecode
I wrote:
> In order to find these limits simply sort the random data (a random
> sample drawn out of the raw data) and take the values that have
> approximately 30% or 80% of the values below them (no scaling needed
> for that). In statistical terms: Find the 30% and 80% quantiles.

Sorry, read here 70% instead of 80% to relate correctly to the example
0-30 = bad, 31-70 = neutral, 71-100 = 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: [OT] Weighted distribution of Numbers

2019-08-05 Thread hh via use-livecode
[@Mark: A (weighted) mean is a location parameter, one number.]

Here the customer (say Dagobert Duck) wants to change/weight the
distribution of the data.

As Dar says, he could do a mapping from 0-800 to bins as
"bad, neutral, good" simply by setting limits for the bins.

For example 0-30 = bad, 31-70 = neutral, 71-100 = good.

And make these limits transparent and show their frequencies
as they are.

But now Dagobert wants to "adjust" by (1) and/or (2):

(1)
Set the limits for the bins such that each bin has a relative
frequency of 1/3 (or given relative frequencies).
This is setting categories by their frequencies in order to
interpret the frequency of the categories.

(2)
Change the raw data such that for the given limits each bin has
a relative frequency of 1/3 (or given relative frequencies).
This is filling categories by changing data in order to interpret
the frequency of the categories of the changed data.

In sum, Dagobert wants to change the method on base of the raw
data or change the raw data such that the results are the wished
ones. (Honi soit qui mal y pense ...)

-- 
I would accept (1) if one argues from *theoretical* reasons that
the bins are expected to have frequencies of say 30%, 50%, 20%.
This could lead to limits on base of *some* (random part) of raw data:

In order to find these limits simply sort the random data (a random
sample drawn out of the raw data) and take the values that have
approximately 30% or 80% of the values below them (no scaling needed
for that). In statistical terms: Find the 30% and 80% quantiles.

Then one could use these (transparent) limits for the *rest* of the
raw data and new raw data and interpret the frequencies of the bins.


___
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