Re: Basic Maths

2001-01-27 Thread John Kiltinen

Hugh Senior wrote:

>Type this in the message box...
>
>put 5.45 - 1 = 4.45  TRUE
>put 5.45 - 2 = 3.45  TRUE
>put 5.45 - 3 = 2.45  TRUE
>
>but...
>
>put 5.45 - 4 = 1.45  FALSE
>
>Huh? This is not helping my sanity, nor writing a finance checking routine
>that answers false instead of true!
>
>Any answers out there?

On the surface, it appears to me that this is an interesting example of how
roundoff errors in computer calculations can cause programming headaches if
your logic is testing for absolute equality.  As a further test, I did the
subtractions Hugh did, and then went on to substract the supposed
difference, which logically ought to produce 0.  The tests worked out this
way:

put (5.45 - 1) - 4.45 = 0  TRUE
put (5.45 - 2) - 3.45 = 0  TRUE
put (5.45 - 3) - 2.45 = 0  TRUE
put (5.45 - 4) - 1.45 = 0  FALSE

These results are consistent with Hugh's.

Now focussing on the last case, let us test this differece which ought to
be equal to zero but which the computer says is not zero to see how small
the computer agrees that it is in absolute value.  These were my results
with MetaCard:

put abs((5.45 - 4) - 1.45) < 0.0001  FALSE
put abs((5.45 - 4) - 1.45) < 0.001   TRUE

Thus, it appears that the roundoff error that occurs when substracting 4
from 5.45, and then further subtracting 1.45 from that is in the 16th
decimal place.

The moral of the story is to never build logic into numberical programs
that relies on recognizing precise equality of two floating point numbers.
You can count on precision, however, with integer arithmetic, provided you
do not get so large as to produce overflow errors.  For example, if we
multiply Hugh's example by 100 to get all the numbers being integers,
MetaCard says:

put 545 - 400 = 145  TRUE

Pardon me if this may be more detailed than some readers of this list may
care to see.  It's the math prof in me.

Since this is my first post, let me introduce myself.  I am a professor of
mathematics at Northern Michigan University.  I am interested in MetaCard
because it is allowing me to upgrade and make more broadly available some
permutation puzzles that I developed in HyperCard for use in teaching one
of my courses some years ago.  I ported them over to MetaCard over a year
ago, and did some improvements on them at the time.  Now I am doing a more
intensive upgrade.

I have found reading this list to be very helpful over the past year that I
have been getting it.  Now that I am getting more into working with
MetaCard, you may hear from me with questions from time to time.

Don't look for answers from here that have to do with the hard core
computer programming, however.  I am a reluctant programmer, doing it only
when I have a project that wouldn't get done otherwise.

John Kiltinen



 John Kiltinen ([EMAIL PROTECTED])Home  Office
 Professor, Dept. of Math. & CS   Tel.(906) 228-8035 or (906) 227-1600
 Northern Michigan University Fax (906) 228-4667 or (906) 2272010
 Marquette, MI 49855 USA




Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




Re: statistics

2001-01-27 Thread michael kann


--- [EMAIL PROTECTED] wrote:

I want to determine the correlation (relationship)
between 2 groups ie. lines of data in 2 separate
fields.

-

Can you describe your goal in statistical (or better
yet) mathematical terms? 

Michael Kann, [EMAIL PROTECTED]

__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
http://auctions.yahoo.com/

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




Re: statistics

2001-01-27 Thread MMessieh

I want to determine the correlation(relationship) between 2 groups ie. lines 
of  data in 2 separate fields. My best attempt is as below. Can anyone help 
me improve the following script  ?
on mouseUp
  repeat with i = 1 to number of lines in  fld "X"
if line i of bg  fld  "X" ≠ empty then put line i of bg  fld  "X" & 
return after  a
if line i of bg  fld  "Y" ≠ empty then  put line i of bg  fld  "Y" & 
return after  b
if line i of bg  fld  "X" ≠ empty then put (line i of bg  fld  "X") 
*(line i of bg  fld  "Y") & return after  c
if line i of bg  fld  "X" ≠ empty then put (line i of bg  fld  "X")^2 & 
return after  x
if line i of bg  fld  "Y" ≠ empty then put (line i of bg  fld  "Y")^2 & 
return after  y
  end repeat
  put replacetext(  a,return,comma) into  a1
  delete last char of  a1
  put sum(replacetext( a1,return,comma)) into  Ex
  put replacetext(  b,return,comma) into  b1
  delete last char of  b1
  put sum(replacetext( b1,return,comma)) into  Ey
  put replacetext(  c,return,comma) into  c1
  delete last char of  c1
  put sum(replacetext( c1,return,comma)) into  Exy
  put replacetext(  x,return,comma) into x2
  delete last char of  x2
  put sum(replacetext( x2,return,comma)) into  Ex2
  put replacetext(  y,return,comma) into y2
  delete last char of  y2
  put sum(replacetext( y2,return,comma)) into  Ey2
  put (number of lines in  fld "X")*Exy-(Ex*Ey) into num
  put (number of lines in  fld "X")*(Ex2)-Ex^2 into denom1
  put  (number of lines in  fld "Y")*(Ey2)-Ey^2 into denom2
  put num/(sqrt(denom1*denom2)) into bg fld "answer"
