Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def transposeRowMatrix(m: RowMatrix): RowMatrix = { | |
val transposedRowsRDD = m.rows.zipWithIndex.map{case (row, rowIndex) => rowToTransposedTriplet(row, rowIndex)} | |
.flatMap(x => x) // now we have triplets (newRowIndex, (newColIndex, value)) | |
.groupByKey | |
.sortByKey().map(_._2) // sort rows and remove row indexes | |
.map(buildRow) // restore order of elements in each row and remove column indexes | |
new RowMatrix(transposedRowsRDD) | |
} | |
def rowToTransposedTriplet(row: Vector, rowIndex: Long): Array[(Long, (Long, Double))] = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="trans"> | |
Black scale: | |
<div class="main t1">lightest</div> | |
<div class="main t2">lighter</div> | |
<div class="main t3">light</div> | |
<div class="main t4">normal</div> | |
<div class="main t5">dark</div> | |
<div class="main t6">darker</div> | |
<div class="main t7">darkest</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fractalModule =function(stdlib){ | |
"use asm"; | |
var pow = stdlib.Math.pow; | |
var abs = stdlib.Math.abs; | |
var atan2 = stdlib.Math.atan2; | |
var cos = stdlib.Math.cos; | |
var sin = stdlib.Math.sin; | |
function mandlebrot(cx, cy, maxIter) { | |
cx = +cx; | |
cy = +cy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Running this scratchpad will open a Developer Tools window that's debugging | |
* the currently selected tab's toolbox. | |
*/ | |
Cu.import("resource:///modules/devtools/Target.jsm"); | |
let target = TargetFactory.forTab(gBrowser.selectedTab); | |
let toolboxToDebug = gDevTools.getToolbox(target); | |
let tbTarget = TargetFactory.forWindow(toolboxToDebug.frame.contentWindow); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "twitter" | |
require "json" | |
# things you must configure | |
TWITTER_USER = "your_username" | |
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted | |
# get these from dev.twitter.com | |
CONSUMER_KEY = "your_consumer_key" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
TODO: | |
- zoom level menu | |
- need to find a way to re-start the update | |
- add color tools | |
- integrate better in Firefox | |
- crosshair has a 1px offset | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* quantize.js Copyright 2008 Nick Rabinowitz. | |
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php | |
*/ | |
// fill out a couple protovis dependencies | |
/*! | |
* Block below copied from Protovis: http://mbostock.github.com/protovis/ | |
* Copyright 2010 Stanford Visualization Group | |
* Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php |