[OT] Poll: What does it mean for 1 rect to be 'within' a certain distance of another rect?

classic Classic list List threaded Threaded
31 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[OT] Poll: What does it mean for 1 rect to be 'within' a certain distance of another rect?

Mark Wieder via use-livecode
This is an Off Topic informal poll of sorts, but related to LiveCode as
I am writing a LiveCode expression to determine if 2 arbitrary
rectangles (r1,r2) are with some distance d (in px) of one another. In
considering this problem, the questions comes up: What is meant by
rectangles being within a distance d of one another. What is the 'd'
measured from?

center to center? Easiest is many ways, but I don't think this is what
most people would think of.

adjacent edge to adjacent edge? This is harder (I think), but I think
this is what more people intuitively think of. To me, implicit in the
visual concept of 2 rects being within some distance of one another is
that they are NOT overlapping, but that some gap exists between the
nearest adjacent edges?

Something else? What does 2 rects  being 'within' d pixels of one
another mean to you, if not one of the two above options?

Maybe there is a exact mathematical definition of what 2 rectangles
being within distance d of one another is, but, if there is, I am
unfamiliar with it.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Poll: What does it mean for 1 rect to be 'within' a certain distance of another rect?

Mark Wieder via use-livecode
I think the natural definition would be distance between the respective boundaries; i.e., edge
to edge distance, but also the distance between corners. That is, if any of r1's corners is d
distance from any one of r2's closest corners.

On 2/15/21 4:53 PM, Paul Dupuis via use-livecode wrote:

> This is an Off Topic informal poll of sorts, but related to LiveCode as I am writing a LiveCode
> expression to determine if 2 arbitrary rectangles (r1,r2) are with some distance d (in px) of
> one another. In considering this problem, the questions comes up: What is meant by rectangles
> being within a distance d of one another. What is the 'd' measured from?
>
> center to center? Easiest is many ways, but I don't think this is what most people would think of.
>
> adjacent edge to adjacent edge? This is harder (I think), but I think this is what more people
> intuitively think of. To me, implicit in the visual concept of 2 rects being within some
> distance of one another is that they are NOT overlapping, but that some gap exists between the
> nearest adjacent edges?
>
> Something else? What does 2 rects  being 'within' d pixels of one another mean to you, if not
> one of the two above options?
>
> Maybe there is a exact mathematical definition of what 2 rectangles being within distance d of
> one another is, but, if there is, I am unfamiliar with it.
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Poll: What does it mean for 1 rect to be 'within' a certain distance of another rect?

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Hi,
No point reinventing the wheel..

Lots of other way. Distance between two near or far edges. distance between
corners, distance to centers, or area median, area of space between,
overal usage area minus the area used by the two rectangles. Math is fun.
Keeps us in business.

Google (distance between two rectangles):

https://stackoverflow.com/questions/4978323/how-to-calculate-distance-between-two-rectangles-context-a-game-in-lua

https://math.stackexchange.com/questions/2724537/finding-the-clear-spacing-distance-between-two-rectangles

https://www.wyzant.com/resources/answers/583373/finding-the-distance-between-two-rectangles

https://www.programmersought.com/article/44554760896/

etc

On Mon, 15 Feb 2021 at 22:53, Paul Dupuis via use-livecode <
[hidden email]> wrote:

> This is an Off Topic informal poll of sorts, but related to LiveCode as
> I am writing a LiveCode expression to determine if 2 arbitrary
> rectangles (r1,r2) are with some distance d (in px) of one another. In
> considering this problem, the questions comes up: What is meant by
> rectangles being within a distance d of one another. What is the 'd'
> measured from?
>
> center to center? Easiest is many ways, but I don't think this is what
> most people would think of.
>
> adjacent edge to adjacent edge? This is harder (I think), but I think
> this is what more people intuitively think of. To me, implicit in the
> visual concept of 2 rects being within some distance of one another is
> that they are NOT overlapping, but that some gap exists between the
> nearest adjacent edges?
>
> Something else? What does 2 rects  being 'within' d pixels of one
> another mean to you, if not one of the two above options?
>
> Maybe there is a exact mathematical definition of what 2 rectangles
> being within distance d of one another is, but, if there is, I am
> unfamiliar with it.
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