end mouseUp
Thanks,
mike
[EMAIL PROTECTED]

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




Layer settings...

2001-01-27 Thread Ian Gordon

Hi,

The set layers command functionality seems to have changed from mc 2.3 B to MC
2.3???

With mc 2.3 I get an error on scripts that worked fine in mc 2.3B, for example:

SET THE LAYER OF GRP X TO 100

The error message says that the card must be opened  and//or that the property
can't be set .

Anyone have a clue as to what is up?

Thanks in advance.

Ian Gordon



>


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




RE: Announcing MetaCard 2.3.2 for Darwin/Mac OS X

2001-01-27 Thread Monte Goulding

OK, I don't understand how you would do that. I'm only learining at this
stage. Primarily how does Apache communicate with your long running process
or do the clients communicate directly. This seems like a good plan saving
mc to just handle cgi.

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Pierre Sahores
> Sent: Sunday, 28 January 2001 1:36 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Announcing MetaCard 2.3.2 for Darwin/Mac OS X
>
>
> Monte Goulding a écrit :
> >
> > Hi I've been reading the latest thread and some old archives
> about CGI in MC
> > and I have a quick question.
> >
> > It seems to me that it is being suggested that the best, quickest and
> > easiest way to run sripts with MCHTTPd is to use the stacks-bin
> and thus not
> > startUp a new process.
>
> Ok, about this.
>
> This may be a stipid question but what happens if
> > there are two clients wanting the same thing at the same time?
> As it's the
> > same process wouldn't MCHTTPd need to wait untill the last script is
> > finnished before it can do anything?
>
> This is the central point. It's to avoid this kind of problems,
> nor to have
> to do with cgi sort running processes (unable to update and read
> inside big
> vars,
> waiting in ram for the next queries, as stored in a long running
> console or
> x-display .mc stack or standalone process) that i use personnaly
> not MCHTTPd but
> only mc-based web/vpn applications servers, running beside Apache
> (unixes, Linux
> for yet), leeting the httpd manage the requests queue jobs.
>
> -- snip --
>
> Regards, Pierre Sahores
>
> WEB & VPN applications and databases servers
> Inspection académique de la Seine-Saint-Denis
> Penser la part du rêve et produire l'avantage
>
> Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
> Info: http://www.xworlds.com/metacard/mailinglist.htm
> Please send bug reports to <[EMAIL PROTECTED]>, not this list.
>


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




Basic Maths

2001-01-27 Thread Hugh Senior

Type this in the message box...

put 5.45 - 1 = 4.45  TRUE
put 5.45 - 2 = 3.45  TRUE
put 5.45 - 3 = 2.45  TRUE

but...

put 5.45 - 4 = 1.45  FALSE

Huh? This is not helping my sanity, nor writing a finance checking routine
that answers false instead of true!

Any answers out there?

/H

Hugh Senior

The Flexible Learning Company
Consultant Programming & Software Solutions
Fax/Voice: +44 (0)1483.27 87 27
Email: [EMAIL PROTECTED]
Web: www.flexibleLearning.com

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




Re: statistics

2001-01-27 Thread MMessieh

Does anyone have any Metatalk statistical functions  to determine 
1.correlation coefficients(Pearson and/or Spearman),
2.multiple and logistic regression?
mike

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




Re: Digest metacard.v004.n161

2001-01-27 Thread MMessieh

How do you transfer XCMDs from a HyperCard stack to a MetaCard stack
mike

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




Re: Digest metacard.v004.n161

2001-01-27 Thread Ed Cawley

