Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: tests/npapi_pi/npapi_pi.html

Issue 1092005: Issue 1092005 (Closed) Base URL: http://nativeclient.googlecode.com/svn/trunk/src/native_client/
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html> 3 <html>
4 <!-- Copyright 2008 Google Inc. All rights reserved. --> 4 <!-- Copyright 2008 Google Inc. All rights reserved. -->
5 <head> 5 <head>
6 <title>Monte Carlo Estimate for Pi</title> 6 <title>Monte Carlo Estimate for Pi</title>
7 <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 7 <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
8 <META HTTP-EQUIV="Expires" CONTENT="-1"> 8 <META HTTP-EQUIV="Expires" CONTENT="-1">
9 </head> 9 </head>
10 <body id="bodyId" onload="doOnLoad()" onunload="doOnUnload()"> 10 <body id="bodyId" onload="doOnLoad()" onunload="doOnUnload()">
11 <h1>Monte Carlo Estimate for Pi</h1> 11 <h1>Monte Carlo Estimate for Pi</h1>
12 <p> 12 <p>
13 The Native Client module executed in this page creates a thread 13 The Native Client module executed in this page creates a thread
14 that estimates pi (&pi;) using the Monte Carlo method. 14 that estimates pi (&pi;) using the Monte Carlo method.
15 The thread randomly puts 1,000,000,000 points 15 The thread randomly puts 1,000,000,000 points
16 inside a square that shares two sides with a quarter circle (a quadrant). 16 inside a square that shares two sides with a quarter circle (a quadrant).
17 Because the area of 17 Because the area of
18 the quadrant is r&#178;&pi;/4 18 the quadrant is r&#178;&pi;/4
19 and the area of 19 and the area of
20 the square is r&#178;, 20 the square is r&#178;,
21 dividing the number of points inside the quadrant 21 dividing the number of points inside the quadrant
22 by the number of points inside the square gives us 22 by the number of points inside the square gives us
23 an estimate of &pi;/4. 23 an estimate of &pi;/4.
24 The textbox under the square 24 The textbox under the square
25 shows the current estimate of &pi;. 25 shows the current estimate of &pi;.
26 </p> 26 </p>
27 <embed id="nacl" src="npapi_pi.nexe" type="application/x-nacl-npapi" 27 <embed id="nacl" nexe="npapi_pi" type="application/x-nacl-npapi"
28 width="480" height="480" /> 28 width="480" height="480">
29 <noembed>
30 Your browser does not appear to support Native Client.
31 Visit http://code.google.com/p/nativeclient/ to get started.
32 <noembed/>
33 </embed>
29 <br /> 34 <br />
30 <form name="form"> 35 <form name="form">
31 <input type="text" size="15" name="pi" /> 36 <input type="text" size="15" name="pi" />
32 </form> 37 </form>
33 <script type="text/javascript"> 38 <script type="text/javascript">
34 <!-- 39 <!--
35 var nacl = null; 40 var nacl = null;
36 var paintInterval = null; 41 var paintInterval = null;
37 var loadTimer = null; 42 var loadTimer = null;
38 43
(...skipping 15 matching lines...) Expand all
54 } 59 }
55 60
56 function doOnUnload() { 61 function doOnUnload() {
57 clearInterval(paintInterval); 62 clearInterval(paintInterval);
58 clearTimeout(loadTimer); 63 clearTimeout(loadTimer);
59 } 64 }
60 --> 65 -->
61 </script> 66 </script>
62 </body> 67 </body>
63 </HTML> 68 </HTML>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698