Re: Contesting for Idiot du Jour

2020-09-03 Thread Roger Guay via use-livecode
Great suggestion, Thomas! It works very well. 
Originally, I was flummoxed by my code, using polar coordinates, not working as 
expected. Thanks to you and the others responding to this thread, I now get it. 
Your suggestion reestablishes my faith in the basic math, while recognizing 
limitations sometime apply to any particular solution. FWIW, I am playing 
around with Bertrand Paradox, 
https://en.wikipedia.org/wiki/Bertrand_paradox_(probability) 
, and I'm trying 
to be as precise as possible in simulating the approaches to the problem. Just 
having fun, as it were!

Roger

> On Sep 3, 2020, at 1:42 PM, Thomas von Fintel via use-livecode 
>  wrote:
> 
> I think the easiest way is to adjust the linear random function so that it 
> produces higher numbers more frequently than lower numbers. More precisely, 
> the frequency of 10 must be four times that of 5 (because the area quadruples 
> if you double the radius). Or else the outer points have a lower probability 
> of being found.
> 
> If you replace
> 
> put random(200) into tR -- 200 is half the width of the larger circle
> 
> by
> 
> put sqrt(random(1000^2))/1000*200 into tR -- 200 is half the width of the 
> larger circle
> 
> you get random numbers that fulfil these requirements.
> 
> If you only want to test whether a certain point is within the inner corcle, 
> you only need to look at the radius. But I assume you need this in a more 
> complicated situation.
> 
> I hope this helps
> Thomas
> 
> 
> Am 03.09.2020 um 19:21 schrieb Roger Guay via use-livecode:
>> Or to put it simply, how would one select random point  (e.g. in a circle) 
>> using Polar Coordinates??
>> 
>> Roger
>> 
>>> On Sep 3, 2020, at 8:17 AM, Roger Guay via use-livecode 
>>>  wrote:
>>> 
>>> Jerry,
>>> 
>>> You’ve done a very nice job of describing what’s actually(?) happening in 
>>> my code, but I think you missed the point of my question.
>>> You agree that if you simply sample random pixels then the ratio of a 
>>> random pick inside the smaller circle will depend on the area of the 
>>> circles.
>>> And, if I pick a random x and y within the concentric circles of radius R 
>>> and 2R, ¼ of the time they will lie in the smaller circle and ¾ of the time 
>>> in the bigger.
>>> So, pick any random x and y and convert to radial coordinates. Everything 
>>> should work!
>>> In my code I pick a random angle and a random radius (radial coordinates) 
>>> within the limits of the larger circle, thus picking random points within 
>>> the area of the larger circle, yet I get ½ (which you say is the right 
>>> answer).
>>> My intent was to pick random points (using radial coordinates) for which 
>>> the result should be ¼!
>>> 
>>> What’s wrong with my code?
>>> 
>>> Thanks,
>>> 
>>> Roger
>>> 
 On Sep 2, 2020, at 8:27 PM, Jerry Jensen via use-livecode 
  wrote:
 
 1/2 is the right answer.
 
 Take your drawing of the circles. Cut a veyy thin radial slice from 
 the center to the outside circle. So thin that it is just a line.
 
 Now think of how likely a random point on that line will be in the part of 
 the line that was in the smaller circle. The part that was from the 
 smaller circle is HALF as long as the entire line.
 
 Now add up all the possible positions of that line. Why would that change 
 the answer?
 
 Congratulations, you understand integrals!
 .Jerry
 