Hi Sjoerd,
Worked fine.
All I had to do was change the if to scip the first card.
Guess it was too obvious. I think the problem was that I did the menus at
the end of stack development rather than the beginning.
Thanks for thew help.
>
>--- MESSAGE metacard.v004.n161.7 ---
>
>From: "Sjoerd Op 't Land" <[EMAIL PROTECTED]>
>Subject: Re: cross platform menus
>Date: Fri, 26 Jan 2001 23:02:43 +0100
>MIME-Version: 1.0
>Content-Type: text/plain; charset="US-ASCII"
>Content-Transfer-Encoding: 7bit
>In-Reply-To: <[EMAIL PROTECTED]>
>
>Ed Cawley wrote/ schreef:
>
>> Hi
>> I'm doing some cross platform development for the first time and I'm having
>> some problems. I'm developing on a Mac and have set up menus with no
>> problems using menubuilder.  The menu show up on the default Mac menu bar
>> with no trouble but when I run it on a PC running windowsNT the menu bar
>> shows up on the first card but not on the rest.
>That's because the group is not on all the cards. Use this:
>
>-- not tested, but...
>repeat with i = 1 to the number of cards in this stack
>  place background "menuGroup" onto card i
>end repeat
>
>> Also I am building a new stack using the last card in the original start.
>> The new stack is a stack of labels which will be printed. The new stack
>> does not have the menu bar. Do I have to place the menu group on each card
>> individually? Isn't it possible to get a default menu which will appear on
>> all the cards?
>> Ed
>>
>Hope this helps,
>Sjoerd
>
>
>
>--- MESSAGE metacard.v004.n161.8 ---
>
>From: "Sjoerd Op 't Land" <[EMAIL PROTECTED]>
>Subject: Re: empty clipboard
>Date: Fri, 26 Jan 2001 23:02:58 +0100
>MIME-Version: 1.0
>Content-Type: text/plain; charset="US-ASCII"
>Content-Transfer-Encoding: 7bit
>In-Reply-To: <[EMAIL PROTECTED]>
>
>Mark Talluto wrote/ schreef:
>
>> Hello.  How do you empty out the contents of the clipboard?  Have tried
>> various things, but have found no better way then to copy a blank space from
>> a field.  Is there another way?
>I was trying some other ways for you, but then came across the question:
>"Why would I want to empty the clipboard?" I couldn't think of a proper
>reason. You?
>> -Mark
>
>Regards,
>Sjoerd
>
>
>
>--- END metacard.v004.n161 ---


***
Ed CawleyDepartment of Biology
  Director, Envir. Res. Center
 Loras College, Dubuque,IA 52004
[EMAIL PROTECTED] 319-588-7128, FAX 319-588-7964
**
Help save HyperCard, visit http://www.hyperactivesw.com/SaveHC.html
"HyperCard: Is there anything it can't do?"
***



Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




Re: Announcing MetaCard 2.3.2 for Darwin/Mac OS X

2001-01-27 Thread Pierre Sahores

Monte Goulding a écrit :
> 
> Hi I've been reading the latest thread and some old archives about CGI in MC
> and I have a quick question.
> 
> It seems to me that it is being suggested that the best, quickest and
> easiest way to run sripts with MCHTTPd is to use the stacks-bin and thus not
> startUp a new process. 

Ok, about this.

This may be a stipid question but what happens if
> there are two clients wanting the same thing at the same time? As it's the
> same process wouldn't MCHTTPd need to wait untill the last script is
> finnished before it can do anything?

This is the central point. It's to avoid this kind of problems, nor to have
to do with cgi sort running processes (unable to update and read inside big
vars,
waiting in ram for the next queries, as stored in a long running console or
x-display .mc stack or standalone process) that i use personnaly not MCHTTPd but
only mc-based web/vpn applications servers, running beside Apache (unixes, Linux
for yet), leeting the httpd manage the requests queue jobs.

-- snip --

Regards, Pierre Sahores

WEB & VPN applications and databases servers
Inspection académique de la Seine-Saint-Denis
Penser la part du rêve et produire l'avantage

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.




Re: Free movable images and players

2001-01-27 Thread Sjoerd Op 't Land

Scott Raney wrote/ schreef:

> On Fri, 26 Jan 2001 David Bovill <[EMAIL PROTECTED]> wrote:
> 
>> Sounds like a good and useful "group". I would be happy to work on it with
>> you, as the project I am working on involves a similar feature...  that's
>> unless Scott is planing to implement embedded images in fields within the
>> next few weeks -:)
> 
> Actually, it's already done ;-)
Really? That is really great!!!

> Unfortunately it'll be more than a
> few weeks before it will be released (probably sometime in April),
> though we should start public testing in a month or so.  If you need
> something before then, I recommend you just do the minimum necessary
> to get the job done.
I think the person here can wait for that, but can you tell me a little more
about the possibilities? Is it possible that the text flows around the image
or movie? Is it possible to fully adjust the location of the image by
dragging (eventually manually scripted)? Is the HTML of the field now 'real'
HTML? Does it also support frames? So like this:

---
|This is only, an --- example, but|
|I have to type   | Image 1 | some text   |
|for the example, | | you know.   |
|MetaCard is going| | to be a very|
|interesting tool | | because of  |
|this option. --- Maybe we can|
|build a real MC browser, with embedded   |
|stacks...|
---

> Regards,
> Scott
Regards,
Sjoerd


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.