How do I interpret this Build Error dialog?

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Folks:

I have a pretty complex app that I’ve been adding onto for awhile and now I’m getting a seemingly informative error dialog when I try to build it. It works fine in the IDE. The app consists of numerous stacks and libraries launched with a splash stack. I get an error dialog but have no idea how to interpret its info. It’s not clear to me how to interpret the error dialog and what made it fail. It seems to fail at the login stack, which is called when the user clicks the Start button.

Was the failure point at the end of the error message? I haven’t actually tried to build this app for a couple of years and its complexity has grown. All of the stacks in the project have been entered into the “Stacks” section of the standalone properties dialog. I’ve obviously done something wrong and it would help a lot if I could interpret the error message (I hope).

The following two links will display the first part of the error message and the second (scrolled) part.
https://www.dropbox.com/s/brlvvtrbb8xeh6j/buildFail-1.png?dl=0 <https://www.dropbox.com/s/brlvvtrbb8xeh6j/buildFail-1.png?dl=0>

https://www.dropbox.com/s/5cyq3huunp7wnl3/buildFail-2.png?dl=0 <https://www.dropbox.com/s/5cyq3huunp7wnl3/buildFail-2.png?dl=0>

Any wisdom on how to proceed would be much appreciated.

Thanks,
Bill

William Prothero
[hidden email]



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: How do I interpret this Build Error dialog?

Mark Wieder via use-livecode
Hi,
The error panels show the events in reverse order, so last occurrence first.

The first number in each line is the error code and the second is the line
number in the script that failed.
Here's a list of the error codes:
https://livecode.fandom.com/wiki/Error_codes

Going back from line 5 of your error:
353 - THe name of the object it enters (stack "loginLib")
241 - Handler: error in statement , line 236 of stack "LoginLib"
465 - put: error in expression , line 236
118 - Operators &: &: error in left operand , line 236
219 - Function: error in function handler , line 236 (function
getDesktopFolderPath)

So, it's likely a compound problem with lots of things that likely led up
to the fault. There are more 219 and 241 errors and it starts with a 490
(repeat: error in statement). Work your way through the error codes and see
what you find.

All the best
Sean

On Mon, 15 Feb 2021 at 23:24, William Prothero via use-livecode <
[hidden email]> wrote:

> Folks:
>
> I have a pretty complex app that I’ve been adding onto for awhile and now
> I’m getting a seemingly informative error dialog when I try to build it. It
> works fine in the IDE. The app consists of numerous stacks and libraries
> launched with a splash stack. I get an error dialog but have no idea how to
> interpret its info. It’s not clear to me how to interpret the error dialog
> and what made it fail. It seems to fail at the login stack, which is called
> when the user clicks the Start button.
>
> Was the failure point at the end of the error message? I haven’t actually
> tried to build this app for a couple of years and its complexity has grown.
> All of the stacks in the project have been entered into the “Stacks”
> section of the standalone properties dialog. I’ve obviously done something
> wrong and it would help a lot if I could interpret the error message (I
> hope).
>
> The following two links will display the first part of the error message
> and the second (scrolled) part.
> https://www.dropbox.com/s/brlvvtrbb8xeh6j/buildFail-1.png?dl=0 <
> https://www.dropbox.com/s/brlvvtrbb8xeh6j/buildFail-1.png?dl=0>
>
> https://www.dropbox.com/s/5cyq3huunp7wnl3/buildFail-2.png?dl=0 <
> https://www.dropbox.com/s/5cyq3huunp7wnl3/buildFail-2.png?dl=0>
>
> Any wisdom on how to proceed would be much appreciated.
>
> Thanks,
> Bill
>
> William Prothero
> [hidden email]
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Poll: What does it mean for 1 rect to be 'within' a certain distance of another rect?

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode

On 15/02/2021 23:21, Sean Cole (Pi) via use-livecode wrote:
> Hi,
> No point reinventing the wheel..

