From 4b378dbf27445600188eeae7b5a249a3e5e38426 Mon Sep 17 00:00:00 2001 From: David Pritchard Date: Mon, 25 Dec 2017 23:09:11 -0500 Subject: [PATCH 1/4] Move output above program state in embedded mode Prevents jumping around. Thanks to Nik Baltatzis for the suggestion. --- embed/js/iframe-embed.js | 2 +- iframe-embed.html | 2 +- pytutor-customizations.css | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/embed/js/iframe-embed.js b/embed/js/iframe-embed.js index c3e6396..f122707 100644 --- a/embed/js/iframe-embed.js +++ b/embed/js/iframe-embed.js @@ -149,7 +149,7 @@ $(document).ready(function() { $("#stdinShow").html(serverReply.stdin); }*/ if ($.bbq.getState('rightStdout')) { - $("#progOutputs").appendTo("#dataViz"); + $("#progOutputs").prependTo("#dataViz"); }; if (resizeContainer) resizeContainerNow(); diff --git a/iframe-embed.html b/iframe-embed.html index 3ce68f7..62eb27f 100644 --- a/iframe-embed.html +++ b/iframe-embed.html @@ -38,7 +38,7 @@ -
+
diff --git a/pytutor-customizations.css b/pytutor-customizations.css index e2c9472..acd398a 100644 --- a/pytutor-customizations.css +++ b/pytutor-customizations.css @@ -72,4 +72,8 @@ div.ExecutionVisualizer .highlight-cur { .symbolic { font-size: 18pt; -} \ No newline at end of file +} + +#vizDiv.embedded #progOutputs { + margin: 0 20px 10px 20px; width: 400px; +} From 09144ee126a26616e92282b5860a25335b7b5a32 Mon Sep 17 00:00:00 2001 From: Dave Pritchard Date: Sun, 17 Jun 2018 11:46:27 -0700 Subject: [PATCH 2/4] Make options work in URL generation/loading --- jv-frontend.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/jv-frontend.js b/jv-frontend.js index 60289de..0facfb1 100755 --- a/jv-frontend.js +++ b/jv-frontend.js @@ -105,8 +105,9 @@ function setCodeMirrorVal(dat) { viz_options = JSON.parse(viz_options); setOptions(function(key){ return viz_options[key] }); } - else + else { setOptions(function(key){ return undefined;}); + } pyInputCodeMirror.setValue(dat.rtrim()); $('#urlOutput,#embedCodeOutput').val(''); @@ -455,7 +456,7 @@ $(document).ready(function() { $('#genUrlBtn').bind('click', function() { var myArgs = {code: pyInputCodeMirror.getValue(), - mode: appMode + mode: appMode /* , cumulative: $('#cumulativeModeSelector').val(), heapPrimitives: $('#heapPrimitivesSelector').val(), @@ -465,13 +466,15 @@ $(document).ready(function() { py: $('#pythonVersionSelector').val() */}; - // the presence of the key is used, the value is not used + // Set these to a value which coerces to true if ($('#showStringsAsObjects').is(':checked')) - myArgs.showStringsAsObjects=''; + myArgs.showStringsAsObjects=1; if ($('#showAllFields').is(':checked')) - myArgs.showAllFields=''; + myArgs.showAllFields=1; if ($('#disableNesting').is(':checked')) - myArgs.disableNesting=''; + myArgs.disableNesting=1; + if ($('#verticalLists').is(':checked')) + myArgs.verticalLists=1; if (getUserArgs().length > 0) myArgs.args = JSON.stringify(getUserArgs()); @@ -529,7 +532,7 @@ var setOptions = function(lookup_function) { } // parse options - var optionNames = ['showStringsAsObjects', 'showAllFields', 'disableNesting']; + var optionNames = ['showStringsAsObjects', 'showAllFields', 'disableNesting', 'verticalLists']; var someOption = false; for (var i=0; i Date: Mon, 14 Oct 2019 23:22:37 -0700 Subject: [PATCH 3/4] Update default resource limits --- java_safe_ram_maketrace.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/java_safe_ram_maketrace.php b/java_safe_ram_maketrace.php index fbf5554..f42a799 100755 --- a/java_safe_ram_maketrace.php +++ b/java_safe_ram_maketrace.php @@ -55,8 +55,8 @@ function config_get($key, $default = NULL) { // you may choose to tweak these important performance parameters "clock" => config_get("safeexec_wallclock_s", 15), "cpu" => config_get("safeexec_cpu_s", 10), - "mem" => config_get("safeexec_mem_k", 2000000), - // use up to 2000000k ~ 2g of memory (YMMV) + "mem" => config_get("safeexec_mem_k", 8000000), + // use up to 8000000k ~ 8g of memory (YMMV) // counting both VMs and all overhead // see java_jail/cp/traceprinter/MEMORY-NOTES @@ -64,8 +64,8 @@ function config_get($key, $default = NULL) { "exec_dir" => "/", // execute in root of chroot "env_vars" => "''", // no env vars - "nproc" => "50", // max 50 processes - "nfile" => "50", // up to 50 file handles. + "nproc" => "200", // max 200 processes + "nfile" => "200", // up to 200 file handles. // depends on number of files you are including! "share_newnet" => "", // don't unshare network: 2 VMs talk over port @@ -245,4 +245,4 @@ function maketrace() { header("Content-type: text/plain; charset=utf-8"); echo maketrace(); -// end of file. \ No newline at end of file +// end of file. From 705b1d8c44d6f61a64321e02f71930922ba0369a Mon Sep 17 00:00:00 2001 From: Dave Pritchard Date: Mon, 14 Oct 2019 23:23:02 -0700 Subject: [PATCH 4/4] Update explicit resource limit --- jv-config.example.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jv-config.example.json b/jv-config.example.json index 79c4497..49a7c6a 100644 --- a/jv-config.example.json +++ b/jv-config.example.json @@ -27,7 +27,7 @@ "safeexec_wallclock_s": 15, "safeexec_cpu_s": 10, - "safeexec_mem_k": 4000000, + "safeexec_mem_k": 8000000, "visualizer_args": { "MAX_STEPS": 512,