> On Sep 2, 2020, at 7:38 PM, Roger Guay via use-livecode 
>  wrote:
> 
> Your chance to be Genius du Jour:
> 
> If I construct 2 concentric circles, one being half the radius of the 
> larger, then simple math shows that the smaller circle has an area ¼ the 
> area of the larger.
> Now if I generate a random point within the radius of the larger circle, 
> I should expect that the probability of it landing in the smaller circle 
> to be ¼.
> But, I must be doing something wrong because I get ½ !
> 
> Here is my script:
> 
> on mouseDown
> 
>   getStuff
> 
> end mouseDown
> 
> 
> local tR, tTheta, tX0, tY0, tX1, tY1, tTotCount, tL, tLongCount
> 
> on getStuff
> 
>   put item 1 of the loc of grc OuterCircle into tx0
> 
>   put item 2 of the loc of grc OuterCircle into tY0
> 
>   put "" into tTotCount
> 
>   put "" into tLongCount
> 
>   emptyFlds
> 
> end getStuff
> 
> 
> on mouseUp
> 
>   lock screen
> 
>   repeat 1000
> 
>   put random(200) into tR -- 200 is half the width of the larger 
> circle
> 
>   if tR > 1 then
> 
>   ## put random(2*pi) into tTheta1
> 
>   get random(360)
> 
>   put it*pi/180 into tTheta1
> 
>   put tR*cos(tTheta1) into tX1
>   put tR*sin(

Re: Contesting for Idiot du Jour

2020-09-03 Thread Thomas von Fintel via use-livecode
I think the easiest way is to adjust the linear random function so that 
it produces higher numbers more frequently than lower numbers. More 
precisely, the frequency of 10 must be four times that of 5 (because the 
area quadruples if you double the radius). Or else the outer points have 
a lower probability of being found.


If you replace

put random(200) into tR -- 200 is half the width of the larger circle

by

put sqrt(random(1000^2))/1000*200 into tR -- 200 is half the width of 
the larger circle


you get random numbers that fulfil these requirements.

If you only want to test whether a certain point is within the inner 
corcle, you only need to look at the radius. But I assume you need this 
in a more complicated situation.


I hope this helps
Thomas


Am 03.09.2020 um 19:21 schrieb Roger Guay via use-livecode:

Or to put it simply, how would one select random point  (e.g. in a circle) 
using Polar Coordinates??

Roger


On Sep 3, 2020, at 8:17 AM, Roger Guay via use-livecode 
 wrote:

Jerry,

You’ve done a very nice job of describing what’s actually(?) happening in my 
code, but I think you missed the point of my question.
You agree that if you simply sample random pixels then the ratio of a random 
pick inside the smaller circle will depend on the area of the circles.
And, if I pick a random x and y within the concentric circles of radius R and 
2R, ¼ of the time they will lie in the smaller circle and ¾ of the time in the 
bigger.
So, pick any random x and y and convert to radial coordinates. Everything 
should work!
In my code I pick a random angle and a random radius (radial coordinates) 
within the limits of the larger circle, thus picking random points within the 
area of the larger circle, yet I get ½ (which you say is the right answer).
My intent was to pick random points (using radial coordinates) for which the 
result should be ¼!

What’s wrong with my code?

Thanks,

Roger


On Sep 2, 2020, at 8:27 PM, Jerry Jensen via use-livecode 
 wrote:

1/2 is the right answer.

Take your drawing of the circles. Cut a veyy thin radial slice from the 
center to the outside circle. So thin that it is just a line.

Now think of how likely a random point on that line will be in the part of the 
line that was in the smaller circle. The part that was from the smaller circle 
is HALF as long as the entire line.

Now add up all the possible positions of that line. Why would that change the 
answer?

Congratulations, you understand integrals!
.Jerry


On Sep 2, 2020, at 7:38 PM, Roger Guay via use-livecode 
 wrote:

Your chance to be Genius du Jour:

If I construct 2 concentric circles, one being half the radius of the larger, 
then simple math shows that the smaller circle has an area ¼ the area of the 
larger.
Now if I generate a random point within the radius of the larger circle, I 
should expect that the probability of it landing in the smaller circle to be ¼.
But, I must be doing something wrong because I get ½ !

Here is my script:

on mouseDown

getStuff

end mouseDown


local tR, tTheta, tX0, tY0, tX1, tY1, tTotCount, tL, tLongCount

on getStuff

put item 1 of the loc of grc OuterCircle into tx0

put item 2 of the loc of grc OuterCircle into tY0

put "" into tTotCount

put "" into tLongCount

emptyFlds

end getStuff


on mouseUp

lock screen

repeat 1000

put random(200) into tR -- 200 is half the width of the larger 
circle

if tR > 1 then

## put random(2*pi) into tTheta1

get random(360)

put it*pi/180 into tTheta1

put tR*cos(tTheta1) into tX1
put tR*sin(tTheta1) into tY1

set the loc of grc Ptgrc to tX0 + tX1, tY0 - tY1 --- 
grc Ptgrc is a 2 pixle oval

if intersect(grc Ptgrc, grc InnerCircle, "opaque 
Pixels") then add 1 to tLongCount

add 1 to tTotCount

end if

end repeat
put tTotCount into fld "totcountFld"

put tLongCount into fld “LongCountFld"

put tLongCount/tTotCount into fld "RatioFld"

unlock screen

end mouseUp


Apparently, this does not generate a random point within the larger circle! Can 
someone please tell me what’s wrong here?

Thanks,
Roger
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.co

Re: Hacktoberfest is coming

2020-09-03 Thread Richard Gaskin via use-livecode
True, focusing on the subset of issues in the IDE, leaving the engine 
work to the experts on the core team, would make the work much more 
actionable.


The enthusiasm is good to see. I like the vision of a world where we all 
share one common engine and language, and have a wide range of IDE 
options available, tailored for our tastes and workflows.


If you can find a lead maintainer on this, it may be worth pursuing. But 
given the work commitment involved, that may be a big "if".


The nice thing about pinching off corners of IDE functionality in 
plugins is that the scope of work is limited to the size of the itch 
being scratched.  They're also easier to share than convincing folks to 
replace their whole IDE with an alternate one.


But if IDE bugs mount up without workarounds or acceptance long enough, 
sooner or later it will become easier to find contributors to replacing 
it with a fork.


Like the old saying goes, "Change occurs when the pain of changing is 
finally exceeded by the pain of not changing."


--
 Richard Gaskin
 Fourth World Systems



Mike Kerner wrote:

it's not the engine, it's the ide portion, which is not binary.
in addition, as it is a fork, it would be maintained in parallel with the
LC version, so when LC releases an update, beta or otherwise to the ide,
you would merge it into the fork, and review all the diffs.
in some other projects, the community fork thus becomes the major branch
and the community becomes the major maintainers of the fork.
i'm not saying it's easy, and i am by no means volunteering to do it.  it's
a suggestion for the community to consider:  if we are jointly frustrated
with LC's IDE and the progress it is making, especially in accepting and
integrating PR's, then we do have the option of forking it, perhaps for the
purpose of fast-tracking updates, experimental features, etc.
things that might appeal to an audience of developers:
* PR's issued for open bug reports, e.g. mobile scrolling (PR issued
in...June, I think?)
* Project Browser
* Code folding
* Speed in the script editor
It's not like there aren't multiple independent projects going on that
couldn't make this effort better.  Some of those are:
Navigator
Baker's Assistant
Any of Bernd's proposed SE updates

On Wed, Sep 2, 2020 at 12:21 PM Richard Gaskin via use-livecode <
use-livecode at lists.runrev.com> wrote:


Mike Kerner wrote:

 > there isn't any reason why we can't have a fork of the ide that
 > doesn't sit around waiting for themuns to say "ok".

I've considered this myself, but maintaining something as complex as
LC's IDE is no small task.  In fact, I'm finding it less time consuming
to replace portions as I need them than to prowl around in that complex
code.

But even if someone had the time for to maintain a fork of the IDE (and
you might get some assistance on that from others if you do), engine
pull requests would still be in queue with the mother ship.  Few in our
community have the C++ skills to do serious work on the engine, and the
GPL license would make using such a community project a non-starter for
most license holders.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  
  Ambassador at FourthWorld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: ...and now for something completely off the wall...

2020-09-03 Thread Richmond via use-livecode

Well, the last line is in Latin.

Also, be aware that Scots and English have been twining round each other 
like the two snakes on a caduceus;
how ever, to my mind that is part of a poem by William Dunbar, so 15th 
century.


Fit fashes me, mynd, is that the orthographie micht hae been chaungit, 
as qhat scriever screivit

'now' in the 15th centutie qhan they micht hae scrievit 'nou'?

On 1.09.20 14:53, Graham Samuel via use-livecode wrote:

Richmond, is this Scots or just badly spelled 16th Century English? A genuine 
enquiry

The stait of man dois change and vary,
Now sound, now seik, now blith, now sary,
Now dansand mery, now like to dee;
Timor mortis conturbat me.

Graham


On 28 Aug 2020, at 21:22, Richmond via use-livecode 
 wrote:

Very droll: that's a load of Frenchies having fun.

On 28.08.20 19:44, Bob Sneidar via use-livecode wrote:

If the painting is any indication of a real event, the Scots would be well 
advised to build their bon fires a wee bit further from the wooden ladders they 
are torturing their victims on. :-)