But most of those links actually did not have this particular wheel, or
anything like it.

The exception was the last one (programmerssought.com) which had an
ugly, inefficient and lengthy (45 lines in Python) solution. [OK, that
45 includs blank and comments :-) !!

For me, a more precise problem specification is:

Given two rectangles (in regular Livecode format), the distance between
them is :

  - if they touch or overlap, distance is zero.

  - otherwise, it's the smallest distance from any point in R1 to any
point in R2.

Which leads to a simple solution

> function rdist R1, R2
>    local DX, DY
>    put max( item 1 of R1 - item 3 of R2, item 1 of R2 - item 3 of R1,
> 0) into DX
>    put max( item 2 of R1 - item 4 of R2, item 2 of R2 - item 4 of R1,
> 0) into DY
>    return sqrt( DX*DX + DY * DY)
> end rdist
>
Alex.


> Lots of other way. Distance between two near or far edges. distance between
> corners, distance to centers, or area median, area of space between,
> overal usage area minus the area used by the two rectangles. Math is fun.
> Keeps us in business.
>
> Google (distance between two rectangles):
>
> https://stackoverflow.com/questions/4978323/how-to-calculate-distance-between-two-rectangles-context-a-game-in-lua
>
> https://math.stackexchange.com/questions/2724537/finding-the-clear-spacing-distance-between-two-rectangles
>
> https://www.wyzant.com/resources/answers/583373/finding-the-distance-between-two-rectangles
>
> https://www.programmersought.com/article/44554760896/
>
> etc
>
> On Mon, 15 Feb 2021 at 22:53, Paul Dupuis via use-livecode <
> [hidden email]> wrote:
>
>> This is an Off Topic informal poll of sorts, but related to LiveCode as
>> I am writing a LiveCode expression to determine if 2 arbitrary
>> rectangles (r1,r2) are with some distance d (in px) of one another. In
>> considering this problem, the questions comes up: What is meant by
>> rectangles being within a distance d of one another. What is the 'd'
>> measured from?
>>
>> center to center? Easiest is many ways, but I don't think this is what
>> most people would think of.
>>
>> adjacent edge to adjacent edge? This is harder (I think), but I think
>> this is what more people intuitively think of. To me, implicit in the
>> visual concept of 2 rects being within some distance of one another is
>> that they are NOT overlapping, but that some gap exists between the
>> nearest adjacent edges?
>>
>> Something else? What does 2 rects  being 'within' d pixels of one
>> another mean to you, if not one of the two above options?
>>
>> Maybe there is a exact mathematical definition of what 2 rectangles
>> being within distance d of one another is, but, if there is, I am
>> unfamiliar with it.
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: How do I interpret this Build Error dialog?

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
In Sample Stacks, search for LiveCode Error Lookup. I keep it my Plugins
folder. You can paste the whole list of errors into it and it will tell you
what they mean.

However, usually you only need the first line which is where a break would
happen in the IDE. The other lines are, in reverse order, the messages that
led up to the topmost error.

The first item in each line is the error code, the second is the script
line number, and the third is the character offset in the line.

An advantage of this stack is that it reads the error descriptions from the
currently running copy of LiveCode so it is always up to date. New errors
are added as the language expands.

--
Jacqueline Landman Gay | [hidden email]
HyperActive Software | http://www.hyperactivesw.com
On February 15, 2021 5:26:44 PM William Prothero via use-livecode
<[hidden email]> wrote:

