From 7d35b712d33cca0be3af122ecffbbfa7cbc123b2 Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Fri, 29 Jan 2016 18:17:46 +0100 Subject: cleanup --- inc/footer.inc.php | 13 +++++++++ inc/header.inc.php | 8 ++++++ inc/help.inc.php | 42 +++++++++++++++++++++++++++ js/common.js | 71 ---------------------------------------------- util/adadelta_rate_conv.rb | 28 ++++++++++++++++++ 5 files changed, 91 insertions(+), 71 deletions(-) create mode 100644 inc/footer.inc.php create mode 100644 inc/header.inc.php create mode 100644 inc/help.inc.php delete mode 100644 js/common.js create mode 100755 util/adadelta_rate_conv.rb diff --git a/inc/footer.inc.php b/inc/footer.inc.php new file mode 100644 index 0000000..7c30622 --- /dev/null +++ b/inc/footer.inc.php @@ -0,0 +1,13 @@ + +
+ + + + + + + diff --git a/inc/header.inc.php b/inc/header.inc.php new file mode 100644 index 0000000..e812943 --- /dev/null +++ b/inc/header.inc.php @@ -0,0 +1,8 @@ + +Press the 'Next' button to submit your post-edit and to request the next segment for post-edition. +Alternatively, in the textual interface, you may just press return when you finished the post-edit ('Target' text area is in focus).
+ +The session can be paused at any time and continued later; However, if you have to pause your session, wait until the activity notification disappears and then press 'Pause', as we are collecting timing information. You may also just reload this site and re-request the segment to reset the timer.
+ +Please use only a single browser window at the same time. Going back to earlier examples is not possible, please take great care when interacting with the system.
+ +Instructions for the graphical interface:
+To submit a post-edition in the graphical interface all phrases have to be marked as finished.
+The interface was tested with Firefox 31, 38 and 43.
+ +Known issues:
++ Support: Mail +
+Session: # | + Debug +
+ diff --git a/js/common.js b/js/common.js deleted file mode 100644 index 6ccc8ab..0000000 --- a/js/common.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * (common) global vars - * - */ -var data, // data (from JSON) - ui_type; // 't' (text) or 'g' (graphical) - -/* - * hacky way to remove class from node - * - */ -function removeClass(node, className) -{ - node.className = - node.className.replace(" "+className,''); - node.className = - node.className.replace(" "+className,''); // ??? - - return false; -} - -/* - * toggle display of element (by id) - * - */ -function toggleDisplay(id) -{ - node = $(id); - if (node.style.display=='none') { - node.fadeIn(); - } else { - node.fadeOut(); - } - - return false; -} - -/* - * trim string - * - */ -function trim(s) -{ - return s.replace(/(\||\n|\t)/g, " ").replace(/^\s+|\s+$/g, '').replace(/\s+/g, " "); -} - -function updateProgress (oEvent) { - //alert(oEvent); -} - -/* - * cross-site request - * - */ -function CreateCORSRequest(method, url) -{ - var xhr = new XMLHttpRequest(); - if ("withCredentials" in xhr) { - xhr.addEventListener("progress", updateProgress); - xhr.open(method, url, true); - xhr.timeout = 999999999999; - xhr.ontimeout = function () { alert("XHR TIMEOUT"); } - xhr.onerror = function () { alert("XHR ERRROR 1"); } - xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=UTF-8'); - } else { - xhr = null; - } - - return xhr; -} - diff --git a/util/adadelta_rate_conv.rb b/util/adadelta_rate_conv.rb new file mode 100755 index 0000000..c845847 --- /dev/null +++ b/util/adadelta_rate_conv.rb @@ -0,0 +1,28 @@ +#!/usr/bin/env ruby + +require 'zipf' + +updates = SparseVector.new +ReadFile.readlines_strip(ARGV[0]).each { |line| + k,v = line.split + updates[k] = v.to_f +} +grads = SparseVector.new +ReadFile.readlines_strip(ARGV[1]).each { |line| + k,v = line.split + grads[k] = v.to_f +} + +smooth = 0.000001 + +ks = updates.keys + grads.keys + +rates = SparseVector.new +ks.each { |k| + rates[k] = Math.sqrt(updates[k]+smooth)/Math.sqrt(grads[k]+smooth) +} + +rates.each { |k,v| + puts "#{k} #{v}" +} + -- cgit v1.2.3