|
| 1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 | +<html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 | + |
| 4 | +<!-- |
| 5 | +
|
| 6 | +Online Python Tutor |
| 7 | +https://github.com/pgbovine/OnlinePythonTutor/ |
| 8 | +
|
| 9 | +Copyright (C) Philip J. Guo (philip@pgbovine.net) |
| 10 | +
|
| 11 | +Permission is hereby granted, free of charge, to any person obtaining a |
| 12 | +copy of this software and associated documentation files (the |
| 13 | +"Software"), to deal in the Software without restriction, including |
| 14 | +without limitation the rights to use, copy, modify, merge, publish, |
| 15 | +distribute, sublicense, and/or sell copies of the Software, and to |
| 16 | +permit persons to whom the Software is furnished to do so, subject to |
| 17 | +the following conditions: |
| 18 | +
|
| 19 | +The above copyright notice and this permission notice shall be included |
| 20 | +in all copies or substantial portions of the Software. |
| 21 | +
|
| 22 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 23 | +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 24 | +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 25 | +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 26 | +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 27 | +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 28 | +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 29 | +
|
| 30 | + --> |
| 31 | + |
| 32 | +<head> |
| 33 | + <title>C Tutor - Visualize C code execution to learn C online</title> |
| 34 | + |
| 35 | + <meta http-equiv="Content-type" content="text/html; charset=UTF-8"/> |
| 36 | + |
| 37 | +<!-- requirements for pytutor.js --> |
| 38 | +<script type="text/javascript" src="js/d3.v2.min.js"></script> |
| 39 | +<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script> |
| 40 | +<script type="text/javascript" src="js/jquery.ba-bbq.min.js"></script> <!-- for handling back button and URL hashes --> |
| 41 | +<script type="text/javascript" src="js/jquery.ba-dotimeout.min.js"></script> <!-- for event debouncing --> |
| 42 | +<script type="text/javascript" src="js/jquery.jsPlumb-1.3.10-all-min.js "></script> <!-- for rendering SVG connectors |
| 43 | + DO NOT UPGRADE ABOVE 1.3.10 OR ELSE BREAKAGE WILL OCCUR --> |
| 44 | +<script type="text/javascript" src="js/diff_match_patch.js"></script> |
| 45 | + |
| 46 | +<script type="text/javascript" src="js/jquery-ui-1.8.24.custom.min.js"></script> <!-- for sliders and other UI elements --> |
| 47 | +<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.24.custom.css" rel="stylesheet" /> |
| 48 | + |
| 49 | +<!-- adapted from: http://reason.cs.illinois.edu/wenpu1/chatbox.html --> |
| 50 | +<link type="text/css" href="css/jquery.ui.chatbox.css" rel="stylesheet" /> |
| 51 | +<script type="text/javascript" src="js/jquery.ui.chatbox.js"></script> |
| 52 | + |
| 53 | + |
| 54 | +<!-- for annotation bubbles --> |
| 55 | +<script type="text/javascript" src="js/jquery.qtip.min.js"></script> |
| 56 | +<link type="text/css" href="css/jquery.qtip.css" rel="stylesheet" /> |
| 57 | + |
| 58 | +<script type="text/javascript" src="js/pytutor.js"></script> |
| 59 | +<link rel="stylesheet" href="css/pytutor.css"/> |
| 60 | + |
| 61 | +<script type="text/javascript" src="js/holistic.js"></script> |
| 62 | +<link rel="stylesheet" href="css/holistic.css"/> |
| 63 | + |
| 64 | +<!-- requirements for opt-frontend.js --> |
| 65 | + |
| 66 | +<!-- codemirror.net online code editor --> |
| 67 | +<!-- |
| 68 | +<script type="text/javascript" src="js/codemirror/codemirror.js"></script> |
| 69 | +<link type="text/css" href="css/codemirror.css" rel="stylesheet" /> |
| 70 | +<script type="text/javascript" src="js/codemirror/python.js"></script> |
| 71 | + --> |
| 72 | + |
| 73 | +<!-- Ace online code editor --> |
| 74 | +<script type="text/javascript" src="js/ace/src-min-noconflict/ace.js" charset="utf-8"></script> |
| 75 | + |
| 76 | +<script type="text/javascript" src="js/opt-frontend-common.js"></script> |
| 77 | +<script type="text/javascript" src="js/opt-frontend.js"></script> |
| 78 | +<link rel="stylesheet" href="css/opt-frontend.css"/> |
| 79 | + |
| 80 | +<!-- include this AFTER opt-frontend.js so that configuration |
| 81 | + global variables are already defined at load time --> |
| 82 | +<script type="text/javascript" src="js/togetherjs/togetherjs-min.js"></script> |
| 83 | + |
| 84 | +<script type="text/javascript" src="js/socket.io-client/socket.io.js"></script> |
| 85 | + |
| 86 | +<script type="text/javascript" src="js/opt-testcases.js"></script> |
| 87 | +<link rel="stylesheet" href="css/opt-testcases.css"/> |
| 88 | + |
| 89 | + |
| 90 | +<script type="text/javascript"> |
| 91 | + |
| 92 | + var _gaq = _gaq || []; |
| 93 | + _gaq.push(['_setAccount', 'UA-34795707-1']); |
| 94 | + _gaq.push(['_trackPageview']); |
| 95 | + |
| 96 | + (function() { |
| 97 | + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
| 98 | + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
| 99 | + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
| 100 | + })(); |
| 101 | + |
| 102 | +</script> |
| 103 | + |
| 104 | +</head> |
| 105 | + |
| 106 | +<body> |
| 107 | + |
| 108 | +<table id="experimentalHeader"> |
| 109 | +<tr> |
| 110 | +<td valign="top"> |
| 111 | + |
| 112 | +<!-- |
| 113 | +
|
| 114 | +<div id="adInfo" style="font-size: 8pt; width: 180px; margin-bottom: 15px;"> |
| 115 | +
|
| 116 | +<a href="#" id="hideHeaderLink">Hide banner ad</a> |
| 117 | +
|
| 118 | +<br/><br/> |
| 119 | +This tool is free and <a |
| 120 | +href="https://github.com/pgbovine/OnlinePythonTutor/">open-source</a>. |
| 121 | +Ads pay for web hosting costs. |
| 122 | +
|
| 123 | +--> |
| 124 | + |
| 125 | +</div> |
| 126 | + |
| 127 | +<div id="ssDiv"> |
| 128 | + <button id="sharedSessionBtn" type="button" class="togetherjsBtn"> |
| 129 | + Start shared session |
| 130 | + </button> |
| 131 | + <div style="font-size: 7pt; margin-left: 2px; margin-top: 3px;"> |
| 132 | + <a href="https://www.youtube.com/watch?v=Z2TIjNArOK4" target="_blank">What are shared sessions?</a> |
| 133 | + </div> |
| 134 | +</div> |
| 135 | + |
| 136 | +<div> |
| 137 | +<button id="getTutorBtn" type="button" class="togetherjsBtn" style="display: none;"> |
| 138 | +Get help from a tutor |
| 139 | +</button> |
| 140 | +</div> |
| 141 | + |
| 142 | +<div id="sharedSessionDisplayDiv" style="display: none;"> |
| 143 | + <button id="stopTogetherJSBtn" type="button" class="togetherjsBtn"> |
| 144 | + End shared session |
| 145 | + </button> |
| 146 | + |
| 147 | + <div style="width: 200px; font-size: 8pt; color: #666; margin-top: 5px;"> |
| 148 | + Your chat logs and code may be recorded, anonymized, and analyzed for research. |
| 149 | + </div> |
| 150 | +</div> |
| 151 | + |
| 152 | +</td> |
| 153 | +<td valign="top"> |
| 154 | + |
| 155 | +<div id="togetherjsStatus"></div> |
| 156 | + |
| 157 | +<div id="surveyHeader"></div> |
| 158 | + |
| 159 | +<div id="adHeader" style="margin-left: 15px; margin-bottom: 35px;"> |
| 160 | + |
| 161 | +<div id="optHeader" style="font-family: Georgia, Palatino, Times, serif; font-size: 13pt; margin-bottom: 10px;"> |
| 162 | +C Tutor - Visualize C code execution to learn C online |
| 163 | + |
| 164 | +<p style="font-size: 10pt";> |
| 165 | +(also visualize |
| 166 | +<a href="visualize.html#py=2">Python</a>, |
| 167 | +<a href="java.html">Java</a>, |
| 168 | +<a href="javascript.html">JavaScript</a>, |
| 169 | +<a href="typescript.html">TypeScript</a>, |
| 170 | +<a href="ruby.html">Ruby</a>, |
| 171 | +<a href="c.html">C</a>, |
| 172 | +and |
| 173 | +<a href="cpp.html">C++</a> |
| 174 | +code) |
| 175 | +</p> |
| 176 | + |
| 177 | +</div> |
| 178 | + |
| 179 | +<!-- |
| 180 | +<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> |
| 181 | +<ins class="adsbygoogle" |
| 182 | + style="display:inline-block;width:728px;height:90px" |
| 183 | + data-ad-client="ca-pub-7519401450079227" |
| 184 | + data-ad-slot="9796201192"></ins> |
| 185 | +<script> |
| 186 | +(adsbygoogle = window.adsbygoogle || []).push({}); |
| 187 | +</script> |
| 188 | +--> |
| 189 | + |
| 190 | +</div> |
| 191 | + |
| 192 | +</td> |
| 193 | +</tr> |
| 194 | +</table> |
| 195 | + |
| 196 | + |
| 197 | +<div id="pyInputPane"> |
| 198 | + |
| 199 | +<div id="codeInputWarnings">Write C code here (gcc 4.8, C11, EXPERIMENTAL): |
| 200 | + |
| 201 | + <select id="pythonVersionSelector" style="display: none;"> |
| 202 | + <option value="c">C</option> |
| 203 | + </select> |
| 204 | + |
| 205 | +</div> |
| 206 | + |
| 207 | +<div id="someoneIsTypingDiv" style="color: #e93f34; font-weight: bold; display: none;">Someone is typing ...</div> |
| 208 | + |
| 209 | +<div id="codeInputPane"></div> <!-- populate with a CodeMirror or Ace code editor instance --> |
| 210 | +<div id="frontendErrorOutput"></div> |
| 211 | +<div id="surveyPane"></div> |
| 212 | + |
| 213 | +<p> |
| 214 | +<button id="executeBtn" class="bigBtn" type="button">Visualize Execution</button> |
| 215 | +</p> |
| 216 | + |
| 217 | + |
| 218 | +<div id="javaOptionsPane" style="margin-top: 20px;"> |
| 219 | +[<i>coming soon!</i>] Java options: pass in command-line arguments and feed user input to stdin |
| 220 | +</div> |
| 221 | + |
| 222 | + |
| 223 | +<div id="optionsPane" style="margin-top: 18px; line-height: 150%; display: none;"> |
| 224 | + <select id="cumulativeModeSelector" style="display: none;"> |
| 225 | + <option value="false">hide exited frames [default]</option> |
| 226 | + </select> |
| 227 | + <select id="heapPrimitivesSelector" style="display: none;"> |
| 228 | + <option value="false">inline primitives & nested objects [default]</option> |
| 229 | + </select> |
| 230 | + <select id="textualMemoryLabelsSelector" style="display: none;"> |
| 231 | + <option value="false">draw pointers as arrows [default]</option> |
| 232 | + </select> |
| 233 | + |
| 234 | + <!-- hide these for now --> |
| 235 | + <select id="drawParentPointerSelector" style="display: none;"> |
| 236 | + <option value="false">hide environment parent pointers (default)</option> |
| 237 | + <!--<option value="true">show environment parent pointers</option>--> |
| 238 | + </select> |
| 239 | + <select id="showOnlyOutputsSelector" style="display: none;"> |
| 240 | + <option value="false">show everything (default)</option> |
| 241 | + <!--<option value="true">show only outputs</option>--> |
| 242 | + </select> |
| 243 | +</div> |
| 244 | + |
| 245 | + |
| 246 | +<p style="margin-top: 25px; display: none;"><a href="#" id="createTestsLink">Create test cases</a></p> |
| 247 | + |
| 248 | +<div id="testCasesPane"></div> |
| 249 | + |
| 250 | +<!-- insert examples here --> |
| 251 | + |
| 252 | +</div> |
| 253 | + |
| 254 | + |
| 255 | +<div id="pyOutputPane"> |
| 256 | +</div> |
| 257 | + |
| 258 | +<div id="footer"> |
| 259 | + |
| 260 | +<p> |
| 261 | + <button id="genUrlBtn" class="smallBtn" type="button">Generate permanent link</button> <input type="text" id="urlOutput" size="70"/> |
| 262 | +</p> |
| 263 | + |
| 264 | +<p>Click the button above to create a permanent link to your |
| 265 | +visualization. To report a bug, paste the link along with a brief error |
| 266 | +description in an email addressed to philip@pgbovine.net</p> |
| 267 | + |
| 268 | +<div id="embedLinkDiv"> |
| 269 | +<p> |
| 270 | + <button id="genEmbedBtn" class="smallBtn" type="button">Generate embed code</button> <input type="text" id="embedCodeOutput" size="70"/> |
| 271 | +</p> |
| 272 | + |
| 273 | +<p>To embed this visualization in your webpage, click the 'Generate |
| 274 | +embed code' button above and paste the resulting HTML code into your |
| 275 | +webpage. Adjust the height and width parameters and |
| 276 | +change the link to <b>https://</b> if needed.</p> |
| 277 | +</div> |
| 278 | + |
| 279 | +<p style="margin-top: 25px;"> |
| 280 | + |
| 281 | +This tool runs Java using OpenJDK Java 7. The original <a |
| 282 | +href="http://cscircles.cemc.uwaterloo.ca/java_visualize/">Java |
| 283 | +visualizer</a> was created by <a href="https://github.com/daveagp">David Pritchard</a> and Will Gwozdz. |
| 284 | +It supports |
| 285 | +<code><a href="http://introcs.cs.princeton.edu/java/stdlib/javadoc/StdIn.html">StdIn</a></code>, |
| 286 | +<code><a href="http://introcs.cs.princeton.edu/java/stdlib/javadoc/StdOut.html">StdOut</a></code>, |
| 287 | +most other <a href="http://introcs.cs.princeton.edu/java/stdlib"><tt>stdlib</tt> libraries</a>, |
| 288 | +<a href="http://introcs.cs.princeton.edu/java/43stack/Stack.java.html"><tt>Stack</tt></a>, |
| 289 | +<a href="http://introcs.cs.princeton.edu/java/43stack/Queue.java.html"><tt>Queue</tt></a>, |
| 290 | +and <a href="http://introcs.cs.princeton.edu/java/44st/ST.java.html"><tt>ST</tt></a>. |
| 291 | +(To access Java's built-in <tt>Stack</tt>/<tt>Queue</tt> classes, write |
| 292 | +<tt>import java.util.Stack;</tt> — note, <tt>import |
| 293 | +java.util.*;</tt> won't work.) |
| 294 | +Original source |
| 295 | +code: for <a href="https://github.com/daveagp/java_jail/tree/master/cp/traceprinter">the backend</a> and for <a href="https://github.com/daveagp/java_visualize">the frontend and installation |
| 296 | +instructions.</a></p> |
| 297 | + |
| 298 | +<p style="margin-top: 30px;">Privacy Policy: By using Online Python |
| 299 | +Tutor, your visualized code, options, user interactions, text chats, and |
| 300 | +IP address are logged on our server and may be analyzed for research |
| 301 | +purposes. Nearly all Web services collect this basic information from |
| 302 | +users. However, the Online Python Tutor website (pythontutor.com) does |
| 303 | +not collect any personal information or session state from users, nor |
| 304 | +does it issue any cookies.</p> |
| 305 | + |
| 306 | +<!-- |
| 307 | +
|
| 308 | +<p> |
| 309 | +
|
| 310 | +Third party vendors, including Google, use cookies to serve ads based on a |
| 311 | +user's prior visits to pythontutor.com. Google's use of the DoubleClick cookie |
| 312 | +enables it and its partners to serve ads to your users based on their visit to |
| 313 | +pythontutor.com and/or other sites on the Internet. Users may opt out of the use |
| 314 | +of the DoubleClick cookie by visiting Ads Settings. (Alternatively, users may |
| 315 | +opt out of a third-party vendor's use of cookies for interest based advertising |
| 316 | +by visiting <a href="http://www.aboutads.info/">aboutads.info</a>.) Some of our |
| 317 | +advertising partners may use cookies and web beacons on our site. Our |
| 318 | +advertising partners include Google Adsense. These third-party ad servers or ad |
| 319 | +networks use technology to the advertisements and links that appear on |
| 320 | +pythontutor.com send directly to your browsers. They automatically receive your |
| 321 | +IP address when this occurs. Other technologies (such as cookies, JavaScript, |
| 322 | +or Web Beacons) may also be used by the third-party ad networks to measure the |
| 323 | +effectiveness of their advertisements and / or to personalize the advertising |
| 324 | +content that you see. |
| 325 | +
|
| 326 | +pythontutor.com has no access to or control over these cookies that are used by |
| 327 | +third-party advertisers. Consult the respective privacy policies of these |
| 328 | +third-party ad servers for more detailed information on their practices as well |
| 329 | +as for instructions about how to opt-out of certain practices. pythontutor.com's |
| 330 | +privacy policy does not apply to, and we cannot control the activities of, such |
| 331 | +other advertisers or web sites. If you wish to disable cookies, you may do so |
| 332 | +through your individual browser options. |
| 333 | +
|
| 334 | +</p> |
| 335 | +
|
| 336 | +--> |
| 337 | + |
| 338 | +<!-- |
| 339 | +
|
| 340 | +<p>Join the <a |
| 341 | +href="https://groups.google.com/forum/#!forum/pythontutor-users">pythontutor-users</a> |
| 342 | +mailing list to participate in user discussions and <a |
| 343 | +href="https://groups.google.com/forum/#!forum/pythontutor-announce">pythontutor-announce</a> |
| 344 | +to receive occasional announcements. |
| 345 | +(Your name and email address will be kept private; only the list owner can see them.)</p> |
| 346 | +
|
| 347 | +--> |
| 348 | + |
| 349 | +<p style="margin-top: 25px;"> |
| 350 | +Copyright © <a href="http://www.pgbovine.net/">Philip Guo</a>. All rights reserved. |
| 351 | +</p> |
| 352 | + |
| 353 | +</div> |
| 354 | + |
| 355 | +<!-- adapted from: http://reason.cs.illinois.edu/wenpu1/chatbox.html --> |
| 356 | +<div id="chat_div"></div> |
| 357 | + |
| 358 | +</body> |
| 359 | +</html> |
0 commit comments