This file contains hidden or 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
Matrix = (function(){ | |
function id(){return this;} | |
function _set(idx,src){this[idx]=src;} | |
function _get(idx){return this[idx];} | |
Array.prototype.subarray = function(start,end){ | |
var j,row = {}; | |
for(j=0;start<end;j++,start++){ | |
Object.defineProperty(row,j,{ | |
set:_set.bind(this,start), |
This file contains hidden or 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
var DataView = (function(){ | |
var littleEndian = ( | |
(new Uint16Array((new Uint8Array([0x12, 0x34])).buffer)[0] === 0x3412) | |
?true:false); //Determine native endianness | |
function dv(buffer){ | |
this.buffer = buffer; | |
this.bytes = new Uint8Array(buffer); | |
} |
This file contains hidden or 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
if (!FileReader.prototype.readAsArrayBuffer) { | |
FileReader.prototype.readAsArrayBuffer = function readAsArrayBuffer () { | |
this.readAsBinaryString.apply(this, arguments); | |
this.__defineGetter__('resultString', this.__lookupGetter__('result')); | |
Object.defineProperty(this, 'result', { | |
get : function () { | |
var string = this.resultString, | |
result = new Uint8Array(string.length); | |
for (var i = 0; i < string.length; i++) { | |
result[i] = string.charCodeAt(i); |
NewerOlder