> Folks:
>
> I have a pretty complex app that I’ve been adding onto for awhile and now
> I’m getting a seemingly informative error dialog when I try to build it. It
> works fine in the IDE. The app consists of numerous stacks and libraries
> launched with a splash stack. I get an error dialog but have no idea how to
> interpret its info. It’s not clear to me how to interpret the error dialog
> and what made it fail. It seems to fail at the login stack, which is called
> when the user clicks the Start button.
>
> Was the failure point at the end of the error message? I haven’t actually
> tried to build this app for a couple of years and its complexity has grown.
> All of the stacks in the project have been entered into the “Stacks”
> section of the standalone properties dialog. I’ve obviously done something
> wrong and it would help a lot if I could interpret the error message (I hope).
>
> The following two links will display the first part of the error message
> and the second (scrolled) part.
> https://www.dropbox.com/s/brlvvtrbb8xeh6j/buildFail-1.png?dl=0 
> <https://www.dropbox.com/s/brlvvtrbb8xeh6j/buildFail-1.png?dl=0>
>
> https://www.dropbox.com/s/5cyq3huunp7wnl3/buildFail-2.png?dl=0 
> <https://www.dropbox.com/s/5cyq3huunp7wnl3/buildFail-2.png?dl=0>
>
> Any wisdom on how to proceed would be much appreciated.
>
> Thanks,
> Bill
>
> William Prothero
> [hidden email]
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: How do I interpret this Build Error dialog?

Mark Wieder via use-livecode
On 2/15/21 5:29 PM, J. Landman Gay via use-livecode wrote:
> In Sample Stacks, search for LiveCode Error Lookup. I keep it my Plugins
> folder. You can paste the whole list of errors into it and it will tell
> you what they mean.
>
> However, usually you only need the first line which is where a break
> would happen in the IDE. The other lines are, in reverse order, the
> messages that led up to the topmost error.

Actually, in this case the second line has more info.
Line #1 (error #219: error in function handler) is a more generic error
message that I find singularly unuseful.
Line #2 (error #118: Operators &: error in left operand) gives a more
specific reason.

At any rate, the problem seems to be on line 236 in the function
getDesktopFolderPath, and is probably around char 8, although that isn't
always accurate.

The stack frames leading up to the error were triggered by the build
process invoking preOpencard:

preOpenCard
--> initFirstLoginScreen
----> checkForLastLogInFile
------> getDesktopFolderPath

