CTK Exchange
Front Page
Movie shortcuts
Personal info
Awards
Reciprocal links
Terms of use
Privacy Policy

Interactive Activities

Cut The Knot!
MSET99 Talk
Games & Puzzles
Arithmetic/Algebra
Geometry
Probability
Eye Opener
Analog Gadgets
Inventor's Paradox
Did you know?...
Proofs
Math as Language
Things Impossible
My Logo
Math Poll
Other Math sit's
Guest book
News sit's

Recommend this site

Manifesto: what CTK is about Search CTK Buying a book is a commitment to learning Table of content Products to download and subscription Things you can find on CTK Chronology of updates Email to Cut The Knot Recommend this page

CTK Exchange

Subject: "JavaScript on the Probability page"     Previous Topic | Next Topic
Printer-friendly copy     Email this topic to a friend    
Conferences The CTK Exchange Thoughts and Suggestions Topic #27
Reading Topic #27
quintopia
guest
Dec-24-07, 09:14 AM (EST)
 
"JavaScript on the Probability page"
 
   On the page at: https://www.cut-the-knot.org/probability.shtml

I have some suggestions about the selection javascript.

1: When the start button is pressed, it fires off a new timer (which means a new thread), and a every time the timer triggers it creates a new one. Thus, if you press it many times in a row, you get many many timers calling the TimerResponse function. Thus, when you press it the first time, the name of the button should change to "Speed Up". . .just to point out that this feature is available.

2: When the Stop button is pressed, several calls to "Experiment" are already waiting in their own threads (if Start was pressed several times), so this button will reset the density array values only to have them immediately incremented again by the waiting function calls. This requires Stop to be pressed again once all those calls have been made to truly reset that density array.

Thus, the Experiment function requires the following line:

if (Auto) return;

or simply encapsulate the entire method contents with the if (Auto) {} conditional.

Hope this was helpful!


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
alexbadmin
Charter Member
2152 posts
Dec-24-07, 09:15 AM (EST)
Click to EMail alexb Click to send private message to alexb Click to view user profileClick to add this user to your buddy list  
1. "RE: JavaScript on the Probability page"
In response to message #0
 
   >
>Hope this was helpful!

Yes, it was. Many thanks. Hope it is better now.


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top

Conferences | Forums | Topics | Previous Topic | Next Topic

You may be curious to have a look at the old CTK Exchange archive.
Please do not post there.

Copyright © 1996-2018 Alexander Bogomolny

Search:
Keywords:

Google
Web CTK