Bob S



On Aug 28, 2020, at 9:09 AM, Richmond via use-livecode 
 wrote:

Well, I suppose it is funny: about as funny as pointing out to those people in 
Utah who spawned this idiot that
undder Scots law as a citizen of a Scottish colony whose indepndence is only de 
facto under Scots law he should
suffer the death sentence for treason: drawing and quartering.

https://upload.wikimedia.org/wikipedia/commons/f/fc/BNMsFr2643FroissartFol97vExecHughDespenser.jpg

On 28.08.20 18:54, Bob Sneidar via use-livecode wrote:

😆


On Aug 28, 2020, at 7:59 AM, Mark Wieder via use-livecode 
 wrote:

Almost every article on the Scots version of Wikipedia is written by one 
American teenager who can't speak Scots

"A veelage is a clustered human settlement or community, larger than a hamlet but 
smawer than a toun, wi a population rangin frae a few hunder tae a few thoosand 
(sometimes tens o thoosands)."

https://boingboing.net/2020/08/27/almost-every-article-on-the-sc.html
https://www.scotslanguage.com/news/5724

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

___
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


___
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: Contesting for Idiot du Jour

2020-09-03 Thread chaplais via use-livecode
There is no simple way, because the infinitesimal area is polar coordinates is 
r dr dtheta where r is the radius and theta is the angle.
More intuitively, the farther you are from the center, the smaller the angle 
that covers a fixed size pixel becomes.
All the best,
François
Le 3 sept. 2020 à 19:22 +0200, Roger Guay via use-livecode 
, a écrit :
> Or to put it simply, how would one select random point (e.g. in a circle) 
> using Polar Coordinates??
>
> Roger
>
> > On Sep 3, 2020, at 8:17 AM, Roger Guay via use-livecode 
> >  wrote:
> >
> > Jerry,
> >
> > You’ve done a very nice job of describing what’s actually(?) happening in 
> > my code, but I think you missed the point of my question.
> > You agree that if you simply sample random pixels then the ratio of a 
> > random pick inside the smaller circle will depend on the area of the 
> > circles.
> > And, if I pick a random x and y within the concentric circles of radius R 
> > and 2R, ¼ of the time they will lie in the smaller circle and ¾ of the time 
> > in the bigger.
> > So, pick any random x and y and convert to radial coordinates. Everything 
> > should work!
> > In my code I pick a random angle and a random radius (radial coordinates) 
> > within the limits of the larger circle, thus picking random points within 
> > the area of the larger circle, yet I get ½ (which you say is the right 
> > answer).
> > My intent was to pick random points (using radial coordinates) for which 
> > the result should be ¼!
> >
> > What’s wrong with my code?
> >
> > Thanks,
> >
> > Roger
> >
> > > On Sep 2, 2020, at 8:27 PM, Jerry Jensen via use-livecode 
> > >  wrote:
> > >
> > > 1/2 is the right answer.
> > >
> > > Take your drawing of the circles. Cut a veyy thin radial slice from 
> > > the center to the outside circle. So thin that it is just a line.
> > >
> > > Now think of how likely a random point on that line will be in the part 
> > > of the line that was in the smaller circle. The part that was from the 
> > > smaller circle is HALF as long as the entire line.
> > >
> > > Now add up all the possible positions of that line. Why would that change 
> > > the answer?
> > >
> > > Congratulations, you understand integrals!
> > > .Jerry
> > >
> > > > On Sep 2, 2020, at 7:38 PM, Roger Guay via use-livecode 
> > > >  wrote:
> > > >
> > > > Your chance to be Genius du Jour:
> > > >
> > > > If I construct 2 concentric circles, one being half the radius of the 
> > > > larger, then simple math shows that the smaller circle has an area ¼ 
> > > > the area of the larger.
> > > > Now if I generate a random point within the radius of the larger 
> > > > circle, I should expect that the probability of it landing in the 
> > > > smaller circle to be ¼.
> > > > But, I must be doing something wrong because I get ½ !
> > > >
> > > > Here is my script:
> > > >
> > > > on mouseDown
> > > >
> > > > getStuff
> > > >
> > > > end mouseDown
> > > >
> > > >
> > > > local tR, tTheta, tX0, tY0, tX1, tY1, tTotCount, tL, tLongCount
> > > >
> > > > on getStuff
> > > >
> > > > put item 1 of the loc of grc OuterCircle into tx0
> > > >
> > > > put item 2 of the loc of grc OuterCircle into tY0
> > > >
> > > > put "" into tTotCount
> > > >
> > > > put "" into tLongCount
> > > >
> > > > emptyFlds
> > > >
> > > > end getStuff
> > > >
> > > >
> > > > on mouseUp
> > > >
> > > > lock screen
> > > >
> > > > repeat 1000
> > > >
> > > > put random(200) into tR -- 200 is half the width of the larger circle
> > > >
> > > > if tR > 1 then
> > > >
> > > > ## put random(2*pi) into tTheta1
> > > >
> > > > get random(360)
> > > >
> > > > put it*pi/180 into tTheta1
> > > >
> > > > put tR*cos(tTheta1) into tX1
> > > > put tR*sin(tTheta1) into tY1
> > > >
> > > > set the loc of grc Ptgrc to tX0 + tX1, tY0 - tY1 --- grc Ptgrc is a 2 
> > > > pixle oval
> > > >
> > > > if intersect(grc Ptgrc, grc InnerCircle, "opaque Pixels") then add 1 to 
> > > > tLongCount
> > > >
> > > > add 1 to tTotCount
> > > >
> > > > end if
> > > >
> > > > end repeat
> > > > put tTotCount into fld "totcountFld"
> > > >
> > > > put tLongCount into fld “LongCountFld"
> > > >
> > > > put tLongCount/tTotCount into fld "RatioFld"
> > > >
> > > > unlock screen
> > > >
> > > > end mouseUp
> > > >
> > > >
> > > > Apparently, this does not generate a random point within the larger 
> > > > circle! Can someone please tell me what’s wrong here?
> > > >
> > > > Thanks,
> > > > Roger
> > > > ___
> > > > use-livecode mailing list
> > > > use-livecode@lists.runrev.com
> > > > Please visit this url to subscribe, unsubscribe and manage your 
> > > > subscription preferences:
> > > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > >
> > >
> > > ___
> > > use-livecode mailing list
> > > use-livecode@lists.runrev.com
> > > Please visit this url to subscribe, unsubscribe and manage your 
> > > subscription preferences:
> > > http://lists.runrev.com/mailman

