OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <!-- | 3 <!-- |
4 Copyright (c) 2012 The Chromium Authors. All rights reserved. | 4 Copyright (c) 2012 The Chromium Authors. All rights reserved. |
5 Use of this source code is governed by a BSD-style license that can be | 5 Use of this source code is governed by a BSD-style license that can be |
6 found in the LICENSE file. | 6 found in the LICENSE file. |
7 --> | 7 --> |
8 <head> | 8 <head> |
9 <meta http-equiv="Pragma" content="no-cache"> | 9 <meta http-equiv="Pragma" content="no-cache"> |
10 <meta http-equiv="Expires" content="-1"> | 10 <meta http-equiv="Expires" content="-1"> |
(...skipping 12 matching lines...) Expand all Loading... |
23 // text display with this value. | 23 // text display with this value. |
24 function handleMessage(message_event) { | 24 function handleMessage(message_event) { |
25 document.getElementById('pi').value = message_event.data; | 25 document.getElementById('pi').value = message_event.data; |
26 } | 26 } |
27 | 27 |
28 function pageDidUnload() { | 28 function pageDidUnload() { |
29 clearInterval(paintInterval); | 29 clearInterval(paintInterval); |
30 } | 30 } |
31 </script> | 31 </script> |
32 </head> | 32 </head> |
33 <body onload="common.onload('<NAME>', '<tc>')" onunload="pageDidUnload()"> | 33 <body onload="common.onload('<NAME>', '<tc>', '<config>')" onunload="pageDidUnlo
ad()"> |
34 <h1><TITLE></h1> | 34 <h1><TITLE></h1> |
35 <h2>Status: <code id="statusField">NO-STATUS</code></h2> | 35 <h2>Status: <code id="statusField">NO-STATUS</code></h2> |
36 <p> | 36 <p> |
37 The Native Client module executed in this page creates a thread that | 37 The Native Client module executed in this page creates a thread that |
38 estimates pi (π) using the Monte Carlo method. The thread randomly puts | 38 estimates pi (π) using the Monte Carlo method. The thread randomly puts |
39 1,000,000,000 points inside a square that shares two sides with a quarter | 39 1,000,000,000 points inside a square that shares two sides with a quarter |
40 circle (a quadrant). Because the area of the quadrant is r²π/4 and | 40 circle (a quadrant). Because the area of the quadrant is r²π/4 and |
41 the area of the square is r², dividing the number of points inside the | 41 the area of the square is r², dividing the number of points inside the |
42 quadrant by the number of points inside the square gives us an estimate of | 42 quadrant by the number of points inside the square gives us an estimate of |
43 π/4. The textbox under the square shows the current estimate of π. | 43 π/4. The textbox under the square shows the current estimate of π. |
44 </p> | 44 </p> |
45 <!-- The NaCl plugin will be embedded inside the element with id "listener". | 45 <!-- The NaCl plugin will be embedded inside the element with id "listener". |
46 See common.js.--> | 46 See common.js.--> |
47 <div id="listener"></div> | 47 <div id="listener"></div> |
48 <input type="text" size="15" id="pi"> | 48 <input type="text" size="15" id="pi"> |
49 </body> | 49 </body> |
50 </html> | 50 </html> |
OLD | NEW |