--
  Mark Wieder
  [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: How do I interpret this Build Error dialog?

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Sean:
Thank you, thank you!.
Bill

> On Feb 15, 2021, at 4:14 PM, Sean Cole (Pi) via use-livecode <[hidden email]> wrote:
>
> Hi,
> The error panels show the events in reverse order, so last occurrence first.
>
> The first number in each line is the error code and the second is the line
> number in the script that failed.
> Here's a list of the error codes:
> https://livecode.fandom.com/wiki/Error_codes
>
> Going back from line 5 of your error:
> 353 - THe name of the object it enters (stack "loginLib")
> 241 - Handler: error in statement , line 236 of stack "LoginLib"
> 465 - put: error in expression , line 236
> 118 - Operators &: &: error in left operand , line 236
> 219 - Function: error in function handler , line 236 (function
> getDesktopFolderPath)
>
> So, it's likely a compound problem with lots of things that likely led up
> to the fault. There are more 219 and 241 errors and it starts with a 490
> (repeat: error in statement). Work your way through the error codes and see
> what you find.
>
> All the best
> Sean
>
> On Mon, 15 Feb 2021 at 23:24, William Prothero via use-livecode <
> [hidden email]> wrote:
>
>> Folks:
>>
>> I have a pretty complex app that I’ve been adding onto for awhile and now
>> I’m getting a seemingly informative error dialog when I try to build it. It
>> works fine in the IDE. The app consists of numerous stacks and libraries
>> launched with a splash stack. I get an error dialog but have no idea how to
>> interpret its info. It’s not clear to me how to interpret the error dialog
>> and what made it fail. It seems to fail at the login stack, which is called
>> when the user clicks the Start button.
>>
>> Was the failure point at the end of the error message? I haven’t actually
>> tried to build this app for a couple of years and its complexity has grown.
>> All of the stacks in the project have been entered into the “Stacks”
>> section of the standalone properties dialog. I’ve obviously done something
>> wrong and it would help a lot if I could interpret the error message (I
>> hope).
>>
>> The following two links will display the first part of the error message
>> and the second (scrolled) part.
>> https://www.dropbox.com/s/brlvvtrbb8xeh6j/buildFail-1.png?dl=0 <
>> https://www.dropbox.com/s/brlvvtrbb8xeh6j/buildFail-1.png?dl=0>
>>
>> https://www.dropbox.com/s/5cyq3huunp7wnl3/buildFail-2.png?dl=0 <
>> https://www.dropbox.com/s/5cyq3huunp7wnl3/buildFail-2.png?dl=0>
>>
>> Any wisdom on how to proceed would be much appreciated.
>>
>> Thanks,
>> Bill
>>
>> William Prothero
>> [hidden email]
>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

William Prothero
[hidden email]




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: How do I interpret this Build Error dialog?

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Mark and Jacqueline:
Thanks. That’s very helpful!
Bill

> On Feb 15, 2021, at 5:54 PM, Mark Wieder via use-livecode <[hidden email]> wrote:
>
> On 2/15/21 5:29 PM, J. Landman Gay via use-livecode wrote:
>> In Sample Stacks, search for LiveCode Error Lookup. I keep it my Plugins folder. You can paste the whole list of errors into it and it will tell you what they mean.
>> However, usually you only need the first line which is where a break would happen in the IDE. The other lines are, in reverse order, the messages that led up to the topmost error.
>
> Actually, in this case the second line has more info.
> Line #1 (error #219: error in function handler) is a more generic error message that I find singularly unuseful.
> Line #2 (error #118: Operators &: error in left operand) gives a more specific reason.
>
> At any rate, the problem seems to be on line 236 in the function getDesktopFolderPath, and is probably around char 8, although that isn't always accurate.
>
> The stack frames leading up to the error were triggered by the build process invoking preOpencard:
>
> preOpenCard
> --> initFirstLoginScreen
> ----> checkForLastLogInFile
> ------> getDesktopFolderPath
>
> --
> Mark Wieder
> [hidden email]
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

William Prothero
[hidden email]




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Another question about multiple stack projects

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Folks:
I have a question about multiple stack projects. My project starts with a splash stack. In the standalone preferences of this stack, I list all stacks the project uses, including script only stacks I use as libraries. Should I do a “Start using” on all of these stacks at this point? But I could have just done a “start using” for the required stacks for each of the other component stacks when they were first accessed, and got the same result?

I guess my question is: how does the build process make use of the list of stacks in the splash stack? Are they all built into the project in some way that doesn’t happen otherwise? I still seem to be required to “Start using” each of the library stacks anyway.

Best,
Bill

William Prothero
[hidden email]




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: How do I interpret this Build Error dialog?

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
William Prothero wrote:
...
 > https://www.dropbox.com/s/brlvvtrbb8xeh6j/buildFail-1.png?dl=0

What we see there is two bugs: the error being reported, and the dumping
of raw error data in that IDE dialog with no effort made to turn a
format designed for machine parsing into anything useful for human reading.

I'm hoping I'm wrong, and that nothing in the IDE is designed to be so
unhelpful.

Please tell me that dialog is not from the IDE.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: How do I interpret this Build Error dialog?

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
I should have said "the first line with an error code."

I also should have looked at the images before I answered...

--
Jacqueline Landman Gay | [hidden email]
HyperActive Software | http://www.hyperactivesw.com
On February 15, 2021 7:56:47 PM Mark Wieder via use-livecode
<[hidden email]> wrote:

> On 2/15/21 5:29 PM, J. Landman Gay via use-livecode wrote:
>> In Sample Stacks, search for LiveCode Error Lookup. I keep it my Plugins
>> folder. You can paste the whole list of errors into it and it will tell
>> you what they mean.
>>
>> However, usually you only need the first line which is where a break
>> would happen in the IDE. The other lines are, in reverse order, the
>> messages that led up to the topmost error.
>
> Actually, in this case the second line has more info.
> Line #1 (error #219: error in function handler) is a more generic error
> message that I find singularly unuseful.
> Line #2 (error #118: Operators &: error in left operand) gives a more
> specific reason.
>
> At any rate, the problem seems to be on line 236 in the function
> getDesktopFolderPath, and is probably around char 8, although that isn't
> always accurate.
>
> The stack frames leading up to the error were triggered by the build
> process invoking preOpencard:
>
> preOpenCard
> --> initFirstLoginScreen
> ----> checkForLastLogInFile
> ------> getDesktopFolderPath
>
> --
>  Mark Wieder
>  [hidden email]
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Poll: What does it mean for 1 rect to be 'within' a certain distance of another rect?

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Alex,
No one would challenge your definition I think, but your solution only takes the corner points into account, right? So this wouldn’t give correct results in case the rectangles have different sizes or are positioned obliquely.

Henk


> On 16 Feb 2021, at 03:12, [hidden email] wrote:
>
> For me, a more precise problem specification is:
>
> Given two rectangles (in regular Livecode format), the distance between
> them is :
>
> ?- if they touch or overlap, distance is zero.
>
> ?- otherwise, it's the smallest distance from any point in R1 to any
> point in R2.
>
> Which leads to a simple solution
>
>> function rdist R1, R2
>> ?? local DX, DY
>> ?? put max( item 1 of R1 - item 3 of R2, item 1 of R2 - item 3 of R1,
>> 0) into DX
>> ?? put max( item 2 of R1 - item 4 of R2, item 2 of R2 - item 4 of R1,
>> 0) into DY
>> ?? return sqrt( DX*DX + DY * DY)
>> end rdist
>>
> Alex.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Poll: What does it mean for 1 rect to be 'within' a certain distance of another rect?

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
I would go for the distance between edges, although I can see the
Mathematical wobbly bits you
are going to have to jump through.

Richmond.

On 16.02.21 0:53, Paul Dupuis via use-livecode wrote:

> This is an Off Topic informal poll of sorts, but related to LiveCode
> as I am writing a LiveCode expression to determine if 2 arbitrary
> rectangles (r1,r2) are with some distance d (in px) of one another. In
> considering this problem, the questions comes up: What is meant by
> rectangles being within a distance d of one another. What is the 'd'
> measured from?
>
> center to center? Easiest is many ways, but I don't think this is what
> most people would think of.
>
> adjacent edge to adjacent edge? This is harder (I think), but I think
> this is what more people intuitively think of. To me, implicit in the
> visual concept of 2 rects being within some distance of one another is
> that they are NOT overlapping, but that some gap exists between the
> nearest adjacent edges?
>
> Something else? What does 2 rects  being 'within' d pixels of one
> another mean to you, if not one of the two above options?
>
> Maybe there is a exact mathematical definition of what 2 rectangles
> being within distance d of one another is, but, if there is, I am
> unfamiliar with it.
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Poll: What does it mean for 1 rect to be 'within' a certain distance of another rect?

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Sorry: I have moved over here:

http://forums.livecode.com/viewtopic.php?f=7&t=35407

as I believe a picture is worth a thousand words:

Richmond.

On 16.02.21 1:13, J. Landman Gay via use-livecode wrote:

> I think the natural definition would be distance between the
> respective boundaries; i.e., edge to edge distance, but also the
> distance between corners. That is, if any of r1's corners is d
> distance from any one of r2's closest corners.
>
> On 2/15/21 4:53 PM, Paul Dupuis via use-livecode wrote:
>> This is an Off Topic informal poll of sorts, but related to LiveCode
>> as I am writing a LiveCode expression to determine if 2 arbitrary
>> rectangles (r1,r2) are with some distance d (in px) of one another.
>> In considering this problem, the questions comes up: What is meant by
>> rectangles being within a distance d of one another. What is the 'd'
>> measured from?
>>
>> center to center? Easiest is many ways, but I don't think this is
>> what most people would think of.
>>
>> adjacent edge to adjacent edge? This is harder (I think), but I think
>> this is what more people intuitively think of. To me, implicit in the
>> visual concept of 2 rects being within some distance of one another
>> is that they are NOT overlapping, but that some gap exists between
>> the nearest adjacent edges?
>>
>> Something else? What does 2 rects  being 'within' d pixels of one
>> another mean to you, if not one of the two above options?
>>
>> Maybe there is a exact mathematical definition of what 2 rectangles
>> being within distance d of one another is, but, if there is, I am
>> unfamiliar with it.
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Poll: What does it mean for 1 rect to be 'within' a certain distance of another rect?

Mark Wieder via use-livecode
Being a bear of little brain, I would try placing each rect into a group centred on a larger rect, where the margin is d/2,  then test using intersect.

Now, where did I put that hunny?

Best wishes

David Glasgow
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Poll: What does it mean for 1 rect to be 'within' a certain distance of another rect?

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Hi Henk,

No, it's maybe not obvious but it does take all cases into account.

If the smallest distance is between corners of each rectangle - only
then does the 'sqrt' have real meaning. In all other cases, one or other
of the DX and DY comes out as 0.

------
  |    |
| R1 |  ------
  |    |  |    |
  |    |  | R2 |
  ------  |    |
          -----


So if there is an overlap in one dimension, (Y above) then DY is
calculated as 0 - and the result is the distance in X (i.e. sqrt(DX*DX+0) ).

Alex.


On 16/02/2021 07:45, Henk van der Velden via use-livecode wrote:

> Alex,
> No one would challenge your definition I think, but your solution only takes the corner points into account, right? So this wouldn’t give correct results in case the rectangles have different sizes or are positioned obliquely.
>
> Henk
>
>
>> On 16 Feb 2021, at 03:12, [hidden email] wrote:
>>
>> For me, a more precise problem specification is:
>>
>> Given two rectangles (in regular Livecode format), the distance between
>> them is :
>>
>> ?- if they touch or overlap, distance is zero.
>>
>> ?- otherwise, it's the smallest distance from any point in R1 to any
>> point in R2.
>>
>> Which leads to a simple solution
>>
>>> function rdist R1, R2
>>> ?? local DX, DY
>>> ?? put max( item 1 of R1 - item 3 of R2, item 1 of R2 - item 3 of R1,
>>> 0) into DX
>>> ?? put max( item 2 of R1 - item 4 of R2, item 2 of R2 - item 4 of R1,
>>> 0) into DY
>>> ?? return sqrt( DX*DX + DY * DY)
>>> end rdist
>>>
>> Alex.
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Another question about multiple stack projects

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Listing them in the stack files gives LC the ability to find them when you refer to them by name only (as opposed to the full path.) In the case of script only Libraries, you can start using them at any time before you make a call to them. For instance, I have a database setup card that configures the database connection when the card is opened. I start using my database library on openCard.

Bob S


> On Feb 15, 2021, at 9:40 PM, William Prothero via use-livecode <[hidden email]> wrote:
>
> Folks:
> I have a question about multiple stack projects. My project starts with a splash stack. In the standalone preferences of this stack, I list all stacks the project uses, including script only stacks I use as libraries. Should I do a “Start using” on all of these stacks at this point? But I could have just done a “start using” for the required stacks for each of the other component stacks when they were first accessed, and got the same result?
>
> I guess my question is: how does the build process make use of the list of stacks in the splash stack? Are they all built into the project in some way that doesn’t happen otherwise? I still seem to be required to “Start using” each of the library stacks anyway.
>
> Best,
> Bill
>
> William Prothero
> [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Poll: What does it mean for 1 rect to be 'within' a certain distance of another rect?

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
On 2/16/2021 6:16 AM, David V Glasgow via use-livecode wrote:
> Being a bear of little brain, I would try placing each rect into a group centred on a larger rect, where the margin is d/2,  then test using intersect.
>
> Now, where did I put that hunny?
>
>

Like the pooh reference!

Although I am not sure I follow exactly what you are suggests - AND - I
need to do this via math rather than visible (or invisible) objects in LC.

for rects r1,r2, I have l1,t1,r1,b2 and l2,t2,r2,b2 for their
coordinates. The rect min(l1,l2),min(t1,t2),max(r1,r2),max(b1,b2) is a
rectangle that exactly bounds both rects - this would be the rect of the
group (if you created them as objects and grouped them (less
margins/borders).

I don't follow the part about 'centered on a larger rect where the
margin is d/2?


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
12