Re: Contesting for Idiot du Jour

2020-09-03 Thread Roger Guay via use-livecode
Or to put it simply, how would one select random point  (e.g. in a circle) 
using Polar Coordinates??

Roger

> On Sep 3, 2020, at 8:17 AM, Roger Guay via use-livecode 
>  wrote:
> 
> Jerry,
> 
> You’ve done a very nice job of describing what’s actually(?) happening in my 
> code, but I think you missed the point of my question. 
> You agree that if you simply sample random pixels then the ratio of a random 
> pick inside the smaller circle will depend on the area of the circles.
> And, if I pick a random x and y within the concentric circles of radius R and 
> 2R, ¼ of the time they will lie in the smaller circle and ¾ of the time in 
> the bigger.
> So, pick any random x and y and convert to radial coordinates. Everything 
> should work! 
> In my code I pick a random angle and a random radius (radial coordinates) 
> within the limits of the larger circle, thus picking random points within the 
> area of the larger circle, yet I get ½ (which you say is the right answer). 
> My intent was to pick random points (using radial coordinates) for which the 
> result should be ¼!
> 
> What’s wrong with my code?
> 
> Thanks,
> 
> Roger
> 
>> On Sep 2, 2020, at 8:27 PM, Jerry Jensen via use-livecode 
>>  wrote:
>> 
>> 1/2 is the right answer.
>> 
>> Take your drawing of the circles. Cut a veyy thin radial slice from the 
>> center to the outside circle. So thin that it is just a line. 
>> 
>> Now think of how likely a random point on that line will be in the part of 
>> the line that was in the smaller circle. The part that was from the smaller 
>> circle is HALF as long as the entire line.
>> 
>> Now add up all the possible positions of that line. Why would that change 
>> the answer?
>> 
>> Congratulations, you understand integrals!
>> .Jerry
>> 
>>> On Sep 2, 2020, at 7:38 PM, Roger Guay via use-livecode 
>>>  wrote:
>>> 
>>> Your chance to be Genius du Jour:
>>> 
>>> If I construct 2 concentric circles, one being half the radius of the 
>>> larger, then simple math shows that the smaller circle has an area ¼ the 
>>> area of the larger.
>>> Now if I generate a random point within the radius of the larger circle, I 
>>> should expect that the probability of it landing in the smaller circle to 
>>> be ¼.
>>> But, I must be doing something wrong because I get ½ !
>>> 
>>> Here is my script:
>>> 
>>> on mouseDown
>>> 
>>> getStuff
>>> 
>>> end mouseDown
>>> 
>>> 
>>> local tR, tTheta, tX0, tY0, tX1, tY1, tTotCount, tL, tLongCount
>>> 
>>> on getStuff
>>> 
>>> put item 1 of the loc of grc OuterCircle into tx0
>>> 
>>> put item 2 of the loc of grc OuterCircle into tY0
>>> 
>>> put "" into tTotCount
>>> 
>>> put "" into tLongCount
>>> 
>>> emptyFlds
>>> 
>>> end getStuff
>>> 
>>> 
>>> on mouseUp
>>> 
>>> lock screen
>>> 
>>> repeat 1000
>>> 
>>> put random(200) into tR -- 200 is half the width of the larger 
>>> circle
>>> 
>>> if tR > 1 then
>>> 
>>> ## put random(2*pi) into tTheta1
>>> 
>>> get random(360)
>>> 
>>> put it*pi/180 into tTheta1
>>> 
>>> put tR*cos(tTheta1) into tX1
>>> put tR*sin(tTheta1) into tY1
>>> 
>>> set the loc of grc Ptgrc to tX0 + tX1, tY0 - tY1 --- 
>>> grc Ptgrc is a 2 pixle oval
>>> 
>>> if intersect(grc Ptgrc, grc InnerCircle, "opaque 
>>> Pixels") then add 1 to tLongCount
>>> 
>>> add 1 to tTotCount
>>> 
>>> end if
>>> 
>>> end repeat
>>> put tTotCount into fld "totcountFld"
>>> 
>>> put tLongCount into fld “LongCountFld"
>>> 
>>> put tLongCount/tTotCount into fld "RatioFld"
>>> 
>>> unlock screen
>>> 
>>> end mouseUp
>>> 
>>> 
>>> Apparently, this does not generate a random point within the larger circle! 
>>> Can someone please tell me what’s wrong here?
>>> 
>>> Thanks,
>>> Roger
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> ___
> 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: Contesting for Idiot du Jour

2020-09-03 Thread Roger Guay via use-livecode
Jerry,

You’ve done a very nice job of describing what’s actually(?) happening in my 
code, but I think you missed the point of my question. 
You agree that if you simply sample random pixels then the ratio of a random 
pick inside the smaller circle will depend on the area of the circles.
And, if I pick a random x and y within the concentric circles of radius R and 
2R, ¼ of the time they will lie in the smaller circle and ¾ of the time in the 
bigger.
So, pick any random x and y and convert to radial coordinates. Everything 
should work! 
In my code I pick a random angle and a random radius (radial coordinates) 
within the limits of the larger circle, thus picking random points within the 
area of the larger circle, yet I get ½ (which you say is the right answer). 
My intent was to pick random points (using radial coordinates) for which the 
result should be ¼!

What’s wrong with my code?

Thanks,

Roger

> On Sep 2, 2020, at 8:27 PM, Jerry Jensen via use-livecode 
>  wrote:
> 
> 1/2 is the right answer.
> 
> Take your drawing of the circles. Cut a veyy thin radial slice from the 
> center to the outside circle. So thin that it is just a line. 
> 
> Now think of how likely a random point on that line will be in the part of 
> the line that was in the smaller circle. The part that was from the smaller 
> circle is HALF as long as the entire line.
> 
> Now add up all the possible positions of that line. Why would that change the 
> answer?
> 
> Congratulations, you understand integrals!
> .Jerry
> 
>> On Sep 2, 2020, at 7:38 PM, Roger Guay via use-livecode 
>>  wrote:
>> 
>> Your chance to be Genius du Jour:
>> 
>> If I construct 2 concentric circles, one being half the radius of the 
>> larger, then simple math shows that the smaller circle has an area ¼ the 
>> area of the larger.
>> Now if I generate a random point within the radius of the larger circle, I 
>> should expect that the probability of it landing in the smaller circle to be 
>> ¼.
>> But, I must be doing something wrong because I get ½ !
>> 
>> Here is my script:
>> 
>> on mouseDown
>> 
>>  getStuff
>> 
>> end mouseDown
>> 
>> 
>> local tR, tTheta, tX0, tY0, tX1, tY1, tTotCount, tL, tLongCount
>> 
>> on getStuff
>> 
>>  put item 1 of the loc of grc OuterCircle into tx0
>> 
>>  put item 2 of the loc of grc OuterCircle into tY0
>> 
>>  put "" into tTotCount
>> 
>>  put "" into tLongCount
>> 
>>  emptyFlds
>> 
>> end getStuff
>> 
>> 
>> on mouseUp
>> 
>>  lock screen
>> 
>>  repeat 1000
>> 
>>  put random(200) into tR -- 200 is half the width of the larger 
>> circle
>> 
>>  if tR > 1 then
>> 
>>  ## put random(2*pi) into tTheta1
>> 
>>  get random(360)
>> 
>>  put it*pi/180 into tTheta1
>> 
>>  put tR*cos(tTheta1) into tX1
>>  put tR*sin(tTheta1) into tY1
>> 
>>  set the loc of grc Ptgrc to tX0 + tX1, tY0 - tY1 --- 
>> grc Ptgrc is a 2 pixle oval
>> 
>>  if intersect(grc Ptgrc, grc InnerCircle, "opaque 
>> Pixels") then add 1 to tLongCount
>> 
>>  add 1 to tTotCount
>> 
>>  end if
>> 
>>  end repeat
>>  put tTotCount into fld "totcountFld"
>> 
>>  put tLongCount into fld “LongCountFld"
>> 
>>  put tLongCount/tTotCount into fld "RatioFld"
>> 
>>  unlock screen
>> 
>> end mouseUp
>> 
>> 
>> Apparently, this does not generate a random point within the larger circle! 
>> Can someone please tell me what’s wrong here?
>> 
>> Thanks,
>> Roger
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
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: Hacktoberfest is coming

2020-09-03 Thread Mike Kerner via use-livecode
it's not the engine, it's the ide portion, which is not binary.
in addition, as it is a fork, it would be maintained in parallel with the
LC version, so when LC releases an update, beta or otherwise to the ide,
you would merge it into the fork, and review all the diffs.
in some other projects, the community fork thus becomes the major branch
and the community becomes the major maintainers of the fork.
i'm not saying it's easy, and i am by no means volunteering to do it.  it's
a suggestion for the community to consider:  if we are jointly frustrated
with LC's IDE and the progress it is making, especially in accepting and
integrating PR's, then we do have the option of forking it, perhaps for the
purpose of fast-tracking updates, experimental features, etc.
things that might appeal to an audience of developers:
* PR's issued for open bug reports, e.g. mobile scrolling (PR issued
in...June, I think?)
* Project Browser
* Code folding
* Speed in the script editor
It's not like there aren't multiple independent projects going on that
couldn't make this effort better.  Some of those are:
Navigator
Baker's Assistant
Any of Bernd's proposed SE updates

On Wed, Sep 2, 2020 at 12:21 PM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Mike Kerner wrote:
>
>  > there isn't any reason why we can't have a fork of the ide that
>  > doesn't sit around waiting for themuns to say "ok".
>
> I've considered this myself, but maintaining something as complex as
> LC's IDE is no small task.  In fact, I'm finding it less time consuming
> to replace portions as I need them than to prowl around in that complex
> code.
>
> But even if someone had the time for to maintain a fork of the IDE (and
> you might get some assistance on that from others if you do), engine
> pull requests would still be in queue with the mother ship.  Few in our
> community have the C++ skills to do serious work on the engine, and the
> GPL license would make using such a community project a non-starter for
> most license holders.
>
> --
>   Richard Gaskin
>   Fourth World Systems
>   Software Design and Development for the Desktop, Mobile, and the Web
>   
>   ambassa...@fourthworld.comhttp://www.FourthWorld.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
>


-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode