Return-Path: X-Original-To: apmail-mahout-commits-archive@www.apache.org Delivered-To: apmail-mahout-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AD70B17E95 for ; Fri, 29 May 2015 19:07:28 +0000 (UTC) Received: (qmail 46000 invoked by uid 500); 29 May 2015 19:07:24 -0000 Delivered-To: apmail-mahout-commits-archive@mahout.apache.org Received: (qmail 45901 invoked by uid 500); 29 May 2015 19:07:24 -0000 Mailing-List: contact commits-help@mahout.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mahout.apache.org Delivered-To: mailing list commits@mahout.apache.org Received: (qmail 44733 invoked by uid 99); 29 May 2015 19:07:23 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 May 2015 19:07:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 644B8E10DF; Fri, 29 May 2015 19:07:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: dlyubimov@apache.org To: commits@mahout.apache.org Date: Fri, 29 May 2015 19:07:46 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [25/26] mahout git commit: mahout-spark docs. http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/index/index-s.html ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/index/index-s.html b/docs/mahout-spark/index/index-s.html new file mode 100644 index 0000000..258d19e --- /dev/null +++ b/docs/mahout-spark/index/index-s.html @@ -0,0 +1,69 @@ + + + + + Mahout Spark bindings 0.10.0 API + + + + + + + + +
+
Slicing
+ +
+
SparkBCast
+ +
+
SparkDistributedContext
+ +
+
SparkEngine
+ +
+
SparkNaiveBayes
+ +
+
sb2bc
+ +
+
sbcast
+ +
+
sc
+ +
+
sc2sdc
+ +
+
scalarDiv
+ +
+
scalarMinus
+ +
+
sdc2sc
+ +
+
sort
+ +
+
sparkConf
+ +
+
sparkContext
+ +
+
sparkbindings
+ +
+
sparsify
+ +
+
start
+ +
+ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/index/index-t.html ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/index/index-t.html b/docs/mahout-spark/index/index-t.html new file mode 100644 index 0000000..5d80fc5 --- /dev/null +++ b/docs/mahout-spark/index/index-t.html @@ -0,0 +1,54 @@ + + + + + Mahout Spark bindings 0.10.0 API + + + + + + + + +
+
TDIndexedDatasetReader
+ +
+
TDIndexedDatasetReaderWriter
+ +
+
TDIndexedDatasetWriter
+ +
+
TestNBDriver
+ +
+
TextDelimitedIndexedDatasetReader
+ +
+
TextDelimitedIndexedDatasetReaderWriter
+ +
+
TextDelimitedIndexedDatasetWriter
+ +
+
TrainNBDriver
+ +
+
test
+ +
+
timesScalar
+ +
+
toBlockifiedDrmRdd
+ +
+
toDrmRdd
+ +
+
toPhysical
+ +
+ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/index/index-u.html ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/index/index-u.html b/docs/mahout-spark/index/index-u.html new file mode 100644 index 0000000..9bce79d --- /dev/null +++ b/docs/mahout-spark/index/index-u.html @@ -0,0 +1,27 @@ + + + + + Mahout Spark bindings 0.10.0 API + + + + + + + + +
+
uncache
+ +
+
unpersist
+ +
+
uris
+ +
+
useContext
+ +
+ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/index/index-v.html ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/index/index-v.html b/docs/mahout-spark/index/index-v.html new file mode 100644 index 0000000..0440ae3 --- /dev/null +++ b/docs/mahout-spark/index/index-v.html @@ -0,0 +1,21 @@ + + + + + Mahout Spark bindings 0.10.0 API + + + + + + + + +
+
value
+ +
+
valueTypeWritable
+ +
+ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/index/index-w.html ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/index/index-w.html b/docs/mahout-spark/index/index-w.html new file mode 100644 index 0000000..6fc613f --- /dev/null +++ b/docs/mahout-spark/index/index-w.html @@ -0,0 +1,27 @@ + + + + + Mahout Spark bindings 0.10.0 API + + + + + + + + +
+
WritableKryoSerializer
+ +
+
write
+ +
+
writeSchema
+ +
+
writer
+ +
+ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/arrow-down.png ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/arrow-down.png b/docs/mahout-spark/lib/arrow-down.png new file mode 100644 index 0000000..7229603 Binary files /dev/null and b/docs/mahout-spark/lib/arrow-down.png differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/arrow-right.png ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/arrow-right.png b/docs/mahout-spark/lib/arrow-right.png new file mode 100644 index 0000000..b2f2935 Binary files /dev/null and b/docs/mahout-spark/lib/arrow-right.png differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/class.png ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/class.png b/docs/mahout-spark/lib/class.png new file mode 100644 index 0000000..97edbd4 Binary files /dev/null and b/docs/mahout-spark/lib/class.png differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/class_big.png ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/class_big.png b/docs/mahout-spark/lib/class_big.png new file mode 100644 index 0000000..cb1f638 Binary files /dev/null and b/docs/mahout-spark/lib/class_big.png differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/class_diagram.png ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/class_diagram.png b/docs/mahout-spark/lib/class_diagram.png new file mode 100644 index 0000000..9d7aec7 Binary files /dev/null and b/docs/mahout-spark/lib/class_diagram.png differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/class_to_object_big.png ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/class_to_object_big.png b/docs/mahout-spark/lib/class_to_object_big.png new file mode 100644 index 0000000..5dd6e38 Binary files /dev/null and b/docs/mahout-spark/lib/class_to_object_big.png differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/constructorsbg.gif ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/constructorsbg.gif b/docs/mahout-spark/lib/constructorsbg.gif new file mode 100644 index 0000000..2e3f5ea Binary files /dev/null and b/docs/mahout-spark/lib/constructorsbg.gif differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/conversionbg.gif ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/conversionbg.gif b/docs/mahout-spark/lib/conversionbg.gif new file mode 100644 index 0000000..4be145d Binary files /dev/null and b/docs/mahout-spark/lib/conversionbg.gif differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/defbg-blue.gif ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/defbg-blue.gif b/docs/mahout-spark/lib/defbg-blue.gif new file mode 100644 index 0000000..6903833 Binary files /dev/null and b/docs/mahout-spark/lib/defbg-blue.gif differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/defbg-green.gif ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/defbg-green.gif b/docs/mahout-spark/lib/defbg-green.gif new file mode 100644 index 0000000..36c43be Binary files /dev/null and b/docs/mahout-spark/lib/defbg-green.gif differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/diagrams.css ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/diagrams.css b/docs/mahout-spark/lib/diagrams.css new file mode 100644 index 0000000..5fe33f7 --- /dev/null +++ b/docs/mahout-spark/lib/diagrams.css @@ -0,0 +1,143 @@ +.diagram-container +{ + display: none; +} + +.diagram +{ + overflow: hidden; + padding-top:15px; +} + +.diagram svg +{ + display: block; + position: absolute; + visibility: hidden; + margin: auto; +} + +.diagram-help +{ + float:right; + display:none; +} + +.magnifying +{ + cursor: -webkit-zoom-in ! important; + cursor: -moz-zoom-in ! important; + cursor: pointer; +} + +#close-link +{ + position: absolute; + z-index: 100; + font-family: Arial, sans-serif; + font-size: 10pt; + text-decoration: underline; + color: #315479; +} + +#close:hover +{ + text-decoration: none; +} + +svg a +{ + cursor:pointer; +} + +svg text +{ + font-size: 10px; +} + +/* try to move the node text 1px in order to be vertically + centered (does not work in all browsers) */ +svg .node text +{ + transform: translate(0px,1px); + -ms-transform: translate(0px,1px); + -webkit-transform: translate(0px,1px); + -o-transform: translate(0px,1px); + -moz-transform: translate(0px,1px); +} + +/* hover effect for edges */ + +svg .edge.over text, +svg .edge.implicit-incoming.over polygon, +svg .edge.implicit-outgoing.over polygon +{ + fill: #202020; +} + +svg .edge.over path, +svg .edge.over polygon +{ + stroke: #202020; +} + +/* hover effect for nodes in class diagrams */ + +svg.class-diagram .node +{ + opacity: 0.75; +} + +svg.class-diagram .node.this +{ + opacity: 1.0; +} + +svg.class-diagram .node.over +{ + opacity: 1.0; +} + +svg .node.over polygon +{ + stroke: #202020; +} + +/* hover effect for nodes in package diagrams */ + +svg.package-diagram .node.class.over polygon, +svg.class-diagram .node.this.class.over polygon +{ + fill: #098552; + fill: #04663e; +} + +svg.package-diagram .node.trait.over polygon, +svg.class-diagram .node.this.trait.over polygon +{ + fill: #3c7b9b; + fill: #235d7b; +} + +svg.package-diagram .node.type.over polygon, +svg.class-diagram .node.this.type.over polygon +{ + fill: #098552; + fill: #04663e; +} + + +svg.package-diagram .node.object.over polygon +{ + fill: #183377; +} + +svg.package-diagram .node.outside.over polygon +{ + fill: #d4d4d4; +} + +svg.package-diagram .node.default.over polygon +{ + fill: #d4d4d4; +} http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/diagrams.js ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/diagrams.js b/docs/mahout-spark/lib/diagrams.js new file mode 100644 index 0000000..478f2e3 --- /dev/null +++ b/docs/mahout-spark/lib/diagrams.js @@ -0,0 +1,324 @@ +/** + * JavaScript functions enhancing the SVG diagrams. + * + * @author Damien Obrist + */ + +var diagrams = {}; + +/** + * Initializes the diagrams in the main window. + */ +$(document).ready(function() +{ + // hide diagrams in browsers not supporting SVG + if(Modernizr && !Modernizr.inlinesvg) + return; + + // only execute this in the main window + if(diagrams.isPopup) + return; + + if($("#content-diagram").length) + $("#inheritance-diagram").css("padding-bottom", "20px"); + + $(".diagram-container").css("display", "block"); + + $(".diagram").each(function() { + // store inital dimensions + $(this).data("width", $("svg", $(this)).width()); + $(this).data("height", $("svg", $(this)).height()); + // store unscaled clone of SVG element + $(this).data("svg", $(this).get(0).childNodes[0].cloneNode(true)); + }); + + // make diagram visible, hide container + $(".diagram").css("display", "none"); + $(".diagram svg").css({ + "position": "static", + "visibility": "visible", + "z-index": "auto" + }); + + // enable linking to diagrams + if($(location).attr("hash") == "#inheritance-diagram") { + diagrams.toggle($("#inheritance-diagram-container"), true); + } else if($(location).attr("hash") == "#content-diagram") { + diagrams.toggle($("#content-diagram-container"), true); + } + + $(".diagram-link").click(function() { + diagrams.toggle($(this).parent()); + }); + + // register resize function + $(window).resize(diagrams.resize); + + // don't bubble event to parent div + // when clicking on a node of a resized + // diagram + $("svg a").click(function(e) { + e.stopPropagation(); + }); + + diagrams.initHighlighting(); +}); + +/** + * Initializes the diagrams in the popup. + */ +diagrams.initPopup = function(id) +{ + // copy diagram from main window + if(!jQuery.browser.msie) + $("body").append(opener.$("#" + id).data("svg")); + + // positioning + $("svg").css("position", "absolute"); + $(window).resize(function() + { + var svg_w = $("svg").css("width").replace("px", ""); + var svg_h = $("svg").css("height").replace("px", ""); + var x = $(window).width() / 2 - svg_w / 2; + if(x < 0) x = 0; + var y = $(window).height() / 2 - svg_h / 2; + if(y < 0) y = 0; + $("svg").css("left", x + "px"); + $("svg").css("top", y + "px"); + }); + $(window).resize(); + + diagrams.initHighlighting(); + $("svg a").click(function(e) { + opener.diagrams.redirectFromPopup(this.href.baseVal); + window.close(); + }); + $(document).keyup(function(e) { + if (e.keyCode == 27) window.close(); + }); +} + +/** + * Initializes highlighting for nodes and edges. + */ +diagrams.initHighlighting = function() +{ + // helper function since $.hover doesn't work in IE + + function hover(elements, fn) + { + elements.mouseover(fn); + elements.mouseout(fn); + } + + // inheritance edges + + hover($("svg .edge.inheritance"), function(evt){ + var toggleClass = evt.type == "mouseout" ? diagrams.removeClass : diagrams.addClass; + var parts = $(this).attr("id").split("_"); + toggleClass($("#" + parts[0] + "_" + parts[1])); + toggleClass($("#" + parts[0] + "_" + parts[2])); + toggleClass($(this)); + }); + + // nodes + + hover($("svg .node"), function(evt){ + var toggleClass = evt.type == "mouseout" ? diagrams.removeClass : diagrams.addClass; + toggleClass($(this)); + var parts = $(this).attr("id").split("_"); + var index = parts[1]; + $("svg#" + parts[0] + " .edge.inheritance").each(function(){ + var parts2 = $(this).attr("id").split("_"); + if(parts2[1] == index) + { + toggleClass($("#" + parts2[0] + "_" + parts2[2])); + toggleClass($(this)); + } else if(parts2[2] == index) + { + toggleClass($("#" + parts2[0] + "_" + parts2[1])); + toggleClass($(this)); + } + }); + }); + + // incoming implicits + + hover($("svg .node.implicit-incoming"), function(evt){ + var toggleClass = evt.type == "mouseout" ? diagrams.removeClass : diagrams.addClass; + toggleClass($(this)); + toggleClass($("svg .edge.implicit-incoming")); + toggleClass($("svg .node.this")); + }); + + hover($("svg .edge.implicit-incoming"), function(evt){ + var toggleClass = evt.type == "mouseout" ? diagrams.removeClass : diagrams.addClass; + toggleClass($(this)); + toggleClass($("svg .node.this")); + $("svg .node.implicit-incoming").each(function(){ + toggleClass($(this)); + }); + }); + + // implicit outgoing nodes + + hover($("svg .node.implicit-outgoing"), function(evt){ + var toggleClass = evt.type == "mouseout" ? diagrams.removeClass : diagrams.addClass; + toggleClass($(this)); + toggleClass($("svg .edge.implicit-outgoing")); + toggleClass($("svg .node.this")); + }); + + hover($("svg .edge.implicit-outgoing"), function(evt){ + var toggleClass = evt.type == "mouseout" ? diagrams.removeClass : diagrams.addClass; + toggleClass($(this)); + toggleClass($("svg .node.this")); + $("svg .node.implicit-outgoing").each(function(){ + toggleClass($(this)); + }); + }); +}; + +/** + * Resizes the diagrams according to the available width. + */ +diagrams.resize = function() +{ + // available width + var availableWidth = $("body").width() - 20; + + $(".diagram-container").each(function() { + // unregister click event on whole div + $(".diagram", this).unbind("click"); + var diagramWidth = $(".diagram", this).data("width"); + var diagramHeight = $(".diagram", this).data("height"); + + if(diagramWidth > availableWidth) + { + // resize diagram + var height = diagramHeight / diagramWidth * availableWidth; + $(".diagram svg", this).width(availableWidth); + $(".diagram svg", this).height(height); + + // register click event on whole div + $(".diagram", this).click(function() { + diagrams.popup($(this)); + }); + $(".diagram", this).addClass("magnifying"); + } + else + { + // restore full size of diagram + $(".diagram svg", this).width(diagramWidth); + $(".diagram svg", this).height(diagramHeight); + // don't show custom cursor any more + $(".diagram", this).removeClass("magnifying"); + } + }); +}; + +/** + * Shows or hides a diagram depending on its current state. + */ +diagrams.toggle = function(container, dontAnimate) +{ + // change class of link + $(".diagram-link", container).toggleClass("open"); + // get element to show / hide + var div = $(".diagram", container); + if (div.is(':visible')) + { + $(".diagram-help", container).hide(); + div.unbind("click"); + div.removeClass("magnifying"); + div.slideUp(100); + } + else + { + diagrams.resize(); + if(dontAnimate) + div.show(); + else + div.slideDown(100); + $(".diagram-help", container).show(); + } +}; + +/** + * Opens a popup containing a copy of a diagram. + */ +diagrams.windows = {}; +diagrams.popup = function(diagram) +{ + var id = diagram.attr("id"); + if(!diagrams.windows[id] || diagrams.windows[id].closed) { + var title = $(".symbol .name", $("#signature")).text(); + // cloning from parent window to popup somehow doesn't work in IE + // therefore include the SVG as a string into the HTML + var svgIE = jQuery.browser.msie ? $("
").append(diagram.data("svg")).html() : ""; + var html = '' + + '\n' + + '\n' + + '\n' + + ' \n' + + ' ' + title + '\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' Close this window\n' + + ' ' + svgIE + '\n' + + ' \n' + + ''; + + var padding = 30; + var screenHeight = screen.availHeight; + var screenWidth = screen.availWidth; + var w = Math.min(screenWidth, diagram.data("width") + 2 * padding); + var h = Math.min(screenHeight, diagram.data("height") + 2 * padding); + var left = (screenWidth - w) / 2; + var top = (screenHeight - h) / 2; + var parameters = "height=" + h + ", width=" + w + ", left=" + left + ", top=" + top + ", scrollbars=yes, location=no, resizable=yes"; + var win = window.open("about:blank", "_blank", parameters); + win.document.open(); + win.document.write(html); + win.document.close(); + diagrams.windows[id] = win; + } + win.focus(); +}; + +/** + * This method is called from within the popup when a node is clicked. + */ +diagrams.redirectFromPopup = function(url) +{ + window.location = url; +}; + +/** + * Helper method that adds a class to a SVG element. + */ +diagrams.addClass = function(svgElem, newClass) { + newClass = newClass || "over"; + var classes = svgElem.attr("class"); + if ($.inArray(newClass, classes.split(/\s+/)) == -1) { + classes += (classes ? ' ' : '') + newClass; + svgElem.attr("class", classes); + } +}; + +/** + * Helper method that removes a class from a SVG element. + */ +diagrams.removeClass = function(svgElem, oldClass) { + oldClass = oldClass || "over"; + var classes = svgElem.attr("class"); + classes = $.grep(classes.split(/\s+/), function(n, i) { return n != oldClass; }).join(' '); + svgElem.attr("class", classes); +}; + http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/filter_box_left.png ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/filter_box_left.png b/docs/mahout-spark/lib/filter_box_left.png new file mode 100644 index 0000000..0e8c893 Binary files /dev/null and b/docs/mahout-spark/lib/filter_box_left.png differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/filter_box_left2.gif ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/filter_box_left2.gif b/docs/mahout-spark/lib/filter_box_left2.gif new file mode 100644 index 0000000..b9b4907 Binary files /dev/null and b/docs/mahout-spark/lib/filter_box_left2.gif differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/filter_box_right.png ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/filter_box_right.png b/docs/mahout-spark/lib/filter_box_right.png new file mode 100644 index 0000000..f127e35 Binary files /dev/null and b/docs/mahout-spark/lib/filter_box_right.png differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/filterbg.gif ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/filterbg.gif b/docs/mahout-spark/lib/filterbg.gif new file mode 100644 index 0000000..542ba4a Binary files /dev/null and b/docs/mahout-spark/lib/filterbg.gif differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/filterboxbarbg.gif ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/filterboxbarbg.gif b/docs/mahout-spark/lib/filterboxbarbg.gif new file mode 100644 index 0000000..b5075c1 Binary files /dev/null and b/docs/mahout-spark/lib/filterboxbarbg.gif differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/filterboxbarbg.png ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/filterboxbarbg.png b/docs/mahout-spark/lib/filterboxbarbg.png new file mode 100644 index 0000000..d613cf5 Binary files /dev/null and b/docs/mahout-spark/lib/filterboxbarbg.png differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/filterboxbg.gif ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/filterboxbg.gif b/docs/mahout-spark/lib/filterboxbg.gif new file mode 100644 index 0000000..ae2f858 Binary files /dev/null and b/docs/mahout-spark/lib/filterboxbg.gif differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/fullcommenttopbg.gif ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/fullcommenttopbg.gif b/docs/mahout-spark/lib/fullcommenttopbg.gif new file mode 100644 index 0000000..a0d93f4 Binary files /dev/null and b/docs/mahout-spark/lib/fullcommenttopbg.gif differ http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/index.css ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/index.css b/docs/mahout-spark/lib/index.css new file mode 100644 index 0000000..55fb370 --- /dev/null +++ b/docs/mahout-spark/lib/index.css @@ -0,0 +1,338 @@ +* { + color: inherit; + font-size: 10pt; + text-decoration: none; + font-family: Arial, sans-serif; + border-width: 0px; + padding: 0px; + margin: 0px; +} + +a { + cursor: pointer; +} + +a:hover { + text-decoration: underline; +} + +h1 { + display: none; +} + +.selected { + -moz-box-shadow: inset 0px 5px 10px rgba(58, 88, 97, .36); + -webkit-box-shadow: inset 0px 5px 10px rgba(58, 88, 97, .36); + border-top: solid 1px rgba(119, 138, 153, 0.8); + border-bottom: solid 1px rgba(151, 173, 191, 0.4); + background-color: #ced2d9; + margin: -1px 0px; +} + +/*.letters { + font-family: monospace; + font-size: 2pt; + padding: 5px; + background-color: #DADADA; + text-shadow: #ffffff 0 1px 0; +}*/ + +#library { + display: none; +} + +#browser { + top: 0px; + left: 0px; + bottom: 0px; + width: 100%; + display: block; + position: fixed; +} + +#filter { + position: absolute; + display: block; +/* padding: 5px;*/ + right: 0; + left: 0; + top: 0; + background-image:url('filterbg.gif'); + background-repeat:repeat-x; + background-color: #ededee; /* light gray */ + /*background-color: #DADADA;*/ + border:1px solid #bbbbbb; + border-top:0; + border-left:0; + border-right:0; +} + +#textfilter { + position: relative; + display: block; + height: 20px; + margin-top: 5px; + margin-bottom: 5px; +} + +#textfilter > .pre { + display: block; + position: absolute; + top: 0; + left: 0; + height: 23px; + width: 21px; + background: url("filter_box_left.png"); +} + +#textfilter > .input { + display: block; + position: absolute; + top: 0; + right: 20px; + left: 20px; +} + +#textfilter > .input > input { + height: 20px; + padding: 1px; + font-weight: bold; + color: #000000; + background: #ffffff url("filterboxbarbg.png") repeat-x bottom left; + width: 100%; +} + +#textfilter > .post { + display: block; + position: absolute; + top: 0; + right: 0; + height: 23px; + width: 21px; + background: url("filter_box_right.png"); +} + +/*#textfilter { + position: relative; + display: block; + height: 20px; + margin-bottom: 5px; +} + +#textfilter > .pre { + display: block; + position: absolute; + top: 0; + left: 0; + height: 20px; + width: 20px; + background: url("filter_box_left.png"); +} + +#textfilter > .input { + display: block; + position: absolute; + top: 0; + right: 20px; + left: 20px; +} + +#textfilter > .input > input { + height: 16px; + padding: 2px; + font-weight: bold; + color: darkblue; + background-color: white; + width: 100%; +} + +#textfilter > .post { + display: block; + position: absolute; + top: 0; + right: 0; + height: 20px; + width: 20px; + background: url("filter_box_right.png"); +}*/ + +#focusfilter { + position: relative; + text-align: center; + display: block; + padding: 5px; + background-color: #fffebd; /* light yellow*/ + text-shadow: #ffffff 0 1px 0; +} + +#focusfilter .focuscoll { + font-weight: bold; + text-shadow: #ffffff 0 1px 0; +} + +#focusfilter img { + bottom: -2px; + position: relative; +} + +#kindfilter { + position: relative; + display: block; + padding: 5px; +/* background-color: #999;*/ + text-align: center; +} + +#kindfilter > a { + color: black; +/* text-decoration: underline;*/ + text-shadow: #ffffff 0 1px 0; + +} + +#kindfilter > a:hover { + color: #4C4C4C; + text-decoration: none; + text-shadow: #ffffff 0 1px 0; +} + +#letters { + position: relative; + text-align: center; + padding-bottom: 5px; + border:1px solid #bbbbbb; + border-top:0; + border-left:0; + border-right:0; +} + +#letters > a, #letters > span { +/* font-family: monospace;*/ + color: #858484; + font-weight: bold; + font-size: 8pt; + text-shadow: #ffffff 0 1px 0; + padding-right: 2px; +} + +#letters > span { + color: #bbb; +} + +#tpl { + display: block; + position: fixed; + overflow: auto; + right: 0; + left: 0; + bottom: 0; + top: 5px; + position: absolute; + display: block; +} + +#tpl .packhide { + display: block; + float: right; + font-weight: normal; + color: white; +} + +#tpl .packfocus { + display: block; + float: right; + font-weight: normal; + color: white; +} + +#tpl .packages > ol { + background-color: #dadfe6; + /*margin-bottom: 5px;*/ +} + +/*#tpl .packages > ol > li { + margin-bottom: 1px; +}*/ + +#tpl .packages > li > a { + padding: 0px 5px; +} + +#tpl .packages > li > a.tplshow { + display: block; + color: white; + font-weight: bold; + display: block; + text-shadow: #000000 0 1px 0; +} + +#tpl ol > li.pack { + padding: 3px 5px; + background: url("packagesbg.gif"); + background-repeat:repeat-x; + min-height: 14px; + background-color: #6e808e; +} + +#tpl ol > li { + display: block; +} + +#tpl .templates > li { + padding-left: 5px; + min-height: 18px; +} + +#tpl ol > li .icon { + padding-right: 5px; + bottom: -2px; + position: relative; +} + +#tpl .templates div.placeholder { + padding-right: 5px; + width: 13px; + display: inline-block; +} + +#tpl .templates span.tplLink { + padding-left: 5px; +} + +#content { + border-left-width: 1px; + border-left-color: black; + border-left-style: white; + right: 0px; + left: 0px; + bottom: 0px; + top: 0px; + position: fixed; + margin-left: 300px; + display: block; +} + +#content > iframe { + display: block; + height: 100%; + width: 100%; +} + +.ui-layout-pane { + background: #FFF; + overflow: auto; +} + +.ui-layout-resizer { + background-image:url('filterbg.gif'); + background-repeat:repeat-x; + background-color: #ededee; /* light gray */ + border:1px solid #bbbbbb; + border-top:0; + border-bottom:0; + border-left: 0; +} + +.ui-layout-toggler { + background: #AAA; +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/mahout/blob/21e5ddb7/docs/mahout-spark/lib/index.js ---------------------------------------------------------------------- diff --git a/docs/mahout-spark/lib/index.js b/docs/mahout-spark/lib/index.js new file mode 100644 index 0000000..96689ae --- /dev/null +++ b/docs/mahout-spark/lib/index.js @@ -0,0 +1,536 @@ +// © 2009–2010 EPFL/LAMP +// code by Gilles Dubochet with contributions by Johannes Rudolph and "spiros" + +var topLevelTemplates = undefined; +var topLevelPackages = undefined; + +var scheduler = undefined; + +var kindFilterState = undefined; +var focusFilterState = undefined; + +var title = $(document).attr('title'); + +var lastHash = ""; + +$(document).ready(function() { + $('body').layout({ + west__size: '20%', + center__maskContents: true + }); + $('#browser').layout({ + center__paneSelector: ".ui-west-center" + //,center__initClosed:true + ,north__paneSelector: ".ui-west-north" + }); + $('iframe').bind("load", function(){ + var subtitle = $(this).contents().find('title').text(); + $(document).attr('title', (title ? title + " - " : "") + subtitle); + + setUrlFragmentFromFrameSrc(); + }); + + // workaround for IE's iframe sizing lack of smartness + if($.browser.msie) { + function fixIFrame() { + $('iframe').height($(window).height() ) + } + $('iframe').bind("load",fixIFrame) + $('iframe').bind("resize",fixIFrame) + } + + scheduler = new Scheduler(); + scheduler.addLabel("init", 1); + scheduler.addLabel("focus", 2); + scheduler.addLabel("filter", 4); + + prepareEntityList(); + + configureTextFilter(); + configureKindFilter(); + configureEntityList(); + + setFrameSrcFromUrlFragment(); + + // If the url fragment changes, adjust the src of iframe "template". + $(window).bind('hashchange', function() { + if(lastFragment != window.location.hash) { + lastFragment = window.location.hash; + setFrameSrcFromUrlFragment(); + } + }); +}); + +// Set the iframe's src according to the fragment of the current url. +// fragment = "#scala.Either" => iframe url = "scala/Either.html" +// fragment = "#scala.Either@isRight:Boolean" => iframe url = "scala/Either.html#isRight:Boolean" +function setFrameSrcFromUrlFragment() { + var fragment = location.hash.slice(1); + if(fragment) { + var loc = fragment.split("@")[0].replace(/\./g, "/"); + if(loc.indexOf(".html") < 0) loc += ".html"; + if(fragment.indexOf('@') > 0) loc += ("#" + fragment.split("@", 2)[1]); + frames["template"].location.replace(loc); + } + else + frames["template"].location.replace("package.html"); +} + +// Set the url fragment according to the src of the iframe "template". +// iframe url = "scala/Either.html" => url fragment = "#scala.Either" +// iframe url = "scala/Either.html#isRight:Boolean" => url fragment = "#scala.Either@isRight:Boolean" +function setUrlFragmentFromFrameSrc() { + try { + var commonLength = location.pathname.lastIndexOf("/"); + var frameLocation = frames["template"].location; + var relativePath = frameLocation.pathname.slice(commonLength + 1); + + if(!relativePath || frameLocation.pathname.indexOf("/") < 0) + return; + + // Add #, remove ".html" and replace "/" with "." + fragment = "#" + relativePath.replace(/\.html$/, "").replace(/\//g, "."); + + // Add the frame's hash after an @ + if(frameLocation.hash) fragment += ("@" + frameLocation.hash.slice(1)); + + // Use replace to not add history items + lastFragment = fragment; + location.replace(fragment); + } + catch(e) { + // Chrome doesn't allow reading the iframe's location when + // used on the local file system. + } +} + +var Index = {}; + +(function (ns) { + function openLink(t, type) { + var href; + if (type == 'object') { + href = t['object']; + } else { + href = t['class'] || t['trait'] || t['case class'] || t['type']; + } + return [ + '' + ].join(''); + } + + function createPackageHeader(pack) { + return [ + '
  • ', + 'focushide', + '', + pack, + '
  • ' + ].join(''); + }; + + function createListItem(template) { + var inner = ''; + + + if (template.object) { + inner += openLink(template, 'object'); + } + + if (template['class'] || template['trait'] || template['case class'] || template['type']) { + inner += (inner == '') ? + '
    ' : ''; + inner += openLink(template, template['trait'] ? 'trait' : template['type'] ? 'type' : 'class'); + } else { + inner += '
    '; + } + + return [ + '
  • ', + inner, + '', + template.name.replace(/^.*\./, ''), + '
  • ' + ].join(''); + } + + + ns.createPackageTree = function (pack, matched, focused) { + var html = $.map(matched, function (child, i) { + return createListItem(child); + }).join(''); + + var header; + if (focused && pack == focused) { + header = ''; + } else { + header = createPackageHeader(pack); + } + + return [ + '
      ', + header, + '
        ', + html, + '
    ' + ].join(''); + } + + ns.keys = function (obj) { + var result = []; + var key; + for (key in obj) { + result.push(key); + } + return result; + } + + var hiddenPackages = {}; + + function subPackages(pack) { + return $.grep($('#tpl ol.packages'), function (element, index) { + var pack = $('li.pack > .tplshow', element).text(); + return pack.indexOf(pack + '.') == 0; + }); + } + + ns.hidePackage = function (ol) { + var selected = $('li.pack > .tplshow', ol).text(); + hiddenPackages[selected] = true; + + $('ol.templates', ol).hide(); + + $.each(subPackages(selected), function (index, element) { + $(element).hide(); + }); + } + + ns.showPackage = function (ol, state) { + var selected = $('li.pack > .tplshow', ol).text(); + hiddenPackages[selected] = false; + + $('ol.templates', ol).show(); + + $.each(subPackages(selected), function (index, element) { + $(element).show(); + + // When the filter is in "packs" state, + // we don't want to show the `.templates` + var key = $('li.pack > .tplshow', element).text(); + if (hiddenPackages[key] || state == 'packs') { + $('ol.templates', element).hide(); + } + }); + } + +})(Index); + +function configureEntityList() { + kindFilterSync(); + configureHideFilter(); + configureFocusFilter(); + textFilter(); +} + +/* Updates the list of entities (i.e. the content of the #tpl element) from the raw form generated by Scaladoc to a + form suitable for display. In particular, it adds class and object etc. icons, and it configures links to open in + the right frame. Furthermore, it sets the two reference top-level entities lists (topLevelTemplates and + topLevelPackages) to serve as reference for resetting the list when needed. + Be advised: this function should only be called once, on page load. */ +function prepareEntityList() { + var classIcon = $("#library > img.class"); + var traitIcon = $("#library > img.trait"); + var typeIcon = $("#library > img.type"); + var objectIcon = $("#library > img.object"); + var packageIcon = $("#library > img.package"); + + $('#tpl li.pack > a.tplshow').attr("target", "template"); + $('#tpl li.pack').each(function () { + $("span.class", this).each(function() { $(this).replaceWith(classIcon.clone()); }); + $("span.trait", this).each(function() { $(this).replaceWith(traitIcon.clone()); }); + $("span.type", this).each(function() { $(this).replaceWith(typeIcon.clone()); }); + $("span.object", this).each(function() { $(this).replaceWith(objectIcon.clone()); }); + $("span.package", this).each(function() { $(this).replaceWith(packageIcon.clone()); }); + }); + $('#tpl li.pack') + .prepend("hide") + .prepend("focus"); +} + +/* Handles all key presses while scrolling around with keyboard shortcuts in left panel */ +function keyboardScrolldownLeftPane() { + scheduler.add("init", function() { + $("#textfilter input").blur(); + var $items = $("#tpl li"); + $items.first().addClass('selected'); + + $(window).bind("keydown", function(e) { + var $old = $items.filter('.selected'), + $new; + + switch ( e.keyCode ) { + + case 9: // tab + $old.removeClass('selected'); + break; + + case 13: // enter + $old.removeClass('selected'); + var $url = $old.children().filter('a:last').attr('href'); + $("#template").attr("src",$url); + break; + + case 27: // escape + $old.removeClass('selected'); + $(window).unbind(e); + $("#textfilter input").focus(); + + break; + + case 38: // up + $new = $old.prev(); + + if (!$new.length) { + $new = $old.parent().prev(); + } + + if ($new.is('ol') && $new.children(':last').is('ol')) { + $new = $new.children().children(':last'); + } else if ($new.is('ol')) { + $new = $new.children(':last'); + } + + break; + + case 40: // down + $new = $old.next(); + if (!$new.length) { + $new = $old.parent().parent().next(); + } + if ($new.is('ol')) { + $new = $new.children(':first'); + } + break; + } + + if ($new.is('li')) { + $old.removeClass('selected'); + $new.addClass('selected'); + } else if (e.keyCode == 38) { + $(window).unbind(e); + $("#textfilter input").focus(); + } + }); + }); +} + +/* Configures the text filter */ +function configureTextFilter() { + scheduler.add("init", function() { + $("#textfilter").append(""); + var input = $("#textfilter input"); + resizeFilterBlock(); + input.bind('keyup', function(event) { + if (event.keyCode == 27) { // escape + input.attr("value", ""); + } + if (event.keyCode == 40) { // down arrow + $(window).unbind("keydown"); + keyboardScrolldownLeftPane(); + return false; + } + textFilter(); + }); + input.bind('keydown', function(event) { + if (event.keyCode == 9) { // tab + $("#template").contents().find("#mbrsel-input").focus(); + input.attr("value", ""); + return false; + } + textFilter(); + }); + input.focus(function(event) { input.select(); }); + }); + scheduler.add("init", function() { + $("#textfilter > .post").click(function(){ + $("#textfilter input").attr("value", ""); + textFilter(); + }); + }); +} + +function compilePattern(query) { + var escaped = query.replace(/([\.\*\+\?\|\(\)\[\]\\])/g, '\\$1'); + + if (query.toLowerCase() != query) { + // Regexp that matches CamelCase subbits: "BiSe" is + // "[a-z]*Bi[a-z]*Se" and matches "BitSet", "ABitSet", ... + return new RegExp(escaped.replace(/([A-Z])/g,"[a-z]*$1")); + } + else { // if query is all lower case make a normal case insensitive search + return new RegExp(escaped, "i"); + } +} + +// Filters all focused templates and packages. This function should be made less-blocking. +// @param query The string of the query +function textFilter() { + scheduler.clear("filter"); + + $('#tpl').html(''); + + var query = $("#textfilter input").attr("value") || ''; + var queryRegExp = compilePattern(query); + + var index = 0; + + var searchLoop = function () { + var packages = Index.keys(Index.PACKAGES).sort(); + + while (packages[index]) { + var pack = packages[index]; + var children = Index.PACKAGES[pack]; + index++; + + if (focusFilterState) { + if (pack == focusFilterState || + pack.indexOf(focusFilterState + '.') == 0) { + ; + } else { + continue; + } + } + + var matched = $.grep(children, function (child, i) { + return queryRegExp.test(child.name); + }); + + if (matched.length > 0) { + $('#tpl').append(Index.createPackageTree(pack, matched, + focusFilterState)); + scheduler.add('filter', searchLoop); + return; + } + } + + $('#tpl a.packfocus').click(function () { + focusFilter($(this).parent().parent()); + }); + configureHideFilter(); + }; + + scheduler.add('filter', searchLoop); +} + +/* Configures the hide tool by adding the hide link to all packages. */ +function configureHideFilter() { + $('#tpl li.pack a.packhide').click(function () { + var packhide = $(this) + var action = packhide.text(); + + var ol = $(this).parent().parent(); + + if (action == "hide") { + Index.hidePackage(ol); + packhide.text("show"); + } + else { + Index.showPackage(ol, kindFilterState); + packhide.text("hide"); + } + return false; + }); +} + +/* Configures the focus tool by adding the focus bar in the filter box (initially hidden), and by adding the focus + link to all packages. */ +function configureFocusFilter() { + scheduler.add("init", function() { + focusFilterState = null; + if ($("#focusfilter").length == 0) { + $("#filter").append("
    focused on
    "); + $("#focusfilter > .focusremove").click(function(event) { + textFilter(); + + $("#focusfilter").hide(); + $("#kindfilter").show(); + resizeFilterBlock(); + focusFilterState = null; + }); + $("#focusfilter").hide(); + resizeFilterBlock(); + } + }); + scheduler.add("init", function() { + $('#tpl li.pack a.packfocus').click(function () { + focusFilter($(this).parent()); + return false; + }); + }); +} + +/* Focuses the entity index on a specific package. To do so, it will copy the sub-templates and sub-packages of the + focuses package into the top-level templates and packages position of the index. The original top-level + @param package The
  • element that corresponds to the package in the entity index */ +function focusFilter(package) { + scheduler.clear("filter"); + + var currentFocus = $('li.pack > .tplshow', package).text(); + $("#focusfilter > .focuscoll").empty(); + $("#focusfilter > .focuscoll").append(currentFocus); + + $("#focusfilter").show(); + $("#kindfilter").hide(); + resizeFilterBlock(); + focusFilterState = currentFocus; + kindFilterSync(); + + textFilter(); +} + +function configureKindFilter() { + scheduler.add("init", function() { + kindFilterState = "all"; + $("#filter").append(""); + $("#kindfilter > a").click(function(event) { kindFilter("packs"); }); + resizeFilterBlock(); + }); +} + +function kindFilter(kind) { + if (kind == "packs") { + kindFilterState = "packs"; + kindFilterSync(); + $("#kindfilter > a").replaceWith("display all entities"); + $("#kindfilter > a").click(function(event) { kindFilter("all"); }); + } + else { + kindFilterState = "all"; + kindFilterSync(); + $("#kindfilter > a").replaceWith("display packages only"); + $("#kindfilter > a").click(function(event) { kindFilter("packs"); }); + } +} + +/* Applies the kind filter. */ +function kindFilterSync() { + if (kindFilterState == "all" || focusFilterState != null) { + $("#tpl a.packhide").text('hide'); + $("#tpl ol.templates").show(); + } else { + $("#tpl a.packhide").text('show'); + $("#tpl ol.templates").hide(); + } +} + +function resizeFilterBlock() { + $("#tpl").css("top", $("#filter").outerHeight(true)); +}