Skip to content

Instantly share code, notes, and snippets.

Jaswanth Sreeram jsreeram

Block or report user

Report or block jsreeram

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:39fba324be459fab0686
function ParallelInvoke(iterationSpace, obj, fn) {
/*....*/
}
// 2D convolve. input, filter & output are 2D (nested) arrays.
function Test(input, filter, output) {
let filterHalfWidth = (filter.length/2)-1
let inputHeight = input.length;
let inputWidth = input[0].length;
@jsreeram
jsreeram / drawvideo.js
Created Aug 21, 2012
Drawing a video to canvas
View drawvideo.js
// Draws a video element onto a 2D context
// output_canvas: A canvas element
// output_context: A 2D context on output_canvas
// video: A video element to draw
output_context.drawImage(video, 0, 0, output_canvas.width, output_canvas.height);
@jsreeram
jsreeram / PAConstructors.js
Created Aug 8, 2012
Parallel Array Constructors
View PAConstructors.js
// Create an empty Parallel Array
var pa0 = new ParallelArray();
// pa0 = <>
// Create a ParallelArray out of a nested JS array.
// Note that the inner arrays are also ParallelArrays
var pa1 = new ParallelArray([ [0,1], [2,3], [4,5] ]);
// pa1 = <<0,1>, <2,3>, <4.5>>
// Create a ParallelArray from another ParallelArray
You can’t perform that action at this time.