Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
(protected) r = this >> nDB
function bnpDRShiftTo(n,r) { for(var i = n; i < this.t; ++i) r[i-n] = this[i]; r.t = Math.max(this.t-n,0); r.s = this.s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get record() {\n return new B_Record(this.get_record_bin());\n }", "get db() {\n return this._db;\n }", "function SDB(state) {\n var stack = state.stack;\n var n = stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'SDB[]', n);\n }\n\n state.deltaBase = n;\n }", "constructor() {\n this.db = level(chainDB);\n }", "get dbRepresentation(){\n return Object.assign({}, this._obj);\n }", "constructor() { this.leerDB(); }", "getWalkedRecordCopy() {}", "function BasicQueryableMemoryDB() {\n MemoryDB.apply(this, arguments);\n}", "function SDB(state) {\n var stack = state.stack;\n var n = stack.pop();\n\n if (DEBUG) console.log(state.step, 'SDB[]', n);\n\n state.deltaBase = n;\n}", "function db_wrapper(idb) {\n\t\tObject.defineProperty(this, \"_db\", {\n\t\t\tconfigurable: false,\n\t\t\tenumerable: false,\n\t\t\twritable: false,\n\t\t\tvalue: idb,\n\t\t});\n\n\t\tstores.forEach(function (store) {\n\t\t\tObject.defineProperty(this, store, {\n\t\t\t\tconfigurable: false,\n\t\t\t\tenumerable: true,\n\t\t\t\twritable: false,\n\t\t\t\tvalue: new store_wrapper(store, idb),\n\t\t\t});\n\t\t}, this);\n\t}", "get data(){\r\n\t\treturn this.__data \r\n\t\t\t?? (this.__data = idb.createStore(this.__db__, this.__store__)) }", "function Br(t) {\n var e, n, r = qr(t.readTime), i = void 0 !== t.lastLimboFreeSnapshotVersion ? qr(t.lastLimboFreeSnapshotVersion) : B.min();\n return void 0 !== t.query.documents ? (O(1 === (n = t.query).documents.length), \n e = Zt(zt(Dn(n.documents[0])))) : e = function(t) {\n return Zt(Mn(t));\n }(t.query), new Rr(e, t.targetId, 0 /* Listen */ , t.lastListenSequenceNumber, r, i, X.fromBase64String(t.resumeToken))\n /** Encodes TargetData into a DbTarget for storage locally. */;\n}", "function SDB(state) {\n const stack = state.stack;\n const n = stack.pop();\n\n if (exports.DEBUG) console.log(state.step, 'SDB[]', n);\n\n state.deltaBase = n;\n}", "constructor(dbpf) {\n\t\tthis.dbpf = dbpf;\n\t\tthis.memRefs = new Set();\n\t\tfor (let { mem } of this.dbpf.memRefs()) {\n\t\t\tthis.memRefs.add(mem);\n\t\t}\n\t\tthis.$mem = 1;\n\t}", "db() { \n return new sqlite3.Database(this.db_file); \n }", "undo() {\n this.db._write(this.capture);\n return this.db;\n }", "constructor(db) {\n this.db = db;\n this.data = this.db.raw();\n this.capture = this.data;\n }", "function bR(){this.b=this.i=0;this.h=!1;this.buffer=null}", "getDatabase() {\n return this.__db;\n }", "setR(r) {\nthis._r = r;\nreturn this;\n}", "constructor() {\n this._r = null;\n this._d = 0;\n }", "readDbObject() {\n const obj = {};\n let numBytes = this.readUB4();\n if (numBytes > 0)\n obj.toid = Buffer.from(this.readBytesWithLength());\n numBytes = this.readUB4();\n if (numBytes > 0)\n obj.oid = Buffer.from(this.readBytesWithLength());\n numBytes = this.readUB4();\n if (numBytes > 0)\n obj.snapshot = Buffer.from(this.readBytesWithLength());\n this.skipUB2(); // version\n numBytes = this.readUB4();\n this.skipUB2(); // flags\n if (numBytes > 0)\n obj.packedData = Buffer.from(this.readBytesWithLength());\n return obj;\n }", "mapToDb() {\n return {\n fullName: this.fullName,\n username: this.username,\n password: this.password,\n rank: this.rank,\n branch: this.branch,\n permissions: this.permissions || [PERMISSIONS.SOLDIER],\n isArchived: this.isArchived\n };\n }", "function getDB() {\n return db;\n}", "constructor (db) {\n super(db);\n }", "constructor (db) {\n super(db);\n }", "static getDb (): any {\n return getDbInstance()\n }", "function di(t) {\n return Rr(t, dr.store);\n}", "function gen_op_iwmmxt_ldb_raw()\n{\n gen_opc_ptr.push({func:op_iwmmxt_ldb_raw});\n}", "get read() {\n return fbo1;\n }", "get base() {\n\t\treturn this.__base;\n\t}", "get me() {\n return this._db.me;\n }", "async raw() {\n // Call internally stored DB API to return models matching self query\n return await this._db.raw(this._Model, this);\n }", "get BitNumber() {\n return this._bitNumber;\n }", "function bnpRShiftTo(n, r) {\n\t var self = this\n\t r.s = self.s\n\t var ds = Math.floor(n / self.DB)\n\t if (ds >= self.t) {\n\t r.t = 0\n\t return\n\t }\n\t var bs = n % self.DB\n\t var cbs = self.DB - bs\n\t var bm = (1 << bs) - 1\n\t r[0] = self[ds] >> bs\n\t for (var i = ds + 1; i < self.t; ++i) {\n\t r[i - ds - 1] |= (self[i] & bm) << cbs\n\t r[i - ds] = self[i] >> bs\n\t }\n\t if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n\t r.t = self.t - ds\n\t r.clamp()\n\t}", "function bnpRShiftTo(n, r) {\n\t var self = this\n\t r.s = self.s\n\t var ds = Math.floor(n / self.DB)\n\t if (ds >= self.t) {\n\t r.t = 0\n\t return\n\t }\n\t var bs = n % self.DB\n\t var cbs = self.DB - bs\n\t var bm = (1 << bs) - 1\n\t r[0] = self[ds] >> bs\n\t for (var i = ds + 1; i < self.t; ++i) {\n\t r[i - ds - 1] |= (self[i] & bm) << cbs\n\t r[i - ds] = self[i] >> bs\n\t }\n\t if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n\t r.t = self.t - ds\n\t r.clamp()\n\t}", "function tdb(){this.k=0;this.q=[];this.o=[];this.D=this.G=this.j=this.C=this.J=this.B=0;this.K=[]}", "function getDb() {\n return db;\n }", "constructor(stmt, db) {\n this.stmt = stmt;\n this.db = db;\n this.pos = 1; // Index of the leftmost parameter is 1\n this.allocatedmem = []; // Pointers to allocated memory, that need to be freed when the statemend is destroyed\n }", "function bnpRShiftTo(n, r) {\r\n\t r.s = this.s;\r\n\t var ds = Math.floor(n / this.DB);\r\n\t if (ds >= this.t) {\r\n\t r.t = 0;\r\n\t return;\r\n\t }\r\n\t var bs = n % this.DB;\r\n\t var cbs = this.DB - bs;\r\n\t var bm = (1 << bs) - 1;\r\n\t r[0] = this[ds] >> bs;\r\n\t for (var i = ds + 1; i < this.t; ++i) {\r\n\t r[i - ds - 1] |= (this[i] & bm) << cbs;\r\n\t r[i - ds] = this[i] >> bs;\r\n\t }\r\n\t if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\r\n\t r.t = this.t - ds;\r\n\t r.clamp();\r\n\t}", "function bnpRShiftTo(n, r) {\r\n\t r.s = this.s;\r\n\t var ds = Math.floor(n / this.DB);\r\n\t if (ds >= this.t) {\r\n\t r.t = 0;\r\n\t return;\r\n\t }\r\n\t var bs = n % this.DB;\r\n\t var cbs = this.DB - bs;\r\n\t var bm = (1 << bs) - 1;\r\n\t r[0] = this[ds] >> bs;\r\n\t for (var i = ds + 1; i < this.t; ++i) {\r\n\t r[i - ds - 1] |= (this[i] & bm) << cbs;\r\n\t r[i - ds] = this[i] >> bs;\r\n\t }\r\n\t if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\r\n\t r.t = this.t - ds;\r\n\t r.clamp();\r\n\t}", "read() {\n return this.num;\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "getWalkedRecord() {}", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n/this.DB);\n\t if(ds >= this.t) { r.t = 0; return; }\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<bs)-1;\n\t r[0] = this[ds]>>bs;\n\t for(var i = ds+1; i < this.t; ++i) {\n\t r[i-ds-1] |= (this[i]&bm)<<cbs;\n\t r[i-ds] = this[i]>>bs;\n\t }\n\t if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n\t r.t = this.t-ds;\n\t r.clamp();\n\t}", "function Database() {\n var id = null;\n this.getId = function () {return id;};\n\n if (1 == arguments.length && arguments[0][rhoUtil.rhoIdParam()]) {\n if (moduleNS != arguments[0][rhoUtil.rhoClassParam()]) {\n throw \"Wrong class instantiation!\";\n }\n id = arguments[0][rhoUtil.rhoIdParam()];\n } else {\n id = rhoUtil.nextId();\n // constructor methods are following:\n \n }\n }", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function t(t, e, n, r, i, o) {\n this.settings = t, this.databaseId = e, this.R = n, this.ignoreUndefinedProperties = r, \n // Minor hack: If fieldTransforms is undefined, we assume this is an\n // external call and we need to validate the entire path.\n void 0 === i && this.Sc(), this.fieldTransforms = i || [], this.fieldMask = o || [];\n }", "function bnpRShiftTo(n, r) {\n var self = this;\n r.s = self.s;\n var ds = Math.floor(n / self.DB);\n if (ds >= self.t) {\n r.t = 0;\n return;\n }\n var bs = n % self.DB;\n var cbs = self.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = self[ds] >> bs;\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs;\n r[i - ds] = self[i] >> bs;\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs;\n r.t = self.t - ds;\n r.clamp();\n}", "function i(){this.expando=me.expando+i.uid++}", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "_getIndexDBImpl() {\n return window.openDatabase ? shimIndexedDB || indexedDB : indexedDB;\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) { r.t = 0; return; }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "get rootRef() {\n return this._db.ref();\n }", "function z(){r.call(this)}", "_OID() {\n return ++this.#lastOID;\n }", "getDBXrefs() {\n return this.dbxrefs;\n }", "get raw() { return this._raw; }", "get raw() { return this._raw; }", "_4thr(val) {\n this.__4thr = val;\n return this;\n }", "get msgDatabase() {\n if(!this._database) this.openDatabase();\n\t\treturn this._database;\n\t}", "function bnpRShiftTo(n,r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n/this.DB);\n\t if(ds >= this.t) { r.t = 0; return; }\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<bs)-1;\n\t r[0] = this[ds]>>bs;\n\t for(var i = ds+1; i < this.t; ++i) {\n\t r[i-ds-1] |= (this[i]&bm)<<cbs;\n\t r[i-ds] = this[i]>>bs;\n\t }\n\t if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n\t r.t = this.t-ds;\n\t r.clamp();\n\t }", "function bnpRShiftTo(n,r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n/this.DB);\n\t if(ds >= this.t) { r.t = 0; return; }\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<bs)-1;\n\t r.data[0] = this.data[ds]>>bs;\n\t for(var i = ds+1; i < this.t; ++i) {\n\t r.data[i-ds-1] |= (this.data[i]&bm)<<cbs;\n\t r.data[i-ds] = this.data[i]>>bs;\n\t }\n\t if(bs > 0) r.data[this.t-ds-1] |= (this.s&bm)<<cbs;\n\t r.t = this.t-ds;\n\t r.clamp();\n\t}", "function _dbEntry (h, m) {\n return {\n ipfsHash: h,\n metadata: m,\n }\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n}", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n}", "function bnpRShiftTo(n,r) {\n\tr.s = this.s;\n\tvar ds = Math.floor(n/this.DB);\n\tif(ds >= this.t) { r.t = 0; return; }\n\tvar bs = n%this.DB;\n\tvar cbs = this.DB-bs;\n\tvar bm = (1<<bs)-1;\n\tr[0] = this[ds]>>bs;\n\tfor(var i = ds+1; i < this.t; ++i) {\n\t r[i-ds-1] |= (this[i]&bm)<<cbs;\n\t r[i-ds] = this[i]>>bs;\n\t}\n\tif(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n\tr.t = this.t-ds;\n\tr.clamp();\n }", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "function AbstractChainedBatch (db) {\n this._db = db\n this._operations = []\n this._written = false\n}", "get value() {\n return this.i.r;\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }" ]
[ "0.5854444", "0.57315916", "0.5527455", "0.54902464", "0.5453797", "0.5433116", "0.541026", "0.53947645", "0.5382679", "0.5362607", "0.5358324", "0.53390104", "0.5283285", "0.5275703", "0.52659714", "0.52251416", "0.5208499", "0.5181765", "0.5149001", "0.51464134", "0.51279455", "0.5116519", "0.5111483", "0.5111385", "0.5101824", "0.5101824", "0.5030617", "0.5026883", "0.50077206", "0.49942714", "0.49791524", "0.4960732", "0.49514106", "0.49448454", "0.4940966", "0.4940966", "0.49330044", "0.49307546", "0.49198192", "0.49031785", "0.49031785", "0.4896443", "0.4885254", "0.4885254", "0.48843282", "0.4878014", "0.4878014", "0.4878014", "0.4874425", "0.48705244", "0.48702917", "0.48702917", "0.48702917", "0.48702917", "0.48702917", "0.48702917", "0.48702917", "0.4868389", "0.48683092", "0.48660237", "0.486155", "0.4859759", "0.48543322", "0.48525494", "0.48517448", "0.48509607", "0.4850352", "0.4849832", "0.4849832", "0.48466706", "0.48416194", "0.48407888", "0.4838078", "0.4831474", "0.48292413", "0.48292413", "0.4821636", "0.48191547", "0.48191547", "0.48191547", "0.48191547", "0.48191547", "0.48191547", "0.48191547", "0.48191547", "0.48191547", "0.48191547", "0.48191547", "0.48191547", "0.48191547", "0.48191547", "0.48191547", "0.48191547", "0.48154137", "0.48127875", "0.48127875", "0.48127875", "0.48127875", "0.48127875", "0.48127875", "0.48127875" ]
0.0
-1
(protected) r = this << n
function bnpLShiftTo(n,r) { var bs = n%this.DB; var cbs = this.DB-bs; var bm = (1<<cbs)-1; var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i; for(i = this.t-1; i >= 0; --i) { r[i+ds+1] = (this[i]>>cbs)|c; c = (this[i]&bm)<<bs; } for(i = ds-1; i >= 0; --i) r[i] = 0; r[ds] = c; r.t = this.t+ds+1; r.s = this.s; r.clamp(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "0x20(){return a << b}", "function rotr(x, n) {\n return x << (32 - n) | x >>> n;\n}", "function bnpRShiftTo(n, r) {\n\t var self = this\n\t r.s = self.s\n\t var ds = Math.floor(n / self.DB)\n\t if (ds >= self.t) {\n\t r.t = 0\n\t return\n\t }\n\t var bs = n % self.DB\n\t var cbs = self.DB - bs\n\t var bm = (1 << bs) - 1\n\t r[0] = self[ds] >> bs\n\t for (var i = ds + 1; i < self.t; ++i) {\n\t r[i - ds - 1] |= (self[i] & bm) << cbs\n\t r[i - ds] = self[i] >> bs\n\t }\n\t if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n\t r.t = self.t - ds\n\t r.clamp()\n\t}", "function bnpRShiftTo(n, r) {\n\t var self = this\n\t r.s = self.s\n\t var ds = Math.floor(n / self.DB)\n\t if (ds >= self.t) {\n\t r.t = 0\n\t return\n\t }\n\t var bs = n % self.DB\n\t var cbs = self.DB - bs\n\t var bm = (1 << bs) - 1\n\t r[0] = self[ds] >> bs\n\t for (var i = ds + 1; i < self.t; ++i) {\n\t r[i - ds - 1] |= (self[i] & bm) << cbs\n\t r[i - ds] = self[i] >> bs\n\t }\n\t if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n\t r.t = self.t - ds\n\t r.clamp()\n\t}", "function rotl(x, n) {\n return x << n | x >>> (32 - n);\n}", "function rotl(x, n) {\n return (x << n) | (x >>> (32 - n));\n}", "function rotl( x, n ) {\n return ( x >>> ( 32 - n ) ) | ( x << n );\n }", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n,r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n/this._DB);\n\t if(ds >= this.t) { r.t = 0; return; }\n\t var bs = n%this._DB;\n\t var cbs = this._DB-bs;\n\t var bm = (1<<bs)-1;\n\t r[0] = this[ds]>>bs;\n\t for(var i = ds+1; i < this.t; ++i) {\n\t\tr[i-ds-1] |= (this[i]&bm)<<cbs;\n\t\tr[i-ds] = this[i]>>bs;\n\t }\n\t if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n\t r.t = this.t-ds;\n\t r._clamp();\n\t}", "function bnpRShiftTo(n, r) {\n var self = this;\n r.s = self.s;\n var ds = Math.floor(n / self.DB);\n if (ds >= self.t) {\n r.t = 0;\n return;\n }\n var bs = n % self.DB;\n var cbs = self.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = self[ds] >> bs;\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs;\n r[i - ds] = self[i] >> bs;\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs;\n r.t = self.t - ds;\n r.clamp();\n}", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) { r.t = 0; return; }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n\tr.s = this.s;\n\tvar ds = Math.floor(n/this.DB);\n\tif(ds >= this.t) { r.t = 0; return; }\n\tvar bs = n%this.DB;\n\tvar cbs = this.DB-bs;\n\tvar bm = (1<<bs)-1;\n\tr[0] = this[ds]>>bs;\n\tfor(var i = ds+1; i < this.t; ++i) {\n\t r[i-ds-1] |= (this[i]&bm)<<cbs;\n\t r[i-ds] = this[i]>>bs;\n\t}\n\tif(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n\tr.t = this.t-ds;\n\tr.clamp();\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function rotl(x, n) {\n return (x >>> (32 - n)) | (x << n);\n}", "function bnpRShiftTo(n, r) {\r\n\t r.s = this.s;\r\n\t var ds = Math.floor(n / this.DB);\r\n\t if (ds >= this.t) {\r\n\t r.t = 0;\r\n\t return;\r\n\t }\r\n\t var bs = n % this.DB;\r\n\t var cbs = this.DB - bs;\r\n\t var bm = (1 << bs) - 1;\r\n\t r[0] = this[ds] >> bs;\r\n\t for (var i = ds + 1; i < this.t; ++i) {\r\n\t r[i - ds - 1] |= (this[i] & bm) << cbs;\r\n\t r[i - ds] = this[i] >> bs;\r\n\t }\r\n\t if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\r\n\t r.t = this.t - ds;\r\n\t r.clamp();\r\n\t}", "function bnpRShiftTo(n, r) {\r\n\t r.s = this.s;\r\n\t var ds = Math.floor(n / this.DB);\r\n\t if (ds >= this.t) {\r\n\t r.t = 0;\r\n\t return;\r\n\t }\r\n\t var bs = n % this.DB;\r\n\t var cbs = this.DB - bs;\r\n\t var bm = (1 << bs) - 1;\r\n\t r[0] = this[ds] >> bs;\r\n\t for (var i = ds + 1; i < this.t; ++i) {\r\n\t r[i - ds - 1] |= (this[i] & bm) << cbs;\r\n\t r[i - ds] = this[i] >> bs;\r\n\t }\r\n\t if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\r\n\t r.t = this.t - ds;\r\n\t r.clamp();\r\n\t}", "function bnpRShiftTo(n,r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n/this.DB);\n\t if(ds >= this.t) { r.t = 0; return; }\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<bs)-1;\n\t r[0] = this[ds]>>bs;\n\t for(var i = ds+1; i < this.t; ++i) {\n\t r[i-ds-1] |= (this[i]&bm)<<cbs;\n\t r[i-ds] = this[i]>>bs;\n\t }\n\t if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n\t r.t = this.t-ds;\n\t r.clamp();\n\t}", "function bnpRShiftTo(n,r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n/this.DB);\n\t if(ds >= this.t) { r.t = 0; return; }\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<bs)-1;\n\t r[0] = this[ds]>>bs;\n\t for(var i = ds+1; i < this.t; ++i) {\n\t r[i-ds-1] |= (this[i]&bm)<<cbs;\n\t r[i-ds] = this[i]>>bs;\n\t }\n\t if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n\t r.t = this.t-ds;\n\t r.clamp();\n\t }", "function bnpRShiftTo(n, r)\n{\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t)\n {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i)\n {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n}", "function bnpRShiftTo(n,r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n/this.DB);\n\t if(ds >= this.t) { r.t = 0; return; }\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<bs)-1;\n\t r[0] = this[ds]>>bs;\n\t for(var i = ds+1; i < this.t; ++i) {\n\t r[i-ds-1] |= (this[i]&bm)<<cbs;\n\t r[i-ds] = this[i]>>bs;\n\t }\n\t if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n\t r.t = this.t-ds;\n\t r.clamp();\n\t }", "function bnpRShiftTo(n,r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n/this.DB);\n\t if(ds >= this.t) { r.t = 0; return; }\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<bs)-1;\n\t r[0] = this[ds]>>bs;\n\t for(var i = ds+1; i < this.t; ++i) {\n\t r[i-ds-1] |= (this[i]&bm)<<cbs;\n\t r[i-ds] = this[i]>>bs;\n\t }\n\t if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n\t r.t = this.t-ds;\n\t r.clamp();\n\t }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n}", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n}", "function bnShiftRight(n) {\n var r = new BigInteger()\n if (n < 0) this.lShiftTo(-n, r)\n else this.rShiftTo(n, r)\n return r\n}", "function bnShiftRight(n) {\n var r = new BigInteger()\n if (n < 0) this.lShiftTo(-n, r)\n else this.rShiftTo(n, r)\n return r\n}", "function bnShiftRight(n) {\n var r = new BigInteger()\n if (n < 0) this.lShiftTo(-n, r)\n else this.rShiftTo(n, r)\n return r\n}", "function bnShiftRight(n) {\n var r = new BigInteger()\n if (n < 0) this.lShiftTo(-n, r)\n else this.rShiftTo(n, r)\n return r\n}", "function bnShiftRight(n) {\n var r = new BigInteger()\n if (n < 0) this.lShiftTo(-n, r)\n else this.rShiftTo(n, r)\n return r\n}", "function bnShiftRight(n) {\n var r = new BigInteger()\n if (n < 0) this.lShiftTo(-n, r)\n else this.rShiftTo(n, r)\n return r\n}", "function bnShiftRight(n) {\n var r = new BigInteger()\n if (n < 0) this.lShiftTo(-n, r)\n else this.rShiftTo(n, r)\n return r\n}", "function bnShiftRight(n) {\n\t var r = new BigInteger()\n\t if (n < 0) this.lShiftTo(-n, r)\n\t else this.rShiftTo(n, r)\n\t return r\n\t}", "function bnShiftRight(n) {\n\t var r = new BigInteger()\n\t if (n < 0) this.lShiftTo(-n, r)\n\t else this.rShiftTo(n, r)\n\t return r\n\t}", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n}", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n}", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n}", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n}", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n}", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n}" ]
[ "0.6666154", "0.65684676", "0.6520716", "0.6520716", "0.6455233", "0.6428054", "0.642265", "0.6422008", "0.6422008", "0.6422008", "0.6422008", "0.6422008", "0.6422008", "0.6422008", "0.6385195", "0.63797104", "0.63715786", "0.63637096", "0.63637096", "0.63637096", "0.6348662", "0.63475615", "0.63475615", "0.634626", "0.6342702", "0.6338675", "0.6338675", "0.63281167", "0.6317938", "0.6295894", "0.6278185", "0.6278185", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6277157", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.6274444", "0.62678516", "0.62678516", "0.62482184", "0.62482184", "0.62482184", "0.62482184", "0.62482184", "0.62482184", "0.62482184", "0.6247353", "0.6247353", "0.6203031", "0.6203031", "0.6203031", "0.6203031", "0.6203031", "0.6203031" ]
0.0
-1
(protected) r = this >> n
function bnpRShiftTo(n,r) { r.s = this.s; var ds = Math.floor(n/this.DB); if(ds >= this.t) { r.t = 0; return; } var bs = n%this.DB; var cbs = this.DB-bs; var bm = (1<<bs)-1; r[0] = this[ds]>>bs; for(var i = ds+1; i < this.t; ++i) { r[i-ds-1] |= (this[i]&bm)<<cbs; r[i-ds] = this[i]>>bs; } if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs; r.t = this.t-ds; r.clamp(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rotr(x, n) {\n return x << (32 - n) | x >>> n;\n}", "function rotl(x, n) {\n return x << n | x >>> (32 - n);\n}", "function rotl(x, n) {\n return (x << n) | (x >>> (32 - n));\n}", "function rotl( x, n ) {\n return ( x >>> ( 32 - n ) ) | ( x << n );\n }", "function rotl(x, n) {\n return (x >>> (32 - n)) | (x << n);\n}", "function bnpRShiftTo(n, r) {\n\t var self = this\n\t r.s = self.s\n\t var ds = Math.floor(n / self.DB)\n\t if (ds >= self.t) {\n\t r.t = 0\n\t return\n\t }\n\t var bs = n % self.DB\n\t var cbs = self.DB - bs\n\t var bm = (1 << bs) - 1\n\t r[0] = self[ds] >> bs\n\t for (var i = ds + 1; i < self.t; ++i) {\n\t r[i - ds - 1] |= (self[i] & bm) << cbs\n\t r[i - ds] = self[i] >> bs\n\t }\n\t if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n\t r.t = self.t - ds\n\t r.clamp()\n\t}", "function bnpRShiftTo(n, r) {\n\t var self = this\n\t r.s = self.s\n\t var ds = Math.floor(n / self.DB)\n\t if (ds >= self.t) {\n\t r.t = 0\n\t return\n\t }\n\t var bs = n % self.DB\n\t var cbs = self.DB - bs\n\t var bm = (1 << bs) - 1\n\t r[0] = self[ds] >> bs\n\t for (var i = ds + 1; i < self.t; ++i) {\n\t r[i - ds - 1] |= (self[i] & bm) << cbs\n\t r[i - ds] = self[i] >> bs\n\t }\n\t if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n\t r.t = self.t - ds\n\t r.clamp()\n\t}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this\n r.s = self.s\n var ds = Math.floor(n / self.DB)\n if (ds >= self.t) {\n r.t = 0\n return\n }\n var bs = n % self.DB\n var cbs = self.DB - bs\n var bm = (1 << bs) - 1\n r[0] = self[ds] >> bs\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs\n r[i - ds] = self[i] >> bs\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n r.t = self.t - ds\n r.clamp()\n}", "function bnpRShiftTo(n, r) {\n var self = this;\n r.s = self.s;\n var ds = Math.floor(n / self.DB);\n if (ds >= self.t) {\n r.t = 0;\n return;\n }\n var bs = n % self.DB;\n var cbs = self.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = self[ds] >> bs;\n for (var i = ds + 1; i < self.t; ++i) {\n r[i - ds - 1] |= (self[i] & bm) << cbs;\n r[i - ds] = self[i] >> bs;\n }\n if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs;\n r.t = self.t - ds;\n r.clamp();\n}", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) { r.t = 0; return; }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n/this._DB);\n\t if(ds >= this.t) { r.t = 0; return; }\n\t var bs = n%this._DB;\n\t var cbs = this._DB-bs;\n\t var bm = (1<<bs)-1;\n\t r[0] = this[ds]>>bs;\n\t for(var i = ds+1; i < this.t; ++i) {\n\t\tr[i-ds-1] |= (this[i]&bm)<<cbs;\n\t\tr[i-ds] = this[i]>>bs;\n\t }\n\t if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n\t r.t = this.t-ds;\n\t r._clamp();\n\t}", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n }", "function bnpRShiftTo(n, r) {\r\n\t r.s = this.s;\r\n\t var ds = Math.floor(n / this.DB);\r\n\t if (ds >= this.t) {\r\n\t r.t = 0;\r\n\t return;\r\n\t }\r\n\t var bs = n % this.DB;\r\n\t var cbs = this.DB - bs;\r\n\t var bm = (1 << bs) - 1;\r\n\t r[0] = this[ds] >> bs;\r\n\t for (var i = ds + 1; i < this.t; ++i) {\r\n\t r[i - ds - 1] |= (this[i] & bm) << cbs;\r\n\t r[i - ds] = this[i] >> bs;\r\n\t }\r\n\t if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\r\n\t r.t = this.t - ds;\r\n\t r.clamp();\r\n\t}", "function bnpRShiftTo(n, r) {\r\n\t r.s = this.s;\r\n\t var ds = Math.floor(n / this.DB);\r\n\t if (ds >= this.t) {\r\n\t r.t = 0;\r\n\t return;\r\n\t }\r\n\t var bs = n % this.DB;\r\n\t var cbs = this.DB - bs;\r\n\t var bm = (1 << bs) - 1;\r\n\t r[0] = this[ds] >> bs;\r\n\t for (var i = ds + 1; i < this.t; ++i) {\r\n\t r[i - ds - 1] |= (this[i] & bm) << cbs;\r\n\t r[i - ds] = this[i] >> bs;\r\n\t }\r\n\t if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\r\n\t r.t = this.t - ds;\r\n\t r.clamp();\r\n\t}", "function bnpRShiftTo(n,r) {\n\tr.s = this.s;\n\tvar ds = Math.floor(n/this.DB);\n\tif(ds >= this.t) { r.t = 0; return; }\n\tvar bs = n%this.DB;\n\tvar cbs = this.DB-bs;\n\tvar bm = (1<<bs)-1;\n\tr[0] = this[ds]>>bs;\n\tfor(var i = ds+1; i < this.t; ++i) {\n\t r[i-ds-1] |= (this[i]&bm)<<cbs;\n\t r[i-ds] = this[i]>>bs;\n\t}\n\tif(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n\tr.t = this.t-ds;\n\tr.clamp();\n }", "function bnpRShiftTo(n, r)\n{\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t)\n {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i)\n {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n}", "function bnpRShiftTo(n,r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n/this.DB);\n\t if(ds >= this.t) { r.t = 0; return; }\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<bs)-1;\n\t r[0] = this[ds]>>bs;\n\t for(var i = ds+1; i < this.t; ++i) {\n\t r[i-ds-1] |= (this[i]&bm)<<cbs;\n\t r[i-ds] = this[i]>>bs;\n\t }\n\t if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n\t r.t = this.t-ds;\n\t r.clamp();\n\t}", "function bnpRShiftTo(n,r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n/this.DB);\n\t if(ds >= this.t) { r.t = 0; return; }\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<bs)-1;\n\t r[0] = this[ds]>>bs;\n\t for(var i = ds+1; i < this.t; ++i) {\n\t r[i-ds-1] |= (this[i]&bm)<<cbs;\n\t r[i-ds] = this[i]>>bs;\n\t }\n\t if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n\t r.t = this.t-ds;\n\t r.clamp();\n\t }", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n}", "function bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n}", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<<bs)-1;\n r[0] = this[ds]>>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<<cbs;\n r[i-ds] = this[i]>>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n r.t = this.t-ds;\n r.clamp();\n }", "function bnpRShiftTo(n,r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n/this.DB);\n\t if(ds >= this.t) { r.t = 0; return; }\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<bs)-1;\n\t r[0] = this[ds]>>bs;\n\t for(var i = ds+1; i < this.t; ++i) {\n\t r[i-ds-1] |= (this[i]&bm)<<cbs;\n\t r[i-ds] = this[i]>>bs;\n\t }\n\t if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n\t r.t = this.t-ds;\n\t r.clamp();\n\t }", "function bnpRShiftTo(n,r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n/this.DB);\n\t if(ds >= this.t) { r.t = 0; return; }\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<<bs)-1;\n\t r[0] = this[ds]>>bs;\n\t for(var i = ds+1; i < this.t; ++i) {\n\t r[i-ds-1] |= (this[i]&bm)<<cbs;\n\t r[i-ds] = this[i]>>bs;\n\t }\n\t if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;\n\t r.t = this.t-ds;\n\t r.clamp();\n\t }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }", "function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }" ]
[ "0.6944473", "0.6758659", "0.67397445", "0.67136276", "0.66858965", "0.6510775", "0.6510775", "0.6424868", "0.6424868", "0.6424868", "0.6424868", "0.6424868", "0.6424868", "0.6424868", "0.63862187", "0.635912", "0.6358895", "0.6358895", "0.6358895", "0.6343444", "0.6343444", "0.6336766", "0.63356197", "0.63215387", "0.63215387", "0.6294286", "0.6285784", "0.6278292", "0.62687385", "0.62619054", "0.62619054", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.62322474", "0.6210973", "0.6210973", "0.6204716", "0.6204716", "0.6204716", "0.6204716", "0.6204716", "0.6204716", "0.6204716", "0.6204716", "0.6204716", "0.6204716", "0.6204716", "0.6204716", "0.6204716", "0.6204716", "0.6204716", "0.6204716" ]
0.6228594
77
(protected) r = this a
function bnpSubTo(a,r) { var i = 0, c = 0, m = Math.min(a.t,this.t); while(i < m) { c += this[i]-a[i]; r[i++] = c&this.DM; c >>= this.DB; } if(a.t < this.t) { c -= a.s; while(i < this.t) { c += this[i]; r[i++] = c&this.DM; c >>= this.DB; } c += this.s; } else { c += this.s; while(i < a.t) { c -= a[i]; r[i++] = c&this.DM; c >>= this.DB; } c -= a.s; } r.s = (c<0)?-1:0; if(c < -1) r[i++] = this.DV+c; else if(c > 0) r[i++] = c; r.t = i; r.clamp(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function A() {\n r.call(this);\n }", "function z(){r.call(this)}", "get a() {\n\t\treturn this._a_;\n\t}", "get a() {\n\t\treturn this._a_;\n\t}", "get a() {\n return this._a_;\n }", "setR(r) {\nthis._r = r;\nreturn this;\n}", "ap(r) {\n return ap(this, r);\n }", "ap(r) {\n return ap(this, r);\n }", "ap (_) { \n return this\n }", "function M(){this.a={}}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function w(){this.a={}}", "function ri(a){ri.k.constructor.call(this,a);this.Uc()}", "function Re(a){Re.Z.constructor.call(this,null);this.Zv=a}", "function G(){r.call(this)}", "function G(){r.call(this)}", "function r() {}", "function r() {}", "function r() {}", "function Q(){this.a={}}", "function Q(){this.a={}}", "function Q(){this.a={}}", "function o(e){return void 0===e&&(e=null),Object(r[\"r\"])(null!==e?e:a)}", "function fe(a){this.ra=a}", "function x(){this.a={}}", "function x(){this.a={}}", "function x(){this.a={}}", "function ie(a){this.ra=a}", "function r(A,e){0}", "function K(){this.a={}}", "function a$c(r,s)\n{\n this.a$a = r;\n this.a$b = s; \n return this;\n}", "function a$c(r,s)\n{\n this.a$a = r;\n this.a$b = s; \n return this;\n}", "function _a(e,t,n,i){Ca.call(this,e,t,n,i)}", "rot() {\nreturn this._r;\n}", "function a(A,e){if(!A)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?A:e}", "function f(){\n return this.a;\n}", "function R(e,t,a){if(void 0===a&&(a=null),!(this instanceof R))return new R(e,t,a);this.line=e,this.ch=t,this.sticky=a}", "constructor(r, g, b, a) {\n if (a == null) a = 1;\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n }", "set R(value) {\n this._r = value;\n }", "function A() {\n\t\tt.call(this)\n\t}", "function a(e){return void 0===e&&(e=null),Object(r[\"m\"])(null!==e?e:o)}", "function foo(a) {\n\tthis.a = a;\n}", "function L(){A.call(this)}", "function L(){A.call(this)}", "function L(){A.call(this)}", "function Ra(a) {\n\t\tthis.qa = \"\\u2008\";\n\t\tthis.fa = new RegExp(this.qa);\n\t\tthis.ga = \"\";\n\t\tthis.q = new r;\n\t\tthis.v = \"\";\n\t\tthis.k = new r;\n\t\tthis.u = new r;\n\t\tthis.m = !0;\n\t\tthis.aa = this.s = this.ka = !1;\n\t\tthis.oa = M.r();\n\t\tthis.t = 0;\n\t\tthis.d = new r;\n\t\tthis.ea = !1;\n\t\tthis.o = \"\";\n\t\tthis.b = new r;\n\t\tthis.h = [];\n\t\tthis.ha = a;\n\t\tthis.va = this.i = Sa(this, this.ha)\n\t}", "function oi(a){this.Of=a;this.rg=\"\"}", "function Rp(a,b){this.i=[];this.D=a;this.L=b||null;this.g=this.a=!1;this.c=void 0;this.s=this.w=this.j=!1;this.h=0;this.b=null;this.l=0}", "function Rb(a,b,c){this.a=a;this.b=b||1;this.f=c||1}", "set a(val) {\n this._a_ = val * 2;\n }", "function a(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}", "function a(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}", "function a(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!==typeof e&&\"function\"!==typeof e?t:e}", "function a(t,e){function a(){}a.prototype=e.prototype,t.superClass_=e.prototype,t.prototype=new a,t.prototype.constructor=t}", "function Ci(a){this.o=a}", "function Y(){var e=a();return this.copyTo(e),e}", "set a(val) {\n\t\tthis._a_ = val * 2;\n\t}", "set a(val) {\n\t\tthis._a_ = val * 2;\n\t}", "function ai(a) {\n this.m = a\n}", "function Ag(){this.b=null;this.a=[]}", "function sb(a){this.b=a}", "function R(e,t){function n(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "function bR(){this.b=this.i=0;this.h=!1;this.buffer=null}", "function r(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}", "function re(a,b){this.O=[];this.za=a;this.la=b||null;this.J=this.D=!1;this.H=void 0;this.ha=this.Fa=this.S=!1;this.R=0;this.Ef=null;this.N=0}", "function a(e){return void 0===e&&(e=null),Object(r[\"p\"])(null!==e?e:i)}", "function Aa(e,t,n,i){xa.call(this,e,t,n,i)}", "function foo(a) {\n this.a = a;\n}", "function a(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}", "function a(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}", "function a(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}", "function o(e,t){return r.call(e,t)}", "setTR(t, r) {\nthis._t = t;\nthis._r = r;\nreturn this;\n}", "set(r, g, b, a) {\n return this.copyFromFloats(r, g, b, a);\n }", "function G(){var t=a();return this.copyTo(t),t}", "rotate(a) {\n return new Point({\n a: a + this.a,\n d: this.d\n })\n }", "function me(a){me.m.constructor.call(this,a);ke(this)}", "function ai(t) {\n return Rr(t, sr.store);\n}", "function ea(){}", "constructor(_t, _r) {\nthis._t = _t;\nthis._r = _r;\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n console.log(this.a);\n}", "function foo() {\n console.log(this.a);\n}" ]
[ "0.7887505", "0.6961472", "0.6889745", "0.6889745", "0.6741326", "0.67147154", "0.6645265", "0.6645265", "0.65065205", "0.64600086", "0.6406615", "0.6406615", "0.6406615", "0.6406615", "0.6406615", "0.6406615", "0.6406615", "0.6406615", "0.6406615", "0.6406615", "0.6406615", "0.6406615", "0.6406615", "0.6362011", "0.63535357", "0.63009983", "0.6269889", "0.6269889", "0.6222915", "0.6222915", "0.6222915", "0.61886454", "0.61886454", "0.61886454", "0.61634374", "0.6148378", "0.61472", "0.61472", "0.61472", "0.6121606", "0.6097051", "0.6062445", "0.6030064", "0.6030064", "0.6023928", "0.60178953", "0.6008954", "0.5986889", "0.59847885", "0.5962854", "0.5956265", "0.59545076", "0.5938005", "0.5928743", "0.59116024", "0.59116024", "0.59116024", "0.5897284", "0.5867451", "0.58349645", "0.5822495", "0.5821981", "0.5820369", "0.5820369", "0.58139426", "0.57911843", "0.5780204", "0.577017", "0.5743177", "0.5743177", "0.5729628", "0.5728801", "0.5723927", "0.5712686", "0.5698198", "0.5693749", "0.5693367", "0.5687383", "0.56768256", "0.56682545", "0.56674796", "0.56674796", "0.56674796", "0.56588113", "0.56583756", "0.5651455", "0.56461734", "0.5632669", "0.5603203", "0.56001955", "0.55990386", "0.5597217", "0.55958354", "0.55958354", "0.55958354", "0.55958354", "0.55958354", "0.55958354", "0.55958354", "0.559529", "0.559529" ]
0.0
-1
(protected) r = this a, r != this,a (HAC 14.12) "this" should be the larger one if appropriate.
function bnpMultiplyTo(a,r) { var x = this.abs(), y = a.abs(); var i = x.t; r.t = i+y.t; while(--i >= 0) r[i] = 0; for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t); r.s = 0; r.clamp(); if(this.s != a.s) BigInteger.ZERO.subTo(r,r); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function self($this) {\n\treturn $this;\n}", "subUnsafe(other) { return this.#sub(other); }", "function z(){r.call(this)}", "setR(r) {\nthis._r = r;\nreturn this;\n}", "function Y(){var e=a();return this.copyTo(e),e}", "function G(){var t=a();return this.copyTo(t),t}", "function f() { \"use strict\"; return this;}", "function Nothing$prototype$ap(other) {\n return this;\n }", "function A() {\n r.call(this);\n }", "function bR(){this.b=this.i=0;this.h=!1;this.buffer=null}", "get and() { return this; }", "get and() { return this; }", "function whatIsThis() {\n return this;\n}", "function whatIsThis() {\n return this;\n}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function r(t){return void 0===t||null===t}", "function Function$prototype$equals(other) {\n return other === this;\n }", "function Function$prototype$equals(other) {\n return other === this;\n }", "function x(){this.a={}}", "function x(){this.a={}}", "function x(){this.a={}}", "function vb(a,b){this.b=[];this.r=b||null}", "shift() {\n let ret = this[0];\n for (let i = 0; i < __classPrivateFieldGet(this, _length); ++i)\n this[i] = this[i + 1];\n delete this[__classPrivateFieldSet(this, _length, +__classPrivateFieldGet(this, _length) - 1)];\n return ret;\n }", "function M(){this.a={}}", "function A(t){return void 0===t||null===t}", "function Nothing$prototype$alt(other) {\n return other;\n }", "function a(e){return void 0===e&&(e=null),Object(r[\"m\"])(null!==e?e:o)}", "function w(){this.a={}}", "copyFrom(source) {\n this.r = source.r;\n this.g = source.g;\n this.b = source.b;\n this.a = source.a;\n return this;\n }", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function Rp(a,b){this.i=[];this.D=a;this.L=b||null;this.g=this.a=!1;this.c=void 0;this.s=this.w=this.j=!1;this.h=0;this.b=null;this.l=0}", "function f2() {\n 'use strict'; // see strict mode\n return this;\n}", "function maintain_this_binding(parent, orig, val) {\n if (parent instanceof AST_UnaryPrefix && parent.operator == \"delete\"\n || parent instanceof AST_Call && parent.expression === orig\n && (val instanceof AST_PropAccess || val instanceof AST_SymbolRef && val.name == \"eval\")) {\n return make_node(AST_Seq, orig, {\n car: make_node(AST_Number, orig, {\n value: 0\n }),\n cdr: val\n });\n }\n return val;\n }", "function whatisthis() {\n return this;\n }", "ThisExpression(node) {\n const current = stack.getCurrent();\n\n if (current && !current.valid) {\n context.report({ node, message: \"Unexpected 'this'.\" });\n }\n }", "function G(){r.call(this)}", "function G(){r.call(this)}", "function o(e){return void 0===e&&(e=null),Object(r[\"r\"])(null!==e?e:a)}", "function $g(){this.b=null;this.a=[]}", "addUnsafe(other) { return this.#add(other); }", "SameSide() {}", "rot() {\nreturn this._r;\n}", "function UnderTheHood(a, b) {\n this.a = a;\n this.b = b;\n return this;\n}", "function f(){\n return this.a;\n}", "function K(){this.a={}}", "ap (_) { \n return this\n }", "function ft(){var t=b();return this.copyTo(t),t}", "setTR(t, r) {\nthis._t = t;\nthis._r = r;\nreturn this;\n}", "function f1() {\r\n return this;\r\n }", "function L(){A.call(this)}", "function L(){A.call(this)}", "function L(){A.call(this)}", "function r(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}", "function z(){var t=s();return this.copyTo(t),t}", "function Re(a){Re.Z.constructor.call(this,null);this.Zv=a}", "function R(e,t){function n(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "eq(other) { return this == other; }", "function t(a){return void 0===a||null===a}", "function f2() {\n \"use strict\"\n return this === undefined\n}", "copy() {\n return new this.constructor(\n this.power,\n this.value,\n (this.next != null) ? this.next.copy() : null,\n );\n }", "function e(A){return void 0===A||null===A}", "function qwe(){\n // \"this\" is different here too!\n console.log(this); // not what we wanted!\n }", "function InterfaceThis() {\n this.a = 12;\n}", "function get_self(x) {\r\n return x;\r\n}", "function gc(a,b){this.re=[];this.tg=a;this.cg=b||null;this.bd=this.Wb=!1;this.Pb=void 0;this.Cf=this.Rg=this.Ie=!1;this.ve=0;this.eb=null;this.Je=0}", "function same (a, b) {\n\t return a === b || a !== a && b !== b\n\t}", "function Rb(a,b,c){this.a=a;this.b=b||1;this.f=c||1}", "function explainTheValueOfThis() {\n let obj, method;\n\n obj = {\n go: function () { alert(this); console.log(this); }\n };\n\n obj.go(); // (1) [object Object] // 'this' points to the object obj\n\n (obj.go)(); // (2) [object Object] // 'this' points to the object obj\n\n (method = obj.go)(); // (3) undefined // If 'use strict', 'this' is undefined. If not 'use strict' 'this' points to the global object (window)\n\n (obj.go || obj.stop)(); // (4) undefined // If 'use strict', 'this' is undefined. If not 'use strict' 'this' points to the global object (window)\n}", "function this_in_strict() {\n log(this)\n}", "function obj() { return this; }", "transient protected internal function m189() {}", "function qwe(){\n // \"this\" is different here too! --- but we don't care!\n console.log(abc); // it is the right object here too!\n }", "function sb(a){this.b=a}", "get other() {\n\t\treturn this.__other;\n\t}", "function Q(){this.a={}}", "function Q(){this.a={}}", "function Q(){this.a={}}", "function T1a(a,b){if(w(a,b))return!0;if(!a||!b||Vp(a)!=Vp(b))return!1;a=a.a.gg();for(var c=0;c<a.length;c++)if(!b.U(a[c]))return!1;return!0}", "function i(t){return void 0===t&&(t=null),Object(r[\"l\"])(null!==t?t:o)}" ]
[ "0.6002266", "0.58763033", "0.56839097", "0.56422764", "0.5565282", "0.5562465", "0.5532877", "0.55160415", "0.5507149", "0.54126394", "0.53935885", "0.53935885", "0.5385262", "0.5385262", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.5344674", "0.534283", "0.534283", "0.53402346", "0.53402346", "0.53402346", "0.5336255", "0.5328292", "0.53256285", "0.53038037", "0.5279931", "0.52724785", "0.5270451", "0.52690494", "0.5259498", "0.5259498", "0.5259498", "0.5259498", "0.5259498", "0.5259498", "0.5259416", "0.5236702", "0.52342474", "0.5233982", "0.5230669", "0.52296156", "0.52296156", "0.5223793", "0.52168196", "0.52062184", "0.5200576", "0.5191846", "0.51815", "0.51413715", "0.51363975", "0.5120102", "0.5113952", "0.51064336", "0.5103457", "0.50994664", "0.50994664", "0.50994664", "0.5092531", "0.5085079", "0.5082612", "0.5076123", "0.50729924", "0.5067836", "0.5064601", "0.5060983", "0.50487715", "0.5045822", "0.50439894", "0.50322556", "0.5031399", "0.5028653", "0.5023183", "0.5018769", "0.50108993", "0.50016457", "0.5000791", "0.4994197", "0.49927282", "0.49853656", "0.4980021", "0.4980021", "0.4980021", "0.49795157", "0.49729124" ]
0.0
-1
(protected) r = this^2, r != this (HAC 14.16)
function bnpSquareTo(r) { var x = this.abs(); var i = r.t = 2*x.t; while(--i >= 0) r[i] = 0; for(i = 0; i < x.t-1; ++i) { var c = x.am(i,x[i],r,2*i,0,1); if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { r[i+x.t] -= x.DV; r[i+x.t+1] = 1; } } if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1); r.s = 0; r.clamp(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "XOR_R(r1){\n this.register_A = r1 ^ this.register_A;\n this.zero_flag = this.register_A === 0;\n this.carry_flag = false;\n this.subtraction_flag = false;\n this.half_carry_flag = false;\n }", "RR_R(r1){\n let lo = r1 & 0x1;\n let hi = r1 >> 1;\n let rt = (lo << (BITS_ADDRESS - 1)) | this.carry_flag;\n\n this.zero_flag = rt === 0;\n this.subtraction_flag = false;\n this.half_carry_flag = false;\n this.carry_flag = lo;\n return rt;\n }", "rot() {\nreturn this._r;\n}", "RRC_R(r1){\n let lo = r1 & 0x1;\n let hi = r1 >> 1;\n let rt = (lo << (BITS_ADDRESS - 1)) | hi;\n this.zero_flag = rt === 0;\n this.subtraction_flag = false;\n this.half_carry_flag = false;\n this.carry_flag = lo;\n return rt;\n }", "RL_R(r1){\n let lo = r1 & ((1 << (BITS_ADDRESS - 1)) - 1);\n let hi = r1 >> (BITS_ADDRESS - 1);\n let rt = this.carry_flag | (lo << 1);\n this.subtraction_flag = false;\n this.half_carry_flag = false;\n this.carry_flag = hi;\n return rt;\n }", "RLC_R(r1){\n let lo = r1 & ((1 << (BITS_ADDRESS - 1)) - 1);\n let hi = r1 >> (BITS_ADDRESS - 1);\n let rt = hi | (lo << 1);\n \n this.zero_flag = rt === 0;\n this.subtraction_flag = false;\n this.half_carry_flag = false;\n this.carry_flag = hi;\n return rt;\n }", "function bnpIsEven(){return(this.t>0?this[0]&1:this.s)==0;}// (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)", "get r() { return Math.sqrt(this.x*this.x + this.y*this.y); }", "pow(other) {\n return this.__pow__(other);\n }", "get rCombined() {\n return (this.r7 & 0x80) | (this.r & 0xF7);\n }", "get rCombined() {\n return (this.r7 & 0x80) | (this.r & 0xF7);\n }", "SWAP_R(r1){\n let half_1 = r1 & HALF_ADDRESS_MASK;\n let half_2 = r1 >> HALF_ADDRESS;\n let result = (half_1 << (HALF_ADDRESS - 1)) | half_2;\n this.zero_flag = result === 0;\n this.subtraction_flag = false;\n this.half_carry_flag = false;\n this.carry_flag = false;\n return result;\n }", "CP_R(r1){\n this.zero_flag = this.register_A == r1;\n this.subtraction_flag = true;\n this.carry_flag = this.register_A < r1;\n this.half_carry_flag = (((this.register_A & 0x10) - (r1 & 0x10)) & 0x10) === 0x10;\n }", "setR(r) {\nthis._r = r;\nreturn this;\n}", "function z(){r.call(this)}", "function r(e){var t=1===(1&e),n=e>>1;return t?-n:n}", "function qr(n){return null==n}", "OR_R(op, r1){\n this.register_A = r1 | this.register_A;\n this.zero_flag = this.register_A === 0;\n this.carry_flag = false;\n this.subtraction_flag = false;\n this.half_carry_flag = false;\n }", "function prevPow2(v) {\n v |= v >>> 1;\n v |= v >>> 2;\n v |= v >>> 4;\n v |= v >>> 8;\n v |= v >>> 16;\n return v - (v >>> 1);\n }", "function r(e){return 0>e?(-e<<1)+1:(e<<1)+0}", "function bnpMultiplyTo(a,r){var x=this.abs(),y=a.abs();var i=x.t;r.t=i+y.t;while(--i>=0)r[i]=0;for(i=0;i<y.t;++i)r[i+x.t]=x.am(0,y[i],r,i,0,x.t);r.s=0;r.clamp();if(this.s!=a.s)BigInteger.ZERO.subTo(r,r);}// (protected) r = this^2, r != this (HAC 14.16)", "function r(r,o,a,s){e=r,t=a,n=-3*r+3*o-2*a-s,i=2*r-2*o+a+s}", "function nextPow2$1(v) {\n v += v === 0;\n --v;\n v |= v >>> 1;\n v |= v >>> 2;\n v |= v >>> 4;\n v |= v >>> 8;\n v |= v >>> 16;\n return v + 1;\n }", "function nextState(rule, left, self, right) {\n\t var state = left << 2;\n\t state |= self << 1;\n\t state |= right;\n\t return ((rule & (1 << state)) === 0) ? 0 : 1;\n\t}", "two() {\n this.count += 2;\n return this;\n }", "right() {\r\n this.v = 2;\r\n }", "constructor(r,i) {\n this.r = r;\n this.i = i;\n this.updatePows();\n }", "function ex_2_R(a) {\n if (a == 0) {\n return 0;\n } else {\n return 2 * a - 1 + ex_2_R(a - 1);\n }\n}", "function o(r,n=0,t=!1){const u=r[n+3];return r[n+0]*=u,r[n+1]*=u,r[n+2]*=u,t||(r[n+3]*=255),r}", "get modul(){ return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);}", "function bnpIsEven() {\n return (this.t > 0 ? this[0] & 1 : this.s) == 0;\n } // (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)", "function power(a, b) {\n return null; \n}", "function ex_7_R(a, b){\n s = 0; \n if ( b == 0 ) s == 1;\n else if ( b == 1) s = a;\n else\n s = a * ex_7_R( a, (b-1));\nreturn s;\n}", "function methodTwo(x,y){\r\n return (((x**x) + (y**y)) ** ((x**x) + (y**y))); \r\n}", "fRn(){\n return 0.25*this.fm*this.b*this.Lbrg\n }", "function bnpMultiplyTo(a, r) {\n var x = this.abs(),\n y = a.abs();\n var i = x.t;\n r.t = i + y.t;\n\n while (--i >= 0) {\n r[i] = 0;\n }\n\n for (i = 0; i < y.t; ++i) {\n r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);\n }\n\n r.s = 0;\n r.clamp();\n if (this.s != a.s) BigInteger.ZERO.subTo(r, r);\n } // (protected) r = this^2, r != this (HAC 14.16)", "function f1(d, m, r) {\n var t = m + d;\n var I = t << r | t >>> 32 - r;\n return (sBox[0][I >>> 24] ^ sBox[1][I >>> 16 & 255]) - sBox[2][I >>> 8 & 255] + sBox[3][I & 255];\n }", "function bnpMultiplyTo(a, r) {\n var x = this.abs(),\n y = a.abs();\n var i = x.t;\n r.t = i + y.t;\n\n while (--i >= 0) {\n r[i] = 0;\n }\n\n for (i = 0; i < y.t; ++i) {\n r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);\n }\n\n r.s = 0;\n r.clamp();\n if (this.s != a.s) BigInteger.ZERO.subTo(r, r);\n} // (protected) r = this^2, r != this (HAC 14.16)", "setInvert() {\n//--------\n// (t,r) := (-Rot(r*,t),r*) = (Rot(r*,-t),r*)\nthis._r.setInvert();\n(this._t.setNegate()).setRotate(this._r);\nreturn this;\n}", "function r$2(r,t){let n=0,o=\"\",e=0,f=0;const c=r.length;for(;n<c;)f=r[n++],e=f>>4,e<8?e=1:15===e?(e=4,f=(7&f)<<18|(63&r[n++])<<12|(63&r[n++])<<6|63&r[n++]):14===e?(e=3,f=(15&f)<<12|(63&r[n++])<<6|63&r[n++]):(e=2,f=(31&f)<<6|63&r[n++]),(0!==f||t)&&(o+=String.fromCharCode(f));return o}", "mul(other) {\n return this.__mul__(other);\n }", "function f1(d, m, r) {\n const t = m + d;\n const I = t << r | t >>> 32 - r;\n return (sBox[0][I >>> 24] ^ sBox[1][I >>> 16 & 255]) - sBox[2][I >>> 8 & 255] + sBox[3][I & 255];\n }", "clone() { return new Vector2(this.x, this.y); }", "function P2(a,b){this.r=[];this.M=a;this.I=b||null;this.j=this.a=!1;this.g=void 0;this.G=this.Dm=this.D=!1;this.B=0;this.b=null;this.k=0;this.H=null;if(Error.captureStackTrace){var c={stack:f};Error.captureStackTrace(c,P2);typeof c.stack==CJ&&(this.H=c.stack.replace(/^[^\\n]*\\n/,f))}}", "function bR(){this.b=this.i=0;this.h=!1;this.buffer=null}", "setNegate() {\nE3Vec.setNegateV3(this.xyz);\nreturn this;\n}", "function r ( b ) {\n\t\treturn Math.log( -b + Math.sqrt( sq( b ) + 1 ) );\n\t}", "function isPow2 (v) { return !(v & (v - 1)) && (!!v) }", "function r(n,e){0}", "function Rb(a,b,c){this.a=a;this.b=b||1;this.f=c||1}", "mulUnsafe(other) { return this.#mul(other); }", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function Q(a,b){return R(a,W(b))}", "function sc_bitUrsh(x, y) {\n return x >>> y;\n}", "function nextPow2(val) {\n --val;\n val = val >> 1 | val;\n val = val >> 2 | val;\n val = val >> 4 | val;\n val = val >> 8 | val;\n val = val >> 16 | val;\n ++val;\n return val;\n }", "function re(b){this.radius=b}", "function Rp(a,b){this.i=[];this.D=a;this.L=b||null;this.g=this.a=!1;this.c=void 0;this.s=this.w=this.j=!1;this.h=0;this.b=null;this.l=0}", "function multiplyByItself(x){\n return x**2;\n}", "function o0(o1, o2) {\n try {\nreturn --this.o655 == 0;\n}catch(e){}\n}", "function r(t,n){0}", "function r(t,n){0}", "function r(t,n){0}", "function r(t,n){0}", "function r(t,n){0}", "function r(t,n){0}", "function calculatePeriphery(r) {\n var result = 2 * r * Math.PI;\n return result;\n console.log(result);\n}", "function f1(d, m, r) {\n const t = m + d;\n const I = (t << r) | (t >>> (32 - r));\n return ((sBox[0][I >>> 24] ^ sBox[1][(I >>> 16) & 255]) - sBox[2][(I >>> 8) & 255]) + sBox[3][I & 255];\n }", "updatePows() {\n this.rPow = this.r * this.r;\n this.iPow = this.i * this.i;\n }", "setPreStar(trx) {\n//---------\n// (ta,ra) * (tb,rb) = (ta + ra(tb), ra*rb)\n// ... with (ta,ra) = trx and (tb,rb) = this\n(this._t.setRotate(trx._r)).setAdd(trx._t);\nthis._r.setPreMultiply(trx._r);\nreturn this;\n}", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }", "function op_xor(x,y) { return x^y; }" ]
[ "0.6440434", "0.62129754", "0.61445135", "0.61389476", "0.61136216", "0.6075788", "0.60501647", "0.60054326", "0.59395623", "0.5917619", "0.5917619", "0.5880961", "0.5858079", "0.5826148", "0.57878315", "0.5736276", "0.5735339", "0.5718753", "0.5687484", "0.5650332", "0.5646027", "0.56337833", "0.56331646", "0.56311667", "0.5622585", "0.5602315", "0.5597333", "0.5579115", "0.5578763", "0.5575457", "0.55436397", "0.55293256", "0.55148345", "0.54912543", "0.5462145", "0.54568756", "0.5454801", "0.54490083", "0.544813", "0.54440784", "0.54386085", "0.5434238", "0.5432813", "0.5423796", "0.54227966", "0.54224", "0.54188955", "0.54131967", "0.54122674", "0.53758335", "0.5361043", "0.53608847", "0.53608847", "0.53608847", "0.53608847", "0.53608847", "0.53608847", "0.53608847", "0.53608847", "0.53608847", "0.53608847", "0.53608847", "0.53608847", "0.53608847", "0.5346993", "0.5344488", "0.53351265", "0.5323987", "0.532275", "0.53225714", "0.53179073", "0.53111637", "0.53111637", "0.53111637", "0.53111637", "0.53111637", "0.53111637", "0.5301709", "0.52927125", "0.5282666", "0.5280359", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757", "0.52778757" ]
0.0
-1
(protected) divide this by m, quotient and remainder to q, r (HAC 14.20) r != q, this != m. q or r may be null.
function bnpDivRemTo(m,q,r) { var pm = m.abs(); if(pm.t <= 0) return; var pt = this.abs(); if(pt.t < pm.t) { if(q != null) q.fromInt(0); if(r != null) this.copyTo(r); return; } if(r == null) r = nbi(); var y = nbi(), ts = this.s, ms = m.s; var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); } var ys = y.t; var y0 = y[ys-1]; if(y0 == 0) return; var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0); var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2; var i = r.t, j = i-ys, t = (q==null)?nbi():q; y.dlShiftTo(j,t); if(r.compareTo(t) >= 0) { r[r.t++] = 1; r.subTo(t,r); } BigInteger.ONE.dlShiftTo(ys,t); t.subTo(y,y); // "negative" y so we can replace sub with am later while(y.t < ys) y[y.t++] = 0; while(--j >= 0) { // Estimate quotient digit var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2); if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out y.dlShiftTo(j,t); r.subTo(t,r); while(r[i] < --qd) r.subTo(t,r); } } if(q != null) { r.drShiftTo(ys,q); if(ts != ms) BigInteger.ZERO.subTo(q,q); } r.t = ys; r.clamp(); if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder if(ts < 0) BigInteger.ZERO.subTo(r,r); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bnpDivRemTo(m, q, r) {\n\t var self = this\n\t var pm = m.abs()\n\t if (pm.t <= 0) return\n\t var pt = self.abs()\n\t if (pt.t < pm.t) {\n\t if (q != null) q.fromInt(0)\n\t if (r != null) self.copyTo(r)\n\t return\n\t }\n\t if (r == null) r = new BigInteger()\n\t var y = new BigInteger(),\n\t ts = self.s,\n\t ms = m.s\n\t var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n\t if (nsh > 0) {\n\t pm.lShiftTo(nsh, y)\n\t pt.lShiftTo(nsh, r)\n\t } else {\n\t pm.copyTo(y)\n\t pt.copyTo(r)\n\t }\n\t var ys = y.t\n\t var y0 = y[ys - 1]\n\t if (y0 == 0) return\n\t var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n\t var d1 = self.FV / yt,\n\t d2 = (1 << self.F1) / yt,\n\t e = 1 << self.F2\n\t var i = r.t,\n\t j = i - ys,\n\t t = (q == null) ? new BigInteger() : q\n\t y.dlShiftTo(j, t)\n\t if (r.compareTo(t) >= 0) {\n\t r[r.t++] = 1\n\t r.subTo(t, r)\n\t }\n\t BigInteger.ONE.dlShiftTo(ys, t)\n\t t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n\t while (y.t < ys) y[y.t++] = 0\n\t while (--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n\t if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n\t y.dlShiftTo(j, t)\n\t r.subTo(t, r)\n\t while (r[i] < --qd) r.subTo(t, r)\n\t }\n\t }\n\t if (q != null) {\n\t r.drShiftTo(ys, q)\n\t if (ts != ms) BigInteger.ZERO.subTo(q, q)\n\t }\n\t r.t = ys\n\t r.clamp()\n\t if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n\t if (ts < 0) BigInteger.ZERO.subTo(r, r)\n\t}", "function bnpDivRemTo(m, q, r) {\n\t var self = this\n\t var pm = m.abs()\n\t if (pm.t <= 0) return\n\t var pt = self.abs()\n\t if (pt.t < pm.t) {\n\t if (q != null) q.fromInt(0)\n\t if (r != null) self.copyTo(r)\n\t return\n\t }\n\t if (r == null) r = new BigInteger()\n\t var y = new BigInteger(),\n\t ts = self.s,\n\t ms = m.s\n\t var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n\t if (nsh > 0) {\n\t pm.lShiftTo(nsh, y)\n\t pt.lShiftTo(nsh, r)\n\t } else {\n\t pm.copyTo(y)\n\t pt.copyTo(r)\n\t }\n\t var ys = y.t\n\t var y0 = y[ys - 1]\n\t if (y0 == 0) return\n\t var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n\t var d1 = self.FV / yt,\n\t d2 = (1 << self.F1) / yt,\n\t e = 1 << self.F2\n\t var i = r.t,\n\t j = i - ys,\n\t t = (q == null) ? new BigInteger() : q\n\t y.dlShiftTo(j, t)\n\t if (r.compareTo(t) >= 0) {\n\t r[r.t++] = 1\n\t r.subTo(t, r)\n\t }\n\t BigInteger.ONE.dlShiftTo(ys, t)\n\t t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n\t while (y.t < ys) y[y.t++] = 0\n\t while (--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n\t if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n\t y.dlShiftTo(j, t)\n\t r.subTo(t, r)\n\t while (r[i] < --qd) r.subTo(t, r)\n\t }\n\t }\n\t if (q != null) {\n\t r.drShiftTo(ys, q)\n\t if (ts != ms) BigInteger.ZERO.subTo(q, q)\n\t }\n\t r.t = ys\n\t r.clamp()\n\t if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n\t if (ts < 0) BigInteger.ZERO.subTo(r, r)\n\t}", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }", "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) { pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r); } else { pm.copyTo(y);\n pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n\n while (y.t < ys) {\n y[y.t++] = 0;\n }\n\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n\n while (r[i] < --qd) {\n r.subTo(t, r);\n }\n }\n }\n\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n } // (public) this mod a", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }", "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "function bnpDivRemTo(m, q, r) {\n var self = this\n var pm = m.abs()\n if (pm.t <= 0) return\n var pt = self.abs()\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0)\n if (r != null) self.copyTo(r)\n return\n }\n if (r == null) r = new BigInteger()\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y)\n pt.lShiftTo(nsh, r)\n } else {\n pm.copyTo(y)\n pt.copyTo(r)\n }\n var ys = y.t\n var y0 = y[ys - 1]\n if (y0 == 0) return\n var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2\n var i = r.t,\n j = i - ys,\n t = (q == null) ? new BigInteger() : q\n y.dlShiftTo(j, t)\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1\n r.subTo(t, r)\n }\n BigInteger.ONE.dlShiftTo(ys, t)\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t)\n r.subTo(t, r)\n while (r[i] < --qd) r.subTo(t, r)\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q)\n if (ts != ms) BigInteger.ZERO.subTo(q, q)\n }\n r.t = ys\n r.clamp()\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t\tif(q != null) q._fromInt(0);\n\t\tif(r != null) this._copyTo(r);\n\t\treturn;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this._DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm._lShiftTo(nsh,y); pt._lShiftTo(nsh,r); }\n\t else { pm._copyTo(y); pt._copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this._F1)+((ys>1)?y[ys-2]>>this._F2:0);\n\t var d1 = this._FV/yt, d2 = (1<<this._F1)/yt, e = 1<<this._F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y._dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t\tr[r.t++] = 1;\n\t\tr._subTo(t,r);\n\t }\n\t BigInteger.ONE._dlShiftTo(ys,t);\n\t t._subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t\t// Estimate quotient digit\n\t\tvar qd = (r[--i]==y0)?this._DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t\tif((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t\t y._dlShiftTo(j,t);\n\t\t r._subTo(t,r);\n\t\t while(r[i] < --qd) r._subTo(t,r);\n\t\t}\n\t }\n\t if(q != null) {\n\t\tr._drShiftTo(ys,q);\n\t\tif(ts != ms) BigInteger.ZERO._subTo(q,q);\n\t }\n\t r.t = ys;\n\t r._clamp();\n\t if(nsh > 0) r._rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO._subTo(r,r);\n\t}", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y.data[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r.data[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger$4.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y.data[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n\t if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r.data[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger$4.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger$4.ZERO.subTo(r,r);\n\t}", "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) {\n y[y.t++] = 0;\n }while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) {\n r.subTo(t, r);\n }\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) {\n y[y.t++] = 0;\n }while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) {\n r.subTo(t, r);\n }\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) {\n y[y.t++] = 0;\n }while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) {\n r.subTo(t, r);\n }\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n }", "function bnpDivRemTo(m, q, r) {\r\n\t var pm = m.abs();\r\n\t if (pm.t <= 0) return;\r\n\t var pt = this.abs();\r\n\t if (pt.t < pm.t) {\r\n\t if (q != null) q.fromInt(0);\r\n\t if (r != null) this.copyTo(r);\r\n\t return;\r\n\t }\r\n\t if (r == null) r = nbi();\r\n\t var y = nbi(), ts = this.s, ms = m.s;\r\n\t var nsh = this.DB - nbits(pm[pm.t - 1]);\t// normalize modulus\r\n\t if (nsh > 0) {\r\n\t pm.lShiftTo(nsh, y);\r\n\t pt.lShiftTo(nsh, r);\r\n\t }\r\n\t else {\r\n\t pm.copyTo(y);\r\n\t pt.copyTo(r);\r\n\t }\r\n\t var ys = y.t;\r\n\t var y0 = y[ys - 1];\r\n\t if (y0 === 0) return;\r\n\t var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\r\n\t var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\r\n\t var i = r.t, j = i - ys, t = (q == null) ? nbi() : q;\r\n\t y.dlShiftTo(j, t);\r\n\t if (r.compareTo(t) >= 0) {\r\n\t r[r.t++] = 1;\r\n\t r.subTo(t, r);\r\n\t }\r\n\t BigInteger.ONE.dlShiftTo(ys, t);\r\n\t t.subTo(y, y);\t// \"negative\" y so we can replace sub with am later\r\n\t while (y.t < ys) y[y.t++] = 0;\r\n\t while (--j >= 0) {\r\n\t // Estimate quotient digit\r\n\t var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\r\n\t if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\t// Try it out\r\n\t y.dlShiftTo(j, t);\r\n\t r.subTo(t, r);\r\n\t while (r[i] < --qd) r.subTo(t, r);\r\n\t }\r\n\t }\r\n\t if (q != null) {\r\n\t r.drShiftTo(ys, q);\r\n\t if (ts != ms) BigInteger.ZERO.subTo(q, q);\r\n\t }\r\n\t r.t = ys;\r\n\t r.clamp();\r\n\t if (nsh > 0) r.rShiftTo(nsh, r);\t// Denormalize remainder\r\n\t if (ts < 0) BigInteger.ZERO.subTo(r, r);\r\n\t}", "function bnpDivRemTo(m, q, r) {\n var self = this;\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = self.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) self.copyTo(r);\n return;\n }\n if (r == null) r = new BigInteger();\n var y = new BigInteger(),\n ts = self.s,\n ms = m.s;\n var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << self.F1) + (ys > 1 ? y[ys - 2] >> self.F2 : 0);\n var d1 = self.FV / yt,\n d2 = (1 << self.F1) / yt,\n e = 1 << self.F2;\n var i = r.t,\n j = i - ys,\n t = q == null ? new BigInteger() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) {\n y[y.t++] = 0;\n }while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0 ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) {\n r.subTo(t, r);\n }\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n}", "function bnpDivRemTo(m, q, r) {\r\n\t var pm = m.abs();\r\n\t if (pm.t <= 0) return;\r\n\t var pt = this.abs();\r\n\t if (pt.t < pm.t) {\r\n\t if (q != null) q.fromInt(0);\r\n\t if (r != null) this.copyTo(r);\r\n\t return;\r\n\t }\r\n\t if (r == null) r = nbi();\r\n\t var y = nbi(), ts = this.s, ms = m.s;\r\n\t var nsh = this.DB - nbits(pm[pm.t - 1]);\t// normalize modulus\r\n\t if (nsh > 0) {\r\n\t pm.lShiftTo(nsh, y);\r\n\t pt.lShiftTo(nsh, r);\r\n\t }\r\n\t else {\r\n\t pm.copyTo(y);\r\n\t pt.copyTo(r);\r\n\t }\r\n\t var ys = y.t;\r\n\t var y0 = y[ys - 1];\r\n\t if (y0 === 0) return;\r\n\t var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\r\n\t var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\r\n\t var i = r.t, j = i - ys, t = (q == null) ? nbi() : q;\r\n\t y.dlShiftTo(j, t);\r\n\t if (r.compareTo(t) >= 0) {\r\n\t r[r.t++] = 1;\r\n\t r.subTo(t, r);\r\n\t }\r\n\t BigInteger$4.ONE.dlShiftTo(ys, t);\r\n\t t.subTo(y, y);\t// \"negative\" y so we can replace sub with am later\r\n\t while (y.t < ys) y[y.t++] = 0;\r\n\t while (--j >= 0) {\r\n\t // Estimate quotient digit\r\n\t var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\r\n\t if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\t// Try it out\r\n\t y.dlShiftTo(j, t);\r\n\t r.subTo(t, r);\r\n\t while (r[i] < --qd) r.subTo(t, r);\r\n\t }\r\n\t }\r\n\t if (q != null) {\r\n\t r.drShiftTo(ys, q);\r\n\t if (ts != ms) BigInteger$4.ZERO.subTo(q, q);\r\n\t }\r\n\t r.t = ys;\r\n\t r.clamp();\r\n\t if (nsh > 0) r.rShiftTo(nsh, r);\t// Denormalize remainder\r\n\t if (ts < 0) BigInteger$4.ZERO.subTo(r, r);\r\n\t}", "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]);\t// normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n }\n else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 === 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\n var i = r.t, j = i - ys, t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y);\t// \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\t// Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r);\t// Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n\n while (y.t < ys) {\n y[y.t++] = 0;\n }\n\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n\n while (r[i] < --qd) {\n r.subTo(t, r);\n }\n }\n }\n\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n} // (public) this mod a", "function bnpDivRemTo(m, q, r)\n{\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t)\n {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0)\n {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n }\n else\n {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0)\n {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0)\n {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd)\n { // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null)\n {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n}", "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r){var self=this;var pm=m.abs();if(pm.t<=0)return;var pt=self.abs();if(pt.t<pm.t){if(q!=null)q.fromInt(0);if(r!=null)self.copyTo(r);return;}if(r==null)r=new BigInteger();var y=new BigInteger(),ts=self.s,ms=m.s;var nsh=self.DB-nbits(pm[pm.t-1]);// normalize modulus\n\tif(nsh>0){pm.lShiftTo(nsh,y);pt.lShiftTo(nsh,r);}else{pm.copyTo(y);pt.copyTo(r);}var ys=y.t;var y0=y[ys-1];if(y0==0)return;var yt=y0*(1<<self.F1)+(ys>1?y[ys-2]>>self.F2:0);var d1=self.FV/yt,d2=(1<<self.F1)/yt,e=1<<self.F2;var i=r.t,j=i-ys,t=q==null?new BigInteger():q;y.dlShiftTo(j,t);if(r.compareTo(t)>=0){r[r.t++]=1;r.subTo(t,r);}BigInteger.ONE.dlShiftTo(ys,t);t.subTo(y,y);// \"negative\" y so we can replace sub with am later\n\twhile(y.t<ys)y[y.t++]=0;while(--j>=0){// Estimate quotient digit\n\tvar qd=r[--i]==y0?self.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);if((r[i]+=y.am(0,qd,r,j,0,ys))<qd){// Try it out\n\ty.dlShiftTo(j,t);r.subTo(t,r);while(r[i]<--qd)r.subTo(t,r);}}if(q!=null){r.drShiftTo(ys,q);if(ts!=ms)BigInteger.ZERO.subTo(q,q);}r.t=ys;r.clamp();if(nsh>0)r.rShiftTo(nsh,r);// Denormalize remainder\n\tif(ts<0)BigInteger.ZERO.subTo(r,r);}// (public) this mod a", "function bnpDivRemTo(m,q,r) {\n\tvar pm = m.abs();\n\tif(pm.t <= 0) return;\n\tvar pt = this.abs();\n\tif(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t}\n\tif(r == null) r = nbi();\n\tvar y = nbi(), ts = this.s, ms = m.s;\n\tvar nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\tif(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\telse { pm.copyTo(y); pt.copyTo(r); }\n\tvar ys = y.t;\n\tvar y0 = y[ys-1];\n\tif(y0 == 0) return;\n\tvar yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\tvar d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\tvar i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\ty.dlShiftTo(j,t);\n\tif(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t}\n\tBigInteger.ONE.dlShiftTo(ys,t);\n\tt.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\twhile(y.t < ys) y[y.t++] = 0;\n\twhile(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t\ty.dlShiftTo(j,t);\n\t\tr.subTo(t,r);\n\t\twhile(r[i] < --qd) r.subTo(t,r);\n\t }\n\t}\n\tif(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t}\n\tr.t = ys;\n\tr.clamp();\n\tif(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\tif(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(o,m,q,r) {\r\n var pm = abs(m);\r\n if(pm.t <= 0) return;\r\n var pt = abs(o);\r\n if(pt.t < pm.t) {\r\n //if(q != null) // dead code?\r\n fromInt(q,0);\r\n if(r != null) copyTo(o,r);\r\n return;\r\n }\r\n if(r == null) r = [];\r\n var y = [], ts = o.s, ms = m.s;\r\n var nsh = DB-nbits(pm[pm.t-1]);\t// normalize modulus\r\n if(nsh > 0) { bnpLShiftTo(pm,nsh,y); bnpLShiftTo(pt,nsh,r); }\r\n else { copyTo(pm,y); copyTo(pt,r); }\r\n var ys = y.t;\r\n var y0 = y[ys-1];\r\n if(y0 == 0) return;\r\n var yt = y0*(1<<F1)+((ys>1)?y[ys-2]>>F2:0);\r\n var d1 = FV/yt, d2 = (1<<F1)/yt, e = 1<<F2;\r\n var i = r.t, j = i-ys, t = bnpDLShift(y,j);\r\n if(bnCompareTo(r,t) >= 0) {\r\n r[r.t++] = 1;\r\n bnpSubTo(r,t,r);\r\n }\r\n t = bnpDLShift(ONE,ys);\r\n bnpSubTo(t,y,y);\t// \"negative\" y so we can replace sub with am later\r\n while(y.t < ys) y[y.t++] = 0;\r\n while(--j >= 0) {\r\n // Estimate quotient digit\r\n var qd = (r[--i]==y0)?DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\r\n if((r[i]+=am(y,0,qd,r,j,0,ys)) < qd) {\t// Try it out\r\n t = bnpDLShift(y,j);\r\n bnpSubTo(r,t,r);\r\n while(r[i] < --qd) bnpSubTo(r,t,r);\r\n }\r\n }\r\n if(q != null) {\r\n bnpDRShiftTo(r,ys,q);\r\n if(ts != ms) bnpSubTo(ZERO,q,q);\r\n }\r\n r.t = ys;\r\n clamp(r);\r\n if(nsh > 0) bnpRShiftTo(r,nsh,r);\t// Denormalize remainder\r\n if(ts < 0) bnpSubTo(ZERO,r,r);\r\n}" ]
[ "0.7361538", "0.7361538", "0.73573184", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.7326463", "0.73199296", "0.73199296", "0.73073983", "0.7301005", "0.72947264", "0.7292793", "0.7292793", "0.72872454", "0.7285451", "0.7285451", "0.7285451", "0.7285451", "0.7285451", "0.7285451", "0.7285451", "0.7283503", "0.7282082", "0.72721267", "0.72721267", "0.72721267", "0.72336", "0.72246087", "0.721883", "0.72072893", "0.720109", "0.720109", "0.720109", "0.720109", "0.720109", "0.720109", "0.720109", "0.71799785", "0.71721935", "0.71659714", "0.71463495", "0.71463495", "0.71463495", "0.71463495", "0.71463495", "0.71463495", "0.71463495", "0.7128843", "0.7128843", "0.7120536", "0.7081843", "0.6889574" ]
0.7306327
56
(public) this mod a
function bnMod(a) { var r = nbi(); this.abs().divRemTo(a,null,r); if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); return r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get a() {\n\t\treturn this._a_;\n\t}", "get a() {\n\t\treturn this._a_;\n\t}", "get a() {\n return this._a_;\n }", "function ai(a) {\n this.m = a\n}", "function M(){this.a={}}", "set a(val) {\n\t\tthis._a_ = val * 2;\n\t}", "set a(val) {\n\t\tthis._a_ = val * 2;\n\t}", "function w(){this.a={}}", "function _a(e,t,n,i){Ca.call(this,e,t,n,i)}", "set a(val) {\n this._a_ = val * 2;\n }", "function fe(a){this.ra=a}", "function Ai(a,b){this.wc=[];this.je=a;this.Qd=b||null;this.Bb=this.$a=!1;this.X=void 0;this.sd=this.gf=this.Fc=!1;this.Ac=0;this.v=null;this.Hc=0}", "a (a.a - a < 0 &&N\n (a.a.a > 0 || !(a.a[0] a AaAa))) {N\n a a = [];N\n a.a(a);N\n a.a = [a AaAa(a)];N\n a.a[0].a = a;N\n }", "function Aa(e,t,n,i){xa.call(this,e,t,n,i)}", "function mh(a){this.u=a}", "function an(){}", "function foo(a) {\n\tthis.a = a;\n}", "function ed(a){this.a=a}", "function aA(t,e){this.C=[],this.O=t,this.K=e||null,this.B=this.j=!1,this.A=void 0,this.H=this.P=this.F=!1,this.D=0,this.o=null,this.G=0}", "function x(){this.a={}}", "function x(){this.a={}}", "function x(){this.a={}}", "function ea(){}", "ap (_) { \n return this\n }", "function A() {\n r.call(this);\n }", "getAlpha() {\n return this.a;\n }", "mod() {}", "mod() {}", "function Wg(a){this.Ba=a}", "function a(A,e){if(!A)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?A:e}", "function re(a,b){this.O=[];this.za=a;this.la=b||null;this.J=this.D=!1;this.H=void 0;this.ha=this.Fa=this.S=!1;this.R=0;this.Ef=null;this.N=0}", "function Q(){this.a={}}", "function Q(){this.a={}}", "function Q(){this.a={}}", "function a(){\n\tconsole.log(this)\t\n}", "function Alerter() {}", "function uh(a){this.Da=a}", "function K(){this.a={}}", "rotate(a) {\n return new Point({\n a: a + this.a,\n d: this.d\n })\n }", "private public function m246() {}", "function ai(a,b,c,d){this.type=a;this.name=b;this.Y=c;this.ba=d;this.hb=[];this.align=-1;this.Ga=!0}", "transient protected internal function m189() {}", "function oi(a){this.Of=a;this.rg=\"\"}", "function sd(a){this.ta={};this.o=a}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function foo() {\n\tconsole.log( this.a );\n}", "function nd(a){this.la={};this.o=a}", "function Tb(a){this.Aa=new Sb(0,25);this.ia(a)}", "function me(a){me.m.constructor.call(this,a);ke(this)}", "function li(a){var b=mi;this.g=[];this.w=b;this.s=a||null;this.f=this.a=!1;this.c=void 0;this.u=this.B=this.i=!1;this.h=0;this.b=null;this.l=0}", "function li(a){var b=mi;this.g=[];this.w=b;this.s=a||null;this.f=this.a=!1;this.c=void 0;this.u=this.B=this.i=!1;this.h=0;this.b=null;this.l=0}", "function Foo(a) {\n this.a = a;\n }", "function M(a){var b=Hc;this.l=[];this.C=b;this.B=a||null;this.j=this.g=!1;this.i=void 0;this.s=this.H=this.u=!1;this.m=0;this.h=null;this.o=0}", "function b(a){md=a}", "function b(a){md=a}", "function b(a){md=a}", "function b(a){md=a}", "function b(a){md=a}", "function b(a){md=a}", "function InterfaceThis() {\n this.a = 12;\n}", "function f(){\n return this.a;\n}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function pi(a){pi.i.constructor.call(this,a);this.bd()}", "function Ci(a){this.o=a}", "function H(a){A(a)}", "function foo(){\n console.log(this.a);\n}", "function Ke(a){this.Da=a}", "function foo(){\n console.log(this.a);\n}", "function foo(a) {\n this.a = a;\n}", "function pu(a,b){this.$h=[];this.vo=a;this.ym=b||null;this.Af=this.re=!1;this.Jc=void 0;this.jl=this.wq=this.Pi=!1;this.oi=0;this.L=null;this.Si=0}", "function Aa(b){this.c=Math.exp(Math.log(.5)/b);this.b=this.a=0}", "function Ag(){this.b=null;this.a=[]}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function sb(a){this.b=a}", "mod(a, b) {\n\t\tthis.registers[a] %= this.get(b);\n\t}", "function foo() {\n console.log(this.a);\n}", "function foo() {\n console.log(this.a);\n}", "function foo() {\n console.log(this.a);\n}", "function foo() {\n console.log(this.a);\n}", "function ie(a){this.ra=a}", "function foo() {\n console.log(this.a);\n}", "function foo() {\n console.log( this.a );\n}" ]
[ "0.71102196", "0.71102196", "0.6818816", "0.6425755", "0.6398882", "0.61737627", "0.61737627", "0.6133958", "0.61257035", "0.6110084", "0.6063708", "0.6057419", "0.59832966", "0.59351337", "0.58691454", "0.5861765", "0.58456826", "0.5839061", "0.57936484", "0.57804126", "0.57804126", "0.57804126", "0.5766135", "0.5756256", "0.5739851", "0.57278985", "0.5722955", "0.5722955", "0.5717747", "0.5717225", "0.57108694", "0.5704644", "0.5704644", "0.5704644", "0.5700849", "0.5693", "0.5690617", "0.5676071", "0.5653426", "0.5648737", "0.564722", "0.5646579", "0.5624211", "0.5623221", "0.56095016", "0.56095016", "0.56095016", "0.56095016", "0.56095016", "0.56095016", "0.56095016", "0.5604242", "0.56033", "0.5598076", "0.5586959", "0.5586959", "0.55819815", "0.5579805", "0.5575512", "0.5575512", "0.5575512", "0.5575512", "0.5575512", "0.5575512", "0.5556714", "0.554477", "0.5543839", "0.5543839", "0.5543839", "0.5543839", "0.5543839", "0.5543839", "0.5543839", "0.5543839", "0.5543839", "0.5543839", "0.5543839", "0.5543839", "0.55362487", "0.5535491", "0.5532532", "0.55322725", "0.5529636", "0.55294126", "0.5525466", "0.55210066", "0.5510311", "0.5509704", "0.55040544", "0.55040544", "0.55040544", "0.55040544", "0.54947275", "0.5493875", "0.5490856", "0.5490856", "0.5490856", "0.5490856", "0.5486724", "0.54862773", "0.54860216" ]
0.0
-1
Modular reduction using "classic" algorithm
function Classic(m) { this.m = m; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function montReduce(x) {\n while (x.t <= this.mt2) {\n // pad x so am has enough room later\n x[x.t++] = 0;\n }for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n }", "function montReduce(x) {\n while (x.t <= this.mt2) {\n // pad x so am has enough room later\n x[x.t++] = 0;\n }for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n }", "function montReduce(x) {\n while (x.t <= this.mt2) {\n // pad x so am has enough room later\n x[x.t++] = 0;\n }for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n }", "function montReduce(x) {\n\t while (x.t <= this.mt2) // pad x so am has enough room later\n\t x[x.t++] = 0\n\t for (var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i] & 0x7fff\n\t var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n\t // use am to combine the multiply-shift-add into one call\n\t j = i + this.m.t\n\t x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n\t // propagate carry\n\t while (x[j] >= x.DV) {\n\t x[j] -= x.DV\n\t x[++j]++\n\t }\n\t }\n\t x.clamp()\n\t x.drShiftTo(this.m.t, x)\n\t if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n\t}", "function montReduce(x) {\n\t while (x.t <= this.mt2) // pad x so am has enough room later\n\t x[x.t++] = 0\n\t for (var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i] & 0x7fff\n\t var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n\t // use am to combine the multiply-shift-add into one call\n\t j = i + this.m.t\n\t x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n\t // propagate carry\n\t while (x[j] >= x.DV) {\n\t x[j] -= x.DV\n\t x[++j]++\n\t }\n\t }\n\t x.clamp()\n\t x.drShiftTo(this.m.t, x)\n\t if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n\t}", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n\t while(x.t <= this.mt2)\t// pad x so am has enough room later\n\t\tx[x.t++] = 0;\n\t for(var i = 0; i < this.m.t; ++i) {\n\t\t// faster way of calculating u0 = x[i]*mp mod DV\n\t\tvar j = x[i]&0x7fff;\n\t\tvar u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x._DM;\n\t\t// use am to combine the multiply-shift-add into one call\n\t\tj = i+this.m.t;\n\t\tx[j] += this.m.am(0,u0,x,i,0,this.m.t);\n\t\t// propagate carry\n\t\twhile(x[j] >= x._DV) { x[j] -= x._DV; x[++j]++; }\n\t }\n\t x._clamp();\n\t x._drShiftTo(this.m.t,x);\n\t if(x.compareTo(this.m) >= 0) x._subTo(this.m,x);\n\t}", "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV\n x[++j]++\n }\n }\n x.clamp()\n x.drShiftTo(this.m.t, x)\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}", "function montReduce(x) {\n\twhile(x.t <= this.mt2)\t// pad x so am has enough room later\n\t x[x.t++] = 0;\n\tfor(var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i]&0x7fff;\n\t var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n\t // use am to combine the multiply-shift-add into one call\n\t j = i+this.m.t;\n\t x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n\t // propagate carry\n\t while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n\t}\n\tx.clamp();\n\tx.drShiftTo(this.m.t,x);\n\tif(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x)\n{\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i)\n {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV)\n {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}", "function montReduce(x) {\n\t while(x.t <= this.mt2) // pad x so am has enough room later\n\t x[x.t++] = 0;\n\t for(var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i]&0x7fff;\n\t var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n\t // use am to combine the multiply-shift-add into one call\n\t j = i+this.m.t;\n\t x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n\t // propagate carry\n\t while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n\t }\n\t x.clamp();\n\t x.drShiftTo(this.m.t,x);\n\t if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n\t }", "function montReduce(x) {\n\t while(x.t <= this.mt2) // pad x so am has enough room later\n\t x[x.t++] = 0;\n\t for(var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i]&0x7fff;\n\t var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n\t // use am to combine the multiply-shift-add into one call\n\t j = i+this.m.t;\n\t x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n\t // propagate carry\n\t while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n\t }\n\t x.clamp();\n\t x.drShiftTo(this.m.t,x);\n\t if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n\t }", "function montReduce(x) {\n while (x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}", "function montReduce(x) {\n\t while(x.t <= this.mt2)\t// pad x so am has enough room later\n\t x[x.t++] = 0;\n\t for(var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i]&0x7fff;\n\t var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n\t // use am to combine the multiply-shift-add into one call\n\t j = i+this.m.t;\n\t x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n\t // propagate carry\n\t while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n\t }\n\t x.clamp();\n\t x.drShiftTo(this.m.t,x);\n\t if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n\t}", "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 32767;\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}", "function montReduce(x) {\n\t while(x.t <= this.mt2)\t// pad x so am has enough room later\n\t x[x.t++] = 0;\n\t for(var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i]&0x7fff;\n\t var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n\t // use am to combine the multiply-shift-add into one call\n\t j = i+this.m.t;\n\t x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n\t // propagate carry\n\t while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n\t }\n\t x.clamp();\n\t x.drShiftTo(this.m.t,x);\n\t if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n\t }", "function montReduce(x) {\r\n\t while (x.t <= this.mt2)\t// pad x so am has enough room later\r\n\t x[x.t++] = 0;\r\n\t for (var i = 0; i < this.m.t; ++i) {\r\n\t // faster way of calculating u0 = x[i]*mp mod DV\r\n\t var j = x[i] & 0x7fff;\r\n\t var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM;\r\n\t // use am to combine the multiply-shift-add into one call\r\n\t j = i + this.m.t;\r\n\t x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\r\n\t // propagate carry\r\n\t while (x[j] >= x.DV) {\r\n\t x[j] -= x.DV;\r\n\t x[++j]++;\r\n\t }\r\n\t }\r\n\t x.clamp();\r\n\t x.drShiftTo(this.m.t, x);\r\n\t if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\r\n\t}", "function montReduce(x) {\r\n\t while (x.t <= this.mt2)\t// pad x so am has enough room later\r\n\t x[x.t++] = 0;\r\n\t for (var i = 0; i < this.m.t; ++i) {\r\n\t // faster way of calculating u0 = x[i]*mp mod DV\r\n\t var j = x[i] & 0x7fff;\r\n\t var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM;\r\n\t // use am to combine the multiply-shift-add into one call\r\n\t j = i + this.m.t;\r\n\t x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\r\n\t // propagate carry\r\n\t while (x[j] >= x.DV) {\r\n\t x[j] -= x.DV;\r\n\t x[++j]++;\r\n\t }\r\n\t }\r\n\t x.clamp();\r\n\t x.drShiftTo(this.m.t, x);\r\n\t if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\r\n\t}", "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n }", "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n }", "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) { x[j] -= x.DV;\n x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }", "function montReduce(x) {\n while (x.t <= this.mt2) {\n // pad x so am has enough room later\n x[x.t++] = 0;\n }for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}", "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n }", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function montReduce(x) {\n\t while(x.t <= this.mt2)\t// pad x so am has enough room later\n\t x.data[x.t++] = 0;\n\t for(var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x.data[i]*mp mod DV\n\t var j = x.data[i]&0x7fff;\n\t var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n\t // use am to combine the multiply-shift-add into one call\n\t j = i+this.m.t;\n\t x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n\t // propagate carry\n\t while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n\t }\n\t x.clamp();\n\t x.drShiftTo(this.m.t,x);\n\t if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n\t}", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function montReduce(x) {\n while(x.t <= this.mt2)\t// pad x so am has enough room later\n x.data[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x.data[i]*mp mod DV\n var j = x.data[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}", "function multinomial_mod_2(list){\r\n let old_sum = list[0];\r\n for(let i = 1; i < list.length; i++){\r\n for(let j = 1; j <= Math.min(old_sum, list[i]); j = j<<1) {\r\n if (((j & old_sum ) === j) && ((j & list[i]) !== 0) ) {\r\n return 0;\r\n }\r\n }\r\n old_sum += list[i];\r\n }\r\n return 1;\r\n}", "function multMod(x,y,n) {\n var ans=expand(x,n.length);\n multMod_(ans,y,n);\n return trim(ans,1);\n }", "function multMod_(x,y,n) {\n var i;\n if (s0.length!=2*x.length)\n s0=new Array(2*x.length);\n copyInt_(s0,0);\n for (i=0;i<y.length;i++)\n if (y[i])\n linCombShift_(s0,x,y[i],i); //s0=1*s0+y[i]*(x<<(i*bpe))\n mod_(s0,n);\n copy_(x,s0);\n }", "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}" ]
[ "0.6492456", "0.6492456", "0.6492456", "0.6478665", "0.6478665", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.64568865", "0.6439812", "0.64341104", "0.64341104", "0.64341104", "0.64341104", "0.64341104", "0.64341104", "0.64341104", "0.6428419", "0.64281267", "0.64175546", "0.64175546", "0.64171505", "0.641258", "0.6408913", "0.6406966", "0.63977355", "0.63977355", "0.6397111", "0.6397111", "0.6392545", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6387987", "0.6377211", "0.6371063", "0.63411677", "0.63411677", "0.63411677", "0.63411677", "0.63411677", "0.63411677", "0.63411677", "0.6336403", "0.63171893", "0.63171893", "0.6288273", "0.6288273", "0.6288273", "0.6288273", "0.6288273", "0.6288273", "0.6288273", "0.6037095", "0.6022305", "0.58915436", "0.58091813" ]
0.0
-1
(protected) return "1/this % 2^DB"; useful for Mont. reduction justification: xy == 1 (mod m) xy = 1+km xy(2xy) = (1+km)(1km) x[y(2xy)] = 1k^2m^2 x[y(2xy)] == 1 (mod m^2) if y is 1/x mod m, then y(2xy) is 1/x mod m^2 should reduce x and y(2xy) by m^2 at each step to keep size bounded. JS multiply "overflows" differently from C/C++, so care is needed here.
function bnpInvDigit() { if(this.t < 1) return 0; var x = this[0]; if((x&1) == 0) return 0; var y = x&3; // y == 1/x mod 2^2 y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 // last step - calculate inverse mod DV directly; // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits // we really want the negative inverse, and -DV < y < DV return (y>0)?this.DV-y:-y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bnModPow(e, m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if (i <= 0) return r;\n else if (i < 18) k = 1;\n else if (i < 48) k = 3;\n else if (i < 144) k = 4;\n else if (i < 768) k = 5;\n else k = 6;\n if (i < 8)\n z = new Classic(m);\n else if (m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n// precomputation\n var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km;\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\n }\n\n n = k;\n while ((w & 1) === 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2); else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & (1 << i)) === 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "function bnModPow(e, m) {\r\n\t var i = e.bitLength(), k, r = nbv(1), z;\r\n\t if (i <= 0) return r;\r\n\t else if (i < 18) k = 1;\r\n\t else if (i < 48) k = 3;\r\n\t else if (i < 144) k = 4;\r\n\t else if (i < 768) k = 5;\r\n\t else k = 6;\r\n\t if (i < 8)\r\n\t z = new Classic(m);\r\n\t else if (m.isEven())\r\n\t z = new Barrett(m);\r\n\t else\r\n\t z = new Montgomery(m);\r\n\r\n\t// precomputation\r\n\t var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;\r\n\t g[1] = z.convert(this);\r\n\t if (k > 1) {\r\n\t var g2 = nbi();\r\n\t z.sqrTo(g[1], g2);\r\n\t while (n <= km) {\r\n\t g[n] = nbi();\r\n\t z.mulTo(g2, g[n - 2], g[n]);\r\n\t n += 2;\r\n\t }\r\n\t }\r\n\r\n\t var j = e.t - 1, w, is1 = true, r2 = nbi(), t;\r\n\t i = nbits(e[j]) - 1;\r\n\t while (j >= 0) {\r\n\t if (i >= k1) w = (e[j] >> (i - k1)) & km;\r\n\t else {\r\n\t w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\r\n\t if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\r\n\t }\r\n\r\n\t n = k;\r\n\t while ((w & 1) === 0) {\r\n\t w >>= 1;\r\n\t --n;\r\n\t }\r\n\t if ((i -= n) < 0) {\r\n\t i += this.DB;\r\n\t --j;\r\n\t }\r\n\t if (is1) {\t// ret == 1, don't bother squaring or multiplying it\r\n\t g[w].copyTo(r);\r\n\t is1 = false;\r\n\t }\r\n\t else {\r\n\t while (n > 1) {\r\n\t z.sqrTo(r, r2);\r\n\t z.sqrTo(r2, r);\r\n\t n -= 2;\r\n\t }\r\n\t if (n > 0) z.sqrTo(r, r2); else {\r\n\t t = r;\r\n\t r = r2;\r\n\t r2 = t;\r\n\t }\r\n\t z.mulTo(r2, g[w], r);\r\n\t }\r\n\r\n\t while (j >= 0 && (e[j] & (1 << i)) === 0) {\r\n\t z.sqrTo(r, r2);\r\n\t t = r;\r\n\t r = r2;\r\n\t r2 = t;\r\n\t if (--i < 0) {\r\n\t i = this.DB - 1;\r\n\t --j;\r\n\t }\r\n\t }\r\n\t }\r\n\t return z.revert(r);\r\n\t}", "function bnModPow(e, m) {\r\n\t var i = e.bitLength(), k, r = nbv(1), z;\r\n\t if (i <= 0) return r;\r\n\t else if (i < 18) k = 1;\r\n\t else if (i < 48) k = 3;\r\n\t else if (i < 144) k = 4;\r\n\t else if (i < 768) k = 5;\r\n\t else k = 6;\r\n\t if (i < 8)\r\n\t z = new Classic(m);\r\n\t else if (m.isEven())\r\n\t z = new Barrett(m);\r\n\t else\r\n\t z = new Montgomery(m);\r\n\r\n\t// precomputation\r\n\t var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;\r\n\t g[1] = z.convert(this);\r\n\t if (k > 1) {\r\n\t var g2 = nbi();\r\n\t z.sqrTo(g[1], g2);\r\n\t while (n <= km) {\r\n\t g[n] = nbi();\r\n\t z.mulTo(g2, g[n - 2], g[n]);\r\n\t n += 2;\r\n\t }\r\n\t }\r\n\r\n\t var j = e.t - 1, w, is1 = true, r2 = nbi(), t;\r\n\t i = nbits(e[j]) - 1;\r\n\t while (j >= 0) {\r\n\t if (i >= k1) w = (e[j] >> (i - k1)) & km;\r\n\t else {\r\n\t w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\r\n\t if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\r\n\t }\r\n\r\n\t n = k;\r\n\t while ((w & 1) === 0) {\r\n\t w >>= 1;\r\n\t --n;\r\n\t }\r\n\t if ((i -= n) < 0) {\r\n\t i += this.DB;\r\n\t --j;\r\n\t }\r\n\t if (is1) {\t// ret == 1, don't bother squaring or multiplying it\r\n\t g[w].copyTo(r);\r\n\t is1 = false;\r\n\t }\r\n\t else {\r\n\t while (n > 1) {\r\n\t z.sqrTo(r, r2);\r\n\t z.sqrTo(r2, r);\r\n\t n -= 2;\r\n\t }\r\n\t if (n > 0) z.sqrTo(r, r2); else {\r\n\t t = r;\r\n\t r = r2;\r\n\t r2 = t;\r\n\t }\r\n\t z.mulTo(r2, g[w], r);\r\n\t }\r\n\r\n\t while (j >= 0 && (e[j] & (1 << i)) === 0) {\r\n\t z.sqrTo(r, r2);\r\n\t t = r;\r\n\t r = r2;\r\n\t r2 = t;\r\n\t if (--i < 0) {\r\n\t i = this.DB - 1;\r\n\t --j;\r\n\t }\r\n\t }\r\n\t }\r\n\t return z.revert(r);\r\n\t}", "function bnModPow(e,m) {\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t }", "function bnModPow(e,m) {\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\t\n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\t\n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\t\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\t\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e.data[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z\n if (i <= 0) return r\n else if (i < 18) k = 1\n else if (i < 48) k = 3\n else if (i < 144) k = 4\n else if (i < 768) k = 5\n else k = 6\n if (i < 8)\n z = new Classic(m)\n else if (m.isEven())\n z = new Barrett(m)\n else\n z = new Montgomery(m)\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1\n g[1] = z.convert(this)\n if (k > 1) {\n var g2 = new BigInteger()\n z.sqrTo(g[1], g2)\n while (n <= km) {\n g[n] = new BigInteger()\n z.mulTo(g2, g[n - 2], g[n])\n n += 2\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = new BigInteger(),\n t\n i = nbits(e[j]) - 1\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n }\n\n n = k\n while ((w & 1) == 0) {\n w >>= 1\n --n\n }\n if ((i -= n) < 0) {\n i += this.DB\n --j\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r)\n is1 = false\n } else {\n while (n > 1) {\n z.sqrTo(r, r2)\n z.sqrTo(r2, r)\n n -= 2\n }\n if (n > 0) z.sqrTo(r, r2)\n else {\n t = r\n r = r2\n r2 = t\n }\n z.mulTo(r2, g[w], r)\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2)\n t = r\n r = r2\n r2 = t\n if (--i < 0) {\n i = this.DB - 1\n --j\n }\n }\n }\n return z.revert(r)\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z\n if (i <= 0) return r\n else if (i < 18) k = 1\n else if (i < 48) k = 3\n else if (i < 144) k = 4\n else if (i < 768) k = 5\n else k = 6\n if (i < 8)\n z = new Classic(m)\n else if (m.isEven())\n z = new Barrett(m)\n else\n z = new Montgomery(m)\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1\n g[1] = z.convert(this)\n if (k > 1) {\n var g2 = new BigInteger()\n z.sqrTo(g[1], g2)\n while (n <= km) {\n g[n] = new BigInteger()\n z.mulTo(g2, g[n - 2], g[n])\n n += 2\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = new BigInteger(),\n t\n i = nbits(e[j]) - 1\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n }\n\n n = k\n while ((w & 1) == 0) {\n w >>= 1\n --n\n }\n if ((i -= n) < 0) {\n i += this.DB\n --j\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r)\n is1 = false\n } else {\n while (n > 1) {\n z.sqrTo(r, r2)\n z.sqrTo(r2, r)\n n -= 2\n }\n if (n > 0) z.sqrTo(r, r2)\n else {\n t = r\n r = r2\n r2 = t\n }\n z.mulTo(r2, g[w], r)\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2)\n t = r\n r = r2\n r2 = t\n if (--i < 0) {\n i = this.DB - 1\n --j\n }\n }\n }\n return z.revert(r)\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z\n if (i <= 0) return r\n else if (i < 18) k = 1\n else if (i < 48) k = 3\n else if (i < 144) k = 4\n else if (i < 768) k = 5\n else k = 6\n if (i < 8)\n z = new Classic(m)\n else if (m.isEven())\n z = new Barrett(m)\n else\n z = new Montgomery(m)\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1\n g[1] = z.convert(this)\n if (k > 1) {\n var g2 = new BigInteger()\n z.sqrTo(g[1], g2)\n while (n <= km) {\n g[n] = new BigInteger()\n z.mulTo(g2, g[n - 2], g[n])\n n += 2\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = new BigInteger(),\n t\n i = nbits(e[j]) - 1\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n }\n\n n = k\n while ((w & 1) == 0) {\n w >>= 1\n --n\n }\n if ((i -= n) < 0) {\n i += this.DB\n --j\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r)\n is1 = false\n } else {\n while (n > 1) {\n z.sqrTo(r, r2)\n z.sqrTo(r2, r)\n n -= 2\n }\n if (n > 0) z.sqrTo(r, r2)\n else {\n t = r\n r = r2\n r2 = t\n }\n z.mulTo(r2, g[w], r)\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2)\n t = r\n r = r2\n r2 = t\n if (--i < 0) {\n i = this.DB - 1\n --j\n }\n }\n }\n return z.revert(r)\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z\n if (i <= 0) return r\n else if (i < 18) k = 1\n else if (i < 48) k = 3\n else if (i < 144) k = 4\n else if (i < 768) k = 5\n else k = 6\n if (i < 8)\n z = new Classic(m)\n else if (m.isEven())\n z = new Barrett(m)\n else\n z = new Montgomery(m)\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1\n g[1] = z.convert(this)\n if (k > 1) {\n var g2 = new BigInteger()\n z.sqrTo(g[1], g2)\n while (n <= km) {\n g[n] = new BigInteger()\n z.mulTo(g2, g[n - 2], g[n])\n n += 2\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = new BigInteger(),\n t\n i = nbits(e[j]) - 1\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n }\n\n n = k\n while ((w & 1) == 0) {\n w >>= 1\n --n\n }\n if ((i -= n) < 0) {\n i += this.DB\n --j\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r)\n is1 = false\n } else {\n while (n > 1) {\n z.sqrTo(r, r2)\n z.sqrTo(r2, r)\n n -= 2\n }\n if (n > 0) z.sqrTo(r, r2)\n else {\n t = r\n r = r2\n r2 = t\n }\n z.mulTo(r2, g[w], r)\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2)\n t = r\n r = r2\n r2 = t\n if (--i < 0) {\n i = this.DB - 1\n --j\n }\n }\n }\n return z.revert(r)\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z\n if (i <= 0) return r\n else if (i < 18) k = 1\n else if (i < 48) k = 3\n else if (i < 144) k = 4\n else if (i < 768) k = 5\n else k = 6\n if (i < 8)\n z = new Classic(m)\n else if (m.isEven())\n z = new Barrett(m)\n else\n z = new Montgomery(m)\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1\n g[1] = z.convert(this)\n if (k > 1) {\n var g2 = new BigInteger()\n z.sqrTo(g[1], g2)\n while (n <= km) {\n g[n] = new BigInteger()\n z.mulTo(g2, g[n - 2], g[n])\n n += 2\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = new BigInteger(),\n t\n i = nbits(e[j]) - 1\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n }\n\n n = k\n while ((w & 1) == 0) {\n w >>= 1\n --n\n }\n if ((i -= n) < 0) {\n i += this.DB\n --j\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r)\n is1 = false\n } else {\n while (n > 1) {\n z.sqrTo(r, r2)\n z.sqrTo(r2, r)\n n -= 2\n }\n if (n > 0) z.sqrTo(r, r2)\n else {\n t = r\n r = r2\n r2 = t\n }\n z.mulTo(r2, g[w], r)\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2)\n t = r\n r = r2\n r2 = t\n if (--i < 0) {\n i = this.DB - 1\n --j\n }\n }\n }\n return z.revert(r)\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z\n if (i <= 0) return r\n else if (i < 18) k = 1\n else if (i < 48) k = 3\n else if (i < 144) k = 4\n else if (i < 768) k = 5\n else k = 6\n if (i < 8)\n z = new Classic(m)\n else if (m.isEven())\n z = new Barrett(m)\n else\n z = new Montgomery(m)\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1\n g[1] = z.convert(this)\n if (k > 1) {\n var g2 = new BigInteger()\n z.sqrTo(g[1], g2)\n while (n <= km) {\n g[n] = new BigInteger()\n z.mulTo(g2, g[n - 2], g[n])\n n += 2\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = new BigInteger(),\n t\n i = nbits(e[j]) - 1\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n }\n\n n = k\n while ((w & 1) == 0) {\n w >>= 1\n --n\n }\n if ((i -= n) < 0) {\n i += this.DB\n --j\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r)\n is1 = false\n } else {\n while (n > 1) {\n z.sqrTo(r, r2)\n z.sqrTo(r2, r)\n n -= 2\n }\n if (n > 0) z.sqrTo(r, r2)\n else {\n t = r\n r = r2\n r2 = t\n }\n z.mulTo(r2, g[w], r)\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2)\n t = r\n r = r2\n r2 = t\n if (--i < 0) {\n i = this.DB - 1\n --j\n }\n }\n }\n return z.revert(r)\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z\n if (i <= 0) return r\n else if (i < 18) k = 1\n else if (i < 48) k = 3\n else if (i < 144) k = 4\n else if (i < 768) k = 5\n else k = 6\n if (i < 8)\n z = new Classic(m)\n else if (m.isEven())\n z = new Barrett(m)\n else\n z = new Montgomery(m)\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1\n g[1] = z.convert(this)\n if (k > 1) {\n var g2 = new BigInteger()\n z.sqrTo(g[1], g2)\n while (n <= km) {\n g[n] = new BigInteger()\n z.mulTo(g2, g[n - 2], g[n])\n n += 2\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = new BigInteger(),\n t\n i = nbits(e[j]) - 1\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n }\n\n n = k\n while ((w & 1) == 0) {\n w >>= 1\n --n\n }\n if ((i -= n) < 0) {\n i += this.DB\n --j\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r)\n is1 = false\n } else {\n while (n > 1) {\n z.sqrTo(r, r2)\n z.sqrTo(r2, r)\n n -= 2\n }\n if (n > 0) z.sqrTo(r, r2)\n else {\n t = r\n r = r2\n r2 = t\n }\n z.mulTo(r2, g[w], r)\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2)\n t = r\n r = r2\n r2 = t\n if (--i < 0) {\n i = this.DB - 1\n --j\n }\n }\n }\n return z.revert(r)\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z;\n if (i <= 0) return r;\n else if (i < 18) k = 1;\n else if (i < 48) k = 3;\n else if (i < 144) k = 4;\n else if (i < 768) k = 5;\n else k = 6;\n if (i < 8)\n z = new Classic(m);\n else if (m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km;\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\n }\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);\n else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e.data[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e,m){var i=e.bitLength(),k,r=nbv(1),z;if(i<=0)return r;else if(i<18)k=1;else if(i<48)k=3;else if(i<144)k=4;else if(i<768)k=5;else k=6;if(i<8)z=new Classic(m);else if(m.isEven())z=new Barrett(m);else z=new Montgomery(m);// precomputation\n\tvar g=new Array(),n=3,k1=k-1,km=(1<<k)-1;g[1]=z.convert(this);if(k>1){var g2=new BigInteger();z.sqrTo(g[1],g2);while(n<=km){g[n]=new BigInteger();z.mulTo(g2,g[n-2],g[n]);n+=2;}}var j=e.t-1,w,is1=true,r2=new BigInteger(),t;i=nbits(e[j])-1;while(j>=0){if(i>=k1)w=e[j]>>i-k1&km;else{w=(e[j]&(1<<i+1)-1)<<k1-i;if(j>0)w|=e[j-1]>>this.DB+i-k1;}n=k;while((w&1)==0){w>>=1;--n;}if((i-=n)<0){i+=this.DB;--j;}if(is1){// ret == 1, don't bother squaring or multiplying it\n\tg[w].copyTo(r);is1=false;}else{while(n>1){z.sqrTo(r,r2);z.sqrTo(r2,r);n-=2;}if(n>0)z.sqrTo(r,r2);else{t=r;r=r2;r2=t;}z.mulTo(r2,g[w],r);}while(j>=0&&(e[j]&1<<i)==0){z.sqrTo(r,r2);t=r;r=r2;r2=t;if(--i<0){i=this.DB-1;--j;}}}return z.revert(r);}// (public) gcd(this,a) (HAC 14.54)", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n if (jscore && jscore.bnModPow) {\n var r = nbi();\n var s = jscore.bnModPow(this.toString(), e.toString(), m.toString())\n return r.fromString(s, 10);\n }\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\t \n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\t \n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\t \n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\t \n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t }", "function bnModPow(e, m) {\n\t var i = e.bitLength(),\n\t k, r = nbv(1),\n\t z\n\t if (i <= 0) return r\n\t else if (i < 18) k = 1\n\t else if (i < 48) k = 3\n\t else if (i < 144) k = 4\n\t else if (i < 768) k = 5\n\t else k = 6\n\t if (i < 8)\n\t z = new Classic(m)\n\t else if (m.isEven())\n\t z = new Barrett(m)\n\t else\n\t z = new Montgomery(m)\n\n\t // precomputation\n\t var g = new Array(),\n\t n = 3,\n\t k1 = k - 1,\n\t km = (1 << k) - 1\n\t g[1] = z.convert(this)\n\t if (k > 1) {\n\t var g2 = new BigInteger()\n\t z.sqrTo(g[1], g2)\n\t while (n <= km) {\n\t g[n] = new BigInteger()\n\t z.mulTo(g2, g[n - 2], g[n])\n\t n += 2\n\t }\n\t }\n\n\t var j = e.t - 1,\n\t w, is1 = true,\n\t r2 = new BigInteger(),\n\t t\n\t i = nbits(e[j]) - 1\n\t while (j >= 0) {\n\t if (i >= k1) w = (e[j] >> (i - k1)) & km\n\t else {\n\t w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n\t if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n\t }\n\n\t n = k\n\t while ((w & 1) == 0) {\n\t w >>= 1\n\t --n\n\t }\n\t if ((i -= n) < 0) {\n\t i += this.DB\n\t --j\n\t }\n\t if (is1) { // ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r)\n\t is1 = false\n\t } else {\n\t while (n > 1) {\n\t z.sqrTo(r, r2)\n\t z.sqrTo(r2, r)\n\t n -= 2\n\t }\n\t if (n > 0) z.sqrTo(r, r2)\n\t else {\n\t t = r\n\t r = r2\n\t r2 = t\n\t }\n\t z.mulTo(r2, g[w], r)\n\t }\n\n\t while (j >= 0 && (e[j] & (1 << i)) == 0) {\n\t z.sqrTo(r, r2)\n\t t = r\n\t r = r2\n\t r2 = t\n\t if (--i < 0) {\n\t i = this.DB - 1\n\t --j\n\t }\n\t }\n\t }\n\t return z.revert(r)\n\t}", "function bnModPow(e, m) {\n\t var i = e.bitLength(),\n\t k, r = nbv(1),\n\t z\n\t if (i <= 0) return r\n\t else if (i < 18) k = 1\n\t else if (i < 48) k = 3\n\t else if (i < 144) k = 4\n\t else if (i < 768) k = 5\n\t else k = 6\n\t if (i < 8)\n\t z = new Classic(m)\n\t else if (m.isEven())\n\t z = new Barrett(m)\n\t else\n\t z = new Montgomery(m)\n\n\t // precomputation\n\t var g = new Array(),\n\t n = 3,\n\t k1 = k - 1,\n\t km = (1 << k) - 1\n\t g[1] = z.convert(this)\n\t if (k > 1) {\n\t var g2 = new BigInteger()\n\t z.sqrTo(g[1], g2)\n\t while (n <= km) {\n\t g[n] = new BigInteger()\n\t z.mulTo(g2, g[n - 2], g[n])\n\t n += 2\n\t }\n\t }\n\n\t var j = e.t - 1,\n\t w, is1 = true,\n\t r2 = new BigInteger(),\n\t t\n\t i = nbits(e[j]) - 1\n\t while (j >= 0) {\n\t if (i >= k1) w = (e[j] >> (i - k1)) & km\n\t else {\n\t w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n\t if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n\t }\n\n\t n = k\n\t while ((w & 1) == 0) {\n\t w >>= 1\n\t --n\n\t }\n\t if ((i -= n) < 0) {\n\t i += this.DB\n\t --j\n\t }\n\t if (is1) { // ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r)\n\t is1 = false\n\t } else {\n\t while (n > 1) {\n\t z.sqrTo(r, r2)\n\t z.sqrTo(r2, r)\n\t n -= 2\n\t }\n\t if (n > 0) z.sqrTo(r, r2)\n\t else {\n\t t = r\n\t r = r2\n\t r2 = t\n\t }\n\t z.mulTo(r2, g[w], r)\n\t }\n\n\t while (j >= 0 && (e[j] & (1 << i)) == 0) {\n\t z.sqrTo(r, r2)\n\t t = r\n\t r = r2\n\t r2 = t\n\t if (--i < 0) {\n\t i = this.DB - 1\n\t --j\n\t }\n\t }\n\t }\n\t return z.revert(r)\n\t}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z;\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n if (i < 8) z = new Classic(m);else if (m.isEven()) z = new Barrett(m);else z = new Montgomery(m); // precomputation\n\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n n = k;\n\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n\n return z.revert(r);\n } // (public) gcd(this,a) (HAC 14.54)", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e,m) {\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t}", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e, m)\n{\n var i = e.bitLength(),\n k, r = nbv(1),\n z;\n if (i <= 0) return r;\n else if (i < 18) k = 1;\n else if (i < 48) k = 3;\n else if (i < 144) k = 4;\n else if (i < 768) k = 5;\n else k = 6;\n if (i < 8)\n z = new Classic(m);\n else if (m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1)\n {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km)\n {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n var j = e.t - 1,\n w, is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0)\n {\n if (i >= k1) w = (e[j] >> (i - k1)) & km;\n else\n {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\n }\n n = k;\n while ((w & 1) == 0)\n {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0)\n {\n i += this.DB;\n --j;\n }\n if (is1)\n { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else\n {\n while (n > 1)\n {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);\n else\n {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n while (j >= 0 && (e[j] & (1 << i)) == 0)\n {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0)\n {\n i = this.DB - 1;\n --j;\n }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e,m) {\n\tvar i = e.bitLength(), k, r = nbv(1), z;\n\tif(i <= 0) return r;\n\telse if(i < 18) k = 1;\n\telse if(i < 48) k = 3;\n\telse if(i < 144) k = 4;\n\telse if(i < 768) k = 5;\n\telse k = 6;\n\tif(i < 8)\n\t z = new Classic(m);\n\telse if(m.isEven())\n\t z = new Barrett(m);\n\telse\n\t z = new Montgomery(m);\n\n\t// precomputation\n\tvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\tg[1] = z.convert(this);\n\tif(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t}\n\n\tvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\ti = nbits(e.data[j])-1;\n\twhile(j >= 0) {\n\t if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n\t else {\n\t w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n\t }\n\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) { // ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t } else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\n\t while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t}\n\treturn z.revert(r);\n\t}", "function bnModPow(e,m) {\n\tvar i = e.bitLength(), k, r = nbv(1), z;\n\tif(i <= 0) return r;\n\telse if(i < 18) k = 1;\n\telse if(i < 48) k = 3;\n\telse if(i < 144) k = 4;\n\telse if(i < 768) k = 5;\n\telse k = 6;\n\tif(i < 8)\n\t z = new Classic(m);\n\telse if(m.isEven())\n\t z = new Barrett(m);\n\telse\n\t z = new Montgomery(m);\n\n\t// precomputation\n\tvar g = [], n = 3, k1 = k-1, km = (1<<k)-1;\n\tg[1] = z.convert(this);\n\tif(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t\tg[n] = nbi();\n\t\tz.mulTo(g2,g[n-2],g[n]);\n\t\tn += 2;\n\t }\n\t}\n\n\tvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\ti = nbits(e[j])-1;\n\twhile(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t\tw = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t\tif(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t\tg[w].copyTo(r);\n\t\tis1 = false;\n\t }\n\t else {\n\t\twhile(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t\tif(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t\tz.mulTo(r2,g[w],r);\n\t }\n\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t\tz.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t\tif(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t}\n\treturn z.revert(r);\n }", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z;\n if (i <= 0) return r;\n else if (i < 18) k = 1;\n else if (i < 48) k = 3;\n else if (i < 144) k = 4;\n else if (i < 768) k = 5;\n else k = 6;\n if (i < 8)\n z = new Classic(m);\n else if (m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km;\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);\n else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z;\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n if (i < 8) z = new Classic(m);else if (m.isEven()) z = new Barrett(m);else z = new Montgomery(m);\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = new BigInteger();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = new BigInteger();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = new BigInteger(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z;\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n if (i < 8) z = new Classic(m);else if (m.isEven()) z = new Barrett(m);else z = new Montgomery(m);\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;--n;\n }\n if ((i -= n) < 0) {\n i += this.DB;--j;\n }\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);z.sqrTo(r2, r);n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;r = r2;r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);t = r;r = r2;r2 = t;\n if (--i < 0) {\n i = this.DB - 1;--j;\n }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z;\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n if (i < 8) z = new Classic(m);else if (m.isEven()) z = new Barrett(m);else z = new Montgomery(m);\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;--n;\n }\n if ((i -= n) < 0) {\n i += this.DB;--j;\n }\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);z.sqrTo(r2, r);n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;r = r2;r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);t = r;r = r2;r2 = t;\n if (--i < 0) {\n i = this.DB - 1;--j;\n }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z;\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n if (i < 8) z = new Classic(m);else if (m.isEven()) z = new Barrett(m);else z = new Montgomery(m);\n\n // precomputation\n var g = [],\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;--n;\n }\n if ((i -= n) < 0) {\n i += this.DB;--j;\n }\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);z.sqrTo(r2, r);n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;r = r2;r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);t = r;r = r2;r2 = t;\n if (--i < 0) {\n i = this.DB - 1;--j;\n }\n }\n }\n return z.revert(r);\n }", "function am1(i,x,w,j,c,n){while(--n>=0){var v=x*this[i++]+w[j]+c;c=Math.floor(v/0x4000000);w[j++]=v&0x3ffffff;}return c;}// am2 avoids a big mult-and-extract completely.", "function bnpDivRemTo(m,q,r){var self=this;var pm=m.abs();if(pm.t<=0)return;var pt=self.abs();if(pt.t<pm.t){if(q!=null)q.fromInt(0);if(r!=null)self.copyTo(r);return;}if(r==null)r=new BigInteger();var y=new BigInteger(),ts=self.s,ms=m.s;var nsh=self.DB-nbits(pm[pm.t-1]);// normalize modulus\n\tif(nsh>0){pm.lShiftTo(nsh,y);pt.lShiftTo(nsh,r);}else{pm.copyTo(y);pt.copyTo(r);}var ys=y.t;var y0=y[ys-1];if(y0==0)return;var yt=y0*(1<<self.F1)+(ys>1?y[ys-2]>>self.F2:0);var d1=self.FV/yt,d2=(1<<self.F1)/yt,e=1<<self.F2;var i=r.t,j=i-ys,t=q==null?new BigInteger():q;y.dlShiftTo(j,t);if(r.compareTo(t)>=0){r[r.t++]=1;r.subTo(t,r);}BigInteger.ONE.dlShiftTo(ys,t);t.subTo(y,y);// \"negative\" y so we can replace sub with am later\n\twhile(y.t<ys)y[y.t++]=0;while(--j>=0){// Estimate quotient digit\n\tvar qd=r[--i]==y0?self.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);if((r[i]+=y.am(0,qd,r,j,0,ys))<qd){// Try it out\n\ty.dlShiftTo(j,t);r.subTo(t,r);while(r[i]<--qd)r.subTo(t,r);}}if(q!=null){r.drShiftTo(ys,q);if(ts!=ms)BigInteger.ZERO.subTo(q,q);}r.t=ys;r.clamp();if(nsh>0)r.rShiftTo(nsh,r);// Denormalize remainder\n\tif(ts<0)BigInteger.ZERO.subTo(r,r);}// (public) this mod a", "function bnModPow(e, m, callback) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z = new Montgomery(m);\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6; // precomputation\n\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n n = k;\n\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n\n var result = z.revert(r);\n callback(null, result);\n return result;\n} // protected", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }", "function twoToThe(m) {\n var b = Math.floor(m / bpe) + 2\n var t = new Array(b)\n for (var i = 0; i < b; i++) t[i] = 0\n t[b - 2] = 1 << (m % bpe)\n return t\n }", "function doubleHashPowerOf2(inputVal, showCounts) {\n var M = Number($('#M').val());\n\n // Test if its a valid power of 2\n if (!isPowerOf2(M)) {\n error(\"Please enter a valid power of 2 M\");\n // Return error\n return 1;\n }\n\n var stepSize = ((inputVal % (M / 2)) * 2) + 1;\n\n if (!showCounts) {\n jsav.umsg(\"Step size = ((Input Value % (M / 2)) * 2) + 1\");\n jsav.umsg(\"Step size = ((\" + inputVal + \" % (\" + M + \" / 2)) * 2) + 1 = \" + stepSize);\n }\n\n return stepSize;\n }", "function powMod(x,y,n) {\n var ans=expand(x,n.length); \n powMod_(ans,trim(y,2),trim(n,2),0); //this should work without the trim, but doesn't\n return trim(ans,1);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n\tvar pm = m.abs();\n\tif(pm.t <= 0) return;\n\tvar pt = this.abs();\n\tif(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t}\n\tif(r == null) r = nbi();\n\tvar y = nbi(), ts = this.s, ms = m.s;\n\tvar nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\tif(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\telse { pm.copyTo(y); pt.copyTo(r); }\n\tvar ys = y.t;\n\tvar y0 = y[ys-1];\n\tif(y0 == 0) return;\n\tvar yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\tvar d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\tvar i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\ty.dlShiftTo(j,t);\n\tif(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t}\n\tBigInteger.ONE.dlShiftTo(ys,t);\n\tt.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\twhile(y.t < ys) y[y.t++] = 0;\n\twhile(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t\ty.dlShiftTo(j,t);\n\t\tr.subTo(t,r);\n\t\twhile(r[i] < --qd) r.subTo(t,r);\n\t }\n\t}\n\tif(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t}\n\tr.t = ys;\n\tr.clamp();\n\tif(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\tif(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function displayDoubleTwo() {\n var output = \"\";\n var i = 2;\n while (i <= 65536) {\n output += i + \"\\n\";\n i *= 2;\n }\n return output;\n }", "function bnpDivRemTo(m, q, r) {\r\n\t var pm = m.abs();\r\n\t if (pm.t <= 0) return;\r\n\t var pt = this.abs();\r\n\t if (pt.t < pm.t) {\r\n\t if (q != null) q.fromInt(0);\r\n\t if (r != null) this.copyTo(r);\r\n\t return;\r\n\t }\r\n\t if (r == null) r = nbi();\r\n\t var y = nbi(), ts = this.s, ms = m.s;\r\n\t var nsh = this.DB - nbits(pm[pm.t - 1]);\t// normalize modulus\r\n\t if (nsh > 0) {\r\n\t pm.lShiftTo(nsh, y);\r\n\t pt.lShiftTo(nsh, r);\r\n\t }\r\n\t else {\r\n\t pm.copyTo(y);\r\n\t pt.copyTo(r);\r\n\t }\r\n\t var ys = y.t;\r\n\t var y0 = y[ys - 1];\r\n\t if (y0 === 0) return;\r\n\t var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\r\n\t var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\r\n\t var i = r.t, j = i - ys, t = (q == null) ? nbi() : q;\r\n\t y.dlShiftTo(j, t);\r\n\t if (r.compareTo(t) >= 0) {\r\n\t r[r.t++] = 1;\r\n\t r.subTo(t, r);\r\n\t }\r\n\t BigInteger$4.ONE.dlShiftTo(ys, t);\r\n\t t.subTo(y, y);\t// \"negative\" y so we can replace sub with am later\r\n\t while (y.t < ys) y[y.t++] = 0;\r\n\t while (--j >= 0) {\r\n\t // Estimate quotient digit\r\n\t var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\r\n\t if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\t// Try it out\r\n\t y.dlShiftTo(j, t);\r\n\t r.subTo(t, r);\r\n\t while (r[i] < --qd) r.subTo(t, r);\r\n\t }\r\n\t }\r\n\t if (q != null) {\r\n\t r.drShiftTo(ys, q);\r\n\t if (ts != ms) BigInteger$4.ZERO.subTo(q, q);\r\n\t }\r\n\t r.t = ys;\r\n\t r.clamp();\r\n\t if (nsh > 0) r.rShiftTo(nsh, r);\t// Denormalize remainder\r\n\t if (ts < 0) BigInteger$4.ZERO.subTo(r, r);\r\n\t}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }", "function bnpDivRemTo(m, q, r)\n{\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t)\n {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n if (nsh > 0)\n {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n }\n else\n {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = (q == null) ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0)\n {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0)\n {\n // Estimate quotient digit\n var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd)\n { // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null)\n {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n}", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y.data[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r.data[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger$4.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y.data[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n\t if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r.data[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger$4.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger$4.ZERO.subTo(r,r);\n\t}", "function getLevel2(exp) {\n return exp <= 1 ? 1 : Math.floor(1 + REVERSE_PQ_PREFIX + Math.sqrt(REVERSE_CONST + GROWTH_DIVIDES_2 * exp));\n}", "gf_mult(a, b, m) {\n let res = 0;\n while (b !== 0) {\n if ((b & 1) !== 0)\n res ^= a;\n a <<= 1;\n b >>>= 1;\n if (a >= 256)\n a ^= m;\n }\n return res;\n }", "function bnpDivRemTo(m, q, r) {\r\n\t var pm = m.abs();\r\n\t if (pm.t <= 0) return;\r\n\t var pt = this.abs();\r\n\t if (pt.t < pm.t) {\r\n\t if (q != null) q.fromInt(0);\r\n\t if (r != null) this.copyTo(r);\r\n\t return;\r\n\t }\r\n\t if (r == null) r = nbi();\r\n\t var y = nbi(), ts = this.s, ms = m.s;\r\n\t var nsh = this.DB - nbits(pm[pm.t - 1]);\t// normalize modulus\r\n\t if (nsh > 0) {\r\n\t pm.lShiftTo(nsh, y);\r\n\t pt.lShiftTo(nsh, r);\r\n\t }\r\n\t else {\r\n\t pm.copyTo(y);\r\n\t pt.copyTo(r);\r\n\t }\r\n\t var ys = y.t;\r\n\t var y0 = y[ys - 1];\r\n\t if (y0 === 0) return;\r\n\t var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\r\n\t var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\r\n\t var i = r.t, j = i - ys, t = (q == null) ? nbi() : q;\r\n\t y.dlShiftTo(j, t);\r\n\t if (r.compareTo(t) >= 0) {\r\n\t r[r.t++] = 1;\r\n\t r.subTo(t, r);\r\n\t }\r\n\t BigInteger.ONE.dlShiftTo(ys, t);\r\n\t t.subTo(y, y);\t// \"negative\" y so we can replace sub with am later\r\n\t while (y.t < ys) y[y.t++] = 0;\r\n\t while (--j >= 0) {\r\n\t // Estimate quotient digit\r\n\t var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\r\n\t if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\t// Try it out\r\n\t y.dlShiftTo(j, t);\r\n\t r.subTo(t, r);\r\n\t while (r[i] < --qd) r.subTo(t, r);\r\n\t }\r\n\t }\r\n\t if (q != null) {\r\n\t r.drShiftTo(ys, q);\r\n\t if (ts != ms) BigInteger.ZERO.subTo(q, q);\r\n\t }\r\n\t r.t = ys;\r\n\t r.clamp();\r\n\t if (nsh > 0) r.rShiftTo(nsh, r);\t// Denormalize remainder\r\n\t if (ts < 0) BigInteger.ZERO.subTo(r, r);\r\n\t}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }" ]
[ "0.6254393", "0.61926866", "0.61926866", "0.61926866", "0.61926866", "0.61926866", "0.61926866", "0.61926866", "0.612913", "0.612913", "0.6126345", "0.61167604", "0.608618", "0.60735345", "0.60735345", "0.60735345", "0.60735345", "0.60735345", "0.60735345", "0.60735345", "0.60587305", "0.6051277", "0.602932", "0.602858", "0.602858", "0.6027796", "0.6027787", "0.6027787", "0.602721", "0.6013956", "0.6013956", "0.6013956", "0.6013956", "0.6013956", "0.60059947", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5998311", "0.5996966", "0.59698373", "0.5932798", "0.59186316", "0.59164786", "0.5902105", "0.5902105", "0.58587325", "0.56966144", "0.5638289", "0.5613424", "0.556559", "0.556559", "0.5560654", "0.5531339", "0.55135375", "0.5510478", "0.5510478", "0.55075276", "0.55060035", "0.5489476", "0.5489148", "0.5489148", "0.5489148", "0.5489148", "0.5489148", "0.5489148", "0.5489148", "0.5473108", "0.5473052", "0.54704416", "0.5469315", "0.546738", "0.5462654", "0.5461257", "0.5461257", "0.5461257", "0.5461257", "0.5461257", "0.5461257", "0.5461257", "0.5461257", "0.5461257", "0.5461257", "0.5461257" ]
0.0
-1
x = x/R mod m (HAC 14.32)
function montReduce(x) { while(x.t <= this.mt2) // pad x so am has enough room later x[x.t++] = 0; for(var i = 0; i < this.m.t; ++i) { // faster way of calculating u0 = x[i]*mp mod DV var j = x[i]&0x7fff; var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM; // use am to combine the multiply-shift-add into one call j = i+this.m.t; x[j] += this.m.am(0,u0,x,i,0,this.m.t); // propagate carry while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; } } x.clamp(); x.drShiftTo(this.m.t,x); if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mod(x, m) {\n return ((x % m) + m) % m;\n}", "function mod(x, m) {\n return ((x % m) + m) % m;\n}", "function mod (num, m) { return ((num % m) + m) % m; }", "function mod (num, m) { return ((num % m) + m) % m; }", "function mod (num, m) { return ((num % m) + m) % m; }", "function gmod(n,m){ return ((n%m)+m)%m; }", "function mod(n, m) {\r\n return ((n % m) + m) % m;\r\n}", "function mod(num, m) {\n return ((num % m) + m) % m;\n }", "function modinv(x, m)\n{\n // calculate a,b such that a*x+b*m = g\n var [g, a, b] = GCD(x,m);\n if (a<numzero(a)) return a+m;\n return a;\n}", "_mod(val) {\n if (this.pillar === false) return val\n return (val + this.largezero) % this.width\n }", "function mod (n, m) {\n return ((n % m) + m) % m\n}", "mod(n, m) {\n\t\treturn ((n % m) + m) % m;\n\t}", "mod(n, m) {\n\t\treturn ((n % m) + m) % m;\n\t}", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y.data[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r.data[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger$4.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y.data[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n\t if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r.data[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger$4.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger$4.ZERO.subTo(r,r);\n\t}", "_mod(val) {\r\n if (this.pillar === false) return val\r\n return (val + this.largezero) % this.grid.length\r\n }", "function mod(n, m) {\n return ((n % m) + m) % m\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function mod(n, m) {\n return ((n % m) + m) % m;\n }", "function mod(n, m)\n{\n\treturn ((n % m) + m) % m;\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }", "function mod(n, m) {\n return ((n % m) + m) % m\n}", "function bnpDivRemTo(m,q,r) {\n\tvar pm = m.abs();\n\tif(pm.t <= 0) return;\n\tvar pt = this.abs();\n\tif(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t}\n\tif(r == null) r = nbi();\n\tvar y = nbi(), ts = this.s, ms = m.s;\n\tvar nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\tif(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\telse { pm.copyTo(y); pt.copyTo(r); }\n\tvar ys = y.t;\n\tvar y0 = y[ys-1];\n\tif(y0 == 0) return;\n\tvar yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\tvar d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\tvar i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\ty.dlShiftTo(j,t);\n\tif(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t}\n\tBigInteger.ONE.dlShiftTo(ys,t);\n\tt.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\twhile(y.t < ys) y[y.t++] = 0;\n\twhile(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t\ty.dlShiftTo(j,t);\n\t\tr.subTo(t,r);\n\t\twhile(r[i] < --qd) r.subTo(t,r);\n\t }\n\t}\n\tif(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t}\n\tr.t = ys;\n\tr.clamp();\n\tif(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\tif(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function mod(n, m) {\n return ((n % m) + m) % m;\n}", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t}", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }", "function bnpDivRemTo(m, q, r) {\r\n\t var pm = m.abs();\r\n\t if (pm.t <= 0) return;\r\n\t var pt = this.abs();\r\n\t if (pt.t < pm.t) {\r\n\t if (q != null) q.fromInt(0);\r\n\t if (r != null) this.copyTo(r);\r\n\t return;\r\n\t }\r\n\t if (r == null) r = nbi();\r\n\t var y = nbi(), ts = this.s, ms = m.s;\r\n\t var nsh = this.DB - nbits(pm[pm.t - 1]);\t// normalize modulus\r\n\t if (nsh > 0) {\r\n\t pm.lShiftTo(nsh, y);\r\n\t pt.lShiftTo(nsh, r);\r\n\t }\r\n\t else {\r\n\t pm.copyTo(y);\r\n\t pt.copyTo(r);\r\n\t }\r\n\t var ys = y.t;\r\n\t var y0 = y[ys - 1];\r\n\t if (y0 === 0) return;\r\n\t var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\r\n\t var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\r\n\t var i = r.t, j = i - ys, t = (q == null) ? nbi() : q;\r\n\t y.dlShiftTo(j, t);\r\n\t if (r.compareTo(t) >= 0) {\r\n\t r[r.t++] = 1;\r\n\t r.subTo(t, r);\r\n\t }\r\n\t BigInteger.ONE.dlShiftTo(ys, t);\r\n\t t.subTo(y, y);\t// \"negative\" y so we can replace sub with am later\r\n\t while (y.t < ys) y[y.t++] = 0;\r\n\t while (--j >= 0) {\r\n\t // Estimate quotient digit\r\n\t var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\r\n\t if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\t// Try it out\r\n\t y.dlShiftTo(j, t);\r\n\t r.subTo(t, r);\r\n\t while (r[i] < --qd) r.subTo(t, r);\r\n\t }\r\n\t }\r\n\t if (q != null) {\r\n\t r.drShiftTo(ys, q);\r\n\t if (ts != ms) BigInteger.ZERO.subTo(q, q);\r\n\t }\r\n\t r.t = ys;\r\n\t r.clamp();\r\n\t if (nsh > 0) r.rShiftTo(nsh, r);\t// Denormalize remainder\r\n\t if (ts < 0) BigInteger.ZERO.subTo(r, r);\r\n\t}", "function M(t,n,r){return c$7(O,n,t),c$7(V,r,t),s$5(_$1(O,O,V))/2}", "function bnpDivRemTo(m, q, r) {\r\n\t var pm = m.abs();\r\n\t if (pm.t <= 0) return;\r\n\t var pt = this.abs();\r\n\t if (pt.t < pm.t) {\r\n\t if (q != null) q.fromInt(0);\r\n\t if (r != null) this.copyTo(r);\r\n\t return;\r\n\t }\r\n\t if (r == null) r = nbi();\r\n\t var y = nbi(), ts = this.s, ms = m.s;\r\n\t var nsh = this.DB - nbits(pm[pm.t - 1]);\t// normalize modulus\r\n\t if (nsh > 0) {\r\n\t pm.lShiftTo(nsh, y);\r\n\t pt.lShiftTo(nsh, r);\r\n\t }\r\n\t else {\r\n\t pm.copyTo(y);\r\n\t pt.copyTo(r);\r\n\t }\r\n\t var ys = y.t;\r\n\t var y0 = y[ys - 1];\r\n\t if (y0 === 0) return;\r\n\t var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\r\n\t var d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2;\r\n\t var i = r.t, j = i - ys, t = (q == null) ? nbi() : q;\r\n\t y.dlShiftTo(j, t);\r\n\t if (r.compareTo(t) >= 0) {\r\n\t r[r.t++] = 1;\r\n\t r.subTo(t, r);\r\n\t }\r\n\t BigInteger$4.ONE.dlShiftTo(ys, t);\r\n\t t.subTo(y, y);\t// \"negative\" y so we can replace sub with am later\r\n\t while (y.t < ys) y[y.t++] = 0;\r\n\t while (--j >= 0) {\r\n\t // Estimate quotient digit\r\n\t var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\r\n\t if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\t// Try it out\r\n\t y.dlShiftTo(j, t);\r\n\t r.subTo(t, r);\r\n\t while (r[i] < --qd) r.subTo(t, r);\r\n\t }\r\n\t }\r\n\t if (q != null) {\r\n\t r.drShiftTo(ys, q);\r\n\t if (ts != ms) BigInteger$4.ZERO.subTo(q, q);\r\n\t }\r\n\t r.t = ys;\r\n\t r.clamp();\r\n\t if (nsh > 0) r.rShiftTo(nsh, r);\t// Denormalize remainder\r\n\t if (ts < 0) BigInteger$4.ZERO.subTo(r, r);\r\n\t}", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t\tif(q != null) q._fromInt(0);\n\t\tif(r != null) this._copyTo(r);\n\t\treturn;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this._DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm._lShiftTo(nsh,y); pt._lShiftTo(nsh,r); }\n\t else { pm._copyTo(y); pt._copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this._F1)+((ys>1)?y[ys-2]>>this._F2:0);\n\t var d1 = this._FV/yt, d2 = (1<<this._F1)/yt, e = 1<<this._F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y._dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t\tr[r.t++] = 1;\n\t\tr._subTo(t,r);\n\t }\n\t BigInteger.ONE._dlShiftTo(ys,t);\n\t t._subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t\t// Estimate quotient digit\n\t\tvar qd = (r[--i]==y0)?this._DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t\tif((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t\t y._dlShiftTo(j,t);\n\t\t r._subTo(t,r);\n\t\t while(r[i] < --qd) r._subTo(t,r);\n\t\t}\n\t }\n\t if(q != null) {\n\t\tr._drShiftTo(ys,q);\n\t\tif(ts != ms) BigInteger.ZERO._subTo(q,q);\n\t }\n\t r.t = ys;\n\t r._clamp();\n\t if(nsh > 0) r._rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO._subTo(r,r);\n\t}", "function mod(n, m) {\n return ((n % m) + m) % m;\n}", "function mod(n, m) {\n return ((n % m) + m) % m;\n}" ]
[ "0.7431943", "0.7431943", "0.693809", "0.693809", "0.693809", "0.690342", "0.67674375", "0.67412084", "0.6713338", "0.66939044", "0.6662061", "0.6656487", "0.6656487", "0.6651071", "0.66479003", "0.6630517", "0.66261876", "0.66261876", "0.6622791", "0.6610281", "0.6607287", "0.6607287", "0.6607287", "0.6607287", "0.6607287", "0.6607287", "0.6607287", "0.66072315", "0.66072315", "0.6598305", "0.6595426", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.65743506", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6572307", "0.6568756", "0.6568756", "0.6568756", "0.6568756", "0.6568756", "0.6568756", "0.6568756", "0.6568756", "0.6568756", "0.6564348", "0.65615046", "0.65559167", "0.65542567", "0.6547853", "0.65462554", "0.654267", "0.6534141", "0.6534141" ]
0.0
-1
r = "x^2/R mod m"; x != r
function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mod(x, m) {\n return ((x % m) + m) % m;\n}", "function mod(x, m) {\n return ((x % m) + m) % m;\n}", "stringX() {return this.x - 0.5*this.r/2;}", "function modinv(x, m)\n{\n // calculate a,b such that a*x+b*m = g\n var [g, a, b] = GCD(x,m);\n if (a<numzero(a)) return a+m;\n return a;\n}", "function r(o,M){var D=o.split(\"_\");return M%10==1&&M%100!=11?D[0]:M%10>=2&&M%10<=4&&(M%100<10||M%100>=20)?D[1]:D[2]}", "function reciprocalMod(x, mod) {\n if (!(0n <= x && x < mod))\n throw RangeError();\n // Based on a simplification of the extended Euclidean algorithm\n let y = x;\n x = mod;\n let a = 0n;\n let b = 1n;\n while (y != 0n) {\n let temp = a - x / y * b;\n a = b;\n b = temp;\n temp = x % y;\n x = y;\n y = temp;\n }\n if (x == 1n)\n return ((a % mod) + mod) % mod;\n else\n throw new RangeError(\"Reciprocal does not exist\");\n }", "function modular (x, y) {\n var answer = x % y\n return answer\n}", "function equation(s) {\n return eval(s)\n}", "function qr(n){return null==n}", "function r$2(r,t){let n=0,o=\"\",e=0,f=0;const c=r.length;for(;n<c;)f=r[n++],e=f>>4,e<8?e=1:15===e?(e=4,f=(7&f)<<18|(63&r[n++])<<12|(63&r[n++])<<6|63&r[n++]):14===e?(e=3,f=(15&f)<<12|(63&r[n++])<<6|63&r[n++]):(e=2,f=(31&f)<<6|63&r[n++]),(0!==f||t)&&(o+=String.fromCharCode(f));return o}", "function Armstrong(x){\n let arr = x.toString().split('')\n let arr1= arr.map(x=>Math.pow(x,arr.length))\n let narr = arr1.reduce(function(a,b){\n return a+b\n })\n // return narr\n if(narr == x ){\n return true\n }\n else{\n return false\n }\n}", "function gmod(n,m){ return ((n%m)+m)%m; }", "function evaluate(str) {\n\n if ( (/[\\+\\-\\x\\÷]{2}/).test(str) ) {\n return 'Error';\n }\n let newStr = str.replace('x', '*').replace('÷', '/');\n let evalStr = eval(newStr);\n console.log(typeof(evalStr));\n if (typeof(evalStr) === 'number' && evalStr !== Infinity) {\n return evalStr;\n } else {\n return 'Error';\n }\n}", "function mod() {\n alert(x % y % z);\n}", "function caml_int64_mod (x, y)\n{\n if (caml_int64_is_zero (y)) caml_raise_zero_divide ();\n var sign = x[3] ^ y[3];\n if (x[3] & 0x8000) x = caml_int64_neg(x);\n if (y[3] & 0x8000) y = caml_int64_neg(y);\n var r = caml_int64_udivmod(x, y)[2];\n if (sign & 0x8000) r = caml_int64_neg(r);\n return r;\n}", "function mod (num, m) { return ((num % m) + m) % m; }", "function mod (num, m) { return ((num % m) + m) % m; }", "function mod (num, m) { return ((num % m) + m) % m; }", "function caml_mod(x,y) {\n if (y == 0) caml_raise_zero_divide ();\n return x%y;\n}", "function operator(){\r\n var x = Math.floor((Math.random()*4)+1);\r\n\r\n switch (x){\r\n case 1:\r\n return op=\"+\";\r\n case 2:\r\n return op = \"-\";\r\n case 3:\r\n return op = \"*\";\r\n case 4:\r\n return op = \"/\";\r\n }\r\n}", "mod(n, m) {\n\t\treturn ((n % m) + m) % m;\n\t}", "mod(n, m) {\n\t\treturn ((n % m) + m) % m;\n\t}", "function final_r(x) {\r\n return x === 't' || x === 'g' ?\r\n (total_sum + 4) % 11 :\r\n total_sum % 11; \r\n }", "function mod(n, m) {\r\n return ((n % m) + m) % m;\r\n}", "function r(e,t){if(t===e)return!0;if(0===e.indexOf(t)){if(\"/\"===t.substr(-1))return!0;if(\"/\"===e.substr(t.length,1))return!0}return!1}", "function r(e,t){if(t===e)return!0;if(0===e.indexOf(t)){if(\"/\"===t.substr(-1))return!0;if(\"/\"===e.substr(t.length,1))return!0}return!1}", "function math(m, b){\n return (-1 * b)/m\n}", "function createModEvaluator(leftNode, rightNode) {\n var $1 = createEvaluator(leftNode)\n , $2 = createEvaluator(rightNode)\n , type = getBinaryType($1, $2);\n\n return [null, modLeft, modRight, modBoth][type] || ($1 % $2);\n\n function modLeft(c, w) { return $1(c, w) % $2; }\n function modRight(c, w) { return $1 % $2(c, w); }\n function modBoth(c, w) { return $1(c, w) % $2(c, w); }\n }", "function euclideanModulo( n, m ) {\n\n\treturn ( ( n % m ) + m ) % m;\n\n}", "function MMI(a, b) {\r\n // sOld will be the MMI of a (mod b), tOld will be MMI of b (mod a)\r\n // uses euler's extended algorithm\r\n var rOld = a; var r = b;\r\n var sOld = 1n; var s = 0n;\r\n var tOld = 0n; var t = 1n;\r\n \r\n while (r !== 0n) {\r\n var div = rOld / r;\r\n var rNew = rOld - (div * r); rOld = r; r = rNew;\r\n var sNew = sOld - (div * s); sOld = s; s = sNew;\r\n var tNew = tOld - (div * t); tOld = t; t = tNew;\r\n }\r\n \r\n //console.log(\"MMI of a (mod b) = \" + sOld);\r\n //console.log(\"MMI of b (mod a) = \" + tOld);\r\n //console.log(\"GCD: \" + rOld);\r\n \r\n return sOld;\r\n}", "function rpn(input){\n var result = [];\n input = Array.from(input);\n for (var i = 0; i < input.length + 1; i++) {\n if (input[i] == \"x\") {\n input[i] = \" \";\n result.push(\"*\");\n console.log(input);\n continue;\n }else if (input[i] == \"/\") {\n input[i] = \" \";\n result.push(\"/\");\n continue;\n }else if (input[i] == \"+\") {\n input[i] = \" \";\n result.push(\"+\");\n continue;\n }else if (input[i] == \"-\") {\n input[i] = \" \";\n result.push(\"-\");\n continue;\n }\n }\n for (var i = 0; i < result.length; i++) {\n if (result[i] == \"+\" || result[i] == \"-\") {\n result.push(result[i]);\n }\n }\n var x = input.join(\"\");\n console.log(x);\n x = x.split(\" \")\n console.log(x);\n // x.reverse();\n console.log(x);\n for (var i = 0; i < result.length; i++) {\n x.push(result[i])\n }\n result = x.join(\" \");\n console.log(result);\nreturn evaluate(result);\n }", "function mod_(x, n) {\n if (s4.length != x.length)\n s4 = dup(x);\n else\n copy_(s4, x);\n if (s5.length != x.length)\n s5 = dup(x);\n divide_(s4, n, s5, x); //x = remainder of s4 / n\n }", "function mod(num, m) {\n return ((num % m) + m) % m;\n }", "function mod_(x,n) {\n if (s4.length!=x.length)\n s4=dup(x);\n else\n copy_(s4,x);\n if (s5.length!=x.length)\n s5=dup(x); \n divide_(s4,n,s5,x); //x = remainder of s4 / n\n }", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t\tif(q != null) q._fromInt(0);\n\t\tif(r != null) this._copyTo(r);\n\t\treturn;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this._DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm._lShiftTo(nsh,y); pt._lShiftTo(nsh,r); }\n\t else { pm._copyTo(y); pt._copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this._F1)+((ys>1)?y[ys-2]>>this._F2:0);\n\t var d1 = this._FV/yt, d2 = (1<<this._F1)/yt, e = 1<<this._F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y._dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t\tr[r.t++] = 1;\n\t\tr._subTo(t,r);\n\t }\n\t BigInteger.ONE._dlShiftTo(ys,t);\n\t t._subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t\t// Estimate quotient digit\n\t\tvar qd = (r[--i]==y0)?this._DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t\tif((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t\t y._dlShiftTo(j,t);\n\t\t r._subTo(t,r);\n\t\t while(r[i] < --qd) r._subTo(t,r);\n\t\t}\n\t }\n\t if(q != null) {\n\t\tr._drShiftTo(ys,q);\n\t\tif(ts != ms) BigInteger.ZERO._subTo(q,q);\n\t }\n\t r.t = ys;\n\t r._clamp();\n\t if(nsh > 0) r._rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO._subTo(r,r);\n\t}", "function mod(n, m)\n{\n\treturn ((n % m) + m) % m;\n}", "function strRotation(input1, input2) {\n const rotation = input1 + input2;\n return rotation.includes(input1);\n}", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y.data[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r.data[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger$4.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y.data[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n\t if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r.data[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger$4.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger$4.ZERO.subTo(r,r);\n\t}", "function r(a){return a%100==11?!0:a%10!=1}", "function evalInput(input) {\r\n output = \"\";\r\n\r\n let hasOperator = /\\D/.exec(input) == null ? false : true;\r\n let firstOperatorIndex = hasOperator ? /\\D/.exec(input).index + 1 : null;\r\n let InputLength = input.length;\r\n input = input.replace(/×/g, \"*\");\r\n input = input.replace(/÷/g, \"/\");\r\n\r\n if (!(firstOperatorIndex < InputLength)) {\r\n output = \"\";\r\n } else if (input[InputLength - 1] in operators) {\r\n input = input.substring(0, InputLength - 1);\r\n output += eval(input);\r\n } else if (hasOperator) {\r\n output += eval(input);\r\n } else {\r\n output = \"\";\r\n }\r\n return output;\r\n}", "invmod(x, y) {\n var q, u, v, a, c, t;\n u = x;\n v = y;\n c = 1;\n a = 0;\n while (u != 0) {\n t = Integer.fdivrem(v, u);\n q = t[0];\n v = u;\n u = t[1];\n t = c;\n c = a - q * c;\n a = t;\n }\n /* v = gcd(x, y) */\n if (v != 1)\n throw RangeError(\"not invertible\");\n return a % y;\n }", "function equation(s) {\n return eval(s);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function mod(n, m) {\n return ((n % m) + m) % m\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function mod (n, m) {\n return ((n % m) + m) % m\n}", "function testModifier(modNumber) {\n\t\tx = this.funcOldString.replace(this.modifiers[modNumber][0], this.modifiers[modNumber][1]);\n\t\tif (x != this.funcOldString) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }" ]
[ "0.57992804", "0.57992804", "0.5396208", "0.53722554", "0.5308139", "0.5304197", "0.5266612", "0.5257362", "0.52149075", "0.5205655", "0.51960933", "0.51890075", "0.51733774", "0.51677334", "0.51573604", "0.5148757", "0.5148757", "0.5148757", "0.51472664", "0.5130833", "0.5120329", "0.5120329", "0.51202285", "0.5115019", "0.509935", "0.509935", "0.50786924", "0.5077873", "0.5072395", "0.50708324", "0.50688356", "0.50671184", "0.50668347", "0.5066207", "0.5063405", "0.50605345", "0.5052694", "0.5047083", "0.5041967", "0.50403154", "0.5037415", "0.50367355", "0.5035833", "0.5035833", "0.5035006", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.5027726", "0.50256264", "0.5023067", "0.50223047", "0.50223047", "0.50223047", "0.50223047", "0.50223047", "0.50223047", "0.50223047", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503", "0.501503" ]
0.0
-1
r = "xy/R mod m"; x,y != r
function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function r(r,o,a,s){e=r,t=a,n=-3*r+3*o-2*a-s,i=2*r-2*o+a+s}", "function r(o,M){var D=o.split(\"_\");return M%10==1&&M%100!=11?D[0]:M%10>=2&&M%10<=4&&(M%100<10||M%100>=20)?D[1]:D[2]}", "function mod(x, m) {\n return ((x % m) + m) % m;\n}", "function mod(x, m) {\n return ((x % m) + m) % m;\n}", "stringX() {return this.x - 0.5*this.r/2;}", "function caml_int64_mod (x, y)\n{\n if (caml_int64_is_zero (y)) caml_raise_zero_divide ();\n var sign = x[3] ^ y[3];\n if (x[3] & 0x8000) x = caml_int64_neg(x);\n if (y[3] & 0x8000) y = caml_int64_neg(y);\n var r = caml_int64_udivmod(x, y)[2];\n if (sign & 0x8000) r = caml_int64_neg(r);\n return r;\n}", "function normal_equations(x, y, m) {\n out.cyan('Normal Equations:');\n out.red(`${s}a + ${p}b = ${r}`);\n out.green(`${p}a + ${(m + 1)}b = ${q}`);\n}", "static setMat4x4Rot(m, r) {\nreturn r.toRotMat4x4(m);\n}", "setExtractRotX() {\nvar c, d, s;\n//-------------\ns = this.xyzw[0];\nc = this.xyzw[3];\nd = Math.sqrt(s * s + c * c);\nreturn this.set_xyzw(s / d, 0, 0, c / d);\n}", "function isRotation(str1, str2) {\n // your code here\n }", "function r(e,t){if(t===e)return!0;if(0===e.indexOf(t)){if(\"/\"===t.substr(-1))return!0;if(\"/\"===e.substr(t.length,1))return!0}return!1}", "function r(e,t){if(t===e)return!0;if(0===e.indexOf(t)){if(\"/\"===t.substr(-1))return!0;if(\"/\"===e.substr(t.length,1))return!0}return!1}", "mod(x, y) {\n return (x % y + y) % y;\n }", "mDiff(r) {\n\t\tvar orig = new Vector (r.origin.x - this.origin.x - this.width,\n\t\tr.origin.y - this.origin.y - this.height);\n \treturn new Rect(orig, this.width + r.width, this.height + r.height);\n\t}", "function gmod(n,m){ return ((n%m)+m)%m; }", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t\tif(q != null) q._fromInt(0);\n\t\tif(r != null) this._copyTo(r);\n\t\treturn;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this._DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm._lShiftTo(nsh,y); pt._lShiftTo(nsh,r); }\n\t else { pm._copyTo(y); pt._copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this._F1)+((ys>1)?y[ys-2]>>this._F2:0);\n\t var d1 = this._FV/yt, d2 = (1<<this._F1)/yt, e = 1<<this._F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y._dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t\tr[r.t++] = 1;\n\t\tr._subTo(t,r);\n\t }\n\t BigInteger.ONE._dlShiftTo(ys,t);\n\t t._subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t\t// Estimate quotient digit\n\t\tvar qd = (r[--i]==y0)?this._DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t\tif((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t\t y._dlShiftTo(j,t);\n\t\t r._subTo(t,r);\n\t\t while(r[i] < --qd) r._subTo(t,r);\n\t\t}\n\t }\n\t if(q != null) {\n\t\tr._drShiftTo(ys,q);\n\t\tif(ts != ms) BigInteger.ZERO._subTo(q,q);\n\t }\n\t r.t = ys;\n\t r._clamp();\n\t if(nsh > 0) r._rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO._subTo(r,r);\n\t}", "function getRotMatrix(p, str){\n switch(str)\n {case \"x\":\n var obj = new THREE.Matrix4().set(1, 0, 0, 0, \n 0, Math.cos(p),-Math.sin(p), 0, \n 0, Math.sin(p), Math.cos(p), 0,\n 0, 0, 0, 1);\n return obj;\n break;\n\n case \"y\":\n var obj = new THREE.Matrix4().set(Math.cos(p), 0, -Math.sin(p), 0, \n 0, 1, 0, 0, \n Math.sin(p), 0, Math.cos(p), 0,\n 0, 0, 0, 1);\n return obj;\n break;\n\n case \"z\":\n var obj = new THREE.Matrix4().set(Math.cos(p), -Math.sin(p), 0, 0, \n Math.sin(p), Math.cos(p), 0, 0, \n 0, 0, 1, 0,\n 0, 0, 0, 1);\n return obj;\n break;\n\n\n default:\n break;\n\n }\n\n}", "function remainder(x, y) {\n return x % y;\n }", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y.data[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r.data[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger$4.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y.data[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n\t if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r.data[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger$4.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger$4.ZERO.subTo(r,r);\n\t}", "function remainder(x, y) {\nreturn x%y;\n}", "function caml_mod(x,y) {\n if (y == 0) caml_raise_zero_divide ();\n return x%y;\n}", "function stringRotationSpace(str1, str2) {\n if (str1 === str2) return true;\n if (str1.length !== str2.length) return false;\n let pointer1 = 0;\n let pointer2 = 0;\n let rotatePoint;\n while (pointer2 < str2.length) {\n if (str1[0] !== str2[pointer2]) {\n pointer2++;\n } else {\n rotatePointer = pointer2;\n break;\n }\n }\n while (pointer1 < str1.length && pointer2 - rotatePointer < str2.length) {\n if (str1[pointer1] === str2[pointer2 % str2.length]) pointer1++;\n pointer2++;\n }\n if (pointer1 === str1.length) return true;\n return false;\n}", "function r({w,r,x=10,y=20}){\n return w+r+x+y;\n }", "function bnpDivRemTo(o,m,q,r) {\r\n var pm = abs(m);\r\n if(pm.t <= 0) return;\r\n var pt = abs(o);\r\n if(pt.t < pm.t) {\r\n //if(q != null) // dead code?\r\n fromInt(q,0);\r\n if(r != null) copyTo(o,r);\r\n return;\r\n }\r\n if(r == null) r = [];\r\n var y = [], ts = o.s, ms = m.s;\r\n var nsh = DB-nbits(pm[pm.t-1]);\t// normalize modulus\r\n if(nsh > 0) { bnpLShiftTo(pm,nsh,y); bnpLShiftTo(pt,nsh,r); }\r\n else { copyTo(pm,y); copyTo(pt,r); }\r\n var ys = y.t;\r\n var y0 = y[ys-1];\r\n if(y0 == 0) return;\r\n var yt = y0*(1<<F1)+((ys>1)?y[ys-2]>>F2:0);\r\n var d1 = FV/yt, d2 = (1<<F1)/yt, e = 1<<F2;\r\n var i = r.t, j = i-ys, t = bnpDLShift(y,j);\r\n if(bnCompareTo(r,t) >= 0) {\r\n r[r.t++] = 1;\r\n bnpSubTo(r,t,r);\r\n }\r\n t = bnpDLShift(ONE,ys);\r\n bnpSubTo(t,y,y);\t// \"negative\" y so we can replace sub with am later\r\n while(y.t < ys) y[y.t++] = 0;\r\n while(--j >= 0) {\r\n // Estimate quotient digit\r\n var qd = (r[--i]==y0)?DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\r\n if((r[i]+=am(y,0,qd,r,j,0,ys)) < qd) {\t// Try it out\r\n t = bnpDLShift(y,j);\r\n bnpSubTo(r,t,r);\r\n while(r[i] < --qd) bnpSubTo(r,t,r);\r\n }\r\n }\r\n if(q != null) {\r\n bnpDRShiftTo(r,ys,q);\r\n if(ts != ms) bnpSubTo(ZERO,q,q);\r\n }\r\n r.t = ys;\r\n clamp(r);\r\n if(nsh > 0) bnpRShiftTo(r,nsh,r);\t// Denormalize remainder\r\n if(ts < 0) bnpSubTo(ZERO,r,r);\r\n}", "function limitR(r) {\n return (r + 360) % 360;\n }", "function isRotation(str1, str2) {\n\n\tif (str1.length !== str2.length) return false;\n\n\tlet double = str1 + str1;\n\n\treturn double.includes(str2)\n\n}", "function modulus (x, y) {\n\treturn x % y;\n}", "function modular (x, y) {\n var answer = x % y\n return answer\n}", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t}", "function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\t var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\t y.dlShiftTo(j,t);\n\t if(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }", "function sc_modulo(x, y) {\n var remainder = x % y;\n // if they don't have the same sign\n if ((remainder * y) < 0)\n\treturn remainder + y;\n else\n\treturn remainder;\n}", "function r(t,e){if(e===t)return!0;var n=t.indexOf(e);if(0===n){if(\"/\"===e.substr(-1))return!0;if(\"/\"===t.substr(e.length,1))return!0}return!1}", "function r(t,e){if(e===t)return!0;var n=t.indexOf(e);if(0===n){if(\"/\"===e.substr(-1))return!0;if(\"/\"===t.substr(e.length,1))return!0}return!1}", "function r(t,e){if(e===t)return!0;var n=t.indexOf(e);if(0===n){if(\"/\"===e.substr(-1))return!0;if(\"/\"===t.substr(e.length,1))return!0}return!1}", "function bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\n\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y); // \"negative\" y so we can replace sub with am later\n\n while (y.t < ys) {\n y[y.t++] = 0;\n }\n\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n\n while (r[i] < --qd) {\n r.subTo(t, r);\n }\n }\n }\n\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n } // (public) this mod a", "invmod(x, y) {\n var q, u, v, a, c, t;\n u = x;\n v = y;\n c = 1;\n a = 0;\n while (u != 0) {\n t = Integer.fdivrem(v, u);\n q = t[0];\n v = u;\n u = t[1];\n t = c;\n c = a - q * c;\n a = t;\n }\n /* v = gcd(x, y) */\n if (v != 1)\n throw RangeError(\"not invertible\");\n return a % y;\n }", "function remainder(x, y) {\n return x % y;\n}", "function isRotation(string1, string2) {\n // If we split a string at it's rotation there are two parts - x and y. We can consider the\n // original string as yx. If we double the original string yxyx, it will contain any rotated\n // string\n if (string1.length === string2.length && string1.length > 0) {\n let string1string1 = string1 + string1;\n return isSubstring(string1string1, string2);\n }\n\n return false;\n}", "function r(l,o){var M=l.split(\"_\");return o%10==1&&o%100!=11?M[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?M[1]:M[2]}", "function modulo(r, l){\n\n return modulo(r-2, l);\n}", "function modinv(x, m)\n{\n // calculate a,b such that a*x+b*m = g\n var [g, a, b] = GCD(x,m);\n if (a<numzero(a)) return a+m;\n return a;\n}", "function bnpDivRemTo(m,q,r) {\n\tvar pm = m.abs();\n\tif(pm.t <= 0) return;\n\tvar pt = this.abs();\n\tif(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t}\n\tif(r == null) r = nbi();\n\tvar y = nbi(), ts = this.s, ms = m.s;\n\tvar nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n\tif(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\telse { pm.copyTo(y); pt.copyTo(r); }\n\tvar ys = y.t;\n\tvar y0 = y[ys-1];\n\tif(y0 == 0) return;\n\tvar yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n\tvar d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n\tvar i = r.t, j = i-ys, t = (q==null)?nbi():q;\n\ty.dlShiftTo(j,t);\n\tif(r.compareTo(t) >= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t}\n\tBigInteger.ONE.dlShiftTo(ys,t);\n\tt.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n\twhile(y.t < ys) y[y.t++] = 0;\n\twhile(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n\t\ty.dlShiftTo(j,t);\n\t\tr.subTo(t,r);\n\t\twhile(r[i] < --qd) r.subTo(t,r);\n\t }\n\t}\n\tif(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t}\n\tr.t = ys;\n\tr.clamp();\n\tif(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n\tif(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y.data[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r.data[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y.data[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r.data[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}", "function euclideanModulo( n, m ) {\n\n\treturn ( ( n % m ) + m ) % m;\n\n}", "function mod (x, y) {return x < 0? y - (-x % y) : x % y;}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "actualNotes(mR){\n var n = [];\n var mask = 0xff;\n for(var i = 0; i < 4; i ++){\n n.push( (mR & (mask<<i*8))>>>i*8 );\n }\n var l = [];\n n.forEach((element) => {\n l.push(this.rootName[element%12]);\n });\n return l.toString();\n\n }", "function remainder(x,y){\n return x%y;\n}", "function sc_remainder(x, y) {\n return x % y;\n}", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }", "function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]);\t// normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n y.dlShiftTo(j,t);\n if(r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y);\t// \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }" ]
[ "0.53772426", "0.53148067", "0.52019477", "0.52019477", "0.5154438", "0.51277965", "0.5037556", "0.5004299", "0.49786752", "0.49475902", "0.49295637", "0.49295637", "0.48907468", "0.48874667", "0.48766735", "0.487025", "0.48661304", "0.4852779", "0.48273948", "0.48214242", "0.4820526", "0.48185694", "0.48153347", "0.48028558", "0.4801535", "0.47983915", "0.47960988", "0.47901252", "0.47826886", "0.4780222", "0.47800392", "0.4778564", "0.4778564", "0.4778564", "0.47765216", "0.4767303", "0.47611368", "0.47582546", "0.4754482", "0.47380388", "0.47352973", "0.4728626", "0.47260275", "0.47260275", "0.47260275", "0.47260275", "0.47260275", "0.47260275", "0.47260275", "0.47254142", "0.47254142", "0.47170433", "0.470934", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47085157", "0.47061157", "0.47036135", "0.47023904", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648", "0.47023648" ]
0.0
-1
(protected) true iff this is even
function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isEven() {\n return (this.low & 1) === 0;\n }", "function bnpIsEven() {\n return ((this.t > 0) ? (this[0] & 1) : this.s) == 0;\n }", "function bnpIsEven() {\n return ((this.t > 0) ? (this[0] & 1) : this.s) == 0;\n }", "function bnpIsEven() {\n return ((this.t > 0) ? (this[0] & 1) : this.s) == 0;\n }", "function bnpIsEven() {\r\n\t return ((this.t > 0) ? (this[0] & 1) : this.s) === 0;\r\n\t}", "function bnpIsEven() {\r\n\t return ((this.t > 0) ? (this[0] & 1) : this.s) === 0;\r\n\t}", "function bnpIsEven() {\n return (this.t > 0 ? this[0] & 1 : this.s) == 0;\n }", "function bnpIsEven() {\n return (this.t > 0 ? this[0] & 1 : this.s) == 0;\n }", "function bnpIsEven() {\n return (this.t > 0 ? this[0] & 1 : this.s) == 0;\n }", "function bnpIsEven() { return ((this.t > 0) ? (this[0] & 1) : this.s) == 0; }", "function bnpIsEven() {\n\t return ((this.t > 0) ? (this[0] & 1) : this.s) == 0\n\t}", "function bnpIsEven() {\n\t return ((this.t > 0) ? (this[0] & 1) : this.s) == 0\n\t}", "function bnpIsEven() {\n return (this.t > 0 ? this[0] & 1 : this.s) == 0;\n}", "function bnpIsEven() {\n return ((this.t > 0) ? (this[0] & 1) : this.s) == 0;\n}", "function bnpIsEven() {\n return ((this.t > 0) ? (this[0] & 1) : this.s) === 0;\n}", "function bnpIsEven() {\n return (this.t > 0 ? this[0] & 1 : this.s) == 0;\n } // (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)", "function bnpIsEven()\n{\n return ((this.t > 0) ? (this[0] & 1) : this.s) == 0;\n}", "function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; }", "function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; }", "function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; }", "function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; }", "function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; }", "function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; }", "function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; }", "function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; }", "function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; }", "function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; }", "function bnpIsEven() {\n return ((this.t > 0) ? (this[0] & 1) : this.s) == 0\n}", "function bnpIsEven() {\n return ((this.t > 0) ? (this[0] & 1) : this.s) == 0\n}", "function bnpIsEven() {\n return ((this.t > 0) ? (this[0] & 1) : this.s) == 0\n}", "function bnpIsEven() {\n return ((this.t > 0) ? (this[0] & 1) : this.s) == 0\n}", "function bnpIsEven() {\n return ((this.t > 0) ? (this[0] & 1) : this.s) == 0\n}", "function bnpIsEven() {\n return ((this.t > 0) ? (this[0] & 1) : this.s) == 0\n}", "function bnpIsEven() {\n return ((this.t > 0) ? (this[0] & 1) : this.s) == 0\n}", "function even (n) {\n\t return n % 2 === 0\n\t}", "function even(n) {\n return n % 2 === 0;\n }" ]
[ "0.8406392", "0.7872265", "0.7872265", "0.78625864", "0.7857068", "0.7857068", "0.7834824", "0.7834824", "0.7834824", "0.7828928", "0.7742386", "0.7742386", "0.7728565", "0.7652589", "0.76503295", "0.7644145", "0.7640417", "0.7629148", "0.7629148", "0.7629148", "0.7629148", "0.7629148", "0.7629148", "0.7629148", "0.7629148", "0.7629148", "0.7629148", "0.7621347", "0.7621347", "0.7621347", "0.7621347", "0.7621347", "0.7621347", "0.7621347", "0.7606411", "0.754677" ]
0.78499377
60
(protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
function bnpExp(e,z) { if(e > 0xffffffff || e < 1) return BigInteger.ONE; var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; g.copyTo(r); while(--i >= 0) { z.sqrTo(r,r2); if((e&(1<<i)) > 0) z.mulTo(r2,g,r); else { var t = r; r = r2; r2 = t; } } return z.revert(r); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sqr(number) { return number * number}", "function mulberry32(a) {\n return function() {\n a |= 0; a = a + 0x6D2B79F5 | 0;\n var t = Math.imul(a ^ a >>> 15, 1 | a);\n t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;\n return ((t ^ t >>> 14) >>> 0) / 4294967296;\n }\n}", "function bnModPow(e,m){var i=e.bitLength(),k,r=nbv(1),z;if(i<=0)return r;else if(i<18)k=1;else if(i<48)k=3;else if(i<144)k=4;else if(i<768)k=5;else k=6;if(i<8)z=new Classic(m);else if(m.isEven())z=new Barrett(m);else z=new Montgomery(m);// precomputation\n\tvar g=new Array(),n=3,k1=k-1,km=(1<<k)-1;g[1]=z.convert(this);if(k>1){var g2=new BigInteger();z.sqrTo(g[1],g2);while(n<=km){g[n]=new BigInteger();z.mulTo(g2,g[n-2],g[n]);n+=2;}}var j=e.t-1,w,is1=true,r2=new BigInteger(),t;i=nbits(e[j])-1;while(j>=0){if(i>=k1)w=e[j]>>i-k1&km;else{w=(e[j]&(1<<i+1)-1)<<k1-i;if(j>0)w|=e[j-1]>>this.DB+i-k1;}n=k;while((w&1)==0){w>>=1;--n;}if((i-=n)<0){i+=this.DB;--j;}if(is1){// ret == 1, don't bother squaring or multiplying it\n\tg[w].copyTo(r);is1=false;}else{while(n>1){z.sqrTo(r,r2);z.sqrTo(r2,r);n-=2;}if(n>0)z.sqrTo(r,r2);else{t=r;r=r2;r2=t;}z.mulTo(r2,g[w],r);}while(j>=0&&(e[j]&1<<i)==0){z.sqrTo(r,r2);t=r;r=r2;r2=t;if(--i<0){i=this.DB-1;--j;}}}return z.revert(r);}// (public) gcd(this,a) (HAC 14.54)", "function bnModPow(e,m) {\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t }", "function bnModPow(e,m) {\n if (jscore && jscore.bnModPow) {\n var r = nbi();\n var s = jscore.bnModPow(this.toString(), e.toString(), m.toString())\n return r.fromString(s, 10);\n }\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\t \n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\t \n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\t \n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\t \n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t }", "function bnModPow(e,m) {\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\t\n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\t\n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\t\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\t\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t }", "function bnModPow(e, m) {\r\n\t var i = e.bitLength(), k, r = nbv(1), z;\r\n\t if (i <= 0) return r;\r\n\t else if (i < 18) k = 1;\r\n\t else if (i < 48) k = 3;\r\n\t else if (i < 144) k = 4;\r\n\t else if (i < 768) k = 5;\r\n\t else k = 6;\r\n\t if (i < 8)\r\n\t z = new Classic(m);\r\n\t else if (m.isEven())\r\n\t z = new Barrett(m);\r\n\t else\r\n\t z = new Montgomery(m);\r\n\r\n\t// precomputation\r\n\t var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;\r\n\t g[1] = z.convert(this);\r\n\t if (k > 1) {\r\n\t var g2 = nbi();\r\n\t z.sqrTo(g[1], g2);\r\n\t while (n <= km) {\r\n\t g[n] = nbi();\r\n\t z.mulTo(g2, g[n - 2], g[n]);\r\n\t n += 2;\r\n\t }\r\n\t }\r\n\r\n\t var j = e.t - 1, w, is1 = true, r2 = nbi(), t;\r\n\t i = nbits(e[j]) - 1;\r\n\t while (j >= 0) {\r\n\t if (i >= k1) w = (e[j] >> (i - k1)) & km;\r\n\t else {\r\n\t w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\r\n\t if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\r\n\t }\r\n\r\n\t n = k;\r\n\t while ((w & 1) === 0) {\r\n\t w >>= 1;\r\n\t --n;\r\n\t }\r\n\t if ((i -= n) < 0) {\r\n\t i += this.DB;\r\n\t --j;\r\n\t }\r\n\t if (is1) {\t// ret == 1, don't bother squaring or multiplying it\r\n\t g[w].copyTo(r);\r\n\t is1 = false;\r\n\t }\r\n\t else {\r\n\t while (n > 1) {\r\n\t z.sqrTo(r, r2);\r\n\t z.sqrTo(r2, r);\r\n\t n -= 2;\r\n\t }\r\n\t if (n > 0) z.sqrTo(r, r2); else {\r\n\t t = r;\r\n\t r = r2;\r\n\t r2 = t;\r\n\t }\r\n\t z.mulTo(r2, g[w], r);\r\n\t }\r\n\r\n\t while (j >= 0 && (e[j] & (1 << i)) === 0) {\r\n\t z.sqrTo(r, r2);\r\n\t t = r;\r\n\t r = r2;\r\n\t r2 = t;\r\n\t if (--i < 0) {\r\n\t i = this.DB - 1;\r\n\t --j;\r\n\t }\r\n\t }\r\n\t }\r\n\t return z.revert(r);\r\n\t}", "function bnModPow(e, m) {\r\n\t var i = e.bitLength(), k, r = nbv(1), z;\r\n\t if (i <= 0) return r;\r\n\t else if (i < 18) k = 1;\r\n\t else if (i < 48) k = 3;\r\n\t else if (i < 144) k = 4;\r\n\t else if (i < 768) k = 5;\r\n\t else k = 6;\r\n\t if (i < 8)\r\n\t z = new Classic(m);\r\n\t else if (m.isEven())\r\n\t z = new Barrett(m);\r\n\t else\r\n\t z = new Montgomery(m);\r\n\r\n\t// precomputation\r\n\t var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;\r\n\t g[1] = z.convert(this);\r\n\t if (k > 1) {\r\n\t var g2 = nbi();\r\n\t z.sqrTo(g[1], g2);\r\n\t while (n <= km) {\r\n\t g[n] = nbi();\r\n\t z.mulTo(g2, g[n - 2], g[n]);\r\n\t n += 2;\r\n\t }\r\n\t }\r\n\r\n\t var j = e.t - 1, w, is1 = true, r2 = nbi(), t;\r\n\t i = nbits(e[j]) - 1;\r\n\t while (j >= 0) {\r\n\t if (i >= k1) w = (e[j] >> (i - k1)) & km;\r\n\t else {\r\n\t w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\r\n\t if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\r\n\t }\r\n\r\n\t n = k;\r\n\t while ((w & 1) === 0) {\r\n\t w >>= 1;\r\n\t --n;\r\n\t }\r\n\t if ((i -= n) < 0) {\r\n\t i += this.DB;\r\n\t --j;\r\n\t }\r\n\t if (is1) {\t// ret == 1, don't bother squaring or multiplying it\r\n\t g[w].copyTo(r);\r\n\t is1 = false;\r\n\t }\r\n\t else {\r\n\t while (n > 1) {\r\n\t z.sqrTo(r, r2);\r\n\t z.sqrTo(r2, r);\r\n\t n -= 2;\r\n\t }\r\n\t if (n > 0) z.sqrTo(r, r2); else {\r\n\t t = r;\r\n\t r = r2;\r\n\t r2 = t;\r\n\t }\r\n\t z.mulTo(r2, g[w], r);\r\n\t }\r\n\r\n\t while (j >= 0 && (e[j] & (1 << i)) === 0) {\r\n\t z.sqrTo(r, r2);\r\n\t t = r;\r\n\t r = r2;\r\n\t r2 = t;\r\n\t if (--i < 0) {\r\n\t i = this.DB - 1;\r\n\t --j;\r\n\t }\r\n\t }\r\n\t }\r\n\t return z.revert(r);\r\n\t}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z;\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n if (i < 8) z = new Classic(m);else if (m.isEven()) z = new Barrett(m);else z = new Montgomery(m); // precomputation\n\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n n = k;\n\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n\n return z.revert(r);\n } // (public) gcd(this,a) (HAC 14.54)", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e, m) {\n\t var i = e.bitLength(),\n\t k, r = nbv(1),\n\t z\n\t if (i <= 0) return r\n\t else if (i < 18) k = 1\n\t else if (i < 48) k = 3\n\t else if (i < 144) k = 4\n\t else if (i < 768) k = 5\n\t else k = 6\n\t if (i < 8)\n\t z = new Classic(m)\n\t else if (m.isEven())\n\t z = new Barrett(m)\n\t else\n\t z = new Montgomery(m)\n\n\t // precomputation\n\t var g = new Array(),\n\t n = 3,\n\t k1 = k - 1,\n\t km = (1 << k) - 1\n\t g[1] = z.convert(this)\n\t if (k > 1) {\n\t var g2 = new BigInteger()\n\t z.sqrTo(g[1], g2)\n\t while (n <= km) {\n\t g[n] = new BigInteger()\n\t z.mulTo(g2, g[n - 2], g[n])\n\t n += 2\n\t }\n\t }\n\n\t var j = e.t - 1,\n\t w, is1 = true,\n\t r2 = new BigInteger(),\n\t t\n\t i = nbits(e[j]) - 1\n\t while (j >= 0) {\n\t if (i >= k1) w = (e[j] >> (i - k1)) & km\n\t else {\n\t w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n\t if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n\t }\n\n\t n = k\n\t while ((w & 1) == 0) {\n\t w >>= 1\n\t --n\n\t }\n\t if ((i -= n) < 0) {\n\t i += this.DB\n\t --j\n\t }\n\t if (is1) { // ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r)\n\t is1 = false\n\t } else {\n\t while (n > 1) {\n\t z.sqrTo(r, r2)\n\t z.sqrTo(r2, r)\n\t n -= 2\n\t }\n\t if (n > 0) z.sqrTo(r, r2)\n\t else {\n\t t = r\n\t r = r2\n\t r2 = t\n\t }\n\t z.mulTo(r2, g[w], r)\n\t }\n\n\t while (j >= 0 && (e[j] & (1 << i)) == 0) {\n\t z.sqrTo(r, r2)\n\t t = r\n\t r = r2\n\t r2 = t\n\t if (--i < 0) {\n\t i = this.DB - 1\n\t --j\n\t }\n\t }\n\t }\n\t return z.revert(r)\n\t}", "function bnModPow(e, m) {\n\t var i = e.bitLength(),\n\t k, r = nbv(1),\n\t z\n\t if (i <= 0) return r\n\t else if (i < 18) k = 1\n\t else if (i < 48) k = 3\n\t else if (i < 144) k = 4\n\t else if (i < 768) k = 5\n\t else k = 6\n\t if (i < 8)\n\t z = new Classic(m)\n\t else if (m.isEven())\n\t z = new Barrett(m)\n\t else\n\t z = new Montgomery(m)\n\n\t // precomputation\n\t var g = new Array(),\n\t n = 3,\n\t k1 = k - 1,\n\t km = (1 << k) - 1\n\t g[1] = z.convert(this)\n\t if (k > 1) {\n\t var g2 = new BigInteger()\n\t z.sqrTo(g[1], g2)\n\t while (n <= km) {\n\t g[n] = new BigInteger()\n\t z.mulTo(g2, g[n - 2], g[n])\n\t n += 2\n\t }\n\t }\n\n\t var j = e.t - 1,\n\t w, is1 = true,\n\t r2 = new BigInteger(),\n\t t\n\t i = nbits(e[j]) - 1\n\t while (j >= 0) {\n\t if (i >= k1) w = (e[j] >> (i - k1)) & km\n\t else {\n\t w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n\t if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n\t }\n\n\t n = k\n\t while ((w & 1) == 0) {\n\t w >>= 1\n\t --n\n\t }\n\t if ((i -= n) < 0) {\n\t i += this.DB\n\t --j\n\t }\n\t if (is1) { // ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r)\n\t is1 = false\n\t } else {\n\t while (n > 1) {\n\t z.sqrTo(r, r2)\n\t z.sqrTo(r2, r)\n\t n -= 2\n\t }\n\t if (n > 0) z.sqrTo(r, r2)\n\t else {\n\t t = r\n\t r = r2\n\t r2 = t\n\t }\n\t z.mulTo(r2, g[w], r)\n\t }\n\n\t while (j >= 0 && (e[j] & (1 << i)) == 0) {\n\t z.sqrTo(r, r2)\n\t t = r\n\t r = r2\n\t r2 = t\n\t if (--i < 0) {\n\t i = this.DB - 1\n\t --j\n\t }\n\t }\n\t }\n\t return z.revert(r)\n\t}", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z\n if (i <= 0) return r\n else if (i < 18) k = 1\n else if (i < 48) k = 3\n else if (i < 144) k = 4\n else if (i < 768) k = 5\n else k = 6\n if (i < 8)\n z = new Classic(m)\n else if (m.isEven())\n z = new Barrett(m)\n else\n z = new Montgomery(m)\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1\n g[1] = z.convert(this)\n if (k > 1) {\n var g2 = new BigInteger()\n z.sqrTo(g[1], g2)\n while (n <= km) {\n g[n] = new BigInteger()\n z.mulTo(g2, g[n - 2], g[n])\n n += 2\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = new BigInteger(),\n t\n i = nbits(e[j]) - 1\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n }\n\n n = k\n while ((w & 1) == 0) {\n w >>= 1\n --n\n }\n if ((i -= n) < 0) {\n i += this.DB\n --j\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r)\n is1 = false\n } else {\n while (n > 1) {\n z.sqrTo(r, r2)\n z.sqrTo(r2, r)\n n -= 2\n }\n if (n > 0) z.sqrTo(r, r2)\n else {\n t = r\n r = r2\n r2 = t\n }\n z.mulTo(r2, g[w], r)\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2)\n t = r\n r = r2\n r2 = t\n if (--i < 0) {\n i = this.DB - 1\n --j\n }\n }\n }\n return z.revert(r)\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z\n if (i <= 0) return r\n else if (i < 18) k = 1\n else if (i < 48) k = 3\n else if (i < 144) k = 4\n else if (i < 768) k = 5\n else k = 6\n if (i < 8)\n z = new Classic(m)\n else if (m.isEven())\n z = new Barrett(m)\n else\n z = new Montgomery(m)\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1\n g[1] = z.convert(this)\n if (k > 1) {\n var g2 = new BigInteger()\n z.sqrTo(g[1], g2)\n while (n <= km) {\n g[n] = new BigInteger()\n z.mulTo(g2, g[n - 2], g[n])\n n += 2\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = new BigInteger(),\n t\n i = nbits(e[j]) - 1\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n }\n\n n = k\n while ((w & 1) == 0) {\n w >>= 1\n --n\n }\n if ((i -= n) < 0) {\n i += this.DB\n --j\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r)\n is1 = false\n } else {\n while (n > 1) {\n z.sqrTo(r, r2)\n z.sqrTo(r2, r)\n n -= 2\n }\n if (n > 0) z.sqrTo(r, r2)\n else {\n t = r\n r = r2\n r2 = t\n }\n z.mulTo(r2, g[w], r)\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2)\n t = r\n r = r2\n r2 = t\n if (--i < 0) {\n i = this.DB - 1\n --j\n }\n }\n }\n return z.revert(r)\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z\n if (i <= 0) return r\n else if (i < 18) k = 1\n else if (i < 48) k = 3\n else if (i < 144) k = 4\n else if (i < 768) k = 5\n else k = 6\n if (i < 8)\n z = new Classic(m)\n else if (m.isEven())\n z = new Barrett(m)\n else\n z = new Montgomery(m)\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1\n g[1] = z.convert(this)\n if (k > 1) {\n var g2 = new BigInteger()\n z.sqrTo(g[1], g2)\n while (n <= km) {\n g[n] = new BigInteger()\n z.mulTo(g2, g[n - 2], g[n])\n n += 2\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = new BigInteger(),\n t\n i = nbits(e[j]) - 1\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n }\n\n n = k\n while ((w & 1) == 0) {\n w >>= 1\n --n\n }\n if ((i -= n) < 0) {\n i += this.DB\n --j\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r)\n is1 = false\n } else {\n while (n > 1) {\n z.sqrTo(r, r2)\n z.sqrTo(r2, r)\n n -= 2\n }\n if (n > 0) z.sqrTo(r, r2)\n else {\n t = r\n r = r2\n r2 = t\n }\n z.mulTo(r2, g[w], r)\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2)\n t = r\n r = r2\n r2 = t\n if (--i < 0) {\n i = this.DB - 1\n --j\n }\n }\n }\n return z.revert(r)\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z\n if (i <= 0) return r\n else if (i < 18) k = 1\n else if (i < 48) k = 3\n else if (i < 144) k = 4\n else if (i < 768) k = 5\n else k = 6\n if (i < 8)\n z = new Classic(m)\n else if (m.isEven())\n z = new Barrett(m)\n else\n z = new Montgomery(m)\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1\n g[1] = z.convert(this)\n if (k > 1) {\n var g2 = new BigInteger()\n z.sqrTo(g[1], g2)\n while (n <= km) {\n g[n] = new BigInteger()\n z.mulTo(g2, g[n - 2], g[n])\n n += 2\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = new BigInteger(),\n t\n i = nbits(e[j]) - 1\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n }\n\n n = k\n while ((w & 1) == 0) {\n w >>= 1\n --n\n }\n if ((i -= n) < 0) {\n i += this.DB\n --j\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r)\n is1 = false\n } else {\n while (n > 1) {\n z.sqrTo(r, r2)\n z.sqrTo(r2, r)\n n -= 2\n }\n if (n > 0) z.sqrTo(r, r2)\n else {\n t = r\n r = r2\n r2 = t\n }\n z.mulTo(r2, g[w], r)\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2)\n t = r\n r = r2\n r2 = t\n if (--i < 0) {\n i = this.DB - 1\n --j\n }\n }\n }\n return z.revert(r)\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z\n if (i <= 0) return r\n else if (i < 18) k = 1\n else if (i < 48) k = 3\n else if (i < 144) k = 4\n else if (i < 768) k = 5\n else k = 6\n if (i < 8)\n z = new Classic(m)\n else if (m.isEven())\n z = new Barrett(m)\n else\n z = new Montgomery(m)\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1\n g[1] = z.convert(this)\n if (k > 1) {\n var g2 = new BigInteger()\n z.sqrTo(g[1], g2)\n while (n <= km) {\n g[n] = new BigInteger()\n z.mulTo(g2, g[n - 2], g[n])\n n += 2\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = new BigInteger(),\n t\n i = nbits(e[j]) - 1\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n }\n\n n = k\n while ((w & 1) == 0) {\n w >>= 1\n --n\n }\n if ((i -= n) < 0) {\n i += this.DB\n --j\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r)\n is1 = false\n } else {\n while (n > 1) {\n z.sqrTo(r, r2)\n z.sqrTo(r2, r)\n n -= 2\n }\n if (n > 0) z.sqrTo(r, r2)\n else {\n t = r\n r = r2\n r2 = t\n }\n z.mulTo(r2, g[w], r)\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2)\n t = r\n r = r2\n r2 = t\n if (--i < 0) {\n i = this.DB - 1\n --j\n }\n }\n }\n return z.revert(r)\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z\n if (i <= 0) return r\n else if (i < 18) k = 1\n else if (i < 48) k = 3\n else if (i < 144) k = 4\n else if (i < 768) k = 5\n else k = 6\n if (i < 8)\n z = new Classic(m)\n else if (m.isEven())\n z = new Barrett(m)\n else\n z = new Montgomery(m)\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1\n g[1] = z.convert(this)\n if (k > 1) {\n var g2 = new BigInteger()\n z.sqrTo(g[1], g2)\n while (n <= km) {\n g[n] = new BigInteger()\n z.mulTo(g2, g[n - 2], g[n])\n n += 2\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = new BigInteger(),\n t\n i = nbits(e[j]) - 1\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n }\n\n n = k\n while ((w & 1) == 0) {\n w >>= 1\n --n\n }\n if ((i -= n) < 0) {\n i += this.DB\n --j\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r)\n is1 = false\n } else {\n while (n > 1) {\n z.sqrTo(r, r2)\n z.sqrTo(r2, r)\n n -= 2\n }\n if (n > 0) z.sqrTo(r, r2)\n else {\n t = r\n r = r2\n r2 = t\n }\n z.mulTo(r2, g[w], r)\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2)\n t = r\n r = r2\n r2 = t\n if (--i < 0) {\n i = this.DB - 1\n --j\n }\n }\n }\n return z.revert(r)\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z\n if (i <= 0) return r\n else if (i < 18) k = 1\n else if (i < 48) k = 3\n else if (i < 144) k = 4\n else if (i < 768) k = 5\n else k = 6\n if (i < 8)\n z = new Classic(m)\n else if (m.isEven())\n z = new Barrett(m)\n else\n z = new Montgomery(m)\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1\n g[1] = z.convert(this)\n if (k > 1) {\n var g2 = new BigInteger()\n z.sqrTo(g[1], g2)\n while (n <= km) {\n g[n] = new BigInteger()\n z.mulTo(g2, g[n - 2], g[n])\n n += 2\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = new BigInteger(),\n t\n i = nbits(e[j]) - 1\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n }\n\n n = k\n while ((w & 1) == 0) {\n w >>= 1\n --n\n }\n if ((i -= n) < 0) {\n i += this.DB\n --j\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r)\n is1 = false\n } else {\n while (n > 1) {\n z.sqrTo(r, r2)\n z.sqrTo(r2, r)\n n -= 2\n }\n if (n > 0) z.sqrTo(r, r2)\n else {\n t = r\n r = r2\n r2 = t\n }\n z.mulTo(r2, g[w], r)\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2)\n t = r\n r = r2\n r2 = t\n if (--i < 0) {\n i = this.DB - 1\n --j\n }\n }\n }\n return z.revert(r)\n}", "function bnpIsEven(){return(this.t>0?this[0]&1:this.s)==0;}// (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)", "function gmul(a, b) {\n let p = 0,\n counter,\n carry;\n\n for (counter = 0; counter < 8; counter++) {\n if (b & 1) {\n p ^= a;\n }\n\n carry = a & 0x80; // detect if x^8 term is about to be generated\n\n a = (a << 1) & 0xff;\n\n if (carry) {\n a ^= 0xc3;\n } // replace x^8 with x^7 + x^6 + x + 1\n\n b >>= 1;\n }\n\n return p & 0xff;\n } // It is required only this values for R function", "function bnModPow(e, m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if (i <= 0) return r;\n else if (i < 18) k = 1;\n else if (i < 48) k = 3;\n else if (i < 144) k = 4;\n else if (i < 768) k = 5;\n else k = 6;\n if (i < 8)\n z = new Classic(m);\n else if (m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n// precomputation\n var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km;\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\n }\n\n n = k;\n while ((w & 1) === 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2); else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & (1 << i)) === 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n return z.revert(r);\n}", "function aes_mul(a, b) {\n\t\tvar res = 0;\n\t\twhile(a > 0) {\n\t\tif((a&1) != 0)\n\t\t\tres = res ^ b;\t\t// \"add\" to the result\n\t\t\ta >>>= 1;\t\t\t// shift a to get next higher-order bit\n\t\t\tb <<= 1;\t\t\t// shift multiplier also\n\t\t}\n\t\t// now reduce it modulo x**8 + x**4 + x**3 + x + 1\n\t\tvar hbit = 0x10000;\t\t// bit to test if we need to take action\n\t\tvar modulus = 0x11b00;\t// modulus - XOR by this to change value\n\t\twhile(hbit >= 0x100) {\n\t\t\tif ((res & hbit) != 0) {\n\t\t\t\tres ^= modulus;\t// XOR with the modulus\n\t\t\t}\n\t\t\t// prepare for the next loop\n\t\t\thbit >>= 1;\n\t\t\tmodulus >>= 1;\n\t\t}\n\t\treturn res;\n\t}", "function bnModPow(e,m) {\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z;\n if (i <= 0) return r;\n else if (i < 18) k = 1;\n else if (i < 48) k = 3;\n else if (i < 144) k = 4;\n else if (i < 768) k = 5;\n else k = 6;\n if (i < 8)\n z = new Classic(m);\n else if (m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km;\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);\n else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z;\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n if (i < 8) z = new Classic(m);else if (m.isEven()) z = new Barrett(m);else z = new Montgomery(m);\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;--n;\n }\n if ((i -= n) < 0) {\n i += this.DB;--j;\n }\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);z.sqrTo(r2, r);n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;r = r2;r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);t = r;r = r2;r2 = t;\n if (--i < 0) {\n i = this.DB - 1;--j;\n }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z;\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n if (i < 8) z = new Classic(m);else if (m.isEven()) z = new Barrett(m);else z = new Montgomery(m);\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;--n;\n }\n if ((i -= n) < 0) {\n i += this.DB;--j;\n }\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);z.sqrTo(r2, r);n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;r = r2;r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);t = r;r = r2;r2 = t;\n if (--i < 0) {\n i = this.DB - 1;--j;\n }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z;\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n if (i < 8) z = new Classic(m);else if (m.isEven()) z = new Barrett(m);else z = new Montgomery(m);\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = new BigInteger();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = new BigInteger();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = new BigInteger(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n return z.revert(r);\n}", "function sqr(x) { return x * x }", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z;\n if (i <= 0) return r;\n else if (i < 18) k = 1;\n else if (i < 48) k = 3;\n else if (i < 144) k = 4;\n else if (i < 768) k = 5;\n else k = 6;\n if (i < 8)\n z = new Classic(m);\n else if (m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km;\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\n }\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);\n else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n return z.revert(r);\n}", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e.data[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n}", "function squareAndMultiply(m, e, n) {\n var z = 1, string = e.toString(2).split('');\n for (var i=0; i < string.length; i++) {\n z = (z * z) % n;\n if (parseInt(string[i]) == 1) {\n z = (z * m) % n;\n }\n }\n return z;\n}", "function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n g[1] = z.convert(this);\n if(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e.data[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n }\n return z.revert(r);\n}", "mul(val) {\r\n let a = this.a * val.a;\r\n let b = this.b * val.b;\r\n return new Rational(a,b).reduce();\r\n }", "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z;\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n if (i < 8) z = new Classic(m);else if (m.isEven()) z = new Barrett(m);else z = new Montgomery(m);\n\n // precomputation\n var g = [],\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;--n;\n }\n if ((i -= n) < 0) {\n i += this.DB;--j;\n }\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);z.sqrTo(r2, r);n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;r = r2;r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);t = r;r = r2;r2 = t;\n if (--i < 0) {\n i = this.DB - 1;--j;\n }\n }\n }\n return z.revert(r);\n }", "function bnModPow(e,m) {\n\tvar i = e.bitLength(), k, r = nbv(1), z;\n\tif(i <= 0) return r;\n\telse if(i < 18) k = 1;\n\telse if(i < 48) k = 3;\n\telse if(i < 144) k = 4;\n\telse if(i < 768) k = 5;\n\telse k = 6;\n\tif(i < 8)\n\t z = new Classic(m);\n\telse if(m.isEven())\n\t z = new Barrett(m);\n\telse\n\t z = new Montgomery(m);\n\n\t// precomputation\n\tvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\tg[1] = z.convert(this);\n\tif(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t}\n\n\tvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\ti = nbits(e.data[j])-1;\n\twhile(j >= 0) {\n\t if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n\t else {\n\t w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n\t }\n\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) { // ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t } else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\n\t while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t}\n\treturn z.revert(r);\n\t}", "function sqrNum(num){\n z=num**2\n return z;\n}", "function bnModPow(e, m)\n{\n var i = e.bitLength(),\n k, r = nbv(1),\n z;\n if (i <= 0) return r;\n else if (i < 18) k = 1;\n else if (i < 48) k = 3;\n else if (i < 144) k = 4;\n else if (i < 768) k = 5;\n else k = 6;\n if (i < 8)\n z = new Classic(m);\n else if (m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1)\n {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km)\n {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n var j = e.t - 1,\n w, is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0)\n {\n if (i >= k1) w = (e[j] >> (i - k1)) & km;\n else\n {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\n }\n n = k;\n while ((w & 1) == 0)\n {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0)\n {\n i += this.DB;\n --j;\n }\n if (is1)\n { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else\n {\n while (n > 1)\n {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);\n else\n {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n while (j >= 0 && (e[j] & (1 << i)) == 0)\n {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0)\n {\n i = this.DB - 1;\n --j;\n }\n }\n }\n return z.revert(r);\n}", "function gfMul(a, b)\n{\n\tif (a === 0 || b === 0)\n\t{\n\t\treturn 0;\n\t}\n\treturn EXP2[(LOG2[a] + LOG2[b]) % 255];\n}", "function sqr(a)\r\n {\r\n return a * a;\r\n }", "function bnModPow(e,m) {\n\tvar i = e.bitLength(), k, r = nbv(1), z;\n\tif(i <= 0) return r;\n\telse if(i < 18) k = 1;\n\telse if(i < 48) k = 3;\n\telse if(i < 144) k = 4;\n\telse if(i < 768) k = 5;\n\telse k = 6;\n\tif(i < 8)\n\t z = new Classic(m);\n\telse if(m.isEven())\n\t z = new Barrett(m);\n\telse\n\t z = new Montgomery(m);\n\n\t// precomputation\n\tvar g = [], n = 3, k1 = k-1, km = (1<<k)-1;\n\tg[1] = z.convert(this);\n\tif(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t\tg[n] = nbi();\n\t\tz.mulTo(g2,g[n-2],g[n]);\n\t\tn += 2;\n\t }\n\t}\n\n\tvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\ti = nbits(e[j])-1;\n\twhile(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t\tw = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t\tif(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t\tg[w].copyTo(r);\n\t\tis1 = false;\n\t }\n\t else {\n\t\twhile(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t\tif(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t\tz.mulTo(r2,g[w],r);\n\t }\n\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t\tz.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t\tif(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t}\n\treturn z.revert(r);\n }", "gf_mult(a, b, m) {\n let res = 0;\n while (b !== 0) {\n if ((b & 1) !== 0)\n res ^= a;\n a <<= 1;\n b >>>= 1;\n if (a >= 256)\n a ^= m;\n }\n return res;\n }", "function SQR(x) {\r\n return x*x;\r\n}", "function bnModPow(e, m, callback) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z = new Montgomery(m);\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6; // precomputation\n\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n n = k;\n\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n\n var result = z.revert(r);\n callback(null, result);\n return result;\n} // protected", "function sqr(n){\n return n*n\n}", "mul(f, g) {\r\n const f0 = BigInt(f.data[0]);\r\n const f1 = BigInt(f.data[1]);\r\n const f2 = BigInt(f.data[2]);\r\n const f3 = BigInt(f.data[3]);\r\n const f4 = BigInt(f.data[4]);\r\n const f5 = BigInt(f.data[5]);\r\n const f6 = BigInt(f.data[6]);\r\n const f7 = BigInt(f.data[7]);\r\n const f8 = BigInt(f.data[8]);\r\n const f9 = BigInt(f.data[9]);\r\n const f12 = BigInt(2 * f.data[1]);\r\n const f32 = BigInt(2 * f.data[3]);\r\n const f52 = BigInt(2 * f.data[5]);\r\n const f72 = BigInt(2 * f.data[7]);\r\n const f92 = BigInt(2 * f.data[9]);\r\n const g0 = BigInt(g.data[0]);\r\n const g1 = BigInt(g.data[1]);\r\n const g2 = BigInt(g.data[2]);\r\n const g3 = BigInt(g.data[3]);\r\n const g4 = BigInt(g.data[4]);\r\n const g5 = BigInt(g.data[5]);\r\n const g6 = BigInt(g.data[6]);\r\n const g7 = BigInt(g.data[7]);\r\n const g8 = BigInt(g.data[8]);\r\n const g9 = BigInt(g.data[9]);\r\n const g119 = BigInt(19 * g.data[1]); /* 1.4*2^29 */\r\n const g219 = BigInt(19 * g.data[2]); /* 1.4*2^30; still ok */\r\n const g319 = BigInt(19 * g.data[3]);\r\n const g419 = BigInt(19 * g.data[4]);\r\n const g519 = BigInt(19 * g.data[5]);\r\n const g619 = BigInt(19 * g.data[6]);\r\n const g719 = BigInt(19 * g.data[7]);\r\n const g819 = BigInt(19 * g.data[8]);\r\n const g919 = BigInt(19 * g.data[9]);\r\n const h0 = (f0 * g0) + (f12 * g919) + (f2 * g819) + (f32 * g719) +\r\n (f4 * g619) + (f52 * g519) + (f6 * g419) + (f72 * g319) + (f8 * g219) + (f92 * g119);\r\n const h1 = (f0 * g1) + (f1 * g0) + (f2 * g919) + (f3 * g819) + (f4 * g719) +\r\n (f5 * g619) + (f6 * g519) + (f7 * g419) + (f8 * g319) + (f9 * g219);\r\n const h2 = (f0 * g2) + (f12 * g1) + (f2 * g0) + (f32 * g919) + (f4 * g819) +\r\n (f52 * g719) + (f6 * g619) + (f72 * g519) + (f8 * g419) + (f92 * g319);\r\n const h3 = (f0 * g3) + (f1 * g2) + (f2 * g1) + (f3 * g0) + (f4 * g919) +\r\n (f5 * g819) + (f6 * g719) + (f7 * g619) + (f8 * g519) + (f9 * g419);\r\n const h4 = (f0 * g4) + (f12 * g3) + (f2 * g2) + (f32 * g1) + (f4 * g0) +\r\n (f52 * g919) + (f6 * g819) + (f72 * g719) + (f8 * g619) + (f92 * g519);\r\n const h5 = (f0 * g5) + (f1 * g4) + (f2 * g3) + (f3 * g2) + (f4 * g1) +\r\n (f5 * g0) + (f6 * g919) + (f7 * g819) + (f8 * g719) + (f9 * g619);\r\n const h6 = (f0 * g6) + (f12 * g5) + (f2 * g4) + (f32 * g3) + (f4 * g2) +\r\n (f52 * g1) + (f6 * g0) + (f72 * g919) + (f8 * g819) + (f92 * g719);\r\n const h7 = (f0 * g7) + (f1 * g6) + (f2 * g5) + (f3 * g4) + (f4 * g3) +\r\n (f5 * g2) + (f6 * g1) + (f7 * g0) + (f8 * g919) + (f9 * g819);\r\n const h8 = (f0 * g8) + (f12 * g7) + (f2 * g6) + (f32 * g5) + (f4 * g4) +\r\n (f52 * g3) + (f6 * g2) + (f72 * g1) + (f8 * g0) + (f92 * g919);\r\n const h9 = (f0 * g9) + (f1 * g8) + (f2 * g7) + (f3 * g6) + (f4 * g5) +\r\n (f5 * g4) + (f6 * g3) + (f7 * g2) + (f8 * g1) + (f9 * g0);\r\n this.combine(h0, h1, h2, h3, h4, h5, h6, h7, h8, h9);\r\n }", "function tinyPow(b, e) {\n var n = b;\n while (--e) {n *= b;}\n return n;\n }", "function tinyPow(b, e) {\r\n var n = b;\r\n while (--e) n *= b;\r\n return n;\r\n }", "function bnpExp(e, z) {\n\t if (e > 0xffffffff || e < 1) return BigInteger.ONE\n\t var r = new BigInteger(),\n\t r2 = new BigInteger(),\n\t g = z.convert(this),\n\t i = nbits(e) - 1\n\t g.copyTo(r)\n\t while (--i >= 0) {\n\t z.sqrTo(r, r2)\n\t if ((e & (1 << i)) > 0) z.mulTo(r2, g, r)\n\t else {\n\t var t = r\n\t r = r2\n\t r2 = t\n\t }\n\t }\n\t return z.revert(r)\n\t}", "function bnpExp(e, z) {\n\t if (e > 0xffffffff || e < 1) return BigInteger.ONE\n\t var r = new BigInteger(),\n\t r2 = new BigInteger(),\n\t g = z.convert(this),\n\t i = nbits(e) - 1\n\t g.copyTo(r)\n\t while (--i >= 0) {\n\t z.sqrTo(r, r2)\n\t if ((e & (1 << i)) > 0) z.mulTo(r2, g, r)\n\t else {\n\t var t = r\n\t r = r2\n\t r2 = t\n\t }\n\t }\n\t return z.revert(r)\n\t}", "function tinyPow(b, e) {\r\n var n = b;\r\n while (--e) n *= b;\r\n return n;\r\n }", "function tinyPow(b, e) {\r\n var n = b;\r\n while (--e) n *= b;\r\n return n;\r\n }", "function tinyPow(b, e) {\r\n var n = b;\r\n while (--e) n *= b;\r\n return n;\r\n }", "r(u, v) { return (u[0] * v[0] + u[1] * v[1]) / (this.m(u) * this.m(v)); }", "function ex_7_R(a, b){\n s = 0; \n if ( b == 0 ) s == 1;\n else if ( b == 1) s = a;\n else\n s = a * ex_7_R( a, (b-1));\nreturn s;\n}", "function tinyPow(b, e) {\n var n = b;\n while (--e) n *= b;\n return n;\n }", "function sqr(n){\n return n*n;\n}", "function bnpExp(e, z) {\n if (e > 0xffffffff || e < 1) return BigInteger.ONE\n var r = new BigInteger(),\n r2 = new BigInteger(),\n g = z.convert(this),\n i = nbits(e) - 1\n g.copyTo(r)\n while (--i >= 0) {\n z.sqrTo(r, r2)\n if ((e & (1 << i)) > 0) z.mulTo(r2, g, r)\n else {\n var t = r\n r = r2\n r2 = t\n }\n }\n return z.revert(r)\n}", "function bnpExp(e, z) {\n if (e > 0xffffffff || e < 1) return BigInteger.ONE\n var r = new BigInteger(),\n r2 = new BigInteger(),\n g = z.convert(this),\n i = nbits(e) - 1\n g.copyTo(r)\n while (--i >= 0) {\n z.sqrTo(r, r2)\n if ((e & (1 << i)) > 0) z.mulTo(r2, g, r)\n else {\n var t = r\n r = r2\n r2 = t\n }\n }\n return z.revert(r)\n}", "function bnpExp(e, z) {\n if (e > 0xffffffff || e < 1) return BigInteger.ONE\n var r = new BigInteger(),\n r2 = new BigInteger(),\n g = z.convert(this),\n i = nbits(e) - 1\n g.copyTo(r)\n while (--i >= 0) {\n z.sqrTo(r, r2)\n if ((e & (1 << i)) > 0) z.mulTo(r2, g, r)\n else {\n var t = r\n r = r2\n r2 = t\n }\n }\n return z.revert(r)\n}", "function bnpExp(e, z) {\n if (e > 0xffffffff || e < 1) return BigInteger.ONE\n var r = new BigInteger(),\n r2 = new BigInteger(),\n g = z.convert(this),\n i = nbits(e) - 1\n g.copyTo(r)\n while (--i >= 0) {\n z.sqrTo(r, r2)\n if ((e & (1 << i)) > 0) z.mulTo(r2, g, r)\n else {\n var t = r\n r = r2\n r2 = t\n }\n }\n return z.revert(r)\n}", "function bnpExp(e, z) {\n if (e > 0xffffffff || e < 1) return BigInteger.ONE\n var r = new BigInteger(),\n r2 = new BigInteger(),\n g = z.convert(this),\n i = nbits(e) - 1\n g.copyTo(r)\n while (--i >= 0) {\n z.sqrTo(r, r2)\n if ((e & (1 << i)) > 0) z.mulTo(r2, g, r)\n else {\n var t = r\n r = r2\n r2 = t\n }\n }\n return z.revert(r)\n}", "function bnpExp(e, z) {\n if (e > 0xffffffff || e < 1) return BigInteger.ONE\n var r = new BigInteger(),\n r2 = new BigInteger(),\n g = z.convert(this),\n i = nbits(e) - 1\n g.copyTo(r)\n while (--i >= 0) {\n z.sqrTo(r, r2)\n if ((e & (1 << i)) > 0) z.mulTo(r2, g, r)\n else {\n var t = r\n r = r2\n r2 = t\n }\n }\n return z.revert(r)\n}", "function bnpExp(e, z) {\n if (e > 0xffffffff || e < 1) return BigInteger.ONE\n var r = new BigInteger(),\n r2 = new BigInteger(),\n g = z.convert(this),\n i = nbits(e) - 1\n g.copyTo(r)\n while (--i >= 0) {\n z.sqrTo(r, r2)\n if ((e & (1 << i)) > 0) z.mulTo(r2, g, r)\n else {\n var t = r\n r = r2\n r2 = t\n }\n }\n return z.revert(r)\n}", "function bnpExp(e,z) {\n\t if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n\t var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n\t g.copyTo(r);\n\t while(--i >= 0) {\n\t z.sqrTo(r,r2);\n\t if((e&(1<<i)) > 0) z.mulTo(r2,g,r);\n\t else { var t = r; r = r2; r2 = t; }\n\t }\n\t return z.revert(r);\n\t }", "function bnpExp(e,z) {\n\t if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n\t var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n\t g.copyTo(r);\n\t while(--i >= 0) {\n\t z.sqrTo(r,r2);\n\t if((e&(1<<i)) > 0) z.mulTo(r2,g,r);\n\t else { var t = r; r = r2; r2 = t; }\n\t }\n\t return z.revert(r);\n\t }", "function r(e){var t=1===(1&e),n=e>>1;return t?-n:n}" ]
[ "0.67812824", "0.6721616", "0.667814", "0.66451985", "0.6640544", "0.6640189", "0.66384405", "0.66384405", "0.6610541", "0.65880716", "0.65880716", "0.6586046", "0.6586046", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65848553", "0.65659726", "0.65659726", "0.65659726", "0.65659726", "0.65659726", "0.65659726", "0.65659726", "0.6557896", "0.6553133", "0.65500724", "0.65492105", "0.65405357", "0.65184474", "0.651498", "0.651498", "0.65007615", "0.6500394", "0.64939636", "0.64939636", "0.64939636", "0.64939636", "0.64939636", "0.64841104", "0.6479775", "0.64747065", "0.64630127", "0.645616", "0.64405435", "0.64405435", "0.64405435", "0.64405435", "0.64405435", "0.64405435", "0.64405435", "0.6436787", "0.6431308", "0.6420786", "0.64193845", "0.64155066", "0.6409189", "0.6399384", "0.62683856", "0.62647873", "0.6262183", "0.62477356", "0.6238916", "0.6235148", "0.62104064", "0.62051404", "0.62051404", "0.6191393", "0.6191393", "0.6191393", "0.6161678", "0.61609375", "0.6154164", "0.61490697", "0.6128014", "0.6128014", "0.6128014", "0.6128014", "0.6128014", "0.6128014", "0.6128014", "0.61177164", "0.61177164", "0.61156106" ]
0.0
-1
(public) this^e % m, 0 <= e < 2^32
function bnModPowInt(e,m) { var z; if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); return this.exp(e,z); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bnModPow(e, m) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z;\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n if (i < 8) z = new Classic(m);else if (m.isEven()) z = new Barrett(m);else z = new Montgomery(m); // precomputation\n\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n n = k;\n\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n\n return z.revert(r);\n } // (public) gcd(this,a) (HAC 14.54)", "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);\n else z = new Montgomery(m);\n return this.exp(e, z);\n }", "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);\n else z = new Montgomery(m);\n return this.exp(e, z);\n }", "function bnModPowInt(e, m) {\r\n\t var z;\r\n\t if (e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\r\n\t return this.exp(e, z);\r\n\t}", "function bnModPowInt(e, m) {\r\n\t var z;\r\n\t if (e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\r\n\t return this.exp(e, z);\r\n\t}", "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);\n else z = new Montgomery(m);\n return this.exp(e, z);\n }", "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);\n else z = new Montgomery(m);\n return this.exp(e, z);\n }", "function bnModPowInt(e, m)\n{\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);\n else z = new Montgomery(m);\n return this.exp(e, z);\n}", "function bnModPow(e, m) {\n\t var i = e.bitLength(),\n\t k, r = nbv(1),\n\t z\n\t if (i <= 0) return r\n\t else if (i < 18) k = 1\n\t else if (i < 48) k = 3\n\t else if (i < 144) k = 4\n\t else if (i < 768) k = 5\n\t else k = 6\n\t if (i < 8)\n\t z = new Classic(m)\n\t else if (m.isEven())\n\t z = new Barrett(m)\n\t else\n\t z = new Montgomery(m)\n\n\t // precomputation\n\t var g = new Array(),\n\t n = 3,\n\t k1 = k - 1,\n\t km = (1 << k) - 1\n\t g[1] = z.convert(this)\n\t if (k > 1) {\n\t var g2 = new BigInteger()\n\t z.sqrTo(g[1], g2)\n\t while (n <= km) {\n\t g[n] = new BigInteger()\n\t z.mulTo(g2, g[n - 2], g[n])\n\t n += 2\n\t }\n\t }\n\n\t var j = e.t - 1,\n\t w, is1 = true,\n\t r2 = new BigInteger(),\n\t t\n\t i = nbits(e[j]) - 1\n\t while (j >= 0) {\n\t if (i >= k1) w = (e[j] >> (i - k1)) & km\n\t else {\n\t w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n\t if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n\t }\n\n\t n = k\n\t while ((w & 1) == 0) {\n\t w >>= 1\n\t --n\n\t }\n\t if ((i -= n) < 0) {\n\t i += this.DB\n\t --j\n\t }\n\t if (is1) { // ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r)\n\t is1 = false\n\t } else {\n\t while (n > 1) {\n\t z.sqrTo(r, r2)\n\t z.sqrTo(r2, r)\n\t n -= 2\n\t }\n\t if (n > 0) z.sqrTo(r, r2)\n\t else {\n\t t = r\n\t r = r2\n\t r2 = t\n\t }\n\t z.mulTo(r2, g[w], r)\n\t }\n\n\t while (j >= 0 && (e[j] & (1 << i)) == 0) {\n\t z.sqrTo(r, r2)\n\t t = r\n\t r = r2\n\t r2 = t\n\t if (--i < 0) {\n\t i = this.DB - 1\n\t --j\n\t }\n\t }\n\t }\n\t return z.revert(r)\n\t}", "function bnModPow(e, m) {\n\t var i = e.bitLength(),\n\t k, r = nbv(1),\n\t z\n\t if (i <= 0) return r\n\t else if (i < 18) k = 1\n\t else if (i < 48) k = 3\n\t else if (i < 144) k = 4\n\t else if (i < 768) k = 5\n\t else k = 6\n\t if (i < 8)\n\t z = new Classic(m)\n\t else if (m.isEven())\n\t z = new Barrett(m)\n\t else\n\t z = new Montgomery(m)\n\n\t // precomputation\n\t var g = new Array(),\n\t n = 3,\n\t k1 = k - 1,\n\t km = (1 << k) - 1\n\t g[1] = z.convert(this)\n\t if (k > 1) {\n\t var g2 = new BigInteger()\n\t z.sqrTo(g[1], g2)\n\t while (n <= km) {\n\t g[n] = new BigInteger()\n\t z.mulTo(g2, g[n - 2], g[n])\n\t n += 2\n\t }\n\t }\n\n\t var j = e.t - 1,\n\t w, is1 = true,\n\t r2 = new BigInteger(),\n\t t\n\t i = nbits(e[j]) - 1\n\t while (j >= 0) {\n\t if (i >= k1) w = (e[j] >> (i - k1)) & km\n\t else {\n\t w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n\t if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n\t }\n\n\t n = k\n\t while ((w & 1) == 0) {\n\t w >>= 1\n\t --n\n\t }\n\t if ((i -= n) < 0) {\n\t i += this.DB\n\t --j\n\t }\n\t if (is1) { // ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r)\n\t is1 = false\n\t } else {\n\t while (n > 1) {\n\t z.sqrTo(r, r2)\n\t z.sqrTo(r2, r)\n\t n -= 2\n\t }\n\t if (n > 0) z.sqrTo(r, r2)\n\t else {\n\t t = r\n\t r = r2\n\t r2 = t\n\t }\n\t z.mulTo(r2, g[w], r)\n\t }\n\n\t while (j >= 0 && (e[j] & (1 << i)) == 0) {\n\t z.sqrTo(r, r2)\n\t t = r\n\t r = r2\n\t r2 = t\n\t if (--i < 0) {\n\t i = this.DB - 1\n\t --j\n\t }\n\t }\n\t }\n\t return z.revert(r)\n\t}", "function bnModPow(e, m) {\n var i = e.bitLength(),\n k, r = nbv(1),\n z;\n if (i <= 0) return r;\n else if (i < 18) k = 1;\n else if (i < 48) k = 3;\n else if (i < 144) k = 4;\n else if (i < 768) k = 5;\n else k = 6;\n if (i < 8)\n z = new Classic(m);\n else if (m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n\n var j = e.t - 1,\n w, is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = (e[j] >> (i - k1)) & km;\n else {\n w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\n if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\n }\n\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);\n else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n\n while (j >= 0 && (e[j] & (1 << i)) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n return z.revert(r);\n }", "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);else z = new Montgomery(m);\n return this.exp(e, z);\n }", "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);else z = new Montgomery(m);\n return this.exp(e, z);\n }", "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);else z = new Montgomery(m);\n return this.exp(e, z);\n }", "function bnModPow(e,m) {\n if (jscore && jscore.bnModPow) {\n var r = nbi();\n var s = jscore.bnModPow(this.toString(), e.toString(), m.toString())\n return r.fromString(s, 10);\n }\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\t \n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\t \n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\t \n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\t \n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t }", "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e, z);\n}", "function bnModPow(e, m) {\r\n\t var i = e.bitLength(), k, r = nbv(1), z;\r\n\t if (i <= 0) return r;\r\n\t else if (i < 18) k = 1;\r\n\t else if (i < 48) k = 3;\r\n\t else if (i < 144) k = 4;\r\n\t else if (i < 768) k = 5;\r\n\t else k = 6;\r\n\t if (i < 8)\r\n\t z = new Classic(m);\r\n\t else if (m.isEven())\r\n\t z = new Barrett(m);\r\n\t else\r\n\t z = new Montgomery(m);\r\n\r\n\t// precomputation\r\n\t var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;\r\n\t g[1] = z.convert(this);\r\n\t if (k > 1) {\r\n\t var g2 = nbi();\r\n\t z.sqrTo(g[1], g2);\r\n\t while (n <= km) {\r\n\t g[n] = nbi();\r\n\t z.mulTo(g2, g[n - 2], g[n]);\r\n\t n += 2;\r\n\t }\r\n\t }\r\n\r\n\t var j = e.t - 1, w, is1 = true, r2 = nbi(), t;\r\n\t i = nbits(e[j]) - 1;\r\n\t while (j >= 0) {\r\n\t if (i >= k1) w = (e[j] >> (i - k1)) & km;\r\n\t else {\r\n\t w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\r\n\t if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\r\n\t }\r\n\r\n\t n = k;\r\n\t while ((w & 1) === 0) {\r\n\t w >>= 1;\r\n\t --n;\r\n\t }\r\n\t if ((i -= n) < 0) {\r\n\t i += this.DB;\r\n\t --j;\r\n\t }\r\n\t if (is1) {\t// ret == 1, don't bother squaring or multiplying it\r\n\t g[w].copyTo(r);\r\n\t is1 = false;\r\n\t }\r\n\t else {\r\n\t while (n > 1) {\r\n\t z.sqrTo(r, r2);\r\n\t z.sqrTo(r2, r);\r\n\t n -= 2;\r\n\t }\r\n\t if (n > 0) z.sqrTo(r, r2); else {\r\n\t t = r;\r\n\t r = r2;\r\n\t r2 = t;\r\n\t }\r\n\t z.mulTo(r2, g[w], r);\r\n\t }\r\n\r\n\t while (j >= 0 && (e[j] & (1 << i)) === 0) {\r\n\t z.sqrTo(r, r2);\r\n\t t = r;\r\n\t r = r2;\r\n\t r2 = t;\r\n\t if (--i < 0) {\r\n\t i = this.DB - 1;\r\n\t --j;\r\n\t }\r\n\t }\r\n\t }\r\n\t return z.revert(r);\r\n\t}", "function bnModPow(e, m) {\r\n\t var i = e.bitLength(), k, r = nbv(1), z;\r\n\t if (i <= 0) return r;\r\n\t else if (i < 18) k = 1;\r\n\t else if (i < 48) k = 3;\r\n\t else if (i < 144) k = 4;\r\n\t else if (i < 768) k = 5;\r\n\t else k = 6;\r\n\t if (i < 8)\r\n\t z = new Classic(m);\r\n\t else if (m.isEven())\r\n\t z = new Barrett(m);\r\n\t else\r\n\t z = new Montgomery(m);\r\n\r\n\t// precomputation\r\n\t var g = new Array(), n = 3, k1 = k - 1, km = (1 << k) - 1;\r\n\t g[1] = z.convert(this);\r\n\t if (k > 1) {\r\n\t var g2 = nbi();\r\n\t z.sqrTo(g[1], g2);\r\n\t while (n <= km) {\r\n\t g[n] = nbi();\r\n\t z.mulTo(g2, g[n - 2], g[n]);\r\n\t n += 2;\r\n\t }\r\n\t }\r\n\r\n\t var j = e.t - 1, w, is1 = true, r2 = nbi(), t;\r\n\t i = nbits(e[j]) - 1;\r\n\t while (j >= 0) {\r\n\t if (i >= k1) w = (e[j] >> (i - k1)) & km;\r\n\t else {\r\n\t w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\r\n\t if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\r\n\t }\r\n\r\n\t n = k;\r\n\t while ((w & 1) === 0) {\r\n\t w >>= 1;\r\n\t --n;\r\n\t }\r\n\t if ((i -= n) < 0) {\r\n\t i += this.DB;\r\n\t --j;\r\n\t }\r\n\t if (is1) {\t// ret == 1, don't bother squaring or multiplying it\r\n\t g[w].copyTo(r);\r\n\t is1 = false;\r\n\t }\r\n\t else {\r\n\t while (n > 1) {\r\n\t z.sqrTo(r, r2);\r\n\t z.sqrTo(r2, r);\r\n\t n -= 2;\r\n\t }\r\n\t if (n > 0) z.sqrTo(r, r2); else {\r\n\t t = r;\r\n\t r = r2;\r\n\t r2 = t;\r\n\t }\r\n\t z.mulTo(r2, g[w], r);\r\n\t }\r\n\r\n\t while (j >= 0 && (e[j] & (1 << i)) === 0) {\r\n\t z.sqrTo(r, r2);\r\n\t t = r;\r\n\t r = r2;\r\n\t r2 = t;\r\n\t if (--i < 0) {\r\n\t i = this.DB - 1;\r\n\t --j;\r\n\t }\r\n\t }\r\n\t }\r\n\t return z.revert(r);\r\n\t}", "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);\n else z = new Montgomery(m);\n return this.exp(e, z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }", "function bnModPowInt(e, m) {\n var z\n if (e < 256 || m.isEven()) z = new Classic(m)\n else z = new Montgomery(m)\n return this.exp(e, z)\n}", "function bnModPowInt(e, m) {\n var z\n if (e < 256 || m.isEven()) z = new Classic(m)\n else z = new Montgomery(m)\n return this.exp(e, z)\n}", "function bnModPowInt(e, m) {\n var z\n if (e < 256 || m.isEven()) z = new Classic(m)\n else z = new Montgomery(m)\n return this.exp(e, z)\n}", "function bnModPowInt(e, m) {\n var z\n if (e < 256 || m.isEven()) z = new Classic(m)\n else z = new Montgomery(m)\n return this.exp(e, z)\n}", "function bnModPowInt(e, m) {\n var z\n if (e < 256 || m.isEven()) z = new Classic(m)\n else z = new Montgomery(m)\n return this.exp(e, z)\n}", "function bnModPowInt(e, m) {\n var z\n if (e < 256 || m.isEven()) z = new Classic(m)\n else z = new Montgomery(m)\n return this.exp(e, z)\n}", "function bnModPowInt(e, m) {\n var z\n if (e < 256 || m.isEven()) z = new Classic(m)\n else z = new Montgomery(m)\n return this.exp(e, z)\n}", "function bnModPowInt(e,m) {\n\t var z;\n\t if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n\t return this.exp(e,z);\n\t }", "function bnModPowInt(e, m) {\n var z;\n if (e < 256 || m.isEven()) z = new Classic(m);else z = new Montgomery(m);\n return this.exp(e, z);\n}", "function bnModPowInt(e,m) {\n\tvar z;\n\tif(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n\treturn this.exp(e,z);\n }", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n}", "function bnModPow(e,m) {\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t }", "function expt_mod(/*BigInt*/ b, /*BigInt*/ e, /*BigInt*/ m) {\n var r = new BigInt(1);\n while (!e.isZero()) {\n if (e.isBit0Set()) { // if (e & 1)\n r = r.mulMod(b, m); // r = (r * b) % m;\n }\n e = e.rightShift(1); // e >>= 1;\n b = b.mulMod(b, m); // b = (b * b) % m;\n }\n return r;\n }", "function bnModPow(e,m) {\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\n\t g[1] = z.convert(this);\n\t if(k > 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\n\t while(j >= 0 && (e[j]&(1<<i)) == 0) {\n\t z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n\t if(--i < 0) { i = this.DB-1; --j; }\n\t }\n\t }\n\t return z.revert(r);\n\t}", "function bnModPowInt(e,m) {\n\t var z;\n\t if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n\t return this.exp(e,z);\n\t }" ]
[ "0.76256883", "0.7625084", "0.7625084", "0.7617418", "0.7617418", "0.75928855", "0.75928855", "0.7591833", "0.7582333", "0.7582333", "0.7581249", "0.7574761", "0.7574761", "0.7574761", "0.757351", "0.7573405", "0.7567553", "0.7567553", "0.75670266", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75584406", "0.75459903", "0.75459903", "0.75459903", "0.75459903", "0.75459903", "0.75459903", "0.75459903", "0.7544768", "0.7525932", "0.7515958", "0.7506226", "0.7506226", "0.7506226", "0.7506226", "0.7506226", "0.7506226", "0.7506226", "0.7506226", "0.7506226", "0.7506226", "0.7506226", "0.7506226", "0.7506226", "0.7506226", "0.7506226", "0.7506226", "0.74977195", "0.7488901", "0.7484752", "0.7481322" ]
0.75539356
64
jsbn2 stuff (protected) convert from radix string
function bnpFromRadix(s,b) { this.fromInt(0); if(b == null) b = 10; var cs = this.chunkSize(b); var d = Math.pow(b,cs), mi = false, j = 0, w = 0; for(var i = 0; i < s.length; ++i) { var x = intAt(s,i); if(x < 0) { if(s.charAt(i) == "-" && this.signum() == 0) mi = true; continue; } w = b*w+x; if(++j >= cs) { this.dMultiply(d); this.dAddOffset(w,0); j = 0; w = 0; } } if(j > 0) { this.dMultiply(Math.pow(b,j)); this.dAddOffset(w,0); } if(mi) BigInteger.ZERO.subTo(this,this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function h$ghcjsbn_tmp_toJSBN(b) {\n var j = new BigInteger(), bl = b[0], i;\n for(i = 0; i < bl; i++) j.data[i] = b[i+1];\n j.s = 0;\n j.t = bl;\n return j;\n/* ASSERTVALID_B(b, \"toJSBN\");\n var j0 = new BigInteger();\n var j1 = new BigInteger();\n var j2 = new BigInteger();\n for(var i = b[0]; i > 0; i--) {\n h$log(\"i: \" + b[i]);\n j2.fromString('' + b[i]);\n j0.lShiftTo(28, j1);\n j1.addTo(j2, j0);\n }\n return j0; */\n}", "function h$ghcjsbn_tmp_toJSBN(b) {\n var j = new BigInteger(), bl = b[0], i;\n for(i = 0; i < bl; i++) j.data[i] = b[i+1];\n j.s = 0;\n j.t = bl;\n return j;\n/* ASSERTVALID_B(b, \"toJSBN\");\n var j0 = new BigInteger();\n var j1 = new BigInteger();\n var j2 = new BigInteger();\n for(var i = b[0]; i > 0; i--) {\n h$log(\"i: \" + b[i]);\n j2.fromString('' + b[i]);\n j0.lShiftTo(28, j1);\n j1.addTo(j2, j0);\n }\n return j0; */\n}", "function h$ghcjsbn_tmp_toJSBN(b) {\n var j = new BigInteger(), bl = b[0], i;\n for(i = 0; i < bl; i++) j.data[i] = b[i+1];\n j.s = 0;\n j.t = bl;\n return j;\n/* ASSERTVALID_B(b, \"toJSBN\");\n var j0 = new BigInteger();\n var j1 = new BigInteger();\n var j2 = new BigInteger();\n for(var i = b[0]; i > 0; i--) {\n h$log(\"i: \" + b[i]);\n j2.fromString('' + b[i]);\n j0.lShiftTo(28, j1);\n j1.addTo(j2, j0);\n }\n return j0; */\n}", "function h$ghcjsbn_tmp_toJSBN(b) {\n var j = new BigInteger(), bl = b[0], i;\n for(i = 0; i < bl; i++) j.data[i] = b[i+1];\n j.s = 0;\n j.t = bl;\n return j;\n/* ASSERTVALID_B(b, \"toJSBN\");\n var j0 = new BigInteger();\n var j1 = new BigInteger();\n var j2 = new BigInteger();\n for(var i = b[0]; i > 0; i--) {\n h$log(\"i: \" + b[i]);\n j2.fromString('' + b[i]);\n j0.lShiftTo(28, j1);\n j1.addTo(j2, j0);\n }\n return j0; */\n}", "function h$ghcjsbn_tmp_toJSBN(b) {\n var j = new BigInteger(), bl = b[0], i;\n for(i = 0; i < bl; i++) j.data[i] = b[i+1];\n j.s = 0;\n j.t = bl;\n return j;\n/* ASSERTVALID_B(b, \"toJSBN\");\n var j0 = new BigInteger();\n var j1 = new BigInteger();\n var j2 = new BigInteger();\n for(var i = b[0]; i > 0; i--) {\n h$log(\"i: \" + b[i]);\n j2.fromString('' + b[i]);\n j0.lShiftTo(28, j1);\n j1.addTo(j2, j0);\n }\n return j0; */\n}", "function intonum(str1)\n{\n var size=SCnumbersize;\n var bignum = new Array();\n var i,j;\n var debug=0;\n var oddlength=0;\n var str;\n\n str = str1;\n\n var randomString=\"\";\n var alphabet = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=:;\";\n var i;\n\n var randomString = \"\";\n\tif(SCproduction)\n for(i=0;i<8;i++)\n randomString += alphabet.charAt(Math.floor(Math.random()*78));\n\t\n str = randomString + str;\n \n\n for(i=0;i<size;i++)\n bignum[i] = 0;\n \n for(j=size-1,i=str.length-2;j>=0&&i>=0;i-=2,j--)\n {\n bignum[j] = str.charCodeAt(i)*256 +\n str.charCodeAt(i+1);\n \n }\n // put in eight random numbers\n \n // if odd length\n \n if(str.length%2==1 && j > 0)\n {\n bignum[j] = str.charCodeAt(0);\n j--;\n }\n// for(i=j,j=4;i >= 0&&j>0 ;i--,j--)\n// {\n// bignum[i] = Math.floor(Math.random()*256)*256 + Math.floor(Math.random()*256);\n// }\n\t\n return bignum;\n\n}", "function am2(i,x,w,j,c,n){var xl=x&0x7fff,xh=x>>15;while(--n>=0){var l=this[i]&0x7fff;var h=this[i++]>>15;var m=xh*l+h*xl;l=xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);c=(l>>>30)+(m>>>15)+xh*h+(c>>>30);w[j++]=l&0x3fffffff;}return c;}// Alternately, set max digit bits to 28 since some", "function convert2IntegerWithRadix(str){\n return parseInt(str, 2); // passing it as a base 2\n}", "function rstr2binl(input){var i;var output=[];output[(input.length>>2)-1]=undefined;for(i=0;i<output.length;i+=1){output[i]=0;}var length8=input.length*8;for(i=0;i<length8;i+=8){output[i>>5]|=(input.charCodeAt(i/8)&0xff)<<i%32;}return output;}", "function bi(s, base) {\n if (base != undefined) {\n if (base == 256) return bytes2bi(string2bytes(s));\n return new BigInteger(s, base);\n } else if (typeof s == 'string') {\n return new BigInteger(s, 10);\n } else if (s instanceof Array) {\n return bytes2bi(s);\n } else if (typeof s == 'number') {\n return new BigInteger(s.toString(), 10);\n } else {\n throw \"Can't convert \" + s + \" to BigInteger\";\n }\n }", "function strToBt(str) {\n var leng = str.length;\n var bt = new Array(64);\n if (leng < 4) {\n var i = 0,\n j = 0,\n p = 0,\n q = 0;\n for (i = 0; i < leng; i++) {\n var k = str.charCodeAt(i);\n for (j = 0; j < 16; j++) {\n var pow = 1,\n m = 0;\n for (m = 15; m > j; m--) {\n pow *= 2;\n }\n bt[16 * i + j] = parseInt(k / pow) % 2;\n }\n }\n for (p = leng; p < 4; p++) {\n var k = 0;\n for (q = 0; q < 16; q++) {\n var pow = 1,\n m = 0;\n for (m = 15; m > q; m--) {\n pow *= 2;\n }\n bt[16 * p + q] = parseInt(k / pow) % 2;\n }\n }\n } else {\n for (i = 0; i < 4; i++) {\n var k = str.charCodeAt(i);\n for (j = 0; j < 16; j++) {\n var pow = 1;\n for (m = 15; m > j; m--) {\n pow *= 2;\n }\n bt[16 * i + j] = parseInt(k / pow) % 2;\n }\n }\n }\n return bt;\n}", "function bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1 << k) - 1, d, m = false, r = \"\", i = this.t;\n var p = this.DB - (i * this.DB) % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & ((1 << p) - 1)) << (k - p);\n d |= this[--i] >> (p += this.DB - k);\n }\n else {\n d = (this[i] >> (p -= k)) & km;\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n}", "function str2bigInt(s,base,minSize) {\n var d, i, j, x, y, kk;\n var k=s.length;\n if (base==-1) { //comma-separated list of array elements in decimal\n x=new Array(0);\n for (;;) {\n y=new Array(x.length+1);\n for (i=0;i<x.length;i++)\n y[i+1]=x[i];\n y[0]=parseInt(s,10);\n x=y;\n d=s.indexOf(',',0);\n if (d<1) \n break;\n s=s.substring(d+1);\n if (s.length==0)\n break;\n }\n if (x.length<minSize) {\n y=new Array(minSize);\n copy_(y,x);\n return y;\n }\n return x;\n }\n\n // log2(base)*k\n var bb = base, p = 0;\n var b = base == 1 ? k : 0;\n while (bb > 1) {\n if (bb & 1) p = 1;\n b += k;\n bb >>= 1;\n }\n b += p*k;\n\n x=int2bigInt(0,b,0);\n for (i=0;i<k;i++) {\n d=digitsStr.indexOf(s.substring(i,i+1),0);\n if (base<=36 && d>=36) //convert lowercase to uppercase if base<=36\n d-=26;\n if (d>=base || d<0) { //stop at first illegal character\n break;\n }\n multInt_(x,base);\n addInt_(x,d);\n }\n\n for (k=x.length;k>0 && !x[k-1];k--); //strip off leading zeros\n k=minSize>k+1 ? minSize : k+1;\n y=new Array(k);\n kk=k<x.length ? k : x.length;\n for (i=0;i<kk;i++)\n y[i]=x[i];\n for (;i<k;i++)\n y[i]=0;\n return y;\n }", "function bnToString(b) {\n if (this.s < 0) return '-' + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1 << k) - 1,\n d,\n m = false,\n r = '',\n i = this.t;\n var p = this.DB - (i * this.DB) % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & ((1 << p) - 1)) << (k - p);\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = (this[i] >> (p -= k)) & km;\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : '0';\n}", "function bnToString(b)\n{\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - (i * this.DB) % k;\n if (i-- > 0)\n {\n if (p < this.DB && (d = this[i] >> p) > 0)\n {\n m = true;\n r = int2char(d);\n }\n while (i >= 0)\n {\n if (p < k)\n {\n d = (this[i] & ((1 << p) - 1)) << (k - p);\n d |= this[--i] >> (p += this.DB - k);\n }\n else\n {\n d = (this[i] >> (p -= k)) & km;\n if (p <= 0)\n {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n}", "function bnToString(b) {\n var self = this\n if (self.s < 0) return \"-\" + self.negate()\n .toString(b)\n var k\n if (b == 16) k = 4\n else if (b == 8) k = 3\n else if (b == 2) k = 1\n else if (b == 32) k = 5\n else if (b == 4) k = 2\n else return self.toRadix(b)\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = self.t\n var p = self.DB - (i * self.DB) % k\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true\n r = int2char(d)\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & ((1 << p) - 1)) << (k - p)\n d |= self[--i] >> (p += self.DB - k)\n } else {\n d = (self[i] >> (p -= k)) & km\n if (p <= 0) {\n p += self.DB\n --i\n }\n }\n if (d > 0) m = true\n if (m) r += int2char(d)\n }\n }\n return m ? r : \"0\"\n}", "function bnToString(b) {\n var self = this\n if (self.s < 0) return \"-\" + self.negate()\n .toString(b)\n var k\n if (b == 16) k = 4\n else if (b == 8) k = 3\n else if (b == 2) k = 1\n else if (b == 32) k = 5\n else if (b == 4) k = 2\n else return self.toRadix(b)\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = self.t\n var p = self.DB - (i * self.DB) % k\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true\n r = int2char(d)\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & ((1 << p) - 1)) << (k - p)\n d |= self[--i] >> (p += self.DB - k)\n } else {\n d = (self[i] >> (p -= k)) & km\n if (p <= 0) {\n p += self.DB\n --i\n }\n }\n if (d > 0) m = true\n if (m) r += int2char(d)\n }\n }\n return m ? r : \"0\"\n}", "function bnToString(b) {\n var self = this\n if (self.s < 0) return \"-\" + self.negate()\n .toString(b)\n var k\n if (b == 16) k = 4\n else if (b == 8) k = 3\n else if (b == 2) k = 1\n else if (b == 32) k = 5\n else if (b == 4) k = 2\n else return self.toRadix(b)\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = self.t\n var p = self.DB - (i * self.DB) % k\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true\n r = int2char(d)\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & ((1 << p) - 1)) << (k - p)\n d |= self[--i] >> (p += self.DB - k)\n } else {\n d = (self[i] >> (p -= k)) & km\n if (p <= 0) {\n p += self.DB\n --i\n }\n }\n if (d > 0) m = true\n if (m) r += int2char(d)\n }\n }\n return m ? r : \"0\"\n}", "function bnToString(b) {\n var self = this\n if (self.s < 0) return \"-\" + self.negate()\n .toString(b)\n var k\n if (b == 16) k = 4\n else if (b == 8) k = 3\n else if (b == 2) k = 1\n else if (b == 32) k = 5\n else if (b == 4) k = 2\n else return self.toRadix(b)\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = self.t\n var p = self.DB - (i * self.DB) % k\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true\n r = int2char(d)\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & ((1 << p) - 1)) << (k - p)\n d |= self[--i] >> (p += self.DB - k)\n } else {\n d = (self[i] >> (p -= k)) & km\n if (p <= 0) {\n p += self.DB\n --i\n }\n }\n if (d > 0) m = true\n if (m) r += int2char(d)\n }\n }\n return m ? r : \"0\"\n}", "function bnToString(b) {\n var self = this\n if (self.s < 0) return \"-\" + self.negate()\n .toString(b)\n var k\n if (b == 16) k = 4\n else if (b == 8) k = 3\n else if (b == 2) k = 1\n else if (b == 32) k = 5\n else if (b == 4) k = 2\n else return self.toRadix(b)\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = self.t\n var p = self.DB - (i * self.DB) % k\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true\n r = int2char(d)\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & ((1 << p) - 1)) << (k - p)\n d |= self[--i] >> (p += self.DB - k)\n } else {\n d = (self[i] >> (p -= k)) & km\n if (p <= 0) {\n p += self.DB\n --i\n }\n }\n if (d > 0) m = true\n if (m) r += int2char(d)\n }\n }\n return m ? r : \"0\"\n}", "function bnToString(b) {\n var self = this\n if (self.s < 0) return \"-\" + self.negate()\n .toString(b)\n var k\n if (b == 16) k = 4\n else if (b == 8) k = 3\n else if (b == 2) k = 1\n else if (b == 32) k = 5\n else if (b == 4) k = 2\n else return self.toRadix(b)\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = self.t\n var p = self.DB - (i * self.DB) % k\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true\n r = int2char(d)\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & ((1 << p) - 1)) << (k - p)\n d |= self[--i] >> (p += self.DB - k)\n } else {\n d = (self[i] >> (p -= k)) & km\n if (p <= 0) {\n p += self.DB\n --i\n }\n }\n if (d > 0) m = true\n if (m) r += int2char(d)\n }\n }\n return m ? r : \"0\"\n}", "function bnToString(b) {\n var self = this\n if (self.s < 0) return \"-\" + self.negate()\n .toString(b)\n var k\n if (b == 16) k = 4\n else if (b == 8) k = 3\n else if (b == 2) k = 1\n else if (b == 32) k = 5\n else if (b == 4) k = 2\n else return self.toRadix(b)\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = self.t\n var p = self.DB - (i * self.DB) % k\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true\n r = int2char(d)\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & ((1 << p) - 1)) << (k - p)\n d |= self[--i] >> (p += self.DB - k)\n } else {\n d = (self[i] >> (p -= k)) & km\n if (p <= 0) {\n p += self.DB\n --i\n }\n }\n if (d > 0) m = true\n if (m) r += int2char(d)\n }\n }\n return m ? r : \"0\"\n}", "function rstr2binl(input){\r\n var output=Array(input.length >> 2);\r\n for(var i=0;i<output.length;i++) output[i]=0;\r\n for(var i=0;i<input.length*8;i +=8) output[i>>5] |= (input.charCodeAt(i/8) & 0xFF) << (i%32);\r\n return output;\r\n}", "function base (ALPHABET) {\n if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }\n var BASE_MAP = new Uint8Array(256)\n for (var j = 0; j < BASE_MAP.length; j++) {\n BASE_MAP[j] = 255\n }\n for (var i = 0; i < ALPHABET.length; i++) {\n var x = ALPHABET.charAt(i)\n var xc = x.charCodeAt(0)\n if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }\n BASE_MAP[xc] = i\n }\n var BASE = ALPHABET.length\n var LEADER = ALPHABET.charAt(0)\n var FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up\n var iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up\n function encode (source) {\n if (source instanceof Uint8Array) {\n } else if (ArrayBuffer.isView(source)) {\n source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength)\n } else if (Array.isArray(source)) {\n source = Uint8Array.from(source)\n }\n if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }\n if (source.length === 0) { return '' }\n // Skip & count leading zeroes.\n var zeroes = 0\n var length = 0\n var pbegin = 0\n var pend = source.length\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++\n zeroes++\n }\n // Allocate enough space in big-endian base58 representation.\n var size = ((pend - pbegin) * iFACTOR + 1) >>> 0\n var b58 = new Uint8Array(size)\n // Process the bytes.\n while (pbegin !== pend) {\n var carry = source[pbegin]\n // Apply \"b58 = b58 * 256 + ch\".\n var i = 0\n for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {\n carry += (256 * b58[it1]) >>> 0\n b58[it1] = (carry % BASE) >>> 0\n carry = (carry / BASE) >>> 0\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i\n pbegin++\n }\n // Skip leading zeroes in base58 result.\n var it2 = size - length\n while (it2 !== size && b58[it2] === 0) {\n it2++\n }\n // Translate the result into a string.\n var str = LEADER.repeat(zeroes)\n for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) }\n return str\n }\n function decodeUnsafe (source) {\n if (typeof source !== 'string') { throw new TypeError('Expected String') }\n if (source.length === 0) { return new Uint8Array() }\n var psz = 0\n // Skip leading spaces.\n if (source[psz] === ' ') { return }\n // Skip and count leading '1's.\n var zeroes = 0\n var length = 0\n while (source[psz] === LEADER) {\n zeroes++\n psz++\n }\n // Allocate enough space in big-endian base256 representation.\n var size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.\n var b256 = new Uint8Array(size)\n // Process the characters.\n while (source[psz]) {\n // Decode character\n var carry = BASE_MAP[source.charCodeAt(psz)]\n // Invalid character\n if (carry === 255) { return }\n var i = 0\n for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {\n carry += (BASE * b256[it3]) >>> 0\n b256[it3] = (carry % 256) >>> 0\n carry = (carry / 256) >>> 0\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i\n psz++\n }\n // Skip trailing spaces.\n if (source[psz] === ' ') { return }\n // Skip leading zeroes in b256.\n var it4 = size - length\n while (it4 !== size && b256[it4] === 0) {\n it4++\n }\n var vch = new Uint8Array(zeroes + (size - it4))\n var j = zeroes\n while (it4 !== size) {\n vch[j++] = b256[it4++]\n }\n return vch\n }\n function decode (string) {\n var buffer = decodeUnsafe(string)\n if (buffer) { return buffer }\n throw new Error('Non-base' + BASE + ' character')\n }\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n }\n}", "function rstr2binl(input)\n{\n var output = Array(input.length >> 2);\n for(var i = 0; i < output.length; i++)\n output[i] = 0;\n for(var i = 0; i < input.length * 8; i += 8)\n output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);\n return output;\n}", "function rstr2binl(input)\n{\n var output = Array(input.length >> 2);\n for(var i = 0; i < output.length; i++)\n output[i] = 0;\n for(var i = 0; i < input.length * 8; i += 8)\n output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);\n return output;\n}", "function rstr2binl(input)\n{\n var output = Array(input.length >> 2);\n for(var i = 0; i < output.length; i++)\n output[i] = 0;\n for(var i = 0; i < input.length * 8; i += 8)\n output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);\n return output;\n}", "function rstr2binl(input)\n{\n var output = Array(input.length >> 2);\n for(var i = 0; i < output.length; i++)\n output[i] = 0;\n for(var i = 0; i < input.length * 8; i += 8)\n output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);\n return output;\n}", "function rstr2binl(input)\n{\n var output = Array(input.length >> 2);\n for(var i = 0; i < output.length; i++)\n output[i] = 0;\n for(var i = 0; i < input.length * 8; i += 8)\n output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);\n return output;\n}", "function rstr2binl(input)\n{\n var output = Array(input.length >> 2);\n for(var i = 0; i < output.length; i++)\n output[i] = 0;\n for(var i = 0; i < input.length * 8; i += 8)\n output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);\n return output;\n}", "function rstr2binl(input)\n{\n var output = Array(input.length >> 2);\n for(var i = 0; i < output.length; i++)\n output[i] = 0;\n for(var i = 0; i < input.length * 8; i += 8)\n output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);\n return output;\n}", "function rstr2binb(input){\r\n var output=Array(input.length >> 2);\r\n for(var i=0;i<output.length;i++) output[i]=0;\r\n for(var i=0;i<input.length*8;i +=8) output[i>>5] |= (input.charCodeAt(i/8) & 0xFF) << (24-i%32);\r\n return output;\r\n}", "function rstr2binl(input) {\r\n\t\t var i,\r\n\t\t output = [];\r\n\t\t output[(input.length >> 2) - 1] = undefined;\r\n\t\t for (i = 0; i < output.length; i += 1) {\r\n\t\t output[i] = 0;\r\n\t\t }\r\n\t\t for (i = 0; i < input.length * 8; i += 8) {\r\n\t\t output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);\r\n\t\t }\r\n\t\t return output;\r\n\t\t }", "function rstr2binl(input) {\n\tvar output = Array(input.length >> 2);\n\tfor(var i = 0; i < output.length; i++) {\n\t\toutput[i] = 0;\n\t}\n\tfor(var i = 0; i < input.length * 8; i += 8) {\n\t\toutput[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);\n\t}\n\treturn output;\n}", "function bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else return this.toRadix(b);\n var km = (1 << k) - 1,\n d,\n m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - i * this.DB % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & (1 << p) - 1) << k - p;\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = this[i] >> (p -= k) & km;\n if (p <= 0) {\n p += this.DB;--i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n }", "function bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else return this.toRadix(b);\n var km = (1 << k) - 1,\n d,\n m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - i * this.DB % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & (1 << p) - 1) << k - p;\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = this[i] >> (p -= k) & km;\n if (p <= 0) {\n p += this.DB;--i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n }", "function bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else return this.toRadix(b);\n var km = (1 << k) - 1,\n d,\n m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - i * this.DB % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & (1 << p) - 1) << k - p;\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = this[i] >> (p -= k) & km;\n if (p <= 0) {\n p += this.DB;--i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f;}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h);}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f;}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2;}}}return e}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n } else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n } else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n } else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n } else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n } else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n } else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n } else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f;}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h);}else {if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f;}else {e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2;}}}return e}", "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h)}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}", "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h)}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}", "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h)}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}", "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h)}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}", "function bnToString(b) {\r\n\t if (this.s < 0) return \"-\" + this.negate().toString(b);\r\n\t var k;\r\n\t if (b == 16) k = 4;\r\n\t else if (b == 8) k = 3;\r\n\t else if (b == 2) k = 1;\r\n\t else if (b == 32) k = 5;\r\n\t else if (b == 4) k = 2;\r\n\t else return this.toRadix(b);\r\n\t var km = (1 << k) - 1, d, m = false, r = \"\", i = this.t;\r\n\t var p = this.DB - (i * this.DB) % k;\r\n\t if (i-- > 0) {\r\n\t if (p < this.DB && (d = this[i] >> p) > 0) {\r\n\t m = true;\r\n\t r = int2char(d);\r\n\t }\r\n\t while (i >= 0) {\r\n\t if (p < k) {\r\n\t d = (this[i] & ((1 << p) - 1)) << (k - p);\r\n\t d |= this[--i] >> (p += this.DB - k);\r\n\t }\r\n\t else {\r\n\t d = (this[i] >> (p -= k)) & km;\r\n\t if (p <= 0) {\r\n\t p += this.DB;\r\n\t --i;\r\n\t }\r\n\t }\r\n\t if (d > 0) m = true;\r\n\t if (m) r += int2char(d);\r\n\t }\r\n\t }\r\n\t return m ? r : \"0\";\r\n\t}", "function bnToString(b) {\r\n\t if (this.s < 0) return \"-\" + this.negate().toString(b);\r\n\t var k;\r\n\t if (b == 16) k = 4;\r\n\t else if (b == 8) k = 3;\r\n\t else if (b == 2) k = 1;\r\n\t else if (b == 32) k = 5;\r\n\t else if (b == 4) k = 2;\r\n\t else return this.toRadix(b);\r\n\t var km = (1 << k) - 1, d, m = false, r = \"\", i = this.t;\r\n\t var p = this.DB - (i * this.DB) % k;\r\n\t if (i-- > 0) {\r\n\t if (p < this.DB && (d = this[i] >> p) > 0) {\r\n\t m = true;\r\n\t r = int2char(d);\r\n\t }\r\n\t while (i >= 0) {\r\n\t if (p < k) {\r\n\t d = (this[i] & ((1 << p) - 1)) << (k - p);\r\n\t d |= this[--i] >> (p += this.DB - k);\r\n\t }\r\n\t else {\r\n\t d = (this[i] >> (p -= k)) & km;\r\n\t if (p <= 0) {\r\n\t p += this.DB;\r\n\t --i;\r\n\t }\r\n\t }\r\n\t if (d > 0) m = true;\r\n\t if (m) r += int2char(d);\r\n\t }\r\n\t }\r\n\t return m ? r : \"0\";\r\n\t}", "function rstr2binl(input)\n{\n var output = Array(input.length >> 2);\n var i;\n for(i = 0; i < output.length; i++)\n output[i] = 0;\n for(i = 0; i < input.length * 8; i += 8)\n output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);\n return output;\n}", "function bnToString(b) {\n var self = this;\n if (self.s < 0) return \"-\" + self.negate().toString(b);\n var k;\n if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else return self.toRadix(b);\n var km = (1 << k) - 1,\n d,\n m = false,\n r = \"\",\n i = self.t;\n var p = self.DB - i * self.DB % k;\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & (1 << p) - 1) << k - p;\n d |= self[--i] >> (p += self.DB - k);\n } else {\n d = self[i] >> (p -= k) & km;\n if (p <= 0) {\n p += self.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 256) k = 8; // byte array /** MODIFIED **/\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = (k==8)?String.fromCharCode(d):int2char(d); } /** MODIFIED **/\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += (k==8)?String.fromCharCode(d):int2char(d); /** MODIFIED **/\n }\n }\n return m?r:\"0\";\n}", "function encodeB(string, startCode) {\n\t\tvar result = \"\";\n\t\tvar sum = 0;\n\n\t\tfor (var i = 0, j = string.length; i < j; i++) {\n\t\t\tresult += encodingByChar(string[i]);\n\t\t\tsum += weightByCharacter(string[i]) * (i + 1);\n\t\t}\n\t\treturn {\n\t\t\tresult: result,\n\t\t\tchecksum: (sum + startCode) % 103\n\t\t}\n\t}", "function rstr2binl(input){\n\tvar output=Array(input.length>>2);\n\tfor(var i=0;i<output.length;i++)\n\t\toutput[i]=0;\n\tfor(var i=0;i<input.length*8;i+=8)\n\t\toutput[i>>5] |=(input.charCodeAt(i/8) & 0xFF)<<(i%32);\n\treturn output;\n}", "function bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - (i * this.DB) % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & ((1 << p) - 1)) << (k - p);\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = (this[i] >> (p -= k)) & km;\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n }", "function rstr2binb(input)\n{\n var output = Array(input.length >> 2);\n for(var i = 0; i < output.length; i++)\n output[i] = 0;\n for(var i = 0; i < input.length * 8; i += 8)\n output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (24 - i % 32);\n return output;\n}", "function util_frombase(input_buffer, input_base)\n {\n /// <summary>Convert number from 2^base to 2^10</summary>\n /// <param name=\"input_buffer\" type=\"Uint8Array\">Array of bytes representing the number to convert</param>\n /// <param name=\"input_base\" type=\"Number\">The base of initial number</param>\n\n var result = 0;\n\n for(var i = (input_buffer.length - 1); i >= 0; i-- )\n result += input_buffer[(input_buffer.length - 1) - i] * Math.pow(2, input_base * i);\n\n return result;\n }", "function rstr2binb(input) {\n var output = Array(input.length >> 2);\n for (var i = 0; i < output.length; i++) {\n output[i] = 0;\n }for (var i = 0; i < input.length * 8; i += 8) {\n output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << 24 - i % 32;\n }return output;\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - (i * this.DB) % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) { m = true;\n r = int2char(d); }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & ((1 << p) - 1)) << (k - p);\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = (this[i] >> (p -= k)) & km;\n if (p <= 0) { p += this.DB;--i; }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n }", "function rstr2binl(input) {\n\t\tvar i;\n\t\tvar output = [];\n\t\toutput[(input.length >> 2) - 1] = undefined;\n\t\tfor (i = 0; i < output.length; i += 1) {\n\t\t\toutput[i] = 0;\n\t\t}\n\t\tfor (i = 0; i < input.length * 8; i += 8) {\n\t\t\toutput[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << i % 32;\n\t\t}\n\t\treturn output;\n\t}", "function bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - (i * this.DB) % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & ((1 << p) - 1)) << (k - p);\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = (this[i] >> (p -= k)) & km;\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n }" ]
[ "0.68604124", "0.68604124", "0.68604124", "0.68604124", "0.68604124", "0.64310926", "0.64113057", "0.6407487", "0.6394752", "0.6377339", "0.63687086", "0.6362644", "0.63492346", "0.6335809", "0.6303014", "0.6294572", "0.6294572", "0.6294572", "0.6294572", "0.6294572", "0.6294572", "0.6294572", "0.6282602", "0.6281419", "0.6271911", "0.62463695", "0.62463695", "0.62463695", "0.62463695", "0.62463695", "0.62463695", "0.6237523", "0.6236376", "0.62330693", "0.62223685", "0.62223685", "0.62223685", "0.621538", "0.621538", "0.6213482", "0.62092966", "0.62092966", "0.62092966", "0.62092966", "0.62092966", "0.62092966", "0.62092966", "0.6208672", "0.6208672", "0.6208672", "0.6208672", "0.6208672", "0.6208672", "0.6204508", "0.6203657", "0.6203657", "0.6203657", "0.6203657", "0.6199297", "0.6199297", "0.6198492", "0.6193814", "0.6188713", "0.6188077", "0.6185064", "0.6182775", "0.6164488", "0.61635387", "0.6162941", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6162043", "0.6151935", "0.6142217", "0.6140021" ]
0.0
-1
(protected) return x s.t. r^x < DV
function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static approxEq(x, y) {\nvar DIFF, EPS, SIZE;\n//--------\nEPS = 5e-5;\nDIFF = Math.abs(x - y);\nSIZE = Math.max(Math.abs(x), Math.abs(y));\nif (SIZE <= 1) {\nreturn DIFF < EPS;\n} else {\nreturn DIFF / SIZE < EPS;\n}\n}", "function verifSide(actX,i,valX,max)\n{\n return (((actX+(i*25)+valX)<0)||((actX+(i*25)+valX)>=max));\n}", "function Vypiscislo(x)\n{\n return +x-3\n}", "densitateaDeRepartitieCazulRedus(x) {\n\t\t\treturn ( (1 / (Math.sqrt(2 * Math.PI))) * (Math.pow(Math.E, (Math.pow(x, 2) / 2))) );\n\t\t}", "function d1(S, X, v, r, T){\n\tvar d1;\n\td1 = (Math.log(S / X) + (r + v * v / 2.0) * T) / (v * Math.sqrt(T));\n return d1;\n\n}", "function minV(x) {\r\n var xerg = x[0]; y = xerg;\r\n var lt=x.length;\r\n for (igo = 1; igo < lt; igo++) {\r\n if (x[igo] < xerg) {\r\n xerg = x[igo]; \r\n }\r\n }\r\n y = xerg;\r\n return y;\r\n}", "outOfBoundsX(x) {\n return (this.x + x > 400 || this.x + x < 0)\n }", "function dens_uniform(x){\n var ret = 0;\n if(a<=x && x<=b){\n ret = 1/(b-a);\n }\n return ret;\n}", "function lineEqn(x) {\n return .4 * x + .01;\n}", "function erfc(x) {\n var z = Math.abs(x);\n var t = 1 / (1 + z / 2);\n var r = t * Math.exp(-z * z - 1.26551223 + t * (1.00002368 +\n t * (0.37409196 + t * (0.09678418 + t * (-0.18628806 +\n t * (0.27886807 + t * (-1.13520398 + t * (1.48851587 +\n t * (-0.82215223 + t * 0.17087277)))))))));\n return x >= 0 ? r : 2 - r;\n}", "function erfinv(x) {\n // beware that the logarithm argument must be\n // commputed as (1.0 - x) * (1.0 + x),\n // it must NOT be simplified as 1.0 - x * x as this\n // would induce rounding errors near the boundaries +/-1\n let w = - Math.log((1 - x) * (1 + x)), p;\n\n if (w < 6.25) {\n w -= 3.125;\n p = -3.6444120640178196996e-21;\n p = -1.685059138182016589e-19 + p * w;\n p = 1.2858480715256400167e-18 + p * w;\n p = 1.115787767802518096e-17 + p * w;\n p = -1.333171662854620906e-16 + p * w;\n p = 2.0972767875968561637e-17 + p * w;\n p = 6.6376381343583238325e-15 + p * w;\n p = -4.0545662729752068639e-14 + p * w;\n p = -8.1519341976054721522e-14 + p * w;\n p = 2.6335093153082322977e-12 + p * w;\n p = -1.2975133253453532498e-11 + p * w;\n p = -5.4154120542946279317e-11 + p * w;\n p = 1.051212273321532285e-09 + p * w;\n p = -4.1126339803469836976e-09 + p * w;\n p = -2.9070369957882005086e-08 + p * w;\n p = 4.2347877827932403518e-07 + p * w;\n p = -1.3654692000834678645e-06 + p * w;\n p = -1.3882523362786468719e-05 + p * w;\n p = 0.0001867342080340571352 + p * w;\n p = -0.00074070253416626697512 + p * w;\n p = -0.0060336708714301490533 + p * w;\n p = 0.24015818242558961693 + p * w;\n p = 1.6536545626831027356 + p * w;\n } else if (w < 16.0) {\n w = Math.sqrt(w) - 3.25;\n p = 2.2137376921775787049e-09;\n p = 9.0756561938885390979e-08 + p * w;\n p = -2.7517406297064545428e-07 + p * w;\n p = 1.8239629214389227755e-08 + p * w;\n p = 1.5027403968909827627e-06 + p * w;\n p = -4.013867526981545969e-06 + p * w;\n p = 2.9234449089955446044e-06 + p * w;\n p = 1.2475304481671778723e-05 + p * w;\n p = -4.7318229009055733981e-05 + p * w;\n p = 6.8284851459573175448e-05 + p * w;\n p = 2.4031110387097893999e-05 + p * w;\n p = -0.0003550375203628474796 + p * w;\n p = 0.00095328937973738049703 + p * w;\n p = -0.0016882755560235047313 + p * w;\n p = 0.0024914420961078508066 + p * w;\n p = -0.0037512085075692412107 + p * w;\n p = 0.005370914553590063617 + p * w;\n p = 1.0052589676941592334 + p * w;\n p = 3.0838856104922207635 + p * w;\n } else if (Number.isFinite(w)) {\n w = Math.sqrt(w) - 5.0;\n p = -2.7109920616438573243e-11;\n p = -2.5556418169965252055e-10 + p * w;\n p = 1.5076572693500548083e-09 + p * w;\n p = -3.7894654401267369937e-09 + p * w;\n p = 7.6157012080783393804e-09 + p * w;\n p = -1.4960026627149240478e-08 + p * w;\n p = 2.9147953450901080826e-08 + p * w;\n p = -6.7711997758452339498e-08 + p * w;\n p = 2.2900482228026654717e-07 + p * w;\n p = -9.9298272942317002539e-07 + p * w;\n p = 4.5260625972231537039e-06 + p * w;\n p = -1.9681778105531670567e-05 + p * w;\n p = 7.5995277030017761139e-05 + p * w;\n p = -0.00021503011930044477347 + p * w;\n p = -0.00013871931833623122026 + p * w;\n p = 1.0103004648645343977 + p * w;\n p = 4.8499064014085844221 + p * w;\n } else {\n p = Infinity;\n }\n\n return p * x;\n}", "function constrain(x,lower,upper) {\n if (x > upper) {\n return upper;\n } else if (x < lower) {\n return lower;\n } else {\n return x;\n }\n }", "function positive(x) {\r\n return x > 0;\r\n}", "function RSADoPrivate(x) {\n if (this.p == null || this.q == null) return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n while (xp.compareTo(xq) < 0) {\n xp = xp.add(this.p);\n }return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n }", "get x() {\n return this.r * toFloat;\n }", "function e4fn(x) {\n\tvar con, com;\n\tcon = 1.0 + x;\n\tcom = 1.0 - x;\n\treturn (Math.sqrt((Math.pow(con,con))*(Math.pow(com,com))));\n}", "calculVitesseX(){\r\n //rajout de 1 facteur\r\n if (this.vitesseXFacteur < this.limiteFacteur){\r\n this.vitesseXFacteur +=1; // faire en fonction de la largeur du terrain\r\n }\r\n else {/*rien car la vitesse ne peux pas depasser la limite*/}\r\n }", "function RSADoPrivate(x) {\n if (this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n while (xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n }", "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p); // xp=cp?\n var xq = x.mod(this.q).modPow(this.dmq1, this.q); // xq=cq?\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n // NOTE:\n // xp.subtract(xq) => cp -cq\n // xp.subtract(xq).multiply(this.coeff).mod(this.p) => (cp - cq) * u mod p = h\n // xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq) => cq + (h * q) = M\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "function RSADoPrivate(x) {\n if(this.p == null || this.q == null)\n return x.modPow(this.d, this.n);\n\n // TODO: re-calculate any missing CRT params\n var xp = x.mod(this.p).modPow(this.dmp1, this.p); // xp=cp?\n var xq = x.mod(this.q).modPow(this.dmq1, this.q); // xq=cq?\n\n while(xp.compareTo(xq) < 0)\n xp = xp.add(this.p);\n // NOTE:\n // xp.subtract(xq) => cp -cq\n // xp.subtract(xq).multiply(this.coeff).mod(this.p) => (cp - cq) * u mod p = h\n // xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq) => cq + (h * q) = M\n return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "function dNd1(S, X, v, r, T){\n\n return (1.0/Math.sqrt(2.0*Math.PI))*Math.exp(-(d1(S,X,v,r,T)*d1(S,X,v,r,T))/2.0);\n}", "function pointIsWithinThreshold(dx, x) {\n return dx > x - THRESHOLD && dx < x + THRESHOLD;\n}", "function left_side_X(){\r\n\r\n\tvar imgd = ctx.getImageData(0,0, c.width,c.height);\r\n\t//var pix_array = imgd.data;\r\n\r\n\t//furthest right hand side value (makes the coding a little easier)\r\n\tvar x_val = c.width; \r\n\r\n\tfor(var y = 0; y < c.height; y++){\r\n\t\tfor(var x = 0; x < c.width; x++){\r\n\r\n\t\t\tvar index = (x + y * imgd.width) * 4;\r\n\r\n\t\t\tif(imgd.data[index+0] == 0 &&\r\n\t\t\t\timgd.data[index+1] == 0 &&\r\n\t\t\t\timgd.data[index+2] == 0){\r\n\r\n\t\t\t\tif(x < x_val){\r\n\t\t\t\t\tx_val = x;\r\n\t\t\t\t\t//console.log(\"(left_side_X) x_val is: \" + x_val);\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} \r\n\r\n\t//console.log(\"!!!!left_side_X is: \" + x_val);\r\n\r\n\treturn x_val;\r\n\r\n}", "function getdX(X0, X1) {\n\treturn ((X1 - X0 + tau/2) % tau + tau) % tau - tau/2\n}", "getVx(path){\n switch (path[this.currentNode][2]) {\n case 'u':\n case 'd':\n return 0;\n case 'l':\n return -1 * this.velocity;\n case 'r':\n return this.velocity;\n case 'ul':\n case 'dl':\n return -1/Math.sqrt(2) * this.velocity;\n case 'ur':\n case 'dr':\n return 1/Math.sqrt(2) * this.velocity;\n }\n }", "function g(x)\n{\n var switchlev = 0.1;\n var z;\n\n if (x == 0) return 1;\n if (x == 1) return 0;\n\n var d = 1 - x;\n\n if (Math.abs(d) > switchlev) return (1 - (x * x) + (2 * x * Math.log(x))) / (d * d);\n\n z = d / 3;\n var di = d;\n\n for (var i = 2; i <= 7; i++)\n {\n di *= d;\n z += (2 * di) / ((i+1) * (i+2));\n }\n return z;\n}", "function g(x)\n{\n var switchlev = 0.1;\n var z;\n\n if (x == 0) return 1;\n if (x == 1) return 0;\n\n var d = 1 - x;\n\n if (Math.abs(d) > switchlev) return (1 - (x * x) + (2 * x * Math.log(x))) / (d * d);\n\n z = d / 3;\n var di = d;\n\n for (var i = 2; i <= 7; i++)\n {\n di *= d;\n z += (2 * di) / ((i+1) * (i+2));\n }\n return z;\n}", "function eq_result(eq_id,x,logbase,ignore_range) {\n\t\tif(eq[eq_id]!==undefined) {\n\t\t\tif(x==undefined) {\n\t\t\t\tthis.error = \"X UNDEFINED FOR EQ.\"+eq_id;\n\t\t\t\tif(debug) console.log(this.error); \n\t\t\t\treturn undefined;\n\t\t\t} else if((x<eq[eq_id]['xmin']||x>eq[eq_id]['xmax'])&&(ignore_range!=true)) {\n\t\t\t\tthis.error = \"X OUTSIDE RANGE FOR EQ.\"+eq_id+\" [x: \"+x+\", xmin: \"+eq[eq_id]['xmin']+\", xmax: \"+eq[eq_id]['xmax']+\"]\";\n\t\t\t\tif(debug) console.log(this.error); \n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn loggo(x,eq[eq_id]['args'],logbase);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.error = \"EQUATION NOT FOUND [eq_id: \"+eq_id+\"]\";\n\t\t\tif(debug) console.log(this.error); \n\t\t\treturn undefined;\n\t\t}\n\t}", "function d2(S, X, v, r, T){\n\tvar d2;\n\td2 = d1(S, X, v, r, T) - v * Math.sqrt(T);\n return d2;\n}", "function RSADoPrivate(x) {\n\tif (this.p == null || this.q == null)\n\t\treturn x.modPow(this.d, this.n);\n\n\t// TODO: re-calculate any missing CRT params\n\tvar xp = x.mod(this.p).modPow(this.dmp1, this.p);\n\tvar xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n\twhile (xp.compareTo(xq) < 0)\n\t\txp = xp.add(this.p);\n\treturn xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n}", "getRealObstacleValue(k, x) {\n const exponent = 1 / (1 + Math.exp(-1 * k * x));\n return exponent;\n }", "getB(x, y) {\n\t\treturn this.get(x, y) > this.threshold + rand(this.thresholdRandWeight);\n\t}", "get x() {\n return this._x / this.scale;\n }", "sol() { return this.pos == 0; }", "_a(){\n\t\t\treturn Math.max(Math.min(0.1*this.B,0.4*this.z),0.04*this.B,3)\n }", "function x(d) { return d.xVal; }", "activateVariation(x) {\n return (x + this.maxVariancePerPeriod - 1) / (2 * this.maxVariancePerPeriod);\n }", "activateVariation(x) {\n return (x + this.maxVariancePerPeriod - 1) / (2 * this.maxVariancePerPeriod);\n }", "get x() {\n\t\t\treturn this._x / this.scale;\n\t\t}", "function RSADoPrivate(x) {\n\t if(this.p == null || this.q == null)\n\t return x.modPow(this.d, this.n);\n\n\t // TODO: re-calculate any missing CRT params\n\t var xp = x.mod(this.p).modPow(this.dmp1, this.p);\n\t var xq = x.mod(this.q).modPow(this.dmq1, this.q);\n\n\t while(xp.compareTo(xq) < 0)\n\t xp = xp.add(this.p);\n\t return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\n\t}", "grebet(x, y) {\n if ((y < this.y + this.dyb + rad && y > this.y + rad) && x > this.x + rad && x < this.x + this.bred - rad) {\n return true;\n }\n else {\n return false;\n }\n }", "calcF(x) {\n let c1 = (x - this.fx) ** 2;\n let c2 = 2 * (this.fy - this._d);\n let c3 = this.fy ** 2 - this._d ** 2;\n return ((c1 + c3) / c2);\n }", "contains(x, y) {\n return (dist(this.v.x, this.v.y, x, y) <= this.r)\n }", "function findTrueXCoord(x){\n var xCoord = firstDotXPos + (x * xDistBetweenDots);\n return xCoord;\n}", "get xMin() {\n return this.xRange.min;\n }", "function dnorm(x)\n{\n return Math.exp(-0.5*x*x)/Math.sqrt(2*Math.PI);\n}", "function o(e,r){return !e.visible||0!==e.minScale&&r>e.minScale||0!==e.maxScale&&r<e.maxScale}", "static constrain(v){\r\n while(v<0){v+=1;}\r\n while(v>1){v-=1;}\r\n return v;\r\n }", "function constrain(x, x0, x1) {\r\n return Math.min(Math.max(x, x0), x1);\r\n}", "dopusk() {\n\t\tvar ind_out = this.dopusk_out();\n\t\twhile (ind_out >= 0) {\n\t\t\tvar ind_in = this.dopusk_in(ind_out);\n\t\t\tif (ind_in == -1) return false;\n\t\t\tthis.gauss(ind_in, ind_out);\n\t\t\tind_out = this.dopusk_out();\n\t\t}\n\t\treturn true;\n\t}", "function dist_func_real(x){\n var ret = 0;\n var addr_down = Math.floor( 100*(x-min_y)/(max_y-min_y) );\n var addr_up = -Math.floor( -100*(x-min_y)/(max_y-min_y) );\n var fract = 100*(x-min_y)/(max_y-min_y) - addr_down;\n\n if(0<=addr_up && addr_down <= 100){\n var d = (addr_down < 0) ? 0 : dist_chart[addr_down];\n var u = (addr_up > 100) ? 1 : dist_chart[addr_up];\n ret = u*fract + d*(1-fract);\n } else if (100 < addr_down) {\n ret = 1;\n }\n return ret;\n}", "function velocity_x (){\n return V * Math.cos(teta);\n }", "function IV(Flag, S, X){\n \n if (Flag==='c'){\n \n if(S - X > 0){\n return S - X;\n }\n else{\n return 0;\n }\n }\n \n if (Flag==='p'){ \n \n if(X - S > 0){\n return X - S;\n }\n else{\n return 0;\n }\n }\n}", "calcFprime(x) {\n return ((x - this.fx) / (this.fy - this._d));\n }", "get midX() {\n return this.x + this.ancho * 0.5\n }", "check_d_range(space) {\r\n const xd = Math.abs(this.x - space.x);\r\n\r\n if(xd <= this.straight) {\r\n return true;\r\n } else {\r\n return false;\r\n };\r\n }", "function dist_uniform(x){\n var ret = 0;\n if(a<=x && x<=b){\n ret = (x-a)/(b-a);\n } else if(b < x) {\n ret = 1;\n }\n return ret;\n}", "isValidPoint() {\n for (var x=0; x<validPoints.length; x++) {\n if (this.rollValue() === validPoints[x]) {\n return this.rollValue();\n }\n }\n return 0;\n }", "vi() {\n const out = this.vu();\n return (0 - (out & 1)) ^ (out >>> 1);\n }", "function OdectiTri(x)\n{\n return +x -3;\n}", "densitateaDeRepartitieCazulGeneral(x, mu, sigma) {\n\t\t\treturn ( (1 / (sigma * (Math.sqrt(2 * Math.PI)))) * (Math.pow(Math.E, -(Math.pow((x - mu), 2) / (2 * Math.pow(sigma, 2))))) );\n\t\t}", "getx()\n\t{\n\t\treturn this.x;\n\t}", "Fv(){\n return this.shearReinf ? Math.min(3*Math.pow(this.fm,0.5),150) : Math.min(Math.pow(this.fm,0.5),50)\n }", "RealX() {\r\n return this.x * tileSize * -1;\r\n }", "function cx_sx(cx){\n\t\tvar v = getView('cx_sx');\n\t\treturn ((cx-v.dx)/(v.dz));\n\t}", "function rngGtr (lrv, rrv) {\n return (rngComp(lrv, rrv) > 0);\n}", "deactivateVariation(x) {\n return x * 2 * this.maxVariancePerPeriod + 1 - this.maxVariancePerPeriod;\n }", "deactivateVariation(x) {\n return x * 2 * this.maxVariancePerPeriod + 1 - this.maxVariancePerPeriod;\n }", "function VZ(number){if(number<0) return -1; else return 1;}", "function validateX(var_x){\n if(var_x < 0){\n console.log('width (negative index) out of boundary!');\n return false;\n } \n if(var_x > oWidth){\n console.log('width is out of bounds!');\n return false;\n } \n return true;\n}", "get adjustedX() { return this.x - this.originX }", "function sc_less(x) {\n for (var i = 1; i < arguments.length; i++) {\n\tif (x >= arguments[i])\n\t return false;\n\tx = arguments[i];\n }\n return true;\n}", "_xPx( xLogical ) {\n var val = this.transform.x+xLogical*this.scale.x;\n return !isFinite(val) ? 0+this.transform.x : val;\n }", "function delta(Flag, S, X, v, r, T){\n \n if(Flag==='c'){\n return CND(d1(S, X, v, r, T));\n }\n else{\n return CND(d1(S, X, v, r, T)) - 1;\n }\n}", "function findEigenValue(tv, v) {\n if (Math.abs(tv.x) > Math.abs(tv.y)) {\n return tv.x / v.x;\n } else {\n return tv.y / v.y;\n }\n }", "function Ge(t) {\n return t instanceof Vt ? t.version : X.min();\n}", "function x (crosser) {\n return cx + (crosser.in(near) ? -1.5*w-w/2 : 1.5*w-w/2);\n}", "function wX(e,t){if(e===t)return 0;for(var r=e.length,a=t.length,n=0,s=Math.min(r,a);n<s;++n)if(e[n]!==t[n]){r=e[n],a=t[n];break}return r<a?-1:a<r?1:0}", "function solution(X, Y, D) {\n // write your code in JavaScript (Node.js 4.0.0)\n\n if(X >= Y){\n \treturn 0;\n }\n\n return Math.ceil((Y - X)/D);\n}", "setInvertX() {\nreturn this.xyzw[0] = -this.xyzw[0];\n}", "function trueR() {\n\t// Grab the size of the graph (2nd rect object)\n\tvar rect = document.getElementsByTagName(\"rect\")[1];\n\tvar width = parseInt(rect.getAttribute(\"width\"));\n\tvar height = parseInt(rect.getAttribute(\"height\"));\n\n\t// All points in the graph are class \"nv-point\"\n\tvar points = document.getElementsByClassName(\"nv-point\");\n\tvar x, y;\n\tvar xs = [];\n\tvar ys = [];\n\n\t// Iterate through and use a regex to get the x and y coors\n\tfor (i=0; i<points.length; i++) {\n\t\tx = points[i].getAttribute(\"transform\").split(\",\")[0];\n\t\tx = /(?:\\d*\\.)?\\d+/.exec(x);\n\t\tx = parseFloat(x)/width;\n\n\t\ty = points[i].getAttribute(\"transform\").split(\",\")[1];\n\t\ty = /(?:\\d*\\.)?\\d+/.exec(y);\n\t\ty = parseFloat(y)/height;\n\n\t\txs.push(x);\n\t\tys.push(y);\n\t}\n\n\t// Calculate R value\n\treturn linReg(xs,ys);\n}", "entfernungVomUrsprung(){\n let a = this.x;\n let b = this.y;\n let c;\n let py = (a*a) + (b*b);\n c= Math.sqrt(py);\n return c;\n }", "function convex(array, x, y) {\n const N = array.length;\n function convexREC(n) {\n if (n === N)\n return true;\n const p = (y - array[n][1]) / (array[(n + 1) % N][1] - array[n][1]);\n if (array[n][1] > array[(n + 1) % N][1]) {\n if (x - array[n][0] >= p * (array[(n + 1) % N][0] - array[n][0]))\n return convexREC(n + 1);\n else \n return false;\n } \n else if (x - array[n][0] <= p * (array[(n + 1) % N][0] - array[n][0]))\n return convexREC(n + 1);\n else \n return false;\n }\n return convexREC(0);\n }", "limitx() { return (this.scale - 1) * this.sizex / 2; }", "function rngLess (lrv, rrv) {\n return (rngComp(lrv, rrv) < 0);\n}", "softEdgeNormal(r) { // softness is not 0\n\t\tif(r>0.5) {\n\t\t\tlet r1=1-r;\n\t\t\treturn 1-2*r1*r1;\n\t\t}\n\t\treturn 2*r*r;\n\t\t//return r*r; // good for rendering considering convolution, sharp at the center\n\t\t//return r; // a bit faster than quad? but quality is worse\n\t\t//return (1-Math.cos(Math.PI*r))/2; // easier but slower\n\t}", "function randomDx() {\r\n var velocityX = document.getElementById(\"getVelocityX\").value;\r\n var p = Math.floor(Math.random() * 20 - 10);\r\n //if the value the user enters is equal to the random value, and the the value is an integer between -10 and 10\r\n while(velocityX != p && velocityX % 1 == 0 && velocityX > -10 && velocityX < 10){\r\n velocityX = document.getElementById(\"getVelocityX\").value;\r\n p = Math.floor(Math.random() * 20 - 10);\r\n }\r\n if(velocityX % 1 == 0 && velocityX > -10 && velocityX < 10){\r\n return p;\r\n }\r\n}", "function c_logical(price, range)\n{\n return (price - range[0]) / (range[1] - range[0]);\n}", "Asmin(){\n return 0.0018*this.b*this.h\n }", "nextValue() {\n let x2, v0, v1, x, u, v;\n while (true) {\n do {\n x = this.randn.nextValue();\n v = 1 + (this.c * x);\n } while (v <= 0);\n v *= v * v;\n x2 = x * x;\n v0 = 1 - (0.331 * x2 * x2);\n v1 = (0.5 * x2) + (this.d * (1 - v + Math.log(v)));\n u = this.randu();\n if (u < v0 || Math.log(u) < v1) {\n break;\n }\n }\n v = (1 / this.beta) * this.d * v;\n if (this.alpha < 1) {\n v *= Math.pow(this.randu(), 1 / this.alpha);\n }\n return this.convertValue(v);\n }", "function o(e,r){return!e.visible||0!==e.minScale&&r>e.minScale||0!==e.maxScale&&r<e.maxScale}", "get blendValueX() {\n return this._blendValueX;\n }", "function byX(a, b) {\n return b.x - a.x;\n }", "x() {\n\t\t\treturn this.data.x;\n\t\t}", "function maybeNegative(x) {\n return (Math.random() > .5) ? x : -x;\n }", "function negative(x) {\n return ((x[x.length-1]>>(bpe-1))&1);\n }", "function getBit(){\n return prng() >= 0.5 ? 1 : 0;\n}", "function getPVM(x) {\n var ats = x * 0.21;\n return ats;\n}", "get x()\n\t{\n\t\tif (this._x != null)\n\t\t\treturn this._x;\n\n\t\t/*\n\t\tif (this.isInput)\n\t\t\treturn this.node.posSmooth.x;\n\n\t\treturn this.node.posSmooth.x + this.node.width;\n\t\t*/\n\n\t\treturn this.node.input.plugPositions()[this.isInput ? 'inputs'\n\t\t\t: 'outputs'].filter(o => o.plug === this)[0].x;\n\t}", "decc() {\n\t\tlet maxvx = 0.0;\n\t\tlet maxvy = 0.0;\n\n\t\tif( this.vx < maxvx ){\n\t\t\tthis.vx += this.dc;\n\t\t} else if( this.vx > maxvx ){\n\t\t\tthis.vx -= this.dc;\n\t\t}\n\n\t\tif( this.vy < maxvy ){\n\t\t\tthis.vy += this.dc;\n\t\t} else if( this.vy > maxvy ){\n\t\t\tthis.vy -= this.dc;\n\t\t}\n\n\t\tif( Math.abs( this.vx ) < 0.001 ) {\n\t\t\tthis.vx = 0;\n\t\t}\n\t\tif( Math.abs( this.vy ) < 0.001 ) {\n\t\t\tthis.vy = 0;\n\t\t}\n\t}", "r(u, v) { return (u[0] * v[0] + u[1] * v[1]) / (this.m(u) * this.m(v)); }" ]
[ "0.6147133", "0.6013874", "0.56987005", "0.5673543", "0.5669797", "0.56438255", "0.56329846", "0.563259", "0.56303006", "0.5597823", "0.5556644", "0.55256087", "0.5523057", "0.55152833", "0.5509554", "0.54912525", "0.54801095", "0.5468122", "0.54615235", "0.54615235", "0.545347", "0.5437688", "0.54289603", "0.54158515", "0.53897756", "0.53882694", "0.53882694", "0.53873295", "0.53779453", "0.5372572", "0.5360559", "0.53367937", "0.5322216", "0.5321925", "0.532073", "0.5319262", "0.5319131", "0.5319131", "0.5316437", "0.5304569", "0.5302707", "0.5284934", "0.5274332", "0.52728546", "0.5262111", "0.524645", "0.52441543", "0.52413684", "0.5240942", "0.5234849", "0.5206949", "0.52011687", "0.5199499", "0.5190621", "0.517934", "0.5176287", "0.5174958", "0.5162488", "0.51489466", "0.5148221", "0.51474833", "0.51461476", "0.51458883", "0.513837", "0.51087534", "0.51067716", "0.51025474", "0.51025474", "0.50946915", "0.5092377", "0.50908494", "0.5089746", "0.50884485", "0.5087188", "0.50855863", "0.508521", "0.50848895", "0.50783247", "0.50780964", "0.5070319", "0.5068328", "0.50607705", "0.5060276", "0.5054254", "0.5045317", "0.5043836", "0.50429046", "0.5037905", "0.5029345", "0.50244653", "0.50217164", "0.5014196", "0.50113904", "0.5007223", "0.5000021", "0.4997358", "0.49971792", "0.49887404", "0.49879098", "0.49843302", "0.49767318" ]
0.0
-1
(public) 0 if this == 0, 1 if this > 0
function bnSigNum() { if(this.s < 0) return -1; else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0; else return 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isZero() {\n return this.value == 0;\n }", "function o0(o1, o2) {\n try {\nreturn --this.o655 == 0;\n}catch(e){}\n}", "isZero() { return (this.#val === BN_0); }", "isZero() {\n return this.high === 0 && this.low === 0;\n }", "sol() { return this.pos == 0; }", "get negative () {\n return this.raw <= 0\n }", "function zero(){ return 0;}", "empty() { return this.m == 0; }", "get self() {\n return this.isSelf();\n }", "one() {\r\n this.data.fill(0);\r\n this.data[0] = 1;\r\n }", "isPositive() {\n return this.unsigned || this.high >= 0;\n }", "isNonZero(): boolean {\n return this.value !== 0;\n }", "morto() {\r\n return this.hp <= 0;\r\n }", "static set zero(value) {}", "function zero (data) {\n return data === 0;\n }", "one() {\n this.count += 1;\n return this;\n }", "get value() {\n if (!this._value) {\n this._value = 0;\n }\n return this._value;\n }", "setZero() {\n _instance.setZero()\n }", "function fnRelu(value) { return value > 0 ? value : 0 }", "positive() {\n this.forcePositive = true;\n this.forceNegative = false;\n return this;\n }", "value() {return 0}", "get isFirst() {\n return this.index === 0;\n }", "function dummy() {\n\t\t\treturn this;\n\t\t}", "function dummy() {\n\t\t\treturn this;\n\t\t}", "function dummy() {\n\t\t\treturn this;\n\t\t}", "ThisExpression(node) {\n const current = stack.getCurrent();\n\n if (current && !current.valid) {\n context.report({ node, message: \"Unexpected 'this'.\" });\n }\n }", "function zero (x) {\n\t return typeof x === 'number' && x === 0\n\t}", "function isZero(a, b) {\n return (b === 0) ? ++a : a;\t// not really readable is it?j\n}", "function zero(func) { return func ? func(0) : 0; }", "get isPrimary(){\n return ( 0 != ( ( this.kind ) & 1 ) );\n }", "left() {\r\n this.v = -2;\r\n }", "eq(other) { return this.cmp(other) === 0; }", "static get zero() {}", "isNegative() { return (this.#val < BN_0); }", "function u(e){return Boolean(e.self&&d(e.self))}", "__init5() {this.pos = 0}", "function bnSigNum() {\n if (this.s < 0) return -1;\n else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n}", "function bnSigNum() {\n if (this.s < 0) return -1;\n else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n}", "function self($this) {\n\treturn $this;\n}", "isEmpty(){\n return this.count - this.lowestCount === 0;\n }", "function bnSigNum() {\n if (this.s < 0) return -1\n else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0\n else return 1\n}", "function bnSigNum() {\n if (this.s < 0) return -1\n else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0\n else return 1\n}", "function bnSigNum() {\n if (this.s < 0) return -1\n else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0\n else return 1\n}", "function bnSigNum() {\n if (this.s < 0) return -1\n else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0\n else return 1\n}", "function bnSigNum() {\n if (this.s < 0) return -1\n else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0\n else return 1\n}", "function bnSigNum() {\n if (this.s < 0) return -1\n else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0\n else return 1\n}", "function bnSigNum() {\n if (this.s < 0) return -1\n else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0\n else return 1\n}", "function bnSigNum() {\n\t if (this.s < 0) return -1\n\t else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0\n\t else return 1\n\t}", "function bnSigNum() {\n\t if (this.s < 0) return -1\n\t else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0\n\t else return 1\n\t}", "function bnSigNum() {\r\n\t if (this.s < 0) return -1;\r\n\t else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\r\n\t else return 1;\r\n\t}", "function bnSigNum() {\r\n\t if (this.s < 0) return -1;\r\n\t else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\r\n\t else return 1;\r\n\t}", "masterAxis() {\n\t\tif (Math.abs(this._x) > Math.abs(this._y) && Math.abs(this._x) > Math.abs(this._z)) {\n\t\t\treturn (0);\n\t\t}\n\t\telse if (Math.abs(this._y) > Math.abs(this._x) && Math.abs(this._y) > Math.abs(this._z)) {\n\t\t\treturn (1);\n\t\t}\n\t\telse {\n\t\t\treturn (2);\n\t\t}\n\t}", "offscreen(){return this.x < -this.w}", "function bnSigNum()\n{\n if (this.s < 0) return -1;\n else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n}", "function ml_z_fits_int(z1) {\n if(z1 == (z1 | 0)) return 1;\n else return 0;\n}", "get _isVisible(){return!!(this.offsetWidth||this.offsetHeight)}", "function VZ(number){if(number<0) return -1; else return 1;}", "function get_self(x) {\r\n return x;\r\n}", "function A(t){return void 0===t||null===t}", "hasTop() {return this.Y<=0 ? false : true;}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function i(t){return void 0===t||null===t}", "function bnSigNum() {\n if (this.s < 0) return -1;else if (this.t <= 0 || this.t == 1 && this[0] <= 0) return 0;else return 1;\n}", "function bnSigNum() {\n\t if(this.s < 0) return -1;\n\t else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n\t else return 1;\n\t }", "function e(A){return void 0===A||null===A}", "function bnSigNum() {\n\tif(this.s < 0) return -1;\n\telse if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n\telse return 1;\n }", "empty () {\n return !(this.length >= 1);\n }", "function U(V){return void 0===V||null===V}", "function bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n}", "function bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n}", "function bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n}", "function bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n}", "function bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n}", "function bnSigNum() {\n\t if(this.s < 0) return -1;\n\t else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n\t else return 1;\n\t }", "function bnSigNum() {\n\t if(this.s < 0) return -1;\n\t else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n\t else return 1;\n\t }", "get any() {\n return this._node.first.currently;\n }", "function o(){return new Proxy({value:0,read:0},{get(t,e){return e in t?\"read\"===e?t[e]:t[e]++:0},set(t,e,n){return t[e]=Math.max(n,0),!0}})}", "get any() {\n this.anyOne = true;\n return this;\n }" ]
[ "0.6416564", "0.62657714", "0.59058076", "0.5873262", "0.5860204", "0.58478665", "0.5802061", "0.57786113", "0.56696266", "0.5641842", "0.5641503", "0.56346637", "0.55556726", "0.55554295", "0.5511258", "0.5456321", "0.5445312", "0.53759646", "0.53730774", "0.5371902", "0.53499097", "0.53170085", "0.5304164", "0.5304164", "0.5304164", "0.5282848", "0.5268266", "0.5236778", "0.5232125", "0.52287346", "0.5179505", "0.51735777", "0.51687443", "0.5160623", "0.5150919", "0.5148063", "0.5147339", "0.5147339", "0.51315707", "0.5129136", "0.5128842", "0.5128842", "0.5128842", "0.5128842", "0.5128842", "0.5128842", "0.5128842", "0.5108764", "0.5108764", "0.5101068", "0.5101068", "0.50943", "0.50928026", "0.50877726", "0.5084204", "0.5078656", "0.5077931", "0.5077187", "0.50761855", "0.5074881", "0.50722337", "0.50722337", "0.50722337", "0.50722337", "0.50722337", "0.50722337", "0.50722337", "0.50722337", "0.50722337", "0.50722337", "0.50722337", "0.50651675", "0.5063772", "0.5046682", "0.5043546", "0.5043046", "0.50362456", "0.50299007", "0.50299007", "0.50299007", "0.50299007", "0.50299007", "0.5028147", "0.5028147", "0.5022516", "0.5013176", "0.50070834" ]
0.0
-1
(protected) this = n, this >= 0, 1 < n < DV
function bnpDMultiply(n) { this[this.t] = this.am(0,n-1,this,0,0,this.t); ++this.t; this.clamp(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "n(val) {\n this._n = val;\n return this;\n }", "function N(a){n(this,a)}", "get(){return this[n]}", "set next(n) {\t\t\t\t\t\t// configura novo valor de n, somente se for > do que o atual\n\t\tif (n > this.$n) this.$n = n;\n\t}", "static constrain(v){\r\n while(v<0){v+=1;}\r\n while(v>1){v-=1;}\r\n return v;\r\n }", "function N(a,b){this.j=[];this.D=a;this.v=b||null;this.h=this.a=!1;this.g=void 0;this.I=this.K=this.p=!1;this.o=0;this.b=null;this.k=0}", "static step0(n) {\n return n > 0 ? 1 : 0;\n }", "static step1(n) {\n return n >= 1 ? 1 : 0;\n }", "size() {\n return this.n;\n }", "function N(){}", "expand(n, erange) {\n\t\tea && assert(n > this.n || erange > this.edgeRange);\n\t\tlet nu = new this.constructor(n, erange);\n\t\tnu.assign(this,true); this.xfer(nu);\n\t}", "function t(n,A){0}", "function i(t,e,n){var i=t.length>>>0;return e=null==e?n||0:e<0?Math.max(i+e,0):Math.min(e,i),e}", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r.fromInt(i); return r; }", "function nbv(i) { var r = nbi(); r._fromInt(i); return r; }", "constructor(n,w,p)\n {\n super(n,w,p);\n }", "constructor(n,w,p)\n {\n super(n,w,p);\n }", "constructor(n,w,p)\n {\n super(n,w,p);\n }", "nOf (n) { // I realize this is a bit silly, lets hope random doesn't repeat!\n if (n > this.length) util.error('nOf: n larger than agentset')\n if (n === this.length) return this\n const result = []\n while (result.length < n) {\n const o = this.oneOf()\n if (!(o in result)) result.push(o)\n }\n return this.asAgentSet(result)\n }", "function nbv(i) { var r = nbi();\n r.fromInt(i); return r; }", "constructor(n=10, erange=n) {\n\t\tea && assert(n > 0 && erange > 0);\n\t\tsuper(n);\n\t\tthis._firstEp = new Int32Array(this.n+1);\n\t\tthis._left = new Int32Array(erange+1);\n\t\tthis._right = new Int32Array(erange+1);\n\t\tthis._edges = new ListPair(erange);\n\t\tthis._epLists = new ListSet(2*(erange+1));\n\t\tthis._weight = null;\n\t}", "function n(n) {\n var r = Object(_core_accessorSupport_ensureType_js__WEBPACK_IMPORTED_MODULE_0__[\"ensureInteger\"])(100 * (1 - n));\n return Math.max(0, Math.min(r, 100));\n }", "function d(n) {\n if (n >= 1) {\n if (n == 1 || n == 2) {\n return 1\n } else {\n return d(n - 1) + d(n - 2)\n };\n\n }\n }", "function nN(t,e){var n=wi()(t);if(bi.a){var r=bi()(t);e&&(r=vi()(r).call(r,(function(e){return mi()(t,e).enumerable}))),n.push.apply(n,r)}return n}", "constructor(n=10, d=4) {\n\t\tsuper(n);\n\t\tthis.#item = new Int32Array(n+1);\n\t\tthis.#pos = new Int32Array(n+1);\n\t\tthis.#key = new Float32Array(n+1);\n\t\tthis.#item[0] = this.#m = 0; this.#d = d;\n\t\tthis.#offset = 0;\n\t\tthis.clearStats();\n\t}", "function Nd(){}", "function bnpDMultiply(n) {\n\t this[this.t] = this.am(0,n-1,this,0,0,this.t);\n\t ++this.t;\n\t this.clamp();\n\t }" ]
[ "0.607401", "0.6002053", "0.5899723", "0.57966125", "0.56439304", "0.5593456", "0.54900944", "0.54356056", "0.54285955", "0.5386609", "0.53530186", "0.5340947", "0.532861", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.53038377", "0.5302894", "0.530184", "0.530184", "0.530184", "0.5294287", "0.52665675", "0.525751", "0.52124405", "0.5203135", "0.5202534", "0.51998913", "0.5193403", "0.51833254" ]
0.0
-1
(protected) this += n = 0
function bnpDAddOffset(n,w) { if(n == 0) return; while(this.t <= w) this[this.t++] = 0; this[w] += n; while(this[w] >= this.DV) { this[w] -= this.DV; if(++w >= this.t) this[this.t++] = 0; ++this[w]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "undefined(state, n) {\n state.a += n;\n }", "increment() {\n\t\t++this.amount;\n\t}", "get next() { return this.$n++; }", "function incrementer(n) { afficher(index += n); }", "function addOne(n){\n return n += 1;\n}", "increment() {\n this[$referenceCount]++;\n }", "function increment(){\r\n return this.count++;\r\n}", "function inc(n) {\n return n += 1\n}", "['+']() {\n\t\tthis.D++;\n\t}", "movex (rx){this.x+=rx}", "retain(n) {\n if (typeof n !== 'number') {\n throw new TypeError('retain expects an integer')\n }\n if (n === 0) {\n return this\n }\n this.baseLength += n\n this.targetLength += n\n if (this.isRetain(this.ops[this.ops.length - 1])) {\n // The last op is a retain op => we can merge them into one op.\n this.ops[this.ops.length - 1] += n\n } else {\n // Create a new op.\n this.ops.push(n)\n }\n return this\n }", "n(val) {\n this._n = val;\n return this;\n }", "function increment(){\n\t\tsetCount(prevCount=>prevCount+1)\n\t}", "iinc() {\n this.value++;\n return this;\n }", "function increment(v, n){\n\t//this function increments the v by n times\n\tfor(let i = 0; i < n; i++){\n\t\tv += 1;\n\t}\n\treturn v;\n}", "two() {\n this.count += 2;\n return this;\n }", "_adjust(i){\n\t\tvar ret = Object.assign(Object.create(Note.prototype), this) ;\n\t\tret.acc += i ;\n\t\treturn ret ;\n\t}", "forward(n) {\n this.pos += n;\n }", "Increment(){\n this.count += 1;\n console.log(this.count);\n }", "function countPlus(){\n setCount(count+1)\n }", "function addOne(x) {\r\n\tx++;\r\n}", "addCount() {\n this.count++;\n }", "out()\n {\n this.y += 5;\n }", "function increment (orig) {\n return orig !== undefined ? orig + 1 : 1\n }", "function increment() {\n return increment.count++;\n }", "plusHP( n ) {\n\t\tlet a = this.hp += n;\n\t\tif( a > this.mhp ) {\n\t\t\tthis.hp = this.mhp;\n\t\t}\n\t}", "function sum(){\n setCount(count+1)\n }", "increment() {\n this.referenceCount++;\n }", "increment() {\n this.score++;\n }", "onInc() {\n this.count++;\n }", "function add(){\n this.counter = 0;\n var plus = () => {this.counter += 1};\n plus();\n}", "function increasment(num) {\n return ++num;\n}", "function increase(x) {\n x.value++;\n}", "function nacci() {\n\t\tconsole.log(nNext);\n\t\tlet temp = n;\n\t\tn = nNext;\n\t\tnNext += temp;\n\t}", "one() {\n this.count += 1;\n return this;\n }", "function incrementLength() {\n let length = _length.get( this );\n length++;\n _length.set( this, length );\n}", "function baz() {\r\n baz.count = 4; // refers to itself...\r\n}", "function add (num) {\nreturn ++num;\n}", "set next(n) {\t\t\t\t\t\t// configura novo valor de n, somente se for > do que o atual\n\t\tif (n > this.$n) this.$n = n;\n\t}", "delete(n) {\n if (typeof n === 'string') {\n n = n.length\n }\n if (typeof n !== 'number') {\n throw new TypeError('delete expects an integer or a string')\n }\n if (n === 0) {\n return this\n }\n if (n > 0) {\n n = -n\n }\n this.baseLength -= n\n if (this.isDelete(this.ops[this.ops.length - 1])) {\n this.ops[this.ops.length - 1] += n\n } else {\n this.ops.push(n)\n }\n return this\n }", "get increment(){ return this._increments.peek(); }", "set number (newNum) {\n this.__number = newNum + 2\n }", "function add() {\n counter += 1;\n}", "function add() {\n counter += 1;\n}", "function f(x){\n x += 1;\n }", "add(n) {\n if (n instanceof Matrix) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.cols; j++) {\n this.data[i][j] += n.data[i][j];\n }\n }\n }\n else {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.cols; j++) {\n this.data[i][j] += n;\n }\n }\n }\n }", "function increment (orig) {\n return orig !== undefined ? orig + 1 : 1\n}", "function increment (orig) {\n return orig !== undefined ? orig + 1 : 1\n}", "function increment (orig) {\n return orig !== undefined ? orig + 1 : 1\n}", "function increment (orig) {\n return orig !== undefined ? orig + 1 : 1\n}", "_incrementIndex() {\n this._index++;\n\n if (this._index >= this._capacity) {\n this._index = 0;\n }\n }", "increment(state) {\n state.count++\n }", "function add() {\n counter += 1;\n}", "function increment(num) {\n\treturn num + 1;\n}", "function inc(count) {\n count.value++;\n return count;\n}", "count() {\n return this.reduce(0, math_1.incr);\n }", "function increment(i) {\n i++;\n return i;\n }", "function increaseCount(number){\n return number + 1;\n }", "function f(x) { x++; return x; }", "function g() {\n\t\treturn a++;\n\t}", "addNoMore() { this.noMore.value++; this.updateHitStat(this.noMore); }", "function incrementFunction(that){\n that.value++;\n }", "function consume (\n n\n )\n {\n index += (n === undefined ? 1 : n);\n }", "function increment(orig) {\n return orig !== undefined ? orig + 1 : 1;\n}", "function foo(num) {\n console.log(\"foo: \" + num);\n this.count++;\n}", "function addTo(n) {\n\tconsole.log('Very long time')\n\treturn n + 80;\n}", "awardPoints(numPoints) {\n this.points += numPoints;\n }", "function f(b) {\n currentSum += b;\n return f; // <-- does not call itself, returns itself\n}", "@action\n increment() {\n this.set('number', this.number + 1);\n }", "@action plusOne() { this.myNumber++; }", "function addTen(num){ // 3\n num += 10; // 4\n return num; // 5\n}", "function N(a){n(this,a)}", "function IncrementCount() {\r\n\t\r\n\t++count;\r\n}", "function modificar(n1) {\n n1 = n1 + 1000\n}", "function add(num){\n\tresults.value += num;\n}", "function plusOne() //function that handles incrementing the number\n {\n startingPoint+=1;\n }", "plus(number) {\n\n }", "incrementRefCount() {\n this.refCount_++;\n }", "increment (state) {\n state.count++;\n }", "function addition(num) {\n return ++num\n}", "function addOneFromNumber(x){\n return ++x;\n}", "function addUp(n) {\n if (n == 1) return 1;\n return n + addUp(n - 1);\n }", "increment() {\n this.setState(prevState => ({\n count: prevState.count + 1\n }));\n }", "function memoizedAddTo80(n) {}", "INCREMENT (state, amount) {\n state.count = state.count + amount\n }", "INCREMENT (state, amount) {\n state.count = state.count + amount\n }", "function inc(ar,loc,n){\n if (n === undefined) n = 1;\n if (ar[loc] === undefined){\n ar[loc] = n;\n return n;\n }\n ar[loc] += n;\n return ar[loc];\n}", "function counter() {\n return counter.count++; // counter++;\n }", "m_counter_pp(state) {\n state.m_counter = state.m_counter + 1;\n }", "set_value(n, value) {\n this.slots[n * 2 + 1] = value;\n }", "function incrementVariable() {\n \t\ti = i + 1;\n \t}", "function additionByOne(num){\n return num+1;\n}", "get(){return this[n]}", "function increment(x){\n return x+1;\n}", "function addToAll(arr, n){\n arr.forEach(function(_, index) {\n this[index] += n ;\n }, arr); //Value to use as this when executing callbackFn.\n return arr;\n}", "function addN(arr, n) {\n arr.forEach((ele, i) => {\n arr[i] += n\n })\n return arr\n}", "function inc(num) {\n num++;\n return num;\n}", "function adder(number){\n number += 2;\n console.log(number);\n}", "function increment(thing) {\n thing.count += 1;\n console.log(thing.count);\n}", "next() {\n this.index++;\n }", "function addTo80(n){\n console.log('long time');\n return n + 80;\n}" ]
[ "0.7729201", "0.6934396", "0.6877341", "0.6817428", "0.6811031", "0.6782622", "0.67658055", "0.67545086", "0.6618305", "0.6539163", "0.6507117", "0.6470742", "0.64438957", "0.64383954", "0.6329764", "0.6280653", "0.6277563", "0.62544596", "0.6246216", "0.6219666", "0.61992097", "0.6193697", "0.61888164", "0.61857045", "0.6154613", "0.61502755", "0.6131459", "0.61311895", "0.6119082", "0.6118497", "0.6110632", "0.6105506", "0.61033577", "0.6093666", "0.6089864", "0.6085415", "0.60784143", "0.6064418", "0.6055998", "0.6053603", "0.6013934", "0.6006303", "0.5984803", "0.5984803", "0.59811455", "0.5979404", "0.5971012", "0.5971012", "0.5971012", "0.5971012", "0.5970946", "0.59692574", "0.59622586", "0.5958125", "0.5955894", "0.5953741", "0.59528846", "0.5950525", "0.59465915", "0.593858", "0.5938079", "0.5926783", "0.5926329", "0.5911004", "0.5908932", "0.5899057", "0.58928525", "0.5892169", "0.58841175", "0.58812076", "0.58756053", "0.5858231", "0.584858", "0.58450127", "0.58383244", "0.58233166", "0.58197576", "0.5813535", "0.58075905", "0.58066374", "0.5805401", "0.5796532", "0.57955444", "0.57847", "0.5775206", "0.5775206", "0.5771211", "0.5765112", "0.57504517", "0.5750316", "0.5744884", "0.5744437", "0.57395387", "0.572538", "0.57192826", "0.5718105", "0.5717313", "0.57083535", "0.5702517", "0.57024837", "0.5700459" ]
0.0
-1
(protected) convert to radix string
function bnpToRadix(b) { if(b == null) b = 10; if(this.signum() == 0 || b < 2 || b > 36) return "0"; var cs = this.chunkSize(b); var a = Math.pow(b,cs); var d = nbv(a), y = nbi(), z = nbi(), r = ""; this.divRemTo(d,y,z); while(y.signum() > 0) { r = (a+z.intValue()).toString(b).substr(1) + r; y.divRemTo(d,y,z); } return z.intValue().toString(b) + r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bnToString(b) {\n var self = this\n if (self.s < 0) return \"-\" + self.negate()\n .toString(b)\n var k\n if (b == 16) k = 4\n else if (b == 8) k = 3\n else if (b == 2) k = 1\n else if (b == 32) k = 5\n else if (b == 4) k = 2\n else return self.toRadix(b)\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = self.t\n var p = self.DB - (i * self.DB) % k\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true\n r = int2char(d)\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & ((1 << p) - 1)) << (k - p)\n d |= self[--i] >> (p += self.DB - k)\n } else {\n d = (self[i] >> (p -= k)) & km\n if (p <= 0) {\n p += self.DB\n --i\n }\n }\n if (d > 0) m = true\n if (m) r += int2char(d)\n }\n }\n return m ? r : \"0\"\n}", "function bnToString(b) {\n var self = this\n if (self.s < 0) return \"-\" + self.negate()\n .toString(b)\n var k\n if (b == 16) k = 4\n else if (b == 8) k = 3\n else if (b == 2) k = 1\n else if (b == 32) k = 5\n else if (b == 4) k = 2\n else return self.toRadix(b)\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = self.t\n var p = self.DB - (i * self.DB) % k\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true\n r = int2char(d)\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & ((1 << p) - 1)) << (k - p)\n d |= self[--i] >> (p += self.DB - k)\n } else {\n d = (self[i] >> (p -= k)) & km\n if (p <= 0) {\n p += self.DB\n --i\n }\n }\n if (d > 0) m = true\n if (m) r += int2char(d)\n }\n }\n return m ? r : \"0\"\n}", "function bnToString(b) {\n var self = this\n if (self.s < 0) return \"-\" + self.negate()\n .toString(b)\n var k\n if (b == 16) k = 4\n else if (b == 8) k = 3\n else if (b == 2) k = 1\n else if (b == 32) k = 5\n else if (b == 4) k = 2\n else return self.toRadix(b)\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = self.t\n var p = self.DB - (i * self.DB) % k\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true\n r = int2char(d)\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & ((1 << p) - 1)) << (k - p)\n d |= self[--i] >> (p += self.DB - k)\n } else {\n d = (self[i] >> (p -= k)) & km\n if (p <= 0) {\n p += self.DB\n --i\n }\n }\n if (d > 0) m = true\n if (m) r += int2char(d)\n }\n }\n return m ? r : \"0\"\n}", "function bnToString(b) {\n var self = this\n if (self.s < 0) return \"-\" + self.negate()\n .toString(b)\n var k\n if (b == 16) k = 4\n else if (b == 8) k = 3\n else if (b == 2) k = 1\n else if (b == 32) k = 5\n else if (b == 4) k = 2\n else return self.toRadix(b)\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = self.t\n var p = self.DB - (i * self.DB) % k\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true\n r = int2char(d)\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & ((1 << p) - 1)) << (k - p)\n d |= self[--i] >> (p += self.DB - k)\n } else {\n d = (self[i] >> (p -= k)) & km\n if (p <= 0) {\n p += self.DB\n --i\n }\n }\n if (d > 0) m = true\n if (m) r += int2char(d)\n }\n }\n return m ? r : \"0\"\n}", "function bnToString(b) {\n var self = this\n if (self.s < 0) return \"-\" + self.negate()\n .toString(b)\n var k\n if (b == 16) k = 4\n else if (b == 8) k = 3\n else if (b == 2) k = 1\n else if (b == 32) k = 5\n else if (b == 4) k = 2\n else return self.toRadix(b)\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = self.t\n var p = self.DB - (i * self.DB) % k\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true\n r = int2char(d)\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & ((1 << p) - 1)) << (k - p)\n d |= self[--i] >> (p += self.DB - k)\n } else {\n d = (self[i] >> (p -= k)) & km\n if (p <= 0) {\n p += self.DB\n --i\n }\n }\n if (d > 0) m = true\n if (m) r += int2char(d)\n }\n }\n return m ? r : \"0\"\n}", "function bnToString(b) {\n var self = this\n if (self.s < 0) return \"-\" + self.negate()\n .toString(b)\n var k\n if (b == 16) k = 4\n else if (b == 8) k = 3\n else if (b == 2) k = 1\n else if (b == 32) k = 5\n else if (b == 4) k = 2\n else return self.toRadix(b)\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = self.t\n var p = self.DB - (i * self.DB) % k\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true\n r = int2char(d)\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & ((1 << p) - 1)) << (k - p)\n d |= self[--i] >> (p += self.DB - k)\n } else {\n d = (self[i] >> (p -= k)) & km\n if (p <= 0) {\n p += self.DB\n --i\n }\n }\n if (d > 0) m = true\n if (m) r += int2char(d)\n }\n }\n return m ? r : \"0\"\n}", "function bnToString(b) {\n var self = this\n if (self.s < 0) return \"-\" + self.negate()\n .toString(b)\n var k\n if (b == 16) k = 4\n else if (b == 8) k = 3\n else if (b == 2) k = 1\n else if (b == 32) k = 5\n else if (b == 4) k = 2\n else return self.toRadix(b)\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = self.t\n var p = self.DB - (i * self.DB) % k\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true\n r = int2char(d)\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & ((1 << p) - 1)) << (k - p)\n d |= self[--i] >> (p += self.DB - k)\n } else {\n d = (self[i] >> (p -= k)) & km\n if (p <= 0) {\n p += self.DB\n --i\n }\n }\n if (d > 0) m = true\n if (m) r += int2char(d)\n }\n }\n return m ? r : \"0\"\n}", "function bnToString(b) {\n\t var self = this\n\t if (self.s < 0) return \"-\" + self.negate()\n\t .toString(b)\n\t var k\n\t if (b == 16) k = 4\n\t else if (b == 8) k = 3\n\t else if (b == 2) k = 1\n\t else if (b == 32) k = 5\n\t else if (b == 4) k = 2\n\t else return self.toRadix(b)\n\t var km = (1 << k) - 1,\n\t d, m = false,\n\t r = \"\",\n\t i = self.t\n\t var p = self.DB - (i * self.DB) % k\n\t if (i-- > 0) {\n\t if (p < self.DB && (d = self[i] >> p) > 0) {\n\t m = true\n\t r = int2char(d)\n\t }\n\t while (i >= 0) {\n\t if (p < k) {\n\t d = (self[i] & ((1 << p) - 1)) << (k - p)\n\t d |= self[--i] >> (p += self.DB - k)\n\t } else {\n\t d = (self[i] >> (p -= k)) & km\n\t if (p <= 0) {\n\t p += self.DB\n\t --i\n\t }\n\t }\n\t if (d > 0) m = true\n\t if (m) r += int2char(d)\n\t }\n\t }\n\t return m ? r : \"0\"\n\t}", "function bnToString(b) {\n\t var self = this\n\t if (self.s < 0) return \"-\" + self.negate()\n\t .toString(b)\n\t var k\n\t if (b == 16) k = 4\n\t else if (b == 8) k = 3\n\t else if (b == 2) k = 1\n\t else if (b == 32) k = 5\n\t else if (b == 4) k = 2\n\t else return self.toRadix(b)\n\t var km = (1 << k) - 1,\n\t d, m = false,\n\t r = \"\",\n\t i = self.t\n\t var p = self.DB - (i * self.DB) % k\n\t if (i-- > 0) {\n\t if (p < self.DB && (d = self[i] >> p) > 0) {\n\t m = true\n\t r = int2char(d)\n\t }\n\t while (i >= 0) {\n\t if (p < k) {\n\t d = (self[i] & ((1 << p) - 1)) << (k - p)\n\t d |= self[--i] >> (p += self.DB - k)\n\t } else {\n\t d = (self[i] >> (p -= k)) & km\n\t if (p <= 0) {\n\t p += self.DB\n\t --i\n\t }\n\t }\n\t if (d > 0) m = true\n\t if (m) r += int2char(d)\n\t }\n\t }\n\t return m ? r : \"0\"\n\t}", "function bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1 << k) - 1, d, m = false, r = \"\", i = this.t;\n var p = this.DB - (i * this.DB) % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & ((1 << p) - 1)) << (k - p);\n d |= this[--i] >> (p += this.DB - k);\n }\n else {\n d = (this[i] >> (p -= k)) & km;\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n}", "function bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else return this.toRadix(b);\n var km = (1 << k) - 1,\n d,\n m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - i * this.DB % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & (1 << p) - 1) << k - p;\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = this[i] >> (p -= k) & km;\n if (p <= 0) {\n p += this.DB;--i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n }", "function bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else return this.toRadix(b);\n var km = (1 << k) - 1,\n d,\n m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - i * this.DB % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & (1 << p) - 1) << k - p;\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = this[i] >> (p -= k) & km;\n if (p <= 0) {\n p += this.DB;--i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n }", "function bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else return this.toRadix(b);\n var km = (1 << k) - 1,\n d,\n m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - i * this.DB % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & (1 << p) - 1) << k - p;\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = this[i] >> (p -= k) & km;\n if (p <= 0) {\n p += this.DB;--i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n }", "function bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - (i * this.DB) % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & ((1 << p) - 1)) << (k - p);\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = (this[i] >> (p -= k)) & km;\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n }", "function bigInt2StrHelper(bi, r) {\n return bi.toString(r);\n}", "function bnToString(b) {\n var self = this;\n if (self.s < 0) return \"-\" + self.negate().toString(b);\n var k;\n if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else return self.toRadix(b);\n var km = (1 << k) - 1,\n d,\n m = false,\n r = \"\",\n i = self.t;\n var p = self.DB - i * self.DB % k;\n if (i-- > 0) {\n if (p < self.DB && (d = self[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (self[i] & (1 << p) - 1) << k - p;\n d |= self[--i] >> (p += self.DB - k);\n } else {\n d = self[i] >> (p -= k) & km;\n if (p <= 0) {\n p += self.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n}", "function bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - (i * this.DB) % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) { m = true;\n r = int2char(d); }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & ((1 << p) - 1)) << (k - p);\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = (this[i] >> (p -= k)) & km;\n if (p <= 0) { p += this.DB;--i; }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n }", "function bnToString(b) {\r\n\t if (this.s < 0) return \"-\" + this.negate().toString(b);\r\n\t var k;\r\n\t if (b == 16) k = 4;\r\n\t else if (b == 8) k = 3;\r\n\t else if (b == 2) k = 1;\r\n\t else if (b == 32) k = 5;\r\n\t else if (b == 4) k = 2;\r\n\t else return this.toRadix(b);\r\n\t var km = (1 << k) - 1, d, m = false, r = \"\", i = this.t;\r\n\t var p = this.DB - (i * this.DB) % k;\r\n\t if (i-- > 0) {\r\n\t if (p < this.DB && (d = this[i] >> p) > 0) {\r\n\t m = true;\r\n\t r = int2char(d);\r\n\t }\r\n\t while (i >= 0) {\r\n\t if (p < k) {\r\n\t d = (this[i] & ((1 << p) - 1)) << (k - p);\r\n\t d |= this[--i] >> (p += this.DB - k);\r\n\t }\r\n\t else {\r\n\t d = (this[i] >> (p -= k)) & km;\r\n\t if (p <= 0) {\r\n\t p += this.DB;\r\n\t --i;\r\n\t }\r\n\t }\r\n\t if (d > 0) m = true;\r\n\t if (m) r += int2char(d);\r\n\t }\r\n\t }\r\n\t return m ? r : \"0\";\r\n\t}", "function bnToString(b) {\r\n\t if (this.s < 0) return \"-\" + this.negate().toString(b);\r\n\t var k;\r\n\t if (b == 16) k = 4;\r\n\t else if (b == 8) k = 3;\r\n\t else if (b == 2) k = 1;\r\n\t else if (b == 32) k = 5;\r\n\t else if (b == 4) k = 2;\r\n\t else return this.toRadix(b);\r\n\t var km = (1 << k) - 1, d, m = false, r = \"\", i = this.t;\r\n\t var p = this.DB - (i * this.DB) % k;\r\n\t if (i-- > 0) {\r\n\t if (p < this.DB && (d = this[i] >> p) > 0) {\r\n\t m = true;\r\n\t r = int2char(d);\r\n\t }\r\n\t while (i >= 0) {\r\n\t if (p < k) {\r\n\t d = (this[i] & ((1 << p) - 1)) << (k - p);\r\n\t d |= this[--i] >> (p += this.DB - k);\r\n\t }\r\n\t else {\r\n\t d = (this[i] >> (p -= k)) & km;\r\n\t if (p <= 0) {\r\n\t p += this.DB;\r\n\t --i;\r\n\t }\r\n\t }\r\n\t if (d > 0) m = true;\r\n\t if (m) r += int2char(d);\r\n\t }\r\n\t }\r\n\t return m ? r : \"0\";\r\n\t}", "function bnToString(b) {\n if (this.s < 0) return '-' + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1 << k) - 1,\n d,\n m = false,\n r = '',\n i = this.t;\n var p = this.DB - (i * this.DB) % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & ((1 << p) - 1)) << (k - p);\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = (this[i] >> (p -= k)) & km;\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : '0';\n}", "function bnToString(b)\n{\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - (i * this.DB) % k;\n if (i-- > 0)\n {\n if (p < this.DB && (d = this[i] >> p) > 0)\n {\n m = true;\n r = int2char(d);\n }\n while (i >= 0)\n {\n if (p < k)\n {\n d = (this[i] & ((1 << p) - 1)) << (k - p);\n d |= this[--i] >> (p += this.DB - k);\n }\n else\n {\n d = (this[i] >> (p -= k)) & km;\n if (p <= 0)\n {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n}", "function bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - (i * this.DB) % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & ((1 << p) - 1)) << (k - p);\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = (this[i] >> (p -= k)) & km;\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n }", "function bnToString(b) {\n if (this.s < 0) return \"-\" + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;\n else if (b == 8) k = 3;\n else if (b == 2) k = 1;\n else if (b == 32) k = 5;\n else if (b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1 << k) - 1,\n d, m = false,\n r = \"\",\n i = this.t;\n var p = this.DB - (i * this.DB) % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & ((1 << p) - 1)) << (k - p);\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = (this[i] >> (p -= k)) & km;\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : \"0\";\n }", "function bnToString(b) {\n\t if(this.s < 0) return \"-\"+this.negate().toString(b);\n\t var k;\n\t if(b == 16) k = 4;\n\t else if(b == 8) k = 3;\n\t else if(b == 2) k = 1;\n\t else if(b == 32) k = 5;\n\t else if(b == 4) k = 2;\n\t else return this._toRadix(b);\n\t var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n\t var p = this._DB-(i*this._DB)%k;\n\t if(i-- > 0) {\n\t\tif(p < this._DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n\t\twhile(i >= 0) {\n\t\t if(p < k) {\n\t\t\td = (this[i]&((1<<p)-1))<<(k-p);\n\t\t\td |= this[--i]>>(p+=this._DB-k);\n\t\t }\n\t\t else {\n\t\t\td = (this[i]>>(p-=k))&km;\n\t\t\tif(p <= 0) { p += this._DB; --i; }\n\t\t }\n\t\t if(d > 0) m = true;\n\t\t if(m) r += int2char(d);\n\t\t}\n\t }\n\t return m?r:\"0\";\n\t}", "function bnToString(b) {\n\t if(this.s < 0) return \"-\"+this.negate().toString(b);\n\t var k;\n\t if(b == 16) k = 4;\n\t else if(b == 8) k = 3;\n\t else if(b == 2) k = 1;\n\t else if(b == 32) k = 5;\n\t else if(b == 4) k = 2;\n\t else return this.toRadix(b);\n\t var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n\t var p = this.DB-(i*this.DB)%k;\n\t if(i-- > 0) {\n\t if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n\t while(i >= 0) {\n\t if(p < k) {\n\t d = (this[i]&((1<<p)-1))<<(k-p);\n\t d |= this[--i]>>(p+=this.DB-k);\n\t }\n\t else {\n\t d = (this[i]>>(p-=k))&km;\n\t if(p <= 0) { p += this.DB; --i; }\n\t }\n\t if(d > 0) m = true;\n\t if(m) r += int2char(d);\n\t }\n\t }\n\t return m?r:\"0\";\n\t }", "toBase10(value, b = 62) {\n const limit = value.length;\n let result = base.indexOf(value[0]);\n for (let i = 1; i < limit; i++) {\n result = b * result + base.indexOf(value[i]);\n }\n return result;\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n } else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n } else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n } else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n } else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n } else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n } else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n } else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this.data[i]&((1<<p)-1))<<(k-p);\n d |= this.data[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this.data[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n\t if(this.s < 0) return \"-\"+this.negate().toString(b);\n\t var k;\n\t if(b == 16) k = 4;\n\t else if(b == 8) k = 3;\n\t else if(b == 2) k = 1;\n\t else if(b == 32) k = 5;\n\t else if(b == 4) k = 2;\n\t else return this.toRadix(b);\n\t var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n\t var p = this.DB-(i*this.DB)%k;\n\t if(i-- > 0) {\n\t if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n\t while(i >= 0) {\n\t if(p < k) {\n\t d = (this[i]&((1<<p)-1))<<(k-p);\n\t d |= this[--i]>>(p+=this.DB-k);\n\t }\n\t else {\n\t d = (this[i]>>(p-=k))&km;\n\t if(p <= 0) { p += this.DB; --i; }\n\t }\n\t if(d > 0) m = true;\n\t if(m) r += int2char(d);\n\t }\n\t }\n\t return m?r:\"0\";\n\t }", "function bnToString(b) {\n\t if(this.s < 0) return \"-\"+this.negate().toString(b);\n\t var k;\n\t if(b == 16) k = 4;\n\t else if(b == 8) k = 3;\n\t else if(b == 2) k = 1;\n\t else if(b == 32) k = 5;\n\t else if(b == 4) k = 2;\n\t else return this.toRadix(b);\n\t var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n\t var p = this.DB-(i*this.DB)%k;\n\t if(i-- > 0) {\n\t if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n\t while(i >= 0) {\n\t if(p < k) {\n\t d = (this[i]&((1<<p)-1))<<(k-p);\n\t d |= this[--i]>>(p+=this.DB-k);\n\t }\n\t else {\n\t d = (this[i]>>(p-=k))&km;\n\t if(p <= 0) { p += this.DB; --i; }\n\t }\n\t if(d > 0) m = true;\n\t if(m) r += int2char(d);\n\t }\n\t }\n\t return m?r:\"0\";\n\t }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n}", "function convert2IntegerWithRadix(str){\n return parseInt(str, 2); // passing it as a base 2\n}", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n var p = this.DB-(i*this.DB)%k;\n if(i-- > 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<<p)-1))<<(k-p);\n d |= this[--i]>>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }", "function binl2rstr(input){var i;var output='';var length32=input.length*32;for(i=0;i<length32;i+=8){output+=String.fromCharCode(input[i>>5]>>>i%32&0xff);}return output;}", "function bnToString(b) {\n\t if(this.s < 0) return \"-\"+this.negate().toString(b);\n\t var k;\n\t if(b == 16) k = 4;\n\t else if(b == 8) k = 3;\n\t else if(b == 2) k = 1;\n\t else if(b == 32) k = 5;\n\t else if(b == 4) k = 2;\n\t else return this.toRadix(b);\n\t var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n\t var p = this.DB-(i*this.DB)%k;\n\t if(i-- > 0) {\n\t if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n\t while(i >= 0) {\n\t if(p < k) {\n\t d = (this.data[i]&((1<<p)-1))<<(k-p);\n\t d |= this.data[--i]>>(p+=this.DB-k);\n\t } else {\n\t d = (this.data[i]>>(p-=k))&km;\n\t if(p <= 0) { p += this.DB; --i; }\n\t }\n\t if(d > 0) m = true;\n\t if(m) r += int2char(d);\n\t }\n\t }\n\t return m?r:\"0\";\n\t}", "function bnToString(b) {\n\t if(this.s < 0) return \"-\"+this.negate().toString(b);\n\t var k;\n\t if(b == 16) k = 4;\n\t else if(b == 8) k = 3;\n\t else if(b == 2) k = 1;\n\t else if(b == 32) k = 5;\n\t else if(b == 4) k = 2;\n\t else return this.toRadix(b);\n\t var km = (1<<k)-1, d, m = false, r = \"\", i = this.t;\n\t var p = this.DB-(i*this.DB)%k;\n\t if(i-- > 0) {\n\t if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n\t while(i >= 0) {\n\t if(p < k) {\n\t d = (this[i]&((1<<p)-1))<<(k-p);\n\t d |= this[--i]>>(p+=this.DB-k);\n\t }\n\t else {\n\t d = (this[i]>>(p-=k))&km;\n\t if(p <= 0) { p += this.DB; --i; }\n\t }\n\t if(d > 0) m = true;\n\t if(m) r += int2char(d);\n\t }\n\t }\n\t return m?r:\"0\";\n\t}", "function numtoisbn10($n) {\n $n=string($n);\n $d=0;\n $f=2;\n for ($i=strlen($n)-1;$i>=0;$i--) {\n $d += $n[$i]*$f;\n $f++; \n }\n $d = 11-($d % 11);\n if ($d==11) {$d=\"X\";}\n else {$d=string($d);}\n return strcat(str_pad_left(string($n),9,\"0\"),$d);\n}", "function binl2rstr(input) {\r\n\t\t var i,\r\n\t\t output = '';\r\n\t\t for (i = 0; i < input.length * 32; i += 8) {\r\n\t\t output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);\r\n\t\t }\r\n\t\t return output;\r\n\t\t }" ]
[ "0.6596687", "0.6596687", "0.6596687", "0.6596687", "0.6596687", "0.6596687", "0.6596687", "0.6555484", "0.6555484", "0.65217733", "0.6519197", "0.6519197", "0.6519197", "0.6518932", "0.6516749", "0.651269", "0.6503056", "0.64993274", "0.64993274", "0.649443", "0.6491491", "0.6480293", "0.6480293", "0.64587903", "0.645588", "0.6453564", "0.6442371", "0.6442371", "0.6442371", "0.6442371", "0.6442371", "0.6442371", "0.6442371", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.6440035", "0.64387", "0.64387", "0.64294666", "0.64294666", "0.64268667", "0.64268667", "0.64268667", "0.64268667", "0.64268667", "0.64268667", "0.6423089", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6413023", "0.6411531", "0.64056724", "0.6383749", "0.63715595", "0.63705" ]
0.0
-1
(public) return value as integer
function bnIntValue() { if(this.s < 0) { if(this.t == 1) return this[0]-this.DV; else if(this.t == 0) return -1; } else if(this.t == 1) return this[0]; else if(this.t == 0) return 0; // assumes 16 < DB < 32 return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get intValue() {}", "get valueInteger() {\n\t\treturn this.__valueInteger;\n\t}", "get valueInteger () {\r\n\t\treturn this.__valueInteger;\r\n\t}", "function o2ws_get_int() { return o2ws_get_int32(); }", "function toInt(val){\n\t // we do not use lang/toNumber because of perf and also because it\n\t // doesn't break the functionality\n\t return ~~val;\n\t }", "function bnIntValue() {\n\tif(this.s < 0) {\n\t if(this.t == 1) return this.data[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t} else if(this.t == 1) return this.data[0];\n\telse if(this.t == 0) return 0;\n\t// assumes 16 < DB < 32\n\treturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n\t}", "function bnIntValue() {\n\tif(this.s < 0) {\n\t if(this.t == 1) return this[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t}\n\telse if(this.t == 1) return this[0];\n\telse if(this.t == 0) return 0;\n\t// assumes 16 < DB < 32\n\treturn ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n\t if(this.s < 0) {\n\t if(this.t == 1) return this[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t }\n\t else if(this.t == 1) return this[0];\n\t else if(this.t == 0) return 0;\n\t // assumes 16 < DB < 32\n\t return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n\t }", "function bnIntValue() {\n\t if(this.s < 0) {\n\t if(this.t == 1) return this[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t }\n\t else if(this.t == 1) return this[0];\n\t else if(this.t == 0) return 0;\n\t // assumes 16 < DB < 32\n\t return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n\t }", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;\n else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];\n else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\n }", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;\n else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];\n else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\n }", "function returnInt(element) {\n return parseInt(element, 10);\n }", "function bnIntValue() {\n\t if(this.s < 0) {\n\t if(this.t == 1) return this[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t }\n\t else if(this.t == 1) return this[0];\n\t else if(this.t == 0) return 0;\n\t // assumes 16 < DB < 32\n\t return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n\t }", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;\n else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];\n else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\n }", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;\n else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];\n else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];\n }", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];\n }", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];\n }", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\r\n\t if (this.s < 0) {\r\n\t if (this.t == 1) return this[0] - this.DV;\r\n\t else if (this.t === 0) return -1;\r\n\t }\r\n\t else if (this.t == 1) return this[0];\r\n\t else if (this.t === 0) return 0;\r\n\t// assumes 16 < DB < 32\r\n\t return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\r\n\t}", "function bnIntValue() {\r\n\t if (this.s < 0) {\r\n\t if (this.t == 1) return this[0] - this.DV;\r\n\t else if (this.t === 0) return -1;\r\n\t }\r\n\t else if (this.t == 1) return this[0];\r\n\t else if (this.t === 0) return 0;\r\n\t// assumes 16 < DB < 32\r\n\t return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\r\n\t}", "function getInt(key) {\r var value = retrieve(key);\r if (value != null) {\r try {\r return parseInt(value, 10);\r }\r catch (e) {\r return 0; \r }\r }\r else {\r return 0; \r }\r}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;\n else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];\n else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\n}", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this.data[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this.data[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];\n}", "function bnIntValue() {\n\t if(this.s < 0) {\n\t if(this.t == 1) return this[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t }\n\t else if(this.t == 1) return this[0];\n\t else if(this.t == 0) return 0;\n\t // assumes 16 < DB < 32\n\t return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n\t}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV\n else if (this.t == 0) return -1\n } else if (this.t == 1) return this[0]\n else if (this.t == 0) return 0\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV\n else if (this.t == 0) return -1\n } else if (this.t == 1) return this[0]\n else if (this.t == 0) return 0\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV\n else if (this.t == 0) return -1\n } else if (this.t == 1) return this[0]\n else if (this.t == 0) return 0\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV\n else if (this.t == 0) return -1\n } else if (this.t == 1) return this[0]\n else if (this.t == 0) return 0\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV\n else if (this.t == 0) return -1\n } else if (this.t == 1) return this[0]\n else if (this.t == 0) return 0\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV\n else if (this.t == 0) return -1\n } else if (this.t == 1) return this[0]\n else if (this.t == 0) return 0\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV\n else if (this.t == 0) return -1\n } else if (this.t == 1) return this[0]\n else if (this.t == 0) return 0\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n}", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n}", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n}", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n}", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n}", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n}", "function bnIntValue() {\n\t if (this.s < 0) {\n\t if (this.t == 1) return this[0] - this.DV\n\t else if (this.t == 0) return -1\n\t } else if (this.t == 1) return this[0]\n\t else if (this.t == 0) return 0\n\t // assumes 16 < DB < 32\n\t return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n\t}", "function bnIntValue() {\n\t if (this.s < 0) {\n\t if (this.t == 1) return this[0] - this.DV\n\t else if (this.t == 0) return -1\n\t } else if (this.t == 1) return this[0]\n\t else if (this.t == 0) return 0\n\t // assumes 16 < DB < 32\n\t return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n\t}", "function bnIntValue()\n{\n if (this.s < 0)\n {\n if (this.t == 1) return this[0] - this.DV;\n else if (this.t == 0) return -1;\n }\n else if (this.t == 1) return this[0];\n else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\n}", "getInteger() {\n return this.value ? this.value : null;\n }" ]
[ "0.8062313", "0.72035396", "0.71846676", "0.71775496", "0.7111766", "0.70502305", "0.69886273", "0.698818", "0.698818", "0.697269", "0.697269", "0.6960986", "0.6959027", "0.69558144", "0.69558144", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.6943782", "0.69317687", "0.69317687", "0.69317687", "0.6927587", "0.6927587", "0.6927587", "0.6927587", "0.6927587", "0.6927587", "0.6927587", "0.6902201", "0.6902201", "0.6900031", "0.6898809", "0.68968", "0.68968", "0.6894001", "0.68911517", "0.6884812", "0.6884812", "0.6884812", "0.6884812", "0.6884812", "0.6884812", "0.6884812", "0.68837196", "0.68837196", "0.68837196", "0.68837196", "0.68837196", "0.6868177", "0.6868177", "0.6863849", "0.6846286" ]
0.69251597
74
(protected) r = this + a
function bnpAddTo(a,r) { var i = 0, c = 0, m = Math.min(a.t,this.t); while(i < m) { c += this[i]+a[i]; r[i++] = c&this.DM; c >>= this.DB; } if(a.t < this.t) { c += a.s; while(i < this.t) { c += this[i]; r[i++] = c&this.DM; c >>= this.DB; } c += this.s; } else { c += this.s; while(i < a.t) { c += a[i]; r[i++] = c&this.DM; c >>= this.DB; } c += a.s; } r.s = (c<0)?-1:0; if(c > 0) r[i++] = c; else if(c < -1) r[i++] = this.DV+c; r.t = i; r.clamp(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_(self, a) {\n return self.add(a);\n}", "suma(){\n return this.a + this.b;\n }", "function addiere(a,b) {\n\t\t\t\tvar erg = a + b;\n\t\t\t\treturn erg;\n\t\t}", "add(a, b) {\r\n this.data[0] = a.data[0] + b.data[0];\r\n this.data[1] = a.data[1] + b.data[1];\r\n this.data[2] = a.data[2] + b.data[2];\r\n this.data[3] = a.data[3] + b.data[3];\r\n this.data[4] = a.data[4] + b.data[4];\r\n this.data[5] = a.data[5] + b.data[5];\r\n this.data[6] = a.data[6] + b.data[6];\r\n this.data[7] = a.data[7] + b.data[7];\r\n this.data[8] = a.data[8] + b.data[8];\r\n this.data[9] = a.data[9] + b.data[9];\r\n }", "static add (a, b) {\n return a + b;\n }", "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c < 0) ? -1 : 0;\n if (c > 0) r[i++] = c;\n else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c < 0) ? -1 : 0;\n if (c > 0) r[i++] = c;\n else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c < 0) ? -1 : 0;\n if (c > 0) r[i++] = c;\n else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c < 0) ? -1 : 0;\n if (c > 0) r[i++] = c;\n else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n }", "add() {\n for (let i = 0; i < arguments.length; i++) {\n this.result += arguments[i];\n }\n return this.result;\n }", "function bnpAddTo(a, r) {\r\n\t var i = 0, c = 0, m = Math.min(a.t, this.t);\r\n\t while (i < m) {\r\n\t c += this[i] + a[i];\r\n\t r[i++] = c & this.DM;\r\n\t c >>= this.DB;\r\n\t }\r\n\t if (a.t < this.t) {\r\n\t c += a.s;\r\n\t while (i < this.t) {\r\n\t c += this[i];\r\n\t r[i++] = c & this.DM;\r\n\t c >>= this.DB;\r\n\t }\r\n\t c += this.s;\r\n\t }\r\n\t else {\r\n\t c += this.s;\r\n\t while (i < a.t) {\r\n\t c += a[i];\r\n\t r[i++] = c & this.DM;\r\n\t c >>= this.DB;\r\n\t }\r\n\t c += a.s;\r\n\t }\r\n\t r.s = (c < 0) ? -1 : 0;\r\n\t if (c > 0) r[i++] = c;\r\n\t else if (c < -1) r[i++] = this.DV + c;\r\n\t r.t = i;\r\n\t r.clamp();\r\n\t}", "function bnpAddTo(a, r) {\r\n\t var i = 0, c = 0, m = Math.min(a.t, this.t);\r\n\t while (i < m) {\r\n\t c += this[i] + a[i];\r\n\t r[i++] = c & this.DM;\r\n\t c >>= this.DB;\r\n\t }\r\n\t if (a.t < this.t) {\r\n\t c += a.s;\r\n\t while (i < this.t) {\r\n\t c += this[i];\r\n\t r[i++] = c & this.DM;\r\n\t c >>= this.DB;\r\n\t }\r\n\t c += this.s;\r\n\t }\r\n\t else {\r\n\t c += this.s;\r\n\t while (i < a.t) {\r\n\t c += a[i];\r\n\t r[i++] = c & this.DM;\r\n\t c >>= this.DB;\r\n\t }\r\n\t c += a.s;\r\n\t }\r\n\t r.s = (c < 0) ? -1 : 0;\r\n\t if (c > 0) r[i++] = c;\r\n\t else if (c < -1) r[i++] = this.DV + c;\r\n\t r.t = i;\r\n\t r.clamp();\r\n\t}", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a,r) {\n\t var i = 0, c = 0, m = Math.min(a.t,this.t);\n\t while(i < m) {\n\t c += this[i]+a[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t if(a.t < this.t) {\n\t c += a.s;\n\t while(i < this.t) {\n\t c += this[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c += this.s;\n\t }\n\t else {\n\t c += this.s;\n\t while(i < a.t) {\n\t c += a[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c += a.s;\n\t }\n\t r.s = (c<0)?-1:0;\n\t if(c > 0) r[i++] = c;\n\t else if(c < -1) r[i++] = this.DV+c;\n\t r.t = i;\n\t r.clamp();\n\t }", "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c > 0) r[i++] = c;else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c > 0) r[i++] = c;else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n }", "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c > 0) r[i++] = c;else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n }", "function _add(a, b) { return a + b }", "plus(addend) {\n return new Sum(this, addend);\n }", "function bnpAddTo(a,r) {\n\t var i = 0, c = 0, m = Math.min(a.t,this.t);\n\t while(i < m) {\n\t c += this[i]+a[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t if(a.t < this.t) {\n\t c += a.s;\n\t while(i < this.t) {\n\t c += this[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c += this.s;\n\t }\n\t else {\n\t c += this.s;\n\t while(i < a.t) {\n\t c += a[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c += a.s;\n\t }\n\t r.s = (c<0)?-1:0;\n\t if(c > 0) r[i++] = c;\n\t else if(c < -1) r[i++] = this.DV+c;\n\t r.t = i;\n\t r.clamp();\n\t}", "function bnpAddTo(a, r) {\n\t var self = this\n\n\t var i = 0,\n\t c = 0,\n\t m = Math.min(a.t, self.t)\n\t while (i < m) {\n\t c += self[i] + a[i]\n\t r[i++] = c & self.DM\n\t c >>= self.DB\n\t }\n\t if (a.t < self.t) {\n\t c += a.s\n\t while (i < self.t) {\n\t c += self[i]\n\t r[i++] = c & self.DM\n\t c >>= self.DB\n\t }\n\t c += self.s\n\t } else {\n\t c += self.s\n\t while (i < a.t) {\n\t c += a[i]\n\t r[i++] = c & self.DM\n\t c >>= self.DB\n\t }\n\t c += a.s\n\t }\n\t r.s = (c < 0) ? -1 : 0\n\t if (c > 0) r[i++] = c\n\t else if (c < -1) r[i++] = self.DV + c\n\t r.t = i\n\t r.clamp()\n\t}", "function bnpAddTo(a, r) {\n\t var self = this\n\n\t var i = 0,\n\t c = 0,\n\t m = Math.min(a.t, self.t)\n\t while (i < m) {\n\t c += self[i] + a[i]\n\t r[i++] = c & self.DM\n\t c >>= self.DB\n\t }\n\t if (a.t < self.t) {\n\t c += a.s\n\t while (i < self.t) {\n\t c += self[i]\n\t r[i++] = c & self.DM\n\t c >>= self.DB\n\t }\n\t c += self.s\n\t } else {\n\t c += self.s\n\t while (i < a.t) {\n\t c += a[i]\n\t r[i++] = c & self.DM\n\t c >>= self.DB\n\t }\n\t c += a.s\n\t }\n\t r.s = (c < 0) ? -1 : 0\n\t if (c > 0) r[i++] = c\n\t else if (c < -1) r[i++] = self.DV + c\n\t r.t = i\n\t r.clamp()\n\t}", "function bnpAddTo(a,r) {\n\t var i = 0, c = 0, m = Math.min(a.t,this.t);\n\t while(i < m) {\n\t c += this[i]+a[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t if(a.t < this.t) {\n\t c += a.s;\n\t while(i < this.t) {\n\t c += this[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c += this.s;\n\t }\n\t else {\n\t c += this.s;\n\t while(i < a.t) {\n\t c += a[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c += a.s;\n\t }\n\t r.s = (c<0)?-1:0;\n\t if(c > 0) r[i++] = c;\n\t else if(c < -1) r[i++] = this.DV+c;\n\t r.t = i;\n\t r.clamp();\n\t }", "function bnpAddTo(a,r) {\n\t var i = 0, c = 0, m = Math.min(a.t,this.t);\n\t while(i < m) {\n\t c += this[i]+a[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t if(a.t < this.t) {\n\t c += a.s;\n\t while(i < this.t) {\n\t c += this[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c += this.s;\n\t }\n\t else {\n\t c += this.s;\n\t while(i < a.t) {\n\t c += a[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c += a.s;\n\t }\n\t r.s = (c<0)?-1:0;\n\t if(c > 0) r[i++] = c;\n\t else if(c < -1) r[i++] = this.DV+c;\n\t r.t = i;\n\t r.clamp();\n\t }", "function add(a) {\n return self => add_(self, a);\n}", "function bnpAddTo(a,r) {\n\tvar i = 0, c = 0, m = Math.min(a.t,this.t);\n\twhile(i < m) {\n\t c += this[i]+a[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t}\n\tif(a.t < this.t) {\n\t c += a.s;\n\t while(i < this.t) {\n\t\tc += this[i];\n\t\tr[i++] = c&this.DM;\n\t\tc >>= this.DB;\n\t }\n\t c += this.s;\n\t}\n\telse {\n\t c += this.s;\n\t while(i < a.t) {\n\t\tc += a[i];\n\t\tr[i++] = c&this.DM;\n\t\tc >>= this.DB;\n\t }\n\t c += a.s;\n\t}\n\tr.s = (c<0)?-1:0;\n\tif(c > 0) r[i++] = c;\n\telse if(c < -1) r[i++] = this.DV+c;\n\tr.t = i;\n\tr.clamp();\n }", "static add(a, b) {\n return a + b;\n }", "function A() {\n r.call(this);\n }", "plus(b) {\n let a = this;\n let real = a.re + b.re;\n let imag = a.im + b.im;\n return new Complex(real, imag);\n }", "add(other) {\n return this.__add__(other);\n }", "add(a, b) {\n\t\tthis.registers[a] += this.get(b);\n\t}", "add(q) {\n this[0] = this[0] + q[0];\n this[1] = this[1] + q[1];\n this[2] = this[2] + q[2];\n this[3] = this[3] + q[3];\n this[4] = this[4] + q[4];\n this[5] = this[5] + q[5];\n this[6] = this[6] + q[6];\n this[7] = this[7] + q[7];\n return this;\n }", "function bnpAddTo(a, r) {\n var i = 0, c = 0, m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c < 0) ? -1 : 0;\n if (c > 0) r[i++] = c;\n else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n}", "function bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c < 0) ? -1 : 0;\n if (c > 0) r[i++] = c;\n else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n}", "function sk$add(self, other)\n{\n var tmp = Long$.numOpAndPromotion$(self, other, function(a,b) { return a + b; });\n if (typeof tmp === \"number\") return tmp;\n self = tmp[0];\n other = tmp[1];\n\n if (self.__add__ !== undefined)\n return self.__add__(other);\n else\n {\n throw new TypeError(\"cannot concatenate '\" + sk$typename(self) + \"' and '\" + sk$typename(other) + \"' objects\");\n }\n}", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "function bnpAddTo(a,r) {\n var i = 0, c = 0, m = Math.min(a.t,this.t);\n while(i < m) {\n c += this[i]+a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n}", "function bnpAddTo(a, r) {\n var self = this\n\n var i = 0,\n c = 0,\n m = Math.min(a.t, self.t)\n while (i < m) {\n c += self[i] + a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n if (a.t < self.t) {\n c += a.s\n while (i < self.t) {\n c += self[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += self.s\n } else {\n c += self.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = self.DV + c\n r.t = i\n r.clamp()\n}", "function bnpAddTo(a, r) {\n var self = this\n\n var i = 0,\n c = 0,\n m = Math.min(a.t, self.t)\n while (i < m) {\n c += self[i] + a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n if (a.t < self.t) {\n c += a.s\n while (i < self.t) {\n c += self[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += self.s\n } else {\n c += self.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = self.DV + c\n r.t = i\n r.clamp()\n}", "function bnpAddTo(a, r) {\n var self = this\n\n var i = 0,\n c = 0,\n m = Math.min(a.t, self.t)\n while (i < m) {\n c += self[i] + a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n if (a.t < self.t) {\n c += a.s\n while (i < self.t) {\n c += self[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += self.s\n } else {\n c += self.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = self.DV + c\n r.t = i\n r.clamp()\n}", "function bnpAddTo(a, r) {\n var self = this\n\n var i = 0,\n c = 0,\n m = Math.min(a.t, self.t)\n while (i < m) {\n c += self[i] + a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n if (a.t < self.t) {\n c += a.s\n while (i < self.t) {\n c += self[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += self.s\n } else {\n c += self.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = self.DV + c\n r.t = i\n r.clamp()\n}", "function bnpAddTo(a, r) {\n var self = this\n\n var i = 0,\n c = 0,\n m = Math.min(a.t, self.t)\n while (i < m) {\n c += self[i] + a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n if (a.t < self.t) {\n c += a.s\n while (i < self.t) {\n c += self[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += self.s\n } else {\n c += self.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = self.DV + c\n r.t = i\n r.clamp()\n}", "function bnpAddTo(a, r) {\n var self = this\n\n var i = 0,\n c = 0,\n m = Math.min(a.t, self.t)\n while (i < m) {\n c += self[i] + a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n if (a.t < self.t) {\n c += a.s\n while (i < self.t) {\n c += self[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += self.s\n } else {\n c += self.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = self.DV + c\n r.t = i\n r.clamp()\n}", "function bnpAddTo(a, r) {\n var self = this\n\n var i = 0,\n c = 0,\n m = Math.min(a.t, self.t)\n while (i < m) {\n c += self[i] + a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n if (a.t < self.t) {\n c += a.s\n while (i < self.t) {\n c += self[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += self.s\n } else {\n c += self.s\n while (i < a.t) {\n c += a[i]\n r[i++] = c & self.DM\n c >>= self.DB\n }\n c += a.s\n }\n r.s = (c < 0) ? -1 : 0\n if (c > 0) r[i++] = c\n else if (c < -1) r[i++] = self.DV + c\n r.t = i\n r.clamp()\n}", "function bnpAddTo(a, r)\n{\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m)\n {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t)\n {\n c += a.s;\n while (i < this.t)\n {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else\n {\n c += this.s;\n while (i < a.t)\n {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c < 0) ? -1 : 0;\n if (c > 0) r[i++] = c;\n else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n}", "function foo4(something) {\n console.log(this.a, something);\n return this.a + something;\n}", "function bnpAddTo(a,r) {\n\tvar i = 0, c = 0, m = Math.min(a.t,this.t);\n\twhile(i < m) {\n\t c += this.data[i]+a.data[i];\n\t r.data[i++] = c&this.DM;\n\t c >>= this.DB;\n\t}\n\tif(a.t < this.t) {\n\t c += a.s;\n\t while(i < this.t) {\n\t c += this.data[i];\n\t r.data[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c += this.s;\n\t} else {\n\t c += this.s;\n\t while(i < a.t) {\n\t c += a.data[i];\n\t r.data[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c += a.s;\n\t}\n\tr.s = (c<0)?-1:0;\n\tif(c > 0) r.data[i++] = c;\n\telse if(c < -1) r.data[i++] = this.DV+c;\n\tr.t = i;\n\tr.clamp();\n\t}" ]
[ "0.6958733", "0.67737406", "0.6687434", "0.6640313", "0.66318834", "0.66062677", "0.66062677", "0.6603584", "0.6603584", "0.65958405", "0.6592635", "0.6592635", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6573848", "0.6563502", "0.65505767", "0.65505767", "0.65505767", "0.65456545", "0.65370774", "0.6528493", "0.6527699", "0.6527699", "0.6520421", "0.6520421", "0.6517008", "0.65008414", "0.64956313", "0.6489608", "0.6484708", "0.6483079", "0.6469865", "0.6443681", "0.6430135", "0.6422977", "0.6421907", "0.640255", "0.640255", "0.640255", "0.640255", "0.640255", "0.6396325", "0.6396325", "0.6396325", "0.6396325", "0.6396325", "0.6396325", "0.6396325", "0.63959634", "0.6357581", "0.6355578" ]
0.65576833
58
run may have just been called through dependencies being fulfilled just in this very frame
function doRun() { if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening Module['calledRun'] = true; ensureInitRuntime(); preMain(); if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) { Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms'); } if (Module['_main'] && shouldRunNow) { Module['callMain'](args); } postRun(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doRun(){// run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n if(calledRun)return;calledRun=true;Module['calledRun']=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module);if(Module['onRuntimeInitialized'])Module['onRuntimeInitialized']();postRun();}", "function run() {}", "function run() {\n }", "function doRun() {\n // run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n if (calledRun) return;\n calledRun = true;\n\n if (ABORT) return;\n\n initRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n assert(!Module['_main'], 'compiled without a main, but one is present. if you added it from JS, use Module[\"onRuntimeInitialized\"]');\n\n postRun();\n }", "function doRun() {\n // run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n if (calledRun) return;\n calledRun = true;\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n initRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n postRun();\n }", "function run() {\n\n }", "function doRun() {\n // run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n if (calledRun) return;\n calledRun = true;\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n initRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (shouldRunNow) callMain(args);\n\n postRun();\n }", "Run() {\n\n }", "run () {\n }", "function doRun() {\n\t if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n\t Module['calledRun'] = true;\n\n\t if (ABORT) return;\n\n\t ensureInitRuntime();\n\n\t preMain();\n\n\t if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n\t assert(!Module['_main'], 'compiled without a main, but one is present. if you added it from JS, use Module[\"onRuntimeInitialized\"]');\n\n\t postRun();\n\t }", "function run() {\n\n}", "run() {\n\t\tthrow new Error;\n\t}", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n assert(!Module['_main'], 'compiled without a main, but one is present. if you added it from JS, use Module[\"onRuntimeInitialized\"]');\n\n postRun();\n }", "run() {\n this.packedRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n assert(!Module['_main'], 'compiled without a main, but one is present. if you added it from JS, use Module[\"onRuntimeInitialized\"]');\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n assert(!Module['_main'], 'compiled without a main, but one is present. if you added it from JS, use Module[\"onRuntimeInitialized\"]');\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n assert(!Module['_main'], 'compiled without a main, but one is present. if you added it from JS, use Module[\"onRuntimeInitialized\"]');\n\n postRun();\n }", "function doRun() {\nif (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\nModule['calledRun'] = true;\nif (ABORT) return;\nensureInitRuntime();\npreMain();\nif (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\npostRun();\n}", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n\n postRun();\n }", "function doRun() {\r\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\r\n Module['calledRun'] = true;\r\n\r\n if (ABORT) return;\r\n\r\n ensureInitRuntime();\r\n\r\n preMain();\r\n\r\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\r\n\r\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\r\n\r\n postRun();\r\n }", "function Runner() {\n }", "run() {\n setDestGlobals(this, this._run);\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return; \n\n ensureInitRuntime();\n\n preMain();\n\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return; \n\n ensureInitRuntime();\n\n preMain();\n\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "firstRun() { }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "run() {\n throw new Error(`RequestRunner for type ${this.type} did not implement run()`);\n }", "async run(/*testRun*/) {\n Must(false, `pure virtual: kids must override`);\n }", "function BindAndRun() {\r\n}", "function run() {\n // do something\n}", "function run() {\n hitCallerService.runCombo().then(function(combo) {\n if (stopped) {\n difficulty = getDifficulty();\n return;\n }\n nextComoboTimer = $timeout(function() {\n // reset the difficulty\n difficulty = getDifficulty();\n // call this function again, now the combo is done\n if (!stopped) {\n run();\n }\n }, difficulty);\n });\n }", "onRun(call) {\r\n\r\n if (this.run_ext.indexOf(call) == -1) {\r\n this.run_ext.push(call);\r\n }\r\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "constructor() {\n super();\n\n this.run();\n }", "run () {\n if (this.module !== null) {\n let {imports = {}, onInit = () => {}} = this.moduleDependencyProvider(this);\n this.selectTab(this.tabs[\"output\"]);\n this.logOutput(\"<em>RUNNING...</em>\");\n WebAssembly.instantiate(this.module, imports).then((instance) => {\n onInit(instance);\n this.logOutput(\"<em>...DONE!</em>\");\n }).catch((error) => {\n this.showErrorMessage(error);\n });\n }\n }", "function run (fun) {\n fun() \n}", "async requestedRun(callerReference, functionName, unsanitizedArgs) {\n this.client.pauseTicking();\n const returned = await this.tryToRun(callerReference, functionName, unsanitizedArgs);\n this.client.startTicking();\n return returned;\n }", "async run(ctx, args) {\n return ctx.reply(`${this.constructor.name} does not provide a \\`run()\\` implementation.${ctx.author.id !== this.client.constants.ownerID ? \" This is a bug, please report this in our server at https://discord.gg/mDkMbEh\" : \"\"}`);\n }", "function run() {\r\n\t// Initialize the loader before anything happens\r\n\tloader.init();\r\n}", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return; \n\n ensureInitRuntime();\n\n preMain();\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return; \n\n ensureInitRuntime();\n\n preMain();\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return; \n\n ensureInitRuntime();\n\n preMain();\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return; \n\n ensureInitRuntime();\n\n preMain();\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "function run() {\n console.log(\"tick\");\n delayedCall(1, run)\n }", "run() {\n console.log('running');\n }", "function preRun(){if(Module['preRun']){if(typeof Module['preRun']=='function')Module['preRun']=[Module['preRun']];while(Module['preRun'].length){addOnPreRun(Module['preRun'].shift());}}callRuntimeCallbacks(__ATPRERUN__);}", "function run() { if (this === window) { if (typeof arguments[0] === 'function') arguments[0](); } else if (typeof this === 'function') this.apply(window, arguments); }", "_run(cb) {\n cb();\n }", "_run(cb) {\n cb();\n }", "beforeRun() {}", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "run(callback) {\n callback = callback_wrappers_1.tryCallback(callback);\n if (this.run_cb) {\n return callback(new Error(this.log_prefix + \"Pending run callback already exists.\"));\n }\n this.run_cb = callback;\n // child guards itself against running twice\n // or running uninitialized, returns an exception in response\n this.send(intf.ParentMsgCode.run, {});\n }", "function run(fun){\n fun()\n}", "function run(fun){\n fun()\n}", "function run(fun){\n fun()\n}", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return; \n\n ensureInitRuntime();\n\n preMain();\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return; \n\n ensureInitRuntime();\n\n preMain();\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return; \n\n ensureInitRuntime();\n\n preMain();\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return; \n\n ensureInitRuntime();\n\n preMain();\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "'run'(values) {\n if (values != null) { this['bind'](values); }\n this['step']();\n return this['reset']();\n }", "function thenRun() {\n\tconst args = Array.prototype.slice.call(arguments);\n\treturn () => run.apply(null, args);\n}", "run() {\n return this.get('_run').perform();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n ensureInitRuntime();\n\n preMain();\n\n if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {\n Module.printErr('pre-main prep time: ' + (Date.now() - preloadStartTime) + ' ms');\n }\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (Module['_main'] && shouldRunNow) Module['callMain'](args);\n\n postRun();\n }", "function run(fun) {\n fun()\n}", "function run(fun) {\n fun()\n}", "function run(fun) {\n fun()\n}", "function someRunner(anyFunction){ \n \tconsole.log(2+2); \n \tanyFunction(); \n }", "run(){\n\t\tthis.maybeEnemy();\n\t\tthis.move();\n\t\tthis.update();\n\t\tthis.checkEdges();\n\t\tthis.checkIfDead();\n\t\tthis.display();\n\t}", "function ready() {\n run();\n}", "run () {\n if (!this.active) return this.fn()\n const lastShouldTrack = shouldTrack\n try {\n pushTarget(this)\n shouldTrack = true\n return this.fn()\n } finally {\n popTarget()\n shouldTrack = lastShouldTrack\n this.deferStop ? this.stop() : this.cleanupDeps()\n }\n }", "run () {\n this.data.addInitialBuildEventListener(this.compileAll.bind(this))\n }", "function run() {\n if (!task && (task = stack.get())) {\n task.run();\n }\n }", "function run() {\n if (!task && (task = stack.get())) {\n task.run();\n }\n }", "function run() {\n if (!task && (task = stack.get())) {\n task.run();\n }\n }", "function run() {\n if (!task && (task = stack.get())) {\n task.run();\n }\n }", "function run (fun1) {\n fun1()\n}", "leftBuild () {\n admin.prototype.scriptCallLeft();\n }", "function _main() {\n try {\n // the modules own main routine\n //_logCalls();\n\n // enable a global accessability from window\n window.tools = {} || window.tools;\n window.tools._log = _log;\n window.tools._addNavigation = _addNavigation;\n } catch (error) {\n console.log(error);\n }\n\n }", "function main() {\n\t\t\ttry{\n\t\t\t\trender();\n\t\t\t} catch(e) {\n\t\t\t\tconsole.log(e);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(rendering == true) {\n\t\t\t\traf(main.bind(this));\n\t\t\t}\n\t\t}", "execute() {\n throw new Error(\"Must be implemented in subclass\");\n }", "run() {\n super.run();\n\n while (this._runCondition) {\n this._run(this.tasks.shift());\n }\n }", "run() {\n try {\n this.checkpointConfig = this.getCheckpointConfig(this.originalConfig);\n this.dependencyGraph = new bootDependencyGraph_1.BootDependencyGraph(this.parentName, this.checkpointConfig);\n logger_1.default.system.log(\"forceObjectsToLogger\", \"checkpoint BootDependencyGraph.run\", this.currentStage, this.checkpointConfig, this.dependencyGraph);\n console.log(\"checkpoint BootDependencyGraph.run\", this.currentStage, this.checkpointConfig, this.dependencyGraph);\n // kicks off processing the dependency graph -- will continue until done (i.e. graph state is \"finished\" or \"error\")\n this.processWhatIsReady(this.dependencyGraph);\n }\n catch (error) {\n // even though terminating, remove outstanding timers so they won't throw errors and clutter system log\n this.cleanupStagesOutStandingTimers();\n systemLog_1.default.error({}, `\"checkpointEngine: ${error}`);\n }\n }", "run()\n {\n this.userInterface.run();\n }" ]
[ "0.71392477", "0.7067637", "0.69554377", "0.69400525", "0.6908047", "0.681903", "0.67304075", "0.6727342", "0.65550256", "0.6475799", "0.6438775", "0.64352113", "0.64148164", "0.6402986", "0.6317247", "0.6317247", "0.6317247", "0.63035524", "0.6261234", "0.6261234", "0.62261987", "0.62261987", "0.62261987", "0.62261987", "0.62261987", "0.622594", "0.6185403", "0.61830646", "0.6155701", "0.615506", "0.615506", "0.61462283", "0.6075017", "0.6075017", "0.6075017", "0.6075017", "0.6075017", "0.6075017", "0.6041568", "0.60054284", "0.59826535", "0.5856291", "0.5817436", "0.5807673", "0.5793293", "0.5777937", "0.576838", "0.57644415", "0.57351875", "0.57249826", "0.57184005", "0.56967527", "0.56967527", "0.56967527", "0.56967527", "0.56908804", "0.5687468", "0.56800956", "0.5670673", "0.5670605", "0.5670605", "0.5651747", "0.5638855", "0.563075", "0.5597448", "0.5597448", "0.5597448", "0.55948293", "0.55948293", "0.55948293", "0.55948293", "0.55864704", "0.55753434", "0.55749863", "0.55746436", "0.55746436", "0.55746436", "0.5573747", "0.5573747", "0.5573747", "0.5572317", "0.55639803", "0.5553743", "0.55517143", "0.55480045", "0.55445486", "0.55445486", "0.55445486", "0.55445486", "0.5522208", "0.54857576", "0.5477523", "0.5475402", "0.54719865", "0.54603285", "0.5457356", "0.54461706" ]
0.5703796
54
Creates a function overload resolution table to the given method 'methodName' in the given prototype, if the overload table doesn't yet exist.
function ensureOverloadTable(proto, methodName, humanName) { if (undefined === proto[methodName].overloadTable) { var prevFunc = proto[methodName]; // Inject an overload resolver function that routes to the appropriate overload based on the number of arguments. proto[methodName] = function() { // TODO This check can be removed in -O3 level "unsafe" optimizations. if (!proto[methodName].overloadTable.hasOwnProperty(arguments.length)) { throwBindingError("Function '" + humanName + "' called with an invalid number of arguments (" + arguments.length + ") - expects one of (" + proto[methodName].overloadTable + ")!"); } return proto[methodName].overloadTable[arguments.length].apply(this, arguments); }; // Move the previous function into the overload table. proto[methodName].overloadTable = []; proto[methodName].overloadTable[prevFunc.argCount] = prevFunc; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createMethod(methodName){\n return function(){\n throw new Error('The \"'+methodName+'\" method is not available on the playback technology\\'s API');\n };\n}", "function createXNodeMethod(methodName) {\n\t\tXNode.prototype[methodName] = function() {\n\t\t\treturn this.node[methodName].apply(this.node, arguments);\n\t\t}\n\t}", "function add_stub_for(prototype, stub) {\n function method_missing_stub() {\n // Copy any given block onto the method_missing dispatcher\n this.$method_missing._p = method_missing_stub._p;\n\n // Set block property to null ready for the next call (stop false-positives)\n method_missing_stub._p = null;\n\n // call method missing with correct args (remove '$' prefix on method name)\n return this.$method_missing.apply(this, [stub.slice(1)].concat($slice.call(arguments)));\n }\n\n method_missing_stub.rb_stub = true;\n prototype[stub] = method_missing_stub;\n }", "function add_stub_for(prototype, stub) {\n function method_missing_stub() {\n // Copy any given block onto the method_missing dispatcher\n this.$method_missing._p = method_missing_stub._p;\n\n // Set block property to null ready for the next call (stop false-positives)\n method_missing_stub._p = null;\n\n // call method missing with correct args (remove '$' prefix on method name)\n return this.$method_missing.apply(this, [stub.slice(1)].concat($slice.call(arguments)));\n }\n\n method_missing_stub.rb_stub = true;\n prototype[stub] = method_missing_stub;\n }", "static createStatic(methodName) {\n this[methodName] = this[routeHandlerFactory](methodName)\n }", "function defineOnPrototype(ctor, methods) {\n var proto = ctor.prototype;\n forEachProperty(methods, function(val, key) {\n proto[key] = val;\n });\n }", "function aliasMethod(methodName) {\n return function() {\n return this[methodName].apply(this, arguments);\n };\n}", "function FunctionWithPrototypeTest() {}", "function importMethod(methodName, file, base, importName=methodName) {\n // methodPath is used to create a unique identifier of a method+base pair\n // in order to track the source of the import. This is useful, for example,\n // if the program includes fp/map and lodash/map (fp/ is one base whereas */ is the other)\n var methodPath = `${base || '*'}/${methodName}`;\n if (!selectedMethods[methodPath]) {\n let importPath = resolveModule(methodName, base);\n selectedMethods[methodPath] = file.addImport(importPath, 'default', importName);\n }\n return selectedMethods[methodPath];\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }", "function realMethod(methodName) {\r\n if (methodName === 'debug') {\r\n methodName = 'log';\r\n }\r\n\r\n if (typeof console === undefinedType) {\r\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\r\n } else if (methodName === 'trace' && isIE) {\r\n return traceForIE;\r\n } else if (console[methodName] !== undefined) {\r\n return bindMethod(console, methodName);\r\n } else if (console.log !== undefined) {\r\n return bindMethod(console, 'log');\r\n } else {\r\n return noop;\r\n }\r\n }", "function callMethod(methodName, type) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n visitorSelector(type, methodName).every(function (visitor) {\n var newType = visitor[methodName].apply(visitor, __spreadArrays([type], args));\n if (typeof newType === 'undefined') {\n // Keep going without modifying type.\n return true;\n }\n if (methodName === 'visitSchema' ||\n type instanceof graphql_1.GraphQLSchema) {\n throw new Error(\"Method \" + methodName + \" cannot replace schema with \" + newType);\n }\n if (newType === null) {\n // Stop the loop and return null form callMethod, which will cause\n // the type to be removed from the schema.\n type = null;\n return false;\n }\n // Update type to the new type returned by the visitor method, so that\n // later directives will see the new type, and callMethod will return\n // the final type.\n type = newType;\n return true;\n });\n // If there were no directives for this type object, or if all visitor\n // methods returned nothing, type will be returned unmodified.\n return type;\n }", "function callMethod(methodName, type) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n visitorSelector(type, methodName).every(function (visitor) {\n var newType = visitor[methodName].apply(visitor, __spreadArrays([type], args));\n if (typeof newType === 'undefined') {\n // Keep going without modifying type.\n return true;\n }\n if (methodName === 'visitSchema' ||\n type instanceof graphql_1.GraphQLSchema) {\n throw new Error(\"Method \" + methodName + \" cannot replace schema with \" + newType);\n }\n if (newType === null) {\n // Stop the loop and return null form callMethod, which will cause\n // the type to be removed from the schema.\n type = null;\n return false;\n }\n // Update type to the new type returned by the visitor method, so that\n // later directives will see the new type, and callMethod will return\n // the final type.\n type = newType;\n return true;\n });\n // If there were no directives for this type object, or if all visitor\n // methods returned nothing, type will be returned unmodified.\n return type;\n }", "static isMethodDeclarationOverload(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.MethodOverload;\r\n }", "function protoSuper(prototype, name, method) {\n return function() {\n this._super = prototype[name];\n return method.apply(this, arguments);\n };\n}", "function overloadBaseClassFunction(object, name, basefn) {\n if (!object.hasOwnProperty(name) || typeof object[name] !== 'function') {\n // object method is not a function or just inherited from Object.prototype\n object[name] = basefn;\n return;\n }\n var fn = object[name];\n if (\"$overloads\" in fn) {\n // the object method already overloaded (see defaultScope.addMethod)\n // let's just change a fallback method\n fn.$defaultOverload = basefn;\n return;\n }\n if (!(\"$overloads\" in basefn) && fn.length === basefn.length) {\n // special case when we just overriding the method\n return;\n }\n var overloads, defaultOverload;\n if (\"$overloads\" in basefn) {\n // let's inherit base class overloads to speed up things\n overloads = basefn.$overloads.slice(0);\n overloads[fn.length] = fn;\n defaultOverload = basefn.$defaultOverload;\n } else {\n overloads = [];\n overloads[basefn.length] = basefn;\n overloads[fn.length] = fn;\n defaultOverload = fn;\n }\n var hubfn = function() {\n var fn = hubfn.$overloads[arguments.length] ||\n (\"$methodArgsIndex\" in hubfn && arguments.length > hubfn.$methodArgsIndex ?\n hubfn.$overloads[hubfn.$methodArgsIndex] : null) ||\n hubfn.$defaultOverload;\n return fn.apply(this, arguments);\n };\n hubfn.$overloads = overloads;\n if (\"$methodArgsIndex\" in basefn) {\n hubfn.$methodArgsIndex = basefn.$methodArgsIndex;\n }\n hubfn.$defaultOverload = defaultOverload;\n hubfn.name = name;\n object[name] = hubfn;\n }", "function createNodeToXNodeMethodWrapper(methodName) {\n\t\tvar originalFunction = Node.prototype[methodName];\n\n\t\tNode.prototype[methodName] = function() {\n\t\t\tfor (var a in arguments) {\n\t\t\t\tif (arguments[a] instanceof XNode)\n\t\t\t\t\targuments[a] = arguments[a].node;\n\t\t\t}\n\n\t\t\treturn originalFunction.apply(this, arguments);\n\t\t}\n\t}", "function addMethod(method) {\n\t\tPromise.prototype[method] = function () {\n\t\t\tvar args = slice.call(arguments);\n\t\t\treturn this.then(function (object) {\n\t\t\t\tvar fn = object[method];\n\t\t\t\tif (typeof object[method] === 'function')\n\t\t\t\t\tvar result = fn.apply(object, args);\n\t\t\t\treturn result !== undefined ? result : object;\n\t\t\t});\n\t\t};\n\t}", "function createPrototypeFunction(name) {\n\n return function() {\n\n var data = {\n method: name\n };\n\n var args = Array.prototype.slice.call(arguments);\n\n //for getters add the passed parameters to the arguments for the send call\n if (/^get/.test(name)) {\n playerjs.assert(args.length > 0, 'Get methods require a callback.');\n args.unshift(data);\n } else {\n //for setter add the first arg to the value field\n if (/^set/.test(name)) {\n playerjs.assert(args.length !== 0, 'Set methods require a value.');\n data.value = args[0];\n }\n args = [data];\n }\n\n this.send.apply(this, args);\n };\n}", "function Spy(target, method) {\n // SOLUTION GOES HERE\n // console.log(`Target is : ${target}`);\n // console.log(`Method is : ${method}`);\n\n // Use bind() to pre append target object and method\n // Use accumulator to count number of calls using fn.call()\n // const result = target.reduce(function(acc, item, index, target) {\n // acc.push(method.call(item, index, target))\n // return acc\n // }, [])\n // return result.length;\n\n /*\n\n To override a method existing -- use the apply()\n\n \n\n\n */\n\n let spy = { count : 0};\n\n let oldFunction = target[method];\n\n target[method] = function(){\n spy.count++;\n return oldFunction.apply(target,arguments);\n }\n return spy;\n\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n } // These private functions always need `this` to be set properly", "function append(name, method)\n\t{\n\t\tif(!String.prototype[name])\n\t\t\tString.prototype[name] = method;\n\t}", "function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if ((typeof console === \"undefined\" ? \"undefined\" : _typeof(console)) === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n } // These private functions always need `this` to be set properly", "function Spy(target, method) {\n var self = {\n count: 0\n };\n var fn = target[method];\n\n target[method] = function override() {\n self.count++;\n return fn.apply(this, arguments);\n };\n\n return self;\n}", "static isFunctionDeclarationOverload(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.FunctionOverload;\r\n }", "function realMethod(methodName) {\n\t if (methodName === 'debug') {\n\t methodName = 'log';\n\t }\n\t\n\t if ((typeof console === 'undefined' ? 'undefined' : _typeof(console)) === undefinedType) {\n\t return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n\t } else if (console[methodName] !== undefined) {\n\t return bindMethod(console, methodName);\n\t } else if (console.log !== undefined) {\n\t return bindMethod(console, 'log');\n\t } else {\n\t return noop;\n\t }\n\t }", "function defaultMethodFactory(methodName, level, loggerName) {\r\n /*jshint validthis:true */\r\n return realMethod(methodName) ||\r\n enableLoggingWhenConsoleArrives.apply(this, arguments);\r\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n\t /*jshint validthis:true */\n\t return realMethod(methodName) || enableLoggingWhenConsoleArrives.apply(this, arguments);\n\t }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) || enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) || enableLoggingWhenConsoleArrives.apply(this, arguments);\n }", "function overrideMethod(target, methodName, funcSource) {\r\n var superFunc = target[methodName] || function() {};\r\n var superFuncBound = function() {\r\n return superFunc.apply(target, arguments);\r\n };\r\n target[methodName] = funcSource(superFuncBound);\r\n }", "function addCollectionMethod (methodName) {\n var method = Node.prototype[methodName];\n Collection.prototype[methodName] = function () {\n var result = new Collection();\n if (!this.length) {\n return result;\n }\n var args = Array.prototype.slice.apply(arguments);\n for (var i=0; i<this.length; i++) {\n var value = method.apply(this[i], args);\n if (value instanceof Collection) {\n result.push.apply(result, value);\n } else {\n result.push(value);\n }\n }\n return result;\n }\n }", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (\"production\" !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (false) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if ('development' !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function createMethod(name, fn) {\n\t\t\treturn function() {\n\t\t\t\tvar self = this, tmp = self._super, ret;\n\n\t\t\t\tself._super = _super[name];\n\t\t\t\tret = fn.apply(self, arguments);\n\t\t\t\tself._super = tmp;\n\n\t\t\t\treturn ret;\n\t\t\t};\n\t\t}", "function createMethod(name, fn) {\n\t\t\treturn function() {\n\t\t\t\tvar self = this, tmp = self._super, ret;\n\n\t\t\t\tself._super = _super[name];\n\t\t\t\tret = fn.apply(self, arguments);\n\t\t\t\tself._super = tmp;\n\n\t\t\t\treturn ret;\n\t\t\t};\n\t\t}", "function createMethod(name, fn) {\n\t\t\treturn function() {\n\t\t\t\tvar self = this, tmp = self._super, ret;\n\n\t\t\t\tself._super = _super[name];\n\t\t\t\tret = fn.apply(self, arguments);\n\t\t\t\tself._super = tmp;\n\n\t\t\t\treturn ret;\n\t\t\t};\n\t\t}", "make(methodName) {\n\t if (methodName === 'debug') {\n\t // eslint-disable-next-line no-param-reassign\n\t methodName = 'log';\n\t }\n\n\t /* eslint-disable no-console */\n\t if (typeof console[methodName] !== 'undefined') {\n\t return this.bindMethod(console, methodName);\n\t } else if (typeof console.log !== 'undefined') {\n\t return this.bindMethod(console, 'log');\n\t }\n\n\t /* eslint-enable no-console */\n\t return noop;\n\t }", "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */](props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (true) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (true) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (true) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n\t return function initProxySelector(dispatch, _ref) {\n\t var displayName = _ref.displayName;\n\n\t var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n\t return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n\t };\n\n\t // allow detectFactoryAndVerify to get ownProps\n\t proxy.dependsOnOwnProps = true;\n\n\t proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n\t proxy.mapToProps = mapToProps;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\t var props = proxy(stateOrDispatch, ownProps);\n\n\t if (typeof props === 'function') {\n\t proxy.mapToProps = props;\n\t proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n\t props = proxy(stateOrDispatch, ownProps);\n\t }\n\n\t if (true) (0, _verifyPlainObject2.default)(props, displayName, methodName);\n\n\t return props;\n\t };\n\n\t return proxy;\n\t };\n\t}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject.default)(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject.default)(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}", "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n // allow detectFactoryAndVerify to get ownProps\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (true) Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__[\"a\" /* default */])(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}" ]
[ "0.5103538", "0.50628316", "0.48640546", "0.48640546", "0.4862484", "0.47813582", "0.46100906", "0.45749334", "0.4536829", "0.45298368", "0.45298368", "0.45298368", "0.45298368", "0.45298368", "0.45298368", "0.45298368", "0.45298368", "0.45298368", "0.4504423", "0.4499308", "0.4499308", "0.4488359", "0.44880667", "0.44752032", "0.4435582", "0.43795115", "0.4356955", "0.43558592", "0.4355469", "0.4355469", "0.4355469", "0.4355469", "0.4355469", "0.4355469", "0.43527555", "0.43399853", "0.43232718", "0.4280698", "0.42741436", "0.42522126", "0.42479393", "0.42454937", "0.42454937", "0.42454937", "0.42454937", "0.42454937", "0.42454937", "0.42454937", "0.42454937", "0.42454937", "0.42454937", "0.42454937", "0.42454937", "0.42454937", "0.42454937", "0.42454937", "0.4236522", "0.4219633", "0.4219633", "0.42175347", "0.42164367", "0.42053214", "0.42053214", "0.42033798", "0.42025512", "0.42025512", "0.42016056", "0.42006534", "0.41955706", "0.41955706", "0.41955706", "0.4194352", "0.4193683", "0.4193683", "0.4193683", "0.41924596", "0.41916645", "0.41899458", "0.41899458", "0.41899458", "0.41899458", "0.4187829", "0.4187829", "0.4186225", "0.4186225", "0.4186225", "0.4186225", "0.4186225", "0.4186225", "0.4186225", "0.4186225", "0.41851348", "0.41851348", "0.41851348", "0.41851348", "0.41851348", "0.41851348", "0.41851348", "0.41851348", "0.41851348" ]
0.6609852
0
Registers a symbol (function, class, enum, ...) as part of the Module JS object so that handwritten code is able to access that symbol via 'Module.name'. name: The name of the symbol that's being exposed. value: The object itself to expose (function, class, ...) numArguments: For functions, specifies the number of arguments the function takes in. For other types, unused and undefined. To implement support for multiple overloads of a function, an 'overload selector' function is used. That selector function chooses the appropriate overload to call from an function overload table. This selector function is only used if multiple overloads are actually registered, since it carries a slight performance penalty.
function exposePublicSymbol(name, value, numArguments) { if (Module.hasOwnProperty(name)) { if (undefined === numArguments || (undefined !== Module[name].overloadTable && undefined !== Module[name].overloadTable[numArguments])) { throwBindingError("Cannot register public name '" + name + "' twice"); } // We are exposing a function with the same name as an existing function. Create an overload table and a function selector // that routes between the two. ensureOverloadTable(Module, name, name); if (Module.hasOwnProperty(numArguments)) { throwBindingError("Cannot register multiple overloads of a function with the same number of arguments (" + numArguments + ")!"); } // Add the new function into the overload table. Module[name].overloadTable[numArguments] = value; } else { Module[name] = value; if (undefined !== numArguments) { Module[name].numArguments = numArguments; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function define(name, value) {\n Object.defineProperty(exports, name, {\n value: value,\n enumerable: true\n });\n}", "define(name, value) {\n if (Object.prototype.hasOwnProperty.call(this.values, name)) {\n throw new ReferenceError(`Variable ${name} has already been declared.`);\n }\n this.values[name] = value;\n return value;\n }", "function register(name, fn, checkArgs, returns) {\n\t TYPE_FUNCTIONS[name] = {\n\t checkArguments: checkArgs,\n\t evaluatedArgs: true,\n\t evaluate: fn,\n\t type: returns\n\t };\n\t }", "function register(name, fn, checkArgs, returns) {\n\t MATH_FUNCTIONS[name] = {\n\t checkArguments: checkArgs,\n\t evaluatedArgs: true,\n\t evaluate: fn,\n\t type: returns\n\t };\n\t }", "function register(name, fn, checkArgs, returns, evaluatedArgs) {\n\t MV_FUNCTIONS[name] = {\n\t checkArguments: checkArgs,\n\t evaluatedArgs: evaluatedArgs !== false,\n\t evaluate: fn,\n\t type: returns\n\t };\n\t }", "set name(value) {}", "set name(value) {}", "set name(value) {}", "set name(value) {}", "set name(value) {}", "set name(value) {}", "set name(value) {}", "function register() {\n safeRegister();\n exports.clone.register();\n exports.copy.register();\n exports.extend.register();\n exports.typeOf.register();\n }", "function register(name, fn, checkArgs, returns) {\n\t MISC_FUNCTIONS[name] = {\n\t checkArguments: checkArgs,\n\t evaluatedArgs: true,\n\t evaluate: fn,\n\t type: returns\n\t };\n\t }", "function caml_register_named_value(nm,v) {\n caml_named_values[nm] = v; return 0;\n}", "static register(type, value, options) {\n const validTypes = ['function', 'number', 'string', 'symbol'];\n const valid = validTypes.indexOf(typeof type) >= 0;\n if (!valid) {\n throw new TypeError(`The 'type' parameter must be in ${validTypes}.`);\n }\n const factory = typeof value === \"function\" ? value : () => value;\n INJECT_ITEMS.set(type, factory);\n if (options === null || options === void 0 ? void 0 : options.alias) {\n INJECT_ITEMS.set(options.alias, factory);\n }\n singleton_1.Singleton.clear(type);\n return Injector;\n }", "function moduleExportAs(name) {\n var entry = this;\n var includeDefault = name === \"*+\";\n return function (value) {\n if (name === \"*\" || name === \"*+\") {\n Object.keys(value).forEach(function (key) {\n if (includeDefault || key !== \"default\") {\n utils.copyKey(key, entry.exports, value);\n }\n });\n } else {\n entry.exports[name] = value;\n }\n };\n } // Platform-specific code should find a way to call this method whenever", "function registerGlobal (key, value) {\n\n if (typeof(router[key]) === \"undefined\") {\n\n if (typeof(value) === \"function\") {\n\n router[key] = function () {\n /**\n * Prepare Arguments\n *\n * TODO: (Source: MDN)\n * You should not slice on arguments because it prevents optimizations in JavaScript\n * engines (V8 for example). Instead, try constructing a new array by iterating\n * through the arguments object.\n */\n // var args = Array.prototype.slice.call(arguments);\n var args = arguments;\n if (args.length === 0) args = null;\n\n /**\n * Execute Before hooks on the arguments\n */\n if (router.hooks[key] && router.hooks[key].before && router.hooks[key].before.length > 0)\n args = executeFunctionArray(router.hooks[key].before, args);\n\n /**\n * Execute the intended function\n */\n result = value.apply(this, args);\n\n /**\n * Execute After hooks on the result\n */\n if (router.hooks[key] && router.hooks[key].after && router.hooks[key].after.length > 0)\n result = executeFunctionArray(router.hooks[key].after, result);\n\n return result;\n };\n\n } else {\n\n // If the global is being set to any other type of object or value, just do it.\n router[key] = value;\n\n }\n\n } else {\n console.log(\"ERROR: A module attempted to write to the `\" + key + \"` namespace, but it is already being used.\");\n }\n }", "function moduleExportAs(name) {\n var entry = this;\n var includeDefault = name === \"*+\";\n return function (value) {\n if (name === \"*\" || name === \"*+\") {\n Object.keys(value).forEach(function (key) {\n if (includeDefault || key !== \"default\") {\n utils.copyKey(key, entry.exports, value);\n }\n });\n } else {\n entry.exports[name] = value;\n }\n };\n }", "function polyfillSymbol(name) {\n\n if (!Symbol[name])\n Object.defineProperty(Symbol, name, { value: Symbol(name) });\n}", "function register(name, fn, checkArgs, returns, expandMV) {\n\t STRING_FUNCTIONS[name] = {\n\t checkArguments: checkArgs,\n\t evaluatedArgs: true,\n\t expandMultiValueArg: expandMV,\n\t evaluate: fn,\n\t type: returns || types.STRING\n\t };\n\t }", "define(name, value) {\n this.record[name] = value;\n return value;\n }", "function sym(name, ret, arg) {\n try {\n return new NativeFunction(Module.findExportByName(null, name), ret, arg);\n } catch (e) {\n console.error(name, ':', e);\n }\n}", "@bind\n setCustomModule(name, value) {\n this.customModules[name] = value\n }", "function register(name, fn, checkArgs, returns) {\n\t TIME_FUNCTIONS[name] = {\n\t checkArguments: checkArgs,\n\t evaluatedArgs: true,\n\t evaluate: fn,\n\t type: returns\n\t };\n\t }", "function addToGlobal(name, value) {\n globalData[name] = value;\n }", "function exportMethod (name) {\n\t\tif (name in missing) {\n\t\t\texports[name] = function (obj, arg1, arg2) {\n\t\t\t\treturn missing[name](obj, arg1, arg2);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\texports[name] = wrapNative(name);\n\t\t}\n\t}", "static create(name) {\n return new TypedSymbol(name);\n }", "static create(name) {\n return new TypedSymbol(name);\n }", "add(name, value) {\n if (!this.slots) this.slots = new Array();\n this.slots.push(name);\n this.slots.push(value);\n }", "function register(mname, macro) {\n macros[mname] = macro;\n}", "function register(arg1, arg2) {\n const obj = utils_1.nameValueToObject(arg1, arg2);\n const keys = [...Object.keys(obj), ...Object.getOwnPropertySymbols(obj)];\n for (const key of keys) {\n const value = obj[key];\n registrations[key] = value;\n }\n // Invalidates the computed registrations.\n computedRegistrations = null;\n return container;\n }", "set(name, value) {\n this.resolve(name).values[name] = value;\n return value;\n }", "function register(obj, name, func){\n\t\tif (!obj[name]){\n\t\t\tobj[name] = func;\n\t\t}\n\t}", "function define (name, value, target) {\n Object.defineProperty(target, name, {\n value: value, enumerable: true\n });\n}", "registerApi (moduleName, name, method, args) {\n if (typeof method !== 'function') {\n return\n }\n if (!protocol.apiModule[moduleName]) {\n protocol.apiModule[moduleName] = {}\n protocol._meta[moduleName] = []\n }\n protocol.apiModule[moduleName][name] = method\n if (!args) {\n return\n }\n // register API meta info to jsframework\n protocol.setApiMeta(moduleName, {\n name: name,\n args: args\n })\n global.registerModules(protocol.getApiModuleMeta(moduleName), true)\n }", "registerApi (moduleName, name, method, args) {\n if (typeof method !== 'function') {\n return\n }\n if (!protocol.apiModule[moduleName]) {\n protocol.apiModule[moduleName] = {}\n protocol._meta[moduleName] = []\n }\n protocol.apiModule[moduleName][name] = method\n if (!args) {\n return\n }\n // register API meta info to jsframework\n protocol.setApiMeta(moduleName, {\n name: name,\n args: args\n })\n global.registerModules(protocol.getApiModuleMeta(moduleName), true)\n }", "function registerModule(name, weight)\n{\n fuzzRegisteredModules.push({v: name, w: weight});\n}", "register() {\n Object.keys(this._nameMapping).forEach(newName => {\n this.target[newName] = this.require(newName);\n });\n }", "value(name) {\n return new code.Value(name);\n }", "set(name, value) {\n if (value === undefined) {\n this.remove(name);\n } else {\n if (this.slots) {\n for (let n = 0; n < this.slots.length; n += 2) {\n if (this.slots[n] === name) {\n this.slots[n + 1] = value;\n return;\n }\n }\n }\n this.add(name, value);\n }\n }", "function registerGlobalQmlType(name, type) {\n QmlWeb[type.name] = type;\n QmlWeb.constructors[name] = type;\n modules.Main[name] = type;\n}", "function _register(name, implementation, wrapOptions) {\n wrapOptions = wrapOptions || {};\n\n // Validate options\n Object.keys(wrapOptions).forEach(function (option) {\n if (!DEFAULT_WRAP_OPTIONS.hasOwnProperty(option)) {\n throw new Error(\"Unknown option '\" + option + \"'\");\n }\n if (typeof wrapOptions[option] !== typeof DEFAULT_WRAP_OPTIONS[option]) {\n throw new TypeError(\"Unsupported type '\" + typeof wrapOptions[option] +\n \"' for option '\" + option + \"'\");\n }\n });\n\n // If an option isn't specified, use the default\n wrapOptions = Object.assign({}, DEFAULT_WRAP_OPTIONS, wrapOptions);\n\n if (shell.hasOwnProperty(name)) {\n throw new Error('Command `' + name + '` already exists');\n }\n\n if (wrapOptions.pipeOnly) {\n wrapOptions.canReceivePipe = true;\n shellMethods[name] = wrap(name, implementation, wrapOptions);\n } else {\n shell[name] = wrap(name, implementation, wrapOptions);\n }\n\n if (wrapOptions.canReceivePipe) {\n pipeMethods.push(name);\n }\n}", "function _register(name, implementation, wrapOptions) {\n wrapOptions = wrapOptions || {};\n\n // Validate options\n Object.keys(wrapOptions).forEach(function (option) {\n if (!DEFAULT_WRAP_OPTIONS.hasOwnProperty(option)) {\n throw new Error(\"Unknown option '\" + option + \"'\");\n }\n if (typeof wrapOptions[option] !== typeof DEFAULT_WRAP_OPTIONS[option]) {\n throw new TypeError(\"Unsupported type '\" + typeof wrapOptions[option] +\n \"' for option '\" + option + \"'\");\n }\n });\n\n // If an option isn't specified, use the default\n wrapOptions = Object.assign({}, DEFAULT_WRAP_OPTIONS, wrapOptions);\n\n if (shell.hasOwnProperty(name)) {\n throw new Error('Command `' + name + '` already exists');\n }\n\n if (wrapOptions.pipeOnly) {\n wrapOptions.canReceivePipe = true;\n shellMethods[name] = wrap(name, implementation, wrapOptions);\n } else {\n shell[name] = wrap(name, implementation, wrapOptions);\n }\n\n if (wrapOptions.canReceivePipe) {\n pipeMethods.push(name);\n }\n}", "function _register(name, implementation, wrapOptions) {\n wrapOptions = wrapOptions || {};\n\n // Validate options\n Object.keys(wrapOptions).forEach(function (option) {\n if (!DEFAULT_WRAP_OPTIONS.hasOwnProperty(option)) {\n throw new Error(\"Unknown option '\" + option + \"'\");\n }\n if (typeof wrapOptions[option] !== typeof DEFAULT_WRAP_OPTIONS[option]) {\n throw new TypeError(\"Unsupported type '\" + typeof wrapOptions[option] +\n \"' for option '\" + option + \"'\");\n }\n });\n\n // If an option isn't specified, use the default\n wrapOptions = Object.assign({}, DEFAULT_WRAP_OPTIONS, wrapOptions);\n\n if (shell.hasOwnProperty(name)) {\n throw new Error('Command `' + name + '` already exists');\n }\n\n if (wrapOptions.pipeOnly) {\n wrapOptions.canReceivePipe = true;\n shellMethods[name] = wrap(name, implementation, wrapOptions);\n } else {\n shell[name] = wrap(name, implementation, wrapOptions);\n }\n\n if (wrapOptions.canReceivePipe) {\n pipeMethods.push(name);\n }\n}", "static register_special(name, func, argDef) {\n if (SPECIALS[name] === undefined) {\n SPECIALS[name] = {\n function: func,\n args: (argDef) ? Query.parseArgDef(argDef) : null\n };\n return true;\n }\n else {\n console.warn(`${name} is already registered as a special value`);\n return false;\n }\n }", "set(name, val, resolveUp, isImport) {\n // Allow variables with dots by automatically creating the\n // nested structure\n var parts = name.split('.');\n var obj = this.variables;\n var frame = this;\n\n // CHANGE HERE\n // flag imports, so we can exclude them from Compiler#compileSymbol\n if (isImport) {\n this.imports = this.imports || new Set();\n this.imports.add(parts[0]);\n }\n\n if (resolveUp) {\n if ((frame = this.resolve(parts[0], true))) {\n frame.set(name, val);\n return;\n }\n }\n\n for (let i = 0; i < parts.length - 1; i++) {\n const id = parts[i];\n\n if (!obj[id]) {\n obj[id] = {};\n }\n obj = obj[id];\n }\n\n obj[parts[parts.length - 1]] = val;\n }", "function define(name, func){\n globalScope.put(name, func);\n}", "addField(name, value) {\n this.manifest[name] = value;\n }", "function _register(name, implementation, wrapOptions) {\n wrapOptions = wrapOptions || {}; // Validate options\n\n Object.keys(wrapOptions).forEach(function (option) {\n if (!DEFAULT_WRAP_OPTIONS.hasOwnProperty(option)) {\n throw new Error(\"Unknown option '\" + option + \"'\");\n }\n\n if (_typeof(wrapOptions[option]) !== _typeof(DEFAULT_WRAP_OPTIONS[option])) {\n throw new TypeError(\"Unsupported type '\" + _typeof(wrapOptions[option]) + \"' for option '\" + option + \"'\");\n }\n }); // If an option isn't specified, use the default\n\n wrapOptions = Object.assign({}, DEFAULT_WRAP_OPTIONS, wrapOptions);\n\n if (shell[name]) {\n throw new Error('Command `' + name + '` already exists');\n }\n\n if (wrapOptions.pipeOnly) {\n wrapOptions.canReceivePipe = true;\n shellMethods[name] = wrap(name, implementation, wrapOptions);\n } else {\n shell[name] = wrap(name, implementation, wrapOptions);\n }\n\n if (wrapOptions.canReceivePipe) {\n pipeMethods.push(name);\n }\n}", "function registerExtension(name, extension, options) {\n var params = name;\n if (!isObject(name)) {\n params = {};\n params[name] = {\n extension: extension,\n options: options\n };\n }\n\n each(params, function (v, name) {\n if (v) {\n var _extension = v.extension,\n _options = v.options;\n\n\n if (_extension) {\n extensions[name] = _extension;\n } else {\n extensions[name] = v;\n }\n extensionConfig[name] = _config(_options);\n }\n }, false, false);\n}", "RegisterUniform(Name)\n\t{\n\t\tthis.KnownUniforms[Name] = true;\n\t}", "function declareFunction (core, name, type, body, decl) {\n const codePtr = core.functions.length;\n let value;\n if (body) {\n value = new FunctionValue(type, codePtr, name, body, decl);\n } else {\n value = new BuiltinValue(type, codePtr, name);\n }\n core.functions.push(value);\n core.globalMap[name] = value;\n}", "function register(name, fn, checkArgs, returns) {\n\t COND_FUNCTIONS[name] = {\n\t checkArguments: checkArgs,\n\t evaluatedArgs: false,\n\t evaluate: fn,\n\t type: returns\n\t };\n\t }", "function registerFunction(name, ftype, operands, declar, asm, inline, varLength) {\n\t\tvar pos = -1;\n\t\tfor (var i = 0; i < functionTable.length; i++) {\n\t\t\tif (functionTable[i].name == name)\n\t\t\t\tpos = i;\n\t\t}\n\t\tif (pos >= 0 && functionTable[pos].declar == 1) {\n\t\t\tputError(lineCount, 0, name);\n\t\t\t//info(\"\" + lineCount + \" the function \" + name + \" has already been declared\");\n\t\t} else if (pos == -1) {\n\t\t\t//function name, return type, operands, whether a function is declared, whether a function is used, function code, whether to insert a function instead of a jump\n\t\t\tfunctionTable.push({\n\t\t\t\tname: name,\n\t\t\t\ttype: ftype,\n\t\t\t\toperands: operands,\n\t\t\t\tdeclar: declar,\n\t\t\t\tuse: 0,\n\t\t\t\tasm: asm,\n\t\t\t\tinline: inline,\n\t\t\t\tvarLength: varLength\n\t\t\t});\n\t\t} else {\n\t\t\tif (!(functionTable[pos].type == ftype)) {\n\t\t\t\tputError(lineCount, 1, name);\n\t\t\t\t//info(\"\" + lineCount + \" function \" + name + \" does not match the prototype\");\n\t\t\t}\n\t\t\tfunctionTable[pos].declar = declar;\n\t\t\tfunctionTable[pos].asm = asm;\n\t\t\tfunctionTable[pos].varLength = varLength;\n\t\t}\n\t}", "function defineProxyPropertyWithValue(name, value) {\n var _ref = Object.getOwnPropertyDescriptor(current, name) || {};\n\n var _ref$enumerable = _ref.enumerable;\n var enumerable = _ref$enumerable === undefined ? false : _ref$enumerable;\n var _ref$writable = _ref.writable;\n var writable = _ref$writable === undefined ? true : _ref$writable;\n\n\n defineProxyProperty(name, {\n configurable: true,\n enumerable: enumerable,\n writable: writable,\n value: value\n });\n }", "function defineProxyPropertyWithValue(name, value) {\n var _ref = Object.getOwnPropertyDescriptor(current, name) || {};\n\n var _ref$enumerable = _ref.enumerable;\n var enumerable = _ref$enumerable === undefined ? false : _ref$enumerable;\n var _ref$writable = _ref.writable;\n var writable = _ref$writable === undefined ? true : _ref$writable;\n\n\n defineProxyProperty(name, {\n configurable: true,\n enumerable: enumerable,\n writable: writable,\n value: value\n });\n }", "function defineProxyPropertyWithValue(name, value) {\n var _ref = Object.getOwnPropertyDescriptor(current, name) || {};\n\n var _ref$enumerable = _ref.enumerable;\n var enumerable = _ref$enumerable === undefined ? false : _ref$enumerable;\n var _ref$writable = _ref.writable;\n var writable = _ref$writable === undefined ? true : _ref$writable;\n\n\n defineProxyProperty(name, {\n configurable: true,\n enumerable: enumerable,\n writable: writable,\n value: value\n });\n }", "function defineProxyPropertyWithValue(name, value) {\n var _ref = Object.getOwnPropertyDescriptor(current, name) || {};\n\n var _ref$enumerable = _ref.enumerable;\n var enumerable = _ref$enumerable === undefined ? false : _ref$enumerable;\n var _ref$writable = _ref.writable;\n var writable = _ref$writable === undefined ? true : _ref$writable;\n\n\n defineProxyProperty(name, {\n configurable: true,\n enumerable: enumerable,\n writable: writable,\n value: value\n });\n }", "function defineProxyPropertyWithValue(name, value) {\n var _ref = Object.getOwnPropertyDescriptor(current, name) || {};\n\n var _ref$enumerable = _ref.enumerable;\n var enumerable = _ref$enumerable === undefined ? false : _ref$enumerable;\n var _ref$writable = _ref.writable;\n var writable = _ref$writable === undefined ? true : _ref$writable;\n\n\n defineProxyProperty(name, {\n configurable: true,\n enumerable: enumerable,\n writable: writable,\n value: value\n });\n }", "function defineProxyPropertyWithValue(name, value) {\n var _ref = Object.getOwnPropertyDescriptor(current, name) || {};\n\n var _ref$enumerable = _ref.enumerable;\n var enumerable = _ref$enumerable === undefined ? false : _ref$enumerable;\n var _ref$writable = _ref.writable;\n var writable = _ref$writable === undefined ? true : _ref$writable;\n\n\n defineProxyProperty(name, {\n configurable: true,\n enumerable: enumerable,\n writable: writable,\n value: value\n });\n }", "function defineProxyPropertyWithValue(name, value) {\n var _ref = Object.getOwnPropertyDescriptor(current, name) || {};\n\n var _ref$enumerable = _ref.enumerable;\n var enumerable = _ref$enumerable === undefined ? false : _ref$enumerable;\n var _ref$writable = _ref.writable;\n var writable = _ref$writable === undefined ? true : _ref$writable;\n\n\n defineProxyProperty(name, {\n configurable: true,\n enumerable: enumerable,\n writable: writable,\n value: value\n });\n }", "function defineProxyPropertyWithValue(name, value) {\n var _ref = Object.getOwnPropertyDescriptor(current, name) || {};\n\n var _ref$enumerable = _ref.enumerable;\n var enumerable = _ref$enumerable === undefined ? false : _ref$enumerable;\n var _ref$writable = _ref.writable;\n var writable = _ref$writable === undefined ? true : _ref$writable;\n\n\n defineProxyProperty(name, {\n configurable: true,\n enumerable: enumerable,\n writable: writable,\n value: value\n });\n }", "function s (name, val)\n{\n\tvar len = memory.stack.length;\n\n\tif (memory.identifiers[name] !== undefined) {\n\t\treturn ds( a( name), val);\n\t}\n\tvar len = memory.stack.length;\n\tmemory.stack[len] = val;\n\tmemory.identifiers[name] = len;\n}", "function defineRegister(name, register) {\n var registers = vimGlobalState.registerController.registers;\n if (!name || name.length != 1) {\n throw Error('Register name must be 1 character');\n }\n if (registers[name]) {\n throw Error('Register already defined ' + name);\n }\n registers[name] = register;\n validRegisters.push(name);\n }", "function defineRegister(name, register) {\n var registers = vimGlobalState.registerController.registers;\n if (!name || name.length != 1) {\n throw Error('Register name must be 1 character');\n }\n if (registers[name]) {\n throw Error('Register already defined ' + name);\n }\n registers[name] = register;\n validRegisters.push(name);\n }", "loadValue(register, value) {\n if (Object(_glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"isLowLevelRegister\"])(register)) {\n this[_symbols__WEBPACK_IMPORTED_MODULE_7__[\"INNER_VM\"]].loadRegister(register, value);\n }\n\n switch (register) {\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$s0\"]:\n this.s0 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$s1\"]:\n this.s1 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$t0\"]:\n this.t0 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$t1\"]:\n this.t1 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$v0\"]:\n this.v0 = value;\n break;\n }\n }", "loadValue(register, value) {\n if (Object(_glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"isLowLevelRegister\"])(register)) {\n this[_symbols__WEBPACK_IMPORTED_MODULE_7__[\"INNER_VM\"]].loadRegister(register, value);\n }\n\n switch (register) {\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$s0\"]:\n this.s0 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$s1\"]:\n this.s1 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$t0\"]:\n this.t0 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$t1\"]:\n this.t1 = value;\n break;\n\n case _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$v0\"]:\n this.v0 = value;\n break;\n }\n }", "function declareFunction(core, name, type, body, decl) {\n var codePtr = core.functions.length;\n var value = void 0;\n if (body) {\n value = new _value.FunctionValue(type, codePtr, name, body, decl);\n } else {\n value = new _value.BuiltinValue(type, codePtr, name);\n }\n core.functions.push(value);\n core.globalMap[name] = value;\n}", "static get [Symbol.species]() { \n return Number; \n }", "function encodeOpcode(name) {\n var params = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n params[_i - 1] = arguments[_i];\n }\n var opcode = opcodes[name];\n if (!opcode) {\n throw new Error(\"unknown opcode \" + name);\n }\n var loadArgs = opcode.loadArgs, storeArgs = opcode.storeArgs, code = opcode.code;\n if (params.length != loadArgs + storeArgs) {\n throw new Error(\"opcode '\" + name + \"' requires \" + (loadArgs + storeArgs) + \" arguments, but you gave me \" + params.length + \": \" + JSON.stringify(params));\n }\n // opcode\n var result;\n if (code >= 0x1000) {\n result = [0xC0, 0x00, code >> 8, code & 0xFF];\n }\n else if (code >= 0x80) {\n code = code + 0x8000;\n result = [code >> 8, code & 0xFF];\n }\n else {\n result = [code];\n }\n // loadArgs signature\n var sig = [];\n var i = 0;\n for (; i < loadArgs; i++) {\n var x = params[i];\n if (typeof (x) === 'number') {\n if (x === 0) {\n sig.push(0 /* zero */);\n continue;\n }\n if (-128 <= x && x <= 127) {\n sig.push(1 /* byte */);\n continue;\n }\n if (-0x10000 <= x && x <= 0xFFFF) {\n sig.push(2 /* int16 */);\n continue;\n }\n if (x > 0xFFFFFFFF || x < -0x100000000) {\n throw new Error(\"immediate load operand \" + x + \" out of signed 32 bit integer range.\");\n }\n sig.push(3 /* int32 */);\n continue;\n }\n if (typeof (x) === 'string') {\n if (x === 'pop') {\n sig.push(8 /* stack */);\n continue;\n }\n if (x.indexOf(\"*\") === 0) {\n parsePtr(x, params, i, sig);\n continue;\n }\n if (x.indexOf(\"Fr:\") === 0) {\n parseLocal(x, params, i, sig);\n continue;\n }\n }\n throw new Error(\"unsupported load argument \" + x + \" for \" + name + \"(\" + JSON.stringify(params) + \")\");\n }\n // storeArg signature\n if (storeArgs) {\n for (; i < loadArgs + storeArgs; i++) {\n var x = params[i];\n if (x === null || x === 0 /* discard */) {\n sig.push(0 /* discard */);\n continue;\n }\n if (typeof (x) === 'number') {\n if (x <= 0xFFFF) {\n sig.push(6 /* ptr_16 */);\n continue;\n }\n }\n if (typeof (x) === 'string') {\n if (x === 'push') {\n sig.push(8 /* stack */);\n continue;\n }\n if (x.indexOf(\"*\") === 0) {\n parsePtr(x, params, i, sig);\n continue;\n }\n if (x.indexOf(\"Fr:\") === 0) {\n parseLocal(x, params, i, sig);\n continue;\n }\n }\n throw new Error(\"unsupported store argument \" + x + \" for \" + name + \"(\" + JSON.stringify(params) + \")\");\n }\n }\n // signature padding\n if (i % 2) {\n sig.push(0);\n }\n for (var j = 0; j < sig.length; j += 2) {\n result.push(sig[j] + (sig[j + 1] << 4));\n }\n for (var j = 0; j < i; j++) {\n var s = sig[j];\n if (s === 0 /* zero */)\n continue;\n if (s === 8 /* stack */)\n continue;\n var x = params[j];\n if (s === 1 /* byte */) {\n result.push(uint8(x));\n continue;\n }\n if (s === 2 /* int16 */) {\n x = uint16(x);\n result.push(x >> 8);\n result.push(x & 0xFF);\n continue;\n }\n if (s === 3 /* int32 */) {\n x = uint32(x);\n result.push(x >> 24);\n result.push((x >> 16) & 0xFF);\n result.push((x >> 8) & 0xFF);\n result.push(x & 0xFF);\n continue;\n }\n if (s === 5 /* ptr_8 */ || s === 13 /* ram_8 */ || s === 9 /* local_8 */) {\n result.push(x);\n continue;\n }\n if (s === 6 /* ptr_16 */ || s === 14 /* ram_16 */) {\n result.push(x >> 8);\n result.push(x & 0xFF);\n continue;\n }\n if (s === 7 /* ptr_32 */ || s === 15 /* ram_32 */) {\n result.push(x >> 24);\n result.push((x >> 16) & 0xFF);\n result.push((x >> 8) & 0xFF);\n result.push(x & 0xFF);\n continue;\n }\n throw new Error(\"unsupported argument \" + x + \" of type \" + s + \" for \" + name + \"(\" + JSON.stringify(params) + \")\");\n }\n return result;\n }", "function defineProxyPropertyWithValue(name, value) {\n\t var _ref = Object.getOwnPropertyDescriptor(current, name) || {};\n\n\t var _ref$enumerable = _ref.enumerable;\n\t var enumerable = _ref$enumerable === undefined ? false : _ref$enumerable;\n\t var _ref$writable = _ref.writable;\n\t var writable = _ref$writable === undefined ? true : _ref$writable;\n\n\n\t defineProxyProperty(name, {\n\t configurable: true,\n\t enumerable: enumerable,\n\t writable: writable,\n\t value: value\n\t });\n\t }", "function defineProxyPropertyWithValue(name, value) {\n\t var _ref = Object.getOwnPropertyDescriptor(current, name) || {};\n\n\t var _ref$enumerable = _ref.enumerable;\n\t var enumerable = _ref$enumerable === undefined ? false : _ref$enumerable;\n\t var _ref$writable = _ref.writable;\n\t var writable = _ref$writable === undefined ? true : _ref$writable;\n\n\n\t defineProxyProperty(name, {\n\t configurable: true,\n\t enumerable: enumerable,\n\t writable: writable,\n\t value: value\n\t });\n\t }", "register (name, handler) {\n this.local.push(name);\n return this.use( this.callback(name, handler) );\n }", "global(name, value) {\n this.GLOBALS[name] = value;\n return this;\n }", "registerApiModule (name, module, meta) {\n registerModuleEventListener(name, module, meta)\n if (!protocol.apiModule[name]) {\n protocol.apiModule[name] = module\n }\n else {\n for (const key in module) {\n if (module.hasOwnProperty(key)) {\n protocol.apiModule[name][key] = module[key]\n }\n }\n }\n // register API module's meta info to jsframework\n if (meta) {\n protocol.setApiModuleMeta(meta)\n global.registerModules(protocol.getApiModuleMeta(name), true)\n }\n }", "registerApiModule (name, module, meta) {\n registerModuleEventListener(name, module, meta)\n if (!protocol.apiModule[name]) {\n protocol.apiModule[name] = module\n }\n else {\n for (const key in module) {\n if (module.hasOwnProperty(key)) {\n protocol.apiModule[name][key] = module[key]\n }\n }\n }\n // register API module's meta info to jsframework\n if (meta) {\n protocol.setApiModuleMeta(meta)\n global.registerModules(protocol.getApiModuleMeta(name), true)\n }\n }", "function Symbol(){ return Literal.apply(this,arguments) }", "addVariable(name, value) {\n // Check if variable is already included\n if (typeof this.varMap[name] !== 'undefined') {\n // Check if value for variable has changed\n if (this.varMap[name].value != value) {\n this.varMap[name].value = value;\n this.listUpdated = true;\n return;\n } \n else {\n this.listUpdated = false;\n return; \n }\n }\n // Else, add new variable and update list\n this.varMap[name] = {value: value};\n this.listUpdated = true;\n }", "function registerHandler(name, instance) {\n externals[name] = instance;\n }", "registerElementValue( uniqueName, value, elementId )\n {\n \tlet m = new Module( 'system' );\n \tm.onExecuted = function( e, d ){}\n \tm.execute( 'appmodule', {\n \t\tappName: 'Courses',\n \t\tcommand: 'regelementvalue',\n \t\tuniqueName: uniqueName,\n \t\telementId: elementId,\n \t\tvalue: value,\n \t\tcourseSessionId: this.#courseSessionId,\n \t\tcourseId: this.course.ID\n \t} );\n \t\n \tthis.checkNavButtons();\n }", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}" ]
[ "0.6065042", "0.5907688", "0.5880901", "0.5671248", "0.55329335", "0.54931086", "0.54931086", "0.54931086", "0.54931086", "0.54931086", "0.54931086", "0.54931086", "0.54393893", "0.5393519", "0.53900003", "0.5375349", "0.5366473", "0.5320763", "0.5289489", "0.52333635", "0.5198783", "0.5163362", "0.51487136", "0.50878817", "0.50814515", "0.5063078", "0.50570935", "0.5043229", "0.5043229", "0.5003465", "0.4990725", "0.49764177", "0.49735668", "0.4971522", "0.4965505", "0.49631193", "0.49631193", "0.49432874", "0.48973975", "0.48781374", "0.48676956", "0.48672265", "0.48607755", "0.48607755", "0.48607755", "0.4847218", "0.4832457", "0.4814737", "0.4801306", "0.48009133", "0.47985747", "0.47917852", "0.4772811", "0.47588295", "0.47523972", "0.47498035", "0.47498035", "0.47498035", "0.47498035", "0.47498035", "0.47498035", "0.47498035", "0.47498035", "0.47310862", "0.4708055", "0.4708055", "0.46977586", "0.46977586", "0.4693638", "0.4691578", "0.46844456", "0.4670692", "0.4670692", "0.46693355", "0.4669326", "0.4664901", "0.4664901", "0.46566746", "0.4650589", "0.4623734", "0.46175307", "0.46169746", "0.46169746", "0.46169746", "0.46169746", "0.46169746", "0.46169746", "0.46169746", "0.46169746", "0.46169746", "0.46169746", "0.46169746", "0.46169746", "0.46169746", "0.46169746", "0.46169746", "0.46169746", "0.46169746", "0.46169746", "0.46169746" ]
0.7113097
0
When converting a number from JS to C++ side, the valid range of the number is [minRange, maxRange], inclusive.
function __embind_register_integer(primitiveType, name, size, minRange, maxRange) { name = readLatin1String(name); if (maxRange === -1) { // LLVM doesn't have signed and unsigned 32-bit types, so u32 literals come out as 'i32 -1'. Always treat those as max u32. maxRange = 4294967295; } var shift = getShiftFromSize(size); registerType(primitiveType, { name: name, 'fromWireType': function(value) { return value; }, 'toWireType': function(destructors, value) { // todo: Here we have an opportunity for -O3 level "unsafe" optimizations: we could // avoid the following two if()s and assume value is of proper type. if (typeof value !== "number" && typeof value !== "boolean") { throw new TypeError('Cannot convert "' + _embind_repr(value) + '" to ' + this.name); } if (value < minRange || value > maxRange) { throw new TypeError('Passing a number "' + _embind_repr(value) + '" from JS side to C/C++ side to an argument of type "' + name + '", which is outside the valid range [' + minRange + ', ' + maxRange + ']!'); } return value | 0; }, 'argPackAdvance': 8, 'readValueFromPointer': integerReadValueFromPointer(name, shift, minRange !== 0), destructorFunction: null, // This type does not need a destructor }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function range(nbr,min,max){if(nbr<min){return min;}else if(nbr>max){return max;}else{return nbr;}}", "function toNumberRange(value, min, max) {\n if (_Type__WEBPACK_IMPORTED_MODULE_0__[\"hasValue\"](value)) {\n value = _Type__WEBPACK_IMPORTED_MODULE_0__[\"toNumber\"](value);\n return fitToRange(value, min, max);\n }\n return value;\n}", "clamp(min, max) {\r\n if (this.data < min) return FNumber(min)\r\n if (this.data > max) return FNumber(max)\r\n\r\n return FNumber(this.data)\r\n }", "require_range(min,max,value, field_name=\"\"){\n\t if (this.is_empty(value) ){ return value; }\n\t var number = this.to_number(value);\n\t if (value < min || value > max) {\n\t throw new Error(`out of range ${value} ${field_name} ${value}`);\n\t }\n\t return value;\n\t }", "static range(type, min, max, inclusive = false) {\n return Argument.validate(type, (msg, p, x) => {\n const o = typeof x === \"number\" || typeof x === \"bigint\" ? x : x.length != null ? x.length : x.size != null ? x.size : x;\n return o >= min && (inclusive ? o <= max : o < max);\n });\n }", "function range(input,min,max) {\n\t\tif(min > max) { var x = min; min = max; max = x;}\n\t\treturn Math.max(Math.min(input,max),min);\n\t}", "function explicitRange(min, max) {\n return tr.b.math.Range.fromExplicitRange(min, max);\n }", "function isValidRange(minNum, maxNum){\n return (minNum < maxNum);\n}", "function __WEBPACK_DEFAULT_EXPORT__(range, min, max) {\n var lo = range[0],\n hi = range[1],\n span;\n\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n span = hi - lo;\n\n return span >= (max - min)\n ? [min, max]\n : [\n (lo = Math.min(Math.max(lo, min), max - span)),\n lo + span\n ];\n}", "function isValidRange(number, maxRange){\n return number < 1 || number > maxRange;\n}", "function fitToRange(value, minValue, maxValue) {\n if (_Type__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"](minValue)) {\n if (_Type__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"](maxValue) && maxValue < minValue) {\n var temp = maxValue;\n maxValue = minValue;\n minValue = temp;\n }\n if (value < minValue) {\n value = minValue;\n }\n }\n if (_Type__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"](maxValue)) {\n if (value > maxValue) {\n value = maxValue;\n }\n }\n return value;\n}", "function checkRangeNumber(min, max, number) {\r\n var resultRange = false;\r\n if(number >= min && number <= max) {\r\n resultRange = true;\r\n }\r\n return resultRange;\r\n}", "function __WEBPACK_DEFAULT_EXPORT__(range, min, max) {\n var lo = range[0],\n hi = range[1],\n span;\n\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n span = hi - lo;\n\n return span >= (max - min)\n ? [min, max]\n : [\n Math.min(Math.max(lo, min), max - span),\n Math.min(Math.max(hi, span), max)\n ];\n}", "clamp(number, lower, upper){\r\n \r\n //capture the lower bound value\r\n let lowerClampedValue = Math.max(number, lower)\r\n let clampedValue = Math.min(lowerClampedValue, upper)\r\n return clampedValue;\r\n }", "function NumberRangeLimt(ctrId,minVal,maxVal){\n//var str =$(\"#\"+ctrId.id).get(0).value.replace(/\\D/g,'');\n\tvar str = ($(\"#\"+ctrId.id).val()).replace(/\\D/g,'')*1;\n\tif(minVal != maxVal)\n\t{\n\t if(str < minVal) {return minVal;}\n\t if(str > maxVal) {return maxVal;}\n\t}\n\treturn str;\n}", "function testRange(v:number, range:Range):boolean {\n const { min, max, intervals:_intervals} = range;\n const intervals = _intervals?_intervals:'[]';\n switch (intervals) {\n case '[]':\n //javascript's ?: treat 0 as false,so must check min!=null\n return ((min!=null)? v>=min :true) && ((max!=null)? v<=max :true);\n // seems the express above could not be resolved by flow.\n // return (min || v>=min) && (max || v<= max);\n case '[)':\n return ((min!=null)? v>=min :true) && ((max!=null)? v<max :true);\n case '(]':\n return ((min!=null)? v>min :true) && ((max!=null)? v<=max :true);\n case '()':\n return ((min!=null)? v>min :true) && ((max!=null)? v<max :true);\n default:\n throw new RunTimeCheckE('The range.intervals must be ' +\n ' [] | [) | (] | () .Please check the passed in' +\n `range: ${ePrint(range)}`);\n }\n}", "function clamp(value, min, max) {\n // TODO: Your code goes here.\n return 1337;\n}", "function clamp(num, min, max) {\n\t return Math.min(Math.max(num, min), max);\n\t}", "function fc(num, lower, upper) {\n let clampNum;\n\n if (num < lower) {\n clampNum = lower;\n }\n else if (num > upper) {\n clampNum = upper;\n }\n else {\n clampNum = num;\n }\n\n return clampNum;\n}", "function clampRange(range, min, max) {\n var lo = range[0],\n hi = range[1],\n span;\n\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n span = hi - lo;\n\n return span >= (max - min)\n ? [min, max]\n : [\n (lo = Math.min(Math.max(lo, min), max - span)),\n lo + span\n ];\n }", "clamp(number, lower, upper){\n let lowerClampedValue = Math.max(number, lower);\n let clampedValue = Math.min(lowerClampedValue, upper);\n return clampedValue;\n }", "function restrictToRange(val,min,max) {\n\t\tif (val < min) return min;\n\t\tif (val > max) return max;\n\t\treturn val;\n\t}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number';\n // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n }\n // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n if (!key) {\n return false;\n }\n if (arr) {\n val = value.length;\n }\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n if (len) {\n if (val !== rule.len) {\n errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function limit(lower, upper) {\n\tif (lower < 0 || upper <= 0 || upper < lower) {\n\t\tthrow new TypeError();\n\t}\n\treturn \"{\" + lower + \",\" + upper + \"}\";\n}", "function clamp(number, lowerBound, upperBound) {\n return Math.max(lowerBound, Math.min(number, upperBound));\n}", "function rangeFunc() {\n let rangeNum = Math.max(num1, num2, num3) - Math.min(num1, num2, num3);\n console.log(\"RANGE: \" + rangeNum);\n results[4].textContent = \"Range: \" + rangeNum;\n}", "static clamp(value: number, min: number, max: number): number {\n if (max < min) {\n throw new Error(`max of ${max} is less than min ${min} (with value of ${value})`);\n }\n if (value < min) {\n value = min;\n }\n if (value > max) {\n value = max;\n }\n return value;\n }", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number';\n // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n }\n // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n if (!key) {\n return false;\n }\n if (arr) {\n val = value.length;\n }\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n if (len) {\n if (val !== rule.len) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number';\n // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n }\n // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n if (!key) {\n return false;\n }\n if (arr) {\n val = value.length;\n }\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n if (len) {\n if (val !== rule.len) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number';\n // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n }\n // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n if (!key) {\n return false;\n }\n if (arr) {\n val = value.length;\n }\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n if (len) {\n if (val !== rule.len) {\n errors.push(util.format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(util.format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(util.format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(util.format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number';\n // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n }\n // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n if (!key) {\n return false;\n }\n if (arr) {\n val = value.length;\n }\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n if (len) {\n if (val !== rule.len) {\n errors.push(util.format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(util.format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(util.format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(util.format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number';\n // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n }\n // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n if (!key) {\n return false;\n }\n if (arr) {\n val = value.length;\n }\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n if (len) {\n if (val !== rule.len) {\n errors.push(util.format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(util.format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(util.format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(util.format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "_validateRange(numberToValidate) {\n const that = this;\n numberToValidate = that._numericProcessor.validate(numberToValidate, that._minObject, that._maxObject);\n return numberToValidate;\n }", "static range(min, max){\n\n let l = [];\n for(let i=min; i < max; i++) l.push(i);\n return l;\n\n }", "static range(min, max){\n \n let l = [];\n for(let i=min; i < max; i++) l.push(i);\n return l;\n \n }", "function clamp( num, min, max ) {\n return num < min ? min : num > max ? max : num\n}", "inRange (number, start, end){\r\n // if end is undefined, start = 0 and end = start, then check if in range\r\n if (typeof end === 'undefined'){\r\n end = start;\r\n start = 0;\r\n } else if ( start > end ){\r\n // swap the two values around\r\n let temp = start;\r\n start = end;\r\n end = temp;\r\n }\r\n if ((number > start) && (number < end)){\r\n return true;\r\n }\r\n else\r\n return false;\r\n }", "function setRangeValue(min, max) {\n minNumRange.value = min;\n maxNumRange.value = max;\n}", "function rangeCheck(input, min, max) {\r\n return ((input > min) && (input < max));\r\n}", "function checkRange(number, obj) {\n return (number >= obj.min && number <= obj.max);\n}", "function checkRange (min, max, number) {\r\n var result = false;\r\n if (number >= min && number <= max) {\r\n result = true;\r\n }\r\n return result;\r\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number';\n // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n }\n // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n if (!key) {\n return false;\n }\n if (arr) {\n val = value.length;\n }\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n if (len) {\n if (val !== rule.len) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"format\"](options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"format\"](options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"format\"](options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"format\"](options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(\n format(options.messages[key].range, rule.fullField, rule.min, rule.max),\n );\n }\n}", "function clampBetween(value, lowerBound, upperBound) {\n let result;\n if ( value >= lowerBound && value <= upperBound) {\n result = value;\n } else if (value < lowerBound) {\n result = lowerBound;\n } else if ( value > upperBound) {\n result = upperBound;\n }\n return result;\n}", "function intValidateWithRange(value, min, max) {\n\tif (value == '' || value == null) return 4;\n\tif (RegExValidate('^(-|)[0-9]*$', value, 'i')) {\n\t\ttry { var pint = parseInt(value); } catch (ex) { return 1; }\n\t\tif (pint < min) return 3; else if (pint > max) return 2; return 0;\n\t} else\n\t\treturn 1;\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(format$1(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format$1(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format$1(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(format$1(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "isInBounds(value, minExclusive = false, maxExclusive = false) { \n\t\tif (!FormatUtils.isNumber(value) && !FormatUtils.canBeNumber(value)) \n\t\t\treturn false;\n\n\t\tvalue = Number(value);\n\t\tlet aboveMin = minExclusive ? value > this.#min : value >= this.#min;\n\t\tlet belowMax = maxExclusive ? value < this.#max : value <= this.#max;\n\n\t\treturn aboveMin && belowMax;\n\t}", "function clampValueBetween(value, min, max) {\n return Math.min(Math.max(value, min), max);\n }", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number';\n // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n }\n // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n if (!key) {\n return false;\n }\n if (arr) {\n val = value.length;\n }\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n if (len) {\n if (val !== rule.len) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number';\n // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n }\n // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n if (!key) {\n return false;\n }\n if (arr) {\n val = value.length;\n }\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n if (len) {\n if (val !== rule.len) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number';\n // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n }\n // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n if (!key) {\n return false;\n }\n if (arr) {\n val = value.length;\n }\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n if (len) {\n if (val !== rule.len) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(\n format(options.messages[key].len, rule.fullField, rule.len),\n );\n }\n } else if (min && !max && val < rule.min) {\n errors.push(\n format(options.messages[key].min, rule.fullField, rule.min),\n );\n } else if (max && !min && val > rule.max) {\n errors.push(\n format(options.messages[key].max, rule.fullField, rule.max),\n );\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(\n format(\n options.messages[key].range,\n rule.fullField,\n rule.min,\n rule.max,\n ),\n );\n }\n }", "function range(rule,value,source,errors,options){var len=typeof rule.len==='number';var min=typeof rule.min==='number';var max=typeof rule.max==='number';var val=value;var key=null;var num=typeof value==='number';var str=typeof value==='string';var arr=Array.isArray(value);if(num){key='number';}else if(str){key='string';}else if(arr){key='array';}// if the value is not of a supported type for range validation\n// the validation rule rule should use the\n// type property to also test for a particular type\nif(!key){return false;}if(str||arr){val=value.length;}if(len){if(val!==rule.len){errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\"/* format */](options.messages[key].len,rule.fullField,rule.len));}}else if(min&&!max&&val<rule.min){errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\"/* format */](options.messages[key].min,rule.fullField,rule.min));}else if(max&&!min&&val>rule.max){errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\"/* format */](options.messages[key].max,rule.fullField,rule.max));}else if(min&&max&&(val<rule.min||val>rule.max)){errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\"/* format */](options.messages[key].range,rule.fullField,rule.min,rule.max));}}", "function range(rule, value, source, errors, options) {\n\t var len = typeof rule.len === 'number';\n\t var min = typeof rule.min === 'number';\n\t var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\t\n\t var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n\t var val = value;\n\t var key = null;\n\t var num = typeof value === 'number';\n\t var str = typeof value === 'string';\n\t var arr = Array.isArray(value);\n\t\n\t if (num) {\n\t key = 'number';\n\t } else if (str) {\n\t key = 'string';\n\t } else if (arr) {\n\t key = 'array';\n\t } // if the value is not of a supported type for range validation\n\t // the validation rule rule should use the\n\t // type property to also test for a particular type\n\t\n\t\n\t if (!key) {\n\t return false;\n\t }\n\t\n\t if (arr) {\n\t val = value.length;\n\t }\n\t\n\t if (str) {\n\t // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n\t val = value.replace(spRegexp, '_').length;\n\t }\n\t\n\t if (len) {\n\t if (val !== rule.len) {\n\t errors.push(format(options.messages[key].len, rule.fullField, rule.len));\n\t }\n\t } else if (min && !max && val < rule.min) {\n\t errors.push(format(options.messages[key].min, rule.fullField, rule.min));\n\t } else if (max && !min && val > rule.max) {\n\t errors.push(format(options.messages[key].max, rule.fullField, rule.max));\n\t } else if (min && max && (val < rule.min || val > rule.max)) {\n\t errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n\t }\n\t}", "function range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(util.format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(util.format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(util.format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(util.format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "range(min, max) {\n if (max < min) { return []; }\n let arr = [];\n\n for (let i = min; i <= max; i++) {\n arr.push(i);\n }\n\n return arr;\n }", "clamp(number, lower, upper) {\n const lowerClampedValue = Math.max(number, lower);\n const clampedValue = Math.min(lowerClampedValue, upper);\n return clampedValue;\n }", "function range_range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n } // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n\n\n if (!key) {\n return false;\n }\n\n if (arr) {\n val = value.length;\n }\n\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n\n if (len) {\n if (val !== rule.len) {\n errors.push(util_format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(util_format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(util_format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(util_format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}", "function clamp(num, min, max) {\n return num < min ? min : num > max ? max : num;\n}", "function clamp( val, min, max ) { //takes a min and max and makes sure the number is in the middle\n return Math.min( Math.max( min, val ), max );\n }", "function locRange(min, max) {\n let buffer = Math.ceil((max - min) / 10) \n const values = [min]\n for (let i = 1; i < 11; i++) {\n values[i] = values[i - 1] + buffer\n }\n return values\n}", "function inRange(min, number, max){\n\t\t\t\t\treturn number >= min && number <= max;\n\t\t\t\t}", "function between(value, min, max) {\n return Math.max(min, Math.min(value, max));\n }", "function clamp(num, min, max) {\n return Math.min(Math.max(num, min), max);\n}", "function constrain(value, min, max) {\n return Math.min(Math.max(value, min), max);\n}", "function minRange (num , range){\n\n\tif(num >= (range/2)){\n\t\n\t\treturn (num - (range/2));\n\t}else {\t\t\n\t\treturn 0;\n\t}\n}", "clamp (number, lower, upper) {\n const lowerClampedValue = Math.max(number, lower);\n const clampedValue = Math.min(lowerClampedValue, upper);\n return clampedValue;\n }", "function checkRange(param,min,max){\n\tif(param>=min && param <= max ){\n\t\n\treturn true;\n\t\n }else{\n\t\talert('Invalid value: '+param );\n }\t\n\n}", "function between(val, min, max) {\n\t\treturn Math.min(Math.max(min, val), max);\n\t}", "function between(min, max, num) {\n return (num >= min && num <= max);\n}", "function clamp(a,min,max)\r\n{return Math.min(Math.max(a,min),max);}", "function clamp(value, min, max) {\n if (isNaN(value) || isNaN(min) || isNaN(max)) return false;\n if (min > value) return min;\n if (max < value) return max;\n return value;\n }", "function NumericRange(min, max) {\n if (max === void 0) { max = null; }\n if (typeof min == \"number\" && (!isNullOrUndefined(max))) {\n this.min = min;\n this.max = max;\n }\n else {\n var range = min;\n this.min = range.min;\n this.max = range.max;\n }\n }", "function is_in_range(str_val, min, max)\n{\n\tvar d = decstr2int(str_val);\n\tif ( d > max || d < min ) return false;\n\treturn true;\n}", "function checkRange(value, lowerBounds, upperBounds) {\n if (value >= lowerBounds && value <= upperBounds) {\n return value;\n }\n else {\n return !value;\n }\n}", "function checkRange(value, lowerBounds, upperBounds) {\n if (value >= lowerBounds && value <= upperBounds) {\n return value;\n }\n else {\n return !value;\n }\n}", "function checkRange(value, lowerBounds, upperBounds) {\n if (value >= lowerBounds && value <= upperBounds) {\n return value;\n } else {\n return !value;\n }\n}", "function checkRange(value, lowerBounds, upperBounds) {\n if (value >= lowerBounds && value <= upperBounds) {\n return value;\n } else {\n return !value;\n }\n}", "function clampValue(min, n, max) {\n return Math.min(Math.max(min, n), max);\n}", "function clampValue(min, n, max) {\n return Math.min(Math.max(min, n), max);\n}", "function clamp(min, n, max) {\n\t return Math.max(min, Math.min(n, max));\n\t}", "function __WFU_ApplyValidator_Range(object, min, max) {\r\n object[\"range\"] = [min, max];\r\n}", "function clamped(num) {\n if (field.minValue !== undefined) {\n num = Math.max(num, field.minValue);\n }\n if (field.maxValue !== undefined) {\n num = Math.min(num, field.maxValue);\n }\n return num;\n }", "function validateIntegerRange(val, minVal, maxVal) {\n if (!validateInteger(val))\n return false;\n return ((val >= minVal) && (val <= maxVal));\n}", "function clamp(value, min, max) {\n \treturn Math.min(Math.max(value, min), max);\n}", "inRange(num, endNum, startNum = 0) {\n [endNum, startNum] = [startNum, endNum];\n if (startNum > endNum) {\n [startNum, endNum] = [endNum, startNum];\n }\n return num >= startNum && num < endNum;\n }", "function clamp(val, min, max){\n\t return val < min ? min : (val > max ? max : val);\n }", "validateColorRange(value) {\n const that = this.context;\n\n if (that._wordLengthNumber < 64) {\n return super.validateColorRange(value);\n }\n\n if (that.mode === 'numeric') {\n value = new JQX.Utilities.BigNumber(value);\n }\n else {\n value = JQX.Utilities.DateTime.validateDate(value);\n value = value.getTimeStamp();\n }\n\n const bigMin = new JQX.Utilities.BigNumber(that.min),\n bigMax = new JQX.Utilities.BigNumber(that.max);\n\n if (value.compare(bigMin) === -1) {\n value = bigMin;\n }\n\n if (value.compare(bigMax) === 1) {\n value = bigMax;\n }\n\n return value;\n }" ]
[ "0.71254426", "0.70027244", "0.67878395", "0.6767743", "0.67281413", "0.6708403", "0.6698865", "0.6691565", "0.6678553", "0.66698563", "0.66376096", "0.6606054", "0.6592495", "0.6564608", "0.6548371", "0.64950234", "0.6488208", "0.6485397", "0.648301", "0.64829844", "0.64804107", "0.6458583", "0.64474034", "0.64435697", "0.64421666", "0.6430839", "0.6429747", "0.64270896", "0.64270896", "0.6425464", "0.6425464", "0.6425464", "0.6406987", "0.64032274", "0.64027303", "0.64013046", "0.63963014", "0.63951176", "0.6394745", "0.6382436", "0.637842", "0.6374166", "0.6371733", "0.6363899", "0.6358334", "0.6357704", "0.63556844", "0.63556844", "0.63556844", "0.63556844", "0.63556844", "0.63556844", "0.63556844", "0.63556844", "0.63556844", "0.63556844", "0.63556844", "0.63556844", "0.63556844", "0.6354518", "0.63514537", "0.63467085", "0.63467085", "0.63467085", "0.63427687", "0.633777", "0.63325024", "0.63299704", "0.6329821", "0.63288444", "0.6322006", "0.632144", "0.6311694", "0.6305675", "0.62982374", "0.6295475", "0.62943214", "0.6285556", "0.6282468", "0.6267084", "0.62599975", "0.6258526", "0.6255179", "0.62445486", "0.62287456", "0.622431", "0.6215504", "0.6215256", "0.6215256", "0.6204637", "0.6204637", "0.61948764", "0.61948764", "0.61946595", "0.6188724", "0.6182604", "0.6180517", "0.6179988", "0.61738765", "0.61720836", "0.6170325" ]
0.0
-1
For types whose wire types are 32bit pointers.
function simpleReadValueFromPointer(pointer) { return this['fromWireType'](HEAPU32[pointer >> 2]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function opaqueAllTypesClz32(argument) {\n return Math.clz32(argument);\n}", "function h$writePtrPtrU32(ptr, ptr_off, v, x, y) {\n x = x || 0;\n y = y || 0;\n var arr = ptr.arr[ptr_off + 4 * x];\n arr[0].dv.setInt32(arr[1] + y, v);\n}", "function h$writePtrPtrU32(ptr, ptr_off, v, x, y) {\n x = x || 0;\n y = y || 0;\n var arr = ptr.arr[ptr_off + 4 * x];\n arr[0].dv.setInt32(arr[1] + y, v);\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[((ptr)>>0)]=value; break;\n case 'i8': HEAP8[((ptr)>>0)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? ((Math_min((+(Math_floor((tempDouble)/4294967296.0))), 4294967295.0))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[((ptr)>>0)]=value; break;\n case 'i8': HEAP8[((ptr)>>0)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function h$writePtrPtrU32(ptr, ptr_off, v, x, y) {\n x = x || 0;\n y = y || 0;\n var arr = ptr.arr[ptr_off + 4 * x];\n arr[0].dv.putInt32(arr[1] + y, v);\n}", "function h$writePtrPtrU32(ptr, ptr_off, v, x, y) {\n x = x || 0;\n y = y || 0;\n var arr = ptr.arr[ptr_off + 4 * x];\n arr[0].dv.putInt32(arr[1] + y, v);\n}", "appendPointer(n) {\n this.appendUint32(n);\n }", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math.abs(tempDouble))) >= (+(1)) ? (tempDouble > (+(0)) ? ((Math.min((+(Math.floor((tempDouble)/(+(4294967296))))), (+(4294967295))))|0)>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+(4294967296)))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function oflw32(n) {\n return n & 4294967295;\n }", "function int_64(msint_32, lsint_32)\n\t{\n\t\tthis.highOrder = msint_32;\n\t\tthis.lowOrder = lsint_32;\n\t}", "function sumOutType(type) {\n return upcastType(type, 'int32');\n}", "function sumOutType(type) {\n return upcastType(type, 'int32');\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? ((Math_min((+(Math_floor((tempDouble)/4294967296.0))), 4294967295.0))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? ((Math_min((+(Math_floor((tempDouble)/4294967296.0))), 4294967295.0))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? ((Math_min((+(Math_floor((tempDouble)/4294967296.0))), 4294967295.0))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/(+(4294967296))), (+(4294967295)))>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (HEAPF64[(tempDoublePtr)>>3]=value,HEAP32[((ptr)>>2)]=((HEAP32[((tempDoublePtr)>>2)])|0),HEAP32[(((ptr)+(4))>>2)]=((HEAP32[(((tempDoublePtr)+(4))>>2)])|0)); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/(+(4294967296))), (+(4294967295)))>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (HEAPF64[(tempDoublePtr)>>3]=value,HEAP32[((ptr)>>2)]=((HEAP32[((tempDoublePtr)>>2)])|0),HEAP32[(((ptr)+(4))>>2)]=((HEAP32[(((tempDoublePtr)+(4))>>2)])|0)); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/(+(4294967296))), (+(4294967295)))>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (HEAPF64[(tempDoublePtr)>>3]=value,HEAP32[((ptr)>>2)]=((HEAP32[((tempDoublePtr)>>2)])|0),HEAP32[(((ptr)+(4))>>2)]=((HEAP32[(((tempDoublePtr)+(4))>>2)])|0)); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/4294967296), 4294967295)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (HEAPF64[(tempDoublePtr)>>3]=value,HEAP32[((ptr)>>2)]=HEAP32[((tempDoublePtr)>>2)],HEAP32[(((ptr)+(4))>>2)]=HEAP32[(((tempDoublePtr)+(4))>>2)]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/4294967296), 4294967295)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (HEAPF64[(tempDoublePtr)>>3]=value,HEAP32[((ptr)>>2)]=HEAP32[((tempDoublePtr)>>2)],HEAP32[(((ptr)+(4))>>2)]=HEAP32[(((tempDoublePtr)+(4))>>2)]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/4294967296), 4294967295)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (HEAPF64[(tempDoublePtr)>>3]=value,HEAP32[((ptr)>>2)]=HEAP32[((tempDoublePtr)>>2)],HEAP32[(((ptr)+(4))>>2)]=HEAP32[(((tempDoublePtr)+(4))>>2)]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type[type.length-1] === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': HEAP32[((ptr)>>2)]=value; break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (tempDoubleF64[0]=value,HEAP32[((ptr)>>2)]=tempDoubleI32[0],HEAP32[(((ptr)+(4))>>2)]=tempDoubleI32[1]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type[type.length-1] === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': HEAP32[((ptr)>>2)]=value; break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (tempDoubleF64[0]=value,HEAP32[((ptr)>>2)]=tempDoubleI32[0],HEAP32[(((ptr)+(4))>>2)]=tempDoubleI32[1]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type[type.length-1] === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': HEAP32[((ptr)>>2)]=value; break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (tempDoubleF64[0]=value,HEAP32[((ptr)>>2)]=tempDoubleI32[0],HEAP32[(((ptr)+(4))>>2)]=tempDoubleI32[1]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble)/(+4294967296)))), (+4294967295)))|0)>>>0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/(+4294967296))))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,Math.min(Math.floor((value)/4294967296), 4294967295)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': (HEAPF64[tempDoublePtr>>3]=value,HEAP32[((ptr)>>2)]=HEAP32[tempDoublePtr>>2],HEAP32[(((ptr)+(4))>>2)]=HEAP32[tempDoublePtr+4>>2]); break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,((Math.min((+(Math.floor((value)/(+(4294967296))))), (+(4294967295))))|0)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,((Math.min((+(Math.floor((value)/(+(4294967296))))), (+(4294967295))))|0)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,((Math.min((+(Math.floor((value)/(+(4294967296))))), (+(4294967295))))|0)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,((Math.min((+(Math.floor((value)/(+(4294967296))))), (+(4294967295))))|0)>>>0],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,Math_abs(tempDouble) >= 1 ? (tempDouble > 0 ? Math_min(Math_floor((tempDouble)/4294967296), 4294967295)>>>0 : (~~(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296)))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,Math_abs(tempDouble) >= 1 ? (tempDouble > 0 ? Math_min(Math_floor((tempDouble)/4294967296), 4294967295)>>>0 : (~~(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296)))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit\n switch(type) {\n case 'i1': HEAP8[(ptr)]=value; break;\n case 'i8': HEAP8[(ptr)]=value; break;\n case 'i16': HEAP16[((ptr)>>1)]=value; break;\n case 'i32': HEAP32[((ptr)>>2)]=value; break;\n case 'i64': (tempI64 = [value>>>0,(tempDouble=value,Math_abs(tempDouble) >= 1 ? (tempDouble > 0 ? Math_min(Math_floor((tempDouble)/4294967296), 4294967295)>>>0 : (~~(Math_ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296)))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;\n case 'float': HEAPF32[((ptr)>>2)]=value; break;\n case 'double': HEAPF64[((ptr)>>3)]=value; break;\n default: abort('invalid type for setValue: ' + type);\n }\n}", "function h$readPtrPtrU32(ptr, ptr_off, x, y) {\n x = x || 0;\n y = y || 0;\n var arr = ptr.arr[ptr_off + 4 * x];\n return arr[0].dv.getInt32(arr[1] + 4 * y, true);\n}", "function h$readPtrPtrU32(ptr, ptr_off, x, y) {\n x = x || 0;\n y = y || 0;\n var arr = ptr.arr[ptr_off + 4 * x];\n return arr[0].dv.getInt32(arr[1] + 4 * y, true);\n}", "function h$readPtrPtrU32(ptr, ptr_off, x, y) {\n x = x || 0;\n y = y || 0;\n var arr = ptr.arr[ptr_off + 4 * x];\n return arr[0].dv.getInt32(arr[1] + 4 * y, true);\n}", "function h$readPtrPtrU32(ptr, ptr_off, x, y) {\n x = x || 0;\n y = y || 0;\n var arr = ptr.arr[ptr_off + 4 * x];\n return arr[0].dv.getInt32(arr[1] + 4 * y, true);\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length - 1) === '*') type = 'i32'; // pointers are 32-bit\n switch (type) {\n case 'i1':\n HEAP8[(ptr)] = value;\n break;\n case 'i8':\n HEAP8[(ptr)] = value;\n break;\n case 'i16':\n HEAP16[((ptr) >> 1)] = value;\n break;\n case 'i32':\n HEAP32[((ptr) >> 2)] = value;\n break;\n case 'i64':\n (tempI64 = [value >>> 0, (tempDouble = value, (+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble) / (+4294967296)))), (+4294967295))) | 0) >>> 0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble))) >>> 0)) / (+4294967296)))))) >>> 0) : 0)], HEAP32[((ptr) >> 2)] = tempI64[0], HEAP32[(((ptr) + (4)) >> 2)] = tempI64[1]);\n break;\n case 'float':\n HEAPF32[((ptr) >> 2)] = value;\n break;\n case 'double':\n HEAPF64[((ptr) >> 3)] = value;\n break;\n default:\n abort('invalid type for setValue: ' + type);\n }\n}", "_dtype(addr) { return (addr > 0xFFFFFF) ? 3 : (addr > 0xFFFF) ? 2 : 1; }", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length - 1) === '*') type = 'i32'; // pointers are 32-bit\n switch (type) {\n case 'i1':\n HEAP8[(ptr)] = value;\n break;\n case 'i8':\n HEAP8[(ptr)] = value;\n break;\n case 'i16':\n HEAP16[((ptr) >> 1)] = value;\n break;\n case 'i32':\n HEAP32[((ptr) >> 2)] = value;\n break;\n case 'i64':\n (tempI64 = [value >>> 0, (tempDouble = value, (+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble) / (+4294967296)))), (+4294967295))) | 0) >>> 0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble))) >>> 0)) / (+4294967296)))))) >>> 0) : 0)], HEAP32[((ptr) >> 2)] = tempI64[0], HEAP32[(((ptr) + (4)) >> 2)] = tempI64[1]);\n break;\n case 'float':\n HEAPF32[((ptr) >> 2)] = value;\n break;\n case 'double':\n HEAPF64[((ptr) >> 3)] = value;\n break;\n default:\n abort('invalid type for setValue: ' + type);\n }\n}", "function setValue(ptr, value, type, noSafe) {\n type = type || 'i8';\n if (type.charAt(type.length - 1) === '*') type = 'i32'; // pointers are 32-bit\n switch (type) {\n case 'i1':\n HEAP8[(ptr)] = value;\n break;\n case 'i8':\n HEAP8[(ptr)] = value;\n break;\n case 'i16':\n HEAP16[((ptr) >> 1)] = value;\n break;\n case 'i32':\n HEAP32[((ptr) >> 2)] = value;\n break;\n case 'i64':\n (tempI64 = [value >>> 0, (tempDouble = value, (+(Math_abs(tempDouble))) >= (+1) ? (tempDouble > (+0) ? ((Math_min((+(Math_floor((tempDouble) / (+4294967296)))), (+4294967295))) | 0) >>> 0 : (~~((+(Math_ceil((tempDouble - +(((~~(tempDouble))) >>> 0)) / (+4294967296)))))) >>> 0) : 0)], HEAP32[((ptr) >> 2)] = tempI64[0], HEAP32[(((ptr) + (4)) >> 2)] = tempI64[1]);\n break;\n case 'float':\n HEAPF32[((ptr) >> 2)] = value;\n break;\n case 'double':\n HEAPF64[((ptr) >> 3)] = value;\n break;\n default:\n abort('invalid type for setValue: ' + type);\n }\n }", "function read32Bit(ba, o) {\n var a = ba[o];\n var b = ba[o+1];\n var c = ba[o+2];\n var d = ba[o+3];\n var r = (a | ((b << 8) >>> 0) | ((c << 16) >>> 0) | ((d << 24) >>> 0)) >>> 0;\n return r;\n }", "function smi(i32){return i32>>>1&0x40000000|i32&0xBFFFFFFF;}", "function smi(i32){return i32>>>1&0x40000000|i32&0xBFFFFFFF;}", "function smi(i32){return i32>>>1&0x40000000|i32&0xBFFFFFFF;}", "function convert32_to_8bit(){\n\n}", "function smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xbfffffff;\n}", "function smi(i32) {\n\t\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t\t }", "function smi(i32) {\n\t\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t\t }", "function smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xBFFFFFFF;\n }", "function o30(o31, o32) { try {\no31.__proto__ = o32;\n}catch(e){} }", "function smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xBFFFFFFF;\n }", "function smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xBFFFFFFF;\n }", "function smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xBFFFFFFF;\n }", "function smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xBFFFFFFF;\n }", "function isBin32Compatible(testVal){\n\t\t// if the test value is not an object - return false\n\t\tif(typeof testVal != 'object'){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// if the test object does not define a function .asBinaryString - return false\n\t\tif(typeof testVal.asBinaryString != 'function'){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// if we got here all is well, so return true\n\t\treturn true;\n\t}", "function gen_op_neon_paddl_s32()\n{\n gen_opc_ptr.push({func:op_neon_paddl_s32});\n}", "function wgint32(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val - (val & 0x00ffffff)) / Math.pow(2, 24);\n\t\tbuffer[offset+1] = (val >>> 16) & 0xff;\n\t\tbuffer[offset+2] = (val >>> 8) & 0xff;\n\t\tbuffer[offset+3] = val & 0xff;\n\t} else {\n\t\tbuffer[offset+3] = (val - (val & 0x00ffffff)) /\n\t\t Math.pow(2, 24);\n\t\tbuffer[offset+2] = (val >>> 16) & 0xff;\n\t\tbuffer[offset+1] = (val >>> 8) & 0xff;\n\t\tbuffer[offset] = val & 0xff;\n\t}\n}", "function wgint32(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val - (val & 0x00ffffff)) / Math.pow(2, 24);\n\t\tbuffer[offset+1] = (val >>> 16) & 0xff;\n\t\tbuffer[offset+2] = (val >>> 8) & 0xff;\n\t\tbuffer[offset+3] = val & 0xff;\n\t} else {\n\t\tbuffer[offset+3] = (val - (val & 0x00ffffff)) /\n\t\t Math.pow(2, 24);\n\t\tbuffer[offset+2] = (val >>> 16) & 0xff;\n\t\tbuffer[offset+1] = (val >>> 8) & 0xff;\n\t\tbuffer[offset] = val & 0xff;\n\t}\n}", "function isLittleEndian(){var buffer8=new Uint8Array(2);buffer8[0]=1;var buffer16=new Uint16Array(buffer8.buffer);return buffer16[0]===1;}", "function gen_op_neon_widen_s32()\n{\n gen_opc_ptr.push({func:op_neon_widen_s32});\n}", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t }", "function smi(i32) {\n return ((i32 >>> 1) & 0x40000000) | (i32 & 0xbfffffff);\n}", "function smi(i32) {\n return ((i32 >>> 1) & 0x40000000) | (i32 & 0xbfffffff);\n}", "function smi(i32) {\n return ((i32 >>> 1) & 0x40000000) | (i32 & 0xbfffffff);\n}", "function smi(i32) {\n return ((i32 >>> 1) & 0x40000000) | (i32 & 0xbfffffff);\n}" ]
[ "0.5872316", "0.56684864", "0.56684864", "0.5611329", "0.55908304", "0.5585153", "0.5585153", "0.55539465", "0.55525124", "0.5545535", "0.5541986", "0.55259025", "0.55259025", "0.55216694", "0.55216694", "0.55216694", "0.5520601", "0.5520601", "0.5520601", "0.5509527", "0.5509527", "0.5509527", "0.5509315", "0.5509315", "0.5509315", "0.5502891", "0.5502891", "0.5502891", "0.5502891", "0.5502891", "0.5502891", "0.5502891", "0.5502891", "0.5502891", "0.5502891", "0.5502891", "0.5502891", "0.5498597", "0.5495056", "0.5495056", "0.5495056", "0.5495056", "0.5492995", "0.5492995", "0.5492995", "0.5482973", "0.5482973", "0.5482973", "0.5482973", "0.54704356", "0.54551417", "0.54302156", "0.54246926", "0.539851", "0.538168", "0.538168", "0.538168", "0.5339298", "0.5305658", "0.5304729", "0.5304729", "0.5291423", "0.5278409", "0.52725494", "0.52725494", "0.52725494", "0.52725494", "0.52514833", "0.52499133", "0.5247625", "0.5247625", "0.5217649", "0.5187939", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5187461", "0.5181015", "0.5181015", "0.5181015", "0.5181015" ]
0.559178
4
Function implementation of operator new, per 13.2.2 ES3
function new_(constructor, argumentList) { if (!(constructor instanceof Function)) { throw new TypeError('new_ called with constructor type ' + typeof(constructor) + " which is not a function"); } /* * Previously, the following line was just: function dummy() {}; * Unfortunately, Chrome was preserving 'dummy' as the object's name, even though at creation, the 'dummy' has the * correct constructor name. Thus, objects created with IMVU.new would show up in the debugger as 'dummy', which * isn't very helpful. Using IMVU.createNamedFunction addresses the issue. Doublely-unfortunately, there's no way * to write a test for this behavior. -NRD 2013.02.22 */ var dummy = createNamedFunction(constructor.name, function(){}); dummy.prototype = constructor.prototype; var obj = new dummy; var r = constructor.apply(obj, argumentList); return (r instanceof Object) ? r : obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newOperator(constructor, ...params){\n const result = {}\n Object.setPrototypeOf(result, Person.prototype)\n constructor.apply(result, params)\n return result\n}", "function myNew(func, ...arg) {\n let obj = {};\n obj.__proto__ = func.prototype;\n let res = func.apply(obj, arg);\n return res instanceof Object? res: obj;\n}", "function hzNew(callee) {\n\t\tconst seqExp = hzCall(callee);\n\t\tseqExp.expressions[0].argument.callee.property.name = \"new\";\n\t\treturn seqExp;\n\t}", "function mynew(fn,args){\n var obj =new Object()\n obj.__proto__ = fn.prototype\n var result = fn.apply(obj)\n return typeof result =='Object'?reslut:obj\n}", "function new2() {\n const constructor = arguments[0];\n const args = [].slice.call(arguments, 1);\n const obj = new Object();\n obj.__proto__ = constructor.prototype;\n const ret = constructor.apply(obj, [...args]);\n if (ret && (typeof ret === 'object' || typeof ret === 'function')) {\n return ret;\n }\n return obj;\n}", "function test_operators_create() {\n class Vec2 {\n constructor(x, y) {\n this.x = x;\n this.y = y;\n }\n static mul_scalar(p1, a) {\n var r = new Vec2();\n r.x = p1.x * a;\n r.y = p1.y * a;\n return r;\n }\n toString() {\n return 'Vec2(' + this.x + ',' + this.y + ')';\n }\n }\n\n Vec2.prototype[Symbol.operatorSet] = Operators.create(\n {\n '+'(p1, p2) {\n var r = new Vec2();\n r.x = p1.x + p2.x;\n r.y = p1.y + p2.y;\n return r;\n },\n '-'(p1, p2) {\n var r = new Vec2();\n r.x = p1.x - p2.x;\n r.y = p1.y - p2.y;\n return r;\n },\n '=='(a, b) {\n return a.x == b.x && a.y == b.y;\n },\n '<'(a, b) {\n var r;\n /* lexicographic order */\n if(a.x == b.x) r = a.y < b.y;\n else r = a.x < b.x;\n return r;\n },\n '++'(a) {\n var r = new Vec2();\n r.x = a.x + 1;\n r.y = a.y + 1;\n return r;\n },\n '--'(a) {\n var r = new Vec2();\n r.x = a.x - 1;\n r.y = a.y - 1;\n return r;\n },\n '^'(p1, p2) {\n var r = Math.sqrt((p1.x - p2.x) ** 2 + (p1.y - p2.y) ** 2);\n return r;\n }\n },\n {\n left: Number,\n '*'(a, b) {\n return Vec2.mul_scalar(b, a);\n }\n },\n {\n right: Number,\n '*'(a, b) {\n return Vec2.mul_scalar(a, b);\n }\n }\n );\n\n var a = new Vec2(10, 5);\n var b = new Vec2(110, 105);\n var r;\n\n console.log(`a * 2 + 3 * b = `, (r = a * 2 + 3 * b));\n console.log(`b - a = `, b - a);\n console.log(`b ^ a = `, b ^ a);\n a++;\n r = ++a;\n}", "function parseNewExpression() {\n\t var callee, args, node = new Node();\n\n\t expectKeyword('new');\n\n\t if (match('.')) {\n\t lex();\n\t if (lookahead.type === Token.Identifier && lookahead.value === 'target') {\n\t if (state.inFunctionBody) {\n\t lex();\n\t return node.finishMetaProperty('new', 'target');\n\t }\n\t }\n\t throwUnexpectedToken(lookahead);\n\t }\n\n\t callee = isolateCoverGrammar(parseLeftHandSideExpression);\n\t args = match('(') ? parseArguments() : [];\n\n\t isAssignmentTarget = isBindingElement = false;\n\n\t return node.finishNewExpression(callee, args);\n\t }", "function parseNewExpression() {\n var callee, args, node = new Node();\n\n expectKeyword('new');\n\n if (match('.')) {\n lex();\n if (lookahead.type === Token.Identifier && lookahead.value === 'target') {\n if (state.inFunctionBody) {\n lex();\n return node.finishMetaProperty('new', 'target');\n }\n }\n throwUnexpectedToken(lookahead);\n }\n\n callee = isolateCoverGrammar(parseLeftHandSideExpression);\n args = match('(') ? parseArguments() : [];\n\n isAssignmentTarget = isBindingElement = false;\n\n return node.finishNewExpression(callee, args);\n }", "function NewExpression(node, print) {\n this.push(\"new \");\n print.plain(node.callee);\n this.push(\"(\");\n print.list(node.arguments);\n this.push(\")\");\n}", "function new1(func){\n let obj = Object.create(func.prototype);\n let k = func.call(obj);\n if (typeof k === 'object'){\n return k\n }else {\n return obj;\n }\n}", "function NewExpression(node, print) {\n\t this.push(\"new \");\n\t print.plain(node.callee);\n\t this.push(\"(\");\n\t print.list(node.arguments);\n\t this.push(\")\");\n\t}", "function NewExpression(node, print) {\n\t this.push(\"new \");\n\t print.plain(node.callee);\n\t this.push(\"(\");\n\t print.list(node.arguments);\n\t this.push(\")\");\n\t}", "function parseNewExpression() {\n var callee, args, node = new Node();\n\n expectKeyword('new');\n\n if (match('.')) {\n lex();\n if (lookahead.type === Token.Identifier && lookahead.value === 'target') {\n if (state.inFunctionBody) {\n lex();\n return node.finishMetaProperty('new', 'target');\n }\n }\n throwUnexpectedToken(lookahead);\n }\n\n callee = isolateCoverGrammar(parseLeftHandSideExpression);\n args = match('(') ? parseArguments() : [];\n\n isAssignmentTarget = isBindingElement = false;\n\n return node.finishNewExpression(callee, args);\n }", "function parseNewExpression() {\n var callee, args, node = new Node();\n\n expectKeyword('new');\n\n if (match('.')) {\n lex();\n if (lookahead.type === Token.Identifier && lookahead.value === 'target') {\n if (state.inFunctionBody) {\n lex();\n return node.finishMetaProperty('new', 'target');\n }\n }\n throwUnexpectedToken(lookahead);\n }\n\n callee = isolateCoverGrammar(parseLeftHandSideExpression);\n args = match('(') ? parseArguments() : [];\n\n isAssignmentTarget = isBindingElement = false;\n\n return node.finishNewExpression(callee, args);\n }", "function parseNewExpression() {\n var callee, args, node = new Node();\n\n expectKeyword('new');\n\n if (match('.')) {\n lex();\n if (lookahead.type === Token.Identifier && lookahead.value === 'target') {\n if (state.inFunctionBody) {\n lex();\n return node.finishMetaProperty('new', 'target');\n }\n }\n throwUnexpectedToken(lookahead);\n }\n\n callee = isolateCoverGrammar(parseLeftHandSideExpression);\n args = match('(') ? parseArguments() : [];\n\n isAssignmentTarget = isBindingElement = false;\n\n return node.finishNewExpression(callee, args);\n }", "function sc_jsNew(c) {\n var evalStr = \"new c(\";\n evalStr +=arguments.length > 1? \"arguments[1]\": \"\";\n for (var i = 2; i < arguments.length; i++)\n\tevalStr += \", arguments[\" + i + \"]\";\n evalStr +=\")\";\n return eval(evalStr);\n}", "static from(func){\n let k = new Token(\"\", false, null, null);\n k.raw = repr(func);\n k.type = \"op\";\n if(func instanceof Func)\n k.func = function(){ func.exec(this); }\n else if(func instanceof Lambda)\n k.func = function(){ func.exec(this); }\n else\n error(\"bad type to Token.from\");\n return k;\n }", "new() {\n let newInstance = Object.create(this);\n\n newInstance.init(...arguments);\n\n return newInstance;\n }", "construct (target, args) {\n return new target(...args)\n }", "function NewObj() {}", "function op(id, nargs) {\n return function() {\n var r = new Operation(id);\n r.args = toArray(arguments).slice(0, nargs);\n return r;\n };\n }", "function applyNew(args){\n\t\t// create an object with ctor's prototype but without\n\t\t// calling ctor on it.\n\t\tvar ctor = args.callee, t = forceNew(ctor);\n\t\t// execute the real constructor on the new object\n\t\tctor.apply(t, args);\n\t\treturn t;\n\t}", "function applyNew(args){\n\t\t// create an object with ctor's prototype but without\n\t\t// calling ctor on it.\n\t\tvar ctor = args.callee, t = forceNew(ctor);\n\t\t// execute the real constructor on the new object\n\t\tctor.apply(t, args);\n\t\treturn t;\n\t}", "function applyNew(args){\n\t\t// create an object with ctor's prototype but without\n\t\t// calling ctor on it.\n\t\tvar ctor = args.callee, t = forceNew(ctor);\n\t\t// execute the real constructor on the new object\n\t\tctor.apply(t, args);\n\t\treturn t;\n\t}", "function temporaryConstructor() {}", "function test_operators() {\n var Vec2;\n\n function mul_scalar(p1, a) {\n var r = new Vec2();\n r.x = p1.x * a;\n r.y = p1.y * a;\n return r;\n }\n\n var vec2_ops = Operators(\n {\n '+'(p1, p2) {\n var r = new Vec2();\n r.x = p1.x + p2.x;\n r.y = p1.y + p2.y;\n return r;\n },\n '-'(p1, p2) {\n var r = new Vec2();\n r.x = p1.x - p2.x;\n r.y = p1.y - p2.y;\n return r;\n },\n '=='(a, b) {\n return a.x == b.x && a.y == b.y;\n },\n '<'(a, b) {\n var r;\n /* lexicographic order */\n if(a.x == b.x) r = a.y < b.y;\n else r = a.x < b.x;\n return r;\n },\n '++'(a) {\n var r = new Vec2();\n r.x = a.x + 1;\n r.y = a.y + 1;\n return r;\n },\n '--'(a) {\n var r = new Vec2();\n r.x = a.x - 1;\n r.y = a.y - 1;\n return r;\n },\n '^'(p1, p2) {\n var r = Math.sqrt((p1.x - p2.x) ** 2 + (p1.y - p2.y) ** 2);\n return r;\n }\n },\n {\n left: Number,\n '*'(a, b) {\n return mul_scalar(b, a);\n }\n },\n {\n right: Number,\n '*'(a, b) {\n return mul_scalar(a, b);\n }\n }\n );\n\n Vec2 = class Vec2 extends vec2_ops {\n constructor(x, y) {\n super();\n this.x = x;\n this.y = y;\n }\n toString() {\n return 'Vec2(' + this.x + ',' + this.y + ')';\n }\n };\n\n var a = new Vec2(10, 5);\n var b = new Vec2(110, 105);\n var r;\n\n console.log(`a = `, a);\n console.log(`b = `, b);\n console.log(`a * 2 + 3 * b = `, (r = a * 2 + 3 * b));\n console.log(`b - a = `, b - a);\n console.log(`b ^ a = `, b ^ a);\n a++;\n r = ++a;\n}", "function NewObj(){}", "function cheapNew(cls) {\n disable_constructor = true;\n var rv = new cls;\n disable_constructor = false;\n return rv;\n }", "function cheapNew(cls) {\n disable_constructor = true;\n var rv = new cls;\n disable_constructor = false;\n return rv;\n }", "GetNewOperator() {\r\n\t\treturn this.operators[this.operatorGenerator.GetRandomNumber(0, this.operators.length - 1)];\r\n\t}", "function Math(num1, num1, operator) {\n this.num1 = num1;\n this.num2 = num2;\n this.operator = operator;\n}", "function tempCtor() {}", "function Op(a,b){this.i=[];this.D=a;this.L=b||null;this.g=this.a=!1;this.c=void 0;this.s=this.w=this.j=!1;this.h=0;this.b=null;this.l=0}", "function le(t,e){return new o(t,e)}", "PrimitiveOperation1() {}", "constructor() {\n if (new.target === MatrixBase) {\n throw new TypeError('Cannot construct MatrixBase instances directly');\n }\n }", "function newSyntax() {\n foo::bar();\n const { abc } = { ...oneTwoThree };\n return new.target;\n }", "function createNew(fn) {\n let obj = {};\n obj.__proto__ = fn.prototype;\n let result = fn.apply(obj, [...arguments].slice(1));\n if (result) {\n return result\n } else {\n return obj\n }\n}", "function newx(k, v) { return (k == \"x\") ? new v(42) : v; }", "function hzNewMethod(object, prop) {\n\t\tconst seqExp = hzCallMethod(object, prop);\n\t\tseqExp.expressions[0].argument.callee.property.name = \"newMethod\";\n\t\treturn seqExp;\n\t}", "function Obj(){ return Literal.apply(this,arguments) }", "_copy () {\n return new this.constructor()\n }", "_copy () {\n return new this.constructor()\n }", "function Foo() {\n if (!new.target) throw \"Foo() must be called with new\";\n console.log(\"Foo instantiated with new\");\n}", "function i(e){return new s.default(function(t){t(a(e))})}", "function cheapNew(cls) {\n\t\t\t\tdisable_constructor = true;\n\t\t\t\tvar rv = new cls;\n\t\t\t\tdisable_constructor = false;\n\t\t\t\treturn rv;\n\t\t\t}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function functionConstructorTest() {\n var f;\n var pd;\n\n /* Properties. */\n\n print('prototype' in Function, Function.prototype === Function.prototype);\n pd = Object.getOwnPropertyDescriptor(Function, 'prototype');\n print(pd.writable, pd.enumerable, pd.configurable);\n print('length' in Function, Function.length);\n pd = Object.getOwnPropertyDescriptor(Function, 'length');\n print(pd.writable, pd.enumerable, pd.configurable);\n\n /* Test Function() called both as a function and as a constructor. */\n\n f = Function('print(\"no args\");');\n f('foo', 'bar', 'quux');\n f = new Function('print(\"no args\");');\n f('foo', 'bar', 'quux');\n\n f = Function('x', 'print(\"one arg\", x);');\n f('foo', 'bar', 'quux');\n f = new Function('x', 'print(\"one arg\", x);');\n f('foo', 'bar', 'quux');\n\n f = Function('x', 'y', 'print(\"two args\", x, y);');\n f('foo', 'bar', 'quux');\n f = new Function('x', 'y', 'print(\"two args\", x, y);');\n f('foo', 'bar', 'quux');\n\n f = Function('a', 'b', 'c', 'd', 'e', 'f', 'g', 'print(\"seven args\", a, b, c, d, e, f, g);');\n f('foo', 'bar', 'quux');\n f = new Function('a', 'b', 'c', 'd', 'e', 'f', 'g', 'print(\"seven args\", a, b, c, d, e, f, g);');\n f('foo', 'bar', 'quux');\n\n // Example from specification (E5.1, Section 15.3.2.1, NOTE at bottom).\n\n f = new Function('a', 'b', 'c', 'return a+b+c');\n print(f('foo', 'bar', 'quux', 'baz'));\n f = new Function('a, b, c', 'return a+b+c');\n print(f('foo', 'bar', 'quux', 'baz'));\n f = new Function('a,b', 'c', 'return a+b+c');\n print(f('foo', 'bar', 'quux', 'baz'));\n\n // In ES2015 the resulting function must have a .name of 'anonymous'.\n f = new Function('');\n pd = Object.getOwnPropertyDescriptor(f, 'name');\n print(typeof pd.value, pd.value, pd.writable, pd.enumerable, pd.configurable);\n pd = Object.getOwnPropertyDescriptor(f, 'length');\n print(typeof pd.value, pd.value, pd.writable, pd.enumerable, pd.configurable);\n f = new Function('a', 'b', 'return a+b');\n pd = Object.getOwnPropertyDescriptor(f, 'name');\n print(typeof pd.value, pd.value, pd.writable, pd.enumerable, pd.configurable);\n pd = Object.getOwnPropertyDescriptor(f, 'length');\n print(typeof pd.value, pd.value, pd.writable, pd.enumerable, pd.configurable);\n\n // Function is constructable.\n var fn = new Function('print(\"hello\");');\n x = new fn();\n print(typeof x);\n}", "function fakeNew2(F, ...args) {\n let obj = null;\n try {\n obj = Object.create(F.prototype);\n } catch (_err) {\n obj = Object.create(Object.prototype, {\n constructor: {\n value: F,\n writable: true,\n enumerable: false,\n configurable: true\n }\n });\n }\n\n let returnValue = F(...args);\n if (returnValue && typeof returnValue === 'object') {\n return returnValue;\n }\n\n F.call(obj, ...args);\n return obj;\n}", "function operation(operatorName, args) {\n\t return { type: 'operation', operator: operatorName, args: args || [] };\n\t }", "function operation(operatorName, args) {\n return { type: 'operation', operator: operatorName, args: args || [] };\n }", "function operation(operatorName, args) {\n return { type: 'operation', operator: operatorName, args: args || [] };\n }", "function $new(ctor, k, args)\n{\n if($isTransformed(ctor))\n {\n if(!ctor.$blank)\n ctor.$blank = $makeBlank(ctor);\n\n var obj = new ctor.$blank;\n var augmentedK = $makeK(function(x) {\n if(x != null && x != undefined)\n return k(x);\n else\n return k(obj);\n });\n \n return ctor.apply(obj, [augmentedK].concat(args));\n }\n else\n {\n var privateCtor = function ()\n {\n return ctor.apply(this, args);\n };\n privateCtor.prototype = ctor.prototype;\n\n return k(new privateCtor);\n }\n}", "function N(){return N.__super__.constructor.apply(this,arguments)}", "function _new(Cls) {\n return new(Cls.bind.apply(Cls, arguments))();\n }", "function createNode(...args) {\n return new Node(...args)\n}", "function o(e,t,n){try{return{type:\"normal\",arg:e.call(t,n)}}catch(e){return{type:\"throw\",arg:e}}}// Dummy constructor functions that we use as the .constructor and", "constructor(span, sourceSpan, operator, expr, binaryOp, binaryLeft, binaryRight) {\n super(span, sourceSpan, binaryOp, binaryLeft, binaryRight);\n this.operator = operator;\n this.expr = expr;\n }", "constructor(span, sourceSpan, operator, expr, binaryOp, binaryLeft, binaryRight) {\n super(span, sourceSpan, binaryOp, binaryLeft, binaryRight);\n this.operator = operator;\n this.expr = expr;\n }", "function applyBinary(Constructor, args, self){\n\t\tvar op = new Constructor();\n\t\tself._eval(args[0]).connect(op, 0, 0);\n\t\tself._eval(args[1]).connect(op, 0, 1);\n\t\treturn op;\n\t}", "function functionConstructorTest() {\n var f;\n\n /* Properties. */\n\n print('prototype' in Function, Function.prototype === Function.prototype);\n print('length' in Function, Function.length);\n\n /* Test Function() called both as a function and as a constructor. */\n\n f = Function('print(\"no args\");');\n f('foo', 'bar', 'quux');\n f = new Function('print(\"no args\");');\n f('foo', 'bar', 'quux');\n\n f = Function('x', 'print(\"one arg\", x);');\n f('foo', 'bar', 'quux');\n f = new Function('x', 'print(\"one arg\", x);');\n f('foo', 'bar', 'quux');\n\n f = Function('x', 'y', 'print(\"two args\", x, y);');\n f('foo', 'bar', 'quux');\n f = new Function('x', 'y', 'print(\"two args\", x, y);');\n f('foo', 'bar', 'quux');\n\n f = Function('a', 'b', 'c', 'd', 'e', 'f', 'g', 'print(\"seven args\", a, b, c, d, e, f, g);');\n f('foo', 'bar', 'quux');\n f = new Function('a', 'b', 'c', 'd', 'e', 'f', 'g', 'print(\"seven args\", a, b, c, d, e, f, g);');\n f('foo', 'bar', 'quux');\n\n /* Example from specification (E5.1, Section 15.3.2.1, NOTE at bottom). */\n\n f = new Function(\"a\", \"b\", \"c\", \"return a+b+c\");\n print(f('foo', 'bar', 'quux', 'baz'));\n f = new Function(\"a, b, c\", \"return a+b+c\");\n print(f('foo', 'bar', 'quux', 'baz'));\n f = new Function(\"a,b\", \"c\", \"return a+b+c\");\n print(f('foo', 'bar', 'quux', 'baz'));\n}", "function applyBinary(Constructor, args, self) {\n\t var op = new Constructor();\n\t self._eval(args[0]).connect(op, 0, 0);\n\t self._eval(args[1]).connect(op, 0, 1);\n\t return op;\n\t }", "function applyBinary(Constructor, args, self) {\n\t var op = new Constructor();\n\t self._eval(args[0]).connect(op, 0, 0);\n\t self._eval(args[1]).connect(op, 0, 1);\n\t return op;\n\t }", "function applyBinary(Constructor, args, self) {\n\t var op = new Constructor();\n\t self._eval(args[0]).connect(op, 0, 0);\n\t self._eval(args[1]).connect(op, 0, 1);\n\t return op;\n\t }", "function applyBinary(Constructor, args, self) {\n\t var op = new Constructor();\n\t self._eval(args[0]).connect(op, 0, 0);\n\t self._eval(args[1]).connect(op, 0, 1);\n\t return op;\n\t }", "function applyBinary(Constructor, args, self) {\n\t var op = new Constructor();\n\t self._eval(args[0]).connect(op, 0, 0);\n\t self._eval(args[1]).connect(op, 0, 1);\n\t return op;\n\t }", "constructor(left, op, right) {\n this.left = left;\n this.op = op;\n this.right = right;\n }", "function o(e){return new a[\"default\"](e)}", "function fakeNew(F, ...args) {\n const obj = Object.create(F.prototype); // prototype inheritance\n F.call(obj, ...args); // mixin\n return obj; // prototype + mixin is how js emulate class-based paradigm\n}", "constructor(op, expr) {\n this.op = op;\n this.expr = expr\n this.type = NodeTypes.UNARYOP;\n }", "function vipsOperationNew (name) {\n return libvips.vips_operation_new(name);\n }", "function W(t,e){return new f(t,e)}", "function new_constructor(extend, initializer, methods){\n\t\t\tvar func,\n\t\t\t\tmethodsArr,\n\t\t\t\tmethodsLen,\n\t\t\t\tk,\n\t\t\t\tprototype = Object.create(extend && extend.prototype);\t// ES5, but backup function provided above\n\t\t\t\n\t\t\tif(methods){\n\t\t\t\tmethodsArr = Object.keys(methods);\t\t\t\t\t\t// ES5, but backup function provided above\n\t\t\t\tmethodsLen = methodsArr.length;\n\t\t\t\tfor(k = methodsLen; k--;){\n\t\t\t\t\tprototype[methodsArr[k]] = methods[methodsArr[k]];\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfunc = function(){\t\t\n\t\t\t\tvar that = Object.create(prototype);\t\t\t\t\t// ES5, but backup function provided above\n\t\t\t\tif(typeof initializer === \"function\"){\n\t\t\t\t\tinitializer.apply(that, arguments);\n\t\t\t\t}\n\t\t\t\treturn that;\n\t\t\t};\n\t\t\t\n\t\t\tfunc.prototype = prototype;\n\t\t\tprototype.constructor = func;\n\t\t\treturn func;\n\t\t}", "static create(...args /* :Array<*> */) {\n\t\treturn new this(...args)\n\t}", "function new_(a, b, c, d, e, f, g, h, i) {\n\tswitch (arguments.length) {\n\t\tcase 0: return new this();\n\t\tcase 1: return new this(a);\n\t\tcase 2: return new this(a, b);\n\t\tcase 3: return new this(a, b, c);\n\t\tcase 4: return new this(a, b, c, d);\n\t\tcase 5: return new this(a, b, c, d, e);\n\t\tcase 6: return new this(a, b, c, d, e, f);\n\t\tcase 7: return new this(a, b, c, d, e, f, g);\n\t\tcase 8: return new this(a, b, c, d, e, f, g, h);\n\t\tcase 9: return new this(a, b, c, d, e, f, g, h, i);\n\t\tdefault:\n\t\t\t// Attempt the theorectically equivalent way\n\t\t\t// Native objects often detect this and throw;\n\t\t\t// luckily there aren't many native objects that take >9 arguments; so this case is rare\n\t\t\tvar obj = Object.create(this.prototype);\n\t\t\tvar ret = this.apply(obj, arguments);\n\t\t\treturn (typeof ret === 'object' && ret !== null)?ret:obj;\n\t}\n}", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function createNodeOperator (registry) {\n const kc = new KubeConfig();\n Object.assign(kc, fakeConfig);\n return new NodeOperator(NAMESPACE, kc, registry);\n}", "function construct(constructor, argList) {\r\n for (var argNames = '', i = argList.length; i--;) {\r\n argNames += (argNames ? ',a' : 'a') + i;\r\n }\r\n return Function(argNames, 'return new this(' + argNames + ')').apply(constructor, argList);\r\n }", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "function NewExpression(node) {\n if (this.get(\"callee\").isIdentifier()) {\n // only resolve identifier callee\n return t.genericTypeAnnotation(node.callee);\n }\n}", "function ot(t,e){return new E(t,e)}", "function new_constructor(initializer, methods, extend) {\n var prototype = Object.create(typeof extend === 'function'\n ? extend.prototype\n : extend);\n if (methods) {\n methods.keys().forEach(function (key) {\n prototype[key] = methods[key];\n}); }\n function constructor() {\n var that = Object.create(prototype);\n if (typeof initializer === 'function') {\n initializer.apply(that, arguments);\n }\n return that;\n }\n constructor.prototype = prototype;\n prototype.constructor = constructor;\n return constructor;\n }", "function makeBinaryOp (operation) {\r\n return function (self, other) {\r\n console.log(operation, self, other);\r\n };\r\n }", "static createPlus(span, sourceSpan, expr) {\n return new Unary(span, sourceSpan, '+', expr, '-', expr, new LiteralPrimitive(span, sourceSpan, 0));\n }", "static createPlus(span, sourceSpan, expr) {\n return new Unary(span, sourceSpan, '+', expr, '-', expr, new LiteralPrimitive(span, sourceSpan, 0));\n }" ]
[ "0.7059751", "0.6571295", "0.6505361", "0.64329165", "0.6342355", "0.6335628", "0.6333263", "0.6310198", "0.6298154", "0.6283314", "0.6256712", "0.6256712", "0.6253197", "0.6253197", "0.6253197", "0.6207867", "0.61958474", "0.61389214", "0.61221623", "0.6036005", "0.60329723", "0.6012254", "0.6012254", "0.6012254", "0.58272153", "0.5820748", "0.5776392", "0.57543874", "0.57543874", "0.5752", "0.57457894", "0.5705816", "0.57022184", "0.5694969", "0.5693149", "0.5683984", "0.56784946", "0.567572", "0.56564915", "0.5621019", "0.5618076", "0.5612569", "0.5612569", "0.5604279", "0.5599884", "0.5599395", "0.5597904", "0.5597904", "0.5597904", "0.5597904", "0.5597904", "0.5597904", "0.5593859", "0.55867034", "0.55734694", "0.5569219", "0.5569219", "0.5559104", "0.55536413", "0.5553509", "0.5542298", "0.5534085", "0.55196786", "0.55196786", "0.5516405", "0.5506246", "0.550369", "0.550369", "0.550369", "0.550369", "0.550369", "0.54868144", "0.54825854", "0.5479053", "0.54761595", "0.547515", "0.5467178", "0.5449025", "0.54363215", "0.543493", "0.5419885", "0.5419885", "0.5419885", "0.5419885", "0.5419885", "0.5419885", "0.5419885", "0.5419885", "0.5419885", "0.54000604", "0.53988254", "0.53912115", "0.53912115", "0.53912115", "0.5378999", "0.5372587", "0.53697884", "0.5366461", "0.5347129", "0.5347129" ]
0.60924566
19
The path to interop from JS code to C++ code: (handwritten JS code) > (autogenerated JS invoker) > (templategenerated C++ invoker) > (target C++ function) craftInvokerFunction generates the JS invoker function for each function exposed to JS through embind.
function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cppTargetFunc) { // humanName: a human-readable string name for the function to be generated. // argTypes: An array that contains the embind type objects for all types in the function signature. // argTypes[0] is the type object for the function return value. // argTypes[1] is the type object for function this object/class type, or null if not crafting an invoker for a class method. // argTypes[2...] are the actual function parameters. // classType: The embind type object for the class to be bound, or null if this is not a method of a class. // cppInvokerFunc: JS Function object to the C++-side function that interops into C++ code. // cppTargetFunc: Function pointer (an integer to FUNCTION_TABLE) to the target C++ function the cppInvokerFunc will end up calling. var argCount = argTypes.length; if (argCount < 2) { throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!"); } var isClassMethodFunc = (argTypes[1] !== null && classType !== null); // Free functions with signature "void function()" do not need an invoker that marshalls between wire types. // TODO: This omits argument count check - enable only at -O3 or similar. // if (ENABLE_UNSAFE_OPTS && argCount == 2 && argTypes[0].name == "void" && !isClassMethodFunc) { // return FUNCTION_TABLE[fn]; // } var argsList = ""; var argsListWired = ""; for(var i = 0; i < argCount - 2; ++i) { argsList += (i!==0?", ":"")+"arg"+i; argsListWired += (i!==0?", ":"")+"arg"+i+"Wired"; } var invokerFnBody = "return function "+makeLegalFunctionName(humanName)+"("+argsList+") {\n" + "if (arguments.length !== "+(argCount - 2)+") {\n" + "throwBindingError('function "+humanName+" called with ' + arguments.length + ' arguments, expected "+(argCount - 2)+" args!');\n" + "}\n"; // Determine if we need to use a dynamic stack to store the destructors for the function parameters. // TODO: Remove this completely once all function invokers are being dynamically generated. var needsDestructorStack = false; for(var i = 1; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here. if (argTypes[i] !== null && argTypes[i].destructorFunction === undefined) { // The type does not define a destructor function - must use dynamic stack needsDestructorStack = true; break; } } if (needsDestructorStack) { invokerFnBody += "var destructors = [];\n"; } var dtorStack = needsDestructorStack ? "destructors" : "null"; var args1 = ["throwBindingError", "invoker", "fn", "runDestructors", "retType", "classParam"]; var args2 = [throwBindingError, cppInvokerFunc, cppTargetFunc, runDestructors, argTypes[0], argTypes[1]]; if (isClassMethodFunc) { invokerFnBody += "var thisWired = classParam.toWireType("+dtorStack+", this);\n"; } for(var i = 0; i < argCount - 2; ++i) { invokerFnBody += "var arg"+i+"Wired = argType"+i+".toWireType("+dtorStack+", arg"+i+"); // "+argTypes[i+2].name+"\n"; args1.push("argType"+i); args2.push(argTypes[i+2]); } if (isClassMethodFunc) { argsListWired = "thisWired" + (argsListWired.length > 0 ? ", " : "") + argsListWired; } var returns = (argTypes[0].name !== "void"); invokerFnBody += (returns?"var rv = ":"") + "invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n"; if (needsDestructorStack) { invokerFnBody += "runDestructors(destructors);\n"; } else { for(var i = isClassMethodFunc?1:2; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here. Also skip class type if not a method. var paramName = (i === 1 ? "thisWired" : ("arg"+(i - 2)+"Wired")); if (argTypes[i].destructorFunction !== null) { invokerFnBody += paramName+"_dtor("+paramName+"); // "+argTypes[i].name+"\n"; args1.push(paramName+"_dtor"); args2.push(argTypes[i].destructorFunction); } } } if (returns) { invokerFnBody += "return retType.fromWireType(rv);\n"; } invokerFnBody += "}\n"; args1.push(invokerFnBody); var invokerFunction = new_(Function, args1).apply(null, args2); return invokerFunction; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function JavaInvoke() {\r\n}", "function helloFunctionInvoker(hello){\n hello('function args');\n}", "function CFunc(name, args, retVal) {\n function makeArgument(a) {\n if (!a) return null;\n const arg = MOBridgeSupportArgument.alloc().init();\n setKeys(arg, {\n type64: a.type\n });\n return arg;\n }\n const func = MOBridgeSupportFunction.alloc().init();\n setKeys(func, {\n name: name,\n arguments: args.map(makeArgument),\n returnValue: makeArgument(retVal)\n });\n return func;\n}", "getCpp(){ return this.program.generateCpp(); }", "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "function updateInvokeParamsJs() {\n //console.log(\"updating js json...\");\n invokefunc = \"\";\n if ($(\"#invokefunctionjs\")[0].value != \"Main\")\n invokefunc = $(\"#invokefunctionjs\")[0].value; // method\n var arrayparam = [];\n\n //console.log(\"function is \"+invokefunc);\n var neonJSParams = [];\n\n if (invokefunc != \"\")\n pushParams(neonJSParams, \"String\", invokefunc);\n\n if ($(\"#invokeparamjsbox1\")[0].value != \"None\") {\n if ($(\"#cbx_inarray_js1\")[0].checked)\n pushParams(arrayparam, $(\"#invokeparamjsbox1\")[0].value, $(\"#invokeparamsjs1\")[0].value);\n else\n pushParams(neonJSParams, $(\"#invokeparamjsbox1\")[0].value, $(\"#invokeparamsjs1\")[0].value);\n }\n if ($(\"#invokeparamjsbox2\")[0].value != \"None\") {\n if ($(\"#cbx_inarray_js2\")[0].checked)\n pushParams(arrayparam, $(\"#invokeparamjsbox2\")[0].value, $(\"#invokeparamsjs2\")[0].value);\n else\n pushParams(neonJSParams, $(\"#invokeparamjsbox2\")[0].value, $(\"#invokeparamsjs2\")[0].value);\n }\n if ($(\"#invokeparamjsbox3\")[0].value != \"None\") {\n if ($(\"#cbx_inarray_js3\")[0].checked)\n pushParams(arrayparam, $(\"#invokeparamjsbox3\")[0].value, $(\"#invokeparamsjs3\")[0].value);\n else\n pushParams(neonJSParams, $(\"#invokeparamjsbox3\")[0].value, $(\"#invokeparamsjs3\")[0].value);\n }\n\n if ($(\"#cbx_usearray_js\")[0].checked)\n pushParams(neonJSParams, 'Array', arrayparam);\n\n $(\"#invokeparamsjs\")[0].value = JSON.stringify(neonJSParams);\n}", "function convertJsFunctionToWasm(func, sig) {\n\n // The module is static, with the exception of the type section, which is\n // generated based on the signature passed in.\n var typeSection = [\n 0x01, // id: section,\n 0x00, // length: 0 (placeholder)\n 0x01, // count: 1\n 0x60, // form: func\n ];\n var sigRet = sig.slice(0, 1);\n var sigParam = sig.slice(1);\n var typeCodes = {\n 'i': 0x7f, // i32\n 'j': 0x7e, // i64\n 'f': 0x7d, // f32\n 'd': 0x7c, // f64\n };\n\n // Parameters, length + signatures\n typeSection.push(sigParam.length);\n for (var i = 0; i < sigParam.length; ++i) {\n typeSection.push(typeCodes[sigParam[i]]);\n }\n\n // Return values, length + signatures\n // With no multi-return in MVP, either 0 (void) or 1 (anything else)\n if (sigRet == 'v') {\n typeSection.push(0x00);\n } else {\n typeSection = typeSection.concat([0x01, typeCodes[sigRet]]);\n }\n\n // Write the overall length of the type section back into the section header\n // (excepting the 2 bytes for the section id and length)\n typeSection[1] = typeSection.length - 2;\n\n // Rest of the module is static\n var bytes = new Uint8Array([\n 0x00, 0x61, 0x73, 0x6d, // magic (\"\\0asm\")\n 0x01, 0x00, 0x00, 0x00, // version: 1\n ].concat(typeSection, [\n 0x02, 0x07, // import section\n // (import \"e\" \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x65, 0x01, 0x66, 0x00, 0x00,\n 0x07, 0x05, // export section\n // (export \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x66, 0x00, 0x00,\n ]));\n\n // We can compile this wasm module synchronously because it is very small.\n // This accepts an import (at \"e.f\"), that it reroutes to an export (at \"f\")\n var module = new WebAssembly.Module(bytes);\n var instance = new WebAssembly.Instance(module, {\n e: {\n f: func\n }\n });\n var wrappedFunc = instance.exports.f;\n return wrappedFunc;\n}", "function newTrustedFunctionForJIT(...args) {\n if (!_global.trustedTypes) {\n // In environments that don't support Trusted Types, fall back to the most\n // straightforward implementation:\n return new Function(...args);\n }\n // Chrome currently does not support passing TrustedScript to the Function\n // constructor. The following implements the workaround proposed on the page\n // below, where the Chromium bug is also referenced:\n // https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor\n const fnArgs = args.slice(0, -1).join(',');\n const fnBody = args[args.length - 1];\n const body = `(function anonymous(${fnArgs}\n) { ${fnBody}\n})`;\n // Using eval directly confuses the compiler and prevents this module from\n // being stripped out of JS binaries even if not used. The global['eval']\n // indirection fixes that.\n const fn = _global['eval'](trustedScriptFromString(body));\n if (fn.bind === undefined) {\n // Workaround for a browser bug that only exists in Chrome 83, where passing\n // a TrustedScript to eval just returns the TrustedScript back without\n // evaluating it. In that case, fall back to the most straightforward\n // implementation:\n return new Function(...args);\n }\n // To completely mimic the behavior of calling \"new Function\", two more\n // things need to happen:\n // 1. Stringifying the resulting function should return its source code\n fn.toString = () => body;\n // 2. When calling the resulting function, `this` should refer to `global`\n return fn.bind(_global);\n // When Trusted Types support in Function constructors is widely available,\n // the implementation of this function can be simplified to:\n // return new Function(...args.map(a => trustedScriptFromString(a)));\n}", "function newTrustedFunctionForJIT(...args) {\n if (!_global.trustedTypes) {\n // In environments that don't support Trusted Types, fall back to the most\n // straightforward implementation:\n return new Function(...args);\n }\n // Chrome currently does not support passing TrustedScript to the Function\n // constructor. The following implements the workaround proposed on the page\n // below, where the Chromium bug is also referenced:\n // https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor\n const fnArgs = args.slice(0, -1).join(',');\n const fnBody = args[args.length - 1];\n const body = `(function anonymous(${fnArgs}\n) { ${fnBody}\n})`;\n // Using eval directly confuses the compiler and prevents this module from\n // being stripped out of JS binaries even if not used. The global['eval']\n // indirection fixes that.\n const fn = _global['eval'](trustedScriptFromString(body));\n if (fn.bind === undefined) {\n // Workaround for a browser bug that only exists in Chrome 83, where passing\n // a TrustedScript to eval just returns the TrustedScript back without\n // evaluating it. In that case, fall back to the most straightforward\n // implementation:\n return new Function(...args);\n }\n // To completely mimic the behavior of calling \"new Function\", two more\n // things need to happen:\n // 1. Stringifying the resulting function should return its source code\n fn.toString = () => body;\n // 2. When calling the resulting function, `this` should refer to `global`\n return fn.bind(_global);\n // When Trusted Types support in Function constructors is widely available,\n // the implementation of this function can be simplified to:\n // return new Function(...args.map(a => trustedScriptFromString(a)));\n}", "function cwrap(ident, returnType, argTypes) {\n // TODO: optimize this, eval the whole function once instead of going through ccall each time\n return function() {\n return ccall(ident, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n // TODO: optimize this, eval the whole function once instead of going through ccall each time\n return function() {\n return ccall(ident, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n // TODO: optimize this, eval the whole function once instead of going through ccall each time\n return function() {\n return ccall(ident, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "getTransformedCode() {\n if (this.fastStorage.code) return this.fastStorage.code;\n\n if (this.shouldBeCompiled) {\n this.fastStorage.code = this.packer.generateCode(this.getAST(), this.projectPath, this.getContents());\n } else if (this.isJSON) {\n this.fastStorage.code = \"module.exports = \" + this.getContents();\n } else {\n this.fastStorage.code = this.getContents();\n }\n\n this.fastStorage.rebuildDate = Date.now();\n return this.fastStorage.code;\n }", "function populate_go_chaincode(name){\n\tif(chaincode[name] != null){\n\t\tconsole.log('[obc-js] \\t skip, already exists');\n\t}\n\telse {\n\t\tchaincode.details.func.push(name);\n\t\tchaincode[name] = function(args, cb){\t\t\t\t\t\t\t\t//create the functions in chaincode obj\n\t\t\tvar options = {path: '/devops/invoke'};\n\t\t\tvar body = {\n\t\t\t\t\tchaincodeSpec: {\n\t\t\t\t\t\ttype: \"GOLANG\",\n\t\t\t\t\t\tchaincodeID: {\n\t\t\t\t\t\t\tname: chaincode.details.deployed_name,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tctorMsg: {\n\t\t\t\t\t\t\tfunction: name,\n\t\t\t\t\t\t\targs: args\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t};\n\n\t\t\toptions.success = function(statusCode, data){\n\t\t\t\tconsole.log(\"[obc-js]\", name, \" - success:\", data);\n\t\t\t\tif(cb) cb(null, data);\n\t\t\t};\n\t\t\toptions.failure = function(statusCode, e){\n\t\t\t\tconsole.log(\"[obc-js]\", name, \" - failure:\", statusCode);\n\t\t\t\tif(cb) cb(eFmt('http error', statusCode, e), null);\n\t\t\t};\n\t\t\trest.post(options, '', body);\n\t\t};\n\t}\n}", "function convertJsFunctionToWasm(func, sig) {\n return func;\n}", "function cProxy(\n)\n{\n\n\n}", "async compile(entryPoint) {\n\t\tlet options = this.config.reify(entryPoint, this._cache);\n\t\tlet bundle = await rollup(options.input);\n\t\tlet { output } = await bundle.generate(options.output);\n\t\tif(output.length !== 1) {\n\t\t\tthrow new Error(\"unexpected chunking\"); // TODO: support for code splitting\n\t\t}\n\t\tlet { code, modules } = output[0];\n\n\t\tthis._cache = bundle.cache;\n\t\tthis._modules = modules;\n\t\treturn code;\n\t}", "function ccall(ident, returnType, argTypes, args) {\n var stack = 0;\n function toC(value, type) {\n if (type == 'string') {\n if (value === null || value === undefined || value === 0) return 0; // null string\n if (!stack) stack = Runtime.stackSave();\n var ret = Runtime.stackAlloc(value.length+1);\n writeStringToMemory(value, ret);\n return ret;\n } else if (type == 'array') {\n if (!stack) stack = Runtime.stackSave();\n var ret = Runtime.stackAlloc(value.length);\n writeArrayToMemory(value, ret);\n return ret;\n }\n return value;\n }\n function fromC(value, type) {\n if (type == 'string') {\n return Pointer_stringify(value);\n }\n assert(type != 'array');\n return value;\n }\n try {\n var func = eval('_' + ident);\n } catch(e) {\n try {\n func = globalScope['Module']['_' + ident]; // closure exported function\n } catch(e) {}\n }\n assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');\n var i = 0;\n var cArgs = args ? args.map(function(arg) {\n return toC(arg, argTypes[i++]);\n }) : [];\n var ret = fromC(func.apply(null, cArgs), returnType);\n if (stack) Runtime.stackRestore(stack);\n return ret;\n}", "function ccall(ident, returnType, argTypes, args) {\n var stack = 0;\n function toC(value, type) {\n if (type == 'string') {\n if (value === null || value === undefined || value === 0) return 0; // null string\n if (!stack) stack = Runtime.stackSave();\n var ret = Runtime.stackAlloc(value.length+1);\n writeStringToMemory(value, ret);\n return ret;\n } else if (type == 'array') {\n if (!stack) stack = Runtime.stackSave();\n var ret = Runtime.stackAlloc(value.length);\n writeArrayToMemory(value, ret);\n return ret;\n }\n return value;\n }\n function fromC(value, type) {\n if (type == 'string') {\n return Pointer_stringify(value);\n }\n assert(type != 'array');\n return value;\n }\n try {\n var func = eval('_' + ident);\n } catch(e) {\n try {\n func = globalScope['Module']['_' + ident]; // closure exported function\n } catch(e) {}\n }\n assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');\n var i = 0;\n var cArgs = args ? args.map(function(arg) {\n return toC(arg, argTypes[i++]);\n }) : [];\n var ret = fromC(func.apply(null, cArgs), returnType);\n if (stack) Runtime.stackRestore(stack);\n return ret;\n}", "function ccall(ident, returnType, argTypes, args) {\n var stack = 0;\n function toC(value, type) {\n if (type == 'string') {\n if (value === null || value === undefined || value === 0) return 0; // null string\n if (!stack) stack = Runtime.stackSave();\n var ret = Runtime.stackAlloc(value.length+1);\n writeStringToMemory(value, ret);\n return ret;\n } else if (type == 'array') {\n if (!stack) stack = Runtime.stackSave();\n var ret = Runtime.stackAlloc(value.length);\n writeArrayToMemory(value, ret);\n return ret;\n }\n return value;\n }\n function fromC(value, type) {\n if (type == 'string') {\n return Pointer_stringify(value);\n }\n assert(type != 'array');\n return value;\n }\n try {\n var func = eval('_' + ident);\n } catch(e) {\n try {\n func = globalScope['Module']['_' + ident]; // closure exported function\n } catch(e) {}\n }\n assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');\n var i = 0;\n var cArgs = args ? args.map(function(arg) {\n return toC(arg, argTypes[i++]);\n }) : [];\n var ret = fromC(func.apply(null, cArgs), returnType);\n if (stack) Runtime.stackRestore(stack);\n return ret;\n}", "function evtRoutine1( sender, parms )\n {\n var fld = this.FLD.TEST2, ref = this.REF, rtn = Lansa.evtRoutine( this, COM_OWNER, \"#Com_owner.Initialize\", 16 );\n\n //\n // DEFINE_COM Class(#prim_web.Json) Name(#output)\n //\n var OUTPUT = rtn.createReference( \"OUTPUT\", \"PRIM_WEB\", \"Json\" );\n\n //\n // DEFINE_COM Class(#prim_web.Json) Name(#input)\n //\n var INPUT = rtn.createReference( \"INPUT\", \"PRIM_WEB\", \"Json\" );\n\n //\n // DEFINE_COM Class(#prim_web.Jsonobject) Name(#json) Reference(*DYNAMIC)\n //\n var JSON = rtn.createDynamicReference( \"JSON\" );\n\n //\n // DEFINE_COM Class(#prim_web.JsonElement) Name(#saved) Reference(*DYNAMIC)\n //\n var SAVED = rtn.createDynamicReference( \"SAVED\" );\n\n //\n // DEFINE_COM Class(#prim_web.JsonArray) Name(#array) Reference(*DYNAMIC)\n //\n var ARRAY = rtn.createDynamicReference( \"ARRAY\" );\n\n //\n // DEFINE_COM Class(#prim_web.Jsonobject) Name(#entry) Reference(*DYNAMIC)\n //\n var ENTRY = rtn.createDynamicReference( \"ENTRY\" );\n\n //\n // DEFINE_COM Class(#PRIM_WEB.JsonArray) Name(#entryArray) Reference(*DYNAMIC)\n //\n var ENTRYARRAY = rtn.createDynamicReference( \"ENTRYARRAY\" );\n\n //\n // DEFINE_COM Class(#prim_web.JsonObject) Name(#entryArrayObject) Reference(*DYNAMIC)\n //\n var ENTRYARRAYOBJECT = rtn.createDynamicReference( \"ENTRYARRAYOBJECT\" );\n\n // ------------------------\n // -- Initialize #OUTPUT --\n // ------------------------\n OUTPUT.initialize();\n\n // -----------------------\n // -- Initialize #INPUT --\n // -----------------------\n INPUT.initialize();\n\n //\n // EVTROUTINE Handling(#Com_owner.Initialize)\n //\n rtn.Line( 16 );\n {\n\n //\n // #json <= #output.CreateRootObject\n //\n rtn.Line( 38 );\n JSON = rtn.setref( \"JSON\", OUTPUT.mthCREATEROOTOBJECT() );\n\n //\n // #std_text := 'Test'\n //\n rtn.Line( 41 );\n fld.STD_TEXT.set( \"Test\" );\n\n //\n // #json.InsertString Key('value') String(#STD_TEXT)\n //\n rtn.Line( 42 );\n JSON.mthINSERTSTRING( \"value\", fld.STD_TEXT.get() );\n\n //\n // #array <= #json.InsertArray( 'list' )\n //\n rtn.Line( 45 );\n ARRAY = rtn.setref( \"ARRAY\", JSON.mthINSERTARRAY( \"list\" ) );\n\n //\n // BEGIN_LOOP Using(#listcount) To(10)\n //\n rtn.Line( 48 );\n for( var i1 = 1, step1 = 1, to1 = 10; fld.LISTCOUNT.set( i1 ), ( ( ( step1 >= 0 ) && ( i1 <= to1 ) ) || ( ( step1 < 0 ) && ( i1 >= to1 ) ) ); i1 += step1 )\n {\n\n //\n // #entry <= #array.InsertObject\n //\n rtn.Line( 51 );\n ENTRY = rtn.setref( \"ENTRY\", ARRAY.mthINSERTOBJECT() );\n\n //\n // #entry.InsertNumber Key('entryNumber') Number(#listcount)\n //\n rtn.Line( 54 );\n ENTRY.mthINSERTNUMBER( \"entryNumber\", fld.LISTCOUNT.get() );\n\n //\n // #entry.InsertString Key('entryValue') String('test_' + #listcount.asstring)\n //\n rtn.Line( 55 );\n ENTRY.mthINSERTSTRING( \"entryValue\", Lansa.cat( \"test_\", Lansa.Number.AsString( fld.LISTCOUNT.get() ) ) );\n\n //\n // #entryArray <= #entry.InsertArray( 'entryArray' )\n //\n rtn.Line( 57 );\n ENTRYARRAY = rtn.setref( \"ENTRYARRAY\", ENTRY.mthINSERTARRAY( \"entryArray\" ) );\n\n //\n // BEGIN_LOOP Using(#LISTENTRY) To(10)\n //\n rtn.Line( 59 );\n for( var i2 = 1, step2 = 1, to2 = 10; fld.LISTENTRY.set( i2 ), ( ( ( step2 >= 0 ) && ( i2 <= to2 ) ) || ( ( step2 < 0 ) && ( i2 >= to2 ) ) ); i2 += step2 )\n {\n\n //\n // #entryArrayObject <= #entryArray.InsertObject\n //\n rtn.Line( 61 );\n ENTRYARRAYOBJECT = rtn.setref( \"ENTRYARRAYOBJECT\", ENTRYARRAY.mthINSERTOBJECT() );\n\n //\n // #entryArrayObject.InsertNumber Key('entryNumber') Number(#listcount)\n //\n rtn.Line( 63 );\n ENTRYARRAYOBJECT.mthINSERTNUMBER( \"entryNumber\", fld.LISTCOUNT.get() );\n\n //\n // #entryArrayObject.InsertString Key('entryValue') String('test_' + #listcount.asstring + ' ' + #LISTENTRY.asstring)\n //\n rtn.Line( 64 );\n ENTRYARRAYOBJECT.mthINSERTSTRING( \"entryValue\", Lansa.cat( Lansa.cat( Lansa.cat( \"test_\", Lansa.Number.AsString( fld.LISTCOUNT.get() ) ), \" \" ), Lansa.Number.AsString( fld.LISTENTRY.get() ) ) );\n\n //\n // END_LOOP \n //\n }\n\n //\n // END_LOOP \n //\n }\n\n //\n // #Label1.Caption := Created\n //\n rtn.Line( 70 );\n ref.LABEL1.setCaption( \"CREATED\" );\n\n //\n // #SYS_WEB.LocalStorage.Add Key(#COM_OWNER.ComponentClassName + '.json') Value(#output.text)\n //\n rtn.Line( 72 );\n Lansa.WEB().getLocalStorage().mthADD( Lansa.cat( this.getComponentClassName(), \".json\" ), OUTPUT.getText() );\n\n //\n // #Label1.Caption := Reading\n //\n rtn.Line( 74 );\n ref.LABEL1.setCaption( \"READING\" );\n\n //\n // #STD_TEXT := #COM_OWNER.ComponentClassName + '.json'\n //\n rtn.Line( 76 );\n fld.STD_TEXT.set( Lansa.cat( this.getComponentClassName(), \".json\" ) );\n\n //\n // #input := #SYS_WEB.LocalStorage<#STD_TEXT>\n //\n rtn.Line( 77 );\n INPUT.set( Lansa.WEB().getLocalStorage().get( fld.STD_TEXT.get() ).get() );\n\n //\n // #saved <= #input.RootItem\n //\n rtn.Line( 79 );\n SAVED = rtn.setref( \"SAVED\", INPUT.getRootItem() );\n\n //\n // #Label1.Caption := 'Item 5 is ' + #saved.Item<\"list\">.ItemAt<5>.item<\"entryValue\">.AsString\n //\n rtn.Line( 81 );\n ref.LABEL1.setCaption( Lansa.cat( \"Item 5 is \", SAVED.getItem( \"list\" ).getItemAt( 5 ).getItem( \"entryValue\" ).mthASSTRING() ) );\n\n //\n // FOR Each(#Item) In(#saved.Item<\"list\">)\n //\n rtn.Line( 83 );\n {\n var i1 = SAVED.getItem( \"list\" ).createIterator();\n\n while( i1.step() )\n {\n var ITEM = rtn.setref( \"ITEM\", i1.item() );\n\n //\n // ENDFOR \n //\n rtn.Line( 84 );\n }\n\n i1.end();\n rtn.deleteReference( \"ITEM\" );\n }\n\n }\n\n //\n // ENDROUTINE\n //\n rtn.Line( 86 );\n rtn.end();\n }", "_buildSemanticAction(semanticAction) {\n if (!semanticAction) {\n return null;\n }\n\n // Generate the function handler only for JS language.\n try {\n const handler = CodeUnit.createProductionHandler({\n production: this,\n captureLocations: this._grammar.shouldCaptureLocations(),\n });\n\n return (...args) => {\n // Executing a handler mutates $$ variable, return it.\n try {\n handler(...args);\n } catch (e) {\n this._logProductionError();\n throw e;\n }\n return CodeUnit.getSandbox().__;\n };\n } catch (e) {\n if (global.globalOptions.output == null) {\n this._logProductionError();\n throw e;\n }\n /* And skip for other languages, which use raw handler in generator */\n }\n }", "_buildHandler(tokenHandler) {\n try {\n /* Generate the function handler only for JS language */\n const handler = CodeUnit.createHandler(/* no params */ '', tokenHandler);\n return (matched, tokenizer) => {\n CodeUnit.setBindings({\n yytext: matched,\n yyleng: matched.length,\n });\n\n // Call the handler.\n const token = handler.call(tokenizer);\n const yytext = CodeUnit.getSandbox().yytext;\n\n // Update the `yyleng` in case `yytext` was modified.\n CodeUnit.setBindings({\n yyleng: yytext.length,\n });\n\n // The handler may mutate `yytext` during execution,\n // return a possibly updated one, along with the token.\n return [yytext, token];\n };\n } catch (e) {\n /* And skip for other languages, which use raw handler in generator */\n }\n }", "function createFunctionEvaluator(sandbox) {\n const { realmRec: { unsafeFunction, unsafeGlobal } } = sandbox;\n\n const evaluator = function(...params) {\n const functionBody = `${params.pop() || ''}`;\n let functionParams = `${params.join(',')}`;\n\n // Is this a real functionBody, or is someone attempting an injection\n // attack? This will throw a SyntaxError if the string is not actually a\n // function body. We coerce the body into a real string above to prevent\n // someone from passing an object with a toString() that returns a safe\n // string the first time, but an evil string the second time.\n // eslint-disable-next-line no-new, new-cap\n new unsafeFunction(functionBody);\n\n if (functionParams.includes(')')) {\n // If the formal parameters string include ) - an illegal\n // character - it may make the combined function expression\n // compile. We avoid this problem by checking for this early on.\n\n // note: v8 throws just like this does, but chrome accepts e.g. 'a = new Date()'\n throw new unsafeGlobal.SyntaxError('Function arg string contains parenthesis');\n // todo: shim integrity threat if they change SyntaxError\n }\n\n if (functionParams.length > 0) {\n // If the formal parameters include an unbalanced block comment, the\n // function must be rejected. Since JavaScript does not allow nested\n // comments we can include a trailing block comment to catch this.\n functionParams += '\\n/*``*/';\n }\n\n const src = `(function(${functionParams}){\\n${functionBody}\\n})`;\n\n return sandbox.evalEvaluator(src);\n };\n\n // Ensure that the different Function instances of the different\n // sandboxes all answer properly when used with the instanceof\n // operator to preserve indentity.\n const FunctionPrototype = unsafeFunction.prototype;\n\n // Mimic the native signature. New properties are\n // by default non-writable and non-configurable.\n defineProperties(evaluator, {\n name: {\n value: 'Function'\n },\n prototype: {\n value: FunctionPrototype\n }\n });\n\n // This instance is namespace-specific, and therefore doesn't\n // need to be frozen (only the objects reachable from it).\n return evaluator;\n}", "function sendInvoke (scriptHash, operation, arg1, arg2, assetType, assetAmount) {\n console.log('invoking contract from content script')\n var args = [arg1, arg2]\n\n // var tx = {'operation': 'putvalue', 'args': args, 'scriptHash': 'b3a14d99a3fb6646c78bf2f4e2f25a7964d2956a', 'amount': price, 'type': 'GAS' }\n var tx = {'operation': operation, 'args': args, 'scriptHash': scriptHash, 'amount': assetAmount, 'type': assetType }\n\n // send invoke contract\n chrome.runtime.sendMessage({'msg': 'sendInvoke', 'tx': tx}, function(response) {\n if (response && response.error) {\n console.log('contentInit sendInvoke error: '+response.error)\n window.postMessage(response.error, '*')\n\n } else if (response && response.msg){\n console.log('contentInit sendInvoke response: '+response.msg)\n // TODO: send invoke result to page\n window.postMessage(response.msg, '*')\n } else {\n console.log('content sendInvoke unexpected error')\n }\n })\n}", "toFunction(...argNames) {\n if (up.browser.canEval()) {\n return new Function(...argNames, this.script)\n } else if (this.nonce) {\n // Don't return a bound function so callers can re-bind to a different this.\n let callbackThis = this\n return function(...args) {\n return callbackThis.runAsNoncedFunction(this, argNames, args)\n }\n } else {\n return this.cannotRun.bind(this)\n }\n }", "function hzSpawnMethod(spawnExp) {\n\t\tspawnExp.arguments = [\n\t\t\tspawnExp.arguments[0].callee.object,\n\t\t\tt.stringLiteral(spawnExp.arguments[0].callee.property.name)\n\t\t];\n\t\tspawnExp.callee.property.name = \"spawnMethod\";\n\t\treturn t.yieldExpression(\n\t\t\tspawnExp\n\t\t);\n\t}", "function CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}", "function CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}", "function CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}", "function CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}", "function CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}", "function build_jsonrpc_body(type, func, args, chaincode_hash, enrollId){\n\treturn \t{\n\t\t\t\t\t'jsonrpc': '2.0',\n\t\t\t\t\t'method': type,\n\t\t\t\t\t'params': {\n\t\t\t\t\t\t'type': 1,\n\t\t\t\t\t\t'chaincodeID': {\n\t\t\t\t\t\t\t'name': chaincode_hash\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'ctorMsg': {\n\t\t\t\t\t\t\t'function': func,\n\t\t\t\t\t\t\t\t'args': args\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'secureContext': enrollId\n\t\t\t\t\t},\n\t\t\t\t\t'id': Date.now()\n\t\t\t\t};\n}", "function genFunc(funcCode, index, tabCount) {\n\tvar fList = window.context.state.functionList;\n\tvar component = fList[index];\n\tif(component.type === funcNExp) {\n\t\tif(!component.hasParent && component.name.includes(\"=\")) funcCode = funcCode + \"let \" + component.name + \"<br/>\"; else funcCode = funcCode + component.name + \"<br/>\";\n\t\treturn funcCode;\n\t}\n\t// var inp, inp2;\n\tif(!component.full) return \"not valid\";\n\tvar inputName, inputName2, funcOpName;\n\t// var funcType;\n\tvar hasChild = false;\n\tchildIsOp = false;\n\tif(component.input.name === \"\") {\n\t\tinputName = varNames[currentVar];\n\t} else inputName = component.input.name;\n\tif(component.type === funcOp) {\n\t\t// inp = document.getElementById(\"type\" + component.input.id);\n\t\t// inp2 = document.getElementById(\"type\" + component.input2.id);\n\t\tif(component.input2.name === \"\") {\n\t\t\tinputName2 = varNames[++currentVar];\n\t\t} else inputName2 = component.input2.name;\n\t}\t\n\n\tif(component.name === \"\") {\n\t\tif(component.type === funcBody) {;\n\t\t\tfuncCode = funcCode + \"fun \" + inputName + \" =<br/>\";\n\t\t} else if(component.type === funcRec) {\n\t\t\tvar funcName = varNames[++currentVar];\n\t\t\tfuncCode = funcCode + \"let rec \" + funcName + \" \" + inputName + \" =<br/>\";\n\t\t} else if(component.type === funcOp) {\n\t\t\tif(component.op === \"\") return \"not valid\";\n\t\t\t// funcType = document.getElementById(\"type\" + component.id);\n\t\t\tcomponent.input.valueType = component.valueType;\n\t\t\tcomponent.input2.valueType = component.valueType;\n\t\t\tfuncOpName = \"(\" + component.op + \")\";\n\t\t\tfuncCode = funcCode + funcOpName + \" \" + inputName + \" \" + inputName2 + \"<br/>\";\n\t\t}\n\t} else {\n\t\tif(component.type === funcBody) {\n\t\t\tfuncCode = funcCode + \"let \" + component.name + \" \" + inputName + \" =<br/>\";\n\t\t} else if(component.type === funcRec) {\n\t\t\tfuncCode = funcCode + \"let rec \" + component.name + \" \" + inputName + \" =<br/>\";\n\t\t} else if(component.type === funcOp) {\n\t\t\tif(component.op === \"\") return \"not valid\";\n\t\t\t// funcType = document.getElementById(\"type\" + component.id);\n\t\t\tcomponent.input.valueType = component.valueType;\n\t\t\tcomponent.input2.valueType = component.valueType;\n\t\t\tfuncOpName = \"(\" + component.op + \")\";\n\t\t\tfuncCode = funcCode + \"let \" + component.name + \" = \" + funcOpName + \" \" + inputName + \" \" + inputName2 + \"<br/>\";\n\t\t}\n\t}\n\ttabCount++;\n\tvar i;\n\tvar hasTabs = false;\n\tif(component.type === funcOp) hasTabs = true;\n\t\n\tif(!hasTabs) {\n\t\tfor(i = 0; i < tabCount; i++) {\n\t\t\tfuncCode = funcCode + \"&emsp;\";\n\t\t}\n\t\thasTabs = true;\n\t} else {\n\t\tfor(i = 0; i < tabCount-1; i++) {\n\t\t\tfuncCode = funcCode + \"&emsp;\";\n\t\t}\n\t}\n\t\n\tif(component.output.type === funcBody || component.output.type === funcRec || component.output.type === funcOp) {\n\t\tvar outputIndex = fList.findIndex(func => func.id === component.output.id);\n\t\tcurrentVar++;\n\t\tvar temp = genFunc(funcCode, outputIndex, tabCount);\n\t\tif(temp === \"not valid\") {\n\t\t\treturn temp;\n\t\t}\n\t\tfuncCode = temp;\n\t\tif(component.output.type === funcBody || component.output.type === funcRec) hasTabs = false;\n\t\tif(component.output.name !== \"\") hasChild = true;\n\t\tif(component.output.type === funcOp) {\n\t\t\t/*if(component.input.name !== \"\" && (component.output.input.name === component.input.name || component.output.input2.name === component.input.name))*/ childIsOp = true;\n\t\t\tcomponent.input.valueType = component.output.valueType;\n\t\t} else component.input.valueType = component.output.input.valueType;\n\t}\n\t\n\tif(!hasTabs) {\n\t\tfor(i = 0; i < tabCount; i++) {\n\t\t\tfuncCode = funcCode + \"&emsp;\";\n\t\t\thasTabs = true;\n\t\t}\n\t}\n\t\n\tif(childIsOp) {\n\t\tif(component.output.name === \"\" || component.output.output.type === funcOp) funcCode = funcCode + \"<br/>\"; else funcCode = funcCode + component.output.name + \"<br/>\";\n\t} else if(hasChild) {\n\t\tif(component.output.type === funcOp && component.output.name !== \"\") {\n\t\t\tfuncCode = funcCode + inputName + \"<br/>\";\n\t\t}else if(component.type === funcBody || component.type === funcRec) funcCode = funcCode + component.output.name + \" \" + inputName + \"<br/>\";\n\t} else {\n\t\tif(component.type === funcBody || component.type === funcRec) funcCode = funcCode + inputName + \"<br/>\";\n\t}\n\tcurrentVar++;\n\treturn funcCode;\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n }", "function packageJavascript() {\n return packageGenerator('javascript_compressed.js', 'javascript.js', 'Blockly.JavaScript');\n}", "function serializeJavaScriptText(outerFunction, exportName, isFactoryFunction) {\n // Now produce a textual representation of the closure and its serialized captured environment.\n // State used to build up the environment variables for all the funcs we generate.\n // In general, we try to create idiomatic code to make the generated code not too\n // hideous. For example, we will try to generate code like:\n //\n // var __e1 = [1, 2, 3] // or\n // var __e2 = { a: 1, b: 2, c: 3 }\n //\n // However, for non-common cases (i.e. sparse arrays, objects with configured properties,\n // etc. etc.) we will spit things out in a much more verbose fashion that eschews\n // prettyness for correct semantics.\n const envEntryToEnvVar = new Map();\n const envVarNames = new Set();\n const functionInfoToEnvVar = new Map();\n const requiredPackages = new Set();\n let environmentText = \"\";\n let functionText = \"\";\n const outerFunctionName = emitFunctionAndGetName(outerFunction);\n if (environmentText) {\n environmentText = \"\\n\" + environmentText;\n }\n // Export the appropriate value. For a normal function, this will just be exporting the name of\n // the module function we created by serializing it. For a factory function this will export\n // the function produced by invoking the factory function once.\n let text;\n const exportText = `exports.${exportName} = ${outerFunctionName}${isFactoryFunction ? \"()\" : \"\"};`;\n if (isFactoryFunction) {\n // for a factory function, we need to call the function at the end. That way all the logic\n // to set up the environment has run.\n text = environmentText + functionText + \"\\n\" + exportText;\n }\n else {\n text = exportText + \"\\n\" + environmentText + functionText;\n }\n return { text, exportName, requiredPackages };\n function emitFunctionAndGetName(functionInfo) {\n // If this is the first time seeing this function, then actually emit the function code for\n // it. Otherwise, just return the name of the emitted function for anyone that wants to\n // reference it from their own code.\n let functionName = functionInfoToEnvVar.get(functionInfo);\n if (!functionName) {\n functionName = functionInfo.name\n ? createEnvVarName(functionInfo.name, /*addIndexAtEnd:*/ false)\n : createEnvVarName(\"f\", /*addIndexAtEnd:*/ true);\n functionInfoToEnvVar.set(functionInfo, functionName);\n emitFunctionWorker(functionInfo, functionName);\n }\n return functionName;\n }\n function emitFunctionWorker(functionInfo, varName) {\n const capturedValues = envFromEnvObj(functionInfo.capturedValues);\n const thisCapture = capturedValues.this;\n const argumentsCapture = capturedValues.arguments;\n delete capturedValues.this;\n delete capturedValues.arguments;\n functionText += \"\\n\" +\n \"function \" + varName + \"() {\\n\" +\n \" return (function() {\\n\" +\n \" with(\" + envObjToString(capturedValues) + \") {\\n\\n\" +\n \"return \" + functionInfo.code + \";\\n\\n\" +\n \" }\\n\" +\n \" }).apply(\" + thisCapture + \", \" + argumentsCapture + \").apply(this, arguments);\\n\" +\n \"}\\n\";\n // If this function is complex (i.e. non-default __proto__, or has properties, etc.)\n // then emit those as well.\n emitComplexObjectProperties(varName, varName, functionInfo);\n if (functionInfo.proto !== undefined) {\n const protoVar = envEntryToString(functionInfo.proto, `${varName}_proto`);\n environmentText += `Object.setPrototypeOf(${varName}, ${protoVar});\\n`;\n }\n }\n function envFromEnvObj(env) {\n const envObj = {};\n for (const [keyEntry, { entry: valEntry }] of env) {\n if (typeof keyEntry.json !== \"string\") {\n throw new Error(\"PropertyMap key was not a string.\");\n }\n const key = keyEntry.json;\n const val = envEntryToString(valEntry, key);\n envObj[key] = val;\n }\n return envObj;\n }\n function envEntryToString(envEntry, varName) {\n const envVar = envEntryToEnvVar.get(envEntry);\n if (envVar !== undefined) {\n return envVar;\n }\n // Complex objects may also be referenced from multiple functions. As such, we have to\n // create variables for them in the environment so that all references to them unify to the\n // same reference to the env variable. Effectively, we need to do this for any object that\n // could be compared for reference-identity. Basic types (strings, numbers, etc.) have\n // value semantics and this can be emitted directly into the code where they are used as\n // there is no way to observe that you are getting a different copy.\n if (isObjOrArrayOrRegExp(envEntry)) {\n return complexEnvEntryToString(envEntry, varName);\n }\n else {\n // Other values (like strings, bools, etc.) can just be emitted inline.\n return simpleEnvEntryToString(envEntry, varName);\n }\n }\n function simpleEnvEntryToString(envEntry, varName) {\n if (envEntry.hasOwnProperty(\"json\")) {\n return JSON.stringify(envEntry.json);\n }\n else if (envEntry.function !== undefined) {\n return emitFunctionAndGetName(envEntry.function);\n }\n else if (envEntry.module !== undefined) {\n requiredPackages.add(envEntry.module);\n return `require(\"${envEntry.module}\")`;\n }\n else if (envEntry.output !== undefined) {\n return envEntryToString(envEntry.output, varName);\n }\n else if (envEntry.expr) {\n // Entry specifies exactly how it should be emitted. So just use whatever\n // it wanted.\n return envEntry.expr;\n }\n else if (envEntry.promise) {\n return `Promise.resolve(${envEntryToString(envEntry.promise, varName)})`;\n }\n else {\n throw new Error(\"Malformed: \" + JSON.stringify(envEntry));\n }\n }\n function complexEnvEntryToString(envEntry, varName) {\n // Call all environment variables __e<num> to make them unique. But suffix\n // them with the original name of the property to help provide context when\n // looking at the source.\n const envVar = createEnvVarName(varName, /*addIndexAtEnd:*/ false);\n envEntryToEnvVar.set(envEntry, envVar);\n if (envEntry.object) {\n emitObject(envVar, envEntry.object, varName);\n }\n else if (envEntry.array) {\n emitArray(envVar, envEntry.array, varName);\n }\n else if (envEntry.regexp) {\n const { source, flags } = envEntry.regexp;\n const regexVal = `new RegExp(${JSON.stringify(source)}, ${JSON.stringify(flags)})`;\n const entryString = `var ${envVar} = ${regexVal};\\n`;\n environmentText += entryString;\n }\n return envVar;\n }\n function createEnvVarName(baseName, addIndexAtEnd) {\n const trimLeadingUnderscoreRegex = /^_*/g;\n const legalName = makeLegalJSName(baseName).replace(trimLeadingUnderscoreRegex, \"\");\n let index = 0;\n let currentName = addIndexAtEnd\n ? \"__\" + legalName + index\n : \"__\" + legalName;\n while (envVarNames.has(currentName)) {\n currentName = addIndexAtEnd\n ? \"__\" + legalName + index\n : \"__\" + index + \"_\" + legalName;\n index++;\n }\n envVarNames.add(currentName);\n return currentName;\n }\n function emitObject(envVar, obj, varName) {\n const complex = isComplex(obj);\n if (complex) {\n // we have a complex child. Because of the possibility of recursion in\n // the object graph, we have to spit out this variable uninitialized first.\n // Then we can walk our children, creating a single assignment per child.\n // This way, if the child ends up referencing us, we'll have already emitted\n // the **initialized** variable for them to reference.\n if (obj.proto) {\n const protoVar = envEntryToString(obj.proto, `${varName}_proto`);\n environmentText += `var ${envVar} = Object.create(${protoVar});\\n`;\n }\n else {\n environmentText += `var ${envVar} = {};\\n`;\n }\n emitComplexObjectProperties(envVar, varName, obj);\n }\n else {\n // All values inside this obj are simple. We can just emit the object\n // directly as an object literal with all children embedded in the literal.\n const props = [];\n for (const [keyEntry, { entry: valEntry }] of obj.env) {\n const keyName = typeof keyEntry.json === \"string\" ? keyEntry.json : \"sym\";\n const propName = envEntryToString(keyEntry, keyName);\n const propVal = simpleEnvEntryToString(valEntry, keyName);\n if (typeof keyEntry.json === \"string\" && closure.isLegalMemberName(keyEntry.json)) {\n props.push(`${keyEntry.json}: ${propVal}`);\n }\n else {\n props.push(`[${propName}]: ${propVal}`);\n }\n }\n const allProps = props.join(\", \");\n const entryString = `var ${envVar} = {${allProps}};\\n`;\n environmentText += entryString;\n }\n function isComplex(o) {\n if (obj.proto !== undefined) {\n return true;\n }\n for (const v of o.env.values()) {\n if (entryIsComplex(v)) {\n return true;\n }\n }\n return false;\n }\n function entryIsComplex(v) {\n return !isSimplePropertyInfo(v.info) || deepContainsObjOrArrayOrRegExp(v.entry);\n }\n }\n function isSimplePropertyInfo(info) {\n if (!info) {\n return true;\n }\n return info.enumerable === true &&\n info.writable === true &&\n info.configurable === true &&\n !info.get && !info.set;\n }\n function emitComplexObjectProperties(envVar, varName, objEntry) {\n for (const [keyEntry, { info, entry: valEntry }] of objEntry.env) {\n const subName = typeof keyEntry.json === \"string\" ? keyEntry.json : \"sym\";\n const keyString = envEntryToString(keyEntry, varName + \"_\" + subName);\n const valString = envEntryToString(valEntry, varName + \"_\" + subName);\n if (isSimplePropertyInfo(info)) {\n // normal property. Just emit simply as a direct assignment.\n if (typeof keyEntry.json === \"string\" && closure.isLegalMemberName(keyEntry.json)) {\n environmentText += `${envVar}.${keyEntry.json} = ${valString};\\n`;\n }\n else {\n environmentText += `${envVar}${`[${keyString}]`} = ${valString};\\n`;\n }\n }\n else {\n // complex property. emit as Object.defineProperty\n emitDefineProperty(info, valString, keyString);\n }\n }\n function emitDefineProperty(desc, entryValue, propName) {\n const copy = {};\n if (desc.configurable) {\n copy.configurable = desc.configurable;\n }\n if (desc.enumerable) {\n copy.enumerable = desc.enumerable;\n }\n if (desc.writable) {\n copy.writable = desc.writable;\n }\n if (desc.get) {\n copy.get = envEntryToString(desc.get, `${varName}_get`);\n }\n if (desc.set) {\n copy.set = envEntryToString(desc.set, `${varName}_set`);\n }\n if (desc.hasValue) {\n copy.value = entryValue;\n }\n const line = `Object.defineProperty(${envVar}, ${propName}, ${envObjToString(copy)});\\n`;\n environmentText += line;\n }\n }\n function emitArray(envVar, arr, varName) {\n if (arr.some(deepContainsObjOrArrayOrRegExp) || isSparse(arr) || hasNonNumericIndices(arr)) {\n // we have a complex child. Because of the possibility of recursion in the object\n // graph, we have to spit out this variable initialized (but empty) first. Then we can\n // walk our children, knowing we'll be able to find this variable if they reference it.\n environmentText += `var ${envVar} = [];\\n`;\n // Walk the names of the array properties directly. This ensures we work efficiently\n // with sparse arrays. i.e. if the array has length 1k, but only has one value in it\n // set, we can just set htat value, instead of setting 999 undefineds.\n let length = 0;\n for (const key of Object.getOwnPropertyNames(arr)) {\n if (key !== \"length\") {\n const entryString = envEntryToString(arr[key], `${varName}_${key}`);\n environmentText += `${envVar}${isNumeric(key) ? `[${key}]` : `.${key}`} = ${entryString};\\n`;\n length++;\n }\n }\n }\n else {\n // All values inside this array are simple. We can just emit the array elements in\n // place. i.e. we can emit as ``var arr = [1, 2, 3]`` as that's far more preferred than\n // having four individual statements to do the same.\n const strings = [];\n for (let i = 0, n = arr.length; i < n; i++) {\n strings.push(simpleEnvEntryToString(arr[i], `${varName}_${i}`));\n }\n const entryString = `var ${envVar} = [${strings.join(\", \")}];\\n`;\n environmentText += entryString;\n }\n }\n}", "function generateCode(){\n\n}", "evaluateCode(sourceUrl, ctx, vars, createSourceMap) {\n let fnBody = `\"use strict\";${ctx.toSource()}\\n//# sourceURL=${sourceUrl}`;\n const fnArgNames = [];\n const fnArgValues = [];\n for (const argName in vars) {\n fnArgValues.push(vars[argName]);\n fnArgNames.push(argName);\n }\n if (createSourceMap) {\n // using `new Function(...)` generates a header, 1 line of no arguments, 2 lines otherwise\n // E.g. ```\n // function anonymous(a,b,c\n // /**/) { ... }```\n // We don't want to hard code this fact, so we auto detect it via an empty function first.\n const emptyFn = newTrustedFunctionForJIT(...fnArgNames.concat('return null;')).toString();\n const headerLines = emptyFn.slice(0, emptyFn.indexOf('return null;')).split('\\n').length - 1;\n fnBody += `\\n${ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment()}`;\n }\n const fn = newTrustedFunctionForJIT(...fnArgNames.concat(fnBody));\n return this.executeFunction(fn, fnArgValues);\n }", "evaluateCode(sourceUrl, ctx, vars, createSourceMap) {\n let fnBody = `\"use strict\";${ctx.toSource()}\\n//# sourceURL=${sourceUrl}`;\n const fnArgNames = [];\n const fnArgValues = [];\n for (const argName in vars) {\n fnArgValues.push(vars[argName]);\n fnArgNames.push(argName);\n }\n if (createSourceMap) {\n // using `new Function(...)` generates a header, 1 line of no arguments, 2 lines otherwise\n // E.g. ```\n // function anonymous(a,b,c\n // /**/) { ... }```\n // We don't want to hard code this fact, so we auto detect it via an empty function first.\n const emptyFn = newTrustedFunctionForJIT(...fnArgNames.concat('return null;')).toString();\n const headerLines = emptyFn.slice(0, emptyFn.indexOf('return null;')).split('\\n').length - 1;\n fnBody += `\\n${ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment()}`;\n }\n const fn = newTrustedFunctionForJIT(...fnArgNames.concat(fnBody));\n return this.executeFunction(fn, fnArgValues);\n }", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function () {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "onRuntimeInitialized() {\n window.wasmLoaded = true;\n window.wasmAdapter = Module;\n const event = new Event('wasm_load');\n document.dispatchEvent(event);\n\n const arr = [\n 'NO_CHANGE',\n 'P1',\n 'P2',\n 'SET_CHAR_STATE',\n 'SET_SPRITE_POS',\n 'CHANGE_ORIENTATION',\n 'MOVE',\n 'IDLE',\n 'STOP',\n 'SPOT_ATTACK',\n 'FINISH_SPOT_ATTACK',\n ];\n\n const vec = new Module.StringArray();\n for (let i = 0; i < arr.length; i++) {\n vec.push_back(arr[i]);\n }\n\n const chars = new Module.CharacterInitialConfig();\n chars.set('P1', {\n k: 'assasin',\n speed: 5,\n orientation: 'RIGHT',\n pos: [100, 100],\n });\n chars.set('P2', {\n k: 'knight',\n speed: 5,\n orientation: 'LEFT',\n pos: [200, 200],\n });\n\n\n const vecw = new Module.IntArray();\n const matrix = new Module.TwoDIntArray();\n vec.push_back(1);\n matrix.push_back(vecw);\n\n const initConfig = {\n map: {\n tileW: 33.72222222222222,\n tileH: 33.75,\n matrix,\n },\n chars,\n };\n\n const obj = new Module.GameEnvAdapter(true, vec, initConfig);\n\n window.game_config = {};\n window.js_wasm_adapter = {\n update(arg) {\n window.game_config.update(arg);\n },\n mapEventsKeyDict(name) {\n window.game_config.mapEventsKeyDict(name);\n },\n };\n }", "cs (...args) {\n return MVC.ComponentJS(...args)\n }", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function cwrap(ident, returnType, argTypes) {\n var func = getCFunc(ident);\n return function() {\n return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));\n }\n}", "function asmModule($a,$b,$c){\n'use asm';\n function func0()\n {\n return 2|0;\n }\n function func1(param0)\n {\n param0 = param0|0;\n var local0 = 0;\n if ((26|0) > (25|0))\n {\n local0 = (local0 + 4)|0;\n }\n \n \n local0 = (local0 + 4)|0;\n local0 = (local0 + 4)|0;\n local0 = (local0 + 2)|0;\n \n \n return (local0 + 42) | 0;\n //return 0;\n }\nreturn {a:func1};\n}", "function buildFunctions(codegen) {\n var fn = Object(__WEBPACK_IMPORTED_MODULE_1_vega_expression__[\"c\" /* functions */])(codegen);\n eventFunctions.forEach(function(name) { fn[name] = eventPrefix + name; });\n for (var name in functionContext) { fn[name] = thisPrefix + name; }\n return fn;\n}", "async Invoke(stub) \n {\n let ret = stub.getFunctionAndParameters();\n console.info(ret);\n\n let method = this[ret.fcn];\n if (!method) \n {\n console.error('Function::' + ret.fcn + ' not found');\n throw new Error('Unkonw' + ret.fcn + ' invoke');\n }\n try \n {\n let payload = await method(stub, ret.params);\n return shim.success(payload);\n } catch (err) \n {\n console.log(err);\n return shim.error(err);\n }\n }", "function functionName() { //coffee maker\n// (4)\n return value\n}", "function convertJsFunctionToWasm(func, sig) {\n\n // If the type reflection proposal is available, use the new\n // \"WebAssembly.Function\" constructor.\n // Otherwise, construct a minimal wasm module importing the JS function and\n // re-exporting it.\n if (typeof WebAssembly.Function === \"function\") {\n var typeNames = {\n 'i': 'i32',\n 'j': 'i64',\n 'f': 'f32',\n 'd': 'f64'\n };\n var type = {\n parameters: [],\n results: sig[0] == 'v' ? [] : [typeNames[sig[0]]]\n };\n for (var i = 1; i < sig.length; ++i) {\n type.parameters.push(typeNames[sig[i]]);\n }\n return new WebAssembly.Function(type, func);\n }\n\n // The module is static, with the exception of the type section, which is\n // generated based on the signature passed in.\n var typeSection = [\n 0x01, // id: section,\n 0x00, // length: 0 (placeholder)\n 0x01, // count: 1\n 0x60, // form: func\n ];\n var sigRet = sig.slice(0, 1);\n var sigParam = sig.slice(1);\n var typeCodes = {\n 'i': 0x7f, // i32\n 'j': 0x7e, // i64\n 'f': 0x7d, // f32\n 'd': 0x7c, // f64\n };\n\n // Parameters, length + signatures\n typeSection.push(sigParam.length);\n for (var i = 0; i < sigParam.length; ++i) {\n typeSection.push(typeCodes[sigParam[i]]);\n }\n\n // Return values, length + signatures\n // With no multi-return in MVP, either 0 (void) or 1 (anything else)\n if (sigRet == 'v') {\n typeSection.push(0x00);\n } else {\n typeSection = typeSection.concat([0x01, typeCodes[sigRet]]);\n }\n\n // Write the overall length of the type section back into the section header\n // (excepting the 2 bytes for the section id and length)\n typeSection[1] = typeSection.length - 2;\n\n // Rest of the module is static\n var bytes = new Uint8Array([\n 0x00, 0x61, 0x73, 0x6d, // magic (\"\\0asm\")\n 0x01, 0x00, 0x00, 0x00, // version: 1\n ].concat(typeSection, [\n 0x02, 0x07, // import section\n // (import \"e\" \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x65, 0x01, 0x66, 0x00, 0x00,\n 0x07, 0x05, // export section\n // (export \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x66, 0x00, 0x00,\n ]));\n\n // We can compile this wasm module synchronously because it is very small.\n // This accepts an import (at \"e.f\"), that it reroutes to an export (at \"f\")\n var module = new WebAssembly.Module(bytes);\n var instance = new WebAssembly.Instance(module, {\n 'e': {\n 'f': func\n }\n });\n var wrappedFunc = instance.exports['f'];\n return wrappedFunc;\n}", "function convertJsFunctionToWasm(func, sig) {\n\n // If the type reflection proposal is available, use the new\n // \"WebAssembly.Function\" constructor.\n // Otherwise, construct a minimal wasm module importing the JS function and\n // re-exporting it.\n if (typeof WebAssembly.Function === \"function\") {\n var typeNames = {\n 'i': 'i32',\n 'j': 'i64',\n 'f': 'f32',\n 'd': 'f64'\n };\n var type = {\n parameters: [],\n results: sig[0] == 'v' ? [] : [typeNames[sig[0]]]\n };\n for (var i = 1; i < sig.length; ++i) {\n type.parameters.push(typeNames[sig[i]]);\n }\n return new WebAssembly.Function(type, func);\n }\n\n // The module is static, with the exception of the type section, which is\n // generated based on the signature passed in.\n var typeSection = [\n 0x01, // id: section,\n 0x00, // length: 0 (placeholder)\n 0x01, // count: 1\n 0x60, // form: func\n ];\n var sigRet = sig.slice(0, 1);\n var sigParam = sig.slice(1);\n var typeCodes = {\n 'i': 0x7f, // i32\n 'j': 0x7e, // i64\n 'f': 0x7d, // f32\n 'd': 0x7c, // f64\n };\n\n // Parameters, length + signatures\n typeSection.push(sigParam.length);\n for (var i = 0; i < sigParam.length; ++i) {\n typeSection.push(typeCodes[sigParam[i]]);\n }\n\n // Return values, length + signatures\n // With no multi-return in MVP, either 0 (void) or 1 (anything else)\n if (sigRet == 'v') {\n typeSection.push(0x00);\n } else {\n typeSection = typeSection.concat([0x01, typeCodes[sigRet]]);\n }\n\n // Write the overall length of the type section back into the section header\n // (excepting the 2 bytes for the section id and length)\n typeSection[1] = typeSection.length - 2;\n\n // Rest of the module is static\n var bytes = new Uint8Array([\n 0x00, 0x61, 0x73, 0x6d, // magic (\"\\0asm\")\n 0x01, 0x00, 0x00, 0x00, // version: 1\n ].concat(typeSection, [\n 0x02, 0x07, // import section\n // (import \"e\" \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x65, 0x01, 0x66, 0x00, 0x00,\n 0x07, 0x05, // export section\n // (export \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x66, 0x00, 0x00,\n ]));\n\n // We can compile this wasm module synchronously because it is very small.\n // This accepts an import (at \"e.f\"), that it reroutes to an export (at \"f\")\n var module = new WebAssembly.Module(bytes);\n var instance = new WebAssembly.Instance(module, {\n 'e': {\n 'f': func\n }\n });\n var wrappedFunc = instance.exports['f'];\n return wrappedFunc;\n}", "function convertJsFunctionToWasm(func, sig) {\n\n // If the type reflection proposal is available, use the new\n // \"WebAssembly.Function\" constructor.\n // Otherwise, construct a minimal wasm module importing the JS function and\n // re-exporting it.\n if (typeof WebAssembly.Function === \"function\") {\n var typeNames = {\n 'i': 'i32',\n 'j': 'i64',\n 'f': 'f32',\n 'd': 'f64'\n };\n var type = {\n parameters: [],\n results: sig[0] == 'v' ? [] : [typeNames[sig[0]]]\n };\n for (var i = 1; i < sig.length; ++i) {\n type.parameters.push(typeNames[sig[i]]);\n }\n return new WebAssembly.Function(type, func);\n }\n\n // The module is static, with the exception of the type section, which is\n // generated based on the signature passed in.\n var typeSection = [\n 0x01, // id: section,\n 0x00, // length: 0 (placeholder)\n 0x01, // count: 1\n 0x60, // form: func\n ];\n var sigRet = sig.slice(0, 1);\n var sigParam = sig.slice(1);\n var typeCodes = {\n 'i': 0x7f, // i32\n 'j': 0x7e, // i64\n 'f': 0x7d, // f32\n 'd': 0x7c, // f64\n };\n\n // Parameters, length + signatures\n typeSection.push(sigParam.length);\n for (var i = 0; i < sigParam.length; ++i) {\n typeSection.push(typeCodes[sigParam[i]]);\n }\n\n // Return values, length + signatures\n // With no multi-return in MVP, either 0 (void) or 1 (anything else)\n if (sigRet == 'v') {\n typeSection.push(0x00);\n } else {\n typeSection = typeSection.concat([0x01, typeCodes[sigRet]]);\n }\n\n // Write the overall length of the type section back into the section header\n // (excepting the 2 bytes for the section id and length)\n typeSection[1] = typeSection.length - 2;\n\n // Rest of the module is static\n var bytes = new Uint8Array([\n 0x00, 0x61, 0x73, 0x6d, // magic (\"\\0asm\")\n 0x01, 0x00, 0x00, 0x00, // version: 1\n ].concat(typeSection, [\n 0x02, 0x07, // import section\n // (import \"e\" \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x65, 0x01, 0x66, 0x00, 0x00,\n 0x07, 0x05, // export section\n // (export \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x66, 0x00, 0x00,\n ]));\n\n // We can compile this wasm module synchronously because it is very small.\n // This accepts an import (at \"e.f\"), that it reroutes to an export (at \"f\")\n var module = new WebAssembly.Module(bytes);\n var instance = new WebAssembly.Instance(module, {\n 'e': {\n 'f': func\n }\n });\n var wrappedFunc = instance.exports['f'];\n return wrappedFunc;\n}", "function scalaJSStub(name) {\n\treturn function() {\n\t\tconsole.log(\"Stub for \" + name + \" called with arguments:\");\n\t}\n}", "function buildJavascript() {\n return buildGenerator('javascript', 'JavaScript');\n}", "function genCode(objType,appEnv,rowData){var columns=Object.keys(rowData);var pgm=Object(_optCode__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(objType,appEnv);var caslStatements=\"\\n\\n\\taction table.dropTable/\\n\\t\\tcaslib='\".concat(appEnv.WORKLIBNAME,\"' name='\").concat(appEnv.OUTPUTMASTERTABLENAME,\"' quiet=TRUE;\\n\\n\\ttable.save /\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tname='\").concat(appEnv.OPTABLENAME,\"'\\n\\t\\ttable='\").concat(appEnv.OPTABLENAME,\"'\\n\\t\\treplace=TRUE;\\n\\n\\ttable.loadTable /\\n\\t\\tcasOut={\\n\\t\\tname=\\\"model\\\",\\n\\t\\treplace=TRUE}\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tpath=\\\"MODEL.sashdat\\\";\\n\\n\\ttable.loadTable /\\n\\t\\tcasOut={\\n\\t\\tname=\\\"model_weights\\\",\\n\\t\\treplace=TRUE}\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tpath=\\\"MODEL_WEIGHTS.sashdat\\\";\\n\\n\\ttable.loadTable /\\n\\t\\tcasOut={\\n\\t\\tname=\\\"model_weights_attr\\\",\\n\\t\\treplace=TRUE}\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tpath=\\\"MODEL_WEIGHTS_ATTR.sashdat\\\";\\n\\n\\ttable.attribute /\\n\\t name=\\\"model_weights\\\"\\n\\t table=\\\"model_weights_attr\\\";\\n\\n\\tloadactionset 'deepLearn';\\n\\tdeepLearn.dlScore table={name='\").concat(appEnv.OPTABLENAME,\"'} initWeights={name=\\\"model_weights\\\"}\\n\\t modelTable={name=\\\"model\\\"}\\n\\t\\tcopyVars={'Horizon', 'StartUpDelay', 'Site1StartUpDelay', 'Site1IDDelay', 'Site1Capacity', 'Site2StartUpDelay', 'Site2IDDelay', 'Site2Capacity', 'Site3StartUpDelay', 'Site3IDDelay', 'Site3Capacity', 'Site4StartUpDelay', 'Site4IDDelay', 'Site4Capacity', 'Site5StartUpDelay', 'Site5IDDelay', 'Site5Capacity', 'Site6StartUpDelay', 'Site6IDDelay', 'Site6Capacity', 'Site7StartUpDelay', 'Site7IDDelay', 'Site7Capacity', 'Site8StartUpDelay', 'Site8IDDelay', 'Site8Capacity', 'Site9StartUpDelay', 'Site9IDDelay', 'Site9Capacity', 'Site10StartUpDelay', 'Site10IDDelay', 'Site10Capacity', 'Site1Interarrival', 'Site2Interarrival', 'Site3Interarrival', 'Site4Interarrival', 'Site5Interarrival', 'Site6Interarrival', 'Site7Interarrival', 'Site8Interarrival', 'Site9Interarrival', 'Site10Interarrival', 'Site1ScreenFailP', 'Site2ScreenFailP', 'Site3ScreenFailP', 'Site4ScreenFailP', 'Site5ScreenFailP', 'Site6ScreenFailP', 'Site7ScreenFailP', 'Site8ScreenFailP', 'Site9ScreenFailP', 'Site10ScreenFailP'}\\n\\t\\tcasout={name='\").concat(appEnv.OUTPUTMASTERTABLENAME,\"', caslib='\").concat(appEnv.INPUTLIBNAME,\"', replace=TRUE};\\n\\n\\n\\n\\taction table.save /\\n\\t\\tcaslib = '\").concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\tname = '\").concat(appEnv.OUTPUTMASTERTABLENAME,\"'\\n\\t\\treplace = TRUE\\n\\t\\ttable= {\\n\\t\\t\\tcaslib = '\").concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\t\\tname = '\").concat(appEnv.OUTPUTMASTERTABLENAME,\"'\\n\\t\\t};\\n\\n\\n\\n\\taction table.fetch r=result / to= 1000\\n\\t\\t\\t\\tfetchVars={'_DL_Pred_','Horizon'}\\n\\t\\t\\t\\ttable= {\\n\\t\\t\\t\\t\\tcaslib = '\").concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\t\\t\\t\\tname = '\").concat(appEnv.OUTPUTMASTERTABLENAME,\"'\\n\\t\\t\\t\\t};\\n\\t\\t\\t\\trun;\\n\\n\\n\\n\\tr = {A= result};\\n\\tsend_response( r) ;\\n\\trun;\\n\\n\\t\");return caslStatements;}", "function getFunction(body, params, parentContext){\n return function(){\n var context = Object.create(parentContext),\n g = getGlobal()\n\n context['window'] = context['global'] = g\n\n if (this == g) {\n context['this'] = null\n } else {\n context['this'] = this\n }\n // normalize arguments array\n var args = Array.prototype.slice.call(arguments)\n context['arguments'] = arguments\n args.forEach(function(arg,idx){\n var param = params[idx]\n if (param){\n context[param] = arg\n }\n })\n var result = evaluateAst(body, context)\n\n if (result instanceof ReturnValue){\n return result.value\n }\n }\n}", "function functionBinding(name, moduleSource, minArity, isVarArity, permissions, isCps, loc){\n this.name = name;\n this.moduleSource = moduleSource;\n this.minArity = minArity;\n this.isVarArity = isVarArity;\n this.permissions = permissions;\n this.isCps = isCps;\n this.loc = loc;\n this.toString = function(){return this.name;};\n return this;\n}", "function serializeFunction(func, args) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!args) {\n args = {};\n }\n const exportName = args.exportName || \"handler\";\n const serialize = args.serialize || (_ => true);\n const isFactoryFunction = args.isFactoryFunction === undefined ? false : args.isFactoryFunction;\n const functionInfo = yield closure.createFunctionInfoAsync(func, serialize);\n return serializeJavaScriptText(functionInfo, exportName, isFactoryFunction);\n });\n}", "function compileJsonPathToFunction( uncompiledJsonPath, \n parserGeneratedSoFar ) {\n\n /**\n * On finding a match, if there is remaining text to be compiled\n * we want to either continue parsing using a recursive call to \n * compileJsonPathToFunction. Otherwise, we want to stop and return \n * the parser that we have found so far.\n */\n var onFind = uncompiledJsonPath\n ? compileJsonPathToFunction \n : returnFoundParser;\n \n return clauseForJsonPath( \n uncompiledJsonPath, \n parserGeneratedSoFar, \n onFind\n ); \n }", "function compileJsonPathToFunction( uncompiledJsonPath, \n parserGeneratedSoFar ) {\n\n /**\n * On finding a match, if there is remaining text to be compiled\n * we want to either continue parsing using a recursive call to \n * compileJsonPathToFunction. Otherwise, we want to stop and return \n * the parser that we have found so far.\n */\n var onFind = uncompiledJsonPath\n ? compileJsonPathToFunction \n : returnFoundParser;\n \n return clauseForJsonPath( \n uncompiledJsonPath, \n parserGeneratedSoFar, \n onFind\n ); \n }", "function compileJsonPathToFunction( uncompiledJsonPath, \n parserGeneratedSoFar ) {\n\n /**\n * On finding a match, if there is remaining text to be compiled\n * we want to either continue parsing using a recursive call to \n * compileJsonPathToFunction. Otherwise, we want to stop and return \n * the parser that we have found so far.\n */\n var onFind = uncompiledJsonPath\n ? compileJsonPathToFunction \n : returnFoundParser;\n \n return clauseForJsonPath( \n uncompiledJsonPath, \n parserGeneratedSoFar, \n onFind\n ); \n }", "function compileJsonPathToFunction( uncompiledJsonPath, \n parserGeneratedSoFar ) {\n\n /**\n * On finding a match, if there is remaining text to be compiled\n * we want to either continue parsing using a recursive call to \n * compileJsonPathToFunction. Otherwise, we want to stop and return \n * the parser that we have found so far.\n */\n var onFind = uncompiledJsonPath\n ? compileJsonPathToFunction \n : returnFoundParser;\n \n return clauseForJsonPath( \n uncompiledJsonPath, \n parserGeneratedSoFar, \n onFind\n ); \n }", "function compileJsonPathToFunction( uncompiledJsonPath, \n parserGeneratedSoFar ) {\n\n /**\n * On finding a match, if there is remaining text to be compiled\n * we want to either continue parsing using a recursive call to \n * compileJsonPathToFunction. Otherwise, we want to stop and return \n * the parser that we have found so far.\n */\n var onFind = uncompiledJsonPath\n ? compileJsonPathToFunction \n : returnFoundParser;\n \n return clauseForJsonPath( \n uncompiledJsonPath, \n parserGeneratedSoFar, \n onFind\n ); \n }", "function compileJsonPathToFunction( uncompiledJsonPath, \n parserGeneratedSoFar ) {\n\n /**\n * On finding a match, if there is remaining text to be compiled\n * we want to either continue parsing using a recursive call to \n * compileJsonPathToFunction. Otherwise, we want to stop and return \n * the parser that we have found so far.\n */\n var onFind = uncompiledJsonPath\n ? compileJsonPathToFunction \n : returnFoundParser;\n \n return clauseForJsonPath( \n uncompiledJsonPath, \n parserGeneratedSoFar, \n onFind\n ); \n }", "function compileJsonPathToFunction( uncompiledJsonPath, \n parserGeneratedSoFar ) {\n\n /**\n * On finding a match, if there is remaining text to be compiled\n * we want to either continue parsing using a recursive call to \n * compileJsonPathToFunction. Otherwise, we want to stop and return \n * the parser that we have found so far.\n */\n var onFind = uncompiledJsonPath\n ? compileJsonPathToFunction \n : returnFoundParser;\n \n return clauseForJsonPath( \n uncompiledJsonPath, \n parserGeneratedSoFar, \n onFind\n ); \n }", "function compileJsonPathToFunction( uncompiledJsonPath, \n parserGeneratedSoFar ) {\n\n /**\n * On finding a match, if there is remaining text to be compiled\n * we want to either continue parsing using a recursive call to \n * compileJsonPathToFunction. Otherwise, we want to stop and return \n * the parser that we have found so far.\n */\n var onFind = uncompiledJsonPath\n ? compileJsonPathToFunction \n : returnFoundParser;\n \n return clauseForJsonPath( \n uncompiledJsonPath, \n parserGeneratedSoFar, \n onFind\n ); \n }" ]
[ "0.56310254", "0.5310954", "0.52002484", "0.515308", "0.48963365", "0.48963365", "0.48963365", "0.48963365", "0.48963365", "0.4860841", "0.48409113", "0.47932884", "0.47932884", "0.47722", "0.47722", "0.47722", "0.47703397", "0.4751401", "0.47258136", "0.47156188", "0.471286", "0.47039843", "0.47039843", "0.47039843", "0.470027", "0.46846172", "0.46658227", "0.46628696", "0.463652", "0.46323615", "0.462479", "0.46196356", "0.46196356", "0.46196356", "0.46196356", "0.46196356", "0.461111", "0.4600379", "0.45831013", "0.45809534", "0.45772204", "0.45744935", "0.45673996", "0.45673996", "0.4532352", "0.4532005", "0.453064", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.45199585", "0.4516564", "0.4507994", "0.44996598", "0.44964692", "0.44835305", "0.44805345", "0.44805345", "0.44805345", "0.44752282", "0.4469725", "0.44590944", "0.44438955", "0.4439671", "0.44366086", "0.44347417", "0.44347417", "0.44347417", "0.44347417", "0.44347417", "0.44347417", "0.44347417", "0.44347417" ]
0.79830444
0
root of all pointer and smart pointer handles in embind
function ClassHandle() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor (ptr) {\n this.ptr = ptr\n this._destroyListeners = []\n this._destroyPromise = new Promise((resolve) => {\n this._destroyResolve = resolve\n })\n this._destroyPromise.then(() => {\n this._destroyListeners.forEach((listener) => {\n listener(this)\n })\n })\n }", "attach() {}", "get pointer() { return this._pointer; }", "attach() { }", "attach() { }", "constructor() { \n autoBind(this); \n }", "bindEvents() {\n // Listen for global debounced resize.\n this.resizeId = OdoWindowEvents.onResize(this.update.bind(this));\n\n // Throttle scrolling because it doesn't need to be super accurate.\n this.scrollId = OdoWindowEvents.onFastScroll(this.handleScroll.bind(this));\n\n this.hasActiveHandlers = true;\n }", "get _rootInstance() {return this._p.rootInstance;}", "bindFunctions() {\r\n this.undoReference = undoReference.bind(this);\r\n this.nextReference = nextReference.bind(this);\r\n this.runToNextFault = runToNextFault.bind(this);\r\n this.runToLastReference = runToLastReference.bind(this);\r\n this.resetSIMMState = this.resetSIMMState.bind(this);\r\n }", "function ObjectPool() {\n return;\n }", "$bind() {\n this.$onopen = this.$onopen.bind(this);\n this.$onclose = this.$onclose.bind(this);\n this.$onmessage = this.$onmessage.bind(this);\n this.$onerror = this.$onerror.bind(this);\n this.$oncheck = this.$oncheck.bind(this);\n }", "bindCorrectContext() {\n\t\tthis.onTitleChange = this.onTitleChange.bind(this);\n\t\tthis.onShowDockingToolTip = this.onShowDockingToolTip.bind(this);\n\t\tthis.onToggleDockingIcon = this.onToggleDockingIcon.bind(this);\n\t\tthis.onDockingEnabledChanged = this.onDockingEnabledChanged.bind(this);\n\t\tthis.onAlwaysOnTopChanged = this.onAlwaysOnTopChanged.bind(this);\n\t\tthis.showLinkerButton = this.showLinkerButton.bind(this);\n\t\tthis.isTopRight = this.isTopRight.bind(this);\n\t\tthis.allowDragOnCenterRegion = this.allowDragOnCenterRegion.bind(this);\n\t\tthis.disallowDragOnCenterRegion = this.disallowDragOnCenterRegion.bind(this);\n\n\t\tthis.onShareEmitterChanged = this.onShareEmitterChanged.bind(this);\n\t\tthis.onTabsChanged = this.onTabsChanged.bind(this);\n\t\tthis.onShowTabsChanged = this.onShowTabsChanged.bind(this);\n\t\tthis.onHackScrollbarChanged = this.onHackScrollbarChanged.bind(this);\n\t\tthis.onTilingStop = this.onTilingStop.bind(this);\n\t\tthis.onTilingStart = this.onTilingStart.bind(this);\n\t\tthis.resizeDragHandle = this.resizeDragHandle.bind(this);\n\t\tthis.onDoubleClick = this.onDoubleClick.bind(this);\n\n\t}", "get handle() {\n\t\treturn this._h;\n\t}", "function setBindings() {\n // we're using normal DOM elements\n\n /**\n * Start event\n * @param {object} elem\n * @param {string} rf\n * @param {object} [ptr]\n */\n var bindSwipeStart = function(elem, rf, ptr) {\n\n // make sure the element has all the methods and properties we'll need\n elem = angularize(elem);\n\n // if no pointer reference is supplied, reference the element given\n if(angular.isUndefined(ptr)) {\n ptr = elem;\n } else {\n ptr = angularize(ptr);\n }\n\n // bind the swipe start event to the element\n $swipe.bind(elem, {\n start: function(coords, ev) {\n onStart(ev, ptr, rf);\n }\n });\n };\n\n /**\n * Move event\n * @param {object} elem\n */\n var bindSwipe = function(elem) {\n\n // make sure the element has all the methods and properties we'll need\n elem = angularize(elem);\n\n // bind the swipe move, end, and cancel events\n $swipe.bind(elem, {\n move : function(coords, ev) {\n onMove(ev);\n },\n end : function(coords, ev) {\n onMove(ev);\n onEnd();\n },\n cancel: function(coords, ev) {\n onEnd(ev);\n }\n });\n };\n\n // bind the common events to the various common elements\n bindSwipe($document);\n bindSwipeStart(refs.currPtr, refSelected);\n bindSwipeStart(refs.currBub, refSelected);\n bindSwipeStart(refs.minBub, refSelected, refs.currPtr);\n\n // bind the single knob specific events to the single knob specific elements\n bindSwipeStart(refs.maxBub, refSelected, refs.currPtr);\n bindSwipeStart(refs.fullBar, refSelected, refs.currPtr);\n\n\n }", "_bindDependencies() {\n this._oc.setBindingState(ObjectContainer.IMA_BINDING_STATE);\n this._config.initBindIma(\n ns,\n this._oc,\n this._config.bind,\n ObjectContainer.IMA_BINDING_STATE\n );\n\n this._config.plugins\n .filter(plugin => typeof plugin.module.initBind === 'function')\n .forEach(plugin => {\n this._oc.setBindingState(\n ObjectContainer.PLUGIN_BINDING_STATE,\n plugin.name\n );\n plugin.module.initBind(ns, this._oc, this._config.bind, plugin.name);\n });\n\n this._oc.setBindingState(ObjectContainer.APP_BINDING_STATE);\n this._config.initBindApp(\n ns,\n this._oc,\n this._config.bind,\n ObjectContainer.APP_BINDING_STATE\n );\n }", "attach() {\n this.listeners.push(addListener(this.element, 'resize', this._windowMath, this));\n this.listeners.push(addListener(this.element, 'mousewheel', this._mouseWheel, this));\n this.listeners.push(addListener(this.element, 'contextmenu', this._contextMenu, this));\n this.listeners.push(addListener(this.element.parentElement, 'fullscreenchange', this._onFullscreenChange, this));\n this.listeners.push(addListener(document, 'pointerlockchange', this._pointerLock, this));\n this.listeners.push(addListener(window, 'keydown', this._key, this));\n this.listeners.push(addListener(window, 'keyup', this._key, this));\n this.listeners.push(addListener(window, 'resize', this._windowMath, this));\n this.listeners.push(addListener(window, 'resize', this._resizeStart, this));\n\n // Gamepad support\n this.listeners.push(addListener(window, 'gamepadconnected', this._gamepadConnected, this));\n this.listeners.push(addListener(window, 'gamepaddisconnected', this._gamepadDisconnect, this));\n\n if ('ontouchstart' in window) {\n this.listeners.push(addListener(window, 'touchstart', this._touch, this));\n this.listeners.push(addListener(this.element, 'touchend', this._touch, this));\n this.listeners.push(addListener(this.element, 'touchmove', this._touch, this));\n\n console.log(\"Enabling mouse pointer display for touch devices.\");\n this.send(\"p,1\");\n } else {\n this.listeners.push(addListener(this.element, 'mousemove', this._mouseButtonMovement, this));\n this.listeners.push(addListener(this.element, 'mousedown', this._mouseButtonMovement, this));\n this.listeners.push(addListener(this.element, 'mouseup', this._mouseButtonMovement, this));\n }\n\n // Adjust for scroll offset\n this.listeners.push(addListener(window, 'scroll', () => {\n this.m.scrollX = window.scrollX;\n this.m.scrollY = window.scrollY;\n }, this));\n\n // Using guacamole keyboard because it has the keysym translations.\n this.keyboard = new Guacamole.Keyboard(window);\n this.keyboard.onkeydown = (keysym) => {\n this.send(\"kd,\" + keysym);\n };\n this.keyboard.onkeyup = (keysym) => {\n this.send(\"ku,\" + keysym);\n };\n\n this._windowMath();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "closeBindings() {\n this.receiver_.closeBindings();\n }", "function Component_BindingHandler() {}", "bindResponder(_responder) {\n }", "bindResponder(_responder) {\n }", "attach() {\n }", "onAttach() {}", "createDelegates() {\n // this.onMove = this.onMove.bind(this);\n // this.onMoveComplete = this.onMoved.bind(this);\n this.completeInitialization = this.completeInitialization.bind(this);\n this.onBoundsChanging = this.onBoundsChanging.bind(this);\n this.onBoundsChanged = this.onBoundsChanged.bind(this);\n this.onBoundsUpdate = this.onBoundsUpdate.bind(this);\n this.onMoved = this.onMoved.bind(this);\n this.onClosed = this.onClosed.bind(this);\n this.onFocused = this.onFocused.bind(this);\n this.onMinimized = this.onMinimized.bind(this);\n this.onRestored = this.onRestored.bind(this);\n this.onGroupChanged = this.onGroupChanged.bind(this);\n }", "attachEvents() {\n // Keep track pointer hold and dragging distance\n this.pointerDown = false;\n this.drag = {\n startX: 0,\n endX: 0,\n startY: 0,\n letItGo: null,\n preventClick: false,\n transformX: 0,\n transformY: 0\n };\n }", "resizeHandles() { }", "function attachEventHandlers() {\n // TODO device: attach context menu to device (call showContextMenu() in model-diagram.js if context menu is called)\n $(\"#\"+title).contextmenu(function(ev){\n diagram.showContextMenu(_this, ev);\n });\n // TODO device: attach events for functionality like in assignment-document described\n $(\"#\"+title).mousedown(function(event){\n return false;\n });\n $(\"#\"+title).click(function(event){\n diagram.deviceMouseDown(_this);\n });\n\n $(\"#\"+title).dblclick(function(event) {\n alert(name[type] +\" \"+ index);\n });\n\n $(\"#\"+title).keydown(function(event){\n if(event.which == \"13\"){\n diagram.deviceMouseDown(_this);\n }\n });\n\n var x = $(\"#arrow-device-add-reference\").clone();\n x.attr(\"id\", \"arrow-symbol-\"+ title);\n $(\"#\"+title).append(x);\n $(\"#\"+title).hover(function(event){\n if($(window).width() >= 768){\n x.attr(\"style\", \"display: block;\");\n }\n }, function(event){\n x.attr(\"style\", \"display: none;\");\n });\n x.click(function(event){\n diagram.toggleArrowActive();\n });\n\n $(\"#\"+title).removeClass('ui-draggable-dragging');\n\n // TODO device: attach drag & drop functionality\n $(\"#\"+title).draggable({\n start: function(event){\n if($(window).width() <= 767){\n return false;\n }\n },\n containment: diagram.area,\n drag: function(event){\n moveDevice();\n }\n });\n\n\n // TODO device optional: attach events for bonus points for 'Tab' and 'Enter'\n $(\"#\"+_this.title).attr(\"tabindex\",\"0\");\n }", "function HostBindingDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "bindCorrectContext() {\n\t\tthis.onTitleChange = this.onTitleChange.bind(this);\n\t\tthis.onShowDockingToolTip = this.onShowDockingToolTip.bind(this);\n\t\tthis.onToggleDockingIcon = this.onToggleDockingIcon.bind(this);\n\t\tthis.onDocking = this.onDocking.bind(this);\n\t\tthis.showLinkerButton = this.showLinkerButton.bind(this);\n\t}", "attach(el) {\n if(this.attached)\n {\n this.attached.removeEventListener('mousedown', this.event);\n this.attached.removeEventListener('mouseup', this.event);\n this.attached.removeEventListener('click', this.event);\n this.attached.removeEventListener('dblclick', this.event);\n }\n \n this.attached = el;\n \n el.addEventListener('mousedown', this.event);\n el.addEventListener('mouseup', this.event);\n el.addEventListener('click', this.event);\n el.addEventListener('dblclick', this.event);\n }", "disposeInternal() {\n\t\tthis.eventHandles_ = null;\n\t}", "_events() {\n this._eventsForHandle(this.$handle);\n if(this.handles[1]) {\n this._eventsForHandle(this.$handle2);\n }\n }", "_bindEventHandlers(){\n if ( this._server !== null ){\n // TODO\n }\n }", "function setHostBindings() {\n if (tView.expandoInstructions) {\n bindingRootIndex = viewData[BINDING_INDEX] = tView.expandoStartIndex;\n var currentDirectiveIndex = -1;\n var currentElementIndex = -1;\n for (var i = 0; i < tView.expandoInstructions.length; i++) {\n var instruction = tView.expandoInstructions[i];\n if (typeof instruction === 'number') {\n if (instruction <= 0) {\n // Negative numbers mean that we are starting new EXPANDO block and need to update\n // the current element and directive index.\n currentElementIndex = -instruction;\n if (typeof viewData[bindingRootIndex] === 'number') {\n // We've hit an injector. It may or may not exist depending on whether\n // there is a public directive on this node.\n bindingRootIndex += INJECTOR_SIZE;\n }\n currentDirectiveIndex = bindingRootIndex;\n }\n else {\n // This is either the injector size (so the binding root can skip over directives\n // and get to the first set of host bindings on this node) or the host var count\n // (to get to the next set of host bindings on this node).\n bindingRootIndex += instruction;\n }\n }\n else {\n // If it's not a number, it's a host binding function that needs to be executed.\n viewData[BINDING_INDEX] = bindingRootIndex;\n // We must subtract the header offset because the load() instruction\n // expects a raw, unadjusted index.\n instruction(currentDirectiveIndex - HEADER_OFFSET, currentElementIndex);\n currentDirectiveIndex++;\n }\n }\n }\n}", "function attachEventHandlers() {\n // TODO arrow: attach events for functionality like in assignment-document described\n var clicked;\n $(\"#\"+_this.id).click(function(event){\n clicked = true;\n diagram.selectArrow(_this);\n });\n $(\"#\"+_this.id).contents().on(\"dblclick contextmenu\", function(event){\n clicked = true;\n event.preventDefault();\n });\n\n // TODO arrow optional: attach events for bonus points for 'TAB' to switch between arrows and to select arrow\n $(\"#\"+_this.id).contents().attr(\"tabindex\",\"0\");\n\n $(\"#\"+_this.id).keydown(function(event){\n if(event.which == \"13\"){\n diagram.selectArrow(_this);\n }\n if(event.which == \"9\"){\n clicked = false;\n }\n })\n $(\"#\"+_this.id).contents().focusin(function(event){\n if(!clicked){\n setActive(true);\n }\n });\n $(\"#\"+_this.id).contents().focusout(function(event){\n setActive(false);\n });\n }", "Bind(IDispatch, string, string) {\n\n }", "initHandles (moveableElems) {\n throw new Error('You have to implement the method initHandles!')\n }", "constructor() {\n /**\n * Set of registered bindings.\n *\n * A binding is a definition of how to create an object and an\n * identifier for that object within the container.\n *\n * @private\n * @type {Map.<string, {factory: Function, singleton: boolean}>}\n */\n this.bindings = new Map();\n\n /**\n * Set of concrete object instances.\n *\n * @private\n * @type {Map.<string, *>}\n */\n this.instances = new Map();\n\n /**\n * Set of aliases for bindings or instances.\n *\n * @private\n * @type {Map.<string, string>}\n */\n this.aliases = new Map();\n }", "function bindDragHandlerToNewHost(){\r\n\t//array that hold DragHandler object that bind to new host\r\n\tvar hostDragHandler=new Array();\r\n\t//Iterating the received json data of new discovered host \r\n\tfor(i in newHostJson){\r\n\t\t//binding drag handler to new discovered host\r\n\t\tvar dh=DragHandler.attach(document.getElementById(newHostJson[i].name));\r\n\t\t//binding drag end handler function\t\t\r\n\t\tdh.dragEnd=findandmark;\r\n\t\thostDragHandler.push(dh);\r\n\t}\t\r\n}", "function global(binding){\n console.log(this)\n return binding;\n}", "function _bindEventHandlers() {\n\t\t\n helper.bindEventHandlers();\n }", "bind () {\n for (const event in this._virtuals) {\n document.body.addEventListener(event, this._handlers[event])\n }\n }", "_bindEventListenerCallbacks() {\n this._onClickBound = this._onClick.bind(this);\n this._onScrollBound = this._onScroll.bind(this);\n this._onResizeBound = this._onResize.bind(this);\n this._onVisibleBound = this._onVisible.bind(this);\n this._onMutateBound = this._onMutate.bind(this);\n }", "function addElementHandles() {\n // CURRENTLY UNUSED\n var viewportSVG = d3.selectAll(\"#viz-outer-frame div.vega svg\");\n if (viewportSVG.empty()) {\n console.warn(\"addElementHandles(): viewport SVG not found!\");\n return null;\n }\n if (viewportSVG.selectAll(\"#handles\").empty()) {\n // create a linked instance of handles\n viewportSVG.insert('use', 'svg > g')\n .attr('id', 'handles')\n .attr('xlink:href', '#manipulation-handles');\n }\n // TODO: clear and (re)build handles for all active elements?\n}", "function bindEvents(){angular.element($window).on('resize',handleWindowResize);$scope.$on('$destroy',cleanup);}", "__detach(){this.__objectResolvers.forEach(e=>{e.watchDestroyer&&(e.watchDestroyer(),e.watchDestroyer=null)}),e.EventProvider.raise(\"System.onControlDetached\",this),e.EventProvider.raise(this.__id+\".System.onDetached\",this),e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"IsAttached\"}),e.EventProvider.raise(\"onControlDetached\",this),e.EventProvider.raise(this.__id+\".onDetached\",this),e.System.Services.triggerManager.unregister(this.__triggerAttachList)}", "_resizeHandler() {\n this.refit();\n }", "function bindable(){\n\t\t\n\t}", "function initSharedMemBindings(result) {\n wasmExports = result.instance.exports;\n wasmShared = new Uint8Array(wasmExports.memory.buffer);\n wasmInstanceReady = true;\n}", "function BasicObject_alloc(){}", "_bindEventListenerCallbacks() {\n\n this._onResizeBound = this._onResize.bind(this);\n\n this._onTabListClickBound = this._onTabListClick.bind(this);\n\n this._onRightClickBound = this._onRightClick.bind(this);\n this._onLeftClickBound = this._onLeftClick.bind(this);\n\n this._onTouchStartBound = this._onTouchStart.bind(this);\n this._onTouchMoveBound = this._onTouchMove.bind(this);\n this._onTouchEndBound = this._onTouchEnd.bind(this);\n\n this._onMouseDownBound = this._onMouseDown.bind(this);\n this._onMouseMoveBound = this._onMouseMove.bind(this);\n this._onMouseUpBound = this._onMouseUp.bind(this);\n\n this._onScrollBound = this._onScroll.bind(this);\n\n this._onFocusBound = this._onFocus.bind(this);\n this._onBlurBound = this._onBlur.bind(this);\n }", "function Module_alloc(){}", "pcBindEvent(){ return false }" ]
[ "0.57861084", "0.56068826", "0.551735", "0.54917085", "0.54917085", "0.54191536", "0.53754616", "0.5348062", "0.53371745", "0.52674943", "0.5253667", "0.52248335", "0.5205727", "0.5178629", "0.51785976", "0.51700366", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5163196", "0.5144415", "0.5139435", "0.5139435", "0.5130467", "0.51256585", "0.5121194", "0.511327", "0.5105107", "0.5094322", "0.5090255", "0.50577796", "0.5056962", "0.50549704", "0.50349146", "0.50305426", "0.50201446", "0.501871", "0.50056833", "0.50003815", "0.4989558", "0.49860576", "0.4971643", "0.49650267", "0.4955116", "0.49531046", "0.49480218", "0.49467725", "0.49446762", "0.49444315", "0.49438903", "0.49350417", "0.493316", "0.49275625", "0.49274325", "0.49263096" ]
0.0
-1
URL Template v2.0.6 (
function expand(url, params, variables) { var tmpl = parse(url), expanded = tmpl.expand(params); if (variables) { variables.push.apply(variables, tmpl.vars); } return expanded; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function template (options) {\n\t var variables = [],\n\t url = expand(options.url, options.params, variables);\n\t variables.forEach(function (key) {\n\t delete options.params[key];\n\t });\n\t return url;\n\t}", "function createUrl(tpl, variables) {\r\n return tpl.replace(/\\{([^\\}]+)\\}/g, function (variable, key) {\r\n return key in variables ? variables[key] : variable;\r\n });\r\n }", "function makeUrl ($name, $data) {\n var $template = $templates[$name];\n\n $data['summary'] = $data['description'];\n\n for (var $key in $data) {\n var $camelCaseKey = $name + $key.replace(/^[a-z]/, function($str){\n return $str.toUpperCase();\n });\n\n var $value = encodeURIComponent($data[$camelCaseKey] || $data[$key]);\n $template = $template.replace(new RegExp('{{'+$key.toUpperCase()+'}}', 'g'), $value);\n }\n\n return $template;\n }", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template(options) {\n var variables = [],\n url = expand(options.url, options.params, variables);\n variables.forEach(function (key) {\n delete options.params[key];\n });\n return url;\n}", "function template (options) {\n\n var variables = [],\n url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [],\n url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function newUrl() {\n\trecordUrl();\n\n\tconstructUrlMarkup(2);\n}", "function _createURL()\n { var arr\n\n if(arguments.length === 1) arr=arguments[0]\n else arr = arguments\n\n var url = _transaction.server.location\n\n // arr:['route', 'article', 54 ] => str:\"/route/article/54\"\n for (var i=0; i<arr.length; i++){\n url += '/';\n if (arr[i] in _transaction.server)\n url += _transaction.server[arr[i]];\n else if (arr[i]+'Path' in _transaction.server)\n url += _transaction.server[arr[i]+'Path'];\n else\n url += arr[i]\n }\n\n return url;\n }", "function demoTemplate({\n url\n}) {\n return `Go here to see a demo <a href=\"${url}\">${url}</a>.`;\n}", "function createUrl(val){\n return `http://localhost:3000/api/${val}`;\n \n}", "url(...args) {\n return getMethodUrl(this.name, this.host, this.route, args);\n }", "get (...args) {\n\n\t\t// TODO: Set a default url path if one isn't added as a string in the second param,\n\t\t// or if one exists in the second param object. Look for url.\n\n this.template(...args)\n }", "function createRouteString( modelName )\n{\n return BASE_URL + modelName;\n}", "get url() {return '/';}", "getUrl(name) { return \"\"; }", "function createUrl(item) {\n var urlObj = {\n protocol: config.HOST.protocol,\n slashes: config.HOST.slashes,\n auth: config.HOST.auth,\n host: config.HOST.host,\n hostname: config.HOST.hostname,\n hash: config.HOST.hash,\n query: item,\n pathname: config.HOST.pathname\n }\n var urlString = url.format(urlObj);\n return urlString\n}", "function create_url(endpoint) {\n // TODO: ここを書き換えてURL作る\n // return '/api/guchi' + endpoint\n return URL_BASE + '/deai/' + endpoint;\n}", "function create_app_url(strPath, boolCustom)\r\n{\r\n\t\r\n}", "createShortenedListURL(params) {\n return ApiService.post('/link', { url: params.url });\n }", "function gen_url(object){\n var server = config.get('api_conf.server');\n var port = config.get('api_conf.port');\n var version = config.get('api_conf.version');\n var account = config.get('api_conf.account');\n\n url = \"http://\" + server + \":\" + port + \"/\" + version + \"/\" + account \n //Check if the container/object exist, if they exist \n //concatenate it to the url variable \n if(config.has('api_conf.container')){\n url += \"/\" + config.get('api_conf.container'); \n } \n if(config.has('api_conf.object')){\n url += \"/\" + config.get('api_conf.object');\n }\n url += object; \n\n return url;\n}", "function _render (url) {\r\n if (null != exports.ttQueryStr && '' != exports.ttQueryStr)\r\n {\r\n var m = url.match(\"\\\\.[a-zA-Z]+\\\\?\");\r\n if (null != m && 0 < m.length)\r\n {\r\n if (url.indexOf('?') == (url.length-1))\r\n {\r\n url = url + exports.ttQueryStr;\r\n } else {\r\n url = url + '&' + exports.ttQueryStr;\r\n }\r\n } else {\r\n url = url + '?' + exports.ttQueryStr;\r\n }\r\n\r\n //console.log(\"render:\",url);\r\n }\r\n\r\n return url;\r\n }", "function makeurl()\r\n\t{\r\n\t\tvar url = class_baseUrl + \"?func=ll&objAction=page&objID=\" + virtual_containerId + \"&page=\" + currentPageNum + \"&sort=\" + class_sortColumn;\r\n\r\n\t\t// add on the optional pieces\r\n\t\tif ( containerSubType !== \"\" ) \r\n\t\t{\r\n\t\t\turl += \"&objType=\" + containerSubType;\r\n\t\t}\r\n\t\tif ( filterValue !== \"\" )\r\n\t\t{\r\n\t\t\turl += \"&filterValue=\" + encodeURIComponent( filterValue );\r\n\t\t}\r\n\r\n\t\tif ( objFilter !== \"\" )\r\n\t\t{\r\n\t\t\turl += \"&objFilter=\" + objFilter;\r\n\t\t}\r\n\t\t\r\n\t\tif ( currentTab !== \"\" )\r\n\t\t\t\t{\r\n\t\t\t\t\turl += \"&tab=\" + encodeURIComponent( currentTab );\r\n\t\t}\r\n\t\t\r\n\t\tfor ( var key in contentFilter ) \r\n\t\t{\r\n\t\t\tfor ( var i = 0; i < contentFilter[ key ].length; i ++ ) \r\n\t\t\t{\r\n\t\t\t\turl += \"&\" + key + \"=\" + encodeURIComponent( contentFilter[ key ][ i ] );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn url;\r\n\t}", "url(action,i18n,payload,params,hash){\n if (this.data.url){\n return this.data.url.call(this, action, i18n,payload,params);\n } else {\n let route_path = i18n.t(this.key);\n return `/${i18n.language}/${route_path}`;\n }\n }", "set templateURL(sUrl) {\n }", "function URLUtils() {}", "function make_url() {\n let tag_url = ''\n for (let i = 0; i < tags.length; i++){\n tag_url += '&tags=' + tags[i] + '&'\n }\n return '/products?page=' + page + '&order=' + order + '&category=' + category + '&criteria=' + criteria + tag_url + '&json_response=True'\n}", "urlFor(action) {\n\t\tconst endpoint = this.endpoint(action);\n\n\t\tif (endpoint.path) {\n\t\t\treturn url.resolve(this.url, endpoint.path);\n\t\t}\n\n\t\treturn url.resolve(this.url, endpoint.toString());\n\t}", "static urlForRestaurant(restaurant) {\r\n return (`./restaurant.html?id=${restaurant.id}`);\r\n }", "function url() {\n var u = a + b + c + d\n return u\n }", "url() {\n throw new Error('Not implemented');\n }", "formatUrl(params) {\n if (params.token) {\n return util.format('%s://%s%s.%s/%s/%s', config.gateway.protocol, this.getURLEnvironment(), params.app, config.gateway.hostname, params.path, params.token);\n } else {\n return util.format('%s://%s%s.%s/%s', config.gateway.protocol, this.getURLEnvironment(), params.app, config.gateway.hostname, params.path);\n }\n }", "function generateUrl(urlScheme) {\n var url = urlScheme;\n\n // If query exist\n if (query.length > 0) {\n url = url.replace(/__query__/g, query.val());\n }\n\n // If group exist\n if (group.length > 0) {\n url = url.replace(/__group__/g, group.val());\n }\n\n url = url.replace(/__page__/g, 1);\n\n return url;\n }", "function g_link(template, item) {\r\n return \"/\" + template.id + \"/\" + item.id;\r\n}", "url(info) {\n let path = this.pathname(info);\n path = path.replace(/\\.git$/, '');\n return `https://github.com/${path}`;\n }", "static urlForRestaurant(restaurant) {\n return (`./restaurant.html?id=${restaurant.id}`);\n }", "function dust_url(opts, chunk, ctx, bodies, params) {\n\tvar url = dust.helpers.tap(params.url, chunk, ctx);\n\n\t// Only prepend our base url if we're looking for something relative to it\n\tif (url[0] == '/')\n\t\treturn chunk.write(opts.base_url + url);\n\telse\n\t\treturn chunk.write(url);\n}", "buildUrlEndpoint(action) {\n\t\t\tconst host = this._configuration.getDomain() + '/api/Bookmark/'\n\t\t\tconst endpoint = action || '';\n\t\t\treturn host + endpoint;\n\t\t}", "function makeUrl(type,name){\n return 'https://wind-bow.glitch.me/twitch-api/'+type+'/'+name;\n}", "link() {\n this._template = this._sbolDocument.lookupURI(this._template);\n this._variableComponents = this._sbolDocument.lookupURIs(this._variableComponents);\n }", "getFinalUrl() {\n let url = Request.mergeUrls(this.host, this.url);\n const urlParams = this.getUrlParams();\n if (urlParams.length > 0) {\n url += `?${urlParams}`;\n }\n return url;\n }", "function g_link(template, id) {\r\n return \"/\" + template.id + \"/\" + id;\r\n}", "getHref() {\n switch (this.type) {\n case \"room\":\n return \"room.html?\" + this.id + \"+\" + this.title.split(' ').join('_');\n case \"device\":\n return \"device.html?\" + this.id + \"+\" + this.title.split(' ').join('_');\n default:\n return \"home.html\";\n }\n }", "function constructorurl(intput1) {\n return serverURL + \"?text=\" + intput1;\n}", "static tempURL(ctx, container, filename, method, duration) {\n\n if(!duration)\n duration = 86400;\n\n let secret = ctx._secret(container);\n\n let dst = ctx._endpoint(container, filename);\n let expires = Math.floor(Date.now() / 1000 + duration);\n //pathname does not contains querystring\n let hmac_body = [method || 'GET', expires, decodeURIComponent(dst.pathname)].join(\"\\n\");\n\n var sig = hmac('sha1', secret, hmac_body);\n\n dst.search = encode({...decode(dst.query), temp_url_sig : sig, temp_url_expires : expires});\n return url.format(dst);\n }", "function genUrl(opts, path$$1) {\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t var pathDel = !opts.path ? '' : '/';\n\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t return opts.protocol + '://' + opts.host +\n\t (opts.port ? (':' + opts.port) : '') +\n\t '/' + opts.path + pathDel + path$$1;\n\t}", "buildURL(){\n var url = this._super(...arguments);\n if (url.lastIndexOf('/') !== url.length - 1) {\n url += '/';\n }\n return url;\n }", "function formatURL(name, config) {\n name = name.replace(/\\?.*?$/, '');\n return (config.jsonData.baseURL || '') + name;\n }", "function gen_url (connection, collection) {\n\tvar config = connections.connections[connection];\n\tvar url = config.URI;\n\n\turl += '/' + config.orgName + '/' + config.appName + '/' + collection + '?';\n\n\treturn url;\n}", "function createLoginTemplate(name, url, type) {\n var template = \n `\n <p>Welcome, ${name}. \n <a href='https://8080-ce19f3ee-62b8-4778-b1d0-8b6beb1e067f.us-east1.cloudshell.dev/${url}'>Log${type} here</a>\n </p>\n `;\n return template;\n}", "function urlRenderer() {\n\treturn function(value) {\n\t\tif (value) {\n\t\t\tvar url = \"\";\n\t\t\tvar label = \"\";\n\t\t\tvar s = value.split(\"\\n\");\n\t\t\tif (s.length == 2) {\n\t\t\t\turl = Ext.util.Format.htmlEncode(s[1]);\n\t\t\t\tlabel = Ext.util.Format.htmlEncode(s[0]) || url;\n\t\t\t}\n\t\t\telse {\n\t\t\t\turl = Ext.util.Format.htmlEncode(value);\n\t\t\t\tlabel = Ext.util.Format.htmlEncode(value);\n\t\t\t}\n\t\t\treturn \"<a href=\\\"\" + url + \"\\\" target=\\\"_blank\\\">\" + label + \"</a>\";\n\t\t}\n\t\treturn \"\";\n\t};\n}", "static url(name, params) {\n\n if (!this.names[name]) {\n return null;\n }\n\n var uri = this.names[name];\n\n var query = {};\n\n if (!params) {\n params = {};\n }\n var has_query = false;\n\n _.forIn(params, function(value, param) {\n\n if (value !== undefined) {\n\n if (uri.indexOf('{'+param+'}') !== -1) {\n\n uri = uri.replace('{'+param+'}', value);\n\n } else if (uri.indexOf('{'+param+'?}') !== -1) {\n\n uri = uri.replace('{'+param+'?}', value);\n\n } else {\n\n has_query = true;\n query[param] = value;\n }\n }\n });\n\n uri = uri.replace(/\\{.*?\\?}/g, ''); //remove optional params\n uri = uri.replace(/\\{.*?\\}/g, 'null'); //replace regular unfilled params with null\n uri = uri.replace(/\\/+$/, ''); //remove any unintended trailing slashes\n\n if (has_query) {\n uri+= '?'+qs.stringify(query);\n }\n\n return uri;\n\n }", "buildUrl() {\n let url = this.hostname;\n\n if (this.port !== 80) {\n url += ':' + this.port;\n }\n\n let path = this.path;\n if (path.substring(0, 1) !== '/') {\n path = '/' + path;\n }\n\n url += path;\n\n url = replaceUrlParams(url, this.givenArgs);\n url = url.replace('//', '/');\n url = 'https://' + url;\n return url;\n }", "function makeURI(name, type){\n\tif (name.indexOf(\"http://\") != 0){\n\t\tvar fragment = name.replace(/\\s+/g, '_'); // replace whitespaces\n\t\tname = \"http://hxl.carsten.io/\"+type.toLowerCase()+\"/\" + fragment.toLowerCase();\t\t\n\t}\t\n\treturn name;\n}", "function url(platform, controller, action)\n{\n return location.protocol + '//' + location.host + location.pathname + '?p=' + platform + '&c=' + controller + '&a=' + action;\n}", "toUrlAndQuery() {\r\n return `${super.toUrl()}?${Array.from(this.query).map((v) => v[0] + \"=\" + v[1]).join(\"&\")}`;\r\n }", "url(...args) {\n return this.app.url(`tokens/${this.token}`, ...args);\n }", "function Url(url,params){var self=this||{},options$$1=url,transform;if(isString(url)){options$$1={url:url,params:params};}options$$1=merge({},Url.options,self.$options,options$$1);Url.transforms.forEach(function(handler){if(isString(handler)){handler=Url.transform[handler];}if(isFunction(handler)){transform=factory(handler,transform,self.$vm);}});return transform(options$$1);}", "function generateURL(host, protocol, resourceType) {\n var url = new URL(\"http://{{host}}:{{ports[https][0]}}/common/security-features/subresource/\");\n url.protocol = protocol == Protocol.INSECURE ? \"http\" : \"https\";\n url.hostname = host == Host.SAME_ORIGIN ? \"{{host}}\" : \"{{domains[天気の良い日]}}\";\n\n if (resourceType == ResourceType.IMAGE) {\n url.pathname += \"image.py\";\n } else if (resourceType == ResourceType.FRAME) {\n url.pathname += \"document.py\";\n } else if (resourceType == ResourceType.WEBSOCKET) {\n url.port = {{ports[wss][0]}};\n url.protocol = protocol == Protocol.INSECURE ? \"ws\" : \"wss\";\n url.pathname = \"echo\";\n } else if (resourceType == ResourceType.WORKER) {\n url.pathname += \"worker.py\";\n } else if (resourceType == ResourceType.WORKLET) {\n url.pathname += \"worker.py\";\n } else if (resourceType == ResourceType.FETCH) {\n url.pathname += \"xhr.py\";\n }\n return {\n name: protocol + \"/\" + host + \" \" + resourceType,\n url: url.toString()\n };\n}", "url( pid, query ) {\n \n // Initialize the URL.\n let url = `${self.src}${self.endpoint}`;\n \n // Add query data if applicable.\n if( query ) url += this.query(true);\n \n // Add a unique id.\n url += (query ? '&' : '?') + `pid=${pid}`;\n\n // Return the URL.\n return url;\n\n }", "function formatForUrl(page) {\n var pageName = page.split('.');\n return pageName[0];\n}", "function getUrlController(){\n var t = jQuery(\"#url-page\").html();\n return t;\n //var split = t.split(\"/\");\n //console.debug(t.replace(\"/\"+split[split.length-1], \"/ajax-\"+split[split.length-1]));\n //return t.replace(\"/\"+split[split.length-1], \"/ajax-\"+split[split.length-1]);\n}", "url() {\n const params = {};\n\n if (this.options.start !== undefined) {\n params.start = this.options.start;\n }\n\n if (this.options.branch !== undefined) {\n params.branch = this.options.branch;\n }\n\n return this.options.urlBase + '?' + $.param(params);\n }", "function generateURL(host, protocol, resourceType) {\n var url = new URL(\"http://{{host}}:{{ports[https][0]}}/upgrade-insecure-requests/support/\");\n url.protocol = protocol == Protocol.INSECURE ? \"http\" : \"https\";\n url.hostname = host == Host.SAME_ORIGIN ? \"{{host}}\" : \"{{domains[天気の良い日]}}\";\n\n if (resourceType == ResourceType.IMAGE) {\n url.pathname += \"pass.png\";\n } else if (resourceType == ResourceType.FRAME) {\n url.pathname += \"post-origin-to-parent.html\";\n } else if (resourceType == ResourceType.WEBSOCKET) {\n url.port = {{ports[wss][0]}};\n url.protocol = protocol == Protocol.INSECURE ? \"ws\" : \"wss\";\n url.pathname = \"echo\";\n }\n return {\n name: protocol + \"/\" + host + \" \" + resourceType,\n url: url.toString()\n };\n}", "createURL() {\n\t\tthis.finalURL = [];\n\t\tthis.apiURL.map((name, index, arr) => {\n\t\t\tindex === 0 || index === 1\n\t\t\t\t? this.finalURL.push(name)\n\t\t\t\t: index === arr.length - 1\n\t\t\t\t? this.finalURL.push(`|${name}&display=swap`)\n\t\t\t\t: this.finalURL.push(`|${name}`);\n\t\t});\n\n\t\tlet finalURL = this.finalURL.join(\"\");\n\t\tlet linkUrl = document.createElement(\"link\");\n\t\tlinkUrl.setAttribute(\"href\", `${finalURL}`);\n\t\tlinkUrl.setAttribute(\"rel\", \"stylesheet\");\n\t\tlinkUrl.setAttribute(\"id\", \"fonts-url\");\n\n\t\tlet HTMLlink = document.getElementById(\"fonts-url\");\n\n\t\tif (HTMLlink) {\n\t\t\tHTMLlink.remove();\n\t\t\tdocument.head.appendChild(linkUrl);\n\t\t} else document.head.appendChild(linkUrl);\n\t}", "function buildUrl(searchTerm){\n return {\n s: searchTerm,\n r: \"json\"\n }\n }", "function url(pattern, id, p1, p2, p3, p4) {\n var pattern2 = pattern.\n replace(\"@@id@@\", id)\n .replace(\"__p1__\", p1)\n .replace(\"__p2__\", p2)\n .replace(\"__p3__\", p3)\n .replace(\"__p4__\", p4);\n return pattern2;\n}", "function makeurl( path ) {\n if (path.indexOf(\"://\") > 0) return path;\n return url + \"/\" + path;\n }", "function createURL() {\n var query_url = api_url.concat(patientID,auth,accessToken);\n actualQuery();\n }", "function modifyTourUri(){\n\t\tserverUri = Parameters.getTourServerUri() + \"/path\";\n\t}", "GET() {\n }", "function modifyPublishURL () {\n var path = window.location.pathname,\n // composite id\n cId = path.split('/').slice(-1)[0].split('-'),\n owner = cId[0],\n collectionId = cId.slice(1).join('-'),\n params = $.param({\n collection_id : collectionId,\n owner: owner,\n collection_name: initialJson.collection.info.name\n }),\n // Stupid hack , remove when you change the Publish button to do a form POST\n href = ($(this).attr('href').indexOf('meta') > 0) ? $(this).attr('href') :\n ($(this).attr('href') + '?meta=' + window.btoa(params));\n\n $(this).attr('href', href);\n}", "get url() {\n return `/api/projects/index/${this.projectId}`\n }", "generateReqUrl() {\n this.url = `https://api.openweathermap.org/data/2.5/weather?q=${this.loc}&appid=${this.apiKey}${this.units}${this.lang}${this.mode}`;\n this.query ? this.url += `&${queryString.stringify(this.query)}` : this.url;\n \n }", "gotoListPage() {\n goto.route('/snippets');\n }", "function path() {\n return \"/help/taskHelp\";\n}", "function buildUrl(name) {\n return \"https://api.github.com/users/\"+name;\n }", "function makeUrl(url, parameters) {\r\n\tfor(p in parameters) url = url.replace('%'+p+'%', parameters[p])\r\n\treturn url;\r\n}", "function makeUrl(params)\n{\n var ret = SGL_JS_FRONT_CONTROLLER != ''\n ? SGL_JS_WEBROOT + '/' + SGL_JS_FRONT_CONTROLLER\n : SGL_JS_WEBROOT;\n var moduleName = params.module ? params.module : '';\n var managerName = params.manager ? params.manager : moduleName;\n\n switch (SGL_JS_URL_STRATEGY) {\n\n // make classic URL\n case 'SGL_UrlParser_ClassicStrategy':\n if (ret.charAt(ret.length - 1) != '?') {\n ret = ret + '?';\n }\n ret = ret + 'moduleName=' + escape(moduleName) + '&managerName=' + escape(managerName);\n for (x in params) {\n if (x == 'module' || x == 'manager') {\n continue;\n }\n // add param\n ret = '&' + ret + escape(x) + '=' + escape(params[x]);\n }\n break;\n\n // make default Seagull SEF URL\n default:\n ret = ret + '/' + escape(moduleName) + '/' + escape(managerName) + '/';\n for (x in params) {\n if (x == 'module' || x == 'manager') {\n continue;\n }\n ret = ret + escape(x) + '/' + escape(params[x]) + '/';\n }\n break;\n }\n return ret;\n}", "function resource_url() {\n if (window.location.hash) {\n resource = window.location.hash.substring(1);\n \treturn base_url() + resource;\n } else {\n return base_url_no_slash();\n }\n}", "function apiurltemplatejob(Id,IdT){\n return `${apiurljobgrouptemplate}/${Id}/TemplateJobs/${IdT}`;\n}", "function createURL(urlText){\n const URL= \"https://api.funtranslations.com/translate/klingon.json\" + \"?\"+\"text=\" + urlText;//The text act as a Key and the value is urlText.\n return URL; \n}", "function generateGetURL(path, data){\n\tvar i = 0;\n\tvar url = base_url + path;\n\tfor (i=0; i<data.length; i++){\n\t\tif (isNaN(data[i]) && data[i].indexOf(\"/\") > 0){\n\t\t\tstep1 = data[i].replace('/','-');\n\t\t\tstep2 = step1.replace('/','-');\n\t\t\tdata[i] = step2;\t\t\t\n\t\t}\n\t\telse if (data[i]==\"\"){\n\t\t\tdata[i] = '-';\n\t\t}\n\t\turl = url + encodeURIComponent(data[i]) + \"/\";\t\t\n\t}\n\turl = url.substring(0, url.length -1);\n\treturn decodeURIComponent(url);\n}", "function urlCreator(reqBody) {\r\n fromPlace = reqBody.fromPlace;\r\n toPlace = reqBody.toPlace;\r\n startTime = reqBody.startTime;\r\n startDate = reqBody.startDate;\r\n return url = 'http://' + otpHost + '/otp/routers/default/plan?fromPlace=' + fromPlace + '&toPlace=' + toPlace + '&time=' + startTime + '&date=' + startDate + '&mode=TRANSIT,WALK&maxWalkDistance=500&arriveBy=false';\r\n}", "static toURL(model, query, fields) {\n const queries = [];\n if (fields && fields.length > 0) {\n queries.push(...this.packViewedFields(fields));\n }\n if (query) {\n if (query.pre) {\n queries.push(...this.packMatchRules(this.PreMatchPrefix, model, query.pre));\n }\n if (query.post) {\n queries.push(...this.packMatchRules(this.PostMatchPrefix, model, query.post));\n }\n if (query.sort) {\n queries.push(...this.packSort(model, query.sort));\n }\n if (query.limit) {\n queries.push(...this.packLimit(query.limit));\n }\n }\n return queries.length ? `${this.QueryPrefix}/${queries.join('/')}` : ``;\n }", "function buildUrl() {\n let url = [];\n\n // For each base skill\n for (let bsId in skills) {\n\n let bsLevel = skills[bsId].level;\n url += bsId + bsLevel; // add base skill id and level to url\n\n // find perks\n for (let pId in skills[bsId].perks) {\n let pLevel = skills[bsId].perks[pId].level; // add perk id and perk level to url\n url += pId + pLevel;\n }\n url += 'x'; // add splitter to url\n }\n url = url.slice(0, -1); // remove last splitter from url\n window.history.replaceState(\"\", \"\", window.location.pathname + \"?s=\" + url); // update url\n}", "async createPermalink () {\n\t\tawait this.createLink();\t// create the link as needed\n\t\tawait this.updateCodemark();\t// update the codemark as needed\n\t\treturn this.url;\n\t}", "function _createURL() {\n\t return createURL(state.toggleRefinement(attributeName, isRefined));\n\t }", "function definePage() {\n var fullURL = window.location.href;\n var splitURL = fullURL.split(\"\"); \n var holder = [];\n\n for(i = splitURL.length-1; i > splitURL.length-9; i--) {\n holder.push(splitURL[i]);\n }\n\n holder.reverse();\n \n userURL = holder.join(\"\");\n }", "function generateURL(filters, tab, reportObj) {\n var reportPage = `/gdc/md/${gd_project}/obj/${reportObj}&title=yes`;\n var gd_fragment = `project=/gdc/projects/${gd_project}&report=${reportPage}`;\n return `${gd_host}#${gd_fragment}&tab=${tab}&nochrome=true`;\n}", "function u(path) {\n return BASE_URL + path;\n }", "function url(id) {\n var basedir = getCallsiteDirname();\n return 'url(' + requireAssets(id, basedir) + ')';\n}", "static get PATTERN(){\n\t\treturn /(?:https?:\\/\\/[\\w\\.]+(?::\\d+)?)?((?:\\/\\w+\\/\\w+)\\/([\\w-]+)\\/?((?:\\/)?[\\w-]+)?\\/([\\w-]+\\.html).*)/;\n\t}" ]
[ "0.67540354", "0.6710016", "0.66048586", "0.6517271", "0.6517271", "0.6517271", "0.6517271", "0.6517271", "0.6517271", "0.6517271", "0.6517271", "0.6517271", "0.6473835", "0.6468381", "0.6468381", "0.6464805", "0.6442212", "0.64154816", "0.6373655", "0.6291472", "0.629056", "0.6269153", "0.62688756", "0.6267538", "0.62160575", "0.62016296", "0.6180618", "0.613015", "0.60630065", "0.6052103", "0.5993983", "0.5979878", "0.59735394", "0.59421724", "0.59282815", "0.5909615", "0.58942306", "0.5874359", "0.58589953", "0.58472276", "0.58468246", "0.58352953", "0.58249176", "0.5818337", "0.58080345", "0.5797148", "0.5792898", "0.57901436", "0.5783447", "0.5770403", "0.57636493", "0.5757765", "0.5746494", "0.5746291", "0.57381105", "0.57357687", "0.5733529", "0.57240695", "0.57142556", "0.57091355", "0.5703146", "0.57030743", "0.5690902", "0.56847256", "0.568354", "0.5673918", "0.5661792", "0.56582475", "0.5642742", "0.56368643", "0.5619316", "0.5618905", "0.561632", "0.56158864", "0.5615011", "0.56102383", "0.5610044", "0.5603182", "0.55974424", "0.5597067", "0.5591872", "0.55899966", "0.55886245", "0.5584596", "0.5578227", "0.55750024", "0.5574455", "0.5565593", "0.55540603", "0.5552447", "0.5549972", "0.5545447", "0.55364484", "0.5532616", "0.5528392", "0.55268145", "0.5514802", "0.55145144", "0.551267", "0.5510099", "0.551008" ]
0.0
-1
URL Template (RFC 6570) Transform.
function template (options) { var variables = [], url = expand(options.url, options.params, variables); variables.forEach(function (key) { delete options.params[key]; }); return url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createUrl(tpl, variables) {\r\n return tpl.replace(/\\{([^\\}]+)\\}/g, function (variable, key) {\r\n return key in variables ? variables[key] : variable;\r\n });\r\n }", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template(options) {\n var variables = [],\n url = expand(options.url, options.params, variables);\n variables.forEach(function (key) {\n delete options.params[key];\n });\n return url;\n}", "function template (options) {\n\n var variables = [],\n url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [],\n url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function populateUrlTemplate(template, extent, width, height) {\n let bbox = [extent.xmin, extent.ymin, extent.xmax, extent.ymax].map(x => x.toFixed(5));\n let result = template.replace(\"${bbox}\", bbox.join(','));\n result = result.replace(\"${width}\", width);\n result = result.replace(\"${height}\", height);\n return(result);\n }", "function makeUrl ($name, $data) {\n var $template = $templates[$name];\n\n $data['summary'] = $data['description'];\n\n for (var $key in $data) {\n var $camelCaseKey = $name + $key.replace(/^[a-z]/, function($str){\n return $str.toUpperCase();\n });\n\n var $value = encodeURIComponent($data[$camelCaseKey] || $data[$key]);\n $template = $template.replace(new RegExp('{{'+$key.toUpperCase()+'}}', 'g'), $value);\n }\n\n return $template;\n }", "function Url(url,params){var self=this||{},options$$1=url,transform;if(isString(url)){options$$1={url:url,params:params};}options$$1=merge({},Url.options,self.$options,options$$1);Url.transforms.forEach(function(handler){if(isString(handler)){handler=Url.transform[handler];}if(isFunction(handler)){transform=factory(handler,transform,self.$vm);}});return transform(options$$1);}", "function _createURL()\n { var arr\n\n if(arguments.length === 1) arr=arguments[0]\n else arr = arguments\n\n var url = _transaction.server.location\n\n // arr:['route', 'article', 54 ] => str:\"/route/article/54\"\n for (var i=0; i<arr.length; i++){\n url += '/';\n if (arr[i] in _transaction.server)\n url += _transaction.server[arr[i]];\n else if (arr[i]+'Path' in _transaction.server)\n url += _transaction.server[arr[i]+'Path'];\n else\n url += arr[i]\n }\n\n return url;\n }", "function url(pattern, id, p1, p2, p3, p4) {\n var pattern2 = pattern.\n replace(\"@@id@@\", id)\n .replace(\"__p1__\", p1)\n .replace(\"__p2__\", p2)\n .replace(\"__p3__\", p3)\n .replace(\"__p4__\", p4);\n return pattern2;\n}", "function url() {\n var u = a + b + c + d\n return u\n }", "function demoTemplate({\n url\n}) {\n return `Go here to see a demo <a href=\"${url}\">${url}</a>.`;\n}", "function createUrl(item) {\n var urlObj = {\n protocol: config.HOST.protocol,\n slashes: config.HOST.slashes,\n auth: config.HOST.auth,\n host: config.HOST.host,\n hostname: config.HOST.hostname,\n hash: config.HOST.hash,\n query: item,\n pathname: config.HOST.pathname\n }\n var urlString = url.format(urlObj);\n return urlString\n}", "function makeUrl(url, parameters) {\r\n\tfor(p in parameters) url = url.replace('%'+p+'%', parameters[p])\r\n\treturn url;\r\n}", "function dust_url(opts, chunk, ctx, bodies, params) {\n\tvar url = dust.helpers.tap(params.url, chunk, ctx);\n\n\t// Only prepend our base url if we're looking for something relative to it\n\tif (url[0] == '/')\n\t\treturn chunk.write(opts.base_url + url);\n\telse\n\t\treturn chunk.write(url);\n}", "function makeUrl(protocol, host, resource, id) {\n return protocol + \"://\" + host + resource + id;\n}", "function makeUrl(s){\r\n var ts=s.replace('\\\\','');\r\n var arr=ts.split(':');\r\n var url=arr[1]+':'+arr[2]; \r\n return url; \r\n}", "url(urls: Array<string>, scheme: ?string) {\n const bbox = WhooTS.getTileBBox(this.x, this.y, this.z);\n const quadkey = getQuadkey(this.z, this.x, this.y);\n\n return urls[(this.x + this.y) % urls.length]\n .replace('{prefix}', (this.x % 16).toString(16) + (this.y % 16).toString(16))\n .replace('{z}', String(this.z))\n .replace('{x}', String(this.x))\n .replace('{y}', String(scheme === 'tms' ? (Math.pow(2, this.z) - this.y - 1) : this.y))\n .replace('{quadkey}', quadkey)\n .replace('{bbox-epsg-3857}', bbox);\n }", "function makeUrl() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.reduce(function (acc, cur) { return url_join_1[\"default\"](acc, cur); });\n}", "function initTemplateStringTransformerFromUrl(url, callback) {\n\t graphQLFetcher(url, { query: _introspectionQuery.introspectionQuery }).then(function (result) {\n\t var schemaJson = result.data;\n\t callback(initTemplateStringTransformer(schemaJson));\n\t });\n\t}", "function genUrl(opts, path$$1) {\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t var pathDel = !opts.path ? '' : '/';\n\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t return opts.protocol + '://' + opts.host +\n\t (opts.port ? (':' + opts.port) : '') +\n\t '/' + opts.path + pathDel + path$$1;\n\t}", "function makeUrl() {\n let args = Array.from(arguments);\n return args.reduce(function (acc, cur) {\n return urljoin(acc, cur);\n });\n}", "function generateUrlTalents(talents) {\n var url = [];\n\n for (var t in talents) {\n url.push(talents[t]);\n }\n\n return encodeTalents(url.join(''));\n }", "function transformUrl(params) {\n var endPoint = _endPointsHttp[0];\n var url = params.url;\n var urlParams = params.params;\n if (urlParams) {\n\n var paramsStr = JSON.stringify(params);\n var paramsParams64 = encodeURIComponent(escape(btoa(unescape(encodeURIComponent(paramsStr)))));\n url += '?params64=' + paramsParams64;\n }\n\n var str = JSON.stringify({\n url: url\n });\n var params64 = encodeURIComponent(escape(btoa(unescape(encodeURIComponent(str)))));\n var resultUrl = endPoint + \"/getProxyUrl?params64=\" + params64;\n //var resultUrl = params64;\n return resultUrl;\n}", "function URLDecompositionAttributes() {}", "function createURL(urlText){\n const URL= \"https://api.funtranslations.com/translate/klingon.json\" + \"?\"+\"text=\" + urlText;//The text act as a Key and the value is urlText.\n return URL; \n}", "static tempURL(ctx, container, filename, method, duration) {\n\n if(!duration)\n duration = 86400;\n\n let secret = ctx._secret(container);\n\n let dst = ctx._endpoint(container, filename);\n let expires = Math.floor(Date.now() / 1000 + duration);\n //pathname does not contains querystring\n let hmac_body = [method || 'GET', expires, decodeURIComponent(dst.pathname)].join(\"\\n\");\n\n var sig = hmac('sha1', secret, hmac_body);\n\n dst.search = encode({...decode(dst.query), temp_url_sig : sig, temp_url_expires : expires});\n return url.format(dst);\n }", "function Url(url, params) {\n\t\n\t var self = this || {}, options$$1 = url, transform;\n\t\n\t if (isString(url)) {\n\t options$$1 = {url: url, params: params};\n\t }\n\t\n\t options$$1 = merge({}, Url.options, self.$options, options$$1);\n\t\n\t Url.transforms.forEach(function (handler) {\n\t\n\t if (isString(handler)) {\n\t handler = Url.transform[handler];\n\t }\n\t\n\t if (isFunction(handler)) {\n\t transform = factory(handler, transform, self.$vm);\n\t }\n\t\n\t });\n\t\n\t return transform(options$$1);\n\t}", "function Url(url, params) {\n\t\n\t var self = this || {}, options$$1 = url, transform;\n\t\n\t if (isString(url)) {\n\t options$$1 = {url: url, params: params};\n\t }\n\t\n\t options$$1 = merge({}, Url.options, self.$options, options$$1);\n\t\n\t Url.transforms.forEach(function (handler) {\n\t transform = factory(handler, transform, self.$vm);\n\t });\n\t\n\t return transform(options$$1);\n\t}", "function expand(url,params,variables){var tmpl=parse(url),expanded=tmpl.expand(params);if(variables){variables.push.apply(variables,tmpl.vars);}return expanded;}", "function expand(url,params,variables){var tmpl=parse(url),expanded=tmpl.expand(params);if(variables){variables.push.apply(variables,tmpl.vars);}return expanded;}", "function createUrl(val){\n return `http://localhost:3000/api/${val}`;\n \n}", "function c0_ReplUrl(str)\t\t// Replaces urls to links...\r\n{\r\nvar str2=str;\r\nfor(;;)\r\n{\r\n var urls='';\r\n var at=str2.indexOf(\"http://\");\r\n if(at>=0) var urls=\"HTTP://\" + str2.substr(at+7);\r\n else\r\n {\r\n at=str2.indexOf(\"https://\");\r\n if(at>=0) urls=\"HTTPS://\" + str2.substr(at+8);\r\n }\r\n if(urls.length>0)\r\n {\r\n at2=urls.indexOf(\" \");\r\n if(at2>=0) urls=urls.substr(0,at2);\r\n\r\n str2=str2.substr(0,at) + '<a href=\"' +urls + '\" target=\"blank\" >link»</a>' + str2.substr(at +urls.length);\r\n }\r\n else break;\r\n}\r\n\r\nstr2= c0_ReplaceAll( str2, 'HTTP://', 'http://' );\r\nstr2= c0_ReplaceAll( str2, 'HTTPS://', 'https://' );\r\n\r\nreturn(str2);\r\n}", "function create_url(endpoint) {\n // TODO: ここを書き換えてURL作る\n // return '/api/guchi' + endpoint\n return URL_BASE + '/deai/' + endpoint;\n}", "function createTranslationUrl(word, format=\"\", sourceDest = undefined) {\n var language = sourceDest || prefs.prefs[\"translate.source\"]+prefs.prefs[\"translate.destination\"];\n return \"http://api.wordreference.com/b583b/\"+format+\"/\"+language+\"/\"+word;\n}", "get (...args) {\n\n\t\t// TODO: Set a default url path if one isn't added as a string in the second param,\n\t\t// or if one exists in the second param object. Look for url.\n\n this.template(...args)\n }", "function makeOldURL () {\n const { paths, hosts } = transformToOld({\n paths: pathname.split('/')\n })\n return `http://${hosts.map(el => el + '.').join('')}atcoder.jp/${paths.join(\n '/'\n )}`\n }", "function formatNewsURL(state) {\n let urlString = newsURL + state;\n return urlString\n}", "function Url(url, params) {\n\t var self = this || {},\n\t options$$1 = url,\n\t transform;\n\n\t if (isString(url)) {\n\t options$$1 = {\n\t url: url,\n\t params: params\n\t };\n\t }\n\n\t options$$1 = merge({}, Url.options, self.$options, options$$1);\n\t Url.transforms.forEach(function (handler) {\n\t if (isString(handler)) {\n\t handler = Url.transform[handler];\n\t }\n\n\t if (isFunction(handler)) {\n\t transform = factory(handler, transform, self.$vm);\n\t }\n\t });\n\t return transform(options$$1);\n\t}", "function parseUrl (ast) {\n let [firstAgument] = ast.arguments;\n let rawUrl = firstAgument.raw;\n let url = rawUrl.replace(/^\\//, '').replace(/\\/$/, '').replace(/\\\\/g,'');\n assert(url);\n return url;\n }", "function generateUrl(urlScheme) {\n var url = urlScheme;\n\n // If query exist\n if (query.length > 0) {\n url = url.replace(/__query__/g, query.val());\n }\n\n // If group exist\n if (group.length > 0) {\n url = url.replace(/__group__/g, group.val());\n }\n\n url = url.replace(/__page__/g, 1);\n\n return url;\n }", "function makeURI(name, type){\n\tif (name.indexOf(\"http://\") != 0){\n\t\tvar fragment = name.replace(/\\s+/g, '_'); // replace whitespaces\n\t\tname = \"http://hxl.carsten.io/\"+type.toLowerCase()+\"/\" + fragment.toLowerCase();\t\t\n\t}\t\n\treturn name;\n}", "static getContextStringForUrl(url) {\n let initialUrl = url;\n if (url.startsWith(\"http://\")) {\n url = url.substr(7)\n } else if (url.startsWith(\"https://\")) {\n url = url.substr(8)\n }\n\n let host = url.substr(0, url.indexOf(\"/\"));\n\n console.log(\"picking host=\" + host + \" for url \" + initialUrl);\n return host\n }", "function _render (url) {\r\n if (null != exports.ttQueryStr && '' != exports.ttQueryStr)\r\n {\r\n var m = url.match(\"\\\\.[a-zA-Z]+\\\\?\");\r\n if (null != m && 0 < m.length)\r\n {\r\n if (url.indexOf('?') == (url.length-1))\r\n {\r\n url = url + exports.ttQueryStr;\r\n } else {\r\n url = url + '&' + exports.ttQueryStr;\r\n }\r\n } else {\r\n url = url + '?' + exports.ttQueryStr;\r\n }\r\n\r\n //console.log(\"render:\",url);\r\n }\r\n\r\n return url;\r\n }", "function URLUtils() {}", "function _parseTemplate(t) {\n t = '' + t; // Make sure it's a string.\n t = t.replace(/\\\\\\\\/g, '@@@BACKWARD-SLASH@@@'); // We want to preserve real backward slashes.\n t = t.replace(/\\\\\\(/g, '@@@BRACKET-OPEN@@@'); // Same for opening brackets.\n t = t.replace(/\\\\\\)/g, '@@@BRACKET-CLOSE@@@'); // Same for closing brackets.\n t = t.replace(/\\$\\(([^)]*)\\)/g, \"$1\");\n t = t.replace(/@@@BRACKET-CLOSE@@@/g, ')');\n t = t.replace(/@@@BRACKET-OPEN@@@/g, '(');\n t = t.replace(/@@@BACKWARD-SLASH@@@/g, '/');\n\n return t;\n}", "function Url(url, params) {\n\n var self = this || {}, options$$1 = url, transform;\n\n if (isString(url)) {\n options$$1 = {url: url, params: params};\n }\n\n options$$1 = merge({}, Url.options, self.$options, options$$1);\n\n Url.transforms.forEach(function (handler) {\n\n if (isString(handler)) {\n handler = Url.transform[handler];\n }\n\n if (isFunction(handler)) {\n transform = factory(handler, transform, self.$vm);\n }\n\n });\n\n return transform(options$$1);\n}", "function Url(url, params) {\n\n var self = this || {}, options$$1 = url, transform;\n\n if (isString(url)) {\n options$$1 = {url: url, params: params};\n }\n\n options$$1 = merge({}, Url.options, self.$options, options$$1);\n\n Url.transforms.forEach(function (handler) {\n\n if (isString(handler)) {\n handler = Url.transform[handler];\n }\n\n if (isFunction(handler)) {\n transform = factory(handler, transform, self.$vm);\n }\n\n });\n\n return transform(options$$1);\n}", "function Url(url, params) {\n\n var self = this || {}, options$$1 = url, transform;\n\n if (isString(url)) {\n options$$1 = {url: url, params: params};\n }\n\n options$$1 = merge({}, Url.options, self.$options, options$$1);\n\n Url.transforms.forEach(function (handler) {\n\n if (isString(handler)) {\n handler = Url.transform[handler];\n }\n\n if (isFunction(handler)) {\n transform = factory(handler, transform, self.$vm);\n }\n\n });\n\n return transform(options$$1);\n}", "function Url(url, params) {\n\n var self = this || {}, options$$1 = url, transform;\n\n if (isString(url)) {\n options$$1 = {url: url, params: params};\n }\n\n options$$1 = merge({}, Url.options, self.$options, options$$1);\n\n Url.transforms.forEach(function (handler) {\n\n if (isString(handler)) {\n handler = Url.transform[handler];\n }\n\n if (isFunction(handler)) {\n transform = factory(handler, transform, self.$vm);\n }\n\n });\n\n return transform(options$$1);\n}", "function Url(url, params) {\n\n var self = this || {}, options$$1 = url, transform;\n\n if (isString(url)) {\n options$$1 = {url: url, params: params};\n }\n\n options$$1 = merge({}, Url.options, self.$options, options$$1);\n\n Url.transforms.forEach(function (handler) {\n\n if (isString(handler)) {\n handler = Url.transform[handler];\n }\n\n if (isFunction(handler)) {\n transform = factory(handler, transform, self.$vm);\n }\n\n });\n\n return transform(options$$1);\n}", "function Url(url, params) {\n\n var self = this || {}, options$$1 = url, transform;\n\n if (isString(url)) {\n options$$1 = {url: url, params: params};\n }\n\n options$$1 = merge({}, Url.options, self.$options, options$$1);\n\n Url.transforms.forEach(function (handler) {\n\n if (isString(handler)) {\n handler = Url.transform[handler];\n }\n\n if (isFunction(handler)) {\n transform = factory(handler, transform, self.$vm);\n }\n\n });\n\n return transform(options$$1);\n}", "function Url(url, params) {\n\n var self = this || {}, options$$1 = url, transform;\n\n if (isString(url)) {\n options$$1 = {url: url, params: params};\n }\n\n options$$1 = merge({}, Url.options, self.$options, options$$1);\n\n Url.transforms.forEach(function (handler) {\n\n if (isString(handler)) {\n handler = Url.transform[handler];\n }\n\n if (isFunction(handler)) {\n transform = factory(handler, transform, self.$vm);\n }\n\n });\n\n return transform(options$$1);\n}", "function Url(url, params) {\n\n var self = this || {}, options$$1 = url, transform;\n\n if (isString(url)) {\n options$$1 = {url: url, params: params};\n }\n\n options$$1 = merge({}, Url.options, self.$options, options$$1);\n\n Url.transforms.forEach(function (handler) {\n\n if (isString(handler)) {\n handler = Url.transform[handler];\n }\n\n if (isFunction(handler)) {\n transform = factory(handler, transform, self.$vm);\n }\n\n });\n\n return transform(options$$1);\n}", "function Url(url, params) {\n\n var self = this || {}, options$$1 = url, transform;\n\n if (isString(url)) {\n options$$1 = {url: url, params: params};\n }\n\n options$$1 = merge({}, Url.options, self.$options, options$$1);\n\n Url.transforms.forEach(function (handler) {\n\n if (isString(handler)) {\n handler = Url.transform[handler];\n }\n\n if (isFunction(handler)) {\n transform = factory(handler, transform, self.$vm);\n }\n\n });\n\n return transform(options$$1);\n}", "function Url(url, params) {\n\n var self = this || {}, options$$1 = url, transform;\n\n if (isString(url)) {\n options$$1 = {url: url, params: params};\n }\n\n options$$1 = merge({}, Url.options, self.$options, options$$1);\n\n Url.transforms.forEach(function (handler) {\n\n if (isString(handler)) {\n handler = Url.transform[handler];\n }\n\n if (isFunction(handler)) {\n transform = factory(handler, transform, self.$vm);\n }\n\n });\n\n return transform(options$$1);\n}", "function Url(url, params) {\n\n var self = this || {}, options$$1 = url, transform;\n\n if (isString(url)) {\n options$$1 = {url: url, params: params};\n }\n\n options$$1 = merge({}, Url.options, self.$options, options$$1);\n\n Url.transforms.forEach(function (handler) {\n\n if (isString(handler)) {\n handler = Url.transform[handler];\n }\n\n if (isFunction(handler)) {\n transform = factory(handler, transform, self.$vm);\n }\n\n });\n\n return transform(options$$1);\n}", "function Url(url, params) {\n\n var self = this || {}, options$$1 = url, transform;\n\n if (isString(url)) {\n options$$1 = {url: url, params: params};\n }\n\n options$$1 = merge({}, Url.options, self.$options, options$$1);\n\n Url.transforms.forEach(function (handler) {\n\n if (isString(handler)) {\n handler = Url.transform[handler];\n }\n\n if (isFunction(handler)) {\n transform = factory(handler, transform, self.$vm);\n }\n\n });\n\n return transform(options$$1);\n}", "link() {\n this._template = this._sbolDocument.lookupURI(this._template);\n this._variableComponents = this._sbolDocument.lookupURIs(this._variableComponents);\n }", "function makeurl( path ) {\n if (path.indexOf(\"://\") > 0) return path;\n return url + \"/\" + path;\n }", "function Url(url, params) {\n\n var self = this || {}, options$$1 = url, transform;\n\n if (isString(url)) {\n options$$1 = {url: url, params: params};\n }\n\n options$$1 = merge({}, Url.options, self.$options, options$$1);\n\n Url.transforms.forEach(function (handler) {\n transform = factory(handler, transform, self.$vm);\n });\n\n return transform(options$$1);\n}", "static _tag_32(v) {\n\t return new URL(v)\n\t }", "function urlRenderer() {\n\treturn function(value) {\n\t\tif (value) {\n\t\t\tvar url = \"\";\n\t\t\tvar label = \"\";\n\t\t\tvar s = value.split(\"\\n\");\n\t\t\tif (s.length == 2) {\n\t\t\t\turl = Ext.util.Format.htmlEncode(s[1]);\n\t\t\t\tlabel = Ext.util.Format.htmlEncode(s[0]) || url;\n\t\t\t}\n\t\t\telse {\n\t\t\t\turl = Ext.util.Format.htmlEncode(value);\n\t\t\t\tlabel = Ext.util.Format.htmlEncode(value);\n\t\t\t}\n\t\t\treturn \"<a href=\\\"\" + url + \"\\\" target=\\\"_blank\\\">\" + label + \"</a>\";\n\t\t}\n\t\treturn \"\";\n\t};\n}", "function expandUrls(string) {\n return `https://example.com/${urlify(string)}`\n}", "function renderUrl(url) {\n var divurl = document.querySelector('#url');\n var urltext = (url.length < 45) ? url : url.substr(0, 42) + '...';\n var anchor = document.createElement('a');\n anchor.href = url;\n anchor.innerText = urltext;\n divurl.appendChild(anchor);\n}", "function generateURL(host, protocol, resourceType) {\n var url = new URL(\"http://{{host}}:{{ports[https][0]}}/upgrade-insecure-requests/support/\");\n url.protocol = protocol == Protocol.INSECURE ? \"http\" : \"https\";\n url.hostname = host == Host.SAME_ORIGIN ? \"{{host}}\" : \"{{domains[天気の良い日]}}\";\n\n if (resourceType == ResourceType.IMAGE) {\n url.pathname += \"pass.png\";\n } else if (resourceType == ResourceType.FRAME) {\n url.pathname += \"post-origin-to-parent.html\";\n } else if (resourceType == ResourceType.WEBSOCKET) {\n url.port = {{ports[wss][0]}};\n url.protocol = protocol == Protocol.INSECURE ? \"ws\" : \"wss\";\n url.pathname = \"echo\";\n }\n return {\n name: protocol + \"/\" + host + \" \" + resourceType,\n url: url.toString()\n };\n}", "function generateGetURL(path, data){\n\tvar i = 0;\n\tvar url = base_url + path;\n\tfor (i=0; i<data.length; i++){\n\t\tif (isNaN(data[i]) && data[i].indexOf(\"/\") > 0){\n\t\t\tstep1 = data[i].replace('/','-');\n\t\t\tstep2 = step1.replace('/','-');\n\t\t\tdata[i] = step2;\t\t\t\n\t\t}\n\t\telse if (data[i]==\"\"){\n\t\t\tdata[i] = '-';\n\t\t}\n\t\turl = url + encodeURIComponent(data[i]) + \"/\";\t\t\n\t}\n\turl = url.substring(0, url.length -1);\n\treturn decodeURIComponent(url);\n}", "createShortenedListURL(params) {\n return ApiService.post('/link', { url: params.url });\n }", "function createURI(scheme: string, hostname: string, basePath: string, outputDirectory: string, slug: string, createAbsoluteURI: boolean, callback: Function)\n{\n let err;\n let URI = \"\";\n\n // Ensure that if we need it, the scheme is valid (for a website - might we ever need file: etc.?)\n if(scheme === \"http:\" || scheme === \"https:\" || createAbsoluteURI === false)\n {\n if(hostname.length)\n {\n if(slug.length)\n {\n // First, calculate the path component for this content type so we can add it to the basePath below\n const parsedPath = path.parse(outputDirectory); \n const outputTLD = parsedPath.base;\n \n // Second, create just the hostname and path section of the URI, replacing any instances of >1 / with a single /\n const URN = `${basePath}/${outputTLD}/${slug}.html`.replace(/\\/{2,}/g, \"/\");\n\n if(createAbsoluteURI === true)\n {\n // Now join the above to the scheme and we're done\n const URIEnd = `${hostname}/${URN}`.replace(/\\/{2,}/g, \"/\");\n\n URI = `${scheme}//${URIEnd}`;\n }\n else\n {\n URI = `${URN}`;\n }\n }\n else\n {\n err = new TypeError(\"Argument 'slug' must be a non-empty string\");\n }\n }\n else\n {\n err = new TypeError(\"Argument 'hostname' must be a non-empty string\");\n }\n }\n else\n {\n err = new TypeError(\"Argument 'scheme' must be either 'http:' or 'https:'\");\n }\n\n return callback(err, URI);\n}", "function $Jb61$var$urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if ($XvGG$exports.isString(obj)) obj = $Jb61$var$urlParse(obj);\n if (!(obj instanceof $Jb61$var$Url)) return $Jb61$var$Url.prototype.format.call(obj);\n return obj.format();\n}", "function getCopyTemplateURL(spreadsheet) {\n var templateLink = getValue(spreadsheet, inputs, \"C4\"); // Get the normal link from the sheet\n var arrayLink = templateLink.split(\"/\"); // Split it into a array based on '/'\n arrayLink[arrayLink.length - 1] = \"copy\"; // Replace the last segment for the array with 'copy'\n return arrayLink.join(\"/\"); // Convert back to a string and return that\n}", "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util_11(obj)) obj = parse$1({}, obj);\n\t return format(obj);\n\t}", "buildUrl() {\n let url = this.hostname;\n\n if (this.port !== 80) {\n url += ':' + this.port;\n }\n\n let path = this.path;\n if (path.substring(0, 1) !== '/') {\n path = '/' + path;\n }\n\n url += path;\n\n url = replaceUrlParams(url, this.givenArgs);\n url = url.replace('//', '/');\n url = 'https://' + url;\n return url;\n }", "function generateURL(host, protocol, resourceType) {\n var url = new URL(\"http://{{host}}:{{ports[https][0]}}/common/security-features/subresource/\");\n url.protocol = protocol == Protocol.INSECURE ? \"http\" : \"https\";\n url.hostname = host == Host.SAME_ORIGIN ? \"{{host}}\" : \"{{domains[天気の良い日]}}\";\n\n if (resourceType == ResourceType.IMAGE) {\n url.pathname += \"image.py\";\n } else if (resourceType == ResourceType.FRAME) {\n url.pathname += \"document.py\";\n } else if (resourceType == ResourceType.WEBSOCKET) {\n url.port = {{ports[wss][0]}};\n url.protocol = protocol == Protocol.INSECURE ? \"ws\" : \"wss\";\n url.pathname = \"echo\";\n } else if (resourceType == ResourceType.WORKER) {\n url.pathname += \"worker.py\";\n } else if (resourceType == ResourceType.WORKLET) {\n url.pathname += \"worker.py\";\n } else if (resourceType == ResourceType.FETCH) {\n url.pathname += \"xhr.py\";\n }\n return {\n name: protocol + \"/\" + host + \" \" + resourceType,\n url: url.toString()\n };\n}", "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString$4(obj)) obj = parse$b({}, obj);\n\t return format(obj);\n\t}", "function formatForUrl(page) {\n var pageName = page.split('.');\n return pageName[0];\n}", "templatizeLocalLinks_(contents) {\n contents = contents.replace(patterns.newMarkdownLinkPattern(), (_, text, url, title='') => {\n return `[${ text }](${ this.templatizeLinkIfLocal_(url) }${ title })`;\n });\n contents = contents.replace(patterns.newHrefPattern(), (_, url) => {\n return `href=\"${ this.templatizeLinkIfLocal_(url) }\"`;\n });\n contents = contents.replace(patterns.newSrcPattern(), (_, url) => {\n return `src=\"${ this.templatizeLinkIfLocal_(url) }\"`;\n });\n\n return contents;\n }", "function _decorate_urls(text) {\n var pattern = XRegExp('[a-zA-z]+://[^\\\\s]*', 'g');\n return _decorate_process(text, pattern, function(m) {\n return '<span onclick=\"window.open(\\''+m+'\\', \\'_blank\\');\" class=\"content-link\">' + m + '</span>';\n });\n\n\n }", "static get PATTERN(){\n\t\treturn /(?:https?:\\/\\/[\\w\\.]+(?::\\d+)?)?((?:\\/\\w+\\/\\w+)\\/([\\w-]+)\\/?((?:\\/)?[\\w-]+)?\\/([\\w-]+\\.html).*)/;\n\t}", "function Url(url, params) {\n var self = this || {},\n options$$1 = url,\n transform;\n\n if (isString(url)) {\n options$$1 = {\n url: url,\n params: params\n };\n }\n\n options$$1 = merge({}, Url.options, self.$options, options$$1);\n Url.transforms.forEach(function (handler) {\n if (isString(handler)) {\n handler = Url.transform[handler];\n }\n\n if (isFunction(handler)) {\n transform = factory(handler, transform, self.$vm);\n }\n });\n return transform(options$$1);\n}", "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (isString(obj)) obj = parse$4({}, obj);\n\t return format$1(obj);\n\t}", "function render_url(text) {\n if (text.includes(\"http\")) {\n return \"<a href=\\\"\" + text + \"\\\" target=\\\"_blank\\\">Buy Here</a>\";\n } else {\n return text;\n }\n }", "function newUrl() {\n\trecordUrl();\n\n\tconstructUrlMarkup(2);\n}", "function makeShortUrl() {\n \n var text = \"\";\n var charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n\n for( var i=0; i < 5; i++ )\n text += charset.charAt(Math.floor(Math.random() * charset.length));\n \n var shortUrl = \"https://www.\" + text + \".com\";\n \n insertObj(url, shortUrl);\n \n }", "function substitutions_ECMA6() {\n let sub1 = `paypal`;\n let sub2 = `${sub1} is PYPL`;\n console.log(sub2);\n \n //TL inside of another TL\n let tl1 = `template literal 1`;\n \n let tl3 = `Hello, ${\n `this is ${ tl1 }`\n }.`; \n console.log( tl3);\n}", "function make2xUrl(url) {\n var dotIndex = url.lastIndexOf(\".\");\n var name = url.substr(0, dotIndex);\n var ext = url.substr(dotIndex + 1);\n return name + \"@2x.\" + ext;\n }", "function getSubPrep(x, req, res) {\n const url = strOp.subPrep(x);\n res.redirect(url);\n}", "function makeurl()\r\n\t{\r\n\t\tvar url = class_baseUrl + \"?func=ll&objAction=page&objID=\" + virtual_containerId + \"&page=\" + currentPageNum + \"&sort=\" + class_sortColumn;\r\n\r\n\t\t// add on the optional pieces\r\n\t\tif ( containerSubType !== \"\" ) \r\n\t\t{\r\n\t\t\turl += \"&objType=\" + containerSubType;\r\n\t\t}\r\n\t\tif ( filterValue !== \"\" )\r\n\t\t{\r\n\t\t\turl += \"&filterValue=\" + encodeURIComponent( filterValue );\r\n\t\t}\r\n\r\n\t\tif ( objFilter !== \"\" )\r\n\t\t{\r\n\t\t\turl += \"&objFilter=\" + objFilter;\r\n\t\t}\r\n\t\t\r\n\t\tif ( currentTab !== \"\" )\r\n\t\t\t\t{\r\n\t\t\t\t\turl += \"&tab=\" + encodeURIComponent( currentTab );\r\n\t\t}\r\n\t\t\r\n\t\tfor ( var key in contentFilter ) \r\n\t\t{\r\n\t\t\tfor ( var i = 0; i < contentFilter[ key ].length; i ++ ) \r\n\t\t\t{\r\n\t\t\t\turl += \"&\" + key + \"=\" + encodeURIComponent( contentFilter[ key ][ i ] );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn url;\r\n\t}", "function castToUrl(s) {\n var scheme = /^[a-z][a-z0-9+\\-.]+:/i;\n var email = /^[^\\s]+@[^\\s\\/]+$/i;\n \n if (scheme.test(s)) {\n return s;\n } else if (email.test(s)) {\n return 'mailto:' + s;\n } else {\n return 'http://' + s;\n }\n }", "function createURL (text){ \n text = text.toLowerCase(); \n text = text.replace(new RegExp('[ÁÀÂÃ]','gi'), 'a');\n text = text.replace(new RegExp('[ÉÈÊ]','gi'), 'e');\n text = text.replace(new RegExp('[ÍÌÎ]','gi'), 'i');\n text = text.replace(new RegExp('[ÓÒÔÕ]','gi'), 'o');\n text = text.replace(new RegExp('[ÚÙÛ]','gi'), 'u');\n text = text.replace(new RegExp('[Ç]','gi'), 'c');\n text = text.replace(new RegExp('[ ]','gi'), '-');\n text = text.replace(new RegExp('[,]','gi'), '');\n return text; \n}", "function makeurl(path) {\n if (path.indexOf(\"://\") > 0) {\n return path;\n }\n return url + \"/\" + path;\n }", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n }" ]
[ "0.6925154", "0.6760309", "0.6760309", "0.6760309", "0.6760309", "0.6760309", "0.6760309", "0.6760309", "0.6760309", "0.6760309", "0.67563975", "0.67365557", "0.67365557", "0.63542056", "0.6199783", "0.6060413", "0.6001007", "0.59438264", "0.5925711", "0.58712894", "0.584286", "0.57896423", "0.5752328", "0.5678791", "0.5666349", "0.56584954", "0.5656169", "0.56351554", "0.5598685", "0.55668116", "0.5504522", "0.5466531", "0.54521406", "0.5451328", "0.54442906", "0.5438969", "0.54335856", "0.543285", "0.543285", "0.5412368", "0.5398584", "0.53972846", "0.5393346", "0.5386867", "0.5385108", "0.537623", "0.5362003", "0.5348076", "0.5340261", "0.53306496", "0.5327507", "0.53186154", "0.531816", "0.5317605", "0.53148633", "0.53148633", "0.53148633", "0.53148633", "0.53148633", "0.53148633", "0.53148633", "0.53148633", "0.53148633", "0.53148633", "0.53148633", "0.53148633", "0.53068215", "0.5303834", "0.5296941", "0.5290937", "0.5289245", "0.52890164", "0.52872723", "0.52865255", "0.52762413", "0.52737504", "0.5270151", "0.5263769", "0.5257598", "0.52564", "0.52469546", "0.52447534", "0.5235791", "0.52343357", "0.5226365", "0.5226268", "0.52237576", "0.5210663", "0.52069396", "0.51991355", "0.5188525", "0.51874644", "0.51753813", "0.5175163", "0.51708317", "0.5165643", "0.5163228", "0.5162195", "0.51578516", "0.5140467" ]
0.6883055
1
Service for URL templating.
function Url(url, params) { var self = this || {}, options$$1 = url, transform; if (isString(url)) { options$$1 = { url: url, params: params }; } options$$1 = merge({}, Url.options, self.$options, options$$1); Url.transforms.forEach(function (handler) { if (isString(handler)) { handler = Url.transform[handler]; } if (isFunction(handler)) { transform = factory(handler, transform, self.$vm); } }); return transform(options$$1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function demoTemplate({\n url\n}) {\n return `Go here to see a demo <a href=\"${url}\">${url}</a>.`;\n}", "function template(options) {\n var variables = [],\n url = expand(options.url, options.params, variables);\n variables.forEach(function (key) {\n delete options.params[key];\n });\n return url;\n}", "function template (options) {\n\t var variables = [],\n\t url = expand(options.url, options.params, variables);\n\t variables.forEach(function (key) {\n\t delete options.params[key];\n\t });\n\t return url;\n\t}", "function template (options) {\n\n var variables = [],\n url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [],\n url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, variables);\n\n variables.forEach(function (key) {\n delete options.params[key];\n });\n\n return url;\n}", "get (...args) {\n\n\t\t// TODO: Set a default url path if one isn't added as a string in the second param,\n\t\t// or if one exists in the second param object. Look for url.\n\n this.template(...args)\n }", "function createUrl(tpl, variables) {\r\n return tpl.replace(/\\{([^\\}]+)\\}/g, function (variable, key) {\r\n return key in variables ? variables[key] : variable;\r\n });\r\n }", "function makeUrl ($name, $data) {\n var $template = $templates[$name];\n\n $data['summary'] = $data['description'];\n\n for (var $key in $data) {\n var $camelCaseKey = $name + $key.replace(/^[a-z]/, function($str){\n return $str.toUpperCase();\n });\n\n var $value = encodeURIComponent($data[$camelCaseKey] || $data[$key]);\n $template = $template.replace(new RegExp('{{'+$key.toUpperCase()+'}}', 'g'), $value);\n }\n\n return $template;\n }", "function urlTemplate(url, data) {\n var template;\n return result;\n\n function result(helpers) {\n if (template) {\n return template(helpers);\n } else {\n return ajax.get(url, data).then(function (rawTemplate) {\n template = _.template(rawTemplate);\n return result(helpers);\n });\n }\n }\n }", "function urlRenderer() {\n\treturn function(value) {\n\t\tif (value) {\n\t\t\tvar url = \"\";\n\t\t\tvar label = \"\";\n\t\t\tvar s = value.split(\"\\n\");\n\t\t\tif (s.length == 2) {\n\t\t\t\turl = Ext.util.Format.htmlEncode(s[1]);\n\t\t\t\tlabel = Ext.util.Format.htmlEncode(s[0]) || url;\n\t\t\t}\n\t\t\telse {\n\t\t\t\turl = Ext.util.Format.htmlEncode(value);\n\t\t\t\tlabel = Ext.util.Format.htmlEncode(value);\n\t\t\t}\n\t\t\treturn \"<a href=\\\"\" + url + \"\\\" target=\\\"_blank\\\">\" + label + \"</a>\";\n\t\t}\n\t\treturn \"\";\n\t};\n}", "function _render (url) {\r\n if (null != exports.ttQueryStr && '' != exports.ttQueryStr)\r\n {\r\n var m = url.match(\"\\\\.[a-zA-Z]+\\\\?\");\r\n if (null != m && 0 < m.length)\r\n {\r\n if (url.indexOf('?') == (url.length-1))\r\n {\r\n url = url + exports.ttQueryStr;\r\n } else {\r\n url = url + '&' + exports.ttQueryStr;\r\n }\r\n } else {\r\n url = url + '?' + exports.ttQueryStr;\r\n }\r\n\r\n //console.log(\"render:\",url);\r\n }\r\n\r\n return url;\r\n }", "function templateEngine () { }", "static get template() {\n return `<div>This is my [[name]] app.</div>`\n }", "static get template() {\n return `Hello [[name]]`\n }", "link() {\n this._template = this._sbolDocument.lookupURI(this._template);\n this._variableComponents = this._sbolDocument.lookupURIs(this._variableComponents);\n }", "set templateURL(sUrl) {\n }", "function Url(url,params){var self=this||{},options$$1=url,transform;if(isString(url)){options$$1={url:url,params:params};}options$$1=merge({},Url.options,self.$options,options$$1);Url.transforms.forEach(function(handler){if(isString(handler)){handler=Url.transform[handler];}if(isFunction(handler)){transform=factory(handler,transform,self.$vm);}});return transform(options$$1);}", "_tpl ( name, data ) {\n data = data || {};\n data.$base_url = this._config.base_url;\n\n return {\n html: this._templates[ name ].html( data ),\n text: this._templates[ name ].text( data )\n };\n }", "function exTemplate($this, url, callback) {\n\t\tif (exTemplates[url] === undefined) {\n\t\t\texTemplates[url] = {q:[{$this:$this, callback:callback}]};\n\t\t\t$.ajax({\n\t\t\t\turl:url, cache:false, dataType:\"text\",\n\t\t\t\tsuccess: function(data){\n\t\t\t\t\t_onLoadTempl(data,url);\n\t\t\t\t},\n\t\t\t\terror: function(xreq,stat,err) {\n\t\t\t\t\tvar msg = (location.protocol == \"file:\")\n\t\t\t\t\t\t? \"\\nYour browser does not support LocalFile XHR.\"\n\t\t\t\t\t\t +\"\\n'localfile Access-Control-Allow-Origin' on Google :-P\" : \"\";\n\t\t\t\t\t//alert(\"Template load error:\"+err+\" \"+url+msg);\n\t\t\t\t\tconsole.error(\"Template error:\"+err+\" \"+url+msg)\n\t\t\t\t\t_onLoadTempl(\"<div>Template error:\"+err+\" \"+url+msg+\"</div>\", url);\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (exTemplates[url].node === undefined) {\n\t\t\texTemplates[url].q.push({$this:$this, callback:callback});\n\t\t} else {\n\t\t\t_template($this, exTemplates[url].node, callback);\n\t\t}\n\t\treturn $this;\n\t}", "function createLoginTemplate(name, url, type) {\n var template = \n `\n <p>Welcome, ${name}. \n <a href='https://8080-ce19f3ee-62b8-4778-b1d0-8b6beb1e067f.us-east1.cloudshell.dev/${url}'>Log${type} here</a>\n </p>\n `;\n return template;\n}", "renderTemplate(template, context) {\n return template.replace(/\\$\\{(.*?)\\}/g, (match, key) => context.get(key));\n }", "templatizeLocalLinks_(contents) {\n contents = contents.replace(patterns.newMarkdownLinkPattern(), (_, text, url, title='') => {\n return `[${ text }](${ this.templatizeLinkIfLocal_(url) }${ title })`;\n });\n contents = contents.replace(patterns.newHrefPattern(), (_, url) => {\n return `href=\"${ this.templatizeLinkIfLocal_(url) }\"`;\n });\n contents = contents.replace(patterns.newSrcPattern(), (_, url) => {\n return `src=\"${ this.templatizeLinkIfLocal_(url) }\"`;\n });\n\n return contents;\n }", "function initTemplateStringTransformerFromUrl(url, callback) {\n\t graphQLFetcher(url, { query: _introspectionQuery.introspectionQuery }).then(function (result) {\n\t var schemaJson = result.data;\n\t callback(initTemplateStringTransformer(schemaJson));\n\t });\n\t}", "url(action,i18n,payload,params,hash){\n if (this.data.url){\n return this.data.url.call(this, action, i18n,payload,params);\n } else {\n let route_path = i18n.t(this.key);\n return `/${i18n.language}/${route_path}`;\n }\n }", "function template(page, req, res, tpl = DEFAULT_TPL) {\n\n if (page == undefined) {\n page = req.params.name;\n if (page == 'favicon.ico') return;\n page += '.md'; // route parameter\n }\n\n fs.readFile(PAGE_DIR + page, 'utf8', function (err, data) {\n if (err) {\n res.send(PAGE_404); // page not exists\n } else {\n var mdRender = md.render(data);\n var tplRender = readTemplate(tpl)\n .replace('[[content]]', mdRender)\n .replace('[[folder]]', FOLDER_ICO)\n .replace('[[title]]', req.params.name);\n res.send(tplRender); \n }\n });\n}", "static urlForRestaurant(restaurant) {\r\n return (`./restaurant.html?id=${restaurant.id}`);\r\n }", "function dust_url(opts, chunk, ctx, bodies, params) {\n\tvar url = dust.helpers.tap(params.url, chunk, ctx);\n\n\t// Only prepend our base url if we're looking for something relative to it\n\tif (url[0] == '/')\n\t\treturn chunk.write(opts.base_url + url);\n\telse\n\t\treturn chunk.write(url);\n}", "function URLUtils() {}", "function r(tmpl) {\n\treturn path + tmpl;\n}", "static urlForRestaurant(restaurant) {\n return (`./restaurant.html?id=${restaurant.id}`);\n }", "useTemplateLoader(templateLoader) {\n this.templateLoader = templateLoader;\n }", "function createUrl(val){\n return `http://localhost:3000/api/${val}`;\n \n}", "function formatForUrl(page) {\n var pageName = page.split('.');\n return pageName[0];\n}", "function django(hljs) {\n var FILTER = {\n begin: /\\|[A-Za-z]+:?/,\n keywords: {\n name:\n 'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' +\n 'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' +\n 'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' +\n 'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' +\n 'dictsortreversed default_if_none pluralize lower join center default ' +\n 'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' +\n 'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' +\n 'localtime utc timezone'\n },\n contains: [\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE\n ]\n };\n\n return {\n name: 'Django',\n aliases: ['jinja'],\n case_insensitive: true,\n subLanguage: 'xml',\n contains: [\n hljs.COMMENT(/\\{%\\s*comment\\s*%}/, /\\{%\\s*endcomment\\s*%}/),\n hljs.COMMENT(/\\{#/, /#}/),\n {\n className: 'template-tag',\n begin: /\\{%/, end: /%}/,\n contains: [\n {\n className: 'name',\n begin: /\\w+/,\n keywords: {\n name:\n 'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +\n 'endfor ifnotequal endifnotequal widthratio extends include spaceless ' +\n 'endspaceless regroup ifequal endifequal ssi now with cycle url filter ' +\n 'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +\n 'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' +\n 'plural get_current_language language get_available_languages ' +\n 'get_current_language_bidi get_language_info get_language_info_list localize ' +\n 'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone ' +\n 'verbatim'\n },\n starts: {\n endsWithParent: true,\n keywords: 'in by as',\n contains: [FILTER],\n relevance: 0\n }\n }\n ]\n },\n {\n className: 'template-variable',\n begin: /\\{\\{/, end: /}}/,\n contains: [FILTER]\n }\n ]\n };\n}", "function django(hljs) {\n var FILTER = {\n begin: /\\|[A-Za-z]+:?/,\n keywords: {\n name:\n 'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' +\n 'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' +\n 'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' +\n 'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' +\n 'dictsortreversed default_if_none pluralize lower join center default ' +\n 'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' +\n 'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' +\n 'localtime utc timezone'\n },\n contains: [\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE\n ]\n };\n\n return {\n name: 'Django',\n aliases: ['jinja'],\n case_insensitive: true,\n subLanguage: 'xml',\n contains: [\n hljs.COMMENT(/\\{%\\s*comment\\s*%}/, /\\{%\\s*endcomment\\s*%}/),\n hljs.COMMENT(/\\{#/, /#}/),\n {\n className: 'template-tag',\n begin: /\\{%/, end: /%}/,\n contains: [\n {\n className: 'name',\n begin: /\\w+/,\n keywords: {\n name:\n 'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +\n 'endfor ifnotequal endifnotequal widthratio extends include spaceless ' +\n 'endspaceless regroup ifequal endifequal ssi now with cycle url filter ' +\n 'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +\n 'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' +\n 'plural get_current_language language get_available_languages ' +\n 'get_current_language_bidi get_language_info get_language_info_list localize ' +\n 'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone ' +\n 'verbatim'\n },\n starts: {\n endsWithParent: true,\n keywords: 'in by as',\n contains: [FILTER],\n relevance: 0\n }\n }\n ]\n },\n {\n className: 'template-variable',\n begin: /\\{\\{/, end: /}}/,\n contains: [FILTER]\n }\n ]\n };\n}", "function django(hljs) {\n const FILTER = {\n begin: /\\|[A-Za-z]+:?/,\n keywords: {\n name:\n 'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' +\n 'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' +\n 'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' +\n 'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' +\n 'dictsortreversed default_if_none pluralize lower join center default ' +\n 'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' +\n 'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' +\n 'localtime utc timezone'\n },\n contains: [\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE\n ]\n };\n\n return {\n name: 'Django',\n aliases: ['jinja'],\n case_insensitive: true,\n subLanguage: 'xml',\n contains: [\n hljs.COMMENT(/\\{%\\s*comment\\s*%\\}/, /\\{%\\s*endcomment\\s*%\\}/),\n hljs.COMMENT(/\\{#/, /#\\}/),\n {\n className: 'template-tag',\n begin: /\\{%/,\n end: /%\\}/,\n contains: [{\n className: 'name',\n begin: /\\w+/,\n keywords: {\n name:\n 'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +\n 'endfor ifnotequal endifnotequal widthratio extends include spaceless ' +\n 'endspaceless regroup ifequal endifequal ssi now with cycle url filter ' +\n 'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +\n 'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' +\n 'plural get_current_language language get_available_languages ' +\n 'get_current_language_bidi get_language_info get_language_info_list localize ' +\n 'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone ' +\n 'verbatim'\n },\n starts: {\n endsWithParent: true,\n keywords: 'in by as',\n contains: [FILTER],\n relevance: 0\n }\n }]\n },\n {\n className: 'template-variable',\n begin: /\\{\\{/,\n end: /\\}\\}/,\n contains: [FILTER]\n }\n ]\n };\n}", "function django(hljs) {\n const FILTER = {\n begin: /\\|[A-Za-z]+:?/,\n keywords: {\n name:\n 'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' +\n 'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' +\n 'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' +\n 'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' +\n 'dictsortreversed default_if_none pluralize lower join center default ' +\n 'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' +\n 'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' +\n 'localtime utc timezone'\n },\n contains: [\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE\n ]\n };\n\n return {\n name: 'Django',\n aliases: ['jinja'],\n case_insensitive: true,\n subLanguage: 'xml',\n contains: [\n hljs.COMMENT(/\\{%\\s*comment\\s*%\\}/, /\\{%\\s*endcomment\\s*%\\}/),\n hljs.COMMENT(/\\{#/, /#\\}/),\n {\n className: 'template-tag',\n begin: /\\{%/,\n end: /%\\}/,\n contains: [{\n className: 'name',\n begin: /\\w+/,\n keywords: {\n name:\n 'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +\n 'endfor ifnotequal endifnotequal widthratio extends include spaceless ' +\n 'endspaceless regroup ifequal endifequal ssi now with cycle url filter ' +\n 'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +\n 'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' +\n 'plural get_current_language language get_available_languages ' +\n 'get_current_language_bidi get_language_info get_language_info_list localize ' +\n 'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone ' +\n 'verbatim'\n },\n starts: {\n endsWithParent: true,\n keywords: 'in by as',\n contains: [FILTER],\n relevance: 0\n }\n }]\n },\n {\n className: 'template-variable',\n begin: /\\{\\{/,\n end: /\\}\\}/,\n contains: [FILTER]\n }\n ]\n };\n}", "function autocontentTemplateURLs(directive, callback){\n // TODO Content all\n if(directive.match(/templateUrl\\:\\s?['|\"]([^'\"]+)/)){\n var template = directive.match(/templateUrl\\:\\s?['\"]([^'\"]+)/)[1];\n readTextFile(template, function(tmp){\n autoContent(tmp).then(function(t){\n var taux = t.replace(/[\"']/g, '\\\\$&').replace(/<\\!--[^>]*-->/g, \"\").replace(/(\\r?\\n|\\r)\\s*/g, \" \");\n var aux = directive.replace('templateUrl', 'template');\n aux = aux.replace(/(template\\:\\s?['\"])([^'\"]+)/, \"$1\"+taux);\n callback(aux);\n });\n });\n } else {\n callback(directive);\n }\n}", "function createUrl(item) {\n var urlObj = {\n protocol: config.HOST.protocol,\n slashes: config.HOST.slashes,\n auth: config.HOST.auth,\n host: config.HOST.host,\n hostname: config.HOST.hostname,\n hash: config.HOST.hash,\n query: item,\n pathname: config.HOST.pathname\n }\n var urlString = url.format(urlObj);\n return urlString\n}", "async _getTemplate() {\n if (this._templateSetup === true) return;\n\n const template = this.template();\n const isUrl = template.match(/.html$/);\n\n if (isUrl) {\n // template from built template file\n if (window._templates && (window._templates[template] || window._templates[template.replace(/^\\/+/, '')])) {\n try {\n this._templateMethod = new Function(`return \\`${window._templates[template] || window._templates[template.replace(/^\\/+/, '')]}\\`;`);\n } catch (e) {\n console.error(`Error in html template file ${window._templates[template] || window._templates[template.replace(/^\\/+/, '')]}`);\n throw e;\n }\n // load template url\n } else {\n // this._filePath is generated in the constructor\n const response = await fetch(template);\n const str = await response.text();\n // allow javascript template string syntax in external html file ( ${things} )\n this._templateMethod = new Function(`return \\`${str}\\`;`);\n }\n } else {\n this._templateMethod = this.template;\n }\n\n this._templateSetup = true;\n }", "function defaultProcess( template, content ) {\n\t\t\treturn template.replace( /\\{\\{([.\\-\\w]*)\\}\\}/g, function( match, key ) {\n\t\t\t\treturn resolveName( key, content );\n\t\t\t} );\n\t\t}", "function DefineTemplateLookupProvider() {\n\n if(!require.defined('templates/lookup')) {\n define('templates/lookup', ['handlebars.runtime'], function(Handlebars) {\n\n function TemplateLookupProvider(hbars) {\n this._handlebars = hbars;\n this._templates = {};\n }\n\n TemplateLookupProvider.prototype.registerTemplate = function(reference, template) {\n if(reference && template) {\n this._templates[reference.toLowerCase()] = template;\n }\n };\n\n TemplateLookupProvider.prototype.getTemplate = function(reference) {\n if(reference && (reference = reference.toLowerCase()) && this._templates.hasOwnProperty(reference)) {\n return this._templates[reference];\n }\n return null;\n };\n\n TemplateLookupProvider.prototype.getMatchingTemplates = function(regex) {\n var templates = this._templates;\n var matches = [];\n\n for(var k in templates) {\n if(templates.hasOwnProperty(k)) {\n if(k.match(regex)) {\n matches.push({reference:k, template:templates[k]});\n }\n }\n }\n\n return matches.length ? matches : null;\n };\n\n return new TemplateLookupProvider(Handlebars);\n });\n }\n}", "function render_url(url, default_page) {\n var callee = arguments.callee.name + \"()\";\n logger.debug(callee, \"Passed arguments (\" + url + \", \" + default_page + \")\");\n\n // Contruct a link object to retrieve known url components\n var parser = document.createElement(\"a\");\n parser.href = url;\n if (parser.hash) {\n var page = parser.hash;\n logger.info(callee, \"Found # page from URL of '\" + page + \"'\");\n fill_and_render(page);\n page = strip_hash(page);\n post_function(\"render\", page, $(this));\n\n return page;\n }\n\n if (default_page) {\n logger.info(callee, \"No Hash in URL, rendering default section '\" + default_page + \"'\");\n show_section(default_page);\n post_function(\"render\", page, $(this));\n return default_page;\n }\n\n return;\n}", "function sayHello(to) {\n return _.template(\"Hello, <%= name %>!\")({name: to});\n}", "static get template() {\n return `<div>Coucou ! Bienvenue dans [[name]].</div>`\n }", "function renderStaticTpl() {\n\t\t$(\"#from-text-span\").html($.localise.tr(\"From\"));\n\t\t$(\"#to-text-span\").html($.localise.tr(\"To\"));\n\t\t$(\"#execute-btn\").val($.localise.tr(\"OK\"));\n\n\t\t$(\"#page\").html($.localise.tr(\"Page&nbsp;\"));\n\t\t$(\"#of\").html($.localise.tr(\"&nbsp;of&nbsp;\"));\n\n\t\t$(\"#print-btn\").val($.localise.tr(\"Print\"));\n\t}", "function makeUrl(name) {\n // are we dealing with JavaScript or CSS?\n if (/\\.css$/.test(name)) {\n var suffix = \".css\";\n }\n else {\n var suffix = \".js\";\n }\n \n // remove any existing .js or .css suffix,\n // so that we can replace remaining dots with dashes\n var cmpName = name.replace(new RegExp(\"\\\\\" + suffix + \"$\"), \"\");\n \n // divide component name into name and namespace.\n // when path for that namespace is defined in config,\n // use that path, otherwise use default path\n var matches = cmpName.match(/^([^.]+)\\.(.*)$/);\n if (matches && conf[matches[1]]) {\n var path = conf[ matches[1] ];\n var subCmpName = matches[2];\n }\n else {\n var path = conf[\"\"];\n var subCmpName = cmpName;\n }\n \n return path + subCmpName.replace(/\\./g, \"/\") + suffix;\n }", "get url() {return '/';}", "function view(view, options) {\n\treturn function(req, res, next) {\n\t\toptions.pretty = true;\n\t\tdelete options.apidocs;\n\t\toptions.prefix = (options.language === 'en') ? '/' : '/' + options.language + '/';\n\t\t_.extend(options, content.languages[options.language]);\n\t\tif(_.contains(['0.2.x','0.3.x','0.4.x'], options.api)) {\n\t\t\tvar sendMarked = _.cloneDeep(classReference._marked[options.language][options.api]);\n\t\t\tclassReference.getApi(sendMarked, options.language, options.api, function(err, marked) {\n\t\t\t\toptions.apidocs = sendMarked;\n\t\t\t\tres.render(options.language + '/pages/' + view, options);\n\t\t\t});\n\t\t\t\n\t\t} else {\n\t\t\tres.render(options.language + '/pages/' + view, options);\n\t\t}\n\t}\n}", "visitTemplate(template) { }", "static getContextStringForUrl(url) {\n let initialUrl = url;\n if (url.startsWith(\"http://\")) {\n url = url.substr(7)\n } else if (url.startsWith(\"https://\")) {\n url = url.substr(8)\n }\n\n let host = url.substr(0, url.indexOf(\"/\"));\n\n console.log(\"picking host=\" + host + \" for url \" + initialUrl);\n return host\n }", "static get template() {\n return template;\n }", "function getTranslationUrl(txt) {\n return serverURL + \"?\" + \"text=\" + txt;\n}", "getHostName() {\n // UNIMPLEMENTED: complete this function!\n\n return `${this.url}`;\n }", "template(data) {\n return `${data}`\n }", "template(data) {\n return `${data}`\n }", "static transformTpl(res, pageConfig) {\n res['url'] = res['url'].map((url) => {\n const up = UrlParser.parse(pageConfig.url, true)\n return [up.protocol+'//', up.host, url].join('')\n })\n\n let idx\n res['name'].some((name, i) => {\n if (name === 'Furniture') {\n idx = i\n console.log(Chalk.yellow('IGNORED --------> ', name, pageConfig.url))\n return true\n } else {\n return false\n }\n })\n\n if (idx !== undefined) {\n res['name'].splice(idx, 1)\n res['url'].splice(idx, 1)\n }\n\n return res\n }", "function getThing (thing) {\n return function (req, res) {\n res.render(thing);\n };\n }", "url(...args) {\n return getMethodUrl(this.name, this.host, this.route, args);\n }", "function render_url(text) {\n if (text.includes(\"http\")) {\n return \"<a href=\\\"\" + text + \"\\\" target=\\\"_blank\\\">Buy Here</a>\";\n } else {\n return text;\n }\n }", "getUrl(name) { return \"\"; }", "function _createURL()\n { var arr\n\n if(arguments.length === 1) arr=arguments[0]\n else arr = arguments\n\n var url = _transaction.server.location\n\n // arr:['route', 'article', 54 ] => str:\"/route/article/54\"\n for (var i=0; i<arr.length; i++){\n url += '/';\n if (arr[i] in _transaction.server)\n url += _transaction.server[arr[i]];\n else if (arr[i]+'Path' in _transaction.server)\n url += _transaction.server[arr[i]+'Path'];\n else\n url += arr[i]\n }\n\n return url;\n }", "function url(pattern, id, p1, p2, p3, p4) {\n var pattern2 = pattern.\n replace(\"@@id@@\", id)\n .replace(\"__p1__\", p1)\n .replace(\"__p2__\", p2)\n .replace(\"__p3__\", p3)\n .replace(\"__p4__\", p4);\n return pattern2;\n}", "function template($this, src, callback) {\n\t\tif ( typeof src == \"string\") {\n\t\t\tif (src.indexOf(\"#\") == 0) {\n\t\t\t\t_template($this, $(src), callback);\n\t\t\t} else {\n\t\t\t\texTemplate($this, src, callback);\n\t\t\t}\n\t\t} else {\n\t\t\t_template($this, src, callback);\n\t\t}\n\t\treturn $this;\n\t}", "function getPermalink(item){\n // console.log('getPermalink:', item);\n switch(getService(item)) {\n case 'facebook':\n return 'https://www.facebook.com/photo.php?fbid='+item.data.id;\n // case 'foursquare':\n // return 'https://foursquare.com/ + ??? + /checkin/'+item.data.checkin.id;\n case 'twitter':\n return 'https://twitter.com/' + item.data.user.screen_name + '/statuses/' + item.data.id_str;\n case 'instagram':\n return item.data.link;\n case 'tumblr':\n return item.data.post_url;\n // case 'linkedin':\n // return '#';\n default:\n return '#link-unknown';\n }\n}", "get templateUrlInput() {\n return this._templateUrl;\n }", "static register(_url) {\n\t\tlet generalizedUrl = '/'\n\t\tlet urlRegexPattern = '^/'\n\t\tlet path = []\n\t\tlet pathParamNumber = 0\n\n\t\tfor (let p of _url.split('/')) {\n\t\t\tif (!p) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (p.startsWith(':')) {\n\t\t\t\tgeneralizedUrl += (pathParamNumber + '/')\n\t\t\t\tpathParamNumber += 1\n\t\t\t\tpath.push({\n\t\t\t\t\tname: p.slice(1),\n\t\t\t\t\tvalue: null,\n\t\t\t\t\tisVariable: true\n\t\t\t\t})\n\t\t\t\n\t\t\t\turlRegexPattern += '[a-zA-Z0-9].*/'\n\t\t\t} else {\n\t\t\t\tif (p.indexOf('.') > 0) {\n\t\t\t\t\tgeneralizedUrl += p\n\t\t\t\t\turlRegexPattern += p\n\t\t\t\t} else {\n\t\t\t\t\tgeneralizedUrl += (p + '/')\n\t\t\t\t\turlRegexPattern += (p + '/')\n\t\t\t\t}\n\t\t\t\tpath.push({\n\t\t\t\t\tname: p,\n\t\t\t\t\tvalue: p,\n\t\t\t\t\tisVariable: false\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\t\n\t\turlRegexPattern += '$'\n\t\treturn {\n\t\t\tgeneralizedUrl,\n\t\t\turlRegexPattern,\n\t\t\tpath\n\t\t}\n\t}", "getUrl() {\n let url = ''\n let pageConfig = Config.pages[this.page] || {}\n\n if(this.isBlogPost) {\n url = `${Config.siteUrl}/${this.post.frontmatter.path}`\n }\n else {\n url = pageConfig.url || Config.siteUrl\n }\n\n return url\n }", "urlFor(action) {\n\t\tconst endpoint = this.endpoint(action);\n\n\t\tif (endpoint.path) {\n\t\t\treturn url.resolve(this.url, endpoint.path);\n\t\t}\n\n\t\treturn url.resolve(this.url, endpoint.toString());\n\t}", "_createTemplates() {\n // User's custom templates\n const callbackTemplate = this.config.callbackOnCreateTemplates;\n let userTemplates = {};\n if (callbackTemplate && isType('Function', callbackTemplate)) {\n userTemplates = callbackTemplate.call(this, strToEl);\n }\n\n this.config.templates = extend(TEMPLATES, userTemplates);\n }", "get Template() {\n let template = `\n <div class=\"col-4\">\n <h1>Name: ${this.name}</h1>\n <h3>Head: ${this.head}</h3>\n <h4>Eyes: ${this.eyes}</h4>\n <h3>Body: ${this.body}</h3>\n <h3>Tail: ${this.tail}</h3>\n \n \n <h4>Legs: ${this.legs}</h4>\n\n <img src=\"${this.imgUrl}\" alt=\"Bestie\" class=\"image-thumbnail\">\n <h3>Price: ${this.price}</h3>\n `\n return template\n\n\n\n\n\n\n\n }", "function render(url) {\n // Get the keyword from the url.\n var key = url.split('/')[0];\n\n // Hide whatever page is currently shown.\n var page = $('.main-content .page');\n page.removeClass('visible');\n\n // page hashmap.\n var map = {\n // The Homepage.\n '': function() {\n renderHomePage();\n },\n\n // The CVT report page.\n '#cvt' : function() {\n renderCvtPage();\n }\n };\n\n // Execute the needed function depending on url keyword\n if(map[key]) {\n map[key]();\n } else {\n // show error page\n renderErrorPage();\n }\n }", "template() { }", "function configureTemplateFactory($provide) {\n // Set a suffix outside the decorator function \n var cacheBust = Date.now().toString();\n\n function templateFactoryDecorator($delegate) {\n var fromUrl = angular.bind($delegate, $delegate.fromUrl);\n $delegate.fromUrl = function (url, params) {\n if (url !== null && angular.isDefined(url) && angular.isString(url)) {\n url += (url.indexOf(\"?\") === -1 ? \"?\" : \"&\");\n url += \"v=\" + cacheBust;\n }\n\n return fromUrl(url, params);\n };\n return $delegate;\n }\n\n $provide.decorator('$templateFactory', ['$delegate', templateFactoryDecorator]);\n }", "function Url(url, params) {\n\t\n\t var self = this || {}, options$$1 = url, transform;\n\t\n\t if (isString(url)) {\n\t options$$1 = {url: url, params: params};\n\t }\n\t\n\t options$$1 = merge({}, Url.options, self.$options, options$$1);\n\t\n\t Url.transforms.forEach(function (handler) {\n\t transform = factory(handler, transform, self.$vm);\n\t });\n\t\n\t return transform(options$$1);\n\t}", "getTemplate() {\n if (this.state.route === '/add') {\n return addTemplate;\n }\n if (this.state.route === '/ad') {\n return displayTemplate;\n }\n if (this.state.route === '/edit') {\n return editTemplate;\n }\n if (this.state.route === '/report') {\n return reportTemplate;\n }\n // Fallback\n return template;\n }", "function tmpl(mdl, filename) {\n// return APP_ROOT_FOLDER + mdl + '/templates/' + filename + '.html';\n return ROOT + mdl + '/templates/' + filename + '.html';\n }", "function tmpl(str, data) {\n\t // Figure out if we're getting a template, or if we need to\n\t // load the template - and be sure to cache the result.\n\t var fn = !/\\W/.test(str) ? cache[str] = cache[str] || tmpl(document.getElementById(str).innerHTML) :\n\t\n\t // Generate a reusable function that will serve as a template\n\t // generator (and which will be cached).\n\t new Function(\"obj\", \"var p=[],print=function(){p.push.apply(p,arguments);};\" +\n\t\n\t // Introduce the data as local variables using with(){}\n\t \"with(obj){p.push('\" +\n\t\n\t // Convert the template into pure JavaScript\n\t str.replace(/[\\r\\t\\n]/g, \" \").split(\"<%\").join(\"\\t\").replace(/((^|%>)[^\\t]*)'/g, \"$1\\r\").replace(/\\t=(.*?)%>/g, \"',$1,'\").split(\"\\t\").join(\"');\").split(\"%>\").join(\"p.push('\").split(\"\\r\").join(\"\\\\'\") + \"');}return p.join('');\");\n\t\n\t // Provide some basic currying to the user\n\t return data ? fn(data) : fn;\n\t}", "function router() {\n var route = window.location.hash.substring(1);\n var copy = routes.filter(function(element) {\n return element.name === route;\n })\n\n var template = (copy[0] ? copy[0].template : 'pages/home.html');\n \n var req = new XMLHttpRequest();\n req.addEventListener('load', function() {\n content.innerHTML = this.responseText;\n }, false);\n req.open('get', template, true);\n req.send(null);\n }", "function formatURL(name, config) {\n name = name.replace(/\\?.*?$/, '');\n return (config.jsonData.baseURL || '') + name;\n }", "function create_url(endpoint) {\n // TODO: ここを書き換えてURL作る\n // return '/api/guchi' + endpoint\n return URL_BASE + '/deai/' + endpoint;\n}", "static get PATTERN(){\n\t\treturn /(?:https?:\\/\\/[\\w\\.]+(?::\\d+)?)?((?:\\/\\w+\\/\\w+)\\/([\\w-]+)\\/?((?:\\/)?[\\w-]+)?\\/([\\w-]+\\.html).*)/;\n\t}", "function URLUtils() {\n var instance;\n var defaultURLUtils;\n var regexUtils = [];\n var context = this.context;\n\n function getUtils(url) {\n var i;\n\n for (i = 0; i < regexUtils.length; i++) {\n var regex = regexUtils[i].regex;\n\n if (regex.test(url)) {\n return regexUtils[i].utils;\n }\n }\n\n return defaultURLUtils;\n }\n\n function setup() {\n defaultURLUtils = Object(_DefaultURLUtils__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(context).getInstance();\n }\n /**\n * Register a module to handle specific url.\n * @param {regex} regex - url regex\n * @param {object} utils - object that handles the regex\n * @memberof module:URLUtils\n * @instance\n */\n\n\n function registerUrlRegex(regex, utils) {\n regexUtils.push({\n regex: regex,\n utils: utils\n });\n }\n\n function internalCall(functionName, url, baseUrl) {\n var utils = getUtils(baseUrl || url);\n return utils && typeof utils[functionName] === 'function' ? utils[functionName](url, baseUrl) : defaultURLUtils[functionName](url, baseUrl);\n }\n /**\n * Returns a string that contains the Base URL of a URL, if determinable.\n * @param {string} url - full url\n * @return {string}\n * @memberof module:URLUtils\n * @instance\n */\n\n\n function parseBaseUrl(url) {\n return internalCall('parseBaseUrl', url);\n }\n /**\n * Returns a string that contains the scheme and origin of a URL,\n * if determinable.\n * @param {string} url - full url\n * @return {string}\n * @memberof module:URLUtils\n * @instance\n */\n\n\n function parseOrigin(url) {\n return internalCall('parseOrigin', url);\n }\n /**\n * Returns a string that contains the fragment of a URL without scheme,\n * if determinable.\n * @param {string} url - full url\n * @return {string}\n * @memberof module:URLUtils\n * @instance\n */\n\n\n function removeHostname(url) {\n return internalCall('removeHostname', url);\n }\n /**\n * Returns a string that contains the scheme of a URL, if determinable.\n * @param {string} url - full url\n * @return {string}\n * @memberof module:URLUtils\n * @instance\n */\n\n\n function parseScheme(url) {\n return internalCall('parseScheme', url);\n }\n /**\n * Determines whether the url is relative.\n * @return {boolean}\n * @param {string} url\n * @memberof module:URLUtils\n * @instance\n */\n\n\n function isRelative(url) {\n return internalCall('isRelative', url);\n }\n /**\n * Determines whether the url is path-absolute.\n * @return {bool}\n * @param {string} url\n * @memberof module:URLUtils\n * @instance\n */\n\n\n function isPathAbsolute(url) {\n return internalCall('isPathAbsolute', url);\n }\n /**\n * Determines whether the url is scheme-relative.\n * @return {bool}\n * @param {string} url\n * @memberof module:URLUtils\n * @instance\n */\n\n\n function isSchemeRelative(url) {\n return internalCall('isSchemeRelative', url);\n }\n /**\n * Determines whether the url is an HTTP-URL as defined in ISO/IEC\n * 23009-1:2014 3.1.15. ie URL with a fixed scheme of http or https\n * @return {bool}\n * @param {string} url\n * @memberof module:URLUtils\n * @instance\n */\n\n\n function isHTTPURL(url) {\n return internalCall('isHTTPURL', url);\n }\n /**\n * Determines whether the supplied url has https scheme\n * @return {bool}\n * @param {string} url\n * @memberof module:URLUtils\n * @instance\n */\n\n\n function isHTTPS(url) {\n return internalCall('isHTTPS', url);\n }\n /**\n * Resolves a url given an optional base url\n * @return {string}\n * @param {string} url\n * @param {string} [baseUrl]\n * @memberof module:URLUtils\n * @instance\n */\n\n\n function resolve(url, baseUrl) {\n return internalCall('resolve', url, baseUrl);\n }\n\n setup();\n instance = {\n registerUrlRegex: registerUrlRegex,\n parseBaseUrl: parseBaseUrl,\n parseOrigin: parseOrigin,\n parseScheme: parseScheme,\n isRelative: isRelative,\n isPathAbsolute: isPathAbsolute,\n isSchemeRelative: isSchemeRelative,\n isHTTPURL: isHTTPURL,\n isHTTPS: isHTTPS,\n removeHostname: removeHostname,\n resolve: resolve\n };\n return instance;\n}", "function serveHTML(resource, viewTemplate, sekiResponse, queryResponse) {\n log.debug(\"in serveHTML, viewTemplate = \" + viewTemplate);\n if (!viewTemplate) {\n viewTemplate = htmlTemplates.contentTemplate; // \n }\n\n var saxer = require('./srx2map');\n var stream = saxer.createStream();\n\n sekiResponse.pipe(stream);\n\n queryResponse.on('data', function(chunk) {\n log.debug(\"CHUNK: \" + chunk);\n stream.write(chunk);\n });\n\n queryResponse.on('end', function() {\n\n stream.end();\n\n var bindings = stream.bindings;\n\n // verbosity(\"bindings \" + JSON.stringify(bindings));\n\n if (!bindings || !bindings.title) { // // this is shite\n var creativeMap = {\n \"uri\": resource,\n \"title\": \"Enter title\",\n \"content\": \"Enter content\",\n \"login\": \"nickname\"\n }\n // \"uri\" : sekiRequest.url\n };\n\n sekiResponse.writeHead(200, sekiHeaders);\n\n bindings[\"uri\"] = resource;\n\n var html = freemarker.render(viewTemplate, bindings);\n\n log.info(\"404\");\n\n // log.debug(\"viewTemplate = \"+viewTemplate);\n // log.debug(\"bindings = \"+JSON.stringify(bindings));\n sekiResponse.end(html);\n });\n}", "function resolveTemplate(value, attr, customisations) {\n\t return typeof value === 'string'\n\t ? value.replace('{attr}', attr)\n\t : value(attr, customisations);\n\t}", "function renderUrl(url) {\n var divurl = document.querySelector('#url');\n var urltext = (url.length < 45) ? url : url.substr(0, 42) + '...';\n var anchor = document.createElement('a');\n anchor.href = url;\n anchor.innerText = urltext;\n divurl.appendChild(anchor);\n}", "function SafeResourceUrl(){}", "makeUrl(routeIdentifier, options, domain) {\n const route = this.lookup(routeIdentifier, domain);\n if (!route) {\n return null;\n }\n /*\n * Normalizing options\n */\n options = helpers_1.normalizeMakeUrlOptions(options);\n /*\n * Processing the route pattern with dynamic segments\n */\n let url = helpers_1.processPattern(route.pattern, options.params);\n /*\n * Append query string to the url when it is defined\n */\n const qs = qs_1.stringify(options.qs);\n if (qs) {\n url = `${url}?${qs}`;\n }\n return route.domain !== 'root' && options.prefixDomain\n ? `//${helpers_1.processPattern(route.domain, options.domainParams)}${url}`\n : url;\n }", "function generateLink(title, page, local) {\n return `[${title}](${URL}${page}.html${local || ''})`;\n}", "_getTemplate() {\n return base;\n }", "function parseTemplate(template,templateUrl,options){if(options===void 0){options={};}var interpolationConfig=options.interpolationConfig,preserveWhitespaces=options.preserveWhitespaces;var bindingParser=makeBindingParser(interpolationConfig);var htmlParser=new HtmlParser();var parseResult=htmlParser.parse(template,templateUrl,Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({},options,{tokenizeExpansionForms:true}));if(parseResult.errors&&parseResult.errors.length>0){return{errors:parseResult.errors,nodes:[]};}var rootNodes=parseResult.rootNodes;// process i18n meta information (scan attributes, generate ids)\n// before we run whitespace removal process, because existing i18n\n// extraction process (ng xi18n) relies on a raw content to generate\n// message ids\nrootNodes=visitAll(new I18nMetaVisitor(interpolationConfig,!preserveWhitespaces),rootNodes);if(!preserveWhitespaces){rootNodes=visitAll(new WhitespaceVisitor(),rootNodes);// run i18n meta visitor again in case we remove whitespaces, because\n// that might affect generated i18n message content. During this pass\n// i18n IDs generated at the first pass will be preserved, so we can mimic\n// existing extraction process (ng xi18n)\nrootNodes=visitAll(new I18nMetaVisitor(interpolationConfig,/* keepI18nAttrs */false),rootNodes);}var _a=htmlAstToRender3Ast(rootNodes,bindingParser),nodes=_a.nodes,errors=_a.errors;if(errors&&errors.length>0){return{errors:errors,nodes:[]};}return{nodes:nodes};}", "function render({url}) {\n const context = {};\n\n const store = createStore((state) => JSON.parse(JSON.stringify(state)), {\n ...initialState,\n router: {\n ...initialState.router,\n location: url,\n modified: (new Date()).toISOString(),\n }\n });\n\n const result = renderToString(h(Provider, {store}, h(StaticRouter, {location: url, context}, h(App))));\n\n // Return current context, store and app html\n return {context, store, result};\n}" ]
[ "0.65809613", "0.65192235", "0.6507946", "0.64059323", "0.64059323", "0.64027184", "0.64027184", "0.64027184", "0.64027184", "0.64027184", "0.64027184", "0.64027184", "0.64027184", "0.64027184", "0.63139075", "0.62014467", "0.6138727", "0.5991061", "0.58379054", "0.5729998", "0.5616477", "0.55654997", "0.55013204", "0.5431532", "0.5427419", "0.5415247", "0.54088336", "0.5408425", "0.5383917", "0.53594863", "0.5341028", "0.53375", "0.5282587", "0.52141887", "0.52123815", "0.51910853", "0.5177898", "0.51667136", "0.51660514", "0.5164841", "0.5160374", "0.5149554", "0.51443344", "0.51443344", "0.51262814", "0.51262814", "0.51239073", "0.51229995", "0.51166654", "0.50871474", "0.50555223", "0.5043641", "0.5043269", "0.5028418", "0.5011097", "0.5009939", "0.50062925", "0.49964973", "0.4994652", "0.49933732", "0.49810234", "0.49805743", "0.498057", "0.49722236", "0.49722236", "0.49713373", "0.49704674", "0.49691275", "0.49672815", "0.4965438", "0.49571466", "0.4954246", "0.4945369", "0.49449846", "0.49267918", "0.4926225", "0.4920787", "0.49179924", "0.4911074", "0.49040338", "0.49033695", "0.4900778", "0.48998323", "0.48962933", "0.4896037", "0.48952177", "0.48944062", "0.48903435", "0.48894644", "0.48803326", "0.4877361", "0.4875881", "0.48735243", "0.48730376", "0.48708948", "0.4864411", "0.48591474", "0.4854778", "0.48514658", "0.48487005", "0.48397797" ]
0.0
-1
XDomain client (Internet Explorer).
function xdrClient (request) { return new PromiseObj(function (resolve) { var xdr = new XDomainRequest(), handler = function handler(_ref) { var type = _ref.type; var status = 0; if (type === 'load') { status = 200; } else if (type === 'error') { status = 500; } resolve(request.respondWith(xdr.responseText, { status: status })); }; request.abort = function () { return xdr.abort(); }; xdr.open(request.method, request.getUrl()); if (request.timeout) { xdr.timeout = request.timeout; } xdr.onload = handler; xdr.onabort = handler; xdr.onerror = handler; xdr.ontimeout = handler; xdr.onprogress = function () {}; xdr.send(request.getBody()); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(), handler = function (ref) {\n var type = ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {status: status}));\n };\n\n request.abort = function () { return xdr.abort(); };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(), handler = function (ref) {\n var type = ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {status: status}));\n };\n\n request.abort = function () { return xdr.abort(); };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(), handler = function (ref) {\n var type = ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {status: status}));\n };\n\n request.abort = function () { return xdr.abort(); };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(), handler = function (ref) {\n var type = ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {status: status}));\n };\n\n request.abort = function () { return xdr.abort(); };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(), handler = function (ref) {\n var type = ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {status: status}));\n };\n\n request.abort = function () { return xdr.abort(); };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(), handler = function (ref) {\n var type = ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {status: status}));\n };\n\n request.abort = function () { return xdr.abort(); };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(), handler = function (ref) {\n var type = ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {status: status}));\n };\n\n request.abort = function () { return xdr.abort(); };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(), handler = function (ref) {\n var type = ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {status: status}));\n };\n\n request.abort = function () { return xdr.abort(); };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(), handler = function (ref) {\n var type = ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {status: status}));\n };\n\n request.abort = function () { return xdr.abort(); };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(),\n handler = function (_ref) {\n var type = _ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, { status: status }));\n };\n\n request.abort = function () {\n return xdr.abort();\n };\n\n xdr.open(request.method, request.getUrl());\n xdr.timeout = 0;\n xdr.onload = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(),\n handler = function (_ref) {\n var type = _ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, { status: status }));\n };\n\n request.abort = function () {\n return xdr.abort();\n };\n\n xdr.open(request.method, request.getUrl());\n xdr.timeout = 0;\n xdr.onload = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "function xdrClient(request) {\n return new PromiseObj(function (resolve) {\n var xdr = new XDomainRequest(),\n handler = function handler(ref) {\n var type = ref.type;\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {\n status: status\n }));\n };\n\n request.abort = function () {\n return xdr.abort();\n };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n\n xdr.onprogress = function () {};\n\n xdr.send(request.getBody());\n });\n}", "function XDomainRequestWrapper(xdr){\n this.xdr = xdr;\n this.readyState = 0;\n this.onreadystatechange = null;\n this.status = 0;\n this.statusText = \"\";\n this.responseText = \"\";\n var self = this;\n this.xdr.onload = function(){\n self.readyState = 4;\n self.status = 200;\n self.statusText = \"\";\n self.responseText = self.xdr.responseText;\n if(self.onreadystatechange){\n self.onreadystatechange();\n }\n }\n this.xdr.onerror = function(){\n if(self.onerror){\n self.onerror();\n }\n self.readyState = 4;\n self.status = 0;\n self.statusText = \"\";\n if(self.onreadystatechange){\n self.onreadystatechange();\n }\n }\n this.xdr.ontimeout = function(){\n self.readyState = 4;\n self.status = 408;\n self.statusText = \"timeout\";\n if(self.onreadystatechange){\n self.onreadystatechange();\n }\n }\n }", "function nlobjRequest() {\n}", "_loadXdr() {\n // // if unset, determine the value\n // if (typeof this.xhrType !== 'string') {\n // this.xhrType = this._determineXhrType();\n // }\n // var xdr = this.xhr = new window['XDomainRequest'](); // eslint-disable-line no-undef\n // // XDomainRequest has a few quirks. Occasionally it will abort requests\n // // A way to avoid this is to make sure ALL callbacks are set even if not used\n // // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9\n // xdr.timeout = this.timeout || 5000; // XDR needs a timeout value or it breaks in IE9\n // xdr.onerror = this._boundXhrOnError;\n // xdr.ontimeout = this._boundXhrOnTimeout;\n // xdr.onprogress = this._boundOnProgress;\n // xdr.onload = this._boundXhrOnLoad;\n // xdr.open('GET', this._request.url, true);\n // // Note: The xdr.send() call is wrapped in a timeout to prevent an\n // // issue with the interface where some requests are lost if multiple\n // // XDomainRequests are being sent at the same time.\n // // Some info here: https://github.com/photonstorm/phaser/issues/1248\n // setTimeout(function () {\n // return xdr.send();\n // }, 1);\n }", "function crossDomain() {\n\t\t\tvar parser = document.createElement(\"a\");\n\t\t\tparser.href = params.routerDomainRoot;\n\n\t\t\tvar isSameHost = window.location.hostname === parser.hostname;\n\n\t\t\tvar isSameProtocol = window.location.protocol === parser.protocol;\n\n\t\t\tvar wport = window.location.port !== undefined ? window.location.port : 80;\n\t\t\tvar pport = parser.port !== undefined ? parser.port : 80;\n\t\t\tvar isSamePort = wport === pport;\n\n\t\t\tvar isCrossDomain = !(isSameHost && isSamePort && isSameProtocol);\n\t\t\t__WEBPACK_IMPORTED_MODULE_1__clients_logger___default.a.system.debug(\"Transport crossDomain=\" + isCrossDomain + \" (\" + isSameHost + \":\" + isSameProtocol + \":\" + isSamePort + \")\");\n\t\t\treturn isCrossDomain;\n\t\t}", "function open_ActiveXobject()\r\n{\r\nvar http_request;\r\n if (window.XMLHttpRequest) {\r\n http_request = new XMLHttpRequest();\r\n } else if (window.ActiveXObject) {\r\n try{\r\n http_request = new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n }\r\n catch(e){\r\n try{\r\n http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n }\r\n catch(e) {}\r\n }\r\n }\r\n if(!http_request){\r\n alert('Cannot create XMLHTTP');\r\n return 0;\r\n }\r\n return http_request;\r\n}", "function createCrossDomainRequest(url, handler) {\n if (window.XDomainRequest) { // IE8\n return new window.XDomainRequest();\n } else {\n return new XMLHttpRequest();\n }\n }", "function getXmlhttp ()\r\n {//Create a boolean variable to check for a valid microsoft active X instance.\r\n var xmlhttp = false;\r\n //Check if we are using internet explorer.\r\n try //If the javascript version is greater than 5.\r\n { xmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\"); } \r\n catch (e) \r\n { //If not, then use the older active x object.\r\n try //If we are using internet explorer.\r\n { xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\"); } \r\n catch (e) //Else we must be using a non-internet explorer browser. \r\n { xmlhttp = false; }\r\n\t }\r\n //If we are using a non-internet explorer browser, create a javascript instance of the object.\r\n if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {\txmlhttp = new XMLHttpRequest();\t}\r\n return xmlhttp;\r\n }", "function getCorsAjaxTransport() {\n var xhrOrXdr;\n\n if (window.XMLHttpRequest || window.ActiveXObject) {\n xhrOrXdr = qq.createXhrInstance();\n\n if (xhrOrXdr.withCredentials === undefined) {\n xhrOrXdr = new XDomainRequest();\n // Workaround for XDR bug in IE9 - https://social.msdn.microsoft.com/Forums/ie/en-US/30ef3add-767c-4436-b8a9-f1ca19b4812e/ie9-rtm-xdomainrequest-issued-requests-may-abort-if-all-event-handlers-not-specified?forum=iewebdevelopment\n xhrOrXdr.onload = function() {};\n xhrOrXdr.onerror = function() {};\n xhrOrXdr.ontimeout = function() {};\n xhrOrXdr.onprogress = function() {};\n }\n }\n\n return xhrOrXdr;\n }", "get host() { return this._host; }", "function XBrowserXmlHttp() {\n\n this.XmlHttp = YAHOO.util.Connect.createXhrObject();\n //this.XmlHttp = new XMLHttpRequest();\n}", "function getCORSRequest() {\n\t var xhr = new root.XMLHttpRequest();\n\t if ('withCredentials' in xhr) {\n\t xhr.withCredentials = true;\n\t return xhr;\n\t } else if (!!root.XDomainRequest) {\n\t return new XDomainRequest();\n\t } else {\n\t throw new Error('CORS is not supported by your browser');\n\t }\n\t }", "function cProxy(\n)\n{\n\n\n}", "function zXmlHttp() {\n}", "function GetXmlHttpObject(handler)\n{ \nvar objXmlHttp=null\n\nif (navigator.userAgent.indexOf(\"Opera\")>=0)\n{\nalert(\"This example doesn't work in Opera\") \nreturn \n}\nif (navigator.userAgent.indexOf(\"MSIE\")>=0)\n{ \nvar strName=\"Msxml2.XMLHTTP\"\nif (navigator.appVersion.indexOf(\"MSIE 5.5\")>=0)\n{\nstrName=\"Microsoft.XMLHTTP\"\n} \ntry\n{ \nobjXmlHttp=new ActiveXObject(strName)\nobjXmlHttp.onreadystatechange=handler \nreturn objXmlHttp\n} \ncatch(e)\n{ \nalert(\"Error. Scripting for ActiveX might be disabled\") \nreturn \n} \n} \nif (navigator.userAgent.indexOf(\"Mozilla\")>=0)\n{\nobjXmlHttp=new XMLHttpRequest()\nobjXmlHttp.onload=handler\nobjXmlHttp.onerror=handler \nreturn objXmlHttp\n}\n}", "function createActiveXXHR() {\n try {\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch(e) {}\n\n return false;\n }", "function GetDeviceIP(){\n showBackgroundImage('wait_message');\n getContent('','/cgi-bin/setup.cgi?GetDeviceIP','function:ShowGetDeviceIP');\n}", "function execCrossDomainRequest() {\n\n // context: The ClientContext object provides access to the web and lists objects.\n context = new SP.ClientContext(appweburl);\n\n // factory: Initialize the factory object with the app web URL.\n factory = new SP.ProxyWebRequestExecutorFactory(appweburl);\n context.set_webRequestExecutorFactory(factory);\n appContextSite = new SP.AppContextSite(context, hostweburl);\n\n\n currentWeb = appContextSite.get_web();\n site = appContextSite.get_site();\n rootWeb = site.get_rootWeb();\n webCollection = rootWeb.get_webs();\n\n\n siteGroupsCollection = rootWeb.get_siteGroups();//To get the site collection groups\n roleAssignments = rootWeb.get_roleAssignments() //To get the groups from web/subsite level\n\n \n //Load to prepare the query\n context.load(webCollection)\n context.load(currentWeb);\n context.load(siteGroupsCollection);\n context.load(roleAssignments);\n context.load(siteGroupsCollection, 'Include(Title,Id,Users.Include(Title,Email))');\n\n //Execute the query with all the previous options and parameters\n context.executeQueryAsync(\n Function.createDelegate(this, onQuerySucceeded),\n Function.createDelegate(this, errorHandler)\n );\n\n // Function to handle the error event.Display the error message to the page.\n function errorHandler(data, errorCode, errorMessage) {\n document.getElementById(\"ErrorMessage\").innerText =\n \"Error occurred while retireving information. \" + errorMessage;\n }\n }", "function getHost(){\n\t\treturn this.host;\n\t}", "function browserClient() {\n // If we have an internal GraphQL server, we need to append it with a\n // call to `getServerURL()` to add the correct host (in dev + production)\n const uri = _config2.default.graphQLServer ? `${(0, _env.getServerURL)()}${_config2.default.graphQLEndpoint}` : _config2.default.graphQLEndpoint;\n\n return createClient({\n networkInterface: getNetworkInterface(uri)\n });\n}", "function AXO(id)\n{\n\tvar error; var control = null;\n\ttry {\n\t\tif (window.ActiveXObject && navigator.userAgent.indexOf('Win') != -1) control = new ActiveXObject(id);\n\t\telse if (gkoaxwma) control = new GeckoActiveXObject(id);\n\t}\n\tcatch (error) {}\n\treturn control;\n}", "function GetEraDomain(current_window) \r\n\t{\r\n\t\tif (current_window.era_rc != null && current_window.era_rc[\"ERADomain\"] != null) \r\n\t\t{\r\n\t\t\t\treturn \"http://\" + (current_window.era_rc[\"ERADomain\"]) + ERA_INTERFACE_LINK;;\r\n\t\t} \r\n\t\t\r\n\t\treturn \"http://\" + DEFAULT_DOMAIN + ERA_INTERFACE_LINK;\r\n\t}", "function requestCrossDomain(url, successCallback) {\n $.getJSON(\n 'http://query.yahooapis.com/v1/public/yql?format=json&callback=?&q=' +\n encodeURIComponent('select * from xml where url=\"' + url + '\"'), successCallback);\n}", "function BOOMR_check_doc_domain(a){if(window){if(!a){if(window.parent===window||!document.getElementById(\"boomr-if-as\"))return;if(window.BOOMR&&BOOMR.boomerang_frame&&BOOMR.window)try{BOOMR.boomerang_frame.document.domain!==BOOMR.window.document.domain&&(BOOMR.boomerang_frame.document.domain=BOOMR.window.document.domain)}catch(b){BOOMR.isCrossOriginError(b)||BOOMR.addError(b,\"BOOMR_check_doc_domain.domainFix\")}a=document.domain}if(-1!==a.indexOf(\".\")){try{window.parent.document;return}catch(b){document.domain=a}try{window.parent.document;return}catch(b){a=a.replace(/^[\\w\\-]+\\./,\"\")}BOOMR_check_doc_domain(a)}}}", "function Conectar()\r\n\t{\r\n\t\tif(window.XMLHttpRequest)\r\n\t\t\tConexion=new XMLHttpRequest(); //mozilla\r\n\t\telse if(window.ActiveXObject)\r\n\t\t\tConexion=new ActiveXObject(\"Microsoft.XMLHTTP\"); //microsoft\r\n\t}", "function nlobjServerResponse() {\n}", "handler_XCLIENT(command, callback) {\n // check if user is authorized to perform this command\n if (this._xClient.has('ADDR') || !this._server.options.useXClient) {\n this.send(550, 'Error: Not allowed');\n return callback();\n }\n\n // not allowed to change properties if already processing mail\n if (this.session.envelope.mailFrom) {\n this.send(503, 'Error: Mail transaction in progress');\n return callback();\n }\n\n let allowedKeys = ['NAME', 'ADDR', 'PORT', 'PROTO', 'HELO', 'LOGIN'];\n let parts = command.toString().trim().split(/\\s+/);\n let key, value;\n let data = new Map();\n parts.shift(); // remove XCLIENT prefix\n\n if (!parts.length) {\n this.send(501, 'Error: Bad command parameter syntax');\n return callback();\n }\n\n let loginValue = false;\n\n // parse and validate arguments\n for (let i = 0, len = parts.length; i < len; i++) {\n value = parts[i].split('=');\n key = value.shift();\n if (value.length !== 1 || !allowedKeys.includes(key.toUpperCase())) {\n this.send(501, 'Error: Bad command parameter syntax');\n return callback();\n }\n key = key.toUpperCase();\n\n // value is xtext\n value = (value[0] || '').replace(/\\+([0-9A-F]{2})/g, (match, hex) => unescape('%' + hex));\n\n if (['[UNAVAILABLE]', '[TEMPUNAVAIL]'].includes(value.toUpperCase())) {\n value = false;\n }\n\n if (data.has(key)) {\n // ignore duplicate keys\n continue;\n }\n\n data.set(key, value);\n\n switch (key) {\n // handled outside the switch\n case 'LOGIN':\n loginValue = value;\n break;\n case 'ADDR':\n if (value) {\n value = value.replace(/^IPV6:/i, ''); // IPv6 addresses are prefixed with \"IPv6:\"\n\n if (!net.isIP(value)) {\n this.send(501, 'Error: Bad command parameter syntax. Invalid address');\n return callback();\n }\n\n if (net.isIPv6(value)) {\n value = ipv6normalize(value);\n }\n\n this._server.logger.info(\n {\n tnx: 'xclient',\n cid: this.id,\n xclientKey: 'ADDR',\n xclient: value,\n user: (this.session.user && this.session.user.username) || this.session.user\n },\n 'XCLIENT from %s through %s',\n value,\n this.remoteAddress\n );\n\n // store original value for reference as ADDR:DEFAULT\n if (!this._xClient.has('ADDR:DEFAULT')) {\n this._xClient.set('ADDR:DEFAULT', this.remoteAddress);\n }\n\n this.remoteAddress = value;\n this.hostNameAppearsAs = false; // reset client provided hostname, require HELO/EHLO\n }\n break;\n case 'NAME':\n value = value || '';\n this._server.logger.info(\n {\n tnx: 'xclient',\n cid: this.id,\n xclientKey: 'NAME',\n xclient: value,\n user: (this.session.user && this.session.user.username) || this.session.user\n },\n 'XCLIENT hostname resolved as \"%s\"',\n value\n );\n\n // store original value for reference as NAME:DEFAULT\n if (!this._xClient.has('NAME:DEFAULT')) {\n this._xClient.set('NAME:DEFAULT', this.clientHostname || '');\n }\n\n this.clientHostname = value.toLowerCase();\n break;\n case 'PORT':\n value = Number(value) || '';\n this._server.logger.info(\n {\n tnx: 'xclient',\n cid: this.id,\n xclientKey: 'PORT',\n xclient: value,\n user: (this.session.user && this.session.user.username) || this.session.user\n },\n 'XCLIENT remote port resolved as \"%s\"',\n value\n );\n\n // store original value for reference as NAME:DEFAULT\n if (!this._xClient.has('PORT:DEFAULT')) {\n this._xClient.set('PORT:DEFAULT', this.remotePort || '');\n }\n\n this.remotePort = value;\n break;\n default:\n // other values are not relevant\n }\n this._xClient.set(key, value);\n }\n\n let checkLogin = done => {\n if (typeof loginValue !== 'string') {\n return done();\n }\n if (!loginValue) {\n // clear authentication session?\n this._server.logger.info(\n {\n tnx: 'deauth',\n cid: this.id,\n user: (this.session.user && this.session.user.username) || this.session.user\n },\n 'User deauthenticated using %s',\n 'XCLIENT'\n );\n this.session.user = false;\n return done();\n }\n let method = 'SASL_XCLIENT';\n sasl[method].call(this, [loginValue], err => {\n if (err) {\n this.send(550, err.message);\n this.close();\n return;\n }\n done();\n });\n };\n\n // Use [ADDR] if NAME was empty\n if (this.remoteAddress && !this.clientHostname) {\n this.clientHostname = '[' + this.remoteAddress + ']';\n }\n\n if (data.has('ADDR')) {\n this.emitConnection();\n }\n\n checkLogin(() => {\n // success\n this.send(\n 220,\n this.name + ' ' + (this._server.options.lmtp ? 'LMTP' : 'ESMTP') + (this._server.options.banner ? ' ' + this._server.options.banner : '')\n );\n callback();\n });\n }", "function GetActiveXObject()\r\n {\r\n return new ActiveXObject(progID);\r\n }", "function getDataXDomain(url){\n\t\tvar scriptId = \"tele2PhoneFinderFeed\";\n\t\tvar script = document.createElement(\"script\");\n\t\tscript.type = \"text/javascript\";\n\t\tscript.src = url;\n\t\tscript.id = scriptId;\n\t\tdocument.getElementsByTagName(\"head\")[0].appendChild(script);\n\t\t// how to consume loaded scipt data??\n\t}", "function Client(subdomain, options) {\n\t this.subdomain = subdomain\n\t this.endpoint = options && options.apiRoot\n\t}", "function createInstance()\n{\n var xhttp = null;\n if(window.XMLHttpRequest) {\n xhttp = new XMLHttpRequest();\n }\n else if (window.ActiveXObject) {\n try {\n xhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) {\n try {\n xhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (e) {\n alert(\"XHR not created\");\n }\n }\n }\n return xhttp;\n}", "function createHttpRequestObject() {\n\tvar xmlHttp;\n\n\t/*Code Source: Mozilla.org - Getting Started with Ajax*/\t\n\tif(window.ActiveXObject) {\n\t\ttry {\n\t\t\txmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t}\n\t\tcatch(e) {\n\t\t\txmlHttp = false;\n\t\t}\t\t\t\n\t} \n\telse {\n\t\ttry {\n\t\t\txmlHttp = new XMLHttpRequest(); \n\t\t} catch(e) {\n\t\t\txmlHttp = false; \n\t\t}\n\t}\n\t\n\tif(!xmlHttp)\n\t\talert(\"Could not create XML Request\");\n\telse {\n\t\treturn xmlHttp; \n\t}\n}", "function createHttpRequestObject() {\n\tvar xmlHttp;\n\n\t/*Code Source: Mozilla.org - Getting Started with Ajax*/\t\n\tif(window.ActiveXObject) {\n\t\ttry {\n\t\t\txmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t}\n\t\tcatch(e) {\n\t\t\txmlHttp = false;\n\t\t}\t\t\t\n\t} \n\telse {\n\t\ttry {\n\t\t\txmlHttp = new XMLHttpRequest(); \n\t\t} catch(e) {\n\t\t\txmlHttp = false; \n\t\t}\n\t}\n\t\n\tif(!xmlHttp)\n\t\talert(\"Could not create XML Request\");\n\telse {\n\t\treturn xmlHttp; \n\t}\n}", "function nlobjResponse() {\n}", "function createXMLHttp() {\n var XmlHttp;\n if (window.ActiveXObject) {\n var arr = [\"MSXML2.XMLHttp.6.0\", \"MSXML2.XMLHttp.5.0\", \"MSXML2.XMLHttp.4.0\", \"MSXML2.XMLHttp.3.0\", \"MSXML2.XMLHttp\", \"Microsoft.XMLHttp\"];\n for (var i = 0; i < arr.length; i++) {\n try {\n XmlHttp = new ActiveXObject(arr[i]);\n return XmlHttp;\n } catch (error) {}\n }\n } else {\n try {\n XmlHttp = new XMLHttpRequest();\n return XmlHttp;\n } catch (otherError) {}\n }\n}", "get host() {\n return this._host;\n }", "function checkBrowser() {\r\n if (window.XMLHttpRequest) {\r\n obj = new XMLHttpRequest();\r\n } else {\r\n obj = new ActiveXobject(\"Microfoft.ActiveXobject\");\r\n }\r\n}", "getHostName() {\n // UNIMPLEMENTED: complete this function!\n return \"hostname.com\";\n }", "DomainServices(packName) {\n let url = `/pack/xdsl/${packName}/domain/services`;\n return this.client.request('GET', url);\n }", "callback( xhttp ){}", "function _sendToDomain(currentDoc) {\n // Show console\n _showConsolePanel();\n \n // Connect to domain - execute 'runJSX'\n photoshop.exec('runJSX', currentDoc.text)\n .done(function (result) {\n console.log(result);\n }).fail(function (err) {\n console.error(\"Br-Ps: Failed to execute command 'runJSX' - \" + err);\n });\n }", "function getXMLHTTP() {\r\n var obj = null;\r\n\r\n try {\r\n obj = new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n } catch (e) { }\r\n\r\n if (obj == null) {\r\n try {\r\n obj = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n } catch (e) { }\r\n } // if\r\n \r\n if ((obj == null) && (typeof XMLHttpRequest != \"undefined\"))\r\n obj = new XMLHttpRequest();\r\n return(obj);\r\n} // getXMLHTTP", "function createMicrosoftXhr() {\r\n var xhr;\r\n try {\r\n xhr = new ActiveXObject('Msxml2.XMLHTTP');\r\n } catch (ignore) {\r\n try {\r\n xhr = new ActiveXObject('Microsoft.XMLHTTP');\r\n } catch (ignored) {\r\n throw new Error(\"pklib.ajax.load: can't create XMLHttpRequest object\");\r\n }\r\n }\r\n return xhr;\r\n }", "function getXhr()\n{\n var xhr = null;\n\n // Réupération de l'objet XHR d'Internet Explorer anciennes\n // versions si il existe\n try { xhr = new ActiveXObject('Msxml2.XMLHTTP'); }\n catch (e1)\n {\n // Réupération de l'objet XHR d'Internet Explorer anciennes\n // versions si il existe\n try { xhr = new ActiveXObject('Microsoft.XMLHTTP'); }\n catch (e2)\n {\n // Réupération de l'objet XHR des navigateurs modernes\n // (Firefox, Chrome, Safari...) si il existe\n try { xhr = new XMLHttpRequest(); }\n catch (e3)\n {\n alert(\"AJAX n'est pas supporté par votre navigateur\");\n return false;\n }\n }\n }\nreturn xhr;\n}", "function ShowConnections()\r\n{\r\n\tvar clients = serv.GetWebSockClients();\r\n\t\r\n\tif( clients.length > 0 )\r\n\t{\r\n \t//Make a list of clients.\r\n \tvar list = \"\";\r\n \tfor( var i=0; i<clients.length; i++ )\r\n \t list += clients[i].remoteAddress + \"\\n\";\r\n \t \r\n \t//Show client list.\r\n \ttxt.SetText( list );\r\n\t}\r\n}", "function extCall(){\n\t// external_uri\n\t//var nullElement = new Element();\n\t//$('ext').load(external_uri);\n\t//var myHTMLRequest = new Request.HTML().get(external_uri);\n}", "function makeCorsRequest() {\n // All HTML5 Rocks properties support CORS.\n var url = urlLogin;\n\n var xhr = createCORSRequest('GET', url);\n if (!xhr) {\n alert('CORS not supported');\n return;\n }\n\n // Response handlers.\n xhr.onload = function() {\n var text = xhr.responseText;\n var title = getTitle(text);\n alert('Response from CORS request to ' + url + ': ' + title);\n };\n\n xhr.onerror = function() {\n alert('Woops, there was an error making the request.');\n };\n\n xhr.send();\n}", "hasXDR() {\n return typeof XDomainRequest !== \"undefined\" && !this.xs && this.enablesXDR;\n }", "hasXDR() {\n return typeof XDomainRequest !== \"undefined\" && !this.xs && this.enablesXDR;\n }", "hasXDR() {\n return typeof XDomainRequest !== \"undefined\" && !this.xs && this.enablesXDR;\n }", "function getXMLHTTPRequest(){\r\n\tvar xmlHttp;\r\n\r\n\tif (window.ActiveXObject){\r\n\t\ttry{\r\n\t\t\txmlHttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t\t}catch(e){\r\n\t\t\txmlHttp=false;\r\n\t\t}\r\n\t}else {try{\r\n\t\txmlHttp=new XMLHttpRequest();\r\n\t\t//alert(\"create http\");\r\n\t}catch(e){\r\n\t\txmlHttp=false;\r\n\t}\r\n\t}\r\n\tif (!xmlHttp){\r\n\t\talert(\"cannot create xmlHttp object\");\r\n\t}else{\r\n\t\treturn xmlHttp;\r\n\t}\r\n}", "function getXMLHttpRequest() {\n\t if (root.XMLHttpRequest) {\n\t return new root.XMLHttpRequest();\n\t } else {\n\t var progId;\n\t try {\n\t var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];\n\t for(var i = 0; i < 3; i++) {\n\t try {\n\t progId = progIds[i];\n\t if (new root.ActiveXObject(progId)) {\n\t break;\n\t }\n\t } catch(e) { }\n\t }\n\t return new root.ActiveXObject(progId);\n\t } catch (e) {\n\t throw new Error('XMLHttpRequest is not supported by your browser');\n\t }\n\t }\n\t }", "hasXDR() {\n return typeof XDomainRequest !== \"undefined\" && !this.xs && this.enablesXDR;\n }", "function domainWrapper() {\n return function (req, res, next) {\n var reqDomain = domain.create();\n reqDomain.add(req);\n reqDomain.add(res);\n\n res.on('close', function () {\n reqDomain.dispose();\n });\n reqDomain.on('error', function (err) {\n next(err);\n });\n reqDomain.run(next);\n }\n}", "function createXmlHttpRequestObject() {\n var esignoutxmlHttp;\n // For Internet Explorer \n if (window.ActiveXObject) {\n try {\n esignoutxmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (e) {\n alert(\"can't create IE object\");\n esignoutxmlHttp = false;\n }\n } else {\n //For Google Chrome and other \n try {\n esignoutxmlHttp = new XMLHttpRequest();\n } catch (e) {\n esignoutxmlHttp = false;\n }\n }\n if (!esignoutxmlHttp) {\n alert(\"can't create that object!\");\n } else {\n return esignoutxmlHttp;\n }\n}", "function makeCorsRequest() {\n // This is a sample server that supports CORS.\n var url = 'http://localhost:9000';\n var xhr = createCORSRequest('GET', url);\n if (!xhr) {\n alert('CORS not supported');\n return;\n }\n\n // Response handlers.\n xhr.onload = function() {\n var text = xhr.responseText;\n console.log(`Load Text is: ${text}`);\n returnAction(text)\n };\n\n xhr.onerror = function() {\n alert('Woops, there was an error making the request.');\n };\n\n xhr.send();\n}", "function createXmlHttpReq()\n{\n //alert(\"createXmlHttpReq\")\n if (window.ActiveXObject)\n {\n var activexmodes=[\"Msxml2.XMLHTTP\", \"Microsoft.XMLHTTP\"]\n for (var i=0; i<activexmodes.length; i++)\n {\n try\n {\n return new ActiveXObject(activexmodes[i])\n }\n catch(e)\n {\n }\n }\n }\n else if (window.XMLHttpRequest)\n {\n return new XMLHttpRequest()\n }\n alert(\"no XMLHttpReq\")\n return null\n}", "function GetXmlHttpObject()\r\n\t{ var xmlHttp=null;\r\n\ttry { // create xhttp object in following browser Firefox, Opera 8.0+, Safari\r\n\t\t xmlHttp=new XMLHttpRequest(); }\r\n\tcatch (e)\r\n\t {// create xhttp object in Internet Explorer browser \r\n\t\t try{ \txmlHttp=new ActiveXObject(\"Msxml2.XMLHTTP\"); \t }\r\n\t\t catch (e) { \txmlHttp=new ActiveXObject(\"Microsoft.XMLHTTP\"); \t }\r\n\t }\treturn xmlHttp;\r\n\t}", "function _D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={mimeType:t.mimeType||null,onBeforeSend:t.onBeforeSend||Function.prototype,onSuccess:t.onSuccess||Function.prototype,onError:t.onError||Function.prototype,onComplete:t.onComplete||Function.prototype},r=Array.isArray(e)?e:[e],o=Array.apply(null,Array(r.length)).map((function(e){return null}));function a(e){var t=e&&\"<\"===e.trim().charAt(0);return e&&!t}function i(e,t){n.onError(e,r[t],t)}function l(e,t){var a=n.onSuccess(e,r[t],t);e=!1===a?\"\":a||e,o[t]=e,-1===o.indexOf(null)&&n.onComplete(o)}var s=document.createElement(\"a\");r.forEach((function(e,t){if(s.setAttribute(\"href\",e),s.href=String(s.href),Boolean(document.all&&!window.atob)&&s.host.split(\":\")[0]!==location.host.split(\":\")[0]){if(s.protocol===location.protocol){var r=new XDomainRequest;r.open(\"GET\",e),r.timeout=0,r.onprogress=Function.prototype,r.ontimeout=Function.prototype,r.onload=function(){a(r.responseText)?l(r.responseText,t):i(r,t)},r.onerror=function(e){i(r,t)},setTimeout((function(){r.send()}),0)}else console.warn(\"Internet Explorer 9 Cross-Origin (CORS) requests must use the same protocol (\".concat(e,\")\")),i(null,t)}else{var o=new XMLHttpRequest;o.open(\"GET\",e),n.mimeType&&o.overrideMimeType&&o.overrideMimeType(n.mimeType),n.onBeforeSend(o,e,t),o.onreadystatechange=function(){4===o.readyState&&(o.status<400&&a(o.responseText)||0===o.status&&a(o.responseText)?l(o.responseText,t):i(o,t))},o.send()}}))}", "function getAjaxTransport() {\n\treturn validFuncOf(\n function() {return new XMLHttpRequest()},\n function() {return new ActiveXObject('Msxml2.XMLHTTP')},\n function() {return new ActiveXObject('Microsoft.XMLHTTP')}\n ) \n}", "function XMLRPC() {} // もうちょっとXMLRPCらしくしたい", "function findXMLHttp() {\n var xmlhttp;\n\n //Try internal HTTP\n if (window.XMLHttpRequest) {\n xmlhttp = new XMLHttpRequest();\n }\n\n //If not try ActiveX\n else{\n\n //List ActiveX Versions\n //Some can be deleted if we dont wish to support certain types\n //Most effective at top supported listed below\n var xmlhttpVersions = [\"MSXML2.XMLHttp.6.0\",\n \"MSXML2.XMLHttp.5.0\",\n \"MSXML2.XMLHttp.4.0\",\n \"MSXML2.XMLHttp.3.0\", \n \"MSXML2.XMLHttp\",\n \"Microsoft.XMLHttp\"];\n\n\n //Try the differante versions\n for (var i = 0; i < xmlhttpVersions.length; i++) {\n if (!xmlhttp) {\n try{xmlhttp = new ActiveXObject(xmlhttpVersions[i]);} \n catch (e) { xmlhttp = false;}\n }\n }\n\n //Start an instance for selected ActiveX\n //If not started as internal\n if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {\n try { xmlhttp = new XMLHttpRequest();} \n catch (e) { xmlhttp = false;}\n }\n \n //If ActiveX not even supported alert it.\n if (!xmlhttp) {\n alert('Please check that your browser supports XMLhttp');\n return false;\n }\n \n }\n return xmlhttp;\n}", "function getLocationOrigin() {\n\t return window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '');\n\t}", "function HostService() {\n /*host: string = \"http://localhost:900S0/\"*/\n /*host: string = \"http://localhost:9000/imersa/\"*/\n /*host: string = \"http://192.168.0.20:9000/imersa/\";*/\n /*\thost: string = \"http://localhost:9000/\"*/\n // host: string = \"http://localhost:8080/\";\n /*host: string = \"http://localhost:7089/\" */\n /*host: string = \"http://localhost:8080/imersa_backend-req4/\"*/\n // host: string = \"http://grupocubus.dyndns.org:50001/\";\n //host: string = \"http://ykssistemas.dyndns.org:50001/imersa/\";\n this.host = \"http://ec2-18-217-145-105.us-east-2.compute.amazonaws.com:9000/imersa/\";\n }", "function fncreatexhrObject()\r\n{\r\n var http_request = false;\r\n try\r\n {\r\n http_request = new XMLHttpRequest();\r\n \r\n }\r\n catch (err1)\r\n {\r\n try\r\n {\r\n http_request = new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n \r\n }\r\n catch (err2)\r\n {\r\n try\r\n {\r\n http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n }\r\n catch(err3)\r\n {\r\n http_request = false;\r\n }\r\n } \r\n }\r\n if (!http_request)\r\n {\r\n alert('Cannot create XMLHTTP instance');\r\n return false;\r\n }\r\n return http_request;\r\n}", "getHostNode() {}", "get domain(){\n return this._domain||window.location.domain;\n \n }", "get domain(){\n return this._domain||window.location.domain;\n \n }", "function createFrame(t, name, hostname) {\n return new Promise(resolve => {\n var i = document.createElement('iframe');\n if (hostname) {\n i.src = `//${hostname}:{{location[port]}}/html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_frame.html`;\n } else {\n i.src = \"support/document_domain_frame.html\";\n }\n if (name) {\n i.name = name;\n }\n var listener = m => {\n if (m.source == i.contentWindow)\n resolve(i);\n }\n window.addEventListener('message', listener);\n t.add_cleanup(() => {\n i.remove();\n window.removeEventListener('message', listener);\n });\n document.body.appendChild(i);\n });\n}", "function isCrossDomain(hostname, crossDomains) {\n /**\n * jQuery < 1.6.3 bug: $.inArray crushes IE6 and Chrome if second argument is\n * `null` or `undefined`, http://bugs.jquery.com/ticket/10076,\n * https://github.com/jquery/jquery/commit/a839af034db2bd934e4d4fa6758a3fed8de74174\n *\n * @todo: Remove/Refactor in D8\n */\n if (!crossDomains) {\n return false;\n }\n else {\n return $.inArray(hostname, crossDomains) > -1 ? true : false;\n }\n}", "function createCorsRequest(method, url) {\n var xhr = new XMLHttpRequest();\n if (\"withCredentials\" in xhr) {\n console.log(\"withCredentials\");\n xhr.open(method, url, false);\n xhr.send();\n console.log(\"Status: \" + xhr.status);\n console.log(\"Readystate: \" + xhr.readyState);\n if (xhr.readyState == 4 && xhr.status == 200) {\n return JSON.parse(xhr.response);\n }\n \n\n } else if (typeof XDomainRequest != \"undefined\") {\n console.log(\"XDomainRequest\");\n xhr = new XDomainRequest();\n xhr.open(method, url);\n\n } else {\n console.log(\"supported\");\n xhr = null;\n }\n return xhr;\n}", "function creteXMLHttpRequestObject(){\n\tvar xmlHttp;\n\tif(window.ActiveXObject)\n\t{\n\t\ttry\n\t\t{\n\t\t\txmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t}catch(e){\n\t\t\txmlHttp = false;\n\t\t}\n\t}\n\telse\n\t{\n\t\ttry\n\t\t{\n\t\t\txmlHttp = new XMLHttpRequest();\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t\txmlHttp = false;\n\t\t}\n\t}\n\n\tif(!xmlHttp)\n\t\talert(\"Can't use xmlHttp\");\n\telse\n\t\treturn xmlHttp;\n}", "function createXMLHttpRequest(){ \r\n if (window.ActiveXObject) { xmlHttp=new ActiveXObject(\"Microsoft.XMLHTTP\");}\r\n else if (window.XMLHttpRequest) {xmlHttp= new XMLHttpRequest(); }}", "constructor(targetContainer) {\n this.targetContainer = targetContainer;\n \n if (window.ActiveXObject){\n this.xhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n }\n else {\n this.xhttp = new XMLHttpRequest();\n }\n }", "function WrappedXMLHttpRequest() {\n this._inner = Cc[\"@mozilla.org/xmlextras/xmlhttprequest;1\"].createInstance();\n}", "function getDomainName() {\n return window.location.hostname;\n}", "function polling(opts){\n var xhr;\n var xd = false;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n }\n\n opts.xdomain = xd;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n return new JSONP(opts);\n }\n}", "query(subdomain) {\n if (!this.is_authenticated())\n return;\n // \"COOKIE JAR\" FOR REQUESTS\n const cj = request.jar();\n // MINECRAFT REALMS API DOMAIN\n const domain = \"https://pc.realms.minecraft.net\";\n // SET COOKIE VALS\n cj.setCookie(`user=${this.username}`, domain);\n cj.setCookie(`version=${this.version}`, domain);\n cj.setCookie(`sid=${this.auth_cache.sid}`, domain);\n return new Promise((resolve, reject) => {\n request(`${domain}${subdomain}`, { jar: cj }, (err, response, body) => {\n if (err) {\n return reject(err);\n }\n resolve({\n response: response,\n body: body,\n });\n });\n });\n }", "start() {\n this.registerDomainVerifier_();\n this.requestDomainVerification_();\n }", "function Domain (domain_name) \r\n{\r\n if (arguments.length > 0) {\r\n\tthis.init(domain_name);\r\n }\r\n}", "function polling(opts) {\n var xhr\n var xd = false\n var xs = false\n\n opts.xdomain = xd\n opts.xscheme = xs\n\n return new XHR(opts)\n}", "function createXmlHttpRequestObject() \n{\n\tvar xmlHttp;\n\n\tif(window.ActiveXObject) //If user is using internet Explorer\n\t{\n\t\ttry\n\t\t{\n\t\t\txmlHttp = new ActiveXObject(\"Microsoft.xmlHttp\");\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t\txmlHttp=false;\n\t\t}\n\t}\n\telse //If user is NOT using internet Explorer but any other browser\n\t{\n\t\ttry\n\t\t{\n\t\t\txmlHttp = new XMLHttpRequest();\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t\txmlHttp=false;\n\t\t}\n\t}\n\n\tif(!xmlHttp) //If Object can not be initialized.\n\t\t{\n\t\t\talert(\"Can not create object\");\n\t\t}\n\telse\n\t{\n\t\treturn xmlHttp;\n\t}\n}", "function createXMLHTTPRequest(){\r\n\tvar xmlHTTPRequest = null;\r\n\t\r\n\t//revisamos si no esta definido el objeto nativamente(navegadores tipo mozilla)\r\n\tif (typeof XMLHttpRequest == \"undefined\" ){\r\n\t\t//Ahora revisamos si el motor es mayor o igual a MSIE 5.0 \r\n\t\t//(mayor que microsoft internet explorer 5.0)\r\n\t\tif(navigator.userAgent.indexOf(\"MSIE 5\") >= 0){\r\n\t\t\t// Si es así creamos un control activeX apartir de un objeto\r\n\t\t\t//ActiveXObject(\"Microsoft.XMLHTTP\")\r\n\t\t\txmlHTTPRequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t\t} else {\r\n\t\t\t//si no , o si es menor a MSIE 5.0 creamos otro control activeX\r\n\t\t\t// apartir de un objeto ActiveXObject(\"Msxml2.XMLHTTP\")\r\n\t\t\txmlHTTPRequest = new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n\t\t} \r\n\t} else {\r\n\t\t// en cambio si el objeto estaba definido nativamente, solo lo instanciamos\r\n\t\txmlHTTPRequest = new XMLHttpRequest();\r\n\t}\r\n\t\r\n\treturn xmlHTTPRequest;\r\n}", "function createXMLHTTPRequest(){\r\n\tvar xmlHTTPRequest = null;\r\n\t\r\n\t//revisamos si no esta definido el objeto nativamente(navegadores tipo mozilla)\r\n\tif (typeof XMLHttpRequest == \"undefined\" ){\r\n\t\t//Ahora revisamos si el motor es mayor o igual a MSIE 5.0 \r\n\t\t//(mayor que microsoft internet explorer 5.0)\r\n\t\tif(navigator.userAgent.indexOf(\"MSIE 5\") >= 0){\r\n\t\t\t// Si es así creamos un control activeX apartir de un objeto\r\n\t\t\t//ActiveXObject(\"Microsoft.XMLHTTP\")\r\n\t\t\txmlHTTPRequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t\t} else {\r\n\t\t\t//si no , o si es menor a MSIE 5.0 creamos otro control activeX\r\n\t\t\t// apartir de un objeto ActiveXObject(\"Msxml2.XMLHTTP\")\r\n\t\t\txmlHTTPRequest = new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n\t\t} \r\n\t} else {\r\n\t\t// en cambio si el objeto estaba definido nativamente, solo lo instanciamos\r\n\t\txmlHTTPRequest = new XMLHttpRequest();\r\n\t}\r\n\t\r\n\treturn xmlHTTPRequest;\r\n}", "function start(xdcroot, xdcpath)\n{\n var inst = _getInstance(this);\n logger.info(\"ROV Module: start(\" + inst.id + \": \"\n + xdcroot + \", \" + xdcpath + \")\");\n\n var locPromise = Q.defer();\n\n if (inst.server != null) {\n locPromise.resolve();\n return (locPromise.promise);\n }\n\n if (xdcroot == null) {\n xdcroot = process.env.XDCROOT;\n }\n\n /* HACK: replace non 3.5x.yz xdctools with xdctools installed with CCS */\n if (xdcroot != null && xdcroot.indexOf(\"xdctools_3_5\") == -1) {\n var tmp = _findXDCtools();\n if (tmp) {\n xdcroot = tmp;\n }\n }\n\n var xs;\n if (xdcroot != null) {\n xs = xdcroot + \"/xs\";\n if (process.platform == \"win32\") {\n xs += \".exe\";\n }\n }\n else {\n locPromise.reject(\"xdcroot is not supplied as a parameter or in\"\n + \" the environment\");\n return (locPromise.promise);\n }\n\n /* define XDCROOT_JAVA_HOME in case CCS doesn't (it should but ...) */\n if (process.env.XDCTOOLS_JAVA_HOME == null) {\n logger.info(\"warning: XDCTOOLS_JAVA_HOME was not set by CCS\");\n process.env.XDCTOOLS_JAVA_HOME = _findJRE(xdcroot);\n }\n\n /* check for MacOs /Contents/Home path additions */\n if (process.platform == 'darwin') {\n var jre = process.env.XDCTOOLS_JAVA_HOME;\n if (jre != null && jre.indexOf(\"/Contents/Home\") == -1) {\n /* this should never be necessary, but ... */\n process.env.XDCTOOLS_JAVA_HOME += \"/Contents/Home\";\n logger.info(\n \"warning: added missing /Contents/Home to XDCTOOLS_JAVA_HOME\");\n }\n }\n\n logger.info(\"XDCTOOLS_JAVA_HOME set to \" + process.env.XDCTOOLS_JAVA_HOME);\n\n if (xdcpath == null) {\n xdcpath = process.env.XDCPATH;\n }\n\n var params = [\"xdc.rov.monserver\"];\n if (xdcpath != null) {\n params.unshift(\"--xdcpath=\" + xdcpath);\n }\n\n /* create a common prefix for all monserver debug trace */\n var prefix = \"ROV server \" + params[params.length - 1] + \": \";\n\n inst.buffer = \"\"; /* ensure buffer is empty for new server */\n\n /* spawn xs */\n inst.server = spawn(xs, params, {detached: false, env: undefined});\n /* MUST add error handler IMMEDIATELY otherwise node throws and aborts! */\n inst.server.on(\"error\", function(msg) {\n logger.info(prefix + xs + \" error: \" + msg);\n });\n\n if (inst.server.pid == 0) {\n inst.server = null;\n var msg = prefix + \"internal error: spawn of '\" + xs + \"' failed.\";\n logger.info(msg);\n locPromise.reject(msg);\n return (locPromise.promise);\n }\n\n inst.server.stdout.setEncoding(\"utf8\");\n\n inst.server.stdout.on(\"data\", function(data) {\n logger.info(prefix + \"output: \" + data);\n inst.buffer = inst.buffer + data;\n if (inst.waitingPromise[inst.resolveId] != undefined) {\n if (inst.resolveId > 0) {\n delete inst.waitingPromise[inst.resolveId - 1];\n }\n var message = _checkBuffer(inst);\n if (message != null) {\n logger.info(\"ROV Module: resolving promise \" + inst.resolveId);\n inst.waitingPromise[inst.resolveId].resolve(message);\n inst.resolveId++;\n }\n }\n });\n inst.server.stdout.on(\"end\", function() {\n logger.info(prefix + \"ended stdout\");\n });\n inst.server.stdout.on(\"close\", function() {\n logger.info(prefix + \"closed stdout\");\n _exit(inst); /* in case, xs exits due to some startup error */\n });\n\n inst.server.stderr.on(\"data\", function(data) {\n logger.info(prefix + \"stderr: \" + data);\n inst.stderrBuf = inst.stderrBuf + data;\n });\n inst.server.stderr.on(\"end\", function() {\n logger.info(prefix + \"ended stderr\");\n if (inst.waitingPromise[inst.resolveId] != undefined) {\n if (inst.resolveId > 0) {\n delete inst.waitingPromise[inst.resolveId - 1];\n }\n logger.info(\"ROV Module: rejecting promise \" + inst.resolveId);\n inst.waitingPromise[inst.resolveId].reject(inst.stderrBuf);\n inst.resolveId++;\n }\n });\n\n locPromise.resolve();\n return (locPromise.promise);\n}", "function GetXmlHttpObject(handler) {\n var objXMLHttp = null;\n\n if(window.ActiveXObject) {\n objXMLHttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n }\n else if (window.XMLHttpRequest) {\n objXMLHttp = new XMLHttpRequest();\n }\n else if (window.ActiveXObject) {\n objXMLHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n return objXMLHttp;\n}", "function get(){return proxy;}", "function get(){return proxy;}", "function getRequestObject() {\r\n if (window.ActiveXObject) { \r\n return(new ActiveXObject(\"Microsoft.XMLHTTP\"));\r\n } else if (window.XMLHttpRequest) {\r\n return(new XMLHttpRequest());\r\n } else {\r\n return(null);\r\n }\r\n}" ]
[ "0.66740274", "0.664105", "0.664105", "0.664105", "0.664105", "0.664105", "0.664105", "0.664105", "0.664105", "0.6607422", "0.6607422", "0.65116125", "0.6046756", "0.570742", "0.5586355", "0.55824524", "0.55533683", "0.5527345", "0.53925127", "0.53883755", "0.5377183", "0.53768885", "0.53398275", "0.533594", "0.53098387", "0.5308888", "0.5295525", "0.5249068", "0.52468574", "0.5233776", "0.5204432", "0.51967776", "0.51940244", "0.5191868", "0.5177663", "0.5136118", "0.51162386", "0.5095866", "0.5089843", "0.508735", "0.5081816", "0.5080722", "0.50757843", "0.50757843", "0.5071449", "0.5042618", "0.501808", "0.5008874", "0.5005831", "0.50012267", "0.49928254", "0.49911052", "0.4978786", "0.49666744", "0.49657786", "0.49618614", "0.49602208", "0.49487174", "0.49438325", "0.49438325", "0.49438325", "0.49317667", "0.49246165", "0.49123797", "0.4911143", "0.49041846", "0.49040484", "0.48974335", "0.4894728", "0.48884", "0.48826435", "0.4880625", "0.48791018", "0.4875392", "0.48751202", "0.4871441", "0.48595896", "0.48586422", "0.48586422", "0.48583886", "0.48544738", "0.48458794", "0.48446906", "0.48445034", "0.4841982", "0.48413065", "0.48406988", "0.4838793", "0.48369908", "0.48344725", "0.48258755", "0.4822529", "0.48223785", "0.48169658", "0.48169658", "0.48152632", "0.48138613", "0.48120427", "0.48120427", "0.48075968" ]
0.66231215
9
HTTP method override Interceptor.
function method (request) { if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) { request.headers.set('X-HTTP-Method-Override', request.method); request.method = 'POST'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "function httpMethodInterceptor() {\n return {\n request: function (config) {\n if (config.url.indexOf('cmsapi/newsletters/') >= 0) {\n return config;\n }\n\n if (config.method === 'POST') {\n config.url += '/Post';\n }\n\n if (config.method === 'PUT') {\n config.method = 'POST';\n config.url += '/Put';\n }\n\n if (config.method === 'DELETE') {\n config.method = 'POST';\n config.url += '/Delete';\n }\n\n return config;\n }\n };\n }", "intercept(): * {\n return {}\n }", "function interceptor($q) {\n return {\n 'request': function(config) {\n // do something on success\n console.log(\"Intercepter, request \", config.url);\n var url = config.url.toString();\n console.log(url);\n\n if (url.indexOf(\"special-api\") > -1) {\n console.log(\"injecting special header\");\n \n config.headers[\"X-Special-Token\"] = \"SPECIAL-1234\";\n }\n\n\n return config;\n },\n\n // optional method\n 'requestError': function(rejection) {\n // do something on error\n console.log(\"Intercepter, request requestError \");\n return $q.reject(rejection);\n },\n\n // optional method\n 'response': function(response) {\n // do something on success\n console.log(\"Intercepter, response \", response.status);\n if (response.config.url.indexOf(\"special-api\") > -1) {\n response.data.message = 'Special Processing Done';\n }\n \n return response;\n },\n\n // optional method\n 'responseError': function(rejection) {\n // do something on error\n\n //Samples only, examples at Authentication and Authorization\n if (rejection.status === 403) {\n console.log(\"Invalid request, not authorized\");\n rejection.data.message = 'special processing failed';\n $q.reject(rejection);\n //$location.url('/user/signin');\n }\n \n \n console.log(\"Intercepter, responseError \");\n return $q.reject(rejection);\n }\n };\n }", "function interceptMethod(obj, method, interceptor){\n\t//this catches both when it is undefined and when it's not a function\n\tif(typeof obj[method] != \"function\"){\n\t\treturn;\n\t}\n\tvar originalMethod = obj[method];\n\t//create a closure trapping originalMethod\n\tobj[method] = function(){\n\t\treturn interceptor.call(this, originalMethod, arguments);\n\t};\n}", "intercept_() {\n\t\tIncrementalDomAop.startInterception({\n\t\t\tattributes: this.handleInterceptedAttributesCall_,\n\t\t\telementOpen: this.handleInterceptedOpenCall_\n\t\t});\n\t}", "async intercept(_ctx, _next) {\n let routeData = { match: false };\n switch (_ctx.request.method.toLowerCase()) {\n case 'head': routeData = this._travel('head', _ctx); break;\n case 'get': routeData = this._travel('get', _ctx); break;\n case 'post': routeData = this._travel('post', _ctx); break;\n case 'put': routeData = this._travel('put', _ctx); break;\n case 'patch': routeData = this._travel('patch', _ctx); break;\n case 'delete': routeData = this._travel('delete', _ctx); break;\n }\n\n if (routeData.match) {\n _ctx.request.route = routeData;\n await routeData.match(_ctx, _next, routeData);\n }\n await _next();\n }", "function overrideHttpRequestPrototype () {\n // Save the original function in a 'proxy' variable\n let original = window.XMLHttpRequest.prototype.send;\n\n // Override it\n window.XMLHttpRequest.prototype.send = function() {\n console.info(\"[COVID-COUNTER] Intercepting request...\");\n\n // Appends an event to the stack\n this.addEventListener(\"readystatechange\", function(e) {\n // Check if the response was successful\n if (this.readyState === 4 && this.status === 200) {\n // Check for the wanted API endpoint\n if (this.__zone_symbol__xhrURL.toLowerCase().endsWith(API_ENDPOINT)) {\n // Parse the responseText and send it to the event handler!\n let response = JSON.parse(this.responseText);\n onResponse(response);\n }\n }\n });\n\n // Route back to the original function\n return original.apply(this, [...arguments]);\n };\n}", "continueRequestOverrides() {\n throw new Error('Not implemented');\n }", "function RequestIntercepterAccept($injector) {\n\t\t\n\t\t//setup and return service \t\n var intercepter = {\n \trequest \t: request,\n };\n \n return intercepter;\n\n ////////////\n \n //request function\n \n /**\n\t\t * request\n\t\t * \n\t\t * Intercepts a request and sets the request attribute \n\t *\n\t\t * @param \t{Object} config The requests config object \n\t\t * \n\t\t * @return {Object} The edited config object\n\t\t * \n\t\t**/\n function request(config){\n\n \t\n \t$injector.invoke(['DrupalApiConstant', 'FileResourceConstant', function (DrupalApiConstant, FileResourceConstant) {\n \t \t\t\n \t\tconfig.headers['Accept'] = DrupalApiConstant.responseFormat;\n \t\t\n \t\tif(!(config.method == 'POST' && config.url == DrupalApiConstant.drupal_instance + DrupalApiConstant.api_endpoint + FileResourceConstant.resourcePath)) {\n \t \tconfig.headers['Content-Type'] = DrupalApiConstant.responseFormat;\n \t\t}\n \t\t\n\t \t\n \t \t\n \t }]);\n\n\t\t\treturn config;\n };\n \t\n\t}", "function IAjaxHttpHook() { }", "function xhrInterceptor() {\n var originalXHR = window.XMLHttpRequest;\n var xhrSend = XMLHttpRequest.prototype.send;\n var xhrOpen = XMLHttpRequest.prototype.open;\n originalXHR.getRequestConfig = [];\n function ajaxEventTrigger(event) {\n var ajaxEvent = new CustomEvent(event, { detail: this });\n window.dispatchEvent(ajaxEvent);\n }\n function customizedXHR() {\n var liveXHR = new originalXHR();\n liveXHR.addEventListener('readystatechange', function () {\n ajaxEventTrigger.call(this, 'xhrReadyStateChange');\n }, false);\n liveXHR.open = function (method, url, async, username, password) {\n this.getRequestConfig = arguments;\n return xhrOpen.apply(this, arguments);\n };\n liveXHR.send = function (body) {\n return xhrSend.apply(this, arguments);\n };\n return liveXHR;\n }\n window.XMLHttpRequest = customizedXHR;\n }", "setResponseInterceptor() {\n let self = this;\n this._axios.interceptors.response.use(\n response => {\n return response;\n },\n error => {\n self.checkResponseStatus(error);\n return Promise.reject(new QbResponseError(error));\n }\n );\n }", "responseForRequest() {\n throw new Error('Not implemented');\n }", "function onRequest() {\n\n // sets the actually resolved action, as it is also set by notfound\n req.data.action = req.action;\n \n if (req.action != 'notfound') {\n // let soft-coded actions override\n var idempotentAction = req.action +'_'+ req.method.toLowerCase();\n var action = (this.actions[idempotentAction] || this.actions[req.action]);\n \n if (action) {\n action.call(this);\n res.stop();\n }\n }\n}", "function interceptor(f){\n\n return function(){\n console.log('before function call...');\n var r = f.apply(this, arguments);\n console.log('after function call..');\n return r;\n }\n }", "function VMInterceptor() {\r\n}", "function method (request, next) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers['X-HTTP-Method-Override'] = request.method;\n request.method = 'POST';\n }\n\n next();\n }", "function method (request, next) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers['X-HTTP-Method-Override'] = request.method;\n request.method = 'POST';\n }\n\n next();\n }", "intercept(initialRequest, next) {\n return this.injector.runInContext(() => jsonpInterceptorFn(initialRequest, downstreamRequest => next.handle(downstreamRequest)));\n }", "function NetworkResponseInterceptor () {\n this._originalAjax = $.ajax;\n this._successInterceptors = [];\n this._errorInterceptors = [];\n this._urlPatterns = [];\n}", "function NetworkResponseInterceptor() {\n this._originalAjax = $.ajax;\n this._successInterceptors = [];\n this._errorInterceptors = [];\n this._urlPatterns = [];\n}", "isInterceptResolutionHandled() {\n throw new Error('Not implemented');\n }", "function Interceptor(nativeOpenWrapper, nativeSendWrapper) {\r\n XMLHttpRequest.prototype.open = function () {\r\n // Code here to intercept XHR\r\n // console.log(this, arguments);\r\n return nativeOpenWrapper.apply(this, arguments);\r\n }\r\n XMLHttpRequest.prototype.send = function () {\r\n this.onloadend = function () {\r\n if (this.capture) {\r\n // console.log(this.responseText);\r\n }\r\n }\r\n // console.log(this, arguments);\r\n var xhr = this,\r\n waiter = setInterval(function () {\r\n if (xhr.readyState && xhr.readyState == 4) {\r\n if(xhr.responseURL != null){\r\n var checkingUrl = xhr.responseURL.split(\"/\");\r\n if( checkingUrl[ checkingUrl.length - 1 ] == \"ConfigDwr.updateArraySize.dwr\" ){\r\n $('#update')[0].click();\r\n }\r\n }\r\n clearInterval(waiter);\r\n }\r\n }, 50);\r\n return nativeSendWrapper.apply(this, arguments);\r\n }\r\n }", "intercept(initialRequest, next) {\n return this.injector.runInContext(() => jsonpInterceptorFn(initialRequest, downstreamRequest => next.handle(downstreamRequest)));\n }", "intercept(req, next) {\n if (this.loggedIn) {\n this.logger.log(\"loggedin into interceptor\", \"\");\n return this.auth.getTokenSilently$().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__[\"mergeMap\"])(token => {\n const tokenReq = req.clone({\n setHeaders: { Authorization: `Bearer ${token}` }\n });\n return next.handle(tokenReq);\n }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__[\"catchError\"])(err => {\n this.logger.error(\"injector error\", \"\");\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_0__[\"throwError\"])(err);\n }));\n }\n else {\n this.logger.log(\"not loggedin into interceptor\", \"\");\n return next.handle(req);\n }\n }", "componentWillMount() {\n this.reqInterceptor = axios.interceptors.request.use(req => {\n this.setState({ error: null });\n return req;\n });\n this.resInterceptor = axios.interceptors.response.use(res => res, error => {\n this.setState({ error: error });\n });\n }", "componentWillMount(){\n this.reqInterceptor= axios.interceptors.request.use(req=>{\n // console.log(req);\n this.setState({error:null});\n return req;\n })\n\n this.resInterceptor =axios.interceptors.response.use(res =>res,error=>{\n this.setState({error:error});\n })\n }", "addDefaultRequestInterceptor() {\n\t\tthis.axiosInstance.interceptors.request.use((config) => {\n\t\t\tlet need = Object.keys(this.option.auth).length > 0\n\t\t\tif (need) {\n\t\t\t\tconst timestamp = Date.now()\n\n\t\t\t\tlet query = {}\n\t\t\t\tconst array = config.url.split('?')\n\t\t\t\tif (array.length > 1) {\n\t\t\t\t\tquery = qs.parse(array[1])\n\t\t\t\t}\n\t\t\t\tconst data = config.data || {}\n\t\t\t\tconst params = config.params || {}\n\n\t\t\t\t// signature\n\t\t\t\tconst signature = sign(\n\t\t\t\t\tObject.assign({\n\t\t\t\t\t\t__timestamp__: timestamp\n\t\t\t\t\t}, data, params, query),\n\t\t\t\t\tthis.option.auth.token\n\t\t\t\t)\n\n\t\t\t\t// headers\n\t\t\t\tconfig.headers = {\n\t\t\t\t\t'h-token': this.option.auth.token,\n\t\t\t\t\t'h-nonce': this.option.auth.nonce,\n\t\t\t\t\t'h-signature': signature,\n\t\t\t\t\t'h-timestamp': timestamp\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn config\n\t\t}, (err) => {\n\t\t\treturn Promise.reject(err)\n\t\t})\n\t}", "constructor(props){\n super(props); \n this.reqInterceptor = axios.interceptors.request.use(req => {\n // clear null state before request sent \n this.setState({error: null});\n return req; \n });\n\n // interceptors intercept the requests or response before they are handled by then and catch\n // first param is to do something with the response data, which we do not want to do here so we instantly return it \n this.respInterceptor = axios.interceptors.response.use(res => res, error => {\n this.setState({error: error}); \n });\n }", "on(method, params, body, authModule) {\n return this._response(this.CODE_EMPTY, {});\n }", "function method (request, next) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers['X-HTTP-Method-Override'] = request.method;\n request.method = 'POST';\n }\n\n next();\n}", "function interceptShindigOsapi() {\n\n var osapi = $r(\"osapi\");\n var $newBatch = osapi.newBatch;\n\n osapi.newBatch = function() {\n var batch = $newBatch.apply(this, arguments);\n osapi.jive.corev3._extendOsapiBatchRequestWithResponseInterceptorSupport(batch);\n return batch;\n };\n\n function defer(fn) {\n return function () {\n var self = this;\n var args = arguments;\n ext.runWhenReady(function () {\n return fn.apply(self, args);\n });\n }\n }\n\n function intercept(interceptor, response) {\n if (interceptor.renderSilent === true) {\n return response;\n }\n return interceptor(response) || response;\n }\n\n osapi.jive = osapi.jive || {};\n osapi.jive.corev3 = osapi.jive.corev3 || {};\n $e(osapi.jive.corev3, {\n _extendOsapiRequestWithResponseInterceptor : function(request, responseInterceptor) {\n request._jive = request._jive || {};\n if (!request._jive.hasOwnProperty(\"responseInterceptor\")) {\n if (request.execute._intercepted !== true) {\n var $execute = request.execute;\n request.execute = defer(function (callback) {\n var di = this._jive.responseInterceptor;\n if (di && di instanceof Function) {\n var callbackIntercept = function (response) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = intercept(di, response) || response;\n return callback.apply(this, args);\n };\n var args = Array.prototype.slice.call(arguments);\n args[0] = callbackIntercept;\n return $execute.apply(this, args);\n }\n else {\n return $execute.apply(this, arguments);\n }\n });\n request.executeAs = function (personURI, callback) {\n this.rpc.runAs = \"uri \" + personURI;\n return this.execute(callback);\n };\n request.execute._intercepted = true;\n }\n }\n request._jive.responseInterceptor = responseInterceptor;\n },\n\n _buildRequestWithStaticResponse : function(response) {\n return {\n _jive: {\n staticResponse:response\n },\n execute: function(callback) {\n callback(response);\n }\n };\n },\n\n _buildRequestWithStaticErrorResponse : function(message) {\n return this._buildRequestWithStaticResponse(osapi.jive.core._createErrorResponse({\n message: message\n }));\n },\n\n _extendOsapiBatchRequestWithResponseInterceptorSupport : function(request) {\n if (request.add._intercepted !== true) {\n var $add = request.add;\n request.add = function(key, request) {\n this._jive = this._jive || {requestCount:0};\n this._jive.allRequests = this._jive.allRequests || [];\n var di = request._jive && request._jive.responseInterceptor;\n if (di && di instanceof Function) {\n this._jive.diContainer = this._jive.diContainer || [];\n var diContainer = this._jive.diContainer;\n diContainer.push({ key: key, responseInterceptor: di, request: request });\n }\n var sr = request._jive && request._jive.staticResponse;\n if (sr) {\n this._jive = this._jive || {};\n this._jive.srContainer = this._jive.srContainer || {};\n var srContainer = this._jive.srContainer;\n srContainer[key] = sr;\n } else {\n this._jive.requestCount++;\n this._jive.allRequests.push(request);\n return $add.apply(this, arguments);\n }\n };\n request.add._intercepted = true;\n }\n\n if (request.execute._intercepted !== true) {\n var $execute = request.execute;\n request.execute = defer( function (callback) {\n if (this._jive && this._jive.diContainer && this._jive.diContainer.length) {\n var diContainer = this._jive.diContainer;\n var srContainer = this._jive.srContainer || {};\n var callbackIntercept = function (response) {\n var restore = [];\n for (var i = 0, l = diContainer.length; i < l; ++i) {\n var key = diContainer[i].key;\n if (response.hasOwnProperty(key) && response[key]) {\n var content = response[key];\n if (content) {\n var di = diContainer[i].responseInterceptor;\n var req = diContainer[i].request;\n content = intercept(di, content) || content;\n // hide the interceptor on the request to\n // prevent it from being called twice\n req._jive.responseInterceptor.renderSilent = true;\n restore.push(req._jive.responseInterceptor);\n response[key] = content;\n }\n }\n }\n for (var k in srContainer) {\n if (srContainer.hasOwnProperty(k)) {\n response[k] = srContainer[k];\n }\n }\n var args = Array.prototype.slice.call(arguments);\n args[0] = response;\n try {\n var result = callback.apply(this, args);\n restoreSilence();\n }\n catch (e) {\n restoreSilence(); // because IE is dumb\n throw e;\n }\n function restoreSilence() {\n for (i = 0, l = restore.length; i < l; ++i) {\n // restore the interceptor on the request so that it\n // may be used again\n delete restore[i].renderSilent;\n }\n }\n\n return result;\n };\n var args = Array.prototype.slice.call(arguments);\n args[0] = callbackIntercept;\n return $execute.apply(this, args);\n }\n else if (this._jive && this._jive.srContainer) {\n // pure static response\n callback(this._jive.srContainer)\n }\n else {\n $execute.apply(this, arguments)\n }\n });\n request.executeAs = function (personURI, callback) {\n var requests = (this._jive && this._jive.allRequests) || [];\n var i, l = requests.length;\n for (i = 0; i < l; i++) {\n var req = requests[i];\n if (!/^jive\\.core\\.(get|put|post|delete)$/.test(req.method)) {\n throw \"executeAs() supports batch requests which contain only core API requests: '\" + req.method + \"' is unsupported\";\n }\n }\n var runAs = \"uri \" + personURI;\n for (i = 0; i < l; i++) {\n requests[i].rpc.runAs = runAs;\n }\n return this.execute(callback);\n };\n request.execute._intercepted = true;\n }\n }\n\n });\n\n function interceptJiveCoreRestCall(propertyName) {\n var fn = osapi.jive.core[propertyName];\n if (typeof fn === \"function\" && fn._intercepted !== true) {\n osapi.jive.core[propertyName] = function () {\n var req = fn.apply(osapi.jive.core, arguments);\n if (req) {\n osapi.jive.corev3._extendOsapiRequestWithResponseInterceptor(req,\n function() {\n return osapi.jive.corev3._interceptData.apply(this, arguments);\n });\n }\n return req;\n };\n osapi.jive.core[propertyName]._intercepted = true;\n }\n }\n\n initIntercept = function() {\n if (osapi.jive.core) {\n interceptJiveCoreRestCall(\"get\");\n interceptJiveCoreRestCall(\"put\");\n interceptJiveCoreRestCall(\"post\");\n interceptJiveCoreRestCall(\"delete\");\n }\n if (typeof opensocial === \"object\" && opensocial.data && opensocial.data.getDataContext && opensocial.data.getDataContext._intercepted !== true) {\n var $dataContext = opensocial.data.getDataContext;\n opensocial.data.getDataContext = function() {\n var ctx = $dataContext.apply(this, arguments);\n if ( ctx.getDataSet._intercepted !== true ) {\n $getDataSet = ctx.getDataSet;\n ctx.getDataSet = function() {\n return interceptData($getDataSet.apply(this, arguments));\n };\n ctx.getDataSet._intercepted = true;\n }\n return ctx;\n };\n opensocial.data.getDataContext._intercepted = true;\n }\n };\n\n registerOnLoadHandler(initIntercept);\n\n }", "requestContent(){\n throw \"Not implemented\";\n }", "function methodLogger(request, response, next){\r\n\t\t console.log(\"METHOD LOGGER\");\r\n\t\t console.log(\"================================\");\r\n\t\t console.log(\"METHOD: \" + request.method);\r\n\t\t console.log(\"URL:\" + request.url);\r\n\t\t next(); //call next middleware registered\r\n}", "function unknownMethodHandler(req, res) {\n if (req.method.toLowerCase() === 'options') {\n var allowHeaders = ['Accept', 'Accept-Version', 'Content-Type', 'Api-Version', 'Origin', 'X-Requested-With', 'Authorization', 'X-Auth-App', 'X-Auth-Token']; // added Origin & X-Requested-With & **Authorization**\n\n if (res.methods.indexOf('OPTIONS') === -1) res.methods.push('OPTIONS');\n\n res.header('Access-Control-Allow-Credentials', true);\n res.header('Access-Control-Allow-Headers', allowHeaders.join(', '));\n res.header('Access-Control-Allow-Methods', res.methods.join(', '));\n res.header('Access-Control-Allow-Origin', req.headers.origin);\n\n return res.send(200);\n }\n else\n return res.send(new restify.MethodNotAllowedError());\n}", "componentWillMount(){\n this.reqInterceptor = axios.interceptors.request.use(req =>{\n this.setState({error: null});\n return req;\n })\n this.resInterceptor = axios.interceptors.response.use(res => res, error =>{\n this.setState({error:error});\n });\n }", "function method (request, next) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n next();\n}", "function method (request, next) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n next();\n}", "function method (request, next) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n next();\n}", "static filterHttpRequest (request) {}", "function _createWrappedRequestMethodFactory(breadcrumbsEnabled, tracingEnabled) {\n return function wrappedRequestMethodFactory(originalRequestMethod) {\n return function wrappedMethod() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var httpModule = this;\n var requestArgs = http_1.normalizeRequestArgs(this, args);\n var requestOptions = requestArgs[0];\n var requestUrl = http_1.extractUrl(requestOptions);\n // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method\n if (http_1.isSentryRequest(requestUrl)) {\n return originalRequestMethod.apply(httpModule, requestArgs);\n }\n var span;\n var parentSpan;\n var scope = core_1.getCurrentHub().getScope();\n if (scope && tracingEnabled) {\n parentSpan = scope.getSpan();\n if (parentSpan) {\n span = parentSpan.startChild({\n description: (requestOptions.method || 'GET') + \" \" + requestUrl,\n op: 'http.client',\n });\n var sentryTraceHeader = span.toTraceparent();\n utils_1.logger.log(\"[Tracing] Adding sentry-trace header \" + sentryTraceHeader + \" to outgoing request to \" + requestUrl + \": \");\n requestOptions.headers = tslib_1.__assign(tslib_1.__assign({}, requestOptions.headers), { 'sentry-trace': sentryTraceHeader });\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalRequestMethod\n .apply(httpModule, requestArgs)\n .once('response', function (res) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var req = this;\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('response', requestUrl, req, res);\n }\n if (tracingEnabled && span) {\n if (res.statusCode) {\n span.setHttpStatus(res.statusCode);\n }\n span.description = http_1.cleanSpanDescription(span.description, requestOptions, req);\n span.finish();\n }\n })\n .once('error', function () {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var req = this;\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('error', requestUrl, req);\n }\n if (tracingEnabled && span) {\n span.setHttpStatus(500);\n span.description = http_1.cleanSpanDescription(span.description, requestOptions, req);\n span.finish();\n }\n });\n };\n };\n}", "function wirejQueryInterceptor() {\n $(document).ajaxStart(function () { processRequest(); });\n $(document).ajaxComplete(function () { processResponse(); });\n $(document).ajaxError(function () { processResponse(); });\n }", "constructor(props) {\n super(props);\n this.reqInterceptor = axios.interceptors.request.use(request => {\n this.setState({error: null});\n return request;\n })\n this.resInterceptor = axios.interceptors.response.use(res => res, error => { //res => res returns the res\n this.setState({error: error});\n })\n }", "function endRequest( httpMethod ) {\n httpMethod = normalizedHttpMethod( httpMethod );\n pending.all--;\n pending[ httpMethod ]--;\n // EDGE CASE: In the unlikely event that the interceptors were not\n // able to obtain the config object; or, the method was changed after\n // our interceptor reached it, there's a chance that our numbers will\n // be off. In such a case, we want to try to redistribute negative\n // counts onto other properties.\n if ( pending[ httpMethod ] < 0 ) {\n redistributePendingCounts( httpMethod );\n }\n }", "function returnMethod(){\n return 'GET';\n}", "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "function method (request) {\n\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n\n}", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.ResponseHeader;\n }", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.ResponseHeader;\n }", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.ResponseHeader;\n }", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.ResponseHeader;\n }", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.ResponseHeader;\n }", "function methodLogger(request, response, next) {\n console.log(\"METHOD LOGGER\")\n console.log(\"================================\")\n console.log(\"METHOD: \" + request.method)\n console.log(\"URL:\" + request.url)\n next() //call next middleware registered\n}", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.ResponseHeader;\n }", "setRequestInterceptor() {\n this._axios.interceptors.request.use(config => {\n // a unique id per request\n config.headers[constants.HEADER.SESSION_ID] = uuid.v1();\n // not including now, but this is where we would add another header\n // if want to send unique id per user session --> config.uid\n\n let ticket = this.getCookie(CookieConstants.COOKIES.TICKET);\n if (ticket) {\n config.headers[constants.HEADER.TICKET] = ticket;\n }\n return config;\n });\n }", "function eventGatewayInterceptor($httpProvider) {\n $httpProvider.interceptors.push(['$q', '$injector', function ($q, $injector) {\n var config = $injector.get('config');\n var $location = $injector.get('$location');\n\n var queryPairs = $location.search(),\n ajaxAnalyticsEnabled = config.getBool(config.eventgatewayV4.logServiceCalls),\n ajaxAnalyticsEnabledErrorsOnly = config.getBool(config.eventgatewayV4.logServiceCallErrorsOnly);\n\n // Override reporting level by query param egErrorReportingLevel\n switch (queryPairs.egErrorReportingLevel) {\n case 'all':\n ajaxAnalyticsEnabled = true;\n ajaxAnalyticsEnabledErrorsOnly = false;\n break;\n case 'errors':\n ajaxAnalyticsEnabled = true;\n ajaxAnalyticsEnabledErrorsOnly = true;\n break;\n case 'none':\n ajaxAnalyticsEnabled = false;\n break;\n }\n\n return {\n request: function request(config) {\n var eventGatewayService = $injector.get('eventGatewayService');\n if (ajaxAnalyticsEnabled && config && config.url.indexOf('http') === 0) {\n config.startTime = new Date().getTime();\n eventGatewayService.setServiceCallStartTime();\n }\n return config;\n },\n responseError: function responseError(response) {\n if (ajaxAnalyticsEnabled && response && response.config && response.config.url.indexOf('http') === 0) {\n remoteCallReturned(true, response);\n }\n\n return $q.reject(response);\n },\n response: function response(_response) {\n if (ajaxAnalyticsEnabled && !ajaxAnalyticsEnabledErrorsOnly && _response.config.url.indexOf('http') === 0) {\n remoteCallReturned(false, _response);\n }\n return _response;\n }\n };\n\n function remoteCallReturned(err, config) {\n var eventGatewayService = $injector.get('eventGatewayService');\n var timedOut = config.status === 408,\n result;\n\n if (err) {\n\n if (config.status === -1) {\n return null;\n }\n\n if (timedOut) {\n result = 'timeout';\n } else {\n result = 'failure';\n }\n } else {\n result = 'success';\n }\n\n eventGatewayService.sendEvent('serviceCallResult', {\n httpStatusCode: config.status,\n httpUrl: config.config.url,\n httpVerb: config.config.method,\n result: result\n });\n }\n }]);\n }", "response() {\n throw new Error('Not implemented');\n }", "function instrumentOperation(\n orig,\n origArguments,\n request,\n AWS,\n agent,\n { version, enabled },\n) {\n const instrumentor = instrumentorFromSvcId[request.service.serviceIdentifier];\n if (instrumentor) {\n return instrumentor(orig, origArguments, request, AWS, agent, {\n version,\n enabled,\n });\n }\n\n // if we're still here, then we still need to call the original method\n return orig.apply(request, origArguments);\n}", "intercept(request, next) {\n return next.handle(request).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"tap\"])((event) => {\n if (event instanceof _angular_common_http__WEBPACK_IMPORTED_MODULE_1__[\"HttpResponse\"]) {\n /* const errMsg = event.body.error;\n if (errMsg) {\n if (errMsg === 'You should login first!') {\n // debugger;\n this.authService.destroy_session();\n this.router.navigate(['/auth/login']);\n this.utilService.showErrorToast('You need to login first !');\n // this.messageService.displayToast(errMsg);\n } else if (errMsg === 'Access token is incorrect !!') {\n // dismiss\n } else {\n // this.messageService.displayToast(errMsg);\n }\n }*/\n }\n }, (err) => {\n if (err.status === 401) {\n this.authService.destroy_session();\n this.router.navigate(['/auth/login']).then();\n this.utilService.showErrorToast('You need to login first !');\n }\n else if (err.status === 500) {\n // this.messageService.displayToast(err.error.msg);\n }\n }));\n }", "constructor () {\n this._handleRequest = this._handleRequest.bind(this)\n }", "_initMethodOverride() {\n this.app.use(methodOverride());\n }", "function method(request) {\n if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {\n request.headers.set('X-HTTP-Method-Override', request.method);\n request.method = 'POST';\n }\n}", "GET() {\n }", "getNormalResponse() {\n return \"Not implemented\";\n }", "function superCall(context,methodName){var args=zrUtil.slice(arguments,2);return this.superClass.prototype[methodName].apply(context,args);}", "send(message, transformers) {\n message.interceptors = message.interceptors || [];\n\n var conf = this.tokenAuthConfiguration;\n if(!conf.disabled) {\n message.interceptors.unshift(new RequestInterceptor(this.bearerToken));\n if(conf.renewBearerToken || !this.bearerToken) {\n message.interceptors.unshift(new ResponseInterceptor(this.setBearerToken.bind(this), this.tokenAuthConfiguration.bearerTokenHeaders));\n }\n }\n\n return new HttpClient().send(message, transformers);\n return super.send(message, transformers);\n }", "function onRequest(request, response) {\n\tif (request.method !== \"GET\") {\n\t\tconsole.log(\"!Not a GET!\");\n\t\thandleBadRequest(response, 404); // *could* do a 405 if we then sent the 'Allow' header. meh.\n\t\treturn;\n\t\t}\n\trouter(request, response);\n\tconsole.log(\"Request routed\");\n\t}", "function middleware(request, response, next) {}", "intercept (opts) {\n return new MockInterceptor(opts, this[kDispatches$1])\n }", "function ResponseBase() {}", "trace(method, requestUrl, body, responseBody, responseStatus) {\n this.log.trace(`${method} ${requestUrl.path} ${responseStatus}`);\n }", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.Response;\n this.body = init.body !== undefined ? init.body : null;\n }", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.Response;\n this.body = init.body !== undefined ? init.body : null;\n }", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.Response;\n this.body = init.body !== undefined ? init.body : null;\n }", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.Response;\n this.body = init.body !== undefined ? init.body : null;\n }", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.Response;\n this.body = init.body !== undefined ? init.body : null;\n }", "function timeStampInterceptor() {\r\n\t var factory = {\r\n\t\t request : function(config){\r\n\t\t\t var url = config.url;\r\n\t\t\t if (url.indexOf('view') > -1) return config;\r\n\t\t\t var timeStamp = new Date().getTime();\r\n\t\t\t config.url = url + \"?timestamp=\" + timeStamp;\r\n\t\t\t console.log(config.url);\r\n\t\t\t return config;\r\n\t\t }\r\n\t }\r\n\r\n\t return factory;\r\n }", "constructor(httpRequest) {\n const [method, path] = httpRequest.split(' ');\n this.method = method;\n this.path = path;\n }", "constructor(init = {}) {\n super(init);\n this.type = HttpEventType.Response;\n this.body = init.body !== undefined ? init.body : null;\n }", "function interceptingHandler(backend) {\n var interceptors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n if (!interceptors) {\n return backend;\n }\n\n return interceptors.reduceRight(function (next, interceptor) {\n return new HttpInterceptorHandler(next, interceptor);\n }, backend);\n }", "function getHandler(method, getArgs, service) {\n return function (req, res, next) {\n res.setHeader('Allow', allowedMethods(service).join(','));\n\n // Check if the method exists on the service at all. Send 405 (Method not allowed) if not\n if (typeof service[method] !== 'function') {\n debug('Method \\'' + method + '\\' not allowed on \\'' + req.url + '\\'');\n res.status(statusCodes.methodNotAllowed);\n return next(new _feathersErrors2.default.MethodNotAllowed('Method `' + method + '` is not supported by this endpoint.'));\n }\n\n var params = _extends({}, req.params || {});\n delete params.__feathersId;\n\n // Grab the service parameters. Use req.feathers and set the query to req.query\n params = _extends({ query: req.query || {} }, params, req.feathers);\n\n // Run the getArgs callback, if available, for additional parameters\n var args = getArgs(req, res, next);\n\n // The service success callback which sets res.data or calls next() with the error\n var callback = function callback(error, data) {\n if (error) {\n debug('Error in REST handler: `' + (error.message || error) + '`');\n return next(error);\n }\n\n res.data = data;\n res.hook = hookObject(method, 'after', args.concat([params, callback]));\n\n if (!data) {\n debug('No content returned for \\'' + req.url + '\\'');\n res.status(statusCodes.noContent);\n } else if (method === 'create') {\n res.status(statusCodes.created);\n }\n\n return next();\n };\n\n debug('REST handler calling `' + method + '` from `' + req.url + '`');\n service[method].apply(service, args.concat([params, callback]));\n };\n}", "handleRequest(req, res) {\n if (req.method == 'GET') {\n this.handleGet.bind(this)(req, res);\n } else if (req.method == 'POST') {\n this.handlePost.bind(this)(req, res);\n }\n }", "function log() {\n logger.hit(`${this.req.url} ${this.statusCode} ${this.req.method} ${this.req.body.From} ${this.req.body.Body} ${this[action_symbol]}`, this)\n}", "function methodBindingInterceptor(methodArgs) {\r\n // capture the caller\r\n var caller = this;\r\n // call original method\r\n originalSourceMethod.call(caller, methodArgs);\r\n // forward the call to the binding logic\r\n ComponentBindingConnector.updateBindingValue(caller, bindingDescriptor, methodArgs);\r\n }", "addDefaultResponseInterceptor() {\n\t\tthis.axiosInstance.interceptors.response.use((res) => {\n\t\t\tconst data = res.data;\n\t\t\tif (data.status !== 200) {\n\t\t\t\treturn Promise.reject({status: data.status, body: data.body, message: data.message})\n\t\t\t}\n\t\t\treturn data.body\n\t\t}, (err) => {\n\t\t\tlet errorMessage = err.message\n\t\t\tlet status = -1\n\t\t\tif (err.response) {\n\t\t\t\tstatus = err.response.status\n\t\t\t\tswitch (err.response.status) {\n\t\t\t\t\tcase 404: {\n\t\t\t\t\t\terrorMessage = '404 not found'\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tcase 500: {\n\t\t\t\t\t\terrorMessage = '500 internal error'\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn Promise.reject({status: status, body: null, message: errorMessage})\n\t\t})\n\t}", "componentWillMount() {\n\t\t\t// we will store reference to these interceptors which will be used upon ejecting\n\t\t\tthis.requestInterceptor = axios.interceptors.request.use(\n\t\t\t\tconfig => {\n\t\t\t\t\t// before sending a new request, we first clear any errors that were set earlier\n\t\t\t\t\tthis.setState({ error: null });\n\t\t\t\t\treturn config;\n\t\t\t\t},\n\t\t\t\terror => {\n\t\t\t\t\tthis.setState({ error: error });\n\t\t\t\t\treturn Promise.reject(error);\n\t\t\t\t\t// return Promise.reject(error.response); // correct because axios wraps error\n\t\t\t\t}\n\t\t\t);\n\t\t\tthis.responseInterceptor = axios.interceptors.response.use(\n\t\t\t\tresponse => response,\n\t\t\t\terror => {\n\t\t\t\t\tthis.setState({ error: error });\n\t\t\t\t\treturn Promise.reject(error);\n\t\t\t\t\t// return Promise.reject(error.response); // correct because axios wraps error\n\t\t\t\t}\n\t\t\t);\n\t\t}", "intercept (opts) {\n return new MockInterceptor$1(opts, this[kDispatches$2])\n }", "function csrfSafeMethod(method) {\n\t\treturn (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));\n\t}", "call(method, route, correlationId, params = {}, data, callback) {\n super.call(method, route, correlationId, params, data, callback);\n }" ]
[ "0.6643519", "0.6643519", "0.6643519", "0.6643519", "0.6643519", "0.6469818", "0.60097545", "0.5925656", "0.586097", "0.5851553", "0.58461994", "0.58268934", "0.5821371", "0.57700545", "0.5768504", "0.5766474", "0.5756035", "0.56853807", "0.5640843", "0.56179935", "0.56011593", "0.5587959", "0.5587959", "0.5574784", "0.5564717", "0.55589193", "0.5557926", "0.5552717", "0.5535981", "0.5535318", "0.5506278", "0.54885393", "0.54769063", "0.5466848", "0.5437019", "0.5427776", "0.5413888", "0.5401458", "0.5389246", "0.5366165", "0.5362935", "0.5336622", "0.5336622", "0.5336622", "0.53228045", "0.53196484", "0.529591", "0.5291539", "0.5290643", "0.5273189", "0.52410716", "0.52410716", "0.52410716", "0.52410716", "0.52410716", "0.52410716", "0.52410716", "0.52410716", "0.5204372", "0.5204372", "0.5204372", "0.5204372", "0.5204372", "0.5198565", "0.5166795", "0.5166114", "0.5138827", "0.5127747", "0.5117911", "0.5111332", "0.50844896", "0.50767374", "0.50584984", "0.5049547", "0.49775708", "0.49702093", "0.4954679", "0.49534497", "0.49342093", "0.49321064", "0.49294183", "0.49191067", "0.49094257", "0.49094257", "0.49094257", "0.49094257", "0.49094257", "0.49007306", "0.489812", "0.4897285", "0.4896905", "0.4896025", "0.48949248", "0.4890064", "0.48788387", "0.48706123", "0.48667404", "0.48605075", "0.48522416", "0.485136" ]
0.535123
41
Service for interacting with RESTful services.
function Resource(url, params, actions, options$$1) { var self = this || {}, resource = {}; actions = assign({}, Resource.actions, actions); each(actions, function (action, name) { action = merge({ url: url, params: assign({}, params) }, options$$1, action); resource[name] = function () { return (self.$http || Http)(opts(action, arguments)); }; }); return resource; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RestService() {\n // This is the spoke we'll be in touch with. When returning will wrap it with Plug.\n var spoke = through.obj();\n\n // It's always good to init services on the second tick\n process.nextTick(function () {\n spoke.write(messages.log(\"STARTING API\"));\n\n var api = express();\n\n api.get(\"/dogs\", function (req, res) {\n // We can access the hub as a stream\n spoke.write(messages.log(\"DOGS REQUEST\"));\n\n // or with MueRequest\n requestDogs(spoke, function (err, dogs) {\n res.json({dogs: dogs.dogs});\n })\n })\n api.get(\"/dogs/add/:type/:name\", function (req, res) {\n // Application logic validation should be handled here,\n // Business logic validation should be handled within the DOG ADDING service\n\n addDog(spoke, {type: req.params.type, name: req.params.name}, function (err, addedDog) {\n res.json(addedDog);\n })\n })\n\n api.listen(3000);\n });\n\n // Really important to wrap it with Plug. Otherwise, if you return a through stream, you'll get into a recursion.\n return Plug(spoke);\n}", "function REST(){\n\tvar self = this;\n\tself.connectMysql();\n}", "function ResourceService(ResourceProvider) {\n return {\n login: function (auth) {\n var request = {\n method: 'POST',\n path: '/auth_token',\n headers: {\n Authorization: auth\n }\n };\n return ResourceProvider(request);\n },\n register: function (user) {\n var request = {\n method: 'POST',\n path: '/users',\n data: user\n };\n return ResourceProvider(request);\n },\n getCurrentUser: function () {\n var request = {\n method: 'GET',\n path: '/user'\n };\n return ResourceProvider(request, \"currentUser\");\n },\n getUsers: function (refresh) {\n var request = {\n method: 'GET',\n path: '/users'\n };\n return ResourceProvider(request, \"users\", !refresh);\n },\n getUserDetails: function (username, refresh) {\n var request = {\n method: 'GET',\n path: '/users/' + username\n };\n return ResourceProvider(request, \"user_\" + username, !refresh);\n },\n createUser: function (user) {\n var request = {\n method: 'POST',\n path: '/users',\n data: user\n };\n return ResourceProvider(request);\n },\n updateUser: function (username, user) {\n var request = {\n method: 'PUT',\n path: '/users/' + username,\n data: user\n };\n return ResourceProvider(request);\n },\n deleteUser: function (username) {\n var request = {\n method: 'DELETE',\n path: '/users/' + username\n };\n return ResourceProvider(request);\n },\n getNews: function (refresh) {\n var request = {\n method: 'GET',\n path: '/news'\n };\n return ResourceProvider(request, \"news\", !refresh);\n },\n getNewsBySlug: function (slug, refresh) {\n var request = {\n method: 'GET',\n path: '/news/' + slug\n };\n return ResourceProvider(request, \"news_\" + slug, !refresh);\n },\n createNews: function (news) {\n var request = {\n method: 'POST',\n path: '/news',\n data: news\n };\n return ResourceProvider(request);\n },\n updateNews: function (slug, news) {\n var request = {\n method: 'PUT',\n path: '/news/' + slug,\n data: news\n };\n return ResourceProvider(request);\n },\n deleteNews: function (slug) {\n var request = {\n method: 'DELETE',\n path: '/news/' + slug\n };\n return ResourceProvider(request);\n }\n }\n }", "GET() {\n }", "_rest(_atype, _aurl, _aparams = null, _arethandle = null, _aretkey = null, _amethod = false, _amethodargs = []) {\r\n\r\n\t\tvar core = this;\r\n\r\n\t\t// Encode the parameters for the request\r\n\t\tvar params = \"\";\r\n\t\tif(_aparams != null){\r\n\r\n\t\t\t// GET request will have its params encoded into query strings\r\n\t\t\t// POST request will have its params encoded into form data\r\n\t\t\tif(_atype == \"GET\"){\r\n\t\t\t\tfor (var i = 0, l = _aparams.length; i < l; i++){\r\n\t\t\t\t\tif(_aparams[i] instanceof Array){\r\n\t\t\t\t\t\t_aparams[i] = _aparams[i].join(\"=\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tparams = _aparams.join(\"&\");\r\n\t\t\t} else if(_atype == \"POST\"){\r\n\t\t\t\tparams = new FormData();\r\n\t\t\t\tfor (var i = 0, l = _aparams.length; i < l; i++){\r\n\t\t\t\t\tif(_aparams[i] instanceof Array){\r\n\t\t\t\t\t\tparams.append(_aparams[i][0], _aparams[i][1]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Log\r\n\t\tif(core._app_verbose){\r\n\t\t\tconsole.log(\"REST Request (\" + _atype + \"):\");\r\n\t\t\tconsole.log(params);\r\n\t\t}\r\n\r\n\t\t// Execute the request\r\n\t\tvar _xreq = new XMLHttpRequest();\r\n\t\t\t_xreq.open(_atype, _aurl + (_atype == \"GET\" ? (_aparams != null ? \"?\" + params : \"\") : \"\"), (_aparams != null ? (_atype == \"POST\" ? true : false) : false));\r\n\t\t\t_xreq.addEventListener(\"load\", function(){ if(_amethod != false){ _amethod(_amethodargs); } _arethandle[_aretkey] = this.responseText; });\r\n\t\t\t_xreq.setRequestHeader('Cache-Control', 'no-cache');\r\n\t\t\t_xreq.send((_atype == \"POST\" ? (_aparams != null ? params : \"\") : \"\"));\r\n\r\n\t}", "function createJQueryRestAdapter (){\n // use jQuery to contact the Jive server\n\n var ajaxPath = \"\"; // value replaced when template is rendered\n var osapi = $r(\"osapi\");\n\n var dataFilter = function(data, type) {\n return (type === 'json' && data) ? jQuery.trim(data.replace(/^throw [^;]*;/, '')) : data;\n };\n\n /**\n * @param options.method {String} one of \"GET\", \"PUT\", \"POST\" or \"DELETE\"\n * @param options.endpoint {String} the short REST path, e.g.: \"users/1234?\"\n * @param options.queryParams {Object} map of query params to their values\n * @param options.body {String} body content to send with PUT or POST\n * @constructor\n */\n osapi.Request = function(options) {\n this.options = {\n method: options.method,\n endpoint: options.endpoint,\n ext: options.ext,\n v: options.v\n };\n if (isObjectWithProperties(options.queryParams)) {\n this.options.queryParams = options.queryParams\n }\n if (options.body != null) {\n this.options.body = options.body\n }\n };\n osapi.Request.prototype.execute = function(callback) {\n executeImpl.call(this, null, callback);\n };\n osapi.Request.prototype.executeAs = function(personURI, callback) {\n executeImpl.call(this, \"uri \" + personURI, callback);\n };\n function executeImpl(runAs, callback) {\n callback = callback || function(){};\n var endpoint = this.options.endpoint + buildQueryParams(this.options.queryParams);\n if (endpoint.charAt(0) == '/') {\n endpoint = endpoint.substring(1);\n }\n var path = this.options.ext\n ? \"ext/\" + this.options.ext + \"/\" + (this.options.version || this.options.v)\n : \"v3\";\n var url = [ajaxPath, \"api/core\", path, endpoint].join(\"/\");\n jQuery.ajax({\n url: url,\n type: this.options.method,\n contentType: this.options.body == null ? $u : \"application/json; charset=utf-8\",\n data: this.options.body == null ? $u : this.options.body,\n dataType: \"json\",\n dataFilter: dataFilter,\n beforeSend: function(req) {\n if (runAs != null) {\n req.setRequestHeader(\"X-Jive-Run-As\", runAs);\n }\n },\n success: function(data, textStatus, jqXHR) {\n if(data === null) {\n data = { status : jqXHR.status };\n }\n callback(interceptData(data));\n },\n error: function(xhr) {\n callback(buildErr(500, xhr.status, \"An error occurred while contacting the server\"));\n }\n });\n }\n\n /**\n * Object that may contain several Request objects to be executed in a\n * single REST call.\n * @constructor\n */\n osapi.BatchRequest = function() {\n this._requests = [];\n };\n osapi.BatchRequest.prototype.add = function(key, request) {\n if (this._requests == null) {\n throw \"BatchRequest is no longer valid\";\n }\n this._requests.push({\n key: key,\n request: request.options\n });\n };\n osapi.BatchRequest.prototype.execute = function(callback) {\n executeBatchImpl.call(this, null, callback);\n };\n osapi.BatchRequest.prototype.executeAs = function(personURI, callback) {\n executeBatchImpl.call(this, \"uri \" + personURI, callback);\n };\n function executeBatchImpl(runAs, callback) {\n if (this._requests == null) {\n throw \"BatchRequest is no longer valid\";\n }\n var req = this._requests;\n this._requests = null;\n callback = callback || function(){};\n if (req.length == 0) {\n callback({});\n return;\n }\n var url = [ajaxPath, \"api/core/v3/executeBatch\"].join(\"/\");\n jQuery.ajax({\n url: url,\n type: \"POST\",\n contentType: \"application/json; charset=utf-8\",\n data: JSON.stringify(req),\n dataType: \"json\",\n dataFilter: dataFilter,\n beforeSend: function(req) {\n if (runAs != null) {\n req.setRequestHeader(\"X-Jive-Run-As\", runAs);\n }\n },\n success: function(res) {\n var data = {}, i;\n for (i = 0; i < res.length; i++) {\n if (res[i].data) {\n data[res[i].id] = interceptData(res[i].data);\n } else if (res[i].error) {\n data[res[i].id] = buildErr(res[i].error.code || 500, res[i].status || 500, res[i].error.message);\n }\n }\n for (i = 0; i < req.length; i++) {\n if (!(data.hasOwnProperty(req[i].id) && data[req[i].id])) {\n data[req[i].id] = buildErr(500, 500, \"No data was returned from the server\");\n }\n }\n callback(data);\n },\n error: function(xhr) {\n var res = {};\n try {\n res = JSON.parse(xhr.responseText) || {};\n } catch (e) { /* don't care */ }\n var data = {};\n var err = buildErr(res.code || 500, xhr.status, res.message || \"An error occurred while contacting the server\");\n for (var i = 0; i < req.length; i++) {\n data[req[i].key] = err;\n }\n callback(data);\n }\n });\n }\n\n /**\n * Creates a new, empty BatchRequest\n * @return {osapi.BatchRequest}\n */\n osapi.newBatch = function() {\n return new osapi.BatchRequest();\n };\n\n function buildErr(code, status, msg) {\n return {\n error: {\n code: code,\n status: status,\n message: msg\n }\n };\n }\n\n function buildRequest(method, hasBody, options) {\n var o = {\n method: method,\n endpoint: options.href,\n queryParams: options.params\n };\n if (hasBody) {\n o.body = options.body == null ? \"\" : JSON.stringify(options.body);\n }\n if (options.ext) {\n o.ext = options.ext;\n o.v = options.v;\n }\n return new osapi.Request(o);\n }\n\n $r(\"osapi.jive.core\", function() { return {\n \"get\": function(options) {\n return buildRequest(\"GET\", false, options);\n },\n \"post\": function(options) {\n return buildRequest(\"POST\", true, options);\n },\n \"put\": function(options) {\n return buildRequest(\"PUT\", true, options);\n },\n \"delete\": function(options) {\n return buildRequest(\"DELETE\", false, options);\n }\n }});\n\n osapi.jive.core[\"get\"]._intercepted = true;\n osapi.jive.core[\"put\"]._intercepted = true;\n osapi.jive.core[\"post\"]._intercepted = true;\n osapi.jive.core[\"delete\"]._intercepted = true;\n\n initIntercept = bootstrapRest;\n }", "function RestProvider(http) {\n this.http = http;\n this.baseURI = 'http://192.168.43.230/UT_Api/';\n console.log('Hello RestProvider Provider');\n }", "_RESTfulFactory(verb, type, method, params) {\n\n this.httpHelper.blockUI.start();\n\n let paramsName = ['post', 'put'].indexOf(verb) > -1 ? 'data' : 'params';\n\n return this.$http[verb](this._getUrl(type, method), {\n [paramsName]: params\n }).then(this.httpHelper.verify, this.httpHelper.error);\n\n }", "function RestapiServiceProvider(http) {\n this.http = http;\n this.apiUrl = 'http://81.252.184.9:5003/data/'; //mobile url\n console.log('Hello RestapiServiceProvider Provider');\n }", "function RESTfulDefinition(props) {\n\t\tcopyObjTo(this, props);\n\t}", "function _usersServices() {\n\tlet baseUrl = 'http://localhost:5050/users'\n\n\tthis.get = function($http) {\n\t\treturn $http.get(baseUrl)\n\t}\n}", "function Resource(url,params,actions,options$$1){var self=this||{},resource={};actions=assign({},Resource.actions,actions);each(actions,function(action,name){action=merge({url:url,params:assign({},params)},options$$1,action);resource[name]=function(){return(self.$http||Http)(opts(action,arguments));};});return resource;}", "function Resource(url,params,actions,options$$1){var self=this||{},resource={};actions=assign({},Resource.actions,actions);each(actions,function(action,name){action=merge({url:url,params:assign({},params)},options$$1,action);resource[name]=function(){return(self.$http||Http)(opts(action,arguments));};});return resource;}", "function ApiServiceRegistry() {\n\t }", "function BookRestApi() {\n var bookProvider = BookProvider;\n var searchProvider = Search;\n var self = this;\n\n /**\n * Retuns all the books from the storage. Should be used with care. Apply paging later?\n * @param req express request\n * @param res express response\n */\n this.findAllBooks = function (req, res) {\n bookProvider.findAll(function (error, data) {\n if (error) {\n res.send(JSON.stringify({\"error\": error}))\n } else {\n res.send(JSON.stringify(data));\n }\n });\n };\n\n /**\n * Creates a new book from the clients' JSON. Updates both the MongoDB and the search index.\n *\n * @param req express request\n * @param res express response\n */\n this.newBook = function (req, res) {\n if (!req.body) {\n res.send(500, \"Wrong format - maybe malformed json?\");\n return;\n }\n\n bookProvider.save(req.body, function (error, bookSaved) {\n if (error) {\n LOG('Error saving book. Mongodb: ' + error);\n res.send(500, 'Error saving book!');\n } else {\n searchProvider.index('book', 'document', elasticSearch(bookSaved), bookSaved._id.toHexString(), null, function (data) {\n LOG(JSON.stringify(data));\n });\n res.send(JSON.stringify(bookSaved));\n }\n })\n };\n\n\n /**\n * Search for books endpoint. Waits for 'q' parameter with the keywords to search against, separated by comma. Like\n * ?q=madam,1,none,starting\n *\n * @param req express request\n * @param res express response\n */\n this.searchForBooks = function (req, res) {\n if (!req.query.q) {\n self.findAllBooks(req, res);\n return;\n }\n var qryObj = {\n \"query\": {\n \"query_string\": {\n \"query\": req.query.q\n }\n }\n };\n searchProvider.search('book', 'document', qryObj, null, function (data) {\n var elasticResponse = JSON.parse(data);\n if (elasticResponse.error) {\n LOG('Error from Bonsai: ' + data);\n res.send(500, \"Error from Bonsai\");\n return;\n }\n var hits = elasticResponse.hits.hits;\n LOG(hits.length + \" hits found for query \" + req.query.id);\n\n var ids = hits.map(function (hit) {\n return hit._source.id;\n });\n bookProvider.findByIds(ids, function (err, data) {\n if (err) {\n LOG(err);\n res.send(500, \"Error searching for books.\");\n return;\n }\n res.send(data)\n });\n\n });\n };\n\n this.update = function (req, res) {\n bookProvider.update(req.body, function (err, data) {\n if (err) {\n res.send(500, 'Error saving book!');\n }\n else {\n searchProvider.update('book', 'document', data._id, elasticSearch(data), function (d) {\n LOG(JSON.stringify(d));\n });\n res.send(data);\n }\n });\n };\n\n var elasticSearch = function (book) {\n return {\n \"name\": book.name,\n \"text\": [book.Text, book.Title, book.Author, book.Tags.join(\" \")].join(\" \"),\n \"id\": book._id\n }\n };\n}", "function Rest() {\n this.jsonBody = require('body/json');\n}", "function RestedAPI(options) {\n var $instance = this;\n var $static = $instance && $instance.constructor || RestedAPI;\n\n $static.options(options);\n\n return $static.routes();\n }", "function rest() {\n var handlers; // Cached handlers\n\n return function restApiHandler(req, res, next) {\n var app = req.app;\n var registry = app.registry;\n\n if (!handlers) {\n handlers = [];\n var remotingOptions = app.get('remoting') || {};\n\n var contextOptions = remotingOptions.context;\n if (contextOptions !== undefined && contextOptions !== false) {\n throw new Error(g.f(\n '%s was removed in version 3.0. See %s for more details.',\n 'remoting.context option',\n 'https://docs.strongloop.com/display/APIC/Using%20current%20context'));\n }\n\n if (app.isAuthEnabled) {\n var AccessToken = registry.getModelByType('AccessToken');\n handlers.push(loopback.token({ model: AccessToken, app: app }));\n }\n\n handlers.push(function(req, res, next) {\n // Need to get an instance of the REST handler per request\n return app.handler('rest')(req, res, next);\n });\n }\n if (handlers.length === 1) {\n return handlers[0](req, res, next);\n }\n async.eachSeries(handlers, function(handler, done) {\n handler(req, res, done);\n }, next);\n };\n}", "function REST() {\n var configuration = SharePointClient.Configurations;\n var utility = new SharePointClient.Utilities.Utility();\n configuration.IsApp = true;\n \n\n var listServices = new SharePointClient.Services.REST.ListServices();\n\n //REST Listservices class for accessing list services\n var listServices = new SharePointClient.Services.REST.ListServices();\n\n //Set response type\n var responseType = SharePointClient.Constants.REST.HTTP.DATA_TYPE.JSON;\n\n var listTitle = \"xyz\";\n //Create Caml object\n var camlConstant = SharePointClient.Constants.CAML_CONSTANT;\n var camlQuery = new SharePointClient.CamlExtension.REST.CamlQuery();\n camlQuery.SetViewScopeAttribute(camlConstant.CAML_QUERY_SCOPE.RECURSIVE_ALL)\n .SetViewFieldsXml(\"<FieldRef Name='ID'/><FieldRef Name='Title'/>\")\n .SetQuery(\"<Where><Geq><FieldRef Name=\\\"Modified\\\" /><Value Type=\\\"DateTime\\\" IncludeTimeValue=\\\"TRUE\\\"\"\n + \"StorageTZ=\\\"TRUE\\\">2014-08-05T15:50:08</Value></Geq></Where>\")\n .OverrideQueryThrottleMode(camlConstant.CAML_QUERY_THROTTLE_MODE.OVERRIDE)\n .OverrideOrderByIndex()\n .SetRowLimit(5000);\n\n //Get All list items batch by list name\n listServices.GetListItemsBatchByListName(listTitle, camlQuery.BuildQuery(), responseType).Execute(function (result) {\n //logic for working with returned result set\n });\n}", "configure(options, baseUrl = \"\") {\r\n return new SPRest(options, baseUrl);\r\n }", "function SPRest(options, baseUrl) {\n if (options === void 0) { options = {}; }\n if (baseUrl === void 0) { baseUrl = \"\"; }\n this._options = options;\n this._baseUrl = baseUrl;\n }", "function restApi(action, moreParams) {\n return boxApi.url + \"rest?action=\" + action + \"&api_key=\" + boxApi.apiKey\n + \"&auth_token=\" + boxApi.authToken + \"&\" + (moreParams || \"\");\n }", "init() {\n this.router.get(\"/\", (req, res, next) => {\n res.status(200).json(this._service.defaultMethod());\n });\n }", "function API(){}", "function API(){}", "function IndexService() {\n }", "configure(options, baseUrl = \"\") {\n return new SPRest(options, baseUrl);\n }", "function CategoryService(http) {\n this.http = http;\n this.restURL = \"http://localhost:3000/wscategories\";\n }", "constructor() {\n super(\"api/planetspecies\");\n this.router\n .get(\"\", this.getAll)\n .post(\"\", this.create);\n }", "function SetAPI(arg) {\n // Establish an auth object which has properties token and user_id.\n const module = 'SetAPI';\n let auth;\n if (typeof arg.auth === 'function') {\n auth = arg.auth();\n } else {\n // REALLY??\n auth = arg.auth || {};\n }\n\n if (!arg.url) {\n throw new Error('The service discovery url was not provided');\n }\n if (!arg.version) {\n throw new Error('The service version was not provided');\n }\n\n function options() {\n return {\n timeout: arg.timeout,\n authorization: auth.token,\n rpcContext: arg.rpcContext,\n };\n }\n\n this.lookupModule = function () {\n const func = 'get_service_status',\n params = [\n {\n module_name: module,\n version: arg.version || 'dev',\n },\n ];\n return jsonRpc.request(arg.url, 'ServiceWizard', func, params, 1, options());\n };\n\n /*\n * ref\n */\n this.get_reads_set_v1 = function () {\n const params = Array.prototype.slice.call(arguments),\n func = 'get_reads_set_v1';\n\n return this.lookupModule().then((serviceStatus) => {\n return jsonRpc.request(serviceStatus.url, module, func, params, 1, options());\n });\n };\n\n /*\n * ref\n */\n this.save_reads_set_v1 = function () {\n const params = Array.prototype.slice.call(arguments),\n func = 'save_reads_set_v1';\n\n return this.lookupModule().then((serviceStatus) => {\n return jsonRpc.request(serviceStatus.url, module, func, params, 1, options());\n });\n };\n\n /*\n * ref\n */\n this.list_sets = function () {\n const params = Array.prototype.slice.call(arguments),\n func = 'list_sets';\n\n return this.lookupModule().then((serviceStatus) => {\n return jsonRpc.request(serviceStatus.url, module, func, params, 1, options());\n });\n };\n\n /*\n * ref\n */\n this.get_set_items = function () {\n const params = Array.prototype.slice.call(arguments),\n func = 'get_set_items';\n\n return this.lookupModule().then((serviceStatus) => {\n return jsonRpc.request(serviceStatus.url, module, func, params, 1, options());\n });\n };\n\n /*\n * ref\n */\n this.status = function () {\n const params = Array.prototype.slice.call(arguments),\n func = 'status';\n\n return this.lookupModule().then((serviceStatus) => {\n return jsonRpc.request(serviceStatus.url, module, func, params, 1, options());\n });\n };\n }", "function TopListService() {\r\n\tthis.base_url = \"http://webservice.backend.com:3000\";\r\n\tthis.find_by_id = function(id, callback){\r\n\t\tvar c = new Client.RailsClient(this.base_url);\r\n\t\tc.get_one(\"top_lists\", id, callback );\r\n\t}\r\n\tthis.all = function(id, callback){\r\n\t\tvar c = new Client.RailsClient(this.base_url);\r\n\t\tc.get_all(\"top_lists\", id, callback );\r\n\t}\r\n}", "function productResource($resource) {\n return $resource(\"/api/products/:productId\")\n //The function then simply returns the $resource object giving it the URL for the products,\n //this sets up the communication with the web Server.\n }", "createServiceRouter() {\n const router = express.Router();\n router.post('/service', this._onBrokerRequest.bind(this));\n return router;\n }", "static get(name, id, state, opts) {\n return new RestApi(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "function productResource($resource, appSettings) {\r\n return $resource(appSettings.serverPath + \"/api/products\");\r\n\r\n // This is to test URL path routing.\r\n //return $resource(appSettings.serverPath + \"/api/products/id\");\r\n //return $resource(appSettings.serverPath + \"/api/products/:search\");\r\n }", "function apexrest(pathOrParams) {\n\n var params;\n\n if (pathOrParams.substring) {\n params = {path: pathOrParams};\n } else {\n params = pathOrParams;\n\n if (params.path.charAt(0) !== \"/\") {\n params.path = \"/\" + params.path;\n }\n\n if (params.path.substr(0, 18) !== \"/services/apexrest\") {\n params.path = \"/services/apexrest\" + params.path;\n }\n }\n\n return request(params);\n }", "rest(...args) {\n if (!_.isString(args[0])) {\n throw new Error('first argument of router.rest must be string');\n } \n const url = args[0];\n const controllers = args[args.length - 1];\n if (!_.isObject(controllers)) {\n throw new Error('need rest controllers');\n }\n const middlewares = args.slice(1, args.length - 1);\n if (controllers.list) {\n this.get(url, ...middlewares.map(m => _.isObject(m) ? m.list : m).filter(m => !!m).concat(controllers.list));\n }\n if (controllers.create) {\n this.post(url, ...middlewares.map(m => _.isObject(m) ? m.create : m).filter(m => !!m).concat(controllers.create));\t\t\t\n }\n if (controllers.update) {\n this.put(path.join(url, ':id'), ...middlewares.map(m => _.isObject(m) ? m.update : m).filter(m => !!m).concat(controllers.update));\n }\n if (controllers.remove) {\n this.del(path.join(url, ':id'), ...middlewares.map(m => _.isObject(m) ? m.remove : m).filter(m => !!m).concat(controllers.remove));\t\t\t\n }\n if (controllers.view) {\n this.get(path.join(url, ':id'), ...middlewares.map(m => _.isObject(m) ? m.view : m).filter(m => !!m).concat(controllers.view));\t\t\t\t\t\t\n }\n return this;\n }", "function restManage( callback )\r\n{\r\n return function( data, status, xhr )\r\n {\r\n\t if ( callback != null )\r\n\t\t callback ( data, status );\r\n }\r\n}", "function service(arg) {\n if (_typeof(arg) === 'object') {\n // When we add query params, our backend will complain if we don't have a\n // trailing slash.\n var path = arg.path.slice(-1) === '/' ? arg.path : arg.path.concat('/');\n var url = new URL(endpoint.concat(path));\n\n if ('params' in arg) {\n for (var key in arg.params) {\n if (arg.params.hasOwnProperty(key)) {\n var val = arg.params[key];\n url.searchParams.append(key, val);\n }\n }\n }\n\n return url;\n } else {\n return endpoint.concat(arg);\n }\n}", "get(uri, action) {\n\n this.route('GET', uri, action);\n }", "initGetAllEndpoint() {\n this.router.get('/', (req, res) => this.getDAO()\n .getAll({ user: req.user })\n .then(users => res.status(200).send(users))\n .catch(err => {\n debug('[getAll]', err.message);\n return this.sendErr(res, 400, err.message);\n }));\n }", "function JsonService(url)\n{\n this[\"GetUserSummary\"] = function(userDate, callback)\n {\n return call(\"GetUserSummary\", [ userDate ], callback);\n }\n\n this[\"DeleteCategory\"] = function(categoryID, callback)\n {\n return call(\"DeleteCategory\", [ categoryID ], callback);\n }\n\n this[\"InsertCategory\"] = function(category, callback)\n {\n return call(\"InsertCategory\", [ category ], callback);\n }\n\n this[\"UpdateCategory\"] = function(category, callback)\n {\n return call(\"UpdateCategory\", [ category ], callback);\n }\n\n this[\"InsertSubCategory\"] = function(subCategory, callback)\n {\n return call(\"InsertSubCategory\", [ subCategory ], callback);\n }\n\n this[\"UpdateSubCategory\"] = function(subCategory, callback)\n {\n return call(\"UpdateSubCategory\", [ subCategory ], callback);\n }\n\n this[\"DeleteSubCategory\"] = function(subCategoryID, callback)\n {\n return call(\"DeleteSubCategory\", [ subCategoryID ], callback);\n }\n\n this[\"InsertTrans\"] = function(trans, callback)\n {\n return call(\"InsertTrans\", [ trans ], callback);\n }\n\n this[\"DeleteTrans\"] = function(transID, callback)\n {\n return call(\"DeleteTrans\", [ transID ], callback);\n }\n\n this[\"UpdateTrans\"] = function(trans, callback)\n {\n return call(\"UpdateTrans\", [ trans ], callback);\n }\n\n this[\"SearchTrans\"] = function(startDate, endDate, categoryType, catIDString, amountOperator, amount, callback)\n {\n return call(\"SearchTrans\", [ startDate, endDate, categoryType, catIDString, amountOperator, amount ], callback);\n }\n\n this[\"GetTransPieGraphForDefaultDateRange\"] = function(defaultDateRange, categoryType, currentUserDate, callback)\n {\n return call(\"GetTransPieGraphForDefaultDateRange\", [ defaultDateRange, categoryType, currentUserDate ], callback);\n }\n\n this[\"GetTransPieGraphForCustomDateRange\"] = function(categoryType, startDate, endDate, callback)\n {\n return call(\"GetTransPieGraphForCustomDateRange\", [ categoryType, startDate, endDate ], callback);\n }\n\n /* Returns an array of method names implemented by this service. */\n\n this[\"system.listMethods\"] = function(callback)\n {\n return call(\"system.listMethods\", [ ], callback);\n }\n\n /* Returns the version server implementation using the major, minor, build and revision format. */\n\n this[\"system.version\"] = function(callback)\n {\n return call(\"system.version\", [ ], callback);\n }\n\n /* Returns a summary about the server implementation for display purposes. */\n\n this[\"system.about\"] = function(callback)\n {\n return call(\"system.about\", [ ], callback);\n }\n\n var serviceURL = \"https://\" + window.location.host + \"/Service/ExpJSONService.ashx\";\n var url = typeof (url) === 'string' ? url : serviceURL;\n\n var self = this;\n var nextId = 0;\n\n function call(method, params, callback)\n {\n var request = { id : nextId++, method : method, params : params };\n return callback == null ?\n callSync(method, request) : callAsync(method, request, callback);\n }\n\n function callSync(method, request)\n {\n var http = newHTTP();\n http.open('POST', url, false, self.httpUserName, self.httpPassword);\n setupHeaders(http, method);\n http.send(JSON.stringify(request));\n if (http.status != 200)\n throw { message : http.status + ' ' + http.statusText, toString : function() { return message; } };\n var response = JSON.eval(http.responseText);\n if (response.error != null) throw response.error;\n return response.result;\n }\n\n function callAsync(method, request, callback)\n {\n var http = newHTTP();\n http.open('POST', url, true, self.httpUserName, self.httpPassword);\n setupHeaders(http, method);\n http.onreadystatechange = function() { http_onreadystatechange(http, callback); }\n http.send(JSON.stringify(request));\n return request.id;\n }\n\n function setupHeaders(http, method)\n {\n http.setRequestHeader('Content-Type', 'text/plain; charset=utf-8');\n http.setRequestHeader('X-JSON-RPC', method);\n }\n\n function http_onreadystatechange(sender, callback)\n {\n if (sender.readyState == /* complete */ 4)\n {\n var response = sender.status == 200 ?\n JSON.eval(sender.responseText) : {};\n\n response.xmlHTTP = sender;\n\n callback(response);\n }\n }\n\n function newHTTP()\n {\n if (typeof(window) != 'undefined' && window.XMLHttpRequest)\n return new XMLHttpRequest(); /* IE7, Safari 1.2, Mozilla 1.0/Firefox, and Netscape 7 */\n else\n return new ActiveXObject('Microsoft.XMLHTTP'); /* WSH and IE 5 to IE 6 */\n }\n}", "function prepRest() {\n targetStr = \"&@target='\" + hostUrl + \"'\";\n baseUrl = appUrl + \"/_api/SP.AppContextSite(@target)/\";\n executor = new SP.RequestExecutor(appUrl);\n }", "function Resource(url, params, actions, options$$1) {\n\t\n\t var self = this || {}, resource = {};\n\t\n\t actions = assign({},\n\t Resource.actions,\n\t actions\n\t );\n\t\n\t each(actions, function (action, name) {\n\t\n\t action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\t\n\t resource[name] = function () {\n\t return (self.$http || Http)(opts(action, arguments));\n\t };\n\t });\n\t\n\t return resource;\n\t}", "function Resource(url, params, actions, options$$1) {\n\t\n\t var self = this || {}, resource = {};\n\t\n\t actions = assign({},\n\t Resource.actions,\n\t actions\n\t );\n\t\n\t each(actions, function (action, name) {\n\t\n\t action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\t\n\t resource[name] = function () {\n\t return (self.$http || Http)(opts(action, arguments));\n\t };\n\t });\n\t\n\t return resource;\n\t}", "function api(aPathParam, aQueryParam) {\n return new Promise((resolve) => {\n // Use superagent\n // FIXME - where do we get the hostname from?\n const response = {\n todos: [\n {\n text: 'Use Redux',\n completed: false,\n },\n {\n text: 'Use Saga',\n completed: false,\n },\n ],\n };\n resolve(response);\n });\n}", "function produtoResource($resource) {\n\t\treturn $resource(\"/api/produtos/:id\"); //Retorna um objeto resource para ser utilizado na obtenção de dados do backend webservice\n\t}", "function SearchService($resource, CONFIG){\n\n return $resource(CONFIG.API_BSE_URL + 'resources/:id', {id:'@_id'},\n {\n update:{\n method: 'PUT'\n }\n })\n}", "function getHandler(method, getArgs, service) {\n return function (req, res, next) {\n res.setHeader('Allow', allowedMethods(service).join(','));\n\n // Check if the method exists on the service at all. Send 405 (Method not allowed) if not\n if (typeof service[method] !== 'function') {\n debug('Method \\'' + method + '\\' not allowed on \\'' + req.url + '\\'');\n res.status(statusCodes.methodNotAllowed);\n return next(new _feathersErrors2.default.MethodNotAllowed('Method `' + method + '` is not supported by this endpoint.'));\n }\n\n var params = _extends({}, req.params || {});\n delete params.__feathersId;\n\n // Grab the service parameters. Use req.feathers and set the query to req.query\n params = _extends({ query: req.query || {} }, params, req.feathers);\n\n // Run the getArgs callback, if available, for additional parameters\n var args = getArgs(req, res, next);\n\n // The service success callback which sets res.data or calls next() with the error\n var callback = function callback(error, data) {\n if (error) {\n debug('Error in REST handler: `' + (error.message || error) + '`');\n return next(error);\n }\n\n res.data = data;\n res.hook = hookObject(method, 'after', args.concat([params, callback]));\n\n if (!data) {\n debug('No content returned for \\'' + req.url + '\\'');\n res.status(statusCodes.noContent);\n } else if (method === 'create') {\n res.status(statusCodes.created);\n }\n\n return next();\n };\n\n debug('REST handler calling `' + method + '` from `' + req.url + '`');\n service[method].apply(service, args.concat([params, callback]));\n };\n}", "function getHandler (method, getArgs, service) {\n return function (req, res, next) {\n // Check if the method exists on the service at all. Send 405 (Method not allowed) if not\n if (typeof service[method] !== 'function') {\n debug('Method `' + method + '` not allowed on `' + req.url + '`');\n res.status(status.methodNotAllowed);\n return next(new errors.types.MethodNotAllowed('Method `' + method + '` is not supported by this endpoint.'));\n }\n\n // Run the getArgs callback, if available, for additional parameters\n var args = getArgs(req, res, next);\n // Grab the service parameters. Use req.feathers and set the query to req.query\n var params = _.extend({ query: req.query || {} }, _.omit(req.params || {}, 'id'), req.feathers);\n // The service success callback which sets res.data or calls next() with the error\n var callback = function (error, data) {\n if (error) {\n debug('Error in REST handler: `' + (error.message || error) + '`');\n return next(error);\n }\n\n res.data = data;\n\n if(!data) {\n debug('No content returned for `' + req.url + '`');\n res.status(status.noContent);\n } else if(method === 'create') {\n res.status(status.created);\n }\n\n return next();\n };\n\n debug('REST handler calling `' + method + '` from `' + req.url + '`');\n\n try {\n service[method].apply(service, args.concat([params, callback]));\n } catch (error) {\n error.code = 422;\n callback(error);\n }\n };\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n\n var self = this || {}, resource = {};\n\n actions = assign({},\n Resource.actions,\n actions\n );\n\n each(actions, function (action, name) {\n\n action = merge({url: url, params: assign({}, params)}, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options$$1) {\n var self = this || {},\n resource = {};\n actions = assign({}, Resource.actions, actions);\n each(actions, function (action, name) {\n action = merge({\n url: url,\n params: assign({}, params)\n }, options$$1, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n return resource;\n}", "function RadnikService($http) {\n var service = {};\n\n service.create = create;\n service.get = get;\n service.update = update;\n\n return service;\n \n function create(link, employee) {\n console.log(employee);\n return $http.post('api/users/' + link + '/create/', angular.toJson(employee));\n }\n\n function get(id) {\n return $http.get('api/users/employee/' + id + '/');\n }\n\n function update(id, data) {\n return $http.patch('api/users/employee/update/' + id + '/', angular.toJson(data));\n }\n\n \n}", "doRoute() {\n let routename = 'HTTP:' + this.request.method + ':' + this.url.pathname;\n this.run(routename, this.restnio.routes, \n Parser.parseFullHttpParams, this.request, this.url);\n }", "function resscService($http, $q, logger){\n\t\tvar baseUri = \"api/ressc/\";\n\t\t\n\t\tvar service = {\n\t\t\tgetLatest : getLatest,\n\t\t\tgetRessc : getRessc,\n\t\t\tgetListVersion : getListVersion,\n\t\t\tgetListDependantApimc : getListDependantApimc,\n\t\t\tgetSwagger : getSwagger,\n\t\t\tgetRequestPath: getRequestPath,\n\t\t\tsearch: search,\n\t\t\tsave: save\n\t\t};\n\t\t\n\t\treturn service;\n\t\t\n\t\t///////////////\n\t\t\n\t\tfunction getLatest(){\n\t\t\treturn $http.get(baseUri + \"latest\").then(successCallback, errorCallback);\n\t\t}\n\t\t\n\t\tfunction getRessc(resscId){\n\t\t\treturn $http.get(baseUri + resscId).then(successCallback, errorCallback);\n\t\t}\n\t\t\n\t\tfunction getListVersion(resscId){\n\t\t\treturn $http.get(baseUri + resscId + \"/versions\").then(successCallback, errorCallback);\n\t\t}\n\t\t\n\t\tfunction getListDependantApimc(resscId){\n\t\t\treturn $http.get(baseUri + resscId + \"/ressources\").then(successCallback, errorCallback);\n\t\t}\n\t\t\n\t\tfunction getSwagger(resscId){\n\t\t\treturn $http.get(baseUri + resscId + \"/swagger\").then(successCallback, errorCallback);\n\t\t}\n\t\t\n\t\tfunction getRequestPath(resscId){\n\t\t\treturn $http.get(baseUri + resscId + \"/paths\").then(successCallback, errorCallback);\n\t\t}\n\t\t\n\t\tfunction search(searchParams){\n\t\t\treturn $http.post(baseUri, searchParams).then(successCallback, errorCallback);\n\t\t}\n\t\t\n\t\tfunction save(resscPatch){\n\t\t\treturn $http.patch(baseUri + resscPatch.id, resscPatch).then(successCallback, errorCallback);\n\t\t}\n\t\t\n\n\t\t// Generic callback\n\t\tfunction successCallback(response){\n\t\t\treturn response.data;\n\t\t}\n\t\t\n\t\tfunction errorCallback(response){\n\t\t\tlogger.error(\"Erreur survenue lors de l'appel du service distant resscService\", angular.toJson(response), \"Erreur technique\");\n\t\t\treturn $q.reject(response);\n\t\t}\n\t}", "function restEventFun ($scope, $http) {\r\n\t$http.get('http://localhost:8080/spring-angularJS/springcontent.json').\r\n\tsuccess(function (data) {\r\n\t\t$scope.user = data;\r\n\t});\r\n}", "function ListServiceProxy(uriService) {\r\n this.uriService = uriService;\r\n}", "function APIClass() {\n\t// Config\n\tthis.api_url_base = \"http://\" + window.location.hostname + \":\";\n\tthis.default_config = new Config(PORT.ORCHESTRATOR, CONTENT_TYPE.NONE, METHOD.GET);\n\n\n\t/**\n\t * Open HTTP Request\n\t * @param api_config\n\t * @param uri\n\t * @returns {XMLHttpRequest}\n\t */\n\tthis.open_request = function(api_config, uri) {\n\t\tlet url = this.api_url_base + api_config.port + uri;\n\t\tconsole.log(\"[API] [\" + api_config.method + \"] \" + url);\n\n\t\tlet http = new XMLHttpRequest();\n\t\thttp.open(api_config.method, url, true);\n\t\tif(api_config.contentType !== CONTENT_TYPE.NONE) {\n\t\t\thttp.setRequestHeader(\"Content-Type\", api_config.contentType);\n\t\t}\n\t\thttp.setRequestHeader(\"Authorization\", \"Basic \" + window.localStorage.getItem(\"defpi_token\"));\n\t\treturn http;\n\t};\n\n\t/**\n\t * Send method for API request\n\t * @param {object}\t\t\t\tapi_config\n\t * @param {string} \t\turi\n\t * @param {object} \t\tdata\n\t * @param {function} \t\tcallback\n\t * @param {function(number)} error\n\t */\n\tthis.send = function(api_config, uri, data, callback, error) {\n\t\tif(api_config === null) api_config = this.default_config;\n\n\t\tlet http = this.open_request(api_config, uri);\n\t\thttp.onreadystatechange = function() {\n\t\t\tif(http.readyState === http.DONE ) {\n\t\t\t\tif (http.status >= 200 && http.status <= 207) {\n\t\t\t\t\tif (this.getResponseHeader(\"Content-Type\") === \"application/javascript\" || this.getResponseHeader(\"Content-Type\") === \"application/json\") {\n\t\t\t\t\t\tlet response = JSON.parse(http.response);\n\t\t\t\t\t\tcallback(response);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcallback(http.response);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(\"[Api] HTTP CODE: \" + http.status);\n\t\t\t\t\tif(error != null) { error(http.status); return; }\n\n\t\t\t\t\tconsole.log(\"Server down?\");\n\t\t\t\t\t//document.location = \"/\";\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\thttp.send(data);\n\t};\n\n}", "function setRestfulApi(options) {\n if(options.apis && options.apis.restful) {\n var apis = self.settings().apis;\n for( var api in apis ) {\n apis[api].url = options.apis.restful.url;\n }\n }\n }", "api () {\r\n const router = new Router()\r\n // READ\r\n router.get('/',\r\n (req, res) => {\r\n this\r\n .getAll(req.query)\r\n .then(this.ok(res))\r\n .then(null, this.fail(res))\r\n })\r\n router.get('/:key',\r\n (req, res) => {\r\n this\r\n .get(req.params.key, req.query)\r\n .then(this.ok(res))\r\n .then(null, this.fail(res))\r\n })\r\n // CREATE\r\n router.post('/',\r\n this.requiretmobileid,\r\n (req, res, next) => this.logUserAction(req, res, next, this.name, 'POST'),\r\n (req, res) => {\r\n this\r\n .post(req.body, req.query)\r\n .then(this.ok(res))\r\n .then(null, this.fail(res))\r\n })\r\n // UPDATE\r\n router.patch('/:key',\r\n this.requiretmobileid,\r\n (req, res, next) => this.logUserAction(req, res, next, this.name, 'PATCH'),\r\n (req, res) => {\r\n this\r\n .patch(req.params.key, req.body, req.query) // query?\r\n .then(this.ok(res))\r\n .then(null, this.fail(res))\r\n })\r\n // DELETE\r\n router.delete('/:key',\r\n this.requiretmobileid,\r\n (req, res, next) => this.logUserAction(req, res, next, this.name, 'DELETE'),\r\n (req, res) => {\r\n this\r\n .delete(req.params.key, req.query)\r\n .then(this.ok(res))\r\n .then(null, this.fail(res))\r\n })\r\n\r\n return router\r\n }", "function HttpServiceService(_http) {\n this._http = _http;\n console.log(\"Service is working\");\n }", "indexAction(req, res) {\n this.jsonResponse(res, 200, { 'message': 'Default API route!' });\n }", "fetch () {\n this._makeRequest('GET', resources);\n }", "function HTTPGet (id, controller) {\n console.log(\"Initializing HTTPGet module\");\n HTTPGet.super_.call(this, id, controller);\n}", "constructor(base='http://localhost:8000') {\n super();\n // Set the api base.\n this.base = base;\n this.doFetch = this.doFetch.bind(this);\n }", "function Controller () {\n /**\n * shared logic for handling Feature Service requests\n * most providers will use this mehtod to figure out what request is being made\n *\n * @param {Object} req\n * @param {Object} res\n * @param {Object} err\n * @param {Object} data\n * @param {Function} callback\n */\n function processFeatureServer (req, res, err, data, callback) {\n delete req.query.geometry\n\n if (err) return res.status(500).json(err)\n if (!data) return res.status(400).send('There a problem accessing this repo')\n if (callback) callback = sanitizeCallback(callback)\n // check for info requests and respond like ArcGIS Server would\n if (req._parsedUrl.pathname.substr(-4) === 'info') {\n var arcGisServerLikeResponse = {\n currentVersion: 10.21,\n fullVersion: '10.2.1',\n soapUrl: 'http://sampleserver6.arcgisonline.com/arcgis/services',\n secureSoapUrl: 'https://sampleserver6.arcgisonline.com/arcgis/services',\n authInfo: {\n isTokenBasedSecurity: true,\n tokenServicesUrl: 'https://sampleserver6.arcgisonline.com/arcgis/tokens/',\n shortLivedTokenValidity: 60\n }\n }\n\n return res.status(200).send(arcGisServerLikeResponse)\n }\n\n if (featureServices[req.params.layer]) {\n // requests for specific layers - pass data and the query string\n featureServices[req.params.layer](data, req.query || {}, function (err, d) {\n if (err) {\n res.status(400).send(err)\n return\n }\n // limit response to 1000\n if (d.feature && d.features.length > 1000) {\n d.features = d.features.splice(0, 1000)\n }\n if (callback) {\n res.send(callback + '(' + JSON.stringify(d) + ')')\n } else {\n res.json(d)\n }\n })\n } else {\n // have a layer\n if (req.params.layer && data[req.params.layer]) {\n // pull out the layer data\n data = data[req.params.layer]\n } else if (req.params.layer && !data[req.params.layer]) {\n res.status(404).send('Layer not found')\n }\n if (req.params.method && featureServices[req.params.method]) {\n // we have a method call like \"/layers\"\n featureServices[req.params.method](data, req.query || {}, function (err, d) {\n // limit response to 1000\n if (err) {\n res.status(400).send(err)\n return\n }\n if (d.features && d.features.length > 1000) {\n d.features = d.features.splice(0, 1000)\n }\n if (callback) {\n res.send(callback + '(' + JSON.stringify(d) + ')')\n } else {\n res.json(d)\n }\n })\n } else {\n // make a straight up feature service info request\n // we still pass the layer here to conform to info method, though its undefined\n featureServices.info(data, req.params.layer, req.query, function (err, d) {\n if (err) {\n if (callback) callback(err)\n else res.status(500).send(err)\n }\n if (callback) {\n res.send(callback + '(' + JSON.stringify(d) + ')')\n } else {\n res.json(d)\n }\n })\n }\n }\n }\n\n return {\n processFeatureServer: processFeatureServer\n }\n}", "function createService(schemaName) {\n var baseEndpoint = [API_BASE, schemaName].join('/');\n\n // Potential contraints for the ID\n function assertId(id) {\n var deferred = $q.defer();\n if (id) {\n deferred.resolve();\n } else {\n deferred.reject('Missing ID');\n }\n return deferred.promise;\n }\n\n /**\n * Get an object by id from the API.\n * @param id : The id of the object.\n * @returns : Promise with the object.\n **/\n function get(id) {\n return assertId(id).then(function () {\n return $http.get([baseEndpoint, id].join('/'));\n });\n }\n\n /**\n * Query an endpoint with a collection of parameters instead of an id.\n * @param data : Object with the parameters to put in the query string.\n * @returns : Promise with the result of the query.\n **/\n function query(data, method) {\n method = method || 'GET';\n var queryParams = {\n method: method,\n url: baseEndpoint\n };\n if (method === 'GET') {\n queryParams.params = data;\n }\n if (method === 'POST') {\n queryParams.data = data;\n }\n\n return $http(queryParams);\n }\n\n /**\n * Get a list of objects from the API.\n * @returns : Promise with a list of objects.\n **/\n function getAll() {\n return $http.get(baseEndpoint);\n }\n\n /**\n * Update an object through the API\n * @param id : The id of the object.\n * @param data : The data to update the object with\n * @returns : Promise with the result of the update.\n **/\n function update(id, data) {\n return assertId(id).then(function () {\n return $http.put([baseEndpoint, id].join('/'), data);\n });\n }\n\n /**\n * Create a new object through the API\n * @param data : The data to update the object with\n * @returns : Promise that returns the provided data, amended with the id\n * that the API assigned.\n **/\n function create(data) {\n return $http.post(baseEndpoint, data).then(function (response) {\n data.id = R.last(response.headers().location.split('/'));\n response.data = data;\n return response;\n });\n }\n\n /**\n * Wrapper that saves or updates an object, based on whether it already\n * has an id. Data without an id attribute are created as new objects, and\n * those with an id are updated.\n * This function expects the angular model representation, and will handle\n * the formatting of the request.\n * @param data : The angular model to persist.\n * @returns : Promise that returns the provided data (with the id added\n * if a create took place)\n **/\n function save(data) {\n if (data.id) {\n return update(data.id, data).then(function (result) {\n return data;\n });\n } else {\n return create(data).then(function (result) {\n data.id = result.id;\n return data;\n });\n }\n }\n\n if (!baseEndpoint || !schemaName) {\n throw 'Must specify base endpoint and schema name';\n }\n\n return {\n get: get,\n query: query,\n getAll: getAll,\n update: update,\n create: create,\n save: save\n };\n }", "function SPRest(_options, _baseUrl, _runtime) {\n if (_options === void 0) { _options = {}; }\n if (_baseUrl === void 0) { _baseUrl = \"\"; }\n if (_runtime === void 0) { _runtime = _pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"DefaultRuntime\"]; }\n this._options = _options;\n this._baseUrl = _baseUrl;\n this._runtime = _runtime;\n }", "function callbackGetGenericApi(req, res) {\n var apiConfig=\n (req.method==\"GET\")?getConfig\n :(req.method==\"POST\")?postConfig:[];\n /* check first if services is not loaded */\n if (apiConfig.length==0)\n return res.json({statusCode: 404, message: \"Missing API configuration\", Data: []});\n\n ///api/:type/:path?\n /* decouple request api */\n var request = {\n type:req.params.type,\n t_type:req.params.type+\".\"+req.method,\n header:req.headers||{},\n body:req.body,\n path:req.params.path||\"\",\n query:req.query||{}\n };\n\n requestApi(apiConfig,request,function(d) {\n return res.json(d);\n })\n }", "async function routes(fastify, options) {\n\tfastify.get('/', async (request, reply) => {\n\t\treturn { name: 'Hydrant API', version: process.env.npm_package_version, routes: 'api' }\n\t})\n\n\tfastify.get('/measurement', (request, reply) => {\n\t\tconst $top = request.query.top;\n\t\tif ($top)\n\t\t\tdb.all('SELECT * FROM Measurements LIMIT $top', { $top }, (err, rows) => {\n\t\t\t\treply.send(rows);\n\t\t\t});\n\t\telse\n\t\t\tdb.all('SELECT * FROM Measurements', (err, rows) => {\n\t\t\t\treply.send(rows);\n\t\t\t})\n\t});\n}", "function AlleleFearGetAPIResource($resource, JAVA_API_URL) {\n\t\treturn $resource(JAVA_API_URL + 'allelefear/:key', {}, {\n\t\t\t'': { method: 'JSONP' } \n\t\t});\n\t}", "function UsersService(http) {\n this.http = http;\n // private instance variable to hold base url\n this.usersUrl = app_settings_1.AppSettings.API_ENDPOINT + '/members';\n console.log('in user service');\n }", "getAllEmployees() {\n return this.$http({\n method: 'GET',\n url: `${this.REST_CONSTANTS.BASE_URL}:${this.REST_CONSTANTS.PORT}/employee`\n });\n }", "function rest(method, url, body, timeout) {\n var self = this;\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url, true);\n if(self.isJSON) {\n xhr.setRequestHeader(\"Content-type\", \"application/json\");\n xhr.setRequestHeader(\"Access-Control-Allow-Origin\", \"*\");\n }\n xhr.onreadystatechange = function() {\n if (xhr.readyState !== 4) return;\n if (xhr.status !== 200) {\n console.error(xhr);\n reject(new EqError(xhr.status, xhr.response));\n } else {\n resolve(xhr);\n }\n };\n if(self.timeout || timeout) {\n xhr.timeout = self.timeout || timeout;\n }\n try {\n if(body) {\n if(body.constructor === Object) {\n body = JSON.stringify(body);\n }\n xhr.send(body);\n } else {\n xhr.send();\n }\n } catch(e) {\n console.error(xhr);\n reject(new EqError(ERRORS.ERROR_SENDING_REQUEST, e.message));\n }\n });\n }", "init() {\n // Make sure we've got an exchange client for the request handling.\n this.router.use(this.initialiseExchangeClient.bind(this));\n this.router.get('/', this.query);\n this.router.post('/', this.create);\n this.router.get('/:id', this.get);\n this.router.delete('/:id', this.delete);\n }", "function iniciarAPI() {\n\treturn new Promise((resolve, reject) => {\n\n\t\t// Servidor Restify\n\t\tvar servidor = restify.createServer()\n\t\tservidor.use(cookieParser.parse)\n\t\tservidor.use(restify.plugins.bodyParser({\n\t\t\tmapParams: true\n\t\t}))\n\t\tservidor.listen(process.env.PORT || 3978, function () {\n\t\t\tresolve(servidor)\n\t\t})\n\n\t})\n}", "function Resource(url, params, actions, options) {\n\n var self = this || {},\n resource = {};\n\n actions = assign({}, Resource.actions, actions);\n\n each(actions, function (action, name) {\n\n action = merge({ url: url, params: assign({}, params) }, options, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function Resource(url, params, actions, options) {\n\n var self = this || {},\n resource = {};\n\n actions = assign({}, Resource.actions, actions);\n\n each(actions, function (action, name) {\n\n action = merge({ url: url, params: assign({}, params) }, options, action);\n\n resource[name] = function () {\n return (self.$http || Http)(opts(action, arguments));\n };\n });\n\n return resource;\n}", "function BookingService(http) {\r\n this.http = http;\r\n }", "constructor(service, routes) {\n this.service = service;\n this.routes = routes;\n }", "function getAllItemsREST(callback) {\n\tvar PATH = \"/items/_all_docs?include_docs=true\";\n\tvar options = {\n\t\thostname : CLOUDANT_REST_URL,\n\t\tport : '80',\n\t\tpath : PATH,\n\t\tmethod : 'GET',\n\t\theaders : {\n\t\t\t 'Authorization': 'Basic MmJlMjg0NTctY2JhNy00NDlhLWE4NzAtYjFjYWE0NWQ5MzUwLWJsdWVtaXg6MjRjNzI5NWFkOWM5OWQ5NmQ4Y2JmYmEzZGVlYzdmODU1ZGU2NTA0ODY2ZTcyYzc2YWZjMjQ0Y2FiZTJjNzk3Mg=='\n\t\t},\n\t\trejectUnauthorized : false,\n\t\tagent : false,\n\t};\n\tvar req = http.request(options, function(res) {\n\t\tvar resultString = '';\n\t\tres.on('data', function(chunk) {\n\t\t\tconsole.log('get response: ' + chunk);\n\t\t\tresultString += chunk;\n\t\t});\n\t\tres.on('error', function(c) {\n\t\t\tconsole.log('get error: ' + c);\n\t\t});\n\t\tres.on('end', function() {\n\t\t\tconsole.log('get status ' + res.statusCode);\n\t\t\tif (res.statusCode === 200) {\n\t\t\t\tcallback(JSON.parse(resultString));\n\t\t\t} else {\n\t\t\t\tcallback(); // error case\n\t\t\t}\n\t\t});\n\t});\n\treq.end();\n}", "function ProductService(http) {\n this.http = http;\n this.url = 'http://5cb89c151551570014da4181.mockapi.io/products';\n }", "function MainService() {\n this.httpUrl = 'http://34.93.84.140:3000';\n }", "function BaseServiceInstance(url) {\n this.appName = \"megazord\";\n this.urlBase = EnvironmentConfig.api;\n this.urlBackOfficeBase = EnvironmentConfig.api;\n\n this.httpRequest = function (type, url, params) {\n return $http[type](url, params).then(function (response) {\n return response.data;\n }, function (error) {\n throw error.data;\n });\n };\n\n this.serviceUrl = url;\n this.get = function (id) {\n return this.httpRequest(\"get\", this.urlBackOfficeBase + this.serviceUrl + id);\n };\n\n this.getAll = function (data) {\n return this.httpRequest(\"get\", this.urlBackOfficeBase + this.serviceUrl);\n };\n\n this.create = function (entity) {\n return this.httpRequest(\"post\", this.urlBackOfficeBase + this.serviceUrl, entity);\n };\n\n this.update = function (entity) {\n return this.httpRequest(\"put\", this.urlBackOfficeBase + this.serviceUrl + entity.id, entity);\n };\n\n this.delete = function (id) {\n return this.httpRequest(\"delete\", this.urlBackOfficeBase + this.serviceUrl + id);\n };\n\n return this;\n }", "invoke(verb = \"GET\", ...args) {\n // Setup initial conditions.\n verb = verb.toUpperCase();\n args = _.flatten(args);\n args = _.compact(args);\n\n return new Promise((resolve, reject) => {\n // Prepare the URL.\n let url = this.url(args);\n const urlParamsTotal = this.route.keys.length;\n if (urlParamsTotal > 0) {\n // The URL contained parameters that were taken from the args.\n // Remove them from the set of arguments passed in the payload.\n args = _.clone(args);\n args = args.splice(urlParamsTotal, args.length);\n }\n\n if ((verb === \"GET\" || verb === \"DELETE\") && args.length > 0) {\n let msg = `Cannot send arguments to the \"${ this.name }\", REST does not allow you to submit data to a ${ verb } method. Instead use the PUT or POST verbs.`;\n if (urlParamsTotal > 0) { msg += ` This method\"s URL does, however, take parameters (${ this.urlPattern }).`; }\n throw new Error(msg);\n }\n\n // Setup the payload to send.\n let payload = {\n verb: verb,\n method: this.name,\n args: args\n };\n\n // Send to the server.\n let httpMethod = this.http[verb.toLowerCase()];\n httpMethod(url, payload)\n .then((result) => { resolve(result.data); })\n .catch((err) => {\n err = parseError(err);\n reject(err);\n });\n });\n }", "function Server(host, datasource) {\n var server = express();\n\n /* All categories */\n server.get('/', function (req, res) {\n datasource.getCategories().then(createRepresenter(req, res, 200));\n });\n\n /* All items in a specific category */\n server.get(/^\\/([a-z]+)s$/, function (req, res) {\n var categoryName = req.params[0],\n category = datasource.getCategoryItems(categoryName);\n Q.when(category).then(createRepresenter(req, res, 200));\n });\n\n /* An item from a category */\n server.get(/^\\/([a-z]+)s\\/(\\d+)$/, function (req, res) {\n var categoryName = req.params[0], id = req.params[1],\n item = datasource.getCategoryItem(categoryName, id, true);\n Q.when(item).then(createRepresenter(req, res, 200));\n });\n\n /* Stylesheets */\n server.get(/^\\/stylesheets\\/\\w+$/, function (req, res) {\n res.sendfile(path.join(__dirname, '../assets' + req.url + '.css'));\n });\n\n /* Creates and sends an appropriate representation of the given resource */\n function createRepresenter(req, res, status) {\n return function (resource) {\n // Get the preferred content type and the associated representer\n var contentType = new Negotiator(req).preferredMediaType(Object.keys(representers)),\n representer = representers[contentType];\n // Allow access from any source\n res.setHeader('Access-Control-Allow-Origin', '*');\n\n // Try to represent the resource\n return Q.when(representer.represent(resource)).then(function (representation) {\n // Set the correct content type and send the representation\n res.setHeader('Content-Type', contentType);\n res.send(status, representation);\n })\n // If it fails, represent the error\n .then(null, function (error) {\n var errorResource = { kind: 'error', title: 'Not found', detail: error.message };\n return createRepresenter(req, res, 404)(errorResource);\n });\n };\n }\n\n return server;\n}", "llamarRutasAPI(){\n this.app.use('/', rutas);\n }", "function CallService(ssn,fs,er, callbackF){\r\n\t\t\t\t\r\n\t\t// Set REST Service location\r\n\t\t//var webServiceURL = 'http://d-36312.dor.local:9080/MobileRefund/rest/status';\r\n\t\tvar webServiceURL = 'http://revenue3.dor.local:10073/MobileRefund/rest/status';\t\t\t\r\n\r\n\t\t// Set input parameter variables\r\n\t\tvar data = {ssn:ssn,fs:fs,er:er};\t \r\n\t\t\r\n\t\t// AJAX call\r\n\t\t$.ajax({\r\n\t url: webServiceURL, \r\n\t type: \"GET\",\r\n\t dataType: \"jsonp\", \r\n\t timeout: 5000,\r\n\t data: data, \r\n\t crossDomain: true,\t \r\n\t jsonpCallback: callbackF,\r\n\t success: OnSuccess, \r\n\t error: OnError\r\n\t });\t\t\t\r\n\t\t\r\n\t\treturn false;\r\n\t}" ]
[ "0.72275144", "0.65103894", "0.63224214", "0.6258098", "0.6122539", "0.59976894", "0.5957328", "0.59443754", "0.59406364", "0.58652747", "0.58305925", "0.5823525", "0.5823525", "0.5814718", "0.58138204", "0.5802795", "0.57892436", "0.57746756", "0.5751222", "0.5745047", "0.5743701", "0.57189435", "0.56741416", "0.56741375", "0.56741375", "0.5672059", "0.5670205", "0.5651754", "0.56367445", "0.56143886", "0.5569751", "0.55513644", "0.5544253", "0.554077", "0.55362254", "0.55228865", "0.5519639", "0.55108684", "0.5493945", "0.54917884", "0.5478005", "0.54704", "0.5465089", "0.5443792", "0.5443792", "0.5422467", "0.54035133", "0.5393876", "0.5384742", "0.53672725", "0.5359541", "0.5359541", "0.5359541", "0.5359541", "0.5359541", "0.5359541", "0.5359541", "0.5359541", "0.5359541", "0.5359541", "0.5359541", "0.5359541", "0.5359541", "0.5358748", "0.5357399", "0.5327521", "0.5315375", "0.5309815", "0.53024584", "0.53021085", "0.5300721", "0.5296061", "0.5289899", "0.5286471", "0.5279817", "0.52555865", "0.52434796", "0.5236889", "0.523459", "0.5230071", "0.5208011", "0.5206731", "0.5192855", "0.5178561", "0.5175798", "0.5165641", "0.51638556", "0.51634806", "0.51498216", "0.51498216", "0.5136605", "0.5134516", "0.5132426", "0.5130848", "0.5122332", "0.5114519", "0.5112284", "0.5110127", "0.5100109", "0.5086455" ]
0.54862964
40
Retrieves an auth token so that the user can exceed the uauthenticated rate limit
function getAuthToken () { console.log('You have hit the rate limit for unauthenticated requests, please log in to raise your rate limit:\n'.red); program.prompt('GitHub Username: ', function (user) { console.log('\nAfter entering your password, hit return' + ' twice.\n'.green); var authProcess = spawn('curl', [ '-u', user, '-d', '{"scopes":["repo"],"note":"mdlint"}', '-s', 'https://api.github.com/authorizations' ], { stdio: [process.stdin, 'pipe', process.stderr] }); authProcess.stdout.setEncoding('utf8'); authProcess.stdout.on('data', function (data) { var response = JSON.parse(data); if (response.message) { console.log(response.message.red + '\n'); process.exit(); } else { fs.writeFileSync(tokenFile, response.token); console.log('Authenticated :). Now try your lint again. \n'.green); process.exit(); } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getRequestToken() {\n return apiClient.get(\n '/authentication/token/new?api_key=6c1e80dae659cb7d1abdf16afd8bb0e3'\n )\n }", "async getUserAuthenticationToken() {\n\n\t\tif (this.userAuthToken !== null) {\n\t\t\t// userAuthToken is still valid no need\n\t\t\t// to recalculate it so call the callback immediately\n\t\t\tLogger.v('ApiAuthentication getUserAuthenticationToken: found valid token');\n\t\t\treturn Promise.resolve(this.userAuthToken);\n\t\t}\n\n\t\t// No local timestamp, Request server timestamp\n\t\tthis.userAuthToken = this._createToken(this.userId, this.apiKey, await ApiClient.time());\n\t\treturn this.userAuthToken;\n\t}", "function _authToken() {\r\n var auth_token = _getTokenFromSession();\r\n if (auth_token.token === undefined || auth_token.expTime < Date.now()) {\r\n var url = apiEndPointUrl + '/authenticate?portfolio=001&db=1';\r\n var username = 'API_TOKEN';\r\n var password = 'XJX982HXF392JDXJD98XJS8XD83GXH92XHF8X';\r\n var encodedRes = btoa(username + ':' + password);\r\n $ionicLoading.show();\r\n $http.defaults.headers.common.Authorization = 'Basic ' + encodedRes;\r\n return $http.get(url)\r\n .then(function (response) {\r\n $ionicLoading.hide();\r\n return handlingErrors.errorFromServer(response);\r\n })\r\n .catch(function response(response) {\r\n if ((response.data.StatusCode == 100)) {\r\n var token = response.data.Token;\r\n var expTime = Date.now() + 45 * 60000;\r\n var opt = {\r\n 'token': token,\r\n 'expTime': expTime\r\n }\r\n $sessionStorage.setObject('auth_token', opt);\r\n if (auth_token.expTime < Date.now()) {\r\n return _loginUserAgain().then(function (response) {\r\n if (response.error == false) {\r\n return token;\r\n } else {\r\n return response;\r\n }\r\n\r\n });\r\n } else {\r\n $ionicLoading.hide();\r\n return token;\r\n }\r\n\r\n } else {\r\n $ionicLoading.hide();\r\n return handlingErrors.errorFromServer(response);\r\n }\r\n\r\n });\r\n } else {\r\n return $timeout(function () {\r\n return auth_token.token\r\n }, 500);\r\n }\r\n }", "getAccessToken() {}", "getToken() {\n const params = {\n grant_type: GRANT_TYPE,\n appid: this.appId,\n secret: this.appSecret\n };\n\n return ajaxGet(TOKEN_AUTH_URL, { params })\n .then((data) => {\n if (data && data.errcode) {\n return Promise.reject(data);\n }\n\n return Promise.resolve(data);\n });\n }", "getUser() {\n const token = localStorage.getItem('Authorization');\n let user = null;\n\n // If a token exists then decode it\n if (token) {\n const base64Url = token.split('.')[1];\n const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');\n const secondsSinceEpoch = new Date() / 1000;\n const parsedToken = JSON.parse(window.atob(base64));\n\n // If current date is after expiration date then destroy it\n if (secondsSinceEpoch > parsedToken.exp) {\n this.destroyToken();\n } else {\n user = parsedToken;\n }\n }\n\n return user;\n }", "function getToken() {\n return sessionStorage.getItem('auth');\n }", "function getToken() {\n\treturn wAccessToken;\n}", "function requestToken() {\n return !tokenExpired()\n ? Promise.resolve(_token)\n : request(METHOD_GET, '/auth/token', null, { 'X-CSRF-TOKEN': _csrf })\n .then(function (xhr) {\n var json = JSON.parse(xhr.response);\n _token = json.data;\n\n return _token;\n });\n }", "getToken() {\n return fetch(STT_AUTHURL).then(function(response) {\n return response.text();\n });\n }", "function fetch_user_token()\n{\n if(document.cookie.indexOf(\"_bn_ut\")>=0)\n return getCookie(\"_bn_ut\");\n else\n {\n var err = {\"responseText\":'INVALID_TOKEN',\"status\":403};\n error_response(err);\n }\n}", "getToken() {\n\t\treturn this._post(\"/api/user/token\");\n\t}", "function getLocalToken() {\n return 'Bearer ' + localStorage[\"authToken\"];\n}", "auth(token) {\n if (this.authToken === token) {\n return this.authToken;\n }\n return undefined;\n }", "async requestToken() {\n\t\tlet iat = Math.floor(Date.now() / 1e3);\n\n\t\tlet payload = Object.assign({\n\t\t\tiss: this.iss,\n\t\t\tscope: this.scope,\n\t\t\taud: GOOGLE_TOKEN_URL,\n\t\t\texp: iat + 3600,\n\t\t\tsub: this.sub,\n\t\t\tiat,\n\t\t}, this.additionalClaims);\n\n\t\tlet assertion = sign({ header:{ alg }, payload, secret:this.key });\n\t\tlet body = stringify({ grant_type, assertion });\n\n\t\treturn send('POST', GOOGLE_TOKEN_URL, { headers, body }).then(r => {\n\t\t\tthis.token = r.data.access_token;\n\t\t\tthis.expiresAt = (r.data.expires_in == null) ? null : (iat + r.data.expires_in) * 1e3;\n\t\t\treturn this.token;\n\t\t}).catch(err => {\n\t\t\tthis.token = this.expiresAt = null;\n\t\t\tlet body = err.data || {};\n\t\t\tif (body.error) {\n\t\t\t\tlet msg = String(body.error);\n\t\t\t\tif (body.error_description) msg += `: ${body.error_description}`;\n\t\t\t\terr.message = msg;\n\t\t\t}\n\t\t\tthrow err;\n\t\t});\n\t}", "getRefreshToken() {}", "async obtainToken(req, res, next) {\n const request = new Request(req);\n const response = new Response(res);\n\n try {\n const token = await oAuth2.token(request, response);\n debug('obtainToken: token %s obtained successfully', token);\n res.json(token);\n } catch (err) {\n next(err);\n }\n }", "function getJWT() {\r\n return fetch(auth0Url, {\r\n method: \"POST\",\r\n headers: {\r\n 'content-type': 'application/json',\r\n },\r\n body: JSON.stringify(authPayload)\r\n })\r\n .then(result => result.json())\r\n .then(body => {\r\n console.dir(body);\r\n return body.access_token\r\n });\r\n}", "function fetchAuthToken() { \r\n _authToken();\r\n }", "function getUserToken () {\n return getCurrentUser().then((currentUser) => {\n return currentUser.getIdToken(true);\n }).then((token) => {\n return getSignedInUser().then((user) => {\n return {\n user: user,\n token: token\n };\n });\n });\n }", "function makeAuthToken() {\n var token = 'Auth'+ new Date().getTime();\n\n return token;\n }", "async function getToken() {\r\n let request = {\r\n method: 'GET',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Authorization': 'Basic ' + base64.encode(username + ':' + password)\r\n },\r\n redirect: 'follow'\r\n }\r\n\r\n const serverReturn = await fetch(ENDPOINT_URL + '/login', request)\r\n\r\n\r\n const serverResponse = await serverReturn.json()\r\n token = serverResponse.token\r\n\r\n return token;\r\n}", "async getToken() {\n if (this.token && (this.token.expiresAt === null || this.token.expiresAt > Date.now())) {\n // The current token is still valid\n return this.token;\n }\n return this.refreshToken();\n }", "function getBearerToken(callback){\n var url = template.parse(JWT_GRANT_API).expand({});\n \n var _body = {\n \"assertion\": jwtToken, \n \"botInfo\": {\n \"chatBot\": botName,\n \"taskBotId\": streamId\n },\n \"token\": {}\n };\n \n var options = {\n method: 'POST',\n uri: url,\n headers: {\n 'Content-Type': \"application/json\"\n },\n\n body: JSON.stringify(_body)\n };\n return request(options).then(function(res) {\n\tvar resp = JSON.parse(res);\n var _token = JSON.parse(res);\n accessToken = _token.authorization.accessToken;\n console.log(\"access token\"+accessToken);\n resp.callback = callback;\n\t//init();\n return Promise.resolve(resp);\n }).catch(function(err) {\n return Promise.reject(err);\n })\n\n }", "function getToken() {\n\n var tokenURL = portal + '/sharing/rest/generateToken?';\n\n var parameters = {username: username,\n password: password,\n client: 'referer',\n referer: portal,\n expiration: 60,\n f: 'json',};\n //Pass parameters via form attribute\n var requestPars = {method: 'post', url: tokenURL, form: parameters };\n\n return hr.callAGOL(requestPars,'token');\n}", "function authorize() {\n console.log(\"[Re]authorizing user.\");\n app.getToken().then(\n function(token) {\n //Our new access token for API calls\n access_token = token.access_token;\n //console.log(\"Your access token is \" + access_token);\n\n //Check against this- if time > expire_time, renew before calling.\n expire_time = (new Date).getTime() + token.expires_in;\n\n //Refresh our access token.\n app.setToken(access_token);\n }, function(error) {\n console.log(\"Failed to authenticate.\");\n console.log(error);\n }\n );\n}", "function getOAuthToken() {\n return ScriptApp.getOAuthToken();\n}", "async getAccessToken() {\n const token = await localforage.getItem('access_token')\n\n // if the token is null here we are logged out.\n if (token === null) return\n\n const then = new Date(token.date)\n const now = new Date()\n const eol = then.getTime() + (token.expires_in - 300) * 1000\n const ttl = eol - now.getTime()\n if (ttl > 0) {\n console.log(`Access token valid for ${Math.round(ttl / 1000)} seconds.`)\n return token.access_token\n }\n\n console.log('Access token stale.')\n\n const credentials = await localforage.getItem('credentials')\n const res = await fetch(urls.token, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n grant_type: 'client_credentials',\n client_id: credentials.userId,\n client_secret: credentials.secret,\n }),\n })\n\n if (res.status === 400) {\n throw new Error(`Invalid credentials ${res.status} ${res.statusText}`)\n }\n\n if (!res.ok) {\n throw new Error(`Invalid response: ${res.status} ${res.statusText}`)\n }\n\n const json = await res.json()\n // lets be a bit paranoid\n if (\n !json.hasOwnProperty('access_token') ||\n !json.hasOwnProperty('expires_in')\n ) {\n console.warn(json)\n throw new Error('Something is not right with the access_token Response.')\n }\n\n json.date = new Date()\n localforage.setItem('access_token', json)\n\n return json.access_token\n }", "static getUserToken(){\n let token = JSON.parse(localStorage.getItem('USER')).token;\n return token;\n }", "static getUserToken(){\n let token = JSON.parse(localStorage.getItem('USER')).token;\n return token;\n }", "function get_token (open_id) {\n if (open_id) {\n \n Auth.set_open_id(open_id);\n Auth.set_oauth_page(oauth_page_uri);\n\n var auth = new restUser.auth({\n open_id: open_id\n })\n \n auth.$get()\n .then(function (data) {\n if (data.state) {\n var pair;\n if (oauth_page_uri.indexOf('?') < 0){\n pair = '?';\n } else {\n pair = '&';\n }\n $window.location = oauth_page_uri + pair +\n 'open_id=' + open_id +\n '&state=' + data.state +\n '&ext_key=' + data.ext_key +\n '&response_type=' + data.response_type +\n '&redirect_uri=' + encodeURIComponent(data.redirect_uri);\n }\n })\n\t\t\t\t.catch(function (data) {\n\t\t\t\t\tconsole.error(data)\n $location.path(Config.route.error)\n\t\t\t\t})\n }\n }", "function guestTokenRequest () {\n\treturn sendApiReq(\n\t\t'\\g' + CONFIG_WEBSITE_ENDPOINT + 'backend/web/app_dev.php/oauth/v2/token?client_id=3_p08hEG4THmS3TPlOpS9cYqsh9Aj3vxGUYN8XtmxWLjVtfzoqHg&client_secret=7LYlYxmWBhyjosH3RvRybyCyogmOODppWo6YTLOgBljujlmHSB&grant_type=client_credentials',\n\t\t'GET', null, false, 0\n\t).then(\n\t\tfunction (res) {\n\t\t\tsetCookie('gToken', res.access_token, true)\n\t\t\treturn res\n\t\t},\n\t\tfunction (err) {\n\t\t\tconsole.log('error trying to get new gToken')\n\t\t\treturn err\n\t\t}\n\t)\n}", "function getAccessToken() {\n firebase.auth().currentUser.getIdToken(true).then(idToken => {\n // POST https://thoominspotify.com/api/user/accessToken\n // {\n // \"thoominToken\" : idToken\n // }\n //\n\n console.log(\"TOKEN \" + idToken);\n return idToken;\n })\n .catch(error => {\n console.log(error);\n })\n}", "function getBearer() {\n return 'Bearer ' + token;\n}", "async restApiToken () {\n return indy.restApiToken(this)\n }", "function getUserToken(){\n\t\treturn $cookies.get('user.token');\n\t}", "getToken() {\n\t\treturn this.qdacityTokenAuthenticationProvider.getToken();\n\t}", "async function bearerToken(auth) {\n const requestConfig = {\n url: bearerTokenURL,\n auth: {\n user: consumer_key,\n pass: consumer_secret,\n },\n form: {\n grant_type: 'client_credentials',\n },\n };\n const response = await post(requestConfig);\n return JSON.parse(response.body).access_token;\n}", "function getToken() {\n return token;\n }", "autoAuthUser() {\n const authInformation = this.getAuthData();\n if (!authInformation) {\n return;\n }\n const now = new Date();\n const expiresIn = authInformation.expirationDate.getTime() - now.getTime();\n if (expiresIn > 0) {\n this.token = authInformation.token;\n this.isAuth = true;\n this.setAuthTimer(expiresIn / 1000);\n this.authStatusListener.next(true);\n if (authInformation.admin) {\n this.isAdmin = true;\n this.adminStatusListener.next(true);\n }\n }\n }", "function auth() {\n \n var token = getParameterByName('token');\n var auth = getParameterByName('auth');\n if (auth == 'rest') {\n return authWithRest(token);\n } else {\n return authWithSDK(token);\n }\n}", "function getNewToken(oAuth2Client , res) {\n // an authentication url is generated which is basically an api call to gmail for user authentication\n const authUrl = oAuth2Client.generateAuthUrl({\n access_type: 'offline',\n scope: SCOPES,\n });\n // after the url is generated , redirect it in the browser ...\n res.redirect(authUrl)\n \n}", "function pollForTokenOrGiveUp(authUrl, cumulative, callback) {\n boxApi.dbg(\"Polling for auth token attempt \" + cumulative);\n\n if (cumulative > auth.attempts) {\n boxApi.alert(\"Giving up on auth token after \" + cumulative + \" attempts\");\n return;\n }\n\n $.get(authUrl, function(data, textStatus, jqXHR) {\n var json = goessner.parseXmlStringToJsonObj(jqXHR.responseText);\n\n if (!json) {\n boxApi.alert(\"Couldn't parse xml \" + jqXHR.responseText);\n return;\n }\n\n // Still waiting for window to close?\n if (json.response.status == \"not_logged_in\") {\n setTimeout(function() {\n pollForTokenOrGiveUp(authUrl, cumulative + 1, callback);\n }, 1000);\n\n return;\n }\n\n if (json.response.status != \"get_auth_token_ok\") {\n // The curious user can look at the browser's xhr tab for more info\n boxApi.alert(\"Couldn't load auth token. Did you enter the correct creds?\");\n return;\n }\n\n // Keep a private copy\n auth.token = json.response.auth_token;\n // Set the public version\n boxApi.authToken = auth.token;\n\n boxApi.loadingMode(false);\n callback();\n });\n }", "function getToken() {\n var data = {\n grant_type: 'client_credentials',\n client_id: API_USER_ID,\n client_secret: API_SECRET\n }\n console.log(`sendpulse.js: Getting token for client_id: ${API_USER_ID}, client_secret: ${API_SECRET}`);\n sendRequest('oauth/access_token', 'POST', data, false, saveToken);\n function saveToken(data) {\n if (data.access_token) {\n TOKEN = data.access_token;\n console.log(`sendpulse.js: Token received: ${TOKEN}`);\n var hashName = md5(API_USER_ID + '::' + API_SECRET);\n fs.writeFileSync(path.join(TOKEN_STORAGE, hashName), TOKEN);\n } else {\n console.log(`sendpulse.js: No token received: ${JSON.stringify(data)}`)\n }\n }\n}", "function getToken() {\n var form = {\n grant_type: 'client_credentials',\n client_id: sms_access_key,\n client_secret: sms_secret_key\n };\n\n var formData = querystring.stringify(form);\n var contentLength = formData.length;\n\n return rp({\n headers: {\n 'Content-Length': contentLength,\n 'Content-Type': 'application/x-www-form-urlencoded'\n },\n uri: smsdomain + '/v2/oauth/token',\n body: formData,\n method: 'POST'\n })\n .then(function(response) {\n var json = JSON.parse(response);\n return json.access_token;\n })\n .catch(function(err){\n throw err;\n })\n}", "function getToken() {\n $.post(appServerUrl + \"/user\", null, (data, status) => {\n console.log(\"got response from /user\", data, status);\n token = data.token;\n initializeSession();\n });\n}", "tokenAuth(user_id, auth_token) {\n const query = r.table('users').filter({auth_token: auth_token})\n return this._run(query).then(success => {\n return success ? true : Promise.reject('Authentication failure');\n });\n }", "function getToken(done) {\r\n console.log(\"getting new token\");\r\n $.get(\"/auth/token/new\", function(data) {\r\n if (data.error) {\r\n if (data.error.reason == \"refresh_token_expired\") {\r\n console.log(\"App has become unauthorised.\");\r\n handle_error(\"refresh_token_expired\");\r\n } else {\r\n console.log(\"Unknown Error.\");\r\n }\r\n } else {\r\n console.log(\"token success\");\r\n done(data.access_token);\r\n }\r\n });\r\n }", "async function getOauthToken() {\n if (Date.now() < config[\"twitch-access-token-expires-At\"] && config[\"twitch-access-token\"].length > 0) {\n return config[\"twitch-access-token\"];\n }\n const res = await rp.post(\"https://id.twitch.tv/oauth2/token\", {\n body: {\n \"client_id\": config[\"twitch-client-id\"],\n \"client_secret\": config[\"twitch-client-secret\"],\n \"grant_type\": \"refresh_token\",\n \"refresh_token\": config[\"twitch-refresh-token\"],\n },\n json: true,\n });\n if (!res[\"access_token\"]) {\n throw new Error(\"API did not provide an OAuth token!\");\n }\n updateConfig(\"twitch-access-token\", res[\"access_token\"]);\n updateConfig(\"twitch-access-token-expires-At\", Date.now() + 3500 * 1000);\n\n return res[\"access_token\"];\n}", "function getAuthenticationToken() {\n var time = Math.floor(Date.now() / 1000);\n var outgoing = encryptAppData(\n { 'app': name,\n 'time': time,\n 'salt': getSalt(128) }\n );\n\n return {\n 'signature': outgoing.data,\n 'iv': outgoing.iv\n };\n }", "async getToken() {\n\t\tif (!this.isExpired()) {\n\t\t\treturn Promise.resolve(this.token);\n\t\t}\n\n\t\tif (!this.key) {\n\t\t\tthrow new Error('No key set.');\n\t\t}\n\n\t\treturn this.requestToken();\n\t}", "getCachedToken() {\n if (this.cachedToken &&\n Date.now() + this.tokenRefreshBufferMs >= this.cachedToken.expiresOnTimestamp) {\n this.cachedToken = undefined;\n }\n return this.cachedToken;\n }", "getCachedToken() {\n if (this.cachedToken &&\n Date.now() + this.tokenRefreshBufferMs >= this.cachedToken.expiresOnTimestamp) {\n this.cachedToken = undefined;\n }\n return this.cachedToken;\n }", "function token(req, res, next) {\n return __awaiter(this, void 0, void 0, function* () {\n return req.app.oauth.authenticate()(req, res, () => __awaiter(this, void 0, void 0, function* () {\n if (res.locals.oauth && res.locals.oauth.token) {\n // Go on with the request as soon as the user is available\n const user = res.locals.oauth.token.user;\n req.user = yield models_1.User.findOne(user.id || user._id);\n next();\n // Asynchronously check for user agent information in token\n if (!res.locals.oauth.token.userAgent || !res.locals.oauth.token.userAgent.ip) {\n try {\n // Update user agent in the database\n const ua = yield models_1.OAuthAccessToken.updateUserAgent(res.locals.oauth.token.accessToken, req.clientIp, req.useragent);\n }\n catch (error) {\n req.logger.error(error);\n }\n }\n }\n else {\n return res.error(new ts_framework_1.HttpError(\"Credentials missing or invalid\", ts_framework_1.HttpCode.Client.UNAUTHORIZED, { code: \"UNAUTHORIZED\" }));\n }\n }));\n });\n}", "async ensureTokenIsValid() {\n if (ChromeStatusClient.isTokenExpired(this.tokenExpiresSec)) {\n const refreshResponse = await this.doFetch(\n '/currentuser/token', 'POST', null);\n this.token = refreshResponse.token;\n this.tokenExpiresSec = refreshResponse.tokenExpiresSec;\n }\n }", "function getUsrToken() {\n //if (!isUsrTokenValid()) {\n // return \"\";\n //}else\n return localStorage.getItem(\"usrToken\");\n}", "function getAuthToken() {\n chrome.identity.getAuthToken({\n 'interactive': true\n }, function (token) {\n oauthToken = token;\n createPicker();\n });\n }", "static getAuthToken(authSecret, expiresIn = 2 * 60)\n {\n if (authSecret)\n {\n if (!expiresIn)\n {\n return jwt.sign({}, authSecret, {});\n }\n return jwt.sign({}, authSecret, { expiresIn: expiresIn });\n }\n return '';\n }", "function auth() {\n\n var deferred = $q.defer();\n {\n that.getUser().then(\n function (userData) {\n that.authApplication(userData).success(function (data) {\n that.authCombined(data.token).then(function (data) {\n iodSessionToken.setSessionToken(data.token);\n that.removeTokenFromUrl();\n that.ssoTokenDeffered.resolve();\n that.getUserToken();\n deferred.resolve();\n }, function (e) {\n that.ssoTokenDeffered.reject('Failed to retrieve the combined token ');\n deferred.reject(e);\n });\n }).error(function (e) {\n that.ssoTokenDeffered.reject('Failed to retrieve the unbound token ');\n deferred.reject(e);\n })\n },\n function (e) {\n $log.debug('Failed to get users');\n deferred.reject(e);\n }\n )\n\n }\n return deferred.promise;\n }", "static getToken() {\n return localStorage.getItem('token');\n }", "static getToken() {\n return localStorage.getItem('token');\n }", "async function adminUserToken () {\n\n const token = await post({ \n Authorization: 'Basic ' + Buffer(db.client.admin.id + ':' + db.client.admin.password).toString('base64')\n }, '/oauth2/token', {\n grant_type: 'password',\n password: db.user.admin.password,\n username: db.user.admin.email\n })\n\n return { Authorization: 'Bearer ' + token.body.access_token }\n}", "function getLongerToken () {\n\t\t\t$.get(\"https://graph.facebook.com/v2.8/oauth/access_token?grant_type=fb_exchange_token&client_id=\"+app_id+\"&client_secret=\"+app_secret+\"&fb_exchange_token=\"+short_token+\"/\",\n\t\t\t\tfunction(data) {\n\t\t\t\t\tconsole.log(data);\n\t\t\t});\n\t\t}", "getToken() {\n\t\tif (this.jwtToken == undefined || this.jwtToken == null) {\n\t\t\tthis.loadTokenFromStorage();\n\t\t}\n\t\tthis.refreshTokenIfNeccessary();\n\t\treturn !this.isTokenExpired(this.jwtToken) ? this.jwtToken : null;\n\t}", "async function getToken () {\r\n if (token) { return token }\r\n try {\r\n await messaging.requestPermission()\r\n token = await messaging.getToken()\r\n return token\r\n } catch (e) {\r\n // We assume this as failed messaging auth\r\n }\r\n}", "function getToken(callback) {\n\tconsole.log('Getting token');\n\treadFile(\n\t\t(data) => {\n\t\t\tif (data.expires_at > Date.now() + 180000) {\n\t\t\t\t//Arbitrary 3min to prevent token timing out during request\n\t\t\t\tconsole.log('Saved token is valid');\n\t\t\t\tcallback(data.access_token);\n\t\t\t} else {\n\t\t\t\tconsole.log('Saved token is invalid');\n\t\t\t\trefreshToken(callback);\n\t\t\t}\n\t\t},\n\t\ttrue,\n\t\t'credentials.json'\n\t);\n}", "async getToken() {\n const token = await this.cookies.get('token') || '';\n return token ? `Bearer ${token}` : '';\n }", "function requestToken(next) {\n oauth.getOAuthRequestToken(function(error, oauthToken, oauthTokenSecret, results) {\n if (error) {\n next(error);\n } else {\n next(null, {requestToken:oauthToken, \n requestTokenSecret:oauthTokenSecret, \n redirectUrl:config.authorizeUrl + \"?oauth_token=\" + oauthToken});\n }\n });\n}", "getAuthHeader() {\n return {\n 'Authorization': 'Bearer ' + localStorage.getItem('id_token')\n }\n }", "getToken() {\n let token = null;\n let userEmail = null;\n if (localStorage.getItem('id_token')) {\n token = localStorage.getItem('id_token');\n userEmail = jwt_decode(token).email;\n }\n return { authEmail: userEmail, auth: token };\n }", "function fetchUserByToken(token) {\n return fetch({\n method: 'POST',\n url: 'http://localhost:3000/get-current-user',\n headers: new Headers({\n authorization: token,\n }),\n })\n .then(res => res.json())\n .catch(err => err);\n}", "function currentUserFromToken(req) {\n return decodedToken(req.headers.authorization.split('Bearer ')[1]);\n}", "async get_token() {\n\n var username = await AsyncStorage.getItem(\"username\");\n if (username != null && username != this.guestuserkey()) {\n var bytes_username = utf8.encode(username);\n var encoded_username = binaryToBase64(bytes_username);\n\n //update when upgrading authentication flow\n var securityversion = \"1\";\n\n var tokenobj = {};\n tokenobj[\"token\"] = encoded_username;\n tokenobj[\"securityversion\"] = securityversion;\n\n var token = JSON.stringify(tokenobj);\n var bytes = utf8.encode(token);\n var encoded = binaryToBase64(bytes);\n return encoded;\n }\n else {\n var token = \"4B0053744852ED7C2705E668C43982928978B74BBB7F21A0F9B4E43914E49A6F\";\n var bytes = utf8.encode(token);\n var encoded = binaryToBase64(bytes);\n return encoded;\n }\n\n }", "getAuthHeader() {\n return {\n 'Authorization': 'Bearer ' + localStorage.getItem('access_token')\n }\n }", "function getauth(req,res,next){\n const authToken = req.headers[\"authtoken\"];\n jwt.verify(authToken,SECRET_KEY,(err,user)=>{\n if(err){\n res.status(400).send(\"Un Authrised.\")\n }\n else{\n req.userid = user.id;\n next();\n }\n })\n}", "onAuthenticated(token, refresh = true) {\n\n //Set token model\n this.token = token;\n\n //Refresh user/club data if needed\n if (refresh) {\n $store.club.get(true);\n $store.user.get(true).then(user => $analytics.set.userId(user.id));\n }\n\n //Otherwise just return the token\n return this.token;\n }", "static getAuthHeader() {\n let token = AuthService.getAuthToken();\n if (token) {\n return {\n 'Authorization': 'Bearer ' + AuthService.getAuthToken()\n };\n } else {\n return {};\n }\n }", "function getToken( dispatch, getState ){\r\n return new Promise( (resolve, reject) => {\r\n\r\n // token is okay for now, so just resolve with the current token\r\n if( getState().spotify.token_expiry && new Date().getTime() < getState().spotify.token_expiry ){\r\n resolve(getState().spotify.access_token)\r\n return\r\n }\r\n\r\n // token is expiring/expired, so go get a new one and resolve that\r\n refreshToken( dispatch, getState )\r\n .then(\r\n response => resolve(response.access_token),\r\n error => {\r\n dispatch({ type: 'SPOTIFY_DISCONNECTED' })\r\n reject(error)\r\n }\r\n );\r\n });\r\n}", "async getAccessToken () {\n return this.connection.auth.access_token\n }", "getAuthHeader(token) {\n return {\n Authorization: `Bearer ${token}`,\n };\n }", "function getOAuthToken() {\n var properties = PropertiesService.getScriptProperties();\n\n var token = ScriptApp.getOAuthToken();\n var mode = properties.getProperty(\"picker_mode\");\n DriveApp.getRootFolder();\n var payLoad = {\n token: token,\n mode: mode\n };\n return payLoad;\n}", "function getApiToken() {\n\n if (!apiToken) {\n console.log(\"Fetching Youtube API token...\");\n $http.get('/api/googlekey/', {})\n .success(function(data) {\n if (data.length === 0) {\n $log.error(\"No key was found.\");\n apiToken = null;\n return;\n }\n apiToken = null;\n apiToken = data.googleApiKey;\n })\n .error(function(error) {\n $log.error('Error retrieving google api key: ' + JSON.stringify(error));\n });\n } else {\n return apiToken;\n }\n\n }", "function retrieveToken(req, res) {\n Token.findOne(\n {\n _id: req.params.id,\n user: res.locals.user\n },\n '-salt -value'\n )\n .lean()\n .then(function(token) {\n if (token === null) {\n res.status(404).json({\n error: {\n code: 404,\n message: `No such token: ${req.params.id}`\n }\n });\n } else {\n res.status(200).json(utils.formatTokenResponse(token));\n }\n })\n .catch(function(err) {\n console.log(err);\n\n res.status(500).json({\n error: {\n code: 500,\n message: 'Internal server error'\n }\n });\n });\n}", "async handleAuth() {\n if (!this.API)\n return;\n // handle authorize and try to get the access_token\n const accessToken = await this.API.handleAuth();\n if (accessToken) {\n // new access_token\n this.setAccessToken(accessToken);\n this.user = await this.API.getUser({ accessToken });\n }\n else if (this.getAccessToken()) {\n // have access_token in localstorage\n this.user = await this.API.getUser({ accessToken: this.accessToken });\n }\n else {\n // no access_token\n this.setAccessToken(null);\n this.user = null;\n }\n }", "async function getValidAccessToken() {\n if (!app.currentUser) {\n // If no user is logged in, log in an anonymous user\n await app.logIn(Realm.Credentials.anonymous());\n } else {\n // The logged in user's access token might be stale,\n // Refreshing custom data also refreshes the access token\n await app.currentUser.refreshCustomData();\n }\n // Get a valid access token for the current user\n return app.currentUser.accessToken;\n }", "getAuthHeader () {\n return {\n 'Authorization': 'Bearer ' + window.localStorage.getItem('id_token')\n }\n }", "function getAuthCodeFromUser() {\n return __awaiter(this, void 0, void 0, function* () {\n const url = getOauth2Client().generateAuthUrl({\n access_type: 'offline',\n scope: ['https://www.googleapis.com/auth/drive'],\n });\n yield vscode.window.showInputBox({\n value: url,\n prompt: 'Please open this URL in your browser, complete the flow, and paste the token in the next input box.'\n });\n return yield vscode.window.showInputBox({ prompt: 'Enter token from web browser', ignoreFocusOut: true });\n });\n}", "function getAccessToken() {\n var xmlHttp = null;\n xmlHttp = new XMLHttpRequest();\n xmlHttp.open(\"GET\", '/api/forge/token', false /*forge viewer requires SYNC*/);\n xmlHttp.send(null);\n return xmlHttp.responseText;\n}", "getAccessToken() {\n if (!this.hasDataStored) this.getDataFromResponse(this.responseObject);\n return this.accessToken;\n }", "function getAuth(callback) {\n chrome.identity.getAuthToken({interactive: true}, callback);\n}", "function getToken(){\n return localStorage.getItem(\"token\");\n}", "function fetchToken() {\n $.getJSON(buildTokenUrl(), {command: 'request'}, response => {\n token = response.token;\n console.log(`session token fetched: ${token}`);\n });\n}", "async function generateTokenFromRefreshToken(currentUser, refreshToken, accessTokenLength) {\n\n return jwt.sign({currentUser: currentUser}, process.env.ACCESS_TOKEN_SECRET, {expiresIn: accessTokenLength}); \n \n}", "function refreshToken() {\n const currentUser = authenticationService.currentUserValue;\n const refresh_token = currentUser.refresh_token\n const requestOptions = {\n method: 'POST',\n headers: {\n \"Authorization\": `Bearer ${currentUser.refresh_token}`\n },\n };\n\n return fetch(`${config.apiUrl}/api/refresh/`, requestOptions)\n .then(response => {\n if (!response.ok) {\n return Promise.reject(\"ERROR\");\n };\n\n return response.text()\n .then(text => {\n const access_token = text && JSON.parse(text);\n // store jwt token in local storage to keep user logged in between page refreshes\n const tokens = (Object.assign(access_token, { \"refresh_token\": refresh_token }));\n if (tokens[\"access_token\"]){\n localStorage.setItem('currentUser', JSON.stringify(tokens));\n currentUserSubject.next(tokens);\n }\n\n })\n });\n}", "function checkToken() {\n chrome.storage.local.get(\"token\", result => {\n var token = result.token;\n if (token != undefined) getUserId(token);\n else window.oauth2.start();\n });\n}", "async getTokens() {\n const apiURL = `${this.dxApiURL}/v1/tokens`\n const res = await fetcher(apiURL)\n\n return res.data\n }", "static getTokenFromLS() {\n const localStorageToken = localStorage.getItem(\"tokenObject\");\n if (localStorageToken !== \"\" && localStorageToken !== null) {\n return JSON.parse(localStorageToken).access_token;\n } else {\n return -1;\n }\n }", "function authToken(req, res, next) {\n const userauthtoken = req.cookies.useraccesstoken;\n\n //chekc if token is valid if not, send no permission\n if (userauthtoken == null) {\n return res.sendStatus(401);\n }\n\n //verify token\n jwt.verify(userauthtoken, process.env.ACCESS_TOKEN_SECRET, (err, useremailobject) => {\n //if token is not valid\n if (err) {\n return res.sendStatus(403).send('No access');\n }\n req.useremail = useremailobject;\n next();\n })\n}", "get authenticationToken() {\n return this.fields.authenticationToken;\n }", "function getRequestToken() {\n StartService.getRequestToken().then(function ( data ) {\n // save oauth_token, oauth_token_secret to requestToken\n requestToken = data;\n }, function ( error ) {\n console.error('Can\\'t get request token');\n Toast.showToast(null, 'Can\\'t get request token');\n });\n }", "function getToken() {\n let token = localStorage.getItem('token'); \n if (token) {\n // Check if expired, remove if it is\n const payload = JSON.parse(atob(token.split('.')[1])); // Gets the payload (claims), a JSON string, and converts it into a JavaScript object\n // JWT's exp is expressed in seconds, not milliseconds, so convert\n if (payload.exp < Date.now() / 1000) {\n localStorage.removeItem('token');\n token = null;\n }\n }\n return token;\n}" ]
[ "0.7035979", "0.6960911", "0.68620807", "0.672577", "0.66880494", "0.6617844", "0.6575533", "0.6546989", "0.6523108", "0.6515465", "0.6497888", "0.64920354", "0.64789265", "0.64639044", "0.6380196", "0.6377417", "0.6376784", "0.63588995", "0.6357987", "0.6346817", "0.63218975", "0.63139987", "0.6313553", "0.6297467", "0.62769276", "0.62434584", "0.6241477", "0.6236537", "0.62348986", "0.62348986", "0.6231148", "0.62270653", "0.6222826", "0.62215763", "0.6209098", "0.62061256", "0.6204569", "0.6190759", "0.6189703", "0.6181339", "0.6169427", "0.61646736", "0.61634254", "0.6158571", "0.61527973", "0.61505675", "0.6145832", "0.6143383", "0.6138871", "0.6134108", "0.6130028", "0.61293435", "0.61293435", "0.6127983", "0.6118803", "0.61100817", "0.60858893", "0.607765", "0.60773605", "0.6077179", "0.6077179", "0.6052684", "0.6040327", "0.6040149", "0.60380346", "0.60378367", "0.6030726", "0.6029347", "0.6010591", "0.60064816", "0.5999838", "0.5998976", "0.59761906", "0.5972456", "0.59702355", "0.5969134", "0.5961806", "0.59538746", "0.59523463", "0.595149", "0.5950014", "0.59479874", "0.59469223", "0.5945675", "0.59347695", "0.5934457", "0.59308136", "0.59301794", "0.59297955", "0.5918041", "0.5918014", "0.5908936", "0.59077376", "0.5899905", "0.58950174", "0.5891057", "0.58906466", "0.5889926", "0.5885132", "0.5883876", "0.58730716" ]
0.0
-1
handle mouse wheel events
function handler(canvasid) { var idcode=canvasid[canvasid.length-1]; var idx=((idcode=="x")?0:((idcode=="y")?1:2)); var ii=GLOBAL.iiarr[idx]; var canvas=document.getElementById(canvasid); var img=document.getElementById(canvas.id+"-img"); var phony=document.getElementById(canvas.id+"-img-phony"); canvas.width =parseFloat(canvas.parentNode.style.width ); canvas.height=parseFloat(canvas.parentNode.style.height); var maxii=181*217/Math.max(canvas.width,canvas.height); GLOBAL.iiarr[idx]=Math.min(maxii,Math.max(0,ii)); DrawImage(canvas,img,idx); var phonyid="map-"+idx+"-"+GLOBAL.iiarr[idx]; phony.useMap="#"+phonyid; var areas=document.getElementById(phony.useMap.substr(1)).childNodes; for (var areaiter=0; areaiter < areas.length; areaiter++){ areas[areaiter].addEventListener("click",MouseClickAreaHandler,false); areas[areaiter].addEventListener("mouseover",MouseOverAreaHandler,false); // areas[areaiter].addEventListener("mouseout", MouseOutAreaHandler ,false); } phony.addEventListener("mousedown", MouseDraggingHandler_start,false); phony.addEventListener("mousemove", MouseDraggingHandler_move ,false); phony.addEventListener("mouseup", MouseDraggingHandler_stop ,false); phony.addEventListener("mousewheel", MouseWheelHandler,false); phony.addEventListener("DOMMouseScroll",MouseWheelHandler,false); function MouseWheelHandler(e){ var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail))); var ii=GLOBAL.iiarr[idx]; if (delta>0){ii+=1;}else{ii-=1;} GLOBAL.iiarr[idx]=Math.min(maxii,Math.max(0,ii)); Update(); if (GLOBAL.area_map_flag){ var phonyid="map-"+idx+"-"+GLOBAL.iiarr[idx]; phony.useMap="#"+phonyid; var areas=document.getElementById(phony.useMap.substr(1)).childNodes; for (var areaiter=0; areaiter < areas.length; areaiter++){ areas[areaiter].addEventListener("mouseover",MouseOverAreaHandler,false); areas[areaiter].addEventListener("click",MouseClickAreaHandler,false); // areas[areaiter].addEventListener("mouseout", MouseOutAreaHandler ,false); } } } // function MouseWheelHandler }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mouseWheel(_delta) {}", "function mouseWheel(event) {\n pos += event.delta;\n}", "function handleWheel(delta, event) {\n\n QMouse.isMouseWheel = true;\n\n // Update Mouse Position\n QMouse.X = event.offsetX | event.layerX;\n QMouse.Y = event.offsetY | event.layerY;\n\n QMouse.wheelDelta = delta;\n if (0 < delta)\n $('#zoom-control-up img').click();\n\n if (0 > delta)\n $('#zoom-control-down img').click();\n\n QMouse.isMouseWheel = false;\n QMouse.wheelDelta = 0;\n }", "function mouseWheel(event) {\n // Only works if vibration is on.\n if (Bubble.vibration) {\n if (event.delta > 0) {\n // Scrolled down.\n Bubble.decreaseVibrationStep();\n } else {\n // Scrolled up.\n Bubble.increaseVibrationStep();\n }\n }\n}", "function wheel(event) {\n var delta = 0;\n if (event.wheelDelta) {(delta = event.wheelDelta / 120);}\n else if (event.detail) {(delta = -event.detail / 3);}\n\n handle(delta);\n if (event.preventDefault) {(event.preventDefault());}\n event.returnValue = false;\n}", "function wheel(ev, gl, canvas){\r\n var scroll = ev.deltaY;\r\n \r\n if(buttonE && currPick!=null){\r\n scaleObj(scroll);\r\n }else if(buttonE && currPick===null){\r\n if(lastButton===2){ //right mouse click\r\n moveCamera(scroll);\r\n }else{\r\n zoom(scroll);\r\n }\r\n }\r\n \r\n return false;\r\n}", "function mouseWheelHandler(e)\n {\n var e = window.event || e;\n var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));\n if(delta >0) {\n nextImage(e);\n } else {\n previousImage(e);\n }\n return false;\n }", "function mouseWheelEvent(e){\n var mCtx = metricsContext;\n var delta = 0;\n\n // console.log(e);\n switch (e.type){\n case 'DOMMouseScroll': // FireFox\n delta = Math.round(e.wheelDelta || e.detail*10);\n break;\n\n case 'mousewheel': // Chrome (e.deltaY), IE & Opera (e.wheelDelta)\n delta = Math.round(e.deltaX || e.deltaY || e.wheelDelta);\n break; \n \n default:\n console.log('Currently \"%s\" type is not supported.', e.type);\n return false;\n }\n mCtx.translated = restrictRange(mCtx.translated+delta);\n // translated += delta;\n\n drawText();\n e.preventDefault();\n e.stopPropagation();\n\n // mouseController.wheel(e);\n return false; \n}", "function wheel(event){\n var delta = 0;\n if (!event) /* For IE. */\n event = window.event;\n if (event.wheelDelta) { /* IE/Opera. */\n delta = event.wheelDelta/120;\n } else if (event.detail) { /** Mozilla case. */\n /** In Mozilla, sign of delta is different than in IE.\n * Also, delta is multiple of 3.\n */\n delta = -event.detail/3;\n }\n /** If delta is nonzero, handle it.\n * Basically, delta is now positive if wheel was scrolled up,\n * and negative, if wheel was scrolled down.\n */\n if (delta) {\n handleWheel(delta, event);\n }\n /** Prevent default actions caused by mouse wheel.\n * That might be ugly, but we handle scrolls somehow\n * anyway, so don't bother here..\n */\n if (event.preventDefault) {\n event.preventDefault();\n }\n event.returnValue = false;\n }", "function wheel(event) {\n\n var delta = 0;\n // Indicates that zoom has been 'activated'.\n TFplanner.grid.zoomed = true;\n\n /* For IE. */\n if (!event) {\n event = window.event;\n }\n /* IE/Opera. */\n if (event.wheelDelta) { \n delta = event.wheelDelta/120;\n\n /** Mozilla case. */\n } else if (event.detail) { \n /** In Mozilla, sign of delta is different than in IE.\n * Also, delta is multiple of 3.\n */\n delta = -event.detail/3;\n }\n /** If delta is nonzero, handle it.\n * Basically, delta is now positive if wheel was scrolled up,\n * and negative, if wheel was scrolled down.\n */\n if (delta) {\n TFplanner.grid.handle(delta);\n }\n \n /** Prevent default actions caused by mouse wheel.\n * That might be ugly, but we handle scrolls somehow\n * anyway, so don't bother here..\n */\n if (event.preventDefault) {\n event.preventDefault();\n }\n \n event.returnValue = false;\n }", "function onMouseWheel(event)\n {\n //Normalize event wheel delta\n var delta = event.originalEvent.wheelDelta / 30 || -event.originalEvent.detail;\n\n //If the user scrolled up, it goes to previous slide, otherwise - to next slide\n if(delta < -1)\n {\n goToNextSlide();\n }\n else if(delta > 1)\n {\n goToPrevSlide();\n }\n\n event.preventDefault();\n }", "onWheel(e) {\n // Rewriting default behavior\n e.preventDefault();\n window.scrollBy(e.deltaY, 0);\n\n // Depending methods\n this.scrollBarWidth();\n this.scrollBarHighlight();\n this.closePosition();\n this.backgroundHeaderPosition(e);\n }", "function onWheel( tracker, event ) {\n handleWheelEvent( tracker, event, event, false );\n }", "function wheelHandler() {\n // console.log(event.deltaX, event.deltaY, event.deltaFactor);\n if (toogleScrollEvent === true) {\n toogleScrollEvent = false;\n\n\n // Disable scrolling\n $('.page').unbind('mousewheel', wheelHandler);\n animate();\n }\n}", "_mouseWheelHandler(event) {\n const that = this;\n\n if (!that.computedHorizontalScrollBarVisibility && !that.computedVerticalScrollBarVisibility) {\n return;\n }\n\n if (!that.disabled && that.computedVerticalScrollBarVisibility) {\n event.stopPropagation();\n event.preventDefault();\n that.scrollTo(that.scrollTop + that._getScrollCoefficient(event, that.offsetHeight));\n }\n }", "mouseWheel(event) {\r\n\t\tthis.zooming(this.zoom *pow(this.zoomingRate, -event.delta), mouseX, mouseY);\r\n\t}", "function canvasMouseWheel(e){\r\n\tif(!e) e = window.event;\r\n\tif(useStates){\r\n\t\tStates.current().input.mouseWheel(e);\r\n\t}\r\n\tgInput.mouseWheel(e);\r\n}", "function onMouseWheel(event3D) {\n if (!that.userZoom) {\n return;\n }\n\n var event = event3D.domEvent;\n // wheelDelta --> Chrome, detail --> Firefox\n var delta;\n if (typeof (event.wheelDelta) !== 'undefined') {\n delta = event.wheelDelta;\n } else {\n delta = -event.detail;\n }\n if (delta > 0) {\n that.zoomIn();\n } else {\n that.zoomOut();\n }\n\n this.showAxes();\n }", "function onMouseWheel(event)\n\t{\n\t\t//Normalize event wheel delta\n\t\tvar delta = event.originalEvent.wheelDelta / 30 || -event.originalEvent.detail;\n\n\t\t//If the user scrolled up, it goes to previous slide, otherwise - to next slide\n\t\tif(delta < -1)\n\t\t{\n\t\t\tgoToNextSlide();\n\t\t}\n\t\telse if(delta > 1)\n\t\t{\n\t\t\tgoToPrevSlide();\n\t\t}\n\n\t\tevent.preventDefault();\n\t}", "_mouseWheelHandler(event) {\n const that = this;\n\n if (that._scrollView.hScrollBar.$.hasClass('jqx-hidden') && that._scrollView.vScrollBar.$.hasClass('jqx-hidden')) {\n return;\n }\n\n if (!that.disabled && !that._scrollView.vScrollBar.$.hasClass('jqx-hidden')) {\n event.stopPropagation();\n event.preventDefault();\n that._scrollView.scrollTo(that._scrollView.scrollTop + that._getScrollCoefficient(event, that._clientSize.height));\n // that._scrollView.scrollTop += event.deltaY < 0 ? -100 : 100;\n\n }\n }", "function _mouseWheelHandler(e) {\n // cross-browser wheel delta\n var e = window.event || e; // old IE support\n var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));\n\n // adjusts the camera zoom by the delta,\n // either + or - 1\n _cameraZoomAdjustment( delta*0.01 );\n\n return false;\n }", "function onDocumentMouseWheel (event) {\n}", "_mouseWheelHandler(event) {\n const that = this;\n\n if (that.disabled || that.readonly || (that.items && that.items.length === 0)) {\n return;\n }\n\n if (that.$dropDownContainer && !that.$dropDownContainer.hasClass('jqx-visibility-hidden')) {\n return;\n }\n\n if (that.$.listBox) {\n event.preventDefault();\n that.$.listBox._handleKeyStrokes(event.deltaY > 0 ? 'ArrowDown' : 'ArrowUp');\n }\n }", "_handleMouseWheel(event) {\n const that = this,\n previousIndex = that._currentIndex;\n\n if (that.disabled || !that.wheel || document.activeElement!== that) {\n return\n }\n\n event.stopPropagation();\n event.preventDefault();\n event.deltaY>0 ? that.next() : that.prev();\n that._changeEvent(previousIndex, that._currentIndex);\n }", "handleWheel(e) {\n e.preventDefault();\n if (e.deltaY < 0) {\n this.tryCollapse();\n } else if (e.deltaY > 0) {\n this.tryExpand();\n }\n }", "_mouseWheelHandler(event) {\n const that = this;\n\n if (that._scrollView.hScrollBar.$.hasClass('smart-hidden') && that._scrollView.vScrollBar.$.hasClass('smart-hidden')) {\n return;\n }\n\n if (!that.disabled && !that._scrollView.vScrollBar.$.hasClass('smart-hidden')) {\n const scrollTop = that.scrollTop;\n\n if (scrollTop === 0 && event.deltaY < 0 ||\n scrollTop === that.scrollHeight && event.deltaY > 0) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n that._scrollView.scrollTo(that._scrollView.scrollTop + that._getScrollCoefficient(event, that._clientSize.height));\n // that._scrollView.scrollTop += event.deltaY < 0 ? -100 : 100;\n\n }\n }", "function MouseWheelHandler(e) {\n e.preventDefault(); // prevent default browser scroll\n clearInterval(interval); // cancel previous animation\n ++mult; // we are going to scroll faster\n var delta = -Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));\n if(dir!=delta) { // scroll direction changed\n mult = 1; // start slowly\n dir = delta;\n }\n for(var tgt=e.target; tgt!=document.documentElement; tgt=tgt.parentNode) {\n var oldScroll = tgt.scrollTop;\n tgt.scrollTop+= delta;\n if(oldScroll!=tgt.scrollTop) break;\n }\n var start = tgt.scrollTop;\n var end = start + length*mult*delta; // where to end the scroll\n var change = end - start; // base change in one step\n var step = 0; // current step\n interval = setInterval(function() {\n var pos = Math.easeOut(step++,start,change,steps);\n //window.scrollTo(0,pos);\n tgt.scrollTop = pos;\n if(step>=steps) { // scroll finished without speed up - stop by easing out\n mult = 0;\n clearInterval(interval);\n }\n },10);\n }", "function MouseWheel (e) {\n e = e || window.event;\n // alert(['scrolled ', (( e.wheelDelta <= 0 || e.detail > 0) ? 'down' : 'up')].join(''));\n delta = e.deltaY;\n //console.log(\"in func\" + delta);\n return e;\n}", "function mouseWheel() {\n g = g + 10;\n}", "function onMouseWheel(e) {\r\n let s = scale[0] * Math.pow(1.05, e.deltaY);\r\n scale = [s, s, s];\r\n updateModelViewMatrix();\r\n}", "function onMouseWheel(event) {\n if (currentGameState === GameState.IN_GAME) {\n if (event.ctrlKey) {\n // The Trackballcontrol only works if Ctrl key isn't pressed\n scene.getCameraControls().enabled = false;\n } else {\n scene.getCameraControls().enabled = true;\n }\n }\n}", "function MouseWheelHandler(e) {\n // Prevent page from scrolling\n e.preventDefault();\n\n console.log(e.layerX + ' ' + e.layerY);\n\n /* Calculate scale */\n var scaleBy = e.wheelDeltaY/1000;\n\n /* Save scale for scrolling */\n canvas_scale *= 1+scaleBy;\n\n /* Translate and scale context */\n context.translate(e.layerX, e.layerY);\n context.scale(1+scaleBy, 1+scaleBy);\n context.translate(-e.layerX, -e.layerY);\n\n redraw(contex_line_data);\n}", "function onWheel(evt) {\r\n\t// Various equations could be used here, but this is what I chose\r\n\tcur_scale *= (1000-evt.deltaY) / 1000;\r\n\tupdate_model_view();\r\n}", "mouseWheel(e) {\n if (!e) {\n e = window.event;\n }\n this._modifiers(e);\n let _delta;\n if (e.wheelDelta) {\n _delta = 0 - (e.wheelDelta / 120);\n }\n else if (e.detail) {\n _delta = 0 - (e.detail / 3);\n }\n if (BROWSER_TYPE.opera || BROWSER_TYPE.safari) {\n _delta = 0 - _delta;\n }\n const focused = this._listeners.focused;\n const _wantsToStopTheEvent = [];\n const _mouseWheelable = this._listeners.byEvent.mouseWheel;\n this._filterViewIdToValidView(focused, _viewId => {\n return _mouseWheelable.includes(_viewId);\n }).filter(_ctrl => {\n return this.isFunction(_ctrl.mouseWheel);\n }).forEach(_ctrl => {\n if (_ctrl.mouseWheel(_delta)) {\n _wantsToStopTheEvent.push(_ctrl.viewId);\n }\n });\n if (_wantsToStopTheEvent.length !== 0) {\n Event.stop(e);\n }\n }", "mouseWheel(e) {\n if (!e) {\n e = window.event;\n }\n this._modifiers(e);\n let _delta;\n if (e.wheelDelta) {\n _delta = 0 - (e.wheelDelta / 120);\n }\n else if (e.detail) {\n _delta = 0 - (e.detail / 3);\n }\n if (BROWSER_TYPE.opera || BROWSER_TYPE.safari) {\n _delta = 0 - _delta;\n }\n const focused = this._listeners.focused;\n const _wantsToStopTheEvent = [];\n const _mouseWheelable = this._listeners.byEvent.mouseWheel;\n this._filterViewIdToValidView(focused, _viewId => {\n return _mouseWheelable.includes(_viewId);\n }).filter(_ctrl => {\n return this.isFunction(_ctrl.mouseWheel);\n }).forEach(_ctrl => {\n if (_ctrl.mouseWheel(_delta)) {\n _wantsToStopTheEvent.push(_ctrl.viewId);\n }\n });\n if (_wantsToStopTheEvent.length !== 0) {\n Event.stop(e);\n }\n }", "function wheelEventLs(event) {\n var delta = 0;\n if (!event) { /* For IE. */\n event = window.event;\n }\n if (event.wheelDelta) { /* IE/Opera. */\n delta = event.wheelDelta / 120;\n } else if (event.detail) {\n /**\n * Mozilla case.\n *\n * In Mozilla, sign of delta is different than in IE. Also,\n * delta is multiple of 3.\n */\n delta = -event.detail / 3;\n }\n\n os.fireEvent('mousewheel', Ext.EventObject.setEvent(event), delta);\n }", "function handleMouseWheel(shell, ev) {\n var scale = 1\n switch(ev.deltaMode) {\n case 0: //Pixel\n scale = 1\n break\n case 1: //Line\n scale = 12\n break\n case 2: //Page\n scale = shell.height\n break\n }\n //Add scroll\n shell.scroll[0] += ev.deltaX * scale\n shell.scroll[1] += ev.deltaY * scale\n shell.scroll[2] += (ev.deltaZ * scale)||0.0\n return false\n}", "function applyWheel(e){\n\t var evt = window.event || e \t\t\t\t\t\t\t\t\t//equalize event object\n\t var delta = evt.detail? evt.detail*(-120) : evt.wheelDelta \t\t//check for detail first so Opera uses that instead of wheelDelta\n\t \n\t // If you start wheeling the mouse stock for the first time since 3 seconds, update viewportX, Y\n\t \tstartWheel = new Date();\n\t \tdiffWheel = (startWheel- lastWheel) / 1000;\n\n\t //console.log(delta);\n\n\t wall.goScale(delta);\n\t}", "function wheelEvt(evt) {\n if (configs.force)\n evt.preventDefault();\n else\n youScrollInstance.end();\n }", "function mouseWheel(browserEvent) {\n\t return browserEvent.type === _browserevent2.default.MOUSE_WHEEL || browserEvent.type === _browserevent2.default.WHEEL;\n\t}", "function onWheel(evt) {\n if (!evt) {\n evt = window.event;\n }\n\n var delta = 0;\n if (evt.wheelDelta) { // IE and Opera\n delta = evt.wheelDelta;\n }\n else if (evt.detail) { // Mozilla\n delta = -evt.detail;\n }\n \n if (delta !== 0) {\n if (evt.shiftKey) {\n rotate(delta);\n }\n else {\n zoom(delta, evt.clientX, evt.clientY);\n }\n }\n \n evt.stopPropagation();\n evt.preventDefault();\n }", "function addMiddleWheelHandler(){\r\n container.addEventListener('mousedown', mouseDownHandler);\r\n container.addEventListener('mouseup', mouseUpHandler);\r\n }", "function addMiddleWheelHandler(){\r\n container.addEventListener('mousedown', mouseDownHandler);\r\n container.addEventListener('mouseup', mouseUpHandler);\r\n }", "mousewheel_handle(e) {\n // Test if mousewheel option is enabled and Ctrl key is pressed.\n if (!this.options.default_event_handle['enable_mousewheel_handle'] || !e.ctrlKey) {\n return;\n }\n var evt = e || event;\n // Avoid default page scrolling behavior.\n evt.preventDefault();\n\n if (evt.deltaY < 0) {\n this.view.zoom_in(evt); // wheel down\n } else {\n this.view.zoom_out(evt);\n }\n }", "function addMiddleWheelHandler(){\n container.addEventListener('mousedown', mouseDownHandler);\n container.addEventListener('mouseup', mouseUpHandler);\n }", "function addMiddleWheelHandler(){\n container.addEventListener('mousedown', mouseDownHandler);\n container.addEventListener('mouseup', mouseUpHandler);\n }", "function addMiddleWheelHandler(){\n container.addEventListener('mousedown', mouseDownHandler);\n container.addEventListener('mouseup', mouseUpHandler);\n }", "function wheel(event) {\n\t\tvar \tevent = window.event || event, // old IE support\n\t\t\t\tdelta = Math.max(-1, Math.min(1, (event.wheelDelta || -event.detail)));\n\t\tadd_speed( delta*options.wheel_mutiplier );\n\t\tinit_inertia();\n\t\tevent.stopPropagation();\n\t\tevent.preventDefault();\n\t}", "onWheel(ev) {\n const amount = this._getPixelsScrolled(ev);\n if (amount === 0) {\n return false;\n }\n this._viewportElement.scrollTop += amount;\n return this._bubbleScroll(ev, amount);\n }", "handleWheel(event) {\n if (this.containerRef) {\n this.containerRef.view.scrollTop = this.containerRef.view.scrollTop + event.deltaY\n event.preventDefault()\n event.stopPropagation()\n }\n }", "_handleMousewheel() {\n this.$slidesWrapper.addEventListener(\"wheel\", (e) => {\n if (!this.props.mousewheel) {\n if (this.props.direction === \"horizontal\" && Math.abs(e.deltaX) > 0) {\n e.preventDefault();\n } else if (this.props.direction === \"vertical\" && Math.abs(e.deltaY) > 0) {\n e.preventDefault();\n }\n }\n });\n }", "function wheel(event) {\n var delta = 0;\n if (!event) /* For IE. */\n event = window.event;\n\n console.log('event.wheelDelta:' + event.wheelDelta);\n\n if (event.wheelDelta) { /* IE/Opera. */\n // delta = event.wheelDelta / 120;\n delta = event.wheelDelta / 90; //by ms2\n /** In Opera 9, delta differs in sign as compared to IE.\n */\n if (window.opera)\n delta = -delta;\n }\n else if (event.detail) { /** Mozilla case. */\n /** In Mozilla, sign of delta is different than in IE.\n * Also, delta is multiple of 3.\n */\n delta = -event.detail / 3;\n }\n /** If delta is nonzero, handle it.\n * Basically, delta is now positive if wheel was scrolled up,\n * and negative, if wheel was scrolled down.\n */\n if (delta)\n handle(delta, event);\n }", "function mouseWheel(event) {\n if (event.deltaY > 0) {\n size = size - 10;\n } else {\n size = size + 10;\n }\n}", "function onMouseWheel (event) {\n if (enableControls_3D) {\n if (!shooting_3D) {\n scene_3D.changeWeapon();\n }\n }\n\n}", "function onMouseWheel( tracker, event ) {\n // For legacy IE, access the global (window) event object\n event = event || window.event;\n\n // Simulate a 'wheel' event\n var simulatedEvent = {\n target: event.target || event.srcElement,\n type: \"wheel\",\n shiftKey: event.shiftKey || false,\n clientX: event.clientX,\n clientY: event.clientY,\n pageX: event.pageX ? event.pageX : event.clientX,\n pageY: event.pageY ? event.pageY : event.clientY,\n deltaMode: event.type == \"MozMousePixelScroll\" ? 0 : 1, // 0=pixel, 1=line, 2=page\n deltaX: 0,\n deltaZ: 0\n };\n\n // Calculate deltaY\n if ( $.MouseTracker.wheelEventName == \"mousewheel\" ) {\n simulatedEvent.deltaY = - 1 / $.DEFAULT_SETTINGS.pixelsPerWheelLine * event.wheelDelta;\n } else {\n simulatedEvent.deltaY = event.detail;\n }\n\n handleWheelEvent( tracker, simulatedEvent, event, false );\n }", "function Dragging_Wheel(event)\n{\n\t//has drag data?\n\tif (__DRAG_DATA && __DRAG_DATA.OnWheel)\n\t{\n\t\t//call it\n\t\t__DRAG_DATA.OnWheel(event);\n\t}\n}", "_mouseWheelHandler(event) {\n const that = this;\n\n if (that.disabled || !(that._dragDetails && that._dragDetails.started)) {\n return;\n }\n\n //document.documentElement.scrollTop is always 0 in MS EDGE but not in IE11!\n if (event.deltaY < 0 && that._windowParent.scrollElement.scrollTop + event.deltaY <= 0) {\n that.style.top = Math.max(0, that._dragDetails.windowY) + 'px';\n return;\n }\n\n if (event.deltaY > 0 && (that._dragDetails.windowY + that.offsetHeight + event.deltaY >= that._windowParent.scrollElement.scrollHeight ||\n that._windowParent.scrollElement.scrollTop + that._windowParent.element.clientHeight === that._windowParent.scrollElement.scrollHeight)) {\n return;\n }\n\n if (that._dragDetails.type === 'drag') {\n that._dragDetails.windowY += event.deltaY;\n that.style.top = that._dragDetails.windowY + 'px';\n }\n else {\n that._dragDetails.height += event.deltaY;\n that.style.height = that._dragDetails.height + 'px';\n }\n }", "wheelHandler(event) {\n var direction = event.deltaY;\n if (direction > 0) {\n // Scroll down\n if (this._controlFocus === \"camera\") {\n this.CONTROLLABLES[this._controlFocus].matrixWorld.multiply(new THREE.Matrix4().makeTranslation(0, 0, 3 * this.zoomSpeed));\n } else {\n this.CONTROLLABLES[this._controlFocus].matrix.multiply(new THREE.Matrix4().makeTranslation(0, 0, 3 * this.zoomSpeed));\n }\n } else {\n // Scroll up\n if (this._controlFocus === \"camera\") {\n this.CONTROLLABLES[this._controlFocus].matrixWorld.multiply(new THREE.Matrix4().makeTranslation(0, 0, -3 * this.zoomSpeed));\n } else {\n this.CONTROLLABLES[this._controlFocus].matrix.multiply(new THREE.Matrix4().makeTranslation(0, 0, -3 * this.zoomSpeed));\n }\n }\n }", "onMouseWheelDown(callback, isOnce = false) {\n this._mouseWheelDownCallbacks.push([\n callback,\n isOnce\n ]);\n }", "function addMiddleWheelHandler() {\n container.addEventListener('mousedown', mouseDownHandler);\n container.addEventListener('mouseup', mouseUpHandler);\n }", "function wheelZoom(e){\n var evt=window.event || e;//equalize event object\n var delta=evt.detail? evt.detail*(-120) : evt.wheelDelta; //delta returns +120 when wheel is scrolled up, -120 when scrolled down\n //console.log(\"Wheel Zoom\");\n //console.log(zoom);\n\n if(typeof(delta) === 'number'){\n zoom = zoom + parseInt(delta/12);\n }\n // console.log(zoom);\n\n if(zoom < 80){\n zoom = 80;\n }\n if(zoom > 400){\n zoom = 400;\n }\n if (evt.preventDefault) {//disable default wheel action of scrolling page\n evt.preventDefault();\n }else{\n return false;\n }\n setMatrix();\n drawWorld();\n}", "function handler(event){\n event.type = 'mousewheel';\n event.wheelDelta = event.wheelDelta ? event.wheelDelta/120 : -(event.detail || 0)/3;\n $.browser.mozilla && $.event.handle.apply(this, arguments);\n }", "function handleWheelEvent( tracker, event, originalEvent, isTouch ) {\n var nDelta = 0,\n propagate;\n\n isTouch = isTouch || false;\n\n // The nDelta variable is gated to provide smooth z-index scrolling\n // since the mouse wheel allows for substantial deltas meant for rapid\n // y-index scrolling.\n // event.deltaMode: 0=pixel, 1=line, 2=page\n // TODO: Deltas in pixel mode should be accumulated then a scroll value computed after $.DEFAULT_SETTINGS.pixelsPerWheelLine threshold reached\n nDelta = event.deltaY < 0 ? 1 : -1;\n\n if ( tracker.scrollHandler ) {\n propagate = tracker.scrollHandler(\n {\n eventSource: tracker,\n position: getMouseRelative( event, tracker.element ),\n scroll: nDelta,\n shift: event.shiftKey,\n isTouchEvent: isTouch,\n originalEvent: originalEvent,\n preventDefaultAction: false,\n userData: tracker.userData\n }\n );\n if ( propagate === false ) {\n $.cancelEvent( originalEvent );\n }\n }\n }", "function onWheel (aEvent) {\n let is_ctrlKey;\n let is_metaKey;\n if (isMacOS) {\n\tis_ctrlKey = aEvent.metaKey;\n\tis_metaKey = aEvent.ctrlKey;\n }\n else {\n\tis_ctrlKey = aEvent.ctrlKey;\n\tis_metaKey = aEvent.metaKey;\n }\n if (is_ctrlKey && !aEvent.altKey && !is_metaKey && !aEvent.shiftKey) {\n\taEvent.preventDefault();\n }\n}", "bindMouseEvent () {\n document.addEventListener(\"mousewheel\", (event) => {\n this.direction = event.wheelDelta < 0\n this.changeSlide()\n })\n document.addEventListener(\"DOMMouseScroll\", (event) => {\n this.direction = event.detail == 3 \n this.changeSlide()\n })\n }", "function addMiddleWheelHandler(){\r\n container\r\n .on('mousedown', mouseDownHandler)\r\n .on('mouseup', mouseUpHandler);\r\n }", "function addMiddleWheelHandler(){\r\n container\r\n .on('mousedown', mouseDownHandler)\r\n .on('mouseup', mouseUpHandler);\r\n }", "function addMiddleWheelHandler(){\r\n container\r\n .on('mousedown', mouseDownHandler)\r\n .on('mouseup', mouseUpHandler);\r\n }", "function handleWheelMove(event) {\n if (event.deltaY > 50) {\n scrollDown = true;\n checkDirection();\n }\n else if (event.deltaY < -50) {\n scrollDown = false;\n checkDirection();\n }\n\n // increase/decrease page index base on direction\n function checkDirection() {\n switch (scrollDown) {\n case true:\n moveDownOnePage();\n break;\n\n case false:\n moveUpOnePage();\n break;\n }\n }\n function moveDownOnePage() {\n if ( pageIndex < listBtns.length - 1 ) {\n ++ pageIndex;\n } else {\n pageIndex = 0;\n }\n }\n function moveUpOnePage() {\n if ( pageIndex > 0 ) {\n -- pageIndex;\n } else {\n pageIndex = listBtns.length -1;\n }\n }\n }", "function addMiddleWheelHandler(){\n container\n .on('mousedown', mouseDownHandler)\n .on('mouseup', mouseUpHandler);\n }", "function addMiddleWheelHandler(){\n container\n .on('mousedown', mouseDownHandler)\n .on('mouseup', mouseUpHandler);\n }", "function addMiddleWheelHandler(){\n container\n .on('mousedown', mouseDownHandler)\n .on('mouseup', mouseUpHandler);\n }", "function addMiddleWheelHandler(){\n container\n .on('mousedown', mouseDownHandler)\n .on('mouseup', mouseUpHandler);\n }", "handleMouseOver() {\n this.setState({\n canDrag: true,\n cursor: 'grab'\n });\n window.addEventListener('wheel', this.handleWheel, {passive: false} );\n }", "handle(event) {\n if (event.type === 'wheel') {\n return false;\n }\n return super.handle(event);\n }", "onMouseWheelUp(callback, isOnce = false) {\n this._mouseWheelUpCallbacks.push([\n callback,\n isOnce\n ]);\n }", "_inputWheelHandler(event) {\n const that = this,\n activeElement = that.shadowRoot ? (that.shadowRoot.activeElement || document.activeElement) : document.activeElement;\n\n if (that.$.input === activeElement && that.enableMouseWheelAction && that._isIncrementOrDecrementAllowed()) {\n event.stopPropagation();\n event.preventDefault();\n if (event.wheelDelta > 0) {\n that._incrementOrDecrement('add');\n }\n else {\n that._incrementOrDecrement('subtract');\n }\n }\n }", "handleWheel(e) {\n var angleInDegrees = this.state.deg;\n var angleInRadians = this.state.rad;\n if (e.deltaY < 0) {\n if (angleInDegrees <= Constants.MAX_DEG - Constants.BUFF_DEG && angleInDegrees >= Constants.ANGLE_OFFSET_DEG) {\n angleInDegrees = angleInDegrees + Constants.BUFF_DEG;\n angleInRadians = angleInRadians + Constants.BUFF_RAD;\n } else {\n angleInDegrees = Constants.MIN_DEG;\n angleInRadians = Constants.MIN_RAD;\n }\n } else if (e.deltaY > 0) {\n if (angleInDegrees <= Constants.MAX_DEG && angleInDegrees >= Constants.ANGLE_OFFSET_DEG + Constants.BUFF_DEG) {\n angleInDegrees = angleInDegrees - Constants.BUFF_DEG;\n angleInRadians = angleInRadians - Constants.BUFF_RAD;\n } else {\n angleInDegrees = Constants.MAX_DEG;\n angleInRadians = Constants.MAX_RAD;\n }\n }\n this.setState({\n deg: angleInDegrees,\n rad: angleInRadians\n })\n this.handleAngleChanged(angleInRadians, angleInDegrees);\n e.preventDefault();\n }", "handleOuterMousewheel (event) {\n // Prevent scrolling of the background\n event.preventDefault()\n event.stopPropagation()\n\n const xThreshold = WHEEL_MOVE_X_THRESHOLD\n let actionDelay = 0\n const imageMoveDelay = 500\n\n this.clearTimeout(this.resetScrollTimeout)\n this.resetScrollTimeout = this.setTimeout(() => {\n this.scrollX = 0\n this.scrollY = 0\n }, 300)\n\n // Prevent rapid-fire zoom behavior\n if (this.wheelActionTimeout !== null || this.isAnimating()) {\n return\n }\n\n if (Math.abs(event.deltaY) < Math.abs(event.deltaX)) {\n // handle horizontal scrolls with image moves\n this.scrollY = 0\n this.scrollX += event.deltaX\n\n const bigLeapX = xThreshold / 2\n // If the scroll amount has accumulated sufficiently, or a large leap was taken\n if (this.scrollX >= xThreshold || event.deltaX >= bigLeapX) {\n // Scroll right moves to next\n this.requestMoveNext(event)\n actionDelay = imageMoveDelay\n this.scrollX = 0\n } else if (this.scrollX <= -1 * xThreshold || event.deltaX <= -1 * bigLeapX) {\n // Scroll left moves to previous\n this.requestMovePrev(event)\n actionDelay = imageMoveDelay\n this.scrollX = 0\n }\n }\n\n // Allow successive actions after the set delay\n if (actionDelay !== 0) {\n this.wheelActionTimeout = this.setTimeout(() => {\n this.wheelActionTimeout = null\n }, actionDelay)\n }\n }", "function mouseWheel() {\n song.play();\n song.loop();\n song.volume(5);\n}", "handleOuterMousewheel(event) {\n // Prevent scrolling of the background\n event.stopPropagation();\n\n const xThreshold = WHEEL_MOVE_X_THRESHOLD;\n let actionDelay = 0;\n const imageMoveDelay = 500;\n\n this.clearTimeout(this.resetScrollTimeout);\n this.resetScrollTimeout = this.setTimeout(() => {\n this.scrollX = 0;\n this.scrollY = 0;\n }, 300);\n\n // Prevent rapid-fire zoom behavior\n if (this.wheelActionTimeout !== null || this.isAnimating()) {\n return;\n }\n\n if (Math.abs(event.deltaY) < Math.abs(event.deltaX)) {\n // handle horizontal scrolls with image moves\n this.scrollY = 0;\n this.scrollX += event.deltaX;\n\n const bigLeapX = xThreshold / 2;\n // If the scroll amount has accumulated sufficiently, or a large leap was taken\n if (this.scrollX >= xThreshold || event.deltaX >= bigLeapX) {\n // Scroll right moves to next\n this.requestMoveNext(event);\n actionDelay = imageMoveDelay;\n this.scrollX = 0;\n } else if (\n this.scrollX <= -1 * xThreshold ||\n event.deltaX <= -1 * bigLeapX\n ) {\n // Scroll left moves to previous\n this.requestMovePrev(event);\n actionDelay = imageMoveDelay;\n this.scrollX = 0;\n }\n }\n\n // Allow successive actions after the set delay\n if (actionDelay !== 0) {\n this.wheelActionTimeout = this.setTimeout(() => {\n this.wheelActionTimeout = null;\n }, actionDelay);\n }\n }", "function addWheelListener( elem, callback, useCapture ) {\n _addWheelListener( elem, support, callback, useCapture );\n\n // handle MozMousePixelScroll in older Firefox\n if( support == \"DOMMouseScroll\" ) {\n _addWheelListener( elem, \"MozMousePixelScroll\", callback, useCapture );\n }\n}", "function addWheelListener( elem, callback, useCapture ) {\n _addWheelListener( elem, support, callback, useCapture );\n\n // handle MozMousePixelScroll in older Firefox\n if( support == \"DOMMouseScroll\" ) {\n _addWheelListener( elem, \"MozMousePixelScroll\", callback, useCapture );\n }\n}", "function addMiddleWheelHandler() {\n container\n .on('mousedown', mouseDownHandler)\n .on('mouseup', mouseUpHandler);\n }", "function scrollWheel(e)\n{\n if (e.deltaY < 0)\n zoomValue = Math.min(zoomValue + 100, 1600);\n else if (e.deltaY > 0)\n zoomValue = Math.max(zoomValue - 100, 300);\n\n if (e.deltaY != 0)\n updateZoom();\n}", "function addMouseWheelHandler() {\n var prefix = '';\n\n var _addEventListener;\n\n if (window.addEventListener) {\n _addEventListener = \"addEventListener\";\n } else {\n _addEventListener = \"attachEvent\";\n prefix = 'on';\n } // detect available wheel event\n\n\n var support = 'onwheel' in document.createElement('div') ? 'wheel' : // Modern browsers support \"wheel\"\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least \"mousewheel\"\n 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\n\n var passiveEvent = g_supportsPassive ? {\n passive: false\n } : false;\n\n if (support == 'DOMMouseScroll') {\n document[_addEventListener](prefix + 'MozMousePixelScroll', MouseWheelHandler, passiveEvent);\n } //handle MozMousePixelScroll in older Firefox\n else {\n document[_addEventListener](prefix + support, MouseWheelHandler, passiveEvent);\n }\n }", "function addWheelListener(elem, callback, useCapture) {\n _addWheelListener(elem, support, callback, useCapture);\n\n // handle MozMousePixelScroll in older Firefox\n if (support == \"DOMMouseScroll\") {\n _addWheelListener(elem, \"MozMousePixelScroll\", callback, useCapture);\n }\n }", "function addMouseWheelHandler(){\r\n var prefix = '';\r\n var _addEventListener;\r\n\r\n if (window.addEventListener){\r\n _addEventListener = \"addEventListener\";\r\n }else{\r\n _addEventListener = \"attachEvent\";\r\n prefix = 'on';\r\n }\r\n\r\n // detect available wheel event\r\n var support = 'onwheel' in document.createElement('div') ? 'wheel' : // Modern browsers support \"wheel\"\r\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least \"mousewheel\"\r\n 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\r\n\r\n\r\n if(support == 'DOMMouseScroll'){\r\n document[ _addEventListener ](prefix + 'MozMousePixelScroll', MouseWheelHandler, false);\r\n }\r\n\r\n //handle MozMousePixelScroll in older Firefox\r\n else{\r\n document[ _addEventListener ](prefix + support, MouseWheelHandler, false);\r\n }\r\n }", "function addMouseWheelHandler(){\r\n var prefix = '';\r\n var _addEventListener;\r\n\r\n if (window.addEventListener){\r\n _addEventListener = \"addEventListener\";\r\n }else{\r\n _addEventListener = \"attachEvent\";\r\n prefix = 'on';\r\n }\r\n\r\n // detect available wheel event\r\n var support = 'onwheel' in document.createElement('div') ? 'wheel' : // Modern browsers support \"wheel\"\r\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least \"mousewheel\"\r\n 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\r\n\r\n\r\n if(support == 'DOMMouseScroll'){\r\n document[ _addEventListener ](prefix + 'MozMousePixelScroll', MouseWheelHandler, false);\r\n }\r\n\r\n //handle MozMousePixelScroll in older Firefox\r\n else{\r\n document[ _addEventListener ](prefix + support, MouseWheelHandler, false);\r\n }\r\n }", "function addMouseWheelHandler(){\r\n var prefix = '';\r\n var _addEventListener;\r\n\r\n if (window.addEventListener){\r\n _addEventListener = \"addEventListener\";\r\n }else{\r\n _addEventListener = \"attachEvent\";\r\n prefix = 'on';\r\n }\r\n\r\n // detect available wheel event\r\n var support = 'onwheel' in document.createElement('div') ? 'wheel' : // Modern browsers support \"wheel\"\r\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least \"mousewheel\"\r\n 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\r\n\r\n\r\n if(support == 'DOMMouseScroll'){\r\n document[ _addEventListener ](prefix + 'MozMousePixelScroll', MouseWheelHandler, false);\r\n }\r\n\r\n //handle MozMousePixelScroll in older Firefox\r\n else{\r\n document[ _addEventListener ](prefix + support, MouseWheelHandler, false);\r\n }\r\n }", "function addMouseWheelHandler(){\n var prefix = '';\n var _addEventListener;\n\n if (window.addEventListener){\n _addEventListener = \"addEventListener\";\n }else{\n _addEventListener = \"attachEvent\";\n prefix = 'on';\n }\n\n // detect available wheel event\n var support = 'onwheel' in document.createElement('div') ? 'wheel' : // Modern browsers support \"wheel\"\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least \"mousewheel\"\n 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\n\n\n if(support == 'DOMMouseScroll'){\n document[ _addEventListener ](prefix + 'MozMousePixelScroll', MouseWheelHandler, false);\n }\n\n //handle MozMousePixelScroll in older Firefox\n else{\n document[ _addEventListener ](prefix + support, MouseWheelHandler, false);\n }\n }", "function addMouseWheelHandler(){\n var prefix = '';\n var _addEventListener;\n\n if (window.addEventListener){\n _addEventListener = \"addEventListener\";\n }else{\n _addEventListener = \"attachEvent\";\n prefix = 'on';\n }\n\n // detect available wheel event\n var support = 'onwheel' in document.createElement('div') ? 'wheel' : // Modern browsers support \"wheel\"\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least \"mousewheel\"\n 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\n\n\n if(support == 'DOMMouseScroll'){\n document[ _addEventListener ](prefix + 'MozMousePixelScroll', MouseWheelHandler, false);\n }\n\n //handle MozMousePixelScroll in older Firefox\n else{\n document[ _addEventListener ](prefix + support, MouseWheelHandler, false);\n }\n }", "function addMouseWheelHandler(){\n var prefix = '';\n var _addEventListener;\n\n if (window.addEventListener){\n _addEventListener = \"addEventListener\";\n }else{\n _addEventListener = \"attachEvent\";\n prefix = 'on';\n }\n\n // detect available wheel event\n var support = 'onwheel' in document.createElement('div') ? 'wheel' : // Modern browsers support \"wheel\"\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least \"mousewheel\"\n 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\n\n\n if(support == 'DOMMouseScroll'){\n document[ _addEventListener ](prefix + 'MozMousePixelScroll', MouseWheelHandler, false);\n }\n\n //handle MozMousePixelScroll in older Firefox\n else{\n document[ _addEventListener ](prefix + support, MouseWheelHandler, false);\n }\n }", "function mousewheel() {\n start.apply(this, arguments);\n if (!d3_v3_behavior_zoomZooming) d3_v3_behavior_zoomZooming = d3_v3_behavior_zoomLocation(d3_v3.svg.mouse(d3_v3_behavior_zoomTarget));\n d3_v3_behavior_zoomTo(d3_v3_behavior_zoomDelta() + xyz[2], d3_v3.svg.mouse(d3_v3_behavior_zoomTarget), d3_v3_behavior_zoomZooming);\n }", "function normalizeWheel( /*object*/event) /*object*/{\n\t // Reasonable defaults\n\t var PIXEL_STEP = 10;\n\t var LINE_HEIGHT = 40;\n\t var PAGE_HEIGHT = 800;\n\t\n\t var sX = 0,\n\t sY = 0,\n\t // spinX, spinY\n\t pX = 0,\n\t pY = 0; // pixelX, pixelY\n\t\n\t // Legacy\n\t if ('detail' in event) {\n\t sY = event.detail;\n\t }\n\t if ('wheelDelta' in event) {\n\t sY = -event.wheelDelta / 120;\n\t }\n\t if ('wheelDeltaY' in event) {\n\t sY = -event.wheelDeltaY / 120;\n\t }\n\t if ('wheelDeltaX' in event) {\n\t sX = -event.wheelDeltaX / 120;\n\t }\n\t\n\t // side scrolling on FF with DOMMouseScroll\n\t if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) {\n\t sX = sY;\n\t sY = 0;\n\t }\n\t\n\t pX = sX * PIXEL_STEP;\n\t pY = sY * PIXEL_STEP;\n\t\n\t if ('deltaY' in event) {\n\t pY = event.deltaY;\n\t }\n\t if ('deltaX' in event) {\n\t pX = event.deltaX;\n\t }\n\t\n\t if ((pX || pY) && event.deltaMode) {\n\t if (event.deltaMode === 1) {\n\t // delta in LINE units\n\t pX *= LINE_HEIGHT;\n\t pY *= LINE_HEIGHT;\n\t } else {\n\t // delta in PAGE units\n\t pX *= PAGE_HEIGHT;\n\t pY *= PAGE_HEIGHT;\n\t }\n\t }\n\t\n\t // Fall-back if spin cannot be determined\n\t if (pX && !sX) {\n\t sX = pX < 1 ? -1 : 1;\n\t }\n\t if (pY && !sY) {\n\t sY = pY < 1 ? -1 : 1;\n\t }\n\t\n\t return {\n\t spinX: sX,\n\t spinY: sY,\n\t pixelX: pX,\n\t pixelY: pY\n\t };\n\t }", "function addMouseWheelHandler(){\r\n var prefix = '';\r\n var _addEventListener;\r\n\r\n if (window.addEventListener){\r\n _addEventListener = \"addEventListener\";\r\n }else{\r\n _addEventListener = \"attachEvent\";\r\n prefix = 'on';\r\n }\r\n\r\n // detect available wheel event\r\n var support = 'onwheel' in document.createElement('div') ? 'wheel' : // Modern browsers support \"wheel\"\r\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least \"mousewheel\"\r\n 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\r\n\r\n\r\n if(support == 'DOMMouseScroll'){\r\n document[ _addEventListener ](prefix + 'MozMousePixelScroll', MouseWheelHandler, false);\r\n }\r\n\r\n //handle MozMousePixelScroll in older Firefox\r\n else{\r\n document[ _addEventListener ](prefix + support, MouseWheelHandler, false);\r\n }\r\n }", "function normalizeWheel( /*object*/event) /*object*/{\n\t // Reasonable defaults\n\t var PIXEL_STEP = 10;\n\t var LINE_HEIGHT = 40;\n\t var PAGE_HEIGHT = 800;\n\n\t var sX = 0,\n\t sY = 0,\n\t // spinX, spinY\n\t pX = 0,\n\t pY = 0; // pixelX, pixelY\n\n\t // Legacy\n\t if ('detail' in event) {\n\t sY = event.detail;\n\t }\n\t if ('wheelDelta' in event) {\n\t sY = -event.wheelDelta / 120;\n\t }\n\t if ('wheelDeltaY' in event) {\n\t sY = -event.wheelDeltaY / 120;\n\t }\n\t if ('wheelDeltaX' in event) {\n\t sX = -event.wheelDeltaX / 120;\n\t }\n\n\t // side scrolling on FF with DOMMouseScroll\n\t if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) {\n\t sX = sY;\n\t sY = 0;\n\t }\n\n\t pX = sX * PIXEL_STEP;\n\t pY = sY * PIXEL_STEP;\n\n\t if ('deltaY' in event) {\n\t pY = event.deltaY;\n\t }\n\t if ('deltaX' in event) {\n\t pX = event.deltaX;\n\t }\n\n\t if ((pX || pY) && event.deltaMode) {\n\t if (event.deltaMode === 1) {\n\t // delta in LINE units\n\t pX *= LINE_HEIGHT;\n\t pY *= LINE_HEIGHT;\n\t } else {\n\t // delta in PAGE units\n\t pX *= PAGE_HEIGHT;\n\t pY *= PAGE_HEIGHT;\n\t }\n\t }\n\n\t // Fall-back if spin cannot be determined\n\t if (pX && !sX) {\n\t sX = pX < 1 ? -1 : 1;\n\t }\n\t if (pY && !sY) {\n\t sY = pY < 1 ? -1 : 1;\n\t }\n\n\t return {\n\t spinX: sX,\n\t spinY: sY,\n\t pixelX: pX,\n\t pixelY: pY\n\t };\n\t }", "DOMMouseScroll(evt) {\n this.fire(MouseWheelEvent, evt);\n }", "function addMouseWheelHandler(){\r\n var prefix = '';\r\n var _addEventListener;\r\n\r\n if (window.addEventListener){\r\n _addEventListener = \"addEventListener\";\r\n }else{\r\n _addEventListener = \"attachEvent\";\r\n prefix = 'on';\r\n }\r\n\r\n // detect available wheel event\r\n var support = 'onwheel' in document.createElement('div') ? 'wheel' : // Modern browsers support \"wheel\"\r\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least \"mousewheel\"\r\n 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\r\n var passiveEvent = g_supportsPassive ? {passive: false }: false;\r\n\r\n if(support == 'DOMMouseScroll'){\r\n document[ _addEventListener ](prefix + 'MozMousePixelScroll', MouseWheelHandler, passiveEvent);\r\n }\r\n\r\n //handle MozMousePixelScroll in older Firefox\r\n else{\r\n document[ _addEventListener ](prefix + support, MouseWheelHandler, passiveEvent);\r\n }\r\n }", "e_mouseScroll(e)\n\t{\n\t\t\n\t}", "_onWheelWhileResizing(evt) {\n evt.preventDefault();\n evt.stopPropagation();\n }" ]
[ "0.81449676", "0.7941387", "0.7910802", "0.7814185", "0.7757932", "0.7725161", "0.76599467", "0.76547253", "0.7554527", "0.75438136", "0.75340223", "0.74957687", "0.74697286", "0.7458841", "0.74546665", "0.7453565", "0.7447268", "0.7439002", "0.74034345", "0.739445", "0.737712", "0.7344032", "0.7325584", "0.7298124", "0.72904456", "0.7274051", "0.72401637", "0.7221794", "0.72094566", "0.71790946", "0.7178607", "0.7171001", "0.7161266", "0.7157613", "0.7157613", "0.7145356", "0.71364486", "0.7132832", "0.7122605", "0.7121313", "0.71195626", "0.7116809", "0.7116809", "0.7113742", "0.71077335", "0.71077335", "0.71077335", "0.7101293", "0.7085047", "0.7074131", "0.70670855", "0.70539737", "0.7040901", "0.7036519", "0.7017898", "0.70067275", "0.6997857", "0.6977447", "0.694413", "0.69406927", "0.6919282", "0.68917215", "0.68794745", "0.6855592", "0.68262696", "0.6824082", "0.6824082", "0.6824082", "0.682171", "0.6808211", "0.6808211", "0.6808211", "0.6808211", "0.6760697", "0.6747575", "0.6725711", "0.6685224", "0.6673223", "0.66728014", "0.66427404", "0.6639272", "0.6624136", "0.6624136", "0.66127706", "0.6610877", "0.6565881", "0.656156", "0.6554734", "0.6554734", "0.6554734", "0.6549953", "0.6549953", "0.6549953", "0.6543524", "0.65258586", "0.6523083", "0.6522886", "0.6508235", "0.649302", "0.6492639", "0.64914984" ]
0.0
-1
Draws a crease line, updates on Crease Point input change
function drawCrease(input) { if (line) { scene.remove(line); } var points = getCreaseInputs(input); if(isValidCrease(input) === false){ return; } line_geometry = new THREE.Geometry(); line_geometry.vertices.push(points[0], points[1]); line = new THREE.Line(line_geometry, lineMaterial); scene.add(line); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawline() {\n\n if (isDrawing) {\n linePoint2 = d3.mouse(this);\n gContainer.select('line').remove();\n gContainer.append('line')\n .attr(\"x1\", linePoint1.x)\n .attr(\"y1\", linePoint1.y)\n .attr(\"x2\", linePoint2[0] - 2) //arbitary value must be substracted due to circle cursor hover not working\n .attr(\"y2\", linePoint2[1] - 2); // arbitary values must be tested\n\n }\n }", "function draw (event) {\n // update controls\n controls.updateAll()\n \n // Am I drawning?\n if (!isDrawning) return;\n\n \n\n // basic init style of line, in case of it's no control\n // context.lineWidth = 5;\n // context.strokeStyle = 'red'\n context.lineCap = 'round'\n\n\n\n // drawning the line geting mouse position\n context.lineTo(event.clientX, event.clientY)\n context.stroke() // visualize the line\n\n // I need to start small circle and update his position\n // to get more round line\n context.beginPath()\n context.moveTo(event.clientX, event.clientY)\n }", "function drawLine() {\n\t\t// Si début du dessin : initialisation\n\t\tif(!started) {\n\t\t\tcontext.beginPath();\n\t\t\tcontext.moveTo(cursorX, cursorY);\n\t\t\tstarted = true;\n\t\t}\n\t\t//Sinon, je dessine\n\t\telse {\n\t\t\tcontext.lineTo(cursorX, cursorY);\n\t\t\tcontext.lineWidth = width_brush;\n\t\t\tcontext.stroke();\n\t\t}\n\t}", "function updateLine(line, fromX, fromY, toX, toY) {\n\n line.graphics.clear();\n line.graphics.alpha = 1.0;\n line.graphics.setStrokeStyle(1);\n line.graphics.beginStroke(color.GRAY);\n line.graphics.moveTo(fromX, fromY);\n line.graphics.lineTo(toX, toY);\n line.graphics.endStroke();\n}", "drawLine() {\n ctx.moveTo(this.u0, this.v0);\n ctx.lineTo(this.u1, this.v1);\n ctx.stroke();\n }", "function drawLine() {\n\tif (insideCanvas && drawingMode) {\n\t\tcontext.beginPath();\n\t\tcontext.moveTo(prevX, prevY);\n\t\tcontext.lineTo(currX, currY);\n\t\tcontext.stroke();\n\t\tcontext.closePath();\n\t}\n}", "function drawLine() {\n context.moveTo(points[0].x, points[0].y); \n for (var i=0;i< points.length-1; i++) {\n //draws the line\n context.lineTo(points[i].x, points[i].y);\n context.stroke();\n //begins a path\n\t\t context.beginPath();\n\t\t //arc function makes circle shaped pointer\n\t\t context.arc(points[i].x, points[i].y, points[i].size, 0, Math.PI*2);\n\t\t context.fill();\n\t\t context.beginPath();\n context.moveTo(points[i].x, points[i].y);\n context.stroke();\n } \n}", "function drawLine() {\n ctx.beginPath();\n // handle simple clicks\n if (points.length == 1) {\n y2 += simple_click_offset;\n }\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.closePath();\n}", "function draw() {\r\n if (mousedown) {\r\n document.getElementById('myCanvas').innerHTML = makeLine(lineSize);\r\n }\r\n}", "draw() {\n\n this.drawInteractionArea();\n\n //somewhat depreciated - we only really draw the curve interaction but this isnt hurting anyone\n if(lineInteraction)\n this.drawLine();\n else\n this.drawCurve();\n\n this.drawWatch(); \n\n }", "draw(){\n this.ctx.strokeStyle = this.getStrokeColor();\n this.ctx.lineWidth = 2;\n this.ctx.beginPath()\n this.ctx.moveTo(this.prevx, this.prevy);\n this.ctx.lineTo(this.x, this.y)\n this.ctx.stroke()\n this.ctx.fill();\n }", "function drawLine(P0, P1, line, color, stage) {\r\n line.graphics.setStrokeStyle(2).beginStroke(color);\r\n line.graphics.moveTo(P0.x, P0.y);\r\n line.graphics.lineTo(P1.x, P1.y).endStroke();\r\n stage.update();\r\n}", "function draw_first_line(){\n points.push(start);\n points.push(end);\n}", "function pointLineaire() {\n\tpoint1 = board.create('point', [1, (ordonnee + pente)], {\n\t\tstyle : 6,\n\t\tname : 'p1'\n\t});\n\tpoint1.setAttribute({\n\t\tstrokeColor : 'blue',\n\t\tfillColor : 'yellow',\n\t\tsize : 4\n\t});\n\tpoint2 = board.create('point', [(ordonnee / -pente), 0], {\n\t\tstyle : 6,\n\t\tname : 'p2'\n\t});\n\tpoint2.setAttribute({\n\t\tstrokeColor : 'blue',\n\t\tfillColor : 'yellow',\n\t\tsize : 4\n\t});\n\tpoint3 = board.create('point', [0, (ordonnee)], {\n\t\tvisible : false,\n\t\tstyle : 6\n\t});\n\tvar ligne = board.create('line', [point1, point2]);\n\t// affichage dynamique de l'équation à l'extérieur du graphe\n\tboard.on('update', function() {\n\t\tdocument.getElementById('equationGraph').innerHTML = \"y = \" + dynamiqueA() + 'x + ' + dynamiqueB();\n\t});\n\t//creation triangle de la pente pour equation de premier degree/\n\ttriangle = board.create('slopetriangle', [ligne, point1], {\n\t\tvisible : false\n\t});\n\ttriangle.label.setAttribute({\n\t\tvisible : false\n\t});\n\taffichageEquationLineairePoint(point1, point2);\n\tdocument.getElementById(\"equationGraph\").innerHTML = \" Équation linéaire: y = \" + pente + \"x\" + \" + \" + ordonnee;\n\tmisajour();\n}", "function draw_line(e){\n\n //console.log(\"PrevX:\"+prevX);\n draw_dot(e);\n \n ctx.lineTo(e.offsetX,e.offsetY);\n \n ctx.stroke();\n\n //console.log(\"PrevX:\"+prevX);\n}", "function drawLine(fromX, fromY, toX, toY) {\n\n var line = new createjs.Shape();\n updateLine(line, fromX, fromY, toX, toY);\n stage.addChild(line);\n\n return line;\n}", "canvasDraw() {\n let prev = this.p0;\n for (const point of this.points) {\n Point.drawLine(prev, point, false, this.isSelected, this.color);\n prev = point;\n }\n Point.drawLine(prev, this.p3);\n Point.drawLine(this.p0, this.p1, true);\n Point.drawLine(this.p2, this.p3, true);\n this.p0.draw();\n this.p1.draw();\n this.p2.draw();\n this.p3.draw();\n }", "drawPoint(p) {\n if (this.connectWithPrev) {\n p.line(\n 0,\n 0,\n this.prevPos.x - this.pos.x,\n this.prevPos.y - this.pos.y\n );\n } else {\n p.point(0, 0);\n }\n }", "function startLine(e){\n\t\t\tcontext.beginPath();\n\t\t\tcontext.strokeStyle = \"black\";\n\t\t\tcontext.lineCap = \"round\";\n\t\t\tcontext.lineWidth = 5;\n\t\t\tcontext.moveTo(e.clientX - theCanvas.offsetLeft, e.clientY - theCanvas.offsetTop);\n\t\t}", "drawLineFunction(){\n //Using the pre set variables (this.) from the constructor, this.fillcolour will equal to the random values of this.Green/Red/Blue/Alpha\n this.fillcolour = color(this.Red, this.Green, this.Blue, this.Alpha);\n fill(this.fillcolour);//This then fills a line with the a random colour \n stroke(this.fillcolour);//This then fills a lines stroke with the a random colour \n \n //This creates a new operator (this.x2) and maps it to the value of x1 with a range of 0 to width to width to 0.\n this.x2 = map(this.x1, 0, width, width, 0);\n //This creates a new operator (this.y2) and maps it to the value of y1 with a range of 0 to height to height to 0.\n this.y2 = map(this.y1, 0, height, height, 0);\n \n //this is creating the lines and their partners to refelect\n line(this.x1, this.y1, this.size, this.size);\n line(this.x2, this.y2, this.size, this.size);\n line(this.x2, this.y1, this.size, this.size);\n line(this.x1, this.y2, this.size, this.size);\n \n }", "function drawStart(e)\n\t{\n\t\tcurves = createCurves()\n\t\taddPoint(e)\n\t}", "function drawLine(name,x0, y0, x1, y1, thickness, color, emit){\n listOfCanvas[name].context.beginPath();\n\t\tlistOfCanvas[name].context.globalCompositeOperation=\"source-over\";\n\t\tlistOfCanvas[name].context.moveTo((x0 + $(\"#canvasContainer\" + listOfCanvas[name].container).scrollLeft()), y0);\n\t\tlistOfCanvas[name].context.lineTo((x1 + $(\"#canvasContainer\" + listOfCanvas[name].container).scrollLeft()), y1);\n\t\tlistOfCanvas[name].context.strokeStyle = color;\n\t\tlistOfCanvas[name].context.lineWidth = thickness*scale;\n\t\tlistOfCanvas[name].context.stroke();\n listOfCanvas[name].context.closePath();\n }", "function draw(e) {\n if (!isDrawing) return;\n ctx.beginPath(); //start line path\n ctx.moveTo(X, Y);\n ctx.lineTo(e.offsetX, e.offsetY);\n ctx.stroke();\n [X, Y] = [e.offsetX, e.offsetY]; //define coords\n }", "function point() {\n ctx.beginPath();\n ctx.arc(mouse.x, mouse.y, 0.01, 0, 2 * Math.PI, false);\n //ctx.moveTo(mouse.x, mouse.y);\n //ctx.lineTo(mouse.x+0.01, mouse.y+0.01);\n ctx.strokeStyle = currentColor;\n ctx.lineWidth = brushSize;\n ctx.stroke();\n }", "update(pose) {\n console.log(\"new pose: \", pose);\n\n var newpose = this.translate(pose);\n\n if (this.last) {\n var g = new PIXI.Graphics();\n g.lineStyle(4, 0xffd900, 1);\n g.moveTo(this.last.x, this.last.y);\n g.lineTo(newpose.x, newpose.y);\n this.stage.addChild(g);\n }\n\n this.last = newpose;\n }", "function draw ( ){\n // Parse fields\n fields = splitTokens( lines[lineNo], \",\" ) ;\n var lat = float ( fields[1] ) ;\n var lon = float ( fields[2] ) ;\n var pdop = float ( fields[6] ) ; // pdop for this fix\n \n // Scale lat and lon -- could be backwards, flipped, etc?\n var y = map( lat, minLat, maxLat, 0, height ) ;\n var x = map ( lon, minLon, maxLon, 0, width ) ;\n var p = map ( pdop, 0, 10, 0, 100 ) ;\n \n // Capture the newest data point\n var dp = new DataPoint ( x, y, p) ;\n \n // Plot the points in the current window\n plotCurrentWindow ( dp ) ;\n \n // Go until we run out of input lines\n if ( lineNo < lines.length )\n {\n lineNo ++ ;\n }\n}", "function drawLine(e, clientX, clientY) {\r\n e.preventDefault();\r\n var rect = ctx.canvas.getBoundingClientRect();\r\n line.push([clientX, clientY]);\r\n for (i = 1; i <= line.length - 1; i++) {\r\n ctx.beginPath();\r\n\r\n //Set starting point for new line\r\n ctx.moveTo(line[i - 1][0], line[i - 1][1]);\r\n\r\n //Set thick red line style\r\n ctx.lineWidth = 5;\r\n ctx.strokeStyle = \"rgba(255,0,0, .5)\";\r\n ctx.fillStyle = \"#FF0000\";\r\n\r\n //Create line from last point to new point\r\n ctx.lineTo(line[i][0], line[i][1]);\r\n //Draw line\r\n ctx.stroke();\r\n }\r\n }", "drawLine(x1,y1,x2,y2){\n ctx.beginPath();\n ctx.moveTo(x1,y1);\n ctx.lineTo(x2,y2);\n ctx.strokeStyle = this.dragFill;\n ctx.lineWidth = 5;\n ctx.stroke();\n }", "function drawLine() {\n // if one point isn't on the plane, do not draw a line\n if (pt1.pinned && plane.getContext) {\n let ctx = plane.getContext('2d');\n ctx.beginPath();\n ctx.strokeStyle = 'rgb(45, 166, 87)';\n // when pt2 is not pinned, line is dotted\n if (!pt2.pinned) {\n ctx.setLineDash([5, 5]);\n // moving dotted line animation\n ctx.lineDashOffset -= .25;\n }\n ctx.lineWidth = 3;\n // we want the line to extend past the points up to the edges of the plane\n // therefore we need the canvas boundary intercepts\n let boundInt = getPlaneBoundaryIntercepts();\n ctx.moveTo(boundInt.xBoundary1, boundInt.yBoundary1);\n ctx.lineTo(boundInt.xBoundary2, boundInt.yBoundary2);\n ctx.stroke();\n // reset line dash to be solid\n ctx.setLineDash([]);\n }\n}", "function drawLine(){\n if(mouseDown){\n c.beginPath();\n c.strokeStyle = 'rgba(0,0,0, 0.75)'; \n c.moveTo(ballX + (ballRadius/2), ballY + (ballRadius/2));\n c.lineTo(mouseX, mouseY);\n c.lineWidth = \"2\";\n c.stroke();\n }\n}", "function userDraw()\n{\n con.beginPath();\n con.lineCap = \"round\";\n con.lineJoin = \"round\";\n con.lineWidth = brushRadius * 4;\n con.moveTo(oldx, oldy);\n con.lineTo(newx, newy);\n con.closePath();\n con.fill();\n con.stroke();\n}", "function DrawLine(point1, point2)\n{\n\tvar color=0x47474F;\n\tvar size=1;\n\te.lineStyle(size, color);\n\te.moveTo(point1.x + mapOrigin.x,point1.y + mapOrigin.y);\n\te.lineTo(point2.x + mapOrigin.x,point2.y + mapOrigin.y);\n\te.endFill();\n}", "function uploadLine() {\n // handle simple clicks\n if (points.length == 1) {\n points.push([points[0][0], points[0][1] + simple_click_offset])\n }\n request([global.EVENTS.DRAW_LINE, [simplify(points, drawing_simplification_tolerance, drawing_highquality),\n draw_color, line_width]]);\n}", "function draw_line(p1, p2) {\n var dist = Math.sqrt((p1.x - p2.x) * (p1.x - p2.x)\n + (p1.y - p2.y) * (p1.y - p2.y));\n var line = document.createElement(\"div\");\n line.className = \"line\";\n line.style.width = dist + \"px\";\n line.style.backgroundColor = \"#bbbbbb\";\n lines_div.appendChild(line);\n var m = (p1.y - p2.y) / (p1.x - p2.x);\n var ang = Math.atan(m);\n var ps = [p1, p2];\n var left = ps[0].x < ps[1].x ? 0 : 1;\n var top = ps[0].y < ps[1].y ? 0 : 1;\n if (left == top) {\n line.style.transformOrigin = \"top left\";\n line.style.left = ps[left].x + 2.5 + \"px\";\n line.style.top = ps[top].y + 2.5 + \"px\";\n line.style.transform = \"rotate(\" + ang + \"rad)\";\n }\n else {\n line.style.transformOrigin = \"bottom left\";\n line.style.left = ps[left].x + 2.5 + \"px\";\n line.style.top = ps[1 - top].y + 2.5 + \"px\";\n line.style.transform = \"rotate(\" + ang + \"rad)\";\n }\n}", "function draw_center_line(point1,point2)\r\n\t{\r\n\t\tcenter_line = new Path.Line(point1,point2);\r\n\t\tcenter_line.strokeWidth = 4;\r\n\t\tcenter_line.strokeColor = 'white';\r\n\t\tcenter_line.dashArray = [10,4];\r\n\t}", "update(x, y, point) {\n\t \tlet constructor = this;\n\t\tmoveAt(x, y, point); \t\n\t\tfunction moveAt(x, y, point) {\n\t\t\tif (point == \"start\") {\n\t\t\t constructor.x1 = x;\n\t\t\t constructor.y1 = y;\n\t\t\t constructor.line.setAttribute('x1', x);\n\t\t\t constructor.line.setAttribute('y1', y);\n\t\t\t}\n\t\t\telse {\n\t\t\t constructor.x2 = x;\n\t\t\t constructor.y2 = y;\n\t\t\t\tconstructor.line.setAttribute('x2', x);\n\t\t\t constructor.line.setAttribute('y2', y);\n\t\t\t}\n\t\t}\n\t}", "static draw(){\n switch (drawType){\n case 'Quadratic':\n if (startX === undefined && startY === undefined){ //If Start Point missing, then create\n startX = mouseX;\n startY = mouseY;\n } else {//If Start Point already created, then create Finish Point\n ctxShadow.beginPath();//Create line between points\n ctxShadow.moveTo(startX, startY);\n ctxShadow.lineTo(mouseX, mouseY);\n ctxShadow.stroke();\n\n QuadraticSFP[j] = new LineB(startX, startY, mouseX, mouseY);//Save Finish and Start points coordinates\n\n startX = mouseX;//Finish point for last = Start point for next\n startY = mouseY;\n\n let CPX = (QuadraticSFP[j].bezXFinish + QuadraticSFP[j].bezXStart)/2;//X and Y coordinates of line center\n let CPY = (QuadraticSFP[j].bezYFinish + QuadraticSFP[j].bezYStart)/2; \n\n CPQ[j] = new CircleB(new Point(CPX, CPY), 5);\n\n quadraticHelpingLines(j);\n\n CircleB.draw(CPQ[j]); \n\n j++; \n }\n break;\n }\n }", "draw () {\n this.dotCircle.remove()\n this.dotCircle = this.getDotCircle(this.point, this.thickness, this.color)\n\n this.dotToLine.removeSegments()\n this.dotToLine.add(this.point, this.iPoint)\n\n this.fillingDotToLine.removeSegments()\n this.fillingDotToLine.add(this.point)\n\n const point = this.dotToLine.getLocationAt(this.dotToLine.length * this.fillingProgress)\n this.fillingDotToLine.add(point)\n }", "show () {\n stroke(255);\n line(this.initial.x, this.initial.y, this.final.x, this.final.y)\n }", "function draw() {\n if (mouseIsPressed) {\n stroke(currentColor);\n strokeWeight(currentStroke)\n line(mouseX, mouseY, pmouseX, pmouseY);\n }\n}", "drawLine(){\n for (var index in this.draw){\n this.draw[index] = this.fracToPixel(this.draw[index])\n }\n canvas.beginPath();\n canvas.moveTo(this.draw[\"rightX\"],this.draw[\"rightY\"]);\n canvas.lineTo(this.draw[\"leftX\"],this.draw[\"leftY\"]);\n canvas.stroke();\n }", "drawLineCanvas() {\n var minimumLineWidth = 25;\n var maximumLineWidth = 100;\n var lineWidthRange = maximumLineWidth - minimumLineWidth;\n var maximumSpeed = 50;\n \n this.lineCanvasContext.clearRect(0, 0, this.lineCanvas.width, this.lineCanvas.height);\n this.lineCanvasContext.lineCap = 'round';\n this.lineCanvasContext.shadowBlur = 30;\n this.lineCanvasContext.shadowColor = '#FFF';\n \n for (var i = 1; i < this.state.points.length; i++) {\n var point = this.state.points[i];\n var previousPoint = this.state.points[i - 1];\n \n // Change line width based on speed\n var distance = this.getDistanceBetween(point, previousPoint);\n var speed = Math.max(0, Math.min(maximumSpeed, distance));\n var percentageLineWidth = (maximumSpeed - speed) / maximumSpeed;\n this.lineCanvasContext.lineWidth = minimumLineWidth + percentageLineWidth * lineWidthRange;\n \n // Fade points as they age\n var age = Date.now() - point.time;\n var opacity = (this.pointLifetime - age) / this.pointLifetime;\n this.lineCanvasContext.strokeStyle = 'rgba(0, 0, 0, ' + opacity + ')';\n \n this.lineCanvasContext.beginPath();\n this.lineCanvasContext.moveTo(previousPoint.x, previousPoint.y);\n this.lineCanvasContext.lineTo(point.x, point.y);\n this.lineCanvasContext.stroke();\n }\n }", "draw() {\n var p = window.p;\n\n let col= this.col ? this.p.color(this.col.r, this.col.g , this.col.b) : this.p.color(255,255,255);\n\n //we draw line\n this.p.stroke(col); //it's for campability with old clients\n this.p.strokeWeight(this.sw);\n this.p.line(this.a.x, this.a.y, this.b.x, this.b.y);\n\n }", "render() {\n this.ctx.save();\n this.ctx.strokeStyle = this.penColor;\n this.ctx.lineWidth = this.size;\n this.ctx.lineCap = \"round\";\n const [first, ...rest] = this.points;\n this.ctx.beginPath();\n this.ctx.moveTo(first.x, first.y);\n rest.forEach((point) => this.ctx.lineTo(point.x, point.y));\n this.ctx.stroke();\n this.ctx.restore();\n }", "_drawLine(points, group) {\n const self = this;\n const path = self._getPath(points);\n const line = self.line;\n group.addShape('path', {\n attrs: assign({\n path\n }, line)\n });\n }", "function drawPointsChanged() {\n if (!drawPoints) {\n drawPoints = true\n } else {\n drawPoints = false\n };\n renderJob1.renderText();\n }", "function guideLine(){\n ctx.beginPath();\n ctx.moveTo(300, 300);\n ctx.lineTo(0, 300);\n ctx.lineTo(200, 200);\n ctx.closePath();\n ctx.fillStyle = \"gold\";\n ctx.fill();\n}", "function drawLine(x, y, e) {\n // Set up the path stuff\n context.beginPath();\n context.moveTo(cur_x, cur_y);\n\n // Set the new new location.\n var shift = e.shiftKey;\n cur_x += 3 * x * (shift ? 4 : 1);\n cur_y += 3 * y * (shift ? 4 : 1);\n\n // Set the rotation of the knobs.\n rot_x += 1 * x;\n rot_y += 1 * y;\n\n // Limit!\n if(cur_x <= 0) {\n cur_x = 0;\n } else if(cur_y <= 0) {\n cur_y = 0;\n } else if(cur_x >= 700) {\n cur_x = 700;\n } else if(cur_y >= 400) {\n cur_y = 400;\n }\n\n // Set the direction the user is currently drawing.\n var new_direction = x + \"--\" + y;\n if(current_direction != new_direction) {\n // New direction, so we need to add a new line.\n i++;\n current_direction = new_direction;\n }\n // Update or add a new line.\n path[i] = [cur_x, cur_y];\n\n // Rotate the knob (Fx only so far).\n $('.knob_l').css('-moz-transform', 'rotate(' + rot_x * 50 + 'deg)');\n $('.knob_r').css('-moz-transform', 'rotate(' + rot_y * 50 + 'deg)');\n\n // Draw the line and stroke it.\n context.lineTo(cur_x, cur_y);\n context.closePath();\n context.stroke();\n\n /* TODO: Make this async! */\n if(has_local_storage){\n window.localStorage['path'] = getHash();\n }\n\n // Reset hash\n window.location.hash = '';\n}", "function drawHere(e, canvas, isLine){\n var mouseX = e.pageX - canvas.offsetLeft;\n var mouseY = e.pageY - canvas.offsetTop;\n\tif(isLine == 'line'){\n doTo(['all'], 'draw', myColor, pastX, pastY, mouseX, mouseY);\n\t}else{\n doTo(['all'], 'draw', myColor, mouseX -1, mouseY, mouseX, mouseY);\n\t}\n\tpastX = mouseX;\n\tpastY = mouseY;\n}", "function paddle(){\r\n stroke(\"black\");\r\n strokeWeight(10);\r\n line(mouseX,mouseY-20,mouseX,mouseY+20);\r\n}", "draw() {\n //draw the pen trace\n let colour = colourPicker.selectedColour;\n let p5Colour = p5Instance.color(colour.r, colour.g, colour.b, colour.a);\n this.command.context.chain.stroke(p5Colour);\n super.draw();\n\n this.command.context.chain.push();\n\n //draw the mouse pointer\n this.command.context.chain.strokeWeight(1);\n this.command.context.chain.circle(\n this.command.context.chain.mouseX,\n this.command.context.chain.mouseY,\n this.command.thickness,\n );\n this.command.context.chain.pop();\n }", "function updateDrawingLineOfAPeer(oldLineObj, newLineObj) {\n oldLineObj.set({\n x2: (newLineObj.x1 < 0) ? newLineObj.left + newLineObj.width : newLineObj.left ,\n y2: (newLineObj.y1 < 0) ? newLineObj.top + newLineObj.height : newLineObj.top\n });\n}", "function mouseoverTrainLine() {\n var lineID = d3.select(this).attr(\"id\");\n d3.select(this).attr(\"style\", \"cursor:pointer\");\n\n var circleID = lineID.replace(\"line\", \"circle\");\n var circle = d3.select(\"#\" + circleID);\n\n if ((popupOpen && circleID != currentCircleID) || editting)\n return;\n\n currentCircleID = circleID;\n currentCircle = circle;\n\n // currentCircle\n // .transition().duration(200)\n // .attr(\"style\", \"cursor:pointer\")\n // .attr(\"r\", 5);\n\n defineChangesFromLine(circleID);\n\n popupOpen = true;\n\n // updatePopupCircleSize(currentCircle);\n // updatePopupCircleContent();\n}", "function Line(type){\n this.type = type;\n this.position = {\n x1: null, x2: null, y1: null, y2: null\n };\n this.init = function(){\n this.coordinate.hover(true);\n this.coordinate.show(true)\n artboard.on('mousedown',function(e){\n var data = {};\n \n if(e.originalEvent.detail == 2){\n this.clearPosition();\n data.plot = false;\n }\n else\n {\n ($(e.target).hasClass('coordinate') ? \n\n (\n data.x = Number($(e.target).attr('data-x')) + 2 ,\n data.y = Number($(e.target).attr('data-y')) + 2,\n data.plot = false\n ) \n\n :\n\n ( data.x = e.offsetX, data.y = e.offsetY, data.plot = true)\n\n );\n\n data.isFirst = true;\n data.event = e;\n\n if(this.position.x1 == null)\n {\n this.position.x1 = data.x;\n this.position.y1 = data.y;\n }\n else\n {\n this.position.x2 = data.x;\n this.position.y2 = data.y;\n data.isFirst = false;\n }\n\n this.exe(data);\n }\n \n }.bind(this));\n \n }\n this.fin = function(){\n this.coordinate.hover(false);\n this.clearPosition();\n this.coordinate.show(false);\n artboard.off('mousedown');\n } \n }", "drawAppropriateLine() {\n const { width, color } = this._getLineStyle();\n this.graphics.lineStyle(width, color);\n\n if (this.lineType === EConnectionLineType.SOLID\n || this.lineType === EConnectionLineType.NODATA) {\n\n if (this.drawLineType === EConnectionDrawLineType.STRAIGHT){\n this.drawLine(this.pointA, this.pointB);\n } else {\n this.drawBezier(this.pointA, this.controlPointA, this.controlPointB, this.pointB);\n } \n\n } else {\n this.drawDottedLine();\n }\n\n if (this._selectable) {\n this._setHitArea();\n }\n }", "function myDraw(t,duration) {\n let p = t/duration;\n let g = (1-p)*100\n \n for (let i=1;i<points.length;i++) {\n let f = (i/points.length)*100\n stroke(g,f,100);\n let v11 = points[i-1]; \n let v12 = points[i];\n let v21 = points2[i-1]\n let v22 = points2[i]\n let v1 = p5.Vector.add(v11.copy().mult(p),v21.copy().mult(1-p));\n let v2 = p5.Vector.add(v12.copy().mult(p),v22.copy().mult(1-p));\n line(v1.x,cy(v1.y),v2.x,cy(v2.y)); // the moving line\n }\n}", "function onclick(e){\n if (ONSCREEN && STAGE == 1){\n if (DRAWING){\n // set end point\n let l = Lines[Lines.length-1]\n l.end = new Point(Math.round(EX), Math.round(EY), COLOR)\n\n }else{\n // Start new line\n let l = new Line(new Point(Math.round(EX), Math.round(EY), COLOR), null, COLOR)\n Lines.push(l)\n }\n }\n}", "display() {\n fill(this.color);\n\n triangle(this.x, this.y, this.x + 30, this.y - 55, this.x + 60, this.y);\n strokeWeight(7); //important for line to be visible\n strokeCap(SQUARE);\n stroke(this.color);\n\n //levitating line\n line(this.x, this.lineY - 30, this.x + 60, this.lineY - 30);\n\n //little eyes\n strokeWeight(3);\n stroke(\"white\");\n line(this.x + 10, this.y - 10, this.x + 20, this.y - 10);\n line(this.x + 30, this.y - 10, this.x + 40, this.y - 10);\n\n noStroke(); //reset so stroke doesn't carry into other creatures\n }", "show() {\n strokeWeight(3);\n stroke(this.clr);\n line(this.posx, this.posy, this.endx, this.endy);\n this.posx = this.endx;\n this.posy = this.endy;\n }", "function drawLines() {\n}", "function drawLines() {\n}", "function line_basic_draw(cxt, movex, movey, linex, liney, lineWidth, color) {\n cxt.beginPath();\n cxt.lineWidth = lineWidth;\n cxt.strokeStyle = color;\n cxt.moveTo(movex, movey);\n cxt.lineTo(linex, liney);\n cxt.closePath();\n cxt.stroke();\n}", "function addPoint(event){\n\t//Nao permite adicionar pontos se nao houver linhas\n\tif(qttCurves == 0){\n\t\talert(\"Crie uma curva para adicionar pontos.\")\n\t\treturn;\n\t}\n\n\tvar mouseX = event.offsetX, mouseY = event.offsetY;\n\tlet pointClass = \"p\" + selCurve;\n\n\t//Criacao de pontos\n\tlet color;\n\tif(pointCB.checked) color = \"green\";\n\telse color = \"transparent\";\n\tvar c = document.createElementNS(web, \"circle\");\n\tc.setAttribute(\"cx\", mouseX);\n\tc.setAttribute(\"cy\", mouseY);\n\tc.setAttribute(\"r\", \"6\");\n\tc.setAttribute(\"fill\", color);\n\tc.setAttribute(\"class\", pointClass);\n\tmainCanvas.appendChild(c);\n\n\tvar points = getPoints();\n\t//Criacao de linhas\n\tif(points.length > 1){\n\t\tmakeLine(points[points.length-2].getAttribute('cx'), points[points.length-2].getAttribute('cy'), mouseX, mouseY);\n\t}\n\n\tdeleteBezier();\n\tmakeBezier(apb[selCurve]);\n}", "updateDrawLine(pointer, x, y) {\n if (!this.isSelecting) {\n return\n }\n\n var tw = (this.tileWidth * this.firstLetter.worldScale.x) / 2\n var th = (this.tileHeight * this.firstLetter.worldScale.y) / 2\n\n this.drawLine.clear()\n this.drawLine.lineStyle(\n this.drawLineThickness,\n this.drawLineColor,\n this.drawLineAlpha\n )\n this.drawLine.moveTo(\n this.firstLetter.worldPosition.x + tw,\n this.firstLetter.worldPosition.y + th\n )\n this.drawLine.lineTo(x, y)\n }", "function makeLine(x1, y1, x2, y2){\n\tlet color;\n\tlet lineClass = \"l\" + selCurve;\n\tif(lineCB.checked) color = \"#a832a0\";\n\telse color = \"#00000000\";\n\tvar l = document.createElementNS(web, \"line\");\n\tl.setAttribute(\"x1\", x1);\n\tl.setAttribute(\"y1\", y1);\n\tl.setAttribute('x2', x2);\n\tl.setAttribute('y2', y2);\n\tl.setAttribute('style', 'stroke : ' + color + '; stroke-width : 2');\n\tl.setAttribute(\"class\", lineClass);\n\tmainCanvas.appendChild(l);\n}", "function trackLine(evt, point) {\n if (!your_turn_to_draw) {\n return;\n }\n else if (evt == 'start') {\n x2 = point[0] - canvas.offsetLeft + window.pageXOffset;\n y2 = point[1] - canvas.offsetTop + window.pageYOffset;\n x1 = x2;\n y1 = y2;\n ctx.strokeStyle = draw_color;\n ctx.lineWidth = line_width;\n points.push([x2, y2]);\n currently_drawing = true;\n drawing_timeout_id = setTimeout(uploadPartialLine,\n drawing_upload_interval);\n }\n else if (evt == 'stop' && currently_drawing) {\n currently_drawing = false;\n clearTimeout(drawing_timeout_id);\n // handle simple clicks\n if (points.length == 1) {\n drawLine();\n }\n uploadLine();\n points = [];\n }\n else if (evt == 'move' && currently_drawing) {\n x1 = x2;\n y1 = y2;\n x2 = point[0] - canvas.offsetLeft + window.pageXOffset;\n y2 = point[1] - canvas.offsetTop + window.pageYOffset;\n points.push([x2, y2]);\n drawLine();\n }\n}", "scratchLine(x, y, fresh) {\n const drawctx = this.canvas[0].draw.getContext('2d');\n const strokectx = this.strokeCanvas.getContext('2d');\n\n drawctx.lineWidth = strokectx.lineWidth = this.brushSize;\n drawctx.lineCap = drawctx.lineJoin = strokectx.lineCap = strokectx.lineJoin = 'round';\n\n drawctx.strokeStyle = '#fff'; // can be any opaque color\n strokectx.strokeStyle = '#000';\n\n if (fresh) {\n drawctx.beginPath();\n strokectx.beginPath();\n\n // this +0.01 hackishly causes Linux Chrome to draw a\n // \"zero\"-length line (a single point), otherwise it doesn't\n // draw when the mouse is clicked but not moved\n // Plus 1 for the border\n\n drawctx.moveTo(x+0.01+1, y);\n strokectx.moveTo(x+0.01+1, y);\n }\n\n drawctx.lineTo(x+1, y);\n strokectx.lineTo(x+1, y);\n\n drawctx.stroke();\n strokectx.stroke();\n }", "function updateLine() {\n\t\t\n\t\tvar linestyle = new ol.style.Stroke ({\n\t\t\t\tcolor: $('#Lcolor').val(),\n\t\t\t\twidth:Number( $('#Lwidth').val()),\n\t\t\t\t});\n\t\t\n\t\tvar style3 = new ol.style.Style ({\n\t\t\tstroke: linestyle,\n\t\t});\n\t\tlinestyle,\n\t\t\n\t\twindow.layer.setStyle(style3);\n\t\tmap.getView().fit(\n vectorSource.getExtent(),(map.getSize()));\n\t}", "function pinselada() {\n ctx.lineWidth = tamLinea;\n ctx.lineJoin = \"round\";\n ctx.lineCap = \"round\";\n ctx.lineTo(mouse.x, mouse.y);\n ctx.stroke();\n }", "function dibujarlinea(color, x_inicial, y_inicial, x_final, y_final)\n{\n lienzo.beginPath();\n lienzo.strokeStyle = color;\n lienzo.moveTo(x_inicial, y_inicial);\n lienzo.lineTo(x_final, y_final);\n lienzo.stroke();\n lienzo.closePath();\n}", "function addPointToLine(kineticPoint) {\n var index = getIndexOfClosestPoint(kineticPoint);\n if (index > -1) {\n points.splice(index, 1);\n }\n else {\n points.push(kineticPoint);\n }\n drawPointsAsLine();\n}", "_addLine(line) {\n //line.initProgram(this.webgl);\n line._vbuffer = this.webgl.createBuffer();\n this.webgl.bindBuffer(this.webgl.ARRAY_BUFFER, line._vbuffer);\n this.webgl.bufferData(this.webgl.ARRAY_BUFFER, line.xy, this.webgl.STREAM_DRAW);\n this.webgl.bindBuffer(this.webgl.ARRAY_BUFFER, line._vbuffer);\n line._coord = this.webgl.getAttribLocation(this.progThinLine, \"coordinates\");\n this.webgl.vertexAttribPointer(line._coord, 2, this.webgl.FLOAT, false, 0, 0);\n this.webgl.enableVertexAttribArray(line._coord);\n }", "function SimpleLine(scene, startpoint, endpoint) {\n\n // general\n this.id = Nickel.UTILITY.assign_id();\n this.type = 'SimpleLine';\n this.scene = scene;\n this.canvas = scene.canvas;\n this.context = this.canvas.getContext(\"2d\");\n\n // style\n this.stroke_width = 1;\n this.stroke_dash_length = 0;\n this.stroke_gap_length = 0;\n this.stroke_color = null;\n\n // pos\n this.x = startpoint[0];\n this.y = startpoint[1];\n this.xend = endpoint[0];\n this.yend = endpoint[1];\n\n // dir\n this.dx = this.xend - this.x;\n this.dy = this.yend - this.y;\n\n // other\n this.dead = false;\n this.visibility = true;\n\n this.update = function() {\n //-- Called every frame.\n //-- Updates changing parameters.\n //--\n\n // skip if marked for deletion\n if (this.dead == true) {\n return;\n }\n\n // user custom update\n this.update_more();\n\n // render graphics\n this.draw();\n }\n\n this.draw = function() {\n //-- Called every frame. Processes graphics\n //-- based on current parameters.\n //--\n\n // skip if marked for invisibility\n if (this.visibility == false || this.dead == true) {\n return;\n }\n\n // skip if no stroke color\n if (!this.stroke_color) {\n return;\n }\n\n // draw\n var ctx = this.context;\n ctx.save();\n\n // stroke properties\n ctx.lineWidth = this.stroke_width;\n ctx.setLineDash([this.stroke_dash_length, this.stroke_gap_length]);\n ctx.strokeStyle = this.stroke_color;\n\n // draw line\n ctx.beginPath();\n ctx.moveTo(this.x, this.y);\n ctx.lineTo(this.xend, this.yend);\n ctx.stroke();\n\n ctx.restore();\n }\n\n this.destroy = function() {\n //-- Marks current instance for deletion\n //--\n\n this.dead = true;\n this.visibility = false;\n }\n\n this.hide = function() {\n //-- Marks current instance's visibility to hidden\n //--\n\n this.visibility = false;\n }\n\n this.show = function() {\n //-- Marks current instance's visibility to shown\n //--\n\n this.visibility = true;\n }\n\n this.is_visible = function() {\n //-- Returns if self is visible\n //--\n\n return this.visibility;\n }\n\n this.update_more = function() {\n //-- Called in update. Meant to be over-ridden.\n //--\n\n }\n\n this.get_pos = function() {\n //-- returns the start position\n //--\n\n return [this.x, this.y];\n }\n\n this.get_end = function() {\n //-- returns the end position\n //--\n\n return [this.xend, this.yend];\n }\n\n this.get_dir = function() {\n //-- returns the direction vector from start\n //--\n\n return [this.dx, this.dy];\n }\n\n this.get_rot = function() {\n //-- Returns angle (in radians) from start to end\n //--\n\n return Nickel.UTILITY.atan2(-this.dy, this.dx) * 180 / Math.PI;\n }\n\n this.get_center = function() {\n //-- Returns midpoint of linesegment\n //--\n\n return [this.x + this.dx/2, this.y + this.dy/2];\n //return [this.x+(this.xend-this.x)/2, this.y+(this.yend-this.y)/2];\n }\n\n this.set_pos = function(startpoint) {\n //-- Sets the start point, ultimately changing the\n //-- direction vector\n //--\n\n this.x = startpoint[0];\n this.y = startpoint[1];\n this.dx = this.xend - this.x;\n this.dy = this.yend - this.y;\n }\n\n this.set_end = function(endpoint) {\n //-- Sets the end point, ultimately changing the\n //-- direction vector\n //--\n\n this.xend = endpoint[0];\n this.yend = endpoint[1];\n this.dx = this.xend - this.x;\n this.dy = this.yend - this.y;\n }\n\n this.set_dir = function(dir) {\n //-- Sets the direction vector from start,\n //-- ultimately changing the end point\n //--\n\n this.dx = dir[0];\n this.dy = dir[1];\n this.xend = this.x + dir[0];\n this.yend = this.y + dir[1];\n }\n\n this.set_center = function(new_center) {\n //-- Centers midpoint onto a position (expensive)\n //--\n\n var center = this.get_center();\n var difx = new_center[0] - center[0];\n var dify = new_center[1] - center[1];\n\n this.shift_pos(difx, dify);\n }\n\n this.shift_pos = function(shiftx, shifty) {\n //-- Shifts endpoints\n //--\n\n this.x += shiftx;\n this.y += shifty;\n this.xend += shiftx;\n this.yend += shifty;\n\n this.dx = this.xend - this.x;\n this.dy = this.yend - this.y;\n }\n\n this.scale_around = function(scale, point) {\n //-- Scales self's endpoints around a point\n //--\n\n this.scale_around(scale, scale, point);\n }\n\n this.scale_around2 = function(scalex, scaley, point) {\n //-- Scales self's endpoints around a point\n //--\n\n this.x = scalex * (this.x - point[0]) + point[0];\n this.y = scaley * (this.y - point[1]) + point[1];\n this.xend = scalex * (this.xend - point[0]) + point[0];\n this.yend = scaley * (this.yend - point[1]) + point[1];\n }\n\n this.rotate_around = function(degrees, point) {\n //-- Applies a rotation transformation to both endpoints\n //--\n\n var radians = degrees*Math.PI/180*-1;\n var tmpx, tmpy;\n\n tmpx = this.x - point[0];\n tmpy = this.y - point[1];\n this.x = tmpx * Math.cos(radians) - tmpy * Math.sin(radians) + point[0];\n this.y = tmpx * Math.sin(radians) + tmpy * Math.cos(radians) + point[1];\n\n tmpx = this.xend - point[0];\n tmpy = this.yend - point[1];\n this.xend = tmpx * Math.cos(radians) - tmpy * Math.sin(radians) + point[0];\n this.yend = tmpx * Math.sin(radians) + tmpy * Math.cos(radians) + point[1];\n\n this.dx = this.xend - this.x;\n this.dy = this.yend - this.y;\n }\n\n //\n // proxy functions:\n //\n\n this.offset_position = function(offx, offy) {\n //-- shift_pos proxy\n //--\n\n this.shift_pos(offx, offy);\n }\n\n this.offset_turn = function(angle, point) {\n //-- rotate_around proxy\n //--\n\n this.rotate_around(angle, point);\n }\n\n this.offset_scale = function(scale, point) {\n //-- scale_around proxy\n //--\n\n this.scale_around(scale, point);\n }\n}//end SimpleLine", "function startLine() {\n picking_photo = false;\n line_started = true;\n updateLabels();\n}", "function updateCanvas(pivot){\n var canv = document.getElementById('canv');\n var ctx = canv.getContext('2d');\n\n ctx.clearRect(0, 0, canv.width, canv.height);\n\n drawLines(pivot);\n\n\n}", "updateLastLine(line) { // this is used when drawing with the pen\r\n if (line.length < 2) return;\r\n var point1 = line.points[line.points.length - 1];\r\n var point2 = line.points[line.points.length - 2];\r\n point1 = this.worldPointToChunkScreenPoint(point1);\r\n point2 = this.worldPointToChunkScreenPoint(point2);\r\n this.ctx.beginPath();\r\n this.ctx.lineWidth = Main.Camera.getRelativeWidth(line.width);\r\n this.ctx.strokeStyle = line.style;\r\n this.ctx.lineTo(point1.x, point1.y);\r\n this.ctx.lineTo(point2.x, point2.y);\r\n this.ctx.stroke();\r\n }", "function Line(){}", "function pressMove(event){\n if(!started){\n event.target.x = event.stageX;\n event.target.y = event.stageY;\n\n var position = points.indexOf(event.target);\n stage.removeChild(lines[position]);\n\n var temp = points[position+1];\n if((position+1) % vertexAmount == 0){\n var temp2 = points[(position+1)-vertexAmount];\n lines[position] = createLine(event.stageX, event.stageY, temp2.x, temp2.y);\n }\n else{\n lines[position] = createLine(event.stageX, event.stageY, temp.x, temp.y);\n }\n\n if(position % vertexAmount == 0){\n var pos = position-1+vertexAmount;\n stage.removeChild(lines[pos]);\n lines[pos] = createLine(points[pos].x, points[pos].y, event.stageX, event.stageY);\n }\n else{\n stage.removeChild(lines[position-1]);\n lines[position-1] = createLine(points[position-1].x, points[position-1].y, event.stageX, event.stageY);\n }\n updateCurves();\n }\n\n stage.clear();\n stage.update();\n }", "drawShape(graphics) {\n let xOld = 0\n let yOld = 0\n let start = true\n for (let i = 0; i < this.nLines; i++) {\n const nPoint = this.nLine[i]\n // Check for start of a new line segment\n if (nPoint === -1)\n start = true\n else {\n // Draw a line to the next point\n const xNew = this.xPoints[nPoint]\n const yNew = this.yPoints[nPoint]\n if (start === false)\n graphics.drawLine(xOld, yOld, xNew, yNew)\n // good for debugging\n // graphics.drawString(\"L\" + i, xOld, yOld)\n xOld = xNew\n yOld = yNew\n start = false\n }\n }\n }", "function drawpoint(x, y) {\n\t\tctx.moveTo(x, y);\n\t\tctx.lineTo(x + 1, y + 1);\n\t\tctx.stroke();\n\t}", "function drawLine(points,color) {\n gl.bindBuffer(gl.ARRAY_BUFFER, pBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(points), gl.STATIC_DRAW);\n\n // for all of our points, push a color\n let colors = [];\n for (let p in points) {\n colors.push(color);\n }\n\n // let cBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, cBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(colors), gl.STATIC_DRAW);\n\n // Draw a dot on the first click\n gl.drawArrays(gl.POINTS, 0, 1);\n\n gl.drawArrays(gl.LINE_STRIP, 0, points.length);\n}", "function update() {\n drawPlane();\n if (!pt1.pinned) drawHoverPoint(pt1);\n else if (!pt2.pinned) drawHoverPoint(pt2);\n\n // draws line between points\n drawLine();\n\n // draws numerical label next to line indicating slope\n drawSlopeLabel();\n\n // display labels next to points to help explain calculation\n showRiseOverRun();\n\n // updates equation to reflect current slope\n displayEquation();\n\n // Updates screen every frame\n requestAnimationFrame(update);\n}", "function dibujarLinea(color,x_inicial,y_inicial,x_final,y_final) \n{\n lienzo.beginPath(); // Comienza el dibujo\n lienzo.strokeStyle = color; // Escoger el color de la línea\n lienzo.lineWidth = 3;\n lienzo.moveTo(x_inicial,y_inicial); // Dónde va a iniciar mi trazo\n lienzo.lineTo(x_final,y_final) // Dónde va a terminar mi trazo\n lienzo.stroke(); // Realizar el trazo\n lienzo.closePath(); // Acaba el dibujo \n}", "function makeLine(size) {\r\n if(drawShape==='Circle') {\r\n context.beginPath();\r\n context.arc(event.clientX, event.clientY, size, 0, 2 * Math.PI);\r\n context.strokeStyle = lineColor;\r\n context.fillStyle = lineColor;\r\n context.fill();\r\n context.stroke();\r\n }\r\n else if(drawShape==='Square') {\r\n context.beginPath();\r\n context.rect(event.clientX-size, event.clientY-size, size*2, size*2);\r\n context.strokeStyle = lineColor;\r\n context.fillStyle = lineColor;\r\n context.fill();\r\n context.stroke();\r\n }\r\n else if(drawShape==='Experiment') {\r\n\r\n context.beginPath();\r\n var gradient = context.createRadialGradient(event.clientX, event.clientY, size-(size/4), event.clientX, event.clientY, size);\r\n gradient.addColorStop(0, lineColor);\r\n gradient.addColorStop(1, '#FFFFFF');\r\n context.fillRect(event.clientX-size,event.clientY-size,size*2,size*2);\r\n context.fillStyle = gradient;\r\n context.fill;\r\n context.stroke; \r\n \r\n }\r\n}", "_drawLine() {\n let canvas = this.chart.canvas;\n let ctx = canvas.ctx;\n\n // Defining coordinates of points\n let points = this.points;\n\n let firstVisiblePoint = undefined;\n for (let i = 0; i < points.length; i++) {\n if (canvas.isPointVisible(points[i])) {\n firstVisiblePoint = i;\n break;\n }\n }\n\n // If there is no visible point, there's nothing to draw for this line\n if (firstVisiblePoint === undefined) return;\n \n // Drawing line\n // Move cursor to the point right before the first visible\n let startPoint = firstVisiblePoint > 0 ? firstVisiblePoint - 1 : 0;\n ctx.moveTo(points[startPoint].x, points[startPoint].y);\n\n for (let i = firstVisiblePoint; i < points.length; i++) {\n let p = points[i];\n ctx.lineTo(p.x, p.y);\n\n // If it already drawn a not visible point, stop\n if (!canvas.isPointVisible(p))\n break;\n }\n }", "function activateDraw() {\r\n measureConfig.isActive = true;\r\n measureButton.classList.toggle(\"esri-draw-button-selected\");\r\n\r\n // clear previously used line features\r\n clearPolyline();\r\n measureConfig.finsishedFeature = null;\r\n view.popup.close();\r\n\r\n // on each pointer-down event, a vertex is added to the line\r\n // allowing the user to draw a new line segment in continuation\r\n // of the activeFeature\r\n pointerDownListener = view.on(\"pointer-down\", addPoint);\r\n\r\n // on each pointer-move event, the last segment of the line\r\n // is updated so that the final vertex is the location\r\n // of the pointer or mouse\r\n pointerMoveListener = view.on(\"pointer-move\", function(event) {\r\n updateLastVertex(event);\r\n // measure the polyline on each pointer-move event\r\n if (measureConfig.activeFeature) {\r\n measurePolyline(measureConfig.activeFeature.geometry);\r\n }\r\n });\r\n\r\n // finishes drawing the line (and measurement) and\r\n // drawing is deactivated on the view\r\n doubleClickListener = view.on(\"double-click\", function(event) {\r\n // stops the default double-click behavior in the view\r\n event.stopPropagation();\r\n // stores the final densified version of the polyline\r\n finishDrawing(event);\r\n // measures the final polyline\r\n measurePolyline(measureConfig.finsishedFeature.geometry);\r\n });\r\n }", "generateLine(points) {\n const lineFunction = Object(d3_shape__WEBPACK_IMPORTED_MODULE_4__[\"line\"])()\n .x(d => d.x)\n .y(d => d.y)\n .curve(this.curve);\n return lineFunction(points);\n }", "function draw_line(x1,y1,x2,y2,width) { \n pos1 = [x1,y1];\n pos2 = [x2,y2];\n \n direction = get_direction_vector(pos1,pos2);\n rot = rotate90(direction);\n\n x1 = pos1[0] + width/2 * rot[0];\n y1 = pos1[1] + width/2 * rot[1];\n\n x2 = pos2[0] + width/2 * rot[0];\n y2 = pos2[1] + width/2 * rot[1];\n\n x3 = pos2[0] - width/2 * rot[0];\n y3 = pos2[1] - width/2 * rot[1];\n\n x4 = pos1[0] - width/2 * rot[0];\n y4 = pos1[1] - width/2 * rot[1];\n\n var st = paper.path(\"M \" + x1 + \" \" + y1 + \" L \"\n\t\t\t+ x2 + \" \" + y2 + \" L \"\n\t\t\t+ x3 + \" \" + y3 + \" L \"\n\t\t\t+ x4 + \" \" + y4 + \" z\");\n st.attr(\"fill\", \"black\");\n return st;\n}", "function onMouseMove(e){\n if (!drawing) { return; }\n drawLine(current.x, current.y, e.clientX, e.clientY, current.color, getLineWidth(), true);\n current.x = e.clientX;\n current.y = e.clientY;\n }", "function onMouseUp(e){\n if (!drawing) { return; }\n drawing = false;\n drawLine(current.x, current.y, e.clientX, e.clientY, current.color, getLineWidth(), true);\n }", "_addLine(line) {\n //line.initProgram(this.webgl);\n line._vbuffer = this.webgl.createBuffer();\n this.webgl.bindBuffer(this.webgl.ARRAY_BUFFER, line._vbuffer);\n this.webgl.bufferData(this.webgl.ARRAY_BUFFER, line.xy, this.webgl.STREAM_DRAW);\n //this.webgl.bindBuffer(this.webgl.ARRAY_BUFFER, line._vbuffer);\n line._coord = this.webgl.getAttribLocation(this._progLine, \"coordinates\");\n this.webgl.vertexAttribPointer(line._coord, 2, this.webgl.FLOAT, false, 0, 0);\n this.webgl.enableVertexAttribArray(line._coord);\n }", "function drawSingleLine(x, y) {\n \n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.lineTo(300, 200);\n ctx.stroke();\n\n}", "function draw(e) {\n // mouse left button must be pressed\n if (e.buttons !== 1) return;\n\n ctx.lineWidth = 5;\n ctx.lineCap = 'round';\n ctx.strokeStyle = '#000000';\n\n // TODO: implement the drawing functionality\n ctx.moveTo(pos.x, pos.y);\n setPosition(e);\n ctx.lineTo(pos.x, pos.y);\n ctx.stroke();\n window.canvas_coordinates.push([pos.x,pos.y])\n }", "function mousePressed(){\n\tnext = 0;\n\tdrawing = true;\n\tlast.x = mouseX;\n\tlast.y = mouseY;\n\tlines.push(new Line());\n}", "function draw() {\n let w = width / 3;\n let h = height / 3;\n\n // Toutes les prochains traits auront une épaisseur de 4\n strokeWeight(4);\n line(w, 0, w, height);\n line(w * 2, 0, w * 2, height);\n line(0, h, width, h);\n line(0, h * 2, width, h * 2);\n\n}", "createLine(x1, y1, x2, y2, borderColor = this.COLOR, lineW, lineCap, rotate) {\n const ctx = this.ctx;\n ctx.save();\n const halfW = (x2 - x1) / 2;\n const halfH = (y2 - y1) / 2;\n const cX = x1 + halfW;\n const cY = y1 + halfH;\n\n ctx.translate(cX, cY);\n ctx.rotate((rotate * Math.PI) / 180);\n\n ctx.strokeStyle = borderColor;\n ctx.lineWidth = lineW;\n ctx.lineCap = lineCap;\n if (x1 !== null && y1 !== null) ctx.moveTo(-halfW, -halfH);\n if (x2 && y2) ctx.lineTo(halfW, halfH);\n ctx.stroke();\n ctx.restore();\n //this.createRect(cX, cY, 10, 10);\n }", "function onMouseDown(event) {\n // get the location of the mouse on the canvas\n let [x, y] = getXY(event);\n\n // if this is a brand new curve, add the first control point\n if (_model.points.count === 0) { //it adds the new point to the point list\n _model.points.add(x, y, 0);\n }\n // add a new control point that will be saved on the next mouse click\n // (the location of the previous control point is now frozen)\n _model.points.add(x, y, 0);\n draw();\n}", "function Line(p1,p2){\n\tthis.p1 = p1;\n\tthis.p2 = p2;\n\t\n\tthis.render = function(){\n\t\tdrawLine(p1, p2);\n\t}\n}", "function drawLine(moveToX, moveToY, lineToX, lineToY) {\n ctx2.beginPath();\n ctx2.moveTo(moveToX, moveToY);\n ctx2.lineTo(lineToX, lineToY);\n ctx2.strokeStyle = color;\n \n /* we want diameter so line width matches circle */\n ctx2.lineWidth = radius * 2;\n ctx2.stroke(); /* actually draw the line */\n }", "draw(x, y) {\n var added = x + \",\" + y;\n\n //Sonst Endlosschleife mit Aufruf aus onResize\n if (!this.resizing) {\n this.pairs.push({ x: x, y: y });\n }\n\n var currAtt = this.poly.getAttribute(\"points\");\n if (currAtt === null) {\n currAtt = added;\n } else {\n currAtt += \"\\n\" + added;\n }\n this.poly.setAttribute(\"points\", currAtt);\n }" ]
[ "0.70853513", "0.6902469", "0.6782946", "0.67382157", "0.67174864", "0.66203725", "0.65801877", "0.6574689", "0.654762", "0.65370244", "0.65017253", "0.6487955", "0.64847493", "0.6475334", "0.64677876", "0.6440193", "0.64362234", "0.6399584", "0.63889146", "0.6384229", "0.6384138", "0.6359554", "0.63461906", "0.63437814", "0.6343145", "0.6332179", "0.63315636", "0.63313633", "0.6330625", "0.6323627", "0.6322361", "0.63119614", "0.63053364", "0.63036644", "0.6290849", "0.6281169", "0.62754625", "0.62569404", "0.6237717", "0.62375975", "0.6224793", "0.621779", "0.62121135", "0.6211974", "0.6209589", "0.6209218", "0.6205074", "0.6194597", "0.6190122", "0.6189896", "0.61848676", "0.61712134", "0.61708593", "0.61662686", "0.6166232", "0.6166155", "0.61616", "0.615871", "0.613897", "0.6138822", "0.6138822", "0.61344284", "0.6128325", "0.61258596", "0.6123345", "0.6114294", "0.6110654", "0.61080074", "0.6104136", "0.6095817", "0.6095576", "0.60944486", "0.60943955", "0.60836965", "0.6079656", "0.60726345", "0.60708416", "0.60688865", "0.6050409", "0.6047718", "0.6047299", "0.6044891", "0.60421354", "0.6041274", "0.6040808", "0.6039266", "0.6037659", "0.603307", "0.6031414", "0.6028014", "0.6026561", "0.60257876", "0.6021932", "0.6019176", "0.60174614", "0.60163176", "0.6013233", "0.60130006", "0.6012634", "0.6011067" ]
0.7938718
0
TODO: change this to accept options instead of wrangler_file_id
function GeneSetGroup (wrangler_file_id) { TabSeperatedFile.call(this, { wrangler_file_id: wrangler_file_id }); // TODO: remove this (?) this.setSubmissionType.call(this, "gene_set_collection"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFileNameWith(file) {\n $(file).parent().parent().find(\".jancyFileWrapTexts\").find(\"span\").width($(file).parent().parent().width() - 197);\n}", "function setFileNameWith(file) {\n $(file).parent().parent().find(\".jancyFileWrapTexts\").find(\"span\").width($(file).parent().parent().width() - 197);\n}", "function renderfileid() {\n return function(fileid) {\n var renderfile = fileid ? editor.file('data', fileid).filename : '';\n return renderfile;\n }\n}", "function prepareFileHolder(fileHolder, mergeRequestURI) {\n // computed vars\n let filePath = null;\n let viewFileUrl = null;\n let viewFileUrlRaw = null;\n let fileContent = null;\n let getTextPromise = null;\n let hash = null;\n let key = null;\n // Find filename\n let titleEl = fileHolder.querySelectorAll(FILE_HOLDER_TITLE_SELECTOR);\n if (titleEl.length > 0 && titleEl[0].title) {\n filePath = titleEl[0].title;\n }\n else {\n throw ': Couldn\\'t find file title';\n }\n key = mergeRequestURI + ':' + filePath;\n\n // Get view file url\n let viewFielEl = fileHolder.querySelectorAll(FILE_HOLDER_VIEW_FILE_SELECTOR);\n if (viewFielEl.length > 0) {\n viewFileUrl = viewFielEl[0].getAttribute('href');\n viewFileUrlRaw = viewFileUrl.replace('\\/blob\\/', '/raw/');\n }\n else if(filePath.split('@').length == 2) {\n // submodule modification have no file button and have title in the format \"path@commit_hash\"\n fileContent = filePath.split('@')[1];\n filePath = filePath.split('@')[0];\n }\n else {\n throw filePath + ': Couldn\\'t find view file link';\n }\n\n // Fetch content if there is a file or use already available content if possible\n if (viewFileUrlRaw) {\n getTextPromise = fetch(window.location.protocol + '//' + window.location.hostname + viewFileUrlRaw)\n .then(response => {\n return response.text();\n });\n }\n else if (fileContent) {\n getTextPromise = Promise.resolve(fileContent);\n }\n else {\n throw filePath + ': No file content available';\n }\n\n return getTextPromise\n .then(text => {\n var enc = new TextEncoder();\n let arrayBuffer = enc.encode(text);\n return window.crypto.subtle.digest('SHA-256', arrayBuffer);\n })\n .then(buf => {\n hash = bufferToHex(buf);\n\n // Check if we have already validated this file on this MR once\n return new Promise((resolve) => {\n STORAGE.get(key)\n .then(v => resolve(v[key]))\n .catch(() => resolve(null));\n });\n })\n .then(value => {\n let titleBar = fileHolder.querySelectorAll(FILE_HOLDER_TITLEBAR_SELECTOR);\n if (titleBar.length <= 0) {\n throw filePath + ': Couldn\\'t find title bar';\n }\n\n // Set titlebar color\n let icon = '';\n let className = '';\n if (!value) {\n // not validated\n className = 'reviewed-set';\n icon = '👍';\n console.debug(filePath, 'Not validated', value);\n }\n else if(value != hash) {\n // Validated but modified\n icon = '👍';\n className = 'reviewed-set';\n console.debug(filePath, 'Modified', value);\n titleBar[0].style.backgroundColor = COLOR_MODIFIED;\n }\n else {\n doneCount++;\n // Still valid\n icon = '👎';\n className = 'reviewed-unset';\n console.debug(filePath, 'Validated', value);\n titleBar[0].style.backgroundColor = COLOR_VALIDATED;\n // Click only if open\n if (isExpanded(fileHolder)) {\n titleBar[0].click();\n }\n }\n\n // add button\n let actionBar = fileHolder.querySelectorAll(FILE_HOLDER_ACTIONS_SELECTOR);\n if (actionBar.length <= 0) {\n throw 'Couldn\\'t find title actionBar bar';\n }\n let el = document.createElement('button');\n el.setAttribute('title', 'Mark as reviewed');\n el.setAttribute('type', 'button');\n el.classList.add('btn', className);\n el.appendChild(document.createTextNode(icon));\n actionBar[0].appendChild(el);\n fileCount++;\n\n // Set listener for click\n let setBtn = fileHolder.querySelectorAll('.reviewed-set');\n let unsetBtn = fileHolder.querySelectorAll('.reviewed-unset');\n if (setBtn.length > 0) {\n let btn = setBtn[setBtn.length - 1];\n btn.addEventListener('click', () => onSetClick(fileHolder, titleBar[0], btn, key, hash), {once: true});\n }\n if (unsetBtn.length > 0) {\n let btn = unsetBtn[unsetBtn.length - 1];\n btn.addEventListener('click', () => onUnsetClick(fileHolder, titleBar[0], btn, key, hash), {once: true});\n }\n })\n}", "function setLightroomFileParams( lightroomID, bridgetalkID, lightroomDesc )\n{\n function setParameter( ID, data, method )\n {\n if (typeof(data) == \"undefined\") // Check for empty parameter\n return;\n\n var ref = new ActionReference();\n var desc = new ActionDescriptor();\n \n ref.putProperty( classProperty, ID );\n ref.putEnumerated( classDocument, typeOrdinal, enumFirst );\n desc.putReference( keyTarget, ref );\n var toDesc = new ActionDescriptor();\n eval( method );\n desc.putObject( keyTo, typeNULL, toDesc );\n executeAction( eventSet, desc, DialogModes.NO );\n }\n\n setParameter( klightroomDocIDStr, lightroomID, \"toDesc.putString( ID, data );\" );\n setParameter( klightroomBridgetalkIDStr, bridgetalkID, \"toDesc.putString( ID, data );\" );\n\tif ((typeof(lightroomDesc) != \"undefined\") && (lightroomDesc != null))\n\t\tsetParameter( klightroomSaveParamsStr, lightroomDesc, \"toDesc.putObject( ID, ksaveStr, data );\" );\n}", "function addUploadIds () {\n $(\"input[data-doc='js-doc']\").each(function (i) {\n $(this).attr('id', 'doc-' + i ); // add id dynamically to each field\n $(this).next(\"label\").attr('id', 'filename-' + i);\n $(this).next(\"label\").attr('for', 'doc-' + i);\n $(this).parent().next(\"a\").attr('id', 'js-doc-' + i);\n $(this).parent().parent().attr('id', 'doc-div-' + i);\n\n // add change handler to file upload fields IF NOT DELETING\n updateLabel(i);\n });\n }", "function trigerFileProcessing(file_id) {\n //console.log(file_id);\n checkIfFileExists(file_id);\n}", "setFileDetector() {}", "function createUploadReq(id, file) {\n return JSON.stringify({id: id, guideline: file});\n}", "phototaked(file) {}", "formatReferenceFileQuery() {\n this._query.addKeyValue('type', 'Reference');\n this._elementsReferences?.forEach((elementsReference) => {\n this._query.addKeyValue('@id', elementsReference['@id']);\n });\n\n this._referenceFileQueryString = this._query.format();\n }", "saveToIpfsWithFilename (file) {\n let ipfsId\n const fileStream = fileReaderPullStream(file)\n const fileDetails = {\n path: file.name,\n content: fileStream\n }\n const options = {\n wrapWithDirectory: true,\n progress: (prog) => console.log(`received: ${prog}`)\n }\n this.ipfsApi.add(fileDetails, options)\n .then((response) => {\n console.log(response)\n // CID of wrapping directory is returned last\n ipfsId = response[response.length-1].hash\n console.log(ipfsId)\n this.setState({added_file_hash: ipfsId})\n }).catch((err) => {\n console.error(err)\n })\n }", "function PatchFile(sId) {\n var oRegex = new RegExp(\"(\" + this.ID + \")_(.*$)\");\n var oMatch = sId.match(oRegex);\n\n this.id = sId;\n this.prefix = oMatch[1];\n this.file_name = oMatch[2];\n}", "function createFile(){\n if (projectType == \"Basic\") {\n internalReference = idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId,internalReference,documentType,description,dateCreated,diffusionDate,externalReference,localization,form,status);\n //Internal Reference as Full\n } else if (projectType == \"Full\") {\n internalReference = documentType + \"-\" + padToFour(projectCode) + \"-\" + padToTwo(avenant) + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status);\n //Internal Reference as Full Without Project \n } else {\n\n internalReference = documentType + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status);\n }\n }", "function save_file_name(target_id) {\n \"use strict\";\n // figure out file path\n let file_path = $(\".cea-file-listing a.bg-primary\").data(\"save-file-path\");\n $(`#${target_id}`).val(file_path);\n}", "function genfilelistentry(data)\n{\n var res=document.createElement(\"div\");\n\n data.modtime=new Date(data.modtime*1000);\n data.modtime=`${data.modtime.toISOString().slice(0,10)} ${data.modtime.toTimeString().slice(0,8)}`;\n\n // res.innerHTML=`<dl><dt>${data.name}</dt><dd>${data.size}</dd><dd class=\"type\">${data.type}</dd><dd class=\"mod-time\">${data.modtime}</dd><dd class=\"delete\"><span>delete</span></dd></dl>`;\n res.innerHTML=`<a href=\"webp2.php?fileget=${data.id}\"><dl><dt>${data.name}</dt><dd>${data.size}</dd><dd class=\"type\">${data.type}</dd><dd class=\"mod-time\">${data.modtime}</dd><dd class=\"delete\"><span>delete</span></dd></dl></a>`;\n\n var deletebutton=res.firstChild.querySelector(\".delete span\");\n\n deletebutton.fileid=data.id;\n\n deletebutton.addEventListener(\"click\",(e)=>{\n e.preventDefault();\n\n deleteid(e.currentTarget.fileid);\n\n _filelist.removeChild(e.currentTarget.parentElement.parentElement.parentElement);\n });\n\n return res.firstChild;\n}", "function setFileID() {\n // Create a new Deferred object\n var deferred = $.Deferred();\n console.log(\"list files\");\n gapi.client.drive.files.list({\n 'q': '\\'appdata\\' in parents',\n 'maxResults': 10\n }).then(function (response) {\n console.log(\"Files:\");\n appendPre('Files:');\n var files = response.result.items;\n if (files && files.length > 0) {\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n \n if (file.title == FILENAME) {\n fileId = file.id;\n console.log(\"fileId\" + fileId);\n deferred.resolve();\n }\n }\n } else {\n console.log(\"No files found\");\n appendPre('No files found.');\n deferred.resolve();\n\n\n }\n });\n\n // Return the Deferred's Promise object\n return deferred.promise();\n }", "function handleMediaManagerSelect(fileData){\n quill.insertEmbed(insertPointIndex, 'image', fileData.url);\n}", "upload(req, res, id) {\n this.Model.findById(id, (err, item) => {\n if (err) return res.status(500).jsend.error('item to attach file to not found');\n\n var file;\n if (req.file) {\n file = req.file;\n } else if (req.files) {\n file = req.files[Object.keys(req.files)[0]][0];\n }\n if (!file) return res.status(400).jsend.fail('no file');\n\n // console.log('#--- file:', req.file);\n // console.log('#--- files:', req.files);\n // console.log('#--- var file:', file);\n\n this._processUploadedFile(id, file, (err, path) => {\n if (err) return res.status(500).jsend.error({\n message: 'error processing uploaded file',\n data: err\n });\n\n this._linkFileToItem(item, file.fieldname, path, err => {\n if (err) return res.status(500).jsend.err({\n message: 'error linking file to item',\n data: err\n });\n\n res.json({\n success: true,\n uuid: path\n });\n });\n });\n\n });\n }", "function doFileSynced(id) {\r\n var transaction = db.transaction([\"reqfile\"], (IDBTransaction.READ_WRITE ? IDBTransaction.READ_WRITE : 'readwrite'));\r\n var objectStore = transaction.objectStore(\"reqfile\");\r\n var reqfile = objectStore.get(id);\r\n\r\n reqfile.onsuccess = function(event) {\r\n var data = event.target.result;\r\n data.isSynced = true;\r\n\r\n var reqFileUpdate = objectStore.put(data);\r\n reqFileUpdate.onerror = function(event) {\r\n // Do something with the error\r\n };\r\n reqFileUpdate.onsuccess = function(event) {\r\n // Success - the data is updated!\r\n };\r\n }\r\n\r\n reqfile.onerror = function (event) {\r\n // Do something with the error\r\n };\r\n}", "function file_finder(data_attr, PostId) {\n $.ajax({\n method: \"GET\",\n url: \"REST_api/files?post_id=\" + PostId,\n processData: false,\n contentType: \"application/json\",\n data: '',\n success: function (r) {\n var files = JSON.parse(r || '{}');\n\n if (files.length > 0) {\n\n $.each(files, function (i) {\n\n if (files[i].FileType == \"doc\") {\n // console.log(\"file here\" + PostId);\n\n $('[data-' + data_attr + ' = \"' + PostId + '\"]').html($('[data-' + data_attr + ' = \"' + PostId + '\"]').html() + '<div class=\"files_container flex-column d-flex\" data-' + data_attr + '_container = \"' + PostId + '\"><div class=\"d-flex flex-row file_row\" onclick = \"window.open(\\'' + files[i].FileAddress + '\\')\"><i class=\"fa fa-link align-self-center file_icon\"></i><span class=\"file_link \"> ' + files[i].FileName + '</span> </div></div>'\n );\n\n }\n\n })\n\n }\n },\n\n error: function (r) {\n\n }\n });\n}", "function pickerCallback(data) {\r\n if (data.action == google.picker.Action.PICKED) {\r\n var fileId = data.docs[0].id;\r\n console.log(fileId);\r\n }\r\n}", "function fixFileTypeIds() {\n var types = getSplitFileTypes(mainWidget.softwareCompetition.fileTypes);\n var fileTypes = [];\n for (var i = 0; i < types[0].length; i++) {\n fileTypes.push(types[0][i].value);\n }\n for (var i = 0; i < types[1].length; i++) {\n fileTypes.push(types[1][i]);\n }\n mainWidget.softwareCompetition.fileTypes = fileTypes;\n}", "onDrop(event) {\n event.preventDefault();\n event.stopPropagation();\n this.setState({ dropZoneActive: false });\n const uppy = this.uppy;\n const addAttachment = (file, dataUrl) => {\n let repeated = 0;\n\n // Check if is repeated\n let extension = \"\";\n const fls = this.uppy.getFiles();\n for (let i = 0; i < fls.length; i++) {\n // Hay que quitar la extensión del fichero\n const [fn, ex] = fileNameAndExt(fls[i].name);\n const [fn2, _] = fileNameAndExt(file.name);\n extension = ex;\n\n if (fn.startsWith(fn2)) {\n repeated++;\n }\n }\n\n let fileName =\n repeated === 0 ? file.name : `${file.name} (${repeated}).${extension}`;\n const newAttachment = {\n name: fileName,\n size: file.size,\n type: file.type,\n source: \"Local\",\n isRemote: false,\n data: file,\n //content: dataUrl.currentTarget.result.replace(/^data:[^;]*;base64,/, \"\")\n };\n\n uppy.addFile(newAttachment);\n };\n Array.from(event.dataTransfer.files).forEach((file) => {\n //const fileReader = new FileReader();\n //fileReader.onload = addAttachment.bind(this, file);\n //fileReader.readAsDataURL(file);\n addAttachment(file);\n });\n return true;\n }", "function addFile() {\n document.getElementById(\"chronovisor-converter-container\").appendChild(fileTemplate.cloneNode(true));\n maps.push(null);\n files.push(null);\n data.push(null);\n og_data.push(null);\n }", "setFileID(e) {\n this.fileID = e.target.value;\n this.contenBodyId=this.fileDetails[e.target.value+'contenBodyId'];\n this.versionId=this.fileDetails[e.target.value+'versionId'];\n this.fileExtension=this.fileDetails[e.target.value+'fileExtension'];\n this.versionData=this.fileDetails[e.target.value+'versionData'];\n\n }", "function renderFile(file) {\n var fileDiv = document.createElement(\"div\");\n fileDiv.classList = \"fileEntry text-center\";\n fileDiv.innerHTML = `\n <h3> ` + file.name.slice(0, file.name.length - 4) + `<h3>\n `\n fileList.appendChild(fileDiv);\n}", "function pickerCallback(data) {\n if (data.action == google.picker.Action.PICKED) {\n fileId = data.docs[0].id;\n // alert('The file selected ');\n document.getElementById('alert').innerText = fileId + \"selected!\";\n var delete_btn = document.getElementById('deletebtn');\n delete_btn.setAttribute('href', `/delete/${fileId}`);\n var download_btn = document.getElementById('download');\n download_btn.setAttribute('href', `/download/${fileId}`);\n var view_btn = document.getElementById('view');\n view_btn.setAttribute('href', `/view/${fileId}`);\n }\n}", "function uploadFile(mimetype, bookname, filedata) {\n var bookname1 = 'dcbook.pdf'; // console.log(bookname,bookname1);\n\n try {\n var response = drive.files.create({\n requestBody: {\n name: bookname,\n mimeType: mimetype\n },\n media: {\n mimeType: mimetype,\n body: fs.createReadStream('./public/books/' + bookname)\n }\n });\n var promises = response.data.id;\n if (filedata === 'myFile1') fille1id = response.data.id;\n if (filedata === 'myFile2') file2id = response.data.id; // console.log(response.data.id);\n\n Promise.all(promises).then(function () {\n generatePublicurl(response.data.id, filedata);\n console.log('File uploaded in drive creating link wait....');\n })[\"catch\"](console.error);\n } catch (error) {\n console.error(error.message);\n }\n} // uploadFile();", "function uploadMultipleFile(req, res) {\n\n var fileSize = req.swagger.params.file.value.size\n var timestamp = Number(new Date()); // current time as number\n var file = req.swagger.params.file.value;\n var opportunityId = req.swagger.params.id.value;\n var filename = timestamp + '_' + file.originalname;\n var docPath = \"./images/common/\" + timestamp + '_' + file.originalname;\n var extention = path.extname(filename);\n var allowedExtensionsImg = /(\\.jpg|\\.jpeg|\\.png|\\.gif)$/i;\n var allowedExtensionsDoc = /(\\.txt|\\.rtf|\\.doc|\\.docx|\\.pdf|\\.xls|\\.xlsx|\\.ppt|\\.pptx|\\.pps|\\.msg|\\.log|\\.odt|\\.pages|\\.csv|\\.xml)$/i;\n var fileType;\n if (allowedExtensionsImg.exec(filename)) {\n fileType = 1\n }\n else if (allowedExtensionsDoc.exec(filename)) {\n fileType = 2\n }\n else {\n fileType = 3\n }\n fs_extra.writeFile(path.resolve(docPath), file.buffer, function(err) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: Constant.INTERNAL_ERROR});\n } else {\n var saveData = {\n filePath: Config.webUrl + \"/images/common/\" + filename,\n opportunityId: opportunityId,\n filename: filename,\n size: fileSize / 1000, //size in kb\n uploader: req.swagger.params.uploader.value,\n fileTypeId: fileType,\n createdBy: req.swagger.params.uploader.createdBy,\n modifiedBy: req.swagger.params.uploader.modifiedBy\n };\n attachmentFile(saveData).save(function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: Constant.INTERNAL_ERROR});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: data});\n }\n });\n }\n }\n );\n}", "function _hooker(data) {\n\tvar filename = relative(cwd, data.filename);\n\t// use the shortest name\n\tif (filename.length > data.filename) {\n\t\tfilename = data.filename;\n\t}\n\trequireData.push({\n\t\torder: requireData.length, // loading order\n\t\ttime: data.startedIn, // time\n\t\tlabel: data.name + \" (\" + filename + \")\"\n\t\t//\t\tname: data.name,\n\t\t//\t\tfilename: filename\n\t});\n}", "function appendToGlobusToaster(file, isDirectory){\n // var toaster = $(\"<div></div>\").addClass(\"upload-toaster-list\");\n var toaster = $(\"#globus-toaster\")[0];\n // after a cancel it might already be there\n existing = $(\".globus-toaster-file[name='\" + escapeJquerySelector(file.name) + \"']\");\n \tif (existing.length > 0 ) return;\n \tvar glbImage = \"/gp/images/globusToGenePattern.png\";\n if (file.direction === \"outbound\") glbImage = \"/gp/images/genepatternToGlobus.png\";\n \n var nameSpan = $(\"<span></span>\").addClass(\"globus-toaster-file-name\").text(file.name + \" \");\n if (isDirectory){\n \tvar folderImage = \"/gp/images/iconFolder.gif\";\n \tnameSpan.prepend($(\" <img src='\"+folderImage+\"' height='15px' class='globus-directional-image' alt='folder'></img>\"))\n } else {\n \tvar fileImage = \"/gp/images/iconLeaf.gif\";\n \t\n \tnameSpan.prepend($(\" <img src='\"+fileImage+\"' height='15px' class='globus-directional-image' alt='file'></img>\"))\n \n }\n \n var newDiv = $(\"<div></div>\")\n .addClass(\"globus-toaster-file\")\n .attr(\"name\", file.name)\n .append($(\"<img src='\"+glbImage+\"' height='15px' class='globus-directional-image' alt='\"+file.direction+\"'></img>\"))\n .append(nameSpan)\n .append(\n $(\"<div></div>\")\n .addClass(\"globus-toaster-file-progress\")\n .progressbar({\n change: function() {\n $(this).find(\".globus-toaster-file-progress-label\").text($(this).progressbar(\"value\") + \"%\");\n },\n complete: function() {\n\n $(this).find(\".globus-toaster-file-progress-label\").text(\"Complete!\");\n $(this).parent().find(\".globus-toaster-file-cancel\").button(\"disable\");\n \t$(this).find(\".globus-toaster-file-progress-label\").removeClass(\"barber\");\n }\n })\n .append(\n $(\"<div></div>\")\n .addClass(\"globus-toaster-file-progress-label\")\n .text(\"Pending\")\n )\n )\n .append(\n $(\"<button></button>\")\n .addClass(\"globus-toaster-file-cancel\")\n .text(\"Cancel\")\n .button()\n );\n \n newDiv.appendTo(toaster);\n if (isDirectory){\n \t\n }\n //var uploadDialog = $(\".globus-dialog\");\n \n}", "documentUpload(e) {\n let file = e.target.files[0];\n let fileSize = file.size / 1024 / 1024;\n let fileType = file.type;\n let fileName = file.name;\n let validDocFormat = false;\n let docFormat = fileName.split('.')[1];\n if(docFormat === 'doc'|| docFormat === 'docx' || docFormat === 'xls' || docFormat === 'xlsx'|| docFormat === 'pdf')validDocFormat= true;\n this.setState({ fileType: file.type, fileName: file.name, fileSize: fileSize });\n this.getCentralLibrary();\n if (this.state.totalLibrarySize < 50) {\n let fileExists = this.checkIfFileAlreadyExists(file.name, \"document\");\n let typeShouldBe = _.compact(fileType.split('/'));\n if (file && typeShouldBe && typeShouldBe[0] !== \"image\" && typeShouldBe[0] !== \"video\" && validDocFormat) {\n if (!fileExists) {\n let data = { moduleName: \"PROFILE\", actionName: \"UPDATE\" }\n let response = multipartASyncFormHandler(data, file, 'registration', this.onFileUploadCallBack.bind(this, \"document\"));\n } else {\n toastr.error(\"Document with the same file name already exists in your library\")\n }\n } else {\n toastr.error(\"Please select a Document Format\")\n }\n } else {\n toastr.error(\"Allotted library limit exceeded\");\n }\n }", "add_bingo_list(filename) {\n this.bingoLists.push(filename)\n this.drawSelect()\n }", "function pickerCallback(data) {\n if (data.action == google.picker.Action.PICKED) {\n\n\tvar docs = data[google.picker.Response.DOCUMENTS];\n docs.forEach(function (file) {\n\t\tvar fileid = file.id;\n\t//alert(fileid);\t\n\t\tvar downloadurl = 'https://www.googleapis.com/drive/v3/files/' + fileid +'?alt=media'; \n\t\t//https://www.googleapis.com/drive/v3/files/0ByZcl5tCaPn6Sk11UGYzNUFlcHM?alt=media\n\t\tif (downloadurl) {\n var accessToken = gapi.auth.getToken().access_token;\n var xhr = new XMLHttpRequest();\n xhr.open('GET', downloadurl);\n xhr.setRequestHeader('Authorization', 'Bearer ' + accessToken);\n xhr.onload = function() {\n\tdocument.getElementById(\"feature-text\").innerHTML = xhr.responseText;// \"Hello World\";\n // alert(xhr.responseText);\n\t\t//callback(xhr.responseText);\n };\n xhr.onerror = function() {\n //callback(null);\n };\n xhr.send();\n } else {\n //callback(null);\n }\n\t})\n\t }\n}", "setFileOptionList() {\r\n var me = this;\r\n\r\n Utils.getFromStorage(Storing.buildPrevUriMapStoreObj({}), 'local')\r\n .then((store) => {\r\n var uriMap = store.prevUriMap\r\n\r\n // If we're still in the digging/scraping stages, restore the textual file-list.\r\n // If we're in the file option download stage, show the list of file option checkboxes instead.\r\n var length = Object.values(uriMap).length;\r\n\r\n chrome.runtime.getBackgroundPage((bgWindow) => {\r\n // Alias the static class Utils, and get the Output common instance..\r\n var ut = bgWindow[C.WIN_PROP.UTILS_CLASS];\r\n var out = bgWindow[C.WIN_PROP.OUTPUT_CLASS].getInstanceSetToDoc(window.document);\r\n\r\n // If it's still doing a dig/scrape, just say so and return.\r\n if (out.appIsScraping || out.appIsDigging) {\r\n var descriptionOfWork = out.appIsScraping ? 'scraping...' : 'digging...';\r\n var outMessage = `Currently ${descriptionOfWork}`;\r\n \r\n out.toOut(outMessage);\r\n out.showStopButton();\r\n out.restoreFileList();\r\n\r\n return C.CAN_FN.PR_RS(outMessage);\r\n }\r\n \r\n // Otherwise, if there is a previousUriMap, make the file options.\r\n if (length > 0) {\r\n me.lm(\r\n 'Got persisted uris:\\n' + \r\n ' ' + JSON.stringify(uriMap)\r\n );\r\n\r\n me.lm(\r\n '[Popup] Got checked uris:\\n' +\r\n ' ' + JSON.stringify(out.checkedFileOptUris)\r\n );\r\n\r\n out.showActionButtons();\r\n var dir = ut.getSaltedDirectoryName();\r\n \r\n out.clearFilesDug();\r\n ut.resetDownloader();\r\n\r\n var checkedItemCount = 0;\r\n var idx = length - 1;\r\n\r\n // Make a file option and hook up the event handlers for all in the prevUriMap.\r\n for (var thumbUri in uriMap) { \r\n var uri = uriMap[thumbUri];\r\n\r\n if (!uri || !uri.replace || uri.indexOf(C.ST.D) === 0) {\r\n me.lm(`Bad uri string for download: ${JSON.stringify(uri)}`);\r\n continue;\r\n }\r\n\r\n var queryPos = uri.lastIndexOf(C.ST.Q_MK);\r\n\r\n if (queryPos === -1) {\r\n queryPos = uri.length;\r\n }\r\n\r\n var filePath = dir + C.ST.WHACK + uri.substring(uri.lastIndexOf(C.ST.WHACK) + 1, queryPos);\r\n var optId = (idx--);\r\n\r\n out.addFileOption(new FileOption((optId + C.ST.E), uri, thumbUri, filePath, ut.downloadFile));\r\n \r\n var cBox = document.getElementById(C.ELEMENT_ID.CB_PREFIX + optId);\r\n if (Utils.exists(cBox)) {\r\n if (out.checkedFileOptUris.indexOf(cBox.value) !== -1) {\r\n checkedItemCount++; \r\n cBox.dataset.filePath = C.ST.E;\r\n cBox.checked = true;\r\n cBox.disabled = true;\r\n }\r\n }\r\n }\r\n\r\n // Set the badge text and background color.\r\n chrome.browserAction.setBadgeText({ text: C.ST.E + (length - checkedItemCount) + C.ST.E });\r\n chrome.browserAction.setBadgeBackgroundColor(C.COLOR.AVAILABLE_FOPTS);\r\n\r\n if (checkedItemCount > 0) {\r\n out.toOut('Please select which of the ' + (length - checkedItemCount) + ' remaining files you wish to download.');\r\n }\r\n else {\r\n out.toOut('Please select which of the total ' + length + ' files you wish to download.');\r\n }\r\n }\r\n else {\r\n // If there are no previous uri entries, set us up normally.\r\n chrome.browserAction.setBadgeText({ text: C.ST.E });\r\n out.showDigScrapeButtons();\r\n out.toOut('hit a button to begin.');\r\n }\r\n });\r\n\r\n return C.CAN_FN.PR_RS_DEF();\r\n })\r\n .catch((err) => {\r\n if (!err) {\r\n return C.CAN_FN.PR_RS_DEF();\r\n }\r\n\r\n var outputArea = window.document.getElementById(C.ELEMENT_ID.OUTPUT); \r\n outputArea.textContent = 'Problem loading previous results. My apologies.';\r\n me.lm('Could not get the prevUriMap. err: ' + JSON.stringify(err));\r\n \r\n return C.CAN_FN.PR_RJ(err);\r\n });\r\n }", "function getFileInfoDropdown(){\n\t\tvar currentField = this;\n\t\tvar val = this.value; //filename\n\t\tdropdownAdd(val);\n\t\tshowAlarms(val);\n}", "function ui_multi_add_file(id, file)\n{\n var template = $('#files-template').text();\n template = template.replace('%%filename%%', file.name);\n template = template.replace('%%remove%%', \"data-attach-id=\"+id)\n\n template = $(template);\n template.prop('id', 'uploaderFile' + id);\n template.data('file-id', id);\n\n $('#files').find('li.empty').fadeOut(); // remove the 'no files yet'\n $('#files').prepend(template);\n console.log(\"file added\");\n $(\"button[data-attach-id=\"+id+\"]\").click({\"id\":id}, removeFileElement);\n}", "function link(scope, elem) {\n elem.on('change', (evt) => {\n const fileList = evt.target.files;\n angular.forEach(fileList, (file) => {\n if (!scope.isValidFile(file.name)) {\n scope.$apply(function () {\n scope.alerts(\"please all files must be a valid json\",\n \"danger\", true, 5000);\n });\n return;\n }\n const reader = new FileReader();\n //event fired when reader.readAsTex is called\n reader.onload = (event) => {\n try {\n const result = JSON.parse(event.target.result);\n scope.$apply(() => {\n scope.uploadedFiles[file.name] = result;\n });\n } catch (e) {\n scope.$apply(() => {\n scope.alerts(\"invalid json. pls refer to index guide \",\n \"danger\", true, 5000);\n });\n return;\n }\n };\n reader.readAsText(file);\n });\n });\n }", "async function generateHints() {\n const files = [];\n const dirs = addedFolder.map(({ url }) => url);\n\n editorManager.files.forEach((file) => {\n const { uri, name, type } = file;\n let { location = '' } = file;\n\n if (type === 'git') {\n location = 'git • ' + file.record.repo + '/' + file.record.path;\n } else if (type === 'gist') {\n const { id } = file.record;\n const path = id.length > 10 ? '...' + id.substring(id.length - 7) : id;\n location = `gist • ${path}`;\n } else if (location) {\n location = helpers.getVirtualPath(location);\n }\n\n files.push(hintItem(name, location, uri));\n });\n\n try {\n await listDir(files, dirs);\n } catch (error) {\n // ignore\n }\n\n return files;\n }", "getFileURL(fileId) {\n var file = this.collection.findOne(fileId, {\n fields: { name: 1 }\n });\n return file && `${ this.getURL() }/${ fileId }/${ encodeURIComponent(file.name) }`;\n }", "addFileToClientFiles(fileId, folderName) {\n this.set({\n addFileModal: false\n });\n this.save({\n clientFiles: this.get('clientFiles').concat([{\n ___class: 'ClientFiles',\n folderName: folderName,\n files: {\n ___class: 'Files',\n objectId: fileId,\n }\n }]),\n }, {\n success: (response) => {\n console.log('file added to clientFiles');\n store.files.trigger('change');\n },\n error: (xhr) => {\n console.log('error saving clientFile', xhr);\n }\n });\n }", "function convertResponseToFile(response,callback){\n\tvar files = [];\n\tvar defaultFiles = []; //default files/folders being used by elab if there are any\n\tif (typeof response[0]!='undefined'){\n\t\tfor (var i=0;i<response.length;i++){\n\t\t\tvar thisFile = response[i];\n\n\t\t\t//Check if it has certain preview links\n\t\t\tvar linkToFile = thisFile.alternateLink;\n\t\t\tvar embedLink = thisFile.embedLink;\n\t\t\tvar link_preview;\t\t\t\n\t\t\t//this is the link directly to the google doc editable link. However, because of security issue, there is no concrete to render perfectly the doc in iframe. Therefore, decide to use static content (embedlink_\n\t\t\t//console.log(embedLink)\n\t\t\tif (embedLink){\n\t\t\t\tlink_preview = embedLink;\n\t\t\t}else{\n\t\t\t\tlink_preview= linkToFile;\n\t\t\t}\n\n\t\t\t//Check if it is a folder\n\t\t\tvar isFolder = false;\n\t\t\tif (thisFile.mimeType==\"application/vnd.google-apps.folder\"){\n\t\t\t\tisFolder = true;\n\t\t\t}\n\n\t\t\t//Attributes\n\t\t\tvar file = {\n\t\t\t\t\tid : thisFile.id\n\t\t\t\t\t, title : thisFile.title\n\t\t\t\t\t, size : thisFile.quotaBytesUsed\n\t\t\t\t\t, permission : thisFile.userPermission\n\t\t\t\t\t, createdDate:thisFile.createdDate\n\t\t\t\t\t, modifiedDate : thisFile.modifiedDate\n\t\t\t\t\t, link : link_preview\n\t\t\t\t\t, thumbnailLink : thisFile.thumbnailLink\n\t\t\t\t\t, mimeType: thisFile.mimeType\n\t\t\t\t\t, iconLink: thisFile.iconLink\n\t\t\t\t\t, createdBy:thisFile.ownerNames\n\t\t\t\t\t, isFolder:isFolder\n\t\t\t\t\t, children: new Backbone.Collection()//Only has children\n\t\t\t, parent:thisFile.parents,\t//which project/folder it belong to\n\n\t\t\t};\n\t\t\tif (doesNotContainString(thisFile.title,'#elab.')){\n\t\t\t\t//Push to file array\n\t\t\t\tfiles.push(file);\n\t\t\t}else{\n\t\t\t\tdefaultFiles.push(file);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//return statement\n\treturn callback(files,defaultFiles);\n}", "renderFileUri(reviewId) {\n if (this.state.photo[reviewId]) {\n return (<Image \n source={{ uri: this.state.photo[reviewId] }} \n style={{ height: 400, width: null, flex: 1, marginHorizontal: 3 }}\n />);\n } \n }", "function updateFileNoMD (auth, id, file, callback) {\n var service = google.drive('v3')\n service.files.update({\n fileId: id,\n media: {\n mimeType: 'text/plain',\n body: file\n },\n auth: auth\n }, function (err, response) {\n if (err) {\n return callback(err)\n }\n return callback(null, response.name)\n })\n}", "function requestFile(id, option) {\n connections[id].dataChannel.send(JSON.stringify({\n type: \"request\",\n option: option // The name of the file\n }));\n\n document.getElementById(\"download\").name = option;\n}", "function getProblem(obj) {\n console.log($(obj).attr('id'));\n $.ajax({\n url: 'get_question',\n type: 'POST',\n data: {data: [ $(obj).attr('id')]},//send the file.manip\n success: function (data) {\n console.log(data);\n if (data['redirect']) {\n window.location = data['redirectURL'];\n }\n }\n });\n}", "_prepareList () {\n this._rawFiles.map((file) => {\n const pretendModel = new Pretender(path.resolve(this._modelsDir, file), this._sequelize)\n if (!pretendModel.isModel) return\n this.files.push(pretendModel.toDataJson())\n })\n }", "getFileId(name) {\n let matches = this.entries.filter(e => e.name === name);\n if (matches.length > 0) {\n return matches[0];\n } else {\n return null;\n }\n }", "updateCompleterOnChange(file) {\r\n fs.readFile(file).then(buffer => buffer.toString()).then(content => this.updateCompleter(file, content));\r\n this.extension.completer.input.getGraphicsPath(file);\r\n }", "function ChangeIdFile(id) {\n DisableUI();\n idFile = id;\n if (isPlaying) {\n isPlaying = false;\n $(\"#playButton\").attr(\"value\", \"Play\");\n }\n $(\"#sliderDiv\").slider(\"value\", $(\"#sliderDiv\").slider(\"option\", \"min\"));\n p.getBubbleDrawer().clear();\n p.getBubbleDrawer().loadingWindow();\n p.getBubbleDrawer().display();\n resetData();\n initData();\n launch();\n EnableUI();\n}", "function TuningFileModule()\n{\n this.mFile = \"\";\n}", "_fileUploadResponse(e) {\n this.editExistingNode = true;\n // convert response to object\n let response = JSON.parse(e.detail.xhr.response);\n // access the app that did the upload\n let map = this.__appUsed.connection.operations.add.resultMap;\n let data = {};\n let item = {};\n // look for the items element to draw our data from at its root\n if (\n typeof this._resolveObjectPath(map.item, response) !== typeof undefined\n ) {\n data = this._resolveObjectPath(map.item, response);\n }\n item.type = map.defaultGizmoType;\n // pull in prop matches\n for (var prop in map.gizmo) {\n item[prop] = this._resolveObjectPath(map.gizmo[prop], data);\n }\n // another sanity check, if we don't have a url but have a source bind that too\n if (\n typeof item.url === typeof undefined &&\n typeof item.source !== typeof undefined\n ) {\n item.url = item.source;\n }\n // gizmo type is also supported in the mapping element itself\n // Think an asset management backend as opposed to a specific\n // type of asset like video. If the item coming across can\n // effectively check what kind of gizmo is required for it\n // to work then we need to support that asset declaring the\n // gizmo type needed\n if (typeof map.gizmo.type !== typeof undefined) {\n item.type = this._resolveObjectPath(map.gizmo.type, data);\n }\n this.shadowRoot.querySelector(\"#url\").value = item.url;\n // @todo put in logic to support the response actually\n // just outright returning a haxElement. This is rare\n // but if the HAX developer has control over the endpoint\n // then they could get HAX to streamline some workflows\n // or by-pass the gizmo selection step to improve UX\n // for end users even further. Examples could be a media\n // management system that has remote rendering (cms-token)\n // or a highly specific endpoint that we know we can only\n // present in one way effectively Box / Google doc viewer.\n this.newAssetConfigure();\n }", "_appendAttachment({ id, filename, content }) {\n const renderedPromise = this._renderedCapability.promise;\n\n renderedPromise.then(() => {\n if (renderedPromise !== this._renderedCapability.promise) {\n return; // The FileAttachment annotation belongs to a previous document.\n }\n let attachments = this._attachments;\n\n if (!attachments) {\n attachments = Object.create(null);\n } else {\n for (const name in attachments) {\n if (id === name) {\n return; // Ignore the new attachment if it already exists.\n }\n }\n }\n attachments[id] = {\n filename,\n content,\n };\n this.render({\n attachments,\n keepRenderedCapability: true,\n });\n });\n }", "_fileUploadResponse(e) {\n super._fileUploadResponse(e);\n // @todo put in logic to support the response actually\n // just outright returning a haxElement. This is rare\n // but if the HAX developer has control over the endpoint\n // then they could get HAX to streamline some workflows\n // or by-pass the gizmo selection step to improve UX\n // for end users even further. Examples could be a media\n // management system that has remote rendering (cms-token)\n // or a highly specific endpoint that we know we can only\n // present in one way effectively Box / Google doc viewer.\n this.newAssetConfigure();\n }", "function saveEntry(options, entry)\n{\n var id = urllib.parse(entry.idr);\n addFile(options, path.join(id.host, id.pathname, entry.id+'.json'), entry);\n}", "function clickFileItenAdmin(id) {\n var idchan = '#imgLog' + id;\n var idchankey = 'imgLog' + id;\n $(idchan).click();\n const imgFile = document.getElementById(idchankey);\n imgFile.addEventListener(\"change\", function () {\n const file = this.files[0];\n var tmppath = URL.createObjectURL(this.files[0]);\n var yave = '#ImganItenAdmin' + id;\n if (file) {\n const render = new FileReader();\n render.addEventListener(\"load\", function (event) {\n console.log(this.result);\n $(yave).attr(\"src\", this.result);\n $(yave).attr(\"value\", $(idchan).val());\n });\n render.readAsDataURL(file);\n }\n });\n}", "function uploadCoachFile(){\n var myNode = document.getElementById(\"coach_text_show\");\n while (myNode.firstChild) {\n myNode.removeChild(myNode.firstChild);\n }\n\n for(var i = 0; i < coach_file_array.length; i++){\n var a = document.createElement('span');\n a.setAttribute('id', 'cft_code'+ i);\n a.setAttribute('class', 'cft_code');\n var node = document.createTextNode(coach_file_array[i]);\n a.appendChild(node);\n document.getElementById(\"coach_text_show\").appendChild(a);\n document.getElementById(\"coach_text_show\").appendChild(a);\n a.appendChild(document.createElement('br'));\n }\n\nif (BB2001 == true){\n uploadRosters(46);\n}else{\n uploadRosters(44);\n}\n\n}", "set file(value) { this._file = value; }", "addFile() {\n this.addCustom('type', {\n inputLabel: 'Property value'\n });\n const index = this.model.length - 1;\n const item = this.model[index];\n item.schema.isFile = true;\n item.schema.inputType = 'file';\n this.requestUpdate();\n }", "function idUpdatedCallback() {\n // Update progress bar text:\n tmpThis.fileInputProgressText = \"开始上传数据到服务器,请稍后...\"\n // Insert json array to server:\n tmpThis.insertAllDataIntoServer(jsonArray);\n }", "replace(fileId, file, charsetHunch, options, options = { headers: {} }) {\n return __awaiter(this, void 0, void 0, function* () {\n const localVarPath = this.basePath + '/files/v3/files/{fileId}'\n .replace('{' + 'fileId' + '}', encodeURIComponent(String(fileId)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', '*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'fileId' is not null or undefined\n if (fileId === null || fileId === undefined) {\n throw new Error('Required parameter fileId was null or undefined when calling replace.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n if (file !== undefined) {\n localVarFormParams['file'] = file;\n }\n localVarUseFormData = true;\n if (charsetHunch !== undefined) {\n localVarFormParams['charsetHunch'] = models_1.ObjectSerializer.serialize(charsetHunch, \"string\");\n }\n if (options !== undefined) {\n localVarFormParams['options'] = models_1.ObjectSerializer.serialize(options, \"string\");\n }\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.hapikey.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.hapikey.applyToRequest(localVarRequestOptions));\n }\n if (this.authentications.oauth2.accessToken) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.oauth2.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n localVarRequest(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = models_1.ObjectSerializer.deserialize(body, \"any\");\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n });\n }", "function displayAttachDocGeoLoc() {\n\n\n }", "function handle_update_files(){\r\n\t//console.log(\"Called One time\");\r\n\tvar existing_file_length = existing_file.length;\r\n\tvar len = file_name_hash_map.length;\r\n\tvar flag;\r\n\t// Check for non HTML \r\n\tfor(var i=0;i<len;i++)\r\n\t{\r\n\t\t\tflag=0;\r\n\t\t\tfor(var j=0;j<existing_file_length;j++)\r\n\t\t\t{\r\n\t\t\t\tif(existing_file[j].fileName === file_name_hash_map[i].name)\r\n\t\t\t\t{\r\n\t\t\t\t\tflag=1;\r\n\t\t\t\t\t//existing_file[j].hash = file_name_hash_map[i].hash;\r\n\t\t\t\t\tupdateHashOnBlockChain(file_name_hash_map[i].name,file_name_hash_map[i].hash);\r\n\t\t\t\t\ttotal_files_altered++;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag === 0)\r\n\t\t\t\tuploadHashToBlockChain(file_name_hash_map[i].name,file_name_hash_map[i].hash),\r\n\t\t\t\ttotal_files_altered++;\r\n\t}\r\n{/* <a href=\"https://apple.bc/\" target=\"_blank\">View your domain</a> */}\r\n\tvar len = file_name_html_blob_url.length;\r\n\t//console.log(len);\r\n\thtml_required_cnt = len;\r\n\t//console.log(html_required_cnt);\r\n\thtml_uploaded_cnt = 0;\r\n\tif(html_uploaded_cnt === html_required_cnt)\r\n\t\t{\r\n\t\t\tupload_existing_html_files(); // when there is no html\r\n\r\n\t\t}\r\n\telse\r\n\t{\r\n \tfor(var i=0;i<len;i++){\r\n \t\tcnt = -10;\r\n\r\n \t\tvar url_blob = file_name_html_blob_url[i].url;\r\n \t\tvar fname_blob = file_name_html_blob_url[i].fname;\r\n\r\n \t\t//console.log(\"upload_Html_Files\",url_blob,fname_blob);\r\n \t\thandlingHTMLUpload(url_blob, fname_blob); // this will refract html\r\n \t\t\r\n\t }\r\n\t}\r\n}", "function prerun() \n{\n var fileUrl = \"/public/js/\";\n var fileName;\n var folderName = \"/\";\n var canRead = true;\n var canWrite = false;\n\n fileName = [\n \"vacuum.wav\",\n \"crowd.wav\",\n ];\n\n for (var count = 0; count < fileName.length; count++)\n {\n FMOD.FS_createPreloadedFile(folderName, fileName[count], fileUrl + fileName[count], canRead, canWrite);\n } \n}", "function updateFileList(id, message) {\n document.getElementById(\"remoteFiles\").hidden = false;\n let file = document.getElementById(message.fileName + '-' + connections[id].name);\n if (!file) { // If the file does not already have an option\n file = document.createElement(\"option\"); // Create an option to add to the drop-down menu of files\n file.id = message.fileName;\n }\n\n file.value = message.fileName;\n file.innerHTML = message.fileName + ' (' + formatBytes(message.size) + ')'; // The displayed option text\n\n let files = document.getElementById(\"files\");\n let userFiles = document.getElementById(connections[id].name + 'Files');\n\n if (!userFiles) { // If the user does not have a list of files already\n userFiles = document.createElement(\"userFiles\"); // Create an element for the user\n userFiles.id = connections[id].name + 'Files';\n\n let label = document.createElement(\"label\"); // This label displays who owns the files\n label.for = connections[id].name;\n label.innerHTML = connections[id].name + ': ';\n userFiles.appendChild(label);\n\n let select = document.createElement(\"select\"); // This drop-down menu contains the files to choose from\n userFiles.appendChild(select);\n\n let request = document.createElement(\"button\"); // This button requests the selected file\n request.innerHTML = \"Request File\";\n request.onclick = function () {\n requestFile(id, select.value);\n }\n\n userFiles.appendChild(request);\n userFiles.appendChild(document.createElement(\"br\")); // Place the next user on the next line\n files.appendChild(userFiles);\n }\n\n userFiles.childNodes[1].appendChild(file);\n}", "link () {\n\t this._attachments = this._sbolDocument.lookupURIs(this._attachments);\n\t this._wasGeneratedBys = this._sbolDocument.lookupURIs(this._wasGeneratedBys);\n\t}", "function loadAttachments(worker, taskId) {\n\n}", "toggleFileType() {\n let content = this.model.get(\"content\"),\n title = \"<title>\",\n startTag = 'xml:id=\"',\n fromIndex = 0,\n HTML = \"<h1>\"\n\n HTML += content.substring(content.indexOf(title) + title.length, content.indexOf(\"</title>\")) + \"</h1>\"\n content = content.substring(this.model.get(\"content\").indexOf(\"<text>\"))\n\n while (content.indexOf(startTag, fromIndex) != -1) {\n let endTag = \"</\" + content.substring(0, content.indexOf(startTag, fromIndex)).substring(content.substring(0, content.indexOf(startTag, fromIndex)).lastIndexOf('<') + 1).replaceAll(' ', '').replaceAll(`\n`, '') + '>',\n tag = content.substring(content.indexOf(startTag, fromIndex), content.indexOf(endTag, fromIndex))\n\n let xmlID = content.substring(fromIndex).substring(content.substring(fromIndex).indexOf(startTag) + startTag.length)\n HTML += '<span id=\"' + xmlID.substring(0, xmlID.indexOf('\"')) + '\" class=\"span\">' + tag.substring(tag.indexOf('>') + 1)\n\n fromIndex = content.indexOf(endTag, fromIndex) + endTag.length\n HTML += \"</span>\" + content.substring(fromIndex).substring(0, content.substring(fromIndex).indexOf('<'))\n }\n\n if (!this.$el[0].children[2]) {\n let newChild = document.createElement(\"div\")\n newChild.innerHTML = HTML\n this.$el[0].children[1].parentNode.insertBefore(newChild, this.$el[0].children[1].nextSibling)\n this.$el[0].children[2].style.height = this.$el[0].children[1].offsetHeight + \"px\"\n this.$el[0].children[2].style.overflow = \"auto\"\n this.$el[0].children[2].style.background = \"white\"\n this.$el[0].children[2].style.textAlign = \"justify\"\n this.$el[0].children[2].style.fontFamily = \"roman, 'times new roman', times, serif\"\n }\n\n let filename = this.$el[0].children[0].children[0].children[0].innerText\n if (this.$el[0].children[0].children[0].children[1].children[1].innerText == \"HTML\") {\n this.$el[0].children[0].children[0].children[0].innerText = filename.substring(0, filename.lastIndexOf('.')) + \".html\"\n this.$el[0].children[0].children[0].children[1].children[1].innerText = \"XML\"\n for (let i = 0; i < 2; i++)\n this.$el[0].children[0].children[1].children[i].style.display = \"none\"\n this.$el[0].children[1].style.display = \"none\"\n this.$el[0].children[2].style.display = \"block\"\n }\n else {\n this.$el[0].children[0].children[0].children[0].innerText = filename.substring(0, filename.lastIndexOf('.')) + \".xml\"\n this.$el[0].children[0].children[0].children[1].children[1].innerText = \"HTML\"\n for (let i = 0; i < 2; i++)\n this.$el[0].children[0].children[1].children[i].style.display = \"block\"\n this.$el[0].children[1].style.display = \"block\"\n this.$el[0].children[2].style.display = \"none\"\n }\n }", "function uploadDocVersion(dir, f) {\n \n var this_doc = dir.createFile(f)\n var doc_id = this_doc.getId()\n //var doc_name = this_doc.getName()\n //test\n //Logger.log(DriveApp.Access)\n //var doc_loc = DriveApp.getFileById(\"0B0Ylsx9j8KGqTUFFLWRmMmFiZDY2LTI0ZDctNGJjMy05ZTE0LTBhOTZiMGM0OTRjYw\")\n //var this_doc = DriveApp.getFileById(doc_id)\n //doc_loc.setSharing(DriveApp.Access.ANYONE_WITH_LINK, DriveApp.Permission.VIEW);\n var doc_url = this_doc.getUrl()\n \n return Array(doc_id, doc_url) \n \n}", "constructor() { \n \n PatchGistFiles.initialize(this);\n }", "function read_wb_ID(d, opts) {\n var o = opts || {},\n OLD_WTF = !!o.WTF;\n o.WTF = true;\n\n try {\n var out = SYLK.to_workbook(d, o);\n o.WTF = OLD_WTF;\n return out;\n } catch (e) {\n o.WTF = OLD_WTF;\n if (!e.message.match(/SYLK bad record ID/) && OLD_WTF) throw e;\n return PRN.to_workbook(d, opts);\n }\n }", "function addRelatedDoc(uploadfilepath) {\n //Use filename for title of related doc\n var pathFilename = uploadfilepath.split(\"\\\\\");\n var filename = pathFilename[pathFilename.length - 1];\n\n //Save all change document properties in an object to send to post/put web service \n var properties = new Object();\n properties.Change_Record_Id = id;\n properties.DocTitle = $('#addLinkTitle').val();\n properties.DocType = $('#addLinkType').val();\n\n if (properties.DocType === \"Link\")\n properties.DocLocation = $('#addLinkValue').val();\n\n if (properties.DocType === \"File\")\n properties.DocLocation = uploadfilepath;\n\n properties.CreateDate = new Date($.now());\n\n $.ajax({\n url: 'api/data/PostChangeDocument',\n method: 'post',\n data: properties\n })\n .done(function (e) {\n getRelatedDocs();\n $('#errorInsert').hide();\n $('#errorUpdate').hide();\n $('#errorSelect').hide();\n $('#successInsert').hide();\n\n //Clear out fileupload entry\n var fileuploadclear = $('#fileUpload');\n fileuploadclear.replaceWith(fileuploadclear.clone(true));\n\n $('#success').html(\"Added related document successfully.\").fadeIn(1000);\n setTimeout\n (function () {\n $(\"#success\").fadeOut();\n }, 5000\n );\n })\n .fail(function (e) {\n $('#errorSelect').hide();\n $('#successInsert').hide();\n $('#successUpdate').hide();\n $('#errorInsert').hide();\n\n $('#error').html(\"Failed to Add Related Document.\").fadeIn(1000);\n setTimeout(function () {\n $(\"#error\").fadeOut();\n }, 5000);\n });\n}", "function update_file(file) {\n var file_button = document.getElementById(\"file-button\");\n document.getElementById(\"filename\").innerHTML = file.name;\n file_button.innerHTML = \"open file\";\n file_button.className = \"mat-button mdc-button mdc-button--raised blue-button\";\n mdc.ripple.MDCRipple.attachTo(file_button);\n opened_file = file;\n}", "function putAttachDocGeoLoc(doc_id, geo_obj) {\n\n if (doc_id && geo_obj) {\n attachment_id_list.push(doc_id);\n attachment_geo_loc_map[doc_id] = geo_obj;\n }\n }", "handler(request, reply) {\n return reply.file(path.join('public', a, request.params.filename));\n }", "snippetsWorkspaceEncodedIdFilesPathGet(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n // Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n api_key.apiKeyPrefix = incomingOptions.apiKeyPrefix || 'Token';\n // Configure HTTP basic authorization: basic\n let basic = defaultClient.authentications['basic'];\n basic.username = 'YOUR USERNAME';\n basic.password = 'YOUR PASSWORD';\n // Configure OAuth2 access token for authorization: oauth2\n let oauth2 = defaultClient.authentications['oauth2'];\n oauth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Bitbucket.SnippetApi(); // String | // String | // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.\n /*let path = \"path_example\";*/ /*let encodedId = \"encodedId_example\";*/ /*let workspace = \"workspace_example\";*/ apiInstance.snippetsWorkspaceEncodedIdFilesPathGet(\n incomingOptions.path,\n incomingOptions.encodedId,\n incomingOptions.workspace,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, '', response);\n }\n }\n );\n }", "function handleFileDrop(event, ui){ \n var appointmentID = this.getAttribute( 'appointmentID' );\n var fileID = ui.draggable.attr( 'fileID' );\n /*\n //Get the data from the div that was dropped to the appointment\n var FirstName=ui.draggable.attr('FirstName');\n var LastName= ui.draggable.attr('LastName');\n \n var StreetNumber=ui.draggable.attr('StreetNumber');\n var StreetName=ui.draggable.attr('StreetName');\n var City=ui.draggable.attr('City');\n var Province=ui.draggable.attr('Province');\n var PostalCode=ui.draggable.attr('PostalCode');\n */\n var getString=\"FileID=\"+fileID;//+\"&FirstName=\"+FirstName+\"&LastName=\"+LastName+\"&StreetNumber=\"+StreetNumber+\"&StreetName=\"+StreetName+\"&City=\"+City+\"&Province=\"+Province+\"&PostalCode=\"+PostalCode; \n\t \t \n\t \n\t getString = strReplace(getString, ' ', \"\\\\s\");\n disable(ui.draggable);\n \n $(this).append($(\"<div class='droppedContainer' DroppedID='\"+fileID+\"'>\").load(\"php/view/AppointmentAssignment/FilesFoundDiv/DroppedFile.php?\"+getString, function(){\n DropRefresh();\n submitFile(fileID, appointmentID);\n //setInitialFocus(); \n }));\n \n \n }", "getByName(name) {\r\n const f = new AttachmentFile(this);\r\n f.concat(`('${name}')`);\r\n return f;\r\n }", "function optionChanged(newsample){readFile(newsample)}", "function render(data, options) {\n\n fv_flowplayer_scannedFolders = [];\n fv_flowplayer_scannedFiles = [];\n\n if(Array.isArray(data)) {\n\n data.forEach(function (d) {\n\n if (d.type === 'folder') {\n fv_flowplayer_scannedFolders.push(d);\n }\n else {\n fv_flowplayer_scannedFiles.push(d);\n }\n\n });\n\n } else if(typeof data === 'object') {\n fv_flowplayer_scannedFolders = data.folders;\n fv_flowplayer_scannedFiles = data.files;\n\n }\n\n // Empty the old result and make the new one\n // ... don't do this if we're appending data\n if (!options || !options.append) {\n fileList.empty().hide();\n }\n\n if(!fv_flowplayer_scannedFolders.length && !fv_flowplayer_scannedFiles.length) {\n filemanager.find('.nothingfound').show();\n }\n else {\n filemanager.find('.nothingfound').hide();\n }\n\n if(fv_flowplayer_scannedFolders.length) {\n\n fv_flowplayer_scannedFolders.forEach(function(f) {\n var name = escapeHTML(f.name).replace(/\\/$/,'');\n fileList.append( jQuery(\n '<li class=\"folders attachment save-ready\">'\n + '<div class=\"attachment-preview js--select-attachment type-video subtype-mp4 landscape\">'\n + '<div class=\"thumbnail\">'\n + '<a href=\"' + f.path + '\" title=\"' + name + '\" class=\"folders\">'\n + '<span class=\"icon folder\"></span>'\n + '<div class=\"filename\">'\n + '<div>' + name + '</div>'\n + '</div>'\n + '</a>'\n + '</div>'\n + '</div>'\n + '</li>')\n );\n });\n }\n\n if(fv_flowplayer_scannedFiles.length) {\n\n fv_flowplayer_scannedFiles.forEach(function(f) {\n\n var\n name = escapeHTML(f.name),\n file = jQuery('<li tabindex=\"0\" role=\"checkbox\" aria-label=\"' + name + '\" aria-checked=\"false\" class=\"folders attachment save-ready\"></li>'),\n isPicture = name.match(/\\.(jpg|jpeg|png|gif)$/),\n icon = '';\n\n if( f.splash ) {\n icon = '<img src=\"' + f.splash + '\" draggable=\"false\" class=\"icon thumb\" title=\"' + name + '\" />';\n } else {\n var fileType = name.split('.');\n if( fileType.length > 1 ) {\n fileType = fileType[fileType.length-1];\n icon = '<span class=\"icon file f-'+fileType+'\" >.'+fileType+'</span>';\n } else {\n icon = '<span class=\"icon file\"></span>';\n }\n }\n\n file.append('<div class=\"attachment-preview js--select-attachment type-video subtype-mp4 landscape' + (options && options.extraAttachmentClass ? ' ' + options.extraAttachmentClass : '') + '\">'\n + '<div class=\"thumbnail\"' + (isPicture || (options && options.noFileName) ? ' title=\"' + name + '\"' : '') + '>'\n + icon\n + '<div class=\"filename' + (isPicture || (options && options.noFileName) ? ' hidden' : '') + '\">'\n + '<div data-modified=\"' + f.modified + '\" data-size=\"' + f.size + '\" data-link=\"' + f.link + '\"' + (f.duration ? ' data-duration=\"' + f.duration + '\"' : '') + ' data-extra=\\''+JSON.stringify(f.extra)+'\\'>' + name + '</div>'\n + '</div>'\n + '</div>'\n + '</div>' +\n '<button type=\"button\" class=\"check\" tabindex=\"0\">' +\n '<span class=\"media-modal-icon\"></span>' +\n '<span class=\"screen-reader-text\">Deselect</span>' +\n '</button>');\n\n file.appendTo(fileList);\n });\n\n if (options && options.loadMoreButtonAction) {\n fv_flowplayer_browser_add_load_more_button(fileList, options.loadMoreButtonAction);\n }\n\n }\n\n // Generate the breadcrumbs\n var url = '';\n if (filemanager.hasClass('searching')){\n url = '<span>Search results: </span>';\n fileList.removeClass('animated');\n } else {\n fileList.addClass('animated');\n\n var right_arrow = '<span class=\"arrow_sign\">→</span> ';\n breadcrumbsUrls.forEach(function (u, i) {\n var name = u.replace(/\\/$/,'').split('/');\n if( name.length > 1 ) {\n name.forEach(function (n, k) {\n var path = '';\n for( var j=0; j<k+1; j++ ) {\n path += name[j]+'/';\n }\n url += '<a href=\"'+path+'\"><span class=\"folderName\">'+n+'</span></a>';\n if( k < name.length-1 ) url += right_arrow;\n });\n }\n\n });\n }\n\n breadcrumbs.text('').append(url);\n fileList.show();\n fv_flowplayer_media_browser_setColumns();\n fileList.hide().fadeIn();\n }", "function ChequeAttachments(input, id) {\n\n if (input.files && input.files[0]) {\n\n var filerdr = new FileReader();\n filerdr.onload = function (e) {\n fileExtension = (input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)).replace(/^.*\\./, '');\n if (fileExtension == \"jpg\" || fileExtension == \"jpeg\" || fileExtension == \"pdf\" || fileExtension == \"png\") {\n\n document.getElementById(id + 'PhotoSource').value = e.target.result; //Generated DataURL\n document.getElementById(id + 'FileName').value = input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)\n }\n else {\n $(\"#\" + id).val(\"\");\n alert(\"Only Pdf/jpg/jpeg/png Format allowed\");\n }\n }\n filerdr.readAsDataURL(input.files[0]);\n }\n\n}", "function add_file_of_point(uid, fobj) {\n var tmp={\"uid\":uid,\"file\":fobj.name};\n ucvm_point_file_list.push(tmp);\n}", "function displayFileDetails(file, side){\n side.innerHTML = file.name + \" (\"+ file.size + \" bytes) has been selected. <br/> Last Modified: \" +\n (file.lastModifiedDate ? file.lastModifiedDate.toLocaleDateString() : 'n/a') + \". <br/><br/> To change files drop another file.\";\n }", "function validator(file) {\n for (var i = 0; i < blocked_dir.length; i++) {\n if (file.toLowerCase().indexOf(blocked_dir[i]) < 0) {\n return file;\n }\n }\n}", "getRelatedFiles() {\r\n relatedFiles({ idParent: this.currentOceanRequest.id })\r\n .then(data => {\r\n this.data = data;\r\n })\r\n .catch(error => {\r\n this.dispatchEvent(\r\n new ShowToastEvent({\r\n title: \"Error!!\",\r\n message: error.message,\r\n variant: \"error\"\r\n })\r\n );\r\n })\r\n .finally(() => {\r\n this.showLoadingSpinner = false;\r\n });\r\n }", "function addFlag() {\n const filename = arguments[0];\n const postfix = [].slice.call(arguments, 1).join('.');\n return filename.replace('.html', '.' + postfix + '.html');\n}", "function sendFile(id, option) {\n let fileReader = new FileReader();\n let files = document.getElementById(\"sendFile\").files; // Gets an array of our selected files\n for (let i in files) {\n if (files[i].name == option) { // Find the requested file\n\n fileReader.readAsArrayBuffer(files[i]); // Get the file as a byte array\n\n fileReader.onload = function (e) { // When the files is loaded into memory\n let binary = e.target.result;\n let blob = new File([binary], files[i]); // Make the byte array to a blob\n connections[id].dataChannel.send(blob); // Send the blob\n }\n return;\n }\n }\n}", "TemplateUpload(e) {\n let file = e.target.files[0];\n let fileType = file.type;\n let fileSize = file.size / 1024 / 1024;\n let fileName = file.name;\n let docFormat = fileName.split('.')[1];\n let validDocFormat = false;\n if(docFormat === 'doc'|| docFormat === 'docx' || docFormat === 'xls' || docFormat === 'xlsx'|| docFormat === 'pdf')validDocFormat= true;\n this.setState({ fileType: file.type, fileName: file.name, fileSize: fileSize});\n this.getCentralLibrary();\n if (this.state.totalLibrarySize < 50) {\n let fileExists = this.checkIfFileAlreadyExists(file.name, \"template\");\n let typeShouldBe = _.compact(fileType.split('/'));\n if (file && typeShouldBe && (typeShouldBe[0] == \"image\" || validDocFormat) ) {\n if (!fileExists) {\n let data = { moduleName: \"PROFILE\", actionName: \"UPDATE\" }\n let response = multipartASyncFormHandler(data, file, 'registration', this.onFileUploadCallBack.bind(this, \"template\"));\n } else {\n toastr.error(\"Template with the same file name already exists in your library\");\n }\n } else {\n toastr.error(\"Please select a Template Format\");\n }\n } else {\n toastr.error(\"Allotted library limit exceeded\");\n }\n }", "function getjobinfo_ivr_dtmf(dtmfin, job_num, callback) {\n \n var filename = '';\n fileNameListintro_tolisten[1].file = fileNameListintro_tolisten[1].file + dtmfin + '.wav';\n fileNameListintro_tolisten[1].varname = fileNameListintro_tolisten[1].varname + '_' + dtmfin;\n \n for (var i = 0, len = fileNameListintro_tolisten.length; i < len; i++) {\n filename += fileNameListintro_tolisten[i].varname;\n }\n \n \n fs.stat('/var/lib/asterisk/sounds/en/custom/' + 'dtmf_' + job_num + '_' + filename + '.wav', function (err, stat) {\n if (err == null) {\n console.log('File exists');\n \n callback('dtmf_' + job_num + '_' + filename);\n } else if (err.code == 'ENOENT') {\n \n console.log('no file')\n concat_audio_func_arr(fileNameListintro_tolisten, '/var/lib/asterisk/sounds/en/custom/' + 'dtmf_' + job_num + '_' + filename + '.wav');\n \n callback('dtmf_' + job_num + '_' + filename);\n } else {\n console.log('Some other error: ', err.code);\n\n\n }\n });\n\n\n \n\n }", "function createFilesHtml(id) {\n currentID = id;\n \n var fileChilds = getChildById(id);\n var filesHtml = '';\n if (fileChilds.length) {\n $('.pty').css('display','')\n for (var i = 0; i < fileChilds.length; i++) {\n filesHtml += `<div custome-id=\"${fileChilds[i].id}\" class=\"file-item\">\n <img src=\"img/folder-b.png\" alt=\"\">\n <span class=\"file-name\">${fileChilds[i].title}</span>\n <input type=\"text\" class=\"ditor\">\n <i></i>\n </div>`\n }\n }else{\n $('.pty').css('display','block')\n }\n return filesHtml;\n\n }", "_fileChanged(newValue,oldValue){if(typeof newValue!==typeof void 0){this.$.manifest.generateRequest()}}", "function AttachmentsCheque(input, Id) {\n if (input.files && input.files[0]) {\n\n var filerdr = new FileReader();\n filerdr.onload = function (e) {\n fileExtension = (input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)).replace(/^.*\\./, '');\n if (fileExtension == \"jpg\" || fileExtension == \"jpeg\" || fileExtension == \"pdf\" || fileExtension == \"png\") {\n\n document.getElementById(Id + 'PhotoSource').value = e.target.result; //Generated DataURL\n document.getElementById(Id + 'FileName').value = input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)\n }\n else {\n $(\"#\" + Id).val(\"\");\n alert(\"Only Pdf/jpg/jpeg/png Format allowed\");\n }\n }\n filerdr.readAsDataURL(input.files[0]);\n }\n\n}", "function photosUploaderOld(ent_id, entity, el) //добавление фотографий к сообщению\n\t{ \n\t\tvar link = '/'+entity+'s/' + ent_id + '/upload_photos?format=json'; \n\t\tel.find('#ph_to_msg').empty();\n\t\tel.find('#ph_to_msg').dropzone(\n\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\turl: link,\n\t\t\t\t\t\t\t\t\t\tacceptedFiles: \"image/*\",\n\t\t\t\t\t\t\t\t\t\tparamName: entity+\"[uploaded_photos]\",\n\t\t\t\t\t\t\t\t\t\tinputId: entity+\"_uploaded_photos\",\n\t\t\t\t\t\t\t\t\t\tforceFallback: false,\n\t\t\t\t\t\t\t\t\t\tsuccess: function(file, response){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar ph_id = response.photoID;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgetUploadedPhoto(ph_id, el, file.previewElement);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t\t\t\tfallback: function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar v;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tv='<div class = \"dz-message\"><p class = \"istring norm\">'+this.options.dictFallbackMessage+'</p></div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tv+= '<p class = \"istring norm\">'+this.options.dictFallbackText+'</p><br />';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$(el).find('#ph_to_msg').append(v);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$(el).find('#ph_to_msg').append($('#'+this.options.inputId).clone());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t}", "openFiles() {\n this.hideViewer();\n this.clearFilters();\n const errors = document.getElementById('marot-errors');\n errors.innerHTML = '';\n const filesElt = document.getElementById('marot-file');\n const numFiles = filesElt.files.length;\n if (numFiles <= 0) {\n document.body.style.cursor = 'auto';\n errors.innerHTML = 'No files were selected';\n return;\n }\n let erroneousFile = '';\n try {\n const filesData = [];\n const fileNames = [];\n let filesRead = 0;\n for (let i = 0; i < numFiles; i++) {\n filesData.push('');\n const f = filesElt.files[i];\n fileNames.push(f.name);\n erroneousFile = f.name;\n const fr = new FileReader();\n fr.onload = (evt) => {\n erroneousFile = f.name;\n filesData[i] = fr.result;\n filesRead++;\n if (filesRead == numFiles) {\n if (typeof marotDataConverter == 'function') {\n for (let i = 0; i < filesData.length; i++) {\n filesData[i] = marotDataConverter(fileNames[i], filesData[i]);\n }\n }\n this.setData(filesData);\n }\n };\n fr.readAsText(f);\n }\n /**\n * Set the file field to empty so that re-picking the same file *will*\n * actually reload it.\n */\n filesElt.value = '';\n } catch (err) {\n let errString = err +\n (errnoeousFile ? ' (file with error: ' + erroneousFile + ')' : '');\n errors.innerHTML = errString;\n filesElt.value = '';\n }\n }", "function matchGEOIDSync(options, callback) {\n var polyfile = resolve(options.polyfile);\n var pointfile = resolve(options.coordinatesfile);\n\n var polyGeoJSON = JSON.parse(fs.readFileSync(polyfile, {\n encoding: 'utf-8'\n }))\n var pointGeoJSON = JSON.parse(fs.readFileSync(pointfile, {\n encoding: 'utf-8'\n }));\n\n var newFile = doMatch(options,pointGeoJSON,polyGeoJSON);\n\n if (typeof callback === \"function\") {\n callback(null, newFile);\n } else {\n if (require.main == module) {\n //stdout\n console.log(JSON.stringify(newFile))\n } else {\n //return\n return newFile;\n }\n }\n}", "function fileAttachmentDataProvider() {\n\n var localFile = 'file://c:/local/package/file/batFile.bat';\n var urlFile = 'http://www.intuit.com/some/file/zipFile.zip';\n var httpsURLFile = 'https://www.intuit.com/some/file/zipFile.zip';\n var linkText = 'some link text';\n\n /**\n * FieldInfo and expectations for no flags\n */\n var fieldInfo_NoFlags = [{\n id : 7,\n name : 'file',\n datatypeAttributes: {\n type: 'FILE_ATTACHMENT'\n },\n type : 'CONCRETE'\n }];\n\n var recordInputLocalFile = [[{\n id : 7,\n value: localFile\n }]];\n var recordInputURLFile = JSON.parse(JSON.stringify(recordInputLocalFile));\n recordInputURLFile[0][0].value = urlFile;\n var recordInputHttpsURLFile = JSON.parse(JSON.stringify(recordInputLocalFile));\n recordInputHttpsURLFile[0][0].value = httpsURLFile;\n\n var expectedLocalFile_NoFlags = [[{\n id : 7,\n value : localFile,\n display: localFile\n }]];\n var expectedURLFile_NoFlags = JSON.parse(JSON.stringify(expectedLocalFile_NoFlags));\n expectedURLFile_NoFlags[0][0].value = urlFile;\n expectedURLFile_NoFlags[0][0].display = urlFile;\n var expectedHttpsURLFile_NoFlags = JSON.parse(JSON.stringify(expectedLocalFile_NoFlags));\n expectedHttpsURLFile_NoFlags[0][0].value = httpsURLFile;\n expectedHttpsURLFile_NoFlags[0][0].display = httpsURLFile;\n\n\n /**\n * FieldInfo and expectations for all flags\n */\n var fieldInfo_AllFlags = JSON.parse(JSON.stringify(fieldInfo_NoFlags));\n fieldInfo_AllFlags[0].datatypeAttributes.linkText = linkText;\n var expectedLocalFile_AllFlags = JSON.parse(JSON.stringify(expectedLocalFile_NoFlags));\n expectedLocalFile_AllFlags[0][0].value = localFile;\n expectedLocalFile_AllFlags[0][0].display = linkText;\n var expectedURLFile_AllFlags = JSON.parse(JSON.stringify(expectedLocalFile_NoFlags));\n expectedURLFile_AllFlags[0][0].value = urlFile;\n expectedURLFile_AllFlags[0][0].display = linkText;\n var expectedHttpsURLFile_AllFlags = JSON.parse(JSON.stringify(expectedLocalFile_NoFlags));\n expectedHttpsURLFile_AllFlags[0][0].value = httpsURLFile;\n expectedHttpsURLFile_AllFlags[0][0].display = linkText;\n\n /**\n * Expectations for empty and null URL values\n */\n var recordsNull = JSON.parse(JSON.stringify(recordInputLocalFile));\n recordsNull[0][0].value = null;\n var expectedNull = JSON.parse(JSON.stringify(expectedLocalFile_NoFlags));\n expectedNull[0][0].display = '';\n expectedNull[0][0].value = null;\n\n var recordsEmpty = JSON.parse(JSON.stringify(recordInputLocalFile));\n recordsEmpty[0][0].value = '';\n var expectedEmpty = JSON.parse(JSON.stringify(expectedLocalFile_NoFlags));\n expectedEmpty[0][0].display = '';\n expectedEmpty[0][0].value = '';\n\n var cases = [\n // No flags\n {message: 'FileAttachment - local file with no flags', records: recordInputLocalFile, fieldInfo: fieldInfo_NoFlags, expectedRecords: expectedLocalFile_NoFlags},\n {message: 'FileAttachment - http url file with no flags', records: recordInputURLFile, fieldInfo: fieldInfo_NoFlags, expectedRecords: expectedURLFile_NoFlags},\n {message: 'FileAttachment - https url file with no flags', records: recordInputHttpsURLFile, fieldInfo: fieldInfo_NoFlags, expectedRecords: expectedHttpsURLFile_NoFlags},\n\n // All flags\n {message: 'FileAttachment - local file with all flags', records: recordInputLocalFile, fieldInfo: fieldInfo_AllFlags, expectedRecords: expectedLocalFile_AllFlags},\n {message: 'FileAttachment - http url file with all flags', records: recordInputURLFile, fieldInfo: fieldInfo_AllFlags, expectedRecords: expectedURLFile_AllFlags},\n {message: 'FileAttachment - https url file with all flags', records: recordInputHttpsURLFile, fieldInfo: fieldInfo_AllFlags, expectedRecords: expectedHttpsURLFile_AllFlags},\n\n // Null and Empty File strings\n {message: 'FileAttachment - null -> empty string', records: recordsNull, fieldInfo: fieldInfo_NoFlags, expectedRecords: expectedNull},\n {message: 'FileAttachment - empty string -> empty string', records: recordsEmpty, fieldInfo: fieldInfo_NoFlags, expectedRecords: expectedEmpty}\n ];\n\n return cases;\n }", "function applyPatches(uniDiff, options) {\n if (typeof uniDiff === 'string') {\n uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);\n }\n\n var currentIndex = 0;\n function processIndex() {\n var index = uniDiff[currentIndex++];\n if (!index) {\n return options.complete();\n }\n\n options.loadFile(index, function (err, data) {\n if (err) {\n return options.complete(err);\n }\n\n var updatedContent = applyPatch(data, index, options);\n options.patched(index, updatedContent, function (err) {\n if (err) {\n return options.complete(err);\n }\n\n processIndex();\n });\n });\n }\n processIndex();\n}", "function addManager(data) {\n const managerDetail = new manager(data.id, data.name, data.email, data.officeNumber);\n //adding the data to the file\n const read = details(managerDetail);\n fs.appendFileSync('./src/file.html', read, (err) => {\n if (err) {\n console.log(err);\n }\n else {\n console.log(\"suceesfully appended in to the file\")\n }\n });\n //function to ask if wants to add more people\n addMore();\n}", "function loadFileEntry(_chosenEntry) {\r\n chosenEntry = _chosenEntry;\r\n chosenEntry.file(function(file) {\r\n readAsText(chosenEntry, function(result) {\r\n\t\t//\r\n\t\tdocument.getElementById('file_path').value = result;\r\n //textarea.value = result; /// NEED TO REPLACE NATE\r\n });\r\n // Update display.\r\n saveFileButton.disabled = false; // allow the user to save the content\r\n displayEntryData(chosenEntry);\r\n });\r\n}" ]
[ "0.5131443", "0.5131443", "0.5078335", "0.50472075", "0.5015782", "0.5003612", "0.4990771", "0.49460408", "0.49354964", "0.4924638", "0.4898594", "0.48498374", "0.48206264", "0.48168254", "0.48099968", "0.48027295", "0.477455", "0.47672355", "0.47606468", "0.4739204", "0.4734209", "0.4719078", "0.47134122", "0.47023842", "0.46947107", "0.46893695", "0.46772382", "0.46732655", "0.46720898", "0.46656385", "0.46630177", "0.46619707", "0.46561474", "0.46485308", "0.46373612", "0.46353158", "0.46352434", "0.4626147", "0.46088612", "0.46025023", "0.46012947", "0.4599342", "0.45891923", "0.45871913", "0.45834264", "0.45804718", "0.45803848", "0.45670372", "0.45658255", "0.4565412", "0.454862", "0.45474723", "0.45473483", "0.45466852", "0.45447654", "0.45396447", "0.4526305", "0.45226452", "0.45203015", "0.45075825", "0.4501302", "0.44989946", "0.44937074", "0.4484268", "0.44789496", "0.447734", "0.44699895", "0.44677392", "0.44653773", "0.4464245", "0.44580936", "0.44578138", "0.44538048", "0.44520858", "0.44435364", "0.44406793", "0.44402364", "0.44393307", "0.44387567", "0.44371423", "0.44370544", "0.4434083", "0.44324502", "0.44316208", "0.44275314", "0.44268107", "0.4425937", "0.4423049", "0.4422226", "0.44210622", "0.44186953", "0.44177565", "0.4415275", "0.4414502", "0.44143483", "0.44101194", "0.4409375", "0.44068247", "0.44056845", "0.44047496" ]
0.4534221
56
Generate a number between 0 3 ,zero is our targer
function randomChance() { return Math.floor(Math.random() * 3); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateNum() {\n\treturn Math.floor(Math.random()*100)\n}", "function genNum() {\n // 198 = 99 - (-99)\n return Math.floor((Math.random() * 198) - 99);\n}", "function genNum(){\n\trandomNum = Math.floor(Math.random() * Math.floor(numberMax + numberMin)) \n}", "function generateNumber() {\n return 5;\n}", "function randomNumberGenerate(min, max){\n return Math.floor(Math.random()*(max-min+1)+ min);\n //0.1 - 0.9\n //0.1 * (12 - 2 + 1) + 2 =\n }", "function rng(){\n return Math.floor(Math.random() * 3);\n}", "function getNumber(){\n return (1 + Math.floor(48 * Math.random()));\n}", "function crearNumeroAleatorio() {\n let number = Math.round(Math.random() * 10000);\n\n return number;\n}", "function generateTarget(num){\r\n return Math.floor(Math.random() * 10);\r\n}", "function generateTarget(num){\r\n return Math.floor(Math.random() * 10);\r\n}", "function randInt() {\n return Math.floor(Math.random()*3);\n}", "function generateNum() {\n goalNumber = Math.floor((Math.random() * 120) + 19);\n }", "function generateTarget(number) {\n return Math.floor(Math.random() * 10); \n}", "function generatoreNumeri(max){\n return Math.ceil(Math.random() * max);\n}", "function generateNum(min_value, max_value) {\n return Math.floor(Math.random() * (max_value - min_value) + min_value);\n }", "function generateNum() {\n return Math.round(Math.random() * 100);\n}", "function gen_random(){\r\n\treturn 0.3\r\n}", "function random(min=0,max=1,digits=0){digits=Math.pow(10,digits);min*=digits;nbr=Math.floor(Math.random()*(max*digits-min+1)+min);return nbr/digits;}", "function genNumb(min, max) {\n return parseInt(Math.random() * (max - min)) + min;\n}", "function randomNumber() {\n var rand = Math.ceil(Math.random() * 3);\n return rand;\n}", "function generateRandNum()\n{\n return Math.ceil(Math.random() * 10)\n}", "function randomNumberGenerator() {\n\treturn (Math.floor(((Math.random() * 9) + 1)));\n}", "function numberGenerator(min, max) {\n return min + Math.floor(Math.random() * max)\n}", "function generaNumeroCasuale (){\n return numero = Math.floor(Math.random()*100);\n}", "function randomNumberGenerator(){\n return (10+ Math.floor(Math.random()*(99-10+1)));\n}", "function randomint(){\n\tvar x = Math.floor(Math.random()*9);\n\treturn x;\n}", "function ranToRpsInt(){\n return Math.floor(Math.random()*3);\n \n}", "function getRandomNum(maxNum) {\n return Math.floor(Math.random() * 3);\n }", "function generateVal() {\n return Math.floor((Math.random() * 100) + 1);\n }", "function generateOneNumber() {\n const getRandomInt = (max) => {\n return Math.floor(Math.random() * Math.ceil(max));\n };\n while (true) {\n var output = getRandomInt(5);\n if (output % 2 === 0 && output !== 0){\n break;\n }\n }\n return output;\n }", "function randomNumberGenerator(){\n return Math.floor(Math.random()*1000);\n }", "function generateNumber() {\n return Math.floor(Math.random() * 256);\n }", "function triangularNumberGenerator(number) {\r\n if (number <= 0) {\r\n return number;\r\n }\r\n return triangularNumberGenerator(number - 1) + number;\r\n}", "function getRandomNum() {\n return Math.floor(1 + Math.random() * 10);\n}", "function cNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n}", "function getRandomNumber () {}", "function getRandomNum() {\n\treturn Math.floor(Math.random() * -999 + 2250);\n}", "function genValue(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function gen(input) {\n var seed = Long.fromNumber(input);\n seed = seed.mul(mul).add(0xB).and(mask);\n return seed.toNumber();\n}", "function genRanNum(min,max){\r\n return Math.floor(Math.random() * (max - min)) + min;\r\n}", "function numGenerate() {\n var crystalNumber = Math.floor(Math.random() * 12 + 1);\n return crystalNumber;\n}", "function sequencia3(num) {\n return 0\n}", "function generateRandomNumber(){\n return Math.floor((Math.random()*100)+1);\n }", "function randomNumber() {\n var min = 0;\n var max = 24;\n return Math.floor(Math.random() * (1 + max - min) + min);\n}", "function crystalNumber() {\n var minNumber = 1;\n var maxNumber = 12;\n var randomNumber = Math.floor(Math.random() * (maxNumber) + minNumber);\n return randomNumber;\n}", "static generateNumber(low = 1, high = 50) {\n return Math.floor(low + Math.random() * (high - low)); \n }", "function generateNumber(min, max) {\r\n return Math.floor(Math.random()* (max - min) + min);\r\n}", "function generateRandomlyNumber(){\n\treturn Math.floor(Math.random()*10)\n}", "function generateNumber() {\n return _.shuffle([1, 2, 3, 4, 5, 6, 7, 8, 9]).slice(0, 4);\n}", "function randomNum_1_10(){\n\treturn Math.random()*(10-1)+1;\n}", "function generateNumber(min, max){\n return Math.floor(Math.random() * (max - min) + min)\n}", "function randNum(){\n\tvar num = Math.floor(Math.random() * 9) +1 ;\n\treturn num;\n\n}", "function randomNumGen() {\n return Math.floor(Math.random() * 102) + 19;\n }", "function generateNumber() {\n result = Math.floor(Math.random() * 4) + 1\n return result\n}", "function aleatorio(max){\n return ~~(Math.random()*max);//retorno del numero aleatorio\n}", "function randomNumGenerator(min, max) {//function to get single powerball number\n\n var power = Math.round(Math.random() * (max - min)+ min);//randomly generate the single digit\n\nreturn power; //return power\n}", "function randomNumber(max, min, after) {\n if (max === void 0) { max = 1; }\n if (min === void 0) { min = 0; }\n if (after === void 0) { after = 3; }\n return (Math.floor(Math.random() * (Math.abs(max) + Math.abs(min)) * Math.pow(10, after)) / Math.pow(10, after)) + min;\n}", "range(max, min){\n let num = Math.round(Math.random()*(min-max)+max);\n return num;\n}", "function randomizer() {\n return Math.floor((Math.randon() * 3) + 1)\n}", "function randomizer() {\n return Math.floor((Math.randon() * 3) + 1)\n}", "function randomNumberGenerator(){\n return Math.floor(Math.random()*1000);\n}", "function getRandomNr() {\n return Math.floor(Math.random() * 10) + 300\n}", "function randomMaker(range) {\t\t\r\n\r\n var rand=Math.floor(range*Math.random());\r\n\r\n return rand;\r\n\r\n}", "static generateRandomInteger() {\n var int_ = Math.floor(0 + Math.random() * (1 + 1 - 0))\n switch (int_) {\n case 0:\n return -1.2;\n break;\n case 1:\n return 1.2;\n break\n }\n }", "function numeroAleatorio(min, max) {\n var num=Math.round(Math.random() * (max - min) + min);\n //console.log(num);\n return num;\n }", "function generateTarget() { \n return Math.floor(Math.random() * 9)\n;}", "function generateNumber(multiplier){\n\treturn Math.floor(Math.random() * multiplier);\n}", "randomNum() {\n return Math.floor(Math.random() * 600);\n }", "function generateRandomNumber(num){\r\n return Math.floor(Math.random() * num)\r\n}", "function random(num){\n return Math.floor(num*Math.random());\n}", "function getRandomNum(){\n var number = Math.floor(Math.random() * 9) + 1;\n return number;\n}", "function random (val) {\n return Math.floor(Math.random() * (val - 0) + 0)\n}", "function generateTarget() {\n return Math.floor(Math.random()* 9)\n}", "function generateRandomNumber() {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function myNumber(n) {\n return Math.floor(Math.random() * n);\n}", "function randomNumGen(num){\n return Math.floor(Math.random() * num );\n}", "function numberGenerator() {\n var numero = Math.floor(Math.random() * numeroTotaleGiocate) + 1;\n return numero;\n}", "function generateTwentytoZero() {\n\tvar integers = [];\n\tfor (var i = 20; i >= 0; i--) {\n\t\tintegers.push(i);\n\t}\n\treturn integers;\n}", "function rand() {\n var min = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1000;\n var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3000;\n var num = Math.random() * (max - min) + min;\n return Math.floor(num);\n}", "function randomNumberGenerator(min, max) {return Math.floor(Math.random() * (max - min + 1) ) + min;}", "function inning(){\n return Math.floor(Math.random() * 3);\n}", "function inning(){\n return Math.floor(Math.random() * 3);\n \n}", "function generateNumbers(){\n\tnumber1 = Math.ceil(Math.random()*maxNum);\n\tnumber2 = Math.ceil(Math.random()*maxNum);\n}", "function randomNumberGenerator() {\n return Math.floor(Math.random() * 102) + 19;\n}", "function getRandomInteger_zero_100() {\n return (Math.floor((Math.random()*100)+1));\n}", "function generarNumero(numero) {\n return (Math.random() * numero).toFixed(0);\n}", "function randomInt_1_10(){\n\treturn Math.floor(Math.random()*(10-1))+1;\n}", "function generateTime() {\n return Math.max(0.18, Math.floor(Math.random() * 25) / 100);\n}", "function generarNumero(numero){\n return (Math.random()*numero).toFixed(0);\n }", "function upToNumber(num){\n return Math.floor(Math.random()*num+1)\n}", "function rand_punti() {\n var numero = Math.floor(Math.random()*3);\n if (numero == 2) {\n numero = 3;\n }\n return numero;\n}", "function generateZeroToTwenty() {\n\tvar integers = [];\n\tfor (var i = 0; i < 20; i++) {\n\t\tintegers.push(i);\n\t}\n\treturn integers;\n}", "function R(n) { return Math.floor(n*Math.random()); }", "function randomNumber() {\n return Math.floor(Math.random() * (4 - 0) + 0);\n}", "function generateNum(min, max) {\n randomNumber = Math.floor(Math.random() * 100 + 1);\n console.log(randomNumber);\n}", "function casualNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function crystalRandom(min, max) {\nreturn Math.floor(Math.random() * (12 - 1 + 1)) + 1;\n}", "function generateNumber () {\n answer = Math.floor(Math.random()*(10));\n numberInGrid = puzzles[answer];\n }", "function generaNumero(min, max){\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n}", "function numberGen (min,max) {\n randomNumb = (Math.floor(Math.random() * (max - min +1)) + min);\n console.log(randomNumb)\n}", "function createTrainNum(){\n trainNum = (Math.floor(Math.random() * 9999))\n }" ]
[ "0.71028024", "0.7087485", "0.7009213", "0.7007363", "0.6976727", "0.6936445", "0.69149345", "0.69108915", "0.69089794", "0.69089794", "0.69051147", "0.69039285", "0.689765", "0.68817383", "0.6859779", "0.6857613", "0.68424106", "0.6842053", "0.68334466", "0.6813726", "0.6801089", "0.6794238", "0.6794125", "0.67879516", "0.6781862", "0.67645305", "0.67629945", "0.6758249", "0.6748817", "0.6745659", "0.6738373", "0.6730325", "0.6708515", "0.66977865", "0.6690247", "0.6679999", "0.6678387", "0.66732997", "0.66726005", "0.66674787", "0.6658723", "0.66585445", "0.66558367", "0.6648582", "0.6641985", "0.66358715", "0.6634588", "0.6634431", "0.6627138", "0.6626399", "0.66261476", "0.662461", "0.6622957", "0.66222835", "0.6617632", "0.6610736", "0.6609139", "0.660114", "0.6594419", "0.6594419", "0.65936834", "0.6593465", "0.6587924", "0.6582898", "0.6579866", "0.6575741", "0.6574341", "0.6551538", "0.6546227", "0.65449864", "0.6544418", "0.6537281", "0.6537153", "0.653505", "0.6526951", "0.6526922", "0.652246", "0.6522288", "0.651801", "0.6517455", "0.6515298", "0.6509853", "0.64993316", "0.6498432", "0.64958155", "0.6493959", "0.64939183", "0.64935714", "0.64827526", "0.6477614", "0.6474917", "0.64726484", "0.6468812", "0.64598954", "0.6459784", "0.6458766", "0.6458361", "0.64579135", "0.6454576", "0.64455533", "0.6442845" ]
0.0
-1
vuex v3.1.1 (c) 2019 Evan You
function n(t){var e=Number(t.version.split(".")[0]);if(e>=2)t.mixin({beforeCreate:r});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[r].concat(t.init):r,n.call(this,t)}}function r(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.parent.$store;}}", "function U(He){Le&&(He._devtoolHook=Le,Le.emit('vuex:init',He),Le.on('vuex:travel-to-state',function(Ne){He.replaceState(Ne)}),He.subscribe(function(Ne,je){Le.emit('vuex:mutation',Ne,je)}))}", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit() {\n\t var options = this.$options;\n\t var store = options.store;\n\t var vuex = options.vuex;\n\t // store injection\n\t\n\t if (store) {\n\t this.$store = store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t // vuex option handling\n\t if (vuex) {\n\t if (!this.$store) {\n\t console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n\t }\n\t var state = vuex.state;\n\t var getters = vuex.getters;\n\t var actions = vuex.actions;\n\t // handle deprecated state option\n\t\n\t if (state && !getters) {\n\t console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n\t getters = state;\n\t }\n\t // getters\n\t if (getters) {\n\t options.computed = options.computed || {};\n\t for (var key in getters) {\n\t defineVuexGetter(this, key, getters[key]);\n\t }\n\t }\n\t // actions\n\t if (actions) {\n\t options.methods = options.methods || {};\n\t for (var _key in actions) {\n\t options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n\t }\n\t }\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = typeof options.store === 'function'\n\t ? options.store()\n\t : options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\r\n var options = this.$options;\r\n // store injection\r\n if (options.store) {\r\n this.$store = typeof options.store === 'function'\r\n ? options.store()\r\n : options.store;\r\n } else if (options.parent && options.parent.$store) {\r\n this.$store = options.parent.$store;\r\n }\r\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexlocal() {\n return store => {\n // 判断是否有本地缓存如果有就取本地缓存的如果没有就取自身初始值\n let local = JSON.parse(localStorage.getItem('myVuex')) || store.replaceState(state)\n store.replaceState(local); // 替换state的数据\n store.subscribe((mutation,state) => { // 监听\n // 替换之前先取一次防止数据丢失\n let newstate = JSON.parse(JSON.stringify(state))\n localStorage.setItem('myVuex',JSON.stringify(newstate))\n })\n }\n}", "loadVuex() {\n let keys = Object.keys(settings)\n keys.forEach(this.__loadVuexModule)\n }", "getTokenVuex() {\n return store.getters.jwt;\n }", "users() {\n return this.$store.getters.users\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function t(e){var l=Number(e.version.split(\".\")[0]);if(l>=2)e.mixin({beforeCreate:t});else{var a=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[t].concat(e.init):t,a.call(this,e)}}function t(){var e=this.$options;e.store?this.$store=\"function\"===typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }" ]
[ "0.71114504", "0.70059747", "0.6747754", "0.6744582", "0.662208", "0.662208", "0.662208", "0.6618358", "0.6592901", "0.6487492", "0.63576543", "0.63523763", "0.63509184", "0.63509184", "0.63509184", "0.63509184", "0.63509184", "0.6339643", "0.6321553", "0.62844443", "0.62812215", "0.62554806", "0.6253598", "0.6253598", "0.6253598", "0.6253598", "0.6253598", "0.62428135", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016", "0.6232016" ]
0.0
-1
! vuerouter v3.0.6 (c) 2019 Evan You
function r(t,e){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function version(){ return \"0.13.0\" }", "function TM(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function BO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function yh(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"graticule.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Qw(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function fyv(){\n \n }", "function Uk(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function iP(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "vampireWithName(name) {\n \n }", "transient private internal function m185() {}", "function cO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "upgrade() {}", "function Bv(e){let{basename:t,children:n,window:r}=e,l=X.exports.useRef();l.current==null&&(l.current=gv({window:r}));let o=l.current,[i,u]=X.exports.useState({action:o.action,location:o.location});return X.exports.useLayoutEffect(()=>o.listen(u),[o]),X.exports.createElement(Fv,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:o})}", "function Wx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function vT(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "function ow(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "transient final protected internal function m174() {}", "protected internal function m252() {}", "function Ak(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "updated() {}", "function SigV4Utils() { }", "function Rb(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Hr(e,t){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function dp(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function PD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function jx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function JV(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function Ek(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function VI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "transient protected internal function m189() {}", "function hA(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function comportement (){\n\t }", "transient private protected internal function m182() {}", "added(vrobject){}", "function vI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function uf(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "static get tag(){return\"hal-9000\"}", "function $S(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }" ]
[ "0.5984435", "0.58520705", "0.5815317", "0.5757029", "0.5727303", "0.57165563", "0.56561184", "0.55692035", "0.5557477", "0.5542094", "0.5522843", "0.55133104", "0.5479876", "0.5443766", "0.5443255", "0.5442146", "0.5415237", "0.53994054", "0.5397749", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5375185", "0.5365419", "0.5356666", "0.53560793", "0.5343835", "0.5342185", "0.53313607", "0.5325359", "0.53251964", "0.53111744", "0.5306781", "0.52918696", "0.52868605", "0.5285962", "0.52641785", "0.5258393", "0.5245731", "0.5245004", "0.52350897", "0.52246255", "0.521577", "0.52057785", "0.5200264", "0.51914424", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269", "0.5162269" ]
0.0
-1
Initialize function, receives a DomElementId string and assigns the Dom Element to el for future use.
function init(domElementId, callback){ el = document.getElementById(domElementId); //Render the Layout in Dom Element el el.innerHTML = Layout(); //Assign DOM Elements txtCreateItem = document.getElementById("txt-create-item"); btnCreateItem = document.getElementById("btn-create-item"); //Register button onclick event btnCreateItem.onclick = onCreateItem; // onCreateItemCallback = callback; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init(domElementId){\n\tel = document.getElementById(domElementId)\n\t//Returns Todo List to simplify Jquery Style Chaining API\n\treturn TodoList;\n}", "constructor(el) {\n this.el = el || {};\n }", "constructor(element) {\r\n this.element = document.getElementById(element)\r\n }", "constructor(el) {\n this.el = el;\n }", "setEl(el) {\n this.el = el;\n }", "constructor(selector){\n this.el = document.querySelector(selector);\n this._init();\n }", "function ViewElement(id) {\n this.el = document.getElementById(id);\n if (!this.el) {\n shutdown('element missing');\n }\n }", "make(_targetId, _tagName, _options) {\n if (!_targetId) {\n _targetId = 0;\n }\n if (!_tagName) {\n _tagName = 'DIV';\n }\n else {\n _tagName = _tagName.toUpperCase();\n }\n const _elem = document.createElement(_tagName);\n const _id = this._add(_elem);\n this._initCache(_id);\n if (_options) {\n let _attrs;\n if (this.isntNullOrUndefined(_options.attrs)) {\n _attrs = _options.attrs;\n }\n else if (this.isntNullOrUndefined(_options.attr)) {\n _attrs = _options.attr;\n }\n if (this.isObjectOrArray(_attrs)) {\n if (this.isObject(_attrs)) {\n _attrs = Object.entries(_attrs);\n }\n if (this.isArray(_attrs)) {\n _attrs.forEach(([_key, _value]) => {\n this.setAttr(_id, _key, _value, true);\n });\n }\n }\n const _classes = _options.classes;\n if (this.isArray(_classes)) {\n _classes.forEach(_className => {\n this.addClassName(_id, _className);\n });\n }\n if (_options.styles) {\n this.setStyles(_id, _options.styles);\n }\n if (_options.html) {\n this.setHTML(_id, _options.html);\n }\n }\n if (this._elements[_targetId] !== _elem.parentNode) {\n this._elements[_targetId].appendChild(_elem);\n }\n return _id;\n }", "make(_targetId, _tagName, _options) {\n if (!_targetId) {\n _targetId = 0;\n }\n if (!_tagName) {\n _tagName = 'DIV';\n }\n else {\n _tagName = _tagName.toUpperCase();\n }\n const _elem = document.createElement(_tagName);\n const _id = this._add(_elem);\n this._initCache(_id);\n if (_options) {\n let _attrs;\n if (this.isntNullOrUndefined(_options.attrs)) {\n _attrs = _options.attrs;\n }\n else if (this.isntNullOrUndefined(_options.attr)) {\n _attrs = _options.attr;\n }\n if (this.isObjectOrArray(_attrs)) {\n if (this.isObject(_attrs)) {\n _attrs = Object.entries(_attrs);\n }\n if (this.isArray(_attrs)) {\n _attrs.forEach(([_key, _value]) => {\n this.setAttr(_id, _key, _value, true);\n });\n }\n }\n const _classes = _options.classes;\n if (this.isArray(_classes)) {\n _classes.forEach(_className => {\n this.addClassName(_id, _className);\n });\n }\n if (_options.styles) {\n this.setStyles(_id, _options.styles);\n }\n if (_options.html) {\n this.setHTML(_id, _options.html);\n }\n }\n if (this._elements[_targetId] !== _elem.parentNode) {\n this._elements[_targetId].appendChild(_elem);\n }\n return _id;\n }", "constructor(element) {\n super();\n this._element = element;\n }", "constructor(el) {\n this.el = el;\n this.emptyCheckbox = this.el.parentElement.querySelector('.checkbox-empty');\n this.tickCheckbox = this.el.parentElement.querySelector('.checkbox-tick');\n\n this.init();\n }", "loadElements()\n {\n\n this.el = {};\n\n document.querySelectorAll('[id]').forEach(element => \n {\n this.el[Format.getCamelCase(element.id)] = element\n });\n }", "function constructor(domRoot) {\n\t\t// this._event = null\n\t\t_findElements(domRoot);\n\t}", "function $el(id) {\n if (typeof id === 'string') {\n return document.getElementById(id);\n }\n return id;\n }", "set id(id) {\n if (this.#el) this.#el.id = id;\n else this.#id = id;\n }", "function init(el) {\n if( el == 'undefined' ) {\n el = $('body');\n }\n // Activate plugins\n activateDropdowns(el);\n activateSelects(el);\n activateTextareas(el);\n activateTooltips(el);\n setActiveFieldTypes(el);\n activateSortable(el);\n activateModals(el);\n}", "constructor(element) {\n this.element = element;\n }", "constructor( element ) {\n this.$element = $(element);\n this.initialize();\n }", "constructor () {\n\n\t\t// Set the wrapper class\n\t\tthis.base_class = 'main';\n\n\t\t// Store the main element\n\t\tthis.el = document.getElementById(this.base_class);\n\n\t}", "function el(id) {\n return document.getElementById(id);\n}", "function el(elementid) {\n if (document.getElementById) {\n return document.getElementById(elementid);\n } else if (window[elementid]) {\n return window[elementid];\n }\n}", "setElement(elem) {\n this.element = elem;\n }", "constructor (el) {\n this.el = el;\n\n console.log('I am a sample component instantiated by using data-component=\"sample-component\" (which corresponds with the folder /js/components/sample-component) and I am instantiated on the following DOM node:');\n console.log(this.el);\n }", "initElement(root) {\n\t\tthis.dom = {\n\t\t\tcard_box : root,\n\t\t};\n\n\t\tthis.template = {\n\t\t\tcardTemplate: `\n\t\t\t<div class=\"card_item ship-card\" id=\"{id}\">\n\t\t\t\t<div class=\"card_clickable\">\n\t\t\t\t\t<div class=\"card_title\">{title}</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"card_content\">\n\t\t\t\t\t<ul id=\"ship-group\" class=\"dot_box\">\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t`\n\t\t};\n\t}", "function el(id)\n{\n\tif (document.getElementById)\n\t{\n\t\treturn document.getElementById(id);\n\t}\n\telse if (window[id])\n\t{\n\t\treturn window[id];\n\t}\n\treturn null;\n}", "function ElementFactory() {\n this._uid = 12;\n }", "init() {\n // override init to make sure createEl is not triggered\n }", "construct(element) {\n this._currentElement = element;\n }", "constructor(el, dragEl) {\n this.el = el;\n this.dragEl = dragEl || el;\n this.mousePosition = null;\n this.offset = [0,0];\n this.isDown = false;\n this.init();\n this.moved = false;\n }", "function initElement(el) {\n // samurize() jQuery plugin (below) calls this to make an element editable\n var $el = $(el);\n\n // Do not re-apply\n if ($el.data('cmsItem'))\n return;\n\n var cmsItem = _getCmsItemInfo($el);\n if (!cmsItem) { // apparently we couldn't get hold of any cmsItemInfo\n return;\n }\n $el.data('cmsItem', cmsItem);\n\n // Ignore this element altogether if this is specified in its attributes\n if (cmsItem.ignoreMe)\n return;\n\n // If we have set \"parent\" containers for SamuraiCMS, we should ignore any \n // elements which fall outside of these containers.\n if (samuraiContainers && !$el.parents().filter(samuraiContainers).length) {\n // Remove any cmsitem'y classes from elements which aren't enabled for SamuraiCMS\n $el.removeClass('sm-js-cmsitem')\n .removeClass('sm-js-cmsitem_editable')\n .removeClass('sm-js-cmsitem_linkable');\n return;\n }\n if (typeof $(mov.vars.samuraiContainerBlockSelector) != \"undefined\" && $(mov.vars.samuraiContainerBlockSelector) && $el.parents().filter($(mov.vars.samuraiContainerBlockSelector)).length) {\n // Remove any cmsitem'y classes from elements which aren't enabled for SamuraiCMS\n $el.removeClass('sm-js-cmsitem')\n .removeClass('sm-js-cmsitem_editable')\n .removeClass('sm-js-cmsitem_linkable');\n return;\n }\n\n // Turn \"page\" linkable into special addSkipped-style entry\n if (cmsItem.isPage) {\n _$id('skippedItemsDropdown').addClass(_cls.dropdownContainsPage);\n _$id('skippedCmsItemsLinkable')\n .html('Content on this page is drawn from: ')\n .append($(\n '<a ' +\n 'href=\"' + cmsItem.href + '\" ' +\n 'title=\"Samurai Admin - Edit ' + cmsItem.type + \" #\" + cmsItem.id + '\" ' +\n 'target=\"_blank\">' +\n cmsItem.type + ' #' + cmsItem.id +\n '</a>'\n ));\n $el.remove();\n return;\n }\n\n // Wire-up cms item\n $el.mouseenter(_cmsItem_onMouseEnter);\n $el.mouseleave(_cmsItem_onMouseLeave);\n\n // Give item-list items (containers) a special appearance\n if (cmsItem.actions['add-child']) {\n $el.addClass(_cls.cmsItemContainer);\n }\n\n // Ensure inline elements highlight like a box (not like a set of line-boxes)\n if (_getComputedStyle($el[0], 'display') == 'inline') {\n var hasChildren = $el.children().length != 0;\n \n var message_id = $el.attr('message_id');\n\n var hasBlockChildren = hasChildren && _getComputedStyle($el.children()[0], 'display') == 'block' && $el.children()[0].tagName.toLowerCase() != 'img';\n\n // Need \"inline-block\" instead of \"black\" for display, if the element contains other block elements (except images), and we also don't worry about WYSIYWG snippet types\n var disp = ( hasBlockChildren || _displayCmsItemAsBlock( cmsItem ) ) ? 'block' : 'inline-block';\n\n if (hasChildren) {\n // Sections commented out to fix MOV2360-28 - underline missing from login\n $el.css({\n 'display': disp,\n //'display': 'block' ,\n 'zoom': 1,\n 'text-indent': 0\n });\n }\n }\n }", "constructor (element) {\n super(element);\n }", "function initElement(eleType, eid)\r\n{\r\n\tswitch(eleType)\r\n\t{\r\n\t\tcase \"textArea\":\r\n\t\t\tdocument.querySelector(\"#tae-\" + eid).addEventListener(\"click\", function(){editTA(eid)});\r\n\t\t\tdocument.querySelector(\"#tas-\" + eid).addEventListener(\"click\", function(){saveTA(eid)});\r\n\t\t\tdocument.querySelector(\"#tad-\" + eid + \"-0\").addEventListener(\"click\", function(){deleteElement(eid)});\r\n\t\t\tdocument.querySelector(\"#tad-\" + eid + \"-1\").addEventListener(\"click\", function(){deleteElement(eid)});\r\n\t\tdefault:\r\n\t\t\t// do nothing\r\n\t}\r\n}", "function domElement() {\n this.class = [];\n this.id = \"\";\n this.attributes = [];\n this.rightSibling = undefined;\n this.leftSibling = undefined;\n this.child = undefined;\n this.level = undefined;\n\n this.addChildElement = function (element) {\n this.child = element;\n };\n\n this.addSibling = function (element) {\n this.rightSibling = element;\n };\n }", "constructor(el) {\n this.$root = el;\n this.cache_key = null;\n this.cache_value = null;\n }", "constructor(theElement) {\n this(theElement, null, null);\n }", "constructor(ele) {\n super(ele);\n }", "function ElementFactory() {\n this._uid = 12;\n}", "function ElementFactory() {\n this._uid = 12;\n}", "function ElementFactory() {\n this._uid = 12;\n}", "function ElementFactory() {\n this._uid = 12;\n}", "constructor(alertId){\n this.alert = document.getElementById(alertId);\n }", "_makeElem(_parentElemId) {\n this.elemId = ELEM.make(_parentElemId, this.cellTagName);\n ELEM.setAttr(this.elemId, 'view_id', this.viewId, true);\n ELEM.setAttr(this.elemId, 'elem_id', this.elemId, true);\n Object.entries(this.cellTagAttrs).forEach(([key, value]) => {\n ELEM.setAttr(this.elemId, key, value, true);\n });\n }", "function El(tag) {\n this.el = document.createElement(tag);\n this;\n}", "constructor(element) {\r\n super(element); \r\n this.element = element;\r\n this.attributeManager = new AttributeManager(this.element);\r\n }", "constructor(element) {\r\n super(element); \r\n this.element = element;\r\n this.attributeManager = new AttributeManager(this.element);\r\n }", "constructor(element) {\r\n super(element); \r\n this.element = element;\r\n this.attributeManager = new AttributeManager(this.element);\r\n }", "setElement(element) {\n this.element = element;\n }", "function _initElement(htOptions){\n htElement.welUploader = $(\"#upload\");\n htElement.welTextarea = $('textarea[data-editor-mode=\"content-body\"]');\n htElement.welAttachments = $(\".attachments\");\n htElement.welBtnWatch = $('#watch-button');\n htElement.welComment = $('#comments');\n htElement.welBtnHelp = $('#helpBtn');\n htElement.welMsgHelp = $('#helpMessage');\n htElement.welState = $(\"#state\");\n htElement.welBtnAccept = $(\"#btnAccept\");\n }", "elem(DOMelem) {\n this.element = DOMelem;\n return this;\n }", "set el(el) {\n this.#el = el;\n\n if (this.#value) {\n this.value = this.#value;\n this.#value = null;\n }\n\n if (this.#innerHTML) {\n this.innerHTML = this.#innerHTML;\n this.#innerHTML = null;\n }\n\n if (this.#textContent) {\n this.textContent = this.#textContent;\n this.#textContent = null;\n }\n\n if (this.#innerText) {\n this.innerText = this.#innerText;\n this.#innerText = null;\n }\n\n if (this.#id) {\n this.id = this.#id;\n this.#id = null;\n }\n\n if (this.#className) {\n this.className = this.#className;\n this.#className = null;\n }\n\n if (this.#classList.length) {\n this.#classList.forEach(c => this.classList.add(c));\n this.#classList.length = 0;\n }\n\n if (this.#children.length) {\n this.append(...this.#children);\n this.#children.length = 0;\n }\n\n const attrProps = Object.keys(this.#attr);\n if (attrProps.length) {\n attrProps.forEach(p => this.attr(p, this.#attr[p]));\n this.#attr = {};\n }\n\n const styleProps = Object.keys(this.#style);\n if (styleProps.length) {\n styleProps.forEach(p => this.style[p] = this.#style[p]);\n this.#style = {};\n }\n\n const datasetProps = Object.keys(this.#dataset);\n if (datasetProps.length) {\n datasetProps.forEach(p => this.dataset[p] = this.#dataset[p]);\n this.#dataset = {};\n }\n\n this.#emit('ref', el);\n }", "function addIdTo(el) {\n var id = el.attributes[0].name;\n var i = 0;do {\n el = el.parentNode;\n if (el.id === '') el.id = id + (i === 0 ? '' : '_' + i);\n ++i;\n } while (el.parentNode.tagName !== 'BODY');\n}", "createDomElements(id) {\n this.li = document.createElement('li');\n this.edit = document.createElement('button');\n this.delete = document.createElement('button');\n\n this.edit.classList.add('btn-edit');\n this.delete.classList.add('btn-delete');\n\n this.delete.setAttribute('data-id', id);\n this.edit.setAttribute('data-id', id);\n\n this.edit.innerHTML = 'Edit';\n this.delete.innerHTML = 'Delete';\n\n this.li.appendChild(this.delete);\n this.li.appendChild(this.edit);\n }", "Initialize() \n {\n this.UpdateElementDeclaration();\n }", "constructor() {\n this.id = undefined;\n this.headerTitle = undefined;\n \n // Structure for a button element\n this.buttonElement = function() {\n return {\n tagName: \"button\",\n onClick: null,\n text: null\n };\n };\n \n // Structure for a select element\n this.selectElement = function() {\n return {\n desc: null,\n tagName: \"select\",\n id: null,\n onChange: null,\n value: null,\n text: null\n };\n };\n \n // Structure for a text element\n this.textElement = function() {\n return {\n tagName: \"p\",\n text: null\n };\n }\n \n // List of element(s) to generate\n this.elementList = [];\n }", "static buildDom(el) {\n var smoDomBuilder = function (el) {\n this.e = $('<' + el + '/>');\n var self = this;\n this.classes = function (cl) {\n $(self.e).addClass(cl);\n return self;\n }\n this.html = function(value) {\n $(self.e).html(value);\n return self;\n }\n this.data = function (name, value) {\n $(self.e).attr('data-' + name, value);\n return self;\n }\n this.attr = function (name, value) {\n $(self.e).attr(name, value);\n return self;\n }\n this.prop = function (name, value) {\n $(self.e).prop(name, value);\n return self;\n }\n this.css = function (name, value) {\n $(self.e).css(name, value);\n return self;\n }\n this.append = function (el) {\n $(self.e).append(el.e);\n return self;\n }\n this.text = function (tx) {\n $(self.e).append(document.createTextNode(tx));\n return self;\n }\n this.dom = function () {\n return self.e;\n }\n return this;\n }\n return new smoDomBuilder(el);\n }", "function getElById(el) {\n return document.getElementById(el);\n}", "getElementById(id) {\n return this.root.querySelector(`#${id}`);\n }", "function ElementFactory$1() {\n this._uid = 12;\n}", "_init() {\n const id = this.$element[0].id || GetYoDigits(6, 'smooth-scroll-with-links');\n this.$element.attr({ id });\n\n this._events();\n }", "function id(el){\n return document.getElementById(el);\n}", "constructor(width, el) {\n this.width = width;\n\n this.el = el;\n }", "function addElement(id) {\n // generate new div Element\n var newDiv = document.createElement(\"div\");\n // insert to DOM\n document.body.insertBefore(newDiv, null);\n //provide ID and style\n newDiv.id = id;\n //newDiv.style.cssText = css;\n}", "function injectElement(DOMElement, elementName) {\n this.createElement = document.createElement(elementName);\n this.element = document.querySelectorAll(DOMElement);\n for (let i = 0; i < this.element.length; i++) {\n this.attr = this.element[i].appendChild(this.createElement);\n }\n}", "_init() {\n var $id = this.$element.attr('id');\n\n this.$anchor = $(`[data-toggle=\"${$id}\"]`).length ? $(`[data-toggle=\"${$id}\"]`) : $(`[data-open=\"${$id}\"]`);\n this.$anchor.attr({\n 'aria-controls': $id,\n 'data-is-focus': false,\n 'data-yeti-box': $id,\n 'aria-haspopup': true,\n 'aria-expanded': false\n\n });\n\n if(this.options.parentClass){\n this.$parent = this.$element.parents('.' + this.options.parentClass);\n }else{\n this.$parent = null;\n }\n this.options.positionClass = this.getPositionClass();\n this.counter = 4;\n this.usedPositions = [];\n this.$element.attr({\n 'aria-hidden': 'true',\n 'data-yeti-box': $id,\n 'data-resize': $id,\n 'aria-labelledby': this.$anchor[0].id || Foundation.GetYoDigits(6, 'dd-anchor')\n });\n this._events();\n }", "setElement(newElement) {\n this.#element = newElement;\n }", "initializeElements () {\n this.$els = {\n window,\n body: document.body\n }\n }", "function getElementById(id) {\n\t\tvar el = null;\n\t\ttry {\n\t\t\tel = doc.getElementById(id);\n\t\t} catch (e) {}\n\t\treturn el;\n\t}", "constructor(id) {\n if(id) this.id = id;\n }", "function init({domId, style}) {\n // The element gets found in the DOM by a querySelector with the passed attribute\n const foundElement = document.querySelector(`#${domId}`)\n \n // apply passed settings on DOM element\n foundElement.style.backgroundColor = style.backgroundColor;\n foundElement.style.height = `${style.height}px`;\n foundElement.style.width = `${style.width}px`;\n \n // Parameters get displayed in the DOM\n foundElement.innerText = `turnOn has passed this data: ${JSON.stringify({domId, style})}`;\n }", "function getElementById(id) {\n\t\tvar el = null;\n\t\ttry {\n\t\t\tel = doc.getElementById(id);\n\t\t}\n\t\tcatch (e) {}\n\t\treturn el;\n\t}", "function getElementById(id) {\n\t\tvar el = null;\n\t\ttry {\n\t\t\tel = doc.getElementById(id);\n\t\t}\n\t\tcatch (e) {}\n\t\treturn el;\n\t}", "function getElementById(id) {\n\t\tvar el = null;\n\t\ttry {\n\t\t\tel = doc.getElementById(id);\n\t\t}\n\t\tcatch (e) {}\n\t\treturn el;\n\t}", "createAnElement(tag, id, store_here){\n store_here = store_here || this.elements;\n const element = document.createElement(tag);\n this.addElement(element, id, store_here);\n return element;\n }", "function getElementById(id) {\n var el = null;\n try {\n el = doc.getElementById(id);\n }\n catch (e) { }\n return el;\n }", "function Dom(seletor) {\n this.element = document.querySelector(seletor);\n}", "function getEl(id){\n\treturn document.getElementById(id);\n}", "wrap(el) {\n this.el = [el];\n\n return this;\n }", "_init() {\n var id = this.$element[0].id || Foundation.GetYoDigits(6, 'magellan');\n var _this = this;\n this.$targets = $('[data-magellan-target]');\n this.$links = this.$element.find('a');\n this.$element.attr({\n 'data-resize': id,\n 'data-scroll': id,\n 'id': id\n });\n this.$active = $();\n this.scrollPos = parseInt(window.pageYOffset, 10);\n\n this._events();\n }", "constructor(element) {\n this.element = element;\n this.next = null;\n }", "function getElementById(id) {\n var el = null;\n try {\n el = doc.getElementById(id);\n }\n catch (e) {}\n return el;\n }", "function getElementById(id) {\n var el = null;\n try {\n el = doc.getElementById(id);\n }\n catch (e) {}\n return el;\n }", "createNode(el) {\n\t\t\treturn document.createElement(el);\n\t\t}", "function $(id){const el=document.getElementById(id);return el?assertInstanceof(el,HTMLElement):null}", "constructor(id, el, events, ato)\n {\n this.ato = ato\n this.events = events\n this.State = new State(events.state || {})\n\n this.initialData = { id, el, ato }\n this.after = {}\n\n this.detach('state')\n }", "constructor (el = '', options = {}) {\n super();\n\n this.elbindEvent(el);\n this.createTranslateModal();\n }", "constructor(options, element) {\n super(options, element);\n }", "constructor(options, element) {\n super(options, element);\n }", "constructor(holderelemid, config = {}) {\n\n this.config = Object.assign({\n otpLength : 4,\n boxSize : \"40px\",\n boxColor : \"#d35400\",\n fontSize : \"27px\",\n inputType : \"number\",\n letters : \"\", //uppercase, lowercase, mixed\n }, config); // assign default config with new config\n\n this.holderelemid = holderelemid;\n this.holderelem = document.querySelector(holderelemid);\n }", "function init(el) {\r\n var $el = $(el);\r\n\r\n if ($el.data('initialized')) {\r\n return;\r\n } else {\r\n $el.data('initialized', true);\r\n }\r\n\r\n // When mouse enters the box (Mouse Desktop)\r\n $el.on('mouseenter', box_mouseenterHandler);\r\n\r\n // When mouse leaves the box (Mouse Desktop)\r\n $el.on('mouseleave', box_mouseleaveHandler);\r\n\r\n // When touch starts (Touch Devices)\r\n $el.on('touchstart', box_touchstartHandler);\r\n\r\n // When touch starts moving (scrolling most likely) (Touch Devices)\r\n $el.on('touchmove', box_touchmoveHandler);\r\n\r\n // When touch ends (Touch Devices)\r\n $el.on('touchend', box_touchendHandler);\r\n }", "function el(x){\n return document.getElementById(x);\n }", "function getEl(id) {\n return document.getElementById(id)\n}", "function domdomElement(element) {\n _classCallCheck(this, domdomElement);\n\n this.DOMDOMELEMENT = true;\n this.element = element;\n return this;\n }", "function Element(id,elementName){this.id=id;this.elementName=elementName; /** The indices of the data items in this set */this.items=[]; /** The number of elements in this (sub)set */this.setSize=0; /** The ratio of elements that are contained in this set */this.dataRatio=0.0;}", "constructor(element) \n\t{ \n\t\tthis.element = element; \n\t\tthis.next = null\n\t}", "constructor(elemento) {\n super(elemento);\n }", "function getElemental() {\n if (elemental) return;\n\n // Initialize the elemental\n elemental = settings.elemental(name.el, settings.elementalOptions);\n\n if (!elemental || elemental instanceof HTMLElement) {\n elemental = Storage.get(name.el, `elementals.${settings.elementalName}`);\n }\n\n if (elemental) {\n elemental.id = settings.id;\n } else {\n console.debug(`Expected instance of ${settings.elementalName} is not available.`);\n }\n }", "function ElementNode(domElement){\n\t\n\tthis.id = domElement.id;\n\tthis.length = domElement.getAttribute(\"length\");\n\tthis.volume = domElement.getAttribute(\"volume\");\n\t\n\t// indicates whether note is regular, legato, staccato, or glide \n\tthis.style = domElement.getAttribute(\"type\");\n}", "function $(el){\n\tif (!el) return false;\n\tif (el._element_extended_ || [window, document].test(el)) return el;\n\tif ($type(el) == 'string') el = document.getElementById(el);\n\tif ($type(el) != 'element') return false;\n\tif (['object', 'embed'].test(el.tagName.toLowerCase()) || el.extend) return el;\n\tel._element_extended_ = true;\n\tGarbage.collect(el);\n\tel.extend = Object.extend;\n\tif (!(el.htmlElement)) el.extend(Element.prototype);\n\treturn el;\n}", "constructor(tableId) {\n this.tableId = tableId;\n this.htmlTagFactory = new HtmlTagElementFactory();\n this.tableDom = $(tableId);\n this.emptyTable();\n this.buildTableHeader();\n }", "function ElemId(id){\n\treturn document.getElementById(id);\n}" ]
[ "0.75144947", "0.70310915", "0.68899244", "0.683086", "0.63798684", "0.62945586", "0.62626094", "0.6224272", "0.6224272", "0.6168347", "0.6155521", "0.60777074", "0.60751295", "0.5937388", "0.59264463", "0.5925393", "0.58982545", "0.5882771", "0.5844314", "0.5837004", "0.58041257", "0.57954496", "0.57474893", "0.5743636", "0.5733833", "0.57212913", "0.57159704", "0.5709674", "0.57012355", "0.5698642", "0.56881636", "0.5677389", "0.56765723", "0.56600595", "0.5650887", "0.56489265", "0.5645857", "0.5645857", "0.56455255", "0.56455255", "0.56310415", "0.56159925", "0.5612136", "0.5608106", "0.5608106", "0.5608106", "0.56008154", "0.55925626", "0.55686957", "0.5562521", "0.55496186", "0.5542998", "0.55135256", "0.5501807", "0.5473145", "0.54604954", "0.5452295", "0.5445496", "0.5395837", "0.5389599", "0.538602", "0.538215", "0.5380215", "0.537446", "0.53637326", "0.53505224", "0.5331076", "0.53198844", "0.531654", "0.5313845", "0.5313845", "0.5313845", "0.5311404", "0.5304879", "0.5301806", "0.53007287", "0.5298557", "0.5297371", "0.5291096", "0.5286564", "0.5286564", "0.5286499", "0.5283271", "0.5274984", "0.52682096", "0.5258236", "0.5258236", "0.52558166", "0.52553815", "0.5252158", "0.5250119", "0.5248837", "0.52370507", "0.52311677", "0.5212477", "0.5208988", "0.52000797", "0.5197385", "0.5194897", "0.5192867" ]
0.65691715
4
Initialize function, receives a DomElementId string and assigns the Dom Element to el for future use.
function init(domElementId){ el = document.getElementById(domElementId) //Returns Todo List to simplify Jquery Style Chaining API return TodoList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(el) {\n this.el = el || {};\n }", "constructor(element) {\r\n this.element = document.getElementById(element)\r\n }", "constructor(el) {\n this.el = el;\n }", "function init(domElementId, callback){\n\tel = document.getElementById(domElementId);\n\n\t//Render the Layout in Dom Element el\n\tel.innerHTML = Layout();\n\n\t//Assign DOM Elements\n\ttxtCreateItem = document.getElementById(\"txt-create-item\");\n\tbtnCreateItem = document.getElementById(\"btn-create-item\");\n\t\n\t//Register button onclick event\n\tbtnCreateItem.onclick = onCreateItem;\n\n\t//\n\tonCreateItemCallback = callback;\n}", "setEl(el) {\n this.el = el;\n }", "constructor(selector){\n this.el = document.querySelector(selector);\n this._init();\n }", "function ViewElement(id) {\n this.el = document.getElementById(id);\n if (!this.el) {\n shutdown('element missing');\n }\n }", "make(_targetId, _tagName, _options) {\n if (!_targetId) {\n _targetId = 0;\n }\n if (!_tagName) {\n _tagName = 'DIV';\n }\n else {\n _tagName = _tagName.toUpperCase();\n }\n const _elem = document.createElement(_tagName);\n const _id = this._add(_elem);\n this._initCache(_id);\n if (_options) {\n let _attrs;\n if (this.isntNullOrUndefined(_options.attrs)) {\n _attrs = _options.attrs;\n }\n else if (this.isntNullOrUndefined(_options.attr)) {\n _attrs = _options.attr;\n }\n if (this.isObjectOrArray(_attrs)) {\n if (this.isObject(_attrs)) {\n _attrs = Object.entries(_attrs);\n }\n if (this.isArray(_attrs)) {\n _attrs.forEach(([_key, _value]) => {\n this.setAttr(_id, _key, _value, true);\n });\n }\n }\n const _classes = _options.classes;\n if (this.isArray(_classes)) {\n _classes.forEach(_className => {\n this.addClassName(_id, _className);\n });\n }\n if (_options.styles) {\n this.setStyles(_id, _options.styles);\n }\n if (_options.html) {\n this.setHTML(_id, _options.html);\n }\n }\n if (this._elements[_targetId] !== _elem.parentNode) {\n this._elements[_targetId].appendChild(_elem);\n }\n return _id;\n }", "make(_targetId, _tagName, _options) {\n if (!_targetId) {\n _targetId = 0;\n }\n if (!_tagName) {\n _tagName = 'DIV';\n }\n else {\n _tagName = _tagName.toUpperCase();\n }\n const _elem = document.createElement(_tagName);\n const _id = this._add(_elem);\n this._initCache(_id);\n if (_options) {\n let _attrs;\n if (this.isntNullOrUndefined(_options.attrs)) {\n _attrs = _options.attrs;\n }\n else if (this.isntNullOrUndefined(_options.attr)) {\n _attrs = _options.attr;\n }\n if (this.isObjectOrArray(_attrs)) {\n if (this.isObject(_attrs)) {\n _attrs = Object.entries(_attrs);\n }\n if (this.isArray(_attrs)) {\n _attrs.forEach(([_key, _value]) => {\n this.setAttr(_id, _key, _value, true);\n });\n }\n }\n const _classes = _options.classes;\n if (this.isArray(_classes)) {\n _classes.forEach(_className => {\n this.addClassName(_id, _className);\n });\n }\n if (_options.styles) {\n this.setStyles(_id, _options.styles);\n }\n if (_options.html) {\n this.setHTML(_id, _options.html);\n }\n }\n if (this._elements[_targetId] !== _elem.parentNode) {\n this._elements[_targetId].appendChild(_elem);\n }\n return _id;\n }", "constructor(element) {\n super();\n this._element = element;\n }", "constructor(el) {\n this.el = el;\n this.emptyCheckbox = this.el.parentElement.querySelector('.checkbox-empty');\n this.tickCheckbox = this.el.parentElement.querySelector('.checkbox-tick');\n\n this.init();\n }", "loadElements()\n {\n\n this.el = {};\n\n document.querySelectorAll('[id]').forEach(element => \n {\n this.el[Format.getCamelCase(element.id)] = element\n });\n }", "function constructor(domRoot) {\n\t\t// this._event = null\n\t\t_findElements(domRoot);\n\t}", "function $el(id) {\n if (typeof id === 'string') {\n return document.getElementById(id);\n }\n return id;\n }", "set id(id) {\n if (this.#el) this.#el.id = id;\n else this.#id = id;\n }", "function init(el) {\n if( el == 'undefined' ) {\n el = $('body');\n }\n // Activate plugins\n activateDropdowns(el);\n activateSelects(el);\n activateTextareas(el);\n activateTooltips(el);\n setActiveFieldTypes(el);\n activateSortable(el);\n activateModals(el);\n}", "constructor(element) {\n this.element = element;\n }", "constructor( element ) {\n this.$element = $(element);\n this.initialize();\n }", "constructor () {\n\n\t\t// Set the wrapper class\n\t\tthis.base_class = 'main';\n\n\t\t// Store the main element\n\t\tthis.el = document.getElementById(this.base_class);\n\n\t}", "function el(id) {\n return document.getElementById(id);\n}", "function el(elementid) {\n if (document.getElementById) {\n return document.getElementById(elementid);\n } else if (window[elementid]) {\n return window[elementid];\n }\n}", "setElement(elem) {\n this.element = elem;\n }", "constructor (el) {\n this.el = el;\n\n console.log('I am a sample component instantiated by using data-component=\"sample-component\" (which corresponds with the folder /js/components/sample-component) and I am instantiated on the following DOM node:');\n console.log(this.el);\n }", "initElement(root) {\n\t\tthis.dom = {\n\t\t\tcard_box : root,\n\t\t};\n\n\t\tthis.template = {\n\t\t\tcardTemplate: `\n\t\t\t<div class=\"card_item ship-card\" id=\"{id}\">\n\t\t\t\t<div class=\"card_clickable\">\n\t\t\t\t\t<div class=\"card_title\">{title}</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"card_content\">\n\t\t\t\t\t<ul id=\"ship-group\" class=\"dot_box\">\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t`\n\t\t};\n\t}", "function el(id)\n{\n\tif (document.getElementById)\n\t{\n\t\treturn document.getElementById(id);\n\t}\n\telse if (window[id])\n\t{\n\t\treturn window[id];\n\t}\n\treturn null;\n}", "function ElementFactory() {\n this._uid = 12;\n }", "init() {\n // override init to make sure createEl is not triggered\n }", "construct(element) {\n this._currentElement = element;\n }", "constructor(el, dragEl) {\n this.el = el;\n this.dragEl = dragEl || el;\n this.mousePosition = null;\n this.offset = [0,0];\n this.isDown = false;\n this.init();\n this.moved = false;\n }", "function initElement(el) {\n // samurize() jQuery plugin (below) calls this to make an element editable\n var $el = $(el);\n\n // Do not re-apply\n if ($el.data('cmsItem'))\n return;\n\n var cmsItem = _getCmsItemInfo($el);\n if (!cmsItem) { // apparently we couldn't get hold of any cmsItemInfo\n return;\n }\n $el.data('cmsItem', cmsItem);\n\n // Ignore this element altogether if this is specified in its attributes\n if (cmsItem.ignoreMe)\n return;\n\n // If we have set \"parent\" containers for SamuraiCMS, we should ignore any \n // elements which fall outside of these containers.\n if (samuraiContainers && !$el.parents().filter(samuraiContainers).length) {\n // Remove any cmsitem'y classes from elements which aren't enabled for SamuraiCMS\n $el.removeClass('sm-js-cmsitem')\n .removeClass('sm-js-cmsitem_editable')\n .removeClass('sm-js-cmsitem_linkable');\n return;\n }\n if (typeof $(mov.vars.samuraiContainerBlockSelector) != \"undefined\" && $(mov.vars.samuraiContainerBlockSelector) && $el.parents().filter($(mov.vars.samuraiContainerBlockSelector)).length) {\n // Remove any cmsitem'y classes from elements which aren't enabled for SamuraiCMS\n $el.removeClass('sm-js-cmsitem')\n .removeClass('sm-js-cmsitem_editable')\n .removeClass('sm-js-cmsitem_linkable');\n return;\n }\n\n // Turn \"page\" linkable into special addSkipped-style entry\n if (cmsItem.isPage) {\n _$id('skippedItemsDropdown').addClass(_cls.dropdownContainsPage);\n _$id('skippedCmsItemsLinkable')\n .html('Content on this page is drawn from: ')\n .append($(\n '<a ' +\n 'href=\"' + cmsItem.href + '\" ' +\n 'title=\"Samurai Admin - Edit ' + cmsItem.type + \" #\" + cmsItem.id + '\" ' +\n 'target=\"_blank\">' +\n cmsItem.type + ' #' + cmsItem.id +\n '</a>'\n ));\n $el.remove();\n return;\n }\n\n // Wire-up cms item\n $el.mouseenter(_cmsItem_onMouseEnter);\n $el.mouseleave(_cmsItem_onMouseLeave);\n\n // Give item-list items (containers) a special appearance\n if (cmsItem.actions['add-child']) {\n $el.addClass(_cls.cmsItemContainer);\n }\n\n // Ensure inline elements highlight like a box (not like a set of line-boxes)\n if (_getComputedStyle($el[0], 'display') == 'inline') {\n var hasChildren = $el.children().length != 0;\n \n var message_id = $el.attr('message_id');\n\n var hasBlockChildren = hasChildren && _getComputedStyle($el.children()[0], 'display') == 'block' && $el.children()[0].tagName.toLowerCase() != 'img';\n\n // Need \"inline-block\" instead of \"black\" for display, if the element contains other block elements (except images), and we also don't worry about WYSIYWG snippet types\n var disp = ( hasBlockChildren || _displayCmsItemAsBlock( cmsItem ) ) ? 'block' : 'inline-block';\n\n if (hasChildren) {\n // Sections commented out to fix MOV2360-28 - underline missing from login\n $el.css({\n 'display': disp,\n //'display': 'block' ,\n 'zoom': 1,\n 'text-indent': 0\n });\n }\n }\n }", "constructor (element) {\n super(element);\n }", "function domElement() {\n this.class = [];\n this.id = \"\";\n this.attributes = [];\n this.rightSibling = undefined;\n this.leftSibling = undefined;\n this.child = undefined;\n this.level = undefined;\n\n this.addChildElement = function (element) {\n this.child = element;\n };\n\n this.addSibling = function (element) {\n this.rightSibling = element;\n };\n }", "function initElement(eleType, eid)\r\n{\r\n\tswitch(eleType)\r\n\t{\r\n\t\tcase \"textArea\":\r\n\t\t\tdocument.querySelector(\"#tae-\" + eid).addEventListener(\"click\", function(){editTA(eid)});\r\n\t\t\tdocument.querySelector(\"#tas-\" + eid).addEventListener(\"click\", function(){saveTA(eid)});\r\n\t\t\tdocument.querySelector(\"#tad-\" + eid + \"-0\").addEventListener(\"click\", function(){deleteElement(eid)});\r\n\t\t\tdocument.querySelector(\"#tad-\" + eid + \"-1\").addEventListener(\"click\", function(){deleteElement(eid)});\r\n\t\tdefault:\r\n\t\t\t// do nothing\r\n\t}\r\n}", "constructor(el) {\n this.$root = el;\n this.cache_key = null;\n this.cache_value = null;\n }", "constructor(theElement) {\n this(theElement, null, null);\n }", "constructor(ele) {\n super(ele);\n }", "function ElementFactory() {\n this._uid = 12;\n}", "function ElementFactory() {\n this._uid = 12;\n}", "function ElementFactory() {\n this._uid = 12;\n}", "function ElementFactory() {\n this._uid = 12;\n}", "constructor(alertId){\n this.alert = document.getElementById(alertId);\n }", "_makeElem(_parentElemId) {\n this.elemId = ELEM.make(_parentElemId, this.cellTagName);\n ELEM.setAttr(this.elemId, 'view_id', this.viewId, true);\n ELEM.setAttr(this.elemId, 'elem_id', this.elemId, true);\n Object.entries(this.cellTagAttrs).forEach(([key, value]) => {\n ELEM.setAttr(this.elemId, key, value, true);\n });\n }", "function El(tag) {\n this.el = document.createElement(tag);\n this;\n}", "constructor(element) {\r\n super(element); \r\n this.element = element;\r\n this.attributeManager = new AttributeManager(this.element);\r\n }", "constructor(element) {\r\n super(element); \r\n this.element = element;\r\n this.attributeManager = new AttributeManager(this.element);\r\n }", "constructor(element) {\r\n super(element); \r\n this.element = element;\r\n this.attributeManager = new AttributeManager(this.element);\r\n }", "setElement(element) {\n this.element = element;\n }", "function _initElement(htOptions){\n htElement.welUploader = $(\"#upload\");\n htElement.welTextarea = $('textarea[data-editor-mode=\"content-body\"]');\n htElement.welAttachments = $(\".attachments\");\n htElement.welBtnWatch = $('#watch-button');\n htElement.welComment = $('#comments');\n htElement.welBtnHelp = $('#helpBtn');\n htElement.welMsgHelp = $('#helpMessage');\n htElement.welState = $(\"#state\");\n htElement.welBtnAccept = $(\"#btnAccept\");\n }", "elem(DOMelem) {\n this.element = DOMelem;\n return this;\n }", "set el(el) {\n this.#el = el;\n\n if (this.#value) {\n this.value = this.#value;\n this.#value = null;\n }\n\n if (this.#innerHTML) {\n this.innerHTML = this.#innerHTML;\n this.#innerHTML = null;\n }\n\n if (this.#textContent) {\n this.textContent = this.#textContent;\n this.#textContent = null;\n }\n\n if (this.#innerText) {\n this.innerText = this.#innerText;\n this.#innerText = null;\n }\n\n if (this.#id) {\n this.id = this.#id;\n this.#id = null;\n }\n\n if (this.#className) {\n this.className = this.#className;\n this.#className = null;\n }\n\n if (this.#classList.length) {\n this.#classList.forEach(c => this.classList.add(c));\n this.#classList.length = 0;\n }\n\n if (this.#children.length) {\n this.append(...this.#children);\n this.#children.length = 0;\n }\n\n const attrProps = Object.keys(this.#attr);\n if (attrProps.length) {\n attrProps.forEach(p => this.attr(p, this.#attr[p]));\n this.#attr = {};\n }\n\n const styleProps = Object.keys(this.#style);\n if (styleProps.length) {\n styleProps.forEach(p => this.style[p] = this.#style[p]);\n this.#style = {};\n }\n\n const datasetProps = Object.keys(this.#dataset);\n if (datasetProps.length) {\n datasetProps.forEach(p => this.dataset[p] = this.#dataset[p]);\n this.#dataset = {};\n }\n\n this.#emit('ref', el);\n }", "function addIdTo(el) {\n var id = el.attributes[0].name;\n var i = 0;do {\n el = el.parentNode;\n if (el.id === '') el.id = id + (i === 0 ? '' : '_' + i);\n ++i;\n } while (el.parentNode.tagName !== 'BODY');\n}", "createDomElements(id) {\n this.li = document.createElement('li');\n this.edit = document.createElement('button');\n this.delete = document.createElement('button');\n\n this.edit.classList.add('btn-edit');\n this.delete.classList.add('btn-delete');\n\n this.delete.setAttribute('data-id', id);\n this.edit.setAttribute('data-id', id);\n\n this.edit.innerHTML = 'Edit';\n this.delete.innerHTML = 'Delete';\n\n this.li.appendChild(this.delete);\n this.li.appendChild(this.edit);\n }", "Initialize() \n {\n this.UpdateElementDeclaration();\n }", "constructor() {\n this.id = undefined;\n this.headerTitle = undefined;\n \n // Structure for a button element\n this.buttonElement = function() {\n return {\n tagName: \"button\",\n onClick: null,\n text: null\n };\n };\n \n // Structure for a select element\n this.selectElement = function() {\n return {\n desc: null,\n tagName: \"select\",\n id: null,\n onChange: null,\n value: null,\n text: null\n };\n };\n \n // Structure for a text element\n this.textElement = function() {\n return {\n tagName: \"p\",\n text: null\n };\n }\n \n // List of element(s) to generate\n this.elementList = [];\n }", "static buildDom(el) {\n var smoDomBuilder = function (el) {\n this.e = $('<' + el + '/>');\n var self = this;\n this.classes = function (cl) {\n $(self.e).addClass(cl);\n return self;\n }\n this.html = function(value) {\n $(self.e).html(value);\n return self;\n }\n this.data = function (name, value) {\n $(self.e).attr('data-' + name, value);\n return self;\n }\n this.attr = function (name, value) {\n $(self.e).attr(name, value);\n return self;\n }\n this.prop = function (name, value) {\n $(self.e).prop(name, value);\n return self;\n }\n this.css = function (name, value) {\n $(self.e).css(name, value);\n return self;\n }\n this.append = function (el) {\n $(self.e).append(el.e);\n return self;\n }\n this.text = function (tx) {\n $(self.e).append(document.createTextNode(tx));\n return self;\n }\n this.dom = function () {\n return self.e;\n }\n return this;\n }\n return new smoDomBuilder(el);\n }", "function getElById(el) {\n return document.getElementById(el);\n}", "getElementById(id) {\n return this.root.querySelector(`#${id}`);\n }", "function ElementFactory$1() {\n this._uid = 12;\n}", "_init() {\n const id = this.$element[0].id || GetYoDigits(6, 'smooth-scroll-with-links');\n this.$element.attr({ id });\n\n this._events();\n }", "function id(el){\n return document.getElementById(el);\n}", "constructor(width, el) {\n this.width = width;\n\n this.el = el;\n }", "function addElement(id) {\n // generate new div Element\n var newDiv = document.createElement(\"div\");\n // insert to DOM\n document.body.insertBefore(newDiv, null);\n //provide ID and style\n newDiv.id = id;\n //newDiv.style.cssText = css;\n}", "function injectElement(DOMElement, elementName) {\n this.createElement = document.createElement(elementName);\n this.element = document.querySelectorAll(DOMElement);\n for (let i = 0; i < this.element.length; i++) {\n this.attr = this.element[i].appendChild(this.createElement);\n }\n}", "_init() {\n var $id = this.$element.attr('id');\n\n this.$anchor = $(`[data-toggle=\"${$id}\"]`).length ? $(`[data-toggle=\"${$id}\"]`) : $(`[data-open=\"${$id}\"]`);\n this.$anchor.attr({\n 'aria-controls': $id,\n 'data-is-focus': false,\n 'data-yeti-box': $id,\n 'aria-haspopup': true,\n 'aria-expanded': false\n\n });\n\n if(this.options.parentClass){\n this.$parent = this.$element.parents('.' + this.options.parentClass);\n }else{\n this.$parent = null;\n }\n this.options.positionClass = this.getPositionClass();\n this.counter = 4;\n this.usedPositions = [];\n this.$element.attr({\n 'aria-hidden': 'true',\n 'data-yeti-box': $id,\n 'data-resize': $id,\n 'aria-labelledby': this.$anchor[0].id || Foundation.GetYoDigits(6, 'dd-anchor')\n });\n this._events();\n }", "setElement(newElement) {\n this.#element = newElement;\n }", "initializeElements () {\n this.$els = {\n window,\n body: document.body\n }\n }", "function getElementById(id) {\n\t\tvar el = null;\n\t\ttry {\n\t\t\tel = doc.getElementById(id);\n\t\t} catch (e) {}\n\t\treturn el;\n\t}", "constructor(id) {\n if(id) this.id = id;\n }", "function init({domId, style}) {\n // The element gets found in the DOM by a querySelector with the passed attribute\n const foundElement = document.querySelector(`#${domId}`)\n \n // apply passed settings on DOM element\n foundElement.style.backgroundColor = style.backgroundColor;\n foundElement.style.height = `${style.height}px`;\n foundElement.style.width = `${style.width}px`;\n \n // Parameters get displayed in the DOM\n foundElement.innerText = `turnOn has passed this data: ${JSON.stringify({domId, style})}`;\n }", "function getElementById(id) {\n\t\tvar el = null;\n\t\ttry {\n\t\t\tel = doc.getElementById(id);\n\t\t}\n\t\tcatch (e) {}\n\t\treturn el;\n\t}", "function getElementById(id) {\n\t\tvar el = null;\n\t\ttry {\n\t\t\tel = doc.getElementById(id);\n\t\t}\n\t\tcatch (e) {}\n\t\treturn el;\n\t}", "function getElementById(id) {\n\t\tvar el = null;\n\t\ttry {\n\t\t\tel = doc.getElementById(id);\n\t\t}\n\t\tcatch (e) {}\n\t\treturn el;\n\t}", "createAnElement(tag, id, store_here){\n store_here = store_here || this.elements;\n const element = document.createElement(tag);\n this.addElement(element, id, store_here);\n return element;\n }", "function getElementById(id) {\n var el = null;\n try {\n el = doc.getElementById(id);\n }\n catch (e) { }\n return el;\n }", "function Dom(seletor) {\n this.element = document.querySelector(seletor);\n}", "function getEl(id){\n\treturn document.getElementById(id);\n}", "wrap(el) {\n this.el = [el];\n\n return this;\n }", "_init() {\n var id = this.$element[0].id || Foundation.GetYoDigits(6, 'magellan');\n var _this = this;\n this.$targets = $('[data-magellan-target]');\n this.$links = this.$element.find('a');\n this.$element.attr({\n 'data-resize': id,\n 'data-scroll': id,\n 'id': id\n });\n this.$active = $();\n this.scrollPos = parseInt(window.pageYOffset, 10);\n\n this._events();\n }", "constructor(element) {\n this.element = element;\n this.next = null;\n }", "function getElementById(id) {\n var el = null;\n try {\n el = doc.getElementById(id);\n }\n catch (e) {}\n return el;\n }", "function getElementById(id) {\n var el = null;\n try {\n el = doc.getElementById(id);\n }\n catch (e) {}\n return el;\n }", "createNode(el) {\n\t\t\treturn document.createElement(el);\n\t\t}", "function $(id){const el=document.getElementById(id);return el?assertInstanceof(el,HTMLElement):null}", "constructor(id, el, events, ato)\n {\n this.ato = ato\n this.events = events\n this.State = new State(events.state || {})\n\n this.initialData = { id, el, ato }\n this.after = {}\n\n this.detach('state')\n }", "constructor (el = '', options = {}) {\n super();\n\n this.elbindEvent(el);\n this.createTranslateModal();\n }", "constructor(options, element) {\n super(options, element);\n }", "constructor(options, element) {\n super(options, element);\n }", "function el(x){\n return document.getElementById(x);\n }", "constructor(holderelemid, config = {}) {\n\n this.config = Object.assign({\n otpLength : 4,\n boxSize : \"40px\",\n boxColor : \"#d35400\",\n fontSize : \"27px\",\n inputType : \"number\",\n letters : \"\", //uppercase, lowercase, mixed\n }, config); // assign default config with new config\n\n this.holderelemid = holderelemid;\n this.holderelem = document.querySelector(holderelemid);\n }", "function init(el) {\r\n var $el = $(el);\r\n\r\n if ($el.data('initialized')) {\r\n return;\r\n } else {\r\n $el.data('initialized', true);\r\n }\r\n\r\n // When mouse enters the box (Mouse Desktop)\r\n $el.on('mouseenter', box_mouseenterHandler);\r\n\r\n // When mouse leaves the box (Mouse Desktop)\r\n $el.on('mouseleave', box_mouseleaveHandler);\r\n\r\n // When touch starts (Touch Devices)\r\n $el.on('touchstart', box_touchstartHandler);\r\n\r\n // When touch starts moving (scrolling most likely) (Touch Devices)\r\n $el.on('touchmove', box_touchmoveHandler);\r\n\r\n // When touch ends (Touch Devices)\r\n $el.on('touchend', box_touchendHandler);\r\n }", "function getEl(id) {\n return document.getElementById(id)\n}", "function domdomElement(element) {\n _classCallCheck(this, domdomElement);\n\n this.DOMDOMELEMENT = true;\n this.element = element;\n return this;\n }", "function Element(id,elementName){this.id=id;this.elementName=elementName; /** The indices of the data items in this set */this.items=[]; /** The number of elements in this (sub)set */this.setSize=0; /** The ratio of elements that are contained in this set */this.dataRatio=0.0;}", "constructor(element) \n\t{ \n\t\tthis.element = element; \n\t\tthis.next = null\n\t}", "constructor(elemento) {\n super(elemento);\n }", "function getElemental() {\n if (elemental) return;\n\n // Initialize the elemental\n elemental = settings.elemental(name.el, settings.elementalOptions);\n\n if (!elemental || elemental instanceof HTMLElement) {\n elemental = Storage.get(name.el, `elementals.${settings.elementalName}`);\n }\n\n if (elemental) {\n elemental.id = settings.id;\n } else {\n console.debug(`Expected instance of ${settings.elementalName} is not available.`);\n }\n }", "function ElementNode(domElement){\n\t\n\tthis.id = domElement.id;\n\tthis.length = domElement.getAttribute(\"length\");\n\tthis.volume = domElement.getAttribute(\"volume\");\n\t\n\t// indicates whether note is regular, legato, staccato, or glide \n\tthis.style = domElement.getAttribute(\"type\");\n}", "function $(el){\n\tif (!el) return false;\n\tif (el._element_extended_ || [window, document].test(el)) return el;\n\tif ($type(el) == 'string') el = document.getElementById(el);\n\tif ($type(el) != 'element') return false;\n\tif (['object', 'embed'].test(el.tagName.toLowerCase()) || el.extend) return el;\n\tel._element_extended_ = true;\n\tGarbage.collect(el);\n\tel.extend = Object.extend;\n\tif (!(el.htmlElement)) el.extend(Element.prototype);\n\treturn el;\n}", "function ElemId(id){\n\treturn document.getElementById(id);\n}", "constructor(tableId) {\n this.tableId = tableId;\n this.htmlTagFactory = new HtmlTagElementFactory();\n this.tableDom = $(tableId);\n this.emptyTable();\n this.buildTableHeader();\n }" ]
[ "0.70317376", "0.6889506", "0.68314624", "0.65673274", "0.6381667", "0.62948316", "0.6263454", "0.6225174", "0.6225174", "0.61670923", "0.61555934", "0.60781264", "0.6073943", "0.59388554", "0.59275556", "0.5924387", "0.58971554", "0.58817357", "0.58442557", "0.5840062", "0.58061725", "0.57962286", "0.5747573", "0.5742029", "0.5735828", "0.57215196", "0.571549", "0.57079536", "0.57016295", "0.5697947", "0.5686531", "0.56773645", "0.56770724", "0.56600213", "0.56484425", "0.56477904", "0.564595", "0.564595", "0.5645678", "0.5645678", "0.5630344", "0.56147885", "0.56131786", "0.5605477", "0.5605477", "0.5605477", "0.560102", "0.5591185", "0.5569641", "0.55649126", "0.5550112", "0.5544382", "0.5511575", "0.550165", "0.54744613", "0.5462934", "0.54535615", "0.54457206", "0.5395059", "0.5391382", "0.53862804", "0.53821534", "0.53803635", "0.5373382", "0.5364548", "0.5351098", "0.53322685", "0.5318277", "0.5315316", "0.5315091", "0.5315091", "0.5315091", "0.53116053", "0.5306305", "0.5303313", "0.5303089", "0.5299879", "0.5296012", "0.5290647", "0.52879274", "0.52879274", "0.5287087", "0.52850574", "0.52749336", "0.52679616", "0.52570623", "0.52570623", "0.5255118", "0.52546626", "0.5254524", "0.5252506", "0.52506816", "0.52374536", "0.52306443", "0.5211682", "0.5208946", "0.5199893", "0.5199457", "0.5194585", "0.5191825" ]
0.7514261
0
Renders all objects in TodoList.items using Item Template
function render(){ var src = "" for(i in TodoList.items) src += ItemTemplate(TodoList.items[i]); el.innerHTML = src; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render(todoItems) {\n // const sortedData = todoItems.sortby(['id'])\n const container = document.querySelector('.js-todolist');\n container.innerHTML = '';\n const todoItemsReverse = todoItems.reverse();\n // for (const todoItem of sortedData) {\n for (const todoItem of todoItemsReverse) {\n const div = document.createElement('div');\n div.innerHTML = `\n <article class=\"container box style1 right todoinput\">\n \t\t\t\t<img class=\"image fit\"src=\"images/${todoItem.data.image}\" alt=\"\" />\n \t\t\t\t<div class=\"inner\">\n \t\t\t\t\t<header>\n \t\t\t\t\t\t<h2><a href=\"#/post/${todoItem.id}\">${todoItem.data.title}</a></h2>\n \t\t\t\t\t</header>\n \t\t\t\t\t<p>${todoItem.data.todo}</p>\n \t\t\t\t</div>\n \t\t\t</article>\n\t\t\t `;\n container.appendChild(div);\n };\n }", "function render(){\n todoListContent.innerHTML = \"\";\n\n if(items.length <= 0){\n todoListContent.innerHTML = \"No items in this list\";\n return;\n }\n\n //todoListContent.append(`${items.length} items`)\n\n items.forEach((item, index) => {\n const wrapper = document.createElement('template');\n wrapper.innerHTML = itemHtml(index, item);\n todoListContent.appendChild(wrapper.content.cloneNode(true));\n });\n\n}", "function renderTodoList () {\n if (!data.todo.length && !data.done.length) return;\n for (var i=0;i<data.todo.length;i++){\n addItemList(data.todo[i], 'todo');\n }\n for (var j=0;j<data.done.length;j++){\n addItemList(data.done[j], 'done');\n }\n\n}", "function render () {\n $toDoList.empty();// empty existing posts from view\n var toDoHtml = getAllToDoHtml(allToDos); // pass `allToDos` into the template function\n $toDoList.append(toDoHtml);// append html to the view\n}", "function renderTodoList() {\n if (!data.todo.length && !data.completed.length) return;\n\n for (i = 0; i < data.todo.length; i++) {\n var value = data.todo[i];\n addItemToDOM(value);\n }\n for (j = 0; j < data.completed.length; j++) {\n var value = data.completed[j];\n addItemToDOM(value, true);\n }\n}", "function renderTodos () {\n for (i=0; i < todos.length; i++) {\n var todoItem = todos [i];\n var liElement = document.createElement (\"li\");\n liElement.textContent = todoItem;\n todoList.appendChild(liElement);\n }\n}", "function _drawTodos() {\n let template = ''\n store.State.todos.forEach(item => {\n template += `<li class=\"action\">\n <div class =\"inline\"><input class=\"align-middle\" type=\"checkbox\" ${item.completed ? \"checked\" : \"\"}><div onclick=\"app.TodoController.toggleTodoStatus(${item._id})\">${item.description}</div></div><button class=\"btn btn-danger deleteBtn float-right\" onclick=\"app.TodoController.removeTodo(${item._id})\"></button></li>`\n });\n document.getElementById('list-items').innerHTML = template;\n // document.getElementById('task-count').innerText = \n}", "function render (todoList) {\n renderTodoList(todoList);\n}", "function renderTodoList() {\n //if there is nothing...\n if(!data.todo.length && !data.completed.length){\n //exit function\n return;\n }\n\n //if there is something...add them to DOM\n for (let i = 0; i < data.todo.length; i++) {\n let value = data.todo[i];\n addItemToDOM(value);\n }\n\n for (let j = 0; j < data.completed.length; j++) {\n let value = data.completed[j];\n addItemToDOM(value, true);\n }\n}", "renderTodos() {\n\t\tconst { todos } = this.props.store._;\n\n\t\tif (todos.length) {\n\t\t\treturn todos\n\t\t\t\t.sortBy('completed')\n\t\t\t\t.map( t => <TodoItem key={ t.$().pid() } todo={ t } todos={ todos } /> );\n\t\t} else {\n\t\t\treturn <p className=\"noItems\">What do you want to do today?</p>\n\t\t}\n\t}", "function renderTodos(todos) {\n //clear everything inside <ul> w/ clss=todo-todo-items \n todoItemsList.innerHTML = '';\n\n //run through ea item inside of todos\n todos.forEach(function(item){\n //check if each item is completed\n const checked = item.completed ? 'checked' : null;\n\n // make a li element and fill it \n const li = document.createElement('li');\n // <li class=\"item\"></li>\n li.setAttribute('class', 'item');\n // <li class=\"item\" data-key=\"20200708\"> </li> \n li.setAttribute('data-key', item.id);\n /* <li class=\"item\" data-key=\"20200708\"> \n <input type=\"checkbox\" class=\"checkbox\">\n Go to Gym\n <button class=\"delete-button\">X</button>\n </li> */\n\n // if item is completed, then add a class to <li> called 'checked', which will add \n //line-through style\n if(item.completed === true) {\n li.classList.add('checked');\n }\n li.innerHTML = `\n <input type=\"checkbox\" class=\"checkbox\" ${checked}>\n ${item.name}\n <button class=\"delete-button\">X</button>\n `;\n // finally add the <li> to the <ul>\n todoItemsList.append(li) \n });\n}", "function RENDER_items(items) {\n\n }", "function viewTodoListDom() {\n //clear list of items before render\n list.innerHTML = \"\";\n for (let i = 0; todoItemsOjb.todoItemsRender.length > i; i++) {\n addToDoItemDom(todoItemsOjb.todoItemsRender[i]);\n }\n}", "function render() {\n // Clean the list\n list.innerHTML = '';\n var filteredTodo = getFilteredTodos();\n var todoEls = filteredTodo.map(createTodoNode);\n todoEls.forEach(function (t) { return list.appendChild(t); });\n count.innerHTML = todoEls.length + \" items \" + (filter === FILTER.COMPLETED ? 'completed' : 'left');\n}", "renderItems(){\n\t\tconst props = _.omit(this.props,'todos');\n\t\treturn _.map(this.props.todos,\n\t\t\t\t\t(todo,index) => <TodosListItems key={index} {...todo} {...props}/> \n\t\t); \n\t}", "function _drawTodos() {\n document.getElementById(\"total\").innerText = store.State.todos.length.toString()\n let todos = store.State.todos;\n console.log(todos)\n let todoElem = document.getElementById(\"todos\");\n let template = \"\"\n todos.forEach(todo => {\n template += todo.Template\n });\n todoElem.innerHTML = template\n}", "function renderToDoList() {\n\tif (!data.openTasks.length && !data.doneTasks.length) return; \n\n\tfor (var i=0; i < data.openTasks.length; i++) {\n\t\tvar value = data.openTasks[i]; \n\t\tcreateListElement(value); \n\t}\n\n\tfor (var j=0; j < data.doneTasks.length; j++) {\n\t\tvar value = data.doneTasks[j]; \n\t\tcreateListElement(value, true); \n\t}\n}", "function renderList( list ){\n const listPlace = document.querySelector('.container');\n \n let HTML = '';\n\n for (let i = 0; i < list.length; i++) {\n const todoItem = list[i];\n \n HTML += `\n <div class=\"item\">\n <div class=\"status ${todoItem.status}\"></div>\n <p class=\"desciption\">${todoItem.description}</p>\n <div class=\"deadline\">${todoItem.deadline}</div>\n <div class=\"actions\">\n <div class=\"action remove\">Remove</div>\n </div>\n </div>`;\n }\n return listPlace.innerHTML += HTML;;\n}", "function renderList() {\n //use a for loop to render the list items\n var html = \"\"\n for (let i = 0; i < arr.length; i++) {\n\n if (arr[i].isCompleted) {\n html += `<li class=\"todo-list-item completed\" id=${i}>${arr[i].task}</li>`\n } else {\n html += `<li class=\"todo-list-item\" id=${i}>${arr[i].task}</li>`\n }\n }\n todoList.innerHTML = html\n}", "function renderList() {\n viewSection.innerHTML = \"\";\n counter.innerText = todoList.length;\n for(const todo of todoList) {\n const todoElement = createTodoElement(todo);\n viewSection.appendChild(todoElement);\n }\n}", "render() {\n\t\treturn (\n\t\t\t<section className=\"main\">\n\t\t\t\t<ul className=\"todo-list\">\n\t\t\t\t\t{this.props.todos.map( (todo, i) => <ToDoItem key={todo.id} id={todo.id} isCompleted={todo.completed} text={todo.title} destroyOne={this.props.destroyOne(i)} toggleTodo={this.props.toggleTodo(i)}/> )}\n\t\t\t\t</ul>\n\t\t\t</section>\n\n\t)}", "async renderAllTodos() {\n const todos = await Controller.getTodos();\n this.renderNav(todos);\n this.renderTodos(todos);\n this.renderHeadingTitle('All Todos', todos.length);\n }", "function renderTodo(todo) {\n //store todo items into browser storage.\n localStorage.setItem(\"todoItem\", JSON.stringify(todoItems));\n //get reference of required elements.\n const list = document.querySelector(\".js-todo-list\");\n const item = document.querySelector(`[data-key='${todo.id}']`);\n\n //Runs a check for deleted items and update the DOM.\n if (todo.deleted) {\n item.remove();\n if (todoItems.length === 0) list.innerHTML = \"\";\n return;\n }\n //Evaluate the done state of a todo entry\n const isChecked = todo.checked ? \"done\" : \"\";\n //create a list item that holds todo entry.\n const listItemElement = document.createElement(\"li\");\n\n // set class and data-key attributes to the todo entry.\n listItemElement.setAttribute(\"class\", `todo-item ${isChecked}`);\n listItemElement.setAttribute(\"data-key\", todo.id);\n //populate the todo entry with required values.\n listItemElement.innerHTML = `\n <input id =\"${todo.id}\" type=\"checkbox\"/>\n <label for=\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n &times;\n </button>\n `;\n //Run condition to append the created item to the page.\n if (item) {\n list.replaceChild(listItemElement, item);\n }\n else {\n list.append(listItemElement);\n }\n}", "function renderTodo(todo) {\n\t\tvar html =\n\t\t\t\t'<a class=\"collection-item\" id=\"'+todo.id+'\" href=\"#modal-todo\"'+\n\t\t\t\t\t'data-id=\"'+todo.id+'\"'+\n\t\t\t\t\t'data-title=\"'+todo.title+'\"'+\n\t\t\t\t\t'data-priority=\"'+todo.priority+'\"'+\n\t\t\t\t\t'data-details=\"'+todo.details+'\"'+\n\t\t\t\t\t'data-created=\"'+todo.createdAt+'\"'+\n\t\t\t\t\t'data-elapsed=\"'+todo.elapsedTime+'\"'+\n\t\t\t\t\t'data-finish=\"'+todo.finishAt+'\"'+\n\t\t\t\t\t'data-complete=\"'+todo.isComplete+'\"'+\n\t\t\t\t'>'+\n\t\t\t\t\t'<span class=\"badge '+todo.priority+'\">'+\n\t\t\t\t\t\ttodo.priority+\n\t\t\t\t\t'</span>'+\n\t\t\t\t\ttodo.title+\n\t\t\t\t'</a>';\n\t\tlist.append(html);\n\t}", "function renderTodo(items=[]) {\n\t\t\t\tvar item = ``;\n\t\t\t\tfor(var i=0;i<items.length;i++) {\n\t\t\t\t\t\t\t\titem += `\n\t\t\t\t\t\t\t\t\t\t\t\t<li class=\"collection-item\">\n \t\t\t\t\t\t\t\t\t\t\t${items[i]}\n \t\t\t\t\t\t\t\t\t\t\t<a data-id=\"${i}\" href=\"#!\" class=\"secondary-content delete-todo\">\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t <i class=\"material-icons small red-text\">delete</i>\n \t\t\t\t\t\t\t\t\t\t\t</a>\n \t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t`;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdocument.querySelector(\".list-todoo\").innerHTML = item;\n\t\t\t\t\n\t\t\t\t// Delete todoo\n \t\tconst btnDeleteTodos = Array.from(document.querySelectorAll(\".delete-todo\"));\n \t\tif (btnDeleteTodos != null ) {\t\t\t\n \t\tbtnDeleteTodos.forEach((btn) => {\n \t\t\t\tbtn.addEventListener(\"click\", function() {\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\tconst id = parseInt(this.dataset.id);\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\tSwal.fire({\n \t\t\t\t\t\t\t\t\t\t\t\ttitle: 'Are you sure?',\n \t\t\t\t\t\t\t\t\t\t\t\ttext: \"You won't be able to revert this!\",\n \t\t\t\t\t\t\t\t\t\t\t\ticon: 'warning',\n \t\t\t\t\t\t\t\t\t\t\t\tshowCancelButton: true,\n \t\t\t\t\t\t\t\t\t\t\t\tconfirmButtonColor: '#3085d6',\n \t\t\t\t\t\t\t\t\t\t\t\tcancelButtonColor: '#d33',\n \t\t\t\t\t\t\t\t\t\t\t\tconfirmButtonText: 'Yes, delete it!'\n\t\t\t\t\t\t\t\t\t\t}).then((result) => {\n \t\t\t\t\t\t\t\t\t\t\t\tif (result.isConfirmed) {\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\titems.splice(id, 1);\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tToast.fire({\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon: 'success',\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle: \"Your todo has been deleted\"\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trenderTodo(items);\n \t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t});\n \t\t\t\t\t\t\t\t\n \t\t\t\t});\n \t\t});\n \t\t\t\n \t\t} \n\t\t\t\n}", "function renderTaskItem() {\r\n var html = '';\r\n data.forEach(function (task) {\r\n if (task.isDone) {\r\n html += '<li class=\"collection-item\"><span class=\"line-through\">' + task.text + '</span><a class=\"secondary-content\" href=\"#\"><i class=\"material-icons\">clear</i></a></li>'\r\n } else {\r\n html += '<li class=\"collection-item\"><span>' + task.text + '</span><a class=\"secondary-content\" href=\"#\"><i class=\"material-icons\">clear</i></a></li>'\r\n }\r\n });\r\n collection.innerHTML = html;\r\n if (!collection.children[0]) {\r\n cardAction.style.display = 'none';\r\n } else {\r\n cardAction.style.display = 'block';\r\n }\r\n }", "render() {\n return (\n <div>\n <h1 id = \"mainHeading\">To Do List\n </h1>\n <h3>Things I need to do:</h3>\n <AddItem />\n <ItemCount count= {4} />\n <ul>\n <Item id = \"item1\" text =\"Go to the bank\"/>\n <Item id = \"item2\" text = \"Do the shopping\"/>\n <Item id = \"item3\" text = \"Gym class at 11am\"/>\n <Item id = \"item4\" text = \"Hair appt 1pm\"/>\n {/* PROP*/}\n\n </ul>\n </div>\n );\n }", "function renderTodos() { //fução de renderização de 'to do'\n for (todo of todos) { //apliquei o 'for...of' para percorrer o array acima, criando a variável todo \n var todoElement = document.createElement('li'); //criei var todoElement que cria elementos dentro da ul\n var todoText = document.createTextNode(todo);//todos os elementos todo(criados na lista) serão armazenados em todoText\n \n todoElement.appendChild(todoText);\n listElement.appendChild(todoElement);\n }\n}", "render() {\n\t\t//app level state is shared\n\t\t// return this.props.todos.map((todo) => <h2>{todo.title}</h2>);\n\t\t//MAP through each todo\n\n\t\treturn this.props.todos.map((todo) => (\n\t\t\t<h3>\n\t\t\t\t{/* keys should be the id prop usually */}\n\t\t\t\t{/* //go up one level becuase we can'tuse the state just console stuff */}\n\t\t\t\t<ToDoItem\n\t\t\t\t\tkey={todo.id}\n\t\t\t\t\ttodo={todo}\n\t\t\t\t\tmarkComplete={this.props.markComplete}\n\t\t\t\t\tdeleteTask={this.props.deleteTask}\n\t\t\t\t/>\n\t\t\t</h3>\n\t\t));\n\t}", "function printList(arrayList){\r\n // Pulisce la lista, prima di stamparla\r\n $('.todo-list').text('');\r\n // Preparo template di Handelbars\r\n var source = $('#todo-template').html();\r\n var template = Handlebars.compile(source);\r\n for (var i = 0; i < arrayList.length; i++) {\r\n context = {\r\n listItem: arrayList[i].text,\r\n itemId: arrayList[i].id\r\n };\r\n var html = template(context);\r\n $('.todo-list').append(html);\r\n };\r\n }", "function _drawTodos() {\n let template = `<ul>`\n ProxyState.todos.forEach(t => template += `<li class=\"d-flex w-100 align-items-center justify-content-between\">${t.Template}</li>`)\n document.getElementById('todo-list').innerHTML = template + '</ul>'\n document.getElementById('todo-count').innerText = \"Remaining To-dos: \" + ProxyState.todos.length\n}", "function renderTodo(todo) {\n //Store todo items into broser storage\n localStorage.setItem(\"todoItems\", JSON.stringify(todoItems));\n //Get reference of required elements\n const list = document.querySelector(\".js-todo-list\");\n const item = document.querySelector(`[data-key='${todo.id}']`);\n //Runs a check for deleted items and update the DOM\n if (todo.deleted) {\n item.remove();\n if (todoItems.length === 0) list.innerHTML = \"\";\n return;\n }\n //Evaluate the done state of a todo entry\n const ischecked = todo.checked ? \"done\" : \"\";\n //create a list item that holds todo entry\n //set clss and data-key attribute to the todo entry\n const listItemElement = document.createElement(\"li\");\n listItemElement.setAttribute(\"class\", `todo-item ${ischecked}`);\n //populate the required the values\n listItemElement.setAttribute(\"data-key\", todo.id);\n listItemElement.innerHTML = `<input id=\"${todo.id}\" type=\"checkbox\"/>\n <label for =\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n &times;\n </button>\n `;\n //Run the condition to append the created item to the page\n if (item) {\n list.replaceChild(listItemElement, item);\n } else {\n list.append(listItemElement);\n }\n\n}", "function allItems() {\n JsontoHTML()\n itemtoHTML()\n }", "function renderTasks(){\n //check that there are stored tasks\n if(!storedTask.data.length) return;\n\n //iterate over the stored task\n for(let i = 0; i < storedTask.data.length; i++){\n var task = storedTask.data[i];\n ListBinding.addItemToDOM(task, true);\n }\n}", "function renderTodo(todo) {\n localStorage.setItem('todoItemsRef', JSON.stringify(todoItems));\n const list = document.querySelector('.js-todo-list');\n const item = document.querySelector(`[data-key='${todo.id}']`);\n\n if (todo.deleted) {\n item.remove();\n if (todoItems.length === 0) list.innerHTML = '';\n return\n }\n\n const isChecked = todo.checked ? 'done': '';\n \n const node = document.createElement(\"li\");\n node.setAttribute('class', `todo-item ${isChecked}`);\n node.setAttribute('data-key', todo.id);\n node.innerHTML = `\n <input id=\"${todo.id}\" type=\"checkbox\"/>\n <label for=\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n <svg><use href=\"#delete-icon\"></use></svg>\n </button>\n `;\n\n if (item) {\n list.replaceChild(node, item);\n } else {\n list.append(node);\n }\n}", "async function render() {\n var toDoList = await axios.get(url).then(res => res.data);\n if (toDoList)\n for (let item of toDoList) {\n document.getElementById('list-item').appendChild(generatingItem(item.id, item.content));\n if (itemIndex < item.id)\n itemIndex = Number.parseInt(item.id);\n }\n else\n toDoList = [];\n}", "function todoView(item) {\n var todoConfig = U({ editing: false });\n var toggleEditing = C(_ => todoConfig.editing = !Boolean(todoConfig.editing));\n var doneEditing = C(_ => todoConfig.editing = false);\n var edit = C(_ => todoConfig.editing = true );\n \n return E('li') .\n is({ class: { completed: item.completed, editing: config.editing} }) .\n has([\n \n E('div#view') . has ([\n E('input') . is({type: 'checkbox'}) . does({click: 0}) . sets(item.completed),\n LABEL(item.title) . does({ doubleclick: edit })\n ]),\n \n E('input.edit') . sets(item.title) . does({ blur: doneEditing })\n ])\n ;\n }", "render(){\n\n\n console.log(this.props.todos);\n\n return (\n <table>\n\n <TodoListHeader />\n <tbody>\n {this.renderItems()}\n </tbody>\n </table>\n );\n }", "render() {\n return (\n <div>\n <ul className=\"todoList\">{\n this.props.todos.map((todo) => {\n return <TodoItem key={todo.id} todo={todo} actions={this.props.actions}/>\n })\n }</ul>\n </div>\n );\n }", "function showTodo(todo) {\n // Our single todo item template, each todo item is a single LI tag\n // Note that you can run functions and methods within the ${} template strings\n\n // console.log(todo)\n\n var todoTemplate = `<li class=\"list-group-item\">\n <div class=\"row\">\n <div class=\"col-xs-8\">\n <div class=\"checkbox\">\n <label>\n <input type=\"checkbox\" data-id=\"${todo.id}\" />\n ${todo.todo}\n </label>\n </div>\n </div>\n <div class=\"col-sm-2 text-right\">\n <span class=\"label label-danger\">${todo.category.toUpperCase()}</span>\n </div>\n <div class=\"col-sm-2 text-right\">\n <span class=\"label label-default\">${moment(todo.due_date).format('MM/DD/YYYY')}</span>\n </div>\n </div>\n </li>`\n\n // Concatenate our single todo item template onto the end of the existing todo items on the page\n todosContainer.innerHTML += todoTemplate\n}", "render(){\n\t\t/* Creates variables to hold properties */\n\t\tconst todoEntries = this.props.entries\n\t\tconst listItems = todoEntries.map(this.createItems)\n\n\t\treturn(\n\t\t\t/* Creates an unordered list that holds the information entered by user */\n\t\t\t<ul id = \"theList\">{listItems}</ul>\n\n\t\t)\n\t}", "render() {\n return (\n <table>\n <TodosListHeader />\n <tbody>\n {this.renderItems()}\n </tbody>\n </table>\n );\n }", "renderItem(item) { return item; }", "function _drawTodos() {\n // console.log(\"working from constructor\", store.State.todos);\n let template = \"\";\n\n store.State.todos.forEach(td => (template += td.Template));\n document.querySelector(\"#input\").innerHTML = template;\n}", "function displayItems() {\n const html = items\n .map(\n (item) => `<li class=\"shopping-item\">\n <input value=\"${item.id}\" type=\"checkbox\" ${item.complete && 'checked'}>\n <span class=\"itemName\">${item.name}</span>\n <button aria-label=\"Remove ${item.name}\" value=\"${item.id}\">&times;</button>\n </li>`\n )\n .join('');\n // console.log(html);\n list.innerHTML = html;\n}", "function renderItems(itemsData) {\n\n const filtered = itemsData.filter(item => item.trips.length > 0 ? item.trips[0].id === 16 : null)\n filtered.forEach(item => {\n let newItem = new Item(item)\n let itemHtml = newItem.indexTemplate()\n $('#items-container').append(itemHtml)\n })\n}", "function render() {\n let ul = document.getElementById(\"ul\");\n ul.innerHTML = \"\";\n for (let i = 0; i < todos.length; i++) {\n // Create li element\n let li = document.createElement(\"li\");\n li.classList.add(\"list-group-item\");\n li.innerHTML = todos[i].name;\n ul.appendChild(li);\n\n //Create Checkbox\n let checkBox = document.createElement(\"input\");\n checkBox.classList.add(\"checkBox\");\n checkBox.setAttribute(\"type\", \"checkbox\");\n checkBox.checked = todos[i].isCompleted;\n if (checkBox.checked == true) {\n li.classList.add(\"itemIsChecked\");\n }\n checkBox.addEventListener(\"change\", () => {\n toggleCheckbox(todos[i].name);\n li.classList.toggle(\"itemIsChecked\");\n });\n li.appendChild(checkBox);\n\n //Create remove button\n let remove = document.createElement(\"button\");\n remove.classList.add(\"delete\");\n remove.setAttribute(\"type\", \"button\");\n remove.setAttribute(\"aria-label\", \"Delete button\");\n remove.innerHTML = '<i class=\"far fa-trash-alt\"></i>';\n remove.addEventListener(\"click\", () => {\n removeTodo(todos[i].name);\n li.remove();\n });\n li.appendChild(remove);\n }\n}", "render() {\n return html`\n <h1 class=\"title__list\">${this.title}</h1>\n ${this.items.length === 0\n ? html`<p class=\"list__state\">${this.loading}</p>`\n : this.showList(this.items)}\n `;\n }", "function render() {\n // get all the todos stored on the repository\n var todos = global.TodoRepository.find();\n\n // no todos? :happy_face: render a message on the\n // screen telling: Nothing to do, yay!\n if (todos.length === 0) {\n return renderMessage(\"Nothing to do, yay!\");\n }\n\n // is there any filter active (all, pending, done)? Ok\n // then filter the todos and keep just the ones that\n // match the filter criteria\n var filteredTodos = todos.filter(function(todo) {\n if (filter === \"all\") {\n return true;\n }\n\n if (filter === \"pending\") {\n return !todo.complete;\n }\n\n if (filter === \"done\") {\n return todo.complete;\n }\n });\n\n // no todos after the filter? Cool\n // Print to the screen the message: Nothing here\n if (filteredTodos.length === 0) {\n return renderMessage(\"Nothing here\");\n }\n\n // The document doesn't know what it is a todo\n // the document only works with domNodes, so just\n // convert all our filtered todos into domNodes.\n var todoNodes = filteredTodos.map(function(todo) {\n // let's create a list item\n var todoNode = global.document.createElement(\"li\");\n\n // let's add it an id (so we can identify 'em later)\n todoNode.setAttribute(\"id\", \"todo-\" + todo.id);\n\n // add the text\n todoNode.textContent = todo.text;\n\n // is completed? let's mark it with the \"done\" class\n if (todo.complete) {\n todoNode.classList.add(\"done\");\n }\n\n // if somebody clicks it let's toggle the class\n todoNode.addEventListener(\"click\", toggleTodo);\n return todoNode;\n });\n\n // we must clean the list first (we don't want duplicated elements)\n todoList.innerHTML = \"\";\n\n // we must add every todoNode into the todoList\n todoNodes.forEach(function(todo) {\n todoList.appendChild(todo);\n });\n }", "function printAllTodos(apiUrl, template, todosList) {\n // clean\n todosList.html('');\n $.ajax({\n url: apiUrl,\n method: 'GET',\n success: function (data) {\n var todos = data;\n\n for (var i = 0; i < todos.length; i++) {\n var todo = todos[i];\n\n var context = {\n todo: todo.text,\n id: todo.id\n }\n var html = template(context);\n todosList.append(html);\n }\n\n },\n error: function () {\n console.log('errore richiesta todos');\n\n }\n\n });\n\n}", "function renderTasks(){\n todoList.innerHTML = ''\n\n tasks.forEach( task => {\n todoList.appendChild(generateTask(task))\n })\n}", "listTodos(){\n //this context works fine here.\n renderTodoList(getTodos(this.key), this.listContainer);\n }", "populateItemList(items) {\n let html = \"\";\n items.forEach(function(item) {\n html += `<li class=\"collection-item\" id=\"item-${item.id}\">\n <strong>${item.name}: </strong> <em>${item.calories} Calories</em>\n <a href=\"#\" class=\"secondary-content\">\n <i class=\"edit-item fas fa-pencil-alt\"></i>\n </a>\n </li>`;\n });\n //insert List item\n document.querySelector(UISelectors.itemList).innerHTML = html;\n }", "render() {\n return (\n <div>\n {this.props.list.map((d, i) => {\n return <Todo key = {i} status={d.status} priority={d.priority} description={d.description} />\n })\n }\n </div>\n )\n }", "renderTaskList(tasks) {\n this.ulTaskList.innerHTML = '';\n this.tasks.tasks.forEach((task, index) => this.createNewLiTodoElementHTML(task, index))\n }", "function renderAllTasks(tasksList) {\n if (!tasksList) {\n console.error(\"Передайте список задач\");\n return;\n }\n\n const fragment = document.createDocumentFragment();\n Object.values(tasksList).forEach(task => {\n const li = listItemTemplate(task);\n fragment.appendChild(li);\n });\n listContainer.appendChild(fragment);\n }", "render() {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<h1> Todos </h1>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t}", "function renderTodos1(todos) {\n for (var _i = 0, todos_1 = todos; _i < todos_1.length; _i++) {\n var todo = todos_1[_i];\n // let newRow: HTMLTableRowElement = (<HTMLTableElement>document.querySelector('tcontent'))!.insertRow(); // liefert null, #todo\n var newRow = document.getElementById('tcontent').insertRow();\n newRow.insertCell().innerText = String(todo.id);\n newRow.insertCell().innerText = String(todo.userId);\n newRow.insertCell().innerText = String(todo.title);\n newRow.insertCell().innerText = String(todo.completed);\n if (todo.completed) {\n newRow.style.textDecoration = 'line-through';\n }\n }\n}", "function renderToDos() {\n// let toDos = loadFromLocalStorage();\n ul.innerHTML = \"\";\n for(todo of toDos){\n // Checkbox (when clicked will cross out the text)\n const newCheckBox = document.createElement(\"input\");\n newCheckBox.setAttribute(\"type\", \"checkbox\");\n // task\n const newLi = document.createElement(\"li\");\n // Remove Button (when clicked will remove entire todo)\n const newRemoveBtn = document.createElement(\"button\");\n\n // todo is the object within the array toDos, todo has a key(task) and status set to false\n newLi.innerText = todo.task;\n newRemoveBtn.innerText = \"x\";\n newRemoveBtn.setAttribute(\"id\",\"removeBtn\");\n\n newLi.prepend(newCheckBox);\n newLi.append(newRemoveBtn);\n ul.append(newLi);\n\n // monitor the status of each todo\n if (todo.done) {\n newCheckBox.checked = todo.done;\n newCheckBox.classList.add(\"crossOut\");\n }\n }\n}", "function renderOnePost(todoItems) {\n // const sortedData = todoItems.sortby(['id'])\n const mainContainer = document.querySelector('.js-to-hide');\n mainContainer.style.display = \"none\";\n\n\n const postContainer = document.querySelector('.js-one-post');\n postContainer.style.display = \"block\";\n\n postContainer.innerHTML = '';\n // const todoItemsReverse = todoItems.reverse();\n // for (const todoItem of sortedData) {\n for (const todoItem of todoItems) {\n // const div = document.createElement('div');\n postContainer.innerHTML = `\n <a href=\"../index.html\">Back to home</a>\n\n <header>\n <h2>${todoItem.data.title}</h2>\n <p>${todoItem.data.todo}</p>\n </header>\n <section>\n <hr />\n <header>\n <p>${todoItem.data.when}</p>\n </header>\n </section>\n `;\n // container.appendChild(div);\n };\n }", "get Template() {\n let template = '';\n\n this.items.forEach(item => {\n template += `\n <div class=\"item-container m-1 p-1\">\n <span><input type=\"checkbox\" value=\"done\" class=\"form-check-input\">${item}</span><i class=\"fas fa-trash-alt removeIcon\" onclick=\"app.listController.removeListItem('${item}', '${this.id}')\" title=\"remove item from list\"></i>\n </div>\n `\n });\n\n return `\n <div class=\"card\" style=\"width: 15rem; background-color: ${this.color};\">\n <div class=\"card-body\">\n <form action=\"\" id=\"add-item\" onsubmit=\"app.listController.addListItem(event, '${this.id}')\">\n <i class=\"fa fa-times removeIcon\" onclick=\"app.listController.removeList('${this.id}')\"></i>\n <div class=\"listBtns m-1\">\n <h5 class=\"card-title\">${this.name}</h5>\n <button class=\"btn btn-light\" type=\"submit\" title=\"Add a task\"><i class=\"fas fa-plus add-item-btn\"></i></button></div>\n <div class=\"form-group\">\n <input type=\"text\" class=\"form-control\" id=\"listItemName\" name=\"listItemName\"\n placeholder=\"Add Task...\" required=\"true\">\n </div>\n </form>\n <div>${template}</div>\n </div>\n </div>\n </div>\n `\n }", "function renderActiveToDos(list) {\n const toDoTarget = document.getElementById(\"to-do-target\");\n const template = document.getElementsByTagName(\"template\")[1];\n clearTarget(toDoTarget);\n\n list.forEach((obj, index) => {\n const clone = template.content.cloneNode(true);\n const done = clone.querySelector(\".done\");\n const listItem = clone.querySelector(\".list-item\");\n const flag = clone.querySelector(\".flag\");\n const deleteItem = clone.querySelector(\".delete\");\n\n toDoTarget.appendChild(clone);\n\n done.addEventListener(\"click\", (event) => {\n obj.done ? (obj.done = false) : (obj.done = true);\n listItem.classList.contains(\"strikethrough\")\n ? listItem.classList.remove(\"strikethrough\")\n : listItem.classList.add(\"strikethrough\");\n });\n\n listItem.textContent = list[index].name;\n if (obj.done) {\n listItem.classList.add(\"strikethrough\");\n }\n if (obj.flag) {\n listItem.classList.add(\"flagged\");\n }\n\n flag.addEventListener(\"click\", (event) => {\n event.preventDefault();\n obj.flag ? (obj.flag = false) : (obj.flag = true);\n listItem.classList.contains(\"flagged\")\n ? listItem.classList.remove(\"flagged\")\n : listItem.classList.add(\"flagged\");\n });\n\n deleteItem.addEventListener(\"click\", (event) => {\n event.preventDefault();\n list.splice(index, 1);\n renderActiveToDos(list);\n });\n\n const newListItem = toDoTarget.childNodes;\n });\n}", "function render(){\n var contenL1 = document.getElementById('todo-list-map');\n var arrTodoHtml =todo.map(function(item,i){\n return '<li class =\"list-group-item\" id =\"li-map-'+i+'\">' + item + ' ' \n + '<button class =\"btn btn-outline-secondary _btn-delete\" onclick=\"deleteTodo('+i+')\">Delete</button></li>';\n });\n var content = arrTodoHtml.join('');\n contenL1.innerHTML=content;\n }", "render() {\r\n if (Object.keys(this.props.listItems).length === 0) {\r\n\r\n // return placeholder for empty list\r\n return (<ListPlaceholder\r\n emptyMessage=\"You have nothing to do at the moment. Why don't you put your feet up?\"\r\n filteredTotal={0}\r\n unfilteredTotal={0}/>)\r\n } else {\r\n\r\n // create actual list\r\n return (\r\n <List>\r\n {this\r\n .getKeys()\r\n .map(key => <MyTodoItem\r\n index={key}\r\n toggleDone={this.props.toggleDone}\r\n removeListItem={this.props.removeListItem}\r\n todoItem={this.props.listItems[key]}\r\n key={key}>{key}</MyTodoItem>)}\r\n </List>\r\n )\r\n }\r\n }", "function renderShoppingList() {\n // loop through store using map to generate html to be placed on page\n const items = STORE.map(listItemToHTML);\n // place html on page\n $('ul.shopping-list').html(items.join(''));\n}", "function printTodos(urlApi, template, list){\n //reset\n list.html('');\n\n $.ajax({\n url: urlApi,\n method: 'GET',\n success: function(data) {\n var todos = data;\n \n for (var i = 0; i < todos.length; i++) {\n var todo = todos[i];\n \n var context = {\n todo: todo.text,\n id: todo.id\n }\n \n var html = template(context);\n list.append(html);\n }\n $('.input').val('');\n \n },\n error: function() {\n console.log('Errore');\n }\n });\n}", "function addHTMLTodos(todo) {\n\tincompleteTasksList.innerHTML = \"\";\n\tfor (let i = 0; i < todo.length; i++) {\n\t\tlet node = document.createElement(\"li\");\n\t\tnode.setAttribute(\"class\", `\"item\"`);\n\t\tnode.setAttribute(\"dataKey\", todo[i].id);\n\t\tnode.setAttribute(\"update-key\", `\"item${i}\"`);\n\t\tnode.innerHTML =\n\t\t\t`\n <input type=\"checkbox\" class=\"checkbox\" id=\"${i}\" onclick=completeTasks(` +\n\t\t\ttodo[i].id +\n\t\t\t`,` +\n\t\t\ti +\n\t\t\t`)>\n <small>Task Added: ${todo[i].date}</small>\n <span><input type=\"text\" id=\"item${i}\" class=\"myinput\" value=\"${todo[i].name}\" disabled \"/> </span>\n <button class=\"btn btn-warning updateBtn\" id=\"btn${i}\" onclick=editItem(` +\n\t\t\ti +\n\t\t\t`)>Edit</button>\n <button class=\"btn btn-danger deleteBtn\">Delete</button>\n <br/>\n <hr/>\n `;\n\t\t// Append the element to the DOM as the last child of the element\n\t\tincompleteTasksList.append(node);\n\t}\n}", "function displayItems() {\n\n // empty both lists\n removeChildNodes(document.getElementById('list_todo'));\n removeChildNodes(document.getElementById('list_done'));\n\n // display tasks that still need to be done\n for (var i = 0; i < listComponent.unCompleted.length; i++) {\n var item = listComponent.unCompleted[i];\n\n // Add item to displayed list\n var listContainer = document.getElementById('list_todo');\n\n var itemDiv = document.createElement('div');\n addClass(itemDiv, 'item');\n itemDiv.dataset.item = JSON.stringify(item);\n\n var contentDiv = document.createElement('div');\n addClass(contentDiv, 'content');\n contentDiv.appendChild(document.createTextNode(item.content));\n\n itemDiv.appendChild(contentDiv);\n listContainer.insertBefore(itemDiv, listContainer.childNodes[0]);\n\n itemDiv.onclick = function () {\n selectItem(this, event);\n }\n }\n // display tasks that have already been completed\n for (var i = 0; i < listComponent.completed.length; i++) {\n var item = listComponent.completed[i];\n\n // Add item to displayed list\n var listContainer = document.getElementById('list_done');\n\n var itemDiv = document.createElement('div');\n addClass(itemDiv, 'item');\n itemDiv.dataset.item = JSON.stringify(item);\n\n var contentDiv = document.createElement('div');\n addClass(contentDiv, 'content');\n contentDiv.appendChild(document.createTextNode(item.content));\n\n itemDiv.appendChild(contentDiv);\n listContainer.insertBefore(itemDiv, listContainer.childNodes[0]);\n\n itemDiv.onclick = function () {\n selectCompletedItem(this, event);\n }\n }\n }", "get listTemplate() {\n return /*html*/`\n <div class=\"col-3 border rounded shadow-lg\">\n <h2>${this.title} <button type=\"button\"class=\"text-danger close mt-3\" onclick=\"app.listController.delete('${this.id}')\"><span>&times;</span></button></h2>\n\n <form onsubmit=\"app.taskController.create(event, '${this.id}')\">\n <div class=\"form-group\">\n <input type=\"text\" name=\"taskTitle\" class=\"form-control\" placeholder = \"Enter List Item...\">\n <button type=\"submit\" name=\"\" id=\"\" class=\"btn btn-primary\">Add List</button>\n </div>\n <div class=\"row\">\n ${this.tasks}\n </div>\n </form>\n </div>`\n }", "createTasks(item) {\n return <li onClick={() => this.delete(item.key)}\n key={item.key}>{item.text}</li>\n }", "renderNewList() {}", "function view()\n{\n\t// This function takes care of rendering the to do list\n\t// All UI elements should be added to the \"container\" \n\t// section of the HTML. \n\n\t// get container element by id\n\tvar container = document.getElementById(\"container\");\n\n\tcontainer.innerHTML = \"\";\n\n\t// go through todo list items and add them\n\tfor(var i = 0; i < todos.length; i ++) {\n\t\tvar div = document.createElement('div');\n\n\t\tdiv.className = 'row';\n\n\t\tvar status = '';\n\n\t\tif(todos[i].status == true) {\n\t\t\tstatus = 'checked';\n\t\t}\n\n\t\tdiv.innerHTML = '<input class=\"todoItem\" type=\"checkbox\" onclick=\"updateStatus('+i+')\" '+status+'>\\\n \t\t\t\t\t\t <label for=\"todoItem\">'+todos[i].name+'</label>'+todos[i].completeDate+' \\\n \t\t\t\t\t\t <br>';\n\n\t\tcontainer.appendChild(div);\n\t}\n\t\n\n // clear the text in the input field for todo item\n\tdocument.getElementsByName(\"task\")[0].value = \"\";\n\n}", "function ToDoItems(props) {\n return (\n <div>\n <TaggedContentCard href={\"/myPlants/detail/\" + props.id} thumbnail={props.image} title={props.commonName} description={props.scientificName} tags={[props.nextWaterDate]} />\n </div>\n );\n}", "async function render(){\n let todos = await listar_todos()\n const todos_template = todos.map(todo =>{\n if(todo.completado === 0){\n return '<div class=\"todo\" style=\"border-color:red;\" >'+'<h1 style=\"red;\">'+todo.titulo+'</h1>'+'<pre>'+todo.descripcion+'</pre>'+'<button class=\"eliminar\">Eliminar</button>'+'<button class=\"editar\">Editar</button>'+'<button class=\"completado\">Completado</button>'+'</div>'\n }\n else{\n return '<div class=\"todo\" style=\"border-color:rgb(21,255,0);\" >'+'<h1 style=\"color:rgb(21,255,0);\">'+todo.titulo+'</h1>'+'<pre>'+todo.descripcion+'</pre>'+'<button class=\"eliminar\">Eliminar</button>'+'<button class=\"editar\">Editar</button>'+'<button class=\"completado\">Completado</button>'+'</div>'\n }\n })\n contenedor.innerHTML = todos_template.join('')\n eliminar_todo(todos)\n completar_todo(todos)\n editar_todo_evento(todos)\n}", "function renderNew() {\n Items.getAll()\n .then(res => {\n $scope.items = res.data;\n })\n .catch(err => {\n $scope.items = err;\n });\n }", "function listHTMLString(item, index) {\r\n\t\treturn `<li class='list-content'> \\\r\n\t\t\t<div> \\\r\n\t\t\t\t<p class='task-to-do'><span class=${item.completed ? 'completed' : ''}>TASK: </span>\r\n\t\t\t\t\t<span class=${item.completed ? 'completed' : ''}>${item.task}</span> \\\r\n\t\t\t\t</p> \\\r\n\t\t\t\t<p>DEADLINE: <span class='deadline'>${item.date} ${item.time}</span></p> \\\r\n\t\t\t</div> \\\r\n\t\t\t<div data-list-index='${item.id}'> \\\r\n\t\t\t\t<i class='fas fa-check ${item.completed ? 'checked' : ''}'></i> \\\r\n\t\t\t\t<i class='fas fa-trash'></i> \\\r\n\t\t\t</div> \\\r\n\t\t</li>`\r\n\t}", "render() {\n\t\tthis.$dom.empty()\n\t\tif (this.isEmpty()) {\n\t\t\tlet $label = $('<label>')\n\t\t\t$label.text('empty')\n\t\t\t$label.addClass('text-muted')\n\t\t\tthis.$dom.append($label)\n\t\t} else {\n\t\t\tfor (var sku in this.items) {\n\t\t\t\tvar li = this.items[sku]\n\t\t\t\tvar $p = this.createLineItem(li)\n\t\t\t\tthis.$dom.append($p)\n\t\t\t}\n\t\t}\n\t}", "function displayDoneTodos() {\n\tlet todos = '';\n\tfor (let index = 0; index < doneTodoList.length; index++) {\n\t\tlet counter = index + 1;\n\t\ttodos += `<p>\n ${counter}. ${doneTodoList[index]} \n `;\n\t}\n\tdocument.getElementById('displayDoneTodoList').innerHTML = todos;\n}", "function displayItems(items) {\n const contents = document.getElementById('contents');\n const html = items.map(item => createHTMLString(item));\n contents.innerHTML = items.map(item => createHTMLString(item)).join('');\n}", "render() {\n // Filter by items that pass filtering\n let activeItems = this.props.items\n .filter( this.props.filterFunction.bind( this ) )\n\n // create items from ListItem template\n let items = activeItems.map( ( item, index ) => {\n // Pass all object properties to the template component\n return <this.props.ItemTemplate key={ 'item' + index } {...item} />\n })\n\n // Call the callback to let listeners know a filter event has taken place\n this.props.onFilter( activeItems )\n\n return (\n <ul className=\"DLR-List-container\">\n { items }\n </ul>\n )\n }", "function renderItems(items) {\n if (!items) {\n items = budgetItems;\n }\n\n var tbody = $(\"#budgetItems tbody\");\n // clear out previous budget items\n tbody.empty();\n\n // make table row for each budget item\n items.forEach(function (item) {\n var row = `<tr><td>${item.date}</td><td>${item.name}</td><td>${item.category}</td><td>$${parseFloat(item.amount).toFixed(2)}</td><td>${item.notes}</td><td class=\"delete\">X</td></tr>`\n tbody.prepend(row);\n });\n\n // get total amount for all items or categories\n var totalAmount = items.reduce(function (accum, item) {\n return accum + parseFloat(item.amount);\n }, 0);\n\n $(\"#total\").text(`$${totalAmount.toFixed(2)}`);\n}", "render() {\n const tasksHtmlList = [];\n\n // Loops through tasks array objects to store in tasksHtmlList\n for (let i = 0; i < this.tasks.length; i++) {\n const task = this.tasks[i]; // initialize an array to store the tasks\n\n // Format the date\n const date = new Date(task.dueDate);\n const formattedDate =\n date.getDate() + \"/\" + (date.getMonth() + 1) + \"/\" + date.getFullYear();\n\n // Pass the task id as a parameter\n const taskHtml = createTaskHtml(\n // call the function expression creattaskHtml with parameters\n task.id,\n task.name,\n task.description,\n task.assignedTo,\n formattedDate,\n task.status\n );\n\n tasksHtmlList.push(taskHtml); // push the new task values to taskHtmlList\n }\n\n const tasksHtml = tasksHtmlList.join(\"\\n\");\n\n const tasksList = document.querySelector(\"#tasksList\");\n tasksList.innerHTML = tasksHtml;\n }", "function getTodos() {\n checksaveTodos();\n todos.forEach(function(todo) {\n var newList = document.createElement('li');\n newList.classList.add(\"list-item\");\n newList.innerHTML = `${todo}`;\n unList.append(newList);\n var icon = document.createElement('i');\n icon.setAttribute(\"class\", \"fas fa-trash\");\n newList.appendChild(icon);\n })\n pendingItem(todos);\n}", "todoList() {\r\n return this.state.todos.map(function (currentTodo, i) {\r\n return <Todo todo={currentTodo} key={i} />;\r\n });\r\n }", "itemList() {\n return this.state.items.map(currentitem => {\n return <Item item={currentitem} deleteItem={this.deleteItem}\n key={currentitem._id} />\n })\n }", "function renderTodos(todos) {\n $('#todo-div').empty();\n $('#completed-div').empty();\n // Loop through the results of the get route.\n for (let x of todos) {\n // If it's got a completed date, it's gonna go in the completed section with a green background.\n if (x.date_completed) {\n let $div = $(`<div class=\"todo-item completed-todo\" data-id=${x.id}></div>`);\n $div.append(`<p class=\"todo-name\"><b>${x.name}</b></p>`);\n $div.append(`<p class=\"todo-task\">${x.todo}</p>`);\n $div.append(`<p class=\"todo-added\">Added: ${x.date_added}</p>`);\n $div.append(`<p class=\"todo-completed\">Completed: ${x.date_completed}</p>`);\n $div.append(`<button class=\"btn-undo-complete btn btn-sm\" data-completion=\"${x.date_completed}\">Not Done</button>`);\n $div.append(`<button class=\"btn-delete btn btn-danger btn-sm\">Delete</button>`);\n $('#completed-div').append($div);\n\n }\n // If it doesn't have a completed date, it's gonna go in the to-do section with a yellow background.\n else {\n let $div = $(`<div class=\"todo-item\" data-id=${x.id}></div>`);\n $div.append(`<p class=\"todo-name\"><b>${x.name}</b></p>`);\n $div.append(`<p class=\"todo-task\">${x.todo}</p>`);\n $div.append(`<p class=\"todo-added\">Added: ${x.date_added}</p>`);\n $div.append(`<p class=\"todo-completed\">Not Completed</p>`);\n $div.append(`<button data-completion=\"${x.date_completed}\" class=\"btn-complete btn btn-success btn-sm\">Done!</button>`);\n $div.append(`<button class=\"btn-delete btn btn-danger btn-sm\">Delete</button>`);\n $('#todo-div').append($div);\n }\n\n }\n}", "function showTodos() {\n var i, l,\n html = '';\n \n\t\t// process todos\n for(i = 0, l = todos.length; i < l; i++) {\n if(showing == 'all' || \n (todos[i]['completed'] && showing == 'completed') || \n (!todos[i]['completed'] && showing == 'active')) \n\t\t\t{\n \n html += '<div class=\"todo-item ' + (todos[i]['completed'] ? 'completed' : '') + '\" id=\"todo-holder-' + i + '\">' + \n\n todos[i]['todo'] +\n\n '<a href=\"#\" class=\"remove\" data-id=\"todo-' + i + '\">&times;</a>' +\n\n '<a href=\"#\" class=\"complete\" data-id=\"todo-' + i + '\">&#x2713;</a>' +\n\n '<form id=\"todo-edit-form-' + i + '\">' +\n\n '<input id=\"todo-edit-' + i + '\" type=\"text\" value=\"' + todos[i]['todo'] + '\">' +\n\n '</form>' +\n\n '</div>';\n }\n }\n \n\t\t// render todos\n $('todos').innerHTML = html;\n \n\t\t// render toolbar\n $('toolbar').innerHTML = '<span id=\"total-items\">' + todos.length + ' item' + (todos.length == 1 ? '' : 's') + '</span>' +\n '<a href=\"#\"' + (showing == 'all' ? ' class=\"selected\"' : '') + ' id=\"show-all\">All</a>' +\n '<a href=\"#\"' + (showing == 'active' ? ' class=\"selected\"' : '') + ' id=\"show-active\">Active</a>' +\n '<a href=\"#\"' + (showing == 'completed' ? ' class=\"selected\"' : '') + ' id=\"show-completed\">Completed</a>';\n \n $('toolbar').style.display = todos.length ? 'block' : 'none';\n \n }", "render() {\n console.log(\"PROPS ('Project.js'): \", this.props);\n\n let todoItems;\n // Test to see if there are any 'todos'\n if (this.props.todos) {\n // We are using '.map' because we have an array ('todo')\n todoItems = this.props.todos.map(todo => {\n console.log(\"todoItems: \", todo);\n\n return (\n /*\n 'TodoItem' component to pass in each 'todo' as a property\n\n It is also being assigned to 'TodoItem' variable in the return below\n\n Unique \"key\" prop is needed and must be set for each child in an array or iterator (based on 'todo' array of objects)\n */\n <TodoItem onDelete={this.deleteTodo.bind(this)} key={todo.title} todo={todo} />\n )\n });\n }\n\n return (\n // 'className' == 'class' in JSX\n // Script tags must always have closing pairing tags\n <div className=\"Todos\">\n <h3>Todo List</h3>\n {todoItems}\n <br />\n </div>\n );\n }", "render (h) {\n return h(ItemList, { props: {title}})\n }", "function renderTheUI() {\n //below is how you make it usable\n const toDoList = document.getElementById(\"toDoList\");\n //textContent is an attribute that it has\n toDoList.textContent = \"\";\n\n //for everything in this list do the thing (this function) this function is not named\n toDos.forEach(function(toDo) {\n //these are creating html elements (document.createElement creates html element without being in the html file)\n const newLi = document.createElement(\"li\");\n const checkbox = document.createElement(\"input\");\n const deleteButton = document.createElement(\"button\");\n\n //create a function to use when you press delete\n function deleteToDo() {\n //I want my list toDos to be filled with filtered items that are not\n //filter is a built in function for lists, which runs a function against your lists\n //item is creating another anonomys function (instead of function ()) and\n //alternative to write [after .filter( ] this could be: function(item){ } item => {return item !== toDos;}\n toDos = toDos.filter(item => {\n return item.id !== toDo.id;\n });\n }\n\n //for above this is what the object item and toDo look like\n // {\n // title\n // complete\n // id\n // };\n deleteButton.addEventListener(\"click\", event => {\n deleteToDo();\n renderTheUI();\n });\n\n checkbox.type = \"checkbox\";\n\n newLi.textContent = toDo.title;\n deleteButton.textContent = \"Delete!\";\n\n toDoList.appendChild(newLi);\n newLi.appendChild(checkbox);\n newLi.appendChild(deleteButton);\n });\n }", "render() {\n this.list.innerHTML = '';\n\n startingData.forEach(item => {\n this.createDomElements(item.id);\n this.li.insertAdjacentHTML('afterbegin', item.authorLast+\", \"+item.authorFirst+\". \"+\"<i>\"+item.title+\". \"+\"</i>\"+item.publisher+\": \"+item.year+\".\");\n this.list.appendChild(this.li);\n });\n }", "static renderTasks(tasks) {\n const todoList = document.getElementById(\"taskList\");\n let view = \"\";\n\n tasks.forEach(t => {\n let checked = t.completed ? \"checked\" : \"\";\n let classDone = t.completed ? \"done\" : \"\";\n // console.log(t.id + ' checked: ' + checked + ' ' + t.completed);\n view += `<li id='${t.id}' class='show ${classDone}'>\n <input type='checkbox'\n id='cb_${t.id}' onclick='checkTask(this.id)'${checked}/>\n <p>${t.content}</p>\n <a id='a_${t.id}' href='#' onclick='deleteTask(this.id)'> X </a> \n </li>`;\n });\n todoList.innerHTML = view;\n }", "function renderTodo(todo) {\r\n localStorage.setItem(\"todoItems\", JSON.stringify(todoItems));\r\n // seleting the first element with a class of \"js-todo-list\"\r\n const list = document.querySelector(\".js-todo-list\");\r\n // Select the current todo items in the DOM\r\n const item = document.querySelector(`[data-key='${todo.id}']`);\r\n\r\n if(todo.deleted) {\r\n // remove the item from the DOM\r\n item.remove();\r\n return\r\n }\r\n\r\n // use te ternary opertor to check if the \"todo.checked\" is true \r\n // if so, assign 'done' to 'isChecked'.Otherwise, assign an empty string\r\n const isChecked = todo.checked ? 'done' : \" \";\r\n\r\n //create a 'li' element and assign it to 'node'\r\n const node = document.createElement(\"li\");\r\n //set the class attribute\r\n node.setAttribute(\"class\", `todo-item ${isChecked}`);\r\n //set the data-key attribute to the id of the todo\r\n node.setAttribute(\"data-key\", todo.id);\r\n \r\n //Setting the contents of the 'li' element created above \r\n node.innerHTML = `\r\n <input id =\"${todo.id}\" type=\"checkbox\" />\r\n <label for =\"${todo.id}\" class=\"tick js-tick\"></label>\r\n <span>${todo.text}</span>\r\n <button class=\"delete-todo js-delete-todo\"> <svg><use href=\"#delete-icon\"></use></svg> </button>\r\n \r\n `;\r\n // If the item already exists in the DOM \r\n if (item) {\r\n list.replaceChild(node, item);\r\n } else {\r\n // Otherwise append it to the end of the list\r\n list.append(node);\r\n }\r\n\r\n\r\n}", "renderTodos(todos, filters) {\r\n\r\n // filter by the todo task property values\r\n const filteredTodos = todos.filter(todo => {\r\n\r\n // setup text filter\r\n const textMatch = todo.task.toLowerCase().includes(filters.searchText.toLowerCase())\r\n // setup completed status filter\r\n const completedMatch = ! filters.hideCompleted || ! todo.completed\r\n\r\n return textMatch && completedMatch\r\n })\r\n\r\n const todoList = document.getElementById('todo-list')\r\n \r\n // clear the todo list on the page\r\n todoList.innerHTML = ''\r\n\r\n // create a summary of todos that need completing\r\n todoList.appendChild(this.generateSummaryDOM(filteredTodos))\r\n\r\n // add the todos to the todo list on the page\r\n filteredTodos.forEach(todo => {\r\n const createTodo = this.generateTodoDOM(todo)\r\n todoList.appendChild(createTodo)\r\n }) \r\n }", "render() {\n // console.log(this.store.cartItems);\n // let tbody = this.root.querySelector('tbody');\n // tbody.innerHTML = `<tr class=\"item\">\n // <td><p>'items.date'</p></td>\n // <td>'items.imgsrc'<br />'items.name'</td>\n // <td>'items.customer'</td>\n // <td>'items.status'</td>\n // </tr>`;\n }", "function renderTask(listTask) {\n ulList.innerHTML = '';\n\n listTask.forEach(function(item) {\n //check if the task is completed or not\n const checked = item.completed ? 'checked': null;\n\n const li = document.createElement('li');\n //set a class to the li\n li.setAttribute('class', 'task');\n //gives the li a id\n li.setAttribute('data-key', item.id);\n\n \n //it creates the li markup\n li.innerHTML = \n `<input type=\"checkbox\" class=\"checkbox\" ${checked}>\n <span>- ${item.name}</span>\n <i class=\"far fa-trash-alt delete-button\"></i>`;\n\n //if the task is completed, it add a line through\n if(item.completed === true) {\n li.children[1].classList.add('strike');\n }\n\n //add task inside ul\n ulList.append(li)\n\n });\n}", "render(){\n const { items } = this.state; \n \n return(\n <View>\n {\n items.items && items.items.map(this.renderItem)\n }\n </View>\n )\n }", "render() {\n this.$listBody = this.getBody();\n\n this._renderItems();\n this.trigger('rendered');\n\n return this;\n }", "renderLists() {\n\t\treturn _.map(this.props.lists, (list,listKey) => { \n\t\t\treturn (\n\t <div className={`todo-list ${list.type}`} key={listKey}>\n\t \t<div className=\"todo-list-header\">\n\t \t\t<button \n\t \t\t\tclassName=\"btn btn-graphic\" \n\t \t\t\ttitle=\"Delete List\" \n\t \t\t\tonClick={() => this.props.removeList(this.props.user.uid,listKey)}>\n\t \t\t\t<p>X</p>\n\t \t\t</button>\n\t\t \t<button \n\t\t\t \tclassName=\"btn btn-graphic\" \n\t\t\t \ttitle=\"Edit\" \n\t\t\t \tonClick={() => this.edit(listKey)}>\n\t\t\t \t{<p>&#x270E;</p>}\n\t\t \t</button>\n\t\t \t<h2>{list.title}</h2>\n\t \t</div>\n\n\t \t<ul className=\"list-group list-group-flush\">\n\t \t{(list.items).map((item,index) => (\n\t\t\t\t\t<ListItem\n\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\titem={item[0]}\n\t\t\t\t\t\tcomplete={item[1]}\n\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\tlistName={listKey}\n\t\t\t\t/>))}\n\t \t</ul>\n\t </div>\n\t );\n \t});\n\t}", "function displayItems(items) {\r\n const container=document.querySelector('.items');\r\n container.innerHTML=items.map(item=>createHTMLString(item)).join('');\r\n}" ]
[ "0.7524637", "0.74975294", "0.7435264", "0.7344821", "0.7159357", "0.7054646", "0.6973523", "0.6955017", "0.6851485", "0.6840535", "0.6798981", "0.67904633", "0.6770597", "0.6713732", "0.67127234", "0.6710842", "0.6650769", "0.6641668", "0.6633112", "0.66037863", "0.6591429", "0.65782636", "0.6554712", "0.65492594", "0.6543188", "0.6541962", "0.6537127", "0.6514008", "0.65035826", "0.65031964", "0.64827716", "0.64543533", "0.64488447", "0.64413446", "0.6417752", "0.6387238", "0.6369455", "0.6359446", "0.63505423", "0.6328693", "0.63187885", "0.6318625", "0.630656", "0.6272915", "0.62687427", "0.62634355", "0.62563634", "0.62556803", "0.6247683", "0.62468696", "0.6218121", "0.62175286", "0.6210886", "0.619589", "0.61601555", "0.61402726", "0.61380917", "0.6124711", "0.61174345", "0.6113144", "0.609397", "0.6087831", "0.6084627", "0.6079045", "0.6071618", "0.6070429", "0.6069014", "0.6065454", "0.60497206", "0.60360384", "0.6019008", "0.6017154", "0.6006775", "0.6006256", "0.5997203", "0.59949017", "0.5994516", "0.5978342", "0.5976937", "0.59753406", "0.5961838", "0.59598655", "0.5957923", "0.5953829", "0.594587", "0.5944377", "0.59414077", "0.59396243", "0.5939078", "0.5931932", "0.59306836", "0.5929537", "0.5917666", "0.590679", "0.58972746", "0.58940053", "0.5893791", "0.58859015", "0.5876489", "0.587317" ]
0.7950711
0
reset active classes for nav items
function resetNavBarActiveItems(){ $("#navDashboardLinkItem").removeClass("active"); $("#navPlayersLinkItem").removeClass("active"); $("#navAdminsLinkItem").removeClass("active"); $("#navGroupsLinkItem").removeClass("active"); $("#navEventsLinkItem").removeClass("active"); $("#navCoursesLinkItem").removeClass("active"); $("#navResultsLinkItem").removeClass("active"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetActiveLink() {\n menuLinks.forEach((li) => {\n li.classList.remove(\"active\");\n });\n}", "function setNavActive() {\n $('.nav-a.active').toggleClass('active');\n $(this).toggleClass('active');\n }", "function setActiveNavigation(activeTab) {\n $(\".nav li\").removeClass(\"active\");\n\n $(\"#\" + activeTab).addClass(\"active\");\n }", "function setActiveNavigation(activeTab) {\n $(\".nav li\").removeClass(\"active\");\n\n $(\"#\" + activeTab).addClass(\"active\");\n }", "function changeActiveState(item) {\n $('a.active').removeClass('active');\n $(item).addClass('active');\n}", "clearActiveItems() {\n removeClasses(this.activeItems, 'active');\n this.activeItems = [];\n }", "function setActiveNavLink() {\n // clears the \"active\" class from each of the list items in the navigation\n document.querySelectorAll(\"li.nav-item\").forEach(function (listItem) {\n listItem.setAttribute(\"class\", \"nav-item\");\n });\n\n // add the \"active\" class to the class attribute of the appropriate list item\n document.getElementById(document.title).classList.add(\"active\");\n }", "function deactivateNavItems () {\n\t$( \".nav-item\" ).each( function( i, item ) {\n \t$(item).addClass(\"nav-inactive\")\n\t});\n}", "function SetAllMenuLinksToInactive() {\n \n // target each menu list item and do the following ...\n $('div.navbar-nav a').each(function () {\n \n // remove the \"active\" CSS class from the element's \"class\" attribute\n $(this).removeClass('active');\n \n }); // end of $('div.navbar-nav a').each()\n \n} // end of function SetAllMenuLinksToInactive() {", "removeActiveClass() {\n\t\t\tlet children = this.id.childNodes;\n\t\t\t\n\t\t\tchildren.forEach(function(item) {\n\t\t\t\titem.classList.remove('nav__list-item--active');\n\t\t\t});\n\t\t}", "function makeActive(i){\n\tvar navitems=$('.nav').find('li');\n\tnavitems.removeClass('active');\n\tnavitems.eq(1).addClass('active');\n}", "function resetActiveCss() {\r\n\t$(\".active\").removeClass(\"active\");\r\n}", "function removeActiveClass() {\n\t\tsideBarItems.forEach(item => {\n\t\t\titem.classList.remove('sidebar__item_active')\n\t\t});\n\t}", "function addActive(){\n\tnavLinks.forEach(navLink => navLink.classList.remove('active'));\n\tthis.classList.add('active');\n}", "function dimAllNavItems(){ //Dim non-selected navItems\n\tconsole.log(\"Dimming all navItems...\");\n\t$(\".navItem\").removeClass('active');\n\tconsole.log(\"Dimmed navItems#\");\n}", "function setNavActive(navPosition){\n $(\".root > li a\").removeClass(\"active__current\");\n $( \".root > li a\" ).each(function( index ) {\n if(index==navPosition){\n $(this).addClass(\"active__current\");\n return;\n }\n });\n}", "function activeLinks(){\n $menuLinks = $('.navbar li'),\n $menuLinkActive = $menuLinks.hasClass('active');\n\n $menuLinks.on('click', function(e){\n e.preventDefault();\n var $this = $(this);\n $this.addClass('active');\n $('*').not($this).removeClass('active');\n })\n }", "function updateNav(item) {\n $('button.navigation').removeClass('active');\n $('button.navigation[name=' + item + ']').addClass('active');\n}", "function addactiveclass() {\n $(\"nav ul li a\").each(function () {\n var scrollPos = $(document).scrollTop();\n var currLink = $(this);\n var refElement = $(currLink.data(\"scroll\"));\n if (\n refElement.position().top <= scrollPos &&\n refElement.position().top + refElement.height() > scrollPos\n ) {\n $(\"nav ul li a\").removeClass(\"active\");\n currLink.addClass(\"active\");\n } else {\n currLink.removeClass(\"active\");\n }\n });\n }", "function activeNav(currentNav){\n document.querySelectorAll('.active.pages')[0].classList.remove(\"active\")\n document.getElementsByClassName('pages')[currentNav].classList.add(\"active\")\n}", "function removeAllActive() {\n var navBars = document.getElementsByTagName(\"LI\");\n\n for(var i = 0; i < navBars.length; i++) {\n navBars[i].className = \"\";\n }\n}", "_clearNavbarSelectedItems(navbar) {\n var menuItems = navbar.getElementsByTagName('li');\n for (const item of menuItems) {\n item.classList.remove('active');\n }\n }", "function selectedNav(position){\n\n for(let i=0; i<selected_nav.length; i++){\n const element=selected_nav[i];\n element.classList.remove(\"active\")\n }\n selected_nav[position].classList.add(\"active\")\n}", "function removeActive() {\r\n $(\".navbar a\").removeClass(\"active\");\r\n}", "function resetActiveClass($this) {\r\n \r\n // remove active class\r\n var $headers = $(document).find('div[data-role=\"header\"]');\r\n $headers.find('a').removeClass(\"ui-btn-active\");\r\n\r\n // set active class\r\n $this.addClass(\"ui-btn-active\");\r\n}", "function active_nav(current) {\n\t$('#nav-'+locate).removeClass(\"active\");\n\t$('#nav-'+current).addClass(\"active\");\n\tlocate = current;\n}", "function setMenuActive() {\n $('.menu-li.active').toggleClass('active');\n $(this).toggleClass('active');\n }", "function removeActiveClassFromLinks(){\n\n const links = document.querySelectorAll('li > a');\n for(let i=0;i<links.length;i++){\n links[i].className=\"\";\n }\n}", "function clear_selected_links() {\n $(\"nav ul li\").each(function() {\n $(this).removeClass(\"active\");\n });\n}", "function addActiveClass() {\n const selected = \".navbar-large li a\";\n $(selected).on(\"click\", function(e) {\n $(selected).removeClass(\"active\");\n $(this).addClass(\"active\");\n });\n}", "function resetMenuItem () {\n \n $('.smart-phone li, #taskBar, .desktop-menu, .lang-select').removeClass('active');\n }", "function setActiveNav() {\n if ($('h3').html() === 'My Quizzes') {\n $('#navMyQuizzes').closest('li').\n addClass('active');\n $('#sideNavMyQuizzes').closest('li').\n addClass('active');\n return;\n }\n\n if ($('#createQuiz').length) {\n $('#navNewQuiz').closest('li').\n addClass('active');\n $('#sideNavNewQuiz').closest('li').\n addClass('active');\n return;\n }\n\n if ($('.quiz-search').length) {\n $('#navQuizSearch').closest('li').\n addClass('active');\n $('#sideNavQuizSearch').closest('li').\n addClass('active');\n return;\n }\n\n if ($('#editUserModal').length) {\n $('#navUserAdmin').closest('li').\n addClass('active');\n $('#sideNavUserAdmin').closest('li').\n addClass('active');\n return;\n }\n\n if ($('#loginForm').length) {\n $('#navLogin').closest('li').\n addClass('active');\n $('#sideNavLogin').closest('li').\n addClass('active');\n return;\n }\n\n if ($('#register').length) {\n $('#navRegister').closest('li').\n addClass('active');\n $('#sideNavRegister').closest('li').\n addClass('active');\n }\n\n}", "function changeClass(lien){\n if($(\"#\"+lien).attr(\"class\") != \"nav-link active\"){ \n $(\".custom-nav\").find(\"a\").toggleClass(\"active\"); \n } \n}", "function removeActiveClass(links) {\n links.forEach(link => {\n link.classList.remove('active');\n })\n}", "function changeActive(e) {\n\t$('.main-menu li').removeClass('active');\n\t$(e).addClass('active');\n}", "function setActive(current) {\n\n $(\".nav-link\").removeClass(\"current-section\");\n\n $(`.nav-link[href='#${current}']`).addClass('current-section');\n\n }", "function changeActiveMenu(){\n\tvar subpath = window.document.location.pathname;\n\tvar arr = subpath.split('/');\n\tif(arr.length==0)\n\t\treturn;\n\tvar match = false;\n\t$.each(arr, function(pi, pn){\n\t\tif(match) return;\n\t\t$.each($('.menu li'),function(i,n){\n\t\t\tif($(n).attr('data')==pn){\n\t\t\t\t$(n).addClass('current_page_item');\n\t\t\t\tmatch = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$(n).removeClass('current_page_item');\n\t\t\t}\t\t\n\t\t})\n\t});\n}", "function activeClass() {\n for (let i = 0; i < navElements.length; i++) {\n if (checkViewport(navElements[i])) {\n navElements[i].classList.add(\"your-active-class\");\n navMenuItems[i].classList.add(\"your-active-class\");\n } else {\n navElements[i].classList.remove(\"your-active-class\");\n navMenuItems[i].classList.remove(\"your-active-class\");\n }\n }\n}", "function setCurrentMenuItem() {\n var activePageId = $('.page.active').attr('id');\n // set default nav menu\n $('.vs-nav a[href$=' + activePageId +']').parent().addClass('current_page_item').siblings().removeClass('current_page_item');\n }", "function removeAllActive() {\n\t\t$(\".category-menu li\").removeClass(\"active\");\n\t}", "function handleNavClick() {\n $(\"nav a\").removeClass(\"current\");\n $(this).addClass(\"current\");\n}", "function removeActivMailNav() {\n\tmail_nav.forEach((b) => {\n\t\tb.parentElement.classList.remove(\"active\");\n\t});\n}", "function setActivePagination() {\n pagination.forEach((item, index) => {\n index === carouselItemsActiveIndex\n ? item.classList.add(\"pagination-bullet--active\")\n : item.classList.remove(\"pagination-bullet--active\");\n });\n}", "function updateNavs(nextPos) {\n\n $('.side-nav, .header_nav').children().removeClass('is-active');\n $('.side-nav').children().eq(nextPos).addClass('is-active');\n $('.header_nav').children().eq(nextPos).addClass('is-active');\n\n }", "function highlightNav(id) {\n $('nav .active').removeClass('active');\n $(id).addClass('active');\n }", "function addActiveClass() {\n\n\t//Variable (for all navigation links)\n\tlet links = document.querySelectorAll('.grid__header--nav--imagelink, .grid__header--nav--item'); //Getting all links\n\n\t//Loop through the links and add active class to the current clicked link\n\tfor (let i = 0; i < links.length; i++) {\n\n\t\t//Adding click event on the all links\n\t\tlinks[i].addEventListener('click', function() {\n\n\t\t\t//Link with active class\n\t\t\tlet activeLink = document.getElementsByClassName('active'); //Find el. with active class on it\n\n\t\t\t//Removing active class from the previous link\n\t\t\tactiveLink[0].className = activeLink[0].className.replace(' active', ''); //Replace active class wtih empty space on the el. with active class\n\n\t\t\t//Adding active class to the clicked link\n\t\t\tthis.classList.add('active');\n\t\t});\n\t}\n}", "function activeLink() {\n resetActiveLink();\n this.className = \"active\";\n}", "function addClass () {\n $('.menu-item-just').removeClass('menu-item_active');\n $(`.menu-item-just[href=\"#${id}\"]`).addClass('menu-item_active');\n }", "function InitialHomeMenuState()\n {\n homeMenuLi = document.getElementsByClassName(\"nav-item\");\n // console.log(homeMenuLi)\n\n homeMenuLi[0].lastChild.classList.remove(\"inactive-btn\");\n homeMenuLi[0].lastChild.classList.add(\"active-btn\");\n\n }", "function updateActiveNavLink($clickedLink){\n\t\t$navbarNavLi.removeClass('active');\n\t\t/*If click the \"Julia Hazer\" section of navbar,\n\t\tmake the \"about\" nav link active*/\n\t\tif ($clickedLink.hasClass('navbar-brand')){\n\t\t\t$navbarNavLi.eq(0).addClass('active');\n\t\t}\n\t\telse {\n\t\t\t$clickedLink.parent().addClass('active');\n\t\t}\n\t}", "function updateHeaderActiveClass(){\n $('.header__menu li').each(function(i,val){\n if ( $(val).find('a').attr('href') == window.location.pathname.split('/').pop() ){\n $(val).addClass('is-active');\n } else {\n $(val).removeClass('is-active')\n }\n });\n }", "function setActiveItemMenuRight(el){\n for(i = 0; i < listItems.length; i++) {\n listItems[i].classList.remove(\"active\");\n }\n el.classList.add(\"active\");\n}", "function removeActive(items) {\n for (var i = 0; i < items.length; i++) {\n items[i].classList.remove(\"autocomp-active\");\n }\n }", "function showActive() {\n for (let i = 0; i < navItems.length; i++) {\n navItems[i].addEventListener(\"click\", function() {\n let current = document.getElementsByClassName(\"current\");\n current[0].className = current[0].className.replace(\" current\", \"\");\n this.className += \" current\";\n });\n // closing menu after link click\n toggleMenu();\n }\n}", "function updateHeaderActiveClass() {\n $('.header__pages a').each(function(i, val) {\n if ($(val).attr('href') == window.location.pathname.split('/').pop()) {\n $(val).addClass('is-active');\n } else {\n $(val).removeClass('is-active')\n }\n });\n }", "function removeActiveAll() {\n $('.portfolio').removeClass('active');\n $('.contact').removeClass('active');\n $('.about').removeClass('active');\n $('.home').removeClass('active');\n}", "function changeActiveNav(id) {\n\t\tvar i = 0;\n\t\twhile ((i<navList.length) && (!$(navList[i]).hasClass(\"activeNav\"))) {\n\t\t\ti++;\n\t\t}\n\t\tif (navList[i] != id) {\n\t\t\t$(navList[i]).removeClass(\"activeNav\");\n\t\t\t$(id).addClass(\"activeNav\");\n\t\t}\t\t\n\t}", "changeActiveClass(){\n this.slideArray.forEach((item) => item.element.classList.remove(this.activeClass))\n this.slideArray[this.index.active].element.classList.add(this.activeClass);\n }", "function initMenuItem() {\n $(\".navigation-menu a\").each(function () {\n var pageUrl = window.location.href.split(/[?#]/)[0];\n if (this.href == pageUrl) { \n $(this).parent().addClass(\"active\"); // add active to li of the current link\n $(this).parent().parent().parent().addClass(\"active\"); // add active class to an anchor\n $(this).parent().parent().parent().parent().parent().addClass(\"active\"); // add active class to an anchor\n }\n });\n }", "function setActiveSection() {\n for (let i=0; i < sections.length; i++) {\n // Selects all the nav items and stores in NodeList\n const navItems = document.querySelectorAll('.menu__link');\n if (isInViewport(sections[i])) {\n sections[i].classList.add('active');\n // Removes all active classes from each navItem\n navItems.forEach(navItem => navItem.classList.remove('active'));\n // Adds active class to the navItem that matches the section that is in view\n navItems[i].classList.add('active');\n }\n else {\n // Removes active classes if the section is not in view\n sections[i].classList.remove('active');\n }\n }\n}", "function activeMenuMain() {\n let {pathname} = location;\n if(pathname == \"/\") pathname = \"/trang-chu\";\n $(\"#nav-main li\").removeClass(\"active\");\n $(`#nav-main li[data-active='${pathname.slice(1)}']`).addClass(\"active\");\n}", "function active() {\n $html.addClass('active');\n }", "function review_reset_dot_nav() {\n // remove the current class for the current nav\n $('.review-dot-nav span').removeClass('current');\n // assign it to the first one\n $('.review-dot-nav span').first().addClass('current');\n }", "clearActive(tab) {\n\t\t\tif (typeof tab.parentNode.parentNode.children !== 'undefined' \n\t\t\t\t&& tab.parentNode.parentNode.children) {\n\t\t\t\tthis._forEach(tab.parentNode.parentNode.children, function(index, child) {\n\t\t\t \tchild.classList.remove('tab__nav__item--active');\n\t\t\t\t});\n\t\t\t}\n\t\t}", "function setActiveState(elems, elem) {\n elems.removeClass('active');\n $(elem).addClass('active');\n }", "function removeAllActive() {\n\n // loop through images\n\tsliderImages.forEach(function(img) {\n\n img.classList.remove('active');\n\n\t});\n\n // loop through bullets\n\tpaginationBullets.forEach(function (bullet) {\n bullet.classList.remove('active');\n\t});\n}", "function changeActive(page) {\n var activeClass = $('#change-div>nav>ul>li.active');\n\n scheduleArr.length = 0;\n activeClass.removeClass('active');\n $('#' + page)\n .parent('li')\n .addClass('active');\n }", "setActiveState(){\n let self = this;\n\t // Remove .active class\n\t\t[...document.querySelectorAll('.control-nav a')].forEach(el => el.classList.remove('active'));\n\n\t // Set active item, if not search\n\t if(!this.is_search){\n\t \tlet active = document.querySelector(`.control-nav li a.${this.orderby}`);\n\t \tactive.classList.add('active');\n \t}\n \tsetTimeout(function(){\n \tself.isLoading = false;\n \tself.container.classList.remove('loading');\n }, 1000);\n }", "function SetActiveNavMenu(navSelector) {\n $('.navbar-nav li').removeClass('active');\n $('.navbar-nav li a').remove('span.sr-only');\n $(navSelector).addClass('active').append('<span class=\"sr-only\">(current)</span>');\n }", "function makeActive() {\n\n var header = document.getElementById(\"navbar\");\n var btns = header.getElementsByClassName(\"link\");\n for (var i = 0; i < btns.length; i++) {\n btns[i].addEventListener(\"click\", function() {\n var current = document.getElementsByClassName(\"activeLink\");\n current[0].className = current[0].className.replace(\" activeLink\", \"\");\n this.className += \" activeLink\";\n });\n }\n}", "function setActiveMenu() {\n var pgurl = window.location.hash;\n var baseUrl = window.location.href;\n $(\"ul.menu li a\").each(function () {\n $(this).removeClass(\"active\");\n var urlMenu = $(this).attr(\"href\");\n if (baseUrl == urlMenu || (pgurl == \"/#/\" & urlMenu == \"/#/\"))\n $(this).parents(\"li\").find('a').addClass(\"active\");\n else if (pgurl.indexOf(urlMenu) >= 0 && urlMenu != \"#/\") {\n $(this).parents(\"li\").find('> a').addClass(\"active\");\n }\n })\n}", "function active() {\r\n for (section of sections) {\r\n const navbar__menu = document.querySelector(`a[href=\"#${section.getAttribute(\"id\")}\"]`);\r\n if (Viewport(section)) {\r\n section.classList.add(\"your-active-class\");\r\n navItemLink.classList.add(\"menu__link__active\");\r\n \r\n } else {\r\n section.classList.remove(\"your-active-class\");\r\n navItemLink.classList.remove(\"menu__link__active\");\r\n }\r\n }\r\n }", "function makeItemActive (elem) {\n // Remove existing classes\n var items = document.getElementsByTagName('li');\n for (item of items) {\n item.classList.remove('active');\n }\n // Add active class to the selected item\n elem.classList.add('active');\n}", "setActiveItemClass(item) {\n var last_active = this.control.querySelector('.last-active');\n if (last_active) removeClasses(last_active, 'last-active');\n addClasses(item, 'active last-active');\n\n if (this.activeItems.indexOf(item) == -1) {\n this.activeItems.push(item);\n }\n }", "clickHandler() {\r\n // remove active from all links\r\n const links = Array.from(this.element.closest('nav').querySelectorAll('a'));\r\n links.forEach(e => e.classList.remove('active'));\r\n // add active to current root link\r\n const parentNavGroup = this.element.closest('dxp-nav-group');\r\n parentNavGroup.removeAttribute('is-active');\r\n parentNavGroup.querySelector('.nav-level-one-link').classList.add('active');\r\n // add active to current link\r\n this.element.querySelector('.mega-menu-link').classList.add('active');\r\n }", "_highlightNav() {\n this.linkTargets.forEach(link => {\n if (\n link.href === location.href ||\n (link.dataset.match && location.href.match(link.dataset.match))\n ) {\n link.classList.add(...this.data.get(\"active\").split(\" \"));\n if (this.data.get(\"remove\")) {\n link.classList.remove(...this.data.get(\"remove\").split(\" \"));\n }\n } else {\n link.classList.remove(...this.data.get(\"active\").split(\" \"));\n }\n });\n }", "function addActiveClass(element) {\n if (current === \"\") {\n //for root url\n if (element.attr('href').indexOf(\"index.html\") !== -1) {\n element.parents('.nav-item').last().addClass('active');\n if (element.parents('.sub-menu').length) {\n element.closest('.collapse').addClass('show');\n element.addClass('active');\n }\n }\n } else {\n //for other url\n if (element.attr('href').indexOf(current) !== -1) {\n element.parents('.nav-item').last().addClass('active');\n if (element.parents('.sub-menu').length) {\n element.closest('.collapse').addClass('show');\n element.addClass('active');\n }\n if (element.parents('.submenu-item').length) {\n element.addClass('active');\n }\n }\n }\n}", "function navStart() {\n var d = new Date();\n var m = d.getMonth();\n $(\".fairies-nav li\").eq(m).addClass(\"active\").siblings().attr(\"class\", \"\");\n for (var liNum = m + 1; liNum < 12; liNum++) {\n $(\".fairies-nav li\").eq(liNum).addClass(\"disable\");\n }\n}", "function addActive(){\t\t\n\t\t$(\".navbar-nav li\").each(function(index){\n\t\t\tvar currentSection = $(this).find(\"a\").attr(\"href\");\n\t\t\tif((window_scroll.scrollTop() > $(currentSection).offset().top - 150)){\t\t\t\t\t\n\t\t\t\t$(this).addClass(\"active\");\n\t\t\t\t$(\".navbar-nav li\").not(this).removeClass(\"active\");\t\t\t\t\t\n\t\t\t}\n\t\t});\n\t}", "function setActiveNavLink() {\n //Get url of page, in format: /MyFinancePal/...\n var pathname = window.location.pathname;\n\n //loop through all nav links\n $('ul > li > a').filter(function () {\n /*href is in format http://localhost.. substring removes http://localhost... \n from the link so it starts at /MyFinancePal.. and matches the pathname*/\n return this.href.substring(16) === pathname;\n }).addClass('active bg-primary');\n //^If this function returns true for a link set that link to active\n}", "function removeAllActive() {\n\n slideImages.forEach(function (img) {\n img.classList.remove('active')\n })\n\n paginationBullet.forEach(function (bullet) {\n bullet.classList.remove('active')\n })\n}", "function deActivateSectionsNotInViewPort() {\n for (let currentItem of navMenuItems) {\n if (currentItem.id != navMenuItems.id & currentItem.classList.contains('your-active-class')) {\n currentItem.classList.remove('your-active-class');\n }\n }\n}", "function setActiveMenuLink() {\n var currentLink = window.location.href;\n var menuLinks = $(\".linkPage\");\n var active = $(\".a1\");\n\n for (var i = 0, arrLength = menuLinks.length; i < arrLength; i++) {\n if ($(menuLinks[i]).attr(\"href\") == \"/\" && window.location.pathname == \"/\") {\n $(menuLinks[i]).parents(\".list_item\").addClass(\"active\");\n\n } else if ($(menuLinks[i]).attr(\"href\") !== \"/\" && currentLink.indexOf($(menuLinks[i]).attr(\"href\")) !== -1) {\n $(menuLinks[i]).parents(\".list_item\").addClass(\"active\");\n }\n }\n}", "function anchorActiveState(me){\n\tif(me.closest('.main_menu').length > 0){\n\t\t$j('.main_menu a').parent().removeClass('active');\n\t}\n\n if(me.closest('.vertical_menu').length > 0){\n $j('.vertical_menu a').parent().removeClass('active');\n }\n\n\tif(me.closest('.second').length === 0){\n\t\tme.parent().addClass('active');\n\t}else{\n\t\tme.closest('.second').parent().addClass('active');\n\t}\n\tif(me.closest('.mobile_menu').length > 0){\n\t\t$j('.mobile_menu a').parent().removeClass('active');\n\t\tme.parent().addClass('active');\n\t}\n\t\n\t$j('.mobile_menu a, .main_menu a, .vertical_menu a').removeClass('current');\n\tme.addClass('current');\n}", "function changeNav(destinationItem) {\n var destination = destinationItem.getAttribute('data-title');\n var elementsToRemoveActive = ['classLink', 'accountLink', 'statLink'];\n for (var i = 0; i < elementsToRemoveActive.length; i++) {\n document.getElementById(elementsToRemoveActive[i]).className = document.getElementById(elementsToRemoveActive[i]).className.replace(/(?:^|\\s)active(?!\\S)/g, '');\n }\n if (destination == 'classes') {\n document.getElementById('classLink').className += 'active';\n $('.container').load('panel-lessons.html', function () {\n getLessons();\n });\n } else if (destination == 'stats') {\n document.getElementById('statLink').className += 'active';\n $('.container').load('panel-stats.html', function () {\n\n });\n } else if (destination == 'account') {\n document.getElementById('accountLink').className += 'active';\n $('.container').load('panel-account.html', function () {\n\n });\n }\n}", "function activeMenuItem($links) {\n var top = $(window).scrollTop(),\n windowHeight = $(window).height(),\n documentHeight = $(document).height(),\n cur_pos = top + 2,\n sections = $('section'),\n nav = $links,\n nav_height = nav.outerHeight(),\n home = nav.find(' > ul > li:first');\n\n sections.each(function () {\n var top = $(this).offset().top - nav_height - 40,\n bottom = top + $(this).outerHeight();\n\n if (cur_pos >= top && cur_pos <= bottom) {\n nav.find('> ul > li > a').parent().removeClass('active');\n nav\n .find(\"a[href='#\" + $(this).attr('id') + \"']\")\n .parent()\n .addClass('active');\n } else if (cur_pos === 2) {\n nav.find('> ul > li > a').parent().removeClass('active');\n home.addClass('active');\n } else if ($(window).scrollTop() + windowHeight > documentHeight - 400) {\n nav.find('> ul > li > a').parent().removeClass('active');\n }\n });\n }", "_setActiveClass(e) {\n\t\tlet className = e.target.className;\n\t\tlet els = document.getElementsByClassName(className)\n\n\t\tArray.from(els).forEach((el) => {\n\t\t\tel.parentElement.classList.remove(\"active\");\n\t\t});\n\n\t\te.target.parentElement.classList.add(\"active\");\n\t}", "function activeNav() {\n nav.classList.toggle('active');\n\n}", "_highlightCurrentPage () {\n const currentHref = window.location.href;\n const links = document.querySelectorAll('.nav-link');\n if (links.length) {\n for (var i = links.length; i--;) {\n let link = links[i];\n if (currentHref === link.href) {\n link.classList.add('active');\n } else {\n link.classList.remove('active');\n }\n }\n }\n }", "function activeMenuItem($links) {\n var top = $(window).scrollTop(),\n windowHeight = $(window).height(),\n documentHeight = $(document).height(),\n cur_pos = top + 2,\n sections = $(\"section\"),\n nav = $links,\n nav_height = nav.outerHeight(),\n home = nav.find(\" > ul > li:first\");\n\n sections.each(function() {\n var top = $(this).offset().top - nav_height - 40,\n bottom = top + $(this).outerHeight();\n\n if (cur_pos >= top && cur_pos <= bottom) {\n nav.find(\"> ul > li > a\").parent().removeClass(\"active\");\n nav.find(\"a[href='#\" + $(this).attr('id') + \"']\").parent().addClass(\"active\");\n } else if (cur_pos === 2) {\n nav.find(\"> ul > li > a\").parent().removeClass(\"active\");\n home.addClass(\"active\");\n } else if ($(window).scrollTop() + windowHeight > documentHeight - 400) {\n nav.find(\"> ul > li > a\").parent().removeClass(\"active\");\n }\n });\n }", "function makeActive\n(\n)\n{\n var menuItem = $.session.get('menuItem'); \n var pageName = window.location.pathname;\n pageName = pageName.slice(pageName.lastIndexOf('/') + 1);\n var attr = $.session.get('menuItem'); \n if(pageName.indexOf(attr) > -1)\n {\n $('.'+menuItem).addClass('active'); \n }\n else\n {\n $('.navList').not( $('.'+menuItem)).removeClass('active');\n }\n}", "function removeactive()\n {\n slidimg.forEach(function(img)\n {\n img.classList.remove('active');\n });\n \n newli.forEach(function(li)\n {\n li.classList.remove('active');\n });\n\n\n }", "function navigationHighlight(e) {\n $('.pl-nav-elements .pl-link').removeClass('is-current');\n $(this).addClass('is-current');\n }", "active() {\n\t\tfor (const css of this.activeValues) {\n\t\t\tthis.element.classList.add(css);\n\t\t}\n\t\tfor (const css of this.inactiveValues) {\n\t\t\tthis.element.classList.remove(css);\n\t\t}\n\t}", "function removeMainMenuClass() {\n let subnav = document.querySelectorAll(\".subnav\");\n for (let i = 0; i < subnav.length; i++) {\n subnav[i].classList.remove(\"active\");\n }\n }", "function menuActive()\n {\n $('#menu-barr').find('a').removeClass('active-link');\n $('#menu-barr').find('.btn-box').removeClass('active-back');\n\n var url_activa = window.location.href;\n var lista_hash = url_activa.split('#');\n \n // agregar clase active-link a los 'a' del menu, cuando se seleccionan\n if(lista_hash[1])\n {\n $('#menu-barr').find('a[href=\"#'+lista_hash[1]+'\"]').addClass('active-link');\n\n }else{\n $('#menu-barr').find('a[href=\"#inicio\"]').addClass('active-link');\n }\n\n // agregar clase active-back a los contenedores de los a del menu, cuando se seleccionan\n if ($('#menu-barr').find('a').hasClass('active-link'))\n {\n $('.'+lista_hash[1]+'').addClass('active-back');\n } else {\n $('.'+lista_hash[1]+'').removeClass('active-back');\n }\n\n }", "function active_link(element){\n document.getElementsByClassName('active-link')[0].classList.remove('active-link');\n element.classList.add('active-link');\n}", "function changeActive () {\n\tlinks.forEach(link => link.classList.remove('active'));\n\tthis.classList.add('active');\n\tthis.setAttribute('aria-current', 'page');\n\tif (window.innerWidth >= 920) {\n\t\taddLine.call(this);\n\t}\t\n}", "function removeActive() {\n $('.pure-menu-link').removeClass('btnActive');\n trails.visible = false;\n cabins.visible = false;\n parking.visible = false;\n campsites.visible = false;\n waterfalls.visible = false;\n }", "function closeActive() {\n $(\".navigation li\").removeClass(\"active\");\n}" ]
[ "0.76830125", "0.76333964", "0.74146444", "0.74146444", "0.7364739", "0.7302722", "0.7281692", "0.7209341", "0.71823895", "0.71705705", "0.7168519", "0.71427476", "0.71349293", "0.7110896", "0.7065239", "0.70497906", "0.703111", "0.70099914", "0.7008698", "0.69799906", "0.6978672", "0.6940353", "0.6917357", "0.69156367", "0.69066405", "0.6888296", "0.68426055", "0.68067473", "0.67946666", "0.67756945", "0.67687535", "0.6754866", "0.6747904", "0.6724688", "0.6717921", "0.67125434", "0.6704563", "0.67006475", "0.6671846", "0.6658426", "0.66160417", "0.6615646", "0.66130424", "0.6609004", "0.66006625", "0.6594816", "0.65747637", "0.6574258", "0.65645814", "0.65639526", "0.65603524", "0.6538203", "0.6535918", "0.6527539", "0.6515945", "0.6501574", "0.6498913", "0.6469367", "0.6466547", "0.6464146", "0.6455294", "0.64508945", "0.64504725", "0.64489627", "0.6444761", "0.6434802", "0.64180934", "0.64180857", "0.63984233", "0.6384325", "0.6373188", "0.6355048", "0.6352155", "0.63317347", "0.6326338", "0.6325898", "0.6325354", "0.63209295", "0.63154507", "0.6299982", "0.6297233", "0.6294271", "0.6278246", "0.62767756", "0.6268751", "0.6268", "0.62601584", "0.62535375", "0.6246749", "0.6245146", "0.6235751", "0.6229011", "0.62225014", "0.62224424", "0.6213267", "0.621091", "0.62103283", "0.62082183", "0.62012535", "0.61992794" ]
0.8037945
0
Clean the results based on duplicates and needing ALL values //
function arrayEquals(arrA, arrB) { let equals = true arrA.forEach((a, i) => { if(!equals) return if(i >= arrB.length || arrB[i] !== a) equals = false }) return equals }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_removeDuplicates(data, options) {\n let uniqueValue = [];\n let uniqueData = [];\n let objects = JP.query(data, options.object);\n\n objects.forEach((object, index) => {\n let value = JP.query(object, options.value)[0];\n if (uniqueValue.indexOf(value) === -1){\n uniqueValue.push(value);\n uniqueData.push(data[index]);\n }\n });\n\n return uniqueData;\n }", "function removeDuplicates(data) {\n return data.filter((value, index) => data.indexOf(value) === index);\n }", "function removeDuplicates(allAddressData) {\n const uniqueAddressData = [];\n for(const addressData of allAddressData) {\n /**\n * Check if an equivalent address option already exists in the\n * filtered array\n */\n const existingDataIndex = uniqueAddressData.findIndex((data) => {\n return _.isEqual(data.addressComponents.common, addressData.addressComponents.common);\n });\n\n // Found a duplicate address\n if (existingDataIndex > -1) {\n const existingData = uniqueAddressData[existingDataIndex];\n console.log(`Address ${addressData.placeID} has an identical match: address ${existingData.placeID}`);\n\n // Keep the better of the two addresses\n const bestAddress = getBestAddress([addressData, existingData]);\n console.log(`----Keeping address ${bestAddress.placeID} and removing address ${existingData.placeID}`);\n uniqueAddressData[existingDataIndex] = bestAddress;\n } else {\n // Not a duplicate address\n uniqueAddressData.push(addressData);\n }\n }\n\n return uniqueAddressData;\n }", "static removeDuplicates(rows) {\n const upsertKeys = map(filter(this.tableAttributes, 'upsertKey'), 'fieldName');\n if (!upsertKeys.length) return rows;\n const duplicates = groupBy(rows, it => objectHash(pick(it, upsertKeys)));\n const obsolete = flatMap(duplicates, group => {\n return initial(sortBy(group, 'sfUpdatedAt'));\n });\n return difference(rows, obsolete);\n }", "function getResult(leads) {\n let changeValue = '';\n\n // Filtering and Updating the duplicate ID's\n let uniqueIds = {};\n leads.forEach((e) => {\n if (uniqueIds[e.ID] === undefined) {\n uniqueIds[e.ID] = e;\n }\n else {\n // checking the date is greater or identical\n let prev = uniqueIds[e.ID];\n if (prev.Date <= e.Date) {\n if (prev.Email != e.Email) {\n changeValue += 'For ID : ' + e.ID + ' value of email changed from ' + prev.Email + ' to ' + e.Email + '\\n';\n }\n if (prev.Name != e.Name) {\n changeValue += 'For ID : ' + e.ID + ' value of name changed from ' + prev.Name + ' to ' + e.Name + '\\n';\n }\n uniqueIds[e.ID] = e;\n }\n }\n });\n\n // Filtering and Updating the duplicate Emails\n let uniqueEmails = {};\n for (var e in uniqueIds) { // or Object.keys(uniqueIds).forEach((e)=>{})\n if (uniqueIds.hasOwnProperty(e)) {\n let pEmail = uniqueIds[e].Email;\n let p = uniqueIds[e];\n\n if (uniqueEmails[pEmail] === undefined) {\n uniqueEmails[pEmail] = p;\n }\n else {\n // checking the date is greater or identical\n let prev = uniqueEmails[pEmail];\n if (prev.Date <= p.Date) {\n if (prev.ID != p.ID) {\n changeValue += 'For Email : ' + p.Email + ' value of ID changed from ' + prev.ID + ' to ' + p.ID + '\\n';\n }\n if (prev.Name != p.Name) {\n changeValue += 'For Email : ' + p.Email + ' value of name changed from ' + prev.Name + ' to ' + p.Name + '\\n';\n }\n uniqueEmails[pEmail] = p;\n }\n }\n }\n }\n\n // output in the same format as input format\n let results = [];\n for (var i in uniqueEmails) { // or Object.keys(uniqueEmails).forEach((e)=>{})\n if (uniqueEmails.hasOwnProperty(i)) {\n results.push(uniqueEmails[i]);\n }\n }\n return [results, changeValue];\n}", "function removeDuplicates (input) {\n\t\t\tlet result = input.filter(function(item, pos) {\n\t\t\t\treturn input.indexOf(item) == pos;\n\t\t\t});\n\t\t\treturn result\n\t\t}", "function getUnique2(arr) {\n let tempArr = arr.reduce((gather , current) => {\n gather.add(current.company);\n return gather\n }, new Set()) \n // OUTPUT\n return [...tempArr] \n \n}", "clean_results(results, attributes) {\n const cleaned = [];\n for (var res of results) {\n let goodboy = true;\n for (var attr of attributes) {\n if (!res[attr] || !res[attr].trim()) {\n goodboy = false;\n break;\n }\n }\n if (goodboy) {\n res.rank = this.result_rank++;\n cleaned.push(res);\n }\n }\n return cleaned;\n }", "function getDistinctValues(data) {\n var distinctValues = {}, resData = [];\n\n data.forEach(function(d) {\n\n if (d === undefined) {\n d = null;\n }\n if (!distinctValues[d]) {\n distinctValues[d] = true;\n resData.push(d);\n }\n });\n return resData;\n }", "function removeDuplicates(arr) {\n\tarr = arr.filter((obj, index, self) =>\n\t\tindex === self.findIndex((t) => (\n\t\t\t(t.a === obj.a && t.b === obj.b) || (t.b === obj.a && t.a === obj.b)\n\t\t))\n\t)\n\treturn arr\n}", "function removeDuplicates(data) {\n return data.filter((value, index) => data.indexOf(value) == index);\n}", "distinct() {\n return this.reduce(\n (seen, element) => {\n if (!seen.includes(element)) {\n seen.push(element);\n }\n return seen;\n },\n []\n );\n }", "parseUniqueCategories(dataSet) {\n return dataSet.businesses.reduce((accum, business) => {\n business.categories.forEach((item) => {\n if (!(accum.findIndex(ele => ele.displayTitle === item[0]) + 1)) {\n const newObject = {\n displayTitle: item[0],\n imageUrl: business.image_url,\n };\n accum.push(newObject);\n }\n });\n return accum;\n }, []);\n }", "function dedupe(results) {\n const scores = {};\n for (const r of results) {\n scores[r.word] = Math.max(r.score, scores[r.word] || 0);\n }\n return Object.keys(scores).map(word => ({ word, score: scores[word] }));\n}", "function getUnique3(arr) {\n return [...arr.reduce((gather , current) => {\n gather.add(current.company);\n return gather\n }, new Set())] \n // OUTPUT\n \n}", "function noDuplicates(arr){\n const removeDups = [...new Set(arr)];\n return removeDups;\n }", "getUniqueCategory() {\n //itereate over list of entries using map\n //callback function makes array of unique tags based on the tag array\n //return newly created array\n\n var data = this.data;\n\n\n //parse out all tags\n var uniqueTags = data.reduce(function(prev, curr) {\n console.log(\"prev vs curr\", prev, curr);\n return [...prev, ...curr.photo_tags];\n }, ''); \n\n console.log(\"unique tags:\", uniqueTags);\n //remove duplicates\n var dedupedTags = uniqueTags.filter(function(item, pos, self) {\n //console.log(\"item vs pos\", item, pos);\n return self.indexOf(item) == pos;\n });\n\n //covert all entries to lower case \n dedupedTags = dedupedTags.map(function(x){ console.log(\"while deduping:\",x.title); return x.title.toLowerCase() });\n\n //return sorted array\n this.sortedTags = dedupedTags.sort();\n\n }", "function mergeDuplicateOrganismData(allDisplayData) {\n const mergedDuplicates = [];\n for(const organismData of allDisplayData) {\n const existingData = mergedDuplicates\n .find((element) => element.name === organismData.name);\n\n /**\n * Add organismData's sightings to the existing sightings of that\n * organism in mergedDuplicates\n */\n if (existingData != undefined) {\n existingData.sightings.push(...organismData.sightings);\n } else {\n /**\n * Not a duplicate organism; add all of its data to the\n * mergedDuplicates array\n */\n mergedDuplicates.push(organismData);\n }\n }\n\n return mergedDuplicates;\n }", "checkForDuplicates() {\n const alreadyChecked = [];\n for(let list of [this.state.listA, this.state.listB]) {\n for(let row of list) {\n row.isDuplicate = false;\n const duplicate = alreadyChecked.find(otherRow => otherRow.snomed.code === row.snomed.code);\n if (!row.snomed.code || duplicate) {\n row.isDuplicate = true;\n if (duplicate) duplicate.isDuplicate = true;\n } \n alreadyChecked.push(row);\n }\n }\n }", "function removeDuplicate(data){\n //first check if given param is an array or not\n if(data instanceof Array){\n //now check for length if less than one return the same\n if(data.length < 2)\n return data;\n else{\n let result = [];\n data.forEach(function(element){\n //now check if result array has the element or not if yes do not push else push into this array\n if(result.indexOf(element) === -1){\n result.push(element);\n }\n });\n return result;\n }\n }else {\n return 'Not a valid array';\n }\n}", "function uniq(a, slot, remove) {\n var array = [];\n for (let entry of a) {\n var value = entry[slot];\n if (isValidSlot(value) && doNotIgnore(value, remove)) {\n var lowerCase = fixUpSlot(value);\n var item = [lowerCase, value];\n array.push(item);\n } else {\n console.log(value);\n }\n }\n // Remove duplicates\n var unified = uniqWith(array, comparator);\n\n return unified;\n\n}", "async function _removeDuplicateQueryResults(results) {\n let testElementMatched = false;\n let matchedHarnessTypes = new Set();\n const dedupedMatches = [];\n for (const result of results) {\n if (!result) {\n continue;\n }\n if (result instanceof ComponentHarness) {\n if (!matchedHarnessTypes.has(result.constructor)) {\n matchedHarnessTypes.add(result.constructor);\n dedupedMatches.push(result);\n }\n }\n else if (!testElementMatched) {\n testElementMatched = true;\n dedupedMatches.push(result);\n }\n }\n return dedupedMatches;\n}", "function removeDuplicates(originalArray, objKey) {\n var trimmedArray = [];\n var values = [];\n var value;\n\n for (var i = 0; i < originalArray.length; i++) {\n value = originalArray[i][objKey];\n\n if (values.indexOf(value) === -1) {\n trimmedArray.push(originalArray[i]);\n values.push(value);\n }\n }\n return trimmedArray;\n }", "function deDupIdenticalRcrds() {\n var recrdsAry = entityObj.curRcrds;\n\n entityObj.curRcrds = findUnqRecords(entityObj.curRcrds);\n entityObj.validationResults.dupCnt = recrdsAry.length - entityObj.curRcrds.length;\n }", "function removeDuplicate(arr){\nvar exists = {};\nvar outArr = [];\nvar elm;\n\nfor (var i = 0; i < arr.length; i++){\n elm = arr[i];\n if (!exists[elm]){\n outArr.push(elm);\n exists[elm] = true;\n }\n}\nreturn outArr;\n}", "function removeDuplicates(arrOfStrings){\n //return all duplicate elements filtered out\n return [...new Set(arrOfStrings)]// SPECIAL OPERATION HERE\n} //(OPTION 1)", "function noDupVines(arr) {\n var output = {};\n var len = arr.length;\n for (var i = 0; i < len; i++) {\n //if not null then enter\n if (arr[i] !== null) {\n //set store key in output object, if same key then replace existing one\n output[arr[i].author_url] = arr[i];\n }\n }\n return output;\n}", "function removeDuplicates(){\n //passing our validEmails array to a Set method, so array converts to Set collection,\n var setColl = new Set(validEmails);\n emailsNoDuplicates = [...setColl]; //convert Set collection to an array with spread operator\n console.log(emailsNoDuplicates);\n showValidInvalidOutput();\n}", "findUniqueElements() {\n /** The collection of unique values in a categorical column of CSV Data */\n this.uniqueSet = []\n for (let element of this.paneOb.csvData[this.altColSelect.value]) {\n if (this.uniqueSet.indexOf(element) == -1) {\n this.uniqueSet.push(element)\n }\n }\n }", "function containsAndRemove(_newMeta, _newMetaCopy, _results, id) {\n\n var newMeta = _newMeta;\n var newMetaCopy = _newMetaCopy;\n var b = 0;\n var index = 1;\n var a = 0;\n var arrayOfRepeats = [];\n var array = _results;\n\n array.unshift(id);\n\n while (b < newMeta.length) {\n while (index < newMeta.length && a < newMeta.length) {\n for (var i = index; i < newMeta.length; i++) {\n if(newMeta[a][0] === newMetaCopy[i][0] && newMeta[a][1] === newMetaCopy[i][1]) {\n //console.log('Found dups at index ' + i + ' and first word ' + a + ' with ' + newMetaCopy[i] + array[i].target + ' and ' + newMeta[a] + array[a].target );\n arrayOfRepeats[i] = array[i];\n }\n }\n index++;\n a++;\n }\n b++;\n}\narray.shift();\nreturn arrayOfRepeats;\n}", "function getUniqueValues(values) {\nvar uniqueValues = [];\n\nvalues.forEach(function(item, i) {\n if ((uniqueValues.length < 1 || uniqueValues.indexOf(item) === -1) && item !== \"\") {\n uniqueValues.push(item);\n }\n});\nreturn uniqueValues;\n}", "function removeDuplicates(dups) {\n const used = new Set();\n const clean = [];\n dups.forEach(i => {\n if (!used.has(i.title)) {\n used.add(i.title);\n clean.push(i);\n }\n });\n return clean;\n}", "function copyNonDups(resultArray, array) {\n array.forEach(value => {\n if (!resultArray.includes(value)) {\n resultArray.push(value);\n }\n });\n}", "function copyNonDupsTo(resultArray, array) {\n array.forEach(value => {\n if (resultArray.indexOf(value) === -1) {\n resultArray.push(value);\n }\n });\n }", "checkForDuplicates(state, indexDictionary) {\n const data = state.dictionaries[indexDictionary].content;\n\n data.forEach((value) => {\n state.dictionaries[indexDictionary].content = data.map((pair, index) => {\n // Make sure the object is not itself\n if (data.indexOf(pair) !== data.indexOf(value)) {\n if (pair.domain === value.domain && pair.range === value.range) {\n if (\n data[index].validity.status\n && data[index].validity.reason === ''\n ) {\n // Change validity of the pair to false and assign the reason why\n data[index].validity.status = false;\n data[index].validity.reason = reasonNotValid.duplicate;\n }\n }\n }\n return pair;\n });\n });\n }", "function dedupe(arr) {\n return arr.reduce(function(newArray, item) {\n if(newArray.indexOf(item) < 0) {\n newArray.push(item);\n }\n return newArray;\n }, []);\n }", "function dedup(array) {\nvar special = [...new Set(array)]; //uses set and the spread operator to delete all duplicates of the array\n\n\nreturn special; //returns the special array of values\n}", "_dedupe(ary) {\n return ary.sort().filter((item, ndx, _ary)=>{\n if (ndx!=0 && item == ary[ndx-1]) return false;\n return true;\n });\n }", "function updateTableResults() {\n statusSelections = getSelectValuesfor('statusSelection');\n licenseTypeSelections = getSelectValuesfor('licenseTypeSelection');\n citySelections = getSelectValuesfor('citySelection');\n\n if(statusSelections.length == 0 && licenseTypeSelections.length == 0 && citySelections.length == 0){\n results = businesses;\n } else {\n //filter businesses\n results = businesses.filter(function(b) {\n if (statusSelections.includes(b.License_Status_Description) && licenseTypeSelections.includes(b.Classification_Description) && citySelections.includes(b.City)) {\n return true\n }\n });\n }\n\n if (results.length == 0) {\n //dont update the table. error message\n promptErrorWith(\"0 Results For That Query\");\n } else {\n //update table\n //get the old table body\n var tbody = document.querySelector('tbody');\n var newtablebody = document.createElement('tbody');\n tbody.parentNode.replaceChild(newtablebody, tbody);\n\n let shouldShowDuplicates = document.getElementById('showDuplicates').checked;\n\n //should we show Duplicates?, if not filter them out.\n if (shouldShowDuplicates) {\n updateResult(results.length);\n for (let i = 0; i < results.length; i++) {\n addListingToTable(results[i]);\n }\n } else {\n\n var unique = {}; //Individual values not distinct\n var distinct = []; //distinct objects containing unique values.\n //for each result\n for (var i in results) {\n //Cross reference phone number to records,\n // if one like it doesn't exist already, add it to distinct\n if (typeof(unique[results[i].Business_Phone_Number]) == \"undefined\") {\n distinct.push(results[i]);\n }\n unique[results[i].Business_Phone_Number] = 0;\n }\n //update the table.\n for (let i = 0; i < distinct.length; i++) {\n addListingToTable(distinct[i])\n }\n //update results text field\n updateResult(distinct.length);\n }\n }\n\n}", "function removeDuplicateItems (arr) {\n var input = arr\n var inputLower = []\n output = []\n for (var i = 0; i < input.length; i++) {\n if ( typeof input[i] === 'string') {\n inputLower.push(input[i].toLowerCase())\n }\n else {\n inputLower.push(input[i])\n }\n }\n\n for (var i = 0; i < inputLower.length ; i++)\n { if (inputLower [i] !== inputLower[i+1])\n output.push(inputLower[i])\n }\n\n\nreturn(output)\n}", "function removeDupes(arrWithDupes){\n let uniq = [...new Set(arrWithDupes)];\n // console.log(\"uniq\", uniq);\n return uniq;\n}", "function removeDupes(arrWithDupes){\n let uniq = [...new Set(arrWithDupes)];\n // console.log(\"uniq\", uniq);\n return uniq;\n}", "function uniqueValues(value) {\n if (arr1.includes(value) && arr2.includes(value)) {\n console.log(\"dupe\") \n } else {\n return value;\n }\n }", "function eliminateDuplicates(arr) {\n\t\tvar i,\n\t\tlen = arr.length,\n\t\tout = [],\n\t\tobj = {};\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tobj[arr[i]] = 0;\n\t\t}\n\t\tfor (i in obj) {\n\t\t\tout.push(i.split(','));\n\t\t}\n\t\tout = out.map(function (e) {\n\t\t\t\treturn [parseInt(e[0], 10), parseInt(e[1], 10)];\n\t\t\t});\n\t\treturn out;\n\t}", "function getUnique(arr){\n let tempArr = [...new Set(arr.map(item => item.company))]\n\n // OUTPUT \n return tempArr\n }", "clean_results(results, attributes) {\n if (Array.isArray(results)) {\n let cleaned = [];\n for (let res of results) {\n let goodboy = true;\n for (let attr of attributes) {\n if (!res[attr] || !res[attr].trim()) {\n goodboy = false;\n break;\n }\n }\n if (goodboy) {\n cleaned.push(res);\n }\n }\n return cleaned;\n }\n }", "clean_results(results, attributes) {\n if (Array.isArray(results)) {\n let cleaned = [];\n for (let res of results) {\n let goodboy = true;\n for (let attr of attributes) {\n if (!res[attr] || !res[attr].trim()) {\n goodboy = false;\n break;\n }\n }\n if (goodboy) {\n cleaned.push(res);\n }\n }\n return cleaned;\n }\n }", "function remDupHM(array){\n let result = [];\n let hm = {};\n for (let index = 0; index < array.length; index++) {\n if(!hm[array[index]]) {\n hm[array[index]] = array[index];\n } \n }\n for(let obj in hm){\n result.push(hm[obj]);\n }\n\n console.log(\"remDup:\", result);\n \n }", "function remove_duplicates_safe(arr) {\n var obj = {};\n var arr2 = [];\n for (var i = 0; i < arr.length; i++) {\n if (!(arr[i] in obj)) {\n arr2.push(arr[i]);\n obj[arr[i]] = true;\n }\n }\n return arr2;\n}", "function camRemoveDuplicates(array)\n{\n\tvar prims = {\"boolean\":{}, \"number\":{}, \"string\":{}};\n\tvar objs = [];\n\n\treturn array.filter(function(item) {\n\t\tvar type = typeof item;\n\t\tif (type in prims)\n\t\t{\n\t\t\treturn prims[type].hasOwnProperty(item) ? false : (prims[type][item] = true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn objs.indexOf(item) >= 0 ? false : objs.push(item);\n\t\t}\n\t});\n}", "function RemoveDupes(arr){\n var newarr = []\n for(var i = 0; i < arr.length; i ++){\n if(arr[i] !== arr[i - 1]){\n newarr.push(arr[i]);\n }\n }\n return newarr;\n } //ONLY WORKS IF ARRAY VALUES ARE IN ORDER", "function removeDuplicates(removeDuplicatesFromSheet) {\n var sheet = SpreadsheetApp.getActive().getSheetByName(removeDuplicatesFromSheet);\n var data = sheet.getDataRange().getValues();\n var newData = new Array();\n for(i in data){\n var row = data[i];\n var duplicate = false;\n for(j in newData){\n if(row.join() == newData[j].join()){\n duplicate = true;\n }\n }\n if(!duplicate){\n newData.push(row);\n }\n }\n sheet.clearContents();\n sheet.getRange(1, 1, newData.length, newData[0].length)\n .setValues(newData);\n}", "function groupDuplicates(elementsArray, dupeArray, uniqueArray) {\n let arrLength = elementsArray.length;\n\n for(var i = 1; i < arrLength; i++) {\n\n let date = elementsArray[i].getElementsByClassName('date')[0].innerText;\n let price = elementsArray[i].getElementsByClassName('money')[0].innerText;\n\n//TODO assign this differently. On 4.12 it is adding the first matched pair for each dupe it finds.\n\n let matchingPair = scanForDuplicates(uniqueArray, date, price)\n\n if( matchingPair.length > 0 ) {\n\n matchingPair.push(elementsArray[i]);\n dupeArray.push(matchingPair);\n } else {\n uniqueArray.push(elementsArray[i])\n }\n }\n}", "getUniqueValues(inputArray) {\n let uniques = [];\n inputArray.forEach((input) => {\n input.forEach((inp) => {\n if (!uniques.includes(inp)) {\n uniques.push(inp);\n }\n });\n });\n return uniques;\n }", "function findDistinctValues(values) {\n // FILL THIS IN\n var distinctValuesArray = [],\n flags = [];\n \n for ( var i = 0; i < values.length; i++ ) {\n if ( flags[values[i]] ) continue;\n flags[ values[i] ] = true;\n distinctValuesArray.push( values[i] );\n }\n }", "function eliminateDuplicates(items) {\n return [...new Set(items)];\n}", "function removeDuplicates(arr) {\n return [...new Set(arr.map(s => JSON.stringify(s)))]\n .map(s => JSON.parse(s));\n}", "function removeDuplicates(arrData){\n let unique = {};\n arrData.forEach(function(i) {\n if(!unique[i]) {\n unique[i] = true;\n }\n });\n \n return Object.keys(unique);\n}", "function removeDupes(arr) {\n \"use strict\";\n var newArr = []; //we have to declare a new array to store the result\n for (var i = 0; i < arr.length; i++) { //loop through array\n var lookingFor = arr[i]; // the current index through this i loop\n var foundIt = false; //flag variable set to false\n for (var j = 0; j < newArr.length; j++) { //loop through new array\n if (newArr[j] == lookingFor) { //if the index of the new array has the same value as //the original array we passed in\n foundIt = true; //then the flag is set to true, keep looping through new array\n }\n }\n if (!foundIt) { // if we haven't found any similarities, then\n newArr[newArr.length] = lookingFor; //at the end of the new array, push the value of // the the original array to the new one \n }\n } \n return newArr; //finally, return new array\n}", "function removeDupe(str) {\n // let arr = str.split('');\n // console.log(arr)\n let result='';\n let hash = new HashMap();\n for(let i = 0; i < str.length; i++) {\n \n if(!hash.get(str[i])){\n hash.set(str[i],true);\n result += str[i];\n }\n }\n return result;\n}", "uniques () {\n let uniqueAddresses = [];\n\n this.tree.all().forEach((treeObj) => {\n const feature = treeObj[4].feature;\n\n if (feature.properties._hits.length == 1) {\n uniqueAddresses.push(feature.properties._hits[0]);\n }\n });\n return uniqueAddresses;\n }", "function removeDuplicates(array) {\n var seen = {};\n return array.filter(function(item) {\n return seen.hasOwnProperty(item) ? false : (seen[item] = true);\n });\n }", "function removeDuplicateCities(searchedCities) {\n\n //converts cities array to a string\n var jsonCities = searchedCities.map(JSON.stringify);\n\n //converts string to a set (doesn't allow repeats)\n var nonDuplicateCitiesSet = new Set(jsonCities);\n \n //converts string of nonduplicate cities back to array\n var nonDuplicateCitiesArray = Array.from(nonDuplicateCitiesSet).map(JSON.parse);\n \n //returns array\n return nonDuplicateCitiesArray;\n\n}//end function removeDuplicateCities", "values() {\n const result = [];\n for (let i = 0; i < this.map.length; i += 1) {\n if (this.map[i] !== undefined) {\n for (let j = 0; j < this.map[i].length; j += 1) {\n const value = this.map[i][j][1];\n if (!result.includes(value)) {\n result.push(value);\n }\n }\n }\n }\n\n return result;\n }", "function removeDuplicateDataPts(arr){ \n\n var hash = {};\n var returnArr = [];\n\n for(var i=0; i < arr.length; i++){\n var key = arr[i].dataPt.x + \".\" + arr[i].dataPt.y;\n if(hash[key]){ continue; };\n returnArr.push(arr[i]);\n hash[key] = 1;\n };\n\n return returnArr;\n}", "function checkForDuplicateUN(result) {\n for ( i = 0; i < results.length; i++) {\n comp_result = results[i];\n if (result == comp_result) {\n return false;\n }\n if (result.from_user == comp_result.from_user && !comp_result.geo_info.exact) {\n result.geo_info = comp_result.geo_info;\n //probably meaningless, but could apply to super-fast call on super-slow computer\n return true;\n }\n }\n return false;\n }", "function hasDuplicates(data) {\n var values = data.map(function(i) {return i.value});\n return new Set(values).size != values.length;\n}", "function removeDuplicateAndLogPosition() {\n resultsArray.pop();\n duplicatePositions.push(resultsArray.length);\n }", "function removeduplicate(duplicate) { \n let arr = [];\n for(let i=0; i< duplicate.length; i++) {\n if(arr.indexOf(duplicate[i]) == -1) {\n arr.push(duplicate[i]);\n }\n }\n // console.log(arr);\n return arr;\n }", "function filterDuplicates(arrayToBeFiltered, filteredArray)\n{\n //for each element in allSubs\n for(var i = 0; i < arrayToBeFiltered.length; i++)\n {\n //for each substrate name - substrate at i; name is stored in the first position\n nameOfReactant = arrayToBeFiltered[i][0];\n abbrOfReactant = arrayToBeFiltered[i][1];\n\n isUnique = true;\n for(var j = 0; j < filteredArray.length; j++)\n { \n uniqueName = filteredArray[j][0]\n //if the name is not unique\n if(nameOfReactant == uniqueName)\n isUnique = false;\n }\n if(isUnique)\n { //the array is pass by reference so this is good\n filteredArray.push([nameOfReactant, abbrOfReactant]);\n }\n }\n filteredArray.sort();\n}", "function removeDuplicates(list) {\n let mySet = new Set(list);\n let newArray = [...mySet];\n return newArray;\n}", "function removeDuplicates(Array){\n return Array.filter((a,b) => Array.indexOf(a) === b) //no duplicates for the drop menu in front end\n}", "function removeDuplicateTwo(arr) {\n const uniqueArray = [];\n arr.forEach((e) => {\n if(contain(e, uniqueArray) === false) {\n uniqueArray.push(e)\n }\n })\n return uniqueArray;\n}", "function getDinstinctValues(param, data){\r\n\t\r\n\tvar xset = new Set();\r\n\treturn_arry = [];\r\n\t\r\n\tdata.forEach(function(d){\r\n\t\txset.add(d[param]);\r\n\t});\r\n\txset.forEach(function(item){\r\n\t\treturn_arry.push(item);\r\n\t})\r\n\treturn return_arry.sort();\r\n}", "function findDistinctValues(values) {\n // FILL THIS IN\n var newArray = values.filter(function(elem, pos) {\n return values.indexOf(elem) === pos;\n }); \n return newArray;\n }", "function preCheckForDuplicateAddresses() {\n // Flush out deduper before we start\n newDeduper.clearAll();\n var arr = newDataset.getDataset();\n var amountToProcess = arr.length;\n for (let i = 0; i < arr.length; i++) {\n if (newDeduper.addressExists(arr[i][0])) {\n var amount = new web3.utils.BN(newDeduper.getItemAmount(arr[i][0]));\n var amount_to_add = web3.utils.toBN(arr[i][1]);\n var new_amount = amount.add(amount_to_add);\n newDeduper.addItem(arr[i][0], new_amount.toString());\n } else {\n newDeduper.addItem(arr[i][0], arr[i][1]);\n }\n }\n newDataset.overrideData(newDeduper.dumpAsList());\n console.log(\"Total items reduced from \" + amountToProcess + \" to \" + newDataset.getDataset().length);\n document.getElementById(\"pre_check_output_for_duplicate_addresses\").innerHTML = JSON.stringify(newDataset.getDataset(), 2, 2);\n}", "function scrubDuplicates(movieList) {\n\t\tlet scrubbedList = movieList = movieList.filter(function(elem, pos) {\n\t\t return movieList.indexOf(elem) == pos;\n\t\t});\n\n return scrubbedList;\n\t}", "function remove_duplicates_safe(arr) {\n var seen = {};\n var ret_arr = [];\n for (var i = 0; i < arr.length; i++) {\n if (!(arr[i] in seen)) {\n ret_arr.push(arr[i]);\n seen[arr[i]] = true;\n }\n }\n return ret_arr;\n\n}", "function clearDuplicatedArgumentValues(){\n checked = $(\"#st_automation_step_tab_area\").find('input:checkbox:checked');\n $.each(checked, function()\n {\n table_argument_id = $(this).attr(\"id\").split('_')[1];\n value = $(this).val();\n $('#argument_' + table_argument_id + '_' + value.replace('.','\\\\.')).remove();\n });\n}", "function unmergeAndDuplicateValues() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = ss.getSheetByName('Master Inventory');\n var range = sheet.getRange(firstBarcodeRow, 1, sheet.getLastRow());\n range.breakApart();\n \n var columnToSearchZeroIndexed = 0;\n var rowRangesArray = getRowRangesOfGroupedValues(columnToSearchZeroIndexed);\n var numGroups = rowRangesArray.length;\n \n for (var i=0; i < numGroups; i++) {\n var firstTempRow = rowRangesArray[i][0];\n var lastTempRow = rowRangesArray[i][1];\n var valueToDuplicate = rowRangesArray[i][2]\n \n var tempRange = sheet.getRange(\"A\"+firstTempRow+':'+\"A\"+lastTempRow);\n tempRange.setValue(valueToDuplicate);\n }\n\n}", "function removeDuplicateItems (arr) {\n var arr1 = []\n for (var i = 0; i < arr.length; i++) {\n if (typeof (arr[i]) === 'string') {\n if (arr1.includes(arr[i].toUpperCase()) === false && arr1.includes(arr[i].toLowerCase()) === false) {\n arr1.push(arr[i])\n }\n } else if (arr1.includes(arr[i]) === false) {\n arr1.push(arr[i])\n }\n }\n return arr1\n}", "function removeDuplicates(str) {\n let results = \"\";\n let map = new Hashmap();\n for (let x = 0; x < str.length; x++) {\n map.set(str[x], str[x]);\n }\n for (let x = 0; x < str.length; x++) {\n try {\n results += map.get(str[x]);\n map.delete(str[x]);\n } catch (key) {}\n }\n\n console.log(results);\n return results;\n}", "function removeDupes(array) {\n\tvar unique = new Array();\n\t$.each(array, function(index, value) {\n\t\tif ($.inArray(value,unique) === -1) {unique.push(value);}\n\t})\n\treturn unique;\n}", "function uniq(a) {\n var seen = {};\n return a.filter(function(item) {\n return seen.hasOwnProperty(item) ? false : (seen[item] = true);\n });\n }", "function removeDuplicates(originalArray, prop) {\n\t\tconst outputArray = [];\n\t\tconst lookupObject = {};\n\n\t\tfor (let i in originalArray) {\n\t\t\tlookupObject[originalArray[i][prop]] = originalArray[i];\n\t\t}\n\n\t\tfor (let i in lookupObject) {\n\t\t\toutputArray.push(lookupObject[i]);\n\t\t}\n\t\treturn outputArray;\n\t}", "function removeDuplicates(arr){\n let unique_array = []\n for(let i = 0;i < arr.length; i++){\n if(unique_array.indexOf(arr[i]) == -1){\n unique_array.push(arr[i])\n }\n }\n return unique_array\n }", "function UniqDeadLn(strDeadDtls, plst) {\r\n var lstTmpplst = [];\r\n var arrOutPutlst = [];\r\n var arrDeadDtls = [];\r\n var lstDeadDtls = [];\r\n var strDtls = \"\";\r\n arrDeadDtls = strDeadDtls.trim().split('~');\r\n lstDeadDtls = strDeadDtls.trim().split('~');\r\n $.each(plst, function (ind, val) {\r\n strDtls = val.strUniqueValue.split(',')[0] + '*' + val.strUniqueValue.split(',')[1] + '*' + val.strUniqueValue.split(',')[3] +\r\n '*' + val.strUniqueValue.split(',')[2] + '*' + val.strInsertionDate + '*' + val.strClrBw + '*' + val.strUniqueValue.split(',')[6] +\r\n '*' + val.strBookingUnit + '*' + val.strContentComp + '*' + val.strDesignType;\r\n //strDtls = val.strUniqueValue.split(',')[0] + '*' + val.strUniqueValue.split(',')[1] + '*' + val.strUniqueValue.split(',')[2] + '*' + val.strInsertionDate + '*' + val.strClrBw;\r\n //if ($.inArray(arrDeadDtls, val.strUniqueValue.split(',')[0] + '*' + val.strUniqueValue.split(',')[1] + '*' + val.strUniqueValue.split(',')[3] + '*' + val.strUniqueValue.split(',')[2] + '*' + val.strInsertionDate + '*' + val.strColorType) >= 0) {\r\n if (lstDeadDtls.containsSubString(strDtls) >= 0 && lstTmpplst.containsSubString(strDtls) < 0) {\r\n arrOutPutlst.push(val);\r\n lstTmpplst.push(strDtls);\r\n }\r\n });\r\n return arrOutPutlst;\r\n}", "nonuniques () {\n let nonuniqueAddresses = [];\n\n this.misses.forEach((miss) => {\n nonuniqueAddresses.push(miss);\n });\n\n this.tree.all().forEach((treeObj) => {\n const feature = treeObj[4].feature;\n\n if (feature.properties._hits.length > 1) {\n nonuniqueAddresses = nonuniqueAddresses.concat(feature.properties._hits);\n }\n });\n\n return nonuniqueAddresses;\n }", "function removeDuplicateNames(arr) {\n let duplicate = false;\n let compare;\n let spliceIndexArr = [];\n let cleanStats;\n let lastTeam;\n let duplicatePlayerTeams = [];\n\n arr.map(function(item, index) {\n if(item.Tm === \"TOT\"){\n if(duplicate) {\n duplicatePlayerTeams.push({Player: compare, Tm: lastTeam});\n compare = item.Player;\n }\n else {\n duplicate = true;\n compare = item.Player;\n }\n }\n else if(duplicate) {\n if(item.Player === compare){\n spliceIndexArr.push(index); \n lastTeam = item.Tm;\n }\n else { //use last team and compare to create an array to fill in TOT players\n duplicatePlayerTeams.push({Player: compare, Tm: lastTeam});\n duplicate = false;\n compare = \"\"; \n lastTeam = \"\";\n }\n }\n });\n\n cleanStats = arr.filter(function(item, index) {\n if(spliceIndexArr.indexOf(index) == -1){\n return true; \n }\n else {\n return false\n }\n });\n return populateDuplicatePlayerTeams(cleanStats, duplicatePlayerTeams); \n}", "function filterResults() {\n if (questions.includes('\"\"')) {\n var badQuestionsIndex = [];\n var l = 0;\n while (l < questions.length) {\n if (questions[l] == '\"\"') {\n badQuestionsIndex.push(l);\n }\n l++;\n }\n\n //console.log(\"badQuestionsIndex: \" + badQuestionsIndex);\n var j = 0;\n var k = 0;\n for (var i = badQuestionsIndex.length - 1; i >= 0; i--)\n questions.splice(badQuestionsIndex[i], 1);\n\n for (var i = badQuestionsIndex.length - 1; i >= 0; i--)\n answers.splice(badQuestionsIndex[i], 1);\n\n for (var i = badQuestionsIndex.length - 1; i >= 0; i--)\n categories.splice(badQuestionsIndex[i], 1);\n } else if (!getRandom) {\n var duplicatedIndexes = [];\n for (var i = questions.length - 1; i >= 0; i--) {\n var curr = questions[i];\n for (var j = i - 1; j >= 0; j--) {\n if (questions[j] == curr) {\n duplicatedIndexes.push(j);\n questions.splice(j, 1);\n\n }\n }\n }\n\n for (var r = 0; r < duplicatedIndexes.length; r++) {\n answers.splice(duplicatedIndexes[r], 1);\n categories.splice(duplicatedIndexes[r], 1);\n }\n\n }\n\n}", "removeDup(data, key) {\n return [\n ...new Map(\n data.map(x=>[key(x), x])\n ).values(),\n ];\n }", "function bustHiddenSingles(arr) {\n let def = [];\n for (let y = 0; y < arr.length; y++) { // Moving between items and searching arrays.\n for (let x = 0; x < arr[y].length; x++) {\n if (typeof arr[y][x] === \"object\") { \n def = arr[y][x];\n for (let m = 0; m < arr[y].length; m++) { // Searching other arrays on x and delete difference.\n if (typeof arr[y][m] === \"object\" && x !== m) {\n def = def.filter(function(el) { return !arr[y][m].includes(el); });\n }\n }\n if (def.length === 1){ // If difference heave only one item this item its hidden single.\n arr[y][x] = def[0];\n return bustOpenPairs(arr);\n }\n }\n }\n }\n def = [];\n for (let y = 0; y < arr.length; y++) { // Moving between items and searching arrays.\n for (let x = 0; x < arr[y].length; x++) { \n if (typeof arr[y][x] === \"object\"){ \n def = arr[y][x];\n for (let m = 0; m < arr[x].length; m++) { // Searching other arrays on y and delete difference.\n if (typeof arr[m][x] === \"object\" && y !== m) {\n def = def.filter(function(el) { return !arr[m][x].includes(el); });\n }\n }\n if (def.length === 1){ // If difference heave only one item this item its hidden single.\n arr[y][x] = def[0];\n return bustOpenPairs(arr);\n }\n }\n }\n }\n def = [];\n for (let y = 0; y < arr.length; y++) { // Moving between items and searching arrays.\n for (let x = 0; x < arr[y].length; x++) {\n if (typeof arr[y][x] === \"object\"){ \n def = arr[y][x];\n if (x < 3 && y < 3) { // Searching other arrays on squares and delete difference.\n for (let k = 0; k < 3; k++) {\n next:\n for (let m = 0; m < 3; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n def = def.filter(function(el) { return !arr[k][m].includes(el); });\n } \n }\n }\n if (x >= 3 && x < 6 && y < 3) {\n for (let k = 0 ; k < 3; k++) {\n next:\n for (let m = 3; m < 6; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n def = def.filter(function(el) { return !arr[k][m].includes(el); });\n } \n }\n }\n if (x >= 6 && y < 3) {\n for (let k = 0 ; k < 3; k++) {\n next:\n for (let m = 6; m < 9; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n def = def.filter(function(el) { return !arr[k][m].includes(el); }); \n } \n } \n }\n if (x < 3 && y >= 3 && y < 6) {\n for (let k = 3; k < 6; k++) {\n next:\n for (let m = 0; m < 3; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n def = def.filter(function(el) { return !arr[k][m].includes(el); });\n } \n } \n }\n if (x >= 3 && x < 6 && y >= 3 && y < 6) {\n for (let k = 3; k < 6; k++) {\n next:\n for (let m = 3; m < 6; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n def = def.filter(function(el) { return !arr[k][m].includes(el); }); \n } \n }\n }\n if (x >= 6 && y >= 3 && y < 6) {\n for (let k = 3; k < 6; k++) {\n next:\n for (let m = 6; m < 9; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n def = def.filter(function(el) { return !arr[k][m].includes(el); }); \n } \n } \n }\n if (x < 3 && y >= 6) {\n for (let k = 6; k < 9; k++) {\n next:\n for (let m = 0; m < 3; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n def = def.filter(function(el) { return !arr[k][m].includes(el); });\n } \n } \n }\n if (x >=3 && x < 6 && y >= 6) {\n for (let k = 6; k < 9; k++) {\n next:\n for (let m = 3; m < 6; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n def = def.filter(function(el) { return !arr[k][m].includes(el); });\n } \n } \n }\n if (x >= 6 && y >= 6) {\n for (let k = 6; k < 9; k++) {\n next:\n for (let m = 6; m < 9; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n def = def.filter(function(el) { return !arr[k][m].includes(el); });\n } \n } \n }\n if (def.length === 1){ // If difference heave only one item this item its hidden single.\n arr[y][x] = def[0];\n return bustOpenPairs(arr); \n } \n } \n }\n }\n return bustOpenPairs(arr); // Recursion.\n }", "CullDuplicates(contacts)\n\t{\n\t\tlet uniques = [];\n\t\t\n\t\tfor(let con of contacts)\n\t\t{\n\t\t\tlet dupe = false;\n\t\t\tfor(let u of uniques)\n\t\t\t{\n\t\t\t\tif((u.ColA == con.ColA && u.ColB == con.ColB) ||\n\t\t\t\t (u.ColA == con.ColB && u.ColB == con.ColA))\n\t\t\t\t\tdupe = true;\n\t\t\t}\n\t\t\tif(!dupe) uniques.push(con);\n\t\t}\n\t\t\n\t\treturn uniques;\n\t}", "removeEmptyVals(data) {\n return data.filter(val => {\n return !!val;\n });\n }", "eliminateDuplicates () {\n let oldGroupPaths = this.groupPath.split(\"¬\");\n let reducedPathSet = [];\n // We've already sorted the paths\n for (let i = 0; i<oldGroupPaths.length; i++) {\n if (i == oldGroupPaths.length-1 || oldGroupPaths[i+1].indexOf(oldGroupPaths[i])!=0) {\n reducedPathSet.push(oldGroupPaths[i]);\n }\n }\n this.update(reducedPathSet);\n }", "function findDuplicate() {\n\n var modelsArray = [$scope.data.first, $scope.data.second, $scope.data.third, $scope.data.fourth];\n var filteringModelsArray = _.uniq(modelsArray);\n\n return filteringModelsArray.length === modelsArray.length;\n }", "function removeDup(array) {\n var newArray = []; // Contains cleaned-up array that new entries can be put into\n var cleanObject = {}; // Holding Object - array values will be set as object keys; you can't add keys which already exist --> prevents duplicates!\n var prop = \"\";\n\n for (var x = 0; x < array.length; x++) { // Loops through array\n // console.log(array[x]);\n cleanObject[array[x]] = \"value\"; // Set to ANY value - it doesn't matter\n }\n console.log(cleanObject);\n for (prop in cleanObject) { // Loops through object\n // console.log(prop);\n newArray.push(prop); // Pushes object keys into fresh array\n }\n return newArray; // Must return array containng object keys\n}", "massageData(data) {\n // Grab the unique list of counties from the dataset\n this.listOfCounties = [...new Set(data.map((x) => x.res_geo_short))].sort();\n\n // Group data by residential county\n const groupedData = this.groupBy(data, (item) => item.res_geo_short);\n\n // Convert necessary string to ints and add aggregate fields\n groupedData.forEach((county) => this.convertStrings(county));\n return groupedData;\n }", "function uniqueItems(...param) { //libovolny pocet vstupu\r\n var result = new Set(); //Set zajisti jedinecne hodnoty\r\n param.forEach(inputArray => { //cyklus pro vsechny pole \r\n inputArray.forEach(item => { result.add(item) }); //cyklus pro vsechny prvky pole; vlozeni prvku do Set pomoci funkce add\r\n });\r\n return result;\r\n}", "function fnRemoveDuplicates(input){\n return input.filter((e, i) => {\n return (input.indexOf(e) === i);\n });\n}", "function getDistinct(data, key)\n{\n\tvar ans = {};\n\t$.each(data, function(index, record)\n\t{\tvar val = record[key];\n\t\tans[val] = ans[val] || [];\t\n\t\tans[val].push(record);\t\n\t});\n\treturn ans;\n}" ]
[ "0.7221932", "0.65920717", "0.6452534", "0.63466114", "0.61459416", "0.61258036", "0.6083578", "0.60674196", "0.6009945", "0.600187", "0.5997938", "0.59682995", "0.59653556", "0.5936444", "0.592666", "0.587824", "0.58740073", "0.5871026", "0.58695036", "0.5862457", "0.5844053", "0.5806141", "0.57985944", "0.5798505", "0.5783692", "0.5759413", "0.5745172", "0.57444054", "0.574224", "0.5737271", "0.5734275", "0.57333606", "0.5731796", "0.57257867", "0.57221866", "0.57166606", "0.5707639", "0.5705026", "0.5700673", "0.56799173", "0.5679355", "0.5679355", "0.5672054", "0.5658292", "0.56539124", "0.56360155", "0.56360155", "0.5629479", "0.5617768", "0.56041807", "0.5600044", "0.55918694", "0.55877084", "0.5586829", "0.5581282", "0.55789804", "0.55761087", "0.555796", "0.55477977", "0.5537848", "0.55367875", "0.5536407", "0.55310297", "0.5529505", "0.55263656", "0.55241597", "0.5523339", "0.5513335", "0.55120975", "0.55112207", "0.5504938", "0.5495719", "0.5489886", "0.5487879", "0.5484067", "0.54835826", "0.5475203", "0.5465363", "0.5458968", "0.54582566", "0.5457233", "0.54572177", "0.5442588", "0.54404604", "0.5431077", "0.5430998", "0.54308224", "0.5430638", "0.54259944", "0.5425523", "0.54191923", "0.5406573", "0.54016656", "0.539815", "0.53913635", "0.5390966", "0.53880584", "0.5386911", "0.5383321", "0.53789806", "0.53737617" ]
0.0
-1
Add opportunity (on form submission)
function addOpp() { // Get Data from the input fields var newOpp = { title: $('#title').val(), category: $('#category').val(), desc: $('#desc').val(), fields: $('#fields').val(), period: $('#period').val(), } if ($('#reward-c').val() || $('#reward-h').val()) { let rewards = ""; let first = true; if ($('#reward-c').val()) { rewards = rewards + $('#reward-c').val(); } if ($('#reward-h').val()) { if (first) { first = false; rewards = rewards + $('#reward-h').val(); } else { rewards = rewards + ', ' + $('#reward-h').val(); } } newOpp.rewards = rewards; } if ($('#wage').val()) { newOpp.wage = $('#wage').val(); } // Push new opportunity to the array of opportunities opps.push(newOpp); // display the new array of opportunities var oppScript = ""; opps.forEach(function(opp) { oppScript = oppScript + '<div class="col-md-4 opp-col pb-4"> <div class="opp-container"> <h3>' + opp.title + '</h3> <p class="opp-category">' + opp.category; oppScript = oppScript + '</p> <p class="opp-desc">' + (opp.desc).substring(0, 50) + '...' + '</p> <p class="opp-field">' + opp.fields; oppScript = oppScript + '</p> <p class="opp-period">' + 'لمدة ' + opp.period + '</p>'; if (typeof opp.wage != 'undefined') { oppScript = oppScript + '<p class="opp-wage">' + opp.wage + ' ريال ' + '</p>' } oppScript = oppScript + '<div class="text-center"> <a type="button" class="btn" href="opp.html">التفاصيل</a> </div> </div> </div>' }); $(".opps-row").html(oppScript); $('.message-container').slideDown(); setTimeout( function() { $('.message-container').slideUp(); }, 3000); // $('.message').append('<div class="message-container fixed-top">تم إضافة الفرصة بنجاح!</div>'); // // setTimeout( // function() { // $('.message').empty(); // }, 5000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleFormSubmit(e) {\n this.addComic();\n }", "function addGoal() {\n\t\t\tif (vm.adding == false) {\n\t\t\t\tvm.adding = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Make sure that there are values in the\n\t\t\t// fields\n\t\t\tif (vm.goalName === '' || vm.goalImportance === '') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Create a new goal\n\t\t\tvar goal = {};\n\t\t\tgoal.task = vm.goalName;\n\t\t\tgoal.importance = parseInt(vm.goalImportance);\n\t\t\tgoal.selected = false;\n\t\t\tgoal.done = false;\n\n\t\t\t// Insert the new goal into goals\n\t\t\ttasks.addTask(goal);\n\t\t\tvm.goals.push(goal);\n\n\t\t\t// Reset the form fields\n\t\t\tvm.goalName = '';\n\t\t\tvm.goalImportance = '';\n\n\t\t\tvm.adding = false;\n\t\t\t\n\t\t\tconsole.log(vm.goals);\n\t\t}", "function add() {\n vm.error = null;\n vm.form.submitted = true;\n\n // Show validation messages if needed.\n if (!vm.form.$valid) {\n return;\n }\n\n // Save and show feedback to the user.\n playbookDataService.createCommitmentForPlaybook(vm.playbookId, vm.form.data)\n .then(function (data) {\n vm.info = \"Commitment created successfully\";\n $timeout(function () {\n vm.info = null;\n }, 2000);\n\n // Update cat name of the commitment since it's not returned.\n data.categoryName = vm.form.data.categoryName;\n vm.commitments.push(data);\n })\n .catch(function () {\n vm.error = \"Failed to create commitment.\";\n })\n .finally(function () {\n vm.form.submitted = false;\n vm.form.show = false;\n vm.form.data = {};\n });\n }", "function submit() {\n saveForm(applicant)\n}", "function addIncomeEvent(){\n //checks if the form was filled out correctly\n if(incomeDesc.value !== \"\" && incomeAmount.value !== \"\"){\n //adds a unique property / sub-object to the incomeData object which stores the data of all incomes\n incomeData[globalCounter] = {\n desc: incomeDesc.value,\n amount: incomeAmount.value,\n num: globalCounter,\n output: function() {\n return `<li><p class=\"one\">${this.desc}</p><p class=\"two\">€${this.amount}</p><i id=\"${this.num}\"class=\"fas fa-trash-alt\"></i></li>`\n }\n };\n //refreshes the list and adds 1 to the globalCounter which will create unique key names and delete icon ID's\n incomeRefresh();\n globalCounter++;\n //puts the focus back on the \"Description\" input\n document.querySelector(\".income-desc\").focus();\n }\n }", "function addActivity(event) {\r\n event.preventDefault();\r\n let form = event.target;\r\n let memberName = form.name;\r\n let newActivity = form.elements[0].value;\r\n \r\n // add the activity to the object \r\n if (newActivity)\r\n {\r\n let list = document.getElementById(memberName);\r\n let li = document.createElement(\"li\");\r\n li.textContent = newActivity;\r\n list.appendChild(li);\r\n getMember(memberName).activities.push(newActivity);\r\n }\r\n else{\r\n window.alert(\"Please enter an activity\");\r\n return;\r\n }\r\n form.elements[0].value = null;\r\n } // End of callback function addActivity", "handleOLICreated(event){\n event.preventDefault(); // stop the form from submitting\n const fields = event.detail.fields;\n fields.OpportunityId = this.recordId; // Make reference to the current Opportunity Record\n\n this.template.querySelector('lightning-record-form').submit(fields);\n\n }", "addExpense(expense) {}", "function handleFormSubmit(event) {\n event.preventDefault();\n if (\n formObject.type &&\n formObject.model &&\n formObject.serialNum &&\n formObject.condition &&\n formObject.purchaseDate &&\n formObject.dateIssued &&\n formObject.initialCost\n ) {\n API.insertEquipment({\n // equipment DATA HERE\n type: formObject.type,\n model: formObject.model,\n serialNum: formObject.serialNum,\n condition: formObject.condition,\n purchaseDate: formObject.purchaseDate,\n dateIssued: formObject.dateIssued,\n employee_id: formObject.employee_id,\n\n initialCost: formObject.initialCost,\n })\n .then((res) => loadEquipment())\n .then(clearForm())\n .catch((err) => console.log(err));\n }\n }", "function handleFormSubmit(event) {\n event.preventDefault();\n\n API.createExpense({\n title: formObject.title,\n date: formObject.date,\n category: formObject.category,\n clienttocharge: formObject.clienttocharge,\n amount: formObject.amount,\n notes: formObject.notes,\n creator: userId\n })\n .then(() =>\n setFormObject({\n title: \"\",\n date: \"\",\n category: \"\",\n clienttocharge: \"\",\n amount: \"\",\n notes: \"\"\n })\n )\n .then(() => {\n history.push(\"/allclaims\");\n })\n .catch(err => console.log(err));\n }", "'submit .project-data-form'(event, instance) {\n event.preventDefault();\n\n // Get contact info (text fields)\n const projectName = event.target.projectName.value; // based on associated html id tags\n const bio = event.target.bio.value;\n let skillsWanted = event.target.skillsWanted.value.split(',');\n skillsWanted = _.map(skillsWanted, (skill) => { return utils.makeReadable(skill); });\n const url = event.target.projectUrl.value;\n\n console.log(skillsWanted);\n Projects.update({ _id: FlowRouter.getParam('_id') }, {\n $set: {\n projectName: projectName,\n bio: bio,\n skillsWanted: skillsWanted,\n url: url,\n modifiedAt: new Date()\n }\n });\n\n SkillGraphCollection.addVertexList(skillsWanted);\n\n FlowRouter.go('Project_Profile_Page', { _id: FlowRouter.getParam('_id') });\n }", "function handleSubmitClick(){\r\n\t\tvar grocery = {};\r\n\t\tgrocery.title = txtGroceryName.value;\r\n\t\tgrocery.desc = txtGroceryDesc.value;\r\n\t\tgrocery.price = txtGroceryPrice.value;\r\n\r\n\t\tif(concernedLi === null){\r\n\t\t\tif(isValid(grocery)){\r\n\t\t\t\taddGrocery(grocery);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(isValid(grocery)){\r\n\t\t\t\tupdateGrocery(grocery);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\twindow.event.preventDefault();\r\n\t}", "function addExperience(company, url){\n let newCompany = {\n companyName: company[0].value,\n title: company[1].value,\n city: company[2].value,\n state: company[3].value,\n startDate: company[4].value,\n endDate: company[5].value,\n url: company[6].value, \n logo: company[7].value,\n hideOnPrint: company[8].checked ? true : false\n }\n \n if(newCompany.companyName && newCompany.title && newCompany.city && newCompany.state && newCompany.startDate){\n $.post(url, { newCompany: newCompany })\n .then(function(addedCompany){\n // reset the form\n resetForm(company);\n // REFACTOR THIS SO IT DOESNT REBUILD THE ENTIRE LIST EVERY TIME\n // append new company to list \n // appendExperience(addedCompany, addedCompany);\n rebuildExperienceList(url); \n \n // append to company to dropdown\n $('#company-dd').append('<option>' + addedCompany.companyName + '</option>')\n })\n .catch(function(err){\n throwErr(err);\n });\n }\n}", "function submitBtn(){\n\n window.alert(\"it worked!\");\n\n //Config the Model\n var newResource = {\n techFirstName: document.getElementById(\"firstName\").value, //Put the tech first name here\n techLastName: document.getElementById(\"lastName\").value //Put the tech last name here\n };\n\n resourceRef.push(newResource);\n window.location = \"success.html\";\n\n}", "handleSubmit(event) {\n\n event.preventDefault();\n createGoal({\n goalType: \"Cardio\",\n goalName: this.state.goalName,\n goalStartDate: moment(),\n goalDistance: this.state.goalDistance,\n goalMileTime: this.state.goalMileTime,\n workouts: [],\n goalOwner: this.props.userId\n })\n browserHistory.push(\"/dashboard\");\n }", "function addNewToy(event) {\n event.preventDefault();\n let configToyObj = {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\"\n },\n body: JSON.stringify(\n { name: nameForm.value,\n image: imageForm.value,\n likes: 0 \n })\n }\n fetch(\"http://localhost:3000/toys\", configToyObj).then(getToys)\n toyForm.style.display = \"none\" \n }", "handleEditFormSubmission() {\n\t\tthis.getPortfolioItemData();\n\t}", "onHandleAddOrganization(e) {\n e.preventDefault();\n const { newOrganization } = this.state;\n if (this.onCheckFormValue(newOrganization)) {\n return;\n }\n this.showConsent(this.onAddOrganization.bind(this));\n }", "function handleAdd(){\n console.log('clicked on Submit button');\n\n let newTask = {\n task: $('#taskIn').val()\n }\n // run addTask with newTask variable\n addTask(newTask);\n\n // empty input task\n $('#taskIn').val('')\n} // end handleAdd", "onSubmit(e) {\n this.addPerson(this.state.person);\n e.preventDefault();\n }", "function saveMentorForm(e) {\n e.preventDefault();\n var category = document.getElementById(\"category\").value;\n var paragraph = document.getElementById(\"paragraph\").value;\n saveMentor(category, currentMentor.fullName, currentMentor.job, currentMentor.company, paragraph, currentMentor.img, currentMentor.mail, currentMentor.linkedinLink, currentMentor.linkedinID);\n}", "function addNewItem() { switchToView('edit-form'); }", "function addClaim(){\n\teditClaim();\n}", "registerSubmitEvent() {\n\t\tthis.container.on('click', '.js-modal__save', (e) => {\n\t\t\tAppConnector.request({\n\t\t\t\tmodule: app.getModuleName(),\n\t\t\t\taction: 'ChangeCompany',\n\t\t\t\trecord: this.container.find('#companyId').val()\n\t\t\t}).done(() => {\n\t\t\t\twindow.location.href = 'index.php';\n\t\t\t});\n\t\t\te.preventDefault();\n\t\t});\n\t}", "function setUpForm() {\n var button = document.getElementById(\"submitButton\");\n button.addEventListener(\"click\", addListItemFromForm);\n }", "function setupAddExpenseForm(isCalculatedByLoggedInUser, utils, modal, map, mask) {\n var categoryId = \"#kn-input-field_238 .select\";\n var categoryIdChzn = \"#connection-picker-chosen-field_238 .chzn-container\";\n var beginningMileageId = \"#field_225\" ;\n var endingMileageId = \"#field_226\";\n var amountId= \"#field_222\";\n var tollsId = \"#field_252\" ;\n var expSourceCodeId = \"#field_250\";\n var receiptId= \"#field_227_upload\";\n\n // hide employee field if mileagerate is false meaning its not user\n if(!isCalculatedByLoggedInUser){\n calculateTravelExpense(isCalculatedByLoggedInUser)\n }\n\n $(beginningMileageId).on(\"blur\", function(){\n calculateTravelExpense(isCalculatedByLoggedInUser)\n });\n\n $(endingMileageId).on(\"blur\", function(){\n calculateTravelExpense(isCalculatedByLoggedInUser)\n });\n\n $(tollsId).on('blur',function(){\n calculateTravelExpense(isCalculatedByLoggedInUser);\n });\n\n // this is in case anyone puts a symbol other then a period in the amount field it removes it.\n $(amountId).on(\"blur\",function(){\n $(this).val( $(this).val().replace(/[&\\/\\\\#,+()$~%'\":*?<>{}]/g, '') );\n });\n\n // When expense category gets changed all input fields get cleared\n $(categoryId).on(\"change\", function(){\n $(amountId).val(\" \");\n $(beginningMileageId).val(0);\n $(endingMileageId).val(0);\n $(tollsId).val(0);\n $(amountId).prop('disabled', false);\n });\n\n // shows alert on submit if receipt is needed\n $(\".kn-form .kn-button\").on('click',function() {\n var hasReceipt = $('#kn-input-field_227 .kn-asset-current').text().trim(\" \").length != 0 ;\n var isTravelExpense = $(categoryIdChzn + \" a span\").text().toLowerCase() == \"travel\" ;\n var tolls = utils.getNum(tollsId);\n\n if ( isTravelExpense ){\n calculateTravelExpense(isCalculatedByLoggedInUser)\n }\n\n if (tolls > 0 & isTravelExpense && !hasReceipt ){\n alert('Please add a receipt for your toll');\n return false ;\n }\n\n if ( ! isTravelExpense && !hasReceipt ){\n alert(\"Please make sure you have selected the expense category and added a receipt if its a non mileage expenses\");\n return false ;\n }\n });\n }", "function add(event) {\n event.preventDefault();\n // clear inputs set button\n $('#bomForm input').each(function (index, val) {\n $(this).val('');\n });\n $post.prop(\"hidden\", false);\n $put.prop(\"hidden\", true);\n // set title\n $('#modalTitle').text(\"Add New bom\");\n // spawn modal\n $('#formModal').modal();\n}", "create(form) {\n this.submitted = true;\n this.homework.creator = this.getCurrentUser();\n this.homework.maxPoints = this.maxPoints;\n // TODO add class (fetch from teacher?)\n\n if (form.$valid) {\n this.homeworkService.save(this.homework, () => {\n // Refresh the page\n this.$state.go(this.$state.current, {}, {reload: true});\n });\n }\n }", "@action\n insert() {\n this.error = undefined;\n const { participants, absentees } = this.collectParticipantsAndAbsentees();\n const info = {\n chairman: this.chairman,\n secretary: this.secretary,\n participants,\n absentees,\n };\n if (absentees.includes(this.chairman)) {\n this.error = this.intl.t(\n 'participation-list-modal.chairman-absent-error',\n );\n return;\n }\n this.args.onSave(info);\n this.args.onCloseModal();\n }", "function directUserFromAddInfo() {\n if (nextStep == \"A new department\") {\n addDepartmenet();\n }\n if (nextStep == \"A new role\") {\n addRole();\n }\n if (nextStep == \"A new employee\") {\n addEmployee();\n } \n }", "function createMeeting(formInfoObj){\n\n\t\n}", "function addScheduledInterviewId() {\n document.feedbackForm.interviewId.value = getScheduledInterviewId();\n}", "function addOrcamentoCoberturaIseg(){\r\n\tsubmitFormAjax('#formOrcCobIseg', getContextApp()+'/orcamentoSegAuto/addOrcamentoCoberturaIseg.action', '#coberturasIseg');\r\n}", "function add_activity() {\n\n create_new_activity.style.display = \"block\";\n let new_title = d.getElementById(\"title\");\n let new_desc = d.getElementById(\"desc\");\n let new_goal = d.getElementById(\"goal\");\n let confirm_new_activity = d.getElementById(\"confirm_new_activity\");\n\n function confirm() {\n let newActivity = new Activity();\n newActivity.title = new_title.value;\n newActivity.description = new_desc.value;\n newActivity.current_goal = new_goal.value;\n\n new_title.value = \"\";\n new_desc.value = \"\";\n new_goal.value = \"\";\n\n create_new_activity.style.display = \"none\";\n MyActivities.set(newActivity.title, newActivity);\n sauvegarde();\n list_activities();\n }\n\n confirm_new_activity.addEventListener('click', confirm);\n}", "function formsubmit(e) {\n e.preventDefault();\n firebase\n .firestore()\n .collection(\"times\")\n .add({\n title,\n content,\n votes,\n user: currentUser.uid\n })\n .then(() => {\n setTitle(\"\");\n setContent(\"\");\n });\n }", "function addListItemFromForm() {\n addListItem( getFormValues());\n}", "function addParkingStandsPopup(that){\n // Input form for Objects\n var tmp = '<form id=\"saveMarker\" class=\"tabledisplay\">' +\n '<p><label> <strong>Name: </strong></label>' +\n '<input type=\"text\" id=\"name\" name=\"name\" required=\"true\"/>' +\n '</p><br><p><label><strong>Type: </strong></label>' +\n '<select type=\"text\" id=\"type\" name=\"type\" required=\"true\">' +\n '<option value=\"Parking\">Parking</option><option value=\"Stands\">Stands</option></select>' +\n '</p><br><p><label><strong>Capacity: </strong></label>' +\n '<input type=\"number\" min=\"0\" id=\"cap\" name=\"capacity\" required=\"true\">' +\n '</p><br><p><label><strong>Price: </strong></label>' +\n '<input type=\"number\" min=\"0\" id=\"price\" name=\"price\" required\"true\">' +\n '</p><br><p><label><strong>Description: </strong></label>' +\n '<textarea class=\"form-control\" rows=\"1\" id=\"info\" name=\"description\"></textarea>' +\n '<input class=\"hidden\" value=\"-9999\" type=\"text\" id=\"picture\" name=\"picture\"/>' +\n '<div style=\"text-align:center;\"><button type=\"submit\" value=\"Save\" class=\"btn btn-primary trigger-submit\">Save</button></div>' + '</div>' +\n '</form>';\n createObjectCreationPopup(tmp);\n}", "function createOne() {\n var participantForm = session.forms.giftregistry.event.participant;\n\n Form.get(session.forms.giftregistry).clear();\n\n participantForm.firstName.value = customer.profile.firstName;\n participantForm.lastName.value = customer.profile.lastName;\n participantForm.email.value = customer.profile.email;\n\n app.getView().render('account/giftregistry/eventparticipant');\n}", "function addObject(event) {\n event.preventDefault();\n\n // If it is, compile all user info into one object\n var newObject = {\n 'categories': $('#addObject fieldset input#inputCategories').val().split(\",\"),\n 'tags': $('#addObject fieldset input#inputTags').val().split(\",\"),\n 'related': $('#addObject fieldset input#inputRelated').val().split(\",\"),\n }\n\n var clientID = $('#addObject fieldset input#inputClientID').val();\n var customID = $('#addObject fieldset input#inputCustomID').val();\n\n // Use AJAX to post the object to our service\n $.ajax(createRequest('POST','/geo/'+clientID+'/objects/'+customID,newObject)).done(function( response ) {\n console.log(response);\n // Fill the response field on the webpage\n $('#addObjectResponse').text(JSON.stringify(response));\n });\n}", "async function newGoalSubmit(event){\n /*\n On submit of a goal form. Sends an update post request to the API\n */\n event.preventDefault()\n\n const token = document.cookie.split(';').filter((item) => item.trim().startsWith('token='))[0].split('=')[1]\n\n //collecting form information\n console.log(event.target)\n const activityID = event.target.id\n const title = event.target.querySelector(`#goal-title-input-${activityID}`).value\n const description = event.target.querySelector(`#goal-description-input-${activityID}`).value\n const hours = event.target.querySelector(`#goal-hours-input-${activityID}`).value\n const dateTime = event.target.querySelector(`#goal-deadline-input-${activityID}`).value\n console.log(activityID, title, description, hours, dateTime)\n\n //sending requests\n const response = await fetch('http://127.0.0.1:8000/api/goals/', {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Token ${token}`\n },\n body: JSON.stringify({\n title: `${title}`,\n description: `${description}`,\n activity: `${activityID}`,\n deadline: `${dateTime}`,\n hours_required: `${hours}`\n })})\n if (response.status != 201){\n console.log('screwed up adding a goal to the db status = ' + response.status)\n }\n else {\n\n // creating a new goal card\n const newGoal = await response.json()\n const newGoalCard = buildGoal(newGoal)\n\n // creating a new goal graph\n const chartsContainer = document.getElementById(`graph-body-${activityID}`)\n const goalChart = buildGraph(`goal-${newGoal.id}-data`)\n goalChart.classList.add('hidden')\n chartsContainer.appendChild(goalChart)\n\n // appending after the goal form\n const goalForm = document.getElementById(`goal-form-container-${activityID}`)\n goalForm.insertAdjacentElement('afterend',newGoalCard)\n console.log('updated db')\n }\n}", "function addVolunteer(\n full_name,\n email,\n phone,\n address,\n postcode,\n password,\n zone\n ) {\n const newVolunteer = {\n full_name: full_name,\n email: email,\n phone: phone,\n address: address,\n postcode: postcode,\n password: password,\n zone: zone,\n managerId: 1,\n };\n axios\n .post(\n \"https://qrk4yg29wg.execute-api.eu-west-2.amazonaws.com/dev/volunteer\",\n newVolunteer\n )\n .then((response) => {\n newVolunteer.volunteer_id = response.data.task[0].volunteer_Id;\n const updatedTask = [...volunteer, newVolunteer];\n setVolunteers(updatedTask);\n })\n .catch((error) => {\n console.log(\"Error adding a volunteer\", error);\n });\n }", "handleNewSubmit (event) {\n event.preventDefault();\n //on submit, call AJAX post to API\n const newGoal = this.state.newGoal;\n this.postNewGoals(newGoal);\n }", "handleSubmit(event, item) {\n var obj = {\n Name: this.state.Name,\n Phone: this.state.Phone\n };\n var id = this.state.items._id;\n\n this.state.items.attending.push(obj);\n this.state.items.availableSeats = this.state.items.availableSeats;\n var yahya = this.state.items;\n\n $.ajax({\n type: \"PUT\",\n url: \"/create/\" + id,\n data: yahya,\n success: function(data) {\n alert(\"successfully attended\");\n document.getElementById(\"name\").value = \"\";\n document.getElementById(\"phone\").value = \"\";\n }\n });\n\n event.preventDefault();\n }", "function handleAddItem() {\n // Listen for when users submit a new list item\n $('#js-shopping-list-form').submit(event => {\n event.preventDefault();\n // Get the name of the new item from the text input\n const inputObject = $('.js-shopping-list-entry');\n const newListItem = inputObject.val();\n // Clear out the value of the input so new items can be addeed\n inputObject.val('');\n // Update the store\n addItemToStore({ name: newListItem, completed: false });\n // Rerender the shopping list\n renderShoppingList();\n });\n}", "function attachNewUserToIncident() {\n attachNewUser = true;\n $(\"#user_add_username\").val($(\"#user_name\").val());\n openAddUser();\n }", "handleAddSubmit() {}", "createExpense(e) {\n e.preventDefault()\n const value = this.newExpenseName.value\n\n this.expensesAdapter.createExpense(value).then(expense => {\n this.expenses.push(new Expense(expense))\n this.newExpenseName.value = ''\n this.renderExpense()\n })\n }", "addTask() {\n\t\tif (taskTitle.value !== undefined && taskTitle.value !== '') {\n\t\t\t//This next line adds the newly defined goal to an array of goals created in this session\n\t\t\tnewTaskList.push(taskTitle.value);\n\t\t\tconsole.log(`New Task List: ${newTaskList}`); //Goals are stored correctly\n\t\t\tthis.addTaskDOM(taskTitle.value, false);\n\t\t\tfetch('/items', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t 'Accept': 'application/json',\n\t\t\t\t 'Content-Type': 'application/json'\n\t\t\t\t},\n\t\t\t\t body: JSON.stringify({\n\t\t\t\t\t title: taskTitle.value, \n\t\t\t\t\t goal_id: userGoals.goals[userGoals.goalIndex].id\n\t\t\t\t\t})\n\t\t\t })\n\t\t\t .then(res => res.json())\n\t\t\t .then(res => {\n\t\t\t\t userGoals.goals[userGoals.goalIndex].items.push(res);\n\t\t\t\t this.setId(res.id);\n\t\t\t\t})\n\t\t\t .catch(error => console.error(error));\n\n\t\t\ttaskTitle.value = '';\n\t\t\t\n\t\t\tcloseTaskForm();\n\t\t}\n\t\telse{\n\t\t\talert('Please enter new tasktitle');\n\t\t}\n\t\t// this.edit();\n\t}", "handleFormSubmit(){\n const appointment = {title: this.state.title, appt_time: this.state.appt_time};\n $.post('/appointments',\n {appointment: appointment})\n .done((data) =>{\n this.addNewAppointment(data);\n });\n\n }", "NewItemForm(e) {\n if (typeof this.props.onNew === 'function') {\n var props = {\n type: \"existing\",\n item_id: this.props.menu[1].item_id,\n menu: {\n \"name\": this.props.menu[0],\n \"category\": this.props.menu[1].category,\n \"price\" : this.props.menu[1].price,\n \"calories\": this.props.menu[1].calories,\n \"in_stock\": this.props.menu[1].in_stock,\n \"description\": this.props.menu[1].description\n }\n }\n this.props.onNew(props);\n }\n }", "TestAddExperience(experience_place_input, experience_date_input, experience_center_input, experience_add_action) {\n // set a default value to the experience place input\n experience_place_input.value = \"test\";\n // set a default value to the experience date input\n experience_date_input.value = \"test\";\n // set a default value to the experience center input\n experience_center_input.value = \"test\";\n // invoke the event from the adding experience button\n experience_add_action.dispatchEvent(new Event(\"click\"));\n // print on the console that the test is completed\n console.log(\"Testing add experience method completed\");\n // add the state of was the experience of the client instance had the default values or not\n this._errors_exists = (this._main_store.client.experiences[0].place != \"test\" &&\n this._main_store.client.experiences[0].date != \"test\" &&\n this._main_store.client.experiences[0].center != \"test\");\n }", "handleFormSubmit(formProps) {\n // call action creator to sign up user\n this.props.addArticle(formProps);\n }", "function addNewSkill() {\n var skillInput = registrationProfessionalPage.regSkillInputField.text;\n if (skillInput) {\n volunteerRegObject.skillsArray.push(skillInput);\n updateSkillsSegment();\n registrationProfessionalPage.regSkillInputField.text = \"\";\n } else {\n kony.ui.Alert({\n \"alertType\": constants.ALERT_TYPE_ERROR,\n \"alertTitle\": \"Action Required\",\n \"yesLabel\": \"OK\",\n \"message\": \"Please enter a skill name\",\n \"alertHandler\": null\n }, {\n \"iconPosition\": constants.ALERT_ICON_POSITION_LEFT\n });\n }\n}", "function NewAppt() {\n $(\"#add-appt\").css(\"display\", \"none\");\n $(\"#appt-form\").css(\"display\", \"block\");\n $(\"#add-btn\").css(\"display\", \"inline-block\");\n $(\"#cancel-btn\").css(\"display\", \"inline-block\");\n}", "function addAgenmento() {\n var pop = $('#md-editar-agendamento');\n\n if (pop) {\n loadClientes().then(() => {\n onNovoAgendamento();\n setPopAgendamentoTitle(\"Criar Agendamento\");\n pop.draggable();\n pop.modal();\n });\n }\n }", "submit () {\n\n // Add to saved A/B tests\n const saved = document.querySelector('#saved');\n saved.add(this.info.item);\n saved.clearFilters();\n\n // Switch to tab saved\n const tabs = document.querySelector('#tabs');\n tabs.selectTab('saved');\n\n // Hide modal\n this.modal.hide();\n\n // Reset create form\n document.querySelector('#create').innerHTML = '<fedex-ab-create></fedex-ab-create>';\n }", "function onCreateSubmit(event) {\n event.preventDefault();\n const newTestimony = {\n userTestimony: $(\"#userTestimony\").val(),\n userDisplayName: $(\"#userDisplayName\").val()\n };\n HTTP.createTestimony({\n authToken: STATE.authUser.authToken,\n newTestimony: newTestimony,\n onSuccess: function() {\n $(\".notification\").html(` Testimony was submitted successfully`);\n pastSubmittedTestimonies();\n },\n onError: err => {\n $(\".notification\").html(\n `ERROR: Testimony was not submitted successfully`\n );\n }\n });\n}", "function agregarCita(e) {\n\n e.preventDefault();\n // extraer la información del objeto de citas\n const {mascota,propietario,telefono,fecha,hora,sintomas} = citaObj;\n\n // validar\n if(mascota === '' || propietario === '' || telefono === '' || fecha === '' || hora === '' || sintomas === '') {\n ui.imprimirAlerta('Todos los campos son obligatorios','error');\n return;\n }\n\n if(editando) {\n // imprimir mensaje de agregado\n ui.imprimirAlerta('La cita se editó correctamente');\n \n // pasar el objeto de la cita a ediccion\n administrarCitas.editarCita({...citaObj});\n\n // regresar el botón a su estado original\n form.querySelector('button[type=\"submit\"]').textContent = 'Crear cita';\n\n // quitar modo edición\n editando = false;\n } else {\n // crear id único\n citaObj.id = Date.now();\n\n // agregando una nueva cita\n administrarCitas.crearCita({...citaObj});\n\n // imprimir mensaje de agregado\n ui.imprimirAlerta('La cita se agregó correctamente');\n }\n\n \n \n // reiniciar objeto de validación\n reiniciarObjeto();\n\n // reiniciar formulario\n form.reset();\n\n // mostrar html de las citas\n ui.imprimirCitas(administrarCitas);\n}", "function handleSubmit(evt) {\n evt.preventDefault();\n storeItem(newItem);\n alert(\"Menu item added!\")\n\n // redirect with history.push and the path\n // after the email form is submitted it redirects to the root\n // can also go back and forward unlike redirect\n history.push(`/${item}`);\n }", "function addCampaign(form) {\n vm.form = form;\n CampaignService.addCampaign(vm.campaign)\n .then(closeModal)\n .catch(handleError);\n }", "function addPledgeSubmitListener(st) {\n if (st.view === \"Pledge\") {\n document\n .getElementById(\"Pledge-form\")\n .addEventListener(\"submit\", (event) => {\n event.preventDefault();\n createPledge();\n });\n }\n}", "function addToList() {\n $('#js-shopping-list-form').on('submit', event => {\n event.preventDefault();\n const itemName = $('#shopping-list-entry').val();\n $('.shopping-list').append(createNewItem(itemName));\n $('#shopping-list-entry').val('');\n });\n}", "function handleAddClick() {\n console.log('add button clicked');\n let newTask = {};\n //puts input fields into an object\n newTask.task = $('#taskIn').val();\n newTask.type = $('#homeOrWork').val();\n newTask.notes = $('#notesIn').val();\n addTask(newTask);\n $('#taskIn').val('');\n $('#notesIn').val('');\n}", "function addNewGoal() {\n console.log(\"starting process for adding new goal\");\n // set up the same elemnet used for editing \n\n if (document.querySelector(\".elementForEdit\") == null) { // if editing is NOT in progress, toggle editing\n var editElement = $.parseHTML(getParentEditTemplate(\"\", \"\", \"purple\"));\n editElement[0].childNodes[3].placeholder = \"goal name\"; // sets goal placeholder text\n editElement[0].childNodes[5].placeholder = \"just give me a reason\"; // sets reason placeholder text\n editElement[0].childNodes[7].addEventListener(\"click\", ()=>{ // when submit button is clicked\n fetch(\"/api/addGoal\", {\n headers: {\n \"Content-Type\": \"Application/json\"\n }, \n method: \"POST\",\n body: JSON.stringify({\n color: \"grey\",\n name: editElement[0].childNodes[3].value,\n reason: editElement[0].childNodes[5].value,\n \n })\n }).then((res) => res.json())\n .then((data) => {\n if (data.ok) console.log(\"successfully added goal\");\n else { console.log(\"error adding goal\"); }\n });\n $(\".elementForEdit\").remove(); \n })\n editElement[0].childNodes[9].addEventListener(\"click\", ()=>{\n $(\".elementForEdit\").remove(); \n }) \n $(\".goalsContainer\").append(editElement);\n }\n else { \n console.log(\"Editing in progress already\"); \n }\n}", "onSubmit() { // eslint-disable-line class-methods-use-this\n logEvent('User account', 'Create new AoI', 'Save');\n Router.pushRoute('admin_myprep', { tab: 'areas' });\n }", "function handleNewPlantSubmit(e){\n let targetFormId = parseInt(e.target.id)\n let newPlantField = document.querySelector(`#new-plant-form-${targetFormId}`)\n let plantInput = newPlantField.querySelectorAll(\"input#plant\")\n let newPlantObj = {\n garden_id: plantInput[0].value,\n plantName: plantInput[1].value,\n plantType: plantInput[2].value,\n plantFamily: plantInput[3].value\n }\n Api.newPlant(newPlantObj)\n location.reload()\n}", "function handleNewItemSubmit() {\r\n $('main').on('submit','#new-bookmark-form', event => {\r\n console.log(\"new item submit is listening\");\r\n event.preventDefault();\r\n let data = serializeJson(event.target)\r\n console.log(data)\r\n api.createBookmark(data)\r\n .then((newItem) => {\r\n console.log(newItem);\r\n store.addItem(newItem);\r\n store.error=null;\r\n store.filter = 0;\r\n store.adding = false;\r\n render();\r\n })\r\n .catch((error) => {\r\n store.setError(error.message);\r\n renderError();\r\n });\r\n })\r\n}", "function onSubmit() {\n props.addCustomerModal(customerModal);\n }", "function addMiscellaneousPopup(that) {\n var tmp = '<form id=\"saveMarker\" class=\"tabledisplay\">' +\n '<p><label> <strong>Name: </strong></label>' +\n '<input type=\"text\" id=\"name\" name=\"name\" required=\"true\"/>' +\n '</p><br><p><label><strong>Type: </strong></label>' +\n '<select type=\"text\" id=\"type\" name=\"type\" required=\"true\"/>' +\n '<option value=\"Misc\">Miscellaneous</option></select>' +\n '<input class=\"hidden\" min=\"0\" id=\"cap\" name=\"capacity\" value=\"-9999\"/>' +\n '<input class=\"hidden\" min=\"0\" id=\"price\" name=\"price\" value =\"-9999\"/>' +\n '</p><br><p><label><strong>Picture: </strong></label>' +\n '<input type=\"text\" id=\"picture\" name=\"picture\"/>' +\n '</p><br><p><label><strong>Description: </strong></label>' +\n '<textarea class=\"form-control\" rows=\"1\" id=\"info\" name=\"description\"></textarea>' +\n '<p><br><div style=\"text-align:center;\"><button type=\"submit\" value=\"Save\" class=\"btn btn-primary trigger-submit\">Save</button></div>' + '</div>' +\n '</form>';\n createObjectCreationPopup(tmp);\n}", "submitNewPlace(map, panorama, service, formID, inputClass, inputID, errorMsg, confirmMsg) {\n let formTag = document.getElementById(`${form[0].id}`)\n formTag.addEventListener('submit', evt => {\n evt.preventDefault()\n this.operator.postNewPlace(map, panorama, service, formID, inputClass, inputID, errorMsg, confirmMsg)\n })\n }", "function addMember(){\n // Getting data\n let age = parseInt(document.getElementsByName(\"age\")[0].value, 10);\n let relElem = document.getElementsByName(\"rel\")[0];\n let relationship = relElem.options[relElem.selectedIndex].value;\n let smoker = document.getElementsByName(\"smoker\")[0].checked;\n\n // Checking requirements\n if (age < 0 || Number.isInteger(age) === false) age = null;\n if (relationship === \"\") relationship = null;\n\n // If requirements are fulfilled, add member\n if (age != null && relationship != null) {\n const member = new Member(age, relationship, smoker);\n console.log(\"new member added\");\n householdMembers.unshift(member);\n }\n\n // Reset form and reload household members\n document.getElementsByName(\"age\")[0].value = \"\";\n document.getElementsByName(\"rel\")[0].value = \"\";\n document.getElementsByName(\"smoker\")[0].checked = false;\n reloadMembers();\n}", "handleAdd() {\n const { opps, formData } = this.state\n // Optimistic update\n this.teardownForm()\n this.setState({\n opps: opps.slice().concat([formData])\n })\n\n // Update server\n xhr({\n url: '/api/opps',\n method: 'POST',\n json: formData,\n }, (err, res) => {\n if (err || res.statusCode !== 201) {\n // Rollback if error\n return this.setState({opps})\n }\n\n // Sync client and server\n return this.setState({\n opps: res.body.opps\n })\n })\n }", "function addNewObject(event) {\n const nameInput = document.querySelector('#inputForNew1');\n const latInput = document.querySelector('#inputForNew2');\n const longInput = document.querySelector('#inputForNew3');\n event.preventDefault()\n let a = {\n name: '',\n latitude: '',\n longitude: ''\n\n }\n const nameInputValue = nameInput.value;\n const latInputValue = latInput.value;\n const longInputValue = longInput.value;\n a.name = nameInputValue;\n a.latitude = latInputValue;\n a.longitude = longInputValue;\n countriesList.push(a);\n onSuccessNewSingle();\n}", "save () {\n\n // Validate\n if (this.checkValidity()) {\n\n // Collect input\n this.info.item = this.collectInput();\n\n // Show modal\n this.modal.show();\n }\n }", "function addProduct () {\n event.preventDefault();\n var addCoffee = document.getElementById(\"new-coffee\");\n var addRoast = document.getElementById(\"new-roast\");\n var newCoffee = {\n name: addCoffee.value,\n roast: addRoast.value\n };\n coffees.push(newCoffee);\n outputHTML.innerHTML = renderCoffees(coffees);\n}", "function addNewToyFormListener () {\n formEl.addEventListener('submit', event => {\n event.preventDefault()\n\n const toy = {\n name: formEl.name.value,\n image: formEl.image.value,\n likes: 0\n }\n\n createToy(toy)\n .then(serverToy => renderToy(serverToy))\n .catch(error => alert('Unable to create toy. Plase try again later.'))\n \n formEl.reset()\n })\n}", "function new_alt_loc() {\n\t \n\t $.ajax({\n\t\t type: \"POST\",\n\t\t url: \"/advertiser_admin/form_actions/advert_alt_loc_frm.deal\",\n\t\t success: function(msg){\n\t\t jQuery(\"#alt_loc_form_area\").html(msg);\n\t\t }\n\t });\n\t \n }", "function create_item() {\n document.getElementById('modify-header').textContent = 'Creating new Item';\n create_form('meat_shop_item','content-div');\n}", "function addPunches(e) {\n e.preventDefault();\n\n if (\n $employee.value.trim() === '' ||\n $jobNo.value.trim() === '' ||\n $customer.value.trim() === '' ||\n $task.value.trim() === '' ||\n $jobDesc.value.trim() === '' ||\n $task.value.trim() === ''\n ) {\n alert('Please add all job info before adding punch');\n } else {\n const punch = {\n id: 1,\n employee: $employee.value,\n jobNo: $jobNo.value,\n cust: $customer.value,\n task: $task.value,\n notes: $jobDesc.value,\n start: `${punchDate}`,\n end: '',\n };\n\n punches.push(punch);\n console.log(punches);\n\n addPunchDOM(punch);\n\n $employee.value = '';\n $jobNo.value = '';\n $customer.value = '';\n $task.value = '';\n $jobDesc.value = '';\n }\n}", "function handleSubmit() {\n addExercise(exercise);\n hide();\n }", "function addObj() {\n\n // Input Area Values\n const type = inputType.value; // inc or exp\n const text = inputDescription.value; // description\n const value = parseInt(inputValue.value); // value\n\n // Check if input is empty\n if( text && value ) {\n if (type === 'inc') {\n let id = incId;\n addItem(type, id, text, value);\n // Add to INC Array\n INC.push({\n type: type,\n id: id,\n description: text,\n value: value\n });\n // Increment List Item Id\n incId++;\n // Update Local Storage\n localStorage.setItem(\"INCOME\", JSON.stringify(INC));\n } else if (type === 'exp') {\n // Check if expense value is less than budget\n if (value <= budget) {\n let id = expId;\n addItem(type, id, text, value);\n // Add to EXP Array\n EXP.push({\n type: type,\n id: id,\n description: text,\n value: value,\n });\n // Increment List Item Id\n expId++;\n // Update Local Storage\n localStorage.setItem(\"EXPENSE\", JSON.stringify(EXP));\n } else alert(\"This expense exceeds your available budget.\");\n }\n\n // Clear the input area\n inputDescription.value = \"\";\n inputValue.value = \"\";\n } else alert(\"Please enter a valid value and description.\");\n\n // Update Summary Area\n updateDisplay();\n\n}", "[CREATE_EXPERIENCE](state, {experience}) {\n state.experiences.push(experience)\n }", "addGoal(request, response) {\n const userId = request.params.id;\n const newGoal = {\n id: uuid(),\n date: request.body.dateOnly,\n weight: Number(request.body.weight),\n chest: Number(request.body.chest),\n thigh: Number(request.body.thigh),\n upperArm: Number(request.body.upperArm),\n waist: Number(request.body.waist),\n hips: Number(request.body.hips),\n description: request.body.description,\n status: 'Open',\n };\n goalStore.addGoal(userId, newGoal);\n goalStore.store.save();\n logger.debug('New Goal = ', newGoal);\n response.redirect('back');\n }", "function submit() {\n api.create_travel_date(props.form);\n // Clear and close the form afterward\n cancel();\n }", "function adopt(){\n mainSection.innerHTML += adoptForm\n const adoptButton = document.getElementById('adopt-submit')\n adoptButton.addEventListener('click', adoptA)\n hideNameDiv()\n}", "function handleFormSubmit(event) {\r\n debugger;\r\n event.preventDefault();\r\n debugger;\r\n console.log(\"!!!!!!!!!!! category \" + formObject.category + \" itemName \" + formObject.itemName)\r\n if (formObject.category && formObject.itemName) {\r\n API.saveMenu({\r\n category: formObject.category,\r\n itemName: formObject.itemName,\r\n ingredientsUrl: formObject.ingredientsUrl\r\n })\r\n .then(res => loadMenus())\r\n .catch(err => console.log(err));\r\n } else {\r\n alert('Please fill in values for category and item name')\r\n }\r\n }", "function addAction() {\n\t\t\t\t\t\t\t// if (window.confirm(\"Add this book to your collection?\")) {\n\t\t\t\t\t\t\t\tlet bound = this;\n\t\t\t\t\t\t\t\tbound.innerHTML = \"Please Wait...\";\n\t\t\t\t\t\t\t\tbound.setAttribute(\"style\", \"background-color:grey;\");\n\t\t\t\t\t\t\t\tajaxFunctions.ready(ajaxFunctions.ajaxRequest('POST', addLink, 8000, function (err, data, status) {\n\t\t\t\t\t\t\t\t\tif (err) { console.log(err); bound.innerHTML = \"Error\"; }\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t//handle the server response\n\t\t\t\t\t\t\t\t\t\tbound.setAttribute(\"style\", \"background-color:green;\");\n\t\t\t\t\t\t\t\t\t\tbound.innerHTML = \"Added\";\n\t\t\t\t\t\t\t\t\t\t// console.log(data);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\t// }//alert box\n\t\t\t\t\t\t}//addAction\t", "function place(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tdocument.getElementById('submitButton').style.opacity=0.3;\n\t\t\t\tcheckoutID=document.getElementById('checkoutID').value;\n\t\t\t\tid=sessionStorage.shopID;\n\t\t\t\tverifyCheckoutID(id,checkoutID)\n\t\t\t\t.then(function(){\n\t\t\t\t\tupdate(id,checkoutID)\n\t\t\t\t\t.then(function(){\n\t\t\t\t\t\tconsole.log('updated');\n\t\t\t\t\t})\n\t\t\t\t\t.catch(function(){\n\n\t\t\t\t\t})\n\t\t\t\t\tlocation.reload();\n\t\t\t\t})\n\t\t\t\t.catch(function(){\n\t\t\t\t\tdocument.getElementById('submitButton').setAttribute(\"data-toggle\",\"modal\");\n\t\t\t\t\t$(\"#myModal\").modal(\"show\");\n\t\t\t\t});\n\t\t\t\tdocument.getElementById('submitButton').style.opacity=1;\n\n\t\t\t}", "function addToList(cakeId, cakeName, quantity, selectedText , price, description, productImage) {\n const item = {\n cakeId: cakeId, \n cakeName: cakeName,\n quantity: quantity, \n weight: selectedText, \n price: price, \n description: description,\n productImage: productImage\n }\n formList.push(item);\n console.log(formList);\n// clear the form for the next input \n clearForm();\n console.log(`Total Submission: ${formList.length}`.formList);\n}", "function handleSubmit(e) {\n // function to create a new contact and then close the model\n e.preventDefault();\n createContact(idRef.current.value,nameRef.current.value);\n closeModal();\n\n // create contact\n }", "function addcity() {\n if (!inuse) {\n let cell = document.getElementById(\"addcell2\");\n cell.innerHTML = \"<form action='adminaccountaction.php' method='post'>Entrez le nom du village :<br><br><input type='hidden' name='action' value='addcity'><input type='text' name='city'><br><br><input class='editbutton' type='submit' value='Valider'></form>\";\n inuse = true;\n }\n}", "function saveNewOp() {\n let newEntry = {\n date: new Date().toJSON(),\n cat: pageDialog.category.value,\n amount: pageDialog.amount.value,\n desc: pageDialog.desc.value\n };\n entriesDb.insert(newEntry);\n displayEntries();\n }", "addNew() {\n this.props.addMember();\n this.toggleCircle(document.getElementById('new-member-circle'));\n this.toggleFormDisplay();\n }", "function addLead(props) {\n // las props se las pasa useForm al momento de pasarlo como callback dentro de handleSubmit\n firestore.collection(\"leads\").add(props); // pasa el objeto de nuestros 'inputs' ya validados como objeto a la colleccion\n }", "function showAddCommitmentForm() {\n vm.form.data = {\n category: null,\n question: null,\n name: null,\n description: null,\n status: null,\n dueDate: null\n };\n vm.form.title = \"Add Commitment\";\n vm.form.onSave = vm.add;\n vm.form.onClose = vm.form.show = false;\n\n vm.form.show = true;\n }", "function addOrcamentoServicoIseg(){\r\n\tsubmitFormAjax('#formOrcServIseg', getContextApp()+'/orcamentoSegAuto/addOrcamentoServicosIseg.action', '#servicosIseg');\r\n}", "function onClickAdd() {\n console.log(\"add clicked\");\n const elementType = $(\"#add-select\").val();\n console.log(\"submited a new element of type\", elementType);\n if (elementType === \"element\") {\n setError(\"select an element\");\n } else {\n createActionRow({ elementType });\n }\n}", "function add() {\r\n DlgHelper.AjaxAction(\"/schedule/add/\", \"POST\", function (data) {\r\n\r\n if (data != null && data != \"\") {\r\n refresh().done(function () { DlgHelper.ShowDialogSuccess(\"Добавлено: \" + data, 1000); });\r\n } else {\r\n DlgHelper.ShowDialogError(\"Неверный ввод...\", 2000);\r\n }\r\n\r\n });\r\n }", "function handleAddNewStep(newStepP, pipeline, formFields, stageId) {\n var selected = document.querySelector('input[name=\"newStepType-' + stageId + '\"]:checked');\n var name = $('#newStepName-' + stageId).val();\n newStepP.popover('toggle');\n if (selected) {\n if (!name) {\n name = \"New Step\";\n }\n var newStep = {\"type\": selected.value, \"name\": name};\n var insertResult = wf.insertStep(pipeline, stageId, newStep);\n writeOutChanges(pipeline, formFields);\n refreshStepListing(stageId, insertResult.stepContainer.steps);\n lines.autoJoinDelay(pipeline, 0); // redraw immediately ... no delay\n openEditor(pipeline, insertResult.actionId, formFields); \n }\n}", "function storeOpportunityDetails(opportunityObj){\n\tlocalStorage.konyOpportunityDetails = opportunityObj; //storing the corresponding opportunity details in localstorage\n\tchangePage('opportunitydetailspage','');\n}" ]
[ "0.6300899", "0.62147105", "0.614248", "0.6083525", "0.6043832", "0.6037407", "0.599555", "0.593057", "0.5916525", "0.5902061", "0.5891479", "0.58699584", "0.5858776", "0.5852538", "0.5845648", "0.5829874", "0.581555", "0.58027345", "0.58021337", "0.57887286", "0.5767238", "0.5759246", "0.57429236", "0.57411534", "0.57387924", "0.5736007", "0.57357854", "0.5718943", "0.5712277", "0.57119757", "0.5709213", "0.5686318", "0.568342", "0.5680284", "0.56777036", "0.5674591", "0.56731164", "0.56679076", "0.5665387", "0.56649154", "0.56640714", "0.566197", "0.56580144", "0.56520146", "0.5650377", "0.5647721", "0.5644065", "0.56420505", "0.5637855", "0.56333697", "0.5629913", "0.56252635", "0.56199574", "0.5619613", "0.5618178", "0.561779", "0.56115705", "0.56033117", "0.5595375", "0.5593995", "0.5587096", "0.5564518", "0.55641335", "0.5563918", "0.5562283", "0.5557537", "0.55571127", "0.5556643", "0.55453277", "0.5537736", "0.5535259", "0.5531587", "0.55266243", "0.5516216", "0.55138355", "0.55088764", "0.55037975", "0.5501629", "0.5497388", "0.54955274", "0.54950243", "0.54910165", "0.54896456", "0.5477458", "0.5475882", "0.5473637", "0.54657775", "0.5457089", "0.5455468", "0.54532903", "0.545176", "0.5450584", "0.5448396", "0.544344", "0.5443009", "0.5432264", "0.54250896", "0.5424981", "0.54215926", "0.54213744" ]
0.5937096
7
CONSTRUCTOR Inputs: Name of database document and it's respective schema Notes: Possible schemas can be found here:
function RPC_Model(schemaName, schemaJSON) { this.schema = schemaJSON; this.mongooseModel = mongoose.model(schemaName, new Schema(this.schema)); this.schemaName = schemaName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Database(name) \n{\nthis.tables = {};\nthis.name = name;\n}", "schema() { }", "constructor(schemaChange, name, schema, parent, dialog) {\n this.schemaChange = schemaChange;\n this.name = name;\n this.schema = schema;\n this.parent = parent;\n this.dialog = dialog;\n }", "defineSchema() {\n\n }", "function Schema(id, firstName, lastName, title){\n this.id = id;\n this.firstName = firstName;\n this.lastName = lastName;\n this.title = title;\n}", "constructor(db, name) {\n if (db) {\n this.getStore = db.loadStore;\n this.scheme = db.dbScheme[name];\n this.db = db;\n }\n this.name = name;\n }", "constructor(db_name=\"PoliticianInfo\"){\r\n\t\tthis.db_name = db_name;\r\n\t\tthis.db_connection = null;\r\n\t}", "_setupSchema(schema) {\n if (!schema) {\n throw new Meteor.Error('collectionFast._setupSchema',\n 'Must provide a schema in options.');\n }\n this.schema = new SimpleSchema(schema);\n this.attachSchema(this.schema);\n }", "constructor(database, pgschema, user, trans) {\n this.database = database;\n this.pgschema = pgschema;\n this.user = user;\n this.trans = trans;\n }", "constructor(database, pgschema, user, trans) {\n this.database = database;\n this.pgschema = pgschema;\n this.user = user;\n this.trans = trans;\n }", "constructor(database, pgschema, user, trans) {\n this.database = database;\n this.pgschema = pgschema;\n this.user = user;\n this.trans = trans;\n }", "constructor(database, pgschema, user, trans) {\n this.database = database;\n this.pgschema = pgschema;\n this.user = user;\n this.trans = trans;\n }", "function Database(){}", "constructor(database, pgschema, user) {\n this.database = database;\n this.pgschema = pgschema;\n this.user = user;\n this.cats = ['A', 'M'];\n }", "_initSchema() {\n this.version(1).stores({\n pages: 'url, *terms, *titleTerms, *urlTerms, domain',\n visits: '[time+url], url',\n bookmarks: 'url, time',\n tags: '[name+url], name, url',\n })\n\n // ... add versions/migration logic here\n\n // Set up model classes\n this.pages.mapToClass(Page)\n this.visits.mapToClass(Visit)\n this.bookmarks.mapToClass(Bookmark)\n this.tags.mapToClass(Tag)\n }", "static get schema() {\n return {\n name: { type: 'string' },\n version: { type: 'string' },\n description: { type: 'string' },\n authors: { type: 'array' },\n }\n }", "function SchemaCollection(parent){\n Node.call(this,parent);\n this.nodeType = 'SchemaCollection';\n this._schemas = {};\n}", "setSchema(schema) {\n this.schema = schema;\n }", "setSchema(schema) {\n this.schema = schema;\n }", "constructor(dbName = '') {\n this.db = null;\n this.dbName = dbName;\n }", "constructor() {\n //instanciar el nombre de la colleccion de este schema\n this.collection = 'users';\n //instancia de mongolib para utilizar sus funcionalidades\n this.mongoDB = new MongoLib();\n }", "constructor(link, schema) {\n this.schema = {}\n this.link = link;\n this.leader_field = \"LDR\";\n if (schema !== {}){\n this.setSchema(schema);\n this.loaded = true;\n } else {\n this.loaded = false;\n }\n console.log(this.schema)\n\t}", "constructor(database) {\n this.database = database;\n }", "function init(dbName, dbOldVersion, dbVersion, dbSchema, successCallback, failureCallback) {\n\n if (typeof window.openDatabase === \"undefined\") {\n alert(\"Your browser doesn't support a stable version of WebSQL.\");\n return false;\n }\n\n this.dbName = dbName;\n this.dbOldVersion = dbOldVersion;\n this.dbVersion = dbVersion;\n\n // CG - We deliberatly set an empty value for the version so that it defaults to 0, and therefore we know to populate it on creation.\n // We also by default set the database size to be the maximum value without requiring additional user permission (5 MB)\n db = window.openDatabase(dbName, \"\", \"\", 5 * 1024 * 1024);\n\n // If the version is empty then we know it's the first create so set the version\n // // and populate\n if (db.version.length == 0) {\n db.changeVersion(\"\", dbVersion);\n createDatabase(dbSchema, successCallback, failureCallback);\n } else if (db.version == dbOldVersion) {\n // We can upgrade but in this example we don't!\n alert(\"upgrading database\");\n } else if (db.version != dbVersion) {\n // Trouble. They have a version of the database we\n // cannot upgrade from\n alert(\"incompatible database version\");\n return false;\n }\n\n\n }", "constructor (db) {\n super(db);\n }", "constructor (db) {\n super(db);\n }", "createSchema() {\n this.schema = this.extensionManager.schema;\n }", "constructor(database, pgschema, user, trans) {\n this.database = database;\n this.pgschema = pgschema;\n this.user = user;\n this.trans = trans;\n\n this.breakdown = [];\n }", "constructor(collection_name, organisation_id) {\n // Set Write Endpoint\n this.DB_WRITE_URL = DATABASE.ZC_CORE_DB_WRITE;\n\n // Set Read Endpoint\n this.DB_READ_URL = DATABASE.ZC_CORE_DB_READ;\n\n this.DB_DELETE_URL = DATABASE.DELETE_URL;\n\n // Set the default values for the DB operations\n this.DB_DEFAULTS_CONFIG = {\n plugin_id: DATABASE.PLUGIN_ID,\n organization_id: organisation_id,\n // Set the name of the collection to use\n collection_name,\n bulk_write: false,\n object_id: '',\n filter: {},\n options: {},\n payload: {},\n };\n }", "function Schema(descriptor) {\n\t\t this.rules = null;\n\t\t this._messages = _messages2.messages;\n\t\t this.define(descriptor);\n\t\t}", "function Schema(descriptor){this.rules=null;this._messages=_messages2.messages;this.define(descriptor);}", "function Schema(descriptor){this.rules=null;this._messages=_messages2.messages;this.define(descriptor);}", "function Schema(descriptor){this.rules=null;this._messages=_messages2.messages;this.define(descriptor);}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = _messages2.messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n\t this.rules = null;\n\t this._messages = _messages2.messages;\n\t this.define(descriptor);\n\t}", "function Schema(descriptor) {\n\t this.rules = null;\n\t this._messages = _messages2.messages;\n\t this.define(descriptor);\n\t}", "function Schema(descriptor) {\n\t this.rules = null;\n\t this._messages = _messages2.messages;\n\t this.define(descriptor);\n\t}", "function Schema(descriptor) {\n\t this.rules = null;\n\t this._messages = messages;\n\t this.define(descriptor);\n\t}", "function Schema1(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n }", "function createSchema(db) {\n\t var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'});\n\t db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true})\n\t .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n\t db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});\n\t db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false});\n\t db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n\t\n\t // added in v2\n\t docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\t\n\t // added in v3\n\t db.createObjectStore(LOCAL_STORE, {keyPath: '_id'});\n\t\n\t // added in v4\n\t var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n\t {autoIncrement: true});\n\t attAndSeqStore.createIndex('seq', 'seq');\n\t attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n\t }", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n }", "constructor() {\n // The name of this collection.\n this.name = 'UserTransportationCollection';\n // Define the Mongo collection.\n this.collection = new Mongo.Collection(this.name);\n // Define the structure of each document in the collection.\n this.schema = new SimpleSchema({\n transport: {\n type: String,\n allowedValues: UserTransportationTypeEnum.Array,\n },\n date: Date,\n miles: Number,\n mpg: { type: Number, optional: true },\n userID: String,\n }, { tracker: Tracker });\n // Attach the schema to the collection, so all attempts to insert a document are checked against schema.\n this.collection.attachSchema(this.schema);\n // Define names for publications and subscriptions\n this.userPublicationName = `${this.name}.publication.user`;\n this.adminPublicationName = `${this.name}.publication.admin`;\n // TODO: might have to write publication method for different types of publication if needed\n // Can make a get function for the collection name, then use that with publish method\n this.communityPublicationName = `${this.name}.publication.community`;\n }", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n }", "function DBModel(modelname) {\n this.init(modelname);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages;\n this.define(descriptor);\n}", "function createSchema(db) {\n var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'});\n db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});\n db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false});\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n\n // added in v2\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n // added in v3\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'});\n\n // added in v4\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }", "constructor({ fieldpath, schema, deserializedDefault = [], serializedDefault = [] }) {\n super({ fieldpath, deserializedDefault, serializedDefault });\n this.schema = schema;\n this.schemaKeys = Object.keys(this.schema);\n }", "function DB(name) {\n\t\tthis.name = name;\n\n\t\tthis.columnNames = {};\n\n\t\tthis.rows = [];\n\t\tthis.columns = [];\n\n\t\tthis.updates = {};\n\n\t\tScuttlebutt.call(this, id);\n\t}", "function connect(schema) {\n _opts.url = schema + '.json';\n let _schema = {};\n _modelsPath = schema.replace('/_schemas', '/db/');\n\n if (h.isValidPath(schema + '.json')) {\n _schema.url = schema + '.json';\n _schema.content = require(_schema.url);\n _self._schema = _schema;\n if (_schema.content) {\n _self = loadCollections(_schema.content, _self);\n }\n\n return _self;\n } else {\n throw new Error(`The schema url:\n [${_opts.url}]\ndoes not seem to be valid. Recheck the path and try again`);\n }\n}", "fillDb() {\n if (this.options.before) this.options.before();\n this._schemaRecursuveAdd('', this.schema);\n if (this.options.after) this.options.after();\n }", "function initializeZSchema () {\n ZSchema = new ZSchema({\n breakOnFirstError: true,\n noExtraKeywords: true,\n ignoreUnknownFormats: false,\n reportPathAsArray: true\n });\n}", "constructor(db) {\n this.db = db\n }", "constructor(db) {\n this.db = db;\n }", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages_messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages_messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages_messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages_messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages_messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages_messages;\n this.define(descriptor);\n}", "function Schema(descriptor) {\n this.rules = null;\n this._messages = messages_messages;\n this.define(descriptor);\n}", "function RelationDatabase() {\n this._referenceCounter = 1;\n this._tableCollection = {};\n this._dummyRecords = new DummyRecords();\n }", "constructor(dbUrl) {\n //TODO\n this.dbUrl = dbUrl;\n dbName = dbUrl.substring(dbUrl.lastIndexOf('/') + 1, dbUrl.length);\n }", "function createSchema(db) {\n var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'});\n db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});\n db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false});\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n\n // added in v2\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n // added in v3\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'});\n\n // added in v4\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }", "function createSchema(db) {\n var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'});\n db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});\n db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false});\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n\n // added in v2\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n // added in v3\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'});\n\n // added in v4\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }", "function createSchema(db) {\n var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'});\n db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});\n db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false});\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n\n // added in v2\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n // added in v3\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'});\n\n // added in v4\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }", "function createSchema(db) {\n var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'});\n db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});\n db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false});\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n\n // added in v2\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n // added in v3\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'});\n\n // added in v4\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }", "function createSchema(db) {\n var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'});\n db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});\n db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false});\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n\n // added in v2\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n // added in v3\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'});\n\n // added in v4\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }", "function createSchema(db) {\n var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'});\n db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});\n db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false});\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n\n // added in v2\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n // added in v3\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'});\n\n // added in v4\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }", "function createSchema(db) {\n var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'});\n db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});\n db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false});\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n\n // added in v2\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n // added in v3\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'});\n\n // added in v4\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }", "function createSchema(db) {\n var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'});\n db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});\n db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false});\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n\n // added in v2\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n // added in v3\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'});\n\n // added in v4\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }", "function createSchema(db) {\n var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'});\n db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});\n db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false});\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n\n // added in v2\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n // added in v3\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'});\n\n // added in v4\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }", "function createSchema(db) {\n var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'});\n db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});\n db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false});\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n\n // added in v2\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n // added in v3\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'});\n\n // added in v4\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }", "function createSchema(db) {\n var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'});\n db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true})\n .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true});\n db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});\n db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false});\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n\n // added in v2\n docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false});\n\n // added in v3\n db.createObjectStore(LOCAL_STORE, {keyPath: '_id'});\n\n // added in v4\n var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE,\n {autoIncrement: true});\n attAndSeqStore.createIndex('seq', 'seq');\n attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true});\n }", "static get CoreSchema() {\r\n if (!_CoreSchema) {\r\n log.info(`Define the schema for ${MODEL_NAME}`);\r\n _CoreSchema = new mongoose.Schema({\r\n corename: String,\r\n corecode: Number,\r\n coreemail: String,\r\n dateCreated: { type: Date, default: Date.now },\r\n dateUpdated: { type: Date, default: Date.now }\r\n });\r\n }\r\n\r\n return _CoreSchema;\r\n }", "setupSchema() {\n\t\tfor (const type in this.Definition) {\n\t\t\tif (this.Definition.hasOwnProperty(type)) {\n\t\t\t\t// console.log(type);\n\t\t\t\tconst typeDef = this.Definition[type];\n\t\t\t\tthis.Schema[type] = oas.compile(typeDef);\n\t\t\t}\n\t\t}\n\t\tfor (const type in this.precompiled) {\n\t\t\tif (this.precompiled.hasOwnProperty(type)) {\n\t\t\t\t// console.log(type);\n\t\t\t\tconst typeDef = this.precompiled[type];\n\t\t\t\tthis.Schema[type] = typeDef;\n\t\t\t}\n\t\t}\n\t}", "function Database(data) {\n this.filename = 'dbfile_' + (0xffffffff * Math.random() >>> 0);\n if (data != null) {\n FS.createDataFile('/', this.filename, data, true, true);\n }\n this.handleError(sqlite3_open(this.filename, apiTemp));\n this.db = getValue(apiTemp, 'i32');\n this.statements = {};\n }", "static get schema() {\n return {\n name: { type: 'string' },\n kit: { type: 'string' },\n }\n }" ]
[ "0.6363567", "0.62926126", "0.62822217", "0.6174474", "0.59703773", "0.5856925", "0.57536894", "0.5697396", "0.5690447", "0.5690447", "0.5690447", "0.5690447", "0.56524354", "0.56306463", "0.5626977", "0.56176347", "0.56159234", "0.5583266", "0.5583266", "0.5579682", "0.5563654", "0.55368966", "0.5518407", "0.55153334", "0.54637396", "0.54637396", "0.54480904", "0.537234", "0.53583884", "0.53480595", "0.53447974", "0.53447974", "0.53447974", "0.5337802", "0.5337802", "0.5337802", "0.5337802", "0.5337802", "0.5337802", "0.5337802", "0.5337802", "0.5337802", "0.5337802", "0.53285414", "0.53285414", "0.53285414", "0.5315368", "0.5314007", "0.53027815", "0.53025323", "0.5295807", "0.52926457", "0.52905416", "0.52904326", "0.52904326", "0.52904326", "0.52904326", "0.52904326", "0.52904326", "0.52904326", "0.52904326", "0.52904326", "0.52904326", "0.52904326", "0.52904326", "0.52904326", "0.52904326", "0.52904326", "0.5286278", "0.52835655", "0.52803004", "0.5268812", "0.5246831", "0.52405775", "0.5238264", "0.52324295", "0.52228504", "0.52228504", "0.52228504", "0.52228504", "0.52228504", "0.52228504", "0.52228504", "0.52039665", "0.5197791", "0.51884514", "0.51884514", "0.51884514", "0.51884514", "0.51884514", "0.51884514", "0.51884514", "0.51884514", "0.51884514", "0.51884514", "0.51884514", "0.51828325", "0.5182357", "0.5173991", "0.5169413" ]
0.5317921
46
Simple Response return for most Mongoose callback functions
function defaultResponseReturn(Response, instance) { return function(err, instances) { var result = instances || instance; if(err) { Response(err); } else { Response(null, result); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getCandidate(req,res){\n var return_response = { \"status\": null, \"message\": null, \"data\": {} } \n try {\n const doc = await Candidate.find({});\n return_response.status = 200;\n return_response.message = \"Success\";\n return_response.data = doc;\n } catch (error) {\n return_response.status = 400;\n return_response.message = String(error);\n }\n res.json(return_response);\n}", "function mongoCallback(res, err, responses, success) {\n\tif (err) {\n\t\tconsole.log(err);\n\t\tfor (var key in responses) {\n\t\t\tif (key == err.code) {\n\t\t\t\tres.json(responses[key]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tres.send(err); //catchall\n\t\tconsole.log(\"Unexpected mongo error: \" + err);\n\t\treturn;\n\t}\n\tres.json(success);\n}", "function basicResponder(res) {\n return function (err, data) {\n if (err) {\n res.json(500, err);\n } else {\n res.json(data);\n }\n }\n}", "function saveAndRespond(doc, msg, res) {\n doc.save();\n res.status(200).json({ message: msg, \n data: doc});\n}", "getAllPeople(req, res, next){\n Person.find({})\n .exec(function(err, people){\n if(err){\n res.send('error has occured');\n } else {\n console.log(people);\n //next(people);\n res.json(people);\n }\n });\n }", "function getAllByUser(req, res, next) {\n Model.find({ userId: req.userId }).\n then((doc) => {\n const resObj = new ResponseObject(\n resMessage.successMessage,\n doc\n );\n res.json(resObj);\n }).\n catch((err) => {// connection errors\n res.statusCode = 500;\n err.message = resMessage.connectionError;\n next(err);\n })\n}", "find(req, res) {\n User.findById({\n _id: req.params.id\n })\n .then(doc => {\n res.json(doc)\n }).catch(err => {\n res.json(err)\n })\n }", "getPersonInfo(req, res, next){\n Person.findOne({\n firstname: req.params.firstname\n })\n .exec(function(err, person){\n if(err){\n res.send('error occured');\n } else {\n console.log(person);\n res.json(person);\n }\n });\n }", "function find(req, res) {\n\n}", "async getAllVendeurs(req, res) { \n try { \n const vendeurCollection = await vendeur.findAll() \n res.status(201).send(vendeurCollection); \n console.log(vendeurCollection);\n } catch (e) { \n console.log(e); \n res.status(500).send(e); \n } \n }", "function index(req,res){\n Producto.find({})\n .then(producto => {\n if(producto.length) return res.status(200).send({producto});\n return res.status(500).send({message: 'NO CONTENT'});\n }).catch(error => res.status(500).send({error}));\n}", "show(req, res) {\n User.find({})\n .then(docs => {\n res.json(docs)\n }).catch(err => {\n res.json(err)\n })\n }", "function Response () {\n this.render = function (status, path, parent, name, cb) {\n express.render(status, path, parent, name, cb);\n };\n this.renderComponent = function (cb, parent, style, scripts) {\n express.renderComponent(cb, parent, style, scripts);\n };\n this.filterContent = function (element, options, cb) {\n express.filterContent(element, options, cb);\n };\n this.redirect = function (url) {\n location.replace(url);\n };\n }", "async listing() {\n try {\n const user = await Users.findAll();\n return this.res.send({ status: 1, message: i18n.__(\"SUCCESS\"),data:user });\n } catch (error) {\n console.log(error);\n this.res.send({ status: 0, message: i18n.__('SERVER_ERROR') });\n }\n}", "ok (res) {\r\n return (data) => res.json(data)\r\n }", "async index(req,res){\n allRestaurents = await User.find();\n return res.json(allRestaurents);\n }", "function success(err, req, res) {\n console.log(req);\n console.log(res);\n }", "getAllUsers(req, res) {\n User.find({})\n .select('-__v')\n .then(dbUserData => res.json(dbUserData))\n .catch(err => {\n console.log(err);\n res.sendStatus(400);\n });\n }", "getAll(request, response, next) {\n this.model.find({}, (err, data) => {\n if (err) {\n return next(err);\n }\n response.json(data);\n });\n }", "function responder(res) {\n return function respond(err, data) {\n if (err) {\n var status = err.status || 500\n console.error(err);\n res.status(status).json({ error: { message: \"Something went wrong.\", timestamp: Date.now(), info: err }, data: data });\n } else {\n res.status(200).json({ error: null, data: data })\n }\n };\n}", "getThoughtById({\n params\n }, res) {\n Thought.findOne({\n _id: params.id\n })\n .select(\"-__v\")\n .then(thoughtData => {\n if (!thoughtData) {\n return res.status(404).json({\n message: \"This ID is not in our database\"\n });\n }\n res.json(thoughtData);\n })\n .catch(err => {\n console.log(err);\n res.status(500).json(err);\n })\n }", "getAllUsers(req, res) {\n User.find({})\n .then(dbUserData => res.json(dbUserData))\n .catch(err => {\n console.log(err);\n res.status(400).json(err);\n });\n }", "async show(req,res){\n const response = await UserGit.find();\n if(response.length === 0){\n return res.status(204).json({error: 'Not gitusers'});\n }\n return res.json(response);\n \n }", "getById(req, res) {\n this.Model\n .findByPk(req.params.id)\n .then(item => {\n return Response.create(res, 0, item);\n })\n .catch(err => {\n return Response.create(res, -1, err);\n });\n }", "function getResults(req, res){\n let posts = db.get('posts').value()\n res.write(JSON.stringify(posts))\n}", "static async getOne(req, res) {\n const info = await UserModel.find({ _id: req.params.id });\n return res.send(info);\n }", "getAll(req, res){\n console.log(\"getAll method executed\");\n\n //if you pass in no arguments, it finds everything\n Joke.find()\n .then( (jokes) => {\n res.json(jokes);\n })\n .catch( (err) => {\n res.json(err);\n })\n }", "index(request, response) {\n Book.find({}) // to find all documents, use an empty object\n .then(books => response.json(books))\n .catch(error => response.status(Http.MovedPermanently).json(error));\n }", "static indexGet(req, res) {\n // Set a good status\n res.status(200);\n // Set our content type out\n res.type('application/json');\n // Prepare a response object\n const pingResponse = {\n ping: 'OK',\n timestamp: Math.floor(new Date().getTime() / 1000.0),\n };\n // Respond\n res.send(JSON.stringify(pingResponse));\n }", "static async onGet(req, res) {\n const id = req.params.id\n try {\n const response = await Request.findById(id)\n return res.json(response)\n } catch (err) {\n console.log(err)\n return res.status(400).json(err)\n }\n }", "_createResponseModel() {\n\n }", "findOne(req,res){\n let id = req.params.id;\n res.status(200).json(\n {\n sucess: true,\n messages: 'Estructura base GET ONE',\n errors: null,\n data: [{}, {}, {}]\n }\n );\n }", "function getone_contenido(req, res){\n Contenido.findById(req.params.contid, function(err, oneContenido)\n { \n if(err){\n console.log(err);\n res.sendStatus(500);\n return\n }\n return res.send(oneContenido);\n \n })\n \n }//function btacket ", "static async getStatus(req, res) {\n if (!req.params.id) {\n return res.error('Invalid id supplied');\n }\n\n try {\n const payment = await Payment.findOne({\n 'payment_gateway_response.transaction_id': req.params.id,\n });\n if (!payment) {\n return res.error('Item with id not found', 404);\n }\n\n return res.success(payment);\n } catch (err) {\n return res.error(err.message);\n }\n }", "getThoughtbyId({ params }, res) {\n Thoughts.findOne({ _id: params.id })\n .then(dbThoughtsData => {\n if(!dbThoughtsData) {\n res.status(400).json({message: 'Oh my...no thought found'});\n return;\n }\n res.json(dbThoughtsData);\n })\n .catch(err => {\n console.log(err);\n res.status(400).json(err);\n });\n }", "function _getChallengeById(req, res, next) {\n var json = {};\n var query = { \"_id\": new ObjectID(req.query.challengeId) };\n CHALLENGE_COLLECTION.findOne(query, function (err, challenge) {\n console.log(\"challenge : \" + challenge.length);\n if (err) {\n json.status = '0';\n json.result = { 'Error': JSON.stringify(err) };\n res.send(json);\n } else {\n json.status = '1';\n json.challenge = challenge;\n console.log(\"JSON : \" + JSON.stringify(json));\n res.send(json);\n }\n });\n}", "function getMyposts(req, res) {\n\n Mypost.find({},(err, mypost)=> {\n if (err) {\n return res.status(500).send({ menssage: 'error al realizar la peticion' })\n } else if (mypost.length==0) {\n return res.status(404).send({ menssage: 'No se encontro nada' })\n } else {\n res.json(mypost)\n \n }\n })\n}", "async index(req, res) {\n try {\n let fields = await bdMemberModel.find().exec();\n return res.status(200).send({ status: true, data: fields});\n }\n catch (err) {\n return self.handleError(res, err);\n }\n }", "getAll(req, res) {\n this.Model\n .findAll()\n .then(items => {\n return Response.create(res, 0, items);\n })\n .catch(err => {\n return Response.create(res, -1, err);\n });\n }", "getThoughtById({ params }, res) {\n Thought.findOne({ _id: params.id })\n .then(dbThoughtData => res.json(dbThoughtData))\n .catch(err => {\n console.log(err)\n res.sendStatus(400)\n })\n }", "static async getResult(req, res) {\n const studentDomain = new StudentDomain();\n studentDomain.getResult(req, res);\n }", "function get(req, res, next) {\n Song.find({}, (err, songs) => {\n if (err) {\n next(err);\n }\n const returnedSongs = [];\n songs.forEach((song) => {\n returnedSongs.push(song.transform());\n });\n return res.json(returnedSongs);\n });\n }", "function Status(req, res) {\n\t\tres.json({\n\t\t\tstatus: true\n\t\t});\n}", "async handleResponse () {\n\t\t// we have a special case for an error writing to the database ... rather\n\t\t// than return some vague internal error that we normally would on a database\n\t\t// error, inform the client that the provided parameter was invalid\n\t\tif (\n\t\t\tthis.gotError &&\n\t\t\tthis.gotError.code === 'MDTA-1000' &&\n\t\t\ttypeof this.gotError.reason === 'object' &&\n\t\t\t(\n\t\t\t\tthis.gotError.reason.name === 'MongoServerError' ||\n\t\t\t\tthis.gotError.reason.name === 'MongoError'\n\t\t\t)\n\t\t) {\n\t\t\tthis.warn(JSON.stringify(this.gotError));\n\t\t\tthis.gotError = this.errorHandler.error('invalidParameter');\n\t\t}\n\t\tif (this.gotError) {\n\t\t\treturn await super.handleResponse();\n\t\t}\n\t\tthis.responseData = { team: this.updateOp };\n\t\tawait super.handleResponse();\n\t}", "index(request, response){\n Cake.find({})\n .then(cakes => response.json(cakes))\n .catch(error => response.status(Http.InternalServerError).json(error))\n }", "async getDessert(req,res){\r\n const dessert = await Dessert.find();\r\n if(dessert) return res.status(200).json({dessert});\r\n else return res.status(404).json({error: \"Not found\"});\r\n }", "async viewOne(req, res) {\n const data = await getQuery.findUsersId(req.params.id);\n if (data.err) {\n res.status(200).send(\"Somthing wrong\");\n }\n if (data.length > 0) {\n userDetails = {\n status: 200,\n data: data,\n message: \"User find\"\n };\n res.status(200).send(userDetails);\n } else {\n res.status(200).send(\"Record not Fond\");\n }\n }", "getReactionById({ params }, res) {\n Reaction.findOne({ _id: params.id })\n .then((dbReactionData) => res.json(dbReactionData))\n .catch((err) => {\n console.log(err);\n res.sendStatus(400);\n });\n }", "_getDocument(req, res, next) {\n const documentId = req.params.id\n this.engine.getDocument(documentId, function(err, jsonDoc, version) {\n if (err) return next(err)\n res.json({\n data: jsonDoc,\n version: version\n })\n })\n }", "getAllUsers(req, res) {\n // get all method\n User.find({})\n // leave __v out of selection\n .select(\"-__v\")\n // return all user data\n .then((dbUserData) => res.json(dbUserData))\n // catch error if exists\n .catch((err) => {\n console.log(err);\n res.status(400).json(err);\n });\n }", "function getStatus(req, res) {\n\tres.sendStatus(200);\n}", "index(request, response) {\n Resttask.find({})\n .then(resttask => response.json(resttask))\n .catch(error => response.json(error));\n }", "getAllThoughts(req, res) {\n Thought.find({})\n .select(\"-__v\")\n .then(thoughtData => {\n res.json(thoughtData);\n })\n .catch(err => {\n console.log(err);\n res.status(500).json(err);\n });\n }", "getArticles () {\n console.log('in get articles server_api')\n let self = this\n Article.find(function (err, articles) {\n if (err) {\n self.res.send(err)\n }\n self.res.send(articles)\n })\n }", "function rootRes(req,res,next) { res.json({\"status\" : \"running\"}); return next()}", "function index(req,res){\n Analistas.find({})\n .then(analistas => {\n if(analistas.length) return res.status(200).send({analistas});\n return res.status(500).send({message: 'NO CONTENT'});\n }).catch(error => res.status(500).send({error}));\n}", "admin_add (req, res) {\n\n ConfigModel(req.body).save(function(err,resData){\n if (err) return res.json({resStatus:'error', msg : AppMessages.SERVER_ERR});\n return res.json({resStatus:'success', msg : \"Successfull Saved\", result: resData});\n });\n\n }", "postHero(req, res, next) {\n var db = new Hero(req.body);\n var response = {};\n db.save(function (err) {\n if (err) {\n response = { \"error\": true, \"message\": err };\n }\n else {\n response = { \"error\": false, \"message\": \"Data added\" };\n }\n res.json(response);\n });\n }", "get(req, res) {\n const { id } = req.params;\n\n return Document.find({ _id: id })\n .then((documents) => res.json(documents))\n .catch((err) => res.send(err));\n }", "allUser(req, res){\n User.find()\n .then( users =>{\n let data = users.map( user =>{\n let lastname = user.fullname.split(' ')[0];\n let firstname = user.fullname.split(' ')[1];\n return {\n userId: user._id,\n lastname: lastname,\n firstname: firstname,\n initials: `${lastname[0].toString().toUpperCase()}.${firstname[0].toString().toUpperCase()}`,\n email: user.email,\n createdAt: user.createdAt,\n updatedAt: user.updatedAt\n }\n });\n res.status(200).json({\n error: false,\n message: `users fetched successfully`,\n totalCount: users.length,\n respone: data\n });\n })\n .catch( error =>{\n res.status(400).json({\n error: true,\n message: `error occured: ${error}`\n });\n });\n }", "insertUser() {\n console.log(\"inside controller\");\n let _this = this;\n let data = this.req.body;\n\n //_this.res.status(200).send({res: 'done'});\n\n Users.insertUser(data, function(err, data){\n console.log(err);\n if(err) _this.res.status(500).send(err.errmsg);\n\n return _this.res.status(200).send({message: \"User added successfully\",\"status\":\"1\"});\n });\n }", "function mongoError(res, err) {\n if (err) console.error('mongo error ->', err);\n return res.status(500).send('internal server error')\n}", "static getAllUsers(req, res){\n User.find((err, users) => {\n if (err) return res.json({ success: false, error: err });\n return res.json({ success: true, data: users });\n });\n }", "static async getUsersById(req,res){\n const id = parseInt(req.params.id)\n const user = await Users.findById(id).select('-__v') //find from monoDb user collection\n if(!user) return res.status(404).send(\"User not found\") //error if user is not available\n res.send(user) \n }", "async getById(req,res) {\r\n try { \r\n const product = await Product.findById(req.params.id);\r\n if(!product) return res.status(204).send() //si no \"No Content\"\r\n res.send({message: 'Successful search', product});\r\n } catch (error) {\r\n console.error(500) \r\n res.send({message:'There was a problem trying to get the product'});\r\n }\r\n }", "function respondV3(req, res, next) {\n res.status(200).send('ok v3');\n}", "function exportRawAPIResponse (req, res, next) {\n return function (error, response, body) {\n if (!error) {\n res.type('json');\n res.send(body);\n\n } else {\n next(error);\n }\n };\n}", "static defaultEndpoint(req : $Request, res : $Response) {\n res.json({\n version: '1.0',\n });\n }", "retrieve(req, res) {\n\n return User\n .findById(req.params.id, {})\n .then(user => {\n\n if (!user) {\n\n return res.status(404).send({\n message: 'User Not Found',\n });\n }\n\n return res.status(200).send(user);\n })\n .catch(error => res.status(400).send(error));\n }", "async index(req,res){\n try {\n const {email} = req.body;\n //TODO: Email Validation\n const user =await userModel.findOne({email})\n if(!user){\n return res.status(204);\n }\n\n return res.status(200).json(user);\n } catch (error) {\n return res.status(500).json({path: req.path, message: 'Server error', method: req.method })\n }\n }", "create(req, res) {\n res.sendStatus(501);\n }", "function findHandler(err, docs, res, url) {\n if (!err) {\n // Return Success & JSON Content-type\n var length = docs.length;\n writeMeta(res,200,url,length);\n\n // Process results from Mongo\n docs.forEach(function(e,i,a) {\n delete e._id;\n res.write(JSON.stringify(e)+'\\n');\n });\n res.end('\\n');\n } else {\n getHandlerError(res,url);\n }\n}", "async function getDocument(req, res, next){\n\n document.findAll({ attributes: ['name'] })\n .then(document => {\n res.status(200).send(document)\n })\n .catch(err => {\n res.status(400).send(e);\n })\n}", "function getPublication(req,res){\n var publicationId = req.params.id;\n Publication.findById(publicationId,(err,publication)=>{\n if(err) return res.status(500).send({message: 'Error al devolver publicaciones'});\n\n if(!publication) return res.status(404).send({message: 'No existe la publicacion'});\n\n res.status(200).send({publication});\n });\n\n}", "async getAllPatisseries(req, res) { \n try { \n const patisserieCollection = await patisserie.findAll() \n res.status(201).send(patisserieCollection); \n console.log(patisserieCollection);\n } catch (e) { \n console.log(e); \n res.status(500).send(e); \n } \n }", "readProducts(req, res) {\n Product.find({}).exec((err, products) => {\n //Always do a couple of console.logs just in case of errors.\n if (err) console.log(\"Get Product Mongoose Error------------------\", err);\n //Always log the data you are returning from the database to check if you are receiving the right data.\n //console.log(\"products-------------\", products);\n\n res.status(200).json(products);\n });\n }", "async getNotes(req, res) {\n try {\n //get the particular collection\n const notes = await Notes.findOne({ ID: req.params.ID });\n //return the notes\n return res.status(200).json({ notes });\n } catch (error) {\n //return error if any\n return res.status(400).json({ error: error.message });\n }\n }", "function success(req, res) {\n res.status(200).json({\n message: `field ${req.body.rule.field} successfully validated.`,\n status: \"success\",\n data: {\n validation: {\n error: false,\n field: req.body.rule.field,\n field_value: req.body.data[req.body.rule.field],\n condition: req.body.rule.condition,\n condition_value: req.body.rule.condition_value\n }\n }\n });\n }", "function response(obj) {\n resp.writeHead(200, {'Content-Type': 'application/json' });\n resp.write(JSON.stringify(obj));\n resp.end();\n }", "async getAll(req, res) {\r\n try { \r\n const products = await Product.find();\r\n res.send({message: 'Successful search', products});\r\n } catch (error) {\r\n console.error(500) \r\n res.send({message:'There was a problem trying to get products'});\r\n }\r\n }", "async getAllUsersBirthday(req, res) {\n //your logic here\n const data = await User.find().select([\"birthdate\"]);\n console.log(data);\n return data;\n }", "async function addCandidate(req,res){\n var return_response = { \"status\": null, \"message\": null, \"data\": {} } \n try {\n let opt = req.body;\n const candidate = new Candidate(opt);\n const doc = await candidate.save();\n return_response.status = 200;\n return_response.message = \"Candidate added successfully\";\n return_response.data = doc;\n } catch (error) {\n return_response.status = 400;\n return_response.message = String(error);\n }\n res.json(return_response);\n}", "list(req, res) {\n return res.status(HTTP_OK).json(simpleDatabase)\n }", "createOne(req, res) {\n this.sendNotFound(req, res);\n }", "create(req, res) {\n\n\t}", "indexAction(req, res) {\n this.jsonResponse(res, 200, { 'message': 'Default API route!' });\n }", "async findAll(req,res){\n try{\n const results = await Company.find();\n return res.ok(results);\n }\n catch(err){\n return res.serverError(err);\n }\n }", "async index({response}){\n const userData = await Database.select('username', 'email').from('users');\n\n return response.status(201).json(userData);\n }", "processResponse(obj, runner) {\n const resp = obj.response;\n if (obj.output) return obj.output.call(runner, resp);\n if (obj.method === 'raw') return resp;\n if (resp.command === 'SELECT') {\n if (obj.method === 'first') return resp.rows[0];\n if (obj.method === 'pluck') return map(resp.rows, obj.pluck);\n return resp.rows;\n }\n if (\n resp.command === 'INSERT' ||\n resp.command === 'UPDATE' ||\n resp.command === 'DELETE'\n ) {\n return resp.rowCount;\n }\n return resp;\n }", "static async index() {\n try {\n let users = await UserModel.find();\n return {\n status: 200,\n data: {\n data: users,\n message: \"Users list found successfully!\"\n }\n };\n } catch (error) {\n return ErrorHandler.handleError(error);\n }\n }", "getAlertById(req, res, next) {\n try {\n alertModel.findById(req.params.id, (err, document) => {\n if (err) {\n res.json({ success: false, data: err });\n }\n res.status(200).json({ success: true, data: document });\n });\n } catch (err) {\n next(err);\n }\n }", "static getSingleStudent(req, res) {\n const findStudent = students.find(student => student.id === parseInt(req.params.id, 10));\n if (findStudent) {\n return res.status(200).json({\n student: findStudent,\n message: \"A single student record\",\n });\n }\n return res.status(404).json({\n message: \"Student record not found\",\n });\n }", "getThoughtById({params}, res){\n // Mongoose .findOne() method to find a single thought by its id\n Thought.findOne({_id: params.id})\n .select('-__v')\n .then(dbThoughtData => {\n if(!dbThoughtData){\n // if can't find thought by id send 404 status back to alert users that it doesn't exist\n res.status(404).json({message: \"Cannot find a thought with that id\"});\n return\n }\n res.json(dbThoughtData)\n })\n .catch(err=>{\n console.log(err)\n res.status(400).json(err);\n })\n }", "async findOne(req,res){\n try{\n const admi = await Company.findOne(req.params.id);\n return res.ok(admi);\n }\n catch(err){\n res.serverError(err);\n }\n }", "function create() {\n return new Response();\n}", "async ConsultarConta(req, res){\n return res.json('criado com sucesso'); \n}", "show(req, res) {\r\n // Finds a single book by its ID using the `findById()` method from Sequelize\r\n Book.findById(req.params.id)\r\n // Sends back the book as a JSON response with a 200 status code\r\n .then(function (book) {\r\n res.status(200).json(book);\r\n })\r\n // Sends back an error as a JSON response with a 500 status code\r\n .catch(function (error){\r\n res.status(500).json(error);\r\n });\r\n }", "getUserById({ params }, res) {\n User.findOne({ _id: params.id })\n .then(dbUserData => {\n // If no user is found, send 404\n if (!dbUserData) {\n res.status(404).json({ message: 'No user found with this id!' });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => {\n console.log(err);\n res.status(400).json(err);\n });\n }", "function getPersonen(req, res) {\n var person = {\n vorname: 'Elon',\n name: 'Musk',\n geburtsdatum: '1971-06-28',\n ermaessigung: 'halbtax'\n };\n res.json(person);\n}", "getPost(req, res) {\n this.postService.getPost(req).then(postResponse => {\n if (postResponse.errors) {\n return res.status(postResponse.status).json(postResponse);\n }\n return res.status(postResponse.status).json(postResponse);\n });\n }", "getThoughtById({params}, res) {\n const myID = params.id.slice(1) \n thoughts.findOne({ _id: myID })\n .then(dbThoughtData => res.json(dbThoughtData))\n .catch(err => res.json(err)); \n }" ]
[ "0.62141603", "0.61339843", "0.60500145", "0.60341483", "0.5882048", "0.5822877", "0.5742801", "0.5732723", "0.57326907", "0.5690335", "0.5683713", "0.5670946", "0.56653136", "0.5656011", "0.56333697", "0.56306106", "0.5628055", "0.5620923", "0.5591995", "0.5553789", "0.5552645", "0.5544119", "0.5542631", "0.5527614", "0.5521581", "0.551962", "0.5513834", "0.5496268", "0.5493074", "0.5468218", "0.54639834", "0.54629797", "0.54611176", "0.54527974", "0.54524255", "0.5449878", "0.54498124", "0.5448812", "0.54458994", "0.5435744", "0.5431441", "0.5428808", "0.54285645", "0.5427482", "0.54262924", "0.5415305", "0.54047203", "0.5391357", "0.53844625", "0.53839666", "0.53837067", "0.53762454", "0.5368437", "0.53649867", "0.5357227", "0.5356835", "0.5353577", "0.53493685", "0.5333138", "0.53265715", "0.5325288", "0.5321297", "0.5316053", "0.53076285", "0.5306209", "0.53011096", "0.5289291", "0.52824944", "0.5281629", "0.5280119", "0.527818", "0.527717", "0.5271018", "0.52672595", "0.5261659", "0.5261634", "0.52585006", "0.5258027", "0.5252772", "0.52473146", "0.52443564", "0.5243541", "0.5241933", "0.5236808", "0.5234773", "0.5232695", "0.5232551", "0.52307546", "0.52269757", "0.52252537", "0.52223647", "0.5220286", "0.52193207", "0.5218935", "0.52164096", "0.5214678", "0.5213442", "0.5212386", "0.52102685", "0.52095556", "0.52089757" ]
0.0
-1
Write your code! Canvas where your game will be played!
function initCanvas(width, height){}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw(){\r\n // We define the background color, the sky\r\n context.fillStyle = \"#c0e5f1\";\r\n // We define the x- and y-Position (top-left corner) of the background\r\n context.fillRect(0, 0, canvas.width, canvas.height);\r\n // Call the \"Draw Background\" function\r\n background.draw();\r\n // Call the \"Draw Woods\" function\r\n woods.draw();\r\n // Call the \"Draw Foreground\" function\r\n foreground.draw();\r\n // Call the \"Draw Critter\" function\r\n critter.draw();\r\n // Call the \"Draw Menu\" function\r\n menu.draw();\r\n // Call the \"Draw gameOver\" function\r\n gameOver.draw();\r\n // Call the \"Draw Score\" function\r\n score.draw();\r\n}", "function draw() {\n // calculate the center coordinates of the canvas.\n var center = [(canvas.width / 2), (canvas.height / 2)];\n\n // draw the application name string.\n ctx.font = \"32pt Arial\";\n ctx.fillText(\"HTML5 BREAKOUT\", center[0], center[1] - 200);\n\n // draw the number of players selection instruction strings.\n ctx.font = \"24pt Arial\";\n ctx.fillText(\"Controls:\", center[0], center[1] - 100);\n ctx.fillText(\"[spacebar] launch a ball\", center[0], center[1] - 50);\n ctx.fillText(\"[left-arrow] move left\", center[0], center[1]);\n ctx.fillText(\"[right-arrow] move right\", center[0], center[1] + 50);\n ctx.fillText(\"Press [1] to start a 1 player game\", center[0], center[1] + 150);\n ctx.fillText(\"Press [2] to start a 2 player game\", center[0], center[1] + 200);\n }", "function draw() {\n // background for display\n background (255, 255, 255);\n\n // Set up instructions for when player experience begins and ends\n switch (masterpiece) {\n case \"TITLE\":\n displayTitle();\n break;\n\n case \"GAME\":\n displayGame();\n break;\n\n case \"GAME OVER\":\n displayGameOver();\n break;\n }\n\n // create mural to frame game\n image(mural,width/2,height/2,windowWidth,windowHeight);\n}", "display() {\n // game title\n this.canvas[1].font = \"30px Arial\";\n this.canvas[1].fillText('Classic Arcade Game',10,40);\n this.canvas[1].font = \"20px Arial\";\n this.canvas[1].fillText('- build with ECMAScript 6',10,65);\n this.canvas[1].fillText('- Game Engine by Raghavendra Mani',220,this.canvas[0].height-10);\n // game status\n this.canvas[1].font = \"20px Arial\";\n this.canvas[1].fillText('Active Monsters: '+this.activeEnemies.length,this.canvas[0].width*0.6,25);\n this.canvas[1].fillText('Game status: '+this.status(),this.canvas[0].width*0.6,50);\n this.canvas[1].fillText('Moves: '+this.score,this.canvas[0].width*0.6,75);\n this.canvas[1].fillText('Tries: '+this.tries,this.canvas[0].width*0.8,75);\n // game instructions\n this.instructions();\n // warning messages\n this.warning();\n }", "function drawPlayArea() {\n\n // get the canvas\n const c = document.getElementById(\"playAreaCanvas\");\n const ctx = c.getContext(\"2d\");\n\n // clear the canvas\n ctx.clearRect(0, 0, c.width, c.height);\n\n // draw the canvas\n drawAllBlocksToPlayArea(ctx);\n\n }", "function draw() {\n background(0);\n\n if(state === `title`){\n push();\n fill(255);\n textSize(60);\n text(`MADELEINE`, width/2, height/3);\n pop();\n\n madeleine.display();\n }\n else if(state === `instructions`){\n\n push();\n fill(255);\n text(`Welcome to 'Madeleine'.\n\n\n\n\n Survive the levels to pass onto the next challenge.\n Solve the puzzles to surpass them.\n\n When in a level, press SPACEBAR at anytime to open up the Tips Table.\n Certain levels require your input through microphone; choose wisely whether ot not to allow the web page access to your audio :)\n Remember, all levels are timed.\n\n For your own safety, please keep your volume on the medium-lower end.\n Or blast the volume bar up and enjoy bleeding ears; it is your choice, after all.`, width/2, height/2);\n pop();\n }\n\n}", "function draw() {\n // menggambar dicanvas sekaligus aksi\n drawShip();\n drawEnemy();\n drawPeluru();\n \n // aksi tembak\n tembak();\n \n // update score & lives board\n update();\n}", "startGame() {\r\n\t\tthis.board.drawHTMLBoard();\r\n\t\tthis.activePlayer.activeToken.drawHTMLToken();\r\n\t\tthis.ready = true;\r\n\t}", "function enBlanco(){\n let canvas = document.querySelector(\"#myCanvas\");\n let context = canvas.getContext(\"2d\");\n ctx.fillStyle = \"white\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n }", "function moveGame() {\n $('body').prepend('<center><canvas id=\"myCanvas\"></canvas><!--</br><span style=\"font-size:17; font-weight:bold;\">All design credits go to Merryawe.<span></br></br>--></center>');\n //$('.cbalink').remove();\n }", "function doCanvas(ctx, canvas) {\n /* draw something */\n ctx.fillStyle = '#f90';\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n ctx.fillStyle = '#fff';\n ctx.font = '60px sans-serif';\n ctx.fillText('Code Project', 10, canvas.height / 2 - 15);\n ctx.font = '26px sans-serif';\n ctx.fillText('Click link below to save this as image', 15, canvas.height / 2 + 35);\n }", "drawCanvas() {\n\n\t}", "function draw() {\n\n\n\n}", "function draw() {\n \n\n \n}", "function draw() {\n\n ctx.clearRect( 0, 0, canvas.width, canvas.height);\n\n scoreDraw();\n scoreLine();\n apple.draw();\n snakeDraw();\n appleCollision();\n snakeCollision();\n document.onkeydown = function(e) { \n arrowKeys(e);\n slowMotion(e); \n togglePlay(e);\n };\n}", "function winScreen() {\n\tctx.fillStyle = \"#0000FF\";\n\tctx.fillRect(0,0,canvas.width,canvas.height);\n\tctx.fillStyle = \"#FFFFFF\";\n\tctx.fillRect(canvas.width/2 - 120,320,240,140);\n\tctx.font = \"72px Arial\";\n\tctx.fillText(\"GAME OVER\", 60, 160);\n\tctx.fillText(\"WINNER\", 100, 260);\n\tctx.font = \"48px Arial\";\n\tctx.fillStyle = \"black\";\n\tctx.fillText(\"REPLAY\", 200, 400);\n}", "drawWinScreen() {\n ctx.fillStyle = \"#aade9b\";\n ctx.fillRect(\n 2.2 * BLOCK_SIZE,\n 2.2 * BLOCK_SIZE,\n GAME_CANVAS_WIDTH - 4.4 * BLOCK_SIZE,\n GAME_CANVAS_HEIGHT - 4.4 * BLOCK_SIZE\n );\n ctx.drawImage(this.winCharacter, BLOCK_SIZE * 3, BLOCK_SIZE * 2.5, BLOCK_SIZE * 6, BLOCK_SIZE * 6);\n ctx.fillStyle = \"#620200\";\n ctx.font = \"60px Mali\";\n ctx.fillText(\"YOU WIN\", 5 * BLOCK_SIZE, 3.5 * BLOCK_SIZE);\n ctx.font = \"30px Mali\";\n ctx.fillText(\"Amy's code is\", BLOCK_SIZE * 8, 350);\n ctx.fillText(\"free of bugs\", BLOCK_SIZE * 8, 400);\n ctx.fillText(\"and safely commited\", BLOCK_SIZE * 8, 450);\n ctx.fillText(\"to Git!\", BLOCK_SIZE * 8, 500);\n \n }", "startGame() {\n this.board.drawHTMLBoard()\n this.activePlayer.activeToken.drawHTMLToken()\n this.ready = true\n }", "function draw(){\r\n\t\t \t\tctx.clearRect(0,0,canvas.width,canvas.height);\r\n\t\t\t\t\r\n\t\t\t\tconsole.log(\"TEngine se esta ejecutando correctamente...\")\r\n\t\t\t}", "function drawGameArea() {\n // Clear the canvas below the 'Top Data Bar'\n ctx.clearRect(0, 20, canvas.width, 480);\n // Set the fill colour to black with 50% ocpacity\n ctx.fillStyle = \"rgba(0, 0, 0, 0.5)\";\n // Draw a rectangle for the next piece area\n ctx.fillRect(0, 20, 150, 170);\n // Set the font for text\n ctx.font=\"15px Arial\";\n // set the colour of the text to pure black\n ctx.fillStyle = \"rgb(0,0,0)\";\n // Draw the text 'Next Piece' in the next piece box \n ctx.fillText(\"Next Piece:\", 5, 35);\n // Set the fill colour to black with 50% ocpacity\n ctx.fillStyle = \"rgba(0, 0, 0, 0.5)\";\n // Draw a rectangle for the main game area\n ctx.fillRect(150, 20, 400, 500);\n // Draw Main game area vertical grid\n for (var i=150; i<550; i+=25) {\n ctx.beginPath();\n ctx.moveTo(i,20);\n ctx.lineTo(i,520);\n ctx.stroke();\n }\n\n // Draw Main game area horizontal grid\n for (var i=20; i<520; i+=25) {\n ctx.beginPath();\n ctx.moveTo(150,i);\n ctx.lineTo(550,i);\n ctx.stroke();\n }\n\n // Draw Sidebar Logo\n ctx.drawImage(sidebarLogo, 0, 190);\n\n // draw any blocks that exist on to the main game area\n drawTetrominosOnBoard();\n\n}", "function draw() {\n // tell p5 to print the the text string \"Hello World!\"\n // Positioning this text string at (x:30, y:30).\n text(\"Hello World!\", 30, 30)\n}", "function start(){\n canvas = document.createElement(\"canvas\");\n canvas.width = 400;\n canvas.height = 630;\n canvas.id = \"canvas\";\n canvas.style.border = \"#000000 1pt solid\";\n document.body.appendChild(canvas);\n retrieveHighScore();\n gameMenu();\n}", "instructions() {\n this.canvas[1].font = \"20px Arial\";\n this.canvas[1].fillText('Goal: Avoid the monsters. Reach the princess.',10,105);\n }", "function drawEverything() {\n //background black\n colorRect(0, 0, canvas.width, canvas.height, \"black\");\n //Winner Screen\n if (showWinScreen) {\n ctx.fillStyle = \"white\";\n ctx.font = `25px \"${fontName}\"`;\n ctx.fillText(\"Click here to Play Again\", 100, 400);\n if (playerOneScore >= winningScore) {\n ctx.fillText(\"Winner You Are!!!\", 100, 200);\n } else if (playerTwoScore >= winningScore) {\n ctx.fillText(\"Winner You Are Not!!!\", 100, 200);\n }\n return;\n }\n //draw net\n drawNet();\n //left paddle\n colorRect(10, paddleOneY, paddleThickness, paddleHeight, \"white\");\n //right paddle (computer)\n colorRect(\n canvas.width - paddleThickness - 10,\n paddleTwoY,\n paddleThickness,\n paddleHeight,\n \"white\"\n );\n //ball\n colorCircle(ballX, ballY, 10, \"red\");\n //score keeper\n ctx.font = `20px \"${fontName}\"`;\n ctx.fillText(playerOneScore, 100, 100);\n ctx.fillText(playerTwoScore, canvas.width - 100, 100);\n ctx.font = \"10px 'Press Start 2P'\";\n ctx.fillText(\"Instructions:\", 40, 540);\n ctx.fillText(\"Move mouse to control left paddle\", 40, 560);\n ctx.fillText(\"First to 3 points wins\", 450, 560);\n}", "function draw() {\n background(109, 207, 246);\n\n //states\n if (state === `title`) {\n title();\n }\n\n if (state === `simulation`) {\n simulation();\n }\n\n if (state === `howToPlay`) {\n howToPlay();\n }\n\n if (state === `win`) {\n win();\n }\n\n if (state === `lose`) {\n lose();\n }\n}", "function drawGame() \n {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n drawMain();\n }", "function draw(){\n\n //write hello world using p5 positioned at ( x: 20, y: 30 )\n text( \"Hello World!\", 300, 200);\n}", "function draw() {}", "function draw() {}", "function draw() {\n if (state === \"menu\") {\n showMenu();\n }\n if (state === \"dancing\"){\n dancingBlock();\n }\n if (state === \"howToPlay\") {\n Instructions();\n } \n}", "function initializeCanvas()\r\n{\r\n\tcanvas = document.querySelector('canvas');\r\n\tcanvas.style.display = 'block';\r\n\twidth = 800;\r\n\theight = 400;\r\n\tcanvas.width = width;\r\n\tcanvas.height = height + 100; // add an extra 100 displaying score and lives\r\n\tctx = canvas.getContext(\"2d\");\r\n}", "function draw() {\n ctx.fillStyle = \"#70c5ce\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n cloud.draw();\n pipes.draw();\n ball.draw();\n ground.draw();\n bird.draw();\n getReady.draw();\n gameOver.draw();\n score.draw();\n}", "function draw()\r\n\t{\r\n\t\t// set the draw fill style colour to black\r\n\t\tcontext.fillStyle = \"#000000\";\r\n\t\t// fill the canvas with black\r\n\t\tcontext.fillRect(0,0,canvas.width,canvas.height);\r\n\t\t// choose a font for our message\r\n\t\tcontext.font = \"40pt Calibri\";\r\n\t\t// set the draw fill colour to white\r\n\t\tcontext.fillStyle = \"#ffffff\";\r\n\t\t// draw the text at the specified position\r\n\t\tcontext.fillText(\"Hello World!\", 150, canvas.height);\r\n\t}", "draw() {\n // The script appears in the textbox\n // The text is called here so that the program immediately calls for it and not when the mouse is clicked\n $('#textbox').text(gameScript.paperScript[this.scriptPosition]);\n // The image changes based on the script position\n if (this.scriptPosition === 0) {\n image(paperStoryImages[0], 0, 0, width, height);\n } else if (this.scriptPosition === 2) {\n image(paperStoryImages[1], 0, 0, width, height);\n } else if (this.scriptPosition === 3) {\n image(paperStoryImages[2], 0, 0, width, height);\n } else if (this.scriptPosition === 4) {\n image(paperStoryImages[3], 0, 0, width, height);\n } else if (this.scriptPosition === 5) {\n image(paperStoryImages[4], 0, 0, width, height);\n } else if (this.scriptPosition === 7) {\n image(paperStoryImages[5], 0, 0, width, height);\n } else if (this.scriptPosition === 9) {\n image(paperStoryImages[6], 0, 0, width, height);\n } else if (this.scriptPosition === 10) {\n image(paperStoryImages[7], 0, 0, width, height);\n } else if (this.scriptPosition === 12) {\n image(paperStoryImages[8], 0, 0, width, height);\n } else if (this.scriptPosition === 13) {\n image(paperStoryImages[9], 0, 0, width, height);\n } else if (this.scriptPosition === 14) {\n image(paperStoryImages[10], 0, 0, width, height);\n } else if (this.scriptPosition === 16) {\n image(paperStoryImages[11], 0, 0, width, height);\n } else if (this.scriptPosition === 18) {\n image(paperStoryImages[12], 0, 0, width, height);\n } else if (this.scriptPosition === 20) {\n image(paperStoryImages[13], 0, 0, width, height);\n } else if (this.scriptPosition === 21) {\n image(paperStoryImages[14], 0, 0, width, height);\n } else if (this.scriptPosition === 23) {\n image(paperStoryImages[15], 0, 0, width, height);\n } else if (this.scriptPosition === 24) {\n image(paperStoryImages[16], 0, 0, width, height);\n } else if (this.scriptPosition === 27) {\n image(paperStoryImages[17], 0, 0, width, height);\n }\n }", "function draw()\n{\n\tcanvas.clearRect(0, 0, 1920, 1080); // clear the canvas\n\tturtle.birth(); // recreate turtle\n\tturtle.drop(); // drop it to the playground\n\t\n\t// generate code\n\twindow.LoopTrap = 1000;\n\tBlockly.JavaScript.INFINITE_LOOP_TRAP = 'if(--window.LoopTrap == 0) throw \"Infinite loop.\";\\n';\n\tvar code = Blockly.JavaScript.workspaceToCode(workspace);\n\tconsole.log(code);\n\tinterpreter = new Interpreter(code, initApi);\n\tlastBlockToHighlight = null;\n\t\n\t// execute it\n\trunning = false;\n\tpaused = false;\n\tstopped = false;\n\tdocument.getElementById(\"pause\").disabled = false;\n\tworkspace.traceOn(true);\n\tworkspace.highlightBlock(null);\n\tinterval = setInterval(step, turtle.wait);\n}", "function paintCanvas() {\n /*\n * This function paints all the game components on the canvas. This includes the background, the snake, the food, and the score\n */\n\n // Paint canvas background\n ctx.fillStyle = \"black\";\n ctx.fillRect(0, 0, boardwidth, boardheight);\n ctx.strokeStyle = \"black\";\n ctx.strokeRect(0, 0, boardwidth, boardheight);\n\n // Paint Snake\n /*\n * TODO 4: Paint the snake by iterating through the snake_array and painting each cell of the snake by calling paintCell.\n * Hint: See initSnake() for how snake_array is constructed.\n */\n for (var i = 0; i < snake_array.length; i++) {\n paintCell(snake_array[i].x, snake_array[i].y);\n }\n\n // Paint Food\n // TODO 5: uncomment the following when you finish implementing paintCell\n // Checkpoint: At the end of this step, you should be able to see the snake array in the upper and a food cell appear randomly on the canvas when you refresh.\n paintCell(food.x, food.y);\n\n // Paint score\n var score_text = \"Score: \" + score;\n ctx.fillText(score_text, 5, boardheight-5);\n\n }", "function showScoreBoard() {\n let title = level >= 15 ? 'Congrats, you won!' : 'Ah, you lost!',\n titleX = level >= 15 ? 152 : 220,\n titleY = 280,\n totalScore = level * 60 + GemsCollected.blue * 30 + GemsCollected.green * 40 + GemsCollected.orange * 50,\n scoreBoard = Resources.get('images/score-board.jpg'),\n starResource = Resources.get('images/Star.png'),\n gemBlueResource = Resources.get('images/Gem-Blue.png'),\n gemGreenResource = Resources.get('images/Gem-Green.png'),\n gemOrangeResource = Resources.get('images/Gem-Orange.png'),\n offset = 70;\n // Draw image assets\n ctx.drawImage(scoreBoard, (canvas.width - scoreBoard.width) / 2, (canvas.height - scoreBoard.height - offset) / 2);\n ctx.drawImage(starResource, 175, 260 - offset, starResource.width / 1.5, starResource.height / 1.5);\n ctx.drawImage(gemBlueResource, 180, 345 - offset, gemBlueResource.width / 1.8, gemBlueResource.height / 1.8);\n ctx.drawImage(gemGreenResource, 180, 425 - offset, gemGreenResource.width / 1.8, gemGreenResource.height / 1.8);\n ctx.drawImage(gemOrangeResource, 180, 505 - offset, gemOrangeResource.width / 1.8, gemOrangeResource.height / 1.8);\n // Draw text\n ctx.font = \"50px Gaegu\";\n ctx.fillStyle = \"#fff\";\n ctx.strokeStyle = \"#000\";\n ctx.lineWidth = 3;\n ctx.strokeText(title, titleX, titleY - offset);\n ctx.fillText(title, titleX, titleY - offset);\n ctx.font = \"45px Gaegu\";\n ctx.strokeText(level + ' x 60 = ' + level * 60, 270, 340 - offset);\n ctx.fillText(level + ' x 60 = ' + level * 60, 270, 340 - offset);\n ctx.strokeText(GemsCollected.blue + ' x 30 = ' + GemsCollected.blue * 30, 270, 420 - offset);\n ctx.fillText(GemsCollected.blue + ' x 30 = ' + GemsCollected.blue * 30, 270, 420 - offset);\n ctx.strokeText(GemsCollected.green + ' x 40 = ' + GemsCollected.green * 40, 270, 500 - offset);\n ctx.fillText(GemsCollected.green + ' x 40 = ' + GemsCollected.green * 40, 270, 500 - offset);\n ctx.strokeText(GemsCollected.orange + ' x 50 = ' + GemsCollected.orange * 50, 270, 580 - offset);\n ctx.fillText(GemsCollected.orange + ' x 50 = ' + GemsCollected.orange * 50, 270, 580 - offset);\n ctx.strokeText('_______', 270, 640 - offset);\n ctx.fillText('_______', 270, 640 - offset);\n ctx.strokeText('Total: ' + totalScore.toString(), 270, 640 - offset);\n ctx.fillText('Total: ' + totalScore.toString(), 270, 640 - offset);\n ctx.strokeText('Spacebar to restart', 170, 680);\n ctx.fillText('Spacebar to restart', 170, 680);\n }", "draw() {\n\t\t// this.mySound.start();\n\t\tthis.startSound();\n\t\tfor (let i = 0; i < this.cell.length; i++) {\n\t\t\tthis.game.context.fillStyle = 'rgb(83,83,83)';\n\t\t\tthis.game.context.fillRect(this.cell[i].x, this.cell[i].y, this.grid, this.grid);\n\t\t}\n\n\t\tif (!this.endGame()) {\n\t\t\tthis.game.context.font = '50px Arial';\n\t\t\tthis.game.context.fillStyle = 'rgb(65, 87, 185)';\n\t\t\tthis.game.context.fillText(\"Điểm của bạn là\", 350, 250);\n\t\t\tthis.game.context.font = '40px Arial';\n\t\t\tthis.game.context.fillStyle = 'red';\n\t\t\tthis.game.context.fillText(this.diem(), 490, 290);\n\t\t\tthis.endGameSound.start();\n\t\t\tthis.readLoad();\n\t\t\tthis.mySound.stop();\n\t\t\tthis.eatSound.stop();\n\t\t}\n\t\t//khoi chay am nhac o day \n\n\t}", "function draw(){\n\t\t// recupera o objeto canvas\n\t\tvar context = engine.render.context;\n\t\t// analisa o suporte pelo navegador\n\t\tif(context){\n\t\t\t//desenha o placar\n\t\t\tcontext.drawImage(texPlacar, LARGURA/2-75,0,150,40);\n\t\t\tcontext.fillStyle = \"#FFF\";\n\t\t\tcontext.font = \"30px Arial\";\n\t\t\tcontext.fillText(player1.pontuacao, LARGURA/2-55, 26);\n\t\t\tcontext.fillText(player2.pontuacao, LARGURA/2+40, 26);\n\n\n\t\t\t// caso o jogo esteja pausado, pede que o usuario pressione espaco\n\t\t\t// removendo isto, faz com que o jogo seja continuo\n\t\t\tif (estadoAtual == EstadoJogo.PAUSADO) {\n\t\t\t\tcontext.fillStyle = \"#FFF\";\n\t\t\t\tcontext.fillText(\"Pressione espaco para continuar\",300,ALTURA/2);\n\n\t\t\t\t// Define que a bola estara estacionaria\n\t\t\t\tBody.setPosition(bola, {x: LARGURA/2-7, y: ALTURA/2-7});\n\t\t\t\tBody.setVelocity(bola, {x: 0, y: 0});\n\t\t\t}\n\n\t\t}\n\n\t\t// atualiza os sprites\n\t\tbola.render.sprite.sourceX = spriteBola.getNextSourceX();\n\t\tbola.render.sprite.sourceY = spriteBola.getNextSourceY();\n\t\t//spriteBola.getNextSourceX();\n\t\t//spriteBola.render;\n\t\tpowerUp.render.sprite.sourceX = spritePowerUp.getNextSourceX();\n\t\tpowerUp.render.sprite.sourceY = spritePowerUp.getNextSourceY();\n\t}", "function drawEverything() {\n\tcolorRect(0,0,canvas.width,canvas.height,\"black\"); // background screen size and color\n\tcolorRect(player1X,player1Y,PLAYER_WIDTH,PLAYER_HEIGHT,\"green\"); // player\n\tcolorRect(enemy1X,enemy1Y,ENEMY_1_WIDTH,ENEMY_1_HEIGHT,\"red\"); // enemy 1\n\t\n\tcanvasContext.font=\"26px Helvetica\";\n\tcanvasContext.fillStyle=\"white\";\n\tcanvasContext.fillText((\"Time: \" + time.toString()), 25, 50); \n\n}", "function drawMode(){\n ctx.font = '50px serif';\n //ctx.fillText('Hello world', 50, 90);\n if (buildMode){\n ctx.fillText('Mode: Build', 10,50);\n } else {\n ctx.fillText('Mode: Attack', 10,50);\n }\n}", "function draw(){\r\n ctx.fillStyle = '#70c5ce';\r\n ctx.fillRect(0, 0, cWidth, cHeight);\r\n bg.draw();\r\n pipes.draw();\r\n fg.draw();\r\n kca.draw();\r\n bird.draw();\r\n getReady.draw();\r\n gameOver.draw();\r\n score.draw();\r\n \r\n\r\n}", "function main(){\n //cria o canvas;\n canvas = new createCanvas(600,600);\n\n height = 200;\n \n //Tamanho e massa\n r1 = 120;\n r2 = 120;\n m1 = 7;\n m2 = 7;\n\n //velocidade dos angulos\n a1_v = 0;\n a2_v = 0;\n\n //angulos\n a1 = Math.PI/1.5;\n a2 = Math.PI/1.5;\n\n px2 = 0;\n py2 = 0;\n\n frames = 0;\n\n //aceleração da gravidade\n g = 0.9;\n\n trail = [];\n\n setInterval(draw, 60);\n}", "function runProgram() {\n\t// Clear the canvas\n\tbackground(255);\n\n\t// TODO: Get the phrase in the text box and convert it to upper case\n\tvar words;\n\t//... add your code here.\n\n // Draw the Matrix\n\tdrawMatrix(words)\n}", "function draw() {\n imageMode(CORNER);\n background(bgImage);\n displaystart();\n \n // explainning screen\n if (state === \"starting\"){\n startscreen();\n }\n // playing screen\n else if (state === \"playing\"){\n gameplaying();\n }\n // showing the screen when game ends \n else if (state == \"end\"){\n gameEnded();\n }\n}", "function whiteboard_show_canvas()\n{\n\t$('#white-board .menu .draw').addClass('begin').text('Stop');\n\t$('#white-board .menu .pen').show();\n\t$('#white-board .menu .type').show();\n\t$('#white-board .menu .color').show();\n\t$('#white-board .menu .eraser').show();\n\t$('#white-board .menu .clear').show();\n\t$('#white-board .menu .pen').show();\n\t$('#white-board #canvas').show();\n}", "function draw() {\n\n //textColor changes so it has to be in draw instead of setup\n //starts as transparent clicking i turns it opaque\n textColor = color(0, 0, 0, o);\n textColor2 = color(255,255,255,o);\n\n //main screen only shows up when turning program on\n if (main === true) {\n noStroke();\n fill(0);\n textSize(16);\n text(\"Press i at any time to turn on instructions.\", 150, 175);\n text(\"Pressing i again will turn them off, if the background is white\", 150, 200);\n text(\"you will need to refresh the page by hitting the same number\", 150, 225);\n text(\"to get rid of the instructions.\", 150, 250);\n text(\"To begin press 1,2,3,4, or 5.\", 150, 275);\n \n //title whimsical\n //color changes with mouse position\n fill(mouseX%255,255-mouseY%255,187);\n stroke(0);\n textSize(100);\n text(\"w\",150,500);\n text(\"h\",205,500);\n text(\"i\",240,500);\n text(\"m\",240,500);\n text(\"s\",305,500);\n text(\"i\",335,500);\n text(\"c\",338,500);\n text(\"a\",372,500);\n text(\"l\",407,500);\n textSize(16);\n }\n \n //related to the switch case to switch between modes\n if (bubble === true) {\n bubbles(50);\n }\n if (vortex === true) {\n depth();\n }\n if (box === true) {\n boxes();\n }\n if (stacks === true) {\n stacking();\n }\n if (dots === true) {\n drawing();\n }\n}", "function draw() {\n //dynamically resize canvas to the width and height of the browser window\n createCanvas(windowWidth, windowHeight);\n //light and breezy ocean blue background\n background(200, 255, 100);\n //display the welcome screen first time around.\n welcomeScreen();\n //since we set start to false in the welcome screen, this should now be true until the\n //browser is refreshed.\n if (!gameOver && start === false) {\n //white rectangle so we can see the info displayed better\n push();\n fill(0, 0, 100);\n noStroke();\n rect(0, height - 50, width, height);\n pop();\n\n handleInput();\n\n movePlayer();\n movePrey();\n // moveDistractionFish();\n\n updateHealth();\n updateStamina();\n checkEating();\n gameLevelCheck();\n\n drawStamina();\n drawHealth();\n drawPlayerLives()\n drawLevel();\n //here we are sending the current prey from the array (heh heh heh)\n //to the drawPrey() function:\n drawPrey(preyImages[currentPrey]);\n drawPlayer();\n } else {\n showGameOver();\n }\n}", "function draw() {\n // Any addittional control code.\n handleSpeed()\n\n // Drawing code for game.\n background(0)\n fill(255, 255, 255)\n textSize(40)\n text(\"Tetris\", 340, 100)\n textSize(20)\n text(\"Score: \" + game.score, 345, 150)\n text(\"Lines: \" + game.lines, 345, 180)\n text(\"Next Piece\", 345, 250)\n reDrawGame() // Draws the tetris board.\n\n // Perform a step of the game.\n game.gameFrame()\n}", "function draw() {\n\t\t\t\tctx.fillStyle = \"black\";\n\t\t\t\tctx.fillRect(0,0,canvasWidth, canvasHeight);\n\t\t\t\tplayer.draw();\n\t\t\t\tcomputer.draw();\n\t\t\t\tball.draw();\n\t\t\t}", "function render() {\n /*\n * This function renders the canvas, is composed of painting all the components on the canvas and updating the state of the snake\n */\n\n // paint board, snake, and food\n paintCanvas();\n\n // update snake position, detects wall and food collisions\n updateSnake();\n }", "function draw()\n{\n \n}", "function draw() {\r\n\r\n //Background color.\r\n background(189, 253, 255);\r\n\r\n //This updates the Matter Engine.\r\n Engine.update(engine);\r\n\r\n //To display the platform.\r\n surface.display();\r\n\r\n //To display bricks.\r\n\r\n }", "function drawCanvas(phase) {\n\tvar c = document.getElementById(\"myCanvas\");\n\tvar ctx = c.getContext(\"2d\");\n\tctx.fillStyle = \"black\";\n\tctx.fillRect(0, 0, c.width, c.height);\n\tdrawEnvironment(\"cool\", phase);\n}", "function draw() {\n\tctx.clearRect(0, 0, W, H);\n\n\tif (modeGOT) {\n\t\tdrawPath(\"black\", 0, H * 0.1, W, H * 0.3); // GROUND up\n\t\tdrawPath(\"rgb(255,255,255)\", 0, H * 0.5, W, H * 0.6); // ROUTE\n\t\tctx.font = \"70px Lalezar\";\n\t\tctx.textAlign = \"center\";\n\t\tctx.fillStyle = \"lightgray\";\n\t\tctx.fillText(\"You\", W / 2, H * 0.6 - 10);\n\t\tctx.fillText(\"know\", W / 2, H * 0.7 - 10);\n\t\tctx.fillText(\"nothing\", W / 2, H * 0.8 - 10);\n\t\tctx.fillText(\"Jon Snow\", W / 2, H * 0.9 - 10);\n\t} else {\n\t\tsideroad.draw();\n\t\tdrawPath(\"rgb(110,110,110)\", 0, H * 0.5, W, H * 0.4); // ROUTE\n\t\tdrawLine(\"white\", 10, 0, H * 0.6, W, H * 0.6, [35, 50]); // LIGNE DE ROUTE 1\n\t\tdrawLine(\"sandybrown\", 10, 0, H * 0.7, W, H * 0.7, []); // LIGNE DE ROUTE 2\n\t\tdrawLine(\"white\", 10, 0, H * 0.8, W, H * 0.8, [35, 50]); // LIGNE DE ROUTE 3\n\t}\n\tfluid.draw(); // FLUIDE\n\tdownSide.draw(); // RIVE BAS\n\ttopSide.draw(); // RIVE HAUT\n\n\tfor (let i = 0; i < nbLives; i++) {\n\t\tlife.x = i * 70;\n\t\tlife.draw();\n\t}\n\n\t// SUPPORTS\n\t// Ressources graphiques\n\tif (modeGOT) {\n\t\tgroundImgURL = \"img/got/rock.png\";\n\t\tgroundImgURL2 = \"img/got/rock2.png\";\n\t\tgroundImgURL4 = \"img/got/rock4.png\";\n\t} else {\n\t\tgroundImgURL = \"img/lilypad.png\";\n\t\tgroundImgURL2 = \"img/lilypad2.png\";\n\t\tgroundImgURL4 = \"img/lilypad4.png\";\n\t}\n\n\t// Affichage\n\tif (frames % 200 === 0) {\n\t\tground1 = new Ground1(groundImgURL);\n\t\tgrounds1.push(ground1);\n\t}\n\n\tif (frames % 150 === 0) {\n\t\tground2 = new Ground2(groundImgURL2);\n\t\tgrounds2.push(ground2);\n\t}\n\n\tif (frames % 100 === 0) {\n\t\tground4 = new Ground4(groundImgURL4);\n\t\tgrounds4.push(ground4);\n\t}\n\n\tupdateLeftObjects(grounds1, W, 2);\n\tupdateRightObjects(grounds2, -63 * 2, -3);\n\tupdateLeftObjects(grounds4, W, 4);\n\n\tcheckLostIfDrown(frogger, 0.1 * H, grounds1);\n\tcheckLostIfDrown(frogger, 0.2 * H, grounds2);\n\tcheckLostIfDrown(frogger, 0.3 * H, grounds4);\n\n\t// FROGGER\n\tfrogger.draw();\n\n\t// OBSTACLES\n\t// Ressources graphiques\n\t// Affichage\n\tif (frames % 150 === 0) {\n\t\tif (modeGOT) {\n\t\t\trightObstacleImgURL = \"img/got/dragon_right.png\";\n\t\t\tleftObstacleImgURL = \"img/got/dragon_left.png\";\n\t\t} else {\n\t\t\trightObstacleImgURL = \"img/truck_from_right.png\";\n\t\t\tleftObstacleImgURL = \"img/truck_from_left.png\";\n\t\t}\n\n\t\trightObstacle = new RightObstacle(0.5 * H, rightObstacleImgURL);\n\t\tleftObstacle = new LeftObstacle(0.8 * H, leftObstacleImgURL);\n\n\t\trightObstacles.push(rightObstacle);\n\t\tleftObstacles.push(leftObstacle);\n\t}\n\n\tif (frames % 70 === 0) {\n\t\tif (modeGOT) {\n\t\t\trightObstacleImgURL = \"img/got/dragon_right.png\";\n\t\t\tleftObstacleImgURL = \"img/got/dragon_left.png\";\n\t\t} else {\n\t\t\trightObstacleImgURL = \"img/car_from_right.png\";\n\t\t\tleftObstacleImgURL = \"img/car_from_left.png\";\n\t\t}\n\n\t\trightObstacle = new RightObstacle(0.6 * H, rightObstacleImgURL);\n\t\tleftObstacle = new LeftObstacle(0.7 * H, leftObstacleImgURL);\n\n\t\trightObstacles.push(rightObstacle);\n\t\tleftObstacles.push(leftObstacle);\n\t}\n\n\tupdateLeftObjects(leftObstacles, W, 5);\n\tupdateRightObjects(rightObstacles, -141, -7);\n\n\tcheckLostOnHit(leftObstacles, frogger);\n\tcheckLostOnHit(rightObstacles, frogger);\n\n\t// RESULTAT\n\tif (frogger.y === 0 && !gameover) {\n\t\twin = true;\n\t\tdisplayWin();\n\t}\n\n\tif (lost) {\n\t\tdisplayLost();\n\t\tnbLives = Math.max(0, nbLives - 1);\n\t}\n\n\tif (nbLives === 0) {\n\t\tgameover = true;\n\t}\n\n\tif (gameover) {\n\t\tdisplayGameover();\n\t}\n\n\t// SCORE\n\tdisplayScore();\n}", "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n update(dt);\n render();\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n if (running) {\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n } else {\n\n hud.textElements.push({\n text: 'Press \\'Y\\' to play again.',\n lineWidth: 2,\n fillStyle: 'white',\n strokeStyle: 'black',\n font: '26pt \\'IMPACT\\'',\n position: 'center center',\n padding: 83\n });\n\n render();\n }\n }", "function draw() {\n background(255,50,150);\n\n if(state === `start`){\n intro();\n }\n else if(state === `game`){\n game();\n }\n else if(state === `win`){\n winEnding();\n }\n else if(state === `lose`){\n loseEnding();\n }\n}", "function draw() {\n Gravity();\n Animation();\n FrameBorder(); \n FrameBorderCleaner();\n Controls();\n Interaction();\n}", "function draw() {\n draw_board(board_width,board_height,board_color)\n draw_snake();\n draw_fruit();\n // console.log(\"drawing\")\n}", "function drawSingularity() {\n togglePause();\n ctx.font = '30px Ubuntu';\n ctx.strokeStyle = '#FF6600';\n ctx.textAlign = 'center';\n ctx.strokeText('You\\'ve created a singularity!', canvas.width / 2, canvas.height / 2)\n}", "function drawWin() {\n togglePause();\n ctx.font = '45px Ubuntu';\n ctx.strokeStyle = '#FF6600';\n ctx.textAlign = 'center';\n ctx.strokeText('You win!', canvas.width / 2, canvas.height / 2)\n}", "function stageMagic() {\n\t\t// create object\n\t\ttoiletMonster = new createjs.Bitmap(\"Content/images/toiletmonster.png\");\n\t\ttoiletMonster.regX = toiletMonster.getBounds().width * 0.5;\n\t\ttoiletMonster.regY = toiletMonster.getBounds().height * 0.5;\n\t\ttoiletMonster.scaleX = 0.5;\n\t\ttoiletMonster.scaleY = 0.5;\n\t\ttoiletMonster.x = screenWidth * 0.3;\n\t\ttoiletMonster.y = 30;\n\t\t// add object to stage \n\t\tstage.addChild(toiletMonster);\n\t\t\n\t\t//create object\n\t\tportfolioLabel = new createjs.Text(\"Check Out My Portfolio\", \"30px bahiana-regular\", \"#893315\");\n\t\t// set x and y coordinates for the portfolioLabel\n\t\tportfolioLabel.regX = portfolioLabel.getMeasuredWidth() * 0.5;\n\t\tportfolioLabel.regY = portfolioLabel.getMeasuredHeight() * 0.5;\n\t\tportfolioLabel.x = screenWidth * 0.5;\n\t\tportfolioLabel.y = 25;\n\t\t// add object to the stage\n\t\tstage.addChild(portfolioLabel);\n\t\t\n\t\t\n\t\t$('canvas').on(\"click\", function() {\n\t\t\tportfolioLabel.text = \"Whoa!\";\t\n\t\t}); // end portfolioLabel on click event/function\n\t\t\n\t}", "function draw() {\n if (GAMEMODE == \"MENU\") {\n //draw the backgroud\n background(45, 40, 60);\n strokeWeight(1);\n stroke(0);\n //draw the game logo\n (() => {\n fill(200);\n textSize(height * width * 0.00015);\n text('GONKA', (width / 2) - textWidth('GONKA') / 2, height / 3);\n })();\n //draw the play btn\n (() => {\n let [w, h] = [width * 0.2, height * 0.1];\n let [x, y] = [(width / 2) - w / 2, (height / 2)];\n push();\n if (!(mouseX >= x && mouseX <= x + w && mouseY >= y && mouseY <= y + h)) {\n noStroke();\n rect(x, y, w, h, 20);\n fill(45, 40, 60);\n rect(x + 5, y + 5, w - 10, h - 10, 20);\n fill(220);\n textSize(h * 0.5);\n text('PLAY', x + (w / 2) - textWidth('PLAY') / 2, y + (h / 2) + textSize() / 3);\n } else {\n noStroke();\n rect(x, y, w, h, 20);\n fill(220);\n rect(x + 5, y + 5, w - 10, h - 10, 20);\n fill(230, 20, 20);\n fill(45, 40, 60);\n textSize(h - 10);\n text('PLAY', x + (w / 2) - textWidth('PLAY') / 2, y + (h / 2) + textSize() / 3);\n }\n pop();\n })();\n //draw the credits of the game\n (() => {\n let credits = 'Coded by Stiliyan Kushev.\\nSprites, animations and soundtrack by Vencislav Nikolov';\n textSize(10);\n text(credits, 0, height - textSize() * 2);\n })();\n //draw the links buttons with the credits\n (() => {\n let scl = 50;\n let offset = 10;\n let x = width - scl / 2 - offset;\n let y = height - scl / 2 - offset;\n let w = textWidth('f');\n let h = textSize();\n if (mouseX >= x - scl / 2 && mouseX <= x + scl / 2 && mouseY >= y - scl / 2 && mouseY <= y + scl / 2) {\n if (mouseIsPressed) {\n strokeWeight(4);\n fill(200);\n stroke(200);\n ellipse(x, y, scl, scl);\n textSize(30);\n stroke(220);\n fill(66, 52, 193);\n text(\"f\", x - textWidth('f') / 2, y + textSize() / 3);\n window.location.href = \"https://www.facebook.com/stel.kushev\";\n } else {\n strokeWeight(4);\n fill(200);\n stroke(200);\n ellipse(x, y, scl, scl);\n textSize(30);\n stroke(220);\n fill(66, 52, 193);\n text(\"f\", x - textWidth('f') / 2, y + textSize() / 3);\n }\n } else {\n stroke(220);\n strokeWeight(4);\n fill(66, 52, 193);\n ellipse(x, y, scl, scl);\n textSize(30);\n stroke(200);\n fill(200);\n text(\"f\", x - textWidth('f') / 2, y + textSize() / 3);\n }\n })();\n } else if (GAMEMODE == \"RUNNING\") {\n //drawing the spots of the map\n (() => {\n translate(width / 2 - player.pos.x - player.scl / 2, height / 2 - player.pos.y - player.scl / 2);\n (() => {\n for (let rowIndex = 0; rowIndex < roomMap.length; rowIndex++) {\n for (let colIndex = 0; colIndex < roomMap[rowIndex].length; colIndex++) {\n let [x, y] = [rowIndex * SPOT_SCL, colIndex * SPOT_SCL];\n let currentSpot = roomMap[rowIndex][colIndex];\n image(graphix[currentSpot.imgSource], x, y, SPOT_SCL, SPOT_SCL);\n }\n }\n })();\n //draw all other players\n for (let otherPlayer of otherPlayers) {\n if (otherPlayer.name != username)\n rect(otherPlayer.x, otherPlayer.y, player.scl, player.scl);\n }\n\n //draw the player\n player.show();\n })();\n }\n}", "function drawCanvas () {\n var ctx = c.getContext(\"2d\");\n\n ctx.beginPath();\n ctx.rect(-10, -10, canvasWidth + 20, canvasHeight + 20);\n ctx.fillStyle = \"rgb(252, 209, 79)\"\n\n ctx.fill();\n \n\n\n ctx.font = \"30px Arial\";\n\n if (playerAlive && myCharacter != null) {\n ctx.save();\n ctx.translate(canvasWidth/2 - myCharacter.x, canvasHeight/2 - myCharacter.y);\n ctx.translate(shakeX, shakeY);\n\n ctx.drawImage(backgroundImage, -MAP_SIZE / 2, -MAP_SIZE / 2);\n\n ctx.beginPath();\n ctx.rect(-MAP_SIZE / 2, -MAP_SIZE / 2, MAP_SIZE, MAP_SIZE);\n ctx.strokeStyle = \"black\";\n ctx.globalAlpha = 0.3;\n ctx.lineWidth = 20;\n ctx.stroke();\n ctx.closePath();\n\n ctx.globalAlpha = 1;\n ctx.lineWidth = 1;\n\n\n for (var i = 0; i < holes.length; i++) {\n holes[i].display(ctx);\n }\n\n\n //ctx.fillText(\"Hello I'm a test canvas\", 10, 50);\n for (let [k, c] of characterDatas) {\n if (k != myID) {\n c.display(ctx, c.x, c.y);\n }\n }\n ctx.restore();\n\n ctx.save();\n myCharacter.display(ctx, canvasWidth / 2, canvasHeight / 2);\n ctx.restore();\n\n\n ctx.save();\n ctx.translate(canvasWidth/2 - myCharacter.x, canvasHeight/2 - myCharacter.y);\n //display all shockwaves\n for (let [k, v] of shockwaves){\n ctx.save();\n for (let [ks, s] of v){\n s.display(ctx);\n }\n ctx.restore();\n }\n ctx.restore();\n } else {\n \n }\n\n\n\n ctx.font = \"20px Arial\";\n\n if (!playerAlive && !waitingForRespawning){\n ctx.textAlign = \"center\";\n ctx.strokeText(\"You're dead! Click to respawn\", canvasWidth / 2, canvasHeight / 2);\n ctx.textAlign = \"left\";\n } else if (waitingForRespawning){\n ctx.textAlign = \"center\";\n ctx.strokeText(\"Respawning...\", canvasWidth / 2, canvasHeight / 2);\n ctx.textAlign = \"left\";\n }\n\n if (myID != -1 && characterDatas.size == 1){\n ctx.textAlign = \"center\";\n ctx.strokeText(\"Waiting for players...\", canvasWidth / 2, canvasHeight / 3);\n ctx.textAlign = \"left\";\n }\n\n if (shockwaves.get(myID) != null) {\n var ssizes = shockwaves.get(myID).size;\n if (ssizes > 0) {\n shakeX = -5 + Math.random() * 10;\n shakeY = -5 + Math.random() * 10;\n } else {\n shakeX = 0;\n shakeY = 0;\n }\n } \n \n ctx.beginPath();\n ctx.rect(canvasWidth / 32 - 12, canvasHeight / 8 - 29, 260, 90);\n ctx.fillStyle = 'rgb(140,140,140)';\n\n ctx.fill();\n\n ctx.textAlign = \"left\";\n ctx.fillStyle = 'rgb(245,245,245)';\n ctx.font = \"21px arial\";\n ctx.fillText(\"WASD to move\", canvasWidth / 32, canvasHeight / 8);\n ctx.fillText(\"Mouse to aim and shoot\", canvasWidth / 32, canvasHeight / 8 + 22);\n ctx.fillText(\"Space to jump\", canvasWidth / 32, canvasHeight / 8 + 44);\n ctx.textAlign = \"left\";\n ctx.closePath();\n}", "function drawFrame() {\n // Draw background and a border\n context.strokeStyle = \"#000000\";\n context.fillStyle = \"#d0d0d0\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.fillStyle = \"#e8eaec\";\n context.fillRect(1, 1, canvas.width-2, canvas.height-2);\n \n // Character container\n context.fillStyle = \"#ffffff\";\n context.fillRect(400, 75, 300, 370);\n if (score < (requiredscore/2)) {\n context.drawImage(status1, 400, 75, 300, 370);\n } else {\n context.drawImage(status2, 400, 75, 300, 370);\n }\n \n // Score bar\n context.lineWidth = 3;\n context.fillStyle = \"#ffffff\";\n roundRect(context, 80, 75, 270, 35, 15, true, true);\n \n // Moves left container\n circle(context, 50, 93, 17);\n \n // Draw moves remaining\n context.fillStyle = \"#003300\";\n context.font = \"20px Verdana\";\n context.fillText(movecount, 37, 100);\n \n if (scorechange > 0) {\n // Draw a speech bubble\n drawBubble(context, 500, 125, 90, 30, 5);\n context.fillStyle = \"#003300\";\n context.font = \"10px Verdana\";\n if (!successquote) {\n if (scorechange > 1) {\n successquote = getRandomFromArray(greatquotes);\n } else {\n successquote = getRandomFromArray(goodquotes);\n }\n }\n context.fillText(successquote, 510, 140);\n }\n \n context.lineWidth = 1;\n context.fillStyle = \"#00b300\";\n context.strokeStyle = \"#00b300\";\n // Draw score\n if (score >= requiredscore) {\n roundRect(context, 83, 78, 264, 29, 11, true, true);\n } else if (score > 0) {\n var scorewidth = (score/requiredscore)*(270-6);\n roundOnLeftRect(context, 83, 78, scorewidth, 29, 11, true, true);\n }\n }", "function draw() {\n platforms();\n player.Make()\n}", "function sendBlocklyCode() {\n if (!playing) {\n var code = Blockly.Generator.workspaceToCode('JavaScript');\n //alert(code);\n //--------------------------------------------------\n // error 1: no blocks on the screen\n //--------------------------------------------------\n if (code.length == 0) {\n setHtmlOpacity(\"hint1\", 1.0);\n fadeOutAfterDelay(\"hint1\", 4000);\n }\n \n else {\n var connected = checkConnections(code);\n \n //--------------------------------------------------\n // error 2: blocks aren't connected\n //--------------------------------------------------\n if (!connected) {\n setHtmlOpacity(\"hint2\", 1.0);\n fadeOutAfterDelay(\"hint2\", 4000);\n }\n \n else {\n \n code = code.replace(/\\]\\[/g, '], [');\n code = (code.replace(/\\)/g, '')).replace(/\\(/g, '');\n code = code.replace(/\\;/g, '');\n //if (socket != null && socket.readyState == 1) {\n //alert(code);\n \n //socket.send('@dart'+ CURRENT_LEVEL + '-' + CONNECTION_ID + '-' + code);\n hideAll();\n //code = '@dart'+ CURRENT_LEVEL + '#' + CONNECTION_ID + '#' + code;\n //socket.send(code);\n \n code = '@dart'+ CURRENT_LEVEL + '#' + code;\n var origin = window.location.protocol + \"//\" + window.location.host;\n \t\t\t window.postMessage(code, origin);\n \n tempImg = '';\n playing = true;\n if (CURRENT_BG != 'room') {\n \tvar bg = document.getElementById(\"rosie-output\");\t\t\n \t\t\tbg.style.background = \"url(\\'images//room.png\\')\";\n }\n //window.location.reload(true);\n //}\n }\n }\n \n }\n \n else {\n \talert(\"still generating previous outfit\");\n \n }\n }", "function CurseRoomRun() {\r\n if (Player.CanKneel() && !Player.ActivePose) CharacterSetActivePose(Player, ( window.CharacterItemsHavePose ? [\"Kneel\", \"BackBoxTie\"] : \"Kneel\"));\r\n CurseRoomLoad();\r\n CurseRoomHasCurse = typeof cursedConfig != \"undefined\";\r\n DrawCharacter(Player, !CurseRoomThrown ? 250 : 1250, 0, 1);\r\n DrawCharacter(CurseRoomAce, 750, 0, 1);\r\n DrawButton(1885, 25, 90, 90, \"\", \"White\", \"Icons/Exit.png\");\r\n DrawButton(1885, 145, 90, 90, \"\", \"White\", \"Icons/Character.png\");\r\n DrawButton(1885, 265, 90, 90, \"\", \"White\", \"Icons/Preference.png\");\r\n}", "function drawDebug() {\n ctx.font = \"11px monospace\";\n ctx.fillStyle = \"#777777\";\n //text, x position, y position\n ctx.fillText(\"DEBUG MODE\", 10, 15);\n ctx.fillText(\"upPressed: \"+upPressed, 15, 30);\n ctx.fillText(\"leftPressed: \"+leftPressed, 15, 45);\n ctx.fillText(\"rightPressed: \"+rightPressed, 15, 60);\n ctx.fillText(\"x: \"+x, 15, 75);\n ctx.fillText(\"dx: \"+dx, 15, 90);\n ctx.fillText(\"y: \"+y, 15, 105);\n ctx.fillText(\"dy: \"+dy, 15, 120);\n ctx.fillText(\"fuelout: \"+fuelout, 15, 135);\n ctx.fillText(\"landed: \"+landed, 15, 150);\n ctx.fillText(\"crashed: \"+crashed, 15, 165);\n ctx.fillText(\"landedVelocityY: \"+landedVelocityY, 15, 180);\n ctx.fillText(\"landedVelocityX: \"+landedVelocityX, 15, 195);\n ctx.fillText(\"thrustArrow: \"+thrustArrow, 15, 210);\n if (thrustArrow > gravity){\n ctx.fillText(\"Thrust is greater than gravity\", 15, 225);\n }else{\n ctx.fillText(\"Thrust less than gravity\", 15, 225);\n }\n ctx.fillText(\"MouseX = \" + canvas_x, 15, 240);\n ctx.fillText(\"MouseY = \" + canvas_y, 15, 255);\n ctx.fillText(\"WindowHeight = \" + window.innerHeight, 15, 270);\n ctx.fillText(\"WindowWidth = \" + window.innerWidth, 15, 285);\n ctx.fillText(\"levelnum = \" + levelnum, 15, 300);\n ctx.fillText(\"fuel= \" + fuel, 15, 315);\n ctx.fillText(\"shadowsize= \" + shadowsize, 15, 330);\n}", "function drawgame() {\n updateCharacter();\n drawChicken();\n drawHen();\n drawBottles();\n drawCoins();\n drawInformation();\n drawThrowBottle();\n drawFinalBoss();\n drawJumpBars();\n drawAlternatingHens();\n}", "function main() {\r\n init();\r\n draw();\r\n}", "function game() {\n update();\n paint();\n}", "paintCanvas() {\n // Draw the tile map\n this.game.map.drawMap();\n\n // Draw dropped items\n this.game.map.drawItems();\n\n // Draw the NPCs\n this.game.map.drawNPCs();\n\n // Draw the player\n this.game.map.drawPlayer();\n\n // Draw the mouse selection\n this.game.map.drawMouse();\n }", "function intro_screen(){\r\n\tcontext.font = \"50px Impact\";\r\n\tcontext.fillStyle = \"#0099CC\";\r\n\tcontext.textAlign = \"center\";\r\n\tcontext.fillText(\"GET OUT\", canvas.width/2, canvas.height/2);\r\n\r\n\tcontext.font = \"20px Arial\";\r\n\tcontext.fillText(\"Press Enter To Start ... if you dare\", canvas.width/2, canvas.height/2 + 50);\r\n}", "function startGame() {\n renderTextPhrase(roundCount);\n renderSketchpad();\n init();\n changeId('right-col', 'right-col-sketch');\n renderNextFormBtn();\n timer();\n}", "function draw() {\n \n}", "function draw() {\n background(bg);\n\n if (state === `title`) {\n title();\n }\n else if (state === `simulation`) {\n simulation();\n }\n else if (state === `love`) {\n love();\n }\n else if (state === `sadness`) {\n sadness();\n }\n else if (state === `ignored`) {\n ignored();\n }\n}", "function draw() {\n rect(200, 250, 400, 200)\n text('WELCOME!', 250, 300);\n text('THIS IS THE SNAKE GAME!!', 250, 350);\n text('TO PLAY PRESS THE W BUTTON ON YOUR KEYBOARD!', 250, 370)\n // picking a game mode (this is the unique part about the game)\n if(keyCode === 87){\n rect(200, 250, 400, 200)\n text('SELECT A MODE!', 250, 300);\n text(' EASY (e) / MEDIUM (m) / HARD (h) / INSANE(i)', 250, 350);\n }\n // E vv\n if(keyCode === 69){\n addScore = 10\n gameStart = 1\n }\n // M vv\n if(keyCode === 77){\n addScore = 15\n frameRate(15)\n gameStart = 1\n\n }\n // H vv\n if(keyCode === 72){\n addScore = 30\n frameRate(20)\n gameStart = 1\n }\n // I vv\n if(keyCode === 73){\n addScore = 50\n frameRate(30)\n gameStart = 1\n }\n if(keyCode === 82){\n addScore = 1000\n frameRate(45)\n gameStart = 1\n rageMode = true\n }\n\n // checks to see if game started\n // checks before anything if gameover is true to stop program\n if(gameStart === 1){\n background(226, 206, 231);\n if(rageMode === true){\n if(collide === true){\n frameRate(20);\n // slow it down a little\n background(226, 206, 231);\n textSize(16);\n // bigger text\n text('LOL', random(700), random(700));\n text('HAHAHAHAHAHA', random(700), random(700));\n }\n // the gameover rageMode\n background(random(255),random(255),random(255))\n // eye bleeding background ^^\n }\n food.run();\n // if there is no snake collision then continue vv\n if(collide === false){\n snake.run();\n }\n // this is checking to see if the snake intersects with food\n if(snake.loc.x === food.loc.x & food.loc.y === snake.loc.y){\n food.loc.x = round(random(40))*20\n food.loc.y = round(random(40))*20\n // gives new location ^^\n // if the food keeps spawning in the snake head it will repeat until it\n // is out vv\n while(food.loc.x === snake.loc.x & food.loc.y === snake.loc.y){\n food.loc.x = round(random(40))*20\n food.loc.y = round(random(40))*20\n }\n // now checking to see if the food appears inside of the tail vv\n for(var i = 0; i < segments.length; i++){\n if(food.loc.x === segments[i].x & food.loc.y === segments[i].y){\n food.loc.x = round(random(40))*20\n food.loc.y = round(random(40))*20\n }\n // ^^ though there is still a change that the food will appear inside\n // of the tail the chances are much slimmer now\n }\n templength = segments.length - 1\n segments.push(createVector(segments[templength].x, segments[templength.y] ))\n // this is adding score vv\n score = score + 10;\n }\n // this is where the score is displayed vv\n fill(255)\n text('Score: ' + score, 10, 20);\n // this is the end screen vv\n if(collide === true){\n if(rageMode === true){\n fill(255)\n rect(200, 250, 400, 200);\n fill(0)\n text('AHAHAHAHAH! YOU LOST!', 320, 350);\n text('Try again when you have some real skills player', 320, 370);\n // some real nice text ^^\n }\n if(rageMode === false){\n gameStart = 0\n rect(200, 250, 400, 200)\n food.loc.x = 900\n food.loc.y = 900\n fill(0)\n text('GAME OVER!', 320, 300);\n text(' YOUR SCORE WAS: ' + score, 320, 350);\n text('TO PLAY AGAIN REFRESH THE PAGE!!', 320, 370)\n if(keyCode === 13){\n // this is where you can press enter to restart the game\n setup()\n }\n }\n // the end screen for those who appreciate their eyes\n }\n }\n}", "function scoreBoard() \n {\n ctx.font = \"60px Ariel\"\n ctx.fillStyle = \"White\"\n ctx.fillText(score1, 355,170);\n ctx.fillText(score2, 415,170);\n }", "function draw() {\n image(video, 0, 0, width, height);\n // drawFlyAtNose();\n // drawGreenCircleAtBodyPart('leftWrist');\n // drawGreenCircleAtBodyPart('rightWrist');\n drawParticleSystemAtBodyPart('nose');\n}", "function drawGame() {\n // Draw Board\n drawContext(context, canvas);\n drawMatrix(board, { x: 0, y: 0 });\n drawMatrix(player.matrix, player.position);\n //Iteration 11 - Next block\n drawContext(contextNext, canvasNext);\n drawMatrix(boardNext, { x: 0, y: 0 });\n drawMatrix(nextPlayer.matrix, 0);\n}", "function game(codeWidth) {\n this.codeWidth = codeWidth;\n this.createGame = function(codeWidth) {\n for (i=0; i < 10; i++) {\n var gameLine = \"<div class='flat-line'>\";\n for (j=0; j < codeWidth; j++) {\n gameLine += \"<div class='flat-block' style='width:\" + (100/codeWidth) + \"%'></div>\"\n }\n gameLine += \"</div>\";\n $(\"div.board\").append(gameLine);\n }\n }\n this.start = function() {\n $(\"div.pre-question\").hide();\n $(\"div.game\").show();\n }\n this.clear = function() {\n $(\"div.board\").empty();\n $(\"div.game\").hide();\n $(\"div.pre-question\").show();\n }\n this.generateCode = function (codeWidth) {\n // Create the Code object\n var generatedCode = [];\n for(i=0; i < codeWidth; i++) {\n // Generate the code and push it to the array\n generatedCode.push(Math.floor((Math.random() * 6) + 1));\n }\n return generatedCode;\n }\n this.active = true;\n}", "function drawFirstScreen(){\n ctx.drawImage(titleart, 0, 0, canvas.width, canvas.height);\n \n //Player name in the bottom right\n ctx.font = \"20px Molengo\";\n ctx.fillStyle = \"#9999FF\";\t\t\t\n ctx.fillText(\"Hi there \" + playername +\"!\", 30, canvas.height - 30);\n \n ctx.fillStyle = \"#00AA00\";\n //half way, minus half of the x and y of the shape size\n ctx.fillRect((canvas.width/2)-125,(canvas.height/2)+110, 250 ,75);\n ctx.font = \"50px Molengo\";\n ctx.fillStyle = \"#FFFF00\";\n ctx.fillText(\"START\", (canvas.width/2)-70,(canvas.height/2)+165);\n //This uses the size of the canvas for y axis, and size of window for x axis (as the canvas is centralised)\n //This could be rewritten to be more like the level select code, but there is no real advantage to this (Unless you need to add more buttons, in which case it would be essential)\n if (canvas_x < (window.innerWidth/2)-125 || canvas_x > (window.innerWidth/2)+125 || canvas_y < (canvas.height/2)+135 || canvas_y > (canvas.height/2)+210){\n levelselect = false;\n }\n else{\n levelselect = true;\n }\n}", "function draw() {\n background(BG_COLOR);\n // main menu\n if (state === \"START\") {\n displayMainMenu();\n // tutorial/letter\n } else if (state === \"TUTORIAL\") {\n displayTutorial();\n // playing\n } else if (state === \"PLAY\") {\n gameBackground.display();\n // in-game message\n if (showTextBox) {\n textBox.display();\n }\n useItem(); // display item when using\n showOverlay(); // display close object when examining\n // game over\n } else if (state === \"END\") {\n displayEnd();\n if (showTextBox) {\n textBox.display();\n }\n playMusic();\n }\n}", "function draw() {\n background(wallpaper);\n\n if (state === `start`) {\n startStart();\n } else if (state === `game`) {\n gameStart();\n } else if (state === `finish`) {\n gameEnd();\n }\n}", "function draw()\n{\n}", "function drawEverything() {\n context.clearRect(0, 0, canvas.width, canvas.height);\n drawGrid();\n drawPlayer();\n drawTreasure();\n}", "function paint(ctx){\n\tctx.clearRect(0,0,canvas.width,canvas.height);//va a limpiar nuestro canvas cada vez que se ejecute la funcion\n\tctx.fillStyle='#58BF16';\n\tfor(var i=0,l=body.length;i<l;i++){//Arreglo que dibujara cada parte de nuestra Snake\n\t\t//ctx.fillRect(body[i].x,body[i].y,body[i].width,body[i].height);\n\t\tctx.drawImage(iBody,body[i].x,body[i].y);\n\t}\n\tctx.fillStyle='#E44D26';\n\t//ctx.fillRect(food.x,food.y,food.width,food.height);//toma parametros de food\n\tctx.drawImage(iFood,food.x,food.y);\n\tctx.fillStyle='#000000';\n\tctx.fillText('LastKey '+lastkey,530,20);//Nos dira que tecla estamos precionando\n\tctx.fillText('SCORE: '+score,10,20);\n\tctx.fillText('by lx',10,290);\n\t//Al inicio la el juego estara en pause asi que cada 50 milisegundos se estara imprimiento el siguiente mensaje\n\tif(PAUSE){\n\t\tctx.textAlign='center';\n\t\tif(GAMEOVER)\n\t\tctx.fillText('GameOver',300,150);\n\t\telse\n\t\t\tctx.fillText('PAUSE',300,150);\n\t\t\tctx.textAlign='left';\n\t}\n}", "function draw() {\n CANVAS_CTX.clearRect(0, 0, BOARDER_WIDTH, BOARDER_HEIGHT);\n drawBoard();\n drawPoints();\n drawPacman();\n drawGhosts();\n drawApple();\n drawTimeBonus();\n\n $('#lblScore').val(score.toString());\n}", "function draw() {\r\n \r\n}", "function draw() {\n\n if (startGame == true) {\n background(BG_COLOR);\n drawForest();\n drawTrails();\n drawBlood();\n drawHikers();\n drawBear(bearX, bearY);\n moveHikers();\n moveBear();\n hikerCollide();\n allHikers();\n gameWon();\n }\n}", "draw(){ \n \n if(level == 0){ // level 0\n\n op.play(); //title play\n\n // Intro screen\n game.ctx.fillStyle = \"Blue\";\n game.ctx.font = \"30px Helvetica\";\n game.ctx.textAlign = \"Center\";\n game.ctx.textBaseline = \"top\";\n game.ctx.fillText(\"Welcome to GoblinSlayer\", 190, 50); \n\n game.ctx.fillStyle = \"Blue\";\n game.ctx.font = \"16px Helvetica\";\n game.ctx.textAlign = \"Center\";\n game.ctx.textBaseline = \"top\";\n game.ctx.fillText(\"You are the Goblin Slayer kill all goblins and avoid dangers to win\", 50, 90);\n \n game.ctx.fillStyle = \"Blue\";\n game.ctx.font = \"16px Helvetica\";\n game.ctx.textAlign = \"Center\";\n game.ctx.textBaseline = \"top\";\n game.ctx.fillText(\"The controls of the game are: W (up), S (down), A (Left), D (Right)\", 50, 120);\n\n game.ctx.fillStyle = \"Red\";\n game.ctx.font = \"24px Helvetica\";\n game.ctx.textAlign = \"Center\";\n game.ctx.textBaseline = \"top\";\n game.ctx.fillText(\"Press enter to start\", 210, 150); \n\n if(keys[13]){ //enter\n level++;\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n } else if(gameOver) {\n\n //game over screen\n game.ctx.fillStyle = \"Red\";\n game.ctx.font = \"30px Helvetica\";\n game.ctx.textAlign = \"Center\";\n game.ctx.textBaseline = \"top\";\n game.ctx.fillText(\"Game Over!!\", 220, 120);\n\n game.ctx.fillStyle = \"Red\";\n game.ctx.font = \"20px Helvetica\";\n game.ctx.textAlign = \"Center\";\n game.ctx.textBaseline = \"top\";\n game.ctx.fillText(\"Press enter to try again\", 210, 150);\n\n if(keys[13]){ //enter\n location.reload();\n }\n } else if(win) {\n\n //winner screan\n game.ctx.fillStyle = \"Blue\";\n game.ctx.font = \"30px Helvetica\";\n game.ctx.textAlign = \"Center\";\n game.ctx.textBaseline = \"top\";\n game.ctx.fillText(\"You Win!!!!\", 220, 120);\n\n game.ctx.fillStyle = \"Blue\";\n game.ctx.font = \"20px Helvetica\";\n game.ctx.textAlign = \"Center\";\n game.ctx.textBaseline = \"top\";\n game.ctx.fillText(\"Press enter to play again\", 210, 150);\n\n if(keys[13]){ //enter\n location.reload();\n }\n } else {\n\n //print all objects\n for(let i = 0; i < this.objects.length; ++i){\n //this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n this.objects[i].draw(this.ctx); \n }\n }\n\n }", "function main()\n{\n\t//get canvas elementFromPoint\n\tcanvas = document.getElementById(\"AMC\");\n\tif(!canvas)\n\t\tconsole.log(\"Obtaining canvas from main document failed\\n\");\n\telse\n\t\tconsole.log(\"Obtaining canvas from main document succeeded\\n\");\n\t//print obtained canvas width and height on console\n\tconsole.log(\"Canvas width:\" + canvas.width +\" height:\" +canvas.height);\n\tcanvas_original_width = canvas.width;\n\tcanvas_original_height = canvas.height;\n\t\n\t\n\t//register keyboard and mouse event with window class\n\twindow.addEventListener(\"keydown\", keydown, false);\n\twindow.addEventListener(\"click\", mouseDown, false);\n\twindow.addEventListener(\"resize\", resize, false);\n\t\n\tinit();\n\tresize();\n\tdraw();\n}", "function main() {\n\t\t\t\tcanvas = document.getElementById(\"pong\");\n\t\t\t\tscore = 0;\n\t\t\t\tplaying = true;\n\t\t\t\tcanvasWidth = canvas.width;\n\t\t\t\tcanvasHeight = canvas.height;\n\t\t\t\tctx = canvas.getContext(\"2d\");\n\t\t\t\tball.init(canvasWidth/2,canvasHeight/2);\n\t\t\t\tplayer.init();\n\t\t\t\tcomputer.init(); \n\t\t\t\twindow.requestAnimationFrame(loop,canvas);\n\t\t\t}", "function draw() {\n // clears the canvas before drawing\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n drawText('white', \"24px Helvetica\", \"left\", \"top\", \"Points: \" + POINTS, 0, 0);\n drawText('white', \"24px Helvetica\", \"left\", \"top\", \"\" + powername, 0, 745);\n\n //drawing sprites\n player.draw();\n for (let b of balls) {\n b.draw();\n }\n for (let p of powerups) {\n p.draw();\n }\n for (let w of walls) {\n w.draw();\n }\n for (let m of mobs1) {\n m.draw();\n }\n}", "function setup()\n{\n //this function runs once at the start of your program\n \n //this command creates a drawing area in the browser - it should only be called once\n createCanvas(1000, 480);\n}", "function draw() {\n music.play();\n\t\tclear();\n\t \tBackground(); //sequential so need to draw this first\n Paddle();\n\t\tBoxCollision();\n\t\tPaddleCollision();\n\t\tBall(); //sequential\n Move();\n\t\tBricks();\n\t\tcollisionDetection();\n\t\tScore();\n Lives();\n pauseGame();\n}//draw", "function draw() {\n\tvar x = width / 2;\n\tvar y = height / 2;\n\tif (mouseX !== 0 && mouseY !== 0) {\n\t\tx = mouseX;\n\t\ty = mouseY;\n\t}\n\n\tbackground(0, 25);\n\tpush();\n\t\ttranslate(x, y);\n\t\trotate(frameCount / 30)\n\t\ttext(\"I'm working\", 0, 0);\n\tpop();\n}", "function main() {\n\n //Get our time delta information which is required if your game requires smooth animation.\n\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /*\n Call our update/render functions, pass along the time delta to our update function\n since it may be used for smooth animation.\n */\n update(dt);\n render();\n\n /*\n Set our lastTime variable which is used to determine the time delta\n for the next time this function is called.\n */\n lastTime = now;\n\n /*\n Use the browser's requestAnimationFrame function to call this\n function again as soon as the browser is able to draw another frame.\n If game's stop value is set to true, the game will end.\n */\n if(!game.stop){\n win.requestAnimationFrame(main);\n }\n }", "function render() {\n ctx.clearRect(0, 0, W, H);\n\n ctx.textAlign = \"center\";\n ctx.font = \"25px Arial\";\n ctx.strokeText(\"Your score is: \" + myScore, 150, 100); // show the score inside of the canvas \n\n ctx.strokeStyle = 'lime';\n for (let x = 0; x < COLS; ++x) {\n for (let y = 0; y < ROWS; ++y) {\n if (board[y][x]) {\n ctx.fillStyle = colors[board[y][x] - 1];\n drawBlock(x, y);\n }\n }\n }\n\n ctx.fillStyle = 'red';\n ctx.strokeStyle = 'lime';\n for (let y = 0; y < 4; ++y) {\n for (let x = 0; x < 4; ++x) {\n if (current[y][x]) {\n ctx.fillStyle = colors[current[y][x] - 1];\n drawBlock(currentX + x, currentY + y);\n }\n }\n }\n}", "function gameLoop() {\r\n\t//behind the scenes canvas\r\n\tctx.clearRect(0, 0, width, height);\r\n\tdrawScore();\r\n\tsnake.move();\r\n\tsnake2.move();\r\n\tif (settings.biteme) { biteMe(snake, snake2); }\r\n\tif (settings.snakebite) { snakeBite(snake, snake2); }\r\n\tsnake.draw();\r\n\tsnake2.draw();\r\n\tapple.draw();\r\n\tif (settings.applex2) { apple2.draw(); }\t\r\n}" ]
[ "0.6693262", "0.66874707", "0.65501577", "0.650644", "0.6455544", "0.6409965", "0.64060366", "0.63855106", "0.6348024", "0.6344823", "0.63080055", "0.63024414", "0.6298581", "0.6294167", "0.62838125", "0.62759155", "0.62724596", "0.62621814", "0.62555575", "0.62531465", "0.62530726", "0.6246882", "0.62285686", "0.6227581", "0.6220925", "0.621978", "0.62109554", "0.6209656", "0.6209656", "0.6208253", "0.62070954", "0.6202731", "0.6201551", "0.61916643", "0.6191599", "0.6188946", "0.61877644", "0.6187075", "0.61734706", "0.6171976", "0.61679053", "0.6152541", "0.6148125", "0.6134019", "0.6131921", "0.61288434", "0.6126596", "0.6123178", "0.6121078", "0.6120118", "0.61094284", "0.6101297", "0.6090092", "0.6089862", "0.6089099", "0.60877097", "0.60872287", "0.60848755", "0.608459", "0.60840493", "0.6082728", "0.6079482", "0.6076937", "0.6071341", "0.606879", "0.60684013", "0.606783", "0.60674244", "0.60650146", "0.606336", "0.60542566", "0.605363", "0.6051827", "0.60511297", "0.60497874", "0.60490614", "0.60486966", "0.60475373", "0.6045936", "0.6040498", "0.6039177", "0.6037201", "0.60214317", "0.60212946", "0.6018871", "0.60184026", "0.6014436", "0.60130346", "0.6012883", "0.6009929", "0.600477", "0.60034066", "0.6003244", "0.6001986", "0.6001037", "0.59990174", "0.5995899", "0.59899765", "0.59894675", "0.5984714", "0.59798044" ]
0.0
-1
Draw your maze! Where are your energy pills? How should you place them? What about power ups?
function initMaze(){}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawMaze() {\n\tvar canvas = document.getElementById(\"maze\");\n\tvar context = canvas.getContext('2d');\n\tvar i, y;\n\tcontext.strokeStyle='black';\n\tfor(y=0; y<=610; y+=10) {\t\n\t\tcontext.beginPath();\n\t\tcontext.moveTo(0,y);\n\t\tcontext.lineTo(600,y);\n\t\tcontext.lineWidth=1;\n\t\tcontext.stroke();\n\t}\n\tfor(x=0; x<=610; x+=10) {\n\t\tcontext.beginPath();\n\t\tcontext.moveTo(x, 0);\n\t\tcontext.lineTo(x, 600);\n\t\tcontext.lineWidth=1;\n\t\tcontext.stroke();\n\t}\n}", "function drawMaze() {\n for( var i = 0; i < cols; i++ ) {\n for( var j = 0; j < rows; j++ ) {\n /*\n switch( maze[i][j] ) {\n case 0: ctx.fillStyle = \"black\"; break;\n case 1: ctx.fillStyle = \"gray\"; break;\n case 2: ctx.fillStyle = \"red\"; break;\n case 3: ctx.fillStyle = \"yellow\"; break;\n case 4: ctx.fillStyle = \"#500000\"; break;\n case 8: ctx.fillStyle = \"blue\"; break;\n }\n ctx.fillRect( grid * i, grid * j, grid, grid );\n ctx.strokeStyle = ctx.fillStyle;\n ctx.strokeRect( grid * i, grid * i, grid, grid );*/\n drawBlock(i,j,maze[i][j]);\n }\n }\n}", "function drawMaze()\n{\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n var visited = [],\n rows = Math.floor(canvas.width/size),\n cols = Math.floor(canvas.height/size);\n\n ctx.fillStyle = \"#000000\";\n var rect1 = new Rectangle(0, cols*size, canvas.width, size),\n rect2 = new Rectangle(rows*size, 0, size, canvas.height);\n rect1.draw(ctx);\n rect2.draw(ctx);\n\n // Create the arrays\n for (var i=0; i < rows; i++)\n {\n grid[i] = [];\n visited[i] = [];\n for (var j=0; j < cols; j++)\n {\n grid[i][j] = false;\n visited[i][j] = false;\n }\n }\n\n // Set up the initial grid\n for (var i=0; i < rows; i+=2)\n for (var j=0; j < cols; j+=2)\n grid[i][j] = true;\n\n /*for (var i=0; i < rows; i++)\n {\n var str = \"\";\n for (var j=0; j < cols; j++)\n {\n str += grid[i][j] ? \".\" : \"X\"\n }\n\n console.log(str);\n }*/\n\n var stack = [];\n stack.push(new Point(0, 0)); // start at (x,y)\n\n while (stack.length > 0)\n {\n var loc = stack[stack.length-1],\n x = loc.x,\n y = loc.y,\n cont = false;\n\n // Fischer-Yates Shuffle: randomly weighted direction to go in\n var order = [\"up\", \"down\", \"left\", \"right\"];\n for (var i=3; i >= 0; i--)\n {\n var index = Math.floor(Math.random() * (i+1)),\n temp = order[i];\n order[i] = order[index];\n order[index] = temp;\n }\n\n // Try each direction\n for (var i=0; i < 4; i++)\n {\n switch (order[i])\n {\n case \"up\":\n if (y-2 >= 0)\n {\n if (!visited[x][y-2])\n {\n stack.push(new Point(x, y-2));\n grid[x][y-1] = true;\n visited[x][y-2] = true;\n cont = true;\n }\n }\n break;\n case \"down\":\n if (y+2 < grid[0].length)\n {\n if (!visited[x][y+2])\n {\n stack.push(new Point(x, y+2));\n grid[x][y+1] = true;\n visited[x][y+2] = true;\n cont = true;\n }\n }\n break;\n case \"left\":\n if (x-2 >= 0)\n {\n if (!visited[x-2][y])\n {\n stack.push(new Point(x-2, y));\n grid[x-1][y] = true;\n visited[x-2][y] = true;\n cont = true;\n }\n }\n break;\n case \"right\":\n if (x+2 < grid.length)\n {\n if (!visited[x+2][y])\n {\n stack.push(new Point(x+2, y));\n grid[x+1][y] = true;\n visited[x+2][y] = true;\n cont = true;\n }\n }\n break;\n default:\n }\n\n if (cont) break;\n }\n\n if (cont) continue;\n\n // if dead-end, backtrack\n stack.pop();\n }\n\n /*for (var i=0; i < rows; i++)\n {\n var str = \"\";\n for (var j=0; j < cols; j++)\n {\n str += grid[i][j] ? \".\" : \"X\"\n }\n\n console.log(str);\n }*/\n\n ctx.fillStyle = \"#000000\";\n\n /*for (var i=0; i < rows; i++)\n {\n var rect = new Rectangle(0, i*size, size, size),\n rect2 = new Rectangle(i*size, 0, size, size);\n\n rect.draw(ctx);\n rect2.draw(ctx);\n }*/\n\n for (var i=0; i < rows; i++)\n {\n for (var j=0; j < cols; j++)\n {\n if (!grid[i][j])\n {\n var rect = new Rectangle(i*size, j*size, size, size);\n rect.draw(ctx);\n }\n }\n }\n}", "function createMaze(){\n const mazeCoords1 = \n [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 50, 53, 54, 55, 78, 51, 56,\n 58, 59, 60, 61, 63, 65, 66, 67, 68, 70, 71, 72, 73, 75,76, 81, 83, 84, 85,86, 88, 90,91, 92, 93, 95, 98,\n 100,101, 103,104,105,106,108,109,110,111,115, 116, 117, 118, 120, 121, 122, 123, 125, 126, 150,151, 153, 154, 155, 156, 158, 160, 161,162, 163, 164, 165, 166, 168, 170,171,\n 172, 173, 175, 176, 178,179,180, 181, 183, 185, 186, 187, 188, 189, 190, 191 ,193, 195, 196,197, 198,\n 200, 203, 204, 205, 206, 208, 213, 218, 220, 221, 222, 223, 225, 226, 234, 235, 236, 238, 240, 241, 242,243, 252, 253, 254, 255, 256, 268, 270, 271, 272, 273, 274, 276, 281,\n 250,275,201, 251,295,291, 285, 233, 258, 283, 293, 277, 279,\n 306, 301, 326, 310, 335, 318, 308, 320, 352, 353, 354, 300, 325, 350, 375, 351, 346, 347, 348, 349,\n 376, 370, 371, 372, 373, 374, 380, 395, 310, 335, 360, 361, 365, 358, 383, 368, 393, 331, 345, 356, 381, 366, 316, 341,\n 402, 403, 404, 405, 406, 408, 420, 421, 422, 423, 424, 401, 426, 451, 476, 418, 453, 454, 455, 480, 457, 458, 459, 460, \n 461, 465, 466, 467, 468, 471, 472, 473, 410, 411, 412, 413, 414, 415, 416, 438, 463, 496,469, 400, 425, 450, 475,\n 521, 519, 538, 563, 505, 509, 510, 511, 512, 513, 514, 515, 516, 517, 500, 525, 550, 575, 501, 526, 551, 576, 355, 544, \n 553, 554, 555, 556, 557, 558,507, 532, 559, 560, 561, 565, 566, 567, 568, 569, 570, 571, 572, 573, 523, 524, 503, 502,\n 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617,618, 619, 620, 621, 622, 623, 624, 600, 625, 601\n\n ]\n mazeCoords1.map( coord =>{\n cells[coord-1].classList.add('maze')\n })\n\n //assigning custom town and environment pieces below\n cells[301].classList.add('townpieceA')\n cells[302].classList.add('townpieceB')\n cells[303].classList.add('townpieceC')\n cells[304].classList.add('townpieceD')\n cells[326].classList.add('townpieceE')\n cells[327].classList.add('townpieceF')\n cells[328].classList.add('townpieceG')\n cells[329].classList.add('townpieceH')\n\n cells[295].classList.add('townpieceA')\n cells[296].classList.add('townpieceB')\n cells[297].classList.add('townpieceC')\n cells[298].classList.add('townpieceD')\n cells[320].classList.add('townpieceE')\n cells[321].classList.add('townpieceF')\n cells[322].classList.add('townpieceG')\n cells[323].classList.add('townpieceH')\n\n cells[277].classList.add('townpieceA')\n cells[279].classList.add('townpieceD')\n cells[78].classList.add('lake1')\n cells[79].classList.add('lake2')\n cells[95].classList.add('lake1')\n cells[96].classList.add('lake2')\n cells[396].classList.add('lake1')\n cells[397].classList.add('lake2')\n cells[395].classList.add('townpieceA')\n cells[398].classList.add('townpieceD')\n\n cells[376].classList.add('townpieceA')\n cells[377].classList.add('townpieceH')\n cells[378].classList.add('townpieceD')\n\n //----- apple creation ------\n\n const cookieCoords1 = [27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 52, 57,62, 64, 69, 74, 82, 87, 89, 94,\n 102, 107, 112, 113, 114, 119, 124, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,\n 152, 157, 159, 167, 169, 174, 177, 182, 184, 192, 194, 199, 202, 207, 209, 210, 211, 212, 214, 215, 216, 217, 219, 224, 227, 228, 229, 230, 231, 232, \n 244, 245, 246, 247, 248, 249, 257, 269, 282, 294, 307, 319, 332, 344, 357, 369, 382, 394, 407, 419, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437,\n 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 452, 456, 462, 464, 470, 474, 478, 479, 481, 482, 483, 484, 485, 486, 487, 489, 490, 491, 492, 493, \n 494, 495, 497, 498, 504, 506, 508, 518, 520, 522, 527, 528, 529, 530, 531, 533, 534, 535, 536, 537, 539, 540, 541, 542, 543, 545, 546, 547, 548, 549,\n 552, 562, 564, 574, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599\n ]\n\n cookieCoords1.map( coord =>{\n cells[coord - 1].classList.add('cookie')\n })\n // ----- POWERUP CREATION ----------\n const pokeballCoords1 = [499, 477, 99, 77 ]\n pokeballCoords1.map( coord =>{\n cells[coord - 1].classList.add('pokeBall')\n })\n }", "function displayMaze(x, y, maze) {\r\n canvas = document.getElementById('maze-canvas');\r\n context = canvas.getContext('2d');\r\n let width = canvas.width;\r\n let height = canvas.height;\r\n let cellSize = width / x;\r\n\r\n // Green starting cell\r\n context.fillStyle = 'rgba(0, 200, 0, 0.5)';\r\n context.fillRect(0, 0, cellSize, cellSize);\r\n \r\n // Red ending cell\r\n context.fillStyle = 'rgba(200, 0, 0, 0.5)';\r\n context.fillRect(width - cellSize, height - cellSize, cellSize, cellSize);\r\n\r\n // Loop through each maze cell\r\n for (let i = 0; i < x; i++) {\r\n for (let j = 0; j < y; j++) {\r\n let columnCoord = i * cellSize;\r\n let rowCoord = j * cellSize;\r\n\r\n if(!maze[i][j].top) {\r\n context.beginPath();\r\n context.strokeStyle = '#FFFFFF';\r\n context.moveTo(columnCoord, rowCoord + cellSize);\r\n context.lineTo(columnCoord + cellSize, rowCoord + cellSize);\r\n context.stroke();\r\n }\r\n if(!maze[i][j].bottom) {\r\n context.beginPath();\r\n context.strokeStyle = '#FFFFFF';\r\n context.moveTo(columnCoord + cellSize, rowCoord);\r\n context.lineTo(columnCoord, rowCoord);\r\n context.stroke();\r\n } \r\n if(!maze[i][j].left) {\r\n context.beginPath();\r\n context.strokeStyle = '#FFFFFF';\r\n context.moveTo(columnCoord, rowCoord);\r\n context.lineTo(columnCoord, rowCoord + cellSize);\r\n context.stroke();\r\n }\r\n if(!maze[i][j].right) {\r\n context.beginPath();\r\n context.strokeStyle = '#FFFFFF';\r\n context.moveTo(columnCoord + cellSize, rowCoord + cellSize);\r\n context.lineTo(columnCoord + cellSize, rowCoord);\r\n context.stroke();\r\n }\r\n }\r\n }\r\n }", "function mazeMe() {\n for (x = 0; x < maze.length; x++) {\n for (y = 0; y < maze[x].length; y++) {\n if (maze[y][x] === 1) {\n ctx.fillStyle = \"white\";\n ctx.fillRect(x * 25, y * 25, 25, 25);\n }\n }\n }\n}", "function drawMaze(width, height){\n\n let visited = new Stack();\n let curCell = cellMap.get(coords[0]); // start at top left\n\n visited.push(curCell);\n\n // visit every block\n while(!visited.isEmpty()) {\n\n visited.peek().color = \"red\";\n visited.peek().drawThis();\n\n\n // randomly choose neighbor to visit\n while(!curCell.visitedNeighbors()) {\n // place current dot\n curCell.setVisited(true);\n\n let nextCellCoord = (curCell.getNeighbors()[Math.floor(Math.random() * (curCell.getNeighbors().length))]).getCoord();\n\n let nextCell = cellMap.get(find(nextCellCoord));\n\n while(nextCell.getVisited()) {\n nextCellCoord = (curCell.getNeighbors()[Math.floor(Math.random() * (curCell.getNeighbors().length))]).getCoord();\n\n nextCell = cellMap.get(find(nextCellCoord));\n }\n\n drawMazeLine(curCell.getCoord(), nextCell.getCoord());\n curCell.color = \"black\";\n nextCell.color = \"red\";\n\n curCell.drawThis();\n nextCell.drawThis();\n\n curCell.addConnection(nextCell);\n nextCell.addConnection(curCell);\n\n curCell = nextCell;\n curCell.setVisited(true);\n visited.push(curCell);\n }\n\n let temp = visited.peek();\n temp.color = \"black\";\n temp.drawThis();\n curCell = visited.pop();\n }\n}", "function genMaze() {\n //var alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','aa','bb','cc','dd','ee','ff','gg','hh','ii','jj','kk','ll','mm','nn','oo','pp','qq','rr','ss','tt','aaa','bbb','ccc','ddd','eee','fff','ggg','hhh','iii','jjj','kkk','lll','mmm','nnn','ooo','ppp','qqq','rrr','sss','ttt','aaaa','bbbb','cccc','dddd','eeee','ffff','gggg','hhhh','iiii','jjjj','kkkk','llll','mmmm','nnnn','oooo','pppp','qqqq','rrrr','ssss','tttt'];\n var alphabet2 = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't'];\n var mazeSize = 20;\n\n\n //LOOP THROUGH EACH LETTER (AKA Y COORDINATE)\n for (var j = 0; j < alphabet2.length; j++) {\n var currentLetter = alphabet2[j];\n\n //LOOP THROUGH EACH NUMBER (AKA X COORDINATE)\n for (var k = 0; k < mazeSize; k++) {\n var keyName = currentLetter + k;\n var status;\n\n //RANDOMLY DECIDE IF A TILE IS WALKWAY OR WALL\n var coinToss = Math.random();\n if (coinToss < 0.5) {\n status = 1;\n } else {\n status = 0;\n }\n\n // IF IT'S AN EDGE IT'S SOLID\n if (k == mazeSize - 1) {\n status = 1;\n }\n if (j == mazeSize - 1) {\n status = 1;\n }\n if (k === 0) {\n status = 1;\n }\n if (j === 0) {\n status = 1;\n }\n\n // ASSIGN THE OBJECT\n mazeObject[keyName] = [j, k, status];\n\n }// end inner loop x\n\n //PLACE A STARTING TILE\n var randomSide = Math.random();\n if (randomSide > 0.5) {\n startSide = 0;\n } else {\n startSide = mazeSize - 1;\n }\n\n var randomSpace = Math.floor(Math.random() * (mazeSize - 1)) + 1;\n var finalPlacement = Math.random();\n if (finalPlacement > 0.5) {\n mazeObject.start = [startSide, randomSpace, 0];\n } else {\n mazeObject.start = [randomSpace, startSide, 0];\n }\n\n console.log(mazeObject.start);\n\n }// end outer loop yˆ\n\n}", "function Maze(size, cellTextures, level) {\n\n var cols, rows;\n var w = size;\n this.grid = [];\n\n this.current;\n\n var stack = [];\n\n this.setup = function() {\n createCanvas(605,605)\n cols = floor(width/w);\n rows = floor(height/w);\n\n for (var j = 0; j < rows; j++) {\n for (var i = 0; i < cols; i++) {\n var cell = new Cell(i, j, w, this.grid, cols, rows, cellTextures, level);\n this.grid.push(cell);\n }\n }\n this.current = this.grid[0];\n }\n\n this.draw = function() {\n background(51);\n for (var i = 0; i < this.grid.length; i++) {\n this.grid[i].show();\n }\n\n this.current.visited = true;\n //this.current.highlight();\n // STEP 1\n var next = this.current.checkNeighbors();\n if (next) {\n next.visited = true;\n\n // STEP 2\n stack.push(this.current);\n\n // STEP 3\n this.removeWalls(this.current, next);\n\n // STEP 4\n this.current = next;\n } else if (stack.length > 0) {\n this.current = stack.pop();\n }\n\n }\n\n this.index = function(i, j) {\n if (i < 0 || j < 0 || i > cols-1 || j > rows-1) {\n return -1;\n }\n return i + j * cols;\n }\n\n\n this.removeWalls = function(a, b) {\n var x = a.i - b.i;\n if (x === 1) {\n a.walls[3] = false;\n b.walls[1] = false;\n } else if (x === -1) {\n a.walls[1] = false;\n b.walls[3] = false;\n }\n var y = a.j - b.j;\n if (y === 1) {\n a.walls[0] = false;\n b.walls[2] = false;\n } else if (y === -1) {\n a.walls[2] = false;\n b.walls[0] = false;\n }\n }\n}", "function newMaze() {\n\n width = document.getElementById('width').value;\n height = document.getElementById('height').value;\n\n\n if (width >= 2 && height >= 2) {\n\n canvas.width = width*boxSize + lineWeight/2;\n canvas.height = height*boxSize + lineWeight/2;\n\n errorMessage.style.visibility = \"hidden\";\n resetEverything();\n errorMessage.innerHTML = 'Please input acceptable dimensions.';\n\n fillBoard(width * boxSize, height * boxSize);\n drawMaze(width, height);\n showMaze = true;\n\n //create entry and exit points\n ctx.beginPath();\n ctx.lineWidth = boxSize - lineWeight;\n\n ctx.moveTo(0, boxSize/2 + padding);\n ctx.lineTo(coords[0].getX() - lineWeight, coords[0].getY());\n\n ctx.moveTo(coords[coords.length - 1].getX() + lineWeight, coords[coords.length - 1].getY());\n ctx.lineTo(canvas.width, coords[coords.length - 1].getY());\n\n ctx.closePath();\n ctx.strokeStyle = \"white\";\n ctx.stroke();\n\n } else {\n\n errorMessage.style.visibility = \"visible\";\n errorMessage.classList.add('red-glow');\n setTimeout(function() {errorMessage.classList.add('remove-glow')}, 800);\n setTimeout(function() {errorMessage.classList.remove('red-glow')}, 800);\n setTimeout(function() {errorMessage.classList.remove('remove-glow')}, 1600);\n }\n}", "function drawMaze(maze, svg, cellSize){\n\n var size = {\n width : maze[0].length,\n height : maze.length\n };\n\n // scale svg\n svg.attr(\"width\", size.width*cellSize).attr(\"height\", size.height*cellSize);\n\n for(var i = 0; i < size.height;i++){\n for(var j = 0; j < size.width;j++){\n // draw a rectangle for each maze cell\n var cell = svg.append(\"rect\").attr(\"x\", j*cellSize).attr(\"y\", i*cellSize).attr(\"width\", cellSize).attr(\"height\", cellSize);\n\n switch (maze[i][j]) {\n case cellTypes.empty:\n cell.style(\"fill\", \"white\");\n break;\n case cellTypes.start:\n cell.style(\"fill\", \"green\");\n break;\n case cellTypes.goal:\n cell.style(\"fill\", \"red\");\n break;\n case cellTypes.visited:\n cell.style(\"fill\", \"#888\");\n break;\n case cellTypes.path:\n cell.style(\"fill\", \"#888\");\n svg.append(\"circle\").attr(\"cx\", j*cellSize+(cellSize/2)).attr(\"cy\", i*cellSize+(cellSize/2)).attr(\"r\", cellSize/3).style(\"fill\", \"#333\");\n break;\n default:\n cell.style(\"fill\", \"#333\");\n break;\n }\n }\n }\n}", "function drawMaze(mfields, first, last) {\n console.log(\"startfeld\", first);\n let cvs = document.getElementById('cvs');\n let ctx = cvs.getContext('2d');\n\n ctx.fillStyle = '#000000';\n\n for (let y = 0; y < mfields.length; y++) {\n for (let x = 0; x < mfields[y].length; x++) {\n ctx.beginPath();\n ctx.strokeStyle = '#ffff00';\n ctx.rect(x * field_dim, y * field_dim, field_dim, field_dim);\n ctx.fill();\n ctx.stroke();\n }\n }\n\n ctx.beginPath();\n ctx.fillStyle = '#d1d1d1';\n\n\n\n\n for (let y = 0; y < mfields.length; y++) {\n for (let x = 0; x < mfields[y].length; x++) {\n ctx.beginPath();\n ctx.strokeStyle = '#ffff00';\n\n if (mfields[y][x].neighbors.n) {\n if (y != 0)\n ctx.rect(x * field_dim + 1, (y - 1) * field_dim + 1, field_dim - 2, field_dim * 2 - 2);\n }\n if (mfields[y][x].neighbors.s) {\n if (!(y == mfields.length - 1))\n ctx.rect(x * field_dim + 1, y * field_dim + 1, field_dim - 2, field_dim * 2 - 2);\n }\n\n if (mfields[y][x].neighbors.w) {\n ctx.rect((x - 1) * field_dim + 1, y * field_dim + 1, field_dim * 2 - 2, field_dim - 2);\n }\n if (mfields[y][x].neighbors.e) {\n ctx.rect((x) * field_dim + 1, y * field_dim + 1, field_dim * 2 - 2, field_dim - 2);\n }\n ctx.fill();\n ctx.beginPath();\n ctx.fillStyle = \"#ff0000\";\n\n if (mfields[y][x].item) {\n if (mfields[y][x].item == \"Banane\")\n ctx.fillText(\"B\", (x) * field_dim + field_dim / 2, y * field_dim + 1 + field_dim / 2);\n if (mfields[y][x].item == \"Schwert\")\n ctx.fillText(\"S\", (x) * field_dim + field_dim / 2, y * field_dim + 1 + field_dim / 2);\n\n }\n ctx.fill();\n ctx.fillStyle = \"#000000\";\n }\n\n\n }\n\n\n\n // Aktuelles Feld einzeichnen\n\n let y = parseInt(first.id / cols);\n let x = parseInt(first.id % cols);\n ctx.beginPath();\n ctx.arc(x * field_dim + field_dim / 2, y * field_dim + field_dim / 2, 5, 0, 2 * Math.PI);\n\n ctx.fillStyle = '#ffff00'\n ctx.fill();\n\n\n ctx.fillStyle = '#d1d1d1'\n\n if (first.neighbors.n)\n ctx.rect(x * field_dim + 5, (y - 1) * field_dim + 5, field_dim - 10, field_dim - 10);\n if (first.neighbors.s)\n ctx.rect(x * field_dim + 5, (y + 1) * field_dim + 5, field_dim - 10, field_dim - 10);\n if (first.neighbors.w)\n ctx.rect((x - 1) * field_dim + 5, (y) * field_dim + 5, field_dim - 10, field_dim - 10);\n if (first.neighbors.e)\n ctx.rect((x + 1) * field_dim + 5, (y) * field_dim + 5, field_dim - 10, field_dim - 10);\n\n ctx.fill();\n //ctx.stroke();\t\t\t\n\n\n\n // Letzes Feld einzeichnen\n y = parseInt(last.id / cols);\n x = parseInt(last.id % cols);\n\n ctx.beginPath();\n ctx.arc(x * field_dim + field_dim / 2, y * field_dim + field_dim / 2, 5, 0, 2 * Math.PI);\n\n ctx.fillStyle = '#0000ff'\n ctx.fill();\n\n drawTimer()\n}", "function drawMaze(){\n document.getElementById(`Game-Window`).innerHTML = \"\";\n for (var i = 0; i < maze.length; i++) {\n var row = $('<tr class=\"row\"></tr>');\n for (var j = 0; j < maze[i].length; j++) {\n if (maze[i][j] === 0) {\n var col = $(`<td class=\"col score\">Score:-${score}</td>`).css(\"border\",\"none\").css(\"color\",\"white\")\n row.append(col);\n } else if (maze[i][j] === 1) {\n var col = $(`<td class=\"col wall\"></td>`).css(\"background\",\"white\").css(\"border-color\",\"black\")\n row.append(col);\n } else if (maze[i][j] === 2) {\n var col = $(`<td class=\"col space\"><div class=\"container2\"><div class=\"coin\"></div></div></td>`).css(\"border\",\"none\")\n row.append(col);\n } else if (maze[i][j] === 3) {\n var col = $(`<td class=\"col blank\"></td>`).css(\"background\",\"black\").css(\"border\",\"none\")\n row.append(col);\n } else if (maze[i][j] === 4) {\n var col = $(`<td class=\"col door\"></td>`).css(\"background\",\"black\")\n row.append(col);\n } else if (maze[i][j] === 5) {\n if (directionPM == 1) {\n var col = $(`<td class=\"col space\"><div class=\"container1\"><div class=\"pacman\"></div></div></td>`).css(\"background\",\"black\").css(\"border\",\"none\").css(\"transform\",\"rotate(180deg)\");\n } else if (directionPM == 2) {\n var col = $(`<td class=\"col space\"><div class=\"container1\"><div class=\"pacman\"></div></div></td>`).css(\"background\",\"black\").css(\"border\",\"none\").css(\"transform\",\"rotate(270deg)\");\n } else if (directionPM == 3) {\n var col = $(`<td class=\"col space\"><div class=\"container1\"><div class=\"pacman\"></div></div></td>`).css(\"background\",\"black\").css(\"border\",\"none\").css(\"transform\",\"rotate(0deg)\");\n } else if (directionPM == 4) {\n var col = $(`<td class=\"col space\"><div class=\"container1\"><div class=\"pacman\"></div></div></td>`).css(\"background\",\"black\").css(\"border\",\"none\").css(\"transform\",\"rotate(90deg)\");\n }\n row.append(col);\n } else if (maze[i][j] === 6) {\n var col = $(`<td class=\"col exit\"></td>`).css(\"background\",\"black\").css(\"border\",\"none\")\n row.append(col);\n } else if (maze[i][j] === 7) {\n var col = $(`<td class=\"col space\"><div class=\"container3\"><div class=\"pinky\"></div></div></td>`).css(\"background\",\"black\").css(\"border\",\"none\");\n row.append(col);\n } else if (maze[i][j] === 8) {\n var col = $(`<td class=\"col time\"></td>`).css(\"border\",\"none\").css(\"color\",\"white\")\n row.append(col);\n } else if (maze[i][j] === 9) {\n var col = $(`<td class=\"col space\"><div class=\"container3\"><div class=\"blinky\"></div></div></td>`).css(\"background\",\"black\").css(\"border\",\"none\");\n row.append(col);\n } else if (maze[i][j] === 10) {\n var col = $(`<td class=\"col space\"><div class=\"container3\"><div class=\"inky\"></div></div></td>`).css(\"background\",\"black\").css(\"border\",\"none\");\n row.append(col);\n } else if (maze[i][j] === 11) {\n var col = $(`<td class=\"col space\"><div class=\"container3\"><div class=\"clyde\"></div></div></td>`).css(\"background\",\"black\").css(\"border\",\"none\");\n row.append(col);\n } else if (maze[i][j] === 12) {\n var col = $(`<td class=\"col cage\"></td>`).css(\"background\",\"black\").css(\"border\",\"none\")\n row.append(col);\n } else if (maze[i][j] === 13) {\n var col = $(`<td class=\"col lives\">Lives:-${lives}</td>`).css(\"border\",\"none\").css(\"color\",\"white\")\n row.append(col);\n }\n }\n board.append(row);\n }\n }", "function drawMaze(maze, cell, canvas){\n if (canvas.getContext) {\n var ctx = canvas.getContext('2d');\n\n var corners = maze.getCorners();\n var x0 = corners[0][0];\n var y0 = corners[0][1];\n var x1 = corners[1][0];\n var y1 = corners[1][1];\n var height = x1 - x0;\n var width = y1 - y0;\n var mazeSize = (height > width ? height : width);\n var BORDER = 10;\n // Cell size in pixels, 10 pixel border, add 1 b/c 0 indexed\n var cellSize = Math.floor((canvas.width - BORDER) / (mazeSize));\n var wall_width = Math.floor(cellSize/20);\n if (wall_width === 0) {\n wall_width = 1;\n }\n var yOffset = (mazeSize === width ? BORDER / 2\n : Math.floor(((height - width) * cellSize + BORDER)/2));\n var xOffset = (mazeSize === height ? BORDER / 2\n : Math.floor(((width - height) * cellSize + BORDER)/2));\n // Cheat by using a global, hackish\n mazeClickInfo.cellSize = cellSize;\n mazeClickInfo.xOffset = xOffset;\n mazeClickInfo.yOffset = yOffset;\n mazeClickInfo.x0 = x0;\n mazeClickInfo.y0 = y0;\n mazeClickInfo.cell = cell;\n\n // Draw grey for unexplored cells, white for explored\n var drawCell = function(x, y) {\n x = (x - x0) * cellSize + xOffset;\n y = (y - y0) * cellSize + yOffset;\n ctx.fillRect (y, x, cellSize, cellSize);\n };\n\n // Draw explored areas\n for (var x = x0; x < x1; x++) {\n for (var y = y0; y < y1; y++) {\n if (maze.isExplored(x,y)) {\n ctx.fillStyle = \"rgb(255,255,255)\";\n } else {\n ctx.fillStyle = \"rgb(200,200,200)\";\n }\n drawCell(x, y);\n }\n }\n\n // Draw wall to right of cell\n var drawVertWall = function (x, y) {\n x = (x - x0) * cellSize + xOffset - wall_width/2;\n y = (y - y0 + 1) * cellSize + yOffset - wall_width/2;\n ctx.fillRect(y, x, wall_width, cellSize + wall_width);\n };\n\n // Draw wall at bottom of cell\n var drawHorizWall = function(x, y) {\n x = (x - x0 + 1) * cellSize + xOffset - wall_width/2;\n y = (y - y0) * cellSize + yOffset - wall_width/2;\n ctx.fillRect(y, x, cellSize + wall_width, wall_width);\n };\n\n ctx.fillStyle = \"rgb(0,0,0)\";\n // Draw left side\n for (var x = x0; x < x1; x++) {\n if (maze.isWall(x,y0-1,x,y0)) {\n drawVertWall(x, y0-1);\n }\n }\n // Draw top\n for (var y = y0; y < y1; y++) {\n if (maze.isWall(x0-1,y,x0,y)) {\n drawHorizWall(x0-1, y)\n }\n }\n // Draw the rest\n for (var x = x0; x < x1; x++) {\n for (var y = y0; y < y1; y++) {\n if (maze.isWall(x,y,x,y+1)) {\n drawVertWall(x,y);\n }\n if (maze.isWall(x,y,x+1,y)) {\n drawHorizWall(x, y);\n }\n }\n }\n\n var drawTriangle = function(x,y,dir) {\n x = (x - x0) * cellSize + xOffset;\n y = (y - y0) * cellSize + yOffset;\n // Translate canvas to center, rotate to correct angle, then make triangle\n ctx.translate(y + cellSize/2, x + cellSize/2);\n ctx.scale(cellSize, cellSize);\n ctx.rotate(-dir*Math.PI/2)\n ctx.beginPath();\n ctx.moveTo(-1/4,1/3);\n ctx.lineTo(0,-1/3);\n ctx.lineTo(1/4,1/3);\n ctx.fill();\n ctx.rotate(dir*Math.PI/2)\n ctx.scale(1/cellSize, 1/cellSize);\n ctx.translate(-y - cellSize/2, -x - cellSize/2)\n }\n if (cell) {\n ctx.fillStyle = \"rgb(255,0,0)\";\n var data = cell.getData();\n drawTriangle(data[0],data[1],data[2]);\n }\n }\n}", "function onCreate() {\n\n document.getElementById(\"btnCreateMaze\").setAttribute(\"disabled\", \"disabled\");\n\n wid = document.getElementById(\"maze\").offsetWidth - padding; \n hei = 400;\n\n cols = eval(document.getElementById(\"cols\").value); \n rows = eval(document.getElementById(\"rows\").value);\n\n mazeType = document.getElementById(\"sltType\").value;\n document.getElementById(\"path\").innerHTML = \"\";\n document.getElementById(\"searchlength\").innerHTML = \"\";\n document.getElementById(\"output\").innerHTML =\"生成迷宫中\";\n if(mazeType == \"Maze1\") {\n cols = cols + 1 - cols % 2;\n rows = rows + 1 - rows % 2; \n }\n\n maze = createArray( cols, rows );\n mazePointer = createArray( cols, rows );\n mazeDir = createArray( cols, rows );\n if(document.getElementById(\"sltType\").value == \"Maze2\") {\n document.getElementById(\"Mazedesc\").innerHTML = \"Maze2:<br />一个纯随机生成的迷宫,支持8个方向(包括对角线)LCA算法在此失效 ,但A*算法则表现了其高效的寻路性能。\";\n }\n else {\n document.getElementById(\"Mazedesc\").innerHTML = \"Maze1:<br />一个经典的单连通迷宫,只支持4个方向。绝大多数的算法在这种经典迷宫中均没有良好的效果,但LCA(最近公共祖先算法)显然是个特例。\";\n }\n var canvas = document.getElementById(\"canvas\");\n canvas.width = wid;\n canvas.height = hei;\n s = canvas.width / (grid * cols);\n canvas.height = s * grid * rows;\n\n ctx.scale(s, s);\n\n drawMaze();\n if(mazeType == \"Maze1\") {\n\n start.x = Math.floor( Math.random() * ( cols / 2 ) );\n start.y = Math.floor( Math.random() * ( rows / 2 ) );\n if( !( start.x & 1 ) ) start.x++; if( !( start.y & 1 ) ) start.y++;\n maze[start.x][start.y] = 0;\n mazeDir[start.x][start.y] = undefined;\n if(document.getElementById(\"chkAnimated\").checked) {\n\n createMaze1();\n }\n else {\n\n createMaze1NonAni();\n }\n }\n else {\n\n density = document.getElementById(\"density\").value / 100;\n start.x = 1;\n start.x = 1;\n\n if(document.getElementById(\"chkAnimated\").checked) {\n\n createMaze2();\n }\n else {\n\n createMaze2NonAni();\n }\n }\n document.getElementById(\"output\").innerHTML =\"迷宫已成功生成,点击起终点开始寻路\";\n}", "function solveMazes() {\n\t//SOLVE THE MAZES\n\t//here's some.. starter code?\n\tctx.strokeStyle = \"#00FF00\";\n\tctx.beginPath();\n\tctx.moveTo(65,10);\n\tctx.lineTo(65,40);\n\tctx.lineTo(35,40);\n\tctx.lineTo(35,20);\n\tctx.lineTo(15,20);\n\tctx.lineTo(15,50);\n\tctx.lineTo(70,50);\n\tctx.lineTo(70,70);\n\tctx.lineTo(50,70);\n\tctx.lineTo(50,85);\n\tctx.lineTo(70,85);\n\tctx.lineTo(70,100);\n\tctx.lineTo(35,100);\n\tctx.lineTo(35,85);\n\tctx.lineTo(17,85);\n\tctx.lineTo(17,130);\n\tctx.lineTo(50,130);\n\tctx.lineTo(50,115);\n\tctx.lineTo(80,115);\n\tctx.lineTo(80,100);\n\tctx.lineTo(100,100);\n\tctx.lineTo(100,130);\n\tctx.lineTo(85,130);\n\tctx.lineTo(85,150);\n\tctx.stroke();\n\tctx.strokeStyle=\"#0000FF\";\n\tctx.beginPath();\n\tctx.moveTo(255,10);\n\tctx.lineTo(255,20);\n\tctx.lineTo(245,20);\n\tctx.lineTo(250,35);\n\tctx.lineTo(290,35);\n\tctx.lineTo(285,47);\n\tctx.lineTo(235,47);\n\tctx.lineTo(230,53);\n\tctx.lineTo(235,58);\n\tctx.lineTo(250,58);\n\tctx.lineTo(293,127);\n\tctx.lineTo(288,129);\n\tctx.lineTo(278,129);\n\tctx.lineTo(263,105);\n\tctx.lineTo(233,105);\n\tctx.lineTo(233,145);\n\tctx.lineTo(253,145);\n\tctx.lineTo(253,155);\n\tctx.stroke();\n}", "function generateMaze() {\n init(generate);\n}", "function mazegen(rows, cols) {\n\n var maxheight = rows - 1; //counting 0\n var maxwidth = cols - 1;\n\n deadthresh = Math.ceil((rows + cols) * 0.7);\n\n for (var i = 0; i <= maxheight; i++) { //rows\n\n maze[i] = [];\n\n for (var j = 0; j <= maxwidth; j++) { //columns (cells)\n {\n maze[i][j] = {};\n maze[i][j].pathed = false;\n if (i === 0 || j === 0 || i === maxheight || j === maxwidth) {\n maze[i][j].wall = true;\n } else {\n maze[i][j].wall = false;\n }\n }\n }\n\n }\n\n start = {\n x: Math.floor(maxwidth / 2),\n y: Math.floor(maxheight / 2)\n };\n\n //force the start point to open upward\n maze[start.x][start.y] = {\n pathed: true,\n isInSolution: true\n };\n totalpathed = totalpathed + 1;\n //put walls around the start\n maze[start.x + 1][start.y].wall = true;\n maze[start.x - 1][start.y].wall = true;\n maze[start.x][start.y + 1].wall = true;\n\n //begin generation from the tile above the start\n while (totalpathed < maxheight * maxwidth / 3) {\n pathing(start.x, start.y - 1, \"up\", 0);\n }\n return {\n start: start,\n end: { x: 0, y: 0 },\n rows: rows,\n cols: cols,\n maze: maze\n };\n}", "function pinkyMove() {\n if (maze[pinky.y-1][pinky.x] ==12) {\n maze[pinky.y][pinky.x] = 12;\n pinky.y = 11;\n maze[pinky.y][pinky.x] = 7;\n drawMaze();\n } else if (directionP <= 2.5) {\n if (maze[pinky.y][pinky.x-1] ==5) {\n maze[pinky.y][pinky.x] = 2;\n pinky.x = pinky.x - 1;\n maze[pinky.y][pinky.x] = 7;\n pacman.x = 14;\n pacman.y = 23;\n lives--;\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n } else if (maze[pinky.y][pinky.x-1] ==6) {\n maze[pinky.y][pinky.x] = 2;\n pinky.x = 26;\n maze[pinky.y][pinky.x] = 7;\n drawMaze();\n } else if (maze[pinky.y][pinky.x-1] ==1) {\n maze[pinky.y][pinky.x] = 7;\n directionP = Math.random() * 10;\n drawMaze();\n } else if (maze[pinky.y][pinky.x-1] !==1) {\n maze[pinky.y][pinky.x] = 2;\n pinky.x = pinky.x - 1;\n maze[pinky.y][pinky.x] = 7;\n drawMaze();\n }\n } else if (directionP > 2.5 && directionP <= 5) {\n if (maze[pinky.y-1][pinky.x] ==5) {\n maze[pinky.y][pinky.x] = 2;\n pinky.y = pinky.y - 1;\n maze[pinky.y][pinky.x] = 7;\n pacman.x = 14;\n pacman.y = 23;\n lives--;\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n } else if (maze[pinky.y-1][pinky.x] ==1) {\n maze[pinky.y][pinky.x] = 7;\n directionP = Math.random() * 10;\n drawMaze();\n } else if (maze[pinky.y-1][pinky.x] !==1) {\n maze[pinky.y][pinky.x] = 2;\n pinky.y = pinky.y - 1;\n maze[pinky.y][pinky.x] = 7;\n drawMaze();\n }\n } else if (directionP > 5 && directionP <= 7.5) {\n if (maze[pinky.y][pinky.x+1] ==5) {\n maze[pinky.y][pinky.x] = 2;\n pinky.x = pinky.x + 1;\n maze[pinky.y][pinky.x] = 7;\n pacman.x = 14;\n pacman.y = 23;\n lives--;\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n } else if (maze[pinky.y][pinky.x+1] ==6) {\n maze[pinky.y][pinky.x] = 2;\n pinky.x = 1;\n maze[pinky.y][pinky.x] = 7;\n drawMaze();\n } else if (maze[pinky.y][pinky.x+1] ==1) {\n maze[pinky.y][pinky.x] = 7;\n directionP = Math.random() * 10;\n drawMaze();\n } else if (maze[pinky.y][pinky.x+1] !==1) {\n maze[pinky.y][pinky.x] = 2;\n pinky.x = pinky.x + 1;\n maze[pinky.y][pinky.x] = 7;\n drawMaze();\n }\n } else if (directionP > 7.5) {\n if (maze[pinky.y+1][pinky.x] ==5) {\n maze[pinky.y][pinky.x] = 2;\n pinky.y = pinky.y + 1;\n maze[pinky.y][pinky.x] = 7;\n pacman.x = 14;\n pacman.y = 23;\n lives--;\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n } else if (maze[pinky.y+1][pinky.x] ==4) {\n maze[pinky.y][pinky.x] = 7;\n directionP = Math.random() * 10;\n drawMaze();\n } else if (maze[pinky.y+1][pinky.x] ==1) {\n maze[pinky.y][pinky.x] = 7;\n directionP = Math.random() * 10;\n drawMaze();\n } else if (maze[pinky.y+1][pinky.x] !==1) {\n maze[pinky.y][pinky.x] = 2;\n pinky.y = pinky.y + 1;\n maze[pinky.y][pinky.x] = 7;\n drawMaze();\n }\n }\n }", "function drawMazeIntoCanvas(grid) {\n var tileSize = PROCEDURAL_MAZE.config.tileSize;\n var directions = PROCEDURAL_MAZE.config.directions;\n var wallsWidth = PROCEDURAL_MAZE.config.wallsWidth;\n\n var width = grid[0].length;\n var height = grid.length;\n\n for (var i = 0; i < width; i++) {\n for (var j = 0; j < height; j++) {\n var cell = new createjs.Container();\n cell.x = i * tileSize;\n cell.y = j * tileSize;\n\n var wall = null;\n\n if ((grid[j][i] & directions.north) === 0) {\n wall = new createjs.Shape();\n\n wall.graphics\n .setStrokeStyle(wallsWidth)\n .beginStroke(\"#000000\")\n .moveTo(0, 0)\n .lineTo(tileSize, 0)\n .endStroke();\n\n cell.addChild(wall);\n }\n\n if ((grid[j][i] & directions.east) === 0) {\n wall = new createjs.Shape();\n\n wall.graphics\n .setStrokeStyle(wallsWidth)\n .beginStroke(\"#000000\")\n .moveTo(tileSize, 0)\n .lineTo(tileSize, tileSize)\n .endStroke();\n\n cell.addChild(wall);\n }\n\n if ((grid[j][i] & directions.south) === 0) {\n wall = new createjs.Shape();\n\n wall.graphics\n .setStrokeStyle(wallsWidth)\n .beginStroke(\"#000000\")\n .moveTo(0, tileSize)\n .lineTo(tileSize, tileSize)\n .endStroke();\n\n cell.addChild(wall);\n }\n\n if ((grid[j][i] & directions.west) === 0) {\n wall = new createjs.Shape();\n\n wall.graphics\n .setStrokeStyle(wallsWidth)\n .beginStroke(\"#000000\")\n .moveTo(0, 0)\n .lineTo(0, tileSize)\n .endStroke();\n\n cell.addChild(wall);\n }\n\n stage.addChild(cell);\n }\n }\n\n stage.update();\n}", "function makeNewMaze(mapSize){\n\t//Robert TODO: build a process by which a new array of arrays is created with the proper lengths, and to ensure that there IS a path to the end\n\t//Robert TODO: assign mapData these key value pairs {map: [ [], [], [], [] ], playerPosition: [y, x], mosterNOrigin: [y, x]}\n\tvar mapMargin = mapSize / 3;\n\n\tfunction generateMap(){\n\n\t\tvar monsterCount = 0;\n\n\t\tmapData.map = [];\n\t\tmapData.viewMap = [];\n\n\t\tfor (let i = 0; i < mapSize; i++) {\n\t\t\tmapData.map.push([]);\n\t\t\tfor (let j = 0; j < mapSize; j++) {\n\t\t\t\tmapData.map[i].push(0);\n\t\t\t}\n\t\t}\n\n\t\tmapData.playerPosition = [];\n\t\tmapData.playerPosition.push(Math.ceil(Math.random()*(mapSize-2*mapMargin)+mapMargin));\n\t\tmapData.playerPosition.push(Math.ceil(Math.random()*(mapSize-2*mapMargin)+mapMargin));\n\n\t\tmapData.map[mapData.playerPosition[0]][mapData.playerPosition[1]] = FLOOR;\n\n\t\tvar curY = mapData.playerPosition[0];\n\t\tvar curX = mapData.playerPosition[1];\n\n\t\tvar triedToStep = 0;\n\t\tvar madeAStep = 0;\n\t\t\n\n\t\twhile((curY != 0 && curY != mapSize-1) && (curX != 0 && curX != mapSize-1)) {\n\t\t\tvar upRand = Math.random()*10;\n\t\t\tvar downRand = Math.random()*10;\n\t\t\tvar rightRand = Math.random()*10;\n\t\t\tvar leftRand = Math.random()*10;\n\n\t\t\tif (upRand > downRand && upRand > rightRand && upRand > leftRand) {\n\t\t\t\ttriedToStep++;\n\t\t\t\tif (mapData.map[curY-1][curX] == WALL && (mapData.map[curY-1][curX+1] != FLOOR || mapData.map[curY-1][curX-1] != FLOOR)){\n\t\t\t\t\ttriedToStep = 0;\n\t\t\t\t\tmadeAStep++;\n\t\t\t\t\tcurY-=1;\n\t\t\t\t\tif (madeAStep%180 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = parseInt('4'+String(monsterCount));\n\t\t\t\t\t\teval('mapData.monster'+monsterCount+'Origin = ['+curY+','+curX+']'); //mapData.monster0Origin = [11, 12]\n\t\t\t\t\t\tmonsterCount+=1;\n\t\t\t\t\t} else if (madeAStep%20 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = SAFE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapData.map[curY][curX] = FLOOR;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (downRand > rightRand && downRand > leftRand) {\n\t\t\t\ttriedToStep++;\n\t\t\t\tif (mapData.map[curY+1][curX] == WALL && (mapData.map[curY+1][curX+1] != FLOOR || mapData.map[curY+1][curX-1] != FLOOR)){\n\t\t\t\t\ttriedToStep = 0;\n\t\t\t\t\tmadeAStep++;\n\t\t\t\t\tcurY+=1;\n\t\t\t\t\tif (madeAStep%180 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = parseInt('4'+String(monsterCount));\n\t\t\t\t\t\teval('mapData.monster'+monsterCount+'Origin = ['+curY+','+curX+']');\n\t\t\t\t\t\tmonsterCount+=1;\n\t\t\t\t\t} else if (madeAStep%20 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = SAFE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapData.map[curY][curX] = FLOOR;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (rightRand > leftRand) {\n\t\t\t\ttriedToStep++;\n\t\t\t\tif (mapData.map[curY][curX+1] == WALL && (mapData.map[curY+1][curX+1] != FLOOR || mapData.map[curY-1][curX+1] != FLOOR)){\n\t\t\t\t\ttriedToStep = 0;\n\t\t\t\t\tmadeAStep++;\n\t\t\t\t\tcurX+=1;\n\t\t\t\t\tif (madeAStep%180 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = parseInt('4'+String(monsterCount));\n\t\t\t\t\t\teval('mapData.monster'+monsterCount+'Origin = ['+curY+','+curX+']');\n\t\t\t\t\t\tmonsterCount+=1;\n\t\t\t\t\t} else if (madeAStep%20 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = SAFE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapData.map[curY][curX] = FLOOR;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttriedToStep+=1;\n\t\t\t\tif (mapData.map[curY][curX-1] == WALL && (mapData.map[curY+1][curX-1] != FLOOR || mapData.map[curY-1][curX-1] != FLOOR)){\n\t\t\t\t\ttriedToStep = 0;\n\t\t\t\t\tmadeAStep++;\n\t\t\t\t\tcurX-=1;\n\t\t\t\t\tif (madeAStep%180 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = parseInt('4'+String(monsterCount));\n\t\t\t\t\t\teval('mapData.monster'+monsterCount+'Origin = ['+curY+','+curX+']');\n\t\t\t\t\t\tmonsterCount+=1;\n\t\t\t\t\t} else if (madeAStep%20 == 0){\n\t\t\t\t\t\tmapData.map[curY][curX] = SAFE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapData.map[curY][curX] = FLOOR;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t\tif (triedToStep == 10) {\n\t\t\t\tmadeAStep++;\n\t\t\t\tif (upRand > downRand && upRand > rightRand && upRand > leftRand) {\n\t\t\t\t\tcurY--;\n\t\t\t\t} else if (downRand > rightRand && downRand > leftRand) {\n\t\t\t\t\tcurY++;\n\t\t\t\t} else if (rightRand > leftRand) {\n\t\t\t\t\tcurX++;\n\t\t\t\t} else {\n\t\t\t\t\tcurX--;\n\t\t\t\t}\n\t\t\t\tif (mapData.map[curY][curX] != SAFE && String(mapData.map[curY][curX]).charAt(0) != '4' && mapData.map[curY][curX] != FLOOR && madeAStep%20 != 0){\n\t\t\t\t\tmapData.map[curY][curX] = FLOOR;\n\t\t\t\t} else {\n\t\t\t\t\tif (madeAStep%180 == 0){\n\t\t\t\t\t\tif (String(mapData.map[curY][curX]).charAt(0) != '4') {\n\t\t\t\t\t\t\tmapData.map[curY][curX] = parseInt('4'+String(monsterCount));\n\t\t\t\t\t\t\teval('mapData.monster'+monsterCount+'Origin = ['+curY+','+curX+']');\n\t\t\t\t\t\t\tmonsterCount+=1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmadeAStep--;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (madeAStep%20 == 0){\n\t\t\t\t\t\tif (String(mapData.map[curY][curX]).charAt(0) != '4') {\n\t\t\t\t\t\t\tmapData.map[curY][curX] = SAFE;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmadeAStep--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttriedToStep = 0;\n\t\t\t}\n\t\t}\n\t\treturn madeAStep;\n\t}\n\n\n\tvar goodMap = false;\n\n\twhile (!goodMap) {\n\t\tvar stepsCounted = generateMap();\n\t\tif (stepsCounted > mapSize*8) {\n\t\t\tgoodMap = true;\n\t\t}\n\t}\n\n\tfor (let i = 0; i < 9; i++) {\n\t\tmapData.viewMap.push([]);\n\t\tfor (let j = 0; j < 9; j++) {\n\t\t\tmapData.viewMap[i].push(0);\n\t\t}\n\t}\n\n\tfor (let i = 0; i < 9; i++) {\n\t\tfor (let j = 0; j < 9; j++) {\n\t\t\ttry {\n\t\t\t\tmapData.viewMap[i].push((mapData.map[mapData.playerPosition[0]-(4-i)][mapData.playerPosition[0]-(4-j)]));\n\t\t\t} catch {\n\t\t\t\tmapData.viewMap[i].push(0);\n\t\t\t}\n\t\t}\n\t}\n}", "function maze_draw(maze_string, d) {\n // d is the Drone to use\n d.chkpt('maze-start');\n for(var j = 0; j < maze_string.length; j += 2) {\n switch(maze_string.substr(j, 2)) {\n case ' ':\n d.box(0).fwd(); // Make sure to empty this position\n break;\n case '\\r\\n':\n d.move('maze-start');\n d.right().chkpt('maze-start');\n break;\n default: // '+ ', '+-', '--', '| '\n if(j == 0) {\n d.box(blocks.glowstone, 1, 2, 1); // highlight the maze entry and exit\n } else if(j == maze_string.length - 4) {\n d.box(blocks.glass, 1, 2, 1);\n } else {\n d.box(blocks.oak, 1, 2, 1);\n }\n d.fwd();\n }\n }\n}", "function generateDungeonMaze(width, height, name, method, groundtile, walltiles, sourceImage, exits) {\n\n var map = new Map();\n map.width = width;\n map.height = height;\n map.visibility = new Array(this.width*this.height);\n map.tileEntry = Game.tiles[sourceImage];\n map.name = name;\n\n // Create a simple maze room with an exit:\n var maze = null\n if (method[0]=='Kruskal') maze = generateMazeKruskal(width,height,method[1]);\n if (method[0]=='RecursiveDivision') maze = generateMazeRecursiveDivision(width,height,method[1]);\n\n // make sure exists is open:\n for(var i = 0;i<exits.length;i++) {\n var exit = exits[i];\n for(var j = 0;j<exit[0][2];j++) {\n for(var k = 0;k<exit[0][3];k++) {\n maze[exit[0][0]+j][exit[0][1]+k] = 1; \n }\n }\n for(var j = 0;j<exit[1][2];j++) {\n for(var k = 0;k<exit[1][3];k++) {\n maze[exit[1][0]+j][exit[1][1]+k] = 1; \n }\n }\n }\n\n map.newLayer();\n map.newLayer();\n for(var i = 0;i<height;i++) {\n for(var j = 0;j<width;j++) {\n map.setTile(j,i,0,groundtile);\n// if (maze[j][i]==0) map.setTile(j,i,1,walltiles[0]);\n if (maze[j][i]==0) map.setTile(j,i,1,properWallTile(j,i,maze,walltiles));\n }\n }\n\n // Create the exits:\n for(var i = 0;i<exits.length;i++) {\n var exit = exits[i];\n for(var j = 0;j<exit[0][2];j++) {\n for(var k = 0;k<exit[0][3];k++) {\n map.setTile(exit[0][0]+j, exit[0][1]+k, 1, exit[2]);\n }\n }\n if (exit[3]==null) {\n // do nothing\n } else if (exit[3]=='gameComplete') {\n var script = [{action:\"gameComplete\"}];\n map.triggers.push({x:exit[0][0], y:exit[0][1],\n width:exit[0][2], height:exit[0][3], \n repeat:false,\n script:script});\n } else {\n // create a bridge:\n map.bridges.push({x:exit[0][0], y:exit[0][1], width:exit[0][2], height:exit[0][3], id:exit[3]});\n map.bridgeDestinations.push({x:exit[1][0], y:exit[1][1], width:exit[1][2], height:exit[1][3], id:exit[3]});\n }\n }\n\n\n return map;\n}", "function drawMazeLine(from, to) {\n ctx.beginPath();\n ctx.lineWidth = boxSize - (1*lineWeight);\n\n ctx.moveTo(from.getX(), from.getY());\n ctx.lineTo(to.getX(), to.getY());\n\n ctx.closePath();\n ctx.strokeStyle = \"white\";\n ctx.stroke();\n}", "function drawDots() {\n for (let y = 0; y < 31; ++y) {\n for (let x = 0; x < 28; ++x) {\n if (maze[y][x] == 2) {\n ctx.beginPath();\n ctx.fillStyle = '#FAAFD6';\n ctx.fillRect(size * x + 9, size * y + 9, 5, 5);\n ctx.closePath();\n }\n if (maze[y][x] == 3) {\n ctx.beginPath();\n ctx.arc(size * x + 11, size * y + 11, 9, 0, 2 * Math.PI);\n ctx.fillStyle = '#FAAFD6';\n ctx.fill();\n ctx.closePath();\n }\n }\n }\n }", "function draw() {\r\n\tbackground(53, 74, 35);\r\n\tfor (let i = 0; i < maze_grid.length; i++) {\r\n\t\tmaze_grid[i].displayGrid();\r\n\t}\r\n\r\n\tlet following_unit = current_unit.findAdjcent();\r\n\r\n\tcurrent_unit.visited = true;\r\n\t// console.log(current_unit);\r\n\r\n\tif (complete == false) {\r\n\t\tcurrent_unit.mark();\r\n\t\tif (following_unit) {\r\n\t\t\t// pushes current Unit to the stack for backtracking\r\n\t\t\tmaze_stack.push(current_unit);\r\n\t\t\tclearSide(current_unit, following_unit);\r\n\r\n\t\t\t// sets the current Unit to the following Unit in iteration\r\n\t\t\tfollowing_unit.visited = true;\r\n\t\t\tcurrent_unit = following_unit;\r\n\t\t// if no adjcent cells available then will pop \"backtrack\" until one becomes avaiable\r\n\t\t} else if (maze_stack.length > 0) {\r\n\t\t\tcurrent_unit = maze_stack.pop();\r\n\t\t}\r\n\t}\r\n\r\n\tdetermineComplete(maze_stack);\r\n\r\n\t// displays final path\r\n\tif (complete_path == true) {\r\n\t\tdisplayPath(path_stack)\r\n\t}\r\n\r\n\t// starts path finding process\r\n\tif (complete == true) {\r\n\t\tpath_iteration.pathvisit = true;\r\n\t\tpath_iteration.marksolve();\r\n\r\n\t\tvar following_path = path_iteration.findAdjcentPath();\r\n\t\tif(following_path) {\r\n\t\t\t// pushes current path to the stack for backtracking\r\n\t\t \tpath_stack.push(path_iteration);\r\n\r\n\t\t \t// sets the current path to the following path in iteration\r\n\t\t \tfollowing_path.pathvisit = true;\r\n\t\t \tpath_iteration = following_path;\r\n\t\t } else if(path_stack.length > 0 ) {\r\n\t\t \tpath_iteration = path_stack.pop();\r\n\t\t \tpath_iteration.markbacktrack();\r\n\t\t }\r\n\t}\r\n}", "function makemaze(k) {\n var useCanned = false;\n if (k == DBOTTOM || k == VBOTTOM) {\n useCanned = true;\n }\n else if (k > 1) {\n if (ULARN) {\n useCanned = rnd(100) < 50;\n }\n else {\n useCanned = rnd(17) <= 4;\n }\n }\n\n if (useCanned) {\n /* read maze from data file */\n cannedlevel(k);\n return;\n }\n\n var mitem = player.level.monsters;\n\n for (let i = 0; i < MAXY; i++) {\n for (let j = 0; j < MAXX; j++) {\n if (k == 0)\n setItem(j, i, OEMPTY);\n else\n setItem(j, i, OWALL);\n }\n }\n\n if (k == 0) return;\n\n eat(1, 1);\n\n if (k == 1) setItem(33, MAXY - 1, OHOMEENTRANCE);\n\n /* now for open spaces */\n var tmp2 = rnd(3) + 3;\n var mx, mxl, mxh, my, myl, myh;\n var mon;\n for (let tmp = 0; tmp < tmp2; tmp++) {\n my = rnd(11) + 2;\n myl = my - rnd(2);\n myh = my + rnd(2);\n\n if (k < MAXLEVEL) {\n mx = rnd(44) + 5;\n mxl = mx - rnd(4);\n mxh = mx + rnd(12) + 3;\n mon = null;\n } else {\n mx = rnd(60) + 3;\n mxl = mx - rnd(2);\n mxh = mx + rnd(2);\n mon = makemonst(k);\n }\n\n for (var i = mxl; i < mxh; i++)\n for (var j = myl; j < myh; j++) {\n setItem(i, j, OEMPTY);\n mitem[i][j] = mon ? createMonster(mon) : null;\n }\n }\n /* now for open spaces */\n\n my = rnd(MAXY - 2);\n for (let i = 1; i < MAXX - 1; i++)\n setItem(i, my, OEMPTY);\n\n if (k > (ULARN ? 4 : 1)) {\n treasureroom(k);\n }\n\n}", "function draw() {\n\n // Draw the map.\n ctx.clearRect(0, 0, width, height);\n createMap();\n\n drawSnake();\n drawFood();\n\n // Draw Grid for TESTING purposes\n drawGrid();\n}", "function drawMine(){\n // Draw the mine using buttons.\n // Set each button with id i-j to refer to the location in the 2d array. \n // Attribute clicked stores how many times this button is clicked.\n for(let i = 1; i <= height; i++){\n for (let j = 1; j <= width; j++){\n $(\"#mine-field\").append(\"<a class = 'btn' x = \" + i + \" y = \" + j + \n \" hasBomb = \" + minefield[i][j] + \" id = \" + i + \"-\" + j + \n \" clicked = 0 rclicked = 0\" + \">\" + \"</a>\");\n }\n $(\"#mine-field\").append(\"<br>\");\n }\n }", "function drawTower(){\n push();\n for(var i=0; i<18; i++)\n { \n fill(colors[i]);\n drawVertices(boxes[i].vertices);\n }\n pop();\n}", "function init() {\n // create the maze\n maze = new Maze(\"maze\", CELLSIZE);\n maze.initCells();\n maze.generateMaze();\n\n // load images and sounds\n goblinWhispering = new Array();\n goblinWhispering.push(preloadSound(\"whisper2.mp3\"));\n goblinWhispering.push(preloadSound(\"whisper3.mp3\"));\n goblinWhispering.push(preloadSound(\"whisper4.mp3\"));\n goblinWhispering.push(preloadSound(\"whisper5.mp3\"));\n goblinWhispering.push(preloadSound(\"whisper6.mp3\"));\n goblinWhispering.push(preloadSound(\"whisper7.mp3\"));\n goblinDeathCry = new Array();\n goblinDeathCry.push(preloadSound(\"deathCry1.mp3\"));\n goblinDeathCry.push(preloadSound(\"deathCry2.mp3\"));\n goblinDeathCry.push(preloadSound(\"deathCry3.mp3\"));\n goblinDeathCry.push(preloadSound(\"deathCry4.mp3\"));\n goblinDeathCry.push(preloadSound(\"deathCry5.mp3\"));\n goblinStuckMsg = new Array();\n goblinStuckMsg.push(preloadSound(\"stuckMsg3.mp3\"));\n goblinStuckMsg.push(preloadSound(\"stuckMsg4.mp3\"));\n bombRechargeSound = preloadSound(\"bombRecharge.mp3\");\n tadaaa = preloadSound(\"tadaaa.mp3\");\n loserSound = preloadSound(\"loser.mp3\");\n portalSuckSound = preloadSound(\"suck.mp3\");\n portalPopSound = preloadSound(\"pop.mp3\");\n zapSound = preloadSound(\"zap.mp3\");\n digSound = preloadSound(\"dig.mp3\");\n retiredSound = preloadSound(\"retired.mp3\");\n goblinAngryDeathCry = preloadSound(\"angryDeathCry.mp3\");\n goblinCackle = preloadSound(\"goblinCackle.mp3\");\n goblinTriumphPic = preloadImage(\"goblinTriumph.png\");\n goblinPics = new Array();\n goblinPics.push(preloadImage(\"goblin0.png\"));\n goblinPics.push(preloadImage(\"goblin1.png\"));\n goblinPics.push(preloadImage(\"goblin2.png\"));\n goblinPics.push(preloadImage(\"goblin3.png\"));\n goblinPics.push(preloadImage(\"goblin4.png\"));\n goblinDigPics = new Array();\n goblinDigPics.push(preloadImage(\"goblindig0.png\"));\n goblinDigPics.push(preloadImage(\"goblindig1.png\"));\n goblinDigPics.push(preloadImage(\"goblindig2.png\"));\n goblinDigPics.push(preloadImage(\"goblindig3.png\"));\n goblinTrapPic = preloadImage(\"goblinTrap.png\");\n goblinGhostlyPic = preloadImage(\"goblinGhostly.png\");\n deadGoblinPic = preloadImage(\"deadgoblin.png\");\n portalInPic = preloadImage(\"portalin.png\");\n portalEffectPic = preloadImage(\"portaleffect.png\");\n portalOutPic = preloadImage(\"portalout.png\");\n treasurePic = preloadImage(\"treasure.png\", function () {\n maze.drawMaze();\n }); // draw maze only after last pic is loaded\n}", "function createWorld()\n\n{\n\n\n\n/// create emptiness\n\nfor (var x=0; x < worldWidth+1; x++)\n\n{\n\nworld[x] = [];\n\nfor (var y=0; y < worldHeight+1; y++)\n\n{\n\nworld[x][y] = 1;\n\n\n}\n\n}\n\n\nfor (f = 1; f<= fCount; f++){\n\nfor (b = 1; b<= bCount; b++){\n\n\nworld[b][f] = diamond[f][b].status;\n\n\n}\n\n}\n\n\n\npathStart = [stepB,stepF]\n\ncheckFocus();\n\n\nif (world[pathStart[0]][pathStart[1]] == 0){\n\ncurrentPath = findPath(world,pathStart,pathEnd);\n\n\n\n}\n\n\nredraw();\n\n}", "function Maze(width, height) {\n var self = this;\n self.cells = [];\n initializeCells();\n\n //pick a random x and y starting point to construct maze\n var startX = Math.floor(Math.random()*width);\n var startY = Math.floor(Math.random()*height);\n\n //start the recursion\n visit(self.cells[startX][startY]);\n\n function initializeCells() {\n for(var x = 0; x<width; x++) {\n self.cells[x] = [];\n for (var y = 0; y < height; y++)\n self.cells[x][y] = new Cell(x,y);\n }\n }\n\n //Create a cell at x,y location\n function Cell(x,y) {\n this.x = x;\n this.y = y;\n\n //which walls are up on this cell\n this.walls = {\n left : true,\n right : true,\n up : true,\n down : true\n };\n\n //have we visited this cell yet\n this.visited = false;\n }\n\n //initially just a cell and no direction\n function visit(cell,direction) {\n //this cell has now been visited\n cell.visited = true;\n\n //if a direction is given, knock down the wall\n if(direction)\n cell.walls[direction]=false;\n\n //get all possible movements from this position\n var moves = getMoves(cell);\n\n while(moves.length > 0){\n var index = Math.floor(Math.random() * moves.length);\n var nextCell = moves[index];\n\n var direction = \"up\";\n if(cell.y > nextCell.y){\n cell.walls.up = false;\n direction = \"down\";\n }else if(cell.x < nextCell.x){\n cell.walls.right = false;\n direction = \"left\";\n }else if(cell.y < nextCell.y){\n cell.walls.down = false;\n direction = \"up\";\n }else if(cell.x > nextCell.x){\n cell.walls.left = false;\n direction = \"right\";\n }\n visit(nextCell,direction);\n\n moves = getMoves(cell);\n }\n\n }\n\n //walls only useful when solving the maze\n function getMoves(cell, walls) {\n var options = [];\n\n function checkOptions(x, y) {\n if(walls)\n if((y < cell.y && cell.walls.up) ||\n (x > cell.x && cell.walls.right) ||\n (y > cell.y && cell.walls.down) ||\n (x < cell.x && cell.walls.left))\n return;\n\n if(self.cells[x] && self.cells[x][y] && !self.cells[x][y].visited)\n options.push(self.cells[x][y])\n }\n\n checkOptions(cell.x, cell.y - 1); //check to the down\n checkOptions(cell.x, cell.y +1); //check to the up\n checkOptions(cell.x - 1, cell.y); //check to the left\n checkOptions(cell.x + 1, cell.y); //check to the right\n\n return options;\n }\n\n\n\n self.objects = [];\n\n self.drawMaze = function(hasCeiling) {\n var m = new Maze(10,10);\n\n for(var i = 0; i<m.cells.length; i++)\n for(var j = 0; j<m.cells[i].length; j++)\n self.drawCell(m.cells[i][j],hasCeiling);\n\n return self.objects;\n }\n\n self.drawCell = function(cell,hasCeiling) {\n if(!cell)\n return;\n if(!hasCeiling)\n hasCeiling = false;\n var isEnd = false;\n if(cell.x == self.cells.length-1 && cell.y == self.cells.length-1)\n isEnd = true;\n\n var x = cell.x*4.5;\n var y = cell.y*4.5;\n if(cell.walls.down) {\n var c = new Cube(2.5, 1, .25);\n c.translate(0+x, 0, 0+y);\n c.texture = textures.wall;\n if(isEnd)\n c.texture = textures.end;\n c.buildObject();\n self.objects.push(c);\n }\n if(cell.walls.right) {\n var c1 = new Cube(2.5, 1, .25);\n c1.rotate(90, 0, 1, 0);\n c1.translate(-2.25+y, 0, -2.25-x);\n c1.buildObject();\n c1.texture = textures.wall;\n if(isEnd)\n c1.texture = textures.end;\n self.objects.push(c1);\n }\n if(cell.walls.left) {\n var c2 = new Cube(2.5, 1, .25);\n c2.rotate(90, 0, 1, 0);\n c2.translate(-2.25+y, 0, 2.25-x);\n c2.buildObject();\n c2.texture = textures.wall;\n if(isEnd)\n c2.texture = textures.end;\n self.objects.push(c2);\n }\n if(cell.walls.up) {\n var c3 = new Cube(2.5, 1, .25);\n c3.translate(0+x, 0, -4.5+y);\n c3.buildObject();\n c3.texture = textures.wall;\n if(isEnd)\n c3.texture = textures.end;\n self.objects.push(c3);\n }\n\n var floor = new Cube(2.5,.25,2.5);\n floor.translate(x,-1.25,-2.25+y);\n floor.buildObject();\n floor.texture = textures.floor;\n if(isEnd)\n floor.texture = textures.end;\n self.objects.push(floor);\n\n if(hasCeiling) {\n var ceiling = new Cube(2.5, .25, 2.5);\n ceiling.translate(x, 1.25,-2.25+y);\n ceiling.buildObject();\n ceiling.texture = textures.ceiling;\n if(isEnd)\n ceiling.texture = textures.end;\n self.objects.push(ceiling);\n }\n }\n}", "show(){\r\n let x = this.col * this.size / this.cols\r\n let y = this.row * this.size / this.rows\r\n\r\n ctx.strokeStyle = \"black\"\r\n ctx.fillStyle = \"white\"\r\n ctx.lineWidth = 2\r\n\r\n if(this.walls.top) this.drawTopWall(x,y)\r\n if(this.walls.bottom) this.drawBtmWall(x,y)\r\n if(this.walls.right) this.drawRightWall(x,y)\r\n if(this.walls.left) this.drawLeftWall(x,y)\r\n\r\n if(this.has_visited){\r\n ctx.fillRect(x+1,y+1,this.size/this.cols - 2, this.size/this.rows - 2)\r\n }\r\n }", "function\ninit_maze(w1, h1)\n{\n var i, j, vedges, hedges;\n var x, y, t, inc, xoff, yoff;\n\n vedges = (w1-1)*h1; /* number of vertical edges */\n hedges = (h1-1)*w1; /* number of horizontal edges */\n redges = edges = vedges + hedges; /* number of removable edges */\n perimeters = 2*w1 + 2*h1;\n vertices = (w1+1)*(h1+1);\n groups = w1*h1;\n\n /* allocate edge array */\n edge = []\n for(i = 0; i < edges; i++)\n edge.push(new Edge())\n\n /* fill in the vertical edges */\n for (i=0; i<vedges; i++) {\n x = Math.floor(i%(w1-1)); /* convert edge number to column */\n y = Math.floor(i/(w1-1)); /* and row */\n j = Math.floor(y*w1 + x); /* convert to cell number */\n edge[i].cell1 = j;\n edge[i].cell2 = j+1;\n edge[i].vertex1 = Math.floor(y*(w1+1) + x+1); /* convert to vertex number */\n edge[i].vertex2 = Math.floor((y+1)*(w1+1) + x+1);\n edge[i].valid = true;\n edge[i].draw = true;\n }\n for (i=vedges; i<edges; i++) {\n j = Math.floor(i - vedges); /* convert to cell number */\n x = Math.floor(j%w1); /* convert edge number to column */\n y = Math.floor(j/w1); /* and row*/\n edge[i].cell1 = j;\n edge[i].cell2 = j + w1;\n edge[i].vertex1 = Math.floor((y+1)*(w1+1) + x); /* convert to vertex number */\n edge[i].vertex2 = Math.floor((y+1)*(w1+1) + x+1);\n edge[i].valid = true;\n edge[i].draw = true;\n }\n\n /* allocate perimeter */\n perimeter = []\n for(var i = 0; i < perimeters; i++)\n perimeter.push(new Edge())\n\n /* fill in horizontal perimeter */\n for (i=0; i<w1; i++) {\n perimeter[2*i].cell1 = i;\n perimeter[2*i].cell2 = i;\n perimeter[2*i].vertex1 = i;\n perimeter[2*i].vertex2 = i + 1;\n perimeter[2*i].valid = true;\n perimeter[2*i].draw = true;\n perimeter[2*i+1].cell1 = Math.floor(i + h1*w1);\n perimeter[2*i+1].cell2 = Math.floor(i + h1*w1);\n perimeter[2*i+1].vertex1 = Math.floor(i + h1*(w1+1));\n perimeter[2*i+1].vertex2 = Math.floor(i + h1*(w1+1) + 1);\n perimeter[2*i+1].valid = true;\n perimeter[2*i+1].draw = true;\n }\n /* fill in vertical perimeter */\n for (i=w1; i<w1+h1; i++) {\n j = i-w1;\n perimeter[2*i].cell1 = Math.floor(j*w1);\n perimeter[2*i].cell2 = Math.floor(j*w1);\n perimeter[2*i].vertex1 = j*(w1+1);\n perimeter[2*i].vertex2 = (j+1)*(w1+1);\n perimeter[2*i].valid = true;\n perimeter[2*i].draw = true;\n perimeter[2*i+1].cell1 = Math.floor((j+1)*w1 - 1);\n perimeter[2*i+1].cell2 = Math.floor((j+1)*w1 - 1);\n perimeter[2*i+1].vertex1 = Math.floor((j+1)*(w1+1) - 1);\n perimeter[2*i+1].vertex2 = Math.floor((j+2)*(w1+1) - 1);\n perimeter[2*i+1].valid = true;\n perimeter[2*i+1].draw = true;\n }\n\n //Verticies handled on a per-object basis, no need to generate vertexes as the maze is built. Generated here for debug only.\n /* allocate vertex array */\n vertex = []\n for(var i = 0; i < vertices; i++)\n vertex.push(vec2())\n\n /* figure out the spacing between vertex coordinates. we want\n square cells so use the minimum spacing */\n inc = (3.6/w1)*10;\n t = (3.6/h1)*10;\n if (t < inc) {\n inc = t;\n }\n /* determine the required offsets to center the maze using the\n spacing calculated above */\n xoff = Math.floor((4.0-w1*inc)/2 - 2.0);\n yoff = Math.floor((4.0-h1*inc)/2 - 2.0);\n /* fill in the vertex array */\n for (i=0; i<vertices; i++) {\n x = Math.floor(i%(w1+1));\n y = Math.floor(i/(w1+1));\n vertex[i][0] = x*inc + xoff;\n vertex[i][1] = y*inc + yoff;\n }\n\n /* allocate the group table */\n group = []\n\n /* set the group table to the identity */\n for (i=0; i<groups; i++) {\n group[i] = i;\n }\n}", "function drawMountains()\n{\n\tfor(var i = 0; i < mountain.length; i++)\n\t\t{\n\t\t\tfill(128,128,128,100);\n\t\t\ttriangle(mountain[i].x_pos - 75,\n\t\t\t\t mountain[i].y_pos +272,\n\t\t\t\t mountain[i].x_pos,\n\t\t\t\t mountain[i].y_pos,\n\t\t\t\t mountain[i].x_pos + 75,\n\t\t\t\t mountain[i].y_pos + 272);\n\t\t}\n}", "draw(){\r\n canvas.width = this.size\r\n canvas.height = this.size\r\n canvas.style.background = \"white\"\r\n curr.has_visited = true\r\n\r\n //show every cell\r\n for(let r = 0; r < this.rows;r++)\r\n for(let c = 0; c < this.cols;c++)\r\n this.mazegrid[r][c].show()\r\n\r\n //get the next cell as one of the current's neighbors\r\n let next = curr.getNeighbors()\r\n\r\n if(next){//if there is another neighbor\r\n next.has_visited=true\r\n this.stack.push(curr)\r\n removeWall(curr,next) //remove the wall between current and next\r\n curr = next\r\n }\r\n else if(this.stack.length>0){ //back-tracker: if there are no more neighbors that need to visited, the stack will pop out a cell that wasn't visited\r\n curr = this.stack.pop()\r\n }\r\n\r\n if(this.stack.length === 0)\r\n return\r\n else this.draw() //recurse until every cell has been visited/ejected from the stack\r\n\r\n }", "function draw(){\n prepareMatrix();\n\n //draw the arena to see the previous pieces\n drawMatrix(arena, {x: 0, y: 0});\n //draw the player matrix to see the current piece\n drawMatrix(player.matrix, player.pos);\n}", "function renderMap(){\n clearMap();\n var currentVertice\n for(var y = 0; y < scaledHeight+1; y++){\n for(var x = 0; x < scaledHeight+1; x++){\n if(renderTopLeft[0]+x >= 0 && renderTopLeft[0] + x < vertices.length){\n if(renderTopLeft[1]+y >= 0 && renderTopLeft[1]+y < vertices[x].length){\n currentVertice = vertices[renderTopLeft[0]+x][renderTopLeft[1]+y];\n\n // check rooms\n for(var i = 0; i < allRooms.length; i++){\n if(allRooms[i].getTopLeft() == currentVertice && allRooms[i].found == true){\n allRooms[i].activateAllVertice();\n allRooms[i].draw();\n }\n }\n // check passageways\n for(var i = 0; i < allPassageways.length; i++){\n if(allPassageways[i].getTopLeft() == currentVertice && allPassageways[i].found == true){\n allPassageways[i].draw();\n }\n }\n\n // check doors\n for(var i = 0; i < allDoors.length; i++){\n if(allDoors[i].getTopLeft() == currentVertice && allDoors[i].found === true){\n allDoors[i].draw(allDoors[i].getDirection());\n }\n }\n\n // check all chests\n for(var i = 0; i < allChests.length; i++){\n if(allChests[i].found == true){\n if(allChests[i].getTopLeft() == currentVertice){\n allChests[i].draw();\n }\n }\n }\n\n // checks all traps\n for(var i = 0; i < allTraps.length; i++){\n if(allTraps[i].found === true){\n if(allTraps[i].getTopLeft() == currentVertice){\n allTraps[i].draw();\n }\n }\n }\n\n }\n }\n }\n }\n}", "function draw() {\n background(0)\n t = new Turtle();\n noLoop()\n\n noFill()\n stroke(255, 210)\n strokeWeight(1.5)\n\n unitW = width/scl;\n unitH = height/scl;\n\n\n //create a grid\n // for (var y=0; y<scl; y++){\n // for (var x=0; x<scl; x++){\n // push ()\n // stroke(70);\n // strokeWeight(.3)\n // rect(x*unitW, y*unitH, unitW, unitH)\n // pop ()\n // }\n // }\n\n\n //x, y location -- //size\n makePom(0, 3*unitH, unitW, 2*unitH, -1); \n // makePom(unitW*5, 6*unitH, unitW, 2*unitH, -1);\n // makePom(unitW*6, 6*unitH, unitW, 2*unitH, -1);\n\n makePine(unitW*.5, unitH*6.3, unitW, unitH); \n makePine(unitW*1.5, unitH*7, unitW, unitH); \n makePine(unitW*.5, unitH*7, unitW, unitH); \n makePine(unitW*3, unitH, unitW, unitH); \n\n makeLeafPlant(unitW*2, 4*unitH, unitW, 1.5*unitH, -1);\n makeLeafPlant(unitW*3, 7*unitH, unitW, 1.5*unitH, 1);\n makeLeafPlant(unitW*3, 7*unitH, unitW, 1.5*unitH, -1);\n makeLeafPlant(unitW*4, 7*unitH, unitW, 1.5*unitH, -1);\n\n makeNeedlePlant(unitW*3,unitH*5, unitW, unitH, 1);\n makeNeedlePlant(unitW*6,unitH, unitW, unitH, 1);\n\n var numSquiggles = random(2, 5);\n createPlantSquiggle(5*unitW, unitH*2, unitW, unitH, numSquiggles);\n createPlantSquiggle(6*unitW, unitH*2, unitW, unitH, numSquiggles);\n \n \n createPlantFlower(unitW*5, unitH*4, unitW, unitH, unitW*.5, random(1, 5), random(0, unitW*.005)); \n createPlantFlower(unitW*5, unitH*5, unitW, unitH, unitW*.5, random(1, 5), random(0, unitW*.005)); \n createPlantFlower(unitW*6, unitH*4, unitW, unitH, unitW*.5, random(1, 5), random(0, unitW*.005)); \n createPlantFlower(unitW*6, unitH*5, unitW, unitH, unitW*.5, random(1, 5), random(0, unitW*.005)); \n t.penUp();\n\n\n var startHt = 3*unitH\n for (var i=0; i<2; i++){\n t.pushState();\n createPond(4*unitW, startHt, unitW, unitH)\n t.popState();\n startHt += unitH*.05;\n }\n\n\n\n t.pushState();\n var numSquiggles = 4;\n createPlantSquiggle(unitW, unitH*3, unitW, unitH, numSquiggles);\n t.popState();\n\n t.pushState();\n var numSquiggles = 4;\n createPlantSquiggle(unitW, unitH*4, unitW, unitH*2, numSquiggles);\n t.popState();\n\n t.pushState();\n createPlantBushWide(0, 0, unitW, unitH);\n t.popState();\n\n //plant types: flower, squiggle, bush\n //also the pond one\n \n\n // for (x=0; x<scl; x++){\n // t.penUp();\n // t.pushState()\n // var size = random(.2*unitW, unitW*.6);\n // var gap = random(0, size*.005); //gap between petals\n // var numPetals = random(1, 5) \n // push ()\n // //centers along corner by default so add half unit\n // createPlantFlower(x*unitW, 0, unitW, unitH, size, numPetals, gap)\n // t.penDown()\n // pop ()\n \n // t.popState();\n // }\n \n // t.pushState();\n // for (x=0; x<scl; x++){\n // t.pushState();\n // var sizeFactor = random(0.8, 1.2);\n // createPlantLine(x*unitW, unitH, unitW, unitH);\n // t.penUp();\n // t.popState();\n // }\n // t.popState(); \n\n // t.pushState();\n // for (x=0; x<scl; x++){\n\n // var numSquiggles = random(2, 5);\n // createPlantSquiggle(x*unitW, unitH*2, unitW, unitH, numSquiggles);\n // t.penUp();\n // }\n // t.popState();\n\n \n // for (x=0; x<scl; x++){\n // t.penUp();\n // t.pushState()\n\n // var size = random(.1*unitW, unitW*.13);\n // var gap = random(size*.1, size*.15);\n // var numPetals = random(10, 30)\n // push ()\n // strokeWeight(2)\n // createPlantFlower(x*unitW, unitH*3, unitW, unitH, size, numPetals, gap)\n // t.penDown()\n // pop ()\n // t.penUp();\n // t.popState();\n // }\n \n // t.pushState();\n // for (x=0; x<scl; x++){ \n // createPlantBush(x*unitW, unitH*4, unitW, unitH);\n // t.penUp();\n // }\n // t.popState();\n\n\n // t.pushState();\n // for (x=0; x<scl; x++){\n // createPlantRound(x*unitW, unitH*5, unitW, unitH);\n // t.penUp();\n // }\n // t.popState();\n\n // var size = unitH;\n // var gap = size*0.015;\n // var numPetals = 3 \n // push ()\n // //centers along corner by default so add half unit\n // t.pushState();\n // createPlantFlower(0, unitH*6, unitW, unitH*2, unitW, numPetals, gap)\n // t.popState();\n // pop();\n\n // t.pushState();\n // var numSquiggles = 4;\n // createPlantSquiggle(unitW, unitH*6, unitW, unitH*2, numSquiggles);\n // t.popState();\n\n\n \n // t.pushState();\n // createPlantBushWide(unitW*2, unitH*6, unitW*2, unitH);\n // t.penUp();\n // t.popState(); \n\n\n // t.pushState();\n // createPlantLine(5*unitW, unitH*6, unitW, unitH*2);\n // t.popState();\n // t.penUp();\n\n\n // t.pushState();\n // createPlantBush(6*unitW, unitH*6, unitW, unitH*2);\n // t.popState(); \n\n // t.pushState();\n // createPlantRoundTall(7*unitW, unitH*6, unitW, unitH*2);\n // t.popState(); \n\n\n \n\n\n\n\n}", "function grid(){\r\nfor(y = 0; y < maze.length; y++){\r\n \r\n for(x = 0; x < maze[y].length; x++){\r\n \r\n if(maze[y][x] == 0){\r\n ctx.fillStyle = \"#315625\";\r\n ctx.fillRect(x*tSize,y*tSize,tSize,tSize);\r\n}\r\n if(maze[y][x] == 2){\r\n ctx.drawImage(imghole, x*tSize,y*tSize,tSize,tSize);\r\n}\r\n if(maze[y][x] == 1){\r\n ctx.drawImage(imgbush, x*tSize,y*tSize,tSize,tSize);\r\n}\r\n if(maze[y][x] == 3){\r\n ctx.drawImage(imgmushroom, x*tSize,y*tSize,tSize,tSize);\r\n}\r\n if(maze[y][x] == 4){\r\n ctx.drawImage(imgcheshire, x*tSize,y*tSize,tSize,tSize);\r\n}\r\n if(maze[y][x] == 5){\r\n ctx.drawImage(imgcard, x*tSize,y*tSize,tSize,tSize);\r\n}\r\n if(maze[y][x] == player){\r\n ctx.drawImage(imgalice, x*tSize,y*tSize,tSize,tSize);\r\n playerPosition = {y:y,x:x};\r\n console.log(playerPosition.y + \" \" + playerPosition.x)\r\n }\r\n }\r\n }\r\n}", "function drawMountains()\n{\n for(var i = 0; i < mountains.length; i++)\n {\n push()\ntranslate(450, 35)\n //mountain \n noStroke()\n fill(130);\n triangle(mountains[i].x, mountains[i].y, 200, 150, 397, mountains[i].y);\n \n//mountain peek\n noStroke()\n fill(245,248,240);\nquad(143,220,200,150,250,210,200,190);\n pop();\n }\n\n}", "function genMaze(){\n //Recursive backtracking\n \n var validMoves = true;\n var moveList = ['n', 'e', 's', 'w'];\n //Generate maze with all walls\n //0 = unvisited \n //1 = visited\n var mazeArray = [];\n var grid = [];\n for(var i=0; i<gridSize; i++){\n tempArray = [];\n tempGrid = [];\n for(var j=0; j<gridSize; j++){\n tempArray.push('nsew');\n tempGrid.push(0);\n };\n mazeArray.push(tempArray);\n grid.push(tempGrid);\n };\n\n function checkNeighbors(x,y,grid){\n if(y != gridSize-1){\n if(grid[y+1][x] == 0){\n return(true);\n }\n }\n if(x != gridSize-1){\n if(grid[y][x+1] == 0){\n return(true);\n }\n }\n if(y != 0){\n if(grid[y-1][x] == 0){\n return(true);\n }\n }\n if(x != 0){\n if(grid[y][x-1] == 0){\n return(true);\n }\n }\n return(false);\n }\n\n function getAbsolute(dir, facing){\n if(dir == \"l\"){//left\n tempFacing = moveList[(moveList.indexOf(facing)+3)%4];\n } else if(dir == \"s\"){//straight\n tempFacing = facing;\n } else if(dir == \"r\"){//right\n tempFacing = moveList[(moveList.indexOf(facing)+1)%4];\n }\n return(tempFacing);\n }\n\n function checkMove(x,y, tempFacing){\n var result = true;\n if(tempFacing == 'n'){\n if(y == 0){\n result = false;\n } else if(grid[y-1][x] == 1){\n result = false;\n }\n } else if(tempFacing == 'e'){\n if(x == gridSize-1){\n result = false;\n } else if(grid[y][x+1] == 1){\n result = false;\n }\n } else if(tempFacing == 's'){\n if(y == gridSize-1){\n result = false;\n } else if(grid[y+1][x] == 1){\n result = false;\n }\n } else if(tempFacing == 'w'){\n if(x == 0){\n result = false;\n } else if(grid[y][x-1] == 1){\n result = false;\n }\n } \n return(result);\n }\n\n\n\n visitedList = [];\n fx = Math.floor(Math.random()*gridSize-1);\n fy = Math.floor(Math.random()*gridSize-1);\n grid[fy][fx] = 1;\n //main generation loop\n\n while(visitedList.length < gridSize**2){\n \n //Get visited\n visitedList = [];\n for(var y = 0; y <= gridSize-1; y++) {\n (grid[y]).forEach(function getVisited(item, index){\n if(item == 1){\n visitedList.push([index, y]);\n }\n });\n };\n running = true;\n while(running == true){\n //Pick one at random\n randIndex = Math.floor(Math.random()*visitedList.length);\n var fcoord = visitedList[randIndex];\n fx = fcoord[0];\n fy = fcoord[1];\n if(checkNeighbors(fx,fy,grid)){\n x=fx;\n y=fy;\n surroundingGrid = [];\n if(y != gridSize-1){\n if(grid[y+1][x] == 0){\n surroundingGrid.push('s');\n }\n }\n if(x != gridSize-1){\n if(grid[y][x+1] == 0){\n surroundingGrid.push('e');\n }\n }\n if(y != 0){\n if(grid[y-1][x] == 0){\n surroundingGrid.push('n');\n }\n }\n if(x != 0){\n if(grid[y][x-1] == 0){\n surroundingGrid.push('w');\n }\n }\n facing = surroundingGrid[(Math.floor(Math.random()*surroundingGrid.length))];\n running = false;\n }\n }\n //Move until stuck\n validMoves = checkNeighbors(fx,fy,grid);\n console.log('upper loop')\n var loopCount = 0;\n while(validMoves == true & loopCount < 100){\n \n grid[fy][fx] = 1;\n dir = 'lsr'.charAt(Math.floor(Math.random()*3));\n absMoveDir = getAbsolute(dir,facing);\n \n if(checkMove(fx,fy,absMoveDir) == true){//if a move returns false it is illegal\n \n if(absMoveDir == 'n'){\n mazeArray[fy][fx] = mazeArray[fy][fx].replace('n','');\n mazeArray[fy-1][fx] = mazeArray[fy-1][fx].replace('s','');\n fy = fy - 1;\n\n } else if(absMoveDir == 'e'){\n mazeArray[fy][fx] = mazeArray[fy][fx].replace('e','');\n mazeArray[fy][fx+1] = mazeArray[fy][fx+1].replace('w','');\n fx = fx+ 1;\n } else if (absMoveDir == 's'){\n mazeArray[fy][fx] = mazeArray[fy][fx].replace('s','');\n mazeArray[fy+1][fx] = mazeArray[fy+1][fx].replace('n','');\n fy = fy + 1;\n } else if(absMoveDir == 'w'){\n mazeArray[fy][fx] = mazeArray[fy][fx].replace('w','');\n mazeArray[fy][fx-1] = mazeArray[fy][fx-1].replace('e','');\n fx = fx - 1;\n }\n facing= absMoveDir;\n \n }\n \n validMoves = checkNeighbors(fx,fy,grid);\n if(validMoves == true){\n console.log(fx,fy, validMoves, grid);\n }\n loopCount++;\n \n }\n }\n\n return(mazeArray)\n}", "function draw() {\n ellipse(100, 100, 100, 100)\n rect(30, 20, 55, 55)\n triangle(30, 75, 58, 20, 86, 75)\n }", "function draw() {\n\n// Establishing the colors\n background( 'grey' );\n stroke('pink');\n\n//Creating the for loop to create my abstract grid design. Going from top to bottom.\nfor(var x= 0; x<800; x+= 40){\nline(x, 0, x - slant, height);\n\n}\n\n// Creating the for loop going from bottom to top.\nfor(var x= 0; x<800; x+= 40){\n line(x, 0, x + slant, height);\n}\n\n}", "function draw() {\n //background(gui.color);\n background(gui.bColor);\n \n for (let x = windowWidth / 2 - windowWidth / 4; x <= windowWidth / 2 + windowWidth / 4; x += windowWidth / 4) \n for (let y = windowHeight / 2 - windowHeight / 4; y <= windowHeight / 2 + windowHeight / 4; y += windowHeight / 4){ diamond(x, y, random(50), random(3, 2));}\n \n strokeWeight(gui.stroke);\n stroke(gui.color);\n fill(gui.r,gui.g,gui.b,gui.alpha);\n //translate(width/2,height/2);\n //rotate(PI / gui.rotate);\n //diamond(0,0, gui.radius1, gui.radius2, gui.points);\n}", "display(){\n noStroke();\n fill(245,172,114);\n ellipse(this.location.x, this.location.y, this.mass * 5, this.mass * 5)\n }", "function build()\n{\n columns = Number(document.forms.mazeform.m.value);\n rows = Number(document.forms.mazeform.n.value);\n size = 25;\n\t\n seed = Math.floor(Math.random() * 1000000000);\n rnd.seed = seed;\n \n /* disable the Generate and Solve buttons until it's generated */\n document.forms.mazeform.slv.disabled = true;\n document.forms.mazeform.bld.disabled = true;\n \n /* get the HTML element for the container to hold the maze */\n /* and delete the old one if any */\n box = document.getElementById(\"box\");\n omaze = document.getElementById(\"maze\");\n if(omaze != null)\n {\n box.removeChild(omaze);\n }\n \t\n\t\n /* set the width of the box based on the size of the maze */\n box.style.width = ((columns * size) + 2) + \"px\";\n \n /* the style of the CSS class \".cell\" needs to be updated dynamically\n which has some browser-specific quirks */\n var style = document.styleSheets[2];\n var rules = style.cssRules;\n \n /* IE doesn't understand the cssRules property */\n if(rules != undefined)\n { \n /* instead of hard-coded rule numbers, we should be able to\n use rules.length, but Safari has a bug where the size of \n the rules array doesn't change even after a rule is deleted */\n style.deleteRule(14); \n style.deleteRule(13); \n style.insertRule(\".cell {height: \" + size + \"px}\", 13);\n style.insertRule(\".cell {width: \" + size + \"px}\", 14);\n \n classAttr = \"class\";\n ie = false;\n }\n else\n {\n rules = style.rules; // ie-speak\n rules[15].style.height = size + \"px\"; // nor does it count the \n rules[16].style.width = size + \"px\"; // rules in the same way\n \n classAttr = \"className\"; // ie-speak\n ie = true;\n }\n \n /* create maze object */\n instance = new maze();\n \n /* render and display */\n instance.build();\n \n /* tell the form not to actually submit anything */\n return false;\n}", "function drawMap() {\r\n\t\t\tPacman.contextBackground.fillStyle = \"#000\";\r\n\t\t\tPacman.contextBackground.fillRect(0, 0, Pacman.canvas.width, Pacman.canvas.height);\r\n\r\n\t\t\tdrawWalls();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tfor (var i = 0; i < Pacman.gameHeight; i++) {\r\n\t\t \tfor (var j = 0; j < Pacman.gameWidth; j++) {\t \t\r\n\t\t\t \tvar map = Pacman.currentGameMap[i][j];\r\n\t\t\t \t\r\n\t\t\t \tif (map === Pacman.PILL) {\r\n\t\t\t \t\tPacman.contextBackground.beginPath();\r\n\t\t\t \t\t// fillStyle - Sets or returns the color, gradient, or pattern used to fill the drawing\r\n\t\t\t \t\tPacman.contextBackground.fillStyle = \"#FFF\";\r\n\t \t\t\t\t// arc - Creates an arc/curve (used to create circles, or parts of circles)\r\n\t \t\t\t\tPacman.contextBackground.arc((j * Pacman.gameMapBlockSizeX) + Pacman.gameMapBlockSizeX / 2, (i * Pacman.gameMapBlockSizeY) + Pacman.gameMapBlockSizeY / 2, 6, 0, 2 * Math.PI, false);\r\n\t \t\t\t\tvar canvas = document.getElementById('myCanvas');\r\n \r\n\t\t \t\t\t// fill - Fills the current drawing (path)\r\n \tPacman.contextBackground.fill();\r\n\t\t\t \t} else if (map === Pacman.PELLET) {\r\n\t\t\t \t\tPacman.contextBackground.beginPath();\r\n\t\t\t \t\t// fillStyle - Sets or returns the color, gradient, or pattern used to fill the drawing\r\n\t\t\t \t\tPacman.contextBackground.fillStyle = \"#FFF\";\r\n\t\t\t\t\t\tPacman.contextBackground.fillRect((j * Pacman.gameMapBlockSizeX) + (Pacman.gameMapBlockSizeX / 2.5), (i * Pacman.gameMapBlockSizeY) + (Pacman.gameMapBlockSizeY / 2.5), \r\n\t\t\t\t\t\t\tPacman.gameMapBlockSizeX / 6, Pacman.gameMapBlockSizeY / 6);\r\n\t\t\t \t} else\r\n\t\t\t \t\tcontinue;\r\n\t\t\t\t\t// closePath - Creates a path from the current point back to the starting point\t\t\t \t\t\r\n\t\t\t\t\tPacman.contextBackground.closePath();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function draw(mst)\r\n{\r\n\r\n //This function runs until the entire maze has been carved by MST array\r\n var carve = setInterval(function() {\r\n \r\n //refreshes the viewing canvas so that changes can been seen\r\n content.clearRect(0,0,canvas.width,canvas.height)\r\n content.strokeStyle = \"black\";\r\n content.lineWidth =3;\r\n content.rect(0,0,len*n,len*n);\r\n content.stroke();\r\n\r\n //This is where the maze is carved using MST.\r\n //starting value is extracted out of the first index of the MST array and set to the corresponding starting vertex\r\n starting = linearVertex[mst[0][0]];\r\n\r\n //used to show the walls between all the vertexs in the maze and draws the starting vertex with a light blue color.\r\n //Displays the maze\r\n for(var i=0; i< linearVertex.length; i++)\r\n {\r\n linearVertex[i].show();\r\n starting.startindex();\r\n }\r\n\r\n //starts from the starting vertex and then removes all the edge connection using the MST array.\r\n //Eliminating all the edges which correspond to the MST array would display a maze as a byproduct\r\n if(count<mst.length)\r\n {\r\n //removes edges using MST from Vertex 1 to Vertex2 for the entire grid\r\n for(var j = 0; j< linearVertex[mst[count][0]].edgeConnection.length; j++)\r\n {\r\n if(linearVertex[mst[count][0]].edgeConnection[j].vertex2 === mst[count][1])\r\n {\r\n linearVertex[mst[count][0]].edgeConnection.splice(j,1);\r\n \r\n }\r\n }\r\n\r\n //removes edges using MST from Vertex2 to Vertex1 for the entire grid\r\n for(var k= 0; k< linearVertex[mst[count][1]].edgeConnection.length; k++)\r\n {\r\n if( linearVertex[mst[count][1]].edgeConnection[k].vertex2 === mst[count][0])\r\n {\r\n linearVertex[mst[count][1]].edgeConnection.splice(k,1);\r\n \r\n }\r\n }\r\n }\r\n //count is used as a way of stoping the timer\r\n count++;\r\n //when count has reached the length of MST then it has covered all the vertex and it can stop the timer\r\n if(count>mst.length)\r\n {\r\n clearInterval(carve);\r\n }\r\n \r\n },speed);\r\n \r\n //DFS function is called and passes the MST used by the draw function to show the dfs algorithum\r\n dfs(mst);\r\n\r\n}", "function maze(){\n //The funktion values if the command is true. The command is y < lane1.length.\n //If the command is true, the function create(y) will run.\n //y++ is autoincrement. It means y increases with 1 for every loop.\nfor(y = 0; y < lane4.length; y++){\n create(y);\n}\n}", "function setup(){\r\ncols = Math.floor(width/w);\r\nrows = Math.floor(height/w);\r\n//for each column in each row create a cell\r\nfor (let rn = 0; rn < rows; rn++){\r\n for(let cn = 0; cn < cols; cn++){\r\n const cell = new Maze(cn,rn);\r\n grid.push(cell);\r\n }\r\n current = grid[0]; \r\n}\r\n}", "function grid(){\nfor(y = 0; y < maze.length; y++){\n for(x = 0; x < maze[y].length; x++){\n if(maze[y][x] == 0) { // selve banen\n ctx.drawImage(wallImg, x*tileSize, y*tileSize, tileSize, tileSize);\n }else if(maze[y][x] == 2){ // mål \n ctx.drawImage(goal, x*tileSize, y*tileSize, tileSize, tileSize);\n }else if(maze[y][x] == player){ //player = 3\n playerPosition = {y, x}; \n ctx.drawImage(nisse, x*tileSize, y*tileSize, tileSize, tileSize);\n }else if(maze[y][x] == 4){ //bomb \n ctx.drawImage(bombeImg, x*tileSize, y*tileSize, tileSize, tileSize);\n }else if(maze[y][x] == 5){ //point \n ctx.drawImage(nisseHue, x*tileSize, y*tileSize, tileSize, tileSize);\n }\n else if(maze[y][x] == 6){ //nøgler\n ctx.drawImage(giftOne, x*tileSize, y*tileSize, tileSize, tileSize);\n }else{\n ctx.fillStyle = \"white\"; \n ctx.fillRect(x*tileSize, y*tileSize, tileSize, tileSize); \n }\n }\n}\n}", "function draw() {\n drawbackground();\n drawHoles();\n }", "function draw() {\n context.fillStyle = '#212121';\n context.fillRect(0, 0, canvas.width, canvas.height);\n \n drawMatrix(arena, {x: 0, y:0});\n drawMatrix(player.matrix, player.pos); \n}", "function print(maze) {\n\tfor(var y=0;y<maze.length;y++) {\n\t\tvar str = \" \";\n\t\tfor(var x=0;x<maze.length;x++) {\n\t\t\tstr += maze[x][y] == true ? \"#\" : \" \";\n\t\t}\n\t\tconsole.log(str);\n\t}\n}", "display() {\n fill(this.color);\n\n triangle(this.x, this.y, this.x + 30, this.y - 55, this.x + 60, this.y);\n strokeWeight(7); //important for line to be visible\n strokeCap(SQUARE);\n stroke(this.color);\n\n //levitating line\n line(this.x, this.lineY - 30, this.x + 60, this.lineY - 30);\n\n //little eyes\n strokeWeight(3);\n stroke(\"white\");\n line(this.x + 10, this.y - 10, this.x + 20, this.y - 10);\n line(this.x + 30, this.y - 10, this.x + 40, this.y - 10);\n\n noStroke(); //reset so stroke doesn't carry into other creatures\n }", "display(){\n noStroke();\n fill(0,0,0);\n ellipse(this.location.x, this.location.y, this.mass * 5, this.mass * 5)\n noFill();\n stroke(255,255,255);\n ellipse(this.location.x, this.location.y, 200, 200);\n }", "function mazeBuilder(x,y) {\n\tthis.columns = x;\n\tthis.rows = y;\n\tthis.totalCells = this.columns * this.rows;\n\tthis.currentCell = [Math.floor(Math.random()*y), Math.floor(Math.random()*x)];\n\tthis.path = [];\n\tthis.maze = [];\n\tthis.numberVisited = 0;\n\tthis.unvisitedCells = [];\n}", "function initLogicalMaze()\n {\n //This function is hard-coded for a fixed maze of length 23 across and down.\n // I will manually make rows 0-11. Rows 12-22 will be a mirror image of rows 0-10.\n\n // Note by default each square is already a GRID_BLANK due to initGrid()\n\n //row 0\n for(var i = 0; i < GRIDSIZE; i++)\n {\n GRID[i][0] = GRID_WALL;\n }\n\n //row 1\n GRID[0][1] = GRID_WALL;\n GRID[1][1] = GRID_PORTAL;\n GRID[4][1] = GRID_WALL;\n GRID[10][1] = GRID_WALL;\n GRID[12][1] = GRID_WALL;\n GRID[21][1] = GRID_PORTAL;\n GRID[22][1] = GRID_WALL;\n\n //row 2\n GRID[0][2] = GRID_WALL;\n GRID[2][2] = GRID_WALL;\n\n for(i = 6; i <= 22; i += 2)\n {\n GRID[i][2] = GRID_WALL;\n }\n\n //row 3\n GRID[0][3] = GRID_WALL;\n GRID[2][3] = GRID_WALL;\n GRID[3][3] = GRID_WALL;\n GRID[5][3] = GRID_WALL;\n GRID[6][3] = GRID_WALL;\n GRID[8][3] = GRID_WALL;\n GRID[9][3] = GRID_WALL;\n for(i = 10; i <= 22; i += 2)\n {\n GRID[i][3] = GRID_WALL;\n }\n\n //row 4\n GRID[0][4] = GRID_WALL;\n GRID[5][4] = GRID_WALL;\n GRID[8][4] = GRID_WALL;\n GRID[22][4] = GRID_WALL;\n\n //row 5\n GRID[0][5] = GRID_WALL;\n GRID[1][5] = GRID_WALL;\n GRID[3][5] = GRID_WALL;\n GRID[5][5] = GRID_WALL;\n GRID[7][5] = GRID_WALL;\n GRID[8][5] = GRID_WALL;\n for(i = 10; i <= 16; i++)\n {\n GRID[i][5] = GRID_WALL;\n }\n GRID[17][5] = GRID_HEALTH_PICKUP;\n GRID[18][5] = GRID_WALL;\n GRID[19][5] = GRID_WALL;\n GRID[20][5] = GRID_WALL;\n GRID[22][5] = GRID_WALL;\n\n //row 6\n GRID[0][6] = GRID_WALL;\n GRID[3][6] = GRID_WALL;\n GRID[5][6] = GRID_WALL;\n GRID[10][6] = GRID_WALL;\n GRID[14][6] = GRID_WALL;\n GRID[16][6] = GRID_WALL;\n GRID[17][6] = GRID_WALL;\n GRID[18][6] = GRID_WALL;\n GRID[22][6] = GRID_WALL;\n\n //row 7\n GRID[0][7] = GRID_WALL;\n GRID[2][7] = GRID_WALL;\n GRID[3][7] = GRID_WALL;\n GRID[7][7] = GRID_WALL;\n GRID[9][7] = GRID_WALL;\n GRID[10][7] = GRID_WALL;\n GRID[12][7] = GRID_WALL;\n GRID[14][7] = GRID_WALL;\n GRID[18][7] = GRID_WALL;\n GRID[19][7] = GRID_DAMAGE_PICKUP;\n GRID[20][7] = GRID_WALL;\n GRID[22][7] = GRID_WALL;\n\n //row 8\n GRID[0][8] = GRID_WALL;\n GRID[2][8] = GRID_DAMAGE_PICKUP;\n GRID[3][8] = GRID_WALL;\n GRID[4][8] = GRID_WALL;\n GRID[5][8] = GRID_WALL;\n GRID[7][8] = GRID_WALL;\n GRID[12][8] = GRID_WALL;\n GRID[14][8] = GRID_WALL;\n GRID[16][8] = GRID_WALL;\n GRID[18][8] = GRID_WALL;\n GRID[19][8] = GRID_WALL;\n GRID[20][8] = GRID_WALL;\n GRID[22][8] = GRID_WALL;\n\n //row 9\n GRID[0][9] = GRID_WALL;\n GRID[2][9] = GRID_WALL;\n GRID[4][9] = GRID_HEALTH_PICKUP;\n GRID[5][9] = GRID_WALL;\n for(i = 7; i <= 10; i++)\n {\n GRID[i][9] = GRID_WALL;\n }\n GRID[12][9] = GRID_WALL;\n GRID[16][9] = GRID_WALL;\n GRID[22][9] = GRID_WALL;\n\n //row 10\n GRID[0][10] = GRID_WALL;\n GRID[4][10] = GRID_WALL;\n GRID[8][10] = GRID_WALL;\n GRID[10][10] = GRID_WALL;\n GRID[12][10] = GRID_WALL;\n GRID[13][10] = GRID_WALL;\n GRID[15][10] = GRID_WALL;\n GRID[17][10] = GRID_WALL;\n GRID[18][10] = GRID_WALL;\n GRID[20][10] = GRID_WALL;\n GRID[21][10] = GRID_WALL;\n GRID[22][10] = GRID_WALL;\n\n //row 11. This is the middle row (it will not be mirrored, only 0-10 will be mirrored)\n for(var i = 0; i <= 3; i++)\n {\n GRID[i][11] = GRID_WALL;\n }\n GRID[4][11] = GRID_PORTAL;\n GRID[6][11] = GRID_WALL;\n GRID[22][11] = GRID_WALL;\n\n //mirror the remaining rows.\n var jOld = 10;\n for(var jNew = 12; jNew < GRIDSIZE; jNew++)\n {\n for(i = 0; i < GRIDSIZE; i++)\n {\n GRID[i][jNew] = GRID[i][jOld];\n }\n jOld--;\n }\n\n }", "function constructMaze() {\n let wallMeshes = [];\n let floorMeshes = [];\n\n let width = 1;\n let height = 1;\n\n // rotations to get floor to wall orientation\n let leftRotation = vec3.fromValues(0, Math.PI / 2, 0);\n let rightRotation = vec3.fromValues(0, -Math.PI / 2, 0);\n let topRotation = vec3.fromValues(-Math.PI / 2, 0, 0);\n let bottomRotation = vec3.fromValues(Math.PI / 2, 0, 0);\n\n // floor rotation is just not rotating at all\n let floorRotation = vec3.fromValues(0, 0, 0);\n\n for (let i = 0; i < maze.sizeX; i++) {\n for (let j = 0; j < maze.sizeY; j++) {\n let isWall = maze.data[i][j] == 1;\n\n let left = i;\n let right = i + 1;\n let top = j + 1;\n let bottom = j;\n\n let centerX = i + 0.5;\n let centerY = j + 0.5;\n\n let floorZ = 0;\n let wallZ = 0.5;\n\n if (isWall) {\n // construct wall tile(s) here\n // contstruct a wall in every direction that has a free tile in it\n let drawLeft = i != 0 && maze.data[i-1][j] == 0;\n let drawRight = i != maze.sizeX - 1 && maze.data[i+1][j] == 0;\n let drawBottom = j != 0 && maze.data[i][j-1] == 0;\n let drawTop = j != maze.sizeY - 1 && maze.data[i][j+1] == 0;\n\n if (drawLeft) {\n let leftWallCenter = vec3.fromValues(left, centerY, wallZ);\n let leftWallShapeData = getQuadMesh(leftWallCenter, leftRotation, width, height);\n wallMeshes.push(leftWallShapeData);\n }\n if (drawRight) {\n let rightWallCenter = vec3.fromValues(right, centerY, wallZ);\n let rightWallShapeData = getQuadMesh(rightWallCenter, rightRotation, width, height);\n wallMeshes.push(rightWallShapeData);\n }\n if (drawBottom) {\n let bottomWallCenter = vec3.fromValues(centerX, bottom, wallZ);\n let bottomWallShapeData = getQuadMesh(bottomWallCenter, bottomRotation, width, height);\n wallMeshes.push(bottomWallShapeData);\n }\n if (drawTop) {\n let topWallCenter = vec3.fromValues(centerX, top, wallZ);\n let topWallShapeData = getQuadMesh(topWallCenter, topRotation, width, height);\n wallMeshes.push(topWallShapeData);\n }\n } else {\n let floorCenter = vec3.fromValues(centerX, centerY, floorZ);\n let floorShapeData = getQuadMesh(floorCenter, floorRotation, width, height);\n floorMeshes.push(floorShapeData);\n }\n }\n }\n\n return {\n wallMeshes: wallMeshes,\n floorMeshes: floorMeshes\n };\n}", "function generate_DFS(width, height) {\n var msize = width * height;\n\n //Typed Arrays in JS!\n var mazeData = new Uint8Array(msize);\n\n if (mazeData.byteLength != msize) {\n alert(\"Something horrible has happened during maze generation!\" +\n \"\\nYour browser probably doesn't support typed arrays.\");\n }\n\n //Set the initial state of the maze: everything is a wall, nothing is visited,\n //and all backtrack directions are 00 to easily mask them later.\n for (var i = 0; i < msize; i++) {\n mazeData[i] = 0xF0; //1111 0000\n }\n\n /**\n * Internal helper function to return a random neighboring cell ID which isn't\n * outside of the maze.\n *\n * @return The cell index of a random unvisited neighbor. -1 if none exist.\n */\n function getRandomUnvisitedNeighbor(where) {\n if (where < 0 || where >= msize) {\n alert(\"Neighbor index out of bounds: \" + where);\n return -1;\n }\n\n //Build a list of candidate neighbors. A neighbor is not a candidate if it\n //would be outside of the maze (border edge cases) or if it's visited.\n var candidates = [];\n\n //North\n if (where >= width) {\n if ((mazeData[where - width] & 0x02) == 0) {\n candidates.push(where - width);\n }\n }\n\n //South\n if (where + width < msize) {\n if ((mazeData[where + width] & 0x02) == 0) {\n candidates.push(where + width);\n }\n }\n\n //West\n if (where % width != 0) {\n if ((mazeData[where - 1] & 0x02) == 0) {\n candidates.push(where - 1);\n }\n }\n\n //East\n if ((where + 1) % width != 0) {\n if ((mazeData[where + 1] & 0x02) == 0) {\n candidates.push(where + 1);\n }\n }\n\n if (candidates.length == 0) {\n return -1;\n }\n\n return candidates[~~(Math.random() * candidates.length)];\n }\n\n /**\n * Because we store the backtrack direction in two bits, we need to be able to\n * get the cell ID of the neighbor we mean to backtrack to.\n *\n * @return the cell ID of where we arrive by travelling in `dir` from `whence`\n * where values for `dir` are 00 = N, 01 = E, 10 = W, 11 = S.\n */\n function getNeighbor(whence, dir) {\n if (whence < 0 || whence >= msize || dir < 0 || dir > 3) {\n alert(\"Internal argument error; dir: \" + dir + \"; whence: \" + whence);\n return -1;\n }\n\n //North\n if (dir == 0) {\n if (whence >= width) {\n return whence - width;\n } else {\n return -1;\n }\n }\n\n //South\n if (dir == 3) {\n if (whence + width < msize) {\n return whence + width;\n } else {\n return -1;\n }\n }\n\n //West\n if (dir == 2) {\n if (whence % width != 0) {\n return whence - 1;\n } else {\n return -1;\n }\n }\n\n //East\n if (dir == 1) {\n if ((whence + 1) % width != 0) {\n return whence + 1;\n } else {\n return -1;\n }\n }\n\n return -1;\n }\n\n //Pick a random cell to start from.\n var curCell = ~~(Math.random() * msize);\n mazeData[curCell] |= 0x03; //Home is both visited and the home cell.\n\n while (true) {\n //Pick an unvisited neighbor at random.\n var canCell = getRandomUnvisitedNeighbor(curCell);\n\n if (canCell == -1) {\n //This cell has no candidate neighbors, so backtrack from this cell, or\n //terminate if this is the home cell.\n if ((mazeData[curCell] & 0x01) == 1) {\n break;\n }\n\n curCell = getNeighbor(curCell, (mazeData[curCell] & 0x0C) >> 2);\n continue;\n }\n\n //Set new cell as visited.\n mazeData[canCell] |= 0x02;\n\n //See how we approached the new cell and demolish the appropriate walls.\n //Also, set the backtrack data on the candidate cell.\n switch (canCell - curCell) {\n case 1:\n //Went east\n mazeData[canCell] &= 0xDF;\n mazeData[curCell] &= 0xBF;\n\n //And should go back west\n mazeData[canCell] |= 0x08;\n break;\n case -1:\n //Went west\n mazeData[canCell] &= 0xBF;\n mazeData[curCell] &= 0xDF;\n\n //And should go back east\n mazeData[canCell] |= 0x04;\n break;\n case -width:\n //Went north\n mazeData[canCell] &= 0xEF;\n mazeData[curCell] &= 0x7F;\n\n //And should go back south\n mazeData[canCell] |= 0x0C;\n break;\n case width: //Went south\n mazeData[canCell] &= 0x7F;\n mazeData[curCell] &= 0xEF;\n\n //And should go back north\n mazeData[canCell] |= 0x00;\n break;\n }\n\n //Set the new cell as the current cell.\n curCell = canCell;\n }\n\n //Pick a random edge cell from which to knock out the exit, and also mark it\n //as \"non-visited\". Since we're done here, the visited bit doesn't matter and\n //since all other cells will be marked as visited, we can re-use it to\n //determine which cell is the exit ;)\n var rnd = ~~(Math.random() * 3);\n switch (rnd) {\n case 0:\n\n rnd = ~~(Math.random() * width);\n mazeData[rnd] &= 0x7D;\n break;\n case 1:\n\n rnd = ~~(Math.random() * height);\n mazeData[(rnd + 1) * width - 1] &= 0xBD;\n break;\n case 2:\n\n rnd = ~~(Math.random() * height);\n mazeData[rnd * width] &= 0xDD;\n break;\n case 3:\n\n rnd = ~~(Math.random() * width);\n mazeData[(height - 1) * width + rnd] &= 0xED;\n break;\n }\n\n return mazeData;\n}", "function draw() {\n // Clears everything to make all of the pixels 100% transparent\n clear(); // avoids having planets leave a trail\n\n // Removing the stroke on all planets\n noStroke();\n\n // Draw the sun and each planet\n planets();\n\n // Draw saturn's ring\n push();\n saturnRing();\n pop();\n\n // P5's orbitControl() allows you to drag and move around the world\n // in this case, the zoom is disabled\n orbitControl();\n}", "function buildMaze() {\n\tconsole.log(\"buildMaze enter\"); \n\tvar a = new Array();\n\tfor(x=0; x<600; x+=10) {\n\t\tfor(y=0; y<600; y+=10) {\n\t\t\tvar cell = new Cell(x,y);\n\t\t\tvar id = x+\":\"+y;\n\t\t\ta[id]=cell;\n\t\t\t\n\t\t}\n\t}\n\tconsole.log(\"buildMaze exit\");\n\treturn a;\n}", "function Maze(i,j){\r\n this.i = i;//col number\r\n this.j = j;//row number\r\n this.walls = [true,true,true,true];\r\n this.visited = false;// at the beginning all cells are not visited\r\n\r\n //play buttons\r\n this.moveUp = function (){\r\n let top = grid[index(i,j-1)];\r\n if(top && this.walls[0] !== true) {\r\n counter++;\r\n return top;\r\n } else {\r\n return current\r\n }\r\n }\r\n this.moveRight = function (){\r\n let right = grid[index(i+1,j)];\r\n if(right && this.walls[1] !== true) {\r\n counter++;\r\n return right;\r\n } else {\r\n return current\r\n }\r\n }\r\n this.moveDown = function (){\r\n let bottom = grid[index(i,j +1)];\r\n if(bottom && this.walls[2] !== true) {\r\n counter++;\r\n return bottom;\r\n } else {\r\n return current\r\n }\r\n }\r\n this.moveLeft = function (){\r\n let left = grid[index(i-1,j)];\r\n if(left && this.walls[3] !== true) {\r\n counter++;\r\n return left;\r\n } else {\r\n return current\r\n }\r\n }\r\n //check neighbors function\r\n this.checkNeighbors = function(){\r\n const neighbors = [];\r\n let top = grid[index(i,j-1)];\r\n let right = grid[index(i+1,j)];\r\n let bottom = grid[index(i,j +1)];\r\n let left = grid[index(i-1,j)];\r\n if(top && !top.visited) {\r\n neighbors.push(top)\r\n }\r\n if(right && !right.visited) {\r\n neighbors.push(right)\r\n }\r\n if(bottom && !bottom.visited) {\r\n neighbors.push(bottom)\r\n }\r\n if(left && !left.visited) {\r\n neighbors.push(left)\r\n }\r\n if (neighbors.length > 0) {\r\n const random = Math.floor(Math.random() * neighbors.length);\r\n return neighbors[random]\r\n } else {\r\n return undefined\r\n }\r\n }\r\n //highligt the current cell\r\n this.highlight = function (){\r\n const x = this.i*w;\r\n const y = this.j*w;\r\n // mtx.beginPath();\r\n // mtx.fillStyle = \"rgba(0,255,255,100)\";\r\n // mtx.fillRect(x+3, y+3, w-6, w-6);\r\n mtx.drawImage(playerImg, x, y, w, w);\r\n }\r\n //highlight the finish cell\r\n this.finishColor = function () {\r\n const x = this.i*w;\r\n const y = this.j*w;\r\n // mtx.beginPath();\r\n // mtx.fillStyle = \"green\";\r\n // mtx.fillRect(x+3, y+3, w-6, w-6);\r\n mtx.drawImage(finishImg, x, y, w, w);\r\n }\r\n //show wall for each side and show visited rectangle\r\n this.show = function() { \r\n const x = this.i*w;\r\n const y = this.j*w;\r\n mtx.strokeStyle = \"#000000\"\r\n if(this.walls[0]){ // top wall\r\n mtx.beginPath();\r\n mtx.moveTo(x, y);\r\n mtx.lineTo(x+w, y);\r\n mtx.stroke();\r\n } \r\n if(this.walls[1]){ // right wall\r\n mtx.beginPath();\r\n mtx.moveTo(x+w, y);\r\n mtx.lineTo(x+w, y+w);\r\n mtx.stroke();\r\n } \r\n if(this.walls[2]){ // bottom wall\r\n mtx.beginPath();\r\n mtx.moveTo(x+w, y+w);\r\n mtx.lineTo(x, y+w);\r\n mtx.stroke();\r\n } \r\n if(this.walls[3]){ // left wall\r\n mtx.beginPath();\r\n mtx.moveTo(x, y+w);\r\n mtx.lineTo(x, y);\r\n mtx.stroke();\r\n }\r\n if(this.visited){ // draw a rectangle on visited cell\r\n mtx.beginPath();\r\n mtx.fillStyle = \"yellow\";\r\n mtx.fillRect(x, y, w, w);\r\n } \r\n }\r\n}", "function escapeMazeAllWays(maze, pos = 0, row = 0, col = 0, path = [], direction='S') {\n if (row >= maze.length || col >= maze[0].length) {\n return;\n }\n if (row < 0 || col < 0) {\n return;\n }\n\n path[pos] = direction;\n pos++;\n\n if (maze[row][col] === 'e') {\n console.log(path);\n return;\n }\n if (maze[row][col] === ' ') {\n maze[row][col] = 'x';\n escapeMaze(maze, pos, row, col + 1, path, 'R');\n escapeMaze(maze, pos, row, col - 1, path, 'L');\n escapeMaze(maze, pos, row + 1, col, path, 'D');\n escapeMaze(maze, pos, row - 1, col, path, 'U');\n maze[row][col] = ' ';\n }\n pos--;\n}", "show() {\n stroke(0);\n noFill();\n this.makeShape()\n if (this.revealed) {\n if (this.mine) {\n fill(127);\n ellipse(this.x + this.mineOffsetX, this.y + this.mineOffsetY, this.w * 0.5);\n } \n else {\n fill(200);\n this.makeShape()\n if (this.neighborCount > 0) {\n textAlign(CENTER);\n fill(0);\n text(this.neighborCount, this.x + this.textOffsetX, this.y + this.textOffsetY);\n }\n }\n }\n }", "function drawBabyzenomorph(x, y) {\n fill('grey')\n stroke('grey')\n strokeWeight(5)\n ellipse(x, y, w)\n ellipse(x, y - 20, w + 5, 25)\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 25, y - 25);\n vertex(x - 25, y - 25);\n vertex(x - 20, y - 35)\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 25, y - 25);\n vertex(x + 25, y - 25);\n vertex(x + 20, y - 35);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 30, y - 15);\n vertex(x + 30, y - 15);\n vertex(x + 40, y);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 30, y - 15);\n vertex(x - 30, y - 15);\n vertex(x - 40, y);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 35, y + 5);\n vertex(x - 35, y + 5);\n vertex(x - 40, y + 20);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 35, y + 5);\n vertex(x + 35, y + 5);\n vertex(x + 40, y + 20);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 10, y - 50);\n vertex(x - 10, y - 50);\n vertex(x - 25, y - 60);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 10, y - 50);\n vertex(x + 10, y - 50);\n vertex(x + 25, y - 60);\n endShape();\n\n beginShape(TRIANGLES)\n vertex(x - 10, y);\n vertex(x + 10, y);\n vertex(x, y + 50);\n vertex(x - 5, y + 40);\n vertex(x + 5, y + 40);\n vertex(x, y + 75);\n endShape();\n }", "function draw() {\n context.fillStyle = '#000';\n context.fillRect(0, 0, canvas.width, canvas.height);\n draw_matrix(arena, {x: 0, y: 0});\n draw_matrix(player.matrix, player.pos);\n}", "function drawMap(){\n for(let x = 0; x < 4; x++){\n for(let y = 0; y < 4; y++){\n if(g_horizontalMap[x][y] == 10){\n var body = new Cube();\n body.color = [.64, .17, .17, 1];\n body.textureNum = 3;\n //body.matrix.translate(0,0,0);\n body.matrix.translate(39,1,-22);\n body.matrix.scale(12,25,1);\n body.matrix.translate(x-4, -.17, y-6);\n //body.render();\n }\n if(g_verticalMap[x][y] == 10){\n var body = new Cube();\n body.color = [.64, 0, .17, 1];\n body.textureNum = 3;\n body.matrix.translate(-.5 , 1, 33);\n body.matrix.scale(1, 21 , 8);\n body.matrix.translate(x-4, -.25, y-6);\n //body.render();\n }\n }\n }\n // for(let x = 0; x < 25; x++){\n // for(let y = 0; y < 25; y++){\n // if(g_mazeMap[x][y] == 10){\n // var body = new Cube();\n // body.color = [1, 0, 0, 1];\n // body.textureNum = 2;\n // body.matrix.translate(4.5, -.5, -7);\n // body.matrix.scale(2,2,2);\n // body.matrix.translate(x-4, -.17, y-6);\n // body.render();\n // }\n // }\n // }\n\n\nfor(let x = 0; x < 10; x++){\n for(let y = 0; y < 13; y++){\n if(g_mazeMap[x][y] == 10){\n var body = new Cube();\n body.color = [1, 0, 0, 1];\n body.textureNum = 2;\n if(g_normalOn){\n body.textureNum = -3;\n }\n body.matrix.translate(4.5, -.5, -7);\n body.matrix.scale(2,8,2);\n body.matrix.translate(x-4, -.17, y-6);\n body.render();\n }\n }\n }\n}", "function drawTree(){\n drawLeaves();\n drawTrunk();\n penUp();\n}", "function\nstep_maze()\n{\n var i, j, k, o, n;\n\n /* randomly select one of the the remaining walls */\n k = Math.floor(Math.random()*redges);\n /* scan down the edge array till we find the kth removeable edge */\n for (i=0; i<edges; i++) {\n if (edge[i].valid == true) {\n if (k == 0) {\n edge[i].valid = false;\n n = group[edge[i].cell1];\n o = group[edge[i].cell2];\n /* if the cells are already connected don't remove the wall */\n if (n != o) {\n edge[i].draw = false;\n done = true;\n /* fix up the group array */\n for (j=0; j<groups; j++) {\n if (group[j] == o) {\n group[j] = n;\n }\n if (group[j] != n) {\n done = false; /* if we have more than one\n group we're not done */\n }\n }\n }\n break;\n } else {\n k--;\n }\n }\n }\n redges--; /* decriment the number of removable edges */\n /* if we're done, create an entrance and exit */\n if (done) {\n for (j=0; j<2; j++) {\n /* randomly select a perimeter edge */\n k = Math.floor(Math.random()*(perimeters-j));\n for (i=0; i<perimeters; i++) {\n if (k == 0) {\n if (perimeter[i].valid == true) {\n perimeter[i].draw = false;\n break;\n }\n }\n else {\n k--;\n }\n }\n }\n }\n}", "function setup() {\n createCanvas(w * 20 + 1, w * 20 + 1); // forms the width and height of the board\n // need to + 1 to draw the right and bottom borders\n\n // calculates number of rows and columns and then round down to nearest whole number\n cols = floor(width/w);\n rows = floor(height/w);\n grid = make2DArray(cols, rows);\n for (var i = 0; i < cols; i++) { // for every column\n for (var j = 0; j < rows; j++) { // for every row\n grid[i][j] = new Cell(i, j, w); // initialise every spot to be a new cell\n }\n }\n \n \n // Options to pick totalMines spots to plant the mines\n var options = []; // new array\n // go thr every spot...\n for (var i = 0; i < cols; i++) {\n for (var j = 0; j < rows; j++) {\n options.push([i, j]); // and adds each spot into option list\n }\n }\n \n\n for (var n = 0; n < totalMines; n ++) { // as long as number of planted mines haven't hit target\n var index = floor(random(options.length));\n // Option has a column and row in it\n var choice = options[index];\n var i = choice[0];\n var j = choice[1];\n // Deletes that spot so it's no longer an option\n options.splice(index, 1);\n grid[i][j].mine = true; // sets the spot as a mine\n }\n for (var i = 0; i < cols; i++) {\n for (var j = 0; j < rows; j++) {\n grid[i][j].countMines();\n }\n }\n\n}", "function escape(maze) {\n \n this.maze = maze;\n \n this.traverse = function(column, row) {\n console.log('D')\n if(this.maze[column][row] == 2) {\n console.log(\"We solved the maze at (\" + column + \", \" + row + \")\");\n } else if(this.maze[column][row] == 1) {\n console.log(\"At valid position (\" + column + \", \" + row + \")\");\n this.maze[column][row] = 9;\n if(column < this.maze.length - 1) {\n console.log('R')\n this.traverse(column + 1, row);\n }\n if(row < this.maze[column].length - 1) {\n console.log('D')\n this.traverse(column, row + 1);\n }\n if(column > 0) {\n console.log('L')\n this.traverse(column - 1, row);\n }\n if(row > 0) {\n console.log('U')\n this.traverse(column, row - 1);\n }\n }\n };\n \n }", "function draw() {\n background(0, 0, 0);\n frameRate(50);\n fill(0, 25);\n rect(0, 0, width, height);\n fill(255);\n ellipse(random(width), random(height), 10, 10);\n\n //calling zenomorph function and movement\n drawXenoMorph()\n if (xCoord2 > 250) {\n xCoord2 = xCoord2 - 1;\n }\n if (yCoord2 < 240) {\n yCoord2 = yCoord2 + 1;\n }\n //calling Riley function and movement\n drawRiley()\n if (xCoord3 < 125) {\n xCoord3 = xCoord3 + 1;\n }\n if (yCoord3 > 300) {\n yCoord3 = yCoord3 - 1;\n }\n\n //calling baby zenomorph function to appear once both\n //Zenomorph and Riley meet\n if ((xCoord2 < 251) && (yCoord2 > 239) && (xCoord3 > 124) && (yCoord3 < 301)) {\n scale(.5);\n for (i = 0; i < XBABY_TO_DRAW; i = i + 1) {\n frameRate(10)\n drawBabyzenomorph(round(random(CONST_WIDTH * 2, 0)), round(random(0, CONST_HEIGHT * 2)))\n }\n\n }\n //baby Zenomporph\n //creating the function to draw the baby zenomorph\n function drawBabyzenomorph(x, y) {\n fill('grey')\n stroke('grey')\n strokeWeight(5)\n ellipse(x, y, w)\n ellipse(x, y - 20, w + 5, 25)\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 25, y - 25);\n vertex(x - 25, y - 25);\n vertex(x - 20, y - 35)\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 25, y - 25);\n vertex(x + 25, y - 25);\n vertex(x + 20, y - 35);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 30, y - 15);\n vertex(x + 30, y - 15);\n vertex(x + 40, y);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 30, y - 15);\n vertex(x - 30, y - 15);\n vertex(x - 40, y);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 35, y + 5);\n vertex(x - 35, y + 5);\n vertex(x - 40, y + 20);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 35, y + 5);\n vertex(x + 35, y + 5);\n vertex(x + 40, y + 20);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 10, y - 50);\n vertex(x - 10, y - 50);\n vertex(x - 25, y - 60);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 10, y - 50);\n vertex(x + 10, y - 50);\n vertex(x + 25, y - 60);\n endShape();\n\n beginShape(TRIANGLES)\n vertex(x - 10, y);\n vertex(x + 10, y);\n vertex(x, y + 50);\n vertex(x - 5, y + 40);\n vertex(x + 5, y + 40);\n vertex(x, y + 75);\n endShape();\n }\n}", "function drawMap(){\n\t\tvar height = gameArea.canvas.height();\n\t\tvar width = gameArea.canvas.width();\n\n var innerPaths = {\n strokeStyle : settings.wallColor,\n strokeWidth: settings.innerWallWidth,\n rounded : true,\n layer :true,\n name: 'map'\n };\n\n var borderPaths = {\n strokeStyle: settings.wallColor,\n strokeWidth: settings.outerWallWidth,\n rounded: true,\n layer: true,\n name: 'mapBorder'\n };\n \n var pathCount = 0;\n var borderPathCount = 0;\n \n for (var col = 0; col < settings.columns; col++) {\n for (var row = 0; row < settings.rows; row++) {\n \n var walls = gameMap.getTile([row, col]).getWalls();\n\n var y = row * (height / settings.rows);\n var x = col * (width / settings.columns);\n\n //north\n if (walls[0] && row !=0 ) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n pathCount++;\n innerPaths[\"p\" + pathCount] = {\n type: 'line',\n x1: x, y1: y,\n x2: xLineTo, y2: y\n };\n } else if (walls[0] && row == 0){\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n borderPathCount++;\n borderPaths[\"p\" + borderPathCount] = {\n type: 'line',\n x1: x, y1: y,\n x2: xLineTo, y2: y\n };\n }\n\n\n //east\n if (walls[1] && col != settings.columns-1) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n pathCount++;\n innerPaths[\"p\" + pathCount] = {\n type: 'line',\n x1: xLineTo, y1: y,\n x2: xLineTo, y2: yLineTo\n };\n } else if (walls[1] && col == settings.columns - 1) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n borderPathCount++;\n borderPaths[\"p\" + borderPathCount] = {\n type: 'line',\n x1: xLineTo, y1: y,\n x2: xLineTo, y2: yLineTo\n };\n }\n\n //south\n if (walls[2] && row != settings.rows-1) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n pathCount++;\n innerPaths[\"p\" + pathCount] = {\n type: 'line',\n x1: x, y1: yLineTo,\n x2: xLineTo, y2: yLineTo\n };\n } else if (walls[2] && row == settings.rows - 1) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n borderPathCount++;\n borderPaths[\"p\" + borderPathCount] = {\n type: 'line',\n x1: x, y1: yLineTo,\n x2: xLineTo, y2: yLineTo\n };\n }\n\n //west\n if (walls[3] && col != 0) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n pathCount++;\n innerPaths[\"p\" + pathCount] = {\n type: 'line',\n x1: x, y1: y,\n x2: x, y2: yLineTo\n };\n\n } else if (walls[3] && col == 0) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n borderPathCount++;\n borderPaths[\"p\" + borderPathCount] = {\n type: 'line',\n x1: x, y1: y,\n x2: x, y2: yLineTo\n };\n }\n \n }\n }\n\n gameArea.canvas.drawPath(innerPaths);\n gameArea.canvas.drawPath(borderPaths);\n\t}", "function solveMaze() {\n init(solve);\n}", "function board()\r\n{\r\n // function that creats maze grid using a double for loop\r\n // for each itteration for the for loop, it creates a new Vertex with y and x\r\n // it pushes that vertex into LinearVertex arraylist and sets the value to the Index from 0.. nXn\r\n for (var y = 0; y< n; y++)\r\n {\r\n for(var x = 0; x<n; x++)\r\n {\r\n var unit = new vertex(y,x);\r\n unit.value = numOfVertex;\r\n linearVertex.push(unit);\r\n numOfVertex++;\r\n \r\n }\r\n }\r\n\r\n //horizontal edge connection between 2 vertex, \r\n //itterates from top row to bottom row and adds a horizontal edge between 2 vertex in each column \r\n for(var y=0; y<n; y++)\r\n {\r\n for(var x = 0; x< n-1; x++)\r\n {\r\n //random variable r picks value from 0-10 and assigns it as the weight.\r\n //2 edges are created using Vertex1 to vertex2 and Vertex2 to Vertex1 with the same weight \"r\"\r\n //then it pushes the two edges with the corresponding weight into Edges array in the corresponding Grid \"linearVertex\"\r\n var r = Math.floor(Math.random()*10);\r\n var edge1 = new edge(linearVertex[index(y,x)].value, linearVertex[index(y,x+1)].value, r);\r\n var edge2 = new edge(linearVertex[index(y,x+1)].value, linearVertex[index(y,x)].value, r);\r\n linearVertex[index(y,x)].edgeConnection.push(edge1);\r\n linearVertex[index(y,x+1)].edgeConnection.push(edge2); \r\n }\r\n\r\n }\r\n\r\n //Vertical edge connection between 2 vertex, \r\n //itterates from top row to bottom row and adds a vertical edge between 2 vertex in each column \r\n for(var y =0; y< n-1; y++)\r\n {\r\n for(var x = 0; x< n; x++)\r\n {\r\n //random variable r picks value from 0-10 and assigns it as the weight.\r\n //2 edges are created using Vertex1 to vertex2 and Vertex2 to Vertex1 with the same weight \"r\"\r\n //then it pushes the two edges with the corresponding weight into Edges array in the corresponding Grid \"linearVertex\"\r\n var r2 = Math.floor(Math.random()*10);\r\n var edgev1 = new edge(linearVertex[index(y,x)].value,linearVertex[(index(y+1,x))].value,r2);\r\n var edgev2 = new edge(linearVertex[index(y+1,x)].value,linearVertex[(index(y,x))].value,r2);\r\n linearVertex[index(y,x)].edgeConnection.push(edgev1);\r\n linearVertex[index(y+1,x)].edgeConnection.push(edgev2);\r\n\r\n }\r\n }\r\n\r\n\r\n}", "function draw() {\n context.fillStyle = '#000';\n context.fillRect(0,0, canvas.width, canvas.height);\n \n //Makes sure that dropping blocks don't disappear\n drawMatrix(arena, { x: 0, y: 0 });\n drawMatrix(player.matrix, player.pos);\n}", "show() {\n push();\n noStroke();\n fill(120, 180, 255, 150);\n\n translate(this.position.x, this.position.y);\n\n if (this.crashed) {\n fill(255, 0, 0);\n\n circle(0, 0, 12);\n\n pop();\n return;\n }\n\n circle(0, 0, 14);\n pop();\n }", "function clearMaze() {\r\n canvas = document.getElementById('maze-canvas');\r\n context = canvas.getContext('2d');\r\n context.clearRect(0, 0, canvas.width, canvas.height);\r\n }", "function generateGraph(size = Math.ceil(Math.random()*20)+10){ \r\n clearTimeout(currTimeout);\r\n clearTimeout(explore);\r\n clearTimeout(draw);\r\n\r\n size = parseInt(size);\r\n if(size % 2 == 0) size += 1;\r\n\r\n $(function(){\r\n $(\"#currSize\").text(size);\r\n $(\"#sizeInput\").attr(\"placeholder\", size + \" (Odd number 1-101)\");\r\n });\r\n \r\n //console.log(size);\r\n var cellWidth = canvSize/size;\r\n var cellHeight = canvSize/size;\r\n //console.log(cellWidth);\r\n\r\n matrix = new Array();\r\n for(var i=0; i<size; i++){\r\n matrix[i] = new Array();\r\n for(var j=0; j<size; j++){\r\n matrix[i][j] = 0;\r\n // context.fillStyle = (matrix[i][j] == 0) ? \"#000000\" : \"#FFFFFF\";\r\n // context.fillRect(i*cellWidth,j*cellHeight, cellWidth, cellHeight);\r\n }\r\n }\r\n\r\n \r\n innerWalls(1, size-2, 1, size-2, true); //marks interior walls as 1\r\n outerWalls(size); //exterior walls are 1\r\n\r\n for(var i=0; i<size; i++){ //drawing walls\r\n for(var j=0; j<size; j++){\r\n context.fillStyle = (matrix[i][j] == 1) ? \"#000000\" : \"#FFFFFF\";\r\n context.fillRect(i*cellWidth,j*cellHeight, cellWidth, cellHeight);\r\n\r\n context.fillStyle = \"#000000\";\r\n context.fillRect(i*cellWidth,j*cellHeight, 1, cellHeight);\r\n context.fillRect(i*cellWidth,j*cellHeight, cellWidth, 1);\r\n context.fillRect((i+1)*cellWidth-1,j*cellHeight-1, 1, cellHeight);\r\n context.fillRect(i*cellWidth,(j+1)*cellHeight, cellWidth, 1);\r\n\r\n context.fillStyle = \"green\";\r\n context.font = cellWidth/2 + \"px Arial\";\r\n //context.fillText(\"Test\", i*cellWidth, j*cellHeight+(cellHeight/1.5));\r\n }\r\n }\r\n context.fillStyle = \"red\";\r\n context.fillRect(cellWidth, cellHeight, cellWidth, cellHeight);\r\n context.fillRect(cellWidth*(size-2), cellWidth*(size-2), cellWidth, cellHeight);\r\n\r\n context.fillStyle = \"black\";\r\n\r\n\r\n \r\n}", "function draw() {\n // waits to start drawing so that location won't be empty\n if (frameCount > 35) {\n clear();\n noFill();\n stroke(250, 10, 10, opac);\n strokeWeight(w);\n\n // const userLocation = myMap.latLngToPixel(\n // locationData.latitude,\n // locationData.longitude\n // );\n // // Using that position, draw an ellipse\n // ellipse(userLocation.x, userLocation.y, x, x);\n\n // const userLocation3 = myMap.latLngToPixel(-22.983911, -43.201888);\n // ellipse(userLocation3.x, userLocation3.y, x, x);\n\n for (let i = 0; i < locations.length; i++) {\n const pos = myMap.latLngToPixel(locations[i].lat, locations[i].lon);\n ellipse(pos.x, pos.y, x, x);\n }\n\n //dot animation\n if (x < 100) {\n x = x + 1;\n w = w - 0.1;\n } else if ((x = 99)) {\n x = 10;\n opac = 255;\n w = 5;\n }\n if (opac > 0) {\n opac = opac - 4;\n }\n }\n}", "function drawHitZones() {\r\n\tfill(153, 204, 255);\r\n\trect(5, height - 40, 50, 40);\r\n\trect(60, height - 40, 50, 40);\r\n\trect(115, height - 40, 50, 40);\r\n\trect(170, height - 40, 50, 40);\r\n}", "function drawMesh() {\n ctx.beginPath();\n for (let yl = 1; yl < col; yl++) {\n ctx.moveTo(cellSize * yl , 0);\n ctx.lineTo(cellSize * yl , height);\n }\n for (let xl = 1; xl < row; xl++) {\n ctx.moveTo(0 , cellSize * xl);\n ctx.lineTo(width , cellSize * xl);\n }\n ctx.lineWidth = 1;\n ctx.strokeStyle='#888';\n ctx.stroke();\n}", "function Spot(i, j) {\n // Location\n this.i = i;\n this.j = j;\n\n // f, g, and h values for A*\n this.f = 0;\n this.g = 0;\n this.h = 0;\n\n // Neighbors\n this.neighbors = [];\n\n // Where did I come from?\n this.previous = undefined;\n\n // Am I a wall?\n this.wall = false;\n if (random(1) < 0.4) {\n this.wall = true;\n }\n\n // Display me\n this.show = function(col) {\n if (this.wall) {\n fill(0);\n noStroke();\n ellipse(this.i * w + w / 2, this.j * h + h / 2, w / 2, h / 2);\n } else if (col) {\n fill(col);\n rect(this.i * w, this.j * h, w, h);\n }\n };\n\n // Figure out who my neighbors are\n this.addNeighbors = function(grid) {\n var i = this.i;\n var j = this.j;\n if (i < cols - 1) {\n this.neighbors.push(grid[i + 1][j]);\n }\n if (i > 0) {\n this.neighbors.push(grid[i - 1][j]);\n }\n if (j < rows - 1) {\n this.neighbors.push(grid[i][j + 1]);\n }\n if (j > 0) {\n this.neighbors.push(grid[i][j - 1]);\n }\n if (i > 0 && j > 0) {\n this.neighbors.push(grid[i - 1][j - 1]);\n }\n if (i < cols - 1 && j > 0) {\n this.neighbors.push(grid[i + 1][j - 1]);\n }\n if (i > 0 && j < rows - 1) {\n this.neighbors.push(grid[i - 1][j + 1]);\n }\n if (i < cols - 1 && j < rows - 1) {\n this.neighbors.push(grid[i + 1][j + 1]);\n }\n };\n}", "show() {\n fill(255);\n noStroke();\n let sx = map(this.x/this.z, 0, 1, 0, width);\n let sy = map(this.y/this.z, 0, 1, 0, height);\n let r = map(this.z, 0, width, 8, 0);\n //ellipse(sx, sy, r, r);\n stroke(255);\n let px = map(this.x/this.pz, 0, 1, 0, width);\n let py = map(this.y/this.pz, 0, 1, 0, height);\n line(px,py, sx, sy);\n this.pz = this.z;\n }", "function maze()\n{\n this.cells = new Array();\n this.start = {m: 0, n: 0};\n this.end = {m: columns - 1, n: rows - 1};\n this.visitedCount = 0;\n \n /**\n * Provides a level of indirection to the builder() method which can't\n * use a 'this' reference\n */\n this.build = function()\n {\n builder(this); \n }\n \n /**\n * Kicks of the initialization abcation, then continues with the generator()\n */\n function builder(maze)\n { \n abc( function(column) { return rowInitializer(maze, column) }, columns, \n function() { generator(maze) }); \n }\n\n /**\n * Initializes the maze one row at a time\n */\n function rowInitializer(maze, m)\n {\n maze.cells[m] = new Array(columns);\n\n for(n = 0; n < rows; n++)\n {\n maze.cells[m][n] = new cell();\n }\n \n return m + 1;\n }\n\n /**\n * A cell object\n */\n function cell()\n {\n this.token = null; // reference to the div for when we're solving\n this.visited = false;\n this.wall = [ true, true, true, true ];\n }\n}", "function draw(){\n \n if(prevChangeCount !=0){\n for(var y=0; y<mazeCopy.length; y++){\n for(var x=0; x<mazeCopy[y].length; x++){\n if(mazeCopy[y][x].length == 3){\n corner = mazeCopy[y][x];\n if(corner.indexOf('n') == -1){\n mazeCopy[y-1][x] = mazeCopy[y-1][x] + 's';\n mazeCopy[y][x] = mazeCopy[y][x] + 'n';\n }else if(corner.indexOf('e') == -1){\n mazeCopy[y][x+1] = mazeCopy[y][x+1] + 'w';\n mazeCopy[y][x] = mazeCopy[y][x] + 'e';\n }else if(corner.indexOf('s') == -1){\n mazeCopy[y+1][x] = mazeCopy[y+1][x] + 'n';\n mazeCopy[y][x] = mazeCopy[y][x] + 's';\n }else if(corner.indexOf('w') == -1){\n mazeCopy[y][x-1] = mazeCopy[y][x-1] + 'e';\n mazeCopy[y][x] = mazeCopy[y][x] + 'w';\n }\n changeCount++;\n fill(60,0,0);\n noStroke();\n rect(gridToPos(x)+buffer, gridToPos(y)+buffer, rectSize, rectSize);\n }\n }\n }\n }else{\n for(var y=0; y<mazeCopy.length; y++){\n for(var x=0; x<mazeCopy[y].length; x++){\n if(mazeCopy[y][x].length == 4){\n noStroke();\n fill(255);\n rect(gridToPos(x)+buffer, gridToPos(y)+buffer, rectSize, rectSize);\n }else{\n noStroke();\n fill(0,255,0);\n rect(gridToPos(x)+buffer, gridToPos(y)+buffer, rectSize, rectSize);\n }\n }\n }\n }\n prevChangeCount = changeCount;\n changeCount = 0;\n}", "function drawGallows() {\r\n\t\tctx.beginPath();\r\n\t\tctx.strokeStyle = \"#666D69\";\r\n\t\tctx.lineWidth = 10;\r\n\t\tctx.moveTo(250, 400);\r\n\t\tctx.lineTo(450, 400);\r\n\t\tctx.stroke();\r\n\r\n\t\t// pole\r\n\t\tctx.moveTo(425, 400);\r\n\t\tctx.lineTo(425, 50);\r\n\t\tctx.stroke();\r\n\r\n\t\t// overhang\r\n\t\tctx.lineTo(290, 50);\r\n\t\tctx.stroke();\r\n\r\n\t\t//brace\r\n\t\tctx.moveTo(385, 50);\r\n\t\tctx.lineTo(425, 90);\r\n\t\tctx.stroke();\r\n\r\n\t\t//rope\r\n\t\tctx.beginPath();\r\n\t\tctx.lineWidth = 5;\r\n\t\tctx.strokeStyle = \"#F5E5BC\";\r\n\t\tctx.moveTo(centerLine, 55);\r\n\t\tctx.lineTo(centerLine, 125);\r\n\t\tctx.stroke();\r\n\t}", "function solveMaze(){\n var Xqueue=[parseInt(src_x)]; \n var Yqueue=[parseInt(src_y)]; \n let pathFound=false;\n var xLoc;\n var yLoc;\n\n while(Xqueue.length>0 && !pathFound){\n xLoc=Xqueue.shift();\n yLoc=Yqueue.shift();\n if(xLoc>1){\n if(tiles[xLoc-1][yLoc].state=='f'){\n pathFound=true;\n }\n }\n if(xLoc<tileColCount-1){\n if(tiles[xLoc+1][yLoc].state=='f'){\n pathFound=true;\n }\n }\n if(yLoc>1){\n if(tiles[xLoc][yLoc-1].state=='f'){\n pathFound=true;\n }\n }\n \n if(yLoc<tileRowCount-1){\n if(tiles[xLoc][yLoc+1].state=='f'){\n pathFound=true;\n }\n }\n if(xLoc>1){\n if(tiles[xLoc-1][yLoc].state=='e'){\n Xqueue.push(xLoc-1);\n Yqueue.push(yLoc);\n tiles[xLoc-1][yLoc].state=tiles[xLoc][yLoc].state+'l';\n // rect(xloc-1,yLoc,tileW,tileH,tiles[xLoc-1][yLoc].state);\n }\n }\n if(xLoc<tileColCount-1){\n if(tiles[xLoc+1][yLoc].state=='e'){\n Xqueue.push(xLoc+1);\n Yqueue.push(yLoc);\n tiles[xLoc+1][yLoc].state=tiles[xLoc][yLoc].state+'r';\n //rect(xloc+1,yLoc,tileW,tileH,tiles[xLoc+1][yLoc].state);\n }\n }\n if(yLoc>1){\n if(tiles[xLoc][yLoc-1].state=='e'){\n Xqueue.push(xLoc);\n Yqueue.push(yLoc-1);\n tiles[xLoc][yLoc-1].state=tiles[xLoc][yLoc].state+'u';\n // rect(xloc,yLoc-1,tileW,tileH,tiles[xLoc][yLoc-1].state);\n }\n }\n if(yLoc<tileRowCount-1){\n if(tiles[xLoc][yLoc+1].state=='e'){\n Xqueue.push(xLoc);\n Yqueue.push(yLoc+1);\n tiles[xLoc][yLoc+1].state=tiles[xLoc][yLoc].state+'d';\n // rect(xloc,yLoc+1,tileW,tileH,tiles[xLoc][yLoc+1].state);\n }\n }\n //setInterval(draw(),100);\n }\n if(!pathFound){\n output.innerHTML=\"No Solution\";\n }\n else{\n output.innerHTML=\"Solved\";\n let path=tiles[xLoc][yLoc].state; \n let pathLength=path.length;\n let currX=parseInt(src_x); \n let currY=parseInt(src_y); \n for(let i=0;i<pathLength-1;i++){\n if(path.charAt(i+1)=='u'){\n currY-=1;\n }\n if(path.charAt(i+1)=='d'){\n currY+=1;\n }\n if(path.charAt(i+1)=='l'){\n currX-=1;\n }\n if(path.charAt(i+1)=='r'){\n currX+=1;\n }\n tiles[currX][currY].state='p';\n }\n }\n}", "function createWorld(canvasId) \n{\n //Gravity vector x, y - 10 m/s2 - thats earth!!\n var gravity = new b2Vec2(0, -10);\n \n world = new b2World(gravity , true );\n \n //setup debug draw\n var debugDraw = new b2DebugDraw();\n debugDraw.SetSprite(document.getElementById(canvasId).getContext(\"2d\"));\n debugDraw.SetDrawScale(scale);\n debugDraw.SetFillAlpha(0.5);\n debugDraw.SetLineThickness(1.0);\n debugDraw.SetFlags(b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit);\n \n world.SetDebugDraw(debugDraw);\n \n //create some objects\n // basic walls\n ground = createBox(world, 10.5, 2, 20 , 0.5, {type : b2Body.b2_staticBody, 'user_data' : {'fill_color' : 'rgba(204,237,165,1)' , 'border_color' : '#7FE57F' }});\n ground = createBox(world, 10.5, 14, 20, 0.5, {type : b2Body.b2_staticBody, 'user_data' : {'fill_color' : 'rgba(204,237,165,1)' , 'border_color' : '#7FE57F' }});\n ground = createBox(world, 0.7, 8, 0.5, 12.5, {type : b2Body.b2_staticBody, 'user_data' : {'fill_color' : 'rgba(204,237,165,1)' , 'border_color' : '#7FE57F' }});\n ground = createBox(world, 20.3, 8, 0.5, 12.5, {type : b2Body.b2_staticBody, 'user_data' : {'fill_color' : 'rgba(204,237,165,1)', 'border_color' : '#7FE57F' }});\n\n maze_base = new Maze(6, 4, Maze.Algorithms.Prim);\n maze_base.generate();\n //console.table(maze_base.grid.data);\n /*\n */\n maze_base.grid.data = maze_base.grid.data.map(function(col, i) { \n return maze_base.grid.data.map(function(row) { \n return row[i] \n })\n });\n //console.table(maze_base.grid.data);\n maze = [];\n var space=3, h_width=3, v_width=0.5, h_height=0.5, v_height=3, h_x=2, h_y=12.7, v_x=3.5, v_y=12.5;\n\n var f=0;\n for(var i=0; i<maze_base.grid.data.length;i++){\n for(var j=0;j<maze_base.grid.data[i].length;j++){\n //console.log(\"Cell(\"+i+\",\"+j+\") E\", maze_base.isEast(i,j))\n //console.log(\"Cell(\"+i+\",\"+j+\") W\", maze_base.isWest(i,j))\n //console.log(\"Cell(\"+i+\",\"+j+\") N\", maze_base.isNorth(i,j))\n //console.log(\"Cell(\"+i+\",\"+j+\") S\", maze_base.isSouth(i,j))\n f=i*2;\n //console.log(f,i);\n if(typeof maze[f]==\"undefined\"){\n maze[f]= [];\n }\n if(typeof maze[f+1]==\"undefined\"){\n maze[f+1]= [];\n }\n maze[f].push((maze_base.isEast(i,j))?0:1);\n maze[f+1].push((maze_base.isSouth(i,j))?0:1);\n }\n }\n\n /*\n maze[0] = [0,1,0,1,0,1];\n maze[1] = [1,1,1,1,1,1];\n maze[2] = [0,1,0,1,0,1];\n maze[3] = [1,1,1,1,1,1];\n maze[4] = [0,1,0,1,0,1];\n maze[5] = [1,1,1,1,1,1];\n maze[6] = [0,1,0,1,0,1];\n\n\n maze[0] = [1,1,1,1,1,1];\n maze[1] = [0,0,1,1,1,1];\n maze[2] = [0,1,0,1,0,1];\n maze[3] = [1,1,1,1,1,1];\n maze[4] = [0,1,0,1,0,1];\n maze[5] = [0,1,1,1,1,1];\n maze[6] = [0,1,0,1,0,1];\n */\n\n\n for(var i=0;i<maze.length-1;i++){\n if(i%2==0){\n //vertical walls\n wval = v_width;\n hval = v_height;\n xval = v_x;\n yval = v_y;\n spacex=space;\n spacey=-1.5;\n }else{\n //horizontal walls\n wval = h_width;\n hval = h_height;\n xval = h_x;\n yval = h_y;\n spacex=space;\n spacey=-1.5;\n }\n for(var j=0; j<maze[i].length;j++){\n if(maze[i][j]==1){\n if(i%2==0){xval=v_x+(spacex*j);yval=v_y+(spacey*i) }else{xval=h_x+(spacex*j);yval=h_y+(spacey*i)};\n ground = createBox(world, xval, yval, wval, hval, {type : b2Body.b2_staticBody, 'user_data' : {'fill_color' : 'rgba(204,237,165,1)' , 'border_color' : '#7FE57F' }});\n }\n }\n }\n\n // inner walls\n //ground = createBox(world, 2, 11, 3, 0.5, {type : b2Body.b2_staticBody, 'user_data' : {'fill_color' : 'rgba(204,237,165,1)' , 'border_color' : '#7FE57F' }});\n //ground = createBox(world, 6, 9.7, 0.5, 9, {type : b2Body.b2_staticBody, 'user_data' : {'fill_color' : 'rgba(204,237,165,1)' , 'border_color' : '#7FE57F' }});\n /*\n ground = createBox(world, 4.7, 5, 3, 0.5, {type : b2Body.b2_staticBody, 'user_data' : {'fill_color' : 'rgba(204,237,165,1)' , 'border_color' : '#7FE57F' }});\n */\n ground = createBox(world, 18, 5, 5, 0.5, {type : b2Body.b2_staticBody, 'user_data' : {'fill_color' : 'rgba(204,237,165,1)' , 'border_color' : '#7FE57F' }});\n ground = createBox(world, 15.2, 7.8, 0.5, 6, {type : b2Body.b2_staticBody, 'user_data' : {'fill_color' : 'rgba(204,237,165,1)' , 'border_color' : '#7FE57F' }});\n ground = createBox(world, 18, 5.3, 5, 0.2, {type : b2Body.b2_staticBody, 'user_data' : {'fill_color' : 'rgba(255,0,0,1)' , 'border_color' : '#ff0000' }});\n\n createBox(world, 6.50, 3.80, 1 , 1, {'user_data' : {'border_color' : '#555' }});\n createBox(world, 8.50, 3.80, 1 , 1, {'user_data' : {'fill_color' : 'rgba(204,0,165,0.3)' , 'border_color' : '#555' }});\n createBox(world, 8.50, 3.80, 1 , 1, {'user_data' : {'fill_color' : 'rgba(0,0,165,0.3)' , 'border_color' : '#b4d455', 'solution':'solved' }});\n superball = createBall(world, 2, 13, 1 , {'user_data' : {'fill_color' : 'rgba(204,100,0,0.3)' , 'border_color' : '#555' }});\n\n var listener = new Box2D.Dynamics.b2ContactListener;\n listener.BeginContact = function(contact) {\n var color = contact.GetFixtureA().GetBody().GetUserData()['border_color'];\n //console.log(color);\n if(color==\"#ff0000\"){\n $(\".winner\").show();\n }\n //console.log(contact.GetFixtureA().GetBody().GetUserData()['border_color']);\n //console.log(\"> \", contact.GetFixtureA().GetBody());\n }\n listener.EndContact = function(contact) {\n var color = contact.GetFixtureA().GetBody().GetUserData()['border_color'];\n //console.log(contact.GetFixtureA().GetBody().GetUserData());\n //console.log(\"> \", contact.GetFixtureA().GetBody());\n if(color==\"#ff0000\"){\n $(\".winner\").hide();\n }\n }\n world.SetContactListener(listener);\n \n return world;\n}", "function drawMountains()\n{\n for (var i = 0; i < mountains.length; i++)\n {\n fill(153, 0, 76)\n triangle(mountains[i].x_pos, floorPos_y - 293, mountains[i].x_pos - 278, floorPos_y, mountains[i].x_pos + 258, floorPos_y);\n \n fill(255)\n triangle(mountains[i].x_pos, 139, mountains[i].x_pos - 77, 220, mountains[i].x_pos + 73, 220);\n \n }\n}", "function drawMountains()\n{\n for (var i = 0; i < mountains.length; i++)\n {\n fill(125, 138, 166);\n triangle(mountains[i].x_pos, 432,\n mountains[i].x_pos + ((100 * mountains[i].size)/2), (height /(1.5 * mountains[i].size)),\n mountains[i].x_pos + (100 * mountains[i].size), 432);\n }\n}", "display() {\n levelPath[this.x][this.y] = 2;\n\n for (let x = 0; x < GRIDSIZE; x++) {\n for (let y = 0; y < GRIDSIZE; y++) {\n if (levelPath[x][y] === 2) {\n fill(\"black\");\n rect(this.x * this.width, this.y * this.height, this.width, this.height);\n }\n }\n }\n }", "show() {\n fill(0, 10, 100);\n noStroke();\n\n ellipse(this.x, this.y, this.mainSize, this.mainSize);\n ellipse(this.x - 18, this.y + 20, this.subSize, this.subSize);\n ellipse(this.x - 6, this.y + 20, this.subSize, this.subSize);\n ellipse(this.x + 6, this.y + 20, this.subSize, this.subSize);\n ellipse(this.x + 18, this.y + 20, this.subSize, this.subSize);\n }", "function World(_maze) {\n // create a char maze\n const maze = _maze.map(s => s.split(''))\n // set maze char\n const setMazeChar = ([i, j], c) => { maze[i][j] = c }\t\n\n const { startPos, numKeys } = mazeStats(maze)\n const posKey = (pos) => pos.join(',')\n\n const char = ([i, j], objs = []) => {\n const c = maze[i][j]\n if (objs.indexOf(c) >= 0) return '.'\n return c\n }\n\n // given pos and taken objs\n // find all possible next pos\n const dirs = (pos, objs = []) => {\n const c = char(pos, objs)\n if (c != '.') return []\n \n return DIRS.map(([di, dj]) => [pos[0]+di, pos[1]+dj])\n .filter(([ni, nj]) => maze[ni][nj] != '#')\n }\n \n // given a source pos and taken objs\n // find all reachable objs\n const findDests = (srcPos, objs) => {\n const queue = [[srcPos, 0]]\n const marked = {}\n const dests = {} \n \n const mark = pos => { marked[posKey(pos)] = true }\n const isMarked = pos => marked[posKey(pos)] || false\n \n while (queue.length) {\n const [pos, k] = queue.shift()\n mark(pos)\n const c = char(pos, objs)\n if (c != '.') {\n dests[c] = { pos, k }\n }\n dirs(pos, objs).forEach(nextPos => {\n if (!isMarked(nextPos)) {\n queue.push([nextPos, k+1])\n }\n })\n }\n \n return dests\n }\n \n // given the door, and taken objs\n const canOpen = (door, objs) => {\n const keys = objs.filter(isKey)\n return keys.indexOf(door.toLowerCase()) >= 0\n }\n \n const dijkstra = (srcPos, srcObj) => {\n const nodes = {}\n const pq = new Map()\n \n const weight = objs => objs.filter(isKey).length\n \n const srcNode = { dist: 0, from: '', pos: srcPos, objs: [srcObj] }\n nodes[srcObj] = srcNode\n pq.set(srcObj, srcNode)\n while (pq.size) {\n // find the shortest path so far\n const u = [...pq.keys()].sort((a, b) => {\n return weight(pq.get(a).objs) - weight(pq.get(b).objs)\n })[0]\n const { dist, from, pos, objs } = pq.get(u)\n// console.log([...pq.keys()], u)\n pq.delete(u)\n \n // test next paths\n const dests = findDests(pos, objs)\n const nextObjs = Object.keys(dests)\n .filter(c => isKey(c) || canOpen(c, objs))\n \n nextObjs.forEach(v => {\n const { pos: nextPos, k } = dests[v]\n const nextDist = dist + k\n let nextNode = nodes[v]\n if (!nextNode) {\n nextNode = { dist: Infinity, objs: [] }\n nodes[v] = nextNode\n }\n \n if (weight([...objs, v]) > weight(nextNode.objs)) {\n console.log([...objs, v], nextNode.objs)\n nextNode.dist = nextDist\n nextNode.from = u\n nextNode.pos = nextPos\n nextNode.objs = [...objs, v]\n pq.set(v, nextNode)\n }\n })\n }\n console.log(nodes)\n }\n\n dijkstra(startPos, '@')\n}", "function draw_white_king(idUnit,objRoot,x,y,z,boolShown){\n var g=getG(idUnit,objRoot,x,y,z,boolShown,25,25);\n getPath(null,g,0,0,1,'#ffffff','#000000',1.5,'m 25.030443,27.1875 c 0,0 4.5,-7.5 3,-10.5 0,0 -1,-2.5 -3,-2.5 -2,0 -3,2.5 -3,2.5 -1.5,3 3,10.5 3,10.5');\n getPath(null,g,0,0,1,'#ffffff','#000000',1.5,'m 14.030443,39.1875 c 5.5,3.5 15.5,3.5 21,0 l 0,-7 c 0,0 9,-4.5 6,-10.5 -4,-6.5 -13.5,-3.5 -16,4 l 0,3.5 0,-3.5 c -3.5,-7.5 -13,-10.5 -16.0000004,-4 -3,6 5.0000004,10 5.0000004,10 l 0,7.5 z');\n getPath(null,g,0,0,1,'none','#000000',1.5,'m 25.030443,13.8175 0,-5.63');\n getPath(null,g,0,0,1,'none','#000000',1.5,'m 22.530443,10.1875 5,0');\n getPath(null,g,0,0,1,'none','#000000',1.5,'m 14.030443,32.1875 c 5.5,-3 15.5,-3 21,0');\n getPath(null,g,0,0,1,'none','#000000',1.5,'m 14.030443,35.6875 c 5.5,-3 15.5,-3 21,0');\n getPath(null,g,0,0,1,'none','#000000',1.5,'m 14.030443,39.1875 c 5.5,-3 15.5,-3 21,0');\n g.name='king';\n g.side=true;\n g.fen='K';\n return g;\n}", "drawFog() {\n this.map.fog.forEach((room) => {\n if (room.foggy) {\n for (let i = room.pos[0] - 1; i < room.pos[0] + room.width - 1; i++) {\n for (let j = room.pos[1] - 1; j < room.pos[1] + room.height - 1; j++) {\n this.map.drawTile(i, j, 175)\n }\n }\n }\n\n })\n }", "function draw(){\n tile.clearRect(0, 0, canvas.width, canvas.height);\n drawFoundAnswers();\n drawSelection();\n drawBoard();\n drawAnswers();\n drawWinner();\n}" ]
[ "0.7810492", "0.7380694", "0.7377591", "0.72737205", "0.7158664", "0.7058064", "0.70144844", "0.6977286", "0.6968469", "0.69660324", "0.69474226", "0.69333684", "0.69130766", "0.6906382", "0.6870622", "0.682254", "0.6722877", "0.6643445", "0.6592553", "0.6567338", "0.6537188", "0.6531993", "0.6531833", "0.6529025", "0.650451", "0.6500453", "0.64851373", "0.64574337", "0.64520967", "0.6439996", "0.64172095", "0.6375267", "0.6374058", "0.63525", "0.63202375", "0.6314947", "0.6314422", "0.6283395", "0.6275451", "0.62605715", "0.62383676", "0.6230095", "0.6228256", "0.6227906", "0.6226286", "0.6221814", "0.6206888", "0.62006253", "0.61897254", "0.6189131", "0.61865", "0.61830264", "0.61752266", "0.6170294", "0.61691874", "0.61681783", "0.6162064", "0.61578023", "0.61518955", "0.6143688", "0.614108", "0.6135807", "0.6135505", "0.61346906", "0.61336267", "0.6131778", "0.6131718", "0.6129302", "0.6128887", "0.612684", "0.6113045", "0.61038357", "0.6102939", "0.6095892", "0.60853153", "0.60800326", "0.6071814", "0.6065494", "0.604682", "0.6045875", "0.60398716", "0.6034373", "0.6027711", "0.6020828", "0.60092646", "0.6005359", "0.60029036", "0.59996325", "0.5996892", "0.599615", "0.5993229", "0.59920466", "0.59808505", "0.5979403", "0.59736913", "0.5971839", "0.5970043", "0.5946965", "0.5946666", "0.59454393" ]
0.6851658
15
See if sprite can move one more step at the given (x,y) facing the given direction
function canMove (x,y,dir) {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function canBeMoved(direction) {\n return block.every(function(blockCell) {\n var p = direction(blockCell); // next state\n // check for boundaries and elements of the same type\n return p.y >= 0 && p.x >= 0 && p.y < dimention[1] && p.x < dimention[0] && field[p.y][p.x] !== dir && field[p.y][p.x] !== -2 * dir;\n });\n }", "function isValid(start, direction)\r\n {\r\n var target = {};\r\n switch (direction)\r\n {\r\n case 'up':\r\n target.z = start.z;\r\n target.x = start.x - 10;\r\n break;\r\n case 'left':\r\n target.z = start.z + 10;\r\n target.x = start.x;\r\n break;\r\n case 'down':\r\n target.z = start.z;\r\n target.x = start.x + 10;\r\n break;\r\n case 'right':\r\n target.z = start.z - 10;\r\n target.x = start.x;\r\n break;\r\n case null:\r\n return false;\r\n default:\r\n console.log('Invalid direction!');\r\n return false;\r\n }\r\n target.y = start.y;\r\n var actor = grid.getActor(target);\r\n if (actor != null)\r\n {\r\n return false;\r\n }\r\n return isLegalMove(target);\r\n }", "function checkStep(pathState, direction) {\n const { x, y } = pathState;\n\n let newX, newY;\n switch (direction) {\n case 'U':\n newX = x;\n newY = y - 1;\n break;\n case 'D':\n newX = x;\n newY = y + 1;\n break;\n case 'L':\n newX = x - 1;\n newY = y;\n break;\n case 'R':\n newX = x + 1;\n newY = y;\n break;\n }\n\n if (\n (maze[x][y] !== 's' && isOppositeToLastStep(pathState.path, direction)) ||\n isInTheLoop(pathState.cellsVisited, newX, newY) ||\n !canGoTo(newX, newY, pathState.blocks)\n ) {\n return null;\n }\n\n return new PathCheckResult(newX, newY);\n}", "directionIsValide(){\n let max_x = window.innerWidth;\n let max_y = window.innerHeight;\n let new_x= this.dir.x*this.dir.vect+this.pos.x;\n let new_y= this.dir.y*this.dir.vect+this.pos.y;\n return (new_x>0 && new_y>0 && new_x<max_x && new_y<max_y );\n }", "CanMoveDirection(direction) {\n if (direction === this.Utilities.Up || direction === this.Utilities.Down) {\n return true;\n }\n switch (direction) {\n case this.Utilities.North:\n return this.ThisMaze.MazeGrid[this.CurrentLocation.Z][this.CurrentLocation.Y][this.CurrentLocation.X].North;\n break;\n case this.Utilities.East:\n return this.ThisMaze.MazeGrid[this.CurrentLocation.Z][this.CurrentLocation.Y][this.CurrentLocation.X].East;\n break;\n case this.Utilities.South:\n return this.ThisMaze.MazeGrid[this.CurrentLocation.Z][this.CurrentLocation.Y][this.CurrentLocation.X].South;\n break;\n case this.Utilities.West:\n return this.ThisMaze.MazeGrid[this.CurrentLocation.Z][this.CurrentLocation.Y][this.CurrentLocation.X].West;\n break;\n }\n }", "function action(direction) {\n var futurePosition = {x: currentPlayer.currentPos.x, y: currentPlayer.currentPos.y }\n var otherPlayerPosition = otherPlayer.currentPos;\n\n switch (direction) {\n case 'up':\n futurePosition.y -= 1;\n break;\n case 'down':\n futurePosition.y += 1;\n break;\n case 'left':\n futurePosition.x -= 1;\n break;\n case 'right':\n futurePosition.x += 1;\n break;\n default:\n return false;\n }\n\n //can move?\n if (futurePosition.x == otherPlayerPosition.x && futurePosition.y == otherPlayerPosition.y) {\n console.log(\"Is trying to step into the other player\", futurePosition);\n return true\n }\n\n //can move?\n if(!canMoveToPosition(futurePosition, obstaclesPositions)) {\n console.log(\"Is trying to move to a obstacle position \", futurePosition);\n return false;\n }\n\n if(!isInsideTheBoard(futurePosition)) {\n console.log(\"Is trying to move outside the board \", futurePosition);\n return false;\n }\n\n //move\n currentPlayer.currentPos = futurePosition\n return true;\n}", "can_move(next_pos_x, next_pos_y)\n {\n if (next_pos_x < 0 || next_pos_y < 0) {\n return false;\n }\n if (next_pos_y >= (this.matrix.length)) {\n return false;\n }\n if (next_pos_x >= (this.matrix[0].length)) {\n return false;\n }\n return this.matrix[next_pos_y][next_pos_x] == 0;\n }", "_canMove (dir) {\n let pos = this._directionToVector3(dir)\n\n for (let testX of [-0.5, 0, 0.5]) {\n let origin = this._player.position.clone()\n if (dir === Directions.Up || dir === Directions.Down) {\n origin.x += testX\n } else {\n origin.z += testX\n }\n origin.y -= 0.45 // check the ground\n\n let ray = new BABYLON.Ray(origin, pos, 1.5)\n\n //FIXME: sometimes check fails, maybe player pos, or just wrong material...\n // debug\n //if (origin.z === 0) console.log('ray', [origin.toString(), pos.toString(), this._player.position.toString()])\n\n // Show raycast helper\n let rayHelper = BABYLON.RayHelper.CreateAndShow(ray, scene, new BABYLON.Color3(1, 1, 0.1))\n rayHelper._renderLine.isPickable = false\n\n\n const STRiP_DELAY = 35000\n\n setTimeout(() => rayHelper.dispose(), STRiP_DELAY)\n\n let hit = scene.pickWithRay(ray)\n if (hit.hit) {\n //TODO: some ux feedback for failed move attempt\n return false\n }\n }\n\n return true;\n }", "function CheckNextPosStatus(direction, myTankId)\n{\n\tvar me = g_tanks[g_team][myTankId];\n\tvar nextPos = FindNextPosition(direction, me);\n\t\n\tif(!IsPositionAvailable(nextPos, myTankId))\n\t\treturn POS_UNAVAIL;\n\t\t\n\tconsole.log(\"CheckNextPosStatus, direction: \" + direction + \", myTankId: \" + myTankId + \" (\" + me.m_x + \",\" + me.m_y + \"), nextPos: (\" + nextPos.x + \",\" + nextPos.y + \")\");\n\t\n\t//check if position safe\n\tvar danger = FindBulletCome2Pos(nextPos.x, nextPos.y, me.m_speed, myTankId, false);\n\tif(danger != null)\n\t\treturn POS_UNSAFE;\n\t\n\treturn POS_SAFE;\n}", "function paddleCanMove(direction)\n{\n if(direction === \"up\")\n {\n if(userPaddle.top <= gameMetrics.boardTop)\n {\n return false;\n }\n else\n {\n return true;\n }\n }\n\n else if(direction === \"down\")\n {\n if(userPaddle.top >= (gameMetrics.boardBottom - userPaddle.height))\n {\n return false;\n }\n else\n {\n return true;\n }\n }\n}", "function canMove(direction) {\n // 37 - left arrow\n // 38 - up arrow\n var a = 1,\n b = 4,\n c = 1;\n // 39 - right arrow\n // 40 - down arrow\n if (direction == 39 || direction == 40) {\n a = 2;\n b = -1;\n c = -1;\n }\n for (var i = 0; i < 4; i++) {\n for (var j = a; j != b; j += c) {\n switch (direction) {\n // when moving left or rigth, we check whether there are either free space\n // or two adjacent tiles with the same number in the same row\n case 37:\n case 39:\n if (all_numbers[i][j]) {\n if (all_numbers[i][j - c] == 0 || all_numbers[i][j] == all_numbers[i][j - c]) {\n return true;\n }\n }\n break;\n case 38:\n case 40:\n // when moving up or down, we check whether there are either free space\n // or two adjacent tiles with the same number in the same column\n if (all_numbers[j][i]) {\n if (all_numbers[j - c][i] == 0 || all_numbers[j][i] == all_numbers[j - c][i]) {\n return true;\n }\n }\n break;\n }\n }\n }\n return false;\n}", "function check_move(x, y, newx, newy, dir) {\n // if the map ends in either direction, disallow the desired move\n if (player['x'] === 0 && dir === 2) return false;\n if (player['x'] === MAP_WIDTH-1 && dir === 0) return false;\n if (player['y'] === 0 && dir === 1) return false;\n if (player['y'] === MAP_HEIGHT-1 && dir === 3) return false;\n\n // disallow moves onto lava\n if (map[newy][newx]['type'] === ' ') {\n return false;\n }\n\n // don't allow moves onto tiles that are currently rotating\n if (map[newy][newx]['tweenrot'] !== 0) {\n return false;\n }\n\n // (dir + 2) % 4 checks the side opposite the side we are moving into\n // eg. o if we are moving left ONTO this object, then dir = 2,\n // o o <- so then (dir+2)%4 = 0, meaning the right side must be \n // x open, 0, for us to be able to move onto it, which is true.\n // \n // o if instead we wanted to move up, dir=1, onto this object,\n // o o then (dir+2)%4 = 3, which corrosponds to the bottom, which is\n // x 1 in this case, so we cannot complete this move.\n // ^\n // |\n //\n // the blocked list for this object would be: [right, top, left, bottom] = [0,0,0,1]\n if ( !(is_blocked(newx, newy, (dir + 2) % 4, false))\n && !(is_blocked(x, y, (dir + 2) % 4, true)) ) {\n return true;\n }\n //console.log(\"direction IS blocked\");\n return false;\n}", "function moveCheck(actorObj) {\n\t\tlet fitsTop = false;\n\t\tlet fitsLeft = false;\n\t\n\t\tcurrTopPx = actorObj.TopPx;\n\t\tcurrLeftPx = actorObj.LeftPx;\n\t\n\t\tcurrTop = Math.floor(currTopPx / dimension);\n\t\tcurrLeft = Math.floor(currLeftPx / dimension);\n\t\n\t\tif(currTopPx % dimension == 0)\n\t\t\tfitsTop = true;\n\n\t\tif(currLeftPx % dimension == 0)\n\t\t\tfitsLeft = true;\n\t\t\n\t\tnewLeft = currLeft;\n\t\tnewTop = currTop;\n\t\t\n\t\tswitch(actorObj.dir) {\n\t\t\tcase leftKey: \n\t\t\t\tif(fitsLeft)\n\t\t\t\t\tnewLeft = currLeft - 1;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase upKey:\n\t\t\t\tif(fitsTop)\n\t\t\t\t\tnewTop = currTop - 1;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase rightKey:\n\t\t\t\tnewLeft = currLeft + 1;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase downKey:\n\t\t\t\tnewTop = currTop + 1;\n\t\t\t\tbreak;\t\t\t\t\t \n\t\t}\n\t\ttunnelConditions();\n\t\tcheckOverlapse(actorObj.dir);\n\t\t\n\t\tif (!Obstacles())\n\t\t\treturn true;\n\t\t\n\t\treturn false;\t\n\t}", "function isWinningMove() {\n var hori = count(0, -1) + count(0, 1) - 1;\n var vert = count(-1, 0) + count(1, 0) - 1;\n var diag = count(1, -1) + count(-1, 1) - 1;\n var antd = count(1, 1) + count(-1, -1) - 1;\n // console.log(\"horizontal: \" + hori);\n // console.log(\"vertical: \" + vert);\n // console.log(\"diagonal: \" + diag);\n // console.log(\"anti-diagonal: \" + antd);\n if (hori >=4 | vert >= 4 | diag >= 4 | antd >= 4) {\n return true;\n }\n else return false;\n }", "function checkFlagpole()\n{\n var d = abs(gameChar_world_x - flagpole.x_pos);\n \n if(d < 50)\n {\n flagpole.isReached = true;\n }\n}", "function moved(movement : Vector3) {\n\n\tvar newFace : Vector3;\n\tif (movement.x == 0 && movement.y == 0){\n\n\t\tif(!stopped){\n\t\t\n\t\t\tif(spriteAnimation.sprite != null){\n\t\t\t\n\t\t\t\tspriteAnimation.notifyDirection(Vector3.zero);\n\t\t\t}\t\t\n\t\t}\n\t\tstopped = true;\t\n\t}\n\telse{\n\t\n\t\tif(movement.x < 0 && (stopped || !spriteFacingLeft)){\n\t\t\n\t\t\tif(spriteAnimation.sprite != null){\n\t\t\t\t\n\t\t\t\tspriteAnimation.notifyDirection(Vector3.left);\n\t\t\t}\n\t\t\tspriteFacingLeft = true;\n\t\t}\n\t\telse if(movement.x > 0 && (stopped || spriteFacingLeft)){\n\t\t\n\t\t\tif(spriteAnimation.sprite != null){\n\t\t\t\n\t\t\t\tspriteAnimation.notifyDirection(Vector3.right);\n\t\t\t}\n\t\t\tspriteFacingLeft = false;\n\t\t}\n\t\t\n\t\tstopped = false;\n\t\t\n\t\tif (Mathf.Abs(movement.x) < Mathf.Abs(movement.y)) {\n\t\t\t// More Vertical Movement\n\t\t\tif (movement.y > 0) {\n\t\t\t\tnewFace = Vector3.up;\n\t\t\t} else {\n\t\t\t\tnewFace = Vector3.down;\n\t\t\t}\n\t\t} else {\n\t\t\t// More Horizontal Movement\n\t\t\tif (movement.x > 0) {\n\t\t\t\tnewFace = Vector3.right;\n\t\t\t} else { \n\t\t\t\tnewFace = Vector3.left;\n\t\t\t}\n\t\t}\n\t}\n\t// If object changed face directions, make the necessary updates\n\tif (newFace != face) {\n\t\tchangeFace(newFace);\n\t}\n}", "function canFrameShift(map, row, col, dir) {\n // console.log(`r,c=${row},${col} dir=${dir}`)\n if (row < 0 || col < 0 || row >= map.rows || col >= map.cols) {\n//\tconsole.log(\"can't shift: off the world\")\n\treturn false\n }\n if (!map.hasObstacleAt(row, col)) {\n\t//console.log(\"the map has no obstacle at row, col\")\n\tif (map.hasObjectTouching(row, col)) {\n\t // console.log(\"there's an obj touching row, col\")\n\t var obj = map.getObjectTouching(row, col)\n\t if (obj.isMoving === false) {\n\t//\tconsole.log(\"the obj is not moving\")\n\t\treturn false\n\t }\n\t // console.log(\"the object is moving\")\n\t return checkFrontier(map, obj, row, col, dir)\n\t}\n//\tconsole.log(\"there is no obj touching\")\n\tlet v = true\n\tmap.objList.forEach(function(obj) {\n\t if (obj.isMoving) {\n\t\tif (obj !== player && checkFrontier(map, obj, row, col, dir) == false) v = false\n\t }\n\t})\n\treturn v //prevent sideways collision\n }\n // console.log(\"there is obstacle at row col\")\n \n return false //is obstacle\n}", "function isValidWalk(walk) {\n //define x and y coordinates x for horizontal movement y for vertical movement\n let y = 0;\n let x = 0;\n walk.forEach(function(dir) {\n if (dir === 'n') {\n //increment or decrement x and y for opposite movements\n y = y + 1;\n }\n if (dir === 's'){\n y = y - 1;\n }\n if (dir === 'e'){\n x = x + 1;\n }\n if (dir === 'w'){\n x = x - 1;\n } \n }); \n \n if(walk.length === 10 && y ===0 && x ===0){\n return true;\n }\n else {\n return false;\n }\n}", "function checkDirection (currentPoint, point) {\n let alpha = (point.alpha - currentPoint.alpha > 1.8 * Math.PI ? \n point.alpha + ALPHA_DIRECTION * 2 * Math.PI :\n point.alpha),\n diffR = currentPoint.radius - point.radius,\n diffA = alpha - currentPoint.alpha,\n curDirR = currentPoint.direction.radius,\n curDirA = currentPoint.direction.alpha,\n candDirR = point.direction.radius,\n candDirA = point.direction.alpha;\n\n if (currentPoint.alpha - point.alpha > 1.8 * Math.PI) return false;\n\n return diffR * curDirR >= 0 && diffA * curDirA >= 0 &&\n diffR * candDirR >= 0 && diffA * candDirA >= 0;\n}", "function checkIsLegalMove(nextX, nextY) {\n let nextTile = currentGameWorld[nextY][nextX];\n\n // If next tile is a wall, locked, or the end\n if (nextTile != worldTile.WALL && nextTile != worldTile.LOCKED && nextTile != worldTile.END) {\n checkCollision(nextX, nextY);\n return true;\n }\n\n // If the next tile is locked\n else if (nextTile == worldTile.LOCKED) {\n let key;\n for (let obj of currentInventory) {\n if (obj.type == \"key\") {\n key = obj;\n break;\n }\n }\n\n // If dont' have key\n if (!key) {\n effectAudio.play();\n return false;\n }\n\n // If have key\n else {\n currentInventory.splice(currentInventory.indexOf(key.type), 1);\n currentGameWorld[nextY][nextX] = 0;\n inventory.removeChild(inventory.childNodes[findChildNode(\"key\", \"#inven\")]);\n }\n }\n\n // If the next tile is the end\n else if (nextTile == worldTile.END) {\n currentLevelNumber += 1;\n if (gameworld[\"world\" + currentLevelNumber]) {\n nextLevel();\n }\n else {\n noNextLevel();\n }\n }\n\n // If just floor\n else {\n effectAudio.play();\n return false;\n }\n}", "isMoveStraight(args){\n if ((args[0] - args[1] == this.basicMoveObj.y) && (args[2] - args[3] == this.basicMoveObj.x)) {\n return true\n } else {\n return false\n }\n }", "function move(direction) {\n var row, col;\n var canMove = true;\n undrawPiece();\n for (var i = 0; i < active.location.length; i++) {\n\n row = active.location[i][0];\n col = active.location[i][1];\n row += direction.row;\n col += direction.col;\n if (grid[row][col] !==-1 || grid[row][col] === BORDER) {\n canMove = false;\n }\n }\n if (canMove) {\n for (var i = 0; i < active.location.length; i++) {\n active.location[i][0] += direction.row;\n active.location[i][1] += direction.col;\n }\n active.pivot.r += direction.row;\n active.pivot.c += direction.col;\n }\n piece2Grid();\n drawBoard();\n return canMove;\n}", "function checkPermittedMove(direction) {\n var targetSquare = null;\n mapWidth = mapLocations[currentLocation][0][1].length;\n mapHeight = mapLocations[currentLocation][0].length;\n switch (direction) {\n case \"up\":\n // Make sure player isn't already at the top of the map, but let them move if \n // the next square leads to a different map.\n targetSquare = mapLocations[currentLocation][0][playerY - 1][playerX];\n if (typeof targetSquare === \"string\"){\n return true;\n } else if (playerY === 0) {\n return false;\n }\n break;\n case \"down\":\n // Make sure player isn't already at the bottom of the map, but let them move if \n // the next square leads to a different map.\n targetSquare = mapLocations[currentLocation][0][playerY + 1][playerX];\n if (typeof targetSquare === \"string\"){\n return true;\n } else if (playerY === mapHeight) {\n return false;\n }\n break;\n case \"left\":\n // Make sure player isn't already at the left edge of the map, but let them move if \n // the next square leads to a different map.\n targetSquare = mapLocations[currentLocation][0][playerY][playerX - 1];\n if (typeof targetSquare === \"string\"){\n return true;\n } else if (playerX === 0) {\n return false;\n }\n break;\n case \"right\":\n // Make sure player isn't already at the right edge of the map, but let them move if \n // the next square leads to a different map.\n targetSquare = mapLocations[currentLocation][0][playerY][playerX + 1];\n if (typeof targetSquare === \"string\"){\n return true;\n } else if (playerX === mapWidth) {\n return false;\n }\n break;\n default:\n }\n if (targetSquare === 1 || targetSquare === 3) {\n // Next square is an obstacle\n return false;\n } else if (targetSquare.toString()[0] === \"2\") {\n // Square is taken by an interactive object\n return false;\n } else if (targetSquare === 5 && direction !== \"down\") {\n // Can only jump *down* ledges\n return false;\n } else if (targetSquare === 5 && direction === \"down\") {\n // Next square is a ledge and the player is moving down\n return true;\n } else if (targetSquare.toString()[0] === \"6\") {\n // Square is taken by an NPC\n return false;\n } else if (targetSquare.toString()[0] === \"7\") {\n // Square is taken by a claimable object\n return false;\n } else if (targetSquare.toString()[0] === \"8\") {\n // Invisible barrier. Can't cross without a healthy pokemon.\n if (myPokemon === null) {\n showText(\"You'll need a pokemon to leave town. Find Professor Oak.\");\n return false;\n } else if (myPokemon.currentHP === 0) {\n showText(\"Your pokemon has 0 HP! Talk to Mom to heal.\");\n return false;\n } else {\n return true;\n }\n } else {\n // Default to true. Nothing disqualifies the square.\n return true;\n }\n}", "isFacing(side) {\n return this.position.includes(side);\n }", "function checkFlagpole() {\n\tvar d = abs(gameChar_world_x - flagpole.x_pos);\n\n\tif (d < 15) {\n\t\tflagpole.isReached = true;\n\t}\n}", "checkNextPosition(x,z)\n\t{\n\t\tvar ang = this.angleDirection;\n\t\t// Length of the each division of the plan\n\t\tvar lengthPlan = 50 / (this.scene.planTerrain.length-1);\n\t\tvar vehicleCoordI = this.scene.vehicleInitialMap[0];\n\t\tvar vehicleCoordJ = this.scene.vehicleInitialMap[1];\n\n\t\tvar i = vehicleCoordI-Math.round((x-3.8*Math.sin(ang)+1*Math.cos(ang))/lengthPlan);\n\t\tvar j = vehicleCoordJ-Math.floor((z+3.8*Math.cos(ang)+1*Math.sin(ang))/lengthPlan);\n\n\t\tif(this.scene.planTerrain[i][j] != 0)\n\t\t\treturn false;\n\n\t\ti = vehicleCoordI-Math.round((x-3.8*Math.sin(ang)-1*Math.cos(ang))/lengthPlan);\n\t\tj = vehicleCoordJ-Math.floor((z+3.8*Math.cos(ang)-1*Math.sin(ang))/lengthPlan);\n\n\t\tif(this.scene.planTerrain[i][j] != 0)\n\t\t\treturn false;\n\t\t\n\t\ti = vehicleCoordI-Math.round((x+0.4*Math.sin(ang)+1*Math.cos(ang))/lengthPlan);\n\t\tj = vehicleCoordJ-Math.floor((z-0.4*Math.cos(ang)+1*Math.sin(ang))/lengthPlan);\n\n\t\tif(this.scene.planTerrain[i][j] != 0)\n\t\t\treturn false;\n\t\t\n\t\ti = vehicleCoordI-Math.round((x+0.4*Math.sin(ang)-1*Math.cos(ang))/lengthPlan);\n\t\tj = vehicleCoordJ-Math.floor((z-0.4*Math.cos(ang)-1*Math.sin(ang))/lengthPlan);\n\n\t\tif(this.scene.planTerrain[i][j] != 0)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "shouldMove() {\n if (!this.dir) return false;\n\n //this tells us if we should move or not\n if (this.timer === this.speed) {\n this.timer = 0;\n return true;\n }\n this.timer++\n }", "function checkMove() {\n var discToMove = startPeg[startPeg.length - 1];\n var topDisc = endPeg[endPeg.length - 1];\n var moveAvailable = false;\n if (discToMove < topDisc || endPeg.length === 0) {\n moveAvailable = true;\n }\n return moveAvailable;\n }", "function checkMoving() {\n\tif (avgSpeed < 2) {\n\t\trestartSimulation();\n\t}\n}", "function canMove(coordinatesCallback, dir) {\n if (pauseState) {\n return false;\n }\n for (var i = 0; i < tetromino.cells.length; i++) {\n var new_coord = coordinatesCallback(i, dir); // return coords in terms of cells, not pixels\n var new_x = new_coord[0];\n var new_y = new_coord[1];\n if (!validateCoordinates(new_x, new_y)) {\n return false;\n }\n }\n return true;\n}", "isInMovement() {\n //if(this.resOffset !== this.workResOffset || this.canvasStartTime.getJulianMinutes() !== this.workStartTime.getJulianMinutes() || this.canvasEndTime.getJulianMinutes() !== this.workEndTime.getJulianMinutes()) {\n if (this.isPanning || this.isSwiping) {\n return true;\n } else {\n return false;\n }\n }", "function canWalkHere(x, y) {\n return Grid.isWalkable(x, y);\n }", "_canMoveIn(dir)\n {\n return this._grid.get(this._newPosition(dir)) > 0; // scaffold or intersection\n }", "function canWalkHere(x, y)\n\t{\n\t\t\n\t\tvar spaceTaken = false;\n\t\tvar unit;\n\t\tfor(var i = game.items.length-1; i>=0; i--){\n\t\t\tvar item = game.items[i];\n\t\t\tif(item.uid == unitId)\n\t\t\t\tunit = item;\n\t\t}\n\t\tfor(var i = game.items.length-1; i>=0; i--){\n\t\t\tvar item = game.items[i];\n\t\t\tif(item.uid != unitId && item.team == unit.team){\n\t\t\tvar xLoc = Math.floor(item.x);\n\t\t\tvar xLocplus = xLoc+1;\n\t\t\tvar xLocminus = xLoc-1;\n\t\t\tvar yLoc = Math.floor(item.y);\n\t\t\tvar yLocplus = yLoc+1;\n\t\t\tvar yLocminus = yLoc-1;\n\t\t\t//console.log(\"xloc, yloc:\", xLoc, yLoc);\n\t\t\tif((xLoc == x && yLoc == y) || (x == xLocplus && y == yLocplus) || (x == xLocminus && y == yLocminus) ||\n\t\t\t(x == xLocplus && y == yLocminus) || (x == xLocminus && y == yLocplus) || (x == xLoc && y == yLocminus) ||\n\t\t\t(x == xLoc && y == yLocplus) || (y == yLoc && x == xLocplus) || (y == yLoc && x == xLocminus)){\n\t\t\t\tspaceTaken = true;\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn ((world[x] != null) &&\n\t\t\t(world[x][y] != null) &&\n\t\t\t(world[x][y] <= maxWalkableTileNum) &&\n\t\t\t(spaceTaken != true));\n\n\t}", "function isValidWalk(walk) {\n\tconst coordinates = {\n\t x: 0,\n\t y: 0\n\t}\n\tlet minutes = 0;\n\tfor( const direction of walk ) {\n\t minutes++;\n\t if( direction === 'n' ) {\n\t\tcoordinates.y++;\n\t } else if( direction === 's' ) {\n\t\tcoordinates.y--;\n\t } else if( direction === 'e' ) {\n\t\tcoordinates.x++;\n\t } else if( direction === 'w' ){\n\t\tcoordinates.x--;\n\t }\n\t}\n\treturn coordinates.x === 0 && coordinates.y === 0 && minutes === 10 ? true : false;\n }", "canRotate(activePiece, dir) {\n if (!activePiece) {\n return false;\n }\n return !activePiece\n .rotate(dir)\n .getCoords()\n .some(coord => {\n this.logger.info(coord);\n return this.hasCollision(coord);\n });\n }", "isValidMove(board, direction) {\n let row = this.position.row;\n let col = this.position.col;\n switch (direction) {\n case DIRECTION.UP:\n row -= 1;\n break;\n case DIRECTION.DOWN:\n row += 1;\n break;\n case DIRECTION.RIGHT:\n col += 1;\n break;\n case DIRECTION.LEFT:\n col -= 1;\n break;\n }\n\n // check for out of bounds, for more robust code\n if (typeof board.data[row] !== 'undefined' &&\n typeof board.data[row][col] !== 'undefined') {\n return board.data[row][col].passable || (this.flying && board.data[row][col] !== tileTypes.wall);\n } else {\n return false;\n }\n }", "checkLength(currentPos, direction, length) {\n for (var i = 0; i < length; i++) {\n var x = currentPos.x;\n var y = currentPos.y;\n if (x >= this.props.size || y >= this.props.size || x < 0 || y < 0) {\n return false;\n }\n currentPos = this.move(currentPos, direction);\n }\n return true;\n }", "checkCollision(direction) {\n const [dx, dy] = directions[direction];\n const [newx, newy] = [this.x + dx, this.y + dy];\n\n for (let sibling of this.siblings()) {\n const x = sibling.collisionX || Math.floor(sibling.x);\n const y = sibling.collisionY || Math.floor(sibling.y);\n if (x === newx && y === newy && sibling.id !== this.id) {\n return true;\n }\n }\n\n return super.checkCollision(direction);\n }", "function is_player_moving() {\n if (player['tweenx'] !== 0 || player['tweeny'] !== 0) {\n return true;\n }\n return false;\n}", "function check_arrow(event){\r\n\r\n const LEFT_KEY = 37;\r\n const RIGHT_KEY = 39;\r\n const UP_KEY = 38;\r\n const DOWN_KEY = 40;\r\n\r\n if(changing_direction) return;\r\n changing_direction = true;\r\n const keyPressed = event.keyCode;\r\n // Use this to check if the snake is moving in the reverse side\r\n const goingUp = dy === -10;\r\n const goingDown = dy === 10;\r\n const goingRight = dx === 10;\r\n const goingLeft = dx === -10;\r\n\r\n if(keyPressed === LEFT_KEY && !goingRight){\r\n dx = -10;\r\n dy = 0;\r\n }\r\n\r\n if(keyPressed === RIGHT_KEY && !goingLeft){\r\n dx = 10;\r\n dy = 0;\r\n }\r\n\r\n if(keyPressed === UP_KEY && !goingDown){\r\n dx = 0;\r\n dy = -10;\r\n }\r\n\r\n if(keyPressed === DOWN_KEY && !goingUp){\r\n dx = 0;\r\n dy = 10;\r\n }\r\n}", "function nextStep(step, cx, cy, cd){ \n var updated_pos = determineMove(cx, cy, cd, step);\n if(updated_pos == false) {\n return false;\n };\n timer = setTimeout(function(){nextStep(step+1, updated_pos[0], updated_pos[1], updated_pos[2]);}, speed);\n}", "function isMoving(moveDelta, deltaSqr) {\n return true;\n /* let distSqr = (moveDelta.x * moveDelta.x + moveDelta.y * moveDelta.y)\n let isMoving = (distSqr > deltaSqr)\n // console.log(\"moving\",isMoving)\n return isMoving*/\n}", "function canMove(coordinatesCallback,dir){\n if(pauseState){\n return false;\n }\n for(var i = 0; i < tetromino.cells.length; i++){\n var new_coord = coordinatesCallback(i,dir); // tulemus on kastides, mitte pikslites\n var new_x = new_coord[0];\n var new_y = new_coord[1];\n if(!validateCoordinates(new_x,new_y)){\n return false;\n }\n }\n return true;\n}", "stepDirection() {\n\n switch (this.direction) {\n case 'left':\n this.position['x'] -= 1\n break;\n\n case 'up':\n this.position['y'] -= 1\n break;\n\n case 'right':\n this.position['x'] += 1\n break;\n\n case 'down':\n this.position['y'] += 1\n break;\n }\n\n }", "function verifyVacancy(direction, goBack) {\r\n\tif(currentRow < maxRow && currentColl + direction >= minColl && currentColl + direction <= maxColl) {\r\n\t\tif(isPositionOpen(direction, goBack)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "canAttack(enemyShip) {\n const directionOfAttack = this.orientation(enemyShip.x, enemyShip.y, this.x, this.y)\n if (directionOfAttack === 'left' || directionOfAttack === 'right') {\n if (this.direction === 'up' || this.direction === 'down') return true\n else return false\n } else {\n if (this.direction === 'left' || this.direction === 'right') return true\n else return false\n } \n }", "function checkDirection() {\n switch (scrollDown) {\n case true:\n moveDownOnePage();\n break;\n\n case false:\n moveUpOnePage();\n break;\n }\n }", "function hasMoves() {\n for (var x = 0; x < cols; ++x) {\n for (var y = 0; y < cols; ++y) {\n if (canJewelMove(x, y)) {\n return true;\n }\n }\n }\n\n return false;\n }", "move(dir){\n\n let outOfBound = false;\n\n if(dir === 'd'){ // go down\n if(this.posY + 1 >= this.rows){\n outOfBound = true;\n }\n else{\n this.posY += 1; \n }\n }\n else if(dir === 'u'){\n if(this.posY - 1 < 0){\n outOfBound = true;\n }\n else{\n this.posY -= 1;\n }\n }\n else if(dir === 'l'){\n if(this.posX - 1 < 0){\n outOfBound = true;\n }\n else{\n this.posX -= 1;\n }\n }\n else if(dir === 'r'){\n if(this.posX + 1 >= this.cols){\n outOfBound = true;\n }\n else{\n this.posX += 1;\n }\n }\n else{\n term.red.bold(\"Invalid input! Try again! \\n\");\n }\n \n if(outOfBound){\n term.blue(\"You are \").bgWhite.red.bold(\"Out Of Bound! \\n\");\n return false;\n }\n\n // check hole\n if(this.isHole(this.posY, this.posX)){\n term.red.bold(\"You dropped in a HOLE!\\n\");\n term.green(\"You died, haha! \\n\");\n return false;\n }\n\n // check hat\n if(this.isHat(this.posY, this.posX)){\n term.bgCyan.magenta.bold.blink(\"You found the hat! You win! \\n\");\n return false;\n }\n\n // draw the new path\n this.drawPath(this.posY, this.posX);\n\n return true;\n }", "function checkKey(e) {\n\n e = e || window.event;\n\n if (e.keyCode == '38') {\n\tdirection = 1;\n\tmove();\n }\n else if (e.keyCode == '40') {\n\tdirection = 2;\n\tmove();\n }\n else if (e.keyCode == '37') {\n\tdirection = 3;\n\tmove();\n }\n else if (e.keyCode == '39') {\n\tdirection = 4\n\tmove();\n }\n\n}", "colisionCheck(object, player) {\n if ((player.x-10)+ player.width < object.x ||(object.x-10) + object.width < player.x){\n return false;\n }\n if ((player.y+20) > object.y + object.height || object.y+30 > player.y + player.height) {\n return false;\n }\n return true; \n }", "function isRotatable(x, y,tempCurrentX){\n var result = true;\n for(var xI = 0; xI < x.length; xI++){\n if(((y[xI] + currentY)) < (yGridAmount -1)){\n if(gridCellOccupied[(x[xI] + tempCurrentX)][(y[xI] + currentY)] == true\n && (y[xI] + currentY) < yGridAmount - 1){\n print(\"Cannot rotate: shape\");\n result = false;\n break;\n }\n }\n else{\n print(\"Cannot rotate: ground\");\n result = false;\n break;\n }\n }\n return result;\n}", "function movementDecision(bug, dest, dt){\n var val = (bug.angle - dest + 360) % 360;\n if (val > 180) {\n bug.angle += 1;\n } else if (val == 0){\n coordChange(bug,dt);\n } else {\n bug.angle -= 1;\n }\n}", "checkPassant(board, target_pos, pos, last_move){\n\t\treturn false;\n\t}", "function canTileMove (x, y) {\n return ((x > 0 && canSwap(x, y, x-1 , y)) ||\n (x < cols-1 && canSwap(x, y, x+1 , y)) ||\n (y > 0 && canSwap(x, y, x , y-1)) ||\n (y < rows-1 && canSwap(x, y, x , y+1)));\n }", "function tryToMakeStep(col, row){\r\n\tif (!active_spot) return false;\r\n\tvar dcol = col - active_spot[0];\r\n\tvar drow = row - active_spot[1];\r\n\tvar res = prossedStep(PLAYER, active_spot[0], active_spot[1] ,dcol, drow);\r\n\tif (res){\r\n\t\tactive_spot = null;\r\n\t\tupdateGameField();\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "move(direction) {\n if (direction === 'left') this.x -= 101; // Step left\n if (direction === 'up') this.y -= 85; // Step up\n if (direction === 'right') this.x += 101; // Step right\n if (direction === 'down') this.y += 85; // Step down\n }", "function canJewelMove(x, y) {\n return ((x > 0 && canSwap(x, y, x - 1, y)) || \n (x < cols - 1 && canSwap(x, y, x + 1, y)) ||\n (y > 0 && canSwap(x, y, x, y - 1)) ||\n (y < rows - 1 && canSwap(x, y, x, y + 1)));\n }", "function canWalkHere(x, y)\n\n{\n\nreturn ((world[x] != null) &&\n\n(world[x][y] != null) &&\n\n(world[x][y] <= maxWalkableTileNum));\n\n}", "function canMove(x, y){\r\n\treturn (y>=0) && (y<board.length) && (x >= 0) && (x < board[y].length) && (board[y][x] != 1);\r\n}", "function checkMove(){\n var iMove = gMan.i + gDirec.i;\n var jMove = gMan.j + gDirec.j;\n var canMove = true;\n \n \n if (gArr[iMove][jMove]=== 'W') return false; //` into wall box\n // var nextCellWAllObj = isElsInPos(iMove,jMove,'W');//` into wall box\n // if( nextCellWAllObj !=null ) return false;\n var nextCellBoxObj = isElsInPos(iMove,jMove,'B');\n if (nextCellBoxObj !=null ){ //` pusshing box\n if (gArr[iMove+ gDirec.i][jMove+ gDirec.j]=== 'W') return false; //` into wall box\n //var wall = isElsInPos(iMove+ gDirec.i,jMove+ gDirec.j,'W');//` into wall box\n var box = isElsInPos(iMove+ gDirec.i,jMove+ gDirec.j,'B');//` into another box\n if(box !=null ){\n return false;\n }else{\n objsToMove.push(nextCellBoxObj); \n }\n }\n return true\n}", "d_move_val(space) {\r\n if(this.check_d_range(space)) {\r\n if(space.x > this.x && space.y > this.y) {\r\n for(let i = this.x + 1, j = this. y + 1; i < space.x + 1; i++,j++) {\r\n if(this.pass(game.board[j][i])) {\r\n if(this.capture_check(game.board[j][i])) {\r\n console.log('can capture');\r\n return false;\r\n } else {\r\n console.log('Pass');\r\n };\r\n } else {\r\n console.log('test failed');\r\n return false;\r\n };\r\n };\r\n return true;\r\n } else if (space.x < this.x && space.y < this.y) {\r\n for(let i = this.x - 1, j = this. y - 1; i > space.x - 1; i--,j--) {\r\n if(this.pass(game.board[j][i])) {\r\n if(this.capture_check(game.board[j][i])) {\r\n console.log('can capture');\r\n return false;\r\n } else {\r\n console.log('Pass');\r\n };\r\n } else {\r\n console.log('test failed');\r\n return false;\r\n };\r\n };\r\n return true;\r\n } else if (space.x > this.x && space.y < this.y) {\r\n for(let i = this.y - 1, j = this.x + 1; j > space.y - 1; i--, j++) {\r\n if(this.pass(game.board[j][i])) {\r\n if(this.capture_check(game.board[j][i])) {\r\n console.log('can capture');\r\n return false;\r\n } else {\r\n console.log('Pass');\r\n };\r\n } else {\r\n console.log('test failed');\r\n return false;\r\n };\r\n };\r\n return true;\r\n } else if (space.x < this.x && space.y > this.y) {\r\n for(let i = this.y + 1, j = this.x -1; j < space.y + 1; i++, j--) {\r\n if(this.pass(game.board[j][i])) {\r\n if(this.capture_check(game.board[j][i])) {\r\n console.log('can capture');\r\n return false;\r\n } else {\r\n console.log('Pass');\r\n };\r\n } else {\r\n console.log('test failed');\r\n return false;\r\n };\r\n };\r\n return true;\r\n } else {\r\n console.log('Error in move validation');\r\n return false;\r\n };\r\n } else {\r\n console.log('Out of range');\r\n return false;\r\n };\r\n }", "move(direction) {\n if (direction === \"left\" && this.x - this.size > 0) {\n this.x -= this.speed;\n } else if (direction === \"right\" && this.x + (this.size * 2) < width) {\n this.x += this.speed;\n } else if (direction === \"up\" && this.y - this.size> 0) {\n this.y -= this.speed;\n } else if (direction === \"down\" && this.y + (this.size * 2) < height) {\n this.y += this.speed;\n }\n }", "checkCollisionOne() {\n if (player.x + player.size / 2 > this.x && player.x - player.size / 2 < this.x + this.width) {\n if (player.y + player.size / 2 > this.y && player.y - player.size / 2 < this.y + this.height) {\n currentState = 1;\n }\n }\n }", "canMove(t) {\n if (this.done) return false; // turn used up\n // if (this.moves < 1) return false; // not enuf moves left\n return this.udata.terrain.charAt(t) !== \"0\";\n }", "canMove(t) {\n if (this.done) return false; // turn used up\n // if (this.moves < 1) return false; // not enuf moves left\n return this.udata.terrain.charAt(t) !== \"0\";\n }", "function canMove(x, y){\n return (y>=0) && (y<board.length) && (x >= 0) && (x < board[y].length) && (board[y][x] != 1);\n}", "function hasMoves () {\n for (var x = 0; x < cols; x++) {\n for (var y = 0; y < rows; y++) {\n if (canTileMove(x, y)) {\n return true;\n }\n }\n }\n return false;\n }", "move(direction) {\n // Make a clean copy (not a reference)\n this.PreviousLocation = JSON.parse(JSON.stringify(this.CurrentLocation));\n if (this.CanMoveDirection(direction)) {\n switch (direction) {\n case this.Utilities.North:\n this.SetRelativeLocation(0, -1, 0);\n break;\n case this.Utilities.East:\n this.SetRelativeLocation(0, 0, 1);\n break;\n case this.Utilities.South:\n this.SetRelativeLocation(0, 1, 0);\n break;\n case this.Utilities.West:\n this.SetRelativeLocation(0, 0, -1);\n break;\n case this.Utilities.Up:\n if (this.CurrentLocation.Z === this.ThisMaze.GridLayers - 1) {\n this.SetExactLocation(0, null, null);\n }\n else {\n this.SetRelativeLocation(1, 0, 0);\n }\n break;\n case this.Utilities.Down:\n if (this.CurrentLocation.Z === 0) {\n this.SetExactLocation(this.ThisMaze.GridLayers - 1, null, null);\n }\n else {\n this.SetRelativeLocation(-1, 0, 0);\n }\n break;\n }\n return true;\n }\n return false;\n }", "wallCheck(position,direction,distance)\n\t{\n\t\tlet currentPosition = position;\n\t\tfor(let x=0;x<distance;x++){\n\n\t\t\t\tswitch(direction){\n\t\t\t\t\tcase(0):\n\t\t\t\t\t\tif(this.props.G.cells[currentPosition].walls[0] === 0){\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentPosition = currentPosition - boardWidth;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase(1):\n\t\t\t\t\t\tif(this.props.G.cells[currentPosition].walls[1] === 0){\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentPosition = currentPosition + 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase(2):\n\t\t\t\t\t\tif(this.props.G.cells[currentPosition].walls[2] === 0){\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentPosition = currentPosition + boardWidth;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase(3):\n\t\t\t\t\t\tif(this.props.G.cells[currentPosition].walls[3] === 0){\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentPosition = currentPosition - 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\t\t\n\t}", "updatePosition(gb){\r\n let hasMoved;\r\n hasMoved = this.moveMeTo(this.turnDir,gb); \r\n if (hasMoved){\r\n\r\n this.setFacingDir(this.turnDir);\r\n this.dir = this.turnDir;\r\n this.turnDir = DIRECTIONS.STATIONARY;\r\n\r\n } else {\r\n hasMoved = this.moveMeTo(this.dir,gb);\r\n }\r\n return hasMoved;\r\n \r\n }", "function checkIfAnyTileCanMove() {\n function checkTile(tile, direction) {\n // Calculates the position of the next cell\n // in the direction of the movement.\n const nextX = tile.x + direction.x;\n const nextY = tile.y + direction.y;\n\n // If next cell is out of bound stop.\n if (nextX > 3 || nextY > 3 || nextX < 0 || nextY < 0) {\n return false;\n }\n\n const nextCell = grid[nextY][nextX];\n const canMove = !nextCell || nextCell.value === tile.value;\n\n return canMove;\n }\n\n let canAnyTileMove = false;\n loopGrid((x, y) => {\n const cell = grid[y][x];\n const tile = {\n id: cell.id,\n value: cell.value,\n x,\n y,\n };\n // Checks move to the right.\n const canMoveRight = !!checkTile(tile, { x: 1, y: 0 });\n canAnyTileMove = canAnyTileMove || canMoveRight;\n if (canAnyTileMove) return true;\n // Checks move to the left.\n const canMoveLeft = !!checkTile(tile, { x: -1, y: 0 });\n canAnyTileMove = canAnyTileMove || canMoveLeft;\n if (canAnyTileMove) return true;\n // Checks move to the top.\n const canMoveUp = !!checkTile(tile, { x: 0, y: -1 });\n canAnyTileMove = canAnyTileMove || canMoveUp;\n if (canAnyTileMove) return true;\n // Checks move to the bottom.\n const canMoveDown = !!checkTile(tile, { x: 0, y: 1 });\n canAnyTileMove = canAnyTileMove || canMoveDown;\n if (canAnyTileMove) return true;\n\n return false;\n });\n\n return canAnyTileMove;\n}", "function canJumpDiagonal(x, y, z, w){\r\n\tif(getPrevContent() !== getJumpedOverContent(x, y) &&\r\n\t\tgetJumpedOverContent(x, y) !== \"\" &&\r\n\t\tgetCurContent() === \"\" && currentCol === z\r\n\t\t&& currentRow === w && getPrevContent() === \"O\")\r\n\t{\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}", "function checkDirection(side){\n if(placedTile[side].condition == \"road\" && direction != backwards[side]){\n // console.log(\"tile has a top road\");\n direction = side;\n var newTile = gameState.filter(function(tile){\n return tile.position.x == placedTile.position.x && tile.position.y == (placedTile.position.y + 1);\n })[0];\n\n return checkForTerminus(newTile, false, direction);\n }\n }", "function isValidWalk(walk) {\n var possibleDirections = {\n 'n': 0,\n 's': 0,\n 'e': 0,\n 'w': 0\n }\n walk.forEach(function(direction) {\n possibleDirections[direction]++;\n })\n var displacement = {\n x: possibleDirections['n'] - possibleDirections['s'],\n y: possibleDirections['e'] - possibleDirections['w']\n }\n return walk.length === 10 && displacement.x === 0 && displacement.y === 0;\n}", "move(direction) {\n if (direction === MOVE_LEFT && this.x > 0) {\n this.x = this.x - PLAYER_WIDTH;\n } else if (direction === MOVE_RIGHT && this.x < GAME_WIDTH - PLAYER_WIDTH) {\n this.x = this.x + PLAYER_WIDTH;\n } else if (direction === MOVE_UP && this.y > 0) {\n this.y = this.y - PLAYER_HEIGHT;\n } else if (direction === MOVE_DOWN && this.y < GAME_HEIGHT - PLAYER_HEIGHT) {\n this.y = this.y + PLAYER_HEIGHT;\n }\n }", "isValidMove(){\n\n }", "function directionMove(direction){\r\n \r\n const oldPos = store.getState().player.position\r\n const newPos = getNewPosition(direction)\r\n if(boundaryCheck(oldPos, newPos) && hitObject(oldPos, newPos)){\r\n store.dispatch({\r\n type: 'MOVE_PLAYER',\r\n payload:{\r\n position: newPos\r\n }\r\n })\r\n }\r\n }", "function CheckIfBoundary ()\r\n{\r\n\r\n\t// If we are moving to the right\r\n\tif (isRight)\r\n\t{\r\n\t\t\r\n\t\t// translate the DeLorean so that it is pushed to left (blocked)\r\n\t\t// left = 0.1 to the left \r\n\t\ttransform.Translate (Vector3 (-0.1f, 0f, 0f));\r\n\t\t\r\n\t}\r\n\t// If we are moving to the right\r\n\telse if (isLeft)\r\n\t{\r\n\t\t\r\n\t\t// translate the DeLorean so that it is pushed to right (blocked)\r\n\t\t// right = 0.1 to the right (-0.1)\r\n\t\ttransform.Translate (Vector3 (0.1f, 0f, 0f));\r\n\t\t\t\r\n\t}\r\n\t// IF we are moving upwards\r\n\telse if (isUp)\r\n\t{\r\n\t\t\r\n\t\t// translate the DeLorean so that it is pushed down (blocked)\r\n\t\t// down = 0.1 downwards (0.1)\r\n\t\ttransform.Translate (Vector3 (0f, -0.1f, 0f));\r\n\t\t\r\n\t}\r\n\t// If we are moving downwards\r\n\telse if (isDown)\r\n\t{\r\n\t\t\t\r\n\t\t// translate the DeLorean so that it is pushed to up (blocked)\r\n\t\t// up = 0.1 upwards\r\n\t\ttransform.Translate (Vector3 (0f, 0.1f, 0f));\r\n\t\t\r\n\t}\r\n\r\n}", "function HittingTheWall() {\n for (let i = 0; i < curTetromino.length; i++) {\n let newX = curTetromino[i][0] + startX;\n if (newX <= 0 && direction === DIRECTION.LEFT) {\n return true;\n } else if (newX >= 11 && direction === DIRECTION.RIGHT) {\n return true;\n }\n }\n return false;\n}", "function direction(x, y){ \n\tif (((dirX != 0) && (!x)) || ((dirY != 0) && (!y))) { \n\t\tdirX = x;\n\t\tdirY = y;\n\t}\n}", "moveMeTo(currDir,gb){\r\n if(!equals(currDir,DIRECTIONS.STATIONARY)){\r\n let nextPos = sumArrays(this.pos,currDir);\r\n this.gridToAxis(nextPos); \r\n return !gb.checkCollision(this,nextPos);\r\n }\r\n return false;\r\n }", "function facingDirection(direction) {\n var roverFace = roverDirection(direction);\n console.log(\"Rover is now facing: \" + roverFace);\n}", "function checkCell(cell, direction) {\n return field[direction(cell).y][direction(cell).x];\n }", "function HittingTheWall() {\n for (let i = 0; i < curTetromino.length; i++) {\n let newX = curTetromino[i][0] + startX;\n if (newX <= 0 && direction === DIRECTION.LEFT) {\n return true;\n } else if (newX >= 11 && direction === DIRECTION.RIGHT) {\n return true;\n }\n }\n return false;\n}", "function validMove(x, y)\n{\n\tvar valid = true;\n\tfor (var i = 0; i < xArray.length; i++) {\n\t\tif (xArray[i][0] == xCord && xArray[i][1] == yCord) {\n\t\t\tvalid = false;\n\t\t}\n\t}\n\n\tfor (var i = 0; i < oArray.length; i++) {\n\t\tif (oArray[i][0] == xCord && oArray[i][1] == yCord) {\n\t\t\tvalid = false;\n\t\t}\n\t}\n\t\n\treturn valid;\n}", "function checkFlagpole()\n{\n d = dist(flagpole.x_pos, floorPos_y+50, gameChar_world_x, floorPos_y+50);\n \n if (d <= 15)\n {\n flagpole.isReached = true;\n }\n}", "function checkInverseDirection(direction)\n{\n var acceptChangeDirection = true;\n\n acceptChangeDirection = typeof direction !== 'undefined' && direction !== null && (direction[0] !== snake.currentDirection[0] || direction[1] !== snake.currentDirection[1]) && !(direction[0] * (-1) == snake.currentDirection[0] || direction[1] * (-1) == snake.currentDirection[1]) && !disallowChangeDirection; \n\n return acceptChangeDirection;\n}", "function checkFalling (agent) {\n agent.isFalling = agent.y < world.floor;\n}", "function checkDirectHit(cx,cy,victim){\n \n \n weapon = curPlayer.getweapon();\n\n //checks if the weapon hits tank directly\n changeDelta(victim);\n if((cx>=victim.getpx() && cx<=victim.getpx()+30 )&&(cy>=terrainY[victim.getpx()]-20 && cy<=terrainY[victim.getpx()])){\n victim.sethealth(victim.gethealth()-weapons[weapon][4]);\n checkEndGame();\n console.log(\"Direct Hit\");\n return true;\n }\n return false;\n\n\n}", "function isInputCorrect(direction) {\n return direction === pattern[patternIndex];\n}", "function isRunning () {\n return (character.isLeft || character.isRight) && !character.isFalling;\n}", "move() {\n if (this.crashed) {\n return;\n }\n if (this.direction == 1) {\n this.y -= settings.step;\n }\n else if (this.direction == 2) {\n this.x += settings.step;\n }\n else if (this.direction == 3) {\n this.y += settings.step;\n }\n else if (this.direction == 4) {\n this.x -= settings.step;\n }\n }", "function checkValidMove(piece,x,y) {\r\n\tswitch(piece) {\r\n\t\tcase 'b': //black has to on other side of white\r\n\t\t\treturn checkAllDir('b',x,y,'w');\r\n\t\t\tbreak;\r\n\t\tcase 'w': //white has to be on other side of black\r\n\t\t\treturn checkAllDir('w',x,y,'b');\r\n\t\t\tbreak;\r\n\t}\r\n}", "moveCharacter(character, direction) {\n \n var candidateTile;\n var currTileX = character.getCurrentTile().getTileX();\n var currTileY = character.getCurrentTile().getTileY();\n var charState;\n var result = true;\n\n switch (direction) {\n case 'up':\n candidateTile = this.gameBoard[currTileX][currTileY - 1]; \n break;\n case 'left':\n candidateTile = this.gameBoard[currTileX - 1][currTileY]; \n charState = 'idleLeft';\n break;\n case 'down':\n candidateTile = this.gameBoard[currTileX][currTileY + 1]; \n break;\n case 'right':\n candidateTile = this.gameBoard[currTileX + 1][currTileY]; \n charState = 'idleRight';\n break;\n default:\n console.log(\"Debug method: moveCharacter\");\n break;\n }\n\n //If the candidate tile contains the survivor, it cannot be moved into.\n if (this.Survivor.getCurrentTile() == candidateTile) {\n result = false;\n }\n\n //If the candidate tile contains is not passable, it cannot be moved into.\n if (candidateTile.canBePassed() == false) {\n result = false;\n }\n\n //If the candidate tile contains an active, alive zombie, it cannot be moved into.\n for (const z of this.activeZombies) {\n if (z.getCurrentTile() == candidateTile && z.isZombieAlive()) {\n result = false;\n }\n }\n\n //If the tile can be moved into, move the entity and change animation state.\n if (result) {\n character.moveChar(candidateTile);\n\n }\n\n if (charState != null) {\n character.setState(charState);\n }\n return result;\n }", "Move(direction) {\r\n\r\n switch (direction) {\r\n case 'left':\r\n try {\r\n //Using \"== false\" instead of \"!\", to prevent undrefined walls (edges) from being allowed\r\n if (map[this.y][this.x - 1] == false) {\r\n animationLagX = 0 - animationLagFrames\r\n this.x--;\r\n }\r\n } catch (e) { }\r\n break;\r\n case 'right':\r\n try {\r\n if (map[this.y][this.x + 1] == false) {\r\n animationLagX = animationLagFrames\r\n this.x++;\r\n }\r\n } catch (e) { }\r\n break;\r\n case 'up':\r\n try {\r\n if (map[this.y - 1][this.x] == false) {\r\n animationLagY = 0 - animationLagFrames\r\n this.y--;\r\n }\r\n } catch (e) { }\r\n break;\r\n case 'down':\r\n try {\r\n if (map[this.y + 1][this.x] == false) {\r\n animationLagY = animationLagFrames\r\n this.y++;\r\n }\r\n } catch (e) { }\r\n break;\r\n }\r\n }", "function direction(currentx,currenty){\n //if circle is getting close to border\n if (currentx >= screenW-50 || currenty >= screenH-50 || currentx <= 50 || currenty <= 50){\n //change direction\n angle -= 180;\n newCoords(angle)\n }\n //console.log(millis())\n if (lastTime <= millis() - 2500){\n angle -= 70;\n newCoords(angle)\n lastTime = millis(); //update last time \n }\n newCoords(angle)\n}", "canMove(key, dir) {\n var data = this.ldapSettingsData;\n var index = this._indexOf(key);\n return ((dir === 'up' && index > 0) || (dir === 'down' && index < data.length - 1));\n }", "function checkMove ( moveX, moveY, newTetromino ) {\r\n //If the tetromino is simply moving along with the arrow key\r\n if ( newTetromino == undefined ) {\r\n newTetromino = tetromino;\r\n }\r\n \r\n for ( let y = 0; y < TETROMINO_SIZE; y++ ) {\r\n for ( let x = 0; x < TETROMINO_SIZE; x++ ) {\r\n\r\n if ( newTetromino[y][x] != 0 ) {\r\n let newX = tetromino_x + x + moveX;\r\n let newY = tetromino_y + y + moveY;\r\n\r\n if ( newX < 0 || newY < 0 || FIELD_COLUMN <= newX || FIELD_ROW <= newY\r\n || field[newY][newX] != 0 ) {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n}" ]
[ "0.6591468", "0.6576128", "0.65548956", "0.64943117", "0.64802504", "0.64373124", "0.6394775", "0.6350045", "0.6287304", "0.6284429", "0.6237724", "0.6174555", "0.61623216", "0.61610013", "0.61583424", "0.61456686", "0.61368805", "0.61067516", "0.60915834", "0.6060695", "0.60589564", "0.6034674", "0.60259044", "0.60254014", "0.6024808", "0.6020287", "0.59934986", "0.5978172", "0.5975784", "0.5964061", "0.5963429", "0.59523964", "0.59485316", "0.59440434", "0.59363633", "0.5925541", "0.5903028", "0.59005815", "0.5898547", "0.5891218", "0.58593315", "0.5856463", "0.5830929", "0.58301365", "0.58062947", "0.57974523", "0.57972926", "0.5794812", "0.57870066", "0.578326", "0.5777091", "0.5776307", "0.5774433", "0.57704985", "0.57682985", "0.57624376", "0.5762353", "0.5746375", "0.573998", "0.5728809", "0.57258034", "0.5711063", "0.57079625", "0.57027817", "0.5701038", "0.5695495", "0.5695495", "0.5686358", "0.5680927", "0.5678345", "0.56716955", "0.56701624", "0.5649109", "0.56460714", "0.5645198", "0.56409967", "0.5636771", "0.5631014", "0.56308854", "0.56292", "0.5628865", "0.5622692", "0.5613878", "0.5613194", "0.5611833", "0.5610341", "0.5605463", "0.5592833", "0.5592576", "0.55893284", "0.5586574", "0.55831313", "0.5581564", "0.5580226", "0.5574367", "0.5571775", "0.55615854", "0.55606556", "0.5559429", "0.5547744" ]
0.7259557
0
welcome screen animation OPTIONAL
function updateWelcomeScreen () {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayWelcome() {\n\t$(\"#welcome\").css('opacity', 0).show().animate({ opacity: 1 }, 750, function() {\n\t \t$(\"#welcome\").animate({ top: \"15%\" }, 1000, function() {\n\t \t\t$(\"#welcomemessage\").fadeIn(function () {\n\t \t\t\tsetTimeout(function() {\n\t \t\t\t\t$(\"#welcomebutton\").fadeIn(function() {\n\t \t\t\t\t\tinitializeRockAndRollButton();\n\t \t\t\t\t});\n\t \t\t\t}, 500);\n\t \t\t});\n\t \t});\n });\n}", "static showGreeting() {\n const currentScreen = mainScreen.firstElementChild;\n const greeting = new GreetingScreen();\n const onElementAnimationEnd = () => {\n central.classList.remove(`central--animate-screens`);\n central.classList.remove(`central--stack-screens`);\n\n currentScreen.removeEventListener(`animationend`, onElementAnimationEnd);\n mainScreen.removeChild(currentScreen);\n greeting.changeScreen();\n };\n\n central.classList.add(`central--stack-screens`);\n currentScreen.addEventListener(`animationend`, onElementAnimationEnd);\n mainScreen.appendChild(greeting.element);\n central.classList.add(`central--animate-screens`);\n\n }", "function runIntro(name) {\n var welcome_screen = document.getElementById(\"welcome-screen\");\n var welcome_text = document.createElement(\"p\");\n document.getElementById(\"welcome-screen-frame\").style.display = \"none\";\n welcome_screen.style.animation = \"welcome-screen-go-up 2s 1 2s\";\n welcome_screen.style.animationDelay = \"2s\";\n welcome_screen.style.animationFillMode = \"forwards\";\n welcome_screen.appendChild(welcome_text);\n welcome_text.style.fontSize = \"10vh\";\n welcome_text.style.opacity = \"0\";\n welcome_text.style.animation = \"hello-fade-in 2s 1\";\n welcome_text.style.animationFillMode = \"forwards\";\n welcome_text.innerText = \"Hello\" + name + \"!\";\n document.getElementById(\"display-4\").innerHTML = \"Welcome\" + name + \"!\";\n setTimeout(function() {\n document.body.style.overflow = \"auto\";\n }, 4000);\n}", "function welcomeAnimation() {\n $('#welcome, #crocobox, #motivation, #get-started').addClass('fade-in');\n $('#get-started').addClass('fade-in').click(function() {\n slideToNextRow(this, 0);\n });\n}", "function revealWelcome() {\n // Keep progress bar hidden\n $userProgress.hide();\n // Hide welcome message initially\n $welcomeText.hide();\n $affirmation.hide();\n $playButton.hide();\n\n // Fade out inspirational image\n setTimeout(function() {$introImage.fadeOut(function() {\n // Then fade in sidebar displaying zodiac image\n // and play accompanying sound effect\n $appearSFX.play();\n $sidebar.fadeIn(function() {\n // Then fade in welcome message\n $welcomeText.fadeIn('slow', function() {\n // After a pause, reveal final profile question\n setTimeout(function() {\n console.log('last one!');\n $userProfile.filter('h3').filter(':nth-child(5)').fadeIn();\n $userAura.fadeIn();\n }, 500);\n });\n });\n });\n},100);\n\n // Set inspirational image to gif for later\n\n}", "function welcome() {\r\n\t\tctx.clearRect(0, 0, cw, ch);\r\n\t\tctx.fillStyle = \"white\";\r\n\t\tctx.font = ch*2/15 + \"px Lucida Console\";\r\n\t\tctx.fillText(\"Retro Snaker\", cw/6, ch/2, cw*2/3);\r\n\t\tctx.font = ch*1/25 + \"px Lucida Console\";\r\n\t\tctx.fillText(\"Press \\\"↑ ↓ ← →\\\" to Start\", cw*3/10, 11*ch/15, cw*2/5);\r\n\t}", "function welcome_screen()\n{\n $(document).on(\"pagecreate\",\"#welcomeScreen\",function(){\n $(\"#welcomeText\").fadeIn(2000,function(){\n $(\"#easy\").fadeIn(1000,function(){\n $(\"#medium\").fadeIn(1000,function(){\n $(\"#hard\").fadeIn(1000);\n });\n });\n });\n $(\"#logo\").fadeIn();\n $(\"#easy\").on(\"tap\",function(){\n diff_lev=1;\n knock.play();\n computeAndRender();\n });\n $(\"#medium\").on(\"tap\",function(){\n diff_lev=2;\n knock.play();\n computeAndRender();\n });\n $(\"#hard\").on(\"tap\",function(){\n diff_lev=3;\n knock.play();\n computeAndRender();\n });\n });\n}", "function winScreen() {\n image(introScreenBackground, 0, 0);\n\n push();\n noFill();\n noStroke();\n rect(285, 300, 335, 100);\n pop();\n\n rainRun();\n\n lightningGenerator();\n\n animation(huntAgainAnim, 450, 350);\n\n animation(winMaskAnim, 475, 200);\n}", "function welcome(agent) {\n agent.add(i18n.__('WELCOME_BASIC'));\n}", "function introScreen() {\n SDPresents = new image(DEMO_ROOT + \"/def/resources/senior.png\");\n presentsScreen = SeniorDads.ScreenHandler.Codef(640,400,name,zIndex++);\n \t\tSDPresents.draw(presentsScreen,0,0);\n \t}", "function homeAnim() { //homepage animation on load \n qsCl(\"home__logo-fill\").left = '-177px';\n qsCl(\"home__logo-dolya\").color = 'black';\n qsCl(\"home__logo-consulting\").color = 'black';\n qsCl(\"home__logo-frame\").opacity = '1';\n qsCl(\"home__tagline-line\").width = '60px';\n qsCl(\"home__mission-statement\").color = '#303030';\n qsCl(\"home__tagline\").color = '#303030';\n qsCl(\"home__golden-thread\").color = 'var(--gold)';\n qsCl(\"path-logo\").animation = 'dash 3s ease-in forwards 1s'\n qsCl(\"path-home\").animation = 'dash 5s ease-in-out forwards 4s';\n drawn.home = true;\n}", "function welcomeScreen() {\n const startBtn = document.querySelector(`#${START_BTN}`);\n startBtn.addEventListener('click', startListener);\n}", "function splashScreen ( ) { //Mostramos panel \n\n drawHeaderComponent ();\n drawDescriptionComponent (\"Recorre el camino hasta que no puedas más...\");\n drawFooterComponent (\"Presiona 's' para continuar\");\n}", "function showWelcome() {\n\tvar message = '1) Shake phone to attack!\\n2) Touch screen to yell!',\n\t\tbuttonText = 'Start',\n\t\ttoastId,\n\n\t\t// button clicked callback\n\t\tonButtonSelected = function() {\n\t\t\tgong.play();\n\t\t},\n\n\t\t// toast dismissed callback\n\t\tonToastDismissed = function() {};\n\n\t// toast options\n\toptions = {\n\t\tbuttonText: buttonText,\n\t\tbuttonCallback: onButtonSelected,\n\t\tdismissCallback: onToastDismissed,\n\t\ttimeout: 20000\n\t};\n\n\t// display the toast message\n\ttoastId = blackberry.ui.toast.show(message, options);\n}", "function welcome() {\n swal({\n title: \"Welcome!\",\n text: \"Click on any state to start playing. You have 180 days to FLATTEN THE CURVE!! Help save the country from the virus!\", \n button: \"Let's Go!\"\n });\n console.log(\"TIGGERED\");\n}", "async showWelcomeMessage(){\n \n Animated.sequence([Animated.timing(this.state.positionInScreen, {\n \n toValue: { x: wp(\"15%\") , y:hp(\"6%\") },\n }),\n Animated.timing(this.state.positionInScreen, {\n duration: 2500,\n toValue: { x: wp(\"15%\"), y:hp(\"6%\") },\n }),\n Animated.timing(this.state.positionInScreen, {\n duration:2000,\n toValue: { x: wp(\"15%\"), y: hp(\"-8%\") },\n })]).start(()=>{\n this.setState({welcomeMessage:false})})\n\n \n\n }", "function init() {\n createWelcomeGraphic();\n console.log('WELCOME TO ASSOCIATE MANAGER!');\n console.log('FOLLOW THE PROMPTS TO COMPLETE YOUR TASKS.');\n}", "function renderWelcomeScreen(){\r\n getTemplateAjax('./templates/welcome.handlebars', function(template) {\r\n welcomeData =\r\n {welcomeTitle: \"Hey. Where do you want to park?\", welcomeMessage: \"Single-origin coffee portland squid tofu 3 wolf moon fixie thundercats single-origin coffee tofu jean shorts.\"}\r\n $('#welcomeScreen').html(template(welcomeData));\r\n })\r\n }", "function hideIntercept() {\n $('#welcome-page').css('animation', \"none\");\n $('#welcome-page').css('display', \"none\");\n flashWhite();\n}", "entered(welcome) {}", "function animateHomeScreen(action) {\n if (action === \"OPEN\") {\n Animated.timing(homeScreen_opacity, {\n toValue: 0.15,\n duration: 300,\n useNativeDriver: false,\n }).start();\n } else if (action === \"CLOSE\") {\n Animated.timing(homeScreen_opacity, {\n toValue: 1,\n duration: 200,\n useNativeDriver: false,\n }).start();\n }\n }", "function startScreen() {\n fill(255, 56, 115, opacity);\n rect(0,0,width,height);\n textSize(12);\n if (frameCount%2 == 0){\n fill(255,opacity);\n textAlign(CENTER);\n textSize(12);\n text(\"CLICK TO PLAY\", width/2, height/2);\n }\n}", "function splash() {\n document.querySelector(\".splash\").classList.add(\"animation\", \"fadeOut\", \"hide\");\n document.querySelector(\".game-page\").classList.add(\"animation\", \"fadeIn\", \"active\");\n keyStart();\n}", "function welcomePageToMercury () {\n welcomeDiv.style.display = 'none'\n questionDiv.style.display = 'block'\n lives.style.display = \"flex\"\n lifeThree.style.visibility = \"visible\"\n lifeTwo.style.visibility = \"visible\"\n lifeOne.style.visibility = \"visible\"\n wrongAnswer = 3\n lifeSource(wrongAnswer)\n planetToPlanet(counter)\n}", "function animate() {\n\twindow.requestAnimationFrame(animate);\n\trender();\n\t\n\tif(drillImage != null && hasFinishedInit == false && welcomePageUp == false){\n\t\thasFinishedInit = true;\n\t\tgenerateMapLevel(currentLevel);\n\t\tcreateLevel(currentLevel);\n\t}\n}", "function welcome(agent) {\n\n agent.add(`Welcome to my agent!`);\n }", "function welcome (name) {\n console.log('Welcome, ' + name)\n}", "function introduction (game) {\n out(GAME_INTRODUCTION);\n scenes_tick(game);\n look(game);\n update_statusbar(game);\n}", "function homePage() {\n const tl = new TimelineMax({ delay: 0.5 });\n tl.from(\"#logo\", {\n y: -500,\n scale: 0.1,\n ease: \"back\",\n duration: 1.5,\n }).from(\n \"#hamburger-menu\",\n {\n opacity: 0,\n scale: 0.6,\n ease: \"back\",\n duration: 1.2,\n },\n \"-=0.3\"\n );\n}", "function pageLoad_welcome() {\n console.log(\"On welcome page\");\n var loggedInUser = persist.getLoggedInUser();\n if (loggedInUser.id) {\n console.log(loggedInUser.username + \" already logged in\");\n navigateToScreen(SCREENS.MAIN);\n }\n}", "function welcome(agent){\n agent.add(getTelegramButtons(\"Welcome to Big Brother! I'm responsible for taking care of your apps! Here's what you can do with me:\", actions));\n}", "function welcomeDisplay1() {\n push();\n background(boxOffice1.image);\n imageMode(CENTER);\n image(sonicSign.image, sonicSign.x, sonicSign.y, 600, 180);\n pop();\n}", "function instructionScreen() {\n\n image(introScreenBackground, introScreenBackgroundSpec.x, introScreenBackgroundSpec.y, introScreenBackgroundSpec.w, introScreenBackgroundSpec.h);\n\n rainRun();\n\n lightningGenerator();\n\n push();\n noFill();\n noStroke();\n rect(whyStartAnimHitbox.x, whyStartAnimHitbox.y, whyStartAnimHitbox.w, whyStartAnimHitbox.h);\n pop();\n\n animation(whyStartAnim, whyStartAnimSpec.x, whyStartAnimSpec.y);\n howToAnim.frameDelay = howToAnimSpec.delay;\n animation(howToAnim, howToAnimSpec.x, howToAnimSpec.y);\n animation(controlAnim, controlAnimSpec.x, controlAnimSpec.y);\n\n}", "function showLogoWhite() {\n $.logoRed.animate({ opacity:0.0, duration:250 });\n $.logoWhite.animate({ opacity:1.0, duration:250 });\n\n $.helpLight.animate({ opacity:0.0, duration:250 });\n $.helpDark.animate({ opacity:1.0, duration:250 });\n}", "function welcomeScreen(){\n\t//loads existing jobs\n\tif (localStorage[\"timepunch.totaljobs\"] != null){\n\t\tfor(var count = 0; count < parseInt(localStorage[\"timepunch.totaljobs\"]); count ++){\n\t\t\tprintJob(count);\n\t\t}\n\t}\n\t//initializes job count\n\t//first time app is loaded\n\telse {\n\t\tlocalStorage[\"timepunch.totaljobs\"] = 0;\n\t}\n}", "function showWelcome()\n {\n// switched off on client request\n//\tvar srcFile = \"../ModelPopup/WelcomeModal.aspx\";\t//COMDIFF: prepend \"../\"\n//\tvar cFrame = new Element('iframe').setProperties({id:\"yt-HelpContent\", height:'580px', width:'600px', frameborder:\"0\", scrolling:\"no\", src:srcFile}).injectInside(document.body);\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n//\tcustomModalBox.htmlBox('yt-HelpContent', '', 'Help'); \n//\t$('mb_contents').addClass('yt-Panel-Primary');\n//\tnew Element('h2').setHTML('Welcome to Your Tribute').setProperty('id','mb_Title').injectTop($('mb_contents'));\n//\twelcomeClose();\n}", "function mainScreen() {\n startSplash(ctx);\n startBox.draw(ctx);\n \n }", "function showWelcome() {\n\n\t// populate the welcome message\n\t$.get('/marques/pages/welcome', function(data){\n\t\n\t\t// add the data to the div and load the welcome box\n\t\t$('#welcome_dialog_text').empty().append(data);\n\t\t$('#welcome_dialog').dialog('open');\n\t});\n}", "function showWelcomeText(time, strength, colour, offsetX, offsetY, scale) {\n let margin = 2; //number of characters as margin\n //write(\"Hello World\", -1, strength, colour, offset, scale);\n write(\"Welcome\", time, 2*strength, colour, offsetX+margin*scale*originalBoxSize, offsetY+margin*scale*originalBoxSize, scale);\n write(\"Press number key\", time, strength, colour, offsetX+margin*scale*originalBoxSize, offsetY+(margin+3)*scale*originalBoxSize, scale);\n write(\"or\", time, strength, colour, offsetX+margin*scale*originalBoxSize, offsetY+(margin+5)*scale*originalBoxSize, scale);\n write(\"click number field\", time, strength, colour, offsetX+margin*scale*originalBoxSize, offsetY+(margin+7)*scale*originalBoxSize, scale);\n write(\"to start\", time, strength, colour, offsetX+margin*scale*originalBoxSize, offsetY+(margin+9)*scale*originalBoxSize, scale);\n}", "function goToLaunch() {\n $(\".launch-page\").show();\n $(\".main-page\").hide();\n animateCSS('.header-title','slideInDown');\n animateCSS('.launch-logo', 'fadeIn');\n animateCSS('.launch-modes', 'fadeIn');\n animateCSS('.launch-footer-left','slideInUp');\n}", "function displayLanding() {\n const homeContainer = document.querySelector(\".homePageContainer\");\n const welcomeStatement = document.querySelector(\".welcomeStatement\");\n if (homeContainer.style.display === \"none\") {\n homeContainer.style.display = \"flex\";\n welcomeStatement.style.display = \"block\";\n } else {\n setTimeout(delayHomePageChange = () => { homeContainer.style.display = \"none\";}, 600);\n setTimeout(delayWelcomeStatementChange = () => { welcomeStatement.style.display = \"none\";}, 600);\n }\n}", "function welcomeMessage(){\n $('#introModal').show();\n }", "function MakeshiftFlashAnimation() {\n if (me.state.isCurrent(me.state.FLASH_ANIMATION)) {\n me.state.change(me.state.PLAY);\n } else {\n me.state.change(me.state.FLASH_ANIMATION);\n }\n}", "function welcome(str){\n return str + \"\\nPlease press Start to restart the game.\";\n}", "function displayWelcomeMessage(){\n DisplayNotification(\n config[\"welcome\"][\"title\"],\n welcome_message,\n [],\n true\n );\n}", "function welcome() {\n console.log(`\n--------------------------------------\n Welcome to the lemonade estimator\n--------------------------------------\n `);\n}", "function createWelcomeGraphic() {\n\n}", "function start () {\n if (m.debug > m.NODEBUG) { console.log('screens.start'); }\n \n // draw background pattern behind other elements, redraw after resizing\n // aka 'the hard way'\n m.pattern.drawDiamondPatternBackground( $('body') );\n $(window).on('resize orientationchange', function (event) {\n $('#patternBkgdCanvas').remove();\n m.pattern.drawDiamondPatternBackground( $('body') );\n }\n );\n \n showScreen('splashScreen'); // without tagline or progress bar initially\n }", "function wowAnimation() {\r\n new WOW({\r\n offset: 100,\r\n animateClass: \"animated\",\r\n mobile: true,\r\n }).init();\r\n }", "function loadScreen1()\n{\n TweenMax.from(\"#screen1 h1\", duration, {\n delay: delay-1,\n opacity: 0\n });\n TweenMax.from(\"#globe1\", duration-0.5, {\n delay: delay-1,\n scale:0,\n opacity: 0\n });\n TweenMax.from(\"#globe2\", duration-0.5, {\n delay: delay-0.5,\n scale:0,\n opacity: 0\n });\n TweenMax.from(\"#globe3\", duration-0.5, {\n delay: delay,\n scale:0,\n opacity: 0\n });\n \n // update delay to wait for screen transition\n delay = duration + 0.5;\n}", "function handleSplashScreen() {\n\t$(\"#splash\").addClass(\"animated\");\n\t$(\"#splash-wrapper\").css(\"opacity\", \"0\");\n\tsetTimeout(() => { $(\"#splash-wrapper\").addClass(\"hidden\") }, 500);\n}", "playAnimation() {\n \n document.body.classList.add('splash');\n this.animObj.addEventListener(\"complete\", () => {\n //handles switching fadeIn and fadeOut className to Logo\n this.setState({ animationFinished: true })\n EventEmitter.emit(Signals.splashIsDone);\n //delay so we don't jump directly to home page after animation finishes\n setTimeout(() => {\n this.setState({ popup: false });\n console.log(\"finished animation\")\n document.body.classList.remove('splash');\n this.props.handleSplashDone();\n }, 2000);\n });\n \n //added delay so animation can load a bit properly\n setTimeout(() => {\n this.animObj.play(this.animationName);\n }, 2000);\n }", "async sendWelcome() {\n await this.send(\"welcome\", \"welcome to our website\")\n }", "function menuScreen() {\n if (currentPage === 'highscorepage') {\n $box2.animate({left: $screenWidth}, 150); // slides highscorepage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else if (currentPage === 'creditspage') {\n $box3.animate({left: $screenWidth}, 150); // slides creditspage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else {\n $box1.animate({left: $screenWidth}, 150); // slides playpage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n }\n currentPage = 'menupage';\n }", "function introAnimation () {\n let x = 0\n let flash = setInterval(() => {\n flashButtons()\n x++\n if (x >= 3) {\n clearInterval(flash)\n }\n }, 500)\n}", "function walkHome(){\r\n\tbackground(0);\r\n\tfirstOption.hide();\r\n\tsecondOption.hide();\r\n\tuserName.hide();\r\n\r\n\t//change the text for the title\r\n\ttitle.html(\"You have gone home. Good Night.\");\r\n\r\n\t//startOver = createA(\"index.html\", \"Start Over\")\r\n\t//firstOption.mousePressed(startOver);\r\n}", "function welcome(agent) {\n console.log('welc default intent works');\n agent.add(`Welcome to my agent!`);\n }", "function C012_AfterClass_Jennifer_StartPlayerHumiliation() {\n\tSetScene(CurrentChapter, \"Humiliation\");\n}", "welcomeIntent(assistant) {\n this.assistant = assistant;\n this.agent.randomGreeting();\n }", "function OsAnimation() {\r\n wow = new WOW(\r\n {\r\n boxClass: 'wow', // default\r\n animateClass: 'animated', // default\r\n offset: 0, // default\r\n mobile: true, // default\r\n live: true // default\r\n }\r\n );\r\n wow.init();\r\n }", "function welcomeMessage() {\n responsiveVoice.speak('Good morning, Agent' + spyProfile.name +'. Right now, the time is ' + time + ' and the date is ' + theDate + '. Good luck not dying');\n}", "function startGame() {\n $(menu).animate({ opacity: \"0\" }, 800, function () {\n menu.hidden = true;\n })\n handleSatisfied();\n}", "function welcomeScreen() {\n\n // Get position of logo and play image in sprite\n let image = {\n 'logo': {\n 'sx': 702,\n 'sy': 180,\n 'sw': 178,\n 'sh': 48\n },\n 'play': {\n 'sx': 706,\n 'sy': 236,\n 'sw': 106,\n 'sh': 58\n }\n }\n\n // Draw logo on canvas\n ctx.drawImage(sprite,\n image.logo.sx,\n image.logo.sy,\n image.logo.sw,\n image.logo.sh,\n (CANVAS_WIDTH - image.logo.sw) / 2,\n (CANVAS_HEIGHT - image.logo.sh) / 2 - image.logo.sh,\n image.logo.sw,\n image.logo.sh);\n\n // Calculate position of play button on canvas\n let playX = (CANVAS_WIDTH - image.play.sw) / 2;\n let playY = (CANVAS_HEIGHT - image.play.sh) / 2 + image.play.sh;\n\n // Draw play button on canvas\n ctx.drawImage(sprite,\n image.play.sx,\n image.play.sy,\n image.play.sw,\n image.play.sh,\n playX,\n playY,\n image.play.sw,\n image.play.sh);\n\n // Create event handler to handle play button click\n let playEvent = canvas.addEventListener('click', function (event) {\n let x = event.clientX;\n let y = event.clientY;\n\n // Initialize Game\n if (x >= playX && x <= playX + image.play.sw && y >= playY && y <= playY + image.play.sh) {\n canvas.removeEventListener('click', playEvent, false);\n initController(); // Initialize Controller\n rafId = requestAnimationFrame(play); // Start animation\n }\n });\n}", "function intro() {\n\tbackground(50);\n\n\tfill(255);\n\tnoStroke();\n\ttextSize(100);\n\ttextAlign(CENTER, CENTER);\n\ttext('INTRO', width/2, height/2);\n\n\ttextSize(24);\n\ttext('[ press any key to start ]', width/2, height-height/4);\n}", "function startGameHandler()\n{\n introScreen.style.display = \"none\";\n gameScreen.style.display = \"block\";\n}", "function introduction()\n{\n\tif(lineEventEnd == 1){\n\t\t//smooth title generic\n\t\th1.fadeIn(5000, function(){\n\t\t\t$(this).delay(2000).fadeOut(5000);\n\t\t});\n\n\t\tlineStory(str.msg_intro, 3000, true);\n\t}\n}", "function intro(){\n\tvar int\n\tif($('#status').hasClass('loading')){int = 2000}else{int = 0}\t\n\tsetTimeout(function(){\n\t\tclearTimeout(introTimer)\n\t\t$('#status').removeClass('loading')\t\n\t\t$('#status').empty().writeText('Site Initialization Complete', function(){\n\t\t\t\n\t\t\t$('#status').fadeOut(1000, function(){\n\n\t\t\t\t//$('#top').animate({height:\"6%\"},1200,'easeOutExpo')\n\t\t\t\t//$('#header').animate({top:\"0\"},1200,'easeOutExpo')\t\n\t\t\t\t//$('#bottom').animate({height:\"6%\"},1200,'easeOutExpo',function(){\n\n\t\t\t\t\t$('#panelMenu').fadeTo('3000',1)\n\t\t\t\t\t$('#footerLeft').fadeTo('3000',1)\n\t\t\t\t\t$('#footerRight').fadeTo('3000',1)\n\n\t\t\t\t//})\t\n\n\t\t\t})\n\n\t\t})\n\n\t},int)\n\n\t$(window).trigger('hashchange')\t\n\n}", "function welcome_page(request, response) {\n if(request.session.id) { return response.redirect('/account'); }\n return response.render(chamber.pages['welcome'], { signed_in: request.session.id || false });\n}", "function WelcomeState() {\n\n}", "function draw() {\n //set up the different states\n if (state === `enter`) {\n welcomeDisplay();\n } else if (state === `display1`) {\n welcomeDisplay1();\n } else if (state === `display2`) {\n welcomeDisplay2();\n } else if (state === `display3`) {\n welcomeDisplay3();\n } else if (state === `display4`) {\n welcomeDisplay4();\n } else if (state === `display5`) {\n welcomeDisplay5();\n } else if (state === `display6`) {\n welcomeDisplay6();\n } else if (state === `gallery`) {\n galleryDisplay();\n } else if (state === `home`) {\n }\n}", "function displayIntroScreen() {\n image(imgIntroScreen, 0, 0, windowWidth, windowWidth * 0.4);\n\n}", "function introAnim() {\n $('.welcome-text')\n .delay(500)\n .animate({opacity: \"1\"}, 500)\n .delay(500)\n .animate({top: \"10%\"}, 1000 );\n setTimeout(function() {\n $('.logo-box')\n .delay(1500)\n .animate({opacity: \"1\"}, 1000 );\n }, 1000);\n\n \n}", "function welcome() {\n console.log('Oh, Hello!');\n}", "function getStarted() {\n document.getElementById(\"welcome\").remove();\n drawKittens();\n}", "function startScreen() {\n if (loggedIn === false) {\n resetButton.classList.add(\"hidden\");\n easy.classList.add(\"hidden\");\n medium.classList.add(\"hidden\");\n hard.classList.add(\"hidden\");\n signupBtn.style.display = \"block\";\n loginBtn.style.display = \"block\";\n } else if (loggedIn === true) {\n resetButton.classList.remove(\"hidden\");\n easy.classList.remove(\"hidden\");\n medium.classList.remove(\"hidden\");\n hard.classList.remove(\"hidden\");\n }\n }", "function startGame() {\n lobby.hide();\n game.start();\n animate();\n}", "function C012_AfterClass_Amanda_StartDatingSarah() {\n\tLeaveIcon = \"\";\n\tActorSetPose(\"\");\n}", "function startup() {\n\tsceneTransition(\"start\");\n}", "function menu(){\n toggleVisibility(\"root\",\"menu\");\n greeting();\n}", "function showNextScreen()\n{\n // targets the current screen\n var currentScreen = \"#screen\" + screenNum;\n // sets next screen number\n screenNum++;\n // targets the next screen\n var nextScreen = \"#screen\" + screenNum;\n // transition out navigation\n hideNav();\n // transitions current screen out\n TweenMax.fromTo(currentScreen, duration, {\n x: 0\n }, {\n delay: 0.5,\n x: -960,\n ease: Power2.easeInOut\n });\n // shows next screen\n $(nextScreen).show();\n // transitions next screen in\n TweenMax.fromTo(nextScreen, duration, {\n x: 960\n }, {\n delay: 0.5,\n x: 0,\n ease: Power2.easeInOut,\n onComplete: function() {\n // hide current screen\n $(currentScreen).hide();\n // transition on navigation\n showNav();\n }\n });\n \n // load function to animate on contents of screen\n window[\"loadScreen\" + screenNum]();\n}", "function Deathscreen1(SmaeX,SmaeY){\n background(0);\n image(DeathScreen,0,SmaeY);\n fill(255,0,0);\n textSize(72);\n text('Defeat',515,SmaeY+150)\n textSize(36);\n text('Press Number 1 to Retry',425,SmaeY+300);\n noLoop();\n}", "function sayGreeting() {\r\n let username = sessionStorage.getItem('username');\r\n if (username != undefined) {\r\n $('#loggedInUser').text(`Welcome ${username}!`);\r\n updateNavigation();\r\n }\r\n else\r\n {\r\n $('#viewHome').show();\r\n $('#linkLogin').show();\r\n $('#linkRegister').show(); \r\n $('#linkListBooks').hide();\r\n $('#linkCreateBook').hide();\r\n $('#linkLogout').hide();\r\n $('#loggedInUser').text('');\r\n showPage('viewHome');\r\n }\r\n }", "function animate() {\n\tmoveShipRight();\n\tmoveShipLeft();\n\tif(GAME_OBJECTS[\"missles\"].length > 0) {\n\t\tstepMissle();\n\t}\n\tif(steps % 60 == 0) {\n\t\tanimateEnemies();\n\t}\n\tsteps++;\n\tif(steps == 600) {\n\t\tsteps = 0;\n\t}\n\t\n\t// check if game has been finished\n\tif(isGameOver() && gamePhase == 1){\n\t\tdisplayEnd();\n\t}\n}", "function welcome(agent) {\r\n const benvenuto = agent.parameters.bienvenidos; \r\n\tagent.add(benvenuto+ `, me gustaria saber cual es tu nombre! 10.48`);\r\n\r\n }", "function highScoreScreen() {\n if (currentPage === 'creditspage') {\n $box3.animate({left: $screenWidth}, 150); // slides creditspage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else if (currentPage === 'highscorepage') {\n $box2.animate({left: 0}, 150); // slides highscorepage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else if (currentPage === 'playpage') {\n $box1.animate({left: $screenWidth}, 150); // slides playpage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n }\n currentPage = 'highscorepage';\n }", "function welcome(name)\r\n{\r\n console.log(\"Hello, Welcome \",name);\r\n}", "function welcome(){\n var username = readlineSync.question(chalk.blue(\"What's your name? \"))\n console.log(chalk.red(\"Welcome to the CRICKET FANDOM quiz\"), chalk.bgRed.bold(username))\n console.log(chalk.red(\"Type 1,2 or 3 for answering each question.\"))\n console.log(\"---------------------------------------------\")\n}", "function hideWelcome() {\n $(\"#welcome\").hide();\n }", "function failScreen() {\n image(introScreenBackground, 0, 0);\n\n push();\n noStroke();\n noFill();\n rect(275, 310, 340, 75);\n pop();\n\n rainRun();\n\n lightningGenerator();\n\n animation(huntAgainAnim, 450, 350);\n\n animation(brokenMaskAnim, 450, 170);\n}", "function Display(screen) {\n\t\t\n\t\t//Log the current screen Ai can keep track of where we are: \t\t\n\t\tcurrentScreen = screen; \n\n\t\tif (screen == 'Starting') {\n\n\t\t\t//Hide previous screens if existing: \n\t\t\t$('.screen').hide(); \t\t\n\n\t\t\t//Welcome user: \n\t\t\tconsole.log(\"Welcome to DICE.\");\t\t\t\n\t\t\t$('#startScreen').show(); \n\n\t\t\t//Animate UI elements: \n\t\t\t$(\"#rollBtn \").addClass(\"animated bounceInUp\"); \n\t\t\t$(\"#logo\").addClass('animated bounceIn'); \n\t\t}\n\n\t\tif (screen == 'Rolling') {\n\t\t\t//Hide start screen and show the gameplay screens: \n\t\t\t$('#startScreen').hide(); \n\t\t\t$('#dieScreen').show();\n\t\t\t$('#gameplayUI').show();\n\t\t\t//Make the roll button say 'ROLLING': \n\t\t\tupdateRollButton(); \t\t\t\n\t\t}\n\t}", "function introductionScreen() {\n\n instructionsScreen = new createjs.Container();\n\n var panelBG = new createjs.Bitmap(queue.getResult(\"panel\"));\n panelBG.x = 0;\n panelBG.y = 50;\n\n var titleText = new createjs.Text(gameData.Title, \" Bold 18px Comic Sans MS\", \"#000000\");\n titleText.x = panelBG.x + 130;\n titleText.y = panelBG.y + 70;\n titleText.lineWidth = 560;\n\n var descriptionText = new createjs.Text(gameData.Description, \"17px Comic Sans MS\", \"#000000\");\n descriptionText.x = panelBG.x + 130;\n descriptionText.y = panelBG.y + 140;\n descriptionText.lineWidth = 550;\n\n\n var directionsText = new createjs.Text(\"Directions: Touch Directional Arrow Buttons to move along the ship.\" +\n \"\\nHarpoons will fire every 2 seconds.\\nEliminate squids for treasure.\" +\n \"\\nIf the pirate gets hit by the ink, you will need to answer a question.\" +\n \"\\nIf the pirate runs out of harpoons, you will need to answer a question.\", \"16px Comic Sans MS\", \"#000000\");\n directionsText.x = panelBG.x + 130;\n directionsText.y = panelBG.y + 280;\n directionsText.lineWidth = 400;\n\n\n //load logo as a sprite\n //logoContainer = new createjs.Container();\n //var speed = .02;\n //var data = {\n // images: [queue.getResult(\"logosprite\")],\n // frames: {\n // width: 700,\n // height: 500,\n // frames: 2,\n // },\n // animations: {\n // tentacles: [0, 1, \"tentacles\", speed],\n // },\n //};\n\n //var spriteSheet = new createjs.SpriteSheet(data);\n //var sprite = new createjs.Sprite(spriteSheet, \"tentacles\");\n //logoContainer.addChild(sprite);\n\n //create a tween for the logo\n //logoContainer.alpha = 0;\n //createjs.Tween.get(logoContainer).wait(500).to({ alpha: 1, visible: true }, 2000).call(handleComplete);\n //function handleComplete() {\n\n //}\n\n //logoContainer.regX = 180;\n //logoContainer.regY = 60;\n //logoContainer.x = panelBG.x + 220;\n //logoContainer.y = panelBG.y + 300;\n //logoContainer.scaleX = logoContainer.scaleY = 0.30;\n\n\n instructionsScreen.addChild(panelBG, titleText, descriptionText, directionsText);\n\n var soundContain = createSoundContainer();\n self.stage.addChild(instructionsScreen);\n self.stage.addChild(soundContain);\n\n var playButton = new createjs.Bitmap(queue.getResult(\"playbutton\"))\n\n playButton.regX = 93;\n playButton.regY = 95;\n playButton.x = panelBG.x + 600;\n playButton.y = panelBG.y + 400;\n playButton.scaleX = playButton.scaleY = 0.20;\n\n instructionsScreen.addChild(playButton);\n\n createjs.Tween.get(playButton, {\n loop: false\n }).to({\n rotation: 360,\n scaleX: .4,\n scaleY: .4\n }, 2000);\n\n\n //add a tween\n var shadow = new createjs.Shadow(\"#000\", 0, 0, 3);\n\n createjs.Tween.get(shadow, { loop: false })\n .to({ offsetX: 10, offsetY: 10, blur: 20 }, 1500, createjs.Ease.quadInOut)\n // .to({ offsetX: 0, offsetY: 0, blur: 0 }, 1500, createjs.Ease.quadInOut);\n\n playButton.shadow = shadow;\n // logoContainer.shadow = shadow;\n // titleText.shadow = shadow;\n panelBG.shadow = shadow;\n\n playButton.addEventListener(\"click\", handleClickPlay);\n\n function handleClickPlay(event) {\n instructionsScreen.removeChild(playButton);\n self.stage.removeChild(instructionsScreen);\n StartInteraction();\n\n\n };\n\n // if (isGamePaused == true) {\n backText = new createjs.Text(\"Back\", \"Bold 23px Comic Sans MS\", \"#000000\");\n backText.x = instructionsScreen.x + 450;\n backText.y = instructionsScreen.y + 450;\n backText.hitArea = new createjs.Shape(new createjs.Graphics().beginFill(\"#FFF\").drawRoundRect(0, 0, 100, 40, 50));\n // self.stage.addChild(backText);\n // backText.alpha = 0;\n\n backText.addEventListener(\"click\", handleClick);\n\n backText.on(\"mouseover\", handleButtonHover);\n backText.on(\"mouseover\", function (evt) {\n evt.currentTarget.color = \"white\";\n });\n\n backText.on(\"mouseout\", handleButtonHover);\n backText.on(\"mouseout\", function (evt) {\n evt.currentTarget.color = \"black\";\n })\n\n\n function handleClick(event) {\n //self.stage.removeChild(backText);\n self.stage.removeChild(instructionsScreen);\n resumeTheGame();\n }\n\n\n }", "function LoadingScreen() {\n\tloadingEllipsis();\n\tloadingSplash();\n\tloadingEllipsisID = setInterval(loadingEllipsis, 1000);\n\tloadingSplashID = setInterval(loadingSplash, 1500);\n\tloadingFadeOut();\n}", "function Aside() {\n appStarted = true;\n // all objects added to the stage appear in \"layer order\"\n // add a helloLabel to the stage\n seeMore = new objects.Label(\"Click me to see more of my work\", \"32px\", \"Times New Roman\", \"#000000\", canvasHalfWidth, canvasHalfHeight + 200, true);\n stage.addChild(seeMore);\n // add a clickMeButton to the stage\n treesharksLogo = new objects.Icon(loader, \"treesharksLogo\", canvasHalfWidth, canvasHalfHeight - 100, true);\n stage.addChild(treesharksLogo);\n }", "function introWelcome() {\n title.innerText = \"Welcome, \" + username;\n subTitle.innerText = \"\";\n\n firstButton.classList.remove(\"hidden\");\n firstButton.innerText = \"Click to start!\"\n firstButton.onclick = function() {\n startFunction();\n }\n\n userInput.classList.add(\"hidden\");\n submitButton.classList.add(\"hidden\");\n}", "function hideWelcomePage() {\n document.getElementById(\"navigationBar\").style.visibility = \"visible\";\n\n document.getElementById(\"welcomeVideo\").style.visibility = \"hidden\";\n document.getElementById(\"welcomeVideo\").style.opacity = 0;\n document.getElementById(\"welcomeVideo\").style.transition = \"visibility 0s 1s, opacity 1s linear\";\n\n document.getElementById(\"welcomeText\").style.visibility = \"hidden\";\n document.getElementById(\"welcomeText\").style.opacity = 0;\n document.getElementById(\"welcomeText\").style.transition = \"visibility 0s 1s, opacity 1s linear\";\n\n document.getElementById(\"enterName\").style.visibility = \"hidden\";\n document.getElementById(\"enterName\").style.opacity = 0;\n document.getElementById(\"enterName\").style.transition = \"visibility 0s 1s, opacity 1s linear\";\n\n document.getElementById(\"skipButton\").style.visibility = \"hidden\";\n document.getElementById(\"skipButton\").style.opacity = 0;\n document.getElementById(\"skipButton\").style.transition = \"visibility 0s 1s, opacity 1s linear\";\n\n document.getElementById(\"welcomeTextSmall\").style.visibility = \"hidden\";\n document.getElementById(\"welcomeTextSmall\").style.opacity = 0;\n document.getElementById(\"welcomeTextSmall\").style.transition = \"visibility 0s 1s, opacity 1s linear\";\n}", "function Deathscreen3(SmaeX,SmaeY){\n background(0);\n image(DeathScreen,0,SmaeY);\n fill(255,0,0);\n textSize(72);\n text('Defeat',515,SmaeY+150)\n textSize(36);\n text('Press Number 3 to Retry',425,SmaeY+300);\n noLoop();\n}", "function intro(){\n backgroundMove();\n crateShow();\n image(introImg, width/2, height/2);\n}", "function wowAnimation() {\n var wow = new WOW({\n boxClass: 'wow',\n animateClass: 'animated',\n offset: 0,\n mobile: true,\n live: true\n });\n wow.init();\n}", "function run () {\n if (m.debug > m.NODEBUG) { console.log('screens.aboutScreen.run'); }\n \n // one-time initialization\n if (needsInit) {\n // draw logo\n var $canvasBox = $('#aboutLogoBox');\n m.logo.drawLogo($canvasBox, false, 0, 0, 0);\n\n $('#aboutMenuButton')\n // navigate to the screen stored in the button's data\n .click( function (event) {\n var nextScreenId = $(event.target).data('screen');\n m.screens.showScreen(nextScreenId);\n }\n );\n \n // redraw logo when window is resized\n $(window)\n .resize(function (event) {\n $canvasBox.empty();\n m.logo.drawLogo($canvasBox, false, 0, 0, 0);\n }\n );\n }\n needsInit = false;\n }", "onTutorialDone() {\n this.show();\n this.app.message('The tutorial is always available in the settings menu at the bottom right.',5000)\n }" ]
[ "0.7529636", "0.7381515", "0.71753395", "0.7049929", "0.69621754", "0.6757623", "0.6699554", "0.6625824", "0.66090506", "0.6583265", "0.6532268", "0.65173364", "0.6432347", "0.64083445", "0.6354284", "0.63259906", "0.6321166", "0.63039553", "0.6279336", "0.62790334", "0.62763596", "0.6202235", "0.619943", "0.617928", "0.6165521", "0.6164175", "0.61506855", "0.6150174", "0.61417395", "0.614159", "0.61274743", "0.61139995", "0.6105492", "0.60966295", "0.60660815", "0.60645163", "0.605583", "0.60505116", "0.60498327", "0.60476404", "0.60403013", "0.602367", "0.6016112", "0.6016108", "0.5973776", "0.59633887", "0.59555423", "0.5933844", "0.5928223", "0.5915437", "0.5909726", "0.5893593", "0.5874886", "0.5874093", "0.5855523", "0.58519715", "0.58454853", "0.58385015", "0.5832401", "0.5832099", "0.58232665", "0.5809774", "0.58097625", "0.5801946", "0.5788468", "0.57761234", "0.57753277", "0.5774018", "0.577275", "0.5768411", "0.57660776", "0.5762438", "0.5753849", "0.5753594", "0.57508147", "0.5745378", "0.5744479", "0.5742661", "0.573841", "0.5736041", "0.57356817", "0.57342535", "0.5730061", "0.5724481", "0.57235444", "0.5716442", "0.5715345", "0.5711394", "0.57080203", "0.5703432", "0.56995517", "0.5696991", "0.56917924", "0.56893134", "0.5686072", "0.5681003", "0.56747174", "0.567334", "0.56717217", "0.5656812" ]
0.753405
0
show || update score
function showScore(){ ctx.fillStyle="black"; ctx.fillRect(CANVAS_WIDTH-250, 10, 190, 40); ctx.fillStyle = "white"; ctx.font = "24px monospace"; ctx.textAlign = "left"; ctx.fillText("score: " + parseInt(score), CANVAS_WIDTH-250, 37); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateScore() {\n document.querySelector(\"#score\").innerHTML = \"Score: \" + score;\n }", "function updateScore() {\n document.getElementById(\"demo9\").innerHTML = \"Score: \" + score;\n }", "function updateScore(value) {\n addScore(value);\n displayScore();\n}", "function updateScore() {\n $score.text(score);\n}", "function showScore(){\n console.log(chalk.underline.bold(\"Hey your score is: \", score))\n console.log(\"Check out the high scores, if you want to be there ping me.\");\n highScores.map(score => console.log(score.name, \" : \", score.score))\n console.log(\"Enjoy!\")\n}", "function updateScore() {\n document.querySelector(\"#wins\").innerHTML = \"Score: \" + score;\n }", "function updateScore (score){\n\n\tvar scoreDisplay = document.getElementById('score');\n\t\n\tscoreDisplay.innerHTML = 'Score '+ score;\n\n\n\t}", "function updateScore(){\n $('#score').html(score);\n }", "function updateScore(score) {\n\tdocument.querySelector('.score').innerHTML = `Score: ${score}`\n}", "function update_score() {\n\t\t$('[id$=-score]').val(score);\n\t}", "function displayscore(){\n \t$('#playerscore').html('Correct Answer: ' + correctanswer + \n \t\t '<br>Wrong Answer: ' + wronganswer +\n '<br>Unanswer: ' + unanswered);\n }", "function displayScore() {\r\n id(\"this-score\").innerText = scoreGot;\r\n id(\"score\").innerText = score;\r\n id(\"max-score\").innerText = maxScore;\r\n }", "function showScore(){\n\t\t$(\"#score\").html(score+\"/6\");\n\t}", "function updateScoreDisplay()\n{\n\tif(isP2Mode)\n\t{\n\t\t$(\"#best_score\").text(\"\");\n\t\t$(\"#p1_score\").text(\"Blue : \" + snake1.score);\n\t\t$(\"#p2_score\").text(\"Purple : \" + snake2.score);\n\t\t$(\"#tie_score\").text(\"Ties : \" + tie_score);\n\t}\n\telse\n\t{\n\t\t$(\"#best_score\").text(\"High score : \" + highscore);\n\t\t$(\"#p1_score\").text(\"\");\n\t\t$(\"#p2_score\").text(\"\");\n\t\t$(\"#tie_score\").text(\"\");\n\t}\n}", "function score(){\n\tdocument.getElementById('score').innerHTML = \"Score: \" + score;\n}", "function updateScores() {\n scope.$el.find('.js-score-value').text(model.prediction[team])\n }", "function displayscores() {\n\tlet timeto = endTime;\n\tif(!timeto)\n\t\ttimeto = Date.now();\n\tlet formattime = formatTime(timeto-startTime);\n\tlet t = statstext.replace(\"$score\",(score/100 | 0)).replace(\"$level\",\"\" + diffToLevel()).replace(\"$health\",health).replace(\"$kills\",kills).replace(\"$time\",formattime).replace(\"$difficulty\",difficultyGame);\n\tif(difficultyGame == \"easy\") {\n\t\tt = t.replace(\"Health\",\"Amount of Damage received\");\n\t}\n\ttext(t,0,0);\n}", "function updateScore() {\n totalScore = totalScore + 10; // add 10 points to the score\n $score.text(totalScore); // displays the new score on the screen\n console.log(totalScore); // logs the new score in the console\n }", "function updateScore() {\n\tdocument.getElementById(\"score\").innerHTML = score;\n}", "scoreUpdateView() {\n let levelElement = document.getElementById(\"show-pontos\");\n levelElement.innerHTML = '<h2>' + this.score + '</h2>';\n }", "function updateScore () {\n incrementScore ();\n $('.js-score').text(score);\n}", "function updateScore() {\n score += questions[currentQuestionId - 1].worth;\n scoreElement.textContent = score;\n}", "function updateScore(currentScore) {\n $('#score').text(currentScore);\n}", "function userScore() {\n $(\"#yourscore\").html(yourScore);\n console.log(\"yourscore \" + yourScore)\n console.log(\"crystalscore \" + crystalScore)\n }", "function updateScore(){\n\tdocument.getElementById(\"correct\").innerHTML = \"Correct Answers: \" + counters.correct;\n\tdocument.getElementById(\"incorrect\").innerHTML= \"Incorrect Answers: \" + counters.incorrect;\n\tdocument.getElementById(\"unanswered\").innerHTML= \"Unanswered: \" + counters.unanswered;\n}", "function updateScore(){\r\n $('.score').text(`Score: ${score}`)\r\n}", "function updateScore() {\n currentScore = ansArray.length;\n $('#currentScore').text(`Current Score = ${currentScore}`);\n\n if (parseInt(highScore) === 0) {\n highScore = currentScore;\n $('#highScore').text(`High Score = ${highScore}`);\n } else if (parseInt(currentScore) > parseInt(highScore)) {\n highScore = currentScore;\n $('#highScore').text(`High Score = ${highScore}`);\n }\n }", "function updateScore(value) {\n gState.score += value;\n document.querySelector('header > h3 > span').innerText = gState.score;\n displayVictory();\n}", "function updateScore() {\n const scoreDisplay = document.querySelector(\".user-score\")\n score += 1;\n scoreDisplay.textContent = score.toString();\n}", "function updateScore() {\n store.score++;\n}", "function updateScore() {\n score++;\n}", "function updateScore() {\n $('#scoreNumber').text(score);\n}", "function updateScores() {\n lastScore.innerText = 'Last score: ' + score;\n if (score > bestScore) {\n bestScore = score;\n displayBestScore.innerText = 'Best Score: ' + bestScore;\n }\n}", "function updateScore(){\n $('#js-score').html(myGame.score);\n }", "function displayScore() {\n // Create the score\n $('.score').append(`<b>${followers}</b><p>Followers</p>`);\n // Create the post counter\n $('.numPosts').append(`<b>${posts.length}</b><p>Posts</p>`);\n // Create the follower counter\n $('.following').append(`<b>644</b><p>Following</p>`);\n}", "function updateScore(){ // displays into HTML new current score counter\n $(\"#current-score\").text(counter);\n $(\"#win-record\").text(wins);\n $(\"#loss-record\").text(losses);\n}", "function updateScore() {\n scoreDom.innerHTML = score;\n }", "function displayScore(){\n document.getElementById('score').innerHTML = 'Score: '+ score;\n}", "updateScore() {\n if(Dashboard.candyMachted.length) {\n this.score += 1;\n this.levelUp();\n this.scoreUpdateView();\n Dashboard.candyMachted.pop();\n }\n }", "_updateScore() {\n\t\tthis._$scoreBoard.textContent= this._score+'';\n\t}", "function updateScore () {\n score++;\n $('.js-score').text(`${score} `);\n console.log(`updateScore ran and the score is ${score}`);\n}", "function updateScore() {\n scoreElement.textContent = `Score: ${score}`;\n}", "function updateScore() {\n scoreElement.textContent = `Score: ${score}`;\n}", "function updateScore() {\n\t$(\"#wordsCorrect\").html(\"<h5>Words Guessed Correctly: </h5><h3>\" + scoreCorrect + \"</h3>\");\n\t$(\"#wordsSkipped\").html(\"<h5>Words Skipped: </h5><h3>\" + scoreSkipped + \"</h3>\");\n}", "function refreshScore() {\n\tdocument.getElementById(\"score\").innerHTML = PLAYERSCORE + \" - \" + COMPUTERSCORE ;\n}", "function updateScore () {\n score++;\n $('.score').text(score);\n}", "function updateScore(){\n\t$(\"#thescore\").html(\"Score: \" + variables.videos);\n}", "function updateScore(){\n score++\n if(score === 10){\n result.textContent = 'Wow! 10/10 You are the snake genius!'\n } else if(score === 9 ){\n result.textContent= '9/10 Amazing!'\n } else if( score === 8){\n result.textContent = '8/10 Great job!'\n } else if( score === 7){\n result.textContent= '7/10 Good job!'\n }else if(score === 6){\n result.textContent = '6/10 Good Job!'\n }else if(score === 5){\n result.textContent = '5/10 Looks like you need to learn!'\n }else if(score === 4){\n result.textContent = '4/10 Looks like you need to learn!'\n }else if(score === 3){\n result.textContent = '3/10 Looks like you need to learn!'\n }else if(score === 2){\n result.textContent= '2/10 Looks like you need to learn!'\n }else if(score === 1){\n result.textContent = '1/10 Looks like you need to learn!'\n }else if(score === 0){\n result.textContent = '0/10 FAIL!'\n }\n}", "function updateScore() {\n document.querySelector('#score').innerHTML = player.score;\n if(player.score > player.highscore){\n player.highscore = player.score;\n }\n document.querySelector('#highscore').innerHTML = player.highscore;\n}", "static displayScore(score) {\n document.getElementById('gameScore').innerHTML = `Score: ${score}`;\n }", "function updateScore() {\n score++;\n $('.score').text(score);\n}", "function updateScore() {\n score++;\n $('.score').text(score);\n}", "function scoreUpdate(){\r\n document.getElementById('score').innerText = piece.score;\r\n }", "function displayNewScore() {\n score++;\n $('.score').text(score);\n}", "function setCurrentScore () {\n $(\"#current-score\").html(crystal.currentval);\n }", "function displayScore (points){\n\tdocument.getElementById(\"score\").innerHTML = \"Score: \" + points;\n}", "function showScore() {\n\tscoreID.innerHTML = \"Score: \" + score;\n}", "function update_score(value){\n playerInstance.score = Math.max(0, playerInstance.score + value);\n score_tracker.innerText = playerInstance.score;\n }", "function updateScore() {\n if (draw) {\n document.getElementById(\"current_score\").innerHTML = score;\n }\n return;\n}", "function screenScore(score) {\n var element = document.getElementById(\"scor\");\n element.innerHTML = \"Score: \"+score;\n}", "function displayScore(){\n $(\"#memory-score\").html(score);\n $(\"#correct-pairs\").html(pairsCorrect);\n}", "function showScore() {\n var scoreDiv = document.getElementById(\"scoreOutput\");\n var span = '<span id=\"score\">' + score + '</score>';\n scoreDiv.innerHTML = \"Score: \" + span;\n }", "function updateScore() {\n\tvar elScore = document.querySelector('#score');\n\tvar sHTML = (gBallsColected === 1)? gBallsColected +' ball' : gBallsColected +' balls';\n\t\n\telScore.innerHTML = sHTML;\n}", "function showScores() {\n console.log(\"Wooohooo! You SCORED: \", currScore);\n\n console.log(\"Check out the high scores. (Updated Automatically.)\");\n\n highScores.map(score => console.log(score.name, \" : \", score.hScore))\n}", "function displayScores() {\n score0El.innerText = score0;\n score1El.innerText = score1;\n }", "function refreshTargetScore() {\n\t\t$(\"#targetScore\").text(targetScore);\n\t}", "function updateScore(){\n showScore.innerHTML = tetromino.score++/100|0;// Divide by 100 and floor the score to make it a smaller whole number \n}", "function showScore() {\n $(\"h2\").text(`Score: ${score}`);\n}", "function displayScore() {\n titleEl.textContent = (\"High scores:\")\n titleEl.style = (\"color: black\");\n footerEl.style = (\"display: none\");\n timerEl.textContent = (JSON.stringify(highScores[0][\"initials\"]))\n penalty.textContent = (JSON.stringify(highScores[0][\"score\"]))\n penalty.style = (\"color: black\");\n}", "function setScore() {\n $(\"#winsDisplay\").text(wins);\n $(\"#lossesDisplay\").text(losses);\n}", "function drawScore() {\n document.getElementById('score').innerText = score.toString();\n }", "function displayScore(score, highscore) {\n scoreDisplay.textContent = `Score: ${score} `\n highscoreDisplay.textContent = `Highscore: ${highscore}`\n}", "function displayScore() {\n $('#scoreCurrent').text(total);\n}", "function showScores() {\n console.log(\"YAY! You SCORED: \", score);\n\n console.log(\"Check out the high scores, if you should be there ping me and I'll update it\");\n\n highScores.map(score => console.log(score.name, \" : \", score.score))\n}", "function updateScore() {\n score++;\n\n $('.score').text(score);\n}", "function updateScore() {\n document.getElementById(\"points\").innerHTML = score;\n // Debugging\n // console.log(document.getElementById(\"points\").innerHTML);\n }", "function showScore() {\n\n\tdocument.getElementById(\"score\").innerHTML = \"SCORE: \" + score;\n\n\t//Check if score is 0\n\tif (score === 0) {\n\t\tshowGameOver();\n\t}\n}", "function tallyScore(){\n\t\t$('#scoreKeeper').html(score);\n\t}", "function displayScore() {\n $(\"#score\").text(\"Score:\" + score)\n $(\"#incorrect\").text(\"Incorrect:\" + incorrect)\n}", "function getScore(){\n return score\n}", "function showHighScores() {\n display.set(\"highScores\").show();\n }", "function setScore(newScore) {\n document.getElementById('score').innerHTML = newScore;\n score = newScore;\n}", "function updateScoreDisplay(draw, won, lost, played) {\n $(\"#game_won\").html(\" \" + gameWon);\n $(\"#game_lost\").html(\" \" + gameLost);\n $(\"#game_draw\").html(\" \" + gameDraw);\n $(\"#game_played\").html(\" \" + gamePlayed);\n}", "function updatePlayerScore(newScore) {\n player.score = newScore;\n document.getElementById(\"player-score\").innerText = newScore;\n}", "updateTotalScore() {\n this.score =\n this.calculatedRedScore +\n this.calculatedYellowScore +\n this.calculatedGreenScore +\n this.calculatedBlueScore -\n this.penaltyScore;\n this.displayCurrentScore();\n }", "function showCurrentScore() {\n score1.innerHTML = `<p><strong>${gameData.score[0]}</strong><\\p>`;\n score2.innerHTML = `<p><strong>${gameData.score[1]}</strong><\\p>`;\n }", "function updateScore(){\n\tconsole.log(playerScore);\n\tdocument.getElementById(\"player\").innerHTML = \"Player: \" + playerScore;\n\tdocument.getElementById(\"computer\").innerHTML = \"Computer: \" + computerScore;\n}", "function updatePlayer2Score(score)\n{\n if (typeof (score) == 'undefined' || score == null)\n throw \"The score is unassigned.\";\n\n $('#player2_score').html(\"Player 2: \" + score);\n}", "function updateScore(result) {\n\tif (result === 'won') {\n\t\t++totalWins;\n\t} else if (result === 'lose') {\n\t\t++totalLost;\n\t} else {\n\t\t++totalDraw;\n\t}\n\n\t++totalMatches;\n\n\tupdateBoard(totalMatches, totalWins, totalLost, totalDraw);\n}", "updateScore(num) {\n if (num === 0) {\n this.scoreCounter = num; // Reset the score to 0\n } else {\n this.scoreCounter += 1; // Increment the score by 1\n }\n // Show the updated score on the page\n this.scoreBoard.textContent = this.scoreCounter;\n }", "function refreshUserScore() {\n\t\t$(\"#userScore\").text(userScore);\n\t}", "function score (won){\n if (won === true)\n {$(\"#score\").html(\"Score: 100\");}\n}", "updateScore( score ){\n this.score += score;\n this.playerDB.update(this.props());\n }", "updateScore(){\n this.score += 10;\n CURRENT_SCORE.innerHTML = `Score: ${this.score}`;\n }", "function showScore(currentScore) {\n elems.currentscore.innerHTML = currentScore.toFixed(0);\n elems.allscore.innerHTML = score.toFixed(0);\n elems.scoreboard.style.right = \"0px\";\n}", "function displayScore(){\n console.log(\"Your final score is: \",score)\n console.log(\"High Scorer's: \")\n for(var i=0;i<highScore.length;i++){\n console.log(highScore[i].name,\":\",highScore[i].score)\n }\n //if user score is equal or greater than high scorer congrats user\n if(score >= highScore[0].score || score >= highScore[1].score){\n console.log(chalk.bgGrey(\"Congrats! You made it to the high score chart.\\nSend screenshot of your score.\"))\n }\n}", "function showScore() {\r\n\tlet scoreContainer = document.getElementsByClassName('score__current')[0];\r\n\tlet bestScoreContainer = document.getElementsByClassName('score__best')[0];\r\n\r\n\tscoreContainer.innerHTML = \"Score:\" + score;\r\n\tif(!localStorage.bestScore) {\r\n\t\tlocalStorage.bestScore = 0;\r\n\t}\r\n\tbestScoreContainer.innerHTML = \"Best Score:\" + localStorage.bestScore;\r\n}", "function showScore() {\n $(\".score\").html(`${currentScore}`);\n console.log('showing score');\n}", "function outputResults(score) {\n\n\n}", "updateScore() {\n\t\tthis.score += 1;\n\t\tthis.gameinfoElement.childNodes[0].innerHTML = \"<h1>Score: \" + this.score + \"</h1>\";\n\t}", "function updateScores() {\n dealerScore = getScore(dealerCards);\n playerScore = getScore(playerCards);\n}" ]
[ "0.7663399", "0.7636699", "0.7526363", "0.7466327", "0.7430234", "0.7386744", "0.7368273", "0.7341629", "0.7305776", "0.7277595", "0.72756666", "0.7252861", "0.72473353", "0.72389555", "0.71993923", "0.7197679", "0.7186347", "0.7182971", "0.71429926", "0.71310365", "0.71276236", "0.7126773", "0.7119981", "0.71172523", "0.7094946", "0.7075388", "0.7074322", "0.7066143", "0.70463353", "0.70329845", "0.70323515", "0.7023132", "0.7021081", "0.7019169", "0.70157605", "0.7012453", "0.70011085", "0.6998176", "0.698533", "0.69790345", "0.6977205", "0.69713235", "0.69713235", "0.69671655", "0.69597197", "0.69574547", "0.6956763", "0.6943423", "0.69353163", "0.6928664", "0.6921536", "0.6921536", "0.69158506", "0.6912674", "0.69028836", "0.69004136", "0.68923074", "0.6881235", "0.6872682", "0.68710285", "0.6862982", "0.68562156", "0.68484336", "0.6846769", "0.68382835", "0.68381065", "0.6834577", "0.68289167", "0.68264586", "0.6824348", "0.68195015", "0.68185806", "0.68025255", "0.6801566", "0.6799882", "0.67996913", "0.67972", "0.6796367", "0.67957765", "0.6792628", "0.67888254", "0.6788536", "0.6786736", "0.67856866", "0.67849123", "0.67809844", "0.6774985", "0.67747295", "0.6766957", "0.6762511", "0.6761924", "0.6760908", "0.6759245", "0.6756996", "0.67532337", "0.67522675", "0.6752264", "0.67514527", "0.6749749", "0.67416275", "0.6740322" ]
0.0
-1
run the game. Create mrPacman and 4 ghosts. Reset their positions.
function run() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup() {\n createCanvas(575, 675)\n cols = width / scale\n rows = height / scale\n //frameRate changed for easier animations and movement speed changes\n frameRate(30)\n\n // animation setup\n animationSetUp()\n\n //create new game\n game = new Game()\n\n // game board set up\n game.setupGrid()\n\n //create new pacman\n pacman = new Pacman(game.grid, scale, 12, 19)\n\n //TODO: Rethink starting positions\n createGhosts()\n\n // get the button\n\n startButton = createButton('Start Game').size(100, 35).center()\n // startButton.position(windowWidth/2-50, windowHeight/2)\n startButton.mousePressed(() => game.start())\n\n resetButton = createButton('Restart Game').size(100, 35).center()\n // resetButton.position(windowWidth/2-50, windowHeight/2)\n resetButton.mousePressed(() => {\n game.restart()\n pacman = new Pacman(game.grid, scale, 12, 19)\n })\n resetButton.hide()\n}", "run() {\n this.spawns();\n this.move();\n this.draw();\n }", "resetBoard(){\r\n //location pacman is reset to\r\n this.pos = createVector(13*16+8, 23*16+8); \r\n //resets all of the ghosts\r\n this.blinky = new Blinky();\r\n this.clyde = new Clyde();\r\n this.pinky = new Pinky();\r\n this.inky = new Inky();\r\n //resets pacmans velocity\r\n this.vel = createVector(-1, 0);\r\n this.goTo = createVector(-1,0);\r\n }", "function generateGhost(red,pink){\n /*\n Red Ghost/Blinky\n Starts outside of ghost house\n Scatter (\"home\") target = top right of screen.\n In chase mode, target is pacman's current location.\n */\n red.updateTargetTile = function(){\n if (red.movingDir != 0) {\n if (red.state == GHOST_CHASE) {\n red.targetX = red.pacman.currX;\n red.targetY = red.pacman.currY;\n } else if (red.state == GHOST_SCATTER) {\n red.targetX = red.scatterX;\n red.targetY = red.scatterY;\n }\n }\n }\n red.updateGhost = function(){\n if (!red.pause) {\n red.maze.moveGrid[red.prevY][red.prevX] = 1;\n red.updatePrevious();\n red.updateTargetTile();\n red.updatePhase();\n red.determineNextTile();\n red.maze.moveGrid[red.currY][red.currX] = red.id;\n }\n }\n red.restartUpdate = function(cX,cY){\n red.currX = cX;\n red.currY = cY;\n red.prevX = cX;\n red.prevY = cY;\n }\n\n /*\n Pink Ghost/Pinky\n Starts inside ghost house but exits almost immediately\n Scatter (\"home\") target = bottom left of screen\n In chase mode, target is where pacman is going\n (4 tiles straight ahead of pacman's current position, straight = direction pacman is facing)\n This means his target CAN be behind him.\n */\n pink.updateTargetTile = function(){\n if (pink.movingDir != 0) {\n if (pink.state == GHOST_CHASE) {\n switch(pink.pacman.faceDir){\n case MOUTH_UP:\n pink.targetX = pink.pacman.currX;\n pink.targetY = pink.pacman.currY-4;\n break;\n case MOUTH_DOWN:\n pink.targetX = pink.pacman.currX;\n pink.targetY = pink.pacman.currY+4;\n break;\n case MOUTH_LEFT:\n pink.targetX = pink.pacman.currX-4;\n pink.targetY = pink.pacman.currY;\n break;\n case MOUTH_RIGHT:\n pink.targetX = pink.pacman.currX+4;\n pink.targetY = pink.pacman.currY;\n break;\n }\n } else if (pink.state == GHOST_SCATTER) {\n pink.targetX = pink.scatterX;\n pink.targetY = pink.scatterY;\n }\n }\n };\n pink.updateGhost = function(){\n if (!pink.pause && !pink.inHouse) {\n pink.maze.moveGrid[pink.prevY][pink.prevX] = 1;\n pink.updatePrevious();\n pink.updateTargetTile();\n pink.updatePhase();\n pink.determineNextTile();\n pink.maze.moveGrid[pink.currY][pink.currX] = pink.id;\n }else if (pink.inHouse){\n pink.maze.moveGrid[pink.prevY][pink.prevX] = 1;\n pink.checkExitHouse();\n pink.maze.moveGrid[pink.currY][pink.currX] = pink.id;\n }\n };\n pink.restartUpdate = function(cX,cY){\n pink.currX = cX;\n pink.currY = cY;\n pink.prevX = cX;\n pink.prevY = cY;\n }\n pink.coinCount = 0;\n pink.checkExitHouse = function(){\n if (pink.pacman.numCoin > pink.coinCount){\n pink.exitHouse();\n }\n };\n pink.exitHouse = function(){\n pink.targetX = GHOST_STARTX_RED/TILEX-1;\n pink.targetY = GHOST_STARTY_RED/TILEY;\n pink.updatePrevious();\n pink.determineNextTile();\n\n if (pink.currY == 10){\n pink.maze.moveGrid[9][8] = INVISIWALL;\n pink.maze.moveGrid[9][9] = INVISIWALL;\n pink.maze.moveGrid[9][10] = INVISIWALL;\n }else if (pink.currY < 9){\n inHouse = false;\n pink.maze.moveGrid[9][8] = GATE;\n pink.maze.moveGrid[9][9] = GATE;\n pink.maze.moveGrid[9][10] = GATE;\n pink.updateTargetTile();\n }\n };\n}", "function run(){ //the only function which is executed.Rest all functions are interconnected by this function.\n initial(); //it creates snakes,food and walls\n int=setInterval(gameloop,interval);\n }", "function worldFunction() {\r\n\r\n reset();\r\n\r\n $(\"#introScreen\").css('display', 'none');\r\n $(\"#worldBorder\").css('display', 'inline-block');\r\n $(\"#runningman\").css('display', 'block');\r\n $(\"#world\").css('display', 'block');\r\n $(\"#Ghost1\").css('display', 'block');\r\n $(\"#Ghost2\").css('display', 'block');\r\n $(\"#Ghost3\").css('display', 'block');\r\n $(\"#Ghost4\").css('display', 'block');\r\n $(\"#scoreBox\").css('display', 'inline-block');\r\n\r\n // ------------------------------------------------------\r\n // AGENTS FUNCTION\r\n // ------------------------------------------------------\r\n\r\n window.setInterval(function() {\r\n randomAgent(Ghost1, displayGhost1);\r\n }, 300);\r\n\r\n window.setInterval(function() {\r\n randomAgent(Ghost2, displayGhost2);\r\n }, 300);\r\n\r\n window.setInterval(function() {\r\n randomAgent(Ghost3, displayGhost3);\r\n }, 500);\r\n\r\n window.setInterval(function() {\r\n randomAgent(Ghost4, displayGhost4);\r\n }, 300);\r\n\r\n displayWorld();\r\n displayrunningman();\r\n displayGhost1();\r\n displayGhost2();\r\n displayGhost3();\r\n displayGhost4();\r\n\r\n displayScore();\r\n\r\n window.addEventListener(\"keydown\", function(e) {\r\n // space and arrow keys\r\n if ([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {\r\n e.preventDefault();\r\n }\r\n }, false);\r\n\r\n document.onkeydown = function(moverunningman) {\r\n let newLoc = null;\r\n\r\n if (moverunningman.keyCode == 39) {\r\n newLoc = right(runningman);\r\n\r\n if (getLoc(newLoc) != 2) {\r\n $(\"#runningman\").css('transform', 'none');\r\n runningman.x = newLoc.x;\r\n }\r\n } else if (moverunningman.keyCode == 37) {\r\n newLoc = left(runningman);\r\n\r\n if (getLoc(newLoc) != 2) {\r\n $(\"#runningman\").css('transform', 'rotate(180deg)');\r\n runningman.x = left(runningman).x;\r\n }\r\n } else if (moverunningman.keyCode == 38) {\r\n newLoc = up(runningman);\r\n\r\n if (getLoc(newLoc) != 2) {\r\n $(\"#runningman\").css('transform', 'rotate(270deg)');\r\n runningman.y = up(runningman).y;\r\n }\r\n } else if (moverunningman.keyCode == 40) {\r\n newLoc = down(runningman);\r\n\r\n if (getLoc(newLoc) != 2) {\r\n $(\"#runningman\").css('transform', 'rotate(90deg)');\r\n runningman.y = down(runningman).y;\r\n }\r\n }\r\n\r\n if (world[runningman.y][runningman.x] == 1) {\r\n world[runningman.y][runningman.x] = 0;\r\n score--;\r\n displayScore();\r\n displayWorld();\r\n }\r\n // displayrunningman();\r\n\r\n if (collision(Ghost1, runningman)) {\r\n runningmanGotHit = true;\r\n gameOver();\r\n }\r\n // displayrunningman();\r\n\r\n if (collision(Ghost2, runningman)) {\r\n runningmanGotHit = true;\r\n gameOver();\r\n }\r\n // displayrunningman();\r\n\r\n if (collision(Ghost3, runningman)) {\r\n runningmanGotHit = true;\r\n gameOver();\r\n }\r\n // displayrunningman();\r\n\r\n if (collision(Ghost4, runningman)) {\r\n runningmanGotHit = true;\r\n gameOver();\r\n }\r\n // displayrunningman();\r\n\r\n displayrunningman();\r\n }\r\n\r\n}", "function start_game(){\n\tif(!game_started){\n\t\tclearInterval(animation_press);\n\t\tclearInterval(animation_press2);\n\t\tpacmanimg = document.getElementById(\"pacman-yellow\");\n\t\tblueimg = document.getElementById(\"ghost1\");\n\t\tpinkimg = document.getElementById(\"ghost2\");\n\t\tmakelabyrinth();\n\t\tpacman = new drawPacman(300, 435);\n\t\tghostblue = new Ghost(300, 310, blueimg);\n\t\tghostblue.draw();\n\t\tpacman.draw();\n\t\tghostpink = new Ghost(300, 270, pinkimg);\n\t\tghostpink.draw();\n\t\trepaint = setInterval(render, 20);\n\t\tdocument.addEventListener(\"keydown\", movePacman, false);\n\t\tgame_started = true;\n\t\tmakepoints();\n\t}else{\n\t\talert(\"Are you sure you want to re-start the game?\");\n\t}\n}", "checkPosition(){\r\n if(isCriticalPosition(this.pos)){\r\n //if((this.pos.x-8)%16 == 0 && (this.pos.y-8)%16 == 0){//checks if pacman is on a critical spot\r\n //let arrPosition = createVector((this.pos.x-8)/16, (this.pos.y-8)/16);//changes location to an array position\r\n let arrPosition = pixelToTile(this.pos);\r\n //resets all paths for the ghosts\r\n //this.blinky.setPath();\r\n //this.pinky.setPath();\r\n //this.clyde.setPath();\r\n //this.inky.setPath();\r\n //Checks if the position has been eaten or not, blank spaces are considered eaten\r\n if(!this.tiles[floor(arrPosition.y)][floor(arrPosition.x)].eaten){\r\n this.tiles[floor(arrPosition.y)][floor(arrPosition.x)].eaten = true;\r\n //score+=10;//adds points for eating\r\n this.score+=1;\r\n this.dotsEaten++;\r\n this.ttl = 600;\r\n if(this.tiles[floor(arrPosition.y)][floor(arrPosition.x)].bigDot){//checks if the big dot is eaten\r\n //set all ghosts to frightened mode\r\n if(!this.blinky.goHome && !this.blinky.tempDead){\r\n this.blinky.frightened = true;\r\n this.blinky.flashCount = 0;\r\n }if(!this.clyde.goHome && !this.clyde.tempDead){\r\n this.clyde.frightened = true;\r\n this.clyde.flashCount = 0;\r\n }if(!this.pinky.goHome && !this.pinky.tempDead){\r\n this.pinky.frightened = true;\r\n this.pinky.flashCount = 0;\r\n }if(!this.inky.goHome && !this.inky.tempDead){\r\n this.inky.frightened = true;\r\n this.inky.flashCount = 0;\r\n }\r\n }\r\n }\r\n //the position in the tiles array that pacman is turning towards\r\n let positionToCheck = new createVector(arrPosition.x + this.goTo.x, arrPosition.y + this.goTo.y);\r\n //console.log(\"Position to Check X: \", positionToCheck.x, \" Y: \", positionToCheck.y);\r\n if(this.tiles[floor(positionToCheck.y)][floor(positionToCheck.x)].tunnel){//checks if the next position will be in the tunnel\r\n this.specialCase(this.pos);\r\n }if(this.tiles[floor(positionToCheck.y)][floor(positionToCheck.x)].wall){//checks if the space is not a wall\r\n if(tiles[floor(arrPosition.y + vel.y)][floor(arrPosition.x + vel.x)].wall){\r\n this.vel = createVector(this.goTo.x, this.goTo.y);//Not sure about this line...\r\n return false;\r\n }else{//moving ahead is free\r\n return true;\r\n }//return !(this.tiles[floor(arrPosition.y + this.vel.y)][floor(arrPosition.x + this.vel.x)].wall);//if both are walls then don't move\r\n }else{//allows pacman to turn\r\n this.vel = createVector(this.goTo.x, this.goTo.y);\r\n return true;\r\n }\r\n }else{//if pacman is not on a critial spot\r\n let ahead = createVector(this.pos.x+10*this.vel.x, this.pos.y+10*this.vel.y);\r\n //if((this.pos.x+10*this.vel.x-8)%16 == 0 && (this.pos.y+10*this.vel.y-8)%16 == 0){\r\n if(isCriticalPosition(ahead)){\r\n //let arrPosition = createVector((this.pos.x+10*this.vel.y-8)/16, (this.pos.y+10*this.vel.y)/16);\r\n let arrPostion = pixelToTile(ahead);//convert to an array position\r\n if(!this.tiles[floor(arrPosition.y)][floor(arrPosition.x)].eaten){\r\n this.tiles[floor(arrPosition.y)][floor(arrPosition.x)].eaten = true;//eat the dot\r\n this.score+=1;//10\r\n this.dotsEaten++;\r\n ttl = 600;\r\n if(this.tiles[floor(arrPosition.y)][floor(arrPosition.x)].bigDot && bigDotsActive){\r\n //this.score+=40;//could be used to give a better reward for getting the big dots\r\n //sets all ghosts to frightened mode\r\n if(!this.blinky.goHome && !this.blinky.tempDead){\r\n this.blinky.frightened = true;\r\n this.blinky.flashCount = 0;\r\n }if(!this.clyde.goHome && !this.clyde.tempDead){\r\n this.clyde.frightened = true;\r\n this.clyde.flashCount = 0;\r\n }if(!this.pinky.goHome && !this.pinky.tempDead){\r\n this.pinky.frightened = true;\r\n this.pinky.flashCount = 0;\r\n }if(!this.inky.goHome && !this.inky.tempDead){\r\n this.inky.frightened = true;\r\n this.inky.flashCount = 0;\r\n }\r\n }\r\n } \r\n }if(this.goTo.x+this.vel.x == 0 && this.vel.y+this.goTo.y == 0){//if turning change directions entirely, 180 degrees\r\n this.vel = createVector(this.goTo.x, this.goTo.y);//turn\r\n return true;\r\n }return true;//if it is not a critical position then it will continue forward\r\n }\r\n }", "function createWorld(){\n cnvBg = document.getElementById(\"bg\");\n cnvPacman = document.getElementById(\"pacman\");\n\n if(cnvPacman.getContext){\n ctxBg = cnvBg.getContext(\"2d\");\n ctxPacman = cnvPacman.getContext(\"2d\");\n\n ctxBg.fillStyle = \"black\";\n ctxBg.fillRect(0, 0, 760, 880);\n\n for(y = 0; y < Pacman.MAP.length; y++){\n for(x = 0; x < Pacman.MAP[y].length; x++){\n if(Pacman.MAP[y][x] == 0){\n var blocksGradient = ctxPacman.createLinearGradient(x * 40, y * 40, x * 40, (y * 40) + 40);\n blocksGradient.addColorStop(0,\"#1240AB\");\n blocksGradient.addColorStop(1,\"#06266F\");\n\n ctxBg.fillStyle = blocksGradient;\n ctxBg.fillRect(x * 40, y * 40, 40, 40);\n\n ctxBg.strokeStyle = \"#4671D5\";\n ctxBg.strokeRect(x * 40, y * 40, 40, 40);\n } else if(Pacman.MAP[y][x] == 1){\n ctxBg.fillStyle = \"white\";\n ctxBg.fillRect((x * 40) + 18, (y * 40) + 18, 4, 4);\n } else if(Pacman.MAP[y][x] == 4){\n ctxBg.beginPath();\n ctxBg.arc((x * 40) + 20, (y * 40) + 20, 5, 0, 2 * Math.PI);\n ctxBg.fillStyle = \"white\";\n ctxBg.fill();\n ctxBg.closePath();\n }\n }\n }\n\n ghostSprite = {};\n\n pacmanSprite.y = 20 ;\n pacmanSprite.x = 9;\n\n ghostSprite.y = 8;\n ghostSprite.x = 9;\n\n drawGhost(4,400);\n\n $(\"#log\").html(log);\n }\n}", "function move(){\n const pacmanGridBox = gridBoxes[position]\n const player = gridBoxes.find(box => box.classList.contains('pacman'))\n player.classList.remove('pacman')\n player.removeAttribute('data-direction')\n pacmanGridBox.classList.add('pacman')\n\n\n pacmanGridBox.setAttribute('data-direction', pacmanDirection.toString())\n\n if ((pacmanGridBox.classList.contains('ghost')) && (!pacmanGridBox.classList.contains('blue'))) deathClear()\n\n if (pacmanGridBox.classList.contains('pac-dot')){\n pacmanGridBox.classList.remove('pac-dot')\n score++\n scoreElem.innerText = score\n }\n\n if (pacmanGridBox.classList.contains('power-dot')) startBlueGhostPhase(pacmanGridBox)\n\n if ((pacmanGridBox.classList.contains('blue'))){\n score = score + powerScore\n powerScore = powerScore*2\n scoreElem.innerText = score\n\n if (pacmanGridBox.classList.contains('yellow')){\n clearInterval(yellowGhostInterval)\n pacmanGridBox.classList.remove('blue','yellow','ghost')\n yellowGhostPosition = 298\n gridBoxes[yellowGhostPosition].classList.add('yellow', 'ghost')\n }\n if (pacmanGridBox.classList.contains('red')){\n clearInterval(redGhostInterval)\n pacmanGridBox.classList.remove('blue','red','ghost')\n redGhostPosition = 274\n gridBoxes[redGhostPosition].classList.add('red', 'ghost')\n }\n if (pacmanGridBox.classList.contains('pink')){\n clearInterval(pinkGhostInterval)\n pacmanGridBox.classList.remove('blue','pink','ghost')\n pinkGhostPosition = 301\n gridBoxes[pinkGhostPosition].classList.add('pink', 'ghost')\n }\n if (pacmanGridBox.classList.contains('aqua')){\n clearInterval(aquaGhostInterval)\n pacmanGridBox.classList.remove('blue','aqua','ghost')\n aquaGhostPosition = 277\n gridBoxes[aquaGhostPosition].classList.add('aqua', 'ghost')\n }\n }\n }", "function runComplex() {\n initTestMap();\n splitLeaves();\n createRooms(root);\n drawHalls();\n initActors();\n display();\n}", "function continueGame() {\n //initial monsters\n _pacmanLives--;\n for (var i = 0; i < _numberOfMonster; i++) {\n var monster = _monsters[i];\n currBoard[monster.i][monster.j] = _beforeMonsterCell[i];\n if (i === 0) {\n currBoard[0][0] = 5;\n monster.i = 0;\n monster.j = 0;\n }\n if (i === 1 && _numberOfMonster>1) {\n currBoard[38][18] = 6;\n monster.i = 38;\n monster.j = 18;\n }\n if (i === 2 && _numberOfMonster>2) {\n currBoard[38][0] = 7;\n monster.i = 38;\n monster.j = 0;\n }\n }\n _beforeMonsterCell = [9, 9, 9];\n _monsterLastPosition = [[], [], []];\n\n //initial pacman\n pac_color = \"yellow\";\n m_currDirection = 4;\n var randomNum = Math.floor((Math.random() * 285 + 1));\n locatePacman = 0;\n var pacman_remain = 1;\n for (var i = 0; i < _gameWidth / proportion - 1; i++) {\n for (var j = 0; j < _gameHeight / proportion - 1; j++) {\n if (currBoard[i][j] === 9) {\n if (randomNum - 10 <= locatePacman && locatePacman <= randomNum + 10 && pacman_remain === 1) {\n currBoard[i][j] = 2;\n pacmanShape.i = i;\n pacmanShape.j = j;\n pacman_remain--;\n break;\n }\n locatePacman++;\n }\n }\n }\n Draw();\n intervalPacman = setInterval(UpdatePosition, ui_gameSpeed);\n}", "function GameStart() {\n\tGenerateCharacter();\n\tCreateTileGrid();\n\tCreateGraphicsGrid();\n\tCreateNoteGrid();\n\tGenerateDungeon();\n\tRoundTimer();\n}", "run(){\n\t\tthis.maybeEnemy();\n\t\tthis.move();\n\t\tthis.update();\n\t\tthis.checkEdges();\n\t\tthis.checkIfDead();\n\t\tthis.display();\n\t}", "launchGame() {\n this.grid.generate()\n this.grid.generateWalls()\n this.grid.generateWeapon('axe', this.grid.giveRandomCase())\n this.grid.generateWeapon('pickaxe', this.grid.giveRandomCase())\n this.grid.generateWeapon('sword', this.grid.giveRandomCase())\n this.grid.generateWeapon('rod', this.grid.giveRandomCase())\n \n this.shears = new Weapon('shears', 10)\n this.sword = new Weapon('sword', 20)\n this.axe = new Weapon('axe', 30)\n this.pickaxe = new Weapon('pickaxe', 40)\n this.rod = new Weapon('rod', 50)\n\n var position_player1 = -1\n var position_player2 = -1\n\n do {\n position_player1 = this.grid.generatePlayer('1')\n this.player1.setPosition(position_player1)\n } while (position_player1 == -1)\n\n do {\n position_player2 = this.grid.generatePlayer('2')\n this.player2.setPosition(position_player2)\n } while (position_player2 == -1 || this.grid.isNextToPlayer(position_player2))\n\n this.game_status = $('#game_status')\n this.game_status.html('Recherche d\\'armes pour les deux joueurs...')\n }", "function start(){\n // First/starting background\n imageMode(CENTER);\n image(gamebackground, width/2, height/2, width, height);\n fill(255);\n text(\"Master of Pie\", width/2 - width/20, height/4);\n text(\"Start\", width/2 - width/75, height/2);\n text(\"(Landscape Orientation Preferred)\", width/2 - width/10, height/4 + height/14);\n // Pizzas array is cleared\n pizzas = [];\n // Creates the ship\n ship = new Spacecraft();\n // Creates pizzas/asteroids at random places offscreen\n for(let i = 0; i < pizzaorder; i++){\n pizzas[i] = new Rock(random(0, width), random(0, height), random(width/40, width/10));\n }\n // Reset variables\n click3 = true;\n reload = 10;\n piecutter = [];\n pizzaorder = 1;\n level = 1;\n}", "function startReset(ghost) {\n for( let i=0; i<16; i++) {\n clearInterval(caughtIdOne)\n clearInterval(caughtIdTwo)\n clearInterval(caughtIdThree)\n clearInterval(caughtIdFour)\n }\n reset(ghost)\n clearInterval(pacSoundId)\n pacSoundId = setInterval(pacSound, 650)\n //restart ghosts moving\n clearInterval(ghostMoveIdOne)\n clearInterval(ghostMoveIdTwo)\n clearInterval(ghostMoveIdThree)\n clearInterval(ghostMoveIdFour)\n ghostMoveIdOne = setInterval(function(){\n chooseAndMove(ghostOne)\n }, ghostTimePerMove)\n ghostMoveIdTwo = setInterval(function(){\n chooseAndMove(ghostTwo)\n }, ghostTimePerMove)\n ghostMoveIdThree = setInterval(function(){\n chooseAndMove(ghostThree)\n }, ghostTimePerMove)\n ghostMoveIdFour = setInterval(function(){\n chooseAndMove(ghostFour)\n }, ghostTimePerMove)\n }", "function runGame() {\n\tvar g = new Main('game', 'container');\n\tg.init();\n}", "function pacMove() {\n if (directionPM == 1) {\n if (maze[pacman.y][pacman.x-1] ==7 || maze[pacman.y][pacman.x-1] ==9 || maze[pacman.y][pacman.x-1] ==10 || maze[pacman.y][pacman.x-1] ==11) {\n pacman.x = 14;\n pacman.y = 23;\n lives--;\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n } else if (maze[pacman.y][pacman.x-1] ==6) {\n maze[pacman.y][pacman.x] = 3;\n pacman.x = 26;\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n } else if (maze[pacman.y][pacman.x-1] ==4) {\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n } else if (maze[pacman.y][pacman.x-1] !==1) {\n if (maze[pacman.y][pacman.x-1] ==2) {\n maze[pacman.y][pacman.x] = 3;\n pacman.x = pacman.x - 1;\n maze[pacman.y][pacman.x] = 5;\n score += 100;\n drawMaze();\n } else {\n maze[pacman.y][pacman.x] = 3;\n pacman.x = pacman.x - 1;\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n }\n }\n } else if (directionPM == 2) {\n $(\".pacman\").css(\"transform\",\"rotate(270deg)\");\n if (maze[pacman.y-1][pacman.x] ==7 || maze[pacman.y-1][pacman.x] ==9 || maze[pacman.y-1][pacman.x] ==10 || maze[pacman.y-1][pacman.x] ==11) {\n pacman.x = 14;\n pacman.y = 23;\n lives--;\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n } else if (maze[pacman.y-1][pacman.x] ==4) {\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n } else if (maze[pacman.y-1][pacman.x] !==1) {\n if (maze[pacman.y-1][pacman.x] ==2) {\n maze[pacman.y][pacman.x] = 3;\n pacman.y = pacman.y - 1;\n maze[pacman.y][pacman.x] = 5;\n score += 100;\n drawMaze();\n } else {\n maze[pacman.y][pacman.x] = 3;\n pacman.y = pacman.y - 1;\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n }\n }\n } else if (directionPM == 3) {\n $(\".pacman\").css(\"transform\",\"rotate(0deg)\");\n if (maze[pacman.y][pacman.x+1] ==7 || maze[pacman.y][pacman.x+1] ==9 || maze[pacman.y][pacman.x+1] ==10 || maze[pacman.y][pacman.x+1] ==11) {\n pacman.x = 14;\n pacman.y = 23;\n lives--;\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n } else if (maze[pacman.y][pacman.x+1] ==4) {\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n } else if (maze[pacman.y][pacman.x+1] ==6) {\n maze[pacman.y][pacman.x] = 3;\n pacman.x = 1;\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n } else if (maze[pacman.y][pacman.x+1] !==1) {\n if (maze[pacman.y][pacman.x+1] ==2) {\n maze[pacman.y][pacman.x] = 3;\n pacman.x = pacman.x + 1;\n maze[pacman.y][pacman.x] = 5;\n score += 100;\n drawMaze();\n } else {\n maze[pacman.y][pacman.x] = 3;\n pacman.x = pacman.x + 1;\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n }\n }\n } else if (directionPM == 4) {\n $(\".pacman\").css(\"transform\",\"rotate(90deg)\");\n if (maze[pacman.y+1][pacman.x] ==7 || maze[pacman.y+1][pacman.x] ==9 || maze[pacman.y+1][pacman.x] ==10 || maze[pacman.y+1][pacman.x] ==11) {\n pacman.x = 14;\n pacman.y = 23;\n lives--;\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n } else if (maze[pacman.y+1][pacman.x] ==4) {\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n } else if (maze[pacman.y+1][pacman.x] !==1) {\n if (maze[pacman.y+1][pacman.x] ==2) {\n maze[pacman.y][pacman.x] = 3;\n pacman.y = pacman.y + 1;\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n } else {\n maze[pacman.y][pacman.x] = 3;\n pacman.y = pacman.y + 1;\n maze[pacman.y][pacman.x] = 5;\n drawMaze();\n }\n }\n }\n }", "function startGame(){\n gBoard = buildBoard()\n renderBoard(gBoard)\n placeMines()\n setMinesNegsCount(gBoard)\n openNegs(gBoard, gGame.safeCell.i, gGame.safeCell.j)\n renderBoard(gBoard)\n startTimer()\n}", "function startGame(){\n \t\tGameJam.sound.play('start');\n \t\tGameJam.sound.play('run');\n\t\t\n\t\t// Put items in the map\n\t\titemsToObstacles(true);\n\n\t\t// Create the prisoner path\n\t\tGameJam.movePrisoner();\n\n\t\t// Reset items, we dont want the user to be able to drag and drop them\n \t\tGameJam.items = [];\n \t\t\n \t\tfor (var item in GameJam.levels[GameJam.currentLevel].items) {\n \t\t\tGameJam.levels[GameJam.currentLevel].items[item].count = GameJam.levels[GameJam.currentLevel].items[item].countStart;\n \t\t}\n\n\t\t// Reset prisoner speed\n\t\tGameJam.prisoner[0].sprite.speed = 5;\n\n\t\t// Reset game time\n\t\tGameJam.tileCounter = 0;\n\t\tGameJam.timer.className = 'show';\n\t\tdocument.getElementById('obstacles').className = 'hide';\n\t\tdocument.getElementById('slider').className = 'hide';\n\t\tdocument.getElementById('start-button-wrapper').className = 'hide';\n\n\t\t// Game has started\n\t\tGameJam.gameStarted = true;\n\n\t\tGameJam.gameEnded = false;\n\n\t\tdocument.getElementById('static-canvas').className = 'started';\n\n\t\tconsole.log('-- Game started');\n\t}", "function Update ()\t{\n\n if (white==\"w\")\n {\n whiteb.gameObject.SetActive(true);\n blackb.gameObject.SetActive(false);\n }else\n {\n whiteb.gameObject.SetActive(false);\n blackb.gameObject.SetActive(true);\n }\n\n // added to restart if game Over !!!!!!!!!!!!!!!!!!!!!!!!\n\tif (gameover){Application.LoadLevel (0);}\n\n if (restart) { \n Application.LoadLevel (0); \n } \n if (quit) {\n Application.Quit();\n }\n \n\t\n\t\n if(!C0.c0_moving)\tActivateCamera(false);\n if(FirstStart) {// could be right in Start(), anyway it's the same..., sometimes good to wait a bit while all the objects are being created...\t\t\n if(mode==1 || mode==2) {\n PlanesOnBoard();\t\t\t\t\t// Planes needed for mouse drag... (a ray from camera to this rigibody object is catched)...\n TransformVisualAllToH1();\t\t// The board contains blank-pieces (to clone from) just on some squares. Moving all of them to h1... \n\t\t\n //1.FEN startup test (ok):\t\n //C0.c0_start_FEN=\"8/p3r1k1/6p1/3P2Bp/p4N1P/p5P1/5PK1/8 w - - 0 1\";\n //C0.c0_set_start_position(\"\");\n //print(C0.c0_get_FEN());\n\t\t\t\t\n //C0.c0_start_FEN=\"7k/Q7/2P2K2/8/8/8/8/8 w - - 0 70\";\t\t// a checkmate position just for tests...\n\t\t\n C0.c0_side=1;\t\t\t\t\t\t\t// This side is white. For black set -1\n C0.c0_waitmove=true;\t\t\t\t\t// Waiting for mouse drag...\n C0.c0_set_start_position(\"\");\t\t// Set the initial position... \n }\n }\n\t\n DoPieceMovements();\t\t\t\t\t\t\t// All the movements of pieces (constant frames per second for rigidbody x,y,z)...\n if(mode==1) DoEngineMovements();\t\t\t\t\t\t\t// If chess engine should do a move...\n else if(mode==2) checkGameover();\n MouseMovement();\t\t\t\t\t\t\t\t// Mouse movement events, suggest legal moves...\n RollBackAction();\t\t\t\t\t\t\t\t\t// If a takeback should be performed/ or new game started..\n\n if(FirstStart)\t{\n position2board();\t\t\t\t\t// Set current position on the board visually...\n HideBlankPieces();\t\t\t\t\t// Hide blank-pieces...\n if(mode==1 || mode==2) {\n FirstStart=false;\n }\n }\n else\t{\n DragDetect();\t\t\t\t\t\t// If mouse pressed on any square...\n }\n\n\n // added here *********************************************\n if(FirstStart) {\n mode=2;\n }else\n\t\t{ if(engineStatus==1) { engineStatus=2; }}\n\t\t//*****************************************************************\n\n }", "generateGame() {\n\n this.generateGrounds();\n this.setPlayers();\n this.setPlayerStartArea();\n this.generateUnbreakableWalls();\n this.generateBreakableWalls();\n this.generateItems();\n GameElements.bombs.splice(0,GameElements.bombs.length);\n GameElements.explosions.splice(0,GameElements.explosions.length);\n \n }", "function startGame() {\n myGameArea.start();\n\n //ylempi vaakasuora laatta rivi \n var i = 1;\n while(i < 11){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posX = posX + 60;\n tilesArray.push(tileName)\n i++;\n }\n \n //alempi vaakasuora laatta rivi \n i = 1;\n posX = 20;\n posY = 560;\n while(i < 11){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posX = posX + 60;\n tilesArray.push(tileName)\n i++;\n }\n \n i = 1;\n posX = 20;\n posY = 1160;\n while(i < 11){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posX = posX + 60;\n tilesArray.push(tileName)\n i++;\n }\n\n // vasen laatta palkki \n i = 1;\n posX = 20;\n posY = 80;\n while(i < 20){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posY = posY + 60;\n tilesArray.push(tileName)\n i++;\n }\n \n // oikea laatta palkki \n i = 1;\n posX = 560;\n posY = 80;\n while(i < 20){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posY = posY + 60;\n tilesArray.push(tileName)\n i++;\n }\n //console.log(tilesArray);\n //pelaaja\n player = new Component(20, 20, \"red\", 30, 30);\n}", "function StartGame() {\n SetMapSize();\n MakeTiles();\n MakeUI();\n SetMatch();\n // SetItemCoordinates(thisMap); //inicializamos un array con el mapa que vayamos a utilizar\n // resetcurrentNrg(); //\n StartTimer();\n}", "function setup() {\n /* Set game score */\n score = 0;\n gscore = 0;\n /* Set time controls */\n tick = 0;\n tTime = 60; //60 seconds to make a number of kills.\n \n /* Creating the canvas */\n canvas = document.createElement(\"canvas\");\n context = canvas.getContext('2d');\n canvas.width = 610;\n canvas.height = 410;\n var size = Math.floor(window.innerHeight / 4);\n canvas.setAttribute(\"style\", \"margin-top: \" + size.toString() + \"px;\");\n \n /* Creating a sprite sheet */\n spriteSheet = document.getElementById(\"pac\");\n spriteSheet.onload = checkReady();\n\n /* Append canvas to document body element */\n document.body.appendChild(canvas);\n \n /* Creating enemies */\n for (var i=0; i<=4; i++){\n enemies.push(new Enemy(colors[i],((i*64)+32), (i * 64)));\n }\n \n /* Setting up walls properties */\n upLeftCorner.x = 0+sideWallpadding;\n upLeftCorner.y = 0+sideWallpadding;\n bottomLeftCorner.x = 0+sideWallpadding;\n bottomLeftCorner.y = canvas.height -sideWallpadding;\n upRightCorner.x = canvas.width - sideWallpadding;\n upRightCorner.y = 0+sideWallpadding;\n bottomRightCorner.x = canvas.width - sideWallpadding;\n bottomRightCorner.y = canvas.height - sideWallpadding;\n /* Creating walls */\n makeWalls();\n \n /* Setting up player and all ghosts colors */\n player.spawn();\n enemies.forEach(spawnAll); \n\n /* setting up center */\n player.updateCenter(); //player center\n enemies.forEach(UpdateCAll);\n \n /* Start countdown timer */\n timeReturn = window.setInterval(mTime, 1000);\n}", "function animationSetUp() {\n // Pacman's frames\n for (let i = 0; i < 5; i++) {\n for (let j = 0; j < 4; j++) {\n let frame = pacmanImg.get(j * 32, i * 32, 32, 32)\n pacmanFrames.push(frame)\n }\n }\n\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < 2; j++) {\n leftImages.push(leftGhosts.get(j * 32, i * 32, 32, 32))\n rightImages.push(rightGhosts.get(j * 32, i * 32, 32, 32))\n upImages.push(upGhosts.get(j * 32, i * 32, 32, 32))\n downImages.push(downGhosts.get(j * 32, i * 32, 32, 32))\n }\n }\n}", "function main() {\n console.log('main');\n g = new Globals(); //instatiates object which encaspulates globals in game (encapuslates 'singleton' components)\n systemManager = new SystemManager(); //instantiate object responsble for updating systems\n\n //create canvas\n ctx = createCanvas(window.innerWidth, window.innerHeight);\n bgColor = [255, 192, 40, 1];\n\n createEntitiesFromBlueprint('player');\n\n createEntitiesFromBlueprint('mesh', 50);\n\n update();\n setInterval(update, fps); //begin update loop in which all systems update / act on all their relevant entities\n\n}", "function main_loop(delta) {\r\n if (running) {\r\n let gr = game_map;\r\n stage.removeChild(game_map);\r\n gr.clear();\r\n\r\n // Add new particles by calling each respective run functions\r\n for (let type in simulation_status) {\r\n if (simulation_status[type].running) {\r\n let new_particle = simulation_status[type].run();\r\n if (new_particle !== 0) {\r\n particles.push(new_particle);\r\n }\r\n }\r\n }\r\n\r\n // Update particles by calling their update and draw functions\r\n for (let i = particles.length - 1; i >= 0; i--) {\r\n particles[i].update(particles[i]);\r\n particles[i].draw(particles[i], gr);\r\n if (particles[i].offscreen(particles[i])) {\r\n stage.removeChild(particles[i]);\r\n particles.splice(i, 1);\r\n }\r\n }\r\n\r\n stage.addChild(gr);\r\n }\r\n}", "function game() {\n dessinerSerpent();\n dessinerPomme();\n detectionCollision();\n verifMangerPomme();\n gestionVieSerpent();\n gestionBonus();\n }", "function startGame() {\n pacSoundId = setInterval(pacSound, 650)\n countUpid = setInterval(countUp, 1000)\n ghostMoveIdOne = setInterval(function(){\n chooseAndMove(ghostOne)\n }, ghostTimePerMove)\n ghostMoveIdTwo = setInterval(function(){\n chooseAndMove(ghostTwo)\n }, ghostTimePerMove)\n ghostMoveIdThree = setInterval(function(){\n chooseAndMove(ghostThree)\n }, ghostTimePerMove)\n ghostMoveIdFour = setInterval(function(){\n chooseAndMove(ghostFour)\n }, ghostTimePerMove)\n }", "function startGame(){\n let bg1 = new Background(0,0,\"url(/TPE3/background/bg1.png)\",30);//como mencione antes, el orden es importante, primero se crean los fondos\n let bg2 = new Background(0,0,\"url(/TPE3/background/bg2.png)\",20);//y el orden de los fondos tambien importan, el primero tiene que ser el que esta \"mas atras\" y tiene que ser el mas lento\n let bg3 = new Background(0,0,\"url(/TPE3/background/bg3.png)\",15);\n let bg4 = new Background(0,0,\"url(/TPE3/background/bg4.png)\",9);// y el ultimo el \"mas cercano\", y se tiene que mover mas rapido\n let bg5 = new Background(0,0,\"url(/TPE3/background/bg5.png)\",9);// en este caso los ultimos 2 se mueven igual por que el ante ultimo son los arboles del camino\n bg1.moveBg();//luego les decimos que se muevan, tambien se puede crear un array de fondos para hacer esto en menos lineas de codigo\n bg2.moveBg();\n bg3.moveBg();\n bg4.moveBg();\n bg5.moveBg();\n let jugador = new Player(100,460,\"url(/TPE3/charactersTira.png\");//creamos un objeto de la clase player\n jugador.spawnPlayer();//spawneamos al jugador\n jugador.run();//hacemos que inicie su animacion de \"correr\"\n let octi = new Octi(640,460,\"url(/TPE3/octi.png)\")//instanciamos las clases octi y token\n let token = new Token(600,460, \"url(/TPE3/token.png)\");\n\n let points = 0;//iniciamos los puntos en 0\n\n //iniciamos 2 intervals para token y octi, asi se van generando de a poco.\n let intervalOcti = setInterval(() => {\n let divOcti = octi.spawnOcti();\n //este settimeout es para borrar el div de octi cuando haya terminado su recorrido\n setTimeout(() => {\n document.getElementById(\"container\").removeChild(divOcti);\n octi.setSpawnedOcti(false);\n }, 2500);// 2,5 segs, este es el tiempo que dura el recorrido de octi, se deberia cambiar esto por una variable asi no estaria tan hardcodeado\n }, 5000);\n\n //este interval funciona igual que el interval de octi\n let intervalToken = setInterval(() => {\n let divToken = token.spawnToken();\n setTimeout(() => {\n if(token.spawnedToken){\n document.getElementById(\"container\").removeChild(divToken);\n token.setSpawnedToken(false);\n }\n }, 4000);\n }, 6500);\n\n //este es el famosisimo gameloop\n let intervalGame = setInterval(() => {\n //cada interacion del gameloop, se checkea si el jugador colisiono con octi, de ser asi \n if(octi.getSpawnedOcti() && checkCollision(document.getElementById(\"player\"),document.getElementById(\"octi\"))){\n //si el juegador toco a octi cortamos la generacion de octis, de tokens y las iteraciones de este mismo interval\n clearInterval(intervalGame);\n clearInterval(intervalOcti);\n clearInterval(intervalToken);\n //y se llama al a funcion que nos muestra el game over ademas de el boton de reinicio y los puntos\n gameOver(points);\n }\n //tambien en cada iteracion se comprueba si el jugador toco una moneda\n if(token.getSpawnedToken() && checkCollision(document.getElementById(\"player\"),document.getElementById(\"token\"))){\n points++; // si toco una moneda, se le da un punto\n document.getElementById(\"container\").removeChild(document.getElementById(\"token\"));//y quitamos la moneda.\n token.setSpawnedToken(false);\n }\n //este evento es para que el jugador pueda saltar, al hacer click en el juego, la animacion cambiao a \"saltar\"\n document.getElementById(\"container\").addEventListener(\"click\",()=>{\n jugador.jump();\n });\n }, 50);\n }", "create () {\n /****game.var adds a new \"class variable\" to game state, like in other languages****/\n\n //create background\n var background = game.add.sprite(game.world.centerX, game.world.centerY, 'background');\n background.anchor.set(0.5);\n background.width = game.screenWidth;\n background.height = 700;\n\n game.boardHeight = 102\n game.boardOffset = 15\n game.pieceWidth = 38\n game.pieceHeight = 25\n\n game.squareSize = 50\n //the size of the board, i.e nxn board, 3x3 for tictactoe\n game.n = 3\n game.isXTurn = true\n game.isDraw = false\n game.magicSquare = false\n game.firstTime = true\n\n\n game.turns = 0\n game.linesToAnimate = 0\n\n game.boardTurns = [];\n for (var i=0; i < game.n; i++) {\n game.boardTurns[i]=new Array(game.n)\n }\n\n for (var i=0; i < game.n; i++)\n {\n for (var j=0; j < game.n; j++)\n {\n game.boardTurns[i][j] = 0\n }\n }\n\n console.log(\"First Time\")\n\n //the top left coordinate to place the whole board at, we will make game\n //not hardcoded in the furture to center the board, but I believe we need jQuery\n //to get window size and I didn't feel like learning that right now\n game.startingX = game.screenWidth/2 - game.cache.getImage('board').width / 1.2\n game.startingY = 80\n\n //intialize waiting status to false, update accordingly later if multiplayer\n game.waiting = false\n\n //record of the pieces that have been placed\n game.placedPieces = []\n\n //record of the big pieces that have been placed\n game.bigPlacedPieces = []\n\n game.bigBoardLogic = []\n for (var i=0; i < game.n; i++) {\n game.bigBoardLogic[i]=new Array(game.n)\n }\n\n for (var i=0; i < game.n; i++)\n {\n for (var j=0; j < game.n; j++)\n {\n game.bigBoardLogic[i][j] = \"open\"\n }\n }\n\n game.magicBoardLogic = []\n for (var i=0; i < game.n; i++) {\n game.magicBoardLogic[i]=new Array(game.n)\n }\n\n for (var i=0; i < game.n; i++)\n {\n for (var j=0; j < game.n; j++)\n {\n game.magicBoardLogic[i][j] = \"null\"\n }\n }\n\n //asign functions ot the game object, so they can be called by the client\n this.assignFunctions()\n\n game.cursorSquares = []\n for (var i=0; i < game.n; i++) {\n game.cursorSquares[i]=new Array(game.n)\n }\n\n game.redSquares = []\n for (var i=0; i < game.n; i++) {\n game.redSquares[i]=new Array(game.n)\n for (var j=0; j < game.n; j++)\n {\n game.redSquares[i][j]=new Array(game.n)\n for (var k=0; k < game.n; k++)\n {\n game.redSquares[i][j][k]=new Array(game.n)\n }\n }\n }\n\n for (var i=0; i < game.n; i++)\n {\n for (var j=0; j < game.n; j++)\n {\n game.cursorSquares[i][j] = game.addSpriteWithWidth(game.startingX + i*game.squareSize*3, game.startingY + j*game.squareSize*3, 'greensquare', game.squareSize*3, game.squareSize*3)\n game.cursorSquares[i][j].alpha = 0\n for (var k=0; k < game.n; k++)\n {\n for (var l=0; l < game.n; l++)\n {\n game.redSquares[i][j][k][l] = game.addSprite(game.startingX + i*game.squareSize*3 + k*game.squareSize, game.startingY + j * game.squareSize*3 + l*game.squareSize, 'redsquare')\n game.redSquares[i][j][k][l].alpha = 0\n }\n }\n }\n }\n game.firstTime = false\n\n //create an internal representation of the board as a 2D array\n game.board = game.makeBoardAsArray(game.n)\n //create the board on screen and makes each square clickable\n game.makeBoardOnScreen()\n //add messages that display turn status, connection statuses\n this.addTexts()\n //folloowing logic is for multiplayer games\n if(game.singleplayer || game.vsAi)\n return\n\n game.previousPiece = \"\"\n //if this is the first play against an opponent, create a new player on the server\n game.startMultiplayer()\n\n }", "prepAndStartNewGame() {\n this.resetPlayers(Player.TOWN);\n this.assignRoles(this.options.numMafia, this.options.numCops, this.options.numDoctors);\n this.updateRoleCounts();\n this.gameState = MAFIA_TIME;\n }", "function startGame() {\n\tfor (var yPos = 1; yPos < gridHeight - 1; yPos++) {\n\t\tagents.push(new Agent(new B2Vec2(0, yPos), 0));\n\t\tagents.push(new Agent(new B2Vec2(1, yPos), 0));\n\t\tagents.push(new Agent(new B2Vec2(2, yPos), 0));\n\t}\n\n\tfor (yPos = 1; yPos < gridHeight - 1; yPos++) {\n\t\tagents.push(new Agent(new B2Vec2(gridWidth - 1, yPos), 1));\n\t\tagents.push(new Agent(new B2Vec2(gridWidth - 2, yPos), 1));\n\t\tagents.push(new Agent(new B2Vec2(gridWidth - 3, yPos), 1));\n\t}\n\n\t//for (var i = 0; i < gridHeight; i++) {\n\t//\tif (i == gridHeight / 2 || i == gridHeight / 2 - 1) {\n\t//\t\tcontinue;\n\t//\t}\n\t//\tobstacles.push(new B2Vec2(8, i));\n\t//\tobstacles.push(new B2Vec2(7, i));\n\t//}\n\n\n\t//for (var i = 0; i < 30; i++) {\n\t//\tvar x = 1 + Math.floor(Math.random() * (gridWidth - 3));\n\t//\tvar y = Math.floor(Math.random() * (gridHeight - 2));\n\t//\tobstacles.push(new B2Vec2(x, y));\n\t//}\n\n\tfor (var i = 0; i < obstacles.length; i++) {\n\t\tvar pos = obstacles[i];\n\n\t\t//Create a physics body for the agent\n\t\tvar fixDef = new B2FixtureDef();\n\t\tvar bodyDef = new B2BodyDef();\n\n\t\tfixDef.density = 1.0;\n\t\tfixDef.friction = 0.5;\n\t\tfixDef.restitution = 0.2;\n\t\tfixDef.shape = new B2PolygonShape();\n\t\tfixDef.shape.SetAsBox(0.5, 0.5);\n\n\t\tbodyDef.type = B2Body.b2_staticBody;\n\t\tbodyDef.position.SetV(pos);\n\n\t\tworld.CreateBody(bodyDef).CreateFixture(fixDef);\n\t}\n\n\tstage.addEventListener('stagemouseup', function (ev) {\n\t\tdestinations[0].x = ev.stageX / gridPx - 0.5;\n\t\tdestinations[0].y = ev.stageY / gridPx - 0.5;\n\n\t\tdestinations[1].x = (gridWidthPx - ev.stageX) / gridPx - 0.5;\n\t\tdestinations[1].y = (gridHeightPx - ev.stageY) / gridPx - 0.5;\n\t});\n}", "function init() {\r\n var selectMap = Math.round(Math.random()*4);\r\n if (selectMap == 0) {\r\n map = map1;\r\n } else if (selectMap == 1) {\r\n map = map2;\r\n } else if (selectMap == 2) {\r\n map = map3;\r\n } else if (selectMap == 3){\r\n map = map4;\r\n } else {\r\n map = map5;\r\n }\r\n clearInterval(thread);\r\n man = new Man(manStartX, manStartY);\r\n baddies = [];\r\n ///////////////////////////\r\n //ADD BADDIES\r\n //parameters: x position, y position\r\n ////////////////////////////\r\n new Baddie(10 * tileW, 4 * tileH);\r\n new Baddie(10 * tileW, 16 * tileH);\r\n new Baddie(17 * tileW, 10 * tileH);\r\n ///////////////////////\r\n //goal\r\n //////////////////////\r\n goal = new Goal(7 * tileW, 9.5 * tileH);\r\n //start the game\r\n thread = setInterval(draw, 30);\r\n}", "function deathSetUp(){\n livesElem.innerText = lives\n scoreElem.innerText = score\n position = 289\n redGhostPosition = 274\n yellowGhostPosition = 298\n pinkGhostPosition = 301\n aquaGhostPosition = 277\n gridBoxes[position].classList.add('pacman')\n gridBoxes[redGhostPosition].classList.add('red', 'ghost')\n gridBoxes[yellowGhostPosition].classList.add('yellow', 'ghost')\n gridBoxes[pinkGhostPosition].classList.add('pink', 'ghost')\n gridBoxes[aquaGhostPosition].classList.add('aqua', 'ghost')\n\n redGhostInterval = setInterval(function(){\n ghostInitiate('red', redGhostPosition)\n } , interval)\n yellowGhostInterval = setInterval(function(){\n ghostInitiate('yellow', yellowGhostPosition)\n } , interval)\n pinkGhostInterval = setInterval(function(){\n ghostInitiate('pink', pinkGhostPosition)\n } , interval)\n aquaGhostInterval = setInterval(function(){\n ghostInitiate('aqua', aquaGhostPosition)\n } , interval)\n }", "function resetAllGame() {\n /* Setting up player and all ghosts colors */\n player.spawn();\n enemies.forEach(spawnAll); \n\n /* setting up center */\n player.updateCenter(); //player center\n enemies.forEach(UpdateCAll);\n \n resetHUD();\n}", "spawnearPacman(){\n this.deletePacman();\n\n this.pacman = new PacMan(this.game.getPacmanSpeed());\n this.pacman.scale.set (0.1, 0.1, 0.1);\n this.add(this.pacman);\n\n this.pacman.position.set(this.pacmanSpawn.x, 0, this.pacmanSpawn.z);\n }", "function startGame() {\n hitCount = 0\n\n if (isSettingsInitialized) {\n console.log('Settings initialized')\n loadSettings()\n }\n\n togglePanel(panel.PREGAME)\n generateLayout()\n\n maxSpawns = Math.floor(maxTime / spawnRate)\n remainingSpawns = maxSpawns\n\n for (let s = 0; s < maxSpawns; s++) {\n spawnTimeouts.push(setTimeout(spawnYagoo, spawnRate * s))\n }\n\n startTimer(msToSec(maxTime), document.getElementById('timer-text'))\n}", "function reset() {\n ctx.clearRect(pacman.x, pacman.y, sqaure, sqaure);\n ctx.fillRect(pacman.x, pacman.y, sqaure, sqaure);\n ctx.clearRect(white_sprite.x, white_sprite.y, sqaure, sqaure);\n ctx.clearRect(grey_sprite.x, grey_sprite.y, sqaure, sqaure);\n ctx.clearRect(green_sprite.x, green_sprite.y, sqaure, sqaure);\n ctx.clearRect(evil_sprite.x, evil_sprite.y, sqaure, sqaure);\n ctx.fillRect(white_sprite.x, white_sprite.y, sqaure, sqaure);\n ctx.fillRect(grey_sprite.x, grey_sprite.y, sqaure, sqaure);\n ctx.fillRect(green_sprite.x, green_sprite.y, sqaure, sqaure);\n ctx.fillRect(evil_sprite.x, evil_sprite.y, sqaure, sqaure);\n pacman.x = 25;\n pacman.y = 25;\n white.x = 16;\n white.y = 14;\n green.x = 14;\n green.y = 15;\n grey.x = 15;\n grey.y = 14;\n evil.x = 17;\n evil.y = 17;\n vel_x = 0;\n vel_y = 0;\n white_sprite.x = white.x * sqaure;\n white_sprite.y = white.y * sqaure;\n green_sprite.x = green.x * sqaure;\n green_sprite.y = green.y * sqaure;\n grey_sprite.x = grey.x * sqaure;\n grey_sprite.y = grey.y * sqaure;\n evil_sprite.x = evil.x * sqaure;\n evil_sprite.y = evil.y * sqaure;\n}", "function make_map(stage){\r\n stage.addPlayer(new Player(stage,images.naked_player ,Math.floor(stage.width/2), Math.floor(stage.height/2),player_width,player_height));\r\n stage.addItem(new Gun(stage,images.machine_gun,40,40,100,100,'gun'));\r\n stage.addItem(new Gun(stage,images.pistol,80,80,2300,2200,'gun'));\r\n stage.addItem(new Ammo(stage,images.ammo,20,20,2200,2200,'ammo'));\r\n stage.addItem(new Item(stage,images.health_pack,20,20,2300,2300,'health'));\r\n\r\n var canvw = stage.width;\r\n var canvl = stage.height;\r\n for (var i = 0; i<30; i++){\r\n x = randint(canvw);\r\n y = randint(canvl);\r\n stage.addItem(new Gun(stage,images.pistol,80,80,x,y,'gun'));\r\n\r\n }\r\n for (var i = 0; i<trees.length; i++){\r\n stage.addHittable(new hittableObject(stage,'sprites/tree.png',100,100,trees[i][0],trees[i][1],true));\r\n }\r\n\r\n for (var i = 0; i<rocks.length; i++){\r\n stage.addHittable(new hittableObject(stage,'sprites/rock.png',70,70,rocks[i][0],rocks[i][1],false));\r\n }\r\n for (var i = 0; i<npcs.length; i++){\r\n stage.addEnemy(new NPC_Enemies(stage, images.gun_player ,npcs[i][0], npcs[i][1],player_width,player_height));\r\n }\r\n var game_house = new house(stage,images.house_outside,1000,1000,4000,0);\r\n stage.type.house = game_house;\r\n \r\n\r\n\r\n}", "function spawnResetter() {\n for(var idx = 0; idx < mapArrays.length; idx++) {\n for(var idx2 = 0; idx2 < mapArrays[idx].length; idx2++) {\n mapArrays[idx][idx2].resetSpawn();\n }\n }\n}", "function start(){\n renderGameField();\n resizeGameField();\n spawnSnake();\n spawnFood();\n eatFood();\n renderSnake();\n}", "function startGame(){\n\tif(!$.editor.enable){\n\t\tfor(n=0;n<levels_arr.length;n++){\n\t\t\t$.stage[n].visible = false;\n\t\t}\n\t\t$.stage[gameData.levelNum].visible = true;\n\t}\n\t\n\tgameData.planes = [];\n\tgameData.runway = [];\n\tgameData.types = [];\n\tgameData.typeCount = 0;\n\tgameData.countPlane = 0;\n\tgameData.totalPlane = levels_arr[gameData.levelNum].level.total;\n\tgameData.speed = levels_arr[gameData.levelNum].level.speed;\n\tgameData.nextPlaneTimer = levels_arr[gameData.levelNum].level.planTimer;\n\tgameData.stageComplete = false;\n\t\n\tplayerData.score = playerData.displayScore = 0;\n\tplayerData.total = 0;\n\tupdateStatus();\n\t\n\tfor(var n=0;n<levels_arr[gameData.levelNum].runway.length;n++){\n\t\tcreateRunway(false, levels_arr[gameData.levelNum].runway[n].type, levels_arr[gameData.levelNum].runway[n].x, levels_arr[gameData.levelNum].runway[n].y, levels_arr[gameData.levelNum].runway[n].rotation);\n\t\t\n\t\tfor(var t=0;t<levels_arr[gameData.levelNum].runway[n].planes.length;t++){\n\t\t\tgameData.types.push(levels_arr[gameData.levelNum].runway[n].planes[t]);\t\t\n\t\t}\n\t}\n\t\n\tgameData.types = unique(gameData.types);\n\tshuffle(gameData.types);\n\t\n\tTweenMax.ticker.useRAF(false);\n\tTweenMax.lagSmoothing(0);\n\n\titemBoom.visible = false;\n\tcompleteContainer.visible = false;\n\t\n\tif(gameData.tutorial){\n\t\tgameData.tutorial = false;\n\t\ttoggleTutorial(true);\n\t}else{\n\t\tstartPlaneTimer(0);\n\t\tgameData.paused = false;\n\t}\n}", "function game() {\n canvasContext.clearRect(0, 0, getCanvasContainer.width, getCanvasContainer.height);\n createBall();\n createPalette();\n createBricks();\n detectBricks();\n createScore();\n gameFinished();\n\n initialValueX += moveX;\n initialValueY += moveY;\n\n\n\n if (initialValueY + moveY < radiusOfBall) {\n moveY = -moveY;\n //checking collision with ceil\n } else if (initialValueY + moveY > getCanvasContainer.height - radiusOfBall) {\n if (initialValueX > paletteValueX && initialValueX < paletteWidth + paletteValueX) {\n moveY = -moveY;\n //checking collision with palette\n } else {\n alert('Game over!');\n document.location.reload();\n //checking collision with floor and game over\n }\n }\n\n if (initialValueX + moveX + radiusOfBall > getCanvasContainer.width || initialValueX + moveX < radiusOfBall) {\n moveX = -moveX;\n //checking collision with left and right walls\n }\n\n if (keyPressRight && paletteValueX + paletteWidth < getCanvasContainer.width) {\n paletteValueX += 7;\n //move palette right\n }\n\n\n if (keyPressLeft && paletteValueX + getCanvasContainer.width > getCanvasContainer.width) {\n paletteValueX -= 7;\n //move palette left\n }\n requestAnimationFrame(game);\n\n }", "function startGame() {\n\tsetup();\n\tmainLoop();\n}", "function game() {\n\tvar canvas = document.getElementById('canvas');\n\n\tif (!canvas) {\n\t\talert(\"Impossible to get the canvas\");\n\t\treturn;\n\t}\n\n\tvar context = canvas.getContext('2d');\n\tif (!context) {\n\t\talert(\"Impossible to get the canvas context\");\n\t\treturn;\n\t}\n\n\tcontext.canvas.width = window.innerWidth\n\tcontext.canvas.height = window.innerHeight\n\n\tif (canvas.width/28 < canvas.height/36) {\n\t\tquantum = Math.floor(canvas.width/28)\n\t\tcontext.canvas.height = quantum * 36\n\t} else {\n\t\tquantum = Math.floor(canvas.height/36)\n\t\tcontext.canvas.width = quantum * 28\n\t}\n\n\tif (count === 0) {\n\t\tanimate()\n\t\tshowButton()\n\t\tif (game_over) {\n\t\t\tgameOver()\n\t\t}\n\t\tif (has_won) {\n\t\t\thasWon()\n\t\t}\n\t} else {\n\t\tcountDown(count)\n\t}\n\n\t// Function that draws the grid, pacman and the ghosts\n\tfunction animate() {\n\t\tcontext.fillStyle = \"black\";\n\t\tcontext.fillRect(0, 0, canvas.width, canvas.height);\n\n\t\tif (iteration%2 == 1) {\n\t\t\tpacmanMouth = !pacmanMouth;\n\t\t\tghostOndulation = !ghostOndulation;\n\t\t\tif (next_attack_in <= 30) {\n\t\t\t\tblinking = !blinking\n\t\t\t} else {\n\t\t\t\tblinking = false\n\t\t\t}\n\t\t}\n\t\titeration++\n\n\t\tdrawGrid(context, quantum)\n\n\t\tfor (var i = 0; i < pacmans.length; i++) {\n\t\t\tdrawPacman(context, quantum, pacmans[i], pacmanMouth)\n\t\t}\n\t\tfor (var i = 0; i < ghosts.length; i++) {\n\t\t\tdrawGhost(context, quantum, ghosts[i], i, ghostOndulation, blinking)\n\t\t}\n\n\t\tcontext.font = quantum + \"px Bangers, cursive\";\n\t\tcontext.fillStyle = \"#F9C328\";\n\t\tcontext.textAlign=\"center\";\n\t\tcontext.fillText(\"Score : \" + pacmans[0].score,context.canvas.width/2,context.canvas.height - 1.2*quantum);\n\n\t}\n\n\t// Function that draws game Over with the score\n\tfunction gameOver() {\n\t\tcontext.fillStyle = \"#F9C328\";\n\t\tcontext.textAlign=\"center\";\n\t\tcontext.shadowOffsetX = quantum/5\n\t\tcontext.shadowOffsetY = quantum/5\n\t\tcontext.shadowColor = \"black\"\n\t\tcontext.shadowBlur = quantum/5\n\t\tcontext.font = 2*quantum + \"px Bangers, cursive\";\n\t\tcontext.fillText(\"You scored \" + pacmans[0].score + \" points.\",context.canvas.width/2,context.canvas.height/2 + 2.5*quantum);\n\t\tcontext.font = \"bold \" + 3.5*quantum + \"px Bangers, cursive\";\n\t\tcontext.fillText(\"GAME OVER \",context.canvas.width/2, context.canvas.height/2 - 3*quantum);\n\t}\n\n\t// Function that draws Has Won with the score\n\tfunction hasWon() {\n\t\tcontext.fillStyle = \"#F9C328\";\n\t\tcontext.textAlign=\"center\";\n\t\tcontext.shadowOffsetX = quantum/5\n\t\tcontext.shadowOffsetY = quantum/5\n\t\tcontext.shadowColor = \"black\"\n\t\tcontext.shadowBlur = quantum/5\n\t\tcontext.font = 2*quantum + \"px Bangers, cursive\";\n\t\tcontext.fillText(\"You scored \" + pacmans[0].score + \" points.\",context.canvas.width/2,context.canvas.height/2 + 2.5*quantum);\n\t\tcontext.font = \"bold \" + 3.5*quantum + \"px Bangers, cursive\";\n\t\tcontext.fillText(\"YOU WON !! \",context.canvas.width/2, context.canvas.height/2 - 3*quantum);\n\t}\n\n\t// Function that draws the count down\n\tfunction countDown(){\n\t\tcontext.fillStyle = \"black\";\n\t\tcontext.fillRect(0, 0, canvas.width, canvas.height);\n\t\tcontext.fillStyle = \"#F9C328\";\n\t\tcontext.textAlign=\"center\";\n\t\t// context.shadowOffsetX = quantum/5\n\t\t// context.shadowOffsetY = quantum/5\n\t\t// context.shadowColor = \"black\"\n\t\t// context.shadowBlur = quantum/5\n\t\tcontext.font = 6*quantum + \"px Bangers, cursive\";\n\t\tcontext.fillText(count, context.canvas.width/2, context.canvas.height/2);\n\n\t}\n}", "function resetGameBoard() {\n for (var id in cars) {\n cars[id].destroy();\n }\n cars = {};\n dests = {};\n locations = {};\n\n var shape_graphics = [];\n\n configAndStart();\n}", "setUpGameObjects() {\n\t\tthis.treesSmall = [];\n\t\tthis.treesLarge = [];\n\t\tthis.treesBare = [];\n\t\tthis.bumpsGroup = [];\n\t\tthis.bumpsSmall = [];\n\t\tthis.bumpsLarge = [];\n\t\tthis.rocks = [];\n\t\tthis.jumps = [];\n\t\tthis.stumps = [];\n\n\t\tthis.calculateGameObjectCount();\n\t\tfor (let n = 0; n < this.gameObjectCount; n++) {\n\t\t\tlet type = this.getRandomGameObjectType();\n\t\t\tthis.spawnNewGameObjectAtStart(type);\n\t\t}\n\t}", "function reset_game(){\n\tmap = new Map();\n\tmenuSound.play(); \n\trootPiece = map.getMapPieces()[27];\n\tspawnPiece1 = map.getMapPieces()[25];\n\tspawnPiece2 = map.getMapPieces()[24];\n\tspawnPiece3 = map.getMapPieces()[26];\n\tspawnPiece4 = map.getMapPieces()[22];\n\tdiskPiece1 = map.getMapPieces()[13]; \n\tdiskPiece2 = map.getMapPieces()[17];\n\tspawnPieces = [spawnPiece1, spawnPiece2, spawnPiece3, spawnPiece4];\n\tqbert = new Qbert(rootPiece.tx+0.003, 0.4255, -0.65);\n\tenemies = [new Enemy(spawnPiece1.tx+0.003, spawnPiece1.ty+0.05, -0.65, 2, 1), new Enemy(spawnPiece2.tx+0.003, spawnPiece2.ty+0.05, -0.65, 3,3)];\n\tdisks = [new Disk(diskPiece1.tx -0.12 ,diskPiece1.ty+0.1, -0.65, 5,0), new Disk(diskPiece2.tx +0.12 ,diskPiece2.ty+0.1, -0.65, 5,6)] //to continue\n\n\tstartGame = true;\n\t// Buffers\n\tmapVertexPositionBuffer = [];\n\tmapVertexIndexBuffer = [];\n\tmapVertexColorBuffer = [];\n\tmapVertexNormalBuffer = [];\n\n\tqbertVertexPositionBuffer = null;\n\tqbertVertexColorBuffer = null;\n\tqbertVertexNormalBuffer = null;\n\n\tenemiesVertexPositionBuffer = [];\n\tenemiesVertexColorBuffer = [];\n\tenemiesVertexNormalBuffer = [];\n\n\tdisksVertexPositionBuffer = [];\n\tdisksVertexNormalBuffer = [];\n\tdisksVertexColorBuffer = [];\n\n\tinitBuffers();\n}", "function startGame() {\n if(!presence.ballIsSpawned) {\n fill(start.color.c, start.color.saturation, start.color.brightness);\n stroke(start.color.c, start.color.saturation, start.color.brightness)\n if((windowWidth < 600) && (windowHeight < 600)) {\n textSize(20);\n text(\"PRESS ENTER TO START GAME\", windowWidth/4.2, windowHeight/2.5);\n textSize(15);\n text(\"(First to 7 Wins)\", windowWidth * 0.41, windowHeight * 0.47);\n }\n if((windowWidth > 601) && (windowHeight > 601)) {\n textSize(30)\n text(\"PRESS ENTER TO START GAME\", windowWidth * 0.35, windowHeight/2.5);\n textSize(20);\n text(\"(First to 7 Wins)\", start.textX + start.textX * 0.265, windowHeight * 0.44);\n }\n if(mode == 'single'){\n if((windowWidth > 601) && (windowHeight > 601)){\n text(\"Mode: \" + mode, windowWidth * 0.9, windowHeight * 0.08);\n textSize(18);\n text(\"USE ARROWS TO MOVE\", start.textX + start.textX * 0.2, windowHeight * 0.48);\n textSize(14);\n text(\"PRESS SHIFT FOR TWO PLAYER\", start.textX + start.textX * 0.2, windowHeight * 0.52);\n }\n if((windowWidth < 600) && (windowHeight < 600)){\n text(\"Mode: \" + mode, windowWidth * 0.8, windowHeight * 0.08);\n textSize(14);\n text(\"USE ARROWS TO MOVE\", start.textX + start.textX * 0.01, start.textY + start.textY * 0.04);\n textSize(12);\n text(\"PRESS SHIFT FOR TWO PLAYER\", windowWidth * 0.35, start.textY + start.textY * 0.16);\n defaultBallSpeed = 4;\n }\n }\n if(mode == 'two'){\n if((windowWidth > 601) && (windowHeight > 601)) {\n textSize(20);\n text(\"Mode: \" + mode, windowWidth * 0.9, windowHeight * 0.08)\n textSize(18);\n text(\"USE Q, A, P, L TO MOVE\", windowWidth * 0.43, windowHeight * 0.48);\n textSize(14);\n text(\"PRESS SHIFT FOR ONE PLAYER\", start.textX + start.textX * 0.2, windowHeight * 0.52);\n }\n }\n \n start.color.c += 1;\n if(start.color.c > 359) {\n start.color.c = 0;\n }\n }\n }", "function startGame() {\n //init the game\n gWorld = new gameWorld(6);\n gWorld.w = cvs.width;\n gWorld.h = cvs.height;\n \n gWorld.state = 'RUNNING';\n gWorld.addObject(makeGround(gWorld.w, gWorld.h));\n gWorld.addObject(makeCanopy(gWorld.w));\n gWorld.addObject(makeWalker(gWorld.w, gWorld.h));\n gWorld.addObject(makeWalker(gWorld.w, gWorld.h,true));\n gWorld.addObject(makePlayer());\n \n startBox.active = false;\n pauseBtn.active = true;\n soundBtn.active = true;\n touchRightBtn.active = true;\n touchLeftBtn.active = true;\n replayBtn.active = false;\n \n gameLoop();\n }", "function buildAndRun() {\n\n // set up the \"controller\" with the test Entity object\n ctrl.addEntity(mainPlayer);\n ctrl.addEntity(badguy);\n ctrl.onTouch = gameClick;\n ctrl.postStep = function () {\n // adjust the view's coordinates to follow the player Entity\n var x = (mainPlayer.x + (mainPlayer.width / 2)) - ($vast.Canvas.getWidth() / 2);\n var y = (mainPlayer.y + (mainPlayer.height / 2)) - ($vast.Canvas.getHeight() / 2);\n ctrl.setViewPosition(x, y);\n\n // trick to avoid \"jumping\" effect on load if you call Canvas.setVisible(false) right after Game.run(), then this.\n // (when view is drawn at (0, 0) briefly before \"snapping\" to desired position)\n if (!$vast.Canvas.visible) {\n $vast.Canvas.setVisible(true);\n }\n };\n\n buildWallMap(ctrl);\n $vast.Game.setActiveController(ctrl);\n\n // run the game, hide the Canvas until we're ready\n $vast.Game.run();\n $vast.Canvas.setVisible(false);\n }", "startGame () {\n\t\tif ( this.model.isBoardShuffling ) return;\n\t\tif ( this.model.isModalOpen ) this.toggleModal();\n\t\tif ( this.model.isBoardBlocked ) this.toggleBoardLock( this.model.isBoardBlocked );\n\t\tthis.model.populateListOfPossibleChanges();\n\t\tthis.view.alocatePieces( this.model.finalPositionsArr, this.model.baseNumber, this.model.getPieceSize(), this.model.gutterSize );\n\t\tthis.shufflePieces();\n\t\tthis.resetConter();\n\t}", "function startGame(mapName = 'galaxy'){\n toggleMenu(currentMenu);\n if (showStats)\n $('#statsOutput').show();\n $('#ammoBarsContainer').show();\n scene.stopTheme();\n scene.createBackground(mapName);\n if (firstTime) {\n firstTime = false;\n createGUI(true);\n render();\n } else {\n requestAnimationFrame(render);\n }\n}", "function startGame() {\n //reseting everything\n trees.forEach(index => grid[index].classList.remove('tree'))\n grid[beaverIndex].classList.remove('beaver')\n grid[beaverIndex].classList.remove('beaver_tree')\n grid[lynxIndex].classList.remove('lynx')\n grid[lodgeIndex].classList.remove('lodge')\n clearInterval(interval)\n\n direction = '>'\n intervalTime = 500\n interval = setInterval(moveLynx, intervalTime)\n interval = setInterval(checks, intervalTime)\n beaverIndex = Math.floor(width*(0.5)*height) //left center\n lynxIndex = beaverIndex + width - 1 //right center\n lodgeIndex = Math.floor(Math.random() * height) * (width-1)\n\n spawnBeaver(beaverIndex)\n grid[lynxIndex].classList.add('lynx')\n forestGen(Math.floor(height*width/6))\n grid[lodgeIndex].classList.add('lodge')\n }", "function create () {\n\t\t\t\t\t// We create the world of our simulation\n\t\t\t\t\t// will randomply set objects and everything up according to constant.js data\n\t\t\t\t\t_this.world = new World();\n\n\t\t\t\t\t// we draw a ground sprite for every tile of the world\n\t\t\t\t\t// we also maintain an array of sprites to draw on the top of the ground tiles\n\t\t\t\t\t_this.sprites = new Array(_this.world.map_size);\n\t\t\t\t\tfor(var y=0;y<_this.world.map_size;y++){\n\t\t\t\t\t\t_this.sprites[y] = new Array(_this.world.map_size).fill(undefined);\n\t\t\t\t\t\tfor(var x=0;x<_this.world.map_size;x++){\n\t\t\t\t\t\t\t_this.game.add.sprite( 1 + x*_this.world_sprite_size, 1+ y*_this.world_sprite_size, \"ground\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// allow Phaser app to still work if focus is lost\n\t\t\t\t\t_this.game.stage.disableVisibilityChange = true;\n\n\t\t\t\t\t// will resize the Phaser app at best and keep aspect ratio\n\t\t\t\t\t_this.game.scale.scaleMode = 2;\n\n\t\t\t\t\t// how many logic update per phaser update we want to perform\n\t\t\t\t\t// this var represents how many simulation updates per second we want\n\t\t\t\t\t_this.updates_per_second = 1;\n\t\t\t\t\t// this is to keep track of the elapsed time since last simulation updates\n\t\t\t\t\t_this.elapsed_time_cumul = 0;\n\t\t\t\t\t// how often we want to compute stats and update graphes per simulation updates\n\t\t\t\t\t_this.stats_update = _this.updates_per_second * 100;\n\t\t\t\t\t// maximum number of dot to be displayed on graphes\n\t\t\t\t\t_this.max_graph_dots = 200;\n\n\n\t\t\t\t\t// create graphes to display our stats\n\t\t\t\t\t_this.avg_error_graph = app.graphUtils.scalableGeneric2DGraph(\"avg-error\", _this.max_graph_dots, _this.stats_update, 150);\n\t\t\t\t\t_this.avg_random_behavior_graph = app.graphUtils.scalableGeneric2DGraph(\"avg-random-behavior\", _this.max_graph_dots, _this.stats_update, 150);\n\t\t\t\t\t_this.avg_reward_graph = app.graphUtils.scalableGeneric2DGraph(\"avg-reward\", _this.max_graph_dots, _this.stats_update, 150);\n\t\t\t\t\t_this.avg_plant_nearby_graph = app.graphUtils.scalableGeneric2DGraph(\"avg-plant-nearby\", _this.max_graph_dots, _this.stats_update, 150);\n\t\t\t\t\t_this.avg_eat_graph = app.graphUtils.scalableGeneric2DGraph(\"avg-eat\", _this.max_graph_dots, _this.stats_update, 150);\n\t\t\t\t\t_this.avg_feed_graph = app.graphUtils.scalableGeneric2DGraph(\"avg-feed\", _this.max_graph_dots, _this.stats_update, 150);\n\n\t\t\t\t\t// extracting the weights of the network\n\t\t\t\t\tvar weights = [];\n\t\t\t\t\tfor(var l=0;l<_this.world.creature.nn.layer_count;l++){\n\t\t\t\t\t\tfor(var i=0;i<_this.world.creature.nn.layers[l].input_unit_count;i++){\n\t\t\t\t\t\t\tfor(var o=0;o<_this.world.creature.nn.layers[l].output_unit_count;o++){\n\t\t\t\t\t\t\t\tweights.push( _this.world.creature.nn.layers[l].weights[o][i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// creating neural network representation\n\t\t\t\t\t_this.nn_graph = app.graphUtils.neuralNetworkGraph(\"nn-graph\", _this.constants.network, weights);\n\n\t\t\t\t\twindow.creature = _this.world.creature;\n\t\t\t\t}", "run() {\n logger.info('Starting game...');\n this.running = true;\n this.update();\n }", "runGame(){\n\t\t\tthis.scene.runGame();\n\t\t}", "function GenerateDungeon() {\n\tCreateMapArray();\n\tPopulateMapRooms();\n\tPopulateMapTunnels();\n\tPopulateRandomTunnels();\n\tPopulateSecretRoom();\n\tAddEncounters();\n\tUpdateGraphicsMap();\n\tUpdateTileMap();\n}", "function movePacMan(e) {\n gridSquare[pacIndex].classList.remove('pacmanUp')\n gridSquare[pacIndex].classList.remove('pacmanRight')\n gridSquare[pacIndex].classList.remove('pacmanDown')\n gridSquare[pacIndex].classList.remove('pacmanLeft')\n switch(e.keyCode) {\n case 37: // left arrow\n left.classList.add('active')\n setTimeout(() => left.classList.remove('active'), 100)\n if (gridSquare[pacIndex-1].classList.contains('wall')) pacIndex += 0\n else if(pacIndex % width !== 0) pacIndex -= 1\n gridSquare[pacIndex].classList.add('pacmanLeft')\n break\n case 38: // upp arrow\n up.classList.add('active')\n setTimeout(() => up.classList.remove('active'), 100)\n if (gridSquare[pacIndex-width].classList.contains('wall')) pacIndex += 0\n else if(pacIndex - width >= 0) pacIndex -= width\n gridSquare[pacIndex].classList.add('pacmanUp')\n break\n case 39: // right arrow\n right.classList.add('active')\n setTimeout(() => right.classList.remove('active'), 100)\n if (gridSquare[pacIndex + 1].classList.contains('wall')) pacIndex += 0\n else if(pacIndex % width < width - 1) pacIndex += 1\n gridSquare[pacIndex].classList.add('pacmanRight')\n break\n case 40: //down arrow\n down.classList.add('active')\n setTimeout(() => down.classList.remove('active'), 100)\n if (gridSquare[pacIndex+width].classList.contains('wall')) pacIndex += 0\n else if(pacIndex + width < width * width) pacIndex += width\n gridSquare[pacIndex].classList.add('pacmanDown')\n break\n }\n // colliding with food -----------------------\n if(gridSquare[pacIndex].classList.contains('food')) {\n gridSquare[pacIndex].classList.remove('food')\n scoreNumber = scoreNumber + 10\n score.innerHTML = scoreNumber\n }\n // colliding with pill ------------------------------------------\n if(gridSquare[pacIndex].classList.contains('pill')) {\n gridSquare[pacIndex].classList.remove('pill')\n for (let i = 0; i < ghosts.length; i++) {\n pilltaken(ghosts[i])\n }\n setTimeout(function(){\n for( let i=0; i<16; i++) {\n clearInterval(caughtIdOne)\n clearInterval(caughtIdTwo)\n clearInterval(caughtIdThree)\n clearInterval(caughtIdFour)\n }\n caughtIdOne = setInterval(function(){\n pacCaught(ghostOne)\n }, 60)\n caughtIdTwo = setInterval(function(){\n pacCaught(ghostTwo)\n }, 60)\n caughtIdThree = setInterval(function(){\n pacCaught(ghostThree)\n }, 60)\n caughtIdFour = setInterval(function(){\n pacCaught(ghostFour)\n }, 60)\n }, pilltime)\n }\n // The next 2 if statments allow for warping from each side of the map\n if (pacIndex === 141) {\n gridSquare[pacIndex].classList.remove('pacmanUp')\n gridSquare[pacIndex].classList.remove('pacmanRight')\n gridSquare[pacIndex].classList.remove('pacmanDown')\n gridSquare[pacIndex].classList.remove('pacmanLeft')\n pacIndex = 157\n gridSquare[pacIndex].classList.add('pacmanLeft')\n }\n if (pacIndex === 158) {\n gridSquare[pacIndex].classList.remove('pacmanUp')\n gridSquare[pacIndex].classList.remove('pacmanRight')\n gridSquare[pacIndex].classList.remove('pacmanDown')\n gridSquare[pacIndex].classList.remove('pacmanLeft')\n pacIndex = 142\n gridSquare[pacIndex].classList.add('pacmanRight')\n }\n }", "function runBasic() {\n initMap();\n initActors();\n display(); \n}", "function loop() {\n //this function controls most of the game\n gameStart = true; //flag for the controller to take inputs for the game and not the menu\n draw.clear(); //for animation\n\n player.draw(); //initialize the player to be drawn and take input to move up/down\n player.move();\n\n wall1.draw(); //draw walls\n wall2.draw();\n\n for (var i = 0; i < rectangleList.length; i++) {\n rec = rectangleList[i]; //push the rectangles to be randomly generated and move\n rec.draw();\n rec.move();\n }\n for (var i = 0; i < powerupList.length; i++) {\n pow = powerupList[i]; //push the powerups to be created\n pow.draw();\n pow.move();\n }\n for (var i = 0; i < debuffList.length; i++) {\n deb = debuffList[i]; //push the debuffs to be created\n deb.draw();\n deb.move();\n }\n\n TimeMe.startTimer(\"game\"); //starts the timer at 0 for a new game\n\n time = TimeMe.getTimeOnPageInSeconds(\"game\").toFixed(2); //sets the time to seconds with 2 decimal places\n score = Math.ceil(powerUpScore + (time * 1.5)); //score is always increasing by 1.5 of time\n }", "respawn() {\n this.initRandomPosition()\n }", "function updatePositionGhosts(){\n ALL_GHOSTS.forEach(function (element) {\n if (element === undefined)\n return;\n\n let possibleMoves = validMoves(element);\n let chosenMove;\n let curMin = Number.MAX_SAFE_INTEGER;\n possibleMoves.forEach(function (move) {\n if (move.x === element.j_last\n && move.y === element.i_last)\n return;\n const tmp_dist = manhattanDistance(pacman.j, pacman.i, move.x, move.y);\n if (tmp_dist<curMin){\n chosenMove = move;\n curMin = tmp_dist;\n }\n else if (tmp_dist === curMin){\n if (Math.random()> 0.5)\n chosenMove = move;\n }\n });\n\n if (chosenMove === undefined){\n chosenMove = {};\n chosenMove.x = element.j;\n chosenMove.y = element.i;\n }\n\n // to determine which ghost image should be draw\n if (element.i < chosenMove.y)\n element.direction = 'DOWN';\n if (element.i > chosenMove.y)\n element.direction = 'UP';\n if (element.j < chosenMove.x)\n element.direction = 'RIGHT';\n if (element.j > chosenMove.x)\n element.direction = 'LEFT';\n\n board_objects[element.i][element.j] = 0;\n\n element.i_last = element.i;\n element.j_last = element.j;\n element.i = chosenMove.y;\n element.j = chosenMove.x;\n\n board_objects[element.i][element.j] = element.id;\n });\n}", "startIntern()\r\n {\r\n Game.log(\"Starting a new game.\");\r\n\r\n // Set the important variables again.\r\n this.direction = Direction.Up;\r\n this.playerTailLength = 5;\r\n this.score = 0;\r\n\r\n let plInitialPos = new Vector2i(this.gridWidth / 2, this.gridHeight / 2);\r\n this.playerPosition.unshift(plInitialPos);\r\n\r\n this.loopDelay = 240;\r\n this.running = true;\r\n clearTimeout(this.loopTimeout);\r\n\r\n this.doGameLoop();\r\n }", "function startGame() {\n removeClicks();\n resetGame();\n addPattern();\n addPattern();\n playPattern();\n}", "function start() {\n\tclear();\n\tc = new GameManager();\n\tc.startGame();\t\n}", "function initializeGame () {\n trees = [\n // Screen 1\n { x: 200 },\n { x: 620 },\n { x: 855 },\n // Screen 2\n { x: 1224 },\n { x: 1648 },\n { x: 1879 },\n // Screen 3\n { x: 2243 },\n { x: 2686 },\n { x: 2887 },\n // Screen 4\n { x: 3272 },\n { x: 3772 }\n ];\n\n clouds = [\n // screen 1\n { x: 85, y: 90, size: 1 },\n { x: 420, y: 150, size: 0.85 },\n { x: 700, y: 50, size: 0.7 },\n { x: 820, y: 80, size: 0.75 },\n // screen 2\n { x: 1109, y: 90, size: 1.1 },\n { x: 1444, y: 150, size: 0.85 },\n { x: 1724, y: 50, size: 0.74 },\n { x: 1844, y: 80, size: 0.79 },\n // screen 3\n { x: 2133, y: 90, size: 0.8 },\n { x: 2475, y: 150, size: 1 },\n { x: 2700, y: 50, size: 0.8 },\n { x: 2850, y: 120, size: 1 },\n // screen 4\n { x: 3157, y: 90, size: 1.2 },\n { x: 3392, y: 150, size: 0.85 },\n { x: 3772, y: 50, size: 0.7 }\n ];\n\n mountains = [\n // screen 1\n { x: 5 },\n { x: 320 },\n { x: 647, hasDoor: true },\n // screen 2\n { x: 1029 },\n { x: 1340, hasDoor: true },\n { x: 1671 },\n // screen 3\n { x: 2055 }\n ];\n\n canyons = [\n // screen 1\n { x: 275, size: 80 },\n { x: 550, size: 80 },\n { x: 940, size: 100 },\n // screen 2\n { x: 1299, size: 80 },\n { x: 1574, size: 100 },\n { x: 1964, size: 90 },\n // screen 3\n { x: 2323, size: 100 },\n { x: 2598, size: 110 },\n { x: 2988, size: 130 }\n ].map(setCanyonValue);\n\n coins = [\n // screen 1\n { x: 275, y: 60, size: 20 },\n { x: 550, y: 60, size: 25 },\n { x: 920, y: 60, size: 30 },\n { x: 964, y: 52, size: 35 },\n { x: 1000, y: 25, size: 32 },\n // screen 2\n { x: 1299, y: 60, size: 25 },\n { x: 1554, y: 60, size: 35 },\n { x: 1598, y: 52, size: 35 },\n { x: 1634, y: 25, size: 35 },\n { x: 1964, y: 60, size: 25 },\n // screen 3\n { x: 2303, y: 60, size: 25 },\n { x: 2343, y: 60, size: 25 },\n { x: 2598, y: 60, size: 40 },\n { x: 2988, y: 70, size: 40 }\n ].map(setCoinValue);\n\n flagpole = {\n x: 3148,\n height: world.floor - 160,\n flagHeight: world.floor - 155,\n offset: 0,\n offsetDirection: 'down',\n isFound: false\n };\n\n flagpole.hitbox = {\n x: flagpole.x - 2.5,\n y: flagpole.height,\n width: 60,\n height: 160\n };\n\n // set the number of lives\n lives = maxLives;\n}", "function Spawn_ForeverGround(){\r\n if (frameCount% 80 ===0) {\r\n var rand = Math.round(random(1,6));\r\n switch(rand) {\r\n case 1: var Forever_Ground = createSprite(width+100,height-240,10,10)\r\n Forever_Ground.addImage(ForeverGround_Img)\r\n Forever_Ground.scale = 0.5\r\n Forever_Ground.velocityX =-(3 + 3*score/100); \r\n \r\n \r\n var Forever_Ground2 = createSprite(width+164,height-240,10,10)\r\n Forever_Ground2.addImage(ForeverGround_Img2)\r\n Forever_Ground2.scale = 0.5\r\n Forever_Ground2.velocityX =-(3 + 3*score/100); \r\n\r\n var invisibleground = createSprite(width+164,height-265,200,5)\r\n invisibleground.velocityX = Forever_Ground2.velocityX\r\n invisibleground.visible = false\r\n \r\n var Forever_Ground3= createSprite(width+220,height-240,10,10)\r\n Forever_Ground3.addImage(ForeverGround_Img3)\r\n Forever_Ground3.scale = 0.5\r\n Forever_Ground3.velocityX =-(3 + 3*score/100); \r\n \r\n Forever_Ground.lifetime = 450\r\n Forever_Ground2.lifetime = 450\r\n Forever_Ground3.lifetime = 450\r\n invisibleground.lifetime = 450\r\n\r\n ForeverGroundGroup.add(Forever_Ground) \r\n ForeverGroundGroup.add(Forever_Ground2) \r\n ForeverGroundGroup.add(Forever_Ground3) \r\n CollideGroup.add(invisibleground);\r\n\r\n\r\n \r\n var Tree = createSprite(width+220,height-300,0,10)\r\n Tree.addImage(TreeImage)\r\n Tree.velocityX =-(3 + 3*score/100); \r\n Tree.scale=0.25\r\n Treegroup.add(Tree);\r\n \r\n var obstacle = createSprite(width+220,height-280,0,10)\r\n obstacle.addImage(ObstacleImage2)\r\n obstacle.velocityX =-(3 + 3*score/100); \r\n obstacle.scale = 0.5;\r\n ObstacleGroup.add(obstacle)\r\n \r\n \r\n CollideGroup.add(invisibleground) \r\n \r\n \r\n \r\n break;\r\n case 2: var Forever_Ground = createSprite(width+100,height-320,10,10)\r\n Forever_Ground.addImage(ForeverGround_Img)\r\n Forever_Ground.scale = 0.5\r\n Forever_Ground.velocityX =-(3 + 3*score/100); \r\n \r\n \r\n var Forever_Ground2 = createSprite(width+164,height-320,10,10)\r\n Forever_Ground2.addImage(ForeverGround_Img2)\r\n Forever_Ground2.scale = 0.5\r\n Forever_Ground2.velocityX =-(3 + 3*score/100); \r\n\r\n var invisibleground2 = createSprite(width+164,height-350,200,5)\r\n invisibleground2.velocityX = Forever_Ground2.velocityX\r\n invisibleground2.visible = false\r\n\r\n CollideGroup.add(invisibleground2)\r\n \r\n \r\n \r\n var Forever_Ground3= createSprite(width+220,height-320,10,10)\r\n Forever_Ground3.addImage(ForeverGround_Img3)\r\n Forever_Ground3.scale = 0.5\r\n Forever_Ground3.velocityX =-(3 + 3*score/100); \r\n\r\n Forever_Ground.lifetime = 450;\r\n Forever_Ground2.lifetime = 450;\r\n Forever_Ground3.lifetime = 450;\r\n invisibleground2.lifetime = 450;\r\n\r\n ForeverGroundGroup.add(Forever_Ground) \r\n ForeverGroundGroup.add(Forever_Ground2) \r\n ForeverGroundGroup.add(Forever_Ground3) \r\n \r\n break;\r\n case 3: var Forever_Ground = createSprite(width+100,height-120,10,10)\r\n Forever_Ground.addImage(ForeverGround_Img)\r\n Forever_Ground.scale = 0.5\r\n Forever_Ground.velocityX =-(3 + 3*score/100); \r\n \r\n \r\n var Forever_Ground2 = createSprite(width+164,height-120,10,10)\r\n Forever_Ground2.addImage(ForeverGround_Img2)\r\n Forever_Ground2.scale = 0.5\r\n Forever_Ground2.velocityX =-(3 + 3*score/100); \r\n \r\n var invisibleground3 = createSprite(width+164,height-145,200,5)\r\n invisibleground3.velocityX = Forever_Ground2.velocityX\r\n invisibleground3.visible = false\r\n\r\n \r\n var Forever_Ground3= createSprite(width+220,height-120,10,10)\r\n Forever_Ground3.addImage(ForeverGround_Img3)\r\n Forever_Ground3.scale = 0.5\r\n Forever_Ground3.velocityX =-(3 + 3*score/100); \r\n\r\n Forever_Ground.lifetime = 450\r\n Forever_Ground2.lifetime = 450\r\n Forever_Ground3.lifetime = 450\r\n invisibleground3.lifetime = 450\r\n\r\n ForeverGroundGroup.add(Forever_Ground) \r\n ForeverGroundGroup.add(Forever_Ground2) \r\n ForeverGroundGroup.add(Forever_Ground3)\r\n \r\n Tree = createSprite(width+164,height-180,0,10)\r\n Tree.addImage(TreeImage)\r\n Tree.velocityX =-(3 + 3*score/100); \r\n Tree.scale=0.25\r\n Treegroup.add(Tree);\r\n Tree.collide(Forever_Ground3)\r\n \r\n CollideGroup.add(invisibleground3)\r\n \r\n break;\r\n case 4: var Forever_Ground = createSprite(width+100,height/2,10,10)\r\n Forever_Ground.addImage(ForeverGround_Img)\r\n Forever_Ground.scale = 0.5\r\n Forever_Ground.velocityX =-(3 + 3*score/100); \r\n \r\n \r\n var Forever_Ground2 = createSprite(width+164,height/2,10,10)\r\n Forever_Ground2.addImage(ForeverGround_Img2)\r\n Forever_Ground2.scale = 0.5\r\n Forever_Ground2.velocityX =-(3 + 3*score/100); \r\n \r\n var invisibleground4=createSprite(width+164,height/2-25,200,5)\r\n invisibleground4.velocityX = Forever_Ground2.velocityX\r\n invisibleground4.visible = false\r\n\r\n \r\n\r\n var Forever_Ground3= createSprite(width+220,height/2,10,10)\r\n Forever_Ground3.addImage(ForeverGround_Img3)\r\n Forever_Ground3.scale = 0.5\r\n Forever_Ground3.velocityX =-(3 + 3*score/100); \r\n \r\n Forever_Ground.lifetime = 450\r\n Forever_Ground2.lifetime = 450\r\n Forever_Ground3.lifetime = 450\r\n invisibleground4.lifetime = 450\r\n\r\n ForeverGroundGroup.add(Forever_Ground) \r\n ForeverGroundGroup.add(Forever_Ground2) \r\n ForeverGroundGroup.add(Forever_Ground3) \r\n\r\n CollideGroup.add(invisibleground4)\r\n\r\n \r\n break;\r\n case 5: var Forever_Ground = createSprite(width+100,height-110,10,10)\r\n Forever_Ground.addImage(ForeverGround_Img)\r\n Forever_Ground.scale = 0.5\r\n Forever_Ground.velocityX =-(3 + 3*score/100); \r\n \r\n \r\n var Forever_Ground2 = createSprite(width+164,height-110,10,10)\r\n Forever_Ground2.addImage(ForeverGround_Img2)\r\n Forever_Ground2.scale = 0.5\r\n Forever_Ground2.velocityX =-(3 + 3*score/100); \r\n \r\n var invisibleground5 = createSprite(width+164,height-140,200,5)\r\n invisibleground5.velocityX = Forever_Ground2.velocityX\r\n invisibleground5.visible = false\r\n \r\n var Forever_Ground3= createSprite(width+220,height-110,10,10)\r\n Forever_Ground3.addImage(ForeverGround_Img3)\r\n Forever_Ground3.scale = 0.5\r\n Forever_Ground3.velocityX =-(3 + 3*score/100); \r\n \r\n Forever_Ground.lifetime = 450\r\n Forever_Ground2.lifetime = 450\r\n Forever_Ground3.lifetime = 450\r\n invisibleground5.lifetime = 450\r\n ForeverGroundGroup.add(Forever_Ground) \r\n ForeverGroundGroup.add(Forever_Ground2) \r\n ForeverGroundGroup.add(Forever_Ground3) \r\n \r\n\r\n CollideGroup.add(invisibleground5)\r\n var Tree = createSprite(width+164,height-170,0,10)\r\n Tree.addImage(TreeImage)\r\n Tree.velocityX =-(3 + 3*score/100); \r\n Tree.scale=0.25\r\n Treegroup.add(Tree);\r\n \r\n \r\n break;\r\n case 6: var Forever_Ground = createSprite(width+100,height-400,10,10)\r\n Forever_Ground.addImage(ForeverGround_Img)\r\n Forever_Ground.scale = 0.5\r\n Forever_Ground.velocityX =-(3 + 3*score/100); \r\n \r\n \r\n var Forever_Ground2 = createSprite(width+164,height-400,10,10)\r\n Forever_Ground2.addImage(ForeverGround_Img2)\r\n Forever_Ground2.scale = 0.5\r\n Forever_Ground2.velocityX =-(3 + 3*score/100); \r\n \r\n var invisibleground6 = createSprite(width +164,height-425,200,5);\r\n invisibleground6.velocityX = Forever_Ground2.velocityX\r\n invisibleground6.visible = false\r\n\r\n var Forever_Ground3= createSprite(width+220,height-400,10,10)\r\n Forever_Ground3.addImage(ForeverGround_Img3)\r\n Forever_Ground3.scale = 0.5\r\n Forever_Ground3.velocityX =-(3 + 3*score/100); \r\n\r\n Forever_Ground.lifetime = 450\r\n Forever_Ground2.lifetime = 450\r\n Forever_Ground3.lifetime = 450\r\n invisibleground6.lifetime = 450\r\n\r\n\r\n ForeverGroundGroup.add(Forever_Ground) \r\n ForeverGroundGroup.add(Forever_Ground2) \r\n ForeverGroundGroup.add(Forever_Ground3) \r\n \r\n CollideGroup.add(invisibleground6)\r\n break;\r\n default: break;\r\n \r\n }\r\n \r\n } \r\n }", "function initGame(){\r\n\t//initialize game object coordinates\r\n\tbillboard_coords = genPoints(80);\r\n\tzombie_coords = genPoints(5);\r\n\tzombie_speed = [];\r\n\tfor(var i=0; i<zombie_coords.length; i++){\r\n\t\tzombie_speed[i] = genSpeedModifier(0.2);\r\n\t}\r\n\r\n\tzombie_to_kill = [];\r\n\tintensity_loop = 0;\r\n\tbullet_coords = [];\r\n\tbullet_timeouts = [];\r\n\tbullet_timeouts = [];\r\n\tkeysPressed = [];\r\n\tspawn_wait = 160;\r\n\ttime = 0;\r\n\r\n\tscore.innerHTML = '0';\r\n\tnum_bullets.innerHTML = '20';\r\n\r\n\ttrans_mat = [];\r\n\trot_mat = [];\r\n\r\n\tgun_coords = genGunCoords();\r\n\r\n\trender();\r\n}", "function __resetGame() {\n\n // reset the timer counter variables\n __lastDrawTime = 0;\n __frameCounter = 0;\n\n // the players positions in 3D space\n var playerPosition = {x: 0.0, y: -1.9, z: 0.0};\n\n // create the Map object\n __map = new __Map();\n\n // create the Ball object\n __ball = new __Ball(null, new __Rect(0, 0, 2.5, 2));\n\n // remove any old players (we want to draw all our game objects from scratch!)\n __players.length = 0;\n\n // add the players to the game\n __players.push(new __Player(__playerNames[0], new __Position(playerPosition.x, playerPosition.y, playerPosition.z), new __Rect(playerPosition.x, playerPosition.y, 2.08, 1), __Player.prototype.PLAYER_TYPE.ROBOT).setColour(0, 0, 1));\n __players.push(new __Player(__playerNames[1], new __Position(playerPosition.x, -playerPosition.y, playerPosition.z), new __Rect(playerPosition.x, -playerPosition.y, 2.08, 1), __Player.prototype.PLAYER_TYPE.ROBOT).setColour(1, 0, 0));\n\n // make note of the human player\n __thePlayer = __players[0];\n\n // using bitwise ORs to be able to easily evaluate the direction\n // the ball is moving in\n var possibleBallDirections = [\n __DIRECTIONS.EAST | __DIRECTIONS.NORTH,\n __DIRECTIONS.WEST | __DIRECTIONS.NORTH,\n __DIRECTIONS.EAST | __DIRECTIONS.SOUTH,\n __DIRECTIONS.WEST | __DIRECTIONS.SOUTH\n ];\n\n // randomize the direction of the ball!\n __ball.setDirection(possibleBallDirections[Math.floor((Math.random() * possibleBallDirections.length) + 1)]);\n\n // start the game loop!\n __tick();\n }", "function setup(){\r\n //makes the canvas for the game according Tothe screen width\r\n createCanvas(windowWidth,windowHeight);\r\n // Groups\r\n BigGroundGroup = new Group();\r\n ForeverGroundGroup = new Group();\r\n CollideGroup = new Group();\r\n Treegroup = new Group();\r\n ObstacleGroup = new Group();\r\n RiverGroup = new Group();\r\n\r\n\r\n \r\n gameState = SERVE\r\n // various Functions of The Html BOdy For Creating The input baar a button and a greeting \r\n // Name BAR,save Button etc are made here \r\n NameBar = createInput(\"Enter your name\");\r\n displayName = createElement('h2');\r\n SaveName = createButton(\"save\")\r\n \r\n NameBar.position(width/2,height/2-100);\r\n SaveName.position(width/2,height/2+20);\r\n title = createElement('h1');\r\n title.html(\"RUNNERS LANDSCAPE\");\r\n title.position(50, 10);\r\n title.style('font-size', '70px');\r\n title.style('color', 'red');\r\n\r\n // Retrieve text \r\n //code for name\r\n points = font.textToPoints('Runners ',width/2-200,height/2-50,width/height+100, {\r\n sampleFactor: 0.3,\r\n simplifyThreshold: 0\r\n});\r\npoints2 = font.textToPoints(\"landscape\",width/2-150,height/2+80,width/height+100,{\r\n sampleFactor: 0.3,\r\n simplifyThreshold: 0\r\n});\r\npoints3 = font.textToPoints(\"Vishnu \",width/2-290,height/2-140,width/height+80,{\r\n sampleFactor: 0.3,\r\n simplifyThreshold: 0\r\n});\r\npoints4 = font.textToPoints(\"presents :-\",width/2-9,height/2-140,width/height+80,{\r\n sampleFactor: 0.3,\r\n simplifyThreshold: 0\r\n});\r\npoints5 = font.textToPoints(\"The Endless Spirit\",width/2-280,height-50,width/height+60,{\r\n sampleFactor: 0.3,\r\n simplifyThreshold: 0\r\n});\r\n//end\r\n\r\n // makes background\r\n \r\n background = createSprite(0,0,600,600);\r\n background.addImage(\"bg-1\",BGImage1);\r\n background.addImage(\"bg-2\",BGImage2);\r\n background.addImage(\"bg-3\",BGImage3);\r\n background.addImage(\"bg-4\",BGImage4);\r\n background.addImage(\"bg-5\",BGImage5);\r\n background.scale = 6\r\n // plays the background music1 whenin the play state \r\n // plays the game Sound When it Starts \r\n BGMusic6.play();\r\n // creates and adds properties to the chracter \r\n Joey = createSprite(50,0,20,50);\r\n Joey.scale= 0.25\r\n Joey.x = 50\r\n Joey.y = 0\r\n Joey.addAnimation(\"Jumping\",Jumping_Joey);\r\n Joey.addAnimation(\"running\", Running_Joey);\r\n Joey.addAnimation(\"death\",Dead_Joey);\r\n Joey.addAnimation(\"sliding\",Slide_Joey);\r\n Joey.setCollider(\"rectangle\",50,0,280,380);\r\n\r\n //Creates in game Buttons\r\n colr = color(random(0,255),random(0,255),random(0,255));\r\n JumpButton = createButton(\"Click To Jump\");\r\n JumpButton.position(50,height-100);\r\n JumpButton.hide();\r\n JumpButton.style('width', '100px');\r\n JumpButton.style('height', '30px');\r\n JumpButton.style('background',colr)\r\n\r\n \r\n SlideButton = createButton(\"Click To Slide\"); \r\n SlideButton.position(width-150,height-100); \r\n SlideButton.mousePressed(Slide);\r\n SlideButton.style('width', '100px');\r\n SlideButton.style('height', '30px');\r\n SlideButton.style('background',colr)\r\n SlideButton.hide(); \r\n\r\n StartButton = createButton(\"START\");\r\n StartButton.size (180,50);\r\n StartButton.position(width/2+30,height-90)\r\n StartButton.style('width', '200px');\r\n StartButton.style('height', '40px');\r\n // colr = random(0,255)\r\n StartButton.style('background', colr);\r\n StartButton.hide();\r\n\r\n InfoButton = createButton(\"Info\") \r\n InfoButton.position(width-90,height/13) \r\n InfoButton.mousePressed(gsINFO); \r\n InfoButton.hide(); \r\n \r\n col = color(\"red\"); //use color instead of fill\r\n \r\n CancelButton = createButton(\"cancel\")\r\n CancelButton.position(width-100,height/8)\r\n CancelButton.hide()\r\n CancelButton.style('background-color', col); \r\n \r\n NextButton = createButton(\"next\")\r\n NextButton.position(width/2+240,height/2) \r\n NextButton.hide();\r\n\r\n PreviousButton = createButton(\"previous\")\r\n PreviousButton.position(width/2-280,height/2)\r\n PreviousButton.hide();\r\n \r\n LifelineButton = createButton(\"lifeline\");\r\n LifelineButton.position(width-2-200,height/+20) \r\n LifelineButton.hide(); \r\n\r\n LifelineButton2 = createButton(\"lifeline\") \r\n LifelineButton2.position(width-2-200,height/+20) \r\n LifelineButton2.hide();\r\n \r\n\r\n RestartButton = createButton(\"Restart\");\r\n RestartButton.position(width/2+20,height/2-20);\r\n RestartButton.style('color', 'skyblue');\r\n RestartButton.hide();\r\n\r\n\r\n // game state screens and the sprites\r\n EndScreen = createSprite(width/2,height/2,200,200);\r\n EndScreen.addImage(EndScreen_Img);\r\n EndScreen.visible = false\r\n \r\n lineofalert = createSprite(width/2,height/2+190,width,20);\r\n lineofalert.visible = false\r\n \r\n InfoScreen = createSprite(width/2,height/2,width*2,height*2)\r\n InfoScreen.visible = false\r\n InfoScreen.addAnimation(\"page1\",InfoScreen_Img);\r\n InfoScreen.addAnimation(\"page2\",InfoScreen_Img2);\r\n InfoScreen.addAnimation(\"page3\",InfoScreen_Img3);\r\n\r\n ServeScreen=createSprite(width/2,height/2,width*2,height*2)\r\n ServeScreen.addImage(ServeScreen_Img);\r\n ServeScreen.visible = false\r\n ServeScreen.scale = windowWidth/windowHeight\r\n\r\n //game State Objects and icons of it\r\n\r\n previousIcon = createSprite(width/2-280,height/2)\r\n previousIcon.addImage(previousIcon_Img)\r\n previousIcon.scale = 0.25\r\n previousIcon.visible = false\r\n\r\n nextIcon = createSprite(width/2+280,height/2)\r\n nextIcon.addImage(nextIcon_Img)\r\n nextIcon.scale = 0.25\r\n nextIcon.visible = false\r\n \r\n LifeLineGround2=createSprite(1200,120,20,20)\r\n LifeLineGround2.addImage(LifeLineGround2_Img)\r\n LifeLineGround2.scale = 0.5\r\n LifeLineGround2.visible = false\r\n\r\n LifeLineGround = createSprite(1200,120,20,20)\r\n LifeLineGround.addImage(LifeLineGround2_Img)\r\n LifeLineGround.scale = 0.5\r\n LifeLineGround.visible = false\r\n\r\n StartGround = createSprite(60,height/2-160)\r\n StartGround.addImage(StartGround_Img)\r\n StartGround.scale = 0.9\r\n StartGround.visible = false\r\n StartGround.setCollider(\"rectangle\",0,0,100,40);\r\n CollideGroup.add(StartGround);\r\n \r\n StartGround2= createSprite(150,height/2-120)\r\n StartGround2.addImage(StartGround_Img)\r\n StartGround2.scale = 0.9\r\n StartGround2.visible = false\r\n StartGround2.setCollider(\"rectangle\",0,0,100,40);\r\n CollideGroup.add(StartGround2);\r\n \r\n StartGround3= createSprite(250,height/2-90);\r\n StartGround3.addImage(StartGround_Img);\r\n StartGround3.scale = 0.9\r\n StartGround3.visible = false\r\n CollideGroup.add(StartGround3);\r\n\r\n StartGround4= createSprite(350,height/2-60)\r\n StartGround4.addImage(StartGround_Img)\r\n StartGround4.scale = 0.9 \r\n CollideGroup.add(StartGround4); \r\n StartGround4.visible = false;\r\n\r\n StartGround5= createSprite(450,height/2-60)\r\n StartGround5.addImage(StartGround_Img)\r\n StartGround5.scale = 0.9 \r\n CollideGroup.add(StartGround5); \r\n StartGround5.visible = false;\r\n\r\n // creates the game Button Icons And hides them \r\n\r\n InfoIcon = createSprite(width-60,height/16,20,20);\r\n InfoIcon.visible = false\r\n InfoIcon.addImage(infoIcon_Img);\r\n InfoIcon.scale = 0.05;\r\n \r\n LifeLineIcon = createSprite(width-2-200,height/+20,10,10)\r\n LifeLineIcon.addImage(LifeLineIcon_Img)\r\n LifeLineIcon.scale=0.025\r\n LifeLineIcon.visible = false\r\n\r\n GameOver = createSprite(width/2,height/2- 50);\r\n GameOver.addImage(GameOver_Img);\r\n GameOver.visible = false;\r\n\r\n RestartButton_Icon=createSprite(width/2,height/2);\r\n RestartButton_Icon.addImage(RestartButtonIcon_Img);\r\n RestartButton_Icon.scale = 0.05\r\n RestartButton_Icon.visible = false;\r\n\r\n\r\n\r\n }", "function _beginGame() {\n\t//clear the canvas if a restart\n\t$game.$renderer.clearBossLevel();\n\t//set score from tiles colored\n\t_score = $game.$player.getTilesColored();\n\t_bossScore = 0;\n\t$score.text(_score);\n\t_start = new Date().getTime();\n _time = 0;\n _elapsed = '0.0';\n _pause = false;\n _totalTime = 0;\n _target = 90;\n _clockRate = 1;\n _numRegularSeeds = 20;\n _currentCharger = 0;\n _charger = {};\n _seedMode = 0;\n _canPlace = true;\n _placeCharger();\n $('.bossHud .regularSeedButton .hudCount').text(_numRegularSeeds);\n setTimeout(_updateTime, 100);\n //trigger boss music!\n $game.$audio.switchTrack(7);\n}", "function GameEngine() {\r\n\r\n this.allMaps = [];\r\n // Entities of the Game\r\n this.entities = []; // All entities of the game\r\n this.weapons = []; // All the weapons of the game\r\n this.items = [];\r\n this.villains = []; // All the Zombies | TODO ? Get rid or change ?\r\n this.players = []; // All the Players | TODO ? Get rid or change ?\r\n this.gameRunning = true;\r\n this.musicPlaying = true;\r\n this.deadPlayers = [];\r\n\r\n // This is the x and y of the game, they control the rotation of the player\r\n this.x;\r\n this.y;\r\n\r\n this.map = null;\r\n //this.menuMode = \"Game\";\r\n this.menuMode = \"Start\";\r\n this.hasSeenIntro = false;\r\n\r\n this.zombieCooldownNumInitial = 3; // how often a zombie will appear initially\r\n this.zombieCooldown = this.zombieCooldownNumInitial; // the cooldown until the next zombie appears\r\n \r\n \r\n this.spiderCooldownNumInitial = 2; // how often a spider will appear\r\n this.spiderCooldown = this.zombieCooldownNumInitial; // the cooldown until the next spider appears\r\n \r\n this.skeletonCooldownNumInitial = 4; // how often a skeleton will appear\r\n this.skeletonCooldown = this.zombieCooldownNumInitial; // the cooldown until the next skeleton appears\r\n\r\n this.kills = 0; // this is the number of kills that the player has total\r\n\r\n this.showOutlines = false; // this shows the outline of the entities\r\n this.ctx = null; // this is the object being used to draw on the map\r\n this.click = null; // this is the click value (if null, not being clicked)\r\n\r\n this.mouse = {x:0, y:0, mousedown:false}; // this is the mouse coordinates and whether the mouse is pressed or not\r\n\r\n this.surfaceWidth = null; // the width of the canvas\r\n this.surfaceHeight = null; // the height of the canvas\r\n\r\n // var source= document.createElement('source');\r\n // source.type= 'audio/ogg';\r\n // source.src= \"./sound/backgroundmusic1.ogg\";\r\n // this.backgroundaudio.appendChild(source);\r\n // source= document.createElement('source');\r\n // source.type= 'audio/mpeg';\r\n // source.src= \"./sound/fastfoot.mp3\";\r\n // this.backgroundaudio.appendChild(source);\r\n // console.log(this.backgroundaudio);\r\n this.setupSounds();\r\n\r\n \r\n this.attributePoints = 0;\r\n // FOREST MAP\r\n // this.worldWidth = 1600; // the width of the world within the canvas FOREST\r\n // this.worldHeight = 1600; // the height of the world within the canvas FOREST\r\n\r\n // this.mapRatioWidth = 1600; //\r\n // this.mapRationHeight = 1600;\r\n\r\n // HOSPITAL MAP\r\n // this.worldWidth = 1400; // the width of the world within the canvas HOSPITAL\r\n // this.worldHeight = 1350; // the height of the world within the canvas HOSPITAL\r\n\r\n // this.mapRatioWidth = 400;\r\n // this.mapRatioHeight = 400;\r\n\r\n this.windowX = 0; // This is the x-coordinate of the top left corner of the canvas currently\r\n this.windowY = 0; // This is the y-coordinate of the top left corner of the canvas currently\r\n\r\n // Quinn's Additions\r\n this.timer = new Timer(); // this creates the Object Timer for the Game Engine\r\n this.keyState = {}; // this is the current keystate which is an object that is nothing\r\n\r\n this.expToLevelUp = 10;\r\n this.level = 1;\r\n this.expEarned = 0;\r\n\r\n this.menuBackground = ASSET_MANAGER.getAsset(menuBackground);\r\n this.aura = false;\r\n\r\n this.maxHalo = 10;\r\n this.halo = this.maxHalo;\r\n}", "function main() {\n if (has_game_ended()) return;\n\n changing_direction = false;\n setTimeout(function onTick() {\n clear_board();\n gridBoard();\n numPathBoard();\n drawFood();\n move_snake();\n drawSnake();\n // Call main again\n main();\n }, delay)\n }", "function create(){\n\tthis.add.image(400,300,'background');\n\n\tplatforms = this.physics.add.staticGroup();\n\n\t\tplatforms.create(310,490,'sol').setScale(0.15,1).refreshBody();\n\t\tplatforms.create(10,460,'sol').setScale(0.15).refreshBody();\n\n\n\t\tplatforms.create(480,500,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(600,500,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(400,460,'sol').setScale(0.15).refreshBody();\n\n\t\tplatforms.create(600,590,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(670,590,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(740,590,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(810,590,'sol').setScale(0.15).refreshBody();\n\n\t\tplatforms.create(100,368,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(170,368,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(240,368,'sol').setScale(0.15).refreshBody();\n\t\tplatforms.create(310,368,'sol').setScale(0.15).refreshBody();\n\t\n\t\tplayer = this.physics.add.sprite(20,400,'perso');\n\t\tplayer.setCollideWorldBounds(true);\n\t\tplayer.setBounce(0.2);\n\t\tplayer.body.setGravityY(000);\n\t\tthis.physics.add.collider(player,platforms);\n\t\n\tcursors = this.input.keyboard.createCursorKeys(); \n\n//------------------------------------------------------------------\n//ajout de l'animation du perso\t\n\tthis.anims.create({\n\t\tkey:'left',\n\t\tframes: this.anims.generateFrameNumbers('perso', {start: 0, end: 3}),\n\t\tframeRate: 10,\n\t\trepeat: -1\n\t});\n\t\n\tthis.anims.create({\n\t\tkey:'stop',\n\t\tframes: [{key: 'perso', frame:5}],\n\t\tframeRate: 10\n\t});\n\n//------------------------------------------------------------------\n//le spawn du coeur\n\tcoeur = this.physics.add.group({\n\t\tkey: 'coeur',\n\t\tsetXY: {x:400,y:0,stepX:70}\n\t});\n\t\t//rebond du coeur\n\t coeur.children.iterate(function (child) {\n child.setBounceY(Phaser.Math.FloatBetween(1, 1));\n });\n\t //mise en place des colisions\n\t\tthis.physics.add.collider(coeur,platforms);\n\t\tthis.physics.add.overlap(player,coeur,collectCoeur,null,this);\n//------------------------------------------------------------------\n//le spawn des etoiles\n\tstars = this.physics.add.group({\n\t\tkey: 'etoile',\n\t\trepeat:11,\n\t\tsetXY: {x:12,y:0,stepX:70}\n\t});\n\t\t//rebond des étoiles\n\t stars.children.iterate(function (child) {\n child.setBounceY(Phaser.Math.FloatBetween(0.1, 0.4));\n });\n\t //mise en place des colisions\n\t\tthis.physics.add.collider(stars,platforms);\n\t\tthis.physics.add.overlap(player,stars,collectStar,null,this);\n\n//------------------------------------------------------------------\n//affichage des pvs et du score\n\tvieText = this.add.text(16,16, 'PV: 3', {fontSize: '32px', fill:'#000'});\n\tscoreText = this.add.text(16,16, 'score: 0', {fontSize: '32px', fill:'#000'});\n\t\n\t//colison des bombs\n\tbombs = this.physics.add.group();\n\tthis.physics.add.collider(bombs,platforms);\n\tthis.physics.add.collider(player,bombs, hitBomb, null, this);\n}", "function gameReset() {\n\n walkInside = false;\n isOutside = true;\n\n victim.dead = false;\n victim.detection = false;\n\n player.inside = false;\n player.x = 1760;\n player.y = 1700;\n\n floorplan.upstairs = false;\n floorplan.outside = true;\n\n killCount = 0;\n\n victimSpawn();\n\n}", "function grtown() {\n // make the world\n let world = new GrWorld({\n width:1500, height:800, // make the window reasonably large\n groundplanesize:30 // make the ground plane big enough for a world of stuff\n });\n\n // put stuff into it - you probably want to take the example stuff out first\n\n\n /********************************************************************** */\n /** EXAMPLES - student should remove these and put their own things in */\n /***/\n \n // Add house into the town\n for (let i = -23; i < 32; i += 7)\n {\n if (i === -9 || i === 12)\n world.add(new GrCrossHipped({x: i - 2, z: -17, size: 3}));\n else\n world.add(new GrPyramidHipHouse({x: i, z: -20, size: 3}));\n if (i === -23 || i === -2 || i === 19)\n world.add(new GrCrossHipped({x: i - 2, z: 20, size:3}));\n else\n world.add(new GrPyramidHipHouse({x: i, z: 17, size:3}));\n }\n\n // Add a skyscraper\n world.add(new GrSkyscraper({x: 0, z: -23,rotate: Math.PI / 2}));\n \n // Add helipads for one airplane' moving\n world.add(new GrHelipad(-25, 0.5, 27, 1));\n world.add(new GrHelipad(25, 0.5, 27, 1));\n world.add(new GrHelipad(0, 0.5, -27, 1));\n\n // Add an airplane moving around the town in the sky\n world.add(new GrAirplane1());\n\n // Add a merry-go-around\n world.add(new GrCarousel({x: 25, size: 1.5}));\n\n // Add a balloon\n world.add(new GrBalloon({x: 13, y: 10, r: 3}));\n\n // Add train track\n let track = new GrTrack();\n\n // Add a \"train\" made up by three car, the cars move along the track\n let car = new GrCar(track);\n let car2 = new GrCar2(track);\n let car3 = new GrCar3(track);\n car.u = 0.25;\n car2.u = 0.125;\n world.add(track);\n world.add(car);\n world.add(car2);\n world.add(car3);\n\n // Add another airplane, moving between helipads\n let airplane = new GrAirplane2();\n world.add(airplane);\n airplane.getPads(world.objects);\n\n // Add plants (trees and flowers)\n world.add(new GrTree({x: -25, z: 10, s: 1.5}));\n world.add(new GrTree({x: -25, z:-10, s: 1.5}));\n world.add(new GrFlower({x:-22, z: -7, s: 1.2}));\n world.add(new GrFlower({x: -22, z: 7, s: 1.2}));\n\n // Make the town snowing\n world.add(new GrSnow());\n\n // Add a sign at the center of the town\n world.add(new GrBall());\n \n /** EXAMPLES - end - things after this should stay */\n /********************************************************************** */\n\n // build and run the UI\n\n // only after all the objects exist can we build the UI\n // @ts-ignore // we're sticking a new thing into the world\n world.ui = new WorldUI(world);\n // now make it go!\n world.go();\n}", "function drawMap() {\r\n\t\t\tPacman.contextBackground.fillStyle = \"#000\";\r\n\t\t\tPacman.contextBackground.fillRect(0, 0, Pacman.canvas.width, Pacman.canvas.height);\r\n\r\n\t\t\tdrawWalls();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tfor (var i = 0; i < Pacman.gameHeight; i++) {\r\n\t\t \tfor (var j = 0; j < Pacman.gameWidth; j++) {\t \t\r\n\t\t\t \tvar map = Pacman.currentGameMap[i][j];\r\n\t\t\t \t\r\n\t\t\t \tif (map === Pacman.PILL) {\r\n\t\t\t \t\tPacman.contextBackground.beginPath();\r\n\t\t\t \t\t// fillStyle - Sets or returns the color, gradient, or pattern used to fill the drawing\r\n\t\t\t \t\tPacman.contextBackground.fillStyle = \"#FFF\";\r\n\t \t\t\t\t// arc - Creates an arc/curve (used to create circles, or parts of circles)\r\n\t \t\t\t\tPacman.contextBackground.arc((j * Pacman.gameMapBlockSizeX) + Pacman.gameMapBlockSizeX / 2, (i * Pacman.gameMapBlockSizeY) + Pacman.gameMapBlockSizeY / 2, 6, 0, 2 * Math.PI, false);\r\n\t \t\t\t\tvar canvas = document.getElementById('myCanvas');\r\n \r\n\t\t \t\t\t// fill - Fills the current drawing (path)\r\n \tPacman.contextBackground.fill();\r\n\t\t\t \t} else if (map === Pacman.PELLET) {\r\n\t\t\t \t\tPacman.contextBackground.beginPath();\r\n\t\t\t \t\t// fillStyle - Sets or returns the color, gradient, or pattern used to fill the drawing\r\n\t\t\t \t\tPacman.contextBackground.fillStyle = \"#FFF\";\r\n\t\t\t\t\t\tPacman.contextBackground.fillRect((j * Pacman.gameMapBlockSizeX) + (Pacman.gameMapBlockSizeX / 2.5), (i * Pacman.gameMapBlockSizeY) + (Pacman.gameMapBlockSizeY / 2.5), \r\n\t\t\t\t\t\t\tPacman.gameMapBlockSizeX / 6, Pacman.gameMapBlockSizeY / 6);\r\n\t\t\t \t} else\r\n\t\t\t \t\tcontinue;\r\n\t\t\t\t\t// closePath - Creates a path from the current point back to the starting point\t\t\t \t\t\r\n\t\t\t\t\tPacman.contextBackground.closePath();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "startGame() {\n if (this.tick <= 50) {\n this.tutorial.alpha -= 0.02;\n this.fireToContinue.alpha -= 0.02;\n this.bg.alpha -= 0.02;\n this.star.alpha -= 0.02;\n }\n else {\n this.startBgm.stop();\n this.scene.stop();\n this.scene.start('mainGame', { remapped: this.remapped, remapKeys: this.remapKeys });\n }\n }", "function startTurn(room, gameStart = false) {\n console.log(\"Starting turn in room \" + room)\n\n let curRoom = rooms[room]\n\n /* \n\n DAY/NIGHT CYCLE\n \n */\n curRoom.turnCount++;\n\n if(curRoom.turnCount % 10 == 0) {\n curRoom.dayTime = !curRoom.dayTime;\n }\n\n /* \n\n == Update MONITORS ==\n \n Each monitor should have the world situation updated. This means\n => New position (and orientation) for all units (ships and sea monsters)\n => New deals at the docks\n => ...\n\n In many cases, only information that has _CHANGED_ is sent. \n \n */\n\n // variable that will hold the monitor package (thus mPack)\n let mPack = {}\n\n /*\n\n This is where GAME INITIALIZATION takes place\n\n The comments speak for themselves. \n It simply creates the map and everything on it, including resources, docks (and their trading routes), etc.\n\n */\n if(gameStart) {\n // send the map seed\n mPack[\"mapSeed\"] = curRoom.mapSeed;\n\n mPack[\"config\"] = curRoom.config;\n\n mPack[\"treasures\"] = curRoom.treasures;\n\n // create the actual BASE MAP (sea and islands)\n createBaseMap(curRoom)\n\n // discover ISLANDS\n // these only need to be saved inside the map (for each tile that's part of an island, save its island index)\n // this function also adds a DOCK to each island\n discoverIslands(curRoom)\n\n // plant TREASURES\n createTreasures(curRoom);\n\n // create routes between docks\n // save the routes themselves within the dock\n // create an AI ship for each dock, pick a random route, place the ship at the start of the route\n createDockRoutes(curRoom);\n\n // create all monsters (individual array)\n createSeaMonsters(curRoom);\n\n // distribute MONSTERS and PLAYERS (both already have their individual array; update that and now place them inside the map)\n distributeStartingUnits(curRoom);\n\n // add ALL this information to the \"mPackage\": the seed, the drawings of creatures/ships, dock position, etc.\n\n // send the drawings (include FLAG and PLAYER DRAWINGS ??)\n mPack[\"monsterDrawings\"] = curRoom.monsterDrawings;\n mPack[\"shipDrawings\"] = curRoom.shipDrawings;\n mPack[\"aiShipDrawings\"] = [];\n\n // send the units\n // TO DO: Only send the information we need: the type (for displaying the drawing) and their location (perhaps orientation)\n // TO DO: Later on, we need to send the dock deals, and which islands have been discovered\n mPack[\"docks\"] = curRoom.docks;\n mPack[\"cities\"] = curRoom.cities;\n\n mPack[\"monsters\"] = curRoom.monsters;\n mPack[\"aiShips\"] = curRoom.aiShips;\n mPack[\"playerShips\"] = curRoom.playerShips;\n } else {\n // send UPDATED information about all units\n // => their new position\n // => ?? anything else ??\n mPack[\"monsters\"] = curRoom.monsters;\n mPack[\"aiShips\"] = curRoom.aiShips;\n mPack[\"playerShips\"] = curRoom.playerShips;\n\n mPack[\"discoveredTiles\"] = curRoom.discoveredTiles;\n }\n\n // send the mPack to all monitors\n sendSignal(room, true, 'pre-signal', mPack, true)\n\n\n\n\n /* \n\n == Update PLAYERS ==\n\n Each player should have updated information - BUT ONLY FOR THEIR ROLES\n For each player, a \"package\" is put together that contains only what this player needs (based on his roles)\n This puts slightly more strain on the server, but limits internet traffic significantly (and thus increases speed)\n\n pPack = \"player package\" \n\n (didn't want to do this, but had some trouble with reserved words and all)\n\n */\n\n // loop through all ships\n // some information only needs to be determined ONCE per ship\n // => adjacency checks (next to a dock? next to an undiscovered island?)\n // => cartographer checks (enemies within range?)\n for(let i = 0; i < curRoom.playerShips.length; i++) {\n let curShip = curRoom.playerShips[i];\n\n let islandsWeAlreadyChecked = {};\n let captainTasks = [];\n\n // arbitrary exploration (if the ship is going slow enough, you can explore your current tile)\n if(curShip.speed <= 1) {\n captainTasks.push([6, null])\n }\n\n // == ADJACENCY (CAPTAIN) STUFF ==\n // check the tiles left/right/top/bottom\n const positions = [[-1,0],[1,0],[0,1],[0,-1]];\n for(let j = 0; j < 4; j++) {\n // get tile\n let xTile = wrapCoords(curShip.x + positions[j][0], curRoom.mapWidth);\n let yTile = wrapCoords(curShip.y + positions[j][1], curRoom.mapHeight);\n\n let curTile = curRoom.map[yTile][xTile]\n\n // check against TASK CONDITIONS\n\n // island discovery; if it's an island, get its index, check if it's already been discovered\n if(isIsland(curTile)) {\n const ind = curTile.island;\n // if it hasn't been discovered, AND it's not an island we're currently discovering (the ship can touch multiple tiles of the same island at once)\n // send a task to discover an island (\"1\"), and send WHICH island we're discovering\n if(!curRoom.islands[ind].discovered && !(ind in islandsWeAlreadyChecked) ) {\n captainTasks.push([1,ind]);\n islandsWeAlreadyChecked[ind] = true;\n }\n }\n\n // dock (if undiscovered, name it; if discovered, you can trade)\n if(hasDock(curTile)) {\n const ind = curTile.dock;\n\n // if the dock hasn't been discovered yet, discover it!\n if(!curRoom.docks[ind].discovered) {\n // send index to captain, including task type (\"3\")\n captainTasks.push([3, ind]);\n } else {\n // send the deal to the captain\n // get the deal\n const deal = curRoom.docks[ind].deal\n\n // send the message type (\"trade with dock\"), the deal, and the dock index\n captainTasks.push([2, { deal: deal, index: ind }]);\n } \n }\n\n // city (if undiscovered, name it; if discovered, you can ask around for clues)\n if(hasCity(curTile)) {\n const ind = curTile.city;\n\n // if the city hasn't been discovered yet, discover it!\n if(!curRoom.cities[ind].discovered) {\n captainTasks.push([4, ind]);\n } else {\n // tell captain that he can \"ask around/look around\"\n captainTasks.push([5, ind]);\n }\n }\n }\n\n // == CARTOGRAPHER STUFF ==\n // Get the map range AND what units are visible\n const tempUpgradeEffects = UPGRADE_EFFECT_DICT[2][curShip.roleStats[2].lvl];\n let mapSize = tempUpgradeEffects.range * 2 + 1;\n let detailLvl = tempUpgradeEffects.detail;\n\n // Loop through these tiles to find all units within them\n // Generate a 2D array with a \"personalized\" view of all the units\n curShip.personalUnits = [];\n let transX = curShip.x - Math.floor(0.5*mapSize), transY = curShip.y - Math.floor(0.5*mapSize);\n \n // The client only needs to know what image to display and where to display it. (Cartographer doesn't even need dock deals, for example.)\n // => The \"where\" is in the \"x\" and \"y\" values\n // => The \"which drawing is it\" is in the index\n // It's created as a flat 1D array, because that is probably more efficient. (There'll probably only be a few units around you, so no need for a large 2D array.)\n\n let enemiesInRange = false;\n for(let y = 0; y < mapSize; y++) {\n for(let x = 0; x < mapSize; x++) {\n // transform coordinates so that our ship is centered\n let xTile = wrapCoords(x + transX, curRoom.mapWidth);\n let yTile = wrapCoords(y + transY, curRoom.mapHeight);\n\n let mapTile = curRoom.map[yTile][xTile];\n\n // TO DO: Based on \"detailLvl\", send more or less info about a particular object (like orientation, last known speed, etc.)\n\n // if this tile has a dock, add it\n // NOTE: The \"index\" parameter here is only used for unique images (right now, all docks and cities look the same)\n if(mapTile.dock != null) {\n let dir = determineSpriteDirection(curRoom, xTile, yTile);\n curShip.personalUnits.push({ myType: 3, index: 0, dir: dir, x: x, y: y });\n }\n\n // if this tile has a city\n if(mapTile.city != null) {\n let dir = determineSpriteDirection(curRoom, xTile, yTile);\n curShip.personalUnits.push({ myType: 4, index: 0, dir: dir, x: x, y: y});\n }\n\n // if this tile has no units (which we keep track of), immediately continue\n if(!mapTile.hasUnits) {\n continue;\n }\n\n // if this tile has ai ships, add them\n if(mapTile.aiShips.length > 0) {\n // send the type of this object AND the drawing index (or \"AI type\")\n for(let aa = 0; aa < mapTile.aiShips.length; aa++) {\n const myIndex = mapTile.aiShips[aa];\n curShip.personalUnits.push({ myType: 2, index: curRoom.aiShips[myIndex].myShipType, x: x, y: y });\n enemiesInRange = true;\n }\n }\n\n // if this tile has monsters, add them\n if(mapTile.monsters.length > 0) {\n for(let aa = 0; aa < mapTile.monsters.length; aa++) {\n const myIndex = mapTile.monsters[aa];\n curShip.personalUnits.push({ myType: 1, index: curRoom.monsters[myIndex].myMonsterType, x: x, y: y });\n enemiesInRange = true;\n }\n }\n\n // if this tile has player ships, add them\n if(mapTile.playerShips.length > 0) {\n for(let aa = 0; aa < mapTile.playerShips.length; aa++) {\n const myIndex = mapTile.playerShips[aa];\n if(myIndex == curShip.num) { continue; } // if this is our own ship, ignore it\n curShip.personalUnits.push({ myType: 0, index: curRoom.playerShips[myIndex].num, x: x, y: y });\n enemiesInRange = true;\n }\n }\n }\n }\n\n // This checks if we can fire or not (and sends the captain that task, if so)\n // If we can see enemies in our vicinity, the fire button appears\n if(enemiesInRange) {\n captainTasks.push([0,0])\n curShip.captainCanFire = true;\n } else {\n curShip.captainCanFire = false;\n }\n\n // add our own ship to personalUnits\n // NOTE: This is done AFTER the previous code, because otherwise we'd need to subtract our own ship there\n // TO DO: Actually, we don't need this. We can just save our own drawing on the client and display our own ship, as we're already sending x and y coordinates\n curShip.personalUnits.push({ myType: 0, index: curShip.num, x: Math.floor(mapSize*0.5), y: Math.floor(mapSize*0.5) });\n\n curShip.captainTasks = captainTasks;\n }\n\n // loop through all players\n for(let playerID in curRoom.players) {\n let curPlayer = curRoom.players[playerID]\n let curShip = curRoom.playerShips[curPlayer.myShip]\n\n let pPack = {}\n\n // if this is the first turn, send the basic info (ship title, flag)\n // Health isn't necessary (always starts at 100%)\n // Instrument level (before upgrades) isn't necessary (all instruments start at level 1)\n if(gameStart) {\n pPack[\"shipTitle\"] = curShip.shipTitle;\n pPack[\"shipFlag\"] = curShip.shipFlag;\n\n pPack[\"config\"] = curRoom.config;\n\n // if preparation was skipped, we need to resend the essential information\n if(curRoom.prepSkip) {\n pPack[\"myShip\"] = curPlayer.myShip;\n pPack[\"myRoles\"] = curPlayer.myRoles;\n }\n } else {\n // on every turn EXCEPT the first, all players receive ship health\n pPack[\"health\"] = curShip.health;\n }\n\n // check this player's roles\n let rList = curPlayer.myRoles;\n for(var i = 0; i < rList.length; i++) {\n let role = rList[i];\n\n switch(role) {\n // Captain\n case 0:\n // replenish crew\n // REMEMBER: curShip.workingCrew is the total crew number \n // => curShip.resources only contains the current resources, with allocated stuff subtracted\n // REMEMBER: peddle crew cost is permanent\n // => Every lvl costs 2 crew, until you \"release\" them \n curShip.resources[1] = (curShip.workingCrew - curShip.roleStats[3].peddleLvl*2);\n\n // (Basic) Ship resources (gold, crew, wood, gun powder)\n pPack[\"resources\"] = curShip.resources;\n\n // List of current tasks\n pPack[\"taskList\"] = curShip.captainTasks;\n\n // List of (feedback) messages\n pPack[\"errorMessages\"] = curShip.errorMessages;\n\n // if we can fire, calculate the cost of firing\n if(curShip.captainCanFire) {\n // without cannoneer, just set crew to the average level of all basic roles\n let cannoneerInGame = false;\n let firingCosts = Math.ceil( (curShip.roleStats[1].lvl + curShip.roleStats[2].lvl + curShip.roleStats[3].lvl + 1) / 3 ); \n\n // if there is a cannoneer in the game, the calculation becomes different\n if(cannoneerInGame) {\n // reduce function calculates the number of cannons (positive loads), multiplies by (half) the current weaponeer value\n let numCannons = curShip.cannons.reduce(function(tot, cur) { if(cur >= 0) { return tot + 1; } else { return tot; } }, 0)\n firingCosts = Math.round((curShip.roleStats[4].lvl + 1) / 2) * numCannons;\n }\n\n pPack[\"firingCosts\"] = firingCosts;\n }\n \n break;\n\n // First Mate\n case 1:\n // Send current ship orientation (and previous orientation), only at game start\n if(gameStart) {\n pPack[\"orientation\"] = curShip.orientation;\n pPack[\"oldOrientation\"] = curShip.orientation;\n }\n \n break;\n\n // Cartographer\n case 2:\n // Only at game start, send initial map information (like the seed and some drawings)\n if(gameStart) {\n pPack[\"mapSeed\"] = curRoom.mapSeed;\n\n // send all drawings in advance (this includes our own ship's drawing)\n // TO DO: AI Ships drawings. (Right now, you can't draw your own AI ship, but that might change)\n pPack['monsterDrawings'] = curRoom.monsterDrawings;\n pPack['shipDrawings'] = curRoom.shipDrawings;\n pPack['aiShipDrawings'] = [];\n }\n\n // send the whole unit thing to the client (determined beforehand in the SHIP LOOP)\n // he saves it in mapUnits, should display it properly on his map\n pPack[\"mapUnits\"] = curShip.personalUnits;\n\n // Send our own location\n // ?? This is also send along with the other units, BUT if we send it ourselves, we don't have to search for it!\n pPack[\"x\"] = curShip.x;\n pPack[\"y\"] = curShip.y;\n break;\n\n // Sailor\n case 3:\n // The sailor DOES need to know the peddle/sail setting => there might have been a crew deficit\n // The client checks if a property starts with \"roleStats\". If so, it gets the corresponding array => [roleNum, property, newValue]\n pPack[\"speed\"] = curShip.speed;\n pPack[\"roleStatsSail\"] = [3, 'sailLvl', curShip.roleStats[3].sailLvl];\n pPack[\"roleStatsPeddle\"] = [3, 'peddleLvl', curShip.roleStats[3].peddleLvl];\n break;\n\n // Cannoneer\n case 4:\n // Send the correct cannon load (just a number, negative means the cannon hasn't been bought yet)\n pPack[\"shipCannons\"] = curShip.cannons;\n break;\n }\n\n // If this role was upgraded last turn, solidify the upgrade (this is true for ALL roles)\n // Send the new level back to the role\n if(curShip.roleStats[role].lvlUp) {\n pPack[\"roleUpdate\" + role] = role;\n curShip.roleStats[role].lvlUp = false;\n }\n }\n\n // send the whole package (to this specific player)\n sendSignal(room, false, 'pre-signal', pPack, true, true, playerID);\n }\n\n // if it isn't the start of the game (which would INSTEAD mean a \"state switch\" to the Play state) ...\n if(!gameStart) {\n // ... tell everyone (both monitors and controllers) to start the new turn\n sendSignal(room, false, 'new-turn', {}, false, false)\n sendSignal(room, true, 'new-turn', {}, false, false)\n }\n\n}", "function draw() {\n if(gameState===\"PLAY\"){\n //giving keyboard controls for ironman\n if (keyDown(\"up\")) {\n ironman.velocityY = -10;\n }\n if (keyDown(\"left\")) {\n ironman.x = ironman.x - 5;\n }\n if (keyDown(\"right\")) {\n ironman.x = ironman.x + 5;\n }\n ironman.velocityY = ironman.velocityY + 0.5;\n\n //calling the functions to generate the objects\n GenerateStone();\n GenerateDiamonds();\n GenerateSpikes();\n\n //making only one object of the group destory if mario touches it\n for (var i = 0; i < stoneGroup.length; i++) {\n var temp = stoneGroup.get(i)\n ironman.collide(temp);\n }\n\n for (var i = 0; i < diamondGroup.length; i++) {\n var temp = diamondGroup.get(i)\n\n if (temp.isTouching(ironman)) {\n score++\n temp.destroy();\n temp = null;\n }\n for (var i = 0; i < spikeGroup.length; i++) {\n var temp = spikeGroup.get(i)\n\n if (temp.isTouching(ironman)) {\n score = score - 5;\n temp.destroy();\n temp = null;\n }\n }\n }\n }\n else if(gameState===\"END\"){\n ironman.velocityY=0;\n spikeGroup.setVelocityXEach(0);\n stoneGroup.setVelocityXEach(0);\n diamondGroup.setVelocityXEach(0);\n diamondGroup.setLifetimeEach(-1);\n stoneGroup.setLifetimeEach(-1);\n spikeGroup.setLifetimeEach(-1);\n }\n \n\n //adding drawsprites to draw the sprites on the screen\n drawSprites();\n\n //giving color and size to the text\n fill(\"white\")\n textSize(25);\n text(\"Score : \" + score, 100, 100);\n}", "function moveAllGhosts() { ghosts.forEach(ghost => moveGhost(ghost))}", "function startsGame() {\n generateMainBoat();\n const intervalRefugees = setInterval(() => {\n if (deathAll >= 750) {\n clearInterval(intervalRefugees);\n endSimulation();\n } else {\n generateRefugees();\n }\n }, 3000);\n }", "function run () {\n var $canvasBox;\n \n $('#newGameLink').removeAttr('disabled'); // can click new game link\n\n if (m.debug > m.NODEBUG) { console.log('screens.gameScreen.run'); }\n \n if (needsInit) {\n \n // disable mouse events on canvas and halt the game loop when we return to the menu\n $('#gameMenuLink')\n .click( function (event) {\n m.playtouch.unhookMouseEvents();\n m.Model.stopGameNow();\n m.Audio.beQuiet();\n m.screens.showScreen('menuScreen');\n });\n \n // shuffle and deal if we ask nicely\n $('#newGameLink')\n .click( function (event) {\n // disallow double-clicks, also disabled in the model while dealing\n if ( $(this).attr('disabled') === 'disabled' ) { return false; } \n $(this).attr('disabled', 'disabled'); \n // if you start a new game before winning, give 'em the not impressed face\n if (m.Settings.getPlaySounds() && !hasWon) {\n m.Sounds.playSoundFor(m.Sounds.QUIT);\n }\n \n // now we play\n setTimeout( function() {\n m.Model.stopGameNow();\n m.screens.showScreen('gameScreen');\n }, m.Settings.Delays.Quit);\n return false;\n });\n \n }\n needsInit = false;\n \n // start the game animation loop\n m.gameloop.setLoopFunction(m.view.refreshDisplay);\n \n // start a new game\n m.view.newGame($('#gameViewBox'));\n \n // hook up event handling\n m.playtouch.hookMouseEvents(); \n\n // resize the game pane if needed after a short delay\n $(window)\n .resize(function (event) {\n setTimeout( function () {\n mikeycell.view.setMetrics();\n }, 500);\n });\n\n }", "function runMyScenes(services) {\n\n var force = services.device.height / 720 * 16; // not responsive here, if screen size changes\n\n setupGamePadDebugTxt(services, force);\n\n var cursor = services.visuals.createCircle()\n .setPosition(Width.HALF, Height.HALF)\n .setColor('#039be5')\n .setLineWidth(Font.get(720, 4))\n .setRadius(Font.get(10));\n\n var direction = {\n x: 0,\n y: 0\n };\n\n services.events.subscribe(Event.GAME_PAD, function (gamePad) {\n direction.x = gamePad.getLeftStickXAxis();\n direction.y = gamePad.getLeftStickYAxis();\n\n var magnitudeSquared = Vectors.squaredMagnitude(direction.x, direction.y); // using squared for performance reasons\n if (magnitudeSquared < deadZoneSquared) {\n direction.x = 0;\n direction.y = 0;\n\n } else {\n var normalized = Vectors.normalizeWithMagnitude(direction.x, direction.y, magnitudeSquared);\n // using squared for performance reasons\n direction.x = normalized.x * ((magnitudeSquared - deadZoneSquared) / (1 - deadZoneSquared));\n direction.y = normalized.y * ((magnitudeSquared - deadZoneSquared) / (1 - deadZoneSquared));\n }\n });\n\n services.events.subscribe(Event.TICK_POST_INPUT, function () {\n cursor.x += Math.round(direction.x * force);\n cursor.y += Math.round(direction.y * force);\n });\n }", "function run(){\n\n\tdescribe(\"UnderseaWorld2\", function(){\n\n\t\tfindXML();\n\t\tparseXML();\n\t\tloadGame();\n\t\tsingleSpin(); // Start by doing a single spin\n\t\tfullGame();\n\t\texpandingTiles();\n\t\tbonusGame();\n\t\tbonusTime();\n\t});\n}", "function drawPlayerPositions() {\r\n for(var i = 0; i < players.length; i++){\r\n var player = players[i];\r\n var x = Math.floor(Math.random() * 5);\r\n var y = Math.floor(Math.random() * 5);\r\n var tile = gameBoard[x][y];\r\n if (player.role === \"Pilot\"){\r\n x = helipadX;\r\n y = helipadY;\r\n tile = gameBoard[x][y];\r\n }else{\r\n while(tile.state === \"sunk\" || tile.children.length > 0 || x == helipadX || y == helipadY){\r\n x = Math.floor(Math.random() * 5);\r\n y = Math.floor(Math.random() * 5);\r\n tile = gameBoard[x][y];\r\n }\r\n }\r\n tile.addChild(player.sprite);\r\n player.x = x;\r\n player.y = y;\r\n player.initValidActionTiles();\r\n player.calculateValidMoveTiles(player.x, player.y, player.validMoveTiles);\r\n player.calculateValidNavigatorTiles();\r\n player.calculateValidShoreTiles();\r\n player.calculateValidGiveTargets();\r\n }\r\n}", "spawn() {\n this.x = getRandomInt(0, 25) * this.grid;\n this.y = getRandomInt(0, 25) * this.grid;\n }", "function gameInit(){\n ctx.clearRect(0, 0, canvas.width,canvas.height);\n laberinto2.forEach(component=>{\n component.dibujar();\n heroe.checkCollision(component)\n \n })\n \n elements[0].draw()\n \n bordes.forEach(component=>{\n component.dibujar();\n })\n heroe.draw()\n // llave1.draw()\n// gemelas.draw()\n enemies.forEach(enemigo => {\n enemigo.draw()\n })\n gemelas.frameX++\n gemelas.frameX >= 5 ? gemelas.frameX = 0 : null;\n gemelas.newPos()\n gemelas.movimiento()\n heroe.checkCollision(gemelas)\n heroe.draw()\n heroe.frameX++\n heroe.frameX >= 5 ? heroe.frameX = 0 : null;\n \n }", "function draw() {\n // menggambar dicanvas sekaligus aksi\n drawShip();\n drawEnemy();\n drawPeluru();\n \n // aksi tembak\n tembak();\n \n // update score & lives board\n update();\n}", "function movePacMan(spaces) {\n squares[currentPacManIndex].classList.remove(\"pacman\")\n\n if (layout[currentPacManIndex + spaces] !== 1) {\n \n currentPacManIndex += spaces\n \n } else if ( (currentPacManIndex === 364) && (spaces === -1) ) {\n\n currentPacManIndex = 391\n\n } else if ( (currentPacManIndex === 391) && (spaces === 1) ) {\n\n currentPacManIndex = 364\n }\n\n squares[currentPacManIndex].classList.add(\"pacman\")\n updatePositionDisplay()\n}", "function Start () {\n\tsetSpawnPositions();\n}", "function moveGhost(ghost) {\n const directions = [-1, +1, -width, +width]\n let direction = directions[Math.floor(Math.random() * directions.length)]\n\n ghost.timerId = setInterval(function() {\n //if the next square does NOT contain a wall and does not contain a ghost\n if (\n !squares[ghost.currentIndex + direction].classList.contains('wall') &&\n !squares[ghost.currentIndex + direction].classList.contains('ghost')\n ) {\n //remove any ghost\n squares[ghost.currentIndex].classList.remove(ghost.className)\n squares[ghost.currentIndex].classList.remove('ghost', 'scared-ghost')\n // //add direction to current Index\n ghost.currentIndex += direction\n // //add ghost class\n squares[ghost.currentIndex].classList.add(ghost.className) \n squares[ghost.currentIndex].classList.add('ghost') \n } else direction = directions[Math.floor(Math.random() * directions.length)]\n\n //if the ghost is currently scared \n if (ghost.isScared) {\n squares[ghost.currentIndex].classList.add('scared-ghost')\n }\n \n //if the ghost is current scared AND pacman is on it\n if (ghost.isScared && squares[ghost.currentIndex].classList.contains('pacman', 'pacman-down', 'pacman-up', 'pacman-left', 'pacman-right')) {\n //remove classnames - ghost.className, 'ghost', 'scared-ghost'\n squares[ghost.currentIndex].classList.remove(ghost.className, 'ghost', 'scared-ghost')\n // change ghosts currentIndex back to its startIndex\n ghost.currentIndex = ghost.startIndex\n //add a score of 100\n score +=300\n scoreDisplay.innerHTML = score;\n if(scoreFromLocalStorage < score) {\n highestScoreDisplay.textContent = score\n localStorage.setItem(\"highestPacmanScore\", score)\n }\n //re-add classnames of ghost.className and 'ghost' to the ghosts new postion \n squares[ghost.currentIndex].classList.add(ghost.className, 'ghost')\n }\n checkForGameOver()\n }, ghost.speed )\n}", "function startGame() {\n if (props.mapObj) {\n setGameRunning(true);\n let inVermont = false;\n let randLat = 0;\n let randLong = 0;\n while (!inVermont) {\n //did I mix up lat and long? I feel like I mixed up lat and long. It works though so if I did I did it consistently at least?\n randLat = (Math.random() * 2 + 71.5) * -1; //-73.5 to -71.5\n randLong = Math.random() * 3.4 + 41.7; //45.1 to 41.7\n inVermont =\n leafletPip.pointInLayer([randLat, randLong], geoJSON(borderData))\n .length > 0;\n }\n props.setMark([randLong, randLat]);\n setLat(randLat);\n setLong(randLong);\n props.mapObj.setView([randLong, randLat], 18);\n setViewLat(randLat);\n setViewLong(randLong);\n setDisplayLat(\"???\");\n setDisplayLong(\"???\");\n setDisplayCounty(\"???\");\n setDisplayTown(\"???\");\n setScore(100);\n setShouldUpdate(true);\n }\n }", "async function startProgram() {\n await registerBolt();\n playMatrixAnimation(boltId - 1);\n while (running) {\n await getNextMove();\n await delay(0.1);\n }\n exitProgram();\n}", "function pregame() {\r\n updateUIVariables();\r\n\r\n drawPregame();\r\n\r\n animation = requestAnimationFrame(pregame);\r\n\r\n if (spacePressed) {\r\n drawBackground(true);\r\n drawHealth(true, health);\r\n drawScore(true, score);\r\n drawPlayer(true, playerYposition);\r\n drawBorder(true);\r\n cancelAnimationFrame(animation);\r\n animation = requestAnimationFrame(() => tick(Date.now()));\r\n setSpacePressed(false);\r\n }\r\n}", "function startUp() {\r\n clearMaze();\r\n clearBread();\r\n clearPath();\r\n\r\n score = 0;\r\n check = 0;\r\n totalTime = 0;\r\n breadArray = [];\r\n pathArray = [];\r\n\r\n // Hide the bread canvas and path canvas\r\n document.getElementsByClassName('bread')[0].style.visibility = 'hidden';\r\n document.getElementsByClassName('path')[0].style.visibility = 'hidden';\r\n\r\n bPressed = false;\r\n pPressed = false;\r\n hPressed = false;\r\n gameOver = false;\r\n }", "function draw() {\n image(galaxy, 0, 0);\n rocket.show();\n rocket.update();\n\n //checks if there should be more meteors, if so, it makes them spawn more\n \n \n \n \n\n //adds a meteor to the screen after every meteorFrequency frames\n if (frameCount % meteorFrequency == 0 && !gameOver && start) {\n meteors.push(new Meteor());\n } //adds distance every 25 frames\n if (frameCount % 25 == 0 && !gameOver && start) {\n distance += rocketSpeed;\n }\n\n //loop to show and move every meteor\n for (var i = meteors.length - 1; i >= 0; i--) {\n meteors[i].show(); //drawing the meteor\n meteors[i].update(); // moving the meteor\n\n //checking if the meteor hits the rocket, and acts accordingly\n if (meteors[i].hits(rocket)) {\n textFont(bodyType);\n textAlign(CENTER);\n textSize(100);\n text(\"HIT\", width/2, height/2);\n //hitSound.play();\n meteors[i].y = height + 32; //moves the meteor off screen\n if (!gameOver) {\n lives = lives - 1;\n hitCount++;\n }\n if (lives <= 0) {\n gameOver = true;\n }\n //meteorSpeed = 2;\n }\n\n if (meteors[i].offscreen()) {\n meteors.splice(i, 1);\n meteorCount++;\n //speedier();\n console.log(\"meteor count\" + meteors.length);\n }\n }\n // I requested to join\n // join mine\n //draws all the stats and the title on the screen\n textFont(bodyType);\n textSize(20);\n textAlign(CORNER);\n text(`Distance : ${distance} miles`, 20, 20);\n text(`Lives : ${lives}`, 20, 40);\n if(!start){ //directions at the beggining of the game\n textAlign(CENTER);\n text(\"Greetings Space Commander, your mission is to \", width/2, height/2-90);\n text(\"orbit Planet Noche Morada .\", width/2, height/2-75);\n \n text('Press m to mute', width/2, height/2 - 40);\n text('Use left and right arrow keys to move', width/2, height/2 - 20);\n text('Avoid meteors at all cost', width/2, height/2);\n text('Your ship will regain 1 health at the end \\n of each stage', width/2, height/2 + 20);\n \n text('Press the SpaceBar to Start', width/2, height - 150);\n text(\"Goodluck Commander.\", width/2, height-170);\n \n textAlign(CORNER);\n }\n //if game is over, display game is over text\n \n if (rocket.checkWin()) {\n if(frameCount % 303 == 0 && !won){\n setTimeout(restart, 1000);\n }\n \n else{\n textAlign(CENTER);\n textSize(30);\n textFont(titleType);\n if (stage != finalStage){\n text(`Stage ${stage} Complete`, width / 2, height / 2 + 20);\n textSize(15);\n text(`Stage ${stage +1} Incoming`, width / 2, height / 2 + 60);\n }\n textAlign(CORNER);\n }\n }\n else if (gameOver) {\n textAlign(CENTER);\n textSize(30);\n textFont(titleType);\n text(\"Game Over\", width / 2, height / 2);\n displayStats();\n } \n if (won){ //text drawn if player finishes the game\n imageMode(CENTER);\n image(planet, width/2, height/2);\n \n textAlign(CENTER);\n textSize(25);\n textFont(titleType);\n text('Great Job space commander', width/2, height/2);\n textSize(30);\n text('You made it', width/2, height/2 + 20);\n displayStats();\n }\n \n textAlign(CORNER);\n textFont(titleType);\n textSize(30);\n text('Rocket Ship', 180, 25);\n \n \n} // end of draw function" ]
[ "0.6717358", "0.66068244", "0.65489066", "0.6534558", "0.6533208", "0.6519098", "0.6515385", "0.650819", "0.64338875", "0.64247084", "0.6407802", "0.6381072", "0.63471395", "0.63459855", "0.63393193", "0.6332745", "0.63316184", "0.6319234", "0.631174", "0.6307115", "0.6300518", "0.62947816", "0.62822074", "0.6271885", "0.6270686", "0.62612903", "0.62526685", "0.62396544", "0.62119514", "0.62005556", "0.6198811", "0.61840516", "0.61694324", "0.61415607", "0.61403674", "0.6120175", "0.6089078", "0.6088013", "0.60865307", "0.60813934", "0.60796756", "0.60773736", "0.60731477", "0.60467374", "0.6044764", "0.604298", "0.6032221", "0.6021942", "0.6017888", "0.6011154", "0.6011024", "0.60070044", "0.6001892", "0.5998714", "0.59916246", "0.5985385", "0.59782994", "0.59734654", "0.5970585", "0.5969921", "0.59683466", "0.5962852", "0.59510607", "0.594499", "0.5939769", "0.5936299", "0.5923209", "0.5917944", "0.59143865", "0.5909123", "0.5904472", "0.5903661", "0.5897702", "0.5896926", "0.5893709", "0.58903915", "0.5887356", "0.58865803", "0.5884849", "0.58813304", "0.5874652", "0.58730173", "0.5870646", "0.5869327", "0.5868998", "0.58687395", "0.58665204", "0.58648413", "0.5862237", "0.58473295", "0.58461267", "0.5832555", "0.58325416", "0.5831958", "0.5822414", "0.5821254", "0.5819294", "0.5815672", "0.5809951", "0.5808997", "0.5803297" ]
0.0
-1
Executes every time the 'valid' event is triggered
function youtubeValid(t){// t = this if(t.getValue() != ""){ var videoInfo = getYoutubeVideoInfo(t.getValue()); //returns a string containing the selected video's information var videoInfoObject = parseJson(videoInfo.body); //convert from a string to an XML Object var secondsString = videoInfoObject.entry.media$group.yt$duration.seconds;//get the 'seconds' attribute we need var seconds = parseInt(secondsString); var time = formatTime(seconds); //converts the video duration (in seconds) to the desired format var title = videoInfoObject.entry.title.$t;//get the video title var container = t.findParentByType("dialogfieldset"); var youtubeDuration = container.getComponent("duration"); // the 'duration' widget var youtubeDurationLabel = container.getComponent("durationLabel"); // the 'duration label' widget var youtubeVideoName = container.getComponent("videoName"); // the 'videoName' widget var youtubeVideoNameLabel = container.getComponent("videoNameLabel"); // the 'videoName' widget youtubeDuration.setValue(time); youtubeDurationLabel.setText(time); youtubeVideoName.setValue(title); youtubeVideoNameLabel.setText(title); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "afterValidChange() { }", "validateInit() {\n this.runValidation(true);\n }", "function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "function validCycle(event) {\n update(event);\n validOrNot(event);\n validForm(event);\n}", "function valid(){return validated}", "function validation() {\r\n\t\t\r\n\t}", "function setIsValid(calEvent){\n calEvent.is_valid = isValid(calEvent)\n}", "function detectValidationChanges() {\n var intervalFunc = function() {\n //if user hasn't clicked the \"book\" button, then we are not ready to show validation messagnig\n if (!vm.showValidations) return;\n\n //validate\n vm.validate();\n };\n $interval(intervalFunc, 1000, 0, true);\n }", "checkValidity(event) {\n event.preventDefault();\n\n this.attemptedSave = true;\n\n if (this.$v.$invalid) {\n console.log(\"something is invalid\", this.$v);\n } else {\n console.log(\"all good!\");\n this.saveFieldForm(event);\n\t\t\t\t}\n\n }", "selfValidate(){\n\n }", "checkIsValid() {\n if (!this.isValid) {\n this.errors.push({\n field: this.fieldName,\n message: this.message,\n valueRecieved: this.fieldValue,\n });\n }\n }", "_validate() {\n\t}", "validate()\n {\n if (this.dirty)\n {\n this.updateText();\n this.dirty = false;\n }\n }", "valid() {\r\n return true\r\n }", "function runValidation() {\n nameVal();\n phoneVal();\n mailVal();\n}", "validate() { }", "_markAsValid() {\n\t this.$points.find('.point').removeClass('has-error');\n\t }", "function validateCheck() {\n\n setActivityCardRules($scope.cardRules.value());\n setSpecialUsePackages($scope.specialPackages.value());\n generateCodeAuto();\n service.validate($scope.activity).success(function () {\n $scope.save();\n }).error(function (error) {\n console.log('error -> ', error);\n });\n }", "function validate(event) {\n event.preventDefault()\n removeErrorMessage()\n removeValidMessage()\n\n validForm = true\n validateName()\n validateCarYear()\n validateCarMake()\n validateCarModel()\n validateStartDate()\n validateDays()\n validateCard()\n validateCvv()\n validateExpiration()\n\n showValidMessage()\n}", "isValidated() {\n\t\tif (this.currentStage.currentState.isValidated()) {\n\t\t\tthis.log(\"Progressing\");\n\t\t\tthis.progressGameMode();\n\t\t}\n\t}", "_revalidate() {\n if (this._startInput) {\n this._startInput._validatorOnChange();\n }\n if (this._endInput) {\n this._endInput._validatorOnChange();\n }\n }", "_revalidate() {\n if (this._startInput) {\n this._startInput._validatorOnChange();\n }\n if (this._endInput) {\n this._endInput._validatorOnChange();\n }\n }", "validate() {\n if (this.isDisposed) {\n return;\n }\n this._invalidated = false;\n this._lastArgs = [];\n }", "validate() {}", "function inlineValidate(evt) {\n\t\tvar el = evt.target,\n\t\t\thasValid = CL.contains(el, 'isValid'),\n\t\t\thasInvalid = CL.contains(el, 'invalid'),\n\t\t\tisValid;\n\n\t\tif (el.willValidate && (hasValid || hasInvalid)) {\n\t\t\tisValid = el.checkValidity();\n\n\t\t\tif (isValid && hasInvalid || !isValid && hasValid) {\n\t\t\t\tsetState(el, isValid);\n\n\t\t\t\tif (isValid) {\n\t\t\t\t\tcloseBubble(el);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "preValidate() { }", "function next(){\n validate();\n}", "function next(){\n validate();\n}", "function isValid(event) {\n event.preventDefault();\n\n verifFirst();\n verifLast();\n verifMail();\n verifDate();\n quantityVerif();\n verifCity();\n verifConditions();\n newsLetter();\n\n if (\n \n validFirst === true &&\n validMail === true &&\n validDate === true &&\n validQuantity === true &&\n validCity === true &&\n validConditions === true\n ) \n \n // retour des valeurs entrée par l'utilisatteur dans un tableaux clefs valeurs \n {\n let datas = new FormData(form);\n for (let i of datas.entries()) {\n console.log(i[0], \":\", i[1]);\n }\n\n validationOk.style.display = \"flex\";\n }\n}", "whenValid() {\n\n }", "runValidation() {\n try {\n var formItem = this.scope['exprForm']['literal'];\n if (formItem.$viewValue) {\n formItem.$setViewValue(formItem.$viewValue);\n formItem.$$parseAndValidate();\n }\n } catch (e) {\n }\n }", "function realtimeValidation() {\n if (lastChanged) {\n /* Get current error(s) for the currently edited field */\n const newError = checkFormValidity()[lastChanged];\n updateErrors(errors, lastChanged, newError);\n }\n }", "function FireDateRangeValidator() {\n ValidatorValidate($(dateRangeValidator));\n }", "function validationBegins()\n {\n if (validationInProgress)\n throw new Error(\"Internal error: Validation is already in progress\");\n\n validationInProgress = true;\n }", "onChange() {\n this.validate();\n this.triggerContextUpdate();\n }", "valid() {\n return true\n }", "fireValidityEventIfNecessary() {\n const previousValidity = this.formValidity_;\n this.formValidity_ = this.checkFormValidity(this.form);\n if (previousValidity !== this.formValidity_) {\n const win = getWin(this.form);\n const type = this.formValidity_ ? FormEvents.VALID : FormEvents.INVALID;\n const event = createCustomEvent(win, type, null, {bubbles: true});\n this.form.dispatchEvent(event);\n }\n }", "function next(){\n\tvalidate();\n}", "function next(){\n\tvalidate();\n}", "function validate() {\r\n\r\n\r\n \r\n // set the progress of the background\r\n progress.style.width = ++position * 100 / questions.length + 'vw'\r\n\r\n // if there is a new question, hide current and load next\r\n if (questions[position]) hideCurrent(putQuestion)\r\n else hideCurrent(done)\r\n \r\n \r\n\r\n }", "validate() {\n // Als NIET (!) valide, dan error weergeven\n if (!this.isValid()) {\n this.showError();\n console.log(\"niet valide\");\n }\n else\n this.hideError();\n }", "onValidationRequest() {\n\n\t\t\t// Simple validation - check if there are any inputs with errors\n\t\t\tvar errors = $(\".sapMInputBaseContentWrapperError\").length,\n\t\t\t\tresult = errors === 0;\n\n\t\t\t// Raise the response event back to the consumer\n\t\t\tsap.ui.getCore().getEventBus().publish(\"codan.zUrgentBoard\", \"validationResult\", {\n\t\t\t\tresult: result\n\t\t\t});\n\t\t}", "function formValidation() {\n $(selectors.name).on('change', nameValidate);\n $(selectors.contactNo).on('change', contactValidate);\n $(selectors.email).on('change', emailValidate);\n $(selectors.submit).on('click', validation);\n }", "function setValidity(validity) {\n this.isFormValid = validity;\n $scope.$emit('sit-property-grid.validity-changed', { id: $scope.id, validity: validity }); //To notify parent\n\n if (this.isFormValid && arr.length > 0) {\n $scope.$emit('sit-property-grid.validity-changed', { id: $scope.id, validity: vm.isFormValid, dirty: false });\n }\n else if (this.isFormValid === false) {\n $scope.$emit('sit-property-grid.validity-changed', { id: $scope.id, validity: vm.isFormValid, dirty: true });\n }\n }", "function execute () {\n// document.getElementById(\"message\").addEventListener(\"change\", cleanError);\n// document.getElementById(\"country\").addEventListener(\"change\", cleanError);\n// document.getElementById(\"email\").addEventListener(\"change\", cleanError);\n// document.getElementById(\"name\").addEventListener(\"change\", cleanError);\n document.getElementById(\"form\").addEventListener(\"submit\", validate);\n }", "function checkValid(result) {\n\t\t\tif(!result) {\n\t\t\t\tself.isValid = false;\n\t\t\t} else {\n\t\t\t\tself.isValid = true;\n\t\t\t}\n\t\t}", "enqueueDocumentValidation() {\n if (this['enqueued'] || !validateFn) {\n return;\n }\n this['enqueued'] = true;\n documentWait(validateFn);\n }", "function data_valid() {\n\t\tif (validName === true && validTime === true && validDuration === true && validTestpaper === true && validGroup === true) {\n\t\t\tsubmit.style.backgroundColor = '#4CCABD';\n\t\t\tsubmit.disabled = false;\n\t\t} else {\n\t\t\tsubmit.style.backgroundColor = 'grey';\n\t\t\tsubmit.disabled = true;\n\t\t}\n\t\tdocument.getElementById('time_invalid').innerHTML = validName + ',' + validTime + validDuration + validTestpaper + validGroup;\n\t}", "function validateSubscription(){\n\n // validate specific form elements when keyup fires\n // if all of the below are fully validated then the code blocde will execute\n\n /* separate verifiable items for batch logic\n\n * combining this logic into a simple (one && two && three) wont be feasable\n * because two and three wont evaluate unless one is also true. This is why\n * all of the verifications must be evaluated prior to comparison */\n\n var vName, vMail, vPhone;\n\n var _RS = {verify: 'required', msgFailed: ''}; // shorthand so it takes up less memory\n\n vName = TMvalidator.validateField(subName, [\n _RS,\n {verify: 'full-name-display'},\n {verify: 'length', min: 1, max: 50}\n ], subNameMsg);\n\n vMail = TMvalidator.validateField(subEmail, [\n _RS,\n {verify: 'email'}\n ], subEmailMsg);\n\n vPhone = TMvalidator.validateField(subPhone, [\n _RS,\n {verify: 'phone'}\n ], subPhoneMsg);\n\n if (vName && vMail && vPhone){\n // if all of the above are validated then the form will be submittable\n return true;\n } else {\n return false;\n }\n }", "function validate(){\r\n\tvar validableForms = $(\".validableForm\");\r\n\tfor(var i=0;i<validableForms.length;i++){\r\n\t\t$(validableForms[i]).validationEngine({promptPosition : \"bottomLeft\"\r\n\t\t\t , scroll: false});\r\n\t}\r\n}", "function validate(inst, validation) {}", "forceValidate() {\n this.setValue(this.getValue());\n }", "function setValidationState(evt) {\n\t\tvar el = evt.target;\n\n\t\t// [DD] Here we set 'isValid' also on elements with no constraints. Is this correct?\n\t\tif (el.willValidate /*&& hasConstraints(el)*/) {\n\t\t\tsetState(el, el.checkValidity());\n\t\t}\n\t}", "update() {\n if (!this.valid) {\n if (this.width > 0 && this.height > 0) {\n this.valid = true;\n this.dispatchEvent(Event_1.Event.getEvent(\"loaded\"));\n this.dispatchEvent(Event_1.Event.getEvent(\"update\"));\n // this.emit('loaded', this);\n // this.emit('update', this);\n }\n }\n else {\n this.dirtyId++;\n this.dirtyStyleId++;\n this.dispatchEvent(Event_1.Event.getEvent(\"update\"));\n // this.emit('update', this);\n }\n }", "_onSubmitValidateInputs() {\n\t\tthis.setState({ inputDirty: true });\n\t\tlet validationValue = this._validateInputFeild(this.state.inputStateKey);\n\t\tthis.setState({ isValidInput: validationValue.test, invalidMessage: validationValue.test ? '' : validationValue.message })\n\t\tif (this.props.inputChanged) {\n\t\t\tthis.props.inputChanged(this.props.inputStateKey, this.state.inputStateKey, this.state.isValidInput)\n\t\t}\n\t}", "validationDidStart(requestContext) {\n console.log('Validation Started!')\n }", "validateInscription() {\n \n }", "onInvalid(errors) {\n console.log(errors);\n }", "checkValidity() {\n const { valid } = this.checkValidityAndDispatch();\n return valid;\n }", "isValid() {\n return true;\n }", "isValid() {\n return true;\n }", "enqueueDocumentValidation() {\n if (this['enqueued'] || !validateFn) {\n return;\n }\n\n this['enqueued'] = true;\n (0, _documentWait.default)(validateFn);\n }", "reportValidity() {\n return this.checkValidity();\n }", "validateAllDirty () {\n for (let fieldID of Object.keys(this.fields)) {\n let field = this.fields[fieldID]\n\n if (field.dirty) {\n field.validate()\n }\n }\n }", "onNext() {\n\t\tconst validationRes = this.validate();\n\n\t\tif (validationRes === undefined) {\n\t\t\tthis.props.onNext();\n\t\t} else {\n\t\t\tthis.props.ui.showErrorAlert(\n\t\t\t\tthis.t('errors.invalidFieldsAlert.title'),\n\t\t\t\tthis.t('errors.invalidFieldsAlert.message')\n\t\t\t);\n\t\t}\n\t}", "validateAll () {\n for (let fieldID of Object.keys(this.fields)) {\n this.fields[fieldID].validate()\n }\n }", "function setValidCheck(check){\n check.valid = 1;\n check.msg = \"Good!\"; \n }", "function setValidations() {\n\tvalidationColumn();\n\tvalidationRow();\n\t// Si hay dulces que borrar\n\tif ($('img.delete').length !== 0) {\n\t\tdeletesCandyAnimation();\n\t}\n}", "function onValidation() {\n\tclearErrors();\n\n\tvar allValidReq = checkRequiredFields();\n\tvar allValidDob = true;\n\tif ($.inArray(\"dob\", getRequiredFields()) > 0)\n\t{\n\t\tallValidDob = checkValidDob();\n\t}\n\t\n\tvar allValidNames = checkValidNames();\n\n\tif ($(\"#usSocialSecurityNumber\").length) {\n\t\tallValidNames = allValidNames && checkSSN();\n\t}\n\t\n\tvar allValidAddress = true;\n\tif (countryIsUSA()) {\n\t\tallValidAddress = checkValidUSAAddress();\n\t}\n\t\n\treturn allValidReq && allValidDob && allValidNames & allValidAddress;\n}", "function validate() {\n $('.validate').each(function () {\n if ($(this).val() != '') {\n checkValid(this);\n }\n });\n}", "validation() {\r\n let verifieNom = document.getElementById('name');\r\n let verifiePrenom = document.getElementById('firstname');\r\n let lack = document.getElementById('lack_name');\r\n let encart = document.getElementById('info_station');\r\n let regex = /^[a-zA-ZéèîïÉÈÎÏ][a-zéèêçîï]+([-'\\s][a-zA-ZéèîïÉÈÎÏ][a-zéèêçîï]+)?/;\r\n this.stocker.addEventListener('click', (e) => {\r\n e.preventDefault();\r\n if (verifieNom.validity.valueMissing || verifiePrenom.validity.valueMissing) {\r\n e.preventDefault();\r\n lack.style.display = 'block';\r\n lack.textContent = 'veuillez remplir les champs';\r\n lack.style.backgroundColor = '#FF0000';\r\n lack.style.color = '#ffffff';\r\n this.canvas.style.visibility = 'hidden';\r\n this.validCanvas.style.visibility = 'hidden';\r\n }else if (regex.test(verifieNom.value) == false) {\r\n e.preventDefault();\r\n lack.style.display = 'block';\r\n lack.textContent = 'Format invalide';\r\n lack.style.backgroundColor = '#FF0000';\r\n lack.style.color = '#ffffff';\r\n this.canvas.style.visibility = 'hidden';\r\n this.validCanvas.style.visibility = 'hidden';\r\n }else if (regex.test(verifiePrenom.value) == false) {\r\n e.preventDefault();\r\n lack.style.display = 'block';\r\n lack.textContent = 'Format invalide';\r\n lack.style.backgroundColor = '#FF0000';\r\n lack.style.color = '#ffffff';\r\n this.canvas.style.visibility = 'hidden';\r\n this.validCanvas.style.visibility = 'hidden';\r\n }else { \r\n lack.style.display = 'none';\r\n encart.style.display = 'none';\r\n this.info_carte.innerHTML = 'Signez et validez votre réservation';\r\n this.info_carte.style.backgroundColor = \"#FFA500\";\r\n this.canvas.style.visibility = 'visible';\r\n this.validCanvas.style.visibility = 'visible';\r\n this.clearCanvas();\r\n }\r\n });\r\n }", "_validate(initialValidation, programmaticValue, keyCode) {\n const that = this,\n oldValue = that.value;\n\n that._validateValue(programmaticValue);\n\n if (keyCode && (keyCode === 35 || keyCode === 36)) {\n that._animate(oldValue);\n }\n else {\n that._updatePointer();\n }\n }", "checkValidity(context, event) {\n throw new Error('Implement in subclass');\n }", "checkValidity(context, event) {\n throw new Error('Implement in subclass');\n }", "async validate() {\n return true\n }", "async validateEverything() {\n const runningValidators = [];\n\n this.validators.forEach(function (validator) {\n if (validator == BoundValidator) {\n validator = new validator(this.fragment)\n } else if (validator == OLCValidator) {\n validator = new validator(this.bpmnObject, this.olc)\n } else if (validator == DataObjectReferenceValidator) {\n validator = new validator(this.fragment.preconditions, this.olc);\n } else if (validator == ThrowEventValidator) {\n validator = new validator(this.bpmnObject, this.dm)\n } else {\n validator = new validator(this.bpmnObject);\n }\n runningValidators.push(validator.validateEverything());\n }.bind(this));\n\n const resolvedValidators = await Promise.all(runningValidators);\n resolvedValidators.forEach(function (validatorResult) {\n this.messages = this.messages.concat(validatorResult);\n }.bind(this));\n }", "update() {\n this._checkEvents();\n }", "validateForm() {\n this.setState({ formValid: this.state.titleValidExist && this.state.titleValidLength && this.state.yearValid && this.state.runtimeValid && this.state.genreValid && this.state.directorValid });\n }", "function validate() {\n handle_enter();\n}", "formChanged() {}", "validationSuccessChanged(newValue){if(newValue!=null && newValue!=undefined && this._link!==null){ this._link.attachValidationSuccess(newValue);}}", "function alsoValidate() {\n const { hasError, error } = validateURL(e.target.value)\n onUpdate(idx, e.target.value, hasError, error)\n }", "function setValidationPending( newValue ) {\n axInputController.validationPending = newValue;\n }", "function validatePage(){\n\tif(controller == 'shop/'){\n\t$.valid = true;\n\t\t$('div.addressSection').children('div').each(function(){\n\t\t\t$(this).trigger('validate');\n//\t\t\talert('$.valid is '+$.valid);\n\t\t\tif($.valid == false){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t})\n\t\treturn true;\n\t}\n}", "get validateAll () {\n\t\treturn true;\n\t}", "get validateAll () {\n\t\treturn true;\n\t}", "get validateAll () {\n\t\treturn true;\n\t}", "function validationReady(item) {\n return queuedValidation.then(() => item, () => item)\n }", "function verifyForm()\n{\n valid = true;\n validFields.forEach(function(element) { valid &= element });\n changeFormState(valid);\n}", "function Validar(){\r\n error.innerHTML=\"\";\r\n\r\n ValidarNombre();\r\n ValidarCategoria();\r\n ValidarPrecio();\r\n ValidarCantidad();\r\n}", "validate() {\n if (this.proxy instanceof HTMLElement) {\n this.setValidity(this.proxy.validity, this.proxy.validationMessage);\n }\n }", "isValid(): boolean {\n return this.innerComponent.isValid();\n }", "validationSuccessChanged(newValue){if(newValue!=null && newValue!=undefined && this._messageitem!==null){ this._messageitem.attachValidationSuccess(newValue);}}", "function validar(){\n\tif(valido){console.log(\"todo piola\");}\n}", "checkValidity() {\n if (this.inputElement.validate) {\n return this.inputElement.validate();\n }\n }", "validate() {\n this.errorMessage = \"Dit is geen text\";\n super.validate();\n }", "validateList() {\n if (!this.isValid) {\n return;\n }\n\n for (let i = 0; i < this._data.length; i++) {\n const item = this._data[i];\n\n this._validateItem(item);\n }\n }", "beforeValidation(callback) {\n\t\tcallback();\n\t}", "function valid() {\n $(\"input\").keyup(function () {\n var thisInput = $(this).val();\n if(thisInput > 12){\n $(this).css('color','red');\n $(this).tooltip('show',{ placement: \"right\" });\n $(this).blur(function(){\n $(this).tooltip('hide');\n });\n }else{\n $(this).css('color','black');\n $(this).tooltip('hide');\n }\n })\n }", "function validate() {\r\n\t\tif (clickablecells.length == MINES) {\r\n\t\t\tstopTimer();\r\n\t\t\tmessageDiv.addClass('winMessage').html(WIN_MESSAGE);\r\n\t\t\t\r\n\t\t\t// Show mines\r\n\t\t\t$('.clickable').each(function() {\r\n\t\t\t\tvar cell = $(this);\r\n\t\t\t\tshowCell(getId(cell), cell, 'x', true);\r\n\t\t\t});\r\n\t\t}\r\n\t}", "function validate(inst, validation)\r\n{\r\n if ($super.validate) {\r\n $super.validate(inst, validation);\r\n }\r\n}" ]
[ "0.69794214", "0.6794825", "0.6725379", "0.6481961", "0.64757246", "0.64694375", "0.64613706", "0.6414585", "0.63441443", "0.6330273", "0.6252113", "0.62486815", "0.6235717", "0.6234934", "0.6225729", "0.6206375", "0.6145285", "0.61396706", "0.61360955", "0.6103722", "0.6091837", "0.6091837", "0.6084193", "0.6075307", "0.6072084", "0.6004117", "0.59970707", "0.59970707", "0.59948957", "0.59815013", "0.5979361", "0.59681547", "0.5947171", "0.5943954", "0.59082174", "0.59024906", "0.58780074", "0.5873711", "0.5873711", "0.58713406", "0.5865208", "0.5856033", "0.5803887", "0.5793481", "0.5789329", "0.5779937", "0.57785255", "0.5771449", "0.57340986", "0.5729948", "0.572137", "0.569051", "0.56887", "0.5682847", "0.5682798", "0.56736976", "0.5643118", "0.5626937", "0.5624879", "0.56239295", "0.56239295", "0.55939746", "0.5592936", "0.5582867", "0.55625504", "0.5562407", "0.55505216", "0.55449367", "0.55420053", "0.5531746", "0.55307317", "0.5527606", "0.5525537", "0.5525537", "0.5517199", "0.55159265", "0.5492335", "0.54836154", "0.5481821", "0.5468484", "0.5468183", "0.54580605", "0.54461217", "0.544181", "0.5435008", "0.5435008", "0.5435008", "0.54321694", "0.54264706", "0.5424707", "0.54239076", "0.54211783", "0.54143274", "0.5411908", "0.54032356", "0.54012114", "0.5398335", "0.539707", "0.5382967", "0.538097", "0.53768283" ]
0.0
-1
converts a string into an Json Object
function parseJson(json){ eval('var data =' + json); return data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toObject(str) {\n return gadgets.json.parse(str);\n}", "function toObject(str) {\n return gadgets.json.parse(str);\n}", "function str2JSON(str){\n\treturn JSON.parse(str);\n}", "function json2obj(str)\n{\n return eval('(' + str + ')');\n}", "function jsonToObj(str) {\n\t\tif (!$.isString(str)) { return str; }\n\t\t// Fix. Complete these checks.\n\t\tvar obj = JSON.parse(str);\n\t\treturn $.isPlainObject(obj) ? obj : str;\n\t}", "parseJsonToObject(str) {\n try {\n return JSON.parse(str);\n }\n catch(e) {\n return {};\n }\n }", "function toObject( str ) {\n try {\n return JSON.parse( str );\n } catch ( err ) {\n return null;\n }\n}", "getJsonObject(str){\n\n let newstr = str.replace(/=/g, \"\\\" : \\\"\").replace(/&/g, \"\\\" , \\\"\");\n newstr = \"{ \\\"\" + newstr + \"\\\" }\";\n return JSON.parse(newstr);\n\n }", "function jsonize(str) {\n try {\n JSON.parse(str);\n return str;\n }\n catch (e) {\n return str\n .replace(/([\\$\\w]+)\\s*:/g, // wrap keys without double quote\n function (_, $1) {\n return '\"' + $1 + '\":';\n })\n .replace(/'([^']+)'/g, // replacing single quote to double quote\n function (_, $1) {\n return '\"' + $1 + '\"';\n });\n }\n}", "function strToJson(str) {\n\tvar inputSplitted, inputParsed;\n\tinputSplitted = str.split('\\n'); // Split the entire input in lines of string json\n\tinputSplitted = inputSplitted.filter(el => el.trim()); // Remove empty and only whitespaces lines\n\tinputParsed = inputSplitted.map((el) => JSON.parse(JSON.stringify(eval(\"(\" + el + \")\")))); // Parse JSON\n\treturn inputParsed;\n}", "function jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function handleJSON(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return str;\n }\n return JSON.stringify(str);\n}", "function jsonParse(str) {\n let obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function jsonParse(str) {\n let obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}", "function _toObjectIfJSONString(str) {\n try {\n str = JSON.parse(str);\n } catch (err) {\n // ignore error\n }\n\n return str;\n}", "function jsParseJSON(str) {\n try {\n var js = JSON.parse(str);\n var hs = toHS(js);\n } catch(_) {\n return __Z;\n }\n return {_:1,a:hs};\n}", "function jsParseJSON(str) {\n try {\n var js = JSON.parse(str);\n var hs = toHS(js);\n } catch(_) {\n return __Z;\n }\n return {_:1,a:hs};\n}", "function resetJsonStr(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n return obj;\n } catch (e) {\n return str;\n }\n }", "function valuify(string) {\n if (JSON_STRING.test(string)) {\n return JSON.parse(string);\n }\n return string;\n }", "function getJsonObject(strJson)\n{\n return eval('(' + strJson + ')');\n}", "function parseObj(jstring){\n const output = {};\n // for empty obj\n if(jstring.length < 3) return output;\n const valueStr = jstring.slice(1, jstring.length-1)\n let start = 0;\n let key;\n let val;\n for(let i = 0; i <= valueStr.length; i++){\n\n if(stack[stack.length-1] === valueStr[i] && stack[stack.length-1] !== '\"' || \n stack[stack.length-1] === valueStr[i] && valueStr[i] === '\"'){\n stack.pop();\n } else if(openings[valueStr[i]] && stack[stack.length-1] !== '\"'){\n stack.push(openings[valueStr[i]]);\n }\n if (!stack.length){\n if (valueStr[i] === ':'){\n key = JSONParser(valueStr.slice(start, i))\n start = i+1;\n }\n if (valueStr[i] === ',' || i === valueStr.length){\n val = JSONParser(valueStr.slice(start, i));\n start = i+1;\n output[key] = val;\n }\n }\n }\n return output;\n}", "function parseJSON(string) {\n if (string == undefined) {\n return null\n }\n return JSON.parse(String(string).trim().replace(/[\\u2018\\u2019]/g, \"'\").replace(/[\\u201C\\u201D]/g, '\"'));\n}", "function parseJsObj(input) {\n return JSON.parse(input.replace(/(['\"])?([a-zA-Z0-9_\\$]+)(['\"])?\\s*:/g, '\"$2\":').replace(/'/g, '\"'));\n}", "function coerce (str) {\n try {\n return JSON.parse(str)\n } catch (e) {\n return str\n }\n}", "function responseToObject(s){\r\n\t//trim leading and trailing white spaces\r\n\ts = s.trim();\r\n\t//remove double quotes from first and last position\r\n\ts = s.substring(1, s.length-1);\r\n\t//remove backslashes from JSON\r\n\ts = s.replace(/\\\\\"+/g, '\"');\r\n\t//parse JSON\r\n\treturn JSON.parse(s);\r\n}", "function jsonFrom(input) {\n var string = $.trim(input);\n if (!string) return;\n return JSON.parse(string);\n }", "IsJsonString(str) {\n try {\n return JSON.parse(str);\n } catch (e) {\n return str;\n }\n }", "function JSONize(str) {\r\n return str\r\n // Wrap keys without quote with double quotes\r\n .replace(/([\\$\\w]+)\\s*:/g, function (_, $1) { return '\"' + $1 + '\":' })\r\n // Replace single quote wrapped ones to double quotes\r\n .replace(/'([^']+)'/g, function (_, $1) { return '\"' + $1 + '\"' })\r\n}", "function convertStringToObj(str) {\n try {\n var o = eval(\"(\" + str + \")\"); // eval(str);\n return o;\n } catch (ex) {\n console_log(ex.name + \":\" + ex.message + \":\" + ex.location + \":\" + ex.text);\n }\n }", "function jsonDecodeForceObject(str) {\n var ret = {};\n try {\n ret = JSON.parse(str);\n } catch (e) {\n //not json\n }\n if (typeof ret !== 'object') {\n var obj = {value: ret};\n ret = obj;\n } else if (ret === null) {\n ret = {};\n }\n\n return ret;\n}", "function parseJSON(string) {\n try {\n return JSON.parse(string);\n } catch (_) {\n throw new Error(`Failed to parse JSON from data starting with \"${Object(_binary_utils_get_first_characters__WEBPACK_IMPORTED_MODULE_0__[\"getFirstCharacters\"])(string)}\"`);\n }\n}", "static stringToJson(value) {\n try{\n return JSON.parse(value);\n } catch (err) {\n return value;\n }\n }", "function stringToJSON (data) {\n// since currently json is returned as a string .. annoying...\n\tvar out=String(data);\n var re = /NaN/gi\n out=out.replace(re,\"-1\");\n \n // Convert to JSON Object for manipulation\n var obj = JSON.parse(out);\n \n //console.log(\" JSON Object is \" + obj);\n return obj;\n}", "function jsonParse(str) {\r\n try {\r\n return JSON.parse(str);\r\n }\r\n catch (error) {\r\n return undefined;\r\n }\r\n}", "function parseJson(str) {\n if (str.length === 0) {\n // special-case empty json body, as it's a common client-side mistake\n return {};\n }\n try {\n return JSON.parse(str);\n } catch (e) {\n throw new ApiError(400, \"Invalid JSON\");\n }\n}", "static deserialize(messageString) {\n return JSON.parse(messageString);\n }", "JSONCookie(str) {\n if (typeof str !== 'string' || str.substr(0, 2) !== 'j:') {\n return undefined;\n }\n\n try {\n return JSON.parse(str.slice(2));\n } catch (err) {\n return undefined;\n }\n }", "dateString2Json(str)\n\t{\n\t\treturn {\n\t\t\td: str.substring(0,2),\n\t\t\tm: str.substring(3,5),\n\t\t\ty: str.substring(6,10)\n\t\t};\n\t}", "function IsJsonString(str) {\n\t try {\n\t JSON.parse(str);\n\t } catch (e) {\n\t return false;\n\t }\n\t return true;\n\t}", "function main(){\n let str = getString();\n let object = modifyJSONStrToObj(str)\n let resultObject = modifyJSON(object)\n\n return resultObject\n}", "function _str2json(str, // @param String:\r\n addQuote) { // @param Number(= 0): 1 is add quote(\")\r\n // @return String: '\\u0000' or '\"\\u0000\"'\r\n function _swap(m) {\r\n return _str2json._SWAP[m];\r\n }\r\n function _ucs2(str, c) {\r\n c = str.charCodeAt(0);\r\n // '\\uffff'\r\n return \"\\\\u\" + uuhash._num2hh[(c >> 8) & 255] +\r\n uuhash._num2hh[ c & 255];\r\n }\r\n\r\n var rv = str.replace(_str2json._ESCAPE, _swap).\r\n replace(_str2json._ENCODE, _ucs2);\r\n\r\n return addQuote ? '\"' + rv + '\"' : rv;\r\n}", "function isJSONString(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n }", "function isJsonString(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n}", "function isJsonString(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n}", "function isJsonString(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n}", "function isJsonString(str) {\n try {\n if (typeof JSON.parse(str) == \"object\") {\n return true;\n }\n } catch(e) {\n }\n return false;\n}", "function IsJsonString(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n}", "function IsJsonString(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n}", "function IsJsonString(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n}", "function IsJsonString (varStr) {\n try {\n JSON.parse(varStr);\n } catch (e) {\n return false;\n }\n return true;\n }", "function getJSON(input) {\n if (typeof input === 'string') {\n var re = /^[\\+\\-]?[0-9\\.]+,[ ]*\\ ?[\\+\\-]?[0-9\\.]+$/; // lat,lng\n if (input.match(re)) {\n input = '[' + input + ']';\n }\n return JSON.parse(jsonize(input));\n }\n else {\n return input;\n }\n}", "static parseJSON(jstr) {\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`JSON.parse for \\\"${jstr}\\\"`);\n}\nif ((jstr != null) && jstr.length > 0) {\nreturn JSON.parse(jstr);\n} else {\nlggr.warn(`JSON.parse failed for \\\"${jstr}\\\"`);\nreturn null;\n}\n}", "function isJson(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n }", "function isJson(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n }", "function tryToJSONParse(text) {\n let obj;\n try {\n obj = JSON.parse(text);\n } catch (e) {\n //never mind...\n obj = text;\n }\n return obj;\n}", "function identifyJSONString(str, opts) {\n var maxChars = 1000;\n var fmt = null;\n if (str.length > maxChars) str = str.substr(0, maxChars);\n str = str.replace(/\\s/g, '');\n if (opts && opts.json_path) {\n fmt = 'json'; // TODO: make json_path compatible with other types\n } else if (/^\\[[{\\]]/.test(str)) {\n // empty array or array of objects\n fmt = 'json';\n } else if (/\"arcs\":\\[|\"objects\":\\{|\"transform\":\\{/.test(str)) {\n fmt = 'topojson';\n } else if (/^\\{\"/.test(str)) {\n fmt = 'geojson';\n }\n return fmt;\n }", "function isJson(str) {\n try {JSON.parse(str);}\n catch (e) {return false;}\n return true;\n}", "function isJSON(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n }", "function _jsonDecode(json_string)\n {\n data = JSON.parse(json_string);\n return data;\n }", "stringify (str) {\n return JSON.stringify(str);\n }", "function isJSON(str) {\n if (typeof str == 'string') {\n try {\n JSON.parse(str);\n return true;\n } catch(e) {\n console.log(e);\n return false;\n }\n }\n console.log('It is not a string!') \n}", "function isJson(str) {\r\n try {\r\n JSON.parse(str);\r\n } catch (e) {\r\n return false;\r\n }\r\n return true;\r\n}", "static restoreFromString(jsonString, typeName) {\n return Objectify.restore(JSON.parse(jsonString), typeName);\n }", "function isJson(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n}", "function isJson(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n}", "function isJson(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n}", "function isJson(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n}", "function parseJson (jsonString) {\n try {\n var o = JSON.parse(jsonString);\n if (o && typeof o === 'object') {\n return o;\n }\n } catch (e) {}\n\n return false;\n}", "function isJson( string, )\n{\n\ttry\n\t{\n\t\treturn JSON.parse( string, ()=> true, );\n\t}\n\tcatch( e )\n\t{\n\t\treturn false;\n\t}\n}", "function parseFromJSON(jsonString) {\n\tparseGraphObject(window.JSON.parse(jsonString));\n}", "json() {\n return JSON.parse(this.string());\n }", "function JSONConvert(data) {\n var retVal;\n //intenta realizar la operación con el objeto JSON nantivo.\n if (typeof data !== \"undefined\" && data instanceof String)\n retVal = JSON.parse(data);\n else\n retVal = JSON.stringify(data);\n\n return retVal;\n }", "function escapeJSON (str) {\n//\tconsole.log(\"Removing \\\" from \" + str);\n return str.replace(/\\\\/gi,'');\n}", "static isJson(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n }", "function quertStringToObj(queryString) {\n if (queryString == \"?\" || queryString == \"\") return false;\n return JSON.parse(\n '{\"' + queryString.replace(/&/g, '\",\"').replace(/=/g, '\":\"') + '\"}',\n function(key, value) {\n return key === \"\" ? value : decodeURIComponent(value);\n }\n );\n}", "is_json(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n }", "function isJSON(str) {\n try {\n JSON.parse(str);\n }\n catch(e) {\n return false;\n }\n return true;\n}", "function jsonParseWithInitiator(jsonStr)\n {\n return JSON.parse(jsonStr,function(key,value) \n\t\t { \n\t\t\t if (key==='_init') {\t \n\t\t\t\treturn eval(value+'_init');\n\t\t\t }\n\t\t\t if (typeof value == 'object') \n\t\t\t if (value._init) {\n \t\t\t value._init();\n\t\t\t\t value._init=null;\n\t\t\t }\n\t\t\t \n\t\t\t return value;\n\t\t });\n }", "function quertStringToObj(queryString) {\n if (queryString == \"?\" || queryString == \"\") return false;\n return JSON.parse(\n '{\"' + queryString.replace(/&/g, '\",\"').replace(/=/g, '\":\"') + '\"}',\n function(key, value) {\n return key === \"\" ? value : decodeURIComponent(value);\n }\n );\n}", "function jsonPrettyFromString(string) {\n if (string === undefined || string === \"\") {\n return \"\";\n }\n const json = JSON.parse(string);\n return JSON.stringify(json, undefined, 2);\n}", "function checkisJson(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n}", "function toJson(object, jsonFn, space) {\n\t if (jsonFn) {\n\t // We reparse the stringified json so that we can lean on JSON.stringify's\n\t // avoiding-infinite-recursion capabilities when stripping out any\n\t // remaining properties that begin with a dollar sign ($)\n\t object = JSON.parse(jsonFn(object));\n\t }\n\t return JSON.stringify(object, replacer, space);\n\t}", "function parseJson (jsonString) {\n try {\n var o = JSON.parse(jsonString);\n // Handle non-exception-throwing cases:\n // Neither JSON.parse(false) or JSON.parse(1234) throw errors, hence the type-checking\n // so we must check for that, too.\n if (o && typeof o === 'object') {\n return o;\n }\n } catch (e) {}\n\n return false;\n}", "function parseJson (jsonString) {\n try {\n var o = JSON.parse(jsonString);\n // Handle non-exception-throwing cases:\n // Neither JSON.parse(false) or JSON.parse(1234) throw errors, hence the type-checking\n // so we must check for that, too.\n if (o && typeof o === 'object') {\n return o;\n }\n } catch (e) {}\n\n return false;\n}", "function parseJSON (jsonString) {\n try {\n return JSON.parse(jsonString)\n } catch (err) {\n return null\n }\n}", "function string2Object(str = '') {\n const stringAsArray = str.split('\\n').slice(0,-1);\n const myObj = {};\n const arrayToObject = stringAsArray.forEach((program) => {\n const name = program.match(regName);\n const weight = parseInt(program.match(regWeight))\n const children = program.match(regChildren) || [];\n\n const childrenObj = { weight };\n\n children.forEach(key => {\n Object.assign(childrenObj, { [key.trim()]: {} })\n });\n\n const prog = {\n [name]: childrenObj\n }\n\n var condition = children.length !== 0;\n condition = true;\n\n if (condition) {\n Object.assign(myObj, prog);\n }\n });\n\n return myObj;\n}", "function prettyJSONString(inputString) {\n\treturn JSON.stringify(JSON.parse(inputString), null, 2);\n}" ]
[ "0.80173165", "0.80173165", "0.77995336", "0.77443254", "0.762207", "0.7463785", "0.7423364", "0.73983276", "0.7368622", "0.7199587", "0.71669674", "0.71669674", "0.71669674", "0.71669674", "0.71669674", "0.71669674", "0.71669674", "0.71669674", "0.71669674", "0.71669674", "0.71669674", "0.71669674", "0.71669674", "0.71669674", "0.71669674", "0.7144157", "0.7054805", "0.7054805", "0.7053598", "0.70272774", "0.70272774", "0.700051", "0.6992972", "0.686344", "0.6850417", "0.6833796", "0.6817889", "0.68154824", "0.67769027", "0.6759126", "0.6749049", "0.6742133", "0.6691675", "0.6688625", "0.6649721", "0.6642698", "0.66213727", "0.66191024", "0.6614798", "0.6595087", "0.65226877", "0.6494703", "0.6437839", "0.6382338", "0.63671577", "0.6345743", "0.63394743", "0.63394743", "0.63394743", "0.6326883", "0.6292824", "0.6292824", "0.6292824", "0.6292705", "0.62782526", "0.62746155", "0.6266461", "0.625371", "0.6252242", "0.618023", "0.61759055", "0.6174874", "0.6156665", "0.6142226", "0.613032", "0.61235666", "0.61165357", "0.61136645", "0.61136645", "0.61136645", "0.6110781", "0.6095169", "0.60841554", "0.6068693", "0.6037772", "0.6037324", "0.6026529", "0.60147", "0.60028344", "0.59917957", "0.59746766", "0.59725165", "0.59723264", "0.59613323", "0.59569013", "0.59485877", "0.59407884", "0.59407884", "0.5934266", "0.593037", "0.58989424" ]
0.0
-1
gets the desired video information
function getYoutubeVideoInfo(id){ var youtubeApiUrl = "https://gdata.youtube.com/feeds/api/videos/"; var v2Parameter = "?v=2"; var jsonParameter = "&alt=json"; var response = CQ.utils.HTTP.get(youtubeApiUrl + id + v2Parameter + jsonParameter); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVideoInformation() {\n if (config.useRemoteData) {\n return getRemoteVideoInformation();\n }\n return getLocalVideoInformation();\n\n}", "async function getVideoInfo() {\n\tlet videos = document.querySelectorAll(\n\t\t'ytd-browse #contents #contents #items ytd-thumbnail .yt-simple-endpoint.inline-block.style-scope.ytd-thumbnail'\n\t);\n\tlet titleEles = document.querySelectorAll('#contents #contents #items #video-title');\n\n\tlet srcAry = [];\n\n\tfor (let i = 0; i < videos.length; i++) {\n\t\tlet titleEle = titleEles[i];\n\t\tlet videoTitle = titleEle.innerText;\n\t\tlet videoInfo = {};\n\t\tlet video = videos[i];\n\t\tlet href = video.getAttribute('href');\n\t\tlet vars = href.split('?')[1];\n\t\tlet src = vars.split('v=')[1];\n\n\t\tvideoTitle ? (videoInfo.title = videoTitle) : '';\n\t\tsrc ? (videoInfo.id = src) : '';\n\t\tsrcAry.push(videoInfo);\n\t}\n\n\treturn srcAry;\n}", "function getVideoData() {\n var activeEpisode = n.metadata.getActiveVideo();\n var player = n.objects.videoPlayer();\n\n return {\n player: player\n , seasonInfo: n.metadata.getActiveSeason()\n , series: n.metadata.getMetadata().video\n , episodeTitle: activeEpisode.title\n , episodeNum: activeEpisode.seq\n , episodeId: parseInt(activeEpisode.episodeId)\n , isFullscreen: n.fullscreen.isFullscreen()\n , currentTime: player.getCurrentTime() \n , duration: player.getDuration()\n }\n }", "function getRemoteVideoInformation() {\n return new Promise(((resolve, reject) => {\n // Request file content from API.\n buildServerRequest(\"/videoStates\", {})\n .then((data) => {\n if (\"undefined\" === typeof data || null === data || \"\" === data) {\n console.error(\"Error parsing video information!\");\n resolve([]);\n } else {\n resolve(JSON.parse(data));\n }\n }).\n catch(reject);\n }));\n}", "getVideoInformation(link) {\n\t\t\n\t\tif(YoutubeHelper.checkURL(link)) {\n\t\t\t//checking the URL\n\t\t\tlet youtubeID = YoutubeHelper.checkURL(link)\n\t\t\t\n\t\t\t//fetching data from the youtube api after vaidation froma the given ID\n\t\t\txhr(`https://www.googleapis.com/youtube/v3/videos?id=${youtubeID}&key=AIzaSyBgMSJtrr13Q4qTdyOrGktD0Rl0OuOCoag&&&part=snippet,contentDetails`,\n\t\t\t\t\n\t\t\t\t(err, req, body) => {\n\t\t\t\t\t\tbody = JSON.parse(body)\n\t\t\t\t\t\tconsole.log(body.items)\n\n\t\t\t\t\t\tlet title, duration\n\t\t\t\t\t\ttitle = body.items['0'].snippet.title\n\t\t\t\t\t\tduration = YoutubeHelper.convertToSeconds(body.items['0'].contentDetails.duration)\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t//Sending to be added to the list\n\t\t\t\t\t\tapp.me.addVideo(title, youtubeID, duration)\n\t\t\t\t\t}\n\t\t\t\t)\n\n\n\t\n\t\t}\n\n\n\t}", "function get_video_details($stream_video) {\n\n var video_id = $stream_video.find('.siv-id').html();\n var video_provider = $stream_video.find('.siv-provider').html();\n\n if (video_provider == \"youtube.com\"){\n var url = \"http://gdata.youtube.com/feeds/api/videos/\" + video_id + \"?v=2&alt=json\"\n $.get(url, function(data) {\n if(data.entry){\n var video_title = data.entry.title.$t || \"\";\n var video_desc = data.entry.media$group.media$description.$t || \"\";\n var video_url = data.entry.media$group.media$thumbnail[0].url || \"\";\n\n $stream_video.find('h3').html(video_title);\n $stream_video.find('.siv-desc').html(video_desc);\n $stream_video.find('.si-thumb img').attr('src', video_url);\n\n } else {\n console.log(\"Video \" + video_id + \" can't be loaded from \" + video_provider +\".\");\n }\n });\n } else if (video_provider == \"vimeo.com\") {\n var url = \"http://vimeo.com/api/v2/video/\" + video_id + \".json?callback=?\";\n\n $.getJSON(url, {format: \"json\"}, function(data) {\n $stream_video.find('h3').html( data[0].title);\n $stream_video.find('.siv-desc').html( data[0].description );\n $stream_video.find('.si-thumb img').attr('src', data[0].thumbnail_small);\n });\n }\n}", "function getVideoInfo(taking, giving){\n taking.currentTime = giving.currentTime;\n taking.paused = giving.paused;\n taking.muted = giving.muted;\n taking.volume = giving.volume;\n if(!giving.paused)\n taking.play();\n }", "async getVideo() {\n return (await this._client.helix.videos.getVideoById(this._data.video_id));\n }", "get currentVideoData() {\n return this._mapData.get(\"raw\")[this.observable.videoId]\n }", "static getCurrentVideoId() {\n if (Application.currentMediaService() === Service.YouTube) {\n if (window.location.search.length > 0) {\n let s = window.location.search.substring(1);\n let requestObjects = s.split('&');\n for (let i = 0, len = requestObjects.length; i < len; i += 1) {\n let obj = requestObjects[i].split('=');\n if (obj[0] === \"v\") {\n return obj[1];\n }\n }\n }\n }\n else if (Application.currentMediaService() === Service.KissAnime) {\n /** if ((window.location.pathname.match(/\\//g) || []).length === 2) {\n return document.getElementsByTagName(\"title\")[0].innerText.split(\"\\n\", 3).join(\"\\n\").trim();\n }\n else*/ if ((window.location.pathname.match(/\\//g) || []).length > 2) {\n return (document.getElementsByTagName(\"title\")[0].innerText.split(\"\\n\", 3).join(\"\\n\").trim() + \" \" + parseInt(document.getElementById(\"selectEpisode\").options[document.getElementById(\"selectEpisode\").selectedIndex].textContent.match(/(\\d+(\\.\\d+)?)(?!.*\\d)/g))).replace(\"(Sub) \", \"\").replace(\"(Dub) \", \"\")\n }\n }\n else if (Application.currentMediaService() === Service.KissManga) {\n /** if ((window.location.pathname.match(/\\//g) || []).length === 2) {\n return document.getElementsByTagName(\"title\")[0].innerText.split(\"\\n\", 2).join(\"\\n\").trim();\n }\n else */if ((window.location.pathname.match(/\\//g) || []).length > 2) {\n //disgusting way to get Name + Chapter\n if (document.getElementById(\"selectReadType\").options[document.getElementById(\"selectReadType\").selectedIndex].textContent.trim() === \"One page\") {\n return document.getElementsByTagName(\"title\")[0].innerText.split(\"\\n\", 3).join(\"\\n\").substring(12)+ \" \" + parse(document.getElementById(\"selectChapter\").options[document.getElementById(\"selectChapter\").selectedIndex].textContent);\n }\n else {\n console.log(document.getElementById('navsubbar').getElementsByTagName('a')[0].innerHTML.split('\\n')[2] + \" \" + parse(document.querySelector(\".selectChapter\").options[document.querySelector(\".selectChapter\").selectedIndex].textContent));\n return document.getElementById('navsubbar').getElementsByTagName('a')[0].innerHTML.split('\\n')[2] + \" \" + parse(document.querySelector(\".selectChapter\").options[document.querySelector(\".selectChapter\").selectedIndex].textContent);\n }\n }\n }\n return null;\n }", "function get_videoID()\r\n{\r\n\tv_id_patch=url.split(\"v=\");\r\n\tid_offset=v_id_patch[1].indexOf(\"&\");\r\n\tif(id_offset==-1) id_offset=v_id_patch[1].length;\r\n\tvid_id=v_id_patch[1].substring(0,id_offset);\r\n}", "async function createVideoInfo (video) {\r\n const snippet = video.snippet;\r\n const stats = video.statistics;\r\n const channelId = snippet.channelId;\r\n const response = await axios\r\n .get(`https://www.googleapis.com/youtube/v3/channels?part=snippet%2C%20statistics&id=${channelId}&key=${process.env.REACT_APP_YOUTUBE_API_KEY}`)\r\n \r\n const channelImage = response.data.items[0].snippet.thumbnails.medium.url;\r\n const subs = response.data.items[0].statistics.subscriberCount;\r\n const publishedDate = new Date(snippet.publishedAt).toLocaleDateString('en-GB', { \r\n day : 'numeric',\r\n month : 'short',\r\n year : 'numeric'\r\n });\r\n const title = snippet.title;\r\n const description = snippet.description;\r\n const channelTitle = snippet.channelTitle;\r\n\r\n setVideoInfo({\r\n title,\r\n description,\r\n publishedDate,\r\n channelTitle,\r\n channelImage,\r\n });\r\n setIsLoading(false);\r\n }", "function getVideo() {\n return document.getElementsByClassName(\"video-stream html5-main-video\")[0];\n}", "function formatVideoInformation(){\n\t\tconsole.log(\"FUNCTION: formatVideoInformation()\");\n\t\tfor(var x = 0; x < REQUEST_LIMIT/2; x++){\n\t\t\tvar video_url = video_base + video_id[x];\n\t\t\tconsole.log(video_url);\n\t\t\t/*document.getElementById(VIDEO_DOMS[x]).innerHTML += \"<p>\" + video_title[x] +\"</p> <br>\";\n\t\t\tdocument.getElementById(VIDEO_DOMS[x]).innerHTML += \"<p>\" + video_description[x] +\"</p> <br>\";\n\t\t\tdocument.getElementById(VIDEO_DOMS[x]).innerHTML += \"<a href=\" + video_base + video_id[x] + \">\" + \"URL: \" + video_base + video_id[x] + \"</a> <br>\";\n\t\t\tdocument.getElementById(VIDEO_DOMS[x]).innerHTML += \"<img href=\" + video_url + \" src=\" + video_thumb[x] + \"> <br>\";*/\n\t\t\t\n\t\t\t//document.getElementById(IMAGE_CONTAINERS[x]).src = video_thumb[x];\n\t\t\tdocument.querySelector('#'+IMAGE_CONTAINERS[x]).setAttribute('src', video_thumb[x]);\n\t\t\tdocument.querySelector('#'+TITLE_CONTAINERS[x]).setAttribute('value', video_title[x]);\n\t\t\tdocument.querySelector('#'+DESCRIPTION_CONTAINERS[x]).setAttribute('value', video_description[x]);\n\t\t\tdocument.querySelector('#'+HYPERLINK_CONTAINERS[x]).setAttribute('value', video_url);\n\t\t}\t\n\t}", "function getInfo(id, cb) {\n\tvar ytdl = require('ytdl-core');\n\tvar BASE = \"http://www.youtube.com/watch?v=\";\n\tvar url = BASE + id;\n\tytdl.getInfo(url,\n\t\t\t\t{\"downloadURL\":true},\n\t\t\t\tfunction (err, info) {\n\t\t\t\t\t// Error handling if ytdl couldn't get info for the request video\n\t\t\t\t\tif (err || !info) {\n\t\t\t\t\t\tcb('error');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// Calculate and format duration properly\n\t\t\t\t\tvar seconds = info.length_seconds % 60;\n\t\t\t\t\tif (seconds < 10) \n\t\t\t\t\t\tseconds = '0' + seconds;\n\n\t\t\t\t\tvar ret = {\n\t\t\t\t\t\tid : id,\n\t\t\t\t\t\turl : url,\n\t\t\t\t\t\tthumbnail : info.iurlhq,\n\t\t\t\t\t\ttitle : info.title,\n\t\t\t\t\t\taddedBy : 'DJ ROOMBA',\n\t\t\t\t\t\tlength_seconds : info.length_seconds,\n\t\t\t\t\t\tduration : Math.floor(info.length_seconds / 60) + ':' + seconds,\n\t\t\t\t\t\taudioURL : '',\n\t\t\t\t\t\tscore: 0,\n\t\t\t\t\t\tvotedOnBy : []\n\t\t\t\t\t}\n\n\t\t\t\t\tvar results = info.formats;\n\t\t\t\t\tfor (var i = 0; i < results.length; i++) {\n\t\t\t\t\t\tif (results[i].type === undefined)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif ((results[i].type).indexOf(\"audio/mp4\") > -1) {\n\t\t\t\t\t\t\tret.audioURL = results[i].url;\n\t\t\t\t\t\t\tcb(ret);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t});\n}", "function videoDetails(videoDetailUrl, id) {\n \n request.get(videoDetailUrl, function (e, r, b) {\n \n videoParse = JSON.parse(b);\n \n if (videoParse.items !== undefined) {\n \n if (videoParse.items[0] !== undefined) {\n \n newurl = \"https://www.youtube.com/watch?v=\" + id;\n\n details = {};\n vidstats = videoParse.items[0].statistics;\n vidsnippet = videoParse.items[0].snippet;\n details.title = vidsnippet.title;\n details.published = vidsnippet.publishedAt.split('T')[0];\n details.views = vidstats.viewCount;\n details.comments = vidstats.commentCount;\n details.likes = vidstats.likeCount;\n \n details.url = newurl;\n\n silo.videos.push(details);\n //console.log(vidstats);\n\n }\n \n }\n \n });\n }", "function pushVideoInfo(li){\r\n // recupere l'url directe de la video a partir de l'url de la page contenant la video\r\n\t\tfunction getUrlVideo(urlPage){\r\n // recupere l'url directe de la video dans le contenu de la page de la video\r\n // plusieurs urls sont définies en général dans des tag \"<source\" sur la page de la video\r\n // on suppose que l'url de la video HD est celle contenant \"HD\" dans son nom et de type \"mp4\"\r\n\t\t\tfunction extractionUrlVideo(txtPage){\r\n\t\t\t\tvar tab=txtPage.match(/<source src=\".*HD([^\\\"]+)\".*type=\"video\\/mp4\"/ig);\r\n if (!tab || tab.length==0) throw [typeof tab,\"La structure a changé : pas de chaine'<source src=' dans la page :\",urlPage].join(\" \");\r\n\t\t\t\tvar urls=[]\r\n\t\t\t\tforEach (tab, function (elt){\r\n\t\t\t\t\tvar url=(elt.match(/src=\"(.*)\"/))[1];\r\n\t\t\t\t\turls.push(url);\r\n\t\t\t\t});\r\n\t\t\t\tif (urls.length==0) throw [\"Aucune url de vidéo dans la page :\",urlPage].join(\" \");\r\n\t\t\t\treturn urls.pop();\r\n\t\t\t}\r\n \r\n // lance l'extraction en récupérant le contenu de la page de la video par une requete http synchrone\r\n\t\t return extractionUrlVideo(httpSync(urlPage));\r\n\t\t}\r\n \r\n // récupération du titre, categorie et url de la page conteant la video\r\n\t\ttry {\r\n //url de la page video est dans le 'href' du lien du 'li' courant\r\n\t\t\tvar urlPageVideo=trim(tags(li,'a')[0].attributes[\"href\"].value);\r\n //categorie est dans le 'span' du 'h3' du 'li' courant\r\n\t\t\tvar categorieVideo=trim(tags(tags(li,'h3')[0], 'span')[0].firstChild.nodeValue);\r\n // titre video est l'element texte du h3\r\n\t\t\tvar titreVideo=trim(tags(li,'h3')[0].lastChild.nodeValue);\r\n\t\r\n\t\t vids.push ({categorie:categorieVideo,titre:titreVideo,url:getUrlVideo(urlPageVideo)});\r\n\t\t} catch (erreur) {\r\n\t\t alert(\"Impossible de récupérer les infos d'une des vidéos. exception : \"+erreur);\r\n\t\t throw \"Traitement interrompu sur erreur.\";\r\n\t\t}\r\n\t}", "function parseVideoURL(url) {\n\n function getParm(url, base) {\n var re = new RegExp(\"(\\\\?|&)\" + base + \"\\\\=([^&]*)(&|$)\");\n var matches = url.match(re);\n if (matches) {\n return(matches[2]);\n } else {\n return(\"\");\n }\n }\n\n var retVal = {};\n var matches;\n var shortYoutubeRegExp = /^.*(youtu\\.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n\n if (url.indexOf(\"youtube.com/watch\") != -1) {\n retVal.provider = \"youtube\";\n retVal.id = getParm(url, \"v\");\n retVal.embed = '//www.youtube.com/embed/'+retVal.id+'?fs=0';\n } else if (matches = url.match(shortYoutubeRegExp)) {\n // console.log(matches[2]);\n retVal.provider = \"youtube\";\n retVal.id = matches[2];\n retVal.embed = '//www.youtube.com/embed/'+retVal.id+'?fs=0';\n } else if (matches = url.match(/vimeo.com\\/(\\d+)/)) {\n retVal.provider = \"vimeo\";\n retVal.id = matches[1];\n retVal.embed = '//player.vimeo.com/video/'+retVal.id+'?fullscreen=0';\n }\n\n return(retVal);\n}", "function PickNewVideo(iVideoInfo, iAutoPlay, iQuote, iPageObjectIds)\r\r\n{\r\r\n DebugLn(\"PickNewVideo\");\r\r\n if (isObject(iVideoInfo))\r\r\n {\r\r\n DebugLn(\"iVideoInfo.Description = \" + iVideoInfo.Description);\r\r\n DebugLn(\"iVideoInfo.Link = \" + iVideoInfo.Link);\r\r\n \r\r\n if (iVideoInfo.Link && \r\r\n iVideoInfo.Link.length > 0)\r\r\n {\r\r\n pageObjectIds = {VideoDiv: \"VideoDiv\", \r\r\n NamePar: \"VideoName\", \r\r\n DescPar: \"VideoDesc\"};\r\r\n \r\r\n if (isObject(iPageObjectIds))\r\r\n {\r\r\n if (StringLength(iPageObjectIds.VideoDiv) > 0)\r\r\n pageObjectIds.VideoDiv = iPageObjectIds.VideoDiv;\r\r\n if (StringLength(iPageObjectIds.NamePar) > 0)\r\r\n pageObjectIds.NamePar = iPageObjectIds.NamePar;\r\r\n if (StringLength(iPageObjectIds.DescPar) > 0)\r\r\n pageObjectIds.DescPar = iPageObjectIds.DescPar;\r\r\n }\r\r\n \r\r\n // Reset video division\r\r\n SetElementHtml(pageObjectIds.VideoDiv,LoadingHtml());\r\r\n\r\r\n // Set video link \r\r\n DebugLn(\"iVideoInfo.AudioPlayer = \" + iVideoInfo.AudioPlayer);\r\r\n videoLink = iVideoInfo.Link;\r\r\n if (StringLength(iVideoInfo.AudioPlayer) > 0)\r\r\n {\r\r\n videoLink = iVideoInfo.AudioPlayer;\r\r\n }\r\r\n DebugLn(\"videoLink = \" + videoLink);\r\r\n\r\r\n // Put video on page.\r\r\n var so = new SWFObject(videoLink, \"VideoEmbed\", \"425\", \"355\", \"9\", \"#6f7a9e\");\r\r\n if (so)\r\r\n {\r\r\n DebugLn(\"Have swf object.\");\r\r\n\r\r\n if (iVideoInfo.Attribute)\r\r\n\t{\r\r\n DebugLn(\"iVideoInfo.Attribute.length = \" + iVideoInfo.Attribute.length);\r\r\n for (iiAtt=0; iiAtt<iVideoInfo.Attribute.length; iiAtt++)\r\r\n {\r\r\n DebugLn('iiAtt = ' + iiAtt + \": \" + \r\r\n iVideoInfo.Attribute[iiAtt].Name + \" = \" + iVideoInfo.Attribute[iiAtt].Value);\r\r\n so.addVariable(iVideoInfo.Attribute[iiAtt].Name, iVideoInfo.Attribute[iiAtt].Value);\r\r\n }\r\r\n\t}\r\r\n\r\r\n if (iAutoPlay)\r\r\n so.addVariable(\"autoplay\", 1);\r\r\n\r\r\n if (StringLength(iVideoInfo.AudioPlayer) > 0)\r\r\n so.addVariable(\"playlist_url\", iVideoInfo.Link);\r\r\n\r\r\n swfHtml = so.getSWFHTML();\r\r\n if (swfHtml && \r\r\n swfHtml.length > 0)\r\r\n\t{\r\r\n DebugLn(\"swfHtml = \" + swfHtml.replace(/</, \"@\"));\r\r\n SetElementHtml(pageObjectIds.VideoDiv,swfHtml);\r\r\n //so.write(pageObjectIds.VideoDiv);\r\r\n }\r\r\n else\r\r\n {\r\r\n SetElementHtml(pageObjectIds.VideoDiv,BadFlashErrorHtml());\r\r\n }\r\r\n }\r\r\n else\r\r\n {\r\r\n SetElementHtml(pageObjectIds.VideoDiv,JavascriptErrorHtml());\r\r\n }\r\r\n\r\r\n // Put name with video.\r\r\n videoName = iVideoInfo.Name;\r\r\n DebugLn(\"videoName = \" + videoName);\r\r\n SetElementHtml(pageObjectIds.NamePar, videoName);\r\r\n \r\r\n // Put description with video.\r\r\n videoDesc = \"\";\r\r\n if (StringLength(iVideoInfo.Description) > 0)\r\r\n {\r\r\n videoDesc = iVideoInfo.Description;\r\r\n if (iQuote)\r\r\n videoDesc = '\"' + videoDesc +'\"';\r\r\n else\r\r\n videoDesc = videoDesc;\r\r\n }\r\r\n else if (StringLength(iVideoInfo.Date) > 0)\r\r\n {\r\r\n if (StringLength(iVideoInfo.Number) > 0)\r\r\n videoDesc += \"Message \" + iVideoInfo.Number;\r\r\n videoDesc += \"<br/>\" + iVideoInfo.Date;\r\r\n if (StringLength(iVideoInfo.Speaker) > 0)\r\r\n videoDesc += \"<br/>\" + iVideoInfo.Speaker;\r\r\n }\r\r\n DebugLn(\"videoDesc = \" + videoDesc);\r\r\n SetElementHtml(pageObjectIds.DescPar, videoDesc);\r\r\n }\r\r\n }\r\r\n}", "function displayResult(videoSnippet) {\r\n var title = videoSnippet.title;\r\n //var videoId = videoSnippet.resourceId.videoId;\r\n $('#video-container').append('<p>' + title + '</p>');\r\n}", "function getVideoId()\n {\n if (window.location.search.length > 0)\n {\n var s = window.location.search.substring(1);\n var requestObjects = s.split('&');\n for (var i = 0, len = requestObjects.length; i < len; i += 1)\n {\n var obj = requestObjects[i].split('=');\n if (obj[0] === \"v\")\n {\n console.log(\"Video ID is \" + obj[1]);\n return obj[1];\n }\n }\n }\n\n return null;\n }", "async function getVidInfo(vid) {\n let res = await fetch(APIUrl + vid);\n let data = await res.json();\n return data;\n}", "function VideoPlayerData() {}", "function onVideoLoad(oMedia) {\n\n\tif (bDebug) {\n\t\tconsole.log('Media: Video Load: ' + oMedia.media.displayName);\n\t}\n\n\tif (bIsDvs && sBrowser !== 'mobile') {\n\t\tresetOverlays();\n\t}\n\n\taCurrentVideoMetaData = oMedia.media.customFields;\n\taCurrentVideoMetaData.id = oMedia.media.id;\n if(oMedia.media.referenceId){\n aCurrentVideoMetaData.referenceId = oMedia.media.referenceId;\n }else{\n aCurrentVideoMetaData.referenceId = oMedia.media.referenceID;\n }\n\tif (bDebug) {\n\t\tconsole.log('Media: Current Video Meta Data Follows:');\n\t\tconsole.log(aCurrentVideoMetaData);\n\t}\n\n\tif (!bMediaBegin) {\n\t\tif (!bPreRoll) {\n\t\t\tif (bDebug) {\n\t\t\t\tconsole.log('Media: No Preroll Set');\n\t\t\t}\n\n\t\t\tvar oCustomVars = {\n\t\t\t\t1: {\n\t\t\t\t\tname: 'Video Reference ID',\n\t\t\t\t\tvalue: aCurrentVideoMetaData.referenceId\n\t\t\t\t},\n\t\t\t\t2: {\n\t\t\t\t\tname: 'Vehicle Year',\n\t\t\t\t\tvalue: aCurrentVideoMetaData.year\n\t\t\t\t},\n\t\t\t\t3: {\n\t\t\t\t\tname: 'Vehicle Make',\n\t\t\t\t\tvalue: aCurrentVideoMetaData.make\n\t\t\t\t},\n\t\t\t\t4: {\n\t\t\t\t\tname: 'Vehicle Model',\n\t\t\t\t\tvalue: aCurrentVideoMetaData.model\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tsendToGoogle(sPlayerName, 'URL Player', 'Media Begin', oCustomVars);\n\t\t\tmixpanel.track(\"Media Begin\", {\n\t\t\t\t\"Category\" : sPlayerName,\n\t\t\t\t\"Action\" : \"URL Player\",\n\t\t\t\t\"Video ID\": aCurrentVideoMetaData.referenceId,\n\t\t\t\t\"Year\": aCurrentVideoMetaData.year,\n\t\t\t\t\"Make\": aCurrentVideoMetaData.make,\n\t\t\t\t\"Model\": aCurrentVideoMetaData.model,\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (bDebug) {\n\t\t\t\tconsole.log('Media: Preroll Set');\n\t\t\t}\n\n\t\t\tvar oCustomVars = {\n\t\t\t\t1: {\n\t\t\t\t\tname: 'Video Reference ID',\n\t\t\t\t\tvalue: 'Pre-roll'\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tsendToGoogle(sPlayerName, 'URL Player', 'Media Begin', oCustomVars);\n\t\t\tmixpanel.track(\"Media Begin\", {\n\t\t\t\t\"Category\" : sPlayerName,\n\t\t\t\t\"Action\" : \"URL Player\",\n\t\t\t\t\"Video ID\": \"Pre-roll\",\n\t\t\t\t\"Year\": aCurrentVideoMetaData.year,\n\t\t\t\t\"Make\": aCurrentVideoMetaData.make,\n\t\t\t\t\"Model\": aCurrentVideoMetaData.model,\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tbMediaBegin = true;\n\t}\n\n\t//Workaround for BC player in mobile\n\tif (sBrowser === 'mobile' || sBrowser === 'ipad' || bIsHtml5)\n\t{\n\t\tseek(0);\n\t}\n\n\tsCurrentCuePoint = '';\n\tif (bDebug) {\n\t\tconsole.log('URL Player: Hiding all chapters');\n\t}\n\n\t$('#chapter_buttons button').addClass('no_display').removeClass('display');\n\n\t//get new cue points\n\tif (sBrowser === 'mobile' || sBrowser === 'ipad' || bIsHtml5)\n\t{\n\t\tmodCue.getCuePoints(oMedia.media.id, cuePointsHandler);\n\t}\n\telse\n\t{\n\t\tcuepoints = modCue.getCuePoints(oMedia.video.id);\n\t\tcuePointsHandler(cuepoints);\n\t}\n\n\tvar oCustomVars = {\n\t\t1: {\n\t\t\tname: 'Video Reference ID',\n\t\t\tvalue: aCurrentVideoMetaData.referenceId\n\t\t},\n\t\t2: {\n\t\t\tname: 'Vehicle Year',\n\t\t\tvalue: aCurrentVideoMetaData.year\n\t\t},\n\t\t3: {\n\t\t\tname: 'Vehicle Make',\n\t\t\tvalue: aCurrentVideoMetaData.make\n\t\t},\n\t\t4: {\n\t\t\tname: 'Vehicle Model',\n\t\t\tvalue: aCurrentVideoMetaData.model\n\t\t}\n\t};\n\n\tsendToGoogle(sPlayerName, 'URL Player', 'Video Load', oCustomVars);\n\tmixpanel.track(\"Video Loaded\", {\n\t\t\"Category\" : sPlayerName,\n\t\t\"Action\" : \"URL Player\",\n\t\t\"Video ID\": aCurrentVideoMetaData.referenceId,\n\t\t\"Year\": aCurrentVideoMetaData.year,\n\t\t\"Make\": aCurrentVideoMetaData.make,\n\t\t\"Model\": aCurrentVideoMetaData.model,\n\t\t}\n\t);\n\n $.ajaxCall('dvs.iframeChangeVideo', 'bVideoChanged=' + bVideoChanged + '&sRefId=' + aCurrentVideoMetaData.referenceId + '&iDvsId=' + iDvsId + '&bVideoClickable=0');\n\n\tif (sBrowser !== 'mobile' && sBrowser !== 'ipad' || bIsHtml5) {\n\t\tmodMen.closeMenuPage();\n\n\t\tif (bAutoplay || bIgnoreAutoPlaySetting) {\n\t\t\tmodVid.loadVideo(oMedia.video.id);\n\n\t\t\tif (bDebug && bIgnoreAutoPlaySetting && !bAutoplay) {\n\t\t\t\tconsole.log('URL Player: Ignoring auto play setting, video loaded via thumbnail click or video select');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmodVid.cueVideo(oMedia.video.id);\n\t\t}\n\t}\n\n\t// Change vehicle info in dealer contact form\n\n bUpdatedShareUrl = false;\n\n//Give brightcove time to reset the position so we dont show an overlay too early.\n\tif (bIsDvs) {\n//\t\t$(document).ready(function() {\n////\t\t\tcheckBackground();\n//\t\t});\n\n//\t\tbOverlayHold = false;\n\t}\n\n}", "selectVideo() {\n\n // allow hash fragment to intercept on init\n this.getVideoIdFromHash();\n\n //==================================================\n // VARS\n //==================================================\n\n var payload;\n var video_obj = this.feed[this.selectedTimeIndex];\n var isLiveOnInit = this.feedType == 'live' && !this.firstRun;\n\n //==================================================\n // WHEN LIVE AND INIT\n //==================================================\n\n if (isLiveOnInit) {\n log('IS LIVE ON INIT');\n bus.$emit('initPlayer', 'limitDuration');\n\n payload = {\n stream: this.liveStreamPlaylist, // !! WARNING !! - stream doesn't work, only playlist\n image: this.liveStreamImage\n }\n\n } else {\n //==================================================\n // WHEN REPLAY\n //==================================================\n\n if (this.feedType == 'live') {\n return; // live no longer switches video\n }\n\n // this.feedType = 'replay'; // set the tabs\n if (!this.firstRun) bus.$emit('initPlayer');\n\n try {\n payload = {\n stream: video_obj.video_url.replace(/^http:\\/\\//i, 'https://'),\n image: video_obj.image_url.replace(/^http:\\/\\//i, 'https://'), // TODO: video_obj.video_url ??\n format: 'mp4'\n }\n }\n catch(error) {\n payload = {\n stream: '.mp4',\n image: '.jpg',\n format: 'mp4'\n }\n }\n }\n //==================================================\n // GOOGLE TRACKING\n //==================================================\n\n if (this.feed && this.firstRun) this.sendTracking(video_obj); // can't report on video_url if LIVE init, or no feed\n\n //==================================================\n // LOAD VIDEO AFTER INIT\n //==================================================\n\n log('>> firstRun is true');\n this.firstRun = true;\n bus.$emit('loadVideo', payload);\n }", "function videoProperties() {\n // r = video1.width/video1.height;\n w = video1.width;\n h = video1.height;\n // console.log(w,h);\n}", "async function getVideo(req, res) {\n const url = `${BASE_URL}videos?part=snippet&id=${req.body.videoId}&key=${process.env.YOUTUBE_API_KEY}`;\n return res.json(await fetch(url).then(res => res.json()));\n}", "function videoProperty(info){\n try{\n waitingOn = info;\n chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n chrome.tabs.executeScript(tabs[0].id, {code: \"chrome.runtime.sendMessage(storedVideo{0});\".format(info)});\n });\n }catch(error){} \n}", "function getVideo() {\n\tnavigator.mediaDevices.getUserMedia({video: true, audio: false})\n\t\t.then(localMediaStream => {\n\t\t\tconsole.log(localMediaStream);\n\t\t\tvideo.src = window.URL.createObjectURL(localMediaStream);\n\t\t\t//MediaStream is an object and needs to be changed to be a URL\n\t\t\tvideo.play();\n\t\t\t//this updates so that the camera shouldn't just be one frame\n\t\t\t//if inspected, blob is the video being caught\n\t\t})\n\t\t.catch(err => {\n\t\t\tconsole.error(`WELP ERROR`, err);\n\t\t});\n}", "function defaultVideo() {\n return { data : [ { images : { preview : { mp4 :\n 'https://media2.giphy.com/media/JIX9t2j0ZTN9S/giphy-preview.mp4'\n } } } ] }\n}", "function getVideo() {\n // navigator.mediaDevices will look for media devices present on the system (e.g camera , microphone etc)\n // getUserMedia will take media input in form of video or audio\n // here it will only take video input\n // navigator.mediaDevices.getUserMedia will return a promise \n navigator.mediaDevices.getUserMedia({\n video: true,\n audio: false\n })\n // if user allow or give permission then it will return a mediaStream(in this case a video)\n // video.srcObject is the source for the video <div>player</div>\n // video.srcObject=localmediaStream with this we set the source of the video player to the localmediaStream(video) return by the device\n // video.play() will start the video player\n .then(localmediaStream => {\n video.srcObject = localmediaStream;\n video.play();\n })\n // the error will happen if no media device is present in the system\n // OR if the user refuse to give permission to the browser\n // if the source (in this case) the website is not secured(https OR localhost are the only secured host recongnised by the browser)\n .catch(err => console.error('Ohh no!!!', err));\n\n}", "function getVideoModelOutput(error, res) {\n if (error) {\n console.error(error);\n return;\n }\n\n labelVideo = res[0].label;\n classifyVideo();\n}", "getVideoTabContents() {\n\t\tlet isActive = false;\n\t\tconst videos = this.state.itemData.playableContent.filter(content => {\n\t\t\treturn content.mimeType.indexOf('video') !== -1;\n\t\t})\n\t\tif(videos.length > 0) {\n\t\t\tconst transcript = this.state.itemData.rawData.layer__asr || null;//TranscriptExample;\n\t\t\tconst content = videos.map((mediaObject, index) => {\n\t\t\t\tmediaObject.id = 'video__' + index;\n\t\t\t\tif(!isActive) {\n\t\t\t\t\tisActive = this.checkMediaObjectIsSelected.call(this, mediaObject);\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<FlexPlayer\n\t\t\t\t\t\tuser={this.props.user} //current user\n\t\t\t\t\t\tproject={this.state.activeProject} //selected via the ProjectSelector\n\t\t\t\t\t\tresourceId={this.state.itemData.resourceId}\n transcript={transcript}\n\t\t\t\t\t\tcollectionId={this.state.itemData.index}\n\t\t\t\t\t\tmediaObject={mediaObject} //TODO make this plural for playlist support\n\t\t\t\t\t\tactive={this.state.activeMediaTab == index}\n\t\t\t\t\t\tenableFragmentMode={false} //add this to config\n\t\t\t\t\t\tannotationSupport={this.props.recipe.ingredients.annotationSupport} //annotation support the component should provide\n\t\t\t\t\t\tannotationLayers={this.props.recipe.ingredients.annotationLayers} //so the player can distribute annotations in layers\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t});\n\t\t\treturn {type : 'video', content : content, active : isActive}\n\t\t}\n\t\treturn null;\n\t}", "getVideoDetails(courseId, videoId, filters) {\n return axios\n .get(this.apiUrl() + `/api/video-analytics/${courseId}/${videoId}/` + this.getQueryParams(filters), {\n headers: this.authHeader(),\n })\n }", "async function getVideo() {\n const constraints = {\n audio: true,\n video: { facingMode: 'user', width: width, height: height }\n };\n if (await navigator.mediaDevices.getUserMedia) {\n try {\n let stream = await navigator.mediaDevices.getUserMedia(constraints);\n videoFeed.srcObject = stream;\n const videoPromise = new Promise(resolve => {\n videoFeed.onloadedmetadata = () => {\n resolve(videoFeed);\n };\n });\n return videoPromise;\n } catch (error) {\n console.error(error);\n }\n }\n}", "function loadVideo() {\n $.getJSON(URL, options, function(data){\n console.log(data)\n var id = data.items[0].snippet.resourceId.videoId;\n mainVideo(id);\n resultsLoop(data);\n });\n }", "get videoId() {\n return this._data.video_id;\n }", "function getVideoObject() {\n var video = getVideoOnly();\n video.renditions = [];\n video.shortDescription = \"A Live Video!\";\n\n var renditions = video.renditions;\n var renditionElems = $('.rendition');\n renditionElems.each(function (i, renditionForm) {\n var renditionInputs = $(renditionForm).find(':input');\n var rendition = inputsToObject(renditionInputs);\n setRenditionDefaults(rendition);\n renditions.push(rendition);\n });\n return video;\n}", "function getInfo(url) {\n youtubedl.getInfo(url, function(err, info) {\n if (err) throw err\n $('.video > h3').text(info.title)\n $('.info').slideToggle()\n })\n}", "function onPlayerStateChange(event) { \n\t//Let us accept the player which was massaged\n\t//by the mousey hands of woman or man\n\tvar videoURL = event.target.getVideoUrl();\n\t//We must strip from it, the true identity\n\tvar regex = /v=(.+)$/;\n\tvar matches = videoURL.match(regex);\n\tvideoID = matches[1];\n\t//and prepare for it's true title\n\tthisVideoTitle = \"\";\n\t//we look through all the array\n\t//which at first glance may seem unfocused\n\t//but tis the off kilter response\n\t//from the magical moore json\n\t//which belies this approach\n\t//Tis a hack? A kludge?\n\t//These are fighting words, sir!\n\tfor (j=0; j<videoArray.length; j++) {\n\t\t//tis the video a match?\n\t if (videoArray[j]==videoID) {\n\t\t\t//apply the true title!\n\t thisVideoTitle = videoTitle[j]||\"\";\n\t\t\tconsole.log(thisVideoTitle);\n\t\t\t//should we have a title, alas naught else\n\t\t\tif(thisVideoTitle.length>0){\n\t\t\t\tif(showTitle==3){\n\t\t\t\t\tthisVideoTitle = thisVideoTitle + \" | \" + videoID;\n\t\t\t\t}else if(showTitle==2){\n\t\t\t\t\tthisVideoTitle = videoID;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tthisVideoTitle = videoID;\n\t\t\t}\n\t\t\t//Should the video rear it's head\n if (event.data == YT.PlayerState.PLAYING) {\n\t\t\t\t_gaq.push(['_trackEvent', 'Videos', 'Play', thisVideoTitle]); \n \t //ga('send', 'event', 'Videos', 'Play', thisVideoTitle);\n\t\t\t\t//thy video plays\n\t\t\t\t//reaffirm the pausal beast is not with us\n \t\tpauseFlagArray[j] = false;\n \t} \n\t\t\t//should the video tire out and cease\n \tif (event.data == YT.PlayerState.ENDED){\n\t\t\t\t_gaq.push(['_trackEvent', 'Videos', 'Watch to End', thisVideoTitle]); \n \t\t//ga('send', 'event', 'Videos', 'Watch to End', thisVideoTitle);\n \t} \n\t\t\t//and should we tell it to halt, cease, heal.\n\t\t\t//confirm the pause has but one head and it flies not its flag\n\t\t\t//lo the pause event will spawn a many headed monster\n\t\t\t//with events overflowing\n \tif (event.data == YT.PlayerState.PAUSED && pauseFlagArray[j] != true){\n\t\t\t\t_gaq.push(['_trackEvent', 'Videos', 'Pause', thisVideoTitle]); \n \t\t//ga('send', 'event', 'Videos', 'Pause', thisVideoTitle);\n\t\t\t\t//tell the monster it may have\n\t\t\t\t//but one head\n \t\tpauseFlagArray[j] = true;\n \t}\n\t\t\t//and should the monster think, before it doth play\n\t\t\t//after we command it to move\n \tif (event.data == YT.PlayerState.BUFFERING){\n\t\t\t\t_gaq.push(['_trackEvent', 'Videos', 'Buffering', thisVideoTitle]); \n \t\t//ga('send', 'event', 'Videos', 'Buffering', thisVideoTitle);\n \t}\n\t\t\t//and should it cue\n\t\t\t//for why not track this as well.\n \tif (event.data == YT.PlayerState.CUED){\n\t\t\t\t_gaq.push(['_trackEvent', 'Videos', 'Cueing', thisVideoTitle]); \n \t\t//ga('send', 'event', 'Videos', 'Cueing', thisVideoTitle);\n \t}\n\n\t }\n\t}\n}", "function getUrlVideo(urlPage){\r\n // recupere l'url directe de la video dans le contenu de la page de la video\r\n // plusieurs urls sont définies en général dans des tag \"<source\" sur la page de la video\r\n // on suppose que l'url de la video HD est celle contenant \"HD\" dans son nom et de type \"mp4\"\r\n\t\t\tfunction extractionUrlVideo(txtPage){\r\n\t\t\t\tvar tab=txtPage.match(/<source src=\".*HD([^\\\"]+)\".*type=\"video\\/mp4\"/ig);\r\n if (!tab || tab.length==0) throw [typeof tab,\"La structure a changé : pas de chaine'<source src=' dans la page :\",urlPage].join(\" \");\r\n\t\t\t\tvar urls=[]\r\n\t\t\t\tforEach (tab, function (elt){\r\n\t\t\t\t\tvar url=(elt.match(/src=\"(.*)\"/))[1];\r\n\t\t\t\t\turls.push(url);\r\n\t\t\t\t});\r\n\t\t\t\tif (urls.length==0) throw [\"Aucune url de vidéo dans la page :\",urlPage].join(\" \");\r\n\t\t\t\treturn urls.pop();\r\n\t\t\t}\r\n \r\n // lance l'extraction en récupérant le contenu de la page de la video par une requete http synchrone\r\n\t\t return extractionUrlVideo(httpSync(urlPage));\r\n\t\t}", "get isVideo () {\n return this.data.type === 'video'\n }", "function getTrackInfo(){\r\n\tvar feedback;\r\n\tif ((us_getTempData(\"artist\")!=0) || (us_getTempData(\"track\")!=0)) {\r\n\t\tfeedback = \"found\";\r\n\t} else {\r\n\t\t//Retrive trackinformation from database\r\n\t\tif (getDatabaseData()==true) {\r\n\t\t\tfeedback = \"found\";\r\n\t\t\ttrackInfoFromDB = true;\r\n\t\t} else {\r\n\t\t\t//New detection of trackinformation\r\n\t\t\tif (location.href.indexOf(\"youtube.com/user/\") != -1) {\r\n\t\t\t\tif (document.getElementById(\"playnav-curvideo-title\")) {\r\n\t\t\t\t\tvar titleContent = document.getElementById(\"playnav-curvideo-title\").getElementsByTagName(\"a\")[0].textContent;\r\n\t\t\t\t} else if (document.getElementsByClassName(\"channels-featured-video-details tile\")[0]) {\r\n\t\t\t\t\tvar titleContent = document.getElementsByClassName(\"channels-featured-video-details tile\")[0].getElementsByTagName(\"a\")[0].textContent;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t//Feather check\r\n\t\t\t\tif (document.getElementById(\"eow-title\")) {\r\n\t\t\t\t\tvar titleContentOriginal = document.getElementById(\"eow-title\").textContent;\r\n\t\t\t\t} else if (document.getElementById(\"watch-headline-title\")) {\r\n\t\t\t\t\tvar titleContentOriginal = document.getElementById(\"watch-headline-title\").textContent;\r\n\t\t\t\t} else if (document.getElementById(\"vt\")) {\r\n\t\t\t\t\tvar titleContentOriginal = document.getElementById(\"vt\").textContent;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//remove (*) and/or [*] to remove unimportant data\r\n\t\t\tvar titleContent = titleContentOriginal.replace(/ *\\([^)]*\\) */g, '');\r\n\t\t\ttitleContent = titleContent.replace(/ *\\[[^)]*\\] */g, '');\r\n\t\t\t\r\n\t\t\t//remove stupid HD info\r\n\t\t\ttitleContent = titleContent.replace(/\\W* HD( \\W*)?/, '');\r\n\t\t\t\r\n\t\t\t//get remix info\r\n\t\t\tvar remixInfo = titleContentOriginal.match(/\\([^)]*(?:remix|mix|cover|version|edit|booty?leg)\\)/i);\r\n\t\t\t\t\t\r\n\t\t\t//\r\n\t\t\t\r\n\t\t\tvar musicInfo = titleContent.split(\" - \");\r\n\t\t\tif (musicInfo.length == 1) {\r\n\t\t\t\tmusicInfo = titleContent.split(\"-\");\r\n\t\t\t}\r\n\t\t\tif (musicInfo.length == 1) {\r\n\t\t\t\tmusicInfo = titleContent.split(\":\");\r\n\t\t\t}\r\n\t\t\tif (musicInfo.length == 1) {\r\n\t\t\t\tmusicInfo = titleContent.split(' \"');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//remove \" and ' from musicInfo\r\n\t\t\tfor (var i=0;i<musicInfo.length;i++) {\r\n\t\t\t\tmusicInfo[i] = musicInfo[i].replace(/^\\s*\"|\"\\s*$/g, '');\r\n\t\t\t\tmusicInfo[i] = musicInfo[i].replace(/^\\s*'|'\\s*$/g, '');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//remove feat. info\r\n\t\t\tfor (var i=0;i<musicInfo.length;i++) {\r\n\t\t\t\tmusicInfo[i] = musicInfo[i].replace(/ feat.* .*/, '');\r\n\t\t\t\tmusicInfo[i] = musicInfo[i].replace(/ feat.* .*/, '');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ((musicInfo.length == 1)||(musicInfo[0] == false) || (musicInfo[1] == false)) {\r\n\t\t\t\tmusicInfo[0] = \"\";\r\n\t\t\t\tmusicInfo[1] = \"\";\r\n\t\t\t\tfeedback = \"notFound\";\r\n\t\t\t} else {\r\n\t\t\t\t//delete spaces\r\n\t\t\t\tmusicInfo[0] = \" \" + musicInfo[0] + \" \";\r\n\t\t\t\tmusicInfo[0] = musicInfo[0].replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\r\n\t\t\t\tmusicInfo[1] = musicInfo[1].replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\r\n\t\t\t\t\r\n\t\t\t\t//add remix info\r\n\t\t\t\tif(remixInfo && remixInfo.length == 1){\r\n\t\t\t\t musicInfo[1] += \" \" + remixInfo[0];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfeedback = \"found\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (us_getValue(\"us_autoscrobble_active\", 0) == 1) {\r\n\t\t\t\tif ((musicInfo.length != 2)) {\r\n\t\t\t\t\tfeedback = \"bad\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (!us_getTempData(\"artist\")) {\r\n\t\t\t\tus_saveTempData(\"artist\", encodeURIComponent(musicInfo[0]));\r\n\t\t\t}\r\n\t\t\tif (!us_getTempData(\"track\")) {\r\n\t\t\t\tus_saveTempData(\"track\", encodeURIComponent(musicInfo[1]));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn feedback;\r\n}", "function displayVideoPanel() {\n var item = Office.context.mailbox.item;\n\n var entities = item.getEntities();\n \n if (entities.urls == null || entities.urls.length == 0)\n return;\n\n var pattern = /v\\=(\\w+)/i;\n\n for (var i = 0; i < entities.urls.length; i++) {\n var url = entities.urls[i].toString();\n var matches = pattern.exec(url);\n if (matches != null) {\n var videoId = matches[1];\n $('#content-tabs').append('<div class=\"content-tab\" data-videoId=\"' + videoId + '\">Video ' + (i + 1) + '</div>');\n }\n }\n\n $('.content-tab').click(function () {\n var videoId = $(this).data('videoid');\n $('#content-tabs .selected').removeClass('selected');\n $(this).addClass('selected');\n displayVideo(videoId);\n });\n $('.content-tab:first').click();\n }", "function getTrailer(title){\n\tconst userQuery = {\n q: `${title} official trailer`,\n part: \"snippet\",\n key: YOUTUBE_API_AUTH,\n type: \"video\",\n maxResults: 1,\n };\n $.getJSON(YOUTUBE_SEARCH_URL, userQuery, function (data){\n const showVideo = data.items.map((value, index) => displayTrailer(value));\n $('.modal-movie-detail .modal-video').html(showVideo);\n });\n}", "getVideo(videoResolvable) {\n return __awaiter(this, void 0, void 0, function* () {\n const id = yield this.getId(videoResolvable, 'video');\n return this.getItemById(entities_1.Video, id);\n });\n }", "function getVideoP(req, res) {\n\n VideoP.find(function (err, videosp) {\n if (err) {\n res.status(422);\n res.json({ error: err });\n }\n res.status(200);\n res.json(videosp);\n });\n}", "function getVidDeets(id,what){\n\t \n\t\t\tvar toReturn;\n\t\t\tvar getURL =\"https://www.googleapis.com/youtube/v3/videos?part=id%2Csnippet&id=\"\n\t+ id + \"&key=\" + ytApiKey;\n\t\n\t\n\t\n\t\n\t$.ajaxSetup({async: false});\n\tif(what == 'title'){ // when what i want is a title return the title relating to the id\n\t\tvar vidData = $.get(getURL, function(data) {\n\t\t\ttoReturn = data.items[0].snippet.title;\n\t\t});\n\t}\n\t\n\telse if(what == 'tn'){ // when what i want is a thumbnail return the thumbnail relating to the id\n\t\tvar vidData = $.get(getURL, function(data) {\n\t\t\ttoReturn = data.items[0].snippet.thumbnails.medium.url;\n\t\t\t\n\t\t});\n\t}\n\telse if(what == 'ltn'){// when what i want is a high quality thumbnail return the thumbnail relating to the id\n\t\t\t\tvar vidData = $.get(getURL, function(data) {\n\t\t\t\t\ttoReturn = data.items[0].snippet.thumbnails.high.url;\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t}\n\t$.ajaxSetup({async: true});\n\treturn toReturn;\n}", "function getvideodata(vid, callback) {\n console.log(vid);\n var request = require(\"request\");\n var options = {\n method: \"GET\",\n url: \"https://api.vimeo.com/videos/\" + vid,\n headers: {\n Authorization: \"bearer c59cf735b2ba123e00c4938e74b2238a\",\n \"Content-Type\": \"application/json\",\n Accept: \"application/vnd.vimeo.*+json;version=3.4\",\n },\n };\n request(options, function (error, response) {\n if (error) throw new Error(error);\n // console.log(response.body);\n console.log(\"ok\");\n callback(response.body);\n });\n}", "function retrieveVideosRecommended(videoIdRecommended) {\n\n var rpReqUrl = \"php/loadVideosRecommended.php\";\n\n $.post(rpReqUrl,\n\n //data\n {\n videoId: videoIdRecommended\n\n },\n\n\n function (dataClipsServerDBReply, status) {\n\n //loop OVER JSON OBJECT\n $.each(dataClipsServerDBReply, function (index, value) {\n\n console.log(value.length);\n\n //retrieve each video info\n for (m in value) {\n\n // var usrId = value[m].userID;\n var videoTitle = value[m].title;\n var sourceVideo = value[m].sourceLinkVideo + \"\";\n var viewsVideo = value[m].views;\n\n var videoUploadByAuthor = value[m].videoUploadBy;\n var dateUploadVideo = value[m].videoDateUpload;\n var categoryVideo = value[m].category;\n\n var videoId = value[m].videoID;\n\n var itemListID = videoId + \"\";\n\n // console.log(value[m].userID);\n console.log(videoTitle);\n console.log(sourceVideo);\n console.log(viewsVideo);\n\n //slice details\n //var subject=contDetails.slice(0,100)+\"...\";\n\n var FirstNameUser = fnameUser;\n\n\n //var language=value[m].language;\n //by default\n var language = \"english\";\n\n var pictDefault = \"\";\n\n //var category=value[m].category;\n var category = categoryVideo;\n //var FirstName=value[m].fnameCreator;\n var fNameVideoUploadedBy = videoUploadByAuthor;\n var FirstNameUploader = \"Uploaded by \" + fNameVideoUploadedBy;\n\n\n /*to define*/\n var videoFrame = \"video frame here\";\n var additionalDetails = \"video additional details\";\n\n var dateVideo = dateUploadVideo;\n\n var videoFrame = ' <div class=\"col-xs-10\" class=\"embed-responsive embed-responsive-16by9\"> <video class=\"embed-responsive-item\" src= ' + sourceVideo + ' width=\"100%\" height=\"100%\" style=\"border:5px solid #EE82EE;\" frameborder=\"0\" preload=\"metadata\" controls ></video> </div>';\n\n /*Thumbnail by default*/\n var pictDefault = '<img src=\"images/defaultScreenVideo.png\" class=\"screenDefault\" class=\"img-responsive img-thumbnail\" width=\"150\" height=\"100\">';\n\n /*Thumbnail by item if saved on DB as png or gif*/\n //var pictDefault='<img src='+thumbnailImg+' class=\"screenDefault\" class=\"img-responsive img-thumbnail\" width=\"150\" height=\"150\">';\n\n var btnPlayVideo = '<button style=\"margin-right: 5px;\" type=\"button\" class=\"btn btn-info btn-sm glyphicon glyphicon-play-circle\" data-toggle=\"modal\" data-target=\"#' + itemListID + '\" title=\"Game Clips Player\" onclick=\"saveActiveVideo(' + videoId + ')\" > ' + pictDefault + '</button>';\n\n\n\n var btnAddVideoToMyClips = '<button type=\"button\" class=\"btn btn-primary\" data-dismiss=\"modal\" onclick=\"inviteSubscribe(' + videoId + ')\">Add To My Clips</button> ';\n\n\n //FORMAT video Item\n var itemVideo = '<li href=\"#\" class=\"list-group-item text-left\"> ' + btnPlayVideo + '<label class=\"name\">' + FirstNameUploader + ' <br>Date video: ' + dateVideo + '<h6>Category: ' + category + '</h6><br></label><label class=\"pull-right\"> <!-- Modal Play video--><div class=\"modal fade\" id=\"' + itemListID + '\" role=\"dialog\"><div class=\"modal-dialog\"> <!-- Modal content--><div class=\"modal-content\"><div class=\"modal-header\"><button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button><h4 font-color=\"gery\"class=\"modal-title\"><strong>' + FirstNameUploader + '</strong> <span style=\"color:rgb(0, 160, 70)\">Views.</span></h4></div> <div class=\"modal-body\"><h6>category</h6><blockquote>' + category + '</blockquote><h3>Clip</h3><blockquote>' + videoFrame + '</blockquote><h6>Language</h6><blockquote>' + language + '</blockquote><h6>' + additionalDetails + '</h6></div> <div class=\"modal-footer\"> <!-- new Btn --> ' + btnAddVideoToMyClips + '<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close Player</button> </div></div></div></div><a class=\"btn btn-danger btn-sm glyphicon glyphicon-trash\" href=\"#\" id=\"' + videoId + '\" onclick=\"inviteSubscribe(' + videoId + ')\" title=\"Remove Video\"></a> </label> <div class=\"break\"></div></li>';\n\n\n $('#mainpanecontentRecommend').prepend(itemVideo);\n\n }\n\n //horizontal separator\n $('#mainpanecontentRecommend').prepend(\"<br>\");\n });\n\n\n },\n 'json');\n\n } //end video recommended function", "loadMovie({name, description, vidsource}) {\n console.log('show movie details');\n\n this.videotitle = name;\n this.videodescription = description;\n this.videosource = vidsource;\n\n this.showDetails = true;\n }", "getTitle(videoId) {\n return fetch (VIDEO_ENDPOINT + videoId)\n .then(response => response.json())\n .catch (error => \n console.error(error)\n )\n }", "function findVideo() {\n return Array.from(document.querySelectorAll('video'))\n .filter(video => video.readyState !== 0)\n .filter(video => video.disablePictureInPicture === false)\n .filter(video => {\n // google meet\n let isVideo = true;\n if (urlHost !== 'undefined' && urlHost === 'meet.google.com') {\n let videoParentElement = 'div[jscontroller=\"J3CtX\"]';\n let presentationElement = 'div[jscontroller=\"LvT0m\"]';\n let peopleNameElement = '[data-self-name]';\n let videoParent = video.closest(videoParentElement);\n isVideo = false;\n\n if (videoParent != null && videoParent.querySelector(presentationElement) != null) {\n let selfName = videoParent.querySelector(peopleNameElement);\n isVideo = selfName.dataset.selfName !== selfName.innerHTML\n }\n }\n return isVideo;\n })\n .sort((video1, video2) => {\n const video1Rect = video1.getClientRects()[0]||{width:0,height:0};\n const video2Rect = video2.getClientRects()[0]||{width:0,height:0};\n return ((video2Rect.width * video2Rect.height) - (video1Rect.width * video1Rect.height));\n });\n}", "function getMediaInfos() {\n var mediaInfos = adapter.getAllMediaInfoForType(streamInfo, constants.VIDEO);\n mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.AUDIO));\n mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.TEXT)); // mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.MUXED));\n // mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.IMAGE));\n\n eventBus.trigger(events.OFFLINE_RECORD_LOADEDMETADATA, {\n id: manifestId,\n mediaInfos: mediaInfos\n });\n }", "async function getVideo(fileName) {\n\tconst url = `${BASE_URL}/static/video/${fileName}`;\n\tconst options = {\n\t\tmethod: \"GET\",\n\t};\n\n\treturn await fetch(url, options).then((response) => response.json());\n}", "function readVideoInfo() {\n // read json string from videoInfo.json file\n fs.readFile('./videoInfo.json', (err, jsonString) => {\n if (err) {\n console.log(\"Error reading file videoInfo.json:\", err);\n }\n try {\n // parse json string and save to global constant\n videoInfo = JSON.parse(jsonString);\n console.log(\"videoInfo read from videoInfo.json file.\");\n } catch (err) {\n console.log(\"Error parsing JSON string from videoInfo.json:\", err);\n }\n });\n}", "function movieinfo() {\n \n var queryURL = \"http://www.omdbapi.com/?t=rock&apikey=//!InsertKey\";\n // Creating an AJAX call for the specific movie \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n }\n)}", "function detectVideo(videoSelector) {\n console.log('detecting video')\n var videoPing = setInterval(function() {\n var video = $(videoSelector)[0];\n if ($(video).length > 0) {\n console.log('found video')\n console.log($(video))\n clearTimeout(videoPing);\n var videoID = $(video).attr('id');\n if (!videoID) {\n videoID = eimeerVideoID;\n $(video).attr('id', videoID);\n }\n\n $('#' + eimeerVideoID).onload() = function(){\n console.log('iframe loaded')\n }\n\n eimeerTimedCommentVideo = videojs(videoID, {}, function() {\n console.log('videojs obj created')\n var videojsObj = this;\n this.on('loadedmetadata', function() {\n console.log('metadata loaded')\n var videoDuration = parseInt(videojsObj.duration());\n renderProgressBox(videoDuration);\n\n setInterval(function(){\n console.log(videojsObj.currentTime())\n }, 2000)\n });\n });\n } else {\n console.log('havent found video')\n }\n }, 1000);\n setTimeout(function(){clearTimeout(videoPing);}, 20000)\n}", "async function updateData() {\n urlForVideo = document.location.href;\n \n if (urlForVideo != lastURL) {\n lastURL = urlForVideo;\n startTimeStamp = Math.floor(Date.now() / 1000);\n }\n\n playback = \n $('.titleshow h1').text().trim() != \"\"\n && iframe_video.dur != null ? true : false\n\n\n\n //* If page has all required propertys\n if(playback) {\n videoTitle = $('.titleshow h1').html()\n videoAuthor = (await getString(\"presence.episode\")).replace(\"{{episode}}\", $('.episoden a.active').text()),\n \n videoTimestamps = getTimestamps(Math.floor(iframe_video.curr), Math.floor(iframe_video.dur))\n playbackBoolean = !iframe_video.paused\n smallImageKey = playbackBoolean ? 'play' : 'pause'\n smallImageText = playbackBoolean ? await getString(\"presence.playback.playing\") : await getString(\"presence.playback.paused\")\n\n var data = {\n clientID: '517148876273090577',\n presenceData: {\n details: $('<div/>').html(videoTitle).text(),\n state: $('<div/>').html(videoAuthor).text(),\n largeImageKey: 'a4y_lg',\n largeImageText: chrome.runtime.getManifest().name + ' V' + chrome.runtime.getManifest().version,\n smallImageKey: smallImageKey,\n smallImageText: smallImageText,\n },\n trayTitle: $('<div/>').html(videoTitle).text(),\n playback: playbackBoolean,\n service: 'Anime4You'\n }\n\n if(playbackBoolean) {\n data.presenceData.startTimestamp = videoTimestamps[0]\n data.presenceData.endTimestamp = videoTimestamps[1]\n } else {\n delete data.presenceData.startTimestamp\n delete data.presenceData.endTimestamp\n }\n\n } else if(!document.location.pathname.includes('/show/')) {\n var data = {\n clientID: '517148876273090577',\n presenceData: {\n details: await getString('presence.lookingForAnime'),\n largeImageKey: 'a4y_lg',\n largeImageText: chrome.runtime.getManifest().name + ' V' + chrome.runtime.getManifest().version,\n startTimestamp: startTimeStamp\n },\n trayTitle: $('<div/>').html(videoTitle).text(),\n playback: true,\n service: 'Anime4You'\n }\n } else if(document.location.pathname.includes('/show/')) {\n var videoTitle = $('.titleshow h1').text().trim(),\n videoEpisode = (await getString(\"presence.episode\").replace(\"{{episode}}\", $('.episoden a.active').text()))\n\n var data = {\n clientID: '517148876273090577',\n presenceData: {\n details: $('<div/>').html(videoTitle).text(),\n state: $('<div/>').html(videoEpisode).text(),\n largeImageKey: 'a4y_lg',\n largeImageText: chrome.runtime.getManifest().name + ' V' + chrome.runtime.getManifest().version,\n startTimestamp: startTimeStamp\n },\n trayTitle: $('<div/>').html(videoTitle).text(),\n playback: true,\n service: 'Anime4You'\n }\n}\n chrome.runtime.sendMessage({presence: data})\n}", "function getStatus(video) {\n //create the object\n let status = {}\n\n //use the same \"commands\" as the video commands for clarity plz\n if (video.paused == false) {\n status.paused = 0;\n }\n else if (video.paused == true) {\n status.paused = 1;\n }\n status.currentTime = video.currentTime\n status.baseURI = video.baseURI\n\n return status\n}", "function videoURL(response) {\n if (!('data' in response) || response.data.length === 0)\n\treturn videoURL(defaultVideo());\n let pos = Math.floor(Math.random()*response.data.length);\n return { mp4 : response.data[pos].images.preview.mp4 };\n}", "function getVideoPath()\n {\n var codecs = [\n { type: 'video/mp4; codecs=\"avc1.4D401E, mp4a.40.2\"', path: 'pathMP4' },\n { type: 'video/webm; codecs=\"vp8.0, vorbis\"', path: 'pathWEBM' },\n { type: 'video/ogg; codecs=\"theora, vorbis\"', path: 'pathOGG' }\n ];\n\n for( var index in codecs )\n {\n var canPlay = video.canPlayType( codecs[index].type );\n if( canPlay == \"probably\" )\n {\n return currentVidVo[ codecs[index].path ];\n }\n }\n\n return currentVidVo.pathMP4;\n }", "function getMovieInfo(args){\n\tconsole.log(\"Getting info for movie \"+movie_id);\n\tvar req = new XMLHttpRequest();\n\treq.open(\"GET\", request_path+\"/movies/\"+movie_id, true);\n\treq.onload = function() {\n\t\tvar response = JSON.parse(req.response);\n\t\targs[0].setText(response[\"title\"]);\n\t\targs[2].setImage(args[3]+response[\"img\"]);\n\t\tgetMovieRating(args);\n\t}\n\treq.send();\n}", "function getNetflixMediaTitle() {\n\tconsole.log(\"waiting to load video \");\n\tsetTimeout(() => {chrome.tabs.query({active: true}, function(tabs){\n\t\tvar tab = tabs[0];\n\t\tchrome.tabs.executeScript(tab.id, {\n\t\t\tcode: 'document.querySelector(\".ellipsize-text\").textContent'\n\t\t}, function(results){ sendData(results.toString(), \"Netflix\");});\n\t});}, 8000);\n\t\n}", "function getSingleVideo(id, videoDiv) {\n fetch(`${videosUrl}/` + id).then(resp => resp.json())\n .then(video => showVideo(video, videoDiv))\n}", "function Video(VideoID)\n{\n JSONseen(VideoID,function (e) { if (e['ret']!=true) alert(\"YouTube: Fehler beim Seen: \"+uneval(e)); });\n css(\"#watch7-player { z-index:9999; position: fixed; bottom:0px; left:10px; width: 800px; height:600px; }\");\n css(\"#watch7-discussion, #watch7-action-panels, #footer-container { display:none; }\");\n var Video=deserialize(\"Video\",{});\n if (!Video[VideoID]) Video[VideoID]={ id:VideoID, anz:0 };\n Video[VideoID].anz+=1;\n var lastseen=Video[VideoID].lastseen;\n Video[VideoID].lastseen=new Date();\n serialize(\"Video\",Video);\n var Kategorien=deserialize('Kategorien',[]).sort();\n Kategorien.unshift(\"-- bitte auswählen --\");\n Kategorien.push(\"-- Eingeben --\");\n var SelectKat=\"<select id=wKategorie>\"+\n Kategorien.map(function (e) { return \"<option>\"+e+\"</option>\" }).join(\"\")+\n \"</select>\"\n showmsg({\n id:\"VideoStatus\",\n text: ['<span style=\"font-size:0.8em\">'+ObjOut(Video[VideoID])+'</span>',\n //\"Datum: \"+(lastseen||{ getShortDate:function () {return \"???\";}}).getShortDate(),\n \"Kategorie: \"+SelectKat,\n //\"Bitte bewerten sie das Video:\",\n \"\"].join('<br>'),\n color:(Video[VideoID].anz<=1)?\"gray\":{ \"gut\":\"green\", \"schlecht\":\"red\", undefined:\"yellow\" }[Video[getParam(\"v\",\"\")].qualitaet],\n fixed:true,\n OK: \"Gut\",\n Cancel: \"Schlecht\",\n onOK:function () { var Video=deserialize(\"Video\",{}); Video[getParam(\"v\",\"\")].qualitaet=\"gut\"; Video[getParam(\"v\",\"\")].exported=1; serialize(\"Video\",Video); JSONquali(getParam(\"v\",\"\"),2); },\n onCancel:function () { var Video=deserialize(\"Video\",{}); Video[getParam(\"v\",\"\")].qualitaet=\"schlecht\"; Video[getParam(\"v\",\"\")].exported=1; serialize(\"Video\",Video); JSONquali(getParam(\"v\",\"\"),5); },\n });\n // id, text, color, OK, onOK, Cancel, onCancel, Timeout, onTimeout, onOKTimeout // ** Log **\n var i=Kategorien.indexOf(Video[VideoID].Kategorie);\n if (i>0) $('wKategorie').selectedIndex=i;\n $('wKategorie').addEventListener(\"change\",function(event){\n var Video=deserialize(\"Video\",{});\n switch (event.target.value)\n {\n case \"-- bitte auswählen --\":\n delete Video[VideoID].Kategorie;\n break;\n case \"-- Eingeben --\":\n Video[VideoID].Kategorie=prompt(\"Bitte Name der Kategorie eingeben:\");\n var k=deserialize('Kategorien',[]);\n k.push(Video[VideoID].Kategorie);\n serialize('Kategorien',k);\n break;\n default:\n Video[VideoID].Kategorie=event.target.value;\n JSONkat(VideoID,event.target.value);\n break;\n }\n serialize(\"Video\",Video);\n }, true);\n\n // Vorschauliste BUNT\n var VideoLinks=$x(\"//ul[@id='watch-related']//li\")\n .map(function (e) { return { link:($xs(\".//a\",e)||{href:\"ERROR\"}).href, elem:e }; })\n .map(function (vid) { vid.id=((vid.link||\"\").match(/v=([a-zA-Z0-9-_]*)/)||[\"\",\"\"])[1]; return vid; })\n //alert([ uneval(VideoLinks) ].join(\"\\n\"));\n Interval(function () {\n var Video=deserialize(\"Video\",{});\n VideoLinks.forEach(function (vid) { if (Video[vid.id]) vid.elem.style.backgroundColor={ \"gut\":\"green\", \"schlecht\":\"red\", undefined:\"yellow\" }[Video[vid.id].qualitaet]; });\n }, 60000);\n \n // LINKS zu gespeicherten Videos\n var MenuBase=$('watch-actions');\n if (!MenuBase) MenuBase=$('watch7-secondary-actions');\n if (MenuBase)\n {\n // Selectbox\n var Kat=deserialize('Kategorien',[]).sort();\n Kat.push(\"* Ohne Kategorie mit X *\");\n Kat.unshift(\"* Ohne Kategorie *\");\n Kat.unshift(\"- Kategorie öffnen -\");\n var c=Kat.map(function (e) { return createElement('option', { textContent:e }); });\n var m=createElement('select', { className:\"yt-uix-button-default\", childs:c, onChange:function (e){ \n var Video=deserialize(\"Video\",{});\n GM_setValue('lastKat',e.value);\n var youtube=['',new Date()];\n var anz=0;\n for (var i in Video)\n if ((e.value==\"* Ohne Kategorie mit X *\" && !Video[i].Kategorie && Video[i].x) || (e.value==\"* Ohne Kategorie *\" && !Video[i].Kategorie && !Video[i].x) || Video[i].Kategorie==e.value)\n {\n anz+=1;\n if (Video[i].lastseen<youtube[1] && Video[i].qualitaet!=\"schlecht\")\n youtube=[ Video[i].id, Video[i].lastseen ];\n }\n if (youtube[0]=='')\n {\n alert(\"Keine Videos in der Kategorie gefunden\");\n var k=deserialize('Kategorien',[]);\n k.splice(k.indexOf(e.value),1); \n serialize('Kategorien',k);\n GM_setValue('lastKat','* Ohne Kategorie *');\n return;\n }\n if (confirm('Anzahl Videos in der Kategorie: '+anz+'\\n\\nAktuelles Video im neuen Tab öffnen?'))\n GM_openInTab(\"http://www.youtube.com/watch?v=\"+youtube[0]);\n else\n location.href=\"http://www.youtube.com/watch?v=\"+youtube[0];\n } }, MenuBase);\n // Button\n createElement('button',{\n className: \"yt-uix-button yt-uix-button-default\",\n textContent:'Next',\n onClick:function (e) { \n var Video=deserialize(\"Video\",{});\n var youtube=['',new Date()];\n var Kat=GM_getValue('lastKat','* Ohne Kategorie *');\n for (var i in Video)\n if ((Kat==\"* Ohne Kategorie mit X *\" && !Video[i].Kategorie && Video[i].x) || (Kat==\"* Ohne Kategorie *\" && !Video[i].Kategorie && !Video[i].x) || Video[i].Kategorie==Kat)\n {\n if (Video[i].lastseen<youtube[1] && Video[i].qualitaet!=\"schlecht\")\n youtube=[ Video[i].id, Video[i].lastseen ];\n }\n if (youtube[0]=='')\n {\n alert(\"Keine Videos in der Kategorie gefunden\");\n var k=deserialize('Kategorien',[]);\n k.splice(k.indexOf(Kat),1); \n serialize('Kategorien',k);\n GM_setValue('lastKat','* Ohne Kategorie *');\n return;\n }\n location.href=\"http://www.youtube.com/watch?v=\"+youtube[0];\n }\n }, MenuBase);\n createElement('button',{\n className: \"yt-uix-button yt-uix-button-default\",\n textContent:'Galerie',\n onClick:function (e) { \n location.href=\"about:blank#YouTube\";\n }\n }, MenuBase);\n if (getParam('list'))\n createElement('button',{\n className: \"yt-uix-button yt-uix-button-default\",\n textContent:'Playlist',\n onClick:function (e) { \n location.href=\"/playlist?list=\"+getParam('list');\n }\n }, MenuBase);\n }\n $x(\"//a[contains(@href,'v=')]\").forEach(function (a) { a.addEventListener(\"click\",function(event){\n //if (event.ctrlKey) // && event.altKey)\n {\n var e=event.target;\n while (!e || !e.href) e=e.parentNode;\n var VideoID=e.href.match(/v=([a-zA-Z0-9-_]*)/)[1];\n var Video=deserialize(\"Video\",{});\n if (!Video[VideoID])\n {\n Video[VideoID]={ id:VideoID, anz:0, lastseen:new Date() };\n serialize(\"Video\",Video);\n e.style.color=\"lightgray\";\n e.style.backgroundColor=\"darkgray\";\n event.stopPropagation();\n event.preventDefault();\n }\n }\n }, true); });\n //GM_log(\"Ready?\");\n unsafeWindow.onYouTubePlayerReady = function (playerID)\n {\n //GM_log(\"youtube Ready\");\n var player=document.getElementById(\"movie_player\").wrappedJSObject;\n //player.addEventListener(\"onStateChange\", function (e) { alert(\"State Changed: \"+e); });\n var intervalID=window.setInterval(function () {\n //GM_log(\"interval\");\n if (player.getPlayerState()==0)\n {\n //GM_log(\"Ende\");\n NextVideo();\n window.clearInterval(intervalID);\n }\n },1000);\n }\n //GM_log(\"ALL DONE\");\n}", "function getTimeStamp(){\n\treturn document.getElementsByClassName(\"video-stream html5-main-video\")[0].currentTime\n}", "async getVideo(product_id) {\n const endpoint = `${ApplicationMainHost}/api/product/videos/?product_id=${product_id}`;\n let response = await apiService(endpoint);\n this.productVideos = response.results;\n }", "function get_video(path) {\n //with camera stream, only working if we use video here not with 'var video', but before this point video doesn't exist\n video = video2;\n \n //need to be careful here: in use_webcam() the src Object is set with video.srcObject = stream; not with video.setAttribute(). If we don't reset\n //it to null it seems to override the attributes that are set with setAttribute.\n video.srcObject = null;\n //first I created a seperate source object here, which is complete nonesense\n //it's totally dufficient to add the path from the file picker <video src=\"path\" ...>\n video.setAttribute('src', path);\n video.load();\n video.play();\n\n //add an update, as soon as the video is running loop is called constantly\n video.ontimeupdate = function() {loop()};\n\n}", "function getVideoOnly() {\n var videoInputs = $('#video :input');\n var video = inputsToObject(videoInputs);\n return video;\n}", "function retrieveVideoMetaRef(filePath){\n // The following is to handle the auth, campaign id, and history id parsing.\n return retrieveMediaMetaRef(filePath, 'videos');\n}", "function getCurrentVideoId() {\n let attr = document.getElementsByClassName(\"share-twitter\")[0]\n .getAttribute(\"data-event-tracking\").split(\"|\");\n return attr[attr.length - 1];\n}", "function relatedVideos(data) {\n console.log(data);\n\n var monthNames = [ \"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ];\n var contentAV = '<div class=\"related-audio-video\">';\n\n var current_url = $.param.fragment();\n\n $.each(data.media, function(rInd, rElm) {\n contentAV += '<div class=\"shanti-thumbnail video col-lg-2 col-md-3 col-sm-4 col-xs-12\">';\n contentAV += '<div class=\"shanti-thumbnail-image shanti-field-video\">';\n contentAV += '<a href=\"#' + current_url + '&nid=' + rElm.nid + '\" class=\"shanti-thumbnail-link\">';\n contentAV += '<span class=\"overlay\">';\n contentAV += '<span class=\"icon\"></span>';\n contentAV += '</span>';\n contentAV += '<img src=\"' + rElm.thumbnail + '/width/360/height/270/type/2/bgcolor/000000' + '\" alt=\"Video\" typeof=\"foaf:Image\" class=\"k-no-rotate\">';\n contentAV += '<i class=\"shanticon-video thumbtype\"></i>';\n contentAV += '</a>';\n contentAV += '</div>';\n contentAV += '<div class=\"shanti-thumbnail-info\">';\n contentAV += '<div class=\"body-wrap\">';\n contentAV += '<div class=\"shanti-thumbnail-field shanti-field-created\">';\n contentAV += '<span class=\"shanti-field-content\">';\n var date = new Date(parseInt(rElm.created) * 1000);\n contentAV += date.getDate() + ' ' + monthNames[date.getMonth()] + ' ' + date.getFullYear();\n contentAV += '</span>';\n contentAV += '<div class=\"shanti-thumbnail-field shanti-field-title\">';\n contentAV += '<span class=\"field-content\">';\n contentAV += '<a href=\"#' + current_url + '&nid=' + rElm.nid + '\" class=\"shanti-thumbnail-link\">';\n contentAV += rElm.title;\n contentAV += '</a>';\n contentAV += '</span>';\n contentAV += '</div>';\n contentAV += '<div class=\"shanti-thumbnail-field shanti-field-duration\">';\n contentAV += '<span class=\"field-content\">' + rElm.duration.formatted + '</span>';\n contentAV += '</div>';\n contentAV += '</div>';\n contentAV += '</div>';\n contentAV += '<div class=\"footer-wrap\">';\n contentAV += '</div>';\n contentAV += '</div>';\n contentAV += '</div>';\n });\n\n contentAV += '</div>';\n\n var avURL = Settings.mediabaseURL + '/services/' + Settings.app + '/' + Settings.hash_obj.id + '?rows=12';\n var total_pages = parseInt(data.total / data.rows);\n\n contentAV += '<ul id=\"photo-pagination\">';\n contentAV += '<li class=\"first-page\"><a href=\"' + avURL + '&pg=1' + '\">&lt;&lt;</a></li>';\n contentAV += '<li class=\"previous-page\"><a href=\"' + avURL + '&pg=1' + '\">&lt;</a></li>';\n contentAV += '<li>PAGE</li>';\n contentAV += '<li><input type=\"text\" value=\"1\" class=\"page-input\"></li>';\n contentAV += '<li>OF ' + total_pages + '</li>';\n contentAV += '<li class=\"next-page\"><a href=\"' + avURL + '&pg=2' + '\">&gt;</a></li>';\n contentAV += '<li class=\"last-page\"><a href=\"' + avURL + '&page=' + total_pages + '\">&gt;&gt;</a></li>';\n contentAV += '</ul>';\n contentAV += '<div class=\"paginated-spin\"><i class=\"fa fa-spinner\"></i></div>';\n\n $(\"#tab-audio-video\").append(contentAV);\n\n //Add the event listener for the first-page element\n $(\"li.first-page a\").click(function(e) {\n e.preventDefault();\n var currentTarget = $(e.currentTarget).attr('href');\n $.ajax({\n url: currentTarget,\n beforeSend: function(xhr) {\n $('.paginated-spin i.fa').addClass('fa-spin');\n $('.paginated-spin').show();\n }\n })\n .done(paginatedVideos)\n .always(function() {\n $('.paginated-spin i').removeClass('fa-spin');\n $('.paginated-spin').hide();\n $('li input.page-input').val('1');\n $('li.previous-page a').attr('href', currentTarget);\n var nextTarget = currentTarget.substr(0, currentTarget.lastIndexOf('=') + 1) + 2;\n $('li.next-page a').attr('href', nextTarget);\n });\n });\n\n //Add the listener for the previous-page element\n $(\"li.previous-page a\").click(function(e) {\n e.preventDefault();\n var currentTarget = $(e.currentTarget).attr('href');\n currentTarget = currentTarget.substr(0, currentTarget.lastIndexOf('=') + 1);\n var newpage = parseInt($('li input.page-input').val()) - 1;\n if (newpage < 1) { newpage = 1; }\n var currentURL = currentTarget + newpage;\n var previousTarget = currentTarget + ((newpage - 1) < 1 ? 1 : (newpage - 1));\n var nextTarget = currentTarget + ((newpage + 1) > parseInt(total_pages) ? total_pages : (newpage + 1));\n $.ajax({\n url: currentURL,\n beforeSend: function(xhr) {\n $('.paginated-spin i.fa').addClass('fa-spin');\n $('.paginated-spin').show();\n }\n })\n .done(paginatedVideos)\n .always(function() {\n $('.paginated-spin i').removeClass('fa-spin');\n $('.paginated-spin').hide();\n $('li input.page-input').val(newpage);\n $(e.currentTarget).attr('href', previousTarget);\n $('li.next-page a').attr('href', nextTarget);\n });\n });\n\n //Add the listener for the next-page element\n $(\"li.next-page a\").click(function(e) {\n e.preventDefault();\n var currentTarget = $(e.currentTarget).attr('href');\n currentTarget = currentTarget.substr(0, currentTarget.lastIndexOf('=') + 1);\n var newpage = parseInt($('li input.page-input').val()) + 1;\n if (newpage > parseInt(total_pages)) { newpage = parseInt(total_pages); }\n var currentURL = currentTarget + newpage;\n var previousTarget = currentTarget + ((newpage - 1) < 1 ? 1 : (newpage - 1));\n var nextTarget = currentTarget + ((newpage + 1) > parseInt(total_pages) ? total_pages : (newpage + 1));\n $.ajax({\n url: currentURL,\n beforeSend: function(xhr) {\n $('.paginated-spin i.fa').addClass('fa-spin');\n $('.paginated-spin').show();\n }\n })\n .done(paginatedVideos)\n .always(function() {\n $('.paginated-spin i').removeClass('fa-spin');\n $('.paginated-spin').hide();\n $('li input.page-input').val(newpage);\n $('li.previous-page a').attr('href', previousTarget);\n $(e.currentTarget).attr('href', nextTarget);\n });\n });\n\n //Add the listener for the pager text input element\n $(\"li input.page-input\").change(function(e) {\n e.preventDefault();\n var currentTarget = avURL + '&pg=';\n var newpage = parseInt($(this).val());\n if (newpage > parseInt(total_pages)) { newpage = parseInt(total_pages); }\n if (newpage < 1) { newpage = 1; }\n var currentURL = currentTarget + newpage;\n var previousTarget = currentTarget + ((newpage - 1) < 1 ? 1 : (newpage - 1));\n var nextTarget = currentTarget + ((newpage + 1) > parseInt(total_pages) ? total_pages : (newpage + 1));\n $.ajax({\n url: currentURL,\n beforeSend: function(xhr) {\n $('.paginated-spin i.fa').addClass('fa-spin');\n $('.paginated-spin').show();\n }\n })\n .done(paginatedVideos)\n .always(function() {\n $('.paginated-spin i').removeClass('fa-spin');\n $('.paginated-spin').hide();\n $('li input.page-input').val(newpage);\n $('li.previous-page a').attr('href', previousTarget);\n $('li.next-page a').attr('href', nextTarget);\n });\n });\n\n //Add the event listener for the last-page element\n $(\"li.last-page a\").click(function(e) {\n e.preventDefault();\n var currentTarget = $(e.currentTarget).attr('href');\n var newpage = parseInt(total_pages);\n var previousTarget = avURL + (newpage - 1);\n $.ajax({\n url: currentTarget,\n beforeSend: function(xhr) {\n $('.paginated-spin i.fa').addClass('fa-spin');\n $('.paginated-spin').show();\n }\n })\n .done(paginatedVideos)\n .always(function() {\n $('.paginated-spin i').removeClass('fa-spin');\n $('.paginated-spin').hide();\n $('li input.page-input').val(newpage);\n $('li.previous-page a').attr('href', previousTarget);\n $('li.next-page a').attr('href', currentTarget);\n });\n });\n}", "function retrieve() {\n return playerInfo;\n }", "function getDataForVideo(videoId) {\n\t\t\n\t\t//make ajax call to the server to get data for that video\n\t\t$.ajax({\n\t\t\t\ttype: 'GET',\n\t\t\t\turl: vm_video_for_page_url+'?clientId='+vm_client_id+'&pageName='+vm_page_name+'&divId='+videoId+'&userId='+vm_user_id,\t\t\t\n\t\t\t\tsuccess: function(data) { \n\t\t\t\t\t\t\n\t\t\t\t\t\t//populate a centralized JS variable to store tracks for all of the videos\n\t\t\t\t\t\ttracksForVideos.push({\"videoId\":videoId,\"tracks\":data.tracks});\n\t\t\t\t\t\t\n\t\t\t\t\t\t//for track relate html - attach the necessary functions also\n\t\t\t\t\t\tattachTracksForVideo(videoId, data);\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\n\t\t\t});\n\t}", "function getSampleManifestASE (playback) {\n return playback.manifest = {\n \"movieId\": \"70136810\",\n \"mticket\": {\n \"tokendata\": \"NONE\",\n \"signature\": \"NONE\"\n },\n \"tracks\": [\n {\n \"type\": 1,\n \"stereo\": false,\n \"ict\": false,\n \"max_framerate_value\": \"6138\",\n \"max_framerate_scale\": \"256\",\n \"streams\": [\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDPCozaaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=qmZdhJnSVuewknAnuYgxTkcnHT0\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDPCozaaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=mUxVGE1Bi67Hqrnv6XMF1k-Kn9w\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDPCozaaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=0BzH5IbTZudq3vdKQbnzHL3iVWA\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803786989\",\n \"bitrate\": 235,\n \"hd\": false,\n \"superhd\": false,\n \"res_w\": 426,\n \"res_h\": 240,\n \"pix_w\": 4,\n \"pix_h\": 3,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n },\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDOAYXQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=Vs-SpsEleNdI3AHfHVQkDkNq4zI\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDOAYXQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=OOcO9b3wON4Y1d3k7fUnN5sPiTA\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDOAYXQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=ucktNc06mqV1tHXEgsax-26M924\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803787213\",\n \"bitrate\": 375,\n \"hd\": false,\n \"superhd\": false,\n \"res_w\": 512,\n \"res_h\": 288,\n \"pix_w\": 4,\n \"pix_h\": 3,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n },\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDOBIDRaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=qlkphJC0PBrNordDF1rK7ZLTjWI\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDOBIDRaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=d47hAA5gUPiSOt1T95bCMNYEnRk\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDOBIDRaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=VPdUHarD6TBNLzdQOI2YzGQCqK4\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803787742\",\n \"bitrate\": 560,\n \"hd\": false,\n \"superhd\": false,\n \"res_w\": 682,\n \"res_h\": 384,\n \"pix_w\": 4,\n \"pix_h\": 3,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n },\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDOBoTSaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=pcxTRO04Jo2vNOF9Gmg8FTOCjoI\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDOBoTSaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=pU2xXEofj8hNVpwQAf6QpPO76n0\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDOBoTSaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=k16wQ2XWbOjrDKl-7jDE62PYXM8\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803787501\",\n \"bitrate\": 750,\n \"hd\": false,\n \"superhd\": false,\n \"res_w\": 682,\n \"res_h\": 384,\n \"pix_w\": 4,\n \"pix_h\": 3,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n },\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBA4TUaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=QKiihTkVPkUMYakkCaEUoDujliw\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDBA4TUaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=OXB5GQnolbBpbHeGNdftRUV62N4\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBA4TUaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=YzKippu4ekAeqNOrE42Ldhu1-ok\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803788007\",\n \"bitrate\": 1050,\n \"hd\": false,\n \"superhd\": false,\n \"res_w\": 853,\n \"res_h\": 480,\n \"pix_w\": 4,\n \"pix_h\": 3,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n },\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBAYzSaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=hWZY8Aiwknnx8O7ZFFEMyprGdwM\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDBAYzSaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=oCVRgMWvBT-U8CTcmzMchjwx8jk\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBAYzSaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=CUM7dF82nRTdjySxcIL7o2i4JKw\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803788281\",\n \"bitrate\": 1750,\n \"hd\": false,\n \"superhd\": false,\n \"res_w\": 853,\n \"res_h\": 480,\n \"pix_w\": 32,\n \"pix_h\": 27,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n },\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBAIXQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=hriGYUr_P8VGRIS25dldXzG6iYE\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDBAIXQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=iyDwqgqPlKEmMm28-eWhCeBHtLk\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBAIXQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=EKhUov4Ti-UZbR0yGMiUrXbLi2s\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803788313\",\n \"bitrate\": 2350,\n \"hd\": true,\n \"superhd\": false,\n \"res_w\": 1280,\n \"res_h\": 720,\n \"pix_w\": 1,\n \"pix_h\": 1,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n },\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBBITQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=26ETtjjD6kERrIZH-Qc4D_QGECM\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDBBITQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=pO6OCkW8os7S7fO7nsvQUxwLenU\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBBITQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=ls-qxBVqEEYK04_8tuyHxm0k0EY\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803788703\",\n \"bitrate\": 3000,\n \"hd\": true,\n \"superhd\": false,\n \"res_w\": 1280,\n \"res_h\": 720,\n \"pix_w\": 1,\n \"pix_h\": 1,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n }\n ]\n },\n {\n \"type\": 0,\n \"track_id\": \"65737c322e307c5072696d6172797c66616c73657c6e6f6e657c756e6b6e6f776e7c756e6b6e6f776e7c417564696f7c756e6b6e6f776e7c7c\",\n \"disallowedtimedText\": [\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c6e627c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c70742d42527c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c66727c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"none\"\n ],\n \"streams\": [\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHKAI3aaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=xTppQNrnwh_AO1bW5Yf9X_C07zs\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHKAI3aaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=ptS23btm-JCZy2YIiqmSqejFgso\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHKAI3aaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=Qtg2b4ZMMeGXzkKQMio2-GGlwIw\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816293399\",\n \"bitrate\": 64,\n \"channels\": \"2.0\",\n \"language\": \"es\",\n \"trackType\": \"PRIMARY\"\n },\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHMAIbVaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=rkSf03qm-Hg_og9IWYDhBCCqHy8\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHMAIbVaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=rY3YnOVex3xr8VTAZHww8bAY0Dw\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHMAIbVaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=XBmm_dm6oCbM86Mhs5owAc6c_OA\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816295326\",\n \"bitrate\": 96,\n \"channels\": \"2.0\",\n \"language\": \"es\",\n \"trackType\": \"PRIMARY\"\n }\n ]\n },\n {\n \"type\": 0,\n \"track_id\": \"66727c322e307c5072696d6172797c66616c73657c6e6f6e657c756e6b6e6f776e7c756e6b6e6f776e7c417564696f7c756e6b6e6f776e7c7c\",\n \"disallowedtimedText\": [\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c6e627c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c70742d42527c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c65737c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"none\"\n ],\n \"streams\": [\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KJ2MrgSzMAYTTaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=6FxACMnxIlBjeirDNhGAq4McmKk\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KJ2MrgSzMAYTTaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=zrMkNaBJh91dJvZfVUvZIkxr_Aw\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KJ2MrgSzMAYTTaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=32Bk2t0fRRChAgd9sc5rh36nbQ8\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1774345200\",\n \"bitrate\": 64,\n \"channels\": \"2.0\",\n \"language\": \"fr\",\n \"trackType\": \"PRIMARY\"\n },\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHNBYbXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=BoeLnHGpIBFgoou4GMi3lK7YvTk\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHNBYbXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=2HPV-9bpUd9HClEtqn097uCFF6I\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHNBYbXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=1n77Zzty_BR6P9IK4NGCxlmUvJ8\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816294624\",\n \"bitrate\": 96,\n \"channels\": \"2.0\",\n \"language\": \"fr\",\n \"trackType\": \"PRIMARY\"\n }\n ]\n },\n {\n \"type\": 0,\n \"track_id\": \"7a687c322e307c5072696d6172797c66616c73657c6e6f6e657c756e6b6e6f776e7c756e6b6e6f776e7c417564696f7c756e6b6e6f776e7c7c\",\n \"disallowedtimedText\": [\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c6e627c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c70742d42527c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c66727c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c65737c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\"\n ],\n \"streams\": [\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHIA4zSaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=lY-Fmmqcqg3_t_ukYja13fFPupk\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHIA4zSaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=Q8U_DiaTZ3SCtomTGfbgBLgHTrA\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHIA4zSaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=K3McDdXSB7eptsfWDjykbXToXYM\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816291081\",\n \"bitrate\": 64,\n \"channels\": \"2.0\",\n \"language\": \"zh\",\n \"trackType\": \"PRIMARY\"\n },\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHKCoTXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=plhuwrIPllKFQxpejM_6T8zbex4\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHKCoTXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=xNnbfFQ5xim4XNCr7FYm_UkmTgY\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHKCoTXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=xwiRrEPhz_ns_OfVR0Q2YkHQk2E\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816293904\",\n \"bitrate\": 96,\n \"channels\": \"2.0\",\n \"language\": \"zh\",\n \"trackType\": \"PRIMARY\"\n }\n ]\n },\n {\n \"type\": 0,\n \"track_id\": \"656e7c322e307c5072696d6172797c747275657c6e6f6e657c756e6b6e6f776e7c756e6b6e6f776e7c417564696f7c756e6b6e6f776e7c7c\",\n \"disallowedtimedText\": [\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c6e627c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c70742d42527c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c66727c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c65737c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\"\n ],\n \"streams\": [\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHLBYfXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=XjSqEv1CYrOcUt0kRObfNmZSqMA\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHLBYfXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=jYE51yKSaI0CLdExbzFc3KOeNvk\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHLBYfXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=sqNReiPj8D8-e-7GUzuteS5xYpw\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816292634\",\n \"bitrate\": 64,\n \"channels\": \"2.0\",\n \"language\": \"en\",\n \"trackType\": \"PRIMARY\"\n },\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHMBYPTaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=vMcMutSI6h8JEBRe0mkVWqbibPg\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHMBYPTaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=gZch8uZCx-frRDg8AEscRX5IXrU\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHMBYPTaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=76tySe_D_cx4jjs-6LutpfwZSqs\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816295670\",\n \"bitrate\": 96,\n \"channels\": \"2.0\",\n \"language\": \"en\",\n \"trackType\": \"PRIMARY\"\n }\n ]\n },\n {\n \"type\": 0,\n \"track_id\": \"64657c322e307c5072696d6172797c66616c73657c6e6f6e657c756e6b6e6f776e7c756e6b6e6f776e7c417564696f7c756e6b6e6f776e7c7c\",\n \"disallowedtimedText\": [\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c6e627c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c70742d42527c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c66727c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c65737c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\"\n ],\n \"streams\": [\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHIC4bXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=V7hts0k2y0yVr6SHil2kNbAaKyk\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHIC4bXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=_BekWjpX0ZcIMhPcYFs0_QmDKz8\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHIC4bXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=m82To290gn_Uw80yYmKEE1MEYag\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816291824\",\n \"bitrate\": 64,\n \"channels\": \"2.0\",\n \"language\": \"de\",\n \"trackType\": \"PRIMARY\"\n },\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHPBoXbaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=jwg3ij1Bo6WbJ3Eg3JckjIbVqiI\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHPBoXbaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=P-SPsGfj6FMsA6lqMI6rgYAD2OY\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHPBoXbaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=WuEcP_whfKVf6kQMP0T69oosM_o\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816296518\",\n \"bitrate\": 96,\n \"channels\": \"2.0\",\n \"language\": \"de\",\n \"trackType\": \"PRIMARY\"\n }\n ]\n }\n ],\n \"trickplays\": [\n {\n \"urls\": [\n \"http://tp.akam.nflximg.com/tpa3/897/1980102897.bif\"\n ],\n \"width\": \"320\",\n \"height\": \"180\",\n \"pixelAspectX\": \"1\",\n \"pixelAspectY\": \"1\",\n \"interval\": \"10\",\n \"id\": \"1980102897\"\n },\n {\n \"urls\": [\n \"http://tp.akam.nflximg.com/tpa1/083/1980103083.bif\"\n ],\n \"width\": \"240\",\n \"height\": \"122\",\n \"pixelAspectX\": \"1\",\n \"pixelAspectY\": \"1\",\n \"interval\": \"10\",\n \"id\": \"1980103083\"\n }\n ],\n \"duration\": 670000,\n \"locations\": [\n {\n \"key\": \"sjc002.ix-cr-01-high\",\n \"rank\": 2,\n \"level\": 1,\n \"weight\": 160\n },\n {\n \"key\": \"20\",\n \"rank\": 5,\n \"level\": 0,\n \"weight\": 100\n },\n {\n \"key\": \"lax001.ix-cr-02-high\",\n \"rank\": 3,\n \"level\": 1,\n \"weight\": 140\n },\n {\n \"key\": \"19\",\n \"rank\": 4,\n \"level\": 0,\n \"weight\": 120\n },\n {\n \"key\": \"ix.phl001.a-high\",\n \"rank\": 1,\n \"level\": 1,\n \"weight\": 180\n }\n ],\n \"servers\": [\n {\n \"name\": \"c001.phl001.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 17328,\n \"key\": \"ix.phl001.a-high\",\n \"rank\": 1,\n \"lowgrade\": false\n },\n {\n \"name\": \"c015.sjc002.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 11066,\n \"key\": \"sjc002.ix-cr-01-high\",\n \"rank\": 2,\n \"lowgrade\": false\n },\n {\n \"name\": \"c047.lax001.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 10988,\n \"key\": \"lax001.ix-cr-02-high\",\n \"rank\": 3,\n \"lowgrade\": false\n },\n {\n \"name\": \"akamaitp\",\n \"type\": \"BIG_CDN\",\n \"id\": 19,\n \"key\": \"19\",\n \"rank\": 4,\n \"lowgrade\": false\n },\n {\n \"name\": \"akamaiso\",\n \"type\": \"BIG_CDN\",\n \"id\": 20,\n \"key\": \"20\",\n \"rank\": 5,\n \"lowgrade\": false\n }\n ],\n \"video_tracks\": [\n {\n \"type\": 1,\n \"stereo\": false,\n \"ict\": false,\n \"max_framerate_value\": \"6138\",\n \"max_framerate_scale\": \"256\",\n \"streams\": [\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDPCozaaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=qmZdhJnSVuewknAnuYgxTkcnHT0\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDPCozaaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=mUxVGE1Bi67Hqrnv6XMF1k-Kn9w\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDPCozaaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=0BzH5IbTZudq3vdKQbnzHL3iVWA\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803786989\",\n \"bitrate\": 235,\n \"hd\": false,\n \"superhd\": false,\n \"res_w\": 426,\n \"res_h\": 240,\n \"pix_w\": 4,\n \"pix_h\": 3,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n },\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDOAYXQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=Vs-SpsEleNdI3AHfHVQkDkNq4zI\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDOAYXQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=OOcO9b3wON4Y1d3k7fUnN5sPiTA\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDOAYXQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=ucktNc06mqV1tHXEgsax-26M924\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803787213\",\n \"bitrate\": 375,\n \"hd\": false,\n \"superhd\": false,\n \"res_w\": 512,\n \"res_h\": 288,\n \"pix_w\": 4,\n \"pix_h\": 3,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n },\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDOBIDRaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=qlkphJC0PBrNordDF1rK7ZLTjWI\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDOBIDRaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=d47hAA5gUPiSOt1T95bCMNYEnRk\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDOBIDRaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=VPdUHarD6TBNLzdQOI2YzGQCqK4\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803787742\",\n \"bitrate\": 560,\n \"hd\": false,\n \"superhd\": false,\n \"res_w\": 682,\n \"res_h\": 384,\n \"pix_w\": 4,\n \"pix_h\": 3,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n },\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDOBoTSaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=pcxTRO04Jo2vNOF9Gmg8FTOCjoI\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDOBoTSaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=pU2xXEofj8hNVpwQAf6QpPO76n0\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDOBoTSaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=k16wQ2XWbOjrDKl-7jDE62PYXM8\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803787501\",\n \"bitrate\": 750,\n \"hd\": false,\n \"superhd\": false,\n \"res_w\": 682,\n \"res_h\": 384,\n \"pix_w\": 4,\n \"pix_h\": 3,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n },\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBA4TUaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=QKiihTkVPkUMYakkCaEUoDujliw\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDBA4TUaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=OXB5GQnolbBpbHeGNdftRUV62N4\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBA4TUaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=YzKippu4ekAeqNOrE42Ldhu1-ok\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803788007\",\n \"bitrate\": 1050,\n \"hd\": false,\n \"superhd\": false,\n \"res_w\": 853,\n \"res_h\": 480,\n \"pix_w\": 4,\n \"pix_h\": 3,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n },\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBAYzSaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=hWZY8Aiwknnx8O7ZFFEMyprGdwM\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDBAYzSaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=oCVRgMWvBT-U8CTcmzMchjwx8jk\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBAYzSaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=CUM7dF82nRTdjySxcIL7o2i4JKw\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803788281\",\n \"bitrate\": 1750,\n \"hd\": false,\n \"superhd\": false,\n \"res_w\": 853,\n \"res_h\": 480,\n \"pix_w\": 32,\n \"pix_h\": 27,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n },\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBAIXQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=hriGYUr_P8VGRIS25dldXzG6iYE\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDBAIXQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=iyDwqgqPlKEmMm28-eWhCeBHtLk\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBAIXQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=EKhUov4Ti-UZbR0yGMiUrXbLi2s\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803788313\",\n \"bitrate\": 2350,\n \"hd\": true,\n \"superhd\": false,\n \"res_w\": 1280,\n \"res_h\": 720,\n \"pix_w\": 1,\n \"pix_h\": 1,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n },\n {\n \"type\": 1,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBBITQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=26ETtjjD6kERrIZH-Qc4D_QGECM\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGQshSDBBITQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=pO6OCkW8os7S7fO7nsvQUxwLenU\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGQshSDBBITQaaSWdnuQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=ls-qxBVqEEYK04_8tuyHxm0k0EY\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"playready-h264mpl30-dash\",\n \"downloadable_id\": \"1803788703\",\n \"bitrate\": 3000,\n \"hd\": true,\n \"superhd\": false,\n \"res_w\": 1280,\n \"res_h\": 720,\n \"pix_w\": 1,\n \"pix_h\": 1,\n \"framerate_value\": 6138,\n \"framerate_scale\": 256\n }\n ]\n }\n ],\n \"hasDrm\": true,\n \"hasClear\": false,\n \"audio_tracks\": [\n {\n \"type\": 0,\n \"track_id\": \"65737c322e307c5072696d6172797c66616c73657c6e6f6e657c756e6b6e6f776e7c756e6b6e6f776e7c417564696f7c756e6b6e6f776e7c7c\",\n \"disallowedtimedText\": [\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c6e627c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c70742d42527c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c66727c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"none\"\n ],\n \"streams\": [\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHKAI3aaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=xTppQNrnwh_AO1bW5Yf9X_C07zs\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHKAI3aaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=ptS23btm-JCZy2YIiqmSqejFgso\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHKAI3aaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=Qtg2b4ZMMeGXzkKQMio2-GGlwIw\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816293399\",\n \"bitrate\": 64,\n \"channels\": \"2.0\",\n \"language\": \"es\",\n \"trackType\": \"PRIMARY\"\n },\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHMAIbVaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=rkSf03qm-Hg_og9IWYDhBCCqHy8\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHMAIbVaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=rY3YnOVex3xr8VTAZHww8bAY0Dw\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHMAIbVaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=XBmm_dm6oCbM86Mhs5owAc6c_OA\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816295326\",\n \"bitrate\": 96,\n \"channels\": \"2.0\",\n \"language\": \"es\",\n \"trackType\": \"PRIMARY\"\n }\n ]\n },\n {\n \"type\": 0,\n \"track_id\": \"66727c322e307c5072696d6172797c66616c73657c6e6f6e657c756e6b6e6f776e7c756e6b6e6f776e7c417564696f7c756e6b6e6f776e7c7c\",\n \"disallowedtimedText\": [\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c6e627c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c70742d42527c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c65737c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"none\"\n ],\n \"streams\": [\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KJ2MrgSzMAYTTaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=6FxACMnxIlBjeirDNhGAq4McmKk\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KJ2MrgSzMAYTTaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=zrMkNaBJh91dJvZfVUvZIkxr_Aw\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KJ2MrgSzMAYTTaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=32Bk2t0fRRChAgd9sc5rh36nbQ8\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1774345200\",\n \"bitrate\": 64,\n \"channels\": \"2.0\",\n \"language\": \"fr\",\n \"trackType\": \"PRIMARY\"\n },\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHNBYbXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=BoeLnHGpIBFgoou4GMi3lK7YvTk\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHNBYbXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=2HPV-9bpUd9HClEtqn097uCFF6I\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHNBYbXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=1n77Zzty_BR6P9IK4NGCxlmUvJ8\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816294624\",\n \"bitrate\": 96,\n \"channels\": \"2.0\",\n \"language\": \"fr\",\n \"trackType\": \"PRIMARY\"\n }\n ]\n },\n {\n \"type\": 0,\n \"track_id\": \"7a687c322e307c5072696d6172797c66616c73657c6e6f6e657c756e6b6e6f776e7c756e6b6e6f776e7c417564696f7c756e6b6e6f776e7c7c\",\n \"disallowedtimedText\": [\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c6e627c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c70742d42527c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c66727c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c65737c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\"\n ],\n \"streams\": [\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHIA4zSaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=lY-Fmmqcqg3_t_ukYja13fFPupk\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHIA4zSaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=Q8U_DiaTZ3SCtomTGfbgBLgHTrA\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHIA4zSaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=K3McDdXSB7eptsfWDjykbXToXYM\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816291081\",\n \"bitrate\": 64,\n \"channels\": \"2.0\",\n \"language\": \"zh\",\n \"trackType\": \"PRIMARY\"\n },\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHKCoTXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=plhuwrIPllKFQxpejM_6T8zbex4\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHKCoTXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=xNnbfFQ5xim4XNCr7FYm_UkmTgY\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHKCoTXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=xwiRrEPhz_ns_OfVR0Q2YkHQk2E\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816293904\",\n \"bitrate\": 96,\n \"channels\": \"2.0\",\n \"language\": \"zh\",\n \"trackType\": \"PRIMARY\"\n }\n ]\n },\n {\n \"type\": 0,\n \"track_id\": \"656e7c322e307c5072696d6172797c747275657c6e6f6e657c756e6b6e6f776e7c756e6b6e6f776e7c417564696f7c756e6b6e6f776e7c7c\",\n \"disallowedtimedText\": [\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c6e627c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c70742d42527c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c66727c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c65737c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\"\n ],\n \"streams\": [\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHLBYfXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=XjSqEv1CYrOcUt0kRObfNmZSqMA\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHLBYfXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=jYE51yKSaI0CLdExbzFc3KOeNvk\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHLBYfXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=sqNReiPj8D8-e-7GUzuteS5xYpw\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816292634\",\n \"bitrate\": 64,\n \"channels\": \"2.0\",\n \"language\": \"en\",\n \"trackType\": \"PRIMARY\"\n },\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHMBYPTaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=vMcMutSI6h8JEBRe0mkVWqbibPg\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHMBYPTaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=gZch8uZCx-frRDg8AEscRX5IXrU\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHMBYPTaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=76tySe_D_cx4jjs-6LutpfwZSqs\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816295670\",\n \"bitrate\": 96,\n \"channels\": \"2.0\",\n \"language\": \"en\",\n \"trackType\": \"PRIMARY\"\n }\n ]\n },\n {\n \"type\": 0,\n \"track_id\": \"64657c322e307c5072696d6172797c66616c73657c6e6f6e657c756e6b6e6f776e7c756e6b6e6f776e7c417564696f7c756e6b6e6f776e7c7c\",\n \"disallowedtimedText\": [\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c6e627c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c70742d42527c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c66727c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c65737c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\"\n ],\n \"streams\": [\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHIC4bXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=V7hts0k2y0yVr6SHil2kNbAaKyk\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHIC4bXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=_BekWjpX0ZcIMhPcYFs0_QmDKz8\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHIC4bXaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=m82To290gn_Uw80yYmKEE1MEYag\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816291824\",\n \"bitrate\": 64,\n \"channels\": \"2.0\",\n \"language\": \"de\",\n \"trackType\": \"PRIMARY\"\n },\n {\n \"type\": 0,\n \"urls\": [\n {\n \"url\": \"http://ipv6_1.lagg0.c047.lax001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHPBoXbaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=jwg3ij1Bo6WbJ3Eg3JckjIbVqiI\",\n \"cdn_id\": \"10988\"\n },\n {\n \"url\": \"http://198.45.62.144/?o=AQHaLKnhKgAlvg7KKGUpgCHPBoXbaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=P-SPsGfj6FMsA6lqMI6rgYAD2OY\",\n \"cdn_id\": \"11066\"\n },\n {\n \"url\": \"http://ipv6_1.lagg0.c001.phl001.ix.nflxvideo.net/?o=AQHaLKnhKgAlvg7KKGUpgCHPBoXbaaSWdmyQ3PU_lYttz2KuCXr7GxjNtXBfVSB3fDuKZoNi3YodUsgJnXPN8XT2vxBKCyt1KJJxWJ9WGsQJUuYHJvBRJ2Em4e80g7--&v=3&e=1415771983&t=WuEcP_whfKVf6kQMP0T69oosM_o\",\n \"cdn_id\": \"17328\"\n }\n ],\n \"content_profile\": \"heaac-2-dash\",\n \"downloadable_id\": \"1816296518\",\n \"bitrate\": 96,\n \"channels\": \"2.0\",\n \"language\": \"de\",\n \"trackType\": \"PRIMARY\"\n }\n ]\n }\n ],\n \"audioTrackList\": [\n {\n \"id\": \"65737c322e307c5072696d6172797c66616c73657c6e6f6e657c756e6b6e6f776e7c756e6b6e6f776e7c417564696f7c756e6b6e6f776e7c7c\",\n \"channels\": \"2.0\",\n \"codecName\": \"AAC\",\n \"disallowedSubtitleTracks\": [\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c6e627c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c70742d42527c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c66727c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"none\"\n ],\n \"isNative\": false,\n \"language\": \"es\",\n \"languageDescription\": \"Spanish\",\n \"rawTrackType\": \"primary\",\n \"trackType\": \"PRIMARY\"\n },\n {\n \"id\": \"66727c322e307c5072696d6172797c66616c73657c6e6f6e657c756e6b6e6f776e7c756e6b6e6f776e7c417564696f7c756e6b6e6f776e7c7c\",\n \"channels\": \"2.0\",\n \"codecName\": \"AAC\",\n \"disallowedSubtitleTracks\": [\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c6e627c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c70742d42527c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c65737c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"none\"\n ],\n \"isNative\": false,\n \"language\": \"fr\",\n \"languageDescription\": \"French\",\n \"rawTrackType\": \"primary\",\n \"trackType\": \"PRIMARY\"\n },\n {\n \"id\": \"7a687c322e307c5072696d6172797c66616c73657c6e6f6e657c756e6b6e6f776e7c756e6b6e6f776e7c417564696f7c756e6b6e6f776e7c7c\",\n \"channels\": \"2.0\",\n \"codecName\": \"AAC\",\n \"disallowedSubtitleTracks\": [\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c6e627c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c70742d42527c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c66727c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c65737c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\"\n ],\n \"isNative\": false,\n \"language\": \"zh\",\n \"languageDescription\": \"Chinese\",\n \"rawTrackType\": \"primary\",\n \"trackType\": \"PRIMARY\"\n },\n {\n \"id\": \"656e7c322e307c5072696d6172797c747275657c6e6f6e657c756e6b6e6f776e7c756e6b6e6f776e7c417564696f7c756e6b6e6f776e7c7c\",\n \"channels\": \"2.0\",\n \"codecName\": \"AAC\",\n \"disallowedSubtitleTracks\": [\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c6e627c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c70742d42527c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c66727c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c65737c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\"\n ],\n \"isNative\": true,\n \"language\": \"en\",\n \"languageDescription\": \"English\",\n \"rawTrackType\": \"primary\",\n \"trackType\": \"PRIMARY\"\n },\n {\n \"id\": \"64657c322e307c5072696d6172797c66616c73657c6e6f6e657c756e6b6e6f776e7c756e6b6e6f776e7c417564696f7c756e6b6e6f776e7c7c\",\n \"channels\": \"2.0\",\n \"codecName\": \"AAC\",\n \"disallowedSubtitleTracks\": [\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c6e627c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c70742d42527c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c66727c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c65737c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\"\n ],\n \"isNative\": false,\n \"language\": \"de\",\n \"languageDescription\": \"German\",\n \"rawTrackType\": \"primary\",\n \"trackType\": \"PRIMARY\"\n }\n ],\n \"timedtexttracks\": [\n {\n \"type\": \"timedtext\",\n \"id\": \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c65737c5375627469746c65737c756e6b6e6f776e7c546578747c636f6d6d656e746172797c61346639633637322d663464662d346131362d616437322d3738663663623239333963327c7361346639633637322d663464662d346131362d616437322d3738663663623239333963322e6c\",\n \"downloadableId\": \"1111614247\",\n \"rawTrackType\": \"subtitles\",\n \"trackType\": \"PRIMARY\",\n \"ttDownloadables\": {\n \"simplesdh\": {\n \"hashAlgo\": \"sha1\",\n \"hashValue\": \"XDKfnmBtGfTxrgZzk9sjd6z0RxM=\",\n \"downloadUrls\": {\n \"20\": \"http://so0.akam.nflximg.com/soa2/247/1111614247.dfxp?v=1&e=1415683657&t=zmv6fvYzcaKBeEabvqq7SLqg2gA\"\n },\n \"size\": 107001\n },\n \"dfxp-ls-sdh\": {\n \"hashAlgo\": \"sha1\",\n \"hashValue\": \"fomzIy6aQ4HmuBCT+yQ7Ubk+8NM=\",\n \"downloadUrls\": {\n \"20\": \"http://so0.akam.nflximg.com/soa6/792/1111616792.dfxp?v=1&e=1415683657&t=QZxQ9VYWIcesYz-KGN4epslLmc8\"\n },\n \"size\": 124043\n }\n },\n \"language\": \"es-x-cm\",\n \"languageDescription\": \"Spanish\",\n \"cdnlist\": [\n {\n \"name\": \"c059.sjc002.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 12731,\n \"key\": \"sjc002.ix-cr-02-high\",\n \"rank\": 1,\n \"lowgrade\": false\n },\n {\n \"name\": \"c300.sjc002.dev.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 15693,\n \"key\": \"sjc002.ix-cr-01-high\",\n \"rank\": 2,\n \"lowgrade\": false\n },\n {\n \"name\": \"c085.lax004.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 14960,\n \"key\": \"lax004.ix-asr-01-high\",\n \"rank\": 3,\n \"lowgrade\": false\n },\n {\n \"name\": \"akamaitp\",\n \"type\": \"BIG_CDN\",\n \"id\": 19,\n \"key\": \"19\",\n \"rank\": 4,\n \"lowgrade\": false\n },\n {\n \"name\": \"akamaiso\",\n \"type\": \"BIG_CDN\",\n \"id\": 20,\n \"key\": \"20\",\n \"rank\": 5,\n \"lowgrade\": false\n }\n ]\n },\n {\n \"type\": \"timedtext\",\n \"id\": \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c65737c5375627469746c65737c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"downloadableId\": \"778566404\",\n \"rawTrackType\": \"subtitles\",\n \"trackType\": \"PRIMARY\",\n \"ttDownloadables\": {\n \"dfxp-ls-sdh\": {\n \"hashAlgo\": \"sha1\",\n \"hashValue\": \"8I4VoRmHyCKdPJRXplTJqcwf28A=\",\n \"downloadUrls\": {\n \"20\": \"http://so0.akam.nflximg.com/soa6/404/778566404.dfxp?v=1&e=1415683657&t=uYy5qaMZ5TqLwj6zOA6plt1qOhQ\"\n },\n \"size\": 134421\n },\n \"simplesdh\": {\n \"hashAlgo\": \"sha1\",\n \"hashValue\": \"Ems7qgwiPsalPuwgU0ol4i56pX0=\",\n \"downloadUrls\": {\n \"20\": \"http://so0.akam.nflximg.com/soa5/394/778566394.dfxp?v=1&e=1415683657&t=e2jabKftYQgiuRcMNaPot23Hp2Q\"\n },\n \"size\": 81337\n }\n },\n \"language\": \"es\",\n \"languageDescription\": \"Spanish\",\n \"cdnlist\": [\n {\n \"name\": \"c059.sjc002.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 12731,\n \"key\": \"sjc002.ix-cr-02-high\",\n \"rank\": 1,\n \"lowgrade\": false\n },\n {\n \"name\": \"c300.sjc002.dev.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 15693,\n \"key\": \"sjc002.ix-cr-01-high\",\n \"rank\": 2,\n \"lowgrade\": false\n },\n {\n \"name\": \"c085.lax004.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 14960,\n \"key\": \"lax004.ix-asr-01-high\",\n \"rank\": 3,\n \"lowgrade\": false\n },\n {\n \"name\": \"akamaitp\",\n \"type\": \"BIG_CDN\",\n \"id\": 19,\n \"key\": \"19\",\n \"rank\": 4,\n \"lowgrade\": false\n },\n {\n \"name\": \"akamaiso\",\n \"type\": \"BIG_CDN\",\n \"id\": 20,\n \"key\": \"20\",\n \"rank\": 5,\n \"lowgrade\": false\n }\n ]\n },\n {\n \"type\": \"timedtext\",\n \"id\": \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c65737c466f726365647c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"downloadableId\": \"778592140\",\n \"rawTrackType\": \"forced\",\n \"trackType\": \"PRIMARY\",\n \"ttDownloadables\": {\n \"simplesdh\": {\n \"hashAlgo\": \"sha1\",\n \"hashValue\": \"f1T8f1y8LC9KnpshA2Su8GABcp4=\",\n \"downloadUrls\": {\n \"20\": \"http://so0.akam.nflximg.com/soa5/140/778592140.dfxp?v=1&e=1415683657&t=Tf4nGeiQP1ocfznwzpnSHvDaQio\"\n },\n \"size\": 617\n },\n \"dfxp-ls-sdh\": {\n \"hashAlgo\": \"sha1\",\n \"hashValue\": \"B48oqRnlcwHVPl3L4+typjOyQbg=\",\n \"downloadUrls\": {\n \"20\": \"http://so0.akam.nflximg.com/soa4/630/778597630.dfxp?v=1&e=1415683657&t=sQaL-iggc8FS5Rh4df7AUPjKUt8\"\n },\n \"size\": 1002\n }\n },\n \"language\": \"es-x-fn\",\n \"languageDescription\": \"Off\",\n \"cdnlist\": [\n {\n \"name\": \"c059.sjc002.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 12731,\n \"key\": \"sjc002.ix-cr-02-high\",\n \"rank\": 1,\n \"lowgrade\": false\n },\n {\n \"name\": \"c300.sjc002.dev.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 15693,\n \"key\": \"sjc002.ix-cr-01-high\",\n \"rank\": 2,\n \"lowgrade\": false\n },\n {\n \"name\": \"c085.lax004.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 14960,\n \"key\": \"lax004.ix-asr-01-high\",\n \"rank\": 3,\n \"lowgrade\": false\n },\n {\n \"name\": \"akamaitp\",\n \"type\": \"BIG_CDN\",\n \"id\": 19,\n \"key\": \"19\",\n \"rank\": 4,\n \"lowgrade\": false\n },\n {\n \"name\": \"akamaiso\",\n \"type\": \"BIG_CDN\",\n \"id\": 20,\n \"key\": \"20\",\n \"rank\": 5,\n \"lowgrade\": false\n }\n ]\n },\n {\n \"type\": \"timedtext\",\n \"id\": \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c656e7c436c6f73656443617074696f6e737c756e6b6e6f776e7c546578747c7072696d6172797c7c\",\n \"downloadableId\": \"38782057\",\n \"rawTrackType\": \"closedcaptions\",\n \"trackType\": \"ASSISTIVE\",\n \"ttDownloadables\": {\n \"dfxp-ls-sdh\": {\n \"hashAlgo\": \"sha1\",\n \"hashValue\": \"9xQmn17BQtU/3iWAR57xrNO+5bw=\",\n \"downloadUrls\": {\n \"20\": \"http://so0.akam.nflximg.com/soa2/057/38782057.dfxp?v=1&e=1415683657&t=le9dVRrzxPkMD54LBfF1-_FKq2E\"\n },\n \"size\": 137582\n },\n \"simplesdh\": {\n \"hashAlgo\": \"sha1\",\n \"hashValue\": \"dzYswvxETB2lRD3BenaWfXnyOuw=\",\n \"downloadUrls\": {\n \"20\": \"http://so0.akam.nflximg.com/soa6/989/2030152989.dfxp?v=1&e=1415683657&t=8dLdpcnUTILXRL6ZX9vsheX7G9k\"\n },\n \"size\": 96350\n }\n },\n \"language\": \"en\",\n \"languageDescription\": \"English\",\n \"cdnlist\": [\n {\n \"name\": \"c059.sjc002.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 12731,\n \"key\": \"sjc002.ix-cr-02-high\",\n \"rank\": 1,\n \"lowgrade\": false\n },\n {\n \"name\": \"c300.sjc002.dev.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 15693,\n \"key\": \"sjc002.ix-cr-01-high\",\n \"rank\": 2,\n \"lowgrade\": false\n },\n {\n \"name\": \"c085.lax004.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 14960,\n \"key\": \"lax004.ix-asr-01-high\",\n \"rank\": 3,\n \"lowgrade\": false\n },\n {\n \"name\": \"akamaitp\",\n \"type\": \"BIG_CDN\",\n \"id\": 19,\n \"key\": \"19\",\n \"rank\": 4,\n \"lowgrade\": false\n },\n {\n \"name\": \"akamaiso\",\n \"type\": \"BIG_CDN\",\n \"id\": 20,\n \"key\": \"20\",\n \"rank\": 5,\n \"lowgrade\": false\n }\n ]\n },\n {\n \"type\": \"timedtext\",\n \"id\": \"6e6f6e657c554e4b4e4f574e7c756e6b6e6f776e7c66616c73657c656e7c5375627469746c65737c756e6b6e6f776e7c546578747c636f6d6d656e746172797c61346639633637322d663464662d346131362d616437322d3738663663623239333963327c7361346639633637322d663464662d346131362d616437322d3738663663623239333963322e6c\",\n \"downloadableId\": \"1098606018\",\n \"rawTrackType\": \"subtitles\",\n \"trackType\": \"PRIMARY\",\n \"ttDownloadables\": {\n \"simplesdh\": {\n \"hashAlgo\": \"sha1\",\n \"hashValue\": \"Ewdkq6v7uTm4WDwCMP5blmNaY/0=\",\n \"downloadUrls\": {\n \"20\": \"http://so0.akam.nflximg.com/soa3/018/1098606018.dfxp?v=1&e=1415683657&t=ZAZDtMh_oBfsaY4BwYtEa48y_Ig\"\n },\n \"size\": 112833\n },\n \"dfxp-ls-sdh\": {\n \"hashAlgo\": \"sha1\",\n \"hashValue\": \"dNid/3s2eWwun1r5mXmkRx4AXY0=\",\n \"downloadUrls\": {\n \"20\": \"http://so0.akam.nflximg.com/soa2/838/1098608838.dfxp?v=1&e=1415683657&t=P2rU6C1wM2smCaxJUS29zaGxl4U\"\n },\n \"size\": 263609\n }\n },\n \"language\": \"en-x-cm\",\n \"languageDescription\": \"English\",\n \"cdnlist\": [\n {\n \"name\": \"c059.sjc002.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 12731,\n \"key\": \"sjc002.ix-cr-02-high\",\n \"rank\": 1,\n \"lowgrade\": false\n },\n {\n \"name\": \"c300.sjc002.dev.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 15693,\n \"key\": \"sjc002.ix-cr-01-high\",\n \"rank\": 2,\n \"lowgrade\": false\n },\n {\n \"name\": \"c085.lax004.ix.nflxvideo.net\",\n \"type\": \"OPEN_CONNECT_APPLIANCE\",\n \"id\": 14960,\n \"key\": \"lax004.ix-asr-01-high\",\n \"rank\": 3,\n \"lowgrade\": false\n },\n {\n \"name\": \"akamaitp\",\n \"type\": \"BIG_CDN\",\n \"id\": 19,\n \"key\": \"19\",\n \"rank\": 4,\n \"lowgrade\": false\n },\n {\n \"name\": \"akamaiso\",\n \"type\": \"BIG_CDN\",\n \"id\": 20,\n \"key\": \"20\",\n \"rank\": 5,\n \"lowgrade\": false\n }\n ]\n }\n ]\n };\n}", "function getVideoLink(item) {\n var videoID = item.id.videoId;\n var thumb = item.snippet.thumbnails.high.url;\n //build output string\n var output = '<iframe auto src=\"https://youtube.com/embed/' + videoID + '?rel=0\"></iframe>' + '<div class=\"clearfix\"></div>' + '';\n return output;\n }", "async function processVideoInfo() {\n console.log(moduleVideos);\n console.log(levelTitle);\n console.log(videoName);\n const fileName =\n 'modules/' +\n moduleVideos.module.name.replace(/\\s/g, '') +\n '/' +\n levelTitle.replace(/\\s/g, '') +\n '/' +\n videoName.replace(/\\s/g, '') +\n '.mp4';\n\n const video = new Video(videoLink);\n const metadata = await video.getMetadata();\n\n const videoParams = {\n Bucket: bucketName,\n Key: fileName,\n Body: videoLink,\n ContentType: 'video/mp4',\n };\n\n setVideoUploadInProgress(true);\n\n var getKeys = await firebase.functions().httpsCallable('getSecretKeyAdminApp');\n await getKeys().then((result) => {\n if (result.data != null) {\n // Read result of the Cloud Function.\n s3 = new AWS.S3({\n accessKeyId: result.data.accessKeyId,\n secretAccessKey: result.data.secretAccessKey,\n })\n }\n });\n \n s3.upload(videoParams, function (err, info) {\n if (err) {\n alert('Upload Unsuccessful');\n throw err;\n }\n\n if (!levelAdded.title) {\n levelAdded.title = levelTitle;\n levelAdded.data = [];\n }\n\n const data = {\n level: levelTitle,\n drill: videoName,\n source: info.Location,\n duration: metadata.duration,\n description: description,\n guidelines: guidelines,\n key: sh.unique(videoNum.toString()),\n };\n\n levelAdded.data.push(data);\n console.log(levelAdded);\n setVideoUploadInProgress(false);\n alert('Video Upload Successful!');\n });\n }", "function getLVideo(callbacks){\n navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia; //per si de cas el nostre navegador no funciona\n \n var constraints = {\n audio: true,\n video: true\n }\n\n navigator.getUserMedia(constraints, callbacks.success, callbacks.error)\n}", "get video(): ?Video {\n if (this.isVideo) {\n return (this.message: any).video;\n }\n return null;\n }", "async function getMovieInfo(id) {\n let response = await fetch('https://swapi.dev/api/films/');\n let json = await response.json();\n let selectedFilm;\n json.results.forEach((film) => {\n if (film.episode_id == id) {\n selectedFilm = {\n name: film.title,\n episodeID: film.episode_id,\n characters: film.characters,\n };\n }\n });\n return selectedFilm;\n}", "function getVids(playlist){\n //get videos from selected playlist\n $.get(\n \"https://www.googleapis.com/youtube/v3/playlistItems\", {\n part:'snippet',\n maxResults: 5,\n playlistId: playlist,\n key: apiKey\n },\n function(data){\n //parse data from api\n var output;\n $.each(data.items, function(i, item){\n console.log(item);\n var vidTitle = item.snippet.title;\n var videoId = item.snippet.resourceId.videoId;\n var videoDate = item.snippet.publishedAt;\n var prettyVideoDate = new Date(videoDate).toDateString();\n var videoDesc = item.snippet.description;\n //collect result\n output = '<p><h1>'+vidTitle+'</h1><p>'+videoDesc+'</p><p>'+prettyVideoDate+'</p><iframe height=\"'+vidHeight+'\" width=\"'+vidWidth+'\"src=\\\"//www.youtube.com/embed/'+videoId+'\\\"></iframe></p><hr>';\n\n //append result to content div \n $('#content').append(output);\n\n });// end .each\n }\n );//end get\n }", "getVideo(args) {\n\t\targs = args || {};\n\t\tconst accountId = _.get(args, 'accountId', this.accountId);\n\t\tconst videoId = args.videoId;\n\t\tconst skipScheduleCheck = _.get(args, 'skipScheduleCheck', this.skipScheduleCheck);\n\t\tif (!_.isString(accountId)) {\n\t\t\tthrow new Error('An accountId string is required for getVideo()');\n\t\t}\n\n\t\tif (!_.isString(videoId)) {\n\t\t\tthrow new Error('A videoId string is required for getVideo()');\n\t\t}\n\n\t\treturn this.getAccessToken(args).then(auth => {\n\t\t\targs = Object.assign({}, args, {\n\t\t\t\tmethod: 'GET',\n\t\t\t\tbaseUrl: Client.CMS_API_BASE_URL,\n\t\t\t\tpath: `/accounts/${accountId}/videos/${videoId}`,\n\t\t\t\tcontentType: Client.DEFAULT_CONTENT_TYPE,\n\t\t\t\tauthorization: this.getBearerAuthorization(auth.access_token),\n\t\t\t\tquery: {}\n\t\t\t});\n\n\t\t\treturn this\n\t\t\t\t\t\t\t.makeRequest(args)\n\t\t\t\t\t\t\t.then(video => {\n\t\t\t\t\t\t\t\tdebug(`video \"${videoId}\" exists: ${Boolean(video)} skipScheduleCheck: ${skipScheduleCheck}`);\n\t\t\t\t\t\t\t\tif (video && !skipScheduleCheck) {\n\t\t\t\t\t\t\t\t\t// using the Client.resolveIfScheduled, resolve with only published videos\n\t\t\t\t\t\t\t\t\treturn Client.resolveIfScheduled(video);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn Promise.resolve(video);\n\t\t\t\t\t\t\t});\n\t\t});\n\t}", "function getVideoId() {\n\t// Get the URL without any query parameters or anchors\n\tlet url = window.location.href;\n\tif(DEBUG) console.log(`Netflix SRT subs URL: ${url}`);\n\n\tmatch = /netflix\\.[a-z]+\\/watch\\/([0-9]+)/i.exec(url);\n\tif(match !== null && match.length > 1) {\n\t\tlet videoId = match[1];\n\t\tif(DEBUG) console.log(`Netflix SRT subs detected this page to be a video (id = ${videoId})`);\n\t\treturn videoId;\n\t}\n\telse {\n\t\treturn null;\n\t}\n}", "function retrieveVideos(emailUsrActive) {\n\n var rpReqUrl = \"../php/loadVideos.php\";\n\n console.log(\"email user active: \" + emailUsrActive);\n $.post(rpReqUrl,\n\n //data\n {\n //activeUser\n userEmail: emailUsrActive\n\n },\n\n function (dataClipsServerDBReply, status) {\n\n //loop OVER JSON OBJECT\n $.each(dataClipsServerDBReply, function (index, value) {\n\n console.log(value.length);\n\n //retrieve each video info\n for (m in value) {\n\n // var usrId = value[m].userID;\n var videoTitle = value[m].title;\n videoTitle=\"Title: \"+videoTitle;\n \n var sourceVideo = value[m].sourceLinkVideo + \"\";\n var viewsVideo = value[m].views;\n \n \n //author is the email\n var videoUploadByAuthor = value[m].videoUploadBy;\n var dateUploadVideo = value[m].videoDateUpload;\n var categoryVideo = value[m].category;\n \n var descriptionVideo = value[m].description;\n\n var videoId = value[m].videoID;\n var itemListID = videoId + \"\";\n\n // console.log(value[m].userID);\n console.log(videoTitle);\n console.log(sourceVideo);\n console.log(viewsVideo);\n\n //slice details\n //var subject=contDetails.slice(0,100)+\"...\";\n\n var FirstNameUser = fnameUser;\n\n //var language=value[m].language;\n //by default\n var language = \"english\";\n\n var pictDefault = \"\";\n\n //var category=value[m].category;\n var category = categoryVideo;\n\n //var FirstName=value[m].fnameCreator;\n var fNameVideoUploadedBy = videoUploadByAuthor;\n var FirstNameUploader = \"Uploaded by \" + fNameVideoUploadedBy;\n\n\n /*to define*/\n var videoFrame = \"video frame here\";\n var additionalDetails = \" \" + descriptionVideo;\n\n var dateVideo = dateUploadVideo;\n\n /*container definition*/\n var videoFrame = ' <div class=\"col-xs-10\" class=\"embed-responsive embed-responsive-16by9\"> <video class=\"embed-responsive-item\" src= ' + sourceVideo + ' width=\"100%\" height=\"100%\" frameborder=\"0\" preload=\"metadata\" controls ></video> </div>';\n\n //if it is a url resource, then use a iframe tag\n //if the substring is different to -1, it exists as substring of source url\n if (sourceVideo.search(\"https://\") != -1) {\n\n videoFrame = ' <div class=\"col-xs-10\" class=\"embed-responsive embed-responsive-16by9\"> <iframe class=\"embed-responsive-item\" src= ' + sourceVideo + ' width=\"100%\" height=\"100%\" frameborder=\"0\" ></iframe> </div>';\n\n\n }\n\n /*Thumbnail by default*/\n var pictDefault = '<img src=\"images/defaultScreenVideo.png\" class=\"screenDefault\" class=\"img-responsive img-thumbnail\" width=\"150\" height=\"100\">';\n\n /*Thumbnail by item if saved on DB as png or gif*/\n //var pictDefault='<img src='+thumbnailImg+' class=\"screenDefault\" class=\"img-responsive img-thumbnail\" width=\"150\" height=\"150\">';\n\n var btnPlayVideo = '<button style=\"margin-right: 5px;\" type=\"button\" class=\"btn btn-info btn-sm glyphicon glyphicon-play-circle\" data-toggle=\"modal\" data-target=\"#' + itemListID + '\" title=\"Game Clips Player\" onclick=\"saveActiveVideo(' + videoId + ')\" > ' + pictDefault + '</button>';\n\n var btnAddVideoToMyClips = '<button style=\"margin-right: 5px;\" type=\"button\" class=\"btn btn-primary btn-sm glyphicon \" data-toggle=\"modal\" data-target=' + inviteNoMemberAddVideoToMyClipsF() + ' onclick=\"resetFormAddVideoModal()\" >Add to My Clips </button>';\n\n var btnAddMyRatingVideo = '<button style=\"margin-right: 5px;\" type=\"button\" class=\"btn btn-warning btn-sm glyphicon glyphicon-star-empty\" data-toggle=\"modal\" data-target=' + inviteNoMemberRating() + ' onclick=\"resetRatingsModal()\" >Rate Video </button>';\n\n //FORMAT video Item\n var itemVideo = '<li href=\"#\" class=\"list-group-item text-left\"> ' + btnPlayVideo + '<label class=\"name\">' + FirstNameUploader + ' <br>Date video: ' + dateVideo + '<h6>Category: ' + category + '</h6><br></label><label class=\"pull-right\"> <!-- Modal Play video--><div class=\"modal fade\" id=\"' + itemListID + '\" role=\"dialog\"><div class=\"modal-dialog\"> <!-- Modal content--><div class=\"modal-content\"><div class=\"modal-header\"><button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button><h4 font-color=\"grey\"class=\"modal-title\"><strong>' + videoTitle + '</strong> <span style=\"color:rgb(0, 16, 70)\"> Views:'+viewsVideo+'</span></h4></div> <div class=\"modal-body\"><h4>Category:</h4><p><h4>' + category + '<h4></p> <h4>Description:</h4> <blockquote> <h6>' + additionalDetails + '</h6></blockquote> <h4>' +\"Video \"+FirstNameUploader+ '</h4><blockquote>' + videoFrame + '</blockquote><h6>Language</h6><blockquote>' + language + '</blockquote> </div> <div class=\"modal-footer\"> <!-- new Btn --> ' + btnAddMyRatingVideo + btnAddVideoToMyClips + '<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close Player</button> </div></div></div></div> </label> <div class=\"break\"></div></li>';\n\n $('#mainpanecontentSearch').prepend(itemVideo);\n\n }\n\n //horizontal separator\n $('#mainpanecontentSearch').prepend(\"<br>\");\n\n });\n\n\n },\n 'json');\n\n} //end ", "function getLVideo(callbacks){\nnavigator.getUserMedia =navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;\nvar constraints={\n audio:true,\n video:true\n}\nnavigator.getUserMedia(constraints,callbacks.success,callbacks.error)\n\n}", "function getVideoParams(input,mk2) {\n let paramsArr\n if(mk2){\n paramsArr = input.split('-')\n }else {\n paramsArr = input.split(\"TI:\")[1].split(\"-\");\n }\n \n paramsArr[0] = paramsArr[0].trim();\n paramsArr[1] = paramsArr[1].trim();\n let StartTimeStrArr = [];\n let startMinute;\n let startHour;\n let startSecond;\n let startTimeNum = 0;\n let end = {};\n let needChangeDuration = true;\n let duration;\n\n let params = {};\n\n if (paramsArr[0].includes(\".\")) {\n const startTimeArr = paramsArr[0].split(\".\");\n const endTimeArr = paramsArr[1].split(\".\");\n\n if (startTimeArr.length == 2) {\n StartTimeStrArr.push(\"00\");\n StartTimeStrArr.push(\n startTimeArr[0].length < 2\n ? \"0\" + startTimeArr[0]\n : startTimeArr[0]\n );\n StartTimeStrArr.push(\n startTimeArr[1].length < 2\n ? \"0\" + startTimeArr[1]\n : startTimeArr[1]\n );\n\n startHour = 0;\n startMinute = parseInt(startTimeArr[0]) * 60;\n startSecond = parseInt(startTimeArr[1]);\n }\n if (endTimeArr.length == 2) {\n end.hour = 0;\n end.minute = parseInt(endTimeArr[0]) * 60;\n end.second = parseInt(endTimeArr[1]);\n } else if (endTimeArr.length === 1) {\n needChangeDuration = false;\n duration = parseInt(endTimeArr[0]);\n }\n\n //加一,减一,是为了避免剪切视频不精准或者数据不精准,导致该剪进去的没剪进去\n // end.time = end.hour + end.minute+end.second + 1\n // startTimeNum = startHour + startMinute + startSecond -1\n\n end.time = end.hour + end.minute + end.second;\n startTimeNum = startHour + startMinute + startSecond;\n\n let startTime = StartTimeStrArr.join(\":\");\n needChangeDuration && (duration = end.time - startTimeNum);\n if (duration < 0) {\n console.log(\"error: duration is negative\");\n }\n\n params.duration = duration;\n params.start = startTime;\n // console.log(params)\n \n }else if(paramsArr[0].includes(':')){\n\n let startTime = paramsArr[0]\n let endTime = paramsArr[1]\n\n let startTimeSplitByColon = startTime.split(':')\n let endTimeSplitByColon = endTime.split(':')\n let startNum = parseInt(startTimeSplitByColon[0])*3600 + parseInt(startTimeSplitByColon[1])*60 + parseInt(startTimeSplitByColon[2])\n let endNum = parseInt(endTimeSplitByColon[0])*3600 + parseInt(endTimeSplitByColon[1])*60 + parseInt(endTimeSplitByColon[2])\n let duration = endNum - startNum\n if(!paramsArr[1].includes('.')){\n duration = paramsArr[1]\n }\n \n\n params.duration = duration;\n params.start = startTime;\n // console.log(paramsArr[1].includes('.'))\n }\n // console.log(params)\n return params;\n}", "function getVlc()\n {\n result = null;\n logDebug( \"getVlc\" );\n try\n {\n result = document.getElementById('video1');\n logDebug( \"found Vlc\" );\n// document.embeds['video1'];\n }\n catch( e )\n {\n logError(\"getVlc: \", e) ;\n }\n return result;\n }", "async function getVideoSources() {\n // Will return all the sources to captuer from\n const inputSources = await desktopCapturer.getSources({\n types: ['window', 'screen']\n });\n\n // To build \"select source\" menu\n const videoOptionsMenu = Menu.buildFromTemplate(\n\n // Using map function to destructure the list of sources found before\n inputSources.map(source => {\n return {\n label: source.name,\n click: () => selectSource(source)\n };\n })\n );\n \n //for menu popup\n videoOptionsMenu.popup();\n\n }", "getVideoDataBuffer() {\n return this.videoDataBuffer;\n }", "function getVideo(userSearchName, searchTitle) {\n\tvar q = userSearchName + \" \" + searchTitle + \" karaoke\";\n\n\taddVideoCard(searchTitle);\n\n\t// Run GET Request on API\n\t$.get(\n\t\t\"https://www.googleapis.com/youtube/v3/search\", {\n\t\t\tpart: 'snippet, id',\n\t\t\tq: q,\n\t\t\ttype: 'video',\n\t\t\tmaxResults: 4,\n\t\t\tvideoSyndicated: true,\n\t\t\tvideoEmbeddable: true,\n\t\t\tvideoLicense: 'creativeCommon',\n\t\t\tkey: 'AIzaSyBEw_OnLrWKAKGIzxb2ee5WtfnRR0md67Q'\n\t\t},\n\t\tfunction (data) {\n\n\t\t\t// Log Data\n\t\t\tconsole.log(data);\n\n\t\t\t$.each(data.items, function (i, item) {\n\t\t\t\t// Get Output\n\t\t\t\tvar output = getOutput(item);\n\t\t\t\t//set the new videos to the correct card\n\t\t\t\t//by referencing the card Id created for the card\n\t\t\t\t$('#c-' + cardCount + ' .col-rhs ul').append(output);\n\t\t\t\t$('.card-videos').sortable({ handle: '.video-title', placeholder: 'drop-zone' });\n\t\t\t\t$('.card-videos').disableSelection();\n\t\t\t});\n\t\t}\n\t);\n}", "function Object_Video(data) {\n Object_Video.__super__.constructor.apply(this, arguments);\n\n /**\n * The object's source rectangle. It controls which part of the object's image is used\n * for visual presentation.\n * @property srcRect\n * @type gs.Rect\n */\n this.srcRect = new Rect();\n\n /**\n * The object's mask to execute masking-effects on it.\n * @property mask\n * @type gs.Mask\n */\n this.mask = new gs.Mask();\n\n /**\n * Indicates if the object's visual presentation should be mirrored horizontally.\n * @property mirror\n * @type boolean\n */\n this.mirror = false;\n\n /**\n * The domain the object belongs to.\n * @property domain\n * @type string\n */\n this.domain = \"com.degica.vnm.default\";\n\n /**\n * The name of the video resource used for the visual presentation.\n * @property video\n * @type string\n */\n this.video = \"\";\n\n /**\n * Indicates if the video should be looped. The default is <b>false</b>\n * @property loop\n * @type boolean\n */\n this.loop = false;\n\n /**\n * The rotation-angle of the picture in degrees. The rotation center depends on the\n * anchor-point.\n * @property angle\n * @type number\n */\n this.angle = 0;\n\n /**\n * The color tone of the object used for the visual presentation.\n * @property tone\n * @type gs.Tone\n */\n this.tone = new Tone(0, 0, 0, 0);\n\n /**\n * The color of the object used for the visual presentation.\n * @property color\n * @type gs.Color\n */\n this.color = new Color(255, 255, 255, 0);\n\n /**\n * The object's animator-component to execute different kind of animations like move, rotate, etc. on it.\n * @property animator\n * @type vn.Component_Animator\n */\n this.animator = new gs.Component_Animator();\n\n /**\n * The object's visual-component to display the game object on screen.\n * @property visual\n * @type gs.Component_Sprite\n */\n this.visual = new gs.Component_Sprite();\n this.addComponent(this.visual);\n this.addComponent(this.animator);\n this.componentsFromDataBundle(data);\n this.update();\n }", "async function getVideoSources() {\n const inputSources = await desktopCapturer.getSources({\n types: ['window', 'screen']\n });\n\n const videoOptionsMenu = Menu.buildFromTemplate(\n inputSources.map(source => {\n return {\n label: source.name,\n click: () => selectSource(source)\n };\n })\n );\n\n\n videoOptionsMenu.popup();\n}", "get hasHTML5Video() { return hasHTML5Video }", "function manifestVideo() {\n return gManifestNavigatorSource.contentDocument.createElement('video');\n}", "get seek() {\n return this.api.video.time\n }", "function movieGet() {\n\tgetMovie = 'https:/www.amazon.com/s?k=' + searchTermURL + '&i=instant-video';\n\tsetContent();\n}", "getDuration() {\n this.duration = this.api.video.duration\n }", "function beachCam() {\n // Get surf cam\n $.ajax({\n url: \"http://api.surfline.com/v1/cams/\" + beachID,\n type: \"GET\",\n dataType: \"jsonp\",\n success: function(responseData) {\n var options = {\n autoplay: true,\n html5: {\n hlsjsconfig: {\n debug: true,\n autoStartLoad: true,\n maxBufferLength: 30,\n maxBufferSize: 60 * 1000 * 1000,\n enableWorker: true,\n fragLoadingTimeOut: 20000,\n fragLoadingMaxRetry: 6,\n fragLoadingRetryDelay: 500,\n manifestLoadingTimeOut: 10000,\n manifestLoadingMaxRetry: 6,\n manifestLoadingRetryDelay: 500,\n fpsDroppedMonitoringPeriod: 5000,\n fpsDroppedMonitoringThreshold: 0.2,\n appendErrorMaxRetry: 200,\n }\n }\n },\n poster = document.getElementById('poster'),\n video = document.getElementById('videoId'),\n file = responseData.streamInfo.stream[0].file,\n player = videojs('videoId', options);\n\n console.log(responseData)\n\n if (videoLetterboxed) {\n document.querySelector('.video-wrapper').className += ' letterboxed';\n }\n\n poster.src = responseData.streamInfo.stream[0].camImage;\n\n player.src({ type: 'application/x-mpegURL', src: file });\n player.play();\n player.enterFullWindow();\n\n setTimeout(function (){\n video.style.display = 'block';\n poster.style.display = 'none';\n }, 1000);\n\n }, //end success\n error: function(err) {\n console.log(\"ERR\", err);\n }\n });\n}", "function getVideoById (feedId) {\n let getVideoByIdUrl = `https://app.ganji.com/api/v1/msc/v1/jn/feed/info/${feedId}?&user_id=732539543&longitude=104.041918&latitude=30.585407&location=45`\n\n request\n .get({\n url: getVideoByIdUrl,\n headers: headers,\n gzip: true\n }, (err, httpResponse, body) => {\n if (err) console.log(err)\n console.log(body) // 200\n })\n}" ]
[ "0.7567891", "0.74346185", "0.72672266", "0.71350867", "0.7095404", "0.7049103", "0.69045216", "0.677848", "0.676778", "0.6717711", "0.6645546", "0.66026616", "0.65441424", "0.6541425", "0.6491064", "0.6443167", "0.6438557", "0.64296377", "0.63556665", "0.63364846", "0.6325317", "0.6318582", "0.62952137", "0.6278041", "0.6274653", "0.6246708", "0.624477", "0.62423843", "0.6237574", "0.6236739", "0.62306154", "0.62289405", "0.6216822", "0.6190856", "0.61885184", "0.6180916", "0.6174539", "0.61660445", "0.61216855", "0.61067677", "0.608727", "0.6084187", "0.60637957", "0.6046987", "0.60443527", "0.6042241", "0.60393405", "0.60340464", "0.60217386", "0.60213405", "0.60099745", "0.60060585", "0.6002349", "0.59988695", "0.5995692", "0.59888595", "0.59739923", "0.59730446", "0.59710115", "0.59639066", "0.596085", "0.5956699", "0.59428084", "0.5938923", "0.5936666", "0.59366", "0.593513", "0.5924351", "0.5922567", "0.5920403", "0.5914237", "0.5881774", "0.58793616", "0.5874107", "0.58659005", "0.5845963", "0.5839533", "0.5818945", "0.58188987", "0.58185786", "0.5816086", "0.5813881", "0.5799796", "0.5798852", "0.57977533", "0.5796322", "0.5796081", "0.5786316", "0.57849616", "0.5782045", "0.5778495", "0.5773312", "0.5762748", "0.57596797", "0.5753869", "0.5749692", "0.5745911", "0.57456934", "0.5744594", "0.57432395" ]
0.67529047
9
converts from seconds to the desired duration format: hh:mm:ss
function formatTime(totalSeconds){ var seconds = totalSeconds%60; var minutes = Math.floor(totalSeconds/60); var hours = Math.floor(minutes/60); if(hours > 0) minutes = minutes%60; if(hours < 10) hours = "0" + hours; if(minutes < 10) minutes = "0" + minutes; if(seconds < 10) seconds = "0" + seconds; return hours +":"+minutes+":"+seconds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "convertDuration (seconds){\n let hours = Math.floor(seconds / 3600);\n seconds %= 3600;\n let minutes = Math.floor(seconds / 60);\n\n return hours+\"h \"+minutes+\"m\";\n }", "#secondsToTime(s) {\r\n\t\tlet momentTime = moment.duration(s, 'seconds');\r\n\t\tlet sec = momentTime.seconds() < 10 ? ('0' + momentTime.seconds()) : momentTime.seconds();\r\n\t\tlet min = momentTime.minutes() < 10 ? ('0' + momentTime.minutes()) : momentTime.minutes();\r\n\r\n\t\treturn `${min}:${sec}`;\r\n\t}", "function convertTime(seconds) {\n var s = seconds;\n var m = Math.floor(s / 60);\n s %= 60;\n var h = Math.floor(m / 60);\n m %= 60;\n\n return h + ':' + m + ':' + s.toFixed(3);\n}", "function timeConversion(duration) {\n const portions = [];\n duration = parseFloat(duration);\n const msInHour = 1000 * 60 * 60;\n const hours = Math.trunc(duration / msInHour);\n if (hours > 0) {\n portions.push(hours + ' Hours');\n duration = duration - (hours * msInHour);\n }\n\n const msInMinute = 1000 * 60;\n const minutes = Math.trunc(duration / msInMinute);\n if (minutes > 0) {\n portions.push(minutes + ' Minutes');\n duration = duration - (minutes * msInMinute);\n }\n\n const seconds = Math.trunc(duration / 1000);\n if (seconds > 0) {\n portions.push(seconds + ' Seconds');\n }\n\n return portions.join(' ');\n}", "function secondToStringConversion(seconds) {\n const minutes = Math.floor(seconds / 60);\n let remainderSeconds = seconds - minutes * 60;\n remainderSeconds = remainderSeconds > 9 ? \":\" + remainderSeconds : \":0\" + remainderSeconds;\n return minutes + remainderSeconds;\n}", "function format_time_duration(total_seconds) {\n\tvar seconds = total_seconds % 60;\n\tvar total_minutes = Math.floor(total_seconds / 60);\n\tvar minutes = total_minutes % 60;\n\tvar hours = Math.floor(total_minutes / 60);\n\t\n\treturn (\"00\" + hours).substr(-2,2) +\":\"+ (\"00\" + minutes).substr(-2,2) +\":\"+ \n\t\t(\"00\" + seconds).substr(-2,2);\n}", "formatTime(seconds) {\n\t\t// Minutes\n\t\tlet minutes = Math.floor(seconds / 60);\n\t\t// Seconds\n\t\tlet partInSeconds = seconds % 60;\n\t\t// Adds left zeros to seconds\n\t\tthis.partInSeconds = partInSeconds.toString().padStart(2, \"0\");\n\t\t// Returns formated time\n\t\treturn `${minutes}:${partInSeconds}`;\n\t}", "function formatTime (seconds) {\n var minutes = ((seconds / 60) | 0);\n var seconds = ((seconds % 60) | 0);\n minutes = '' + minutes;\n seconds = seconds < 10 ? '0' + seconds : '' + seconds;\n return '' + minutes + ':' + seconds;\n}", "function convertTime(seconds) {\n var time = '';\n var hours;\n var mins;\n var hour = 3600;\n var min = 60;\n if (seconds > hour) {\n hours = Math.floor(seconds / hour);\n time = time.concat(hours.toString() + ' hour ');\n seconds = seconds - hours * hour;\n }\n\n mins = Math.round(seconds / min);\n time = time.concat(mins.toString() + ' min');\n\n return time;\n}", "convertToDisplayTime(seconds) {\n const dHours = Math.floor(seconds / (60 * 60));\n const dMinutes = Math.floor(seconds % (60 * 60) / 60);\n const dSeconds = (Math.floor(seconds % 60));\n\n return (dHours > 0)\n ? dHours + \":\" \n + (dMinutes < 10 ? \"0\" : \"\")\n + dMinutes + \":\"\n + (dSeconds < 10 ? \"0\" : \"\") \n + dSeconds\n : (dMinutes > 0 ? dMinutes + \":\" : \"0\" + \":\")\n + (dSeconds < 10 ? \"0\" : \"\") \n + dSeconds; \n }", "function toMMSS (duration) {\n const min = Math.floor(duration / 60)\n const sec = duration - (min * 60)\n return min + ':' + (sec < 10 ? '0' + sec : sec)\n}", "function secondsToFormatted(seconds) {\n\tif (seconds === 0) return \"0:00\";\n\tconst isNegative = seconds < 0;\n\tif (isNegative) return \"0:00\";\n\tseconds = Math.abs(seconds);\n\tconst hours = Math.floor(seconds / 60 / 60);\n\tconst minutes = Math.floor(seconds / 60) - hours * 60;\n\tconst secs = Math.floor(seconds - minutes * 60 - hours * 60 * 60);\n\tif (hours > 0) {\n\t\treturn hours + \":\" + (minutes < 10 ? \"0\" : \"\") + minutes + \":\" + (secs < 10 ? \"0\" : \"\") + secs;\n\t} else {\n\t\treturn minutes + \":\" + (secs < 10 ? \"0\" : \"\") + secs;\n\t}\n}", "function formatTime(seconds) {\n if (audioDuration > 3600) {\n hours = Math.floor(seconds / 3600);\n hours = (hours >= 10) ? hours : \"0\" + hours;\n }\n else {\n hours = 0;\n }\n minutes = Math.floor((seconds-hours*3600) / 60);\n minutes = (minutes >= 10) ? minutes : \"0\" + minutes;\n seconds = Math.floor(seconds % 60);\n seconds = (seconds >= 10) ? seconds : \"0\" + seconds;\n if (hours === 0){\n return minutes + \":\" + seconds;\n }\n else {\n return hours + \":\" + minutes + \":\" + seconds;\n }\n}", "function formatTime(seconds) {\n return Math.floor(seconds/60) + \":\" + Math.round(seconds % 60)\n}", "function formatTime(seconds) {\n minutes = Math.floor(seconds / 60);\n minutes = (minutes >= 10) ? minutes : \"0\" + minutes;\n seconds = Math.floor(seconds % 60);\n seconds = (seconds >= 10) ? seconds : \"0\" + seconds;\n return minutes + \":\" + seconds;\n }", "function formatSecondsToTime(s) {\n\n\tvar time='';\n\n\tvar h = Math.floor(s / 3600);\n\tif (h > 0)\n\t\ts = s - (h * 3600);\n\n\tvar m = Math.floor(s / 60);\n\tif (m > 0)\n\t\ts = s - (m * 60);\n\t\n\tif (h < 10)\n\t\ttime += '0';\n\t\t\n\ttime += h + ':';\n\t\n\tif (m < 10)\n\t\ttime += '0';\n\t\t\n\ttime += m + ':';\n\n\tif (s < 10)\n\t\ttime += '0';\n\t\n\ttime += s;\n\n\treturn time;\n}", "function toHHMMSS(seconds) {\n var sec_num = parseInt(seconds, 10);\n var hours = Math.floor(sec_num / 3600);\n var minutes = Math.floor((sec_num - (hours * 3600)) / 60);\n\n if (hours < 10) {hours = \"0\" + hours;}\n if (minutes < 10) {minutes = \"0\" + minutes;}\n return hours + ':' + minutes;\n }", "function makeSecondsReadable(seconds){\n seconds = Math.round(seconds);\n let extra0;\n `${seconds%60}`.length == 1 ? extra0 = \"0\" : extra0 = \"\";\n return `${Math.floor(seconds / 60)}:${extra0}${seconds%60}`;\n }", "function convertToFormat(seconds) {\n var hour = Math.floor(seconds/3600);\n var minute = Math.floor((seconds - (hour*3600))/60);\n var second = seconds - (hour*3600) - (minute*60);\n let result = \"\" + addZero(hour) + \":\" + addZero(minute) + \":\" + addZero(second)\n return result;\n}", "function format_as_time(seconds) {\n var minutes = parseInt(seconds / 60);\n var seconds = seconds - (minutes * 60);\n\n if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n var return_var = minutes + ':' + seconds;\n\n return return_var;\n}", "formatTime (seconds) {\n let hours = Math.floor (seconds / 3600);\n let minutes = Math.floor ((seconds - hours * 3600) / 60);\n let time = '';\n if (hours > 0) {\n time += hours === 1 ? '1 hour ' : hours + ' hours ';\n }\n if (minutes > 0) {\n time += minutes === 1 ? '1 minute' : minutes + ' minutes';\n }\n if (hours === 0 && minutes === 0) {\n time = Math.round (seconds) + ' seconds';\n }\n return time;\n }", "function convert(s) {\n\n let minutes = Math.floor(s/60)\n\n let seconds = s % 60\n\n // nf stands for number format\n return nf(minutes, 2) + \":\" + nf(seconds, 2);\n }", "function formatTime(seconds) {\n let min = Math.floor((seconds / 60));\n let sec = Math.floor(seconds - (min * 60));\n if (sec < 10) {\n sec = `0${sec}`;\n };\n return `${min}:${sec}`;\n}", "function formatDuration(duration) {\n if (duration > 3600) {\n var hours = Math.floor(duration / 3600);\n var remainingSeconds = duration % 3600;\n var minutes = Math.floor(remainingSeconds / 60);\n return hours + ' h ' + minutes + ' minutes';\n } else if (duration > 60) {\n var minutes = Math.floor(duration / 60);\n var remainingSeconds = duration % 60;\n return minutes + ' min ' + remainingSeconds + ' sec';\n } else {\n return duration + ' sec';\n }\n}", "function timeFormat(seconds){\n var m = Math.floor(seconds/60)<10 ? \"0\"+Math.floor(seconds/60) : Math.floor(seconds/60);\n var s = Math.floor(seconds-(m*60))<10 ? \"0\"+Math.floor(seconds-(m*60)) : Math.floor(seconds-(m*60));\n return m+\":\"+s;\n}", "function formatTime(seconds) {\n let min = Math.floor((seconds / 60));\n let sec = Math.floor(seconds - (min * 60));\n if (sec < 10){ \n sec = `0${sec}`;\n };\n return `${min}:${sec}`;\n}", "function sec2hms(diff) {\n var str = \"\";\n var hours = Math.max(0, parseInt( diff / 3600 ) % 24);\n var minutes = Math.max(0, parseInt( diff / 60 ) % 60);\n var seconds = diff % 60;\n if (hours) {\n str += pad(hours)+\":\";\n }\n return str+pad(minutes)+\":\"+pad(seconds);\n}", "function formatTime(duration) {\n\t\tlet hours = Math.floor(duration / 60 / 60);\n\t\tlet minutes = Math.floor(duration / 60 - hours * 60);\n\t\tlet seconds = Math.floor(duration - hours * 3600 - minutes * 60);\n\t\tif ( hours > 0 && minutes < 10 ) minutes = '0' + minutes;\n\t\tif ( seconds < 10 ) seconds = '0' + seconds;\n\t\tlet timeStack = hours > 0 ? [hours] : [];\n\t\ttimeStack.push(minutes, seconds);\n\t\treturn timeStack.join(':');\n\t}", "function seconds2string(seconds) { // Integer -> String, e.g. seconds2string(185) == \"02:05\"\n let s = seconds % 60;\n let m = (seconds - s) / 60;\n s = s.toString();\n m = m.toString();\n while (s.length < 2) s = \"0\" + s;\n while (m.length < 2) m = \"0\" + m;\n return m + \":\" + s;\n}", "function _readableDuration(seconds) {\n\n\t\tvar sec = Math.floor( seconds );\n\t\tvar min = Math.floor( sec / 60 );\n\n\t\tmin = min >= 10 ? min : '0' + min;\n\t\tsec = Math.floor( sec % 60 );\n\t\tsec = sec >= 10 ? sec : '0' + sec;\n\n\t\treturn min + ':' + sec;\n\n\t}", "function sec2hms(diff) {\n var str = \"\";\n var hours = parseInt( diff / 3600 ) % 24;\n var minutes = parseInt( diff / 60 ) % 60;\n var seconds = diff % 60;\n if (hours) str += pad(hours)+\":\";\n return str+pad(minutes)+\":\"+pad(seconds);\n}", "function timeFormat(seconds) {\n var m = Math.floor(seconds / 60) < 10 ? \"0\" + Math.floor(seconds / 60) : Math.floor(seconds / 60);\n var s = Math.floor(seconds - (m * 60)) < 10 ? \"0\" + Math.floor(seconds - (m * 60)) : Math.floor(seconds - (m * 60));\n return m + \":\" + s;\n }", "function msToTime(duration) {\n var milliseconds = parseInt((duration % 1000))\n var seconds = parseInt((duration / 1000) % 60)\n var minutes = parseInt((duration / (1000 * 60)) % 60)\n var hours = parseInt((duration / (1000 * 60 * 60)) % 24);\n\n hours = (hours < 10) ? \"0\" + hours : hours;\n\tseconds = (seconds < 10) ? \"0\" + seconds : seconds;\n\n\tif (duration < 1000)\n\t\treturn milliseconds;\n\telse if (duration < 6000)\n\t\treturn seconds + \".\" + milliseconds;\n\telse if (duration < 3600000)\n\t\treturn minutes + \":\" + seconds + \".\" + milliseconds;\n\treturn hours + \":\" + minutes + \":\" + seconds + \".\" + milliseconds;\n}", "function formatSeconds(secs){\n let hours = Math.floor(secs/3600);\n let minutes = Math.floor((secs - (hours * 3600)) / 60);\n let seconds = Math.floor(secs - (hours * 3600) - (minutes * 60));\n\n if(hours < 10) hours = \"0\" + hours;\n if(minutes < 10) minutes = \"0\" + minutes;\n if(seconds < 10) seconds = \"0\" + seconds;\n\n return hours + \":\" + minutes + \":\" + seconds;\n}", "function secondsTimeSpanToMS(s) {\n var m = Math.floor(s / 60); //Get remaining minutes\n s -= m * 60;\n s = Math.floor(s);\n return (m < 10 ? '0' + m : m) + \":\" + (s < 10 ? '0' + s : s); //zero padding on minutes and seconds\n} // End secondsTimeSpanToMS", "function getSecondsTime(duration) {\n if(typeof duration === \"number\") return duration;\n if(typeof duration !== \"string\") return 0;\n\n duration = duration.split(\":\");\n let time = 0;\n\n if(duration.length === 2) {\n time += Number(duration[0]) * 60;\n time += Number(duration[1]);\n } else if(duration.length === 3) {\n time += Number(duration[0]) * 3600;\n time += Number(duration[1]) * 60;\n time += Number(duration[2]);\n }\n\n return time;\n}", "function formattedTime(seconds){\n var minute = parseInt(seconds / 60, 10);\n var seconds = seconds % 60\n seconds = seconds > 9 ? seconds : '0' + seconds;\n return (minute + \":\" + seconds);\n}", "function secondsToHms(d) {\n d = Number(d); // Number() converts variables to numbers for example true -> 1 / false -> 0.\n var h = Math.floor(d / 3600); // Math.floor() rounds result down for example 5.95 --> 5.\n var m = Math.floor(d % 3600 / 60); // simple logic to get minutes.\n var s = Math.floor(d % 3600 % 60); // simple logic to get seconds.\n var hDisplay = h > 0 ? h + (h == 1 ? \" hour, \" : \" hours, \") : \"\"; // hDisplay displays the amount of hours or hour. \n var mDisplay = m > 0 ? m + (m == 1 ? \" minute, \" : \" minutes, \") : \"\"; // mDisplay displays the amount of minutes or minute.\n var sDisplay = s > 0 ? s + (s == 1 ? \" second\" : \" seconds\") : \"\"; // sDisplay displays the amount of seconds or second.\n return hDisplay + mDisplay + sDisplay; // return the aa:bb:cc format of time back to wherever. \n}", "function formatDuration2 (seconds) {\n var time = { year: 31536000, day: 86400, hour: 3600, minute: 60, second: 1 },\n res = [];\n \n if (seconds === 0) return 'now';\n \n for (var key in time) {\n if (seconds >= time[key]) {\n var val = Math.floor(seconds/time[key]);\n res.push(val += val > 1 ? ' ' + key + 's' : ' ' + key);\n seconds = seconds % time[key];\n }\n }\n \n return res.length > 1 ? res.join(', ').replace(/,([^,]*)$/,' and'+'$1') : res[0]\n }", "function formatTime(seconds) {\n var time = Math.round(seconds);\n var min = Math.floor(time / 60);\n var seconds = time - (min * 60);\n var extraXero = (seconds < 10) ? '0' : '';\n return `${min} : ${extraXero} ${seconds}`;\n}", "function Convert_seconds_HH( totalSec )\n{\n\n var hours = parseInt( totalSec / 3600 ) % 24;\n var minutes = parseInt( totalSec / 60 ) % 60;\n var seconds = totalSec % 60;\n\n return (hours < 10 ? \"0\" + hours : hours) + \":\" + (minutes < 10 ? \"0\" + minutes : minutes) + \":\" + (seconds < 10 ? \"0\" + seconds : seconds);\n}", "formatDuration(duration) {\n const hours = Math.floor(duration / 3600);\n const minutes = Math.floor(duration / 60) % 60;\n const seconds = duration % 60;\n\n return `${hours}:${('0' + minutes).substr(-2)}:${('0' + seconds).substr(-2)}`;\n }", "function secondsTimeSpanToHMS(s) {\n s = Math.floor( s );\n var h = Math.floor( s/3600 ); // Hours\n s -= h*3600;\n var m = Math.floor( s/60 ); // Minutes\n s -= m*60;\n\n // Add zero padding\n return ( h == 0 ? \"\" : h + \":\" ) +\n ( h != 0 && m < 10 ? \"0\" + m : m ) + \":\" +\n ( s < 10 ? \"0\" + s : s );\n}", "function humanReadable(seconds) {\n // TODO\n let HH = parseInt(seconds / 3600)\n HH < 10 ? HH = \"0\" + HH : HH\n\n let MM = (parseInt((seconds - HH*3600 ) /60))\n MM <10 ? MM = \"0\" + MM : MM\n \n let SS = parseInt(seconds - (HH*3600) - (MM *60 ))\n SS <10 ? SS = \"0\" + SS : SS\n \n return HH + \":\" + MM + \":\" + SS\n }", "function _convertTime(second) {\n\t\t\tsecond = Math.abs(second);\n\t\t\tvar val = new Array();\n\t\t\tval[0] = Math.floor(second/3600%24);//hours\n\t\t\tval[1] = Math.floor(second/60%60);//mins\n\t\t\tval[2] = Math.floor(second%60);//secs\n\t\t\tvar stopage = true;\n\t\t\tvar cutIndex = -1;\n\t\t\tfor(var i = 0; i < val.length; i++) {\n\t\t\t\tif(val[i] < 10) val[i] = \"0\" + val[i];\n\t\t\t\tif( val[i] == \"00\" && i < (val.length - 2) && !stopage) cutIndex = i;\n\t\t\t\telse stopage = true;\n\t\t\t}\n\t\t\tval.splice(0, cutIndex + 1);\n\t\t\treturn val.join(':');\n\t\t}", "function secondsToHms(d) {\n d = Number(d);\n var h = Math.floor(d / 3600);\n var m = Math.floor(d % 3600 / 60);\n var s = Math.floor(d % 3600 % 60);\n\n var hDisplay = h > 0 ? h + (h == 1 ? \" hour, \" : \" hours, \") : \"\";\n var mDisplay = m > 0 ? m + (m == 1 ? \" minute, \" : \" minutes, \") : \"\";\n var sDisplay = s > 0 ? s + (s == 1 ? \" second\" : \" seconds\") : \"\";\n return hDisplay + mDisplay + sDisplay; \n}", "function to_seconds(t) {\n var sign = t.slice(0, 1) === '-' ? (t = t.slice(1), -1) : 1;\n return sign * t.split(':').reduce((p,c) => p * 60 + +c, 0);\n}", "function formatTime(seconds) {\n\n \n let diffInHrs = seconds / 3600000;\n let hour = Math.floor(diffInHrs);\n \n let diffInMin = (diffInHrs - hour) * 60;\n let min = Math.floor(diffInMin);\n \n let diffInSec = (diffInMin - min) * 60;\n let sec = Math.floor(diffInSec);\n \n \n let formatHour = hour.toString().padStart(2, \"0\");\n let formatMin = min.toString().padStart(2, \"0\");\n let formatSec = sec.toString().padStart(2, \"0\");\n \n return `${formatHour}:${formatMin}:${formatSec}`;\n }", "function intToTime(totalSeconds) { \n secs = totalSeconds % 60;\n totalMinutes = (totalSeconds - secs) / 60;\n mins = totalMinutes % 60;\n if (totalMinutes < 60) {\n\treturn addZero(mins) + \":\" + addZero(secs);\n }\n hours = (totalMinutes - mins) / 60;\n return hours + \":\" + addZero(mins) + \":\" + addZero(secs);\n}", "function secondsToString(seconds) {\r\n\tvar hour=\"\";\r\n\tif (seconds>3600){\r\n\t\thour = Math.floor(seconds / 3600);\r\n\t\thour = (hour < 10)? '0' + hour : hour;\r\n\t\thour+=\":\"\r\n\t}\r\n var minute = Math.floor((seconds / 60) % 60);\r\n minute = (minute < 10)? '0' + minute : minute;\r\n var second = seconds % 60;\r\n second = (second < 10)? '0' + second : second;\r\n return hour + minute + ':' + second;\r\n}", "function timeConverter(t) {\n var minutes = Math.floor(t / 60);\n var seconds = t - (minutes * 60);\n \n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n \n if (minutes === 0) {\n minutes = \"00\";\n }\n \n else if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n \n return minutes + \":\" + seconds;\n }", "function convertDuration(minute, second) {\n let secondInView = \"\";\n let minuteInView = \"\";\n\n if (second < 10) {\n secondInView = `0${second}`;\n } else {\n secondInView = `${second}`;\n }\n\n if (minute < 10) {\n minuteInView = `0${minute}`;\n } else {\n minuteInView = `${minute}`;\n }\n\n return `${minuteInView}:${secondInView}`;\n}", "function msToTime(duration) {\n var milliseconds = parseInt((duration%1000)/100)\n , seconds = parseInt((duration/1000)%60)\n , minutes = parseInt((duration/(1000*60))%60)\n , hours = parseInt((duration/(1000*60*60))%24);\n\n hours = (hours < 10) ? \"0\" + hours : hours;\n minutes = (minutes < 10) ? \"0\" + minutes : minutes;\n seconds = (seconds < 10) ? \"0\" + seconds : seconds;\n\t\n\tif(hours==\"00\")\n\t\treturn minutes + \":\" + seconds;\n\telse\n\t\treturn hours + \":\" + minutes + \":\" + seconds;\n}", "function secondsToString(seconds) {\n\tvar hour=\"\";\n\tif (seconds>3600){\n\t\thour = Math.floor(seconds / 3600);\n\t\thour = (hour < 10)? '0' + hour : hour;\n\t\thour+=\":\"\n\t}\n var minute = Math.floor((seconds / 60) % 60);\n minute = (minute < 10)? '0' + minute : minute;\n var second = seconds % 60;\n second = (second < 10)? '0' + second : second;\n return hour + minute + ':' + second;\n}", "function secondsToHms(d) {\n d = Number(d);\n\n var h = Math.floor(d / 3600);\n var m = Math.floor(d % 3600 / 60);\n var s = Math.floor(d % 3600 % 60);\n\n return ('0' + h).slice(-2) + \":\" + ('0' + m).slice(-2); //+ \":\" + ('0' + s).slice(-2);\n}", "function formatSeconds(s) {\n //noinspection JSDuplicatedDeclaration\n var s = Math.floor(s);\n\n var seconds = s % 60;\n var minutes = (s - seconds) / 60;\n\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n\n return minutes + \":\" + seconds;\n }", "function formatSeconds(seconds) {\n return seconds < 10 ? '0' + seconds : seconds;\n }", "function formatSeconds(sec){\n if( sec > 60 ){\n // logic via https://stackoverflow.com/a/6313008/1104148\n let h = Math.floor(sec / 3600)\n let m = Math.floor((sec - (h * 3600)) / 60)\n let s = sec - (h * 3600) - (m * 60)\n if( h > 0 ){\n return `${h} hours`\n } else {\n return `${m} minutes`\n }\n } else {\n return `${sec} seconds`\n }\n}", "function timeConverter(t) {\n\n var minutes = Math.floor(t/60);\n var seconds = t - (minutes*60);\n\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n if (minutes === 0) {\n minutes = \"00\";\n }\n\n else if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n\n return minutes + \":\" + seconds; \n}", "function formatTime(seconds) {\n\tvar time = \"\";\n\n\tif (Math.floor(seconds/60) != 0) {\n\t\ttime = \"\" + Math.round(seconds/60)+ \" min \";\n\t}\n\telse {\n\t\tvar s = Math.round((seconds % 60)/10)*10;\n\t\tif (s == 0)\n\t\t\ttime = \"5 sec\";\n\t\telse\n\t\t\ttime = \"\" + s + \" sec\";\t\n\t}\n\n\treturn time;\n}", "function timeConverter(t) {\n var minutes = Math.floor(t / 60);\n var seconds = t - (minutes * 60);\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n if (minutes === 0) {\n minutes = \"00\";\n }\n else if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n return minutes + \":\" + seconds;\n }", "function durationString(tSeconds) {\n\tvar hh = Math.floor(tSeconds / 3600);\n\tvar mm = Math.floor((tSeconds - (hh * 3600)) / 60);\n\tvar ss = Math.floor(tSeconds % 60);\n\n\tif(hh < 10) {hh = \"0\"+hh;}\n\tif(mm < 10) {mm = \"0\"+mm;}\n\tif(ss < 10) {ss = \"0\"+ss;}\n\n\tif(hh > 0) {\n\t\treturn hh+\":\"+mm+\":\"+ss;\n\t} else {\n\t\treturn mm+\":\"+ss;\n\t}\n}", "function formatTime(seconds) {\n var days;\n var hours;\n var minutes;\n days = parseInt(seconds / (24*3600));\n seconds -= days * 24 * 3600;\n hours = parseInt(seconds / 3600);\n seconds -= hours * 3600;\n minutes = parseInt(seconds / 60);\n seconds -= minutes * 60;\n var ret = \"\";\n if (days > 0) \n\tret += days + \" days \";\n if (days > 0 || hours > 0) \n\tret += hours + \" hrs \";\n if (days > 0 || hours > 0 || minutes > 0) \n\tret += minutes + \" min \";\n if (days == 0 && hours == 0)\n\tret += seconds + \" sec\";\n return(ret);\n}", "function secToTime(t) {\n var sec_num = parseInt(t, 10); // don't forget the second param\n var minutes = Math.floor(sec_num / 60);\n var seconds = sec_num - (minutes * 60);\n if (minutes < 10) {minutes = \"0\"+minutes;}\n if (seconds < 10) {seconds = \"0\"+seconds;}\n return minutes+':'+seconds;\n}", "function timeConverter(t) {\n\n var minutes = Math.floor(t / 60);\n var seconds = t - (minutes * 60);\n\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n if (minutes === 0) {\n minutes = \"00\";\n\n } else if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n\n return minutes + \":\" + seconds;\n }", "function formatTime(seconds) {\n if (typeof seconds == \"string\") {\n seconds = parseFloat(seconds);\n }\n\n var h = \"00\";\n var m = \"00\";\n var s = \"00\";\n if (!isNaN(seconds) && (seconds >= 0)) {\n var tmpH = Math.floor(seconds / 3600);\n var tmpM = Math.floor((seconds - (tmpH * 3600)) / 60);\n var tmpS = Math.floor(seconds - (tmpH * 3600) - (tmpM * 60));\n var tmpMS = seconds - tmpS;\n h = (tmpH < 10) ? \"0\" + tmpH : (Math.floor(seconds / 3600) + \"\");\n m = (tmpM < 10) ? \"0\" + tmpM : (tmpM + \"\");\n s = (tmpS < 10) ? \"0\" + tmpS : (tmpS + \"\");\n ms = tmpMS + \"\";\n var indexOfSDot = ms.indexOf(\".\");\n if (indexOfSDot != -1) {\n ms = ms.substr(indexOfSDot + 1, ms.length);\n }\n ms = ms.substr(0, 2);\n while (ms.length < 2) {\n ms += \"0\";\n }\n }\n return h + \":\" + m + \":\" + s + \".\" + ms;\n}", "function convertTimer(timer) {\n console.log(timer);\n minutes = parseInt(timer / 60, 10);\n seconds = parseInt(timer % 60, 10);\n\n minutes = minutes < 10 ? \"0\" + minutes : minutes;\n seconds = seconds < 10 ? \"0\" + seconds : seconds;\n return `${minutes}:${seconds}`;\n}", "function fancyTimeFormat(duration)\n{ \n // Hours, minutes and seconds\n var hrs = ~~(duration / 3600);\n var mins = ~~((duration % 3600) / 60);\n var secs = ~~duration % 60;\n\n // Output like \"1:01\" or \"4:03:59\" or \"123:03:59\"\n var ret = \"\";\n\n if (hrs > 0) {\n ret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\n }\n\n ret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\n ret += \"\" + secs;\n return ret;\n}", "function fancyTimeFormat(duration)\n{ \n // Hours, minutes and seconds\n var hrs = ~~(duration / 3600);\n var mins = ~~((duration % 3600) / 60);\n var secs = ~~duration % 60;\n\n // Output like \"1:01\" or \"4:03:59\" or \"123:03:59\"\n var ret = \"\";\n\n if (hrs > 0) {\n ret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\n }\n\n ret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\n ret += \"\" + secs;\n return ret;\n}", "function secondsToHms(d) {\n\n\tvar sec_num = Number(d) // don't forget the second param\n\tvar hours = Math.floor(sec_num / 3600);\n\tvar minutes = Math.floor((sec_num - (hours * 3600)) / 60);\n\tvar seconds = sec_num - (hours * 3600) - (minutes * 60);\n\n\tif (hours < 10) { hours = \"0\" + hours; }\n\tif (minutes < 10) { minutes = \"0\" + minutes; }\n\tif (seconds < 10) { seconds = \"0\" + seconds; }\n\treturn hours + ':' + minutes;\n}", "function timeConverter(t) {\n var minutes = Math.floor(t / 60);\n var seconds = t - (minutes * 60);\n\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n if (minutes === 0) {\n minutes = \"00\";\n }\n else if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n\n return minutes + \":\" + seconds;\n}", "function humanizeSecondsDuration(seconds) {\n let humanText = \"\";\n\n var days = Math.floor(seconds / (24 * 60 * 60));\n seconds -= days * (24 * 60 * 60);\n var hours = Math.floor(seconds / (60 * 60));\n seconds -= hours * (60 * 60);\n var minutes = Math.floor(seconds / 60);\n\n // Unused - Remaining seconds\n seconds -= minutes * 60;\n\n humanText += days > 0 ? days + \" day, \" : \"\";\n humanText += hours > 0 ? hours + \"h and \" : \"\";\n humanText += minutes + \"min\";\n\n return humanText;\n}", "function secondsToHMS(d) {\n\td = Number(d);\n\tvar h = Math.floor(d / 3600);\n\tvar m = Math.floor(d % 3600 / 60);\n\tvar s = Math.floor(d % 3600 % 60);\n\treturn ((h > 0 ? h + \"h\" + (m < 10 ? \"0\" : \"\") : \"\") + m + \"m\" + (s < 10 ? \"0\" : \"\") + s) + \"s\"; \n}", "function convertToseconds(durationInMinutes){\n let minutes = Number(durationInMinutes.split(\"\").slice(0, 2).join(\"\"));\n let seconds = Number(durationInMinutes.split(\"\").slice(3, 5).join(\"\"));\n let totalTime = (minutes * 60) + seconds;\n return totalTime\n}", "function humanReadable(seconds) {\n var format=function(x){ return x < 10 ? '0'+x : x ;}\n return format( parseInt(seconds / 3600)) + ':' +\n format( parseInt(seconds / 60 % 60)) + ':' +\n format( seconds % 60);\n}", "function formatSecondsToDigitalClock(seconds){\n\t\tif (!seconds || isNaN(seconds)) {\n\t\t\tseconds = 0;\n\t\t}\n\t\tvar parseSeconds = parseInt(seconds,10);\n\t\tvar durationHours = Math.floor(parseSeconds / 3600);\n\t\tvar durationMinutes = Math.floor((parseSeconds - (durationHours * 3600)) / 60);\n\t\tvar durationSeconds = Math.floor((parseSeconds - (durationHours * 3600) - (durationMinutes*60)));\n\t\tvar timeString = durationHours > 0 ? durationHours + \":\" : \"\";\n\t\ttimeString += durationMinutes > 9 ? durationMinutes + \":\" : \"0\" + durationMinutes + \":\";\n\t\ttimeString += durationSeconds > 9 ? durationSeconds : \"0\" + durationSeconds;\n\t\t\n\t\treturn timeString;\n\t}", "function formatSeconds(seconds) {\n \n const minutes = Math.floor(seconds / 60);\n\n const rest = seconds % 60;\n\n return [minutes, rest];\n\n}", "toDurationString(val, options = {}) {\n\t\t// TODO: replace by Intl.DurationFormat or equivalent when it becomes available (ECMA-402)\n\t\t// https://github.com/tc39/ecma402/issues/47\n\t\tconst date = new Date(+val);\n\t\tconst parts = [\n\t\t\tdate.getUTCFullYear() - 1970, date.getUTCMonth(), date.getUTCDate() - 1,\n\t\t\tdate.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(),\n\t\t];\n\t\tconst roundingBoundaries = [6, 15, 12, 30, 30];\n\t\tconst unitNames = [\"second\", \"minute\", \"hour\", \"day\", \"month\", \"year\"];\n\t\tconst positiveIndex = parts.findIndex(elem => elem > 0);\n\t\tconst precision = (options && options.precision ? options.precision : parts.length);\n\t\tif (options && options.hhmmss) {\n\t\t\tconst str = parts.slice(positiveIndex).map(value => value < 10 ? \"0\" + value : \"\" + value).join(\":\");\n\t\t\treturn str.length === 2 ? \"00:\" + str : str;\n\t\t}\n\t\t// round least significant displayed unit\n\t\tif (positiveIndex + precision < parts.length && precision > 0 && positiveIndex >= 0) {\n\t\t\tif (parts[positiveIndex + precision] >= roundingBoundaries[positiveIndex + precision - 1]) {\n\t\t\t\tparts[positiveIndex + precision - 1]++;\n\t\t\t}\n\t\t}\n\t\treturn parts\n\t\t\t.slice(positiveIndex)\n\t\t\t.reverse()\n\t\t\t.map((value, index) => value ? value + \" \" + unitNames[index] + (value > 1 ? \"s\" : \"\") : \"\")\n\t\t\t.reverse()\n\t\t\t.slice(0, precision)\n\t\t\t.join(\" \")\n\t\t\t.trim();\n\t}", "function format_time(seconds) {\n var miliseconds = seconds * 1000;\n if(seconds > 60) {\n return new Date(miliseconds).getMinutes() + \" minutes and \" +\n new Date(miliseconds).getSeconds() + \" seconds\";\n } else {\n return new Date(miliseconds).getSeconds() + \" seconds\";\n }\n}", "function formatDuration (seconds)\n{\n if (seconds == 0) return \"now\";\n \n var sec = seconds % 60 + \" second\";\n var min = parseInt(seconds / 60 % 60) + \" minute\";\n var hour = parseInt(seconds / 60 / 60 % 24) + \" hour\";\n var day = parseInt(seconds / 60 / 60 / 24 % 365) + \" day\";\n var year = Math.floor(seconds / 60 / 60 / 24 / 365) + \" year\";\n \n var dur = [year, day, hour, min, sec];\n var rtn = \"\";\n \n for (var item in dur)\n {\n if (parseInt(dur[item]) > 0)\n {\n if (parseInt(dur[item]) >= 2)\n dur[item] += \"s\";\n rtn += dur[item] + \", \";\n }\n else\n dur[item] = \"\";\n }\n \n rtn = rtn.substring(0, rtn.lastIndexOf(\", \"));\n if (rtn.lastIndexOf(\", \") > 0)\n rtn = rtn.substring(0, rtn.lastIndexOf(\", \")) + \" and \" + rtn.substring(rtn.lastIndexOf(\", \") + 2);\n \n return rtn;\n}", "function getTimeStr(seconds) {\n\tvar minutes = Math.floor(seconds / 60);\n\t\n\tvar seconds = Math.floor(seconds % 60);\n\t\n\tif (seconds < 10) {\n\t\treturn '' + minutes + ':0' + seconds;\n\t} else {\n\t\treturn '' + minutes + ':' + seconds;\n\t}\n}", "function formatSecsAsMMSS(secs) {\n var formattedtime;\n var minutes = Math.floor(secs / 60);\n formattedtime = minutes;\n var seconds = secs - (minutes * 60);\n if (seconds < 10) {\n formattedtime += \":0\" + seconds;\n } else {\n formattedtime += \":\" + seconds;\n }\n return formattedtime;\n\n}", "function formatCounter(timeSeconds) {\n \tvar timeString;\n \tif (timeSeconds < 60) {\n \t\ttimeString = Math.floor(timeSeconds) + \"s\";\n \t} else if (timeSeconds < 3600) {\n \t\ttimeString = Math.floor(timeSeconds / 60) + \"m \" + Math.floor(timeSeconds % 60) + \"s\";\n \t} else {\n \t\ttimeString = Math.floor(timeSeconds / 3600) + \"h \" + Math.floor((timeSeconds % 3600) / 60) + \"m \" + Math.floor(timeSeconds % 60) + \"s\";\n \t}\n\n \treturn timeString;\n}", "function humanReadable(seconds) {\n // let hours = toString(Math.floor(seconds/3600));\n let hours = Math.floor(seconds/3600).toString();\n // console.log(typeof hours, hours)\n if (hours.length === 1) {\n hours = \"0\" + hours;\n }\n let afterhours = seconds % 3600;\n let minutes = Math.floor(afterhours/60).toString();\n // console.log(typeof minutes, minutes)\n if (minutes.length === 1) {\n minutes = \"0\" + minutes;\n }\n let myseconds = (afterhours % 60).toString();\n if (myseconds.length === 1) {\n myseconds = \"0\" + myseconds;\n }\n // console.log(typeof myseconds, myseconds)\n let result = hours + \":\" + minutes + \":\" + myseconds;\n return result;\n}", "function convert(ms) {\n if (ms > 0) {\n var min = Math.floor((ms % (1000 * 60 * 60)) / (1000 * 60));\n var sec = Math.floor((ms % (1000 * 60)) / 1000);\n if (min < 10) min = \"0\" + min;\n if (sec < 10) sec = \"0\" + sec;\n return min + ':' + sec;\n }\n else {\n return \"00:00\";\n }\n }", "function secondsToText(seconds) {\n var mins = ~~(seconds/60);\n var secs = seconds - (mins*60);\n\n var result = \"\";\n var spaceBetweenParts = \"\";\n \n if (mins >=2 ) {\n result = mins.toString() + \" minutes\";\n spaceBetweenParts = \" \";\n } else if (mins == 1) {\n result = mins.toString() + \" minute\";\n spaceBetweenParts = \" \";\n }\n\n if (secs == 0) {\n // Do nothing\n } else if (secs == 1) {\n result += spaceBetweenParts + secs.toString() + \" second\";\n } else {\n result += spaceBetweenParts + secs.toString() + \" seconds\";\n }\n\n return result;\n}", "toHHMMSS( num ) {\n let hours = Math.floor(num / 3600);\n let minutes = Math.floor((num - (hours * 3600)) / 60);\n let seconds = num - (hours * 3600) - (minutes * 60);\n \n if (hours < 10) {hours = \"0\"+hours;}\n if (minutes < 10) {minutes = \"0\"+minutes;}\n if (seconds < 10) {seconds = \"0\"+seconds;}\n return hours+':'+minutes+':'+seconds;\n }", "secondsToTime(secs){\n let hours = Math.floor(secs / (60 * 60)); // Seconds divided by 3600\n\n let divisor_for_minutes = secs % (60 * 60); // Get the remainder of mins after hours\n let minutes = Math.floor(divisor_for_minutes / 60); // Remaining seconds divided by 60\n\n let divisor_for_seconds = divisor_for_minutes % 60; // Get the remainder of secs after minutes\n let seconds = Math.ceil(divisor_for_seconds); // Remaining seconds \n\n let obj = {\n \"h\": hours,\n \"m\": minutes,\n \"s\": seconds\n };\n return obj; \n }", "function secondsToString(s) {\n var hours = Math.floor(s / 3600);\n s -= hours*3600;\n var minutes = Math.floor(s / 60);\n s -= minutes*60;\n return hours + \" hours, \" + minutes + \" minutes, and \" + s + \" seconds\";\n}", "function format_time(secs)\n{\n\tvar min = Math.floor(secs / 60);\n\tvar sec = secs % 60;\n\t\n\tif (sec < 10)\n\t\tsec = \"0\" + sec;\n\t\n\treturn min + \":\" + sec;\n}", "function toWholeSeconds(duration) {\n return Math.abs(Math.floor(duration / 1000) * 1000);\n }", "function formatTime (seconds) {\n var minutes = (seconds / 60),\n hours = (seconds / 60 / 60),\n time = '';\n\n if (hours >= 1) {\n time = decFixed(Math.floor(hours), 1) + ' hour';\n time += (hours > 1) ? 's' : '';\n } else if (minutes > 1) {\n time = decFixed(Math.floor(minutes), 0) + ' minute';\n time += (minutes > 1) ? 's' : '';\n } else {\n time = 'less than a minute';\n }\n\n return time;\n }", "function formatTime(seconds){\n if (seconds < 1){\n return \"<1s\";\n }\n var returnStr = \"\";\n if (604800 <= seconds){\n returnStr += `${parseInt(seconds/604800)} ${pluralize(\"week\", parseInt(seconds/604800))}, `;\n seconds %= 604800;\n }\n if (86400 <= seconds){\n returnStr += `${parseInt(seconds/86400)} ${pluralize(\"day\", parseInt(seconds/86400))}, `;\n seconds %= 86400;\n }\n returnStr += ((seconds/3600 < 10) ? '0' : '') + parseInt(seconds/3600);\n seconds %= 3600;\n returnStr += \":\" + ((seconds/60 < 10) ? '0' : '') + parseInt(seconds/60);\n seconds %= 60;\n returnStr += \":\" + ((seconds < 10) ? '0' : '') + parseInt(seconds);\n return returnStr;\n}", "function formatDuration (seconds) {\n var time = { year: 31536000, day: 86400, hour: 3600, minute: 60, second: 1 },\n res = [];\n\n if (seconds === 0) return 'now';\n\n for (var key in time) {\n if (seconds >= time[key]) {\n var val = Math.floor(seconds/time[key]);\n res.push(val += val > 1 ? ' ' + key + 's' : ' ' + key);\n seconds = seconds % time[key];\n }\n }\n\n return res.length > 1 ? res.join(', ').replace(/,([^,]*)$/,' and'+'$1') : res[0]\n}", "secondsToTime(secs){\n let hours = Math.floor(secs / (60 * 60));\n\n let divisor_for_minutes = secs % (60 * 60);\n let minutes = Math.floor(divisor_for_minutes / 60);\n\n let divisor_for_seconds = divisor_for_minutes % 60;\n let seconds = Math.ceil(divisor_for_seconds);\n\n let obj = {\n \"h\": hours,\n \"m\": minutes,\n \"s\": seconds\n };\n return obj;\n }", "function calculateTimeDuration(secs) {\n var hr = Math.floor(secs / 3600);\n var min = Math.floor((secs - (hr * 3600)) / 60);\n var sec = Math.floor(secs - (hr * 3600) - (min * 60));\n\n if (min < 10) {\n min = \"0\" + min;\n }\n\n if (sec < 10) {\n sec = \"0\" + sec;\n }\n\n if (hr <= 0) {\n return min + ':' + sec;\n }\n\n return hr + ':' + min + ':' + sec;\n}", "function secondsToHms(d) {\n var h = Math.floor(d / 3600);\n var m = Math.floor(d % 3600 / 60);\n var s = Math.floor(d % 3600 % 60);\n return ((h > 0 ? h + \":\" + (m < 10 ? \"0\" : \"\") : \"\") + m + \":\" + (s < 10 ? \"0\" : \"\") + s);\n}", "function formatDuration(duration) {\n if (duration < 1000) {\n duration += 'ms';\n } else if (duration > 1000) {\n duration /= 1000;\n duration += 's';\n }\n return duration;\n}", "function FormatTime(seconds) {\n var hh = Math.floor(seconds / (60 * 60));\n var mm = Math.floor(seconds / 60) % 60;\n var ss = seconds % 60;\n\n return (hh == 0 ? \"\" : (hh < 10 ? \"0\" : \"\") + hh.toString() + \":\") + (mm < 10 ? \"0\" : \"\") + mm.toString() + \":\" + (ss < 10 ? \"0\" : \"\") + ss.toFixed(3);\n}", "function msToTime(duration) {\n let milliseconds = parseInt((duration % 1000) / 100);\n let seconds = Math.floor((duration / 1000) % 60);\n let minutes = Math.floor((duration / (1000 * 60)) % 60);\n\n minutes = (minutes < 10) ? \"0\" + minutes : minutes;\n seconds = (seconds < 10) ? \"0\" + seconds : seconds;\n\n return minutes + \":\" + seconds + \".\" + milliseconds;\n}" ]
[ "0.8102121", "0.784536", "0.7589821", "0.75599647", "0.75510377", "0.7507525", "0.74792325", "0.74506074", "0.7412715", "0.74050564", "0.73792595", "0.737781", "0.7371972", "0.7367512", "0.73642397", "0.73574805", "0.7350247", "0.7344105", "0.73269", "0.7312306", "0.73014176", "0.7251423", "0.7247058", "0.7234906", "0.7225278", "0.722472", "0.72155505", "0.7202447", "0.7201498", "0.7195242", "0.7184887", "0.71844375", "0.71815175", "0.7178723", "0.7170403", "0.7161645", "0.71586925", "0.71563166", "0.715071", "0.713592", "0.7128777", "0.71235365", "0.712065", "0.71093005", "0.71079975", "0.70957345", "0.709146", "0.7089527", "0.7088616", "0.7086707", "0.7085045", "0.70849234", "0.7064464", "0.7053466", "0.7047294", "0.7046352", "0.703867", "0.7037722", "0.70297086", "0.7029263", "0.702767", "0.70252055", "0.70251226", "0.70154005", "0.70100987", "0.69943595", "0.69907206", "0.6985134", "0.6985134", "0.6985045", "0.6984863", "0.6984206", "0.69804084", "0.69716436", "0.6946414", "0.6945772", "0.69444466", "0.6937525", "0.6930857", "0.6920271", "0.69176507", "0.6914993", "0.6910922", "0.6905344", "0.69009614", "0.68958706", "0.68958396", "0.6889755", "0.68875015", "0.68845546", "0.6883338", "0.68785214", "0.6876105", "0.68727213", "0.6856982", "0.68521804", "0.68310326", "0.6826357", "0.68226177", "0.68196994" ]
0.6998873
65
Executes every time the 'invalid' event is triggered
function youtubeInvalid(t,msg){// t = this var container = t.findParentByType("dialogfieldset"); var youtubeDurationLabel = container.getComponent("durationLabel"); // the 'duration label' widget var youtubeVideoNameLabel = container.getComponent("videoNameLabel"); // the 'videoName' widget youtubeDurationLabel.setText(""); youtubeVideoNameLabel.setText(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onInvalid(errors) {\n console.log(errors);\n }", "function onInvalidInput() {\n\n transition(\"ERROR_INPUT\");\n\n }", "afterValidChange() { }", "adapterDidInvalidate(errors) {\n var attribute = void 0;\n\n for (attribute in errors) {\n if (errors.hasOwnProperty(attribute)) {\n this.addErrorMessageToAttribute(attribute, errors[attribute]);\n }\n }\n\n this.send('becameInvalid');\n\n this._saveWasRejected();\n }", "_invalidateProperties() {\n this.__isInvalid = true;\n super._invalidateProperties();\n }", "function onInvalidData(code, message) {\n var err = {};\n if(typeof message === 'undefined') {\n err.code = 'INVALID_DATA';\n err.message = code;\n } else {\n err.code = code;\n err.message = message;\n }\n function InvalidValidationWrapper() {\n return validateFunc.apply(this, arguments);\n }\n InvalidValidationWrapper.error = err;\n return InvalidValidationWrapper;\n }", "function validCycle(event) {\n update(event);\n validOrNot(event);\n validForm(event);\n}", "invalidate_() {\n if (this.initializePromiseReject_ !== null) {\n const reject = this.initializePromiseReject_;\n this.initializePromiseReject_ = null;\n this.initializePromise_ = null;\n reject();\n }\n dispatchSimpleEvent(this, 'invalidated', true);\n }", "onNext() {\n\t\tconst validationRes = this.validate();\n\n\t\tif (validationRes === undefined) {\n\t\t\tthis.props.onNext();\n\t\t} else {\n\t\t\tthis.props.ui.showErrorAlert(\n\t\t\t\tthis.t('errors.invalidFieldsAlert.title'),\n\t\t\t\tthis.t('errors.invalidFieldsAlert.message')\n\t\t\t);\n\t\t}\n\t}", "function OnValidationFailed() \n{ \n MarkInvalid(\"#cardNumberSection\");\n $(\"#cardNumberSection .warning span\").html(\"Card number is invalid\");\n}", "showInvalidFormValidation() {\n this.showErrorToast({\n msg: \"The given data was invalid. Please check your form again!\",\n dt: 3800\n });\n }", "function setInvalid() {\n gregDate = moment.utc({'year': 0, 'month': 0, 'date': 0});\n badiYear = -1;\n badiMonth = -1;\n badiDay = -1;\n ayyamiHaLength = -1;\n nawRuz = moment.utc('0000-00-00');\n valid = false;\n }", "function onInvalid(form,fieldName,errorMessage)\n{\n\talert(errorMessage);\n\t\t\t\t\n\tif(!(form[fieldName] instanceof Array))\n\t{\n\t\tform[fieldName].focus();\n\t}\n\treturn false;\n}", "_setFocusOnInvalidInput() {\n\t\t\tvar oData = this._oJSONModel.getData();\n\t\t\t_aNumericInputFields.some(function(sFieldName) {\n\t\t\t\tif (oData[sFieldName].valueState === ValueState.Error) {\n\t\t\t\t\tvar oElement = sap.ui.getCore().byId(oData[sFieldName].id);\n\t\t\t\t\toElement.focus();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}, this);\n\t\t}", "validate() {\n this.errorMessage = \"Dit is geen nummer\";\n super.validate();\n }", "@api\n clearCustomError() {\n this.valid = true;\n }", "function invalidEntry() {\n\talert(\"You have to do something.\");\n}", "checkIsValid() {\n if (!this.isValid) {\n this.errors.push({\n field: this.fieldName,\n message: this.message,\n valueRecieved: this.fieldValue,\n });\n }\n }", "validate() {\n // Als NIET (!) valide, dan error weergeven\n if (!this.isValid()) {\n this.showError();\n console.log(\"niet valide\");\n }\n else\n this.hideError();\n }", "validate() {\n if (this.isDisposed) {\n return;\n }\n this._invalidated = false;\n this._lastArgs = [];\n }", "componentWillUnmount() {\n this.onValidChange(undefined, this.props.validates);\n }", "function validation() {\r\n\t\t\r\n\t}", "checkValidity(event) {\n event.preventDefault();\n\n this.attemptedSave = true;\n\n if (this.$v.$invalid) {\n console.log(\"something is invalid\", this.$v);\n } else {\n console.log(\"all good!\");\n this.saveFieldForm(event);\n\t\t\t\t}\n\n }", "should_indicate_invalid()\n\t{\n\t\tconst { indicateInvalid, error } = this.props\n\t\treturn indicateInvalid && error\n\t}", "should_indicate_invalid()\n\t{\n\t\tconst { indicateInvalid, error } = this.props\n\n\t\treturn indicateInvalid && error\n\t}", "function validate(event) {\n event.preventDefault()\n removeErrorMessage()\n removeValidMessage()\n\n validForm = true\n validateName()\n validateCarYear()\n validateCarMake()\n validateCarModel()\n validateStartDate()\n validateDays()\n validateCard()\n validateCvv()\n validateExpiration()\n\n showValidMessage()\n}", "function onInvalidTag(e){\n console.log(e, e.detail);\n}", "function onInvalidTag(e){\n console.log(\"onInvalidTag: \", e.detail);\n }", "function invalidData() {\n\t\t\t// TODO: Add a modal to warn the user we failed them and they are headed back to the search page.\n\t\t\t$state.go('home');\n\t\t}", "_invalidate() {\n\t\tif (this._invalidated) {\n\t\t\t// console.log(\"already invalidated\", this, ...arguments);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.getDomRef() && !this._suppressInvalidation) {\n\t\t\tthis._invalidated = true;\n\t\t\t// console.log(\"INVAL\", this, ...arguments);\n\t\t\tRenderScheduler.renderDeferred(this);\n\t\t}\n\t}", "function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "validate() {\n this.errorMessage = \"Dit is geen text\";\n super.validate();\n }", "function onInvalidTag(e) {\r\n console.log(\"onInvalidTag: \", e.detail);\r\n }", "beforeInit(e) {\n e.currentTarget._errors = new ReactiveMap({});\n }", "checkValidity(context, event) {\n throw new Error('Implement in subclass');\n }", "checkValidity(context, event) {\n throw new Error('Implement in subclass');\n }", "function inlineValidate(evt) {\n\t\tvar el = evt.target,\n\t\t\thasValid = CL.contains(el, 'isValid'),\n\t\t\thasInvalid = CL.contains(el, 'invalid'),\n\t\t\tisValid;\n\n\t\tif (el.willValidate && (hasValid || hasInvalid)) {\n\t\t\tisValid = el.checkValidity();\n\n\t\t\tif (isValid && hasInvalid || !isValid && hasValid) {\n\t\t\t\tsetState(el, isValid);\n\n\t\t\t\tif (isValid) {\n\t\t\t\t\tcloseBubble(el);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function setIsValid(calEvent){\n calEvent.is_valid = isValid(calEvent)\n}", "validate() {}", "handleFilterFormErrorEvent() {\n\t\t// TODO should we present this error message?\n\t\tthis.listingElement.removeAttribute('aria-busy');\n\t}", "function onInput(event) {\n\t\tutils.setHTML('#form-error', \"\");\n\t\tif(event.target.name === 'email') {\n\t\t\tutils.setHTML('#email .error', \"\");\n\t\t} else if(event.target.name === 'password') {\n\t\t\tutils.setHTML('#password .error', \"\");\n\t\t}\n\t}", "formValueUpdated(e) {\n let errorList = [...this.errors];\n if (!e.target.value) {\n errorList.push(e.target.name);\n } else {\n let indexOfError = errorList.indexOf(e.target.name);\n if (indexOfError >= 0) {\n errorList.splice(indexOfError, 1);\n }\n }\n this.errors = [...errorList];\n }", "_handleValidation(e){\n if(!CPFHelper.VerifyCPF(CPFHelper.HandleCPFStringFormat(e.target.value))){\n this._input.className += ' invalid'\n this._parentElement.append(this._validatorLabel);\n } else {\n this._input.classList.remove('invalid');\n this._validatorLabel.remove();\n }\n }", "validate() { }", "function invalidated()/*:void*/ {\n // The dependency tracker has fired. It can be discarded.\n this.dependencyTracker$nJmn = null;\n // The cached value might no longer be up to date.\n this.valueDirty$nJmn = true;\n // If we have not already requested a recomputation of the cached value, ...\n if (!this.willCheckValueChanged$nJmn) {\n // .. we do so now.\n this.willCheckValueChanged$nJmn = true;\n com.coremedia.ui.util.EventUtil.invokeLater(AS3.bind(this,\"checkValueChanged$nJmn\"));\n }\n }", "onDisabled() {\n this.updateInvalid();\n }", "whenValid() {\n\n }", "_revalidate() {\n if (this._startInput) {\n this._startInput._validatorOnChange();\n }\n if (this._endInput) {\n this._endInput._validatorOnChange();\n }\n }", "_revalidate() {\n if (this._startInput) {\n this._startInput._validatorOnChange();\n }\n if (this._endInput) {\n this._endInput._validatorOnChange();\n }\n }", "onBlur(evt) {\n\t\tconst {formData} = this.state;\n\t\tconst key = evt.target.id;\n\t\tconst data = formData[key];\n\n\t\tif (this.validators[key]\n\t\t&& !this.validators[key](formData[key])) {\n\t\t\tevt.target.classList.add('error');\n\t\t\tevt.target.nextSibling.classList.add('error');\n\t\t}\n\t}", "validate() {\n\t\tconst msg = this.validator ? this.validator(this.value) : '';\n\t\tthis.error = msg;\n\t}", "function onInput(event) {\n\t\tutils.setHTML('#form-error', \"\");\n\t\tif(event.target.name === 'name') {\n\t\t\tutils.setHTML('#name .error', \"\");\n\t\t} else if(event.target.name === 'nameAlpha') {\n\t\t\tutils.setHTML('#nameAlpha .error', \"\");\n\t\t} else if(event.target.name === 'birth') {\n\t\t\tutils.setHTML('#birth .error', \"\");\n\t\t} else if(event.target.name === 'death') {\n\t\t\tutils.setHTML('#death .error', \"\");\n\t\t}\n\t}", "function invalidate(elem) {\n elem.removeClass('ng-valid ng-valid-number');\n elem.addClass('ng-invalid ng-invalid-number')\n }", "revalidate(event) {\n if (event.target instanceof window.HTMLButtonElement ||\n event.target instanceof window.HTMLTextAreaElement ||\n event.target instanceof window.HTMLSelectElement ||\n event.target instanceof window.HTMLInputElement) {\n\n if (this.settings.revalidate === 'hybrid') {\n /* \"hybrid\" somewhat simulates what browsers do. See for example\n * Firefox's :-moz-ui-invalid pseudo-class:\n * https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-invalid */\n if (event.type === 'blur' &&\n event.target.value !== event.target.defaultValue ||\n ValidityState(event.target).valid) {\n /* on blur, update the report when the value has changed from the\n * default or when the element is valid (possibly removing a still\n * standing invalidity report). */\n reportValidity(event.target);\n } else if ((event.type === 'keyup' && event.keyCode !== 9) ||\n event.type === 'change') {\n if (ValidityState(event.target).valid) {\n // report instantly, when an element becomes valid,\n // postpone report to blur event, when an element is invalid\n reportValidity(event.target);\n }\n }\n\n } else if (event.type !== 'keyup' || event.keyCode !== 9) {\n /* do _not_ validate, when the user \"tabbed\" into the field initially,\n * i.e., a keyup event with keyCode 9 */\n reportValidity(event.target);\n }\n\n }\n }", "fireValidityEventIfNecessary() {\n const previousValidity = this.formValidity_;\n this.formValidity_ = this.checkFormValidity(this.form);\n if (previousValidity !== this.formValidity_) {\n const win = getWin(this.form);\n const type = this.formValidity_ ? FormEvents.VALID : FormEvents.INVALID;\n const event = createCustomEvent(win, type, null, {bubbles: true});\n this.form.dispatchEvent(event);\n }\n }", "submitError(){\n\t\tif(!this.isValid()){\n\t\t\tthis.showErrorMessage();\n\t\t}\n\t}", "_validate() {\n\t}", "function next(){\n validate();\n}", "function next(){\n validate();\n}", "onChange() {\n this.validate();\n this.triggerContextUpdate();\n }", "function instantValidation(field) {\n if (shouldBeValidated(field)) {\n let invalid =\n (dateTimePickerMinText.val().length > 0) &&\n (dateTimePickerMaxText.val().length > 0) &&\n (new Date(dateTimePickerMaxText.val()) < new Date(dateTimePickerMinText.val()));\n if (!invalid && field.attr(\"aria-invalid\")) {\n dateTimePickerMinText.removeAttr(\"aria-invalid\");\n dateTimePickerMaxText.removeAttr(\"aria-invalid\");\n dateTimePickerError.css(\"display\",\"none\");\n } else if (invalid && !field.attr(\"aria-invalid\")) {\n dateTimePickerMinText.attr(\"aria-invalid\", \"true\");\n dateTimePickerMaxText.attr(\"aria-invalid\", \"true\");\n dateTimePickerError.css(\"display\",\"block\");\n }\n }\n}", "function invalidInput(input) {\n\n isValid = false;\n\n if (first) {\n input.focus();\n first = false;\n }\n input.style.border = \"3px solid red\";\n }", "setInvalid(state, payload) {\n state.selectedItem[payload.field] = {\n ...state.selectedItem[payload.field],\n invalid: true,\n invalidMsg: payload.message\n }\n }", "function onBlur() {\n\t\t\t$$invalidate(3, inputValue = value);\n\t\t}", "onFieldValidated(res, errors, field) {\n // Remove old errors for this field\n this.errors = this.errors.filter(e => e.field !== field.schema);\n\n if (!res && errors && errors.length > 0) {\n // Add errors with this field\n forEach(errors, err => {\n this.errors.push({\n field: field.schema,\n error: err\n });\n });\n }\n\n let isValid = this.errors.length === 0;\n this.$emit(\"validated\", isValid, this.errors, this);\n }", "function execute () {\n// document.getElementById(\"message\").addEventListener(\"change\", cleanError);\n// document.getElementById(\"country\").addEventListener(\"change\", cleanError);\n// document.getElementById(\"email\").addEventListener(\"change\", cleanError);\n// document.getElementById(\"name\").addEventListener(\"change\", cleanError);\n document.getElementById(\"form\").addEventListener(\"submit\", validate);\n }", "_onBlur() {\n if (this.props.enabled === false) {\n return;\n }\n this.setState({on_focus: false});\n var message = this._validateAndReturnMessage(this.state.text);\n if (message) { // error happens\n this._enableErrorState(message);\n // call invalid callback\n if (this.props.invalidCallback)\n this.props.invalidCallback();\n }\n else { // error did not happen\n // call valid callback\n if (this.props.validCallback)\n this.props.validCallback();\n }\n }", "function(event) {\n\t\tvar isValid = true;\n\t\t\n\t\tvar email = $(\"#email_address\").va();\n\t\tif (email == \"\") {\n\t\t\t$(\"#email_address\").next().text(\"This field is required.\");\n\t\t\tisValid = false;\n\t\t\t}\n\t\t\t\n\t\tvar full_name = $(\"#full_name_id\").val().trim();\n\t\tif (full_name == \"\") {\n\t\t $(\"#full_name_id\").next().text(\"This field is required.\");\n\t\t\tisValid = false;\n\t\t\t}\n\t \n\talert( \"Missing a field b \");\n\t\t\t\t \n//\tif (isValid == false) { \n\t\talert( \"Missing email address or full name\");\n\t\tevent.preventDefault();\n\t//\t}\t\t\t \n\t}", "blurEventHandler() {\n if (!this.validate()) {\n this.error(this._inputElement.validationMessage);\n } else {\n this.error();\n this._containerElement.classList.remove(Input.FORM_GROUP_ERROR_CLASS);\n }\n }", "onInvalidDrop() {\n const me = this;\n\n me.dragData.draggedRecords.forEach((record) => (record.instanceMeta(me.currentOverClient).retainElement = false));\n\n if (me.tip) {\n me.tip.hide();\n }\n }", "function alsoValidate() {\n const { hasError, error } = validateURL(e.target.value)\n onUpdate(idx, e.target.value, hasError, error)\n }", "function realtimeValidation() {\n if (lastChanged) {\n /* Get current error(s) for the currently edited field */\n const newError = checkFormValidity()[lastChanged];\n updateErrors(errors, lastChanged, newError);\n }\n }", "function onBlurHandler(event) {\n let value = event.target.value;\n let field = event.target.getAttribute('id').split('-')[3];\n\n if (!value && requiredFields.indexOf(field) !== -1) {\n templateService.setError(event.target, Packlink.errorMsgs.required);\n } else {\n if (field === 'phone') {\n if (!isPhoneValid(value)) {\n templateService.setError(event.target, Packlink.errorMsgs.phone);\n } else {\n templateService.removeError(event.target);\n }\n } else {\n templateService.removeError(event.target);\n }\n }\n }", "function handleValidate ($node) {\n const validate = $node.validate\n if (!validate || !$node.hasProperty(\"oninput\")) return\n\n $node.addEventListener(\"input\", () => {\n $node.setCustomValidity(\"\")\n timeout(0).then(() => validateNodeValue($node, validate))\n })\n delete $node.validate\n}", "function error(){\n alert('invalid info')\n}", "register(event) {\n\n let selectedfieldList =this.template.querySelectorAll(\"lightning-dual-listbox\");\n let selectValidation=[];\n\n for(let i=0 ; i<selectedfieldList.length ; i++){\n let selectedfields = `${selectedfieldList[i].value}`.split(',');\n if(selectValidation.some(r=> selectedfields.indexOf(r) >= 0)){\n event.target.setCustomValidity(\"Duplicate fields found\"); // Sets custom validatin message\n }else {\n selectedfieldList[i].setCustomValidity(\"\"); // if there was a custom error before, reset it\n }\n selectedfieldList[i].reportValidity();// Tells lightning-input to show the error right away without needing interaction\n \n selectValidation.push(...selectedfields);\n }\n }", "function invalidate(callback/*:Function = null*/)/*:void*/ {if(arguments.length<=0)callback=null;\n // Content types do not change (or at least we do not react to\n // changes within the Studio). Swallow all invalidations.\n if (callback) {\n callback(this);\n }\n }", "function displayInvalid(entryItem) {\n entryItem.addClass('invalid');\n}", "selfValidate(){\n\n }", "function skipValidation() { \n unsaved = false;\n checkChange(unsaved);\n }", "_markAsValid() {\n\t this.$points.find('.point').removeClass('has-error');\n\t }", "function resetError(widget)\n{\n var parent = widget.parent();\n parent.find(\".serious_error\").remove();\n parent.find(\".warning_error\").remove();\n\n var bean = widget.data(\"bean\"); // fetch field bean\n\n if (bean != null)\n {\n bean.valid = true;\n }\n}", "function warnInvalid (theField, s)\r\n{\r\n\ttheField.style.fontWeight = 'bold';\r\n\ttheField.style.backgroundColor='#FFB7BE';\r\n\t// Set id for regex validation dialog div\r\n\tvar valPopupId = 'redcapValidationErrorPopup';\r\n\t// Get ID of field: If field does not have an id, then given it a random one so later we can reference it directly.\r\n\tvar obId = $(theField).attr('id');\r\n\tif (obId == null) {\r\n\t\tobId = \"val-\"+Math.floor(Math.random()*10000000000000000);\r\n\t\t$(theField).attr('id', obId);\r\n\t}\r\n\t// Set the Javascript for returning focus back on element (if specified)\r\n\tsetTimeout(function(){\r\n\t\tsimpleDialog(s, null,valPopupId, null, \"$('#\"+obId+\"').focus();\");\r\n\t\t$('#'+valPopupId).parent().find('button:first').focus();\r\n\t},10);\r\n return false;\r\n}", "function validation(e) {\n $(selectors.error).remove();\n if (validName && validContact && validMail) {\n $(selectors.successMsg).removeClass('hide').addClass('show');\n $(selectors.name).val('');\n $(selectors.contactNo).val('');\n $(selectors.email).val('');\n validName = false;\n validContact = false;\n validMail = false;\n } else {\n $(selectors.name).after('<span class=\"error\">Name is required</span>');\n $(selectors.contactNo).after('<span class=\"error\">Contact No is required.</span>');\n $(selectors.email).after('<span class=\"error\">Email is required.</span>');\n }\n }", "function OnErr() {\r\n}", "handleDynamicRequired(event) {\r\n if(event.target.value === \"email\") {\r\n this.enableHasError(\"email\", true);\r\n let email = document.getElementById(\"email\");\r\n let control = \"emailControl\";\r\n // pattern match test\r\n if(this.state.employee.contactPreference===\"email\" && email.pattern){\r\n if(RegExp(email.pattern).test(email.value)){\r\n // valid\r\n this.setState(prevState => ({[control]: {\r\n touched: true,\r\n invalid: false,\r\n hasError: false,\r\n hasSuccess: true\r\n }}));\r\n } else {\r\n // invalid pattern\r\n this.setState(prevState => ({[control]: {\r\n touched: true,\r\n invalid: true,\r\n hasError: true,\r\n hasSuccess: false\r\n }}));\r\n }\r\n }\r\n this.enableHasError(\"phoneNumber\", false);\r\n } else if(event.target.value === \"phoneNumber\") {\r\n this.enableHasError(\"phoneNumber\", true);\r\n this.enableHasError(\"email\", false);\r\n }\r\n }", "invalidate() {\n this.isValidated = false;\n //clear out various lookups (they'll get regenerated on demand the next time they're requested)\n this.cache.clear();\n }", "validateAfterInput(e) {\n if (e.target.name === \"fname\") {\n if (!isChar(e.target.value)) {\n this.setState({ fname_err: \"error\" });\n this.setState({ fname_err_helperText: \"Invalid\" });\n } else {\n this.setState({ fname_err: \"\" });\n this.setState({ fname_err_helperText: \"\" });\n }\n }\n if (e.target.name === \"lname\") {\n if (!isChar(e.target.value)) {\n this.setState({ lname_err: \"error\" });\n this.setState({ lname_err_helperText: \"Invalid\" });\n } else {\n this.setState({ lname_err: \"\" });\n this.setState({ lname_err_helperText: \"\" });\n }\n }\n if (e.target.name === \"year\") {\n if (!isYearValid(e.target.value)) {\n this.setState({ year_err: \"error\" });\n this.setState({ year_err_helperText: \"Invalid Year\" });\n } else {\n this.setState({ year_err: \"\" });\n this.setState({ year_err_helperText: \"\" });\n }\n }\n if (e.target.name === \"month\") {\n if (!isMonthValid(e.target.value)) {\n this.setState({ month_err: \"error\" });\n this.setState({ month_err_helperText: \"Invalid Month\" });\n } else {\n this.setState({ month_err: \"\" });\n this.setState({ month_err_helperText: \"\" });\n }\n }\n if (e.target.name === \"day\") {\n if (!isDayValid(e.target.value)) {\n this.setState({ day_err: \"error\" });\n this.setState({ day_err_helperText: \"Invalid Day\" });\n } else {\n this.setState({ day_err: \"\" });\n this.setState({ day_err_helperText: \"\" });\n }\n }\n if (e.target.name === \"password\") {\n if (!isPassword(e.target.value)) {\n this.setState({ password_err: \"error\" });\n this.setState({ password_err_helperText: \"Passwords Isn't Secured\" });\n } else {\n this.setState({ password_err: \"\" });\n this.setState({ password_err_helperText: \"\" });\n }\n }\n if (e.target.name === \"confirmPassword\") {\n if (!isEqual(e.target.value, this.state.password.toString())) {\n this.setState({ confirmPassword_err: \"error\" });\n this.setState({\n confirmPassword_err_helperText: \"Passwords Don't Match\",\n });\n } else {\n this.setState({ confirmPassword_err: \"\" });\n this.setState({ confirmPassword_err_helperText: \"\" });\n }\n }\n this.setState({ error: \"\" });\n }", "internalOnChange(event) {\n const me = this; // Don't trigger change if we enter invalid value or if value has not changed (for IE when pressing ENTER)\n\n if (me.isValid && me.hasChanged(me._lastValue, me.value)) {\n me.triggerChange(event, true);\n me._lastValue = me.value;\n }\n }", "onUsernameChange(e) {\n this.setState({ username: e.target.value });\n //We want to clear the error when ever the user type something new\n this.clearValidationErr(\"username\");\n }", "function _onValueChanged(event) {\n this._heightInvalidated = true;\n }", "function onEmailChange(e) {\n console.log('Email changes');\n if (document.querySelector(\"#email-error\")) {\n document.querySelector(\"#email-error\").remove();\n e.target.classList.remove(\"not-valid\");\n e.target.classList.add(\"valid\");\n }\n \n let emailPattern = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$/i;\n let emailValidation = emailPattern.test(e.target.value);\n console.log(emailValidation);\n if (emailValidation) {\n if (document.querySelector(\"#email-error\")) {\n document.querySelector(\"#email-error\").remove();\n \n }\n \n } else if (e.target.value.length === 0) {\n docDotQS(\"#email\").insertAdjacentHTML(\"afterend\", validator.errors.email2);\n } else {\n docDotQS(\"#email\").insertAdjacentHTML(\"afterend\", validator.errors.email1);\n }\n \n}", "function InvalidInput(idInput, message) {\n document.getElementById(idInput).setCustomValidity(message);\n}", "function validate(){\n let inputs = document.querySelectorAll('input');\n for(let input of inputs){\n input.addEventListener('keyup',function(e){\n switch(e.target.id){\n case 'stackID':\n if(!validateStackID(e.target.value)) showInvalid(input);\n else removeValidationError(e.target);\n break;\n case 'startCallNumber':\n case 'endCallNumber':\n if(!validateCallNumbers(e.target.value)) showInvalid(input)\n else removeValidationError(e.target);\n break;\n }\n });\n }\n}", "function postsValidatedEmail() {\r\n if ($(\"#email\").val().length === 0) {\r\n //sets the background\r\n sendState(on, \"email\");\r\n\r\n //adds the data to the array\r\n addDataAllErrors(allErrorMess[0]);\r\n } else if (!validateEmail($(\"#email\").val())) {\r\n //sets the background\r\n sendState(on, \"email\");\r\n\r\n //adds the data to the array\r\n addDataAllErrors(allErrorMess[1]);\r\n\r\n //resets the email field\r\n $(\"#email\").val(\"\");\r\n } else {\r\n //Value validated put an element like a \"tick\"\r\n //image next to the element\r\n\r\n //sends the state and the object source\r\n sendState(off, \"email\");\r\n //clears the element\r\n $(\"#lblEmailError\").html(\"\");\r\n console.log(`the email element entered is correct!`);\r\n }\r\n }", "_validate(initialValidation, programmaticValue, keyCode) {\n const that = this,\n oldValue = that.value;\n\n that._validateValue(programmaticValue);\n\n if (keyCode && (keyCode === 35 || keyCode === 36)) {\n that._animate(oldValue);\n }\n else {\n that._updatePointer();\n }\n }", "function next(){\n\tvalidate();\n}", "function next(){\n\tvalidate();\n}", "validateInit() {\n this.runValidation(true);\n }", "onValidationRequest() {\n\n\t\t\t// Simple validation - check if there are any inputs with errors\n\t\t\tvar errors = $(\".sapMInputBaseContentWrapperError\").length,\n\t\t\t\tresult = errors === 0;\n\n\t\t\t// Raise the response event back to the consumer\n\t\t\tsap.ui.getCore().getEventBus().publish(\"codan.zUrgentBoard\", \"validationResult\", {\n\t\t\t\tresult: result\n\t\t\t});\n\t\t}", "onRegisterFail(errorMessage) {\n console.log(\"error\", errorMessage);\n this.emailValidationState = 'has-error';\n this.helpBlock = errorMessage;\n this.registerMessage = 'Email or password is not correct. Please try again.';\n toastr.error(this.registerMessage);\n }" ]
[ "0.7448369", "0.65909237", "0.64219505", "0.63482034", "0.6233127", "0.61573946", "0.6096706", "0.608694", "0.6063479", "0.60424197", "0.6041023", "0.6040897", "0.6011899", "0.60063565", "0.59854066", "0.5983471", "0.5950519", "0.59489423", "0.5939185", "0.59309214", "0.5860897", "0.5813949", "0.5809781", "0.5808168", "0.5797378", "0.5795215", "0.57653284", "0.5742202", "0.57388604", "0.57370245", "0.57287544", "0.5720935", "0.5717808", "0.57046896", "0.5703093", "0.5703093", "0.5694932", "0.5691907", "0.5667094", "0.56449145", "0.5621944", "0.5614999", "0.5608526", "0.55985165", "0.5588255", "0.55829215", "0.55729365", "0.55727804", "0.55727804", "0.5566317", "0.5540893", "0.55342865", "0.55288017", "0.551352", "0.551011", "0.55059034", "0.5494536", "0.5488183", "0.5488183", "0.54824454", "0.5473389", "0.54718673", "0.54575413", "0.54475355", "0.54431087", "0.5436913", "0.54356223", "0.5426435", "0.54236495", "0.5422767", "0.5420261", "0.541971", "0.5414728", "0.5412037", "0.540626", "0.54050326", "0.54027474", "0.5396577", "0.53932995", "0.5386121", "0.5384232", "0.5384142", "0.537811", "0.5377426", "0.53752923", "0.5369933", "0.5362227", "0.53613526", "0.53576005", "0.5355667", "0.53521013", "0.5336466", "0.53339607", "0.53293777", "0.53275347", "0.53223", "0.53182137", "0.53182137", "0.5315957", "0.531368", "0.5309355" ]
0.0
-1
import shelves from '../images/emptyshelves.png';
function IngredientList({ availIngredients, saveNewIngredient, updateIngredientTimeLine, updateIngredientAmount, autoUseIngredient }) { const [newIngredientName, setNewIngredientName] = useState(''); const [newIngredientAmount, setNewIngredientAmount] = useState(null); const [newIngredientMeasure, setNewIngredientMeasure] = useState(''); const handleSubmit = (ingredient) => { saveNewIngredient(ingredient); }; const handleNameChange = (e) => { setNewIngredientName(e.target.value); e.preventDefault(); }; const handleAmountChange = (e) => { setNewIngredientAmount(e.target.value); e.preventDefault(); }; const handleMeasureChange = (e) => { setNewIngredientMeasure(e.target.value); e.preventDefault(); }; return ( <div> <AvailableTitle> <h2> Current Ingredient Stock </h2> <ClockParagraph> <p>Click on clock to set usage timeframe, or click on wrench to update ingredient count manually</p> </ClockParagraph> </AvailableTitle> <AvailableIngredientsWrapper> <ul> {availIngredients.map((ingredient, index) => ( <Ingredient ingredient={ingredient} key={index} updateIngredientTimeLine={updateIngredientTimeLine} updateIngredientAmount={updateIngredientAmount} autoUseIngredient={autoUseIngredient}/> ))} </ul> </AvailableIngredientsWrapper> <form> <AddIngredientTitle> <h4>Add ingredient</h4> </AddIngredientTitle> <NewIngredientWrapper> <div> <p>Name</p> <TextInput name='name' onChange={handleNameChange}></TextInput> </div> <div> <p>Amount</p> <TextInput name='amount' onChange={handleAmountChange}></TextInput> </div> <div> <p>Measurement (if not applicable, input 'null')</p> <TextInput name='measure' placeholder='lbs., gallons, boxes, oz., etc.' onChange={handleMeasureChange}></TextInput> </div> <SaveButton onClick={(e) => { handleSubmit({ newIngredientName, newIngredientAmount, newIngredientMeasure }); }}>Save</SaveButton> </NewIngredientWrapper> </form> </div > ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadSpriteSheet(){\n this.spriteSheet = loadImage('assets/sprites.png');\n }", "makeImagePath1(product) {\n return require(`../assets/images/${product.images[1]}`);\n }", "makeImagePath2(product) {\n return require(`../assets/images/${product.images[2]}`);\n }", "makeImagePath(product) {\n return require(`../assets/images/${product.images[0]}`);\n }", "renderBox(name, imgSrc){\n return(\n '<img src={require(' + imgSrc + ')} className=\"image\" alt=\"Img\" />'\n );\n }", "function OjoBot() {\n // Import result is the URL of your image\n return <img src={logo} alt=\"Logo\" />;\n}", "function preload()\n{\n game.load.image(\"spaceship\", \"../assets/proto_spaceship.png\");\n}", "function ItemImage(path) {\n this.path = '../lab/assets/' + path;\n this.clicked = 0;\n}", "getImageSource(){\n return `assets/images/cards/${this.rank}_of_${this.suit}.png`;\n }", "loadImages () {\n this.load.image('ground', ground)\n }", "function loadImages() {\n floor = new Image();\n background = new Image();\n ring = new Image();\n platform = new Image();\n\n floor.src = './tile-images/floorpath.png';\n background.src = './tile-images/plainbackgroundtile.png';\n ring.src = './tile-images/ring.png';\n platform.src = './tile-images/platform.png';\n}", "function LogoTitle() {\n return(\n <Image\n style={{ width: 47, resizeMode: 'contain'}}\n source={require(\"../Images/croissant-only.png\")}\n />\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <h1>LIGHTS <span>OUT</span><img src={lightsout}></img></h1>\n <Board />\n \n </div>\n );\n}", "function preload() {\n img = loadImage(\"../assets/Earth.png\");\n}", "render () {\n let {src, alt, ...props} = this.props;\n src = src?.src || src; // image passed through import will return an object\n return <img {...props} src={addBasePath(src)} alt={alt}/>\n }", "pickLogo () {\n\n\t\t/**\n\t\t * You have to call require in each call otherwise it breaks for some reason\n\t\t */\n\t\t\n\t\tlet url = require('../../images/logo_white.png');\n\n\t\tswitch(this.props.route.toString()){\n\t\t\tcase 'Default':\n\t\t\t\turl = require('../../images/logo_bart.png');\n\t\t\tbreak;\n\t\t\tcase 'Meeting':\n\t\t\t\turl = require('../../images/logo_patrick.png');\n\t\t\tbreak;\n\t\t\tcase 'Delivery':\n\t\t\t\turl = require('../../images/logo_stitch.png');\n\t\t\tbreak;\n\t\t\tcase null:\n\t\t\tcase 'Welcome':\n\t\t\tdefault:\n\t\t\t\turl = require('../../images/logo_white.png');\n\t\t\tbreak; \n\t\t}\n\n\t\treturn (\n\t\t\t<Image source={ url } style={ {\n\t\t\t\twidth: 150,\n\t\t\t\theight: 21,\n\t\t\t\tmarginTop: 1,\n\t\t\t\tmarginRight: 10\n\t\t\t} } />\n\t\t)\n\t}", "function loadAssets() {\n PIXI.loader\n .add([\n \"./assets/tileset10.png\",\n ])\n .load(gameCreate);\n}", "static importAllImages(r = require.context(\"./images\", false, /\\.(png|jpe?g|svg)$/)) {\n let images = {};\n r.keys().map((item) => { images[item.replace('./', '')] = r(item); });\n return images;\n }", "function preload()\n{\nhelicopterIMG=loadImage(\"helicopter.png\")\npackageIMG=loadImage(\"package.png\")\n}", "function loadPiecesPng(){\n wPawn = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_plt60.png\")\n wBishop = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_blt60.png\")\n wRook = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_rlt60.png\")\n wKnight = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_nlt60.png\")\n wQueen = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_qlt60.png\")\n wKing = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_klt60.png\") \n \n bPawn = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_pdt60.png\")\n bBishop = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_bdt60.png\")\n bRook = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_rdt60.png\")\n bKnight = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_ndt60.png\")\n bQueen = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_qdt60.png\")\n bKing = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_kdt60.png\")\n}", "constructor() {\n super(...arguments)\n this.bgURL = \"static/assets/images/bg.png\"\n this.groundURL = \"static/assets/images/ground.png\"\n this.avatarURL = \"static/assets/images/avatar.png\"\n this.squircleURL = \"static/assets/images/squircle.png\"\n this.squircleFillURL = \"static/assets/images/squircle_fill.png\"\n }", "showBackSide(card) {\n card.src = `./assets/images/back-side.jpg`;\n }", "static imageRootUrl() {\r\n return (`/dist/img/`);\r\n }", "icons () {\n return require('@packages/icons')\n }", "function Card(props){\n const thisCard = `/cards/${props.card}.png`\n return(\n <div className=\"col-sm-2 card\">\n <img src={thisCard} />\n </div>\n )\n}", "getImage(){\n if(this.color == 'white'){\n return './img/pawn_white.svg';\n }\n else{\n return '../img/pawn_black.svg';\n }\n }", "showFrontSide(card) {\n card.src = `./assets/images/${card.alt}.jpg`;\n }", "function load_img() {\n fabric.Image.fromURL('golf-h.png', function (img) {\n hole = img;\n hole.scaleToWidth(60);\n hole.scaleToHeight(60);\n hole.set({\n top: holey,\n left: holex\n });\n canvas.add(hole);\n });\n\n fabric.Image.fromURL('ball.png', function (img) {\n ball = img;\n ball.scaleToWidth(ballw);\n ball.scaleToHeight(ballh);\n ball.set({\n top: bally,\n left: ballx\n });\n canvas.add(ball);\n });\n}", "function images() {\n return src('assets/fonts/**.*')\n .pipe(dest('dist/fonts'));\n}", "function preload() {\n imgFish = loadImage('assets/images/fish.png');\n imgShark = loadImage('assets/images/shark.png');\n}", "function preload() {\n doveImg = loadImage('./assets/images/dove.png');\n clefImg = loadImage('./assets/images/clef.png');\n}", "function SpriteSheet(path,frameWidth, frameHeight){\n this.image = new Image();\n this.image.src = path;\n}", "get imagePath(){\n return My_Resource +'/img/' + this.logoName;\n }", "preload(){\n this.load.image('player', 'assets/player.png'); //load player.png as 'player'\n this.load.image('pipe', 'assets/pipe.png'); //load pipe.png as 'pipe'\n this.serverURL = 'http://localhost:8080';\n\n }", "function loadImages() {\r\n new Image('(\"Robot\") Bag','/images/bag.jpg', 0);\r\n new Image('Bathroom Phone Holder','/images/bathroom.jpg', 0);\r\n new Image('Breakfast Maker','/images/breakfast.jpg', 0);\r\n new Image('Meatball Bubblegum','/images/bubblegum.jpg', 0);\r\n new Image('Chair','/images/chair.jpg', 0);\r\n new Image('Cthulhu','/images/cthulhu.jpg', 0);\r\n new Image('Duck Mask','/images/dog-duck.jpg', 0);\r\n new Image('Dragon','/images/dragon.jpg', 0);\r\n new Image('U-Pensils','/images/pen.jpg', 0);\r\n new Image('Pet Sweep','/images/pet-sweep.jpg', 0);\r\n new Image('Pizza Scissors','/images/scissors.jpg', 0);\r\n new Image('Shark Blanket','/images/shark.jpg', 0);\r\n new Image('Baby Sweep','/images/sweep.png', 0);\r\n new Image('TaunTaun Sleepingbag','/images/tauntaun.jpg', 0);\r\n new Image('Unicorn Meat','/images/unicorn.jpg', 0);\r\n new Image('USB','/images/usb.gif', 0);\r\n new Image('Water Can','/images/water-can.jpg', 0);\r\n new Image('Wine Glass','/images/wine-glass.jpg', 0);\r\n new Image('boots', '/images/boots.jpg', 0);\r\n new Image('banana','/images/banana.jpg', 0);\r\n }", "function preload() {\n //img = loadImage(\"https://cdn0.iconfinder.com/data/icons/kitchen-colored-3/48/Household_Kitchen_Artboard_120-512.png\");\n img = loadImage(\"https://i.ibb.co/XLvW3GJ/salt3.png\");\n \n\n\n}", "constructor() {\n super({\n key: 'SplashScreen',\n\n // Splash screen and progress bar textures.\n pack: {\n files: [{\n key: 'splash-screen',\n type: 'image'\n }, {\n key: 'progress-bar',\n type: 'image'\n }]\n }\n });\n }", "function Header() {\n const [logoUrl] = useState('./logo-creasume.png');\n\n return(\n <Container>\n <img src={logoUrl} alt=\"Crea-Sume\"/>\n </Container>\n )\n}", "precargar(){\r\n this.gif = this.app.createImg('./Recursos/Balon.gif');\r\n this.gif.size(95, 95);\r\n }", "function loadSnowFlakeImage()\n{\n var texture = new THREE.TextureLoader().load('../assets/images/snowflake/snowflake2.png');\n\tvar alphaTexture = new THREE.TextureLoader().load('../assets/images/snowflake/snowflake_alpha.png');\n var geometry = flipY( new THREE.PlaneBufferGeometry() );\n\tvar material = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide, map: texture, transparent: true, alphaMap: alphaTexture } );\n\t\n\tvar mesh = new THREE.Mesh( geometry, material );\n\n\tmesh.position.x = Math.random() * 50 - 25;\n\tmesh.position.y = Math.random() * 50 - 25;\n\tmesh.position.z = Math.random() * 200-200;\n\n\tsnowflakes.push(mesh);\n\tscene.add( mesh );\n\n}", "function preload() {\n //spritesheets\n playerSS = loadImage('assets/collector.png');\n playerJSON = loadJSON('assets/collector.json');\n trashSS = loadImage('assets/bottle.png');\n trashJSON = loadJSON('assets/bottle.json');\n}", "getImage() {\n if (this.state.pokeImageUrl !== null) {\n return <img src={this.state.pokeImageUrl} className=\"poke-image\" />\n // return <img src={`https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png`} />\n }\n return <p>Loading Image...</p>\n }", "function Image() {\n return (\n <div className=\"Image\">\n <img src={'/isa.JPG'} className=\"profile-pic\" alt=\"logo\" />\n \n </div>\n );\n }", "function changeImageLeavesBack() {\n document.images['white-duck-leaves'].src ='./assets/images/white-duck-leaves.png'\n }", "function TabBarIcon({ source }) {\n return <Image source={source} style={{ height: 30, width: 30 }} />;\n}", "function load_images(){\n enemy_img = new Image();\n enemy_img.src = \"assets/virus.png\"\n\n fighter_girl = new Image()\n fighter_girl.src = \"assets/girl.png\"\n\n fighter_boy = new Image()\n fighter_boy.src = \"assets/man.png\"\n\n mask_img = new Image();\n mask_img.src = \"assets/mask.png\"\n\n heart_img = new Image();\n heart_img.src = \"assets/heart.png\"\n}", "function preload(){\n img = loadImage(\"/8bitGrass.png\");\n}", "constructor() { //initializes objects within class\n this.sprite = 'images/'; //targets image folder\n this.x = 2;\n this.y = 5;\n }", "function preload() {\n shipImage = loadImage(\"assets/images/face.png\");\n bulletImage = loadImage(\"assets/images/heart.png\");\n}", "get image() {\n if (this.sick) {\n return 'sick_wolf'\n } else {\n return 'wolf'\n }\n }", "preload()\r\n {\r\n this.load.image('ball', 'assets/images/ball.png');\r\n this.load.image('leftspike', 'assets/images/leftspike.png');\r\n this.load.image('wall', 'assets/images/wall.png');\r\n this.load.image('rightspike', 'assets/images/rightspike.png');\r\n }", "function preload() {\n //fatcat_sprite_sheet = loadSpriteSheet('images/fatcat.png', 123, 112, 8);\n //hitcat_sprite_sheet = loadSpriteSheet('images/hitcat.png', 124, 116, 10);\n \n fatcat = loadImage(\"images/fatcat.png\");\n hitcat = loadImage(\"images/hitcat.png\");\n yarn = loadImage(\"images/yarn.png\");\n \n}", "function preload(){\n\tcowimg = loadImage('assets/cow.png');\n}", "function loadImages (){\n var img = [\n 'src/Barba Garcia, Francisco.jpg',\n 'src/Barba Rodriguez, Arturo.jpg',\n 'src/Caro Bernal, Miguel Angel.jpg',\n 'src/Castillo Peña, José Luis.jpg',\n 'src/Cruz Vidal, Alejandro.jpg',\n 'src/Gallego Martel, Jose Maria.jpg',\n 'src/Garci Peña, José Joaquín.jpg',\n 'src/Vazquez Rodriguez, Maria del Mar.jpg',\n ];\n\n setImgs(shuffle(initImgs(img)));\n}", "function preload(){\n drain_img = loadImage(\"assets/drain.png\");\n bear_img = loadImage(\"assets/bear.png\");\n tiger_img = loadImage(\"assets/tiger.png\");\n mouse_img = loadImage(\"assets/mouse.png\");\n}", "main() {\n setup_pixi_stage(600, 400);\n const loader = PIXI.Loader.shared;\n loader.add(\"Resources/meteor2.png\");\n loader.add(\"Resources/dinosaur.png\");\n loader.load(this.load_done.bind(this));\n }", "function renderImages() {\n imgElem.src = Actor.all[0].path;\n}", "function resetHearts() {\n let source = \"images/liveHeart.png\";\n for (let life of lives) {\n life.src = source;\n }\n}", "function preload() {\n clownImage = loadImage(\"assets/images/clown.png\");\n feltTextureImage = loadImage(\"assets/images/black-felt-texture.png\");\n}", "function changeImageUmbrellaBack() {\n document.images['white-duck-umbrella'].src ='./assets/images/white-duck-umbrella.png'\n }", "function Icon(props){\n return <img src={props.name} width=\"auto\" height=\"20px\"/>; \n }", "function ImageHelper() { }", "function preload() {\n dragonPic = loadImage(\"assets/images/dragonPic.png\");\n lionPic = loadImage(\"assets/images/lion.png\");\n tigerPic = loadImage(\"assets/images/tiger.png\");\n preyPic = loadImage(\"assets/images/prey.png\");\n}", "constructor() {\n this.icon = 'images/favicon-32x32.png';\n }", "function preload() {\n\n//preload = called once at the very beginning it uploads resources e.g images and sounds\n // resources can be given a name here\n\n game.load.image(\"playerImg\", \"../assets/kitten.png\");\n // this loads the image into the program\n game.load.audio(\"score\", \"../assets/point.ogg\");\n\n game.load.image(\"pipe\", \"../assets/pipe.png\");\n\n game.load.image(\"pipeEnd\", \"../assets/pipe-end.png\");\n\n game.load.image(\"yarn\", \"../assets/yarn1.png\");\n //game.load.image(\"\" , \"../assets/png\");\n}", "function changeImageGlassesBack() {\n document.images['white-duck-glasses'].src ='./assets/images/white-duck-glasses.png'\n }", "function load_happy_fish() {\n\tgame.load.image(\"fish-top\",\"images/fish-top.png\");\n\tgame.load.image(\"fish-bottom\",\"images/fish-bottom.png\");\n\tgame.load.image(\"fish-eyes\",\"images/fish-eyes.png\");\n\tgame.load.image(\"arena\",\"images/arena.png\");\n game.load.image(\"star\",\"images/star.png\");\n game.load.image(\"bg\",\"images/bg.png\");\n\n game.load.audio(\"blop\",\"sounds/blop.wav\");\n game.load.audio(\"theme\",\"sounds/theme.mp3\");\n}", "renderLoader(){\n return(\n <div className=\"loader-container\">\n <img className=\"loader\" src=\"/res/loader.gif\" />\n </div>\n );\n }", "get ImageResolver() {return WebpackModules.getByProps(\"getUserAvatarURL\", \"getGuildIconURL\");}", "preload() {\n this.load.image('over', 'assets/game-over-bg.png');\n }", "function preload(){\n images[0] = loadImage('assets/house.png');\n images[1] = loadImage('assets/hallway.png');\n images[2] = loadImage('assets/livingroom.png');\n images[3] = loadImage('assets/diningroom.png');\n images[4] = loadImage('assets/kitchen.png');\n images[5] = loadImage('assets/bathroom.png');\n images[6] = loadImage('assets/bedroom.png');\n}", "function preload()\n{\n this.load.image('nebula', 'assets/nebula.jpg');\n this.load.image('bullet', 'assets/bullet.png');\n this.load.image('player', 'assets/thrust_ship.png');\n this.load.image('baddie', 'assets/baddie.png');\n this.load.image('baddie2', 'assets/space-baddie.png');\n this.load.image('bossbaddie', 'assets/baddie2.png');\n this.load.image('baddiebullet', 'assets/bbullet.png');\n}", "static preload(scene) {\n scene.load.image('fireball', 'assets/img/Items/fireball.png');\n }", "function images_import() {\n let inputs = ['./build/images/**/*.*', '!./build/images/**/_*.*'],\n output = './public/images/';\n\n return gulp.src(inputs).pipe(imagemin()).pipe(gulp.dest(output));\n}", "function ImageWeather() {\n return <img src={imageWeather} alt=\"Logo\" style={{width: '200px', height: '170px'}} />;\n}", "function preload() {\n println(\"loading images\")\n img = [loadImage(\"./assets/AmericaFirst.png\"), loadImage(\"./assets/AuditTheVote.png\"), loadImage(\"./assets/Hillary.png\"), loadImage(\"./assets/MAGA.png\"), loadImage(\"./assets/TrumpTrain.png\")];\n\n}", "function changeImageMonocleBack() {\n document.images['white-duck-monocle'].src ='./assets/images/white-duck-monocle.png'\n }", "function preload() {\n bg = loadImage(\"assets/space.png\");\n ship = loadImage(\"assets/ship.png\");\n ship.r = 30;\n}", "function loadSprites() {\n Loader.add(\"assets/imgs/resize1.png\")\n .add(\"assets/imgs/resize2.png\")\n .add(\"assets/imgs/colorize.png\")\n .add(\"assets/imgs/rotate.png\")\n .add(\"assets/imgs/select.png\")\n .add(\"assets/imgs/win.png\")\n .add(\"assets/imgs/logo.png\")\n .add(\"assets/imgs/logo2.png\")\n .add(\"assets/imgs/introFinal.png\")\n .add(\"assets/imgs/btPlay.png\")\n .add(\"assets/imgs/btAgain.png\")\n .load(setup);\n}", "function loadImages() {\n testPattern = new Image();\n testPattern.src = \"testpattern.gif\";\n }", "preload() {\n this.load.image('wideBarrier', 'SpriteFolder\\\\wideBarrier.png');\n this.load.image('wideBarrierNew', 'SpriteFolder\\\\wideBarrierNew.png');\n this.load.image('wideBarrierNewRed', 'SpriteFolder\\\\wideBarrierNewRed.png');\n this.load.image('bullet', 'SpriteFolder\\\\newBullet.png');\n this.load.image('ship', 'SpriteFolder\\\\ship.png');\n this.load.image('shipOutline', 'SpriteFolder\\\\shipOutline.png');\n this.load.image('squareBlock', 'SpriteFolder\\\\squareBlock.png');\n }", "async function picItem(item){\r\n importName = path.basename(item[0]).toLowerCase().split(\".jpg\")[0].replace(/\\s/g, '');\r\n await exec(\"copy \" + item[0] + \" \\\"./kigaruweb/src/pictures/food/\" + importName + '.jpg\\\"')\r\n await exec(\"py picture.py \" + item[1] + \" \" + importName + \" \" + item[2]);\r\n}", "render(){\n return <Image source={SpaceX} style={{width: 140, height: 35}}/>\n }", "preload(){ \n for(let i = 0; i<10; i++){\n this.load.image(`card${i+1}`, `../static/Clovers_${i+1}_white.png`);\n }\n this.load.image(`back-card`, '../static/Clovers_King_black.png');\n }", "function preload() {\n\tcheese = loadImage(\"cheese.png\");\n\tmouse = loadImage(\"mouse.png\");\n\tmousetrap = loadImage(\"mousetrap.png\");\n\tpoison = loadImage(\"poison.png\");\n}", "function GameObject()\n{\n var health = 100;\n var element = \"./IMG/EMTPY\";\n}", "function changeImageAppleBack() {\n document.images['white-duck-apple'].src ='./assets/images/white-duck-apple.png'\n }", "function preload() {\n turboImage = loadImage(\"TurboImage.png\");\n enzoImage = loadImage(\"EnzoImage.png\");\n gallardoImage = loadImage(\"GallardoImage.png\");\n viperImage = loadImage(\"ViperImage.png\");\n}", "function imageUrl(path) {\n try {\n return require('text!gcli/ui/' + path);\n }\n catch (ex) {\n var filename = module.id.split('/').pop() + '.js';\n var imagePath;\n\n if (module.uri.substr(-filename.length) !== filename) {\n console.error('Can\\'t work out path from module.uri/module.id');\n return path;\n }\n\n if (module.uri) {\n var end = module.uri.length - filename.length - 1;\n return module.uri.substr(0, end) + '/' + path;\n }\n\n return filename + '/' + path;\n }\n}", "function displayComputerMove (){\n let randomImage = document.getElementById(\"computer-choice\");\n randomImage.src=`images/${computerMove}.png`;\n}", "loadGame() {\n this.player = new Player(100, 100);\n this.treasure = new Treasure()\n this.playerImg = loadImage(\"assets/character-down.png\");\n this.treasureImg = loadImage(\"assets/treasure.png\");\n this.score = 0\n this.bg = loadImage(\"assets/background.png\");\n }", "function loadImage() {\n var baseUrl = 'https://source.unsplash.com/category',\n cat = 'nature',\n size = '1920x1080';\n\n buildElement(`${baseUrl}/${cat}/${size}`).then(render);\n }", "function preload() {\n images[0] = loadImage('assets/allday.png');\n images[1] = loadImage('assets/sleep.png');\n images[2] = loadImage('assets/eat.png');\n images[3] = loadImage('assets/goout.png');\n images[4] = loadImage('assets/splash.png');\n \n}", "preload() {\n this.load.image('menu', 'assets/menu_v3.png');\n }", "function preload() {\n miFondo = loadImage('assets/fondo.jpg')\n miElefante = loadImage('assets/elef.png');\n miHipo = loadImage('assets/hipo.png');\n miJirafa = loadImage('assets/jirafa.png');\n miLeon = loadImage('assets/leon.png');\n miLeopardo = loadImage('assets/leop.png');\n miAvestruz = loadImage('assets/truz.png');\n miZebra = loadImage('assets/zebra.png');\n miOfondo = loadImage('assets/hola.jpg')\n}", "function AdminHeader() {\n return (\n <div>\n <header className=\"admin-header\">\n <div className=\"admin-logo\">\n <img \n className=\"admin_bark_logo\"\n src=\"./images/Barktique-and-meow-logo-final-color.png\" \n />\n </div>\n </header>\n </div>\n )\n} // end AdminHeader", "function preload() {\n clownImage = loadImage(\"assets/images/clown.png\");\n alienFace = loadImage(\"assets/images/alien.png\");\n skullFace = loadImage(\"assets/images/skull.png\");\n feltTextureImage = loadImage(\"assets/images/black-felt-texture.png\");\n}", "function preload() {\n game.load.image(\"playerImg\", \"../assets/flappy.png\");\n game.load.audio(\"score\", \"../assets/point.ogg\");\n game.load.image(\"pipeBlock\",\"../assets/pipe2-body.png\");\n game.load.image(\"pipeEnd\",\"../assets/pipe-end.png\");\n game.load.image(\"balloons\",\"..assets/balloons.png\");\n game.load.image(\"weight\",\"assets/weight.png\");\n}", "function loadStories() {\n require('../app/components/avatars/avatars.stories');\n require('../app/components/loading.stories');\n}", "function preload() {\n game.load.image(\"logo\", \"assets/phaser.png\");\n }", "function addShipImage(playerObj){\r\n if(colorblind){\r\n playerObj.img.src = \"all assets/colorblind/ship/spaceship.png\";\r\n }\r\n else{\r\n playerObj.img.src = \"all assets/normal/ship/spaceship.png\";\r\n }\r\n}" ]
[ "0.658954", "0.6346681", "0.63415027", "0.63189274", "0.6241132", "0.6230925", "0.6167694", "0.61458915", "0.6124944", "0.6080497", "0.59766334", "0.59392256", "0.5919421", "0.5881535", "0.5837802", "0.58300024", "0.581817", "0.57956165", "0.57904404", "0.57499623", "0.5739723", "0.5738465", "0.5734106", "0.5730985", "0.5721249", "0.5701146", "0.56953955", "0.5623279", "0.56117547", "0.56055117", "0.5590342", "0.5584978", "0.55800253", "0.55706954", "0.55670416", "0.5557502", "0.55475384", "0.5539165", "0.5536843", "0.55311793", "0.5523176", "0.55136865", "0.55060685", "0.550451", "0.54939395", "0.5493879", "0.5486985", "0.5484345", "0.54829013", "0.5482596", "0.5482414", "0.547984", "0.54761416", "0.547406", "0.5464667", "0.54643786", "0.54615915", "0.54605657", "0.54590374", "0.54568577", "0.54552716", "0.5454366", "0.54504836", "0.54497164", "0.5440478", "0.5438552", "0.5432249", "0.5426222", "0.5423134", "0.5422745", "0.54224586", "0.54192823", "0.5419138", "0.54144794", "0.5412329", "0.5410033", "0.540836", "0.5407448", "0.5406301", "0.5405251", "0.54041487", "0.5399273", "0.5394562", "0.53893465", "0.5388468", "0.5387761", "0.5383871", "0.5382419", "0.53818446", "0.53781915", "0.5375836", "0.5374167", "0.5370643", "0.5369927", "0.53689635", "0.53608125", "0.53589845", "0.5356096", "0.5350522", "0.535039", "0.5348567" ]
0.0
-1
From Relicensed from the "Do What the Fck You Want To Public License".
function getWeatherChanceValue(timeMs) { let unix = Math.floor(timeMs / 1000); // Get Eorzea hour for weather start let bell = unix / 175; // Do the magic 'cause for calculations 16:00 is 0, 00:00 is 8 and 08:00 is 16 let increment = (bell + 8 - (bell % 8)) % 24; // Take Eorzea days since unix epoch let totalDays = (unix / 4200) >>> 0; // The following math all needs to be done as unsigned integers. let calcBase = ((totalDays * 0x64) + increment) >>> 0; let step1 = ((calcBase << 0xB) ^ calcBase) >>> 0; let step2 = ((step1 >>> 8) ^ step1) >>> 0; return step2 % 0x64; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function licNotice(answer) {\n if (answer === 'Apache 2.0') {\n return `\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file \n except in compliance with the License. You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software distributed under the \n License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, \n either express or implied. See the License for the specific language governing permissions \n and limitations under the License.\n `\n } else if (answer === 'GPLv3') {\n return `\n This program is free software: you can redistribute it and/or modify it under the terms of the \n GNU General Public License as published by the Free Software Foundation, either version 3 of \n the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; \n without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \n See the GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License along with this program. \n If not, see <https://www.gnu.org/licenses/>.\n `\n } else if (answer === 'MIT') {\n return `\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software \n and associated documentation files (the \"Software\"), to deal in the Software without \n restriction, including without limitation the rights to use, copy, modify, merge, publish, \n distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the \n Software is furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all copies or \n substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \n BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \n DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n `\n } else if (answer === 'Unlicense') {\n return `\n This is free and unencumbered software released into the public domain.\n\n Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, \n either in source code form or as a compiled binary, for any purpose, commercial or \n non-commercial, and by any means.\n\n In jurisdictions that recognize copyright laws, the author or authors of this software \n dedicate any and all copyright interest in the software to the public domain. We make this \n dedication for the benefit of the public at large and to the detriment of our heirs and \n successors. We intend this dedication to be an overt act of relinquishment in perpetuity of \n all present and future rights to this software under copyright law.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \n BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN \n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n For more information, please refer to https://unlicense.org\n `\n }\n}", "function createLicense() {}", "function getLicenseInfo() {\n\n\tvar l = \"\";\n\t\n\tl += \"Copyright 2014 DesignaQuark: Josiah Neuberger\\n\\n\";\n\t\n\tl += \"Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n\";\n\tl += \"you may not use this file except in compliance with the License.\\n\";\n\tl += \"You may obtain a copy of the License at\\n\\n\";\n\n\tl += \"\thttp://www.apache.org/licenses/LICENSE-2.0\\n\\n\";\n\n\tl += \"Unless required by applicable law or agreed to in writing, software\\n\";\n\tl += \"distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n\";\n\tl += \"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n\";\n\tl += \"See the License for the specific language governing permissions and\\n\";\n\tl += \"limitations under the License.\\n\";\n\tl += \"return license;\\n\";\n\t\n\treturn l;\n}", "function QLicenseUI() {\n\tvar options = {\n\t\t'': '',\n\t\t'\\n== Licensing ==\\n{{Copyright by CAG}}': 'Copyrighted by Con Artist Games',\n\t\t'\\n== Licensing ==\\n{{Fairuse}}': 'Fair Use',\n\t\t'\\n== Licensing ==\\n{{Permission}}': 'Copyrighted — used with permission',\n\t\t'\\n== Licensing ==\\n{{Copyright by Wikia}}': 'Copyrighted by Wikia',\n\t\t'\\n== Licensing ==\\n{{CC-BY-SA}}': 'CC-BY-SA',\n\t\t'\\n== Licensing ==\\n{{CC-BY-SA-3.0}}': 'CC-BY-SA 3.0',\n\t\t'\\n== Licensing ==\\n{{CC-BY-SA-4.0}}': 'CC-BY-SA 4.0',\n \t'\\n== Licensing ==\\n{{GFDL}}': 'GFDL',\n \t'\\n== Licensing ==\\n{{Other free}}': 'Other free',\n \t'\\n== Licensing ==\\n{{PD}}': 'Public Domain',\n \t'\\n== Licensing ==\\n{{From Wikimedia}}': 'From Wikimedia',\n \t'\\n== Licensing ==\\n{{No license}}': 'I do not know the license',\n\t\t};\n\tvar optstr = '';\n\tfor ( i in options ) {\n\t\tif ( options.hasOwnProperty( i ) ) {\n\t\t\toptstr += '<option value=\"' + i + '\" style=\"text-align:center;\">' + options[i] + '</option>';\n\t\t}\n\t}\n \n\tvar html = '<p style=\"text-align:center;\"><select id=\"QLicenseSelect\">' + optstr + '</select>&nbsp;<a class=\"wikia-button\" style=\"margin:0 1em; cursor:pointer;\" id=\"aSubmit\">Add license</a>';\n\tif($('#LicensedFile').length || $('#Licensing').length) {\n\t\thtml += '&nbsp;<span style=\"color:red; font-weight:bold; text-align:center;\">This file is already licensed</span> (<a href=\"http://tlaststand.wikia.com/wiki/Help:License adder\">help</a>)</p>';\n\t} else {\n\t\thtml += '&nbsp;<span style=\"color:green; font-weight:bold; text-align:center;\">This file does not have a license template! Consider adding one.</span> (<a href=\"http://tlaststand.wikia.com/wiki/Help:License adder\">help</a>)</p>';\n\t}\n\t$('#filetoc').append(html);\n\t$('#aSubmit').click( function(event) {\n\t\tthis.innerHTML = '<img src=\"https://images.wikia.nocookie.net/dev/images/8/82/Facebook_throbber.gif\" style=\"vertical-align: baseline;\" border=\"0\" />';\n\t\t$.post(\"/api.php\", {action: \"edit\", title: mw.config.get(\"wgPageName\"), token: mw.user.tokens.values.editToken, bot: true, appendtext: $(\"#QLicenseSelect\").val(), summary: \"Adding file license. ([[Help:License adder|Assisted]])\"}, function (result) {\n\t\t\twindow.location = wgServer + '/index.php?title=' + mw.config.get(\"wgPageName\") + '&action=purge';\n\t\t});\n\t});\n}", "function renderLicenseSection(license) {\n if (license){\n switch (license){\n case 'Unlicense':\n return `This is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.\n\nIn jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n \nFor more information, please refer to <http://unlicense.org/>`;\n\n case 'MIT':\n return `Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation file (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n<br />${renderLicenseLink(license)}`;\n\n case 'Apache 2.0':\n return `Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.`\n default : \n return ''\n }\n return renderLicenseBadge(license)\n }\n return ''\n}", "function LicenseLink(license) {\n\n let licenseWeb = ' ';\n\n switch (license) {\n case 'GNU AGPLv3':\n licenseWeb = 'https://spdx.org/licenses/AGPL-3.0-or-later.html';\n break;\n case 'GNU GPLv3':\n licenseWeb = 'https://spdx.org/licenses/GPL-3.0-or-later.html';\n break;\n case 'GNU LGPLv3':\n licenseWeb = 'https://spdx.org/licenses/LGPL-3.0-or-later.html';\n break;\n case 'Mozilla Public License 2.0':\n licenseWeb = 'https://spdx.org/licenses/MPL-2.0.html';\n break;\n case 'Apache License 2.0':\n licenseWeb = 'https://www.apache.org/licenses/LICENSE-2.0.html';\n break;\n case 'MIT License':\n licenseWeb = 'https://spdx.org/licenses/MIT.html';\n break;\n case 'Boost Software License 1.0':\n licenseWeb = 'https://spdx.org/licenses/BSL-1.0.html';\n break;\n case 'The Unlicense':\n licenseWeb = 'https://unlicense.org';\n break;\n default:\n break;\n }\n return licenseWeb;\n}", "function renderLicenseSection(license) {\n switch (license) {\n case \"None\":\n licensetext = \"\"\n break;\n case \"Apache License 2.0\":\n licensetext = \"Apache License Version 2.0 January 2004 http://www.apache.org/licenses/\"\n break;\n case \"GNU General Public License v3.0\":\n licensetext = \"The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.\"\n break;\n case \"MIT\":\n licensetext = \"The MIT License is a permissive free software license originating at the Massachusetts Institute of Technology in the late 1980s. As a permissive license, it puts only very limited restriction on reuse and has, therefore, high license compatibility.\"\n break;\n case \"BSD 2-Clause Simplified License\":\n licensetext = \"BSD licenses are a family of permissive free software licenses, imposing minimal restrictions on the use and distribution of covered software. This is in contrast to copyleft licenses, which have share-alike requirements.\"\n break;\n case \"BSD 3-Clause New or Revised\":\n licensetext = \"A permissive license similar to the BSD 2-Clause License, but with a 3rd clause that prohibits others from using the name of the copyright holder or its contributors to promote derived products without written consent.\"\n break;\n case \"Boost Software License 1.0\":\n licensetext = \"Copyright Joe Coder 2004 - 2006 Distributed under the Boost Software License, Version 1.0.\"\n break;\n case \"Creative Commons Zero v1.0 Universal\":\n licensetext = \" CC0 is a universal instrument that is not adapted to the laws of any particular legal jurisdiction, similar to many open source software licenses. And while no tool, not even CC0, can guarantee a complete relinquishment of all copyright and database rights in every jurisdiction, we believe it provides the best and most complete alternative for contributing a work to the public domain given the many complex and diverse copyright and database systems around the world.\"\n break;\n case \"Eclipse Public License 2.0\":\n licensetext = \"The Eclipse Public License is a free and open source software license most notably used for the Eclipse IDE and other projects by the Eclipse Foundation. It replaces the Common Public License and removes certain terms relating to litigations related to patents.\"\n break;\n case \"GNU Affero General Public License v3.0\":\n licensetext = \"The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.\"\n break;\n case \"GNU General Public License v2.0\":\n licensetext = \"The GNU General Public License v2 (GPL v2 for short) is the most commonly used open source licence. Approximately 70% of the projects in the software repository Sourceforge use the GPL v2. This document attempts to draw together the main features of the GNU General Public License v2 into a friendly and comprehensible digest and, in addition, to note some details about its history and usage. The licence itself can be read at http://www.opensource.org/licenses/gpl-license.php.\"\n break;\n case \"GNU Lesser General Public License v2.1\":\n licensetext = \"1 (LGPL v2. 1 for short) is a variation of the regular GNU General Public License (GPL). Originally known as the GNU Library General Public License, it was drafted by the Free Software Foundation (FSF) to provide a weaker (or Lesser) form of copyleft for use in certain specific circumstances.\"\n break;\n case \"Mozilla Public License 2.0\":\n licensetext = \"The MPL is a simple copyleft license. The MPL's file-level copyleft is designed to encourage contributors to share modifications they make to your code, while still allowing them to combine your code with code under other licenses (open or proprietary) with minimal restrictions.\"\n break;\n case \"The Unlicense\":\n licensetext = \"The Unlicense is a public domain equivalent license with a focus on an anti-copyright message. ... The Unlicense offers a public domain waiver text with a fall-back public-domain-like license, inspired by permissive licenses but without an attribution clause.\"\n break;\n }\n return licensetext\n}", "function writeToFile(fileName, data) {\n if(data.lisence=='MIT'){\n data.lis = `MIT License\n\n Copyright (c) [year] [fullname]\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.`\n } else if (data.lisence == 'GNU-AGPLv3'){\n data.lis = `GNU AFFERO GENERAL PUBLIC LICENSE\n Version 3, 19 November 2007\n\nCopyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\nEveryone is permitted to copy and distribute verbatim copies\nof this license document, but changing it is not allowed.\n\n Preamble\n\nThe GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\nThe licenses for most software and other practical works are designed\nto take away your freedom to share and change the works. By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\nWhen we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\nDevelopers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\nA secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate. Many developers of free software are heartened and\nencouraged by the resulting cooperation. However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\nThe GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community. It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server. Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\nAn older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals. This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.`\n } else if (data.lisence == 'Mozilla-Public-License-2'){\n data.lis = `Mozilla Public License Version 2.0\n ==================================\n \n 1. Definitions\n --------------\n \n 1.1. \"Contributor\"\n means each individual or legal entity that creates, contributes to\n the creation of, or owns Covered Software.\n \n 1.2. \"Contributor Version\"\n means the combination of the Contributions of others (if any) used\n by a Contributor and that particular Contributor's Contribution.\n \n 1.3. \"Contribution\"\n means Covered Software of a particular Contributor.\n \n 1.4. \"Covered Software\"\n means Source Code Form to which the initial Contributor has attached\n the notice in Exhibit A, the Executable Form of such Source Code\n Form, and Modifications of such Source Code Form, in each case\n including portions thereof.\n \n 1.5. \"Incompatible With Secondary Licenses\"\n means\n \n (a) that the initial Contributor has attached the notice described\n in Exhibit B to the Covered Software; or\n \n (b) that the Covered Software was made available under the terms of\n version 1.1 or earlier of the License, but not also under the\n terms of a Secondary License.\n \n 1.6. \"Executable Form\"\n means any form of the work other than Source Code Form.\n \n 1.7. \"Larger Work\"\n means a work that combines Covered Software with other material, in\n a separate file or files, that is not Covered Software.\n \n 1.8. \"License\"\n means this document.\n \n 1.9. \"Licensable\"\n means having the right to grant, to the maximum extent possible,\n whether at the time of the initial grant or subsequently, any and\n all of the rights conveyed by this License.\n \n 1.10. \"Modifications\"\n means any of the following:\n \n (a) any file in Source Code Form that results from an addition to,\n deletion from, or modification of the contents of Covered\n Software; or\n \n (b) any new file in Source Code Form that contains any Covered\n Software.\n \n 1.11. \"Patent Claims\" of a Contributor\n means any patent claim(s), including without limitation, method,\n process, and apparatus claims, in any patent Licensable by such\n Contributor that would be infringed, but for the grant of the\n License, by the making, using, selling, offering for sale, having\n made, import, or transfer of either its Contributions or its\n Contributor Version.\n \n 1.12. \"Secondary License\"\n means either the GNU General Public License, Version 2.0, the GNU\n Lesser General Public License, Version 2.1, the GNU Affero General\n Public License, Version 3.0, or any later versions of those\n licenses.\n \n 1.13. \"Source Code Form\"\n means the form of the work preferred for making modifications.\n \n 1.14. \"You\" (or \"Your\")\n means an individual or a legal entity exercising rights under this\n License. For legal entities, \"You\" includes any entity that\n controls, is controlled by, or is under common control with You. For\n purposes of this definition, \"control\" means (a) the power, direct\n or indirect, to cause the direction or management of such entity,\n whether by contract or otherwise, or (b) ownership of more than\n fifty percent (50%) of the outstanding shares or beneficial\n ownership of such entity.\n \n 2. License Grants and Conditions\n --------------------------------\n \n 2.1. Grants\n \n Each Contributor hereby grants You a world-wide, royalty-free,\n non-exclusive license:\n \n (a) under intellectual property rights (other than patent or trademark)\n Licensable by such Contributor to use, reproduce, make available,\n modify, display, perform, distribute, and otherwise exploit its\n Contributions, either on an unmodified basis, with Modifications, or\n as part of a Larger Work; and\n \n (b) under Patent Claims of such Contributor to make, use, sell, offer\n for sale, have made, import, and otherwise transfer either its\n Contributions or its Contributor Version.\n \n 2.2. Effective Date\n \n The licenses granted in Section 2.1 with respect to any Contribution\n become effective for each Contribution on the date the Contributor first\n distributes such Contribution.\n \n 2.3. Limitations on Grant Scope\n \n The licenses granted in this Section 2 are the only rights granted under\n this License. No additional rights or licenses will be implied from the\n distribution or licensing of Covered Software under this License.\n Notwithstanding Section 2.1(b) above, no patent license is granted by a\n Contributor:\n \n (a) for any code that a Contributor has removed from Covered Software;\n or\n \n (b) for infringements caused by: (i) Your and any other third party's\n modifications of Covered Software, or (ii) the combination of its\n Contributions with other software (except as part of its Contributor\n Version); or\n \n (c) under Patent Claims infringed by Covered Software in the absence of\n its Contributions.\n \n This License does not grant any rights in the trademarks, service marks,\n or logos of any Contributor (except as may be necessary to comply with\n the notice requirements in Section 3.4).\n \n 2.4. Subsequent Licenses\n \n No Contributor makes additional grants as a result of Your choice to\n distribute the Covered Software under a subsequent version of this\n License (see Section 10.2) or under the terms of a Secondary License (if\n permitted under the terms of Section 3.3).\n \n 2.5. Representation\n \n Each Contributor represents that the Contributor believes its\n Contributions are its original creation(s) or it has sufficient rights\n to grant the rights to its Contributions conveyed by this License.\n \n 2.6. Fair Use\n \n This License is not intended to limit any rights You have under\n applicable copyright doctrines of fair use, fair dealing, or other\n equivalents.\n \n 2.7. Conditions\n \n Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted\n in Section 2.1.\n \n 3. Responsibilities\n -------------------\n \n 3.1. Distribution of Source Form\n \n All distribution of Covered Software in Source Code Form, including any\n Modifications that You create or to which You contribute, must be under\n the terms of this License. You must inform recipients that the Source\n Code Form of the Covered Software is governed by the terms of this\n License, and how they can obtain a copy of this License. You may not\n attempt to alter or restrict the recipients' rights in the Source Code\n Form.\n \n 3.2. Distribution of Executable Form\n \n If You distribute Covered Software in Executable Form then:\n \n (a) such Covered Software must also be made available in Source Code\n Form, as described in Section 3.1, and You must inform recipients of\n the Executable Form how they can obtain a copy of such Source Code\n Form by reasonable means in a timely manner, at a charge no more\n than the cost of distribution to the recipient; and\n \n (b) You may distribute such Executable Form under the terms of this\n License, or sublicense it under different terms, provided that the\n license for the Executable Form does not attempt to limit or alter\n the recipients' rights in the Source Code Form under this License.\n \n 3.3. Distribution of a Larger Work\n \n You may create and distribute a Larger Work under terms of Your choice,\n provided that You also comply with the requirements of this License for\n the Covered Software. If the Larger Work is a combination of Covered\n Software with a work governed by one or more Secondary Licenses, and the\n Covered Software is not Incompatible With Secondary Licenses, this\n License permits You to additionally distribute such Covered Software\n under the terms of such Secondary License(s), so that the recipient of\n the Larger Work may, at their option, further distribute the Covered\n Software under the terms of either this License or such Secondary\n License(s).\n \n 3.4. Notices\n \n You may not remove or alter the substance of any license notices\n (including copyright notices, patent notices, disclaimers of warranty,\n or limitations of liability) contained within the Source Code Form of\n the Covered Software, except that You may alter any license notices to\n the extent required to remedy known factual inaccuracies.\n \n 3.5. Application of Additional Terms\n \n You may choose to offer, and to charge a fee for, warranty, support,\n indemnity or liability obligations to one or more recipients of Covered\n Software. However, You may do so only on Your own behalf, and not on\n behalf of any Contributor. You must make it absolutely clear that any\n such warranty, support, indemnity, or liability obligation is offered by\n You alone, and You hereby agree to indemnify every Contributor for any\n liability incurred by such Contributor as a result of warranty, support,\n indemnity or liability terms You offer. You may include additional\n disclaimers of warranty and limitations of liability specific to any\n jurisdiction.\n \n 4. Inability to Comply Due to Statute or Regulation\n ---------------------------------------------------\n \n If it is impossible for You to comply with any of the terms of this\n License with respect to some or all of the Covered Software due to\n statute, judicial order, or regulation then You must: (a) comply with\n the terms of this License to the maximum extent possible; and (b)\n describe the limitations and the code they affect. Such description must\n be placed in a text file included with all distributions of the Covered\n Software under this License. Except to the extent prohibited by statute\n or regulation, such description must be sufficiently detailed for a\n recipient of ordinary skill to be able to understand it.\n \n 5. Termination\n --------------\n \n 5.1. The rights granted under this License will terminate automatically\n if You fail to comply with any of its terms. However, if You become\n compliant, then the rights granted under this License from a particular\n Contributor are reinstated (a) provisionally, unless and until such\n Contributor explicitly and finally terminates Your grants, and (b) on an\n ongoing basis, if such Contributor fails to notify You of the\n non-compliance by some reasonable means prior to 60 days after You have\n come back into compliance. Moreover, Your grants from a particular\n Contributor are reinstated on an ongoing basis if such Contributor\n notifies You of the non-compliance by some reasonable means, this is the\n first time You have received notice of non-compliance with this License\n from such Contributor, and You become compliant prior to 30 days after\n Your receipt of the notice.\n \n 5.2. If You initiate litigation against any entity by asserting a patent\n infringement claim (excluding declaratory judgment actions,\n counter-claims, and cross-claims) alleging that a Contributor Version\n directly or indirectly infringes any patent, then the rights granted to\n You by any and all Contributors for the Covered Software under Section\n 2.1 of this License shall terminate.\n \n 5.3. In the event of termination under Sections 5.1 or 5.2 above, all\n end user license agreements (excluding distributors and resellers) which\n have been validly granted by You or Your distributors under this License\n prior to termination shall survive termination.\n \n ************************************************************************\n * *\n * 6. Disclaimer of Warranty *\n * ------------------------- *\n * *\n * Covered Software is provided under this License on an \"as is\" *\n * basis, without warranty of any kind, either expressed, implied, or *\n * statutory, including, without limitation, warranties that the *\n * Covered Software is free of defects, merchantable, fit for a *\n * particular purpose or non-infringing. The entire risk as to the *\n * quality and performance of the Covered Software is with You. *\n * Should any Covered Software prove defective in any respect, You *\n * (not any Contributor) assume the cost of any necessary servicing, *\n * repair, or correction. This disclaimer of warranty constitutes an *\n * essential part of this License. No use of any Covered Software is *\n * authorized under this License except under this disclaimer. *\n * *\n ************************************************************************\n \n ************************************************************************\n * *\n * 7. Limitation of Liability *\n * -------------------------- *\n * *\n * Under no circumstances and under no legal theory, whether tort *\n * (including negligence), contract, or otherwise, shall any *\n * Contributor, or anyone who distributes Covered Software as *\n * permitted above, be liable to You for any direct, indirect, *\n * special, incidental, or consequential damages of any character *\n * including, without limitation, damages for lost profits, loss of *\n * goodwill, work stoppage, computer failure or malfunction, or any *\n * and all other commercial damages or losses, even if such party *\n * shall have been informed of the possibility of such damages. This *\n * limitation of liability shall not apply to liability for death or *\n * personal injury resulting from such party's negligence to the *\n * extent applicable law prohibits such limitation. Some *\n * jurisdictions do not allow the exclusion or limitation of *\n * incidental or consequential damages, so this exclusion and *\n * limitation may not apply to You. *\n * *\n ************************************************************************\n \n 8. Litigation\n -------------\n \n Any litigation relating to this License may be brought only in the\n courts of a jurisdiction where the defendant maintains its principal\n place of business and such litigation shall be governed by laws of that\n jurisdiction, without reference to its conflict-of-law provisions.\n Nothing in this Section shall prevent a party's ability to bring\n cross-claims or counter-claims.\n \n 9. Miscellaneous\n ----------------\n \n This License represents the complete agreement concerning the subject\n matter hereof. If any provision of this License is held to be\n unenforceable, such provision shall be reformed only to the extent\n necessary to make it enforceable. Any law or regulation which provides\n that the language of a contract shall be construed against the drafter\n shall not be used to construe this License against a Contributor.\n \n 10. Versions of the License\n ---------------------------\n \n 10.1. New Versions\n \n Mozilla Foundation is the license steward. Except as provided in Section\n 10.3, no one other than the license steward has the right to modify or\n publish new versions of this License. Each version will be given a\n distinguishing version number.\n \n 10.2. Effect of New Versions\n \n You may distribute the Covered Software under the terms of the version\n of the License under which You originally received the Covered Software,\n or under the terms of any subsequent version published by the license\n steward.\n \n 10.3. Modified Versions\n \n If you create software not governed by this License, and you want to\n create a new license for such software, you may create and use a\n modified version of this License if you rename the license and remove\n any references to the name of the license steward (except to note that\n such modified license differs from this License).\n \n 10.4. Distributing Source Code Form that is Incompatible With Secondary\n Licenses\n \n If You choose to distribute Source Code Form that is Incompatible With\n Secondary Licenses under the terms of this version of the License, the\n notice described in Exhibit B of this License must be attached.\n \n Exhibit A - Source Code Form License Notice\n -------------------------------------------\n \n This Source Code Form is subject to the terms of the Mozilla Public\n License, v. 2.0. If a copy of the MPL was not distributed with this\n file, You can obtain one at http://mozilla.org/MPL/2.0/.\n \n If it is not possible or desirable to put the notice in a particular\n file, then You may include the notice in a location (such as a LICENSE\n file in a relevant directory) where a recipient would be likely to look\n for such a notice.\n \n You may add additional accurate notices of copyright ownership.\n \n Exhibit B - \"Incompatible With Secondary Licenses\" Notice\n ---------------------------------------------------------\n \n This Source Code Form is \"Incompatible With Secondary Licenses\", as\n defined by the Mozilla Public License, v. 2.0.`\n } else if (data.lisence == 'Apache-License'){\n data.lis = ` Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction,\nand distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by\nthe copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all\nother entities that control, are controlled by, or are under common\ncontrol with that entity. For the purposes of this definition,\n\"control\" means (i) the power, direct or indirect, to cause the\ndirection or management of such entity, whether by contract or\notherwise, or (ii) ownership of fifty percent (50%) or more of the\noutstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity\nexercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications,\nincluding but not limited to software source code, documentation\nsource, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical\ntransformation or translation of a Source form, including but\nnot limited to compiled object code, generated documentation,\nand conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or\nObject form, made available under the License, as indicated by a\ncopyright notice that is included in or attached to the work\n(an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object\nform, that is based on (or derived from) the Work and for which the\neditorial revisions, annotations, elaborations, or other modifications\nrepresent, as a whole, an original work of authorship. For the purposes\nof this License, Derivative Works shall not include works that remain\nseparable from, or merely link (or bind by name) to the interfaces of,\nthe Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including\nthe original version of the Work and any modifications or additions\nto that Work or Derivative Works thereof, that is intentionally\nsubmitted to Licensor for inclusion in the Work by the copyright owner\nor by an individual or Legal Entity authorized to submit on behalf of\nthe copyright owner. For the purposes of this definition, \"submitted\"\nmeans any form of electronic, verbal, or written communication sent\nto the Licensor or its representatives, including but not limited to\ncommunication on electronic mailing lists, source code control systems,\nand issue tracking systems that are managed by, or on behalf of, the\nLicensor for the purpose of discussing and improving the Work, but\nexcluding communication that is conspicuously marked or otherwise\ndesignated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity\non behalf of whom a Contribution has been received by Licensor and\nsubsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\nthis License, each Contributor hereby grants to You a perpetual,\nworldwide, non-exclusive, no-charge, royalty-free, irrevocable\ncopyright license to reproduce, prepare Derivative Works of,\npublicly display, publicly perform, sublicense, and distribute the\nWork and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\nthis License, each Contributor hereby grants to You a perpetual,\nworldwide, non-exclusive, no-charge, royalty-free, irrevocable\n(except as stated in this section) patent license to make, have made,\nuse, offer to sell, sell, import, and otherwise transfer the Work,\nwhere such license applies only to those patent claims licensable\nby such Contributor that are necessarily infringed by their\nContribution(s) alone or by combination of their Contribution(s)\nwith the Work to which such Contribution(s) was submitted. If You\ninstitute patent litigation against any entity (including a\ncross-claim or counterclaim in a lawsuit) alleging that the Work\nor a Contribution incorporated within the Work constitutes direct\nor contributory patent infringement, then any patent licenses\ngranted to You under this License for that Work shall terminate\nas of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\nWork or Derivative Works thereof in any medium, with or without\nmodifications, and in Source or Object form, provided that You\nmeet the following conditions:\n\n(a) You must give any other recipients of the Work or\nDerivative Works a copy of this License; and\n\n(b) You must cause any modified files to carry prominent notices\nstating that You changed the files; and\n\n(c) You must retain, in the Source form of any Derivative Works\nthat You distribute, all copyright, patent, trademark, and\nattribution notices from the Source form of the Work,\nexcluding those notices that do not pertain to any part of\nthe Derivative Works; and\n\n(d) If the Work includes a \"NOTICE\" text file as part of its\ndistribution, then any Derivative Works that You distribute must\ninclude a readable copy of the attribution notices contained\nwithin such NOTICE file, excluding those notices that do not\npertain to any part of the Derivative Works, in at least one\nof the following places: within a NOTICE text file distributed\nas part of the Derivative Works; within the Source form or\ndocumentation, if provided along with the Derivative Works; or,\nwithin a display generated by the Derivative Works, if and\nwherever such third-party notices normally appear. The contents\nof the NOTICE file are for informational purposes only and\ndo not modify the License. You may add Your own attribution\nnotices within Derivative Works that You distribute, alongside\nor as an addendum to the NOTICE text from the Work, provided\nthat such additional attribution notices cannot be construed\nas modifying the License.\n\nYou may add Your own copyright statement to Your modifications and\nmay provide additional or different license terms and conditions\nfor use, reproduction, or distribution of Your modifications, or\nfor any such Derivative Works as a whole, provided Your use,\nreproduction, and distribution of the Work otherwise complies with\nthe conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\nany Contribution intentionally submitted for inclusion in the Work\nby You to the Licensor shall be under the terms and conditions of\nthis License, without any additional terms or conditions.\nNotwithstanding the above, nothing herein shall supersede or modify\nthe terms of any separate license agreement you may have executed\nwith Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\nnames, trademarks, service marks, or product names of the Licensor,\nexcept as required for reasonable and customary use in describing the\norigin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\nagreed to in writing, Licensor provides the Work (and each\nContributor provides its Contributions) on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied, including, without limitation, any warranties or conditions\nof TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\nPARTICULAR PURPOSE. You are solely responsible for determining the\nappropriateness of using or redistributing the Work and assume any\nrisks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\nwhether in tort (including negligence), contract, or otherwise,\nunless required by applicable law (such as deliberate and grossly\nnegligent acts) or agreed to in writing, shall any Contributor be\nliable to You for damages, including any direct, indirect, special,\nincidental, or consequential damages of any character arising as a\nresult of this License or out of the use or inability to use the\nWork (including but not limited to damages for loss of goodwill,\nwork stoppage, computer failure or malfunction, or any and all\nother commercial damages or losses), even if such Contributor\nhas been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\nthe Work or Derivative Works thereof, You may choose to offer,\nand charge a fee for, acceptance of support, warranty, indemnity,\nor other liability obligations and/or rights consistent with this\nLicense. However, in accepting such obligations, You may act only\non Your own behalf and on Your sole responsibility, not on behalf\nof any other Contributor, and only if You agree to indemnify,\ndefend, and hold each Contributor harmless for any liability\nincurred by, or claims asserted against, such Contributor by reason\nof your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following\nboilerplate notice, with the fields enclosed by brackets \"[]\"\nreplaced with your own identifying information. (Don't include\nthe brackets!) The text should be enclosed in the appropriate\ncomment syntax for the file format. We also recommend that a\nfile or class name and description of purpose be included on the\nsame \"printed page\" as the copyright notice for easier\nidentification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.`\n } else if (data.lisence == 'The-Unlicense'){\n data.lis = `This is free and unencumbered software released into the public domain.\n\n Anyone is free to copy, modify, publish, use, compile, sell, or\n distribute this software, either in source code form or as a compiled\n binary, for any purpose, commercial or non-commercial, and by any\n means.\n \n In jurisdictions that recognize copyright laws, the author or authors\n of this software dedicate any and all copyright interest in the\n software to the public domain. We make this dedication for the benefit\n of the public at large and to the detriment of our heirs and\n successors. We intend this dedication to be an overt act of\n relinquishment in perpetuity of all present and future rights to this\n software under copyright law.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\n OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n OTHER DEALINGS IN THE SOFTWARE.\n \n For more information, please refer to <https://unlicense.org>`\n }\n\n console.log(data)\n fs.writeFileSync(fileName,markdown(data))\n}", "function renderLicense(license) {\n switch(license[0]) {\n case `GNU AGPLv3`:\n badge = \"[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\";\n link = \"https://www.gnu.org/licenses/agpl-3.0\";\n break;\n case `GNU GPLv3`:\n badge = \"[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\";\n link = \"https://www.gnu.org/licenses/gpl-3.0\";\n break;\n case `GNU LGPLv3`:\n link = \"https://www.gnu.org/licenses/lgpl-3.0\";\n badge = \"[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)\";\n break;\n case `Mozilla Public License 2.0`:\n link = \"https://opensource.org/licenses/MPL-2.0\";\n badge = \"[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)\";\n break;\n case `Apache License 2.0`:\n link = \"https://opensource.org/licenses/Apache-2.0\";\n badge = \"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\";\n break;\n case `MIT License`:\n link = \"https://opensource.org/licenses/MIT\";\n badge = \"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\";\n break;\n case `Boost Software License 1.0`:\n link = \"https://www.boost.org/LICENSE_1_0.txt\";\n badge = \"[![License](https://img.shields.io/badge/License-Boost%201.0-lightblue.svg)](https://www.boost.org/LICENSE_1_0.txt)\";\n break;\n case `The Unlicense`:\n link = \"https://unlicense.org/\";\n badge = \"[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](http://unlicense.org/)\";\n break;\n default:\n badge = \"\";\n link = \"\";\n }\n // Return the respective values for badge and link\n return {\n badge,\n link,\n };\n}", "function renderLicenseLink(license) {\n switch(license) {\n case \"Mozilla Public License 2.0\" :\n return \"https://opensource.org/licenses/MPL-2.0\";\n \n case \"MIT License\" :\n return \"https://opensource.org/licenses/MIT\";\n \n case \"Eclipse Public License version 2.0\" :\n return \"https://opensource.org/licenses/EPL-2.0\";\n \n case \"Apache License 2.0\" : \n return \"https://opensource.org/licenses/Apache-2.0\";\n \n case \"No License Used\" : \n return \"\";\n } \n }", "function renderLicenseSection(license) {\n if (license === 'Apache') {\n return `Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n 1. Definitions.\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n END OF TERMS AND CONDITIONS\n APPENDIX: How to apply the Apache License to your work.\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n Copyright [yyyy] [name of copyright owner]\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n [link](http://www.apache.org/licenses/LICENSE-2.0)\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.`;\n } else if (license === 'SIL') {\n return `SIL OPEN FONT LICENSE (OFL-1.1)\n [link](https://tldrlegal.com/license/open-font-license-(ofl)-explained)View Summary of SIL Open Font License v1.1 (OFL-1.1) on TLDRLegal » (Disclaimer)\n \n Copyright (c) <dates>, <Copyright Holder> (<URL|email>),\n with Reserved Font Name <Reserved Font Name>.\n \n Copyright (c) <dates>, <additional Copyright Holder> (<URL|email>),\n with Reserved Font Name <additional Reserved Font Name>.\n \n Copyright (c) <dates>, <additional Copyright Holder> (<URL|email>).\n \n This Font Software is licensed under the SIL Open Font License, Version 1.1.\n \n This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL\n \n \n SIL OPEN FONT LICENSE\n Version 1.1 - 26 February 2007\n \n \n PREAMBLE\n The goals of the Open Font License (OFL) are to stimulate worldwide\n development of collaborative font projects, to support the font creation\n efforts of academic and linguistic communities, and to provide a free and\n open framework in which fonts may be shared and improved in partnership\n with others.\n \n The OFL allows the licensed fonts to be used, studied, modified and\n redistributed freely as long as they are not sold by themselves. The\n fonts, including any derivative works, can be bundled, embedded,\n redistributed and/or sold with any software provided that any reserved\n names are not used by derivative works. The fonts and derivatives,\n however, cannot be released under any other type of license. The\n requirement for fonts to remain under this license does not apply\n to any document created using the fonts or their derivatives.\n \n \n DEFINITIONS\n \"Font Software\" refers to the set of files released by the Copyright\n Holder(s) under this license and clearly marked as such. This may\n include source files, build scripts and documentation.\n \n \"Reserved Font Name\" refers to any names specified as such after the\n copyright statement(s).\n \n \"Original Version\" refers to the collection of Font Software components as\n distributed by the Copyright Holder(s).\n \n \"Modified Version\" refers to any derivative made by adding to, deleting,\n or substituting - in part or in whole - any of the components of the\n Original Version, by changing formats or by porting the Font Software to a\n new environment.\n \n \"Author\" refers to any designer, engineer, programmer, technical\n writer or other person who contributed to the Font Software.\n \n \n PERMISSION & CONDITIONS\n Permission is hereby granted, free of charge, to any person obtaining\n a copy of the Font Software, to use, study, copy, merge, embed, modify,\n redistribute, and sell modified and unmodified copies of the Font\n Software, subject to the following conditions:\n \n 1) Neither the Font Software nor any of its individual components,\n in Original or Modified Versions, may be sold by itself.\n \n 2) Original or Modified Versions of the Font Software may be bundled,\n redistributed and/or sold with any software, provided that each copy\n contains the above copyright notice and this license. These can be\n included either as stand-alone text files, human-readable headers or\n in the appropriate machine-readable metadata fields within text or\n binary files as long as those fields can be easily viewed by the user.\n \n 3) No Modified Version of the Font Software may use the Reserved Font\n Name(s) unless explicit written permission is granted by the corresponding\n Copyright Holder. This restriction only applies to the primary font name as\n presented to the users.\n \n 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font\n Software shall not be used to promote, endorse or advertise any\n Modified Version, except to acknowledge the contribution(s) of the\n Copyright Holder(s) and the Author(s) or with their explicit written\n permission.\n \n 5) The Font Software, modified or unmodified, in part or in whole,\n must be distributed entirely under this license, and must not be\n distributed under any other license. The requirement for fonts to\n remain under this license does not apply to any document created\n using the Font Software.\n \n \n TERMINATION\n This license becomes null and void if any of the above conditions are\n not met.\n \n \n DISCLAIMER\n THE FONT SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT\n OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE\n COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL\n DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM\n OTHER DEALINGS IN THE FONT SOFTWARE. \n `;\n } else if (license === 'GNUAGPLV3') {\n return ` GNU AFFERO GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\nCopyright (C) 2007 Free Software Foundation, Inc. [link](https://fsf.org/)\nEveryone is permitted to copy and distribute verbatim copies\nof this license document, but changing it is not allowed.\n Preamble\nThe GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\nThe licenses for most software and other practical works are designed\nto take away your freedom to share and change the works. By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\nWhen we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\nDevelopers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\nA secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate. Many developers of free software are heartened and\nencouraged by the resulting cooperation. However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\nThe GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community. It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server. Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\nAn older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals. This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\nThe precise terms and conditions for copying, distribution and\nmodification follow.\n TERMS AND CONDITIONS\n0. Definitions.\n\"This License\" refers to version 3 of the GNU Affero General Public License.\n\"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\"The Program\" refers to any copyrightable work licensed under this\nLicense. Each licensee is addressed as \"you\". \"Licensees\" and\n\"recipients\" may be individuals or organizations.\nTo \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy. The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\nA \"covered work\" means either the unmodified Program or a work based\non the Program.\nTo \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy. Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\nTo \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies. Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\nAn interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License. If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n1. Source Code.\nThe \"source code\" for a work means the preferred form of the work\nfor making modifications to it. \"Object code\" means any non-source\nform of a work.\nA \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\nThe \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form. A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\nThe \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities. However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work. For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\nThe Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\nThe Corresponding Source for a work in source code form is that\nsame work.\n2. Basic Permissions.\nAll rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met. This License explicitly affirms your unlimited\npermission to run the unmodified Program. The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work. This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\nYou may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force. You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright. Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\nConveying under any other circumstances is permitted solely under\nthe conditions stated below. Sublicensing is not allowed; section 10\nmakes it unnecessary.\n3. Protecting Users' Legal Rights From Anti-Circumvention Law.\nNo covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\nWhen you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n4. Conveying Verbatim Copies.\nYou may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\nYou may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n5. Conveying Modified Source Versions.\nYou may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\na) The work must carry prominent notices stating that you modified\nit, and giving a relevant date.\nb) The work must carry prominent notices stating that it is\nreleased under this License and any conditions added under section\n7. This requirement modifies the requirement in section 4 to\n\"keep intact all notices\".\nc) You must license the entire work, as a whole, under this\nLicense to anyone who comes into possession of a copy. This\nLicense will therefore apply, along with any applicable section 7\nadditional terms, to the whole of the work, and all its parts,\nregardless of how they are packaged. This License gives no\npermission to license the work in any other way, but it does not\ninvalidate such permission if you have separately received it.\nd) If the work has interactive user interfaces, each must display\nAppropriate Legal Notices; however, if the Program has interactive\ninterfaces that do not display Appropriate Legal Notices, your\nwork need not make them do so.\nA compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit. Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n6. Conveying Non-Source Forms.\nYou may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\na) Convey the object code in, or embodied in, a physical product\n(including a physical distribution medium), accompanied by the\nCorresponding Source fixed on a durable physical medium\ncustomarily used for software interchange.\nb) Convey the object code in, or embodied in, a physical product\n(including a physical distribution medium), accompanied by a\nwritten offer, valid for at least three years and valid for as\nlong as you offer spare parts or customer support for that product\nmodel, to give anyone who possesses the object code either (1) a\ncopy of the Corresponding Source for all the software in the\nproduct that is covered by this License, on a durable physical\nmedium customarily used for software interchange, for a price no\nmore than your reasonable cost of physically performing this\nconveying of source, or (2) access to copy the\nCorresponding Source from a network server at no charge.\nc) Convey individual copies of the object code with a copy of the\nwritten offer to provide the Corresponding Source. This\nalternative is allowed only occasionally and noncommercially, and\nonly if you received the object code with such an offer, in accord\nwith subsection 6b.\nd) Convey the object code by offering access from a designated\nplace (gratis or for a charge), and offer equivalent access to the\nCorresponding Source in the same way through the same place at no\nfurther charge. You need not require recipients to copy the\nCorresponding Source along with the object code. If the place to\ncopy the object code is a network server, the Corresponding Source\nmay be on a different server (operated by you or a third party)\nthat supports equivalent copying facilities, provided you maintain\nclear directions next to the object code saying where to find the\nCorresponding Source. Regardless of what server hosts the\nCorresponding Source, you remain obligated to ensure that it is\navailable for as long as needed to satisfy these requirements.\ne) Convey the object code using peer-to-peer transmission, provided\nyou inform other peers where the object code and Corresponding\nSource of the work are being offered to the general public at no\ncharge under subsection 6d.\nA separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\nA \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling. In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage. For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product. A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source. The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\nIf you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information. But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\nThe requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed. Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\nCorresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n7. Additional Terms.\n\"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law. If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\nWhen you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit. (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.) You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\nNotwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\na) Disclaiming warranty or limiting liability differently from the\nterms of sections 15 and 16 of this License; or\nb) Requiring preservation of specified reasonable legal notices or\nauthor attributions in that material or in the Appropriate Legal\nNotices displayed by works containing it; or\nc) Prohibiting misrepresentation of the origin of that material, or\nrequiring that modified versions of such material be marked in\nreasonable ways as different from the original version; or\nd) Limiting the use for publicity purposes of names of licensors or\nauthors of the material; or\ne) Declining to grant rights under trademark law for use of some\ntrade names, trademarks, or service marks; or\nf) Requiring indemnification of licensors and authors of that\nmaterial by anyone who conveys the material (or modified versions of\nit) with contractual assumptions of liability to the recipient, for\nany liability that these contractual assumptions directly impose on\nthose licensors and authors.\nAll other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10. If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term. If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\nIf you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\nAdditional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n8. Termination.\nYou may not propagate or modify a covered work except as expressly\nprovided under this License. Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\nHowever, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\nMoreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\nTermination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License. If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n9. Acceptance Not Required for Having Copies.\nYou are not required to accept this License in order to receive or\nrun a copy of the Program. Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance. However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work. These actions infringe copyright if you do\nnot accept this License. Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n10. Automatic Licensing of Downstream Recipients.\nEach time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License. You are not responsible\nfor enforcing compliance by third parties with this License.\nAn \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations. If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\nYou may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License. For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n11. Patents.\nA \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based. The\nwork thus licensed is called the contributor's \"contributor version\".\nA contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version. For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\nEach contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\nIn the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement). To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\nIf you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients. \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\nIf, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\nA patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License. You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\nNothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n12. No Surrender of Others' Freedom.\nIf conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License. If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all. For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n13. Remote Network Interaction; Use with the GNU General Public License.\nNotwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software. This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\nNotwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work. The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n14. Revised Versions of this License.\nThe Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time. Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\nEach version is given a distinguishing version number. If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation. If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\nIf the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\nLater license versions may give you additional or different\npermissions. However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n15. Disclaimer of Warranty.\nTHERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n16. Limitation of Liability.\nIN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n17. Interpretation of Sections 15 and 16.\nIf the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n END OF TERMS AND CONDITIONS\nHow to Apply These Terms to Your New Programs\nIf you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\nTo do so, attach the following notices to the program. It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n<one line to give the program's name and a brief idea of what it does.>\nCopyright (C) <year> <name of author>\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as published\nby the Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Affero General Public License for more details.\nYou should have received a copy of the GNU Affero General Public License\nalong with this program. If not, see [link](https://www.gnu.org/licenses/).\nAlso add information on how to contact you by electronic and paper mail.\nIf your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source. For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code. There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\nYou should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n[link](https://www.gnu.org/licenses/).\n`;\n } else if (license === 'ISC') {\n return `ISC License (ISC)\n Copyright <YEAR> <OWNER>\n \n Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n \n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.`;\n } else if (license === 'MIT') {\n return `MIT License\n Copyright (c) [year] [fullname]\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n `;\n } else {\n return ''\n }\n}", "function License(badge){\n this.badge = badge\n }", "function canIGetADrivingLicense(age){\r\n if(age>=20){\r\n return \"yes you can\";\r\n }else{\r\n return `please come back after ${20-age} years to get one`;\r\n }\r\n}", "function renderLicenseLink(licenseUsed) {\n\n if (licenseUsed == \"MIT License\") {\n\n link = \"[![License: MIT]](https://opensource.org/licenses/MIT)\";\n }\n else if (licenseUsed == 'Apache License') {\n link = \"[![License: Apache](https://opensource.org/licenses/Apache-2.0)\";\n }\n else if (licenseUsed == 'ISC License') {\n link = \"[![License: ISC](https://opensource.org/licenses/ISC)\";\n }\n else {\n return \"\";\n }\n return link;\n}", "function renderLicenseLink(license) { \n let retString = ``;\n switch (license) {\n case 'MIT':\n retString = `https://opensource.org/licenses/MIT)`;\n break;\n case 'APACHE 2.0':\n retString = `https://opensource.org/licenses/Apache-2.0`;\n break;\n case 'GPL 3.0':\n retString = `https://www.gnu.org/licenses/lgpl-3.0`;\n break;\n case 'BDS 3':\n retString = `https://opensource.org/licenses/BSD-3-Clause`;\n break;\n default:\n retString = ``;\n }\n return retString;\n}", "function renderLicenseLink(license) {\n if (license === \"none\" ) {\n return \"\";\n}\nelse if (license === \"MIT\") {\n return \"(https://opensource.org/licenses/MIT)\"\n \n}\nelse if (license === \"Apache\") {\n return \"(https://opensource.org/licenses/Apache-2.0)\"\n}\n}", "function renderLicenseBadge(license) {\n if(license == none)\n {\n return \" \";\n }\n else if(licesnse == MIT) {\n `[![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/Naereen/StrapDown.js/blob/master/LICENSE)`\n `[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)`\n }\n else if(licesnse == Apache) {\n `[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)`\n }\n else if(licesnse == GPL3) {\n `[![GPLv3 license](https://img.shields.io/badge/License-GPLv3-blue.svg)](http://perso.crans.org/besson/LICENSE.html)`\n }\n else{\n return \" \";\n }\n}", "function renderLicenseLink(license) {\n if (license) {\n switch (license) {\n case 'MIT License':\n return '\\n\\n> This project was created under the standard MIT licence.\\n\\n[Learn more about this licence.](https://lbesson.mit-license.org/)';\n case 'GPLv3 License':\n return '\\n\\n> This project was created under the GNU General Public License.\\n\\n[Learn more about this licence.](http://www.gnu.org/licenses/gpl-3.0.en.html)';\n case 'Apache 2.0 License':\n return '\\n\\n> This project was created under the Apache License, Version 2.0.\\n\\n[Learn more about this licence.](https://www.apache.org/licenses/LICENSE-2.0)';\n case 'Mozilla Public License 2.0':\n return '\\n\\n> This project was created under the Mozilla Public License, Version 2.0.\\n\\n[Learn more about this licence.](https://www.mozilla.org/en-US/MPL/2.0/)';\n default:\n \"\";\n break;\n }\n }\n}", "function renderLicenseLink(license) {\n\n switch (license) {\n case \"MIT\":\n return \"(https://mit-license.org/)\"\n break;\n case \"GNU GPLv3\":\n return \"(https://www.gnu.org/licenses/gpl-3.0)\"\n break;\n case \"Apache License 2.0\":\n return \"(https://www.apache.org/licenses/LICENSE-2.0)\"\n break;\n }\n\n}", "function renderLicenseLink(license) {\n if (license === \"MIT\"){\n return \"[ MIT License](https://www.mit.edu/~amini/LICENSE.md)\"\n } else if (license === \"GPL\"){\n return \"[ GPL License](https://www.gnu.org/licenses/gpl-3.0.en.html)\"\n } else if (license === \"BSD\"){\n return \"[ BSD License](https://opensource.org/licenses/BSD-3-Clause)\"\n } else if (license === \"APACHE\"){\n return \"[ APACHE License](https://www.apache.org/licenses/LICENSE-2.0)\"\n } else if (license === \"NONE\"){\n return \"\"\n }\n}", "function renderLicenseLink(license) {\n if (license =='Apache 2.0'){\n return `[${license}](https://opensource.org/licenses/Apache-2.0)`\n } else if (license == 'GNU General Public V3.0') {\n return `[${license}](https://www.gnu.org/licenses/gpl-3.0.en.html)`\n } else if (license == 'MIT') {\n return `[${license}](https://opensource.org/licenses/MIT)`\n } else if (license == 'BSD 3-Clause') {\n return `[${license}](https://opensource.org/licenses/BSD-3-Clause)`\n } else if (license == 'Creative Commons Zero') {\n return `[${license}](http://creativecommons.org/publicdomain/zero/1.0/)`\n } else if (license == 'Eclipse Public License') {\n return `[${license}](https://opensource.org/licenses/EPL-1.0)`\n } else if (license == 'GNU Lesser General Public License') {\n return `[${license}](https://www.gnu.org/licenses/lgpl-3.0.en.html)`\n } else if (license == 'Mozilla Public License') {\n return `[${license}](https://opensource.org/licenses/MPL-2.0)`\n } else if (license == 'The Unlicense') {\n return `[${license}](http://unlicense.org/)`\n } else {\n return \"\";\n }\n}", "function renderLicenseLink(license) {\n if (license !== [1] ) {\n return `\nThis project is covered under the license License [MIT](https://opensource.org/licenses/MIT)\n `;\n }\n\n return '';\n \n}", "function showLicenceKey() {\n routingBase.goToCurrentState('license');\n }", "function Smelly() {\n var feet = document.createElement(\"div\");\n var startYearCDP = 2015;\n //var startYearBTB = 2015; I should remove this because it's not needed in the current situation\n var startYearJDT = 2016;\n\n var now = new Date;\n var theYear = now.getYear();\n if (theYear < 1900)\n theYear = theYear + 1900;\n\n feet.className = \"copyright\";\n\n switch (CheckDate(theYear, startYearCDP, feet), CheckDate(theYear, startYearJDT, feet)) {\n case true, true:\n NextYearBoth(feet, theYear);\n break;\n case true, false:\n NextYearCDP(feet, theYear);\n break;\n default:\n CurrentYear(feet, theYear);\n }\n}", "function renderLicenseBadge(license) {\n if (license =='Apache 2.0' ){\n return ` ![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)`\n } else if (license == 'GNU General Public V3.0') {\n return `![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)`\n } else if (license == 'MIT') {\n return `![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)`\n } else if (license =='BSD 3-Clause') {\n return `![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)`\n } else if (license =='Creative Commons Zero') {\n return `![License: CC0-1.0](https://licensebuttons.net/l/zero/1.0/80x15.png)`\n } else if (license =='Eclipse Public License') {\n return `![License](https://img.shields.io/badge/License-EPL%201.0-red.svg)`\n } else if (license =='GNU Lesser General Public License') {\n return `![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)`\n } else if (license =='Mozilla Public License') {\n return `![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)`\n }else if (license =='The Unlicense') {\n return `![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)`;\n } else {\n return \"\";\n }\n\n}", "function renderLicenseLink(license) {\n switch (license) {\n case \"Apache\":\n return `[Apache](https://www.apache.org/licenses/LICENSE-2.0.txt)`;\n case \"GNU AGPLv3\":\n return `[GNU AGPLv3](https://www.gnu.org/licenses/agpl-3.0-standalone.html)`;\n case \"GNU GPLv3\":\n return `[GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0-standalone.html)`;\n case \"GNU LGPLv3\":\n return `[GNU LGPLv3](https://www.gnu.org/licenses/lgpl-3.0-standalone.html)`;\n case \"MIT\":\n return `[MIT](https://spdx.org/licenses/MIT.html)`;\n case \"Mozilla\":\n return `[Mozilla](https://www.mozilla.org/en-US/MPL/2.0/)`;\n case \"None\":\n return \"\";\n }\n}", "function renderLicenseLink(license) {\n\tvar link = '';\n\tif (license === 'MIT') { \n\t\tlink = 'https://choosealicense.com/licenses/mit/';\n\t} else if (license === 'Apache') { \n\t\tlink = 'https://choosealicense.com/licenses/apache-2.0/';\n\t} else if (license === 'GPL') { \n\t\tlink = 'https://choosealicense.com/licenses/gpl-3.0/';\n\t} else if (license === 'Mozilla') { \n\t\tlink = 'https://choosealicense.com/licenses/mpl-2.0/';\n\t}\n\t\n\treturn link;\n}", "function renderLicenseBadge(license) {\n if(license===\"apache\")return \"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\";\nif(license===\"gnu\") return \"[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\";\nif(license===\"mit\")return \"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\";\n}", "function generateLicense(data) {\n return new Promise(function (resolve, reject) {\n if (data.license === \"MIT\") {\n licenseBadge = \"https://img.shields.io/badge/license-MIT-brightgreen\";\n licenseText = \"Application licensed under MIT. For more information see https://opensource.org/licenses/MIT\";\n resolve(licenseBadge, licenseText);\n } else if (data.license === \"Apache-2.0\") {\n licenseBadge = \"https://img.shields.io/badge/license-Apache_2.0-brightgreen\";\n licenseText = \"Application licensed under Apache Version 2.0. For more information see http://www.apache.org/licenses\";\n resolve(licenseBadge, licenseText);\n } else if (data.license === \"GNU GPLv3\") {\n licenseBadge = \"https://img.shields.io/badge/license-GNU_GPLv3-brightgreen\";\n licenseText = \"Application licensed under General Public License Version 3. For more information see https://www.gnu.org/licenses/gpl-3.0.html\";\n resolve(licenseBadge, licenseText);\n } else if (data.license === \"GNU AGPLv3\") {\n licenseBadge = \"https://img.shields.io/badge/license-GNU_AGPLv3-brightgreen\";\n licenseText = \"Application licensed under AFFERO General Public License Version 3. For more information see https://www.gnu.org/licenses/agpl-3.0.en.html\";\n resolve(licenseBadge, licenseText);\n } else {\n return reject(err);\n };\n\n })\n}", "function renderLicenseLink(license) {\n switch (license){\n case 'Unlicense':\n return 'http://unlicense.org/';\n case 'MIT':\n return 'https://opensource.org/licenses/MIT';\n case 'Apache 2.0':\n return 'https://opensource.org/licenses/Apache-2.0'\n default : \n return ''\n }\n}", "function renderLicenseSection(data) {\n if(data.license == \"MIT\") {\n return \"This project is licensed under the MIT License. To learn more visit \"\n } else if (data.license == \"Apache 2.0\") {\n return \"This project is licensed under the Apache 2.0 License. To learn more visit \"\n } else if (data.license == \"GNU GPL v3.0\") {\n return \"This project is licensed under the GNEU General Public License v3.0. To learn more visit \"\n } else {\n return \"\"\n };\n}", "function renderLicenseLink(license) {\n switch (license[0].license) {\n case 'MIT':\n return \"https://opensource.org/licenses/MIT\";\n case 'APACHE 2.0':\n return \"https://opensource.org/licenses/Apache-2.0\";\n case 'GPL 3.0':\n return \"https://opensource.org/licenses/GPL-3.0\";\n case 'BSD 3':\n return \"https://opensource.org/licenses/BSD-3-Clause\";\n case 'None':\n return \"\";\n }\n}", "function renderLicenseLink(license) {\n if (license === \"MIT\") {\n return `https://opensource.org/licenses/MIT`\n } else \n if (license === \"ISC\") {\n return `https://opensource.org/licenses/ISC`\n } else \n if (license === \"BSD3\") {\n return `https://opensource.org/licenses/BSD-3-Clause`\n } else \n if (license === \"Mozilla\") {\n return `https://opensource.org/licenses/MPL-2.0`\n } else \n if (license === \"Apache\") {\n return `https://opensource.org/licenses/Apache-2.0`\n } else {\n return `https://opensource.org/licenses/lgpl-3.0.html`\n }\n}", "function renderLicenseLink(license) {\n if(license == none){\n return \" \"\n }\n else if(license == MIT){\n `https://opensource.org/licenses/MIT`\n }\n else if(license == Apache)\n {\n `https://opensource.org/licenses/Apache-2.0`\n }\n else if(license == GPL3)\n {\n `https://opensource.org/licenses/GPL-3.0`\n }\n else{\n return \"\";\n }\n}", "function renderLicenseLink(license) {}", "function renderLicenseLink(license) {}", "function renderLicenseLink(license) {}", "function renderLicenseLink(license) {}", "function renderLicenseLink(license) {}", "function renderLicenseLink(license) {}", "function renderLicenseLink(license) {}", "function renderLicenseLink(license) {}", "function renderLicenseLink(license) {}", "function renderLicenseLink(license) {}", "function renderLicenseLink(license) {}", "function renderLicenseLink(license) {}", "function renderLicenseLink(license) {}", "function renderLicenseLink(license) {}", "function renderLicenseLink(license) {}", "function showAbout(){\n\talert(\"Niven is a browser based text editor.\\n\\nUse and modification of this tool are covered by the APACHE 2 license\\nviewable at http://www.apache.org/licenses/LICENSE-2.0\");\n}", "function renderLicenseSection(license) { \n if (license === 'Creative Commons') {\n return 'Creative Commons (CC) is an internationally active non-profit organisation that provides free licences for creators to use when making their work available to the public. These licences help the creator to give permission for others to use the work in advance under certain conditions.'\n} else if (license === 'MIT') {\n return 'A short, permissive software license. Basically, you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source. There are many variations of this license in use.'\n} else if (license === 'None') {\n return 'No description available.'\n}\n}", "function renderLicenseLink(license) { }", "function renderLicenseLink(license) { }", "function renderLicenseLink(license) { }", "function getLicenseLink(license) {\n switch (license){\n case \"Apache\":\n return \"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\";\n break;\n case \"Boost\":\n return \"[![License](https://img.shields.io/badge/License-Boost%201.0-lightblue.svg)](https://www.boost.org/LICENSE_1_0.txt)\";\n break;\n case \"CCO\":\n return \"[![License: CC0-1.0](https://licensebuttons.net/l/zero/1.0/80x15.png)](http://creativecommons.org/publicdomain/zero/1.0/)\";\n break;\n case \"Gnu GPL 3\":\n return \"[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\";\n break;\n default:\n return \"\";\n break;\n }\n}", "function licenseBadge(value) {\n if (value === \"GNU GPLv3\") {\n return \"[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\";\n } else if (value === \"GNU LGPLv3\") {\n return \"[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)\";\n } else if (value === \"Mozilla\") {\n return \"[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)\";\n } else if (value === \"MIT\") {\n return \"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\";\n } else if (value === \"Apache\") {\n return \"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\";\n } else {\n return \"[![License](https://img.shields.io/badge/License-Boost%201.0-lightblue.svg)](https://www.boost.org/LICENSE_1_0.txt)\";\n }\n}", "function renderLicenseLink(license) {\n // returns the link to more info for the corresponding to the type of license\n switch (license) {\n case \"Apache-2.0\":\n return \"https://opensource.org/licenses/Apache-2.0\";\n case \"BSD-3-Clause\":\n return \"https://opensource.org/licenses/BSD-3-Clause\";\n case \"GPL-3.0\":\n return \"http://www.gnu.org/licenses/gpl-3.0\";\n case \"LGPL-3.0\":\n return \"http://www.gnu.org/licenses/lgpl-3.0\";\n case \"MIT\":\n return \"https://opensource.org/licenses/MIT\";\n case \"MPL-2.0\":\n return \"https://opensource.org/licenses/MPL-2.0\";\n case \"CC BY 4.0\":\n return \"http://creativecommons.org/licenses/by/4.0/\";\n case \"EPL-2.0\":\n return \"https://opensource.org/licenses/EPL-1.0\";\n }\n}", "function renderLicenseLink(data) {\n if(data.license == \"MIT\") {\n return \"[MIT License](https://github.com/git/git-scm.com/blob/main/MIT-LICENSE.txt)\"\n } else if (data.license == \"Apache 2.0\") {\n return \"[Apache 2.0 License](https://github.com/moby/moby/blob/master/LICENSE)\"\n } else if (data.license == \"GNU GPL v3.0\") {\n return \"[GNU GPL v3.0 License](https://choosealicense.com/licenses/gpl-3.0/)\"\n } else {\n return \"\"\n };\n}", "function renderLicense(license) {\n //this returns both the license icon and the link in the one function.. \n\n let licenseIcon; \n\n switch (license){\n\n case \"MIT\":\n licenseIcon = \"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\"\n break;\n\n case \"Apache 2.0 License\":\n licenseIcon =\"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\"\n break;\n\n case \"Creative Commons license family\":\n licenseIcon = \"[![License: CC0-1.0](https://licensebuttons.net/l/zero/1.0/80x15.png)](http://creativecommons.org/publicdomain/zero/1.0/)\"\n break;\n\n case \"IBM Public License Version 1.0\":\n licenseIcon = \"[![License: IPL 1.0](https://img.shields.io/badge/License-IPL%201.0-blue.svg)](https://opensource.org/licenses/IPL-1.0)\"\n break;\n\n case \"GNU General Public License family\":\n licenseIcon =\"[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\"\n break;\n\n case \"Do What The F*ck You Want To Public License\":\n licenseIcon = \"[![License: WTFPL](https://img.shields.io/badge/License-WTFPL-brightgreen.svg)](http://www.wtfpl.net/about/)\"\n break;\n \n default: licenseIcon = \"\";\n }\n return licenseIcon;\n}", "function getLicense(value) {\n if (value === \"GNU AGPLv3\") {\n return \"[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\";\n } else if (value === \"GNU GPLv3\") {\n return \"[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\";\n } else if (value === \"GNU LGPLv3\") {\n return \"[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)\";\n } else if (value === \"Apache 2.0\") {\n return \"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\";\n } else if (value === \"Boost Software 1.0\") {\n return \"[![License](https://img.shields.io/badge/License-Boost%201.0-lightblue.svg)](https://www.boost.org/LICENSE_1_0.txt)\";\n } else if (value === \"MIT\") {\n return \"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\";\n } else {\n return \"[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)\";\n }\n}", "function renderLicenseLink(license) {\n if (license === 'MIT') {\n return \"https://opensource.org/licenses/MIT\"\n } else if (license === 'BSD3') {\n return \"https://opensource.org/licenses/BSD-3-Clause\"\n } else if (license === 'EPL') {\n return \"https://opensource.org/licenses/EPL-2.0\"\n } else if (license === 'GPLv3') {\n return \"https://opensource.org/licenses/GPL-3.0\"\n } else {\n return \"\"\n }\n}", "function renderLicenseLink(license) {\n if (!license) return '';\n else if (license === 'MIT License') {\n return 'https://www.mit.edu/~amini/LICENSE.md';\n } else if (license === 'GNU GPLv3') {\n return 'https://www.gnu.org/licenses/lgpl-3.0.html';\n }\n}", "function getLicense(value) {\n if (value === \"GNU AGPLv3\") {\n return \"[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\";\n } else if (value === \"GNU GPLv3\") {\n return \"[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\";\n } else if (value === \"GNU LGPLv3\") {\n return \"[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)\";\n } else if (value === \"Apache 2.0\") {\n return \"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\";\n } else if (value === \"Boost Software 1.0\") {\n return \"[![License](https://img.shields.io/badge/License-Boost%201.0-lightblue.svg)](https://www.boost.org/LICENSE_1_0.txt)\";\n } else if (value === \"MIT\") {\n return \"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\";\n } else {\n return \"[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)\";\n }\n}", "function renderLicenseLink(license) {\n switch(license) {\n case \"GPL\":\n return \"https://opensource.org/licenses/gpl-license\";\n case \"MIT\":\n return \"https://opensource.org/licenses/MIT\";\n case \"Apache\":\n return \"https://opensource.org/licenses/Apache-2.0\";\n }\n}", "function renderLicenseLink(license) {\n if (license === \"N/A\") {\n return \"\";\n }\nif (license === \"MIT\") {\n return `[https://opensource.org/licenses/MIT]`;\n} else if (license === \"Apache 2.0\") {\n return `[https://www.apache.org/licenses/LICENSE-2.0]`;\n} else if (license === \"GNU\") {\n return `[[https://www.gnu.org/licenses/gpl-3.0.en.html]`;\n} else if (license === \"ISC\") {\n return `[https://www.isc.org/licenses/]`;\n} else if (license === \"IBM\") {\n return `[https://opensource.org/licenses/IPL-1.0]`;\n}\n}", "function renderLicenseLink(license) {\n if (license === `MIT`) {\n return \"To learn more about this license, visit (https://choosealicense.com/licenses/mit/)\";\n } else if (license === `Apache 2.0`) {\n return \"To learn more about this license, visit (https://choosealicense.com/licenses/apache-2.0/)\";\n } else if (license === `GNU GPL 3.0`) {\n return \"To learn more about this license, visit (https://choosealicense.com/licenses/gpl-3.0/)\";\n } else if (license === `Unlicense`) {\n return \"To learn more about this license, visit (https://choosealicense.com/licenses/unlicense/)\";\n } else {\n return \"\";\n }\n}", "function copyDate(organization,start_date) {\n\t \n\t\tvar copyright=new Date();\n\t\tvar update=copyright.getFullYear();\n\n\t\t//---write copyright\n\t\tif ( start_date == update )\n\t\t document.write(\"<br />Copyright &#169; \" + start_date + \"<br />\" + organization + \",&nbsp;&nbsp;All Rights Reserved.\");\n\t\telse\n\t\t document.write(\"<br />Copyright &#169; \" + start_date + \" - \" + update + \"<br />\" + organization + \",&nbsp;&nbsp;All Rights Reserved.\");\n\t\t\n\t} //end copyDate()\t", "function renderLicenseLink(license) {\n if (license === \"MIT\") {\n return `https://opensource.org/licenses/MIT`;\n } else if (license === \"GNU GPL\") {\n return `https://www.gnu.org/licenses/gpl-3.0`;\n } else if (license === \"Apache 2.0\") {\n return `https://opensource.org/licenses/Apache-2.0`;\n } else if (license === \"Boost Software License 1.0\") {\n return `https://www.boost.org/LICENSE_1_0.txt`;\n } else if (license === \"Mozilla\") {\n return `!https://opensource.org/licens4es/MPL-2.0`;\n } else if (license === \"Open Software License 3.0\") {\n return `https://opensource.org/licenses/OSL-3.0`;\n } else {\n license = \"\";\n return license;\n }\n}", "function ensureLicense() {\n return through.obj((file, enc, cb) => {\n if (file.isNull()) {\n cb(null, file);\n return;\n }\n\n if (file.isStream()) {\n cb(new PluginError('gulp-license', 'Streaming not supported'));\n return;\n }\n\n const text = file.contents.toString();\n const type = toFileType(file.path);\n\n if (type === FileType.CSS) {\n file.contents = Buffer.from(addCssLicense(text));\n }\n\n if (type === FileType.HTML) {\n file.contents = Buffer.from(addHtmlLicense(text));\n }\n\n if (type === FileType.JAVASCRIPT) {\n file.contents = Buffer.from(addJavaScriptLicense(text));\n }\n\n cb(null, file);\n });\n}", "function renderLicenseLink(license) {\n switch (license) {\n case 'Apache 2.0 License':\n link='https://opensource.org/licenses/Apache-2.0';\n break;\n case 'BSD 2-clause License':\n link='https://opensource.org/licenses/BSD-2-Clause';\n break;\n case 'BSD 3-clause License':\n link='https://opensource.org/licenses/BSD-3-Clause';\n break;\n case 'GPL License 3.0':\n link='https://opensource.org/licenses/GPL-3.0' \n break;\n case 'MIT License':\n link='https://opensource.org/licenses/MIT';\n break;\n case 'Mozilla Public License 2.0':\n link='https://opensource.org/licenses/MPL-2.0';\n break;\n default:\n link='';\n break;\n }\n}", "function renderLicenseBadge(license) {\n if (license === \"none\" || license === \"\") {\n return \"This application does not have a license.\"\n }\n else {\n var badge;\n switch (license) {\n case 'Apache 2.0 License':\n badge = `[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)`;\n break;\n case 'Boost Software License 1.0':\n badge = `[![License](https://img.shields.io/badge/License-Boost%201.0-lightblue.svg)](https://www.boost.org/LICENSE_1_0.txt)`;\n break;\n case 'BSD 3-Clause License':\n badge = `[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)`;\n break;\n case 'BSD 2-Clause License':\n badge = `[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)`;\n break;\n case 'GNU GPL v3':\n badge = `[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)`;\n break;\n case 'MIT':\n badge = `[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)`;\n break;\n case 'Mozilla Public License 2.0':\n badge = `[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)`;\n break;\n case 'The Unlicense':\n badge = `[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](http://unlicense.org/)`;\n break;\n case 'Eclipse Public License 1.0':\n badge = `[![License](https://img.shields.io/badge/License-EPL%201.0-red.svg)](https://opensource.org/licenses/EPL-1.0)`;\n \n }\n return badge\n }\n}", "function renderLicenseLink(license) {\n if(license === 'MIT') {\n return `[GitHub License](https://opensource.org/licenses/MIT)`\n } else if (license === 'AUR') {\n return `![GPLv3 License](http://www.apache.org/licenses/LICENSE-2.0)`\n } else if (license === 'GPL') {\n return `![AGPL License](https://www.gnu.org/licenses/gpl-3.0.html)`\n } else {\n return '';\n }\n}", "function renderLicenseLink(license) {\n let x = \"\";\n switch(license){\n case \"Apache\":\n x = 'https://opensource.org/licenses/Apache-2.0';\n break;\n case \"MIT\":\n x = 'https://opensource.org/licenses/MIT';\n break;\n case \"IBM\": \n x = 'https://opensource.org/licenses/IPL-1.0';\n break;\n case \"BSD\": \n x = 'https://opensource.org/licenses/BSD-3-Clause';\n break;\n case \"None\": \n x = '';\n break;\n default: \n x = \"\";\n }\n return x;\n}", "function renderLicenseLink(license) {\n if (license === \"MIT\") {\n return 'https://choosealicense.com/licenses/mit/'\n }\n else if (license === \"GNU\")\n return 'https://choosealicense.com/licenses/agpl-3.0/'\n else {\n return \"\"\n }\n}", "function renderLicenseLink(license) {\n if (license === 'MIT') {\n return `[MIT License](https://opensource.org/licenses/MIT)`;\n }else if (license === 'ISC') {\n return `[ISC License](https://opensource.org/licenses/ISC)`;\n }else if (license === 'BSD 2-Clause') {\n return `[BSD 2-Clause License](https://opensource.org/licenses/BSD-2-Clause)`;\n }else {\n return ` `;\n }\n}", "function renderLicenseSection(license) {return !license ? '' : `This project is licensed under the ${license} license. For more information. please visit ${renderLicenseLink(license)}.`}", "function badge(licenseChoice) {\n// badge information\n// TODO: Create a function that returns the license link\nlet licenseString = \" \"\nif (licenseChoice === 'MIT'){\n licenseString = `![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)`\n}\nelse if (licenseChoice === 'Apache 2.0'){\n licenseString = `![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)`\n}\nelse if (licenseChoice === 'GPL 3.0'){\n licenseString = `![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)`\n}\n// // If there is no license, return an empty string\nelse if (licenseChoice === 'None'){\n licenseString = `![License: 'None'}](http://img.shields.io/badge/License-None)`\n};\nreturn licenseString\n}", "function renderLicenseSection(license) { \n if (license === null || license.length===0 || license===\"None\"){\n return \"\";\n }\n return `This project is licensed under the ${license} license.\nPlease refer to ${renderLicenseLink(license)} for details.`\n}", "function FairUseRationale() {\n\tif((wgPageName == 'Special:Upload' || wgPageName == 'Special:MultipleUpload') && document.getElementById('wpDestFile').value == '') {\n\t\tdocument.getElementById('wpUploadDescription').value = '== Source ==\\n\\n== Licensing ==\\n\\n[[Category:';\n\t}\n}", "function renderLicenseLink(license) {\n return '# License\\n\\nLicensed under the [MIT LICENSE](LICENSE)';\n}", "function renderLicenseLink(license) {\n var link;\n\n switch(license) {\n case 'MIT License':\n link = 'https://opensource.org/licenses/MIT';\n break;\n case 'GNU Lesser General Public License v3.0':\n link = 'https://www.gnu.org/licenses/lgpl-3.0';\n break;\n case 'Mozilla Public License 2.0':\n link = 'https://opensource.org/licenses/MPL-2.0';\n break;\n case 'GNU Affero General Public License v3.0':\n link = 'https://www.gnu.org/licenses/agpl-3.0';\n break;\n case 'The Unlicense':\n link = 'https://opensource.org/licenses/ISC';\n break;\n case 'Apache License 2.0':\n link = 'https://opensource.org/licenses/Apache-2.0';\n break;\n case 'GNU General Public License v3.0':\n link = 'https://www.gnu.org/licenses/gpl-3.0';\n break;\n default:\n link = '';\n }\n return link;\n}", "function renderLicenseLink(license) {\n if (license === 'Apache') {\n return 'https://www.apache.org/licenses/LICENSE-2.0.html';\n } else if (license === 'SIL') {\n return 'https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=ofl';\n } else if (license === 'GNUAGPLV3') {\n return 'https://www.gnu.org/licenses/gpl-3.0.en.html';\n } else if (license === 'ISC') {\n return 'https://www.isc.org/licenses/';\n } else if (license === 'MIT') {\n return 'https://mit-license.org/';\n } else {\n return ''\n }\n}", "function Pythia() {}", "function renderLicenseLink(license) {\n if (license === 'Creative Commons') {\n return 'Find information about this license [here](http://creativecommons.org/publicdomain/zero/1.0/)'\n } else if (license === 'MIT') {\n return 'Find information about this license [here](https://opensource.org/licenses/MIT)'\n } else if (license === 'None') {\n return 'No license link available.'\n }\n}", "function renderLicenseSection(license) {\n if (license !== \"None\") {\n return `\n## License\n\nThis project is licensed under the ${license} license.\n\nCopyright (c) [year] [fullname]\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n`;\n }\n return \"\";\n}", "function renderLicenseSection(license) {\n if (!license) return '';\n else if (license === 'MIT License') {\n return 'This project is covered under the MIT License. For more information, please click the link below.';\n } else if (license === 'GNU GPLv3') {\n return 'This project is covered under the GNU GPLv3 License. For more information, please click the link below.';\n }\n}", "function renderLicenseBadger(license) {\r\n if (license !== \"none\") {\r\n return `![GitHub license](https://img.shields.io/badge/license-${license}-blue.svg)`\r\n } else {\r\n console.log(\"a license was not selected\")\r\n return ''\r\n }\r\n}", "function renderLicenseSection(license) {\n if (license === \"MIT\") {\n return `A short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.`\n }\n else if (license === \"GNU\") {\n return `Permissions of this strongest copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. When a modified version is used to provide a service over a network, the complete source code of the modified version must be made available.`\n }\n else {\n return \"\"\n }\n}", "function LicenseBadge(license) {\n let badge = ' ';\n\n switch (license) {\n case 'GNU AGPLv3':\n badge = '[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)';\n break;\n case 'GNU GPLv3':\n badge = '[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)';\n break;\n case 'GNU LGPLv3':\n badge = '[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)';\n break;\n case 'Mozilla Public License 2.0':\n badge = '[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)';\n break;\n case 'Apache License 2.0':\n badge = '[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)';\n break;\n case 'MIT License':\n badge = '[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)';\n break;\n case 'Boost Software License 1.0':\n badge = '[![License](https://img.shields.io/badge/License-Boost%201.0-lightblue.svg)](https://www.boost.org/LICENSE_1_0.txt)';\n break;\n case 'The Unlicense':\n badge = '[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](http://unlicense.org/)';\n break;\n default:\n break;\n\n }\n return badge;\n}", "function renderLicenseBadge(licenses) {\n if (licenses === \"APM[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\") {\n return \"[APM][![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\";\n } else if (licenses === \"AUR\") {\n return \"AUR[![License: AUR](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\";\n } else if (licenses === \"BSD 3-Clause\") {\n return \"BSD 3-Clause[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\";\n } else if (licenses === \"BSD 2-Clause\") {\n return \"BSD 2-Clause[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)\";\n } else if (licenses === \"Eclipse Marketplace License\") {\n return \"ECLIPSE[![License](https://img.shields.io/badge/License-EPL%201.0-red.svg)](https://opensource.org/licenses/EPL-1.0)\";\n } else if (licenses === \"GNU GPL v2\") {\n return \"GNU GPL v2[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)\";\n } else if (licenses === \"GNU GPL v3\") {\n return \"GNU GPL v3[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\";\n } else if (licenses === \"IBM Public License\") {\n return \"IBM[![License: IPL 1.0](https://img.shields.io/badge/License-IPL%201.0-blue.svg)](https://opensource.org/licenses/IPL-1.0)\";\n } else if (licenses === \"Mozilla\") {\n return \"Mozilla[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)\";\n } else if (licenses === \"Unlicense\") {\n return \"Unlicense[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](http://unlicense.org/)\";\n } else {\n return \" \";\n }\n}", "function startLicenseAgree()\n{\n var handleUrl = \"handle/\" + cocoon.parameters.handle;\n var signatureNeeded = UFALLicenceAgreement.signatureNeeded(getObjectModel());\n var everythingFine = false;\n if(signatureNeeded) {\n everythingFine = doLicenseAgree(handleUrl);\n }\n\n if(!everythingFine) {\n cocoon.redirectTo(cocoon.request.getContextPath() + \"/\" + handleUrl, true);\n getDSContext().complete();\n }\n}", "function renderLicenseBadge(license) {\nif (license === \"N/A\") {\n return \"\";\n }\n if (license === \"MIT\") {\n return `[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)`;;\n} else if (license === \"Apache 2.0\") {\n return `[![License Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)`;\n} else if (license === \"GNU\") {\n return `[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)`;\n} else if (license === \"ISC\") {\n return `[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)`;\n} else if (license === \"IBM\") {\n return `[![License: IPL 1.0](https://img.shields.io/badge/License-IPL%201.0-blue.svg)](https://opensource.org/licenses/IPL-1.0)`;\n }\n}", "showLicense() {\n cordova.InAppBrowser.open(\"../resources/docs/license.htm\", \"_blank\", \"zoom=no\")\n }", "function checkLicense(res) {\n let badgeFormat = res.license.split(\" \").join(\"_\");\n res.badge = `<img src = \"https://img.shields.io/badge/license-${badgeFormat}-blue`;\n}", "function renderLicenseLink(license) {\n switch (license) {\n case \"Apache\":\n return `[Apache License 2.0](https://choosealicense.com/licenses/apache-2.0/)`;\n case \"GNU\":\n return `[GNU General Public License v3.0](https://choosealicense.com/licenses/gpl-3.0/)`;\n case \"MIT\":\n return `[MIT License](https://choosealicense.com/licenses/mit/)`;\n default:\n return \"\";\n }\n}", "function renderLicenseSection(license) {\n if(license == \"MIT\"){\n return ('[![License: MIT](https://img.shields.io/badge/License-MIT-blue)](https://opensource.org/licenses/MIT)')\n } else if (license == \"IBM\") {\n return ('[![License: IBM](https://img.shields.io/badge/License-IBM-blue)](https://opensource.org/licenses/IBM)')\n } else if (license == \"ISC\") {\n return ('[![License: ISC](https://img.shields.io/badge/License-ISC-blue)](https://opensource.org/licenses/ISC)')\n } else {\n return (' ')\n }\n \n}", "function renderLicenseBadge(license) {\n switch (license) {\n case \"None\":\n url = \"\"\n break;\n case \"Apache License 2.0\":\n url = apache\n break;\n case \"GNU General Public License v3.0\":\n url = gnu\n break;\n case \"MIT\":\n url = mit\n break;\n case \"BSD 2-Clause Simplified License\":\n url = bsd2\n break;\n case \"BSD 3-Clause New or Revised\":\n url = bsd3\n break;\n case \"Boost Software License 1.0\":\n url = bsl1\n break;\n case \"Creative Commons Zero v1.0 Universal\":\n url = ccz1\n break;\n case \"Eclipse Public License 2.0\":\n url = epl\n break;\n case \"GNU Affero General Public License v3.0\":\n url = gnu3\n break;\n case \"GNU General Public License v2.0\":\n url = gnu2\n break;\n case \"GNU Lesser General Public License v2.1\":\n url = gnulesser\n break;\n case \"Mozilla Public License 2.0\":\n url = mozilla\n break;\n case \"The Unlicense\":\n url = theunlicense\n break;\n }\n return url\n}", "function renderLicenseLink(data) {\n const noLicenseResp = '';\n\n if (data.license === 'MIT' || data.license ==='Apache 2.0' || data.license === 'GNU GPL v3' || data.license === 'IBM Public License v1.0' || data.license === 'Mozilla Public License 2.0' || data.license === 'Perl') {\n return `[License](${data.license})` //?????\n } else {\n return noLicenseResp; \n }\n}", "function renderLicenseLink(license) {\n switch (license) {\n case \"MIT License\":\n return \"https://img.shields.io/badge/license-MIT-green\";\n case \"Apache Licence 2.0\":\n return \"https://img.shields.io/badge/license-Apache-green\"\n case \"GNU GPLv3\":\n return \"https://img.shields.io/badge/license-GPL-green\"\n default:\n return \"\";\n }\n //https://img.shields.io/badge/license-MIT-green\n //https://img.shields.io/badge/license-Apache-green\n //https://img.shields.io/badge/license-GPL-green\n}", "function renderLicenseSection(license) {\n if (license === \"NONE\"){\n return \"\";\n }else{\n return `## License \n This project is covered under the ` + license + ` license. Click the link below for more information. \n `\n+ \nrenderLicenseBadge(license) +\n renderLicenseLink(license);\n}}", "function renderLicenseLink(license) {\n\n if (license ==='Apache' ) {\n return `## License \\n https://choosealicense.com/licenses/apache-2.0/`; \n } else if (license ==='GNU' ) {\n return `## License \\n https://choosealicense.com/licenses/agpl-3.0/`; \n } else if (license ==='MIT' ) {\n return `## License \\n https://choosealicense.com/licenses/mit/`; \n } else if (license ==='ISC' ) {\n return `## License \\n https://choosealicense.com/licenses/isc/`; \n } else {\n return '';\n } \n}" ]
[ "0.70789", "0.6999031", "0.6574779", "0.64180183", "0.6207177", "0.6175353", "0.6149885", "0.61334527", "0.6129822", "0.6101268", "0.60971665", "0.5987143", "0.5964633", "0.59605193", "0.59283227", "0.59272885", "0.59209794", "0.5912749", "0.59017444", "0.5894045", "0.5871221", "0.58712023", "0.5869496", "0.5858953", "0.58549935", "0.5847841", "0.5839842", "0.5811567", "0.58093745", "0.57999915", "0.57844466", "0.57820547", "0.5779697", "0.57774866", "0.5774006", "0.5774006", "0.5774006", "0.5774006", "0.5774006", "0.5774006", "0.5774006", "0.5774006", "0.5774006", "0.5774006", "0.5774006", "0.5774006", "0.5774006", "0.5774006", "0.5774006", "0.5771568", "0.576753", "0.576441", "0.576441", "0.576441", "0.57574874", "0.57540995", "0.5753671", "0.5749205", "0.57399803", "0.5733793", "0.5731258", "0.5729513", "0.571453", "0.5711529", "0.57101667", "0.57101566", "0.5702754", "0.57010585", "0.56938946", "0.56925493", "0.5688874", "0.56866014", "0.56820744", "0.5678719", "0.56700945", "0.56578815", "0.5650141", "0.56500965", "0.5649221", "0.5644249", "0.56438303", "0.5640339", "0.56348264", "0.56316984", "0.56273633", "0.5627212", "0.5627026", "0.56235296", "0.5621287", "0.5615922", "0.5612676", "0.56028074", "0.5601605", "0.5594293", "0.55920476", "0.55910724", "0.5589844", "0.5587123", "0.55817395", "0.55783296", "0.5577844" ]
0.0
-1
when loaded shuffle data
componentDidMount() { this.setState({ data: this.shuffleArray(this.state.data) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shuffle() {\n // TODO\n }", "function load() {\n shuffle();\n var shuffledDeck = deck.slice(0, 5);\n checkPoints(shuffledDeck);\n}", "function ReloadTestData(data) {\n Frc.shuffle() ;\n for (var i=0; i<data.length; i++) {\n data[i][0] = Frc[i] ;\n data[i][1] = Math.floor(Math.random()*10) ;\n }\n return data ;\n}", "function setBeerCollectionData() {\n shuffleArray(beer_Collection);\n}", "function retrain() {         \n trainingData = _.shuffle(trainingData);        \n train();    \n}", "function getShuffled() {\r\n return shuffled;\r\n }", "newShuffle(){\n this.drawPile = shuffle(this.newDeck());\n }", "function shuffleTiles() {\n var shuffledTiles = shuffle(tileHTMLElements);\n\n console.log('after shuffle:', shuffledTiles);\n\n repopulateTiles(shuffledTiles);\n }", "function reshuffle() {\n shuffleArray(group.people);\n selectGroup(true);\n saveNewOrder();\n}", "shuffle() {\n this._decks.forEach(deck => deck.shuffle())\n return super.shuffle();\n }", "function shuffle() {\n randomize(deck);\n renderDeck(deck);\n}", "shuffleCards() {\n let random = 0;\n let temp = 0;\n for (i = 1; i < game.cards.length; i++) {\n random = Math.round(Math.random() * i);\n temp = game.cards[i];\n game.cards[i] = game.cards[random];\n game.cards[random] = temp;\n }\n game.assignData();\n \n }", "function shuffleQueston() {\n DATA_SOURCE.sort(_=>Math.random() - 0.5);\n for (let i = 0; i < DATA_SOURCE.length; i++) {\n DATA_SOURCE[i].ans.sort(_=> Math.random() - 0.5);\n }\n}", "function load() {\r\n count = [];\r\n winner = [];\r\n stop = false;\r\n stopTimer();\r\n startTimer();\r\n for (var i = 0; i < 16; i++) {\r\n count.push(i);\r\n if (i > 0) winner.push(i);\r\n $('td').attr(\"id\", function(i) {\r\n return i;\r\n });\r\n }\r\n winner.push(0);\r\n steps = 0;\r\n time = 0;\r\n $(\"#steps\").text(steps);\r\n count = shuffle(count);\r\n for (var i = 0; i < count.length; i++) {\r\n $('#' + (i)).html((count[i] != 0 ? count[i] : ''));\r\n }\r\n}", "shuffle()\n\t{\n\t\tlet temp;\n\t\tlet arraySpot;\n\t\tlet arraySpot2;\n\t\tfor (let x = 0; x < 1000000; x++)\n\t\t{\n\t\t\tarraySpot = Math.floor(Math.random() * this.numCards);\n\t\t\tarraySpot2 = Math.floor(Math.random() * this.numCards);\n\n\t\t\ttemp = this.cards[arraySpot];\n\t\t\tthis.cards[arraySpot] = this.cards[arraySpot2];\n\t\t\tthis.cards[arraySpot2] = temp;\n\t\t}\n\t}", "shuffle() {\n _deck.set(this, shuffleArray(_deck.get(this)));\n }", "static shuffle() {\n shuffleWords(words);\n shuffleWords(globalPool);\n }", "function preload() {\n for (let s = 0; s < 15; s++) {\n let name = 'idb' + s + '.bmp'\n let img = loadImage(name);\n board.push ({image: img, key: s, visible: true})\n }\n board = shuffle(board.concat(board));\n imgDeck = loadImage('deck.bmp');\n imgBlack = loadImage('black.bmp');\n}", "shuffleCards() {\n\n \t\tfor(var i = 0; i < this.cards.length; i++) {\n \t\t\tvar randomIndex = Math.floor(Math.random() * this.cards.length);\n \t\tvar temp = this.cards[i];\n \t\t\n \t\tthis.cards[i] = this.cards[randomIndex];\n \t\tthis.cards[randomIndex] = temp;\n \t\t}\n\t }", "componentDidMount() {\n this.shuffleData();\n this.resetData();\n\n }", "shuffleAndTest(){\n while(this.attempts !== 0 ){\n // decrement this.attempts \n this.attempts -= 1\n // get new current by shuffling a copy of original\n this.currentRoute = this.shuffleArray(this.places.slice());\n //run comparison\n this.compareCurrentRoute()\n\n }\n }", "reshuffle() {\n this._deck = [];\n for(var i = 0; i < 52; i++) {\n\t\t\tthis._deck.push(i);\n\t\t}\n \n this.shuffle();\n }", "function shuffleFunc() {\n\tresetFunc();\n\tshuffle();\n}", "function initCardShuffle() {\n // Shuffle cards, then reset their states and move them in the shuffled order. \n [...memoryGrid.querySelectorAll('.card')]\n\n .sort(function () {\n return 0.5 - Math.random();\n })\n .forEach(function (elem) {\n\n resetCard(elem);\n\n memoryGrid.appendChild(elem);\n });\n }", "function shuffleit() {\n list_cards = shuffle(list_cards);\n shuffle_cards(list_cards);\n}", "shuffle() {\n for (var i = this._deck.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = this._deck[i];\n this._deck[i] = this._deck[j];\n this._deck [j] = temp;\n }\n }", "shuffleDeck() {\n\t\t// Loop through the deck and shuffle cards\n \t\tfor (let i = this.mCardDeck.length - 1; i > 0; i--) {\n \tconst j = Math.floor(Math.random() * (i + 1));\n \t[this.mCardDeck[i], this.mCardDeck[j]] = [this.mCardDeck[j], this.mCardDeck[i]];\n \t}\n \t}", "shuffle() {\n if(this.deck.length <= 1) { return; }\n \n for(let idx = 0; idx < this.deck.length - 1; idx++) {\n let idx_random = this.randomIndex(idx, this.deck.length - 1);\n \n if(idx_random !== idx) {\n let swap = this.deck[idx];\n this.deck[idx] = this.deck[idx_random];\n this.deck[idx_random] = swap;\n }\n }\n }", "function shuffle()\n{\n var tem = getRandom(shuffleIndexCount);\n var tem2 = shuffleIndex[tem];\n shuffleIndex[tem] = shuffleIndex[shuffleIndexCount];\n\n shuffleIndexCount--;\n if(shuffleIndexCount < 0)\n {\n shuffleIndexCount = songsList.length;\n }\n return tem2;\n}", "componentWillMount() {\n function shuffleArray(array) {\n for (let i = array.length - 1; i > 0; i--) {\n let j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n return array;\n }\n shuffleArray(this.cards);\n }", "initializeCards(data) {\n this.setState({ cardContent: yaml.loadAll(data) });\n const cardOrder = [];\n for (let i = 0; i < this.state.cardContent.length; i++) {\n for (let j = 0; j < this.state.cardContent[i].cards.length; j++) {\n cardOrder.push({ 'group': i, 'num': j, 'status': \"unselected\" });\n }\n }\n shuffleArray(cardOrder);\n this.setState({ cardInfo: cardOrder });\n }", "randomShuffle() {\n const shuffled = [];\n const unshuffled = this.cards.slice();\n\n while (unshuffled.length > 0) {\n const randomCard = Math.floor(Math.random() * unshuffled.length);\n shuffled.push(unshuffled.splice(randomCard, 1)[0]);\n }\n\n this.cards = shuffled;\n }", "function shuffle() {\n\t\tfor(let i = 0; i < 1000; i++){\n\t\t\tlet arr = findMovablePieces(xCoordinate,yCoordinate);\n\t\t\tlet rand = parseInt(Math.random() * arr.length);\n\t\t\tswap(arr[rand]);\n\t\t}\n\t}", "function shufflePlayerList() {\r\n shuffle(players);\r\n\r\n playerInTurn = 0;\r\n}", "shuffleDiscardPile(){\n this.drawPile = shuffle(this.discarPile);\n }", "shuffle() {\n for(let i = 0; i < this.library.length; i++) {\n let swapWith = Math.floor(Math.random() * this.library.length);\n\n let temp = this.library[i];\n this.library[i] = this.library[swapWith];\n this.library[swapWith] = temp;\n }\n }", "function createShuffle() {\r\n shuffled = [];\r\n for (var i = 0; i < songs.length; i++) {\r\n shuffled.push(i);\r\n }\r\n return randomize(shuffled);\r\n }", "componentDidMount (){\n this.setState(\n {\n data: this.shuffleData(this.state.data)\n }\n )\n}", "function shuffleSongs() {\n /*\n\t\t\tBuilds a temporary array with the length of the config.\n\t\t*/\n let shuffleTemp = new Array(config.songs.length);\n\n /*\n\t\t\tSet the temporary array equal to the songs array.\n\t\t*/\n for (let i = 0; i < config.songs.length; i++) {\n shuffleTemp[i] = config.songs[i];\n }\n\n /*\n\t\t\tIterate ove rthe songs and generate random numbers to\n\t\t\tswap the indexes of the shuffle array.\n\t\t*/\n for (let i = config.songs.length - 1; i > 0; i--) {\n let randNum = Math.floor(Math.random() * config.songs.length + 1);\n shuffleSwap(shuffleTemp, i, randNum - 1);\n }\n\n /*\n\t\t\tSet the shuffle list to the shuffle temp.\n\t\t*/\n config.shuffle_list = shuffleTemp;\n }", "function slv_shuffle(a) {\n for (var i = a.length - 1; i >= 1; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n if (j < i) {\n var tmp = a[j];\n a[j] = a[i];\n a[i] = tmp;\n }\n }\n }", "function shuffle(_array) {\n // geht über das _array über und wechselt den Eintrag an Position i mit einem anderen zufälligen Eintrag im array\n for (let i = 0; i < _array.length; i++) {\n // der Eintrag an Position i wird zwischen gespeichert\n let tmp = _array[i];\n // randomIndex = random Position im _array, wird mit dem Wert an der Stelle i vertauscht ||Beispiel: Math.random() = 0,99; _array.length = 8 --> 0,99 * 8 = 7,92 --> Math.floor() (abrunden) --> 7 \n let randomIndex = Math.floor(Math.random() * _array.length);\n // Beispiel || warum wird das gemacht? Um die urls zu mischen\n // tmp bleibt immer 4\n // _array[i]: 4, _array[randomIndex]: 9\n // = _array[i]: 9, _array[randomIndex]: 9\n // _array[randomIndex]: 4, _array[i]: 9\n _array[i] = _array[randomIndex];\n _array[randomIndex] = tmp;\n }\n }", "function shuffle()\n\t{\n\t\tvar o = slides;\n\t\tfor (var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n\t\tslides = o;\n\t}", "function shuffle() {\n\t// shuffle the tiles 200 times\n\tfor(var i = 0; i <= 2 * TILE_AREA; i++) {\n\t\tupdateTiles();\n\t}\n}", "function shuffle (arr) {\n var arrCopy = arr.slice();\n shuffleInplace(arrCopy);\n return arrCopy;\n }", "function shuffle() {\n\tshuffleCards = cards.sort(function(a,b){return 0.5 - Math.random()});\n}", "shuffle() {\n for (let i = this.cards.length - 1; i > 1; i--) {\n let x = Math.floor(Math.random() * i);\n let temp = this.cards[i];\n this.cards[i] = this.cards[x];\n this.cards[x] = (temp);\n }\n }", "function shuffle(a) {\n\t\t\t\tvar j, x, i;\n\t\t\t\tfor (i = a.length; i; i -= 1) {\n\t\t\t\t\tj = Math.floor(Math.random() * i);\n\t\t\t\t\tx = a[i - 1];\n\t\t\t\t\ta[i - 1] = a[j];\n\t\t\t\t\ta[j] = x;\n\t\t\t\t}\n\t\t\t}", "shuffle() {\n for (let i = 0; i < 1000; i++) {\n let location1 = Math.floor((Math.random() * this.cards.length));\n let location2 = Math.floor((Math.random() * this.cards.length));\n let tmp = this.cards[location1];\n\n this.cards[location1] = this.cards[location2];\n this.cards[location2] = tmp;\n };\n return this.cards\n }", "function getShuffle() {\n\t\treturn isShuffle;\n\t}", "shuffleTrainingImages(){\n var shuffledArray = this.shuffle(neuralNet.trainingImages);\n neuralNet.trainingImages = shuffledArray;\n console.log(neuralNet.trainingImages);\n }", "static shuffle(deck){\n\t var randomIndex;\n\t var temp;\n\t for(var i = 0; i < deck.length; i++){\n\t //pick a random index from 0 to deck.length - 1\n\t randomIndex = Math.floor(Math.random() * deck.length);\n\n\t temp = deck[i];\n\t deck[i] = deck[randomIndex];\n\t deck[randomIndex] = temp;\n\n\t }\n\t }", "function shuffle()\r\n {\r\n if(document.images)\r\n {\r\n \r\n var j = Math.floor(new Date().getSeconds() * Math.random() + 60);\r\n for(var i = 0;\r\n i < j; \r\n i++)\r\n {\r\n number1 = Math.round(Math.random() * (Images * 2 - 1));\r\n number2 = Math.round(Math.random() * (Images * 2 - 1));\r\n img = imgArrField[number1];\r\n imgArrField[number1] = imgArrField[number2];\r\n imgArrField[number2] = img;\r\n } \r\n }\r\n }", "function shuffleTiles(){\n //SHUFFLE\n console.log(\"Shuffling...\");\n shuffledTiles = shuffle(gameTiles);\n\n //UPDATE BOARD\n for (let i = 0; i <= shuffledTiles.length - 1; i++){ \n let curTile = $(`#${i}`);\n $(curTile).append($(\"<img></img>\")\n .attr('src', `${shuffledTiles[i].value}`)\n .addClass(\"hidden\", \"image\"));\n };\n }", "function shuffleInplace (arr) {\n var j, tmp;\n for (var i = arr.length - 1; i > 0; i--) {\n j = baseRandInt(i + 1);\n tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n }\n }", "function shuffleCards() {\n\t\t\tvar curr_index = cards.length, \n\t\t\t\ttemp_value, \n\t\t\t\trand_index;\n\t\t\twhile (0 !== curr_index){\n\t\t\t\t// Pick random value\n\t\t\t\trand_index = Math.floor(Math.random() * curr_index);\n\t\t\t\tcurr_index--;\n\t\t\t\t// Swap the randomly picked value with the current one\n\t\t\t\ttemp_value = cards[curr_index];\n\t\t\t\tcards[curr_index] = cards[rand_index];\n\t\t\t\tcards[rand_index] = temp_value;\n\t\t\t}\n\t\t}", "function shuffle(array) {\n//randomizes the order of the figures in the array\n let currentIndex = array.length, randomIndex;\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex--;\n [array[currentIndex], array[randomIndex]] = [\n array[randomIndex], array[currentIndex]];\n }\n return array;\n}", "loadList() {\n let deck2 = shuffle(newDeck());\n this.setState({ cards: deck2 });\n }", "shuffle(list) {\n list = list.slice();\n let shuffled = [];\n while (list.length) {\n let pos = (config.PRNG.nextFloat() * list.length)|0;\n shuffled.push( list.splice(pos,1)[0] );\n }\n return shuffled;\n }", "function toggleShuffle() {\n /*\n If shuffle is on, we toggle it off. If shuffle is off, we\n toggle on.\n */\n if (config.shuffle_on) {\n config.shuffle_on = false;\n config.shuffle_list = [];\n } else {\n config.shuffle_on = true;\n shuffleSongs();\n }\n }", "shuffleDeck() {\n let n = this.deck.length;\n for (let i = 0; i < n; i++) {\n var r = Math.floor(Math.random() * n);\n this.shuffledCards.push(this.deck[r]);\n this.deck[r] = this.deck[n - 1];\n n--;\n }\n }", "@autobind\n initShuffleIndexes() {\n for (var i=0; i< this.particleCount; i++) {\n this.shuffleIndexArray[i] = i * 3;\n }\n this.shuffleIndexes();\n }", "shuffle() {\n // -- To shuffle an array a of n elements (indices 0..n-1):\n // for i from n−1 downto 1 do\n // j ← random integer such that 0 ≤ j ≤ i\n // exchange a[j] and a[i]\n for (let n = this.cards.length - 1; n > 0; --n)\n {\n //Step 2: Randomly pick a card which has not been shuffled\n let k = Math.floor(Math.random() * (n + 1));\n\n //Step 3: Swap the selected item with the last \"unselected\" card in the collection\n let temp = this.cards[n];\n this.cards[n] = this.cards[k];\n this.cards[k] = temp;\n }\n }", "function shuffleCards() {\r\n shuffle(cardsOrig);\r\n cardsTop = cardsOrig.slice(0);\r\n shuffle(cardsOrig);\r\n cardsBottom = cardsOrig.slice(0);\r\n cards = cardsTop.concat(cardsBottom);\r\n shuffle(cards);\r\n console.log(cards);\r\n}", "shuffleFrames() {\n this.frames = this._shuffle(this.frames);\n this.frames = this._reorder(this.frames);\n }", "function shuffle() {\n for (var i = 0; i < 1000; i++) {\n var neighbors = findAllNeighbors();\n var randomNumber = parseInt(Math.random() * neighbors.length);\n var selectedTile = neighbors[randomNumber];\n moveTileHelper(selectedTile);\n }\n }", "shuffle() {\n let remainingCardTobeShuffled = this.deck.length, randomCardSwapIndex;\n\n // Swaps 52 times\n while (remainingCardTobeShuffled) {\n\n // Create a random index to be swapped\n randomCardSwapIndex = Math.floor(Math.random() * remainingCardTobeShuffled--);\n\n // Shortcut in js to swap two elements\n [this.deck[remainingCardTobeShuffled], this.deck[randomCardSwapIndex]] = [this.deck[randomCardSwapIndex], this.deck[remainingCardTobeShuffled]];\n }\n\n }", "function someFunction() {\n shuffle(arr)\n}", "function shuffle() {\n\t\tfor (var i = 0; i < 1000; i++) {\n\t\t\tvar neighbors = getEmptyNeighbors();\n\t\t\tvar index = Math.round(Math.random() * (neighbors.length - 1));\n\t\t\tvar id = empty + neighbors[index];\n\t\t\tvar piece = document.getElementById(\"x\" + id);\n\t\t\tmovePiece(piece);\n\t\t}\n\t}", "characterShuffle() {\n\t\tthis.loadedPieces.forEach((e, key) => {\n\t\t\tthis.character[`${key}`] = e.object;\n\t\t});\n\n\t\tHelper.shuffleCharacter(this.game, this.character);\n\t}", "function storeShuffledItems(array) {\n\tshuffleArray(protein_array);\n\tvar _rand_val = (Math.random()*2);\n\tif ( _rand_val == 0 ) {\n\t\tarray=[protein_array[0],protein_array[1],protein_array[2],protein_array[3],protein_array[4],protein_array[5]];\n\t} else {\n\t\tarray=[protein_array[0],protein_array[1],protein_array[2],protein_array[3],protein_array[4],protein_array[5],protein_array[6]];\n\t}\n\treturn array;\n}", "function randomize() {\n var allBanners = $('#pedalTable img');\n shuffle(allBanners.hide()).slice(18).show(); \n}", "shuffle() {\n for (let i = this.cards.length - 1; i > 0; i--) {\n const newIndex = Math.floor(Math.random() * (i + 1)); //get random index before the current card to swap with\n const oldValue = this.cards[newIndex];\n this.cards[newIndex] = this.cards[i];\n this.cards[i] = oldValue;\n //Looping through all of our cards and swapping them with another card to get a random shuffle\n }\n }", "function shuffleCards(){\n\tmemoryCards = shuffle(memoryCards);\n\tfor (var i=0; i < 12; i++){\n\t\tvar item = document.getElementById(i);\n\t\titem.src = card;\n\t}\n}", "reshuffle(){\n this.unpickedKeys = new Set([...this.master.keys()]);\n }", "function reset () {\n shuffledArray = visualizer.getRandomArray();\n visualizer.drawArray(shuffledArray);\n}", "randomizeTrainingData() {\n if (\n this.scenarioParameters.randomizeTrainingDataEveryGeneration ||\n this.trainingData.length != this.scenarioParameters.episodesPerGeneration\n ) {\n this.trainingData = [];\n for (var i = 0; i < this.scenarioParameters.episodesPerGeneration; i++) {\n var temp = this.randomTrainingData();\n this.trainingData.push(temp);\n }\n }\n }", "reset(shuffle = true){\n this.cards = [];\n for (var i = 0; i <= 12; i++) {\n for (var j = 0; j <= 3; j++) {\n let card = new Card(values[i], suits[j]);\n this.cards.push(card);\n }\n }\n if (shuffle){ this.shuffle(); }\n this.dealtIndex = 0;\n }", "function shuffleTiles () {\n tiles.sort(() => 0.5 - Math.random()); // Randomise the positions of the items in the main array to allow \"shuffling\"\n}", "function shuffle() {\n resetClasses()\n puzzleContainer.style.backgroundColor = 'white'\n const shuffled = randomizePieces()\n assignClasses(shuffled)\n // if the puzzle is solved, shuffle again\n if (isSolved()) {\n shuffle()\n }\n isSolvable(shuffled)\n}", "function initNewTeamsData() {\n // execute load student dictionary\n loadStudentDict();\n\n // initialize a list of new teams\n shuffleCounter = 1;\n teams = shuffleNewTeams();\n // flatten new teams multi-array to verify for any undefined\n var flattenTeams = [].concat.apply([], teams);\n // filter out undefined \n flattenTeams = flattenTeams.filter(e => e !== undefined)\n console.log(flattenTeams.length);\n // Reshuffle if all students are not assigned\n while((flattenTeams.length !== studentMap.length)) {\n // Reset studentList\n studentList = studentMap.map(d=>d);\n // Reshuffle new teams\n teams = shuffleNewTeams();\n // flatten new teams multi-array to verify for any undefined\n flattenTeams = [].concat.apply([], teams);\n // filter out undefined \n flattenTeams = flattenTeams.filter(e => e !== undefined)\n // increment counter\n shuffleCounter = shuffleCounter + 1;\n }\n // Print counter and teams in console\n console.log(\"shuffle counter:\" + shuffleCounter);\n console.log(teams);\n}", "function setQuestionBank() {\n for (let val of fixedQuestionBank) {\n questionBank.push(val);\n }\n console.log(questionBank);\n shuffle(questionBank);\n}", "function shuffle () {\n for(let i=setDeck.length-1; i >= 0; i--){\n let j = Math.floor(Math.random() * i)\n let temp = setDeck[i]\n setDeck[i] = setDeck[j]\n setDeck[j] = temp\n }\n}", "shuffle ()\r\n {\r\n for (let i = this.arr.length - 1; i > 0; i--)\r\n {\r\n let num = Math.floor (Math.random () * (i + 1));\r\n this.arr [num].style.order = i;\r\n this.arr [i].style.order = num;\r\n }\r\n }", "function shuffle(array){\n\t\t\t\t\t\t\t\t \tvar currentIndex = array.length;\n\t\t\t\t\t\t\t\t \tvar temporaryValue;\n\t\t\t\t\t\t\t\t \t//var randIndex;\n\n\t\t\t\t\t\t\t\t \twhile (currentIndex > 0){\n\t\t\t\t\t\t\t\t \t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\t\t\t\t\t\t\t \t\tcurrentIndex --;\n\n\t\t\t\t\t\t\t\t \t\ttemporaryValue = array[currentIndex];\n\t\t\t\t\t\t\t\t \t\tarray[currentIndex] = array[randomIndex];\n\t\t\t\t\t\t\t\t \t\tarray[randomIndex] = temporaryValue;\n\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t \t\treturn array;\n}", "function shuffle(quiz) {\n\n\t var currentIndex = quiz.length;\n\t var temporaryValue;\n\t var randomIndex;\n\t while (0 !== currentIndex) {\n\n\t randomIndex = Math.floor(Math.random() * currentIndex);\n\t currentIndex -= 1;\n\t temporaryValue = quiz[currentIndex];\n\t quiz[currentIndex] = quiz[randomIndex];\n\t quiz[randomIndex] = temporaryValue;\n\t }\n\n\t \n\t }", "function shuffle() {\r\n\t// random pieces are moved 200 times\r\n\tfor(var i = 0; i < 200; i++) {\r\n\t\t// create an empty array\r\n\t\tvar movables = [];\r\n\t\t// check each if the piece is movable\r\n\t\t// if movable, add the piece to the array\r\n\t\tfor(var j = 0; j < PIECES.length; j++) {\r\n\t\t\tif(movable(PIECES[j])) {\r\n\t\t\t\tmovables.push(PIECES[j]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// choose a random piece in the array of movable pieces\r\n\t\tvar piece = Math.floor(Math.random()*movables.length);\r\n\t\t// move the piece\r\n\t\tmove(movables[piece]);\r\n\t}\r\n\tSHUFFLE = true;\r\n}", "refreshPage() {\n var combinedVotingRecord = this.props.senatorOneVotingRecord;\n var length = this.props.senatorOneVotingRecord.length;\n for(var i = 0; i < length; i++) {\n combinedVotingRecord.push(this.props.senatorTwoVotingRecord[i]);\n }\n combinedVotingRecord = _.shuffle(combinedVotingRecord); //random shuffle function from lodash\n this.setState({\n index: 0,\n votingRecords: combinedVotingRecord,\n currentRecord: combinedVotingRecord[0],\n gameState: 0\n });\n }", "initCards() {\n let allCards = [\n { value: \"A\", matched: false},\n { value: \"A\", matched: false},\n { value: \"B\", matched: false},\n { value: \"B\", matched: false},\n { value: \"C\", matched: false},\n { value: \"C\", matched: false},\n { value: \"D\", matched: false},\n { value: \"D\", matched: false},\n { value: \"E\", matched: false},\n { value: \"E\", matched: false},\n { value: \"F\", matched: false},\n { value: \"F\", matched: false},\n { value: \"G\", matched: false},\n { value: \"G\", matched: false},\n { value: \"H\", matched: false},\n { value: \"H\", matched: false}\n ];\n this.shuffle(allCards);\n return allCards;\n }", "function processRandom(data) {\n setRandom(data);\n}", "function shuffleBoard() {\r\n for (var i = pack.length - 1; i > 0; i--) {\r\n var j = Math.floor(Math.random() * (i + 1));\r\n var temp = pack[i];\r\n pack[i] = pack[j];\r\n pack[j] = temp;\r\n }\r\n setBoard(pack);\r\n }", "shuffle() {\n const cardDeck = this.cardDeck;\n let cdl = cardDeck.length;\n let i; // Loop through the deck, using Math.random() swap the two items locations in the array\n\n while (cdl) {\n i = Math.floor(Math.random() * cdl--);\n var _ref = [cardDeck[i], cardDeck[cdl]];\n cardDeck[cdl] = _ref[0];\n cardDeck[i] = _ref[1];\n }\n\n return this;\n }", "function shuffle(a) {\n for (let i = a.length; i; i--) {\n let j = Math.floor(Math.random() * i);\n [a[i - 1], a[j]] = [a[j], a[i - 1]];\n }\n }", "_shuffle(o){\n\t\t\tfor(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n\t\t\treturn o;\n\t}", "shuffle() {\n let len = this.cards.length;\n while(len) {\n // randomly choose a card and move it to the end\n // of the deck\n this.cards.push(\n this.cards.splice( Math.floor( Math.random() * len ), 1 )[0]\n )\n len -= 1\n }\n }", "function shuffle(array) { \n for (let i = 0; i < 3; i++) {\n tempArr.push(array.splice(Math.floor(Math.random() * array.length), 1));\n } \n }", "function shuffle () {\n for (var i = 0; colorSet.length > 0; i += 1) {\n colorShuffled = colorShuffled.concat(colorSet.splice(Math.floor(Math.random() * colorSet.length), 1));\n }\n}", "function shuffleCardList() {\r\n console.log(\"list --\", cardListArray);\r\n const shuffeledArray = shuffle(cardListArray);\r\n console.log(\"suffle --\", shuffeledArray);\r\n\r\n for (let i = 0; i < shuffeledArray.length; i++) {\r\n console.log(\"append -->\", shuffeledArray[i]);\r\n container.appendChild(shuffeledArray[i]);\r\n }\r\n }", "shuffle() {\n let currentIndex = this.length;\n let temp, randomIndex;\n\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n temp = this[currentIndex];\n this[currentIndex] = this[randomIndex];\n this[randomIndex] = temp;\n }\n }", "function shuffleHelper() {\n if (0 !== currentIndex) {\n // Pick a remaining element...\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex--;\n\n // And swap it with the current element.\n swap(arr, currentIndex, randomIndex);\n visualizeBars(arr, BAR_WIDTH);\n requestAnimationFrame(shuffleHelper);\n } else {\n cancelAnimationFrame(shuffleId);\n }\n }", "function shuffleBoard() {\n newGameIdsArr = shuffle(gameIdsArr);\n newMoundsArr = shuffle(moundsArr);\n \n for (var i = 0; i < gameIdsArr.length; i++) {\n gamePieces[i].setAttribute('id', newGameIdsArr[i]);\n gamePieces[i].setAttribute('style', 'background-image: url(' + newMoundsArr[i] + ');');\n }\n }" ]
[ "0.7255586", "0.6966312", "0.69415176", "0.6862799", "0.6795091", "0.6694614", "0.66945124", "0.66750777", "0.6668145", "0.6665998", "0.665834", "0.66227144", "0.6619545", "0.6583857", "0.65673214", "0.65652734", "0.6564522", "0.65384674", "0.65221536", "0.64816993", "0.6465372", "0.64268756", "0.64251304", "0.64089453", "0.6368231", "0.63667065", "0.63640875", "0.6350413", "0.6348543", "0.6335537", "0.6335039", "0.6330447", "0.63097113", "0.6307088", "0.63064814", "0.63007426", "0.6295267", "0.6250476", "0.62167484", "0.62151086", "0.61886036", "0.6182758", "0.6178201", "0.6176008", "0.6171277", "0.6167601", "0.6152663", "0.6139132", "0.61386997", "0.61376166", "0.6133928", "0.61329156", "0.612791", "0.6126243", "0.6125495", "0.6124711", "0.61224526", "0.6118682", "0.61145186", "0.6106852", "0.61019087", "0.60937274", "0.6083725", "0.60828125", "0.6069544", "0.6065784", "0.60649514", "0.6063635", "0.6061524", "0.6057666", "0.6055216", "0.60473096", "0.60385597", "0.60371757", "0.6033799", "0.60316104", "0.60313785", "0.60298735", "0.6029219", "0.60282844", "0.6023142", "0.60207915", "0.60181713", "0.60149235", "0.6006178", "0.6001587", "0.59969026", "0.59926486", "0.5989702", "0.5971214", "0.5966635", "0.5964913", "0.59643036", "0.59582525", "0.5955663", "0.5954591", "0.59534013", "0.59466136", "0.59444577", "0.5944202" ]
0.6153941
46
Firebug console or native browser console
function consoleLog() { if (typeof(console) == 'object' && typeof(console["log"]) != "undefined") { console.log.apply(console, arguments); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFirebugConsole(safeWin, unsafeWin, chromeWin) {\n try {\n chromeWin = chromeWin.top;\n // assert FB is installed\n if (!chromeWin.Firebug)\n return null;\n var fbVersion = parseFloat(chromeWin.Firebug.version);\n var fbConsole = chromeWin.Firebug.Console;\n var fbContext = chromeWin.TabWatcher &&\n chromeWin.TabWatcher.getContextByWindow(unsafeWin);\n // assert FB is enabled\n if (!fbConsole.isEnabled(fbContext))\n return null;\n\n if (fbVersion == 1.2) {\n // search console handler\n if (fbContext.consoleHandler)\n for (var i = 0; i < fbContext.consoleHandler.length; i++)\n if (fbContext.consoleHandler[i].window == safeWin)\n return fbContext.consoleHandler[i].handler;\n var dummyElm = safeWin.document.createElement(\"div\");\n dummyElm.setAttribute(\"id\", \"_firebugConsole\");\n safeWin.document.documentElement.appendChild(dummyElm);\n chromeWin.Firebug.Console.injector.addConsoleListener(fbContext, safeWin);\n dummyElm.parentNode.removeChild(dummyElm);\n return fbContext.consoleHandler.pop().handler;\n }\n\n if (fbVersion == 1.3 || fbVersion == 1.4) {\n fbConsole.injector.attachIfNeeded(fbContext, unsafeWin);\n // find active context\n for (var i=0; i<fbContext.activeConsoleHandlers.length; i++)\n if (fbContext.activeConsoleHandlers[i].window == unsafeWin)\n return fbContext.activeConsoleHandlers[i];\n return null;\n }\n } catch (e) {\n dump('Webmonkey getFirebugConsole() error:\\n'+uneval(e)+'\\n');\n }\n return null;\n}", "function i(t,e){window.console}", "function i(t,e){window.console}", "function r(t,e){window.console}", "function r(t,e){window.console}", "function healConsole() {\r\n //<iframe> element\r\n var iframe = document.createElement(\"iframe\");\r\n //Hide it somewhere\r\n iframe.style.position=\"fixed\";\r\n iframe.style.height = iframe.style.width = \"1px\";\r\n iframe.style.top = iframe.style.left = \"-5px\";\r\n //No src to prevent loading some data\r\n iframe.src = \"about: blank\";\r\n //Needs append to work\r\n document.body.appendChild(iframe);\r\n //Get the inner console\r\n return window.console = iframe.contentWindow.console;\r\n}", "function DebugConsole() {\n}", "function DebugConsole() {\n}", "function DebugConsole() {\n}", "function log(t) {\r\n if (window.console && window.console.firebug) {\r\n window.console.log(t);\r\n }\r\n}", "function debug(/*anything*/ obj) { \n try {\n var windowMediator = \n Components.classes[\"@mozilla.org/appshell/window-mediator;1\"]\n .getService(Components.interfaces.nsIWindowMediator);\n var e = windowMediator.getEnumerator(\"navigator:browser\");\n while (e.hasMoreElements()) {\n var chromeWindow = e.getNext();\n printDebug(chromeWindow, obj);\n }\n } catch (e) {\n }\n \n debugToErrorConsole(obj)\n}", "function debug(str) {\n\tjavascript:console.log(str);\n}", "function dbg(value)\n{\n\tvar active = false;//true for active\n\tvar firefox = true;//true if debug under firefox\n\n\tif (active)\n\t\tif (firefox)\n\t\t\tconsole.log(value);\n\t\telse\n\t\t\talert(value);\n}", "function firebugStartup()\n{\n try\n {\n Cu.import(\"resource://firebug/loader.js\");\n FirebugLoader.registerBootstrapScope(this);\n FirebugLoader.registerDefaultPrefs(defaultPrefs);\n }\n catch (e)\n {\n // If an exception happens it's probably because Firebug hasn't been\n // started yet. Just ignore it.\n }\n}", "function writeConsole(content) \n{\n //open new window\n top.consoleRef=window.open('','myconsole','width=350,height=400,menubar=0,toolbar=1,status=0,scrollbars=1,resizable=1')\n //write page\n top.consoleRef.document.writeln('<html><head><title>Console</title></head><body bgcolor=white onLoad=\"self.focus()\">'+content+'</body></html>')\n top.consoleRef.document.close()\n}", "function Console() {}", "function Console() {}", "function myDebug(){\n if(window.console) console.info(arguments);\n}", "function _debug(str) {\n\tif (window.console && window.console.log) window.console.log(str);\n }", "function takeOverConsole() {\n var console = window.console;\n if (!console) return;\n\n function intercept(method) {\n var original = console[method];\n console[method] = function() {\n for (i = 0; i < arguments.length; i++) {\n if (typeof arguments[i] == \"string\" && \n arguments[i].indexOf(\"Error 404 means that Python module\") == -1 &&\n arguments[i].indexOf(\"using indexedDB for stdlib modules cache\") == -1) {\n PrintConsole(arguments[i]);\n }\n }\n if (original.apply) {\n // Do this for normal browsers\n original.apply(console, arguments);\n }\n else {\n // Do this for IE\n var message = Array.prototype.slice.apply(arguments).join(' ');\n original(message);\n }\n };\n }\n var methods = ['log', 'warn', 'error'];\n for (var i = 0; i < methods.length; i++)\n intercept(methods[i]);\n }", "function takeOverConsole() {\n var console = window.console;\n if (!console) return;\n\n function intercept(method) {\n var original = console[method];\n console[method] = function() {\n for (i = 0; i < arguments.length; i++) {\n if (typeof arguments[i] == \"string\" && \n arguments[i].indexOf(\"Error 404 means that Python module\") == -1 &&\n arguments[i].indexOf(\"using indexedDB for stdlib modules cache\") == -1) {\n PrintConsole(arguments[i]);\n }\n }\n if (original.apply) {\n // Do this for normal browsers\n original.apply(console, arguments);\n }\n else {\n // Do this for IE\n var message = Array.prototype.slice.apply(arguments).join(' ');\n original(message);\n }\n };\n }\n var methods = ['log', 'warn', 'error'];\n for (var i = 0; i < methods.length; i++)\n intercept(methods[i]);\n }", "function log(){// this hackery is required for IE8/9, where\n// the `console.log` function doesn't have 'apply'\nreturn'object'===(typeof console===\"undefined\"?\"undefined\":_typeof(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments);}", "function o(){var e;// This hackery is required for IE8/9, where\n// the `console.log` function doesn't have 'apply'\nreturn\"object\"===(\"undefined\"==typeof console?\"undefined\":n(console))&&console.log&&(e=console).log.apply(e,arguments)}", "function shutdownFirebug()\n{\n try\n {\n if (Firebug.isDetached())\n Firebug.chrome.close();\n }\n catch (exc)\n {\n window.dump(\"shutdownFirebug FAILS: \"+exc+\"\\n\");\n }\n\n Firebug.shutdown();\n}", "function showDebugInfo() {\n\t\t\tconsole.log();\n\t\t}", "function log(){// this hackery is required for IE8/9, where\n// the `console.log` function doesn't have 'apply'\nreturn'object'===(typeof console==='undefined'?'undefined':(0,_typeof3.default)(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments);}", "function hackConsole() {\n if (window && window.console) {\n for (var e = Config.behavior.console, n = 0; e.length; n++) {\n var r = e[n];\n var action = window.console[r];\n if (!window.console[r])\n return;\n (function (r, action) {\n window.console[r] = function () {\n var i = Array.prototype.slice.apply(arguments);\n var s = {\n type: \"console\",\n data: {\n level: r,\n message: JSON.stringify(i),\n }\n };\n handleBehavior(s);\n action && action.apply(null, i);\n };\n })(r, action);\n }\n }\n }", "function startup()\r\n{\r\n\tconsole.log(\"#include<stdio.h> \\n void main()\");\r\n}", "function takeOverConsole(){\n var console = window.console;\n if (!console) return;\n function intercept(method){\n var original = console[method]\n console[method] = function(){\n for (i = 0; i < arguments.length; i++) {\n if (arguments[i].indexOf(\"Error 404 means that Python module\") == -1) {\n PrintConsole(arguments[i]);\n }\n } \n if (original.apply){\n // Do this for normal browsers\n original.apply(console, arguments)\n }else{\n // Do this for IE\n var message = Array.prototype.slice.apply(arguments).join(' ')\n original(message)\n }\n }\n }\n var methods = ['log', 'warn', 'error']\n for (var i = 0; i < methods.length; i++)\n intercept(methods[i])\n }", "function console_log(msg) {\n if (window.console) {\n console.log(msg);\n }\n }", "function log() {\n try {\n window.console.log.apply(window.console, [].concat.apply([\"exp<%=idx%>:\"], arguments)), /chdebug/\n .test(location.href)\n } catch (a) {}\n }", "function caml_js_get_console () {\n var c = window.console?window.console:{};\n var m = [\"log\", \"debug\", \"info\", \"warn\", \"error\", \"assert\", \"dir\", \"dirxml\",\n \"trace\", \"group\", \"groupCollapsed\", \"groupEnd\", \"time\", \"timeEnd\"];\n function f () {}\n for (i = 0; i < m.length; i++) if (!c[m[i]]) c[m[i]]=f;\n return c;\n}", "function fblog(message)\n{\n\tif(console && typeof(console.log) == \"function\")\n\t\tconsole.log(message);\n}", "function devDebug(){\n\n}", "static dbg() {\n var str;\n if (!Util.debug) {\n return;\n }\n str = Util.toStrArgs('', arguments);\n Util.consoleLog(str);\n }", "function Console() {\n}", "function _showLogConsole() {\n\t\tif(_logging) {\n\t\t $('body').append( \"<ol id='console-box' reversed='reversed' />\");\n\t\t}\n\t}", "function showDebug() {\r\n window.top.debugWindow =\r\n window.open(\"\",\r\n \"Debug\",\r\n \"left=0,top=0,width=300,height=700,scrollbars=yes,\"\r\n +\"status=yes,resizable=yes\");\r\n window.top.debugWindow.opener = self;\r\n // open the document for writing\r\n window.top.debugWindow.document.open();\r\n window.top.debugWindow.document.write(\r\n \"<HTML><HEAD><TITLE>Debug Window</TITLE></HEAD><BODY><PRE>\\n\");\r\n}", "function debug(msg)\r\n\t{\r\n\t\tif (window.console && window.console.log) {\r\n\t\t\twindow.console.log('Debug message: ' + msg);\r\n\t\t} else {\r\n\t\t\talert('Debug message: ' + msg);\r\n\t\t}\r\n\t}", "static globalize() {\n if (!isBrowser) {\n throw \"Console globalization is not available.\";\n }\n window._console = console;\n window.console = Logger.logger;\n }", "function log(){ // this hackery is required for IE8/9, where\n// the `console.log` function doesn't have 'apply'\nreturn 'object' === typeof console && console.log && Function.prototype.apply.call(console.log,console,arguments);}", "function log(){ // this hackery is required for IE8/9, where\n\t// the `console.log` function doesn't have 'apply'\n\treturn 'object'===(typeof console===\"undefined\"?\"undefined\":_typeof3(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments);}", "function log(){ // this hackery is required for IE8/9, where\n\t// the `console.log` function doesn't have 'apply'\n\treturn 'object'===(typeof console===\"undefined\"?\"undefined\":_typeof2(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments);}", "function debug_print(message)\n{\n if (debug_output_target == 1)\n console.log(message);\n else\n alert(message);\n}", "function consoleTut(){\n // to debug and test\n console.log(\"string\");\n console.log(\"variable\", \"other variable\");\n // same, but easyer to see between all the console.logs\n console.info(\"yes yes\");\n // same, but it indicates an error, and shows line nr in code\n console.error(\"error message here\");\n}", "function traceForIE() {\r\n if (console.log) {\r\n if (console.log.apply) {\r\n console.log.apply(console, arguments);\r\n } else {\r\n // In old IE, native console methods themselves don't have apply().\r\n Function.prototype.apply.apply(console.log, [console, arguments]);\r\n }\r\n }\r\n if (console.trace) console.trace();\r\n }", "function log(){ // this hackery is required for IE8/9, where\n\t// the `console.log` function doesn't have 'apply'\n\treturn 'object'===(typeof console===\"undefined\"?\"undefined\":_typeof(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments);}", "function log(){// this hackery is required for IE8/9, where\n\t// the `console.log` function doesn't have 'apply'\n\treturn'object'===(typeof console==='undefined'?'undefined':_typeof(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments);}", "function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }", "function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }", "function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }", "function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }", "function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }", "function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }", "function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }", "function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }", "function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }", "function a() {\n console.log('hi') // console.log() is window specific\n // we are using the browser to log something to the browser\n}", "function debug_log(msg) {\n\n if (window['debug']) {\n\n console.log(msg);\n\n }\n\n}", "function runTest()\n{\n var prefOrigValue = FBTest.getPref(\"showXMLHttpRequests\");\n FBTest.setPref(\"showXMLHttpRequests\", true);\n\n FBTest.openNewTab(basePath + \"console/2328/issue2328.html\", (win) =>\n {\n FBTest.openFirebug(() =>\n {\n FBTest.enableConsolePanel(() =>\n {\n FBTest.waitForDisplayedElement(\"console\", null, (element) =>\n {\n // Verify error log in the console.\n var expectedResult = \"GET \" + basePath + \"console/2328/issue2328.php\";\n var spyFullTitle = element.getElementsByClassName(\"spyFullTitle\")[0];\n FBTest.compare(expectedResult, spyFullTitle.textContent, \"There must be a XHR log\");\n\n FBTest.setPref(\"showXMLHttpRequests\", prefOrigValue);\n FBTest.testDone();\n });\n\n // Run test implemented on the page.\n FBTest.click(win.document.getElementById(\"testButton\"));\n });\n });\n });\n}", "function safelog(str){return typeof(console)!=='undefined' && console.log && console.log(str);}", "Env(id){debugger;}", "function log(msg, useInBrowserLog){\n if(console) console.log(msg);\n}", "function runTest()\n{\n // Step 1.\n FBTest.openNewTab(basePath + \"console/2694/issue2694.html\", function(win)\n {\n FBTest.openFirebug(function()\n {\n FBTest.enableConsolePanel(function()\n {\n executeSetOfCommands(40, function()\n {\n FBTest.ok(isScrolledToBottom(), \"The Console panel must be scrolled to the bottom.\");\n FBTest.testDone();\n });\n });\n });\n });\n}", "function buildConsoleObject(){\t\n\tif (!window.console ){\n\t var names = [\"log\", \"debug\", \"info\", \"warn\", \"error\", \"assert\", \"dir\", \"dirxml\", \"group\", \"groupEnd\", \"time\", \"timeEnd\", \"count\", \"trace\", \"profile\", \"profileEnd\"];\n\t window.console = {};\n\t for (var i = 0; i < names.length; ++i){\n\t\t\twindow.console[names[i]] = function() {};\n\t\t}\n\t\tnames = null;\n\t}else if( Browser.Engine.webkit ){\n\t var names = [ \"debug\", \"error\", \"assert\", \"dir\", \"dirxml\", \"group\", \"groupEnd\", \"time\", \"timeEnd\", \"count\", \"trace\", \"profile\", \"profileEnd\"];\n\t for (var i = 0; i < names.length; ++i){\n\t\t\twindow.console[names[i]] = function() {};\n\t\t}\n\t\tnames = null;\t\t\n\t}\n}", "function createConsoleWin(){\n // Create new window\n consoleWin = new BrowserWindow({ width: 550, height: 330, frame: false});\n consoleWin.title = \"Console\";\n // load html into window\n consoleWin.loadURL(url.format({\n pathname: path.join(__dirname, 'consoleWindow.html'),\n protocol:'file:',\n slashes: true\n }));\n // garbage collection handle\n consoleWin.on('close', function(){\n consoleWin = null;\n });\n}", "function clearconsole() \n { \n console.log(window.console); \n if(window.console ) \n { \n console.clear(); \n } \n }", "function Show_In_Console(){\n console.log(2+2);\n console.log(2 > 2);\n}", "function debug(message) {\n if ($.fn.track.defaults.debug && typeof console !== 'undefined' && typeof console.debug !== 'undefined') {\n console.debug(message);\n }\n }", "function je(){return G(\"debugger\"),H(),pt.createDebuggerStatement()}", "function log(x)\r\n{\r\n if (typeof(window.console) !== 'undefined') {\r\n window.console.log(x);\r\n }\r\n}", "function _debug( msg )\n {\n if( window.console && window.console.log ) \n console.log( \"[debug] \" + msg ); \n }", "openConsoleWindow() {\n EnigmailWindows.openWin(\n \"enigmail:console\",\n \"chrome://openpgp/content/ui/enigmailConsole.xhtml\",\n \"resizable,centerscreen\"\n );\n }", "function debug() {\r\n\tif (console) {\r\n\t\tconsole.log(this, arguments);\r\n\t}\r\n}", "function DebugDump(msg)\n{\n var ConsoleService = Components.classes[\"@mozilla.org/consoleservice;1\"].\n getService(Components.interfaces.nsIConsoleService);\n\n ConsoleService.logStringMessage(msg);\n}", "function printStackTrace(text) {\n if(unsafeWindow.console && GM_getValue ( myacc() + \"_promptLogInFirebug\", \"0\" ) == 1){\n var GM_log = unsafeWindow.console.log;\n\t}\n\telse {\n\t var GM_log = window.console.log;\n\t};\n\t//logDebugMessages = GM_getValue ( currentServer() + \"_debugMode\", \"0\" ) == \"1\" ? true : false;\n\tlogDebugMessages = true;\n\tif (logDebugMessages) {\n\t\tvar callstack = [];\n\t\tvar isCallstackPopulated = false;\n\t\ttry {\n\t\t\ti.dont.exist+=0; //doesn't exist- that's the point\n\t\t} \n\t\tcatch(e) {\n\t\t\tif (e.stack) { //Firefox\n\t\t\t\tvar lines = e.stack.split(\"\\n\");\n\t\t\t\tfor (var i=0, len=lines.length; i<len; i++) {\n\t\t\t\t\tif (lines[i].match(/^\\s*[A-Za-z0-9\\-_\\$]+\\(/)) {\n\t\t\t\t\t\tcallstack.push(lines[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Remove call to printStackTrace()\n\t\t\t\tcallstack.shift();\n\t\t\t\tisCallstackPopulated = true;\n\t\t\t}\n\t\t\telse if (window.opera && e.message) { //Opera\n\t\t\t\tvar lines = e.message.split(\"\\n\");\n\t\t\t\tfor (var i=0, len=lines.length; i<len; i++) {\n\t\t\t\t\tif (lines[i].match(/^\\s*[A-Za-z0-9\\-_\\$]+\\(/)) {\n\t\t\t\t\t\tvar entry = lines[i];\n\t\t\t\t\t\t//Append next line also since it has the file info\n\t\t\t\t\t\tif (lines[i+1]) {\n\t\t\t\t\t\t\tentry += \" at \" + lines[i+1];\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallstack.push(entry);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Remove call to printStackTrace()\n\t\t\t\tcallstack.shift();\n\t\t\t\tisCallstackPopulated = true;\n\t\t\t}\n\t\t}\n\t\tif (!isCallstackPopulated) { //IE and Safari\n\t\t\tvar currentFunction = arguments.callee.caller;\n\t\t\t\twhile (currentFunction) {\n\t\t\t\t\tvar fn = currentFunction.toString();\n\t\t\t\t\tvar fname = fn.substring(fn.indexOf(\"function\") + 8, fn.indexOf(\"(\")) || \"anonymous\";\n\t\t\t\t\tcallstack.push(fname);\n\t\t\t\t\tcurrentFunction = currentFunction.caller;\n\t\t\t\t}\n\t\t}\n\t\tGM_log ( \"STACK TRACE:: \\n\" + callstack.join(\"\\n\") );\n\t\tif ( text ) {\n\t\t\tGM_log ( text );\n\t\t}\n\t}\n}", "function JavaDebug() {\r\n}", "function console_log(msg) {\n\t\tconsole.log(msg);\n\t\tvar c = document.getElementById('console_log');\n\t\tc.innerHTML = msg + \"<br>\" + c.innerHTML;\n\t}", "function c_log(message){\n\t\tif (console.log) {\n\t\t\tconsole.log(message);\n\t\t}else{\n\t\t\talert(message);\n\t\t}\n\t}", "function debugToErrorConsole(/*anything*/ obj) {\n var consoleService = Components.classes[\"@mozilla.org/consoleservice;1\"]\n .getService(Components.interfaces.nsIConsoleService);\n consoleService.logStringMessage(toDebugString(obj)); \n}", "function sayHelloInTheConsole() {\n console.log(\"Hey there!\\nThanks for checking my console.\\n\");\n }", "function MZConsole(){}", "function toggleConsole(){\r\n\tif(showConsole){\r\n\t\tshowConsole = false;\r\n\t}else{\r\n\t\tshowConsole = true;\r\n\t}\r\n}", "function Browsertools(debug) {\r\n this.debug = typeof debug === \"undefined\" ? false : debug;\r\n}", "function logf(msg) {\n if (typeof window.console != 'undefined' && typeof window.console.log == 'function') {\n console.log(msg);\n }\n}", "directlyAccessDOMAndClearConsoleDangerously() {\n let domConsole = document.getElementById('console');\n domConsole.innerHTML = ''\n }", "function initConsole() {\n // create temporary element\n var htmlFragment = document.createDocumentFragment(),\n temp = document.createElement('div');\n temp.innerHTML = \"<div id=\\\"debugConsoleDiv\\\" class=\\\"debugConsoleDiv\\\">\"+\n \"<p style=\\\"color: white;\\\" id=\\\"debugConsole\\\"></p>\"+\n \"</div>\";\n while (temp.firstChild)\n htmlFragment.appendChild(temp.firstChild);\n //insert htmlFragment into <body>\n document.body.insertBefore(htmlFragment, document.body.childNodes[0]);\n createConsoleBoxStyle();\n}", "function debug () {\n if (Retsly.debug) console.log.apply(console, arguments);\n}", "function logToConsoleAndStdOut(msg) {\n console.log(msg);\n window.webContents.send(\"debug-message\", msg);\n}", "function replaceConsole() {\n\n if (!window.console) {\n window.console = {};\n }\n \n ['info', 'log', 'warn', 'error'].forEach(function(f) {\n var oldFunc = window.console[f];\n \n window.console[f] = function() {\n\t\t\t\n var args = Array.prototype.slice.call(arguments);\n /* Write to local console first */\n oldFunc && oldFunc.apply(window.console, args);\n \n sendToDebugService('Console.messageAdded', { \n type: f.toUpperCase(),\n message: args.toString()\n });\n };\n });\n }", "function ConsoleCtl() {\n var x = document.getElementById(\"console\");\n if (x.style.display === \"none\") {\n x.style.display = \"block\";\n console_visible=true;\n document.getElementById(\"console_input\").focus(); \n } else {\n x.style.display = \"none\";\n console_visible=false;\n window.focus();\n }\n}", "function log(message){\r\n\ttry{\r\n\tif(window.console)\r\n\t\tconsole.log(message);\r\n\t}catch(e){}\r\n}", "function consolePolyfill () {\n // Use window console (if debug is enabled and the console object exists)\n if (consts.debug && (console || objectPath.has(window, 'console'))) {\n return console || window.console\n\n // Give an object with correct properties but with function that does nothing\n } else {\n return {\n clear: noop,\n count: noop,\n debug: noop,\n error: noop,\n group: noop,\n info: noop,\n log: noop,\n table: noop,\n time: noop,\n timeEnd: noop,\n trace: noop,\n warn: noop\n }\n }\n}", "function dlog(text) {\n if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {\n console.log(\"#tui: \" + text);\n }\n}", "function dbg(x) {\n debugger;\n}", "function log(msg) {\n if (window.console) {\n //console.log(msg);\n }\n}", "function wsLib_console(whichMessage, whichType) {\n if (!window.console) {\n window.console = {};\n }\n if (!window.console.log) {\n window.console.log = function () { };\n }\n if (!window.console.error) {\n window.console.error = function () { };\n }\n \n \n \n if(whichType === undefined) {\n whichType = 'log';\n }\n \n if(console !== undefined) {\n if(whichType == 'error') {\n console.error(whichMessage);\n }\n else {\n console.log(whichMessage);\n }\n }\n}", "function PrintValueToConsole() {\n\n }", "_console() {\n\t\tlet _level = window.Array.prototype.shift.call(arguments);\n\t\tif(!_level || !_level.length || ![\"debug\", \"error\", \"info\", \"log\", \"trace\", \"warn\"].includes(_level) || !window.console.hasOwnProperty(_level)) {\n\t\t\treturn;\n\t\t}\n\n\t\twindow.Array.prototype.unshift.call(arguments, `[${this._name}][${_level}]`);\n\t\treturn window.console[_level].apply(null, arguments);\n\t}", "function consolePrintln(string) {\n\tYUI().use('node', function(Y) {\n\t\tY.one('#console').append(string +'<br style=\"margin-bottom:6px;\"/>');\n\t\tvar display = document.getElementById('console');\n\t\tdisplay.scrollTop = display.scrollHeight;\n\t});\n}", "function exec( cmd )\n{\n return browser.devtools.inspectedWindow.eval( cmd );\n}" ]
[ "0.73394054", "0.71571153", "0.71571153", "0.7101851", "0.7101851", "0.67744005", "0.6665635", "0.6665635", "0.6665635", "0.6656699", "0.65939444", "0.6421116", "0.62636", "0.6251301", "0.62359285", "0.62083554", "0.62083554", "0.6190509", "0.6182183", "0.6164408", "0.6164408", "0.6161974", "0.6089509", "0.6084817", "0.6060472", "0.6028732", "0.6025259", "0.6017269", "0.60103124", "0.6002341", "0.59993833", "0.5996999", "0.5984659", "0.5961047", "0.5959835", "0.5919948", "0.59195095", "0.5909544", "0.58940893", "0.5892369", "0.58499223", "0.58354694", "0.58350605", "0.5827858", "0.58249205", "0.5816417", "0.5816308", "0.58150524", "0.5813727", "0.5813727", "0.5813727", "0.5813727", "0.5813727", "0.5813727", "0.5813727", "0.5813727", "0.5813727", "0.57993776", "0.5790757", "0.57861155", "0.5780934", "0.5778698", "0.57684994", "0.57657903", "0.5749991", "0.5746803", "0.5745792", "0.57428974", "0.57320136", "0.5723445", "0.5723421", "0.5721102", "0.57193005", "0.57168895", "0.5708463", "0.570843", "0.57075536", "0.5703668", "0.5703099", "0.56950986", "0.56938815", "0.56935006", "0.56896365", "0.5688985", "0.56888294", "0.568787", "0.5687052", "0.5678212", "0.5646866", "0.56435835", "0.5639211", "0.5637709", "0.56371856", "0.56364775", "0.5633548", "0.56315666", "0.56158066", "0.5609603", "0.56014085", "0.5598702", "0.55918574" ]
0.0
-1
Return an associative array with the GET parameters of the supplied URL, or the URL of the current page if no parameter is passed.
function getUrlParams(url) { var params = {}; if (typeof url == "undefined") { url = window.location.href; } var parts = url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) { params[key] = decodeURIComponent(value); }); return params; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_url_params() {\n var url_params = new URLSearchParams(window.location.search);\n\n return url_params;\n}", "function getURLParams()\n{\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n}", "function get_url_params() {\n var $_GET = {};\n\n document.location.search.replace(/\\??(?:([^=]+)=([^&]*)&?)/g, function () {\n function decode(s) {\n return decodeURIComponent(s.split(\"+\").join(\" \"));\n }\n\n $_GET[decode(arguments[1])] = decode(arguments[2]);\n });\n return $_GET;\n}", "function getUrlParams() \n{\n var paramMap = {};\n\n if (location.search.length === 0) {\n return paramMap;\n }\n\n var parts = location.search.substring(1).split(\"&\");\n\n for (var i = 0; i < parts.length; i ++) {\n var component = parts[i].split(\"=\");\n paramMap [decodeURIComponent(component[0])] = decodeURIComponent(component[1]);\n }\n\n return paramMap;\n}", "function getURLParams() {\n try {\n var search = location.search.substring(1);\n return search ? JSON.parse('{\"' + search.replace(/&/g, '\",\"').replace(/=/g, '\":\"') + '\"}',\n function(key, value) {\n return key === \"\" ? value : decodeURIComponent(value);\n }) : {};\n } catch (_) {\n return {};\n }\n}", "function getParams() {\n return qs.parse(window.location.search);\n}", "function getURLParameters() {\n var params = {};\n if (location.search) {\n var parts = location.search.substring(1).split(\"&\");\n for (var i = 0; i < parts.length; i++) {\n var pair = parts[i].split(\"=\");\n if (!pair[0]) {\n continue;\n }\n params[pair[0]] = pair[1] || \"\";\n }\n }\n return params;\n}", "function getURLParameters () {\n let paramstrings = window.location.search.substr(1).split('&');\n\n if (paramstrings == '') {\n return {};\n }\n\n let params = {};\n\n for (let i = 0; i < paramstrings.length; ++i) {\n let param = paramstrings[i].split('=', 2);\n if (param.length == 1)\n params[param[0]] = '';\n else\n params[param[0]] = decodeURIComponent(param[1].replace(/\\+/g, ' '));\n }\n\n return params;\n}", "function parseGET(url)\n{ \n if(!url || url == '') url = document.location.search;\n if(url.indexOf('?') < 0) return Array();\n \n url = url.split('?');\n url = url[1];\n \n var GET = [];\n var params = [];\n var keyval = [];\n \n if(url.indexOf('#')!=-1) \n { \n anchor = url.substr(url.indexOf('#')+1);\n url = url.substr(0,url.indexOf('#'));\n }\n \n if(url.indexOf('&') > -1) params = url.split('&');\n else params[0] = url;\n \n for (i=0; i<params.length; i++)\n {\n if(params[i].indexOf('=') > -1) keyval = params[i].split('=');\n else { keyval[0] = params[i]; keyval[1] = true; }\n GET[keyval[0]]=keyval[1];\n }\n \n return (GET);\n}", "function getAllUrlParams(url) {\n if (url === void 0) { url = window.location.href; }\n if (url.indexOf(\"?\") > -1) {\n // if query string exists\n var queryString = Strings.GetTagValue(url, '?').value;\n var args = TypeScript.URLPatterns.parseQueryString(queryString);\n return new Dictionary(args);\n }\n else {\n return new Dictionary({});\n }\n}", "function getURLParameters() {\n 'use strict';\n if (debugMode) {\n console.groupCollapsed(\"URL parameters\");\n }\n\n var parametersArray = {};\n\n // A bit hackish.\n if (location.href.indexOf(\"#\") > -1) {\n location.assign(location.href.replace(/\\/?#\\//, \"/\"));\n }\n\n location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {\n var setting = value.split(\"#\")[0]; // Hack\n parametersArray[key] = setting;\n });\n\n var parameters = JSON.stringify(parametersArray);\n GM_setValue(\"current_parameters\", parameters);\n\n if (debugMode) {\n console.dir(parametersArray);\n console.groupEnd(\"URL parameters\");\n }\n}", "function getUrlParams(){\r\n var url = decodeURIComponent(location.href);\r\n var query = url.split('?')[1];\r\n var params = {};\r\n if (query !== ''){\r\n var arr = query.split('&');\r\n for (var i of arr) {\r\n var entry = i.split('=');\r\n var key = entry[0];\r\n var value = entry[1];\r\n params[key] = value;\r\n }\r\n }\r\n return params;\r\n}", "function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\n}", "function getURLParams() {\n var vars = {};\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {\n vars[key] = value;\n });\n return vars;\n}", "function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\n }", "function getRequest(){\n\tvar params = window.location.search.replace('?','').split('&').reduce(\n\t\tfunction(prev, curr){\n\t\t\tvar temp = curr.split('=');\n\t\t\tprev[decodeURIComponent(temp[0])] = decodeURIComponent(temp[1]);\n\t\t\treturn prev;\n\t\t},{}\n\t);\n\treturn params;\n}", "function parseCurrentUrlParams () {\n\t\tme.urlParams = me.paramsToObject(window.location.search.substr(1));\n\t}", "function getParams(url) {\r\n var i, item, len, key_value_section, params, params_list = {};\r\n\r\n if (typeof url === 'string') {\r\n params = url.match(/\\?(.*)/)[0] || '';\r\n } else {\r\n params = root.location.search;\r\n }\r\n\r\n if (params.substr(0, 1) === '?') {\r\n params = params.substr(1);\r\n }\r\n\r\n params = params.split('&');\r\n len = params.length;\r\n\r\n for (i = 0; i < len; ++i) {\r\n key_value_section = params[i];\r\n if (key_value_section.length > 0) {\r\n item = key_value_section.split('=');\r\n params_list[item[0]] = item[1];\r\n }\r\n }\r\n return params_list;\r\n }", "function getUrlParams() {\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for (var i = 0; i < hashes.length; i++) {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n }", "function xGetURLArguments()\r\n{\r\n var idx = location.href.indexOf('?');\r\n var params = new Array();\r\n if (idx != -1) {\r\n var pairs = location.href.substring(idx+1, location.href.length).split('&');\r\n for (var i=0; i<pairs.length; i++) {\r\n nameVal = pairs[i].split('=');\r\n params[i] = nameVal[1];\r\n params[nameVal[0]] = nameVal[1];\r\n }\r\n }\r\n return params;\r\n}", "function getSearchParameters() {\r\n var prmstr = window.location.search.substr(1);\r\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\r\n }", "function getURL() {\n var query_string = {};\n var query = window.location.search.substring(1);\n var vars = query.split(\"&\");\n for (var i=0;i<vars.length;i++) {\n var pair = vars[i].split(\"=\");\n // If first entry with this name\n if (typeof query_string[pair[0]] === \"undefined\") {\n query_string[pair[0]] = decodeURIComponent(pair[1]);\n // If second entry with this name\n } else if (typeof query_string[pair[0]] === \"string\") {\n var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];\n query_string[pair[0]] = arr;\n // If third or later entry with this name\n } else {\n query_string[pair[0]].push(decodeURIComponent(pair[1]));\n }\n }\n return query_string;\n}", "function getUrlParameters() {\n\tvar vars = [], hash;\n\tvar hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n\tfor (var i = 0; i < hashes.length; i++) {\n\t\thash = hashes[i].split('=');\n\t\tvars.push(hash[0]);\n\t\tvars[hash[0]] = hash[1];\n\t}\n\treturn vars;\n}", "function getParametersFromUrl() {\n let queryDict = {}\n location.search.substr(1).split(\"&\").forEach(function(item) {queryDict[item.split(\"=\")[0]] = item.split(\"=\")[1]})\n return queryDict\n}", "function getAllUrlParams(url = window.location.href) {\n let queryString = url ? url.split('?')[1] : window.location.search.slice(1);\n let obj = {};\n if (queryString) {\n queryString = queryString.split('#')[0];\n let arr = queryString.split('&');\n\n for (let i = 0; i < arr.length; i++) {\n let a = arr[i].split('=');\n\n let paramNum = undefined;\n let paramName = a[0].replace(/\\[\\d*\\]/, function (v) {\n paramNum = v.slice(1, -1);\n return '';\n });\n let paramValue = typeof (a[1]) === 'undefined' ? true : a[1];\n paramName = paramName.toLowerCase();\n paramValue = paramValue.toLowerCase();\n\n if (obj[paramName]) {\n if (typeof obj[paramName] === 'string') {\n obj[paramName] = [obj[paramName]];\n }\n if (typeof paramNum === 'undefined') {\n obj[paramName].push(paramValue);\n }\n else {\n obj[paramName][paramNum] = paramValue;\n }\n }\n else {\n obj[paramName] = paramValue;\n }\n }\n }\n return obj;\n}", "function getParams()\n{\n var idx = document.URL.indexOf('?');\n var params = [];\n if (idx != -1) {\n var pairs = document.URL.substring(idx+1, document.URL.length).split('&');\n for (var i=0; i<pairs.length; i++)\n {\n nameVal = pairs[i].split('=');\n params[nameVal[0]] = nameVal[1];\n }\n }\n return params;\n}", "function getParams() {\n var res = {}\n var params = location.search.substr(1).split('&')\n\n for (var value; value = params.pop();) {\n var tmp = value.split('=')\n res[tmp[0]] = decodeURIComponent(tmp[1])\n }\n\n return res\n}", "function getUrlParams()\n {\n var decodedUri = decodeURIComponent(window.location.href);\n var params = [], hash;\n var hashes = decodedUri.slice(decodedUri.indexOf('?') + 1).split('&');\n\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n if (hash[1]) {\n params.push(hash[1].replace('+', ' '));\n }\n }\n return params;\n }", "function GetUrlParams() { \n var e, \n d = function (s) { return decodeURIComponent(s.replace(/\\+/g, \" \")); }, \n q = window.location.search.substring(1), \n r = /([^&=]+)=?([^&]*)/g; \n \n while (e = r.exec(q)) \n urlParams[d(e[1])] = d(e[2]); \n}", "function getURLParameters()\n {\n var sURL = window.document.URL.toString();\n if (sURL.indexOf(\"?\") > 0)\n {\n var arrParams = sURL.split(\"?\");\n var arrURLParams = arrParams[1].split(\"&\");\n\n var i = 0;\n for (i = 0; i<arrURLParams.length; i++)\n {\n var sParam = arrURLParams[i].split(\"=\");\n key = unescape(sParam[0]);\n if (sParam[1] != \"\")\n value = unescape(sParam[1]);\n else\n value = null;\n\n if(argv[key] == null){\n argv[key] = value;\n }\n else if(typeof argv[key] === 'string'){\n argv[key] = [ argv[key], value ];\n }\n else {\n argv[key].push(value);\n }\n }\n }\n }", "function getURL() {\r\n let loc = document.location.href;\r\n\r\n if (loc.indexOf('?') > 0) {\r\n let getString = loc.split('?')[1];\r\n let GET = getString.split('&');\r\n var get = {};\r\n for (var i = 0, l = GET.length; i < l; i++) {\r\n var tmp = GET[i].split('=');\r\n get[tmp[0]] = unescape(decodeURI(tmp[1]));\r\n }\r\n return get;\r\n }\r\n}", "function getCurrentPageArgs()\n{\n\tvar oRet;\n\tvar arrPages;\n\tvar oCurrentPage;\n\tvar oOptions;\n\n\t//\t...\n\toRet = null;\n\n\t//\n\t//\tget stack array of current pages\n\t//\n\tarrPages = getCurrentPages();\n\tif ( wlib.isArray( arrPages ) && arrPages.length > 0 )\n\t{\n\t\t//\n\t\t//\tget the object of current page\n\t\t//\n\t\toCurrentPage = arrPages[ arrPages.length - 1 ];\n\t\tif ( wlib.isObjectWithKeys(oCurrentPage, [ 'options' ] ) )\n\t\t{\n\t\t\t//\tall arguments with url\n\t\t\toOptions = oCurrentPage.options;\n\t\t\tif ( wlib.isObject( oOptions ) )\n\t\t\t{\n\t\t\t\t//\tyes, there are arguments with the url\n\t\t\t\toRet = oOptions;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn oRet;\n}", "function getSearchParameters() {\n var prmstr = decodeURIComponent(window.location.search.slice(1));\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\n}", "function getURLArgs() {\n var query_string = {};\n let query = window.location.search.substring(1);\n let vars = query.split(\"&\");\n \n for (let i=0;i<vars.length;i++) {\n let pair = vars[i].split(\"=\");\n //if is the first entry with that name\n if (typeof query_string[pair[0]] === \"undefined\") {\n query_string[pair[0]] = decodeURIComponent(pair[1]);\n //if is the second entry with that name\n } else if (typeof query_string[pair[0]] === \"string\") {\n let arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];\n query_string[pair[0]] = arr;\n //if is the third or more entry with that name\n } else {\n query_string[pair[0]].push(decodeURIComponent(pair[1]));\n }\n } \n return query_string;\n }", "function getUrlParams() {\n\tvar vars = {};\n\tvar parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,\n\t\t\tfunction(m, key, value) {\n\t\t\t\tvars[key] = value;\n\t\t\t});\n\treturn vars;\n}", "function getUrlParams() {\n var params = {};\n var location = redirect_1.getLocation();\n if (!location) {\n return params;\n }\n var hashes = location.search.slice(location.search.indexOf('?') + 1).split('&');\n return hashes.reduce(function (acc, hash) {\n var _a;\n var _b = hash.split('='), key = _b[0], val = _b[1];\n return __assign(__assign({}, acc), (_a = {}, _a[decodeURIComponent(key)] = decodeURIComponent(val), _a));\n }, params);\n}", "function getUrlArgs() {\n\tvar qs = (location.search.length > 0 ? location.search.substring(1) : \"\")\n\tvar args = {};\n\tvar items = qs.split(\"&\");\n\tvar item = null;\n\tname = null;\n\tvalue = null;\n\tfor (var i = 0; i < items.length; i++) {\n\t\titem = items[i].split(\"=\");\n\t\tname = decodeURIComponent(item[0]);\n\t\tvalue = decodeURIComponent(item[1]);\n\t\targs[name] = value;\n\t}\n\treturn args;\n}", "function getURLParams() {\n\tvar query = window.location.search.substring(1);\n\tvar vars = query.split(\"&\");\n\tvar query_string = {};\n\tfor (var i = 0; i < vars.length; i++) {\n\t\tvar pair = vars[i].split(\"=\");\n\t\tvar key = decodeURIComponent(pair[0]);\n\t\tvar value = decodeURIComponent(pair[1]);\n\t\t// If first entry with this name\n\t\tif (typeof query_string[key] === \"undefined\") {\n\t\t\tquery_string[key] = decodeURIComponent(value);\n\t\t\t// If second entry with this name\n\t\t} \n\t\telse if (typeof query_string[key] === \"string\") {\n\t\t\tvar arr = [query_string[key], decodeURIComponent(value)];\n\t\t\tquery_string[key] = arr;\n\t\t\t// If third or later entry with this name\n\t\t} \n\t\telse {\n\t\t\tquery_string[key].push(decodeURIComponent(value));\n\t\t}\n\t}\n\treturn query_string;\n}", "function getUrlParams() {\n var params = {};\n var location = redirect_1.getLocation();\n\n if (!location) {\n return params;\n }\n\n var hashes = location.search.slice(location.search.indexOf('?') + 1).split('&');\n return hashes.reduce(function (acc, hash) {\n var _a;\n\n var _b = hash.split('='),\n key = _b[0],\n val = _b[1];\n\n return __assign({}, acc, (_a = {}, _a[decodeURIComponent(key)] = decodeURIComponent(val), _a));\n }, params);\n}", "function getQueryString() {\n return window.location.search\n .substr(1)\n .split('&')\n .map(item => item.split('='))\n .reduce((acc, curr) => {\n acc[curr[0]] = curr[1];\n return acc;\n }, {});\n}", "function $_GET(param) {\r\n\tvar vars = {};\r\n\twindow.location.href.replace(location.hash, \"\").replace(\r\n\t\t/[?]+([^=&]+)=?([^&]*)?/gi, // regexp\r\n\t\tfunction (m, key, value) {\r\n\t\t\t// callback\r\n\t\t\tvars[key] = value !== undefined ? value : \"\";\r\n\t\t}\r\n\t);\r\n\r\n\tif (param) {\r\n\t\treturn vars[param] ? vars[param] : null;\r\n\t}\r\n\treturn vars;\r\n}", "function getURLParams (req) {\n\tvar urlParts = url.parse(req.url, true);\n\treturn urlParts.query;\n}", "function $_GET(param) {\n var vars = {};\n window.location.href.replace( location.hash, '' ).replace( \n /[?&]+([^=&]+)=?([^&]*)?/gi, // regexp\n function( m, key, value ) { // callback\n vars[key] = value !== undefined ? value : '';\n }\n );\n\n if ( param ) {\n return vars[param] ? vars[param] : null; \n }\n return vars;\n}", "function getCurrentPageUrlWithArgs()\n{\n\tvar sRet;\n\tvar sUrl;\n\tvar oOptions;\n\tvar sKey;\n\tvar sValue;\n\n\t//\t...\n\tsRet\t\t= '';\n\n\t//\t...\n\tsUrl\t\t= getCurrentPageUrl();\n\toOptions\t= getCurrentPageArgs();\n\n\tif ( wlib.getStrLen( sUrl ) > 0 )\n\t{\n\t\t//\t...\n\t\tsRet\t= sUrl;\n\n\t\tif ( wlib.isObject( oOptions ) )\n\t\t{\n\t\t\t//\tyes, there are arguments with the url\n\t\t\t//\tnow we append them to the end of url\n\t\t\tsRet += '?';\n\n\t\t\tfor ( sKey in oOptions )\n\t\t\t{\n\t\t\t\tsValue\t= new String( oOptions[ sKey ] );\n\t\t\t\tsRet\t+= ( sKey + '=' + sValue + '&' );\n\t\t\t}\n\n\t\t\tsRet = sRet.substring( 0, sRet.length - 1 );\n\t\t}\n\t}\n\n\treturn sRet\n}", "function getParams(url, param) { \n var valueArray = new Array();\n urlArray = url.split(\"?\")\n if (urlArray.length > 1) {\n var queryString = urlArray[1]; \n var hash = queryString.lastIndexOf('#');\n if (hash >= 0) // remove boomark reference\n queryString = queryString.substring(0, hash);\n var qsArray = queryString.split(\"&\");\n for (var i = 0 ; i < qsArray.length; i++) {\n attrValue = qsArray[i];\n avArray = attrValue.split(\"=\");\n if (avArray[0].toLowerCase() == param.toLowerCase()) { \n valueArray[valueArray.length] = avArray[1];\n } \n }\n }\n return valueArray;\n}", "getURLParameters() {\n var hashParams = {};\n var e, r = /([^&;=]+)=?([^&;]*)/g,\n q = window.location.hash.substring(1);\n e = r.exec(q)\n while (e) {\n hashParams[e[1]] = decodeURIComponent(e[2]);\n e = r.exec(q);\n }\n return hashParams;\n }", "function getAllUrlParams(url) {\n var queryString = url ? url.split('?')[1] : window.location.search.slice(1);\n var obj = {};\n if (queryString) {\n queryString = queryString.split('#')[0];\n var arr = queryString.split('&');\n\n for (var i = 0; i < arr.length; i++) {\n var a = arr[i].split('=');\n var paramNum = undefined;\n var paramName = a[0].replace(/\\[\\d*\\]/, function (v) {\n paramNum = v.slice(1, -1);\n return '';\n });\n var paramValue = typeof(a[1]) === 'undefined' ? true : a[1];\n if (obj[paramName]) {\n if (typeof obj[paramName] === 'string') {\n obj[paramName] = [obj[paramName]];\n }\n if (typeof paramNum === 'undefined') {\n obj[paramName].push(paramValue);\n } else {\n obj[paramName][paramNum] = paramValue;\n }\n }\n else {\n obj[paramName] = paramValue;\n }\n }\n }\n return obj;\n}", "function getUrlParams ()\n{\n let query = window.location.search.substring(1);\n let params = query.split ('&');\n\n let object = new Object ();\n for (let param of params)\n {\n let pair = param.split ('=');\n\n object[pair[0]] = pair[1];\n }\n\n return object;\n}", "function $_GET(param) {\n\tvar vars = {};\n\twindow.location.href.replace( location.hash, '' ).replace(\n\t\t/[?&]+([^=&]+)=?([^&]*)?/gi, // regexp\n\t\tfunction( m, key, value ) { // callback\n\t\t\tvars[key] = value !== undefined ? value : '';\n\t\t}\n\t);\n\n\tif ( param ) {\n\t\treturn vars[param] ? vars[param] : null;\n\t}\n\treturn vars;\n}", "function $_GET(param) {\n\tvar vars = {};\n\twindow.location.href.replace( location.hash, '' ).replace(\n\t\t/[?&]+([^=&]+)=?([^&]*)?/gi, // regexp\n\t\tfunction( m, key, value ) { // callback\n\t\t\tvars[key] = value !== undefined ? value : '';\n\t\t}\n\t);\n\n\tif ( param ) {\n\t\treturn vars[param] ? vars[param] : null;\n\t}\n\treturn vars;\n}", "getUrlParams() {\n\n //var my_url_var = window.location.href;\n let my_url_var = (window.location != window.parent.location) ?\n document.referrer :\n document.location.href;\n\n let params_list = my_url_var.split(\"?\");\n\n let final = {};\n\n if (params_list.length > 1) {\n\n let params_parsed = params_list[1].split(\"&\");\n\n for (let i = 0; i < params_parsed.length; i++) {\n let p_couple = params_parsed[i].split(\"=\");\n final[p_couple[0]] = p_couple[1];\n }\n }\n\n return final;\n }", "function ekGetSearchParams() {\n var result = {};\n var searchParams = window.location.href.split('?');\n if (searchParams && searchParams.length > 1) {\n var vals = searchParams[1].split('&');\n for (var i = 0; i < vals.length; i++) {\n var next = vals[i].split('=');\n var key = next[0];\n var val = decodeURIComponent(next[1].replace(/\\+/g,' '));\n result[key] = val;\n }\n }\n return result;\n }", "function get_all_url_params(exclude_params) {\n var params = {};\n\n if (location.search) {\n var parts = location.search.substring(1).split('&');\n\n for (var i = 0; i < parts.length; i++) {\n var nv = parts[i].split('=');\n if (!nv[0] || exclude_params.includes(nv[0])) continue;\n params[nv[0]] = nv[1] || true;\n }\n }\n\n return params;\n }", "function getPageParameters() {\r\n var str = window.location.search.substr(1);\r\n var params = {};\r\n if (str) {\r\n var items = str.split(\"&\");\r\n for (var idItem = 0; idItem < items.length; idItem++) {\r\n var tmp = items[idItem].split(\"=\");\r\n params[tmp[0]] = decodeURIComponent(tmp[1]);\r\n }\r\n }\r\n return params;\r\n}", "function $_GET(param) {\n\t\tvar vars = {};\n\t\twindow.location.href.replace(location.hash, '').replace(\n\t\t\t/[?&]+([^=&]+)=?([^&]*)?/gi, // regexp\n\t\t\tfunction (m, key, value) { // callback\n\t\t\t\tvars[key] = value !== undefined ? value : '';\n\t\t\t}\n\t\t);\n\n\t\tif (param) {\n\t\t\treturn vars[param] ? vars[param] : null;\n\t\t}\n\t\treturn vars;\n\t}", "function obtainGETparameters() {\n\tvar oGetParameters = new Array();\n\n\tvar sLocation = location.search.split(\"?\");\t\n\tif(sLocation.length > 1) {\n\t\tvar sParameterList =sLocation[1].split(\"&\"); \n\n\t\tfor(var i=0; i < sParameterList.length; i++) { \n\t\t\tsParameterList[i] = sParameterList[i].split(\"+\").join(\" \");\n\t\t\tvar aValues = sParameterList[i].split(\"=\");\n\t\t\tvar sId = aValues[0];\n\t\t\tvar sValue = aValues[1];\n\t\t\toGetParameters[sId]=sValue;\n\t\t}\t\t\t\t\n\t}\n\treturn oGetParameters;\n}", "function getQueryParameters() {\n var e_1, _a;\n var queryParameters = {};\n if (window.location.search !== '') {\n var queryParametersString = window.location.search.substr(1); // remove question mark\n var params = queryParametersString.split('&');\n try {\n for (var params_1 = __values(params), params_1_1 = params_1.next(); !params_1_1.done; params_1_1 = params_1.next()) {\n var pair = params_1_1.value;\n if (pair === '') {\n continue;\n }\n var keyValue = pair.split('=');\n var key = keyValue[0];\n var value = keyValue[1] ? keyValue[1] : '';\n try {\n key = decodeURIComponent(key);\n if (value !== '') {\n value = decodeURIComponent(value);\n }\n }\n catch (error) {\n // skip malformed URI sequence\n continue;\n }\n var existedValue = queryParameters[key];\n if (existedValue) {\n if (existedValue instanceof Array) {\n existedValue.push(value);\n }\n else {\n // existed value is string\n queryParameters[key] = [existedValue, value];\n }\n }\n else {\n queryParameters[key] = value;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (params_1_1 && !params_1_1.done && (_a = params_1.return)) _a.call(params_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n return queryParameters;\n}", "function getUrlVars()\n{\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n if(vars==undefined){\n vars = defaults.hash[0];\n }\n return vars;\n}", "getUrlParams(url) {\n var queryString = url ? url.split('?')[1] : window.location.search.slice(1);\n var obj = {};\n\n if (queryString) {\n queryString = queryString.split('#')[0];\n var arr = queryString.split('&');\n\n for (var i=0; i<arr.length; i++) {\n var a = arr[i].split('=');\n\n var paramNum = undefined;\n var paramName = a[0].replace(/\\[\\d*\\]/, (v) => {\n paramNum = v.slice(1,-1);\n return '';\n });\n\n var paramValue = typeof(a[1])==='undefined' ? true : a[1];\n\n if (obj[paramName]) {\n if (typeof obj[paramName] === 'string') {\n obj[paramName] = [obj[paramName]];\n }\n\n if (typeof paramNum === 'undefined') {\n obj[paramName].push(paramValue);\n }\n else {\n obj[paramName][paramNum] = decodeURI(paramValue);\n }\n } else {\n obj[paramName] = decodeURI(paramValue);\n }\n }\n }\n\n return obj;\n }", "function getQueryParams() {\n var url = window.location.href;\n var query = {};\n var params = url.substr(url.lastIndexOf('?') + 1).split('&');\n params.forEach(function (item) {\n var col = item.split('=');\n query[decodeURIComponent(col[0])] = decodeURIComponent(col[1]);\n });\n return query;\n}", "function getAllUrlParams(url) {\n // get query string from url (optional) or window\n var queryString = url ? url.split('?')[1] : window.location.search.slice(1);\n // variable (object) which stores the parameters\n var obj = {};\n // if query string exists\n if (queryString) {\n // stuff after # is not part of query string, so get rid of it\n queryString = queryString.split('#')[0];\n // split our query string into its component parts\n var arr = queryString.split('&');\n for (var i=0; i<arr.length; i++) {\n // separate the keys and the values\n var a = arr[i].split('=');\n // in case params look like: list[]=thing1&list[]=thing2\n var paramNum = undefined;\n var paramName = a[0].replace(/\\[\\d*\\]/, function(v) {\n paramNum = v.slice(1,-1);\n return '';\n });\n // set parameter value (use 'true' if empty)\n var paramValue = typeof(a[1])==='undefined' ? true : a[1];\n // (optional) keep case consistent\n paramName = paramName.toString().toLowerCase();\n paramValue = paramValue.toString().toLowerCase();\n // if parameter name already exists\n if (obj[paramName]) {\n // convert value to array (if still string)\n if (typeof obj[paramName] === 'string') {\n obj[paramName] = [obj[paramName]];\n }\n // if no array index number specified...\n if (typeof paramNum === 'undefined') {\n // put the value on the end of the array\n obj[paramName].push(paramValue);\n }\n // if array index number specified...\n else {\n // put the value at that index number\n obj[paramName][paramNum] = paramValue;\n }\n }\n // if param name doesn't exist yet, set it\n else {\n obj[paramName] = paramValue;\n }\n }\n }\n return obj;\n }", "function getAllUrlParams(url) {\n\n // get query string from url (optional) or window\n var queryString = url ? url.split('?')[1] : window.location.search.slice(1);\n \n // we'll store the parameters here\n var obj = {};\n \n // if query string exists\n if (queryString) {\n \n // stuff after # is not part of query string, so get rid of it\n queryString = queryString.split('#')[0];\n \n // split our query string into its component parts\n var arr = queryString.split('&');\n \n for (var i=0; i<arr.length; i++) {\n // separate the keys and the values\n var a = arr[i].split('=');\n \n // in case params look like: list[]=thing1&list[]=thing2\n var paramNum = undefined;\n var paramName = a[0].replace(/\\[\\d*\\]/, function(v) {\n paramNum = v.slice(1,-1);\n return '';\n });\n \n // set parameter value (use 'true' if empty)\n var paramValue = typeof(a[1])==='undefined' ? true : a[1];\n \n // (optional) keep case consistent\n paramName = paramName.toLowerCase();\n paramValue = paramValue.toLowerCase();\n \n // if parameter name already exists\n if (obj[paramName]) {\n // convert value to array (if still string)\n if (typeof obj[paramName] === 'string') {\n obj[paramName] = [obj[paramName]];\n }\n // if no array index number specified...\n if (typeof paramNum === 'undefined') {\n // put the value on the end of the array\n obj[paramName].push(paramValue);\n }\n // if array index number specified...\n else {\n // put the value at that index number\n obj[paramName][paramNum] = paramValue;\n }\n }\n // if param name doesn't exist yet, set it\n else {\n obj[paramName] = paramValue;\n }\n }\n }\n \n return obj;\n}", "function getUrlVars() {\n\tif (window.location.href.indexOf('?') === -1) {\n\t\treturn [];\n\t}\n\n\tvar vars = [];\n\tvar hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n\tjQuery.each(hashes, function(i, hash) {\n\t\thash = hashes[i].split('=');\n\t\tvars.push(hash[0]);\n\t\tvars[hash[0]] = decodeURIComponent(hash[1]);\n\t});\n\treturn vars;\n}", "function getParameters() {\n\t\t\t var searchString = window.location.search.substring(1)\n\t\t\t\t, params = searchString.split(\"&\")\n\t\t\t\t, hash = {}\n\t\t\t\t;\n\n\t\t\t for (var i = 0; i < params.length; i++) {\n\t\t\t\tvar val = params[i].split(\"=\");\n\t\t\t\thash[unescape(val[0])] = unescape(val[1]);\n\t\t\t }\n\t\t\t return hash;\n\t\t\t}", "function getQueryParameters() {\n\tvar queryString = document.location.search;\n\tvar params = {};\n\tqueryString.replace(/^\\?/,'').split(\"&\").map( function(s) {\n\t\tvar part = s.split(\"=\");\n\t\tvar key = part[0];\n\t\tvar value = decodeURIComponent(part[1]);\n\t\tparams[key] = value;\n\t});\n\treturn params;\n}", "function parseUrl() {\n var url = location.href;\n var k = url.indexOf('?');\n if(k == -1){\n return;\n }\n var querystr = url.substr(k+1);\n var arr1 = querystr.split('&');\n var arr2 = new Object();\n for (k in arr1){\n var ta = arr1[k].split('=');\n arr2[ta[0]] = ta[1];\n }\n return arr2;\n}", "function getQueryParams() {\n\tvar query = location.search.substr(1);\n\tvar data = query.split(\"&\");\n\tvar result = {};\n\tfor(var i=0; i<data.length; i++) {\n\t\tvar item = data[i].split(\"=\");\n\t\tresult[item[0]] = item[1];\n\t}\n\treturn result;\n}", "function parse_get_parameters() {\n if (location.search.length < 1) {\n return null;\n }\n else {\n var parameters = [];\n location.search\n .substr(1)\n .split(\"&\")\n .forEach(function (item) {\n let temp = item.split(\"=\");\n parameters.push(\n {\n parameter_name: temp[0],\n parameter_value: temp[1]\n }\n )\n });\n\n return parameters;\n }\n}", "function get_query_param(param) {\n var urlKeyValuePairs = {}\n window.location.href.split(\"#\")[1].split(\"&\").forEach(function(d) {\n var m = d.split(\"=\");\n urlKeyValuePairs[m[0]] = m[1]\n })\n return urlKeyValuePairs[param].split(',')\n}", "function get_query_param(param) {\n var urlKeyValuePairs = {}\n window.location.href.split(\"#\")[1].split(\"&\").forEach(function(d) {\n var m = d.split(\"=\");\n urlKeyValuePairs[m[0]] = m[1]\n })\n return urlKeyValuePairs[param].split(',')\n}", "function getURLParameters() {\n\tvar parameters = {};\t\n\tvar urlText = window.location.search;\n\n\t//Decodes parameters if encoded in 'Game' parameter\n\tif (urlText.indexOf('?Game=') === 0) {\n\t\tvar encodedURLText = urlText.substring(6);\n\t\turlText = '?' + atob(encodedURLText);\n\t};\n\n\tvar queryValuePairs = urlText.substring(1).split(\"&\");\n\tfor (var i = 0; i < queryValuePairs.length; i++) {\t\t\n \tif (queryValuePairs[i] === \"\") {\n \tcontinue;\n \t}\n\n \tvar queryValueObj = queryValuePairs[i].split(\"=\");\n \tparameters[decodeURIComponent(queryValueObj[0])] = decodeURIComponent(queryValueObj[1] || \"\");\n };\n\n return parameters;\n}", "function getQueryStrings(){\n var queryString = window.location.search || '';\n var keyValPairs = [];\n var params = {};\n queryString = queryString.substr(1);\n\n if (queryString.length){\n keyValPairs = queryString.split('&');\n for (pairNum in keyValPairs){\n var key = keyValPairs[pairNum].split('=')[0];\n if (!key.length) continue;\n if (typeof params[key] === 'undefined')\n params[key] = [];\n params[key].push(keyValPairs[pairNum].split('=')[1]);\n }\n }\n return params;\n}", "function Common_parseUrlParam(){\n\turl = decodeURI(window.location.href);\n\tlet returnParams = {};\n\tparamPos = url.indexOf('?');\n\tif(paramPos<0)\n\t\treturn {};\n\turl = url.substring(paramPos+1);//don't need the '?' any more\n\tfor(;;){\n\t\tparamPos = url.indexOf('=');\n\t\tvalPos = url.indexOf('&');\n\t\tif(paramPos>0 && valPos>0){\n\t\t\treturnParams[url.substring(0,paramPos)] = url.substring(paramPos+1,valPos);\n\t\t\turl = url.substring(valPos+1);\n\t\t}\n\t\telse if(paramPos>0 && valPos<0){\n\t\t\treturnParams[url.substring(0,paramPos)] = url.substring(paramPos+1);\n\t\t\turl='';\n\t\t}\n\t\telse if(paramPos<0){\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}\n\t\n\treturn returnParams;\n\t\n}", "function getQueryString() {\n var result = {}, queryString = location.search.substring(1),\n re = /([^&=]+)=([^&]*)/g, m;\n\n while (m = re.exec(queryString)) {\n result[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);\n }\n\n return result;\n }", "function getQueryParams() {\n const map = {};\n let qs = window.location.search;\n if (!qs) {\n return map;\n }\n qs = qs.replace(/^\\?/, '');\n qs.split('&').forEach(function(pair) {\n const kv = pair.split('=');\n if (kv.length !== 2) {\n return;\n }\n const key = kv[0],\n val = decodeURIComponent(kv[1]);\n if (map[key]) {\n if (!Array.isArray(map[key])) {\n const existingVal = map[key];\n map[key] = [existingVal];\n }\n map[key].push(val);\n } else {\n map[key] = val;\n }\n });\n return map;\n }", "function getUrlVars()\r\n{\r\n var vars = [], hash;\r\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\r\n for(var i = 0; i < hashes.length; i++)\r\n {\r\n hash = hashes[i].split('=');\r\n vars.push(hash[0]);\r\n vars[hash[0]] = hash[1];\r\n }\r\n return vars;\r\n}", "function getAllUrlParams(url) {\n\n // get query string from url (optional) or window\n var queryString = url ? url.split('?')[1] : window.location.search.slice(1);\n \n // we'll store the parameters here\n var obj = {};\n \n // if query string exists\n if (queryString) {\n \n // stuff after # is not part of query string, so get rid of it\n queryString = queryString.split('#')[0];\n \n // split our query string into its component parts\n var arr = queryString.split('&');\n \n for (var i=0; i<arr.length; i++) {\n // separate the keys and the values\n var a = arr[i].split('=');\n \n // in case params look like: list[]=thing1&list[]=thing2\n var paramNum = undefined;\n var paramName = a[0].replace(/\\[\\d*\\]/, function(v) {\n paramNum = v.slice(1,-1);\n return '';\n });\n \n // set parameter value (use 'true' if empty)\n var paramValue = typeof(a[1])==='undefined' ? true : a[1];\n \n // // (optional) keep case consistent\n // paramName = paramName.toLowerCase();\n // paramValue = paramValue.toLowerCase();\n \n // if parameter name already exists\n if (obj[paramName]) {\n // convert value to array (if still string)\n if (typeof obj[paramName] === 'string') {\n obj[paramName] = [obj[paramName]];\n }\n // if no array index number specified...\n if (typeof paramNum === 'undefined') {\n // put the value on the end of the array\n obj[paramName].push(paramValue);\n }\n // if array index number specified...\n else {\n // put the value at that index number\n obj[paramName][paramNum] = paramValue;\n }\n }\n // if param name doesn't exist yet, set it\n else {\n obj[paramName] = paramValue;\n }\n }\n }\n \n return obj;\n }", "function getURLSearch() {\n return window.location.search.substring(1);\n}", "function getQuery(){\n\n\tvar data = window.location.search.substring(1).split('&'), query = {};\n\n\tfor (var i = 0; i < data.length; i++){\n\n\t\tdata[i] = data[i].split('=');\n\n\t\tquery[data[i][0]] = data[i][1];\n\n\t}\n\n\treturn query;\n\n}", "function getUrlParams( prop ) {\r\n var params = {};\r\n var search = decodeURIComponent( window.location.href.slice( window.location.href.indexOf( '?' ) + 1 ) );\r\n var definitions = search.split( '&' );\r\n\r\n definitions.forEach( function( val, key ) {\r\n var parts = val.split( '=', 2 );\r\n params[ parts[ 0 ] ] = parts[ 1 ];\r\n } );\r\n\r\n return ( prop && prop in params ) ? params[ prop ] : params;\r\n}", "function getAllUrlParams(url) {\n\n // gets query string from url (optional) or window\n var queryString = url ? url.split('?')[1] : window.location.search.slice(1);\n\n // we'll store the parameters here\n var obj = {};\n\n // if query string exists\n if (queryString) {\n\n // stuff after # is not part of query string, so get rid of it\n queryString = queryString.split('#')[0];\n\n // split our query string into its component parts\n var arr = queryString.split('&');\n\n for (var i = 0; i < arr.length; i++) {\n // separate the keys and the values\n var a = arr[i].split('=');\n\n // in case params look like: list[]=thing1&list[]=thing2\n var paramNum = undefined;\n var paramName = a[0].replace(/\\[\\d*\\]/, function (v) {\n paramNum = v.slice(1, -1);\n return '';\n });\n\n // set parameter value (use 'true' if empty)\n var paramValue = typeof(a[1]) === 'undefined' ? true : a[1];\n\n // (optional) keep case consistent\n paramName = paramName.toLowerCase();\n paramValue = paramValue.toLowerCase();\n\n // if parameter name already exists\n if (obj[paramName]) {\n // convert value to array (if still string)\n if (typeof obj[paramName] === 'string') {\n obj[paramName] = [obj[paramName]];\n }\n // if no array index number specified...\n if (typeof paramNum === 'undefined') {\n // put the value on the end of the array\n obj[paramName].push(paramValue);\n }\n // if array index number specified...\n else {\n // put the value at that index number\n obj[paramName][paramNum] = paramValue;\n }\n }\n // if param name doesn't exist yet, set it\n else {\n obj[paramName] = paramValue;\n }\n }\n }\n return obj;\n }", "function getURLparams() {\n var paramsArray = getURLSearch().split('&');\n var returnArray = [];\n\n paramsArray.forEach(function(param) {\n \n splitedParams = param.split('=');\n\n returnArray.push({\n name: splitedParams[0],\n value: splitedParams[1]\n });\n\n });\n\n return returnArray;\n}", "function getUrlVars() \n{\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n}", "function parseUrlParams() {\n var search = window.location.search;\n search = search.charAt(0) === \"?\" ? search.substring(1) : search;\n return search.split(\"&\")\n .map(function(pair){ return pair.split(\"=\").map(decodeURIComponent) })\n .reduce( function(obj, pair) { obj[pair[0]] = pair[1]; return obj }, {});\n}", "function getUrlVars()\n{\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n}", "function getUrlVars()\n{\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n}", "function getUrlVars()\n{\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n}", "function getUrlVars()\n{\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n}", "function getUrlVars()\n{\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n}", "function getUrlVars()\n{\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n}", "function getUrlVars()\n{\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n}", "function $_GET(param) {\n\t/* Obtener la url completa */\n\turl = document.URL;\n\t/* Buscar a partir del signo de interrogación ? */\n\turl = String(url.match(/\\?+.+/));\n\t/* limpiar la cadena quitándole el signo ? */\n\turl = url.replace(\"?\", \"\");\n\turl = url.replace(\"#\", \"\");\n\t/* Crear un array con parametro=valor */\n\turl = url.split(\"&\");\n\n\t/* \n\tRecorrer el array url\n\tobtener el valor y dividirlo en dos partes a través del signo = \n\t0 = parametro\n\t1 = valor\n\tSi el parámetro existe devolver su valor\n\t*/\n\tx = 0;\n\twhile (x < url.length) {\n\t\tp = url[x].split(\"=\");\n\t\tif (p[0] == param) {\n\t\t\treturn decodeURIComponent(p[1]);\n\t\t}\n\t\tx++;\n\t}\n}", "function queryParams() {\n const params = {};\n urlBase.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n\n return params;\n }", "function getUrlVars(){\r\n var vars = [];\r\n var loc = window.location.search.substring(1);\r\n var hashes = loc.split('&');\r\n for(var i = 0; i < hashes.length; i++){\r\n var hash = hashes[i].split('=');\r\n vars.push(hash[0]);\r\n vars[hash[0]] = hash[1];\r\n }\r\n return vars;\r\n}", "function getUrlParams( prop ) {\n var params = {};\n var search = decodeURIComponent( window.location.href.slice( window.location.href.indexOf( '?' ) + 1 ) );\n var definitions = search.split( '&' );\n\n definitions.forEach( function( val, key ) {\n var parts = val.split( '=', 2 );\n params[ parts[ 0 ] ] = parts[ 1 ];\n } );\n\n return ( prop && prop in params ) ? params[ prop ] : params;\n}", "function getUrlVars(){\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n}", "function queryParams() {\n const params = {};\n urlBase.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n\n return params;\n }", "function getAllUrlParams(url) {\n // get query string from url (optional) or window\n var queryString = url ? url.split('?')[1] : window.location.search.slice(1);\n\n // we'll store the parameters here\n var obj = {};\n\n // if query string exists\n if (queryString) {\n // stuff after # is not part of query string, so get rid of it\n queryString = queryString.split('#')[0];\n\n // split our query string into its component parts\n var arr = queryString.split('&');\n\n for (var i = 0; i < arr.length; i++) {\n // separate the keys and the values\n var a = arr[i].split('=');\n\n // in case params look like: list[]=thing1&list[]=thing2\n var paramNum;\n var paramName = a[0].replace(/\\[\\d*\\]/, function (v) {\n paramNum = v.slice(1, -1);\n return '';\n });\n\n // set parameter value (use 'true' if empty)\n var paramValue = typeof (a[1]) === 'undefined' ? true : a[1];\n\n // (optional) keep case consistent\n paramName = paramName.toLowerCase();\n paramValue = paramValue.toLowerCase();\n\n // if parameter name already exists\n if (obj[paramName]) {\n // convert value to array (if still string)\n if (typeof obj[paramName] === 'string') {\n obj[paramName] = [obj[paramName]];\n }\n // if no array index number specified...\n if (typeof paramNum === 'undefined') {\n // put the value on the end of the array\n obj[paramName].push(paramValue);\n }\n // if array index number specified...\n else {\n // put the value at that index number\n obj[paramName][paramNum] = paramValue;\n }\n }\n // if param name doesn't exist yet, set it\n else {\n obj[paramName] = paramValue;\n }\n }\n }\n return obj;\n }", "function getUrlVars()\n\t{\n\t var vars = [], hash;\n\t var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n\t for(var i = 0; i < hashes.length; i++)\n\t {\n\t hash = hashes[i].split('=');\n\t vars.push(hash[0]);\n\t vars[hash[0]] = hash[1];\n\t }\n\t return vars;\n\t}", "function getUrlVars()\n\t{\n\t var vars = [], hash;\n\t var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n\t for(var i = 0; i < hashes.length; i++)\n\t {\n\t hash = hashes[i].split('=');\n\t vars.push(hash[0]);\n\t vars[hash[0]] = hash[1];\n\t }\n\t return vars;\n\t}" ]
[ "0.7449035", "0.71950054", "0.7156514", "0.7113758", "0.71092767", "0.7099208", "0.70852816", "0.70024765", "0.6989503", "0.69468063", "0.69382787", "0.69286877", "0.69168925", "0.6881164", "0.6865311", "0.68546534", "0.6845076", "0.6842526", "0.68425244", "0.68345886", "0.68314296", "0.6759935", "0.6728284", "0.6719211", "0.6677477", "0.6673614", "0.6668372", "0.6658499", "0.66502583", "0.66461074", "0.6645072", "0.6636799", "0.6619375", "0.6615575", "0.6609808", "0.66071033", "0.66043377", "0.6589175", "0.6577157", "0.6547593", "0.65173215", "0.6508303", "0.6504775", "0.6503428", "0.64838654", "0.6483538", "0.64746356", "0.6459274", "0.64461356", "0.64461356", "0.64412165", "0.64262336", "0.6417441", "0.6415487", "0.64117944", "0.63946825", "0.6393829", "0.63689035", "0.63405746", "0.6339235", "0.63183475", "0.6309958", "0.6300625", "0.62980443", "0.6297959", "0.6281593", "0.6281574", "0.6268531", "0.62487656", "0.62487656", "0.62432665", "0.6239841", "0.62353253", "0.6227468", "0.62173086", "0.6215981", "0.62109125", "0.6202737", "0.6198927", "0.6198131", "0.61885816", "0.6186062", "0.6184383", "0.6180744", "0.61786264", "0.61786264", "0.61786264", "0.61786264", "0.61786264", "0.61786264", "0.61786264", "0.61759984", "0.6175183", "0.6170005", "0.61657584", "0.61496526", "0.61476433", "0.61447185", "0.6143899", "0.6143899" ]
0.6447991
48
Binary search in a sorted array with timestamps : [[t1, ...], [t2, ...], ...] Return the index of the first element with a timestamp > t, or null if the array does not contain anything newer.
function bsearchT(t, arr) { var first = 0; var last = arr.length - 1; if (last < 0 || arr[last][0] <= t) { return null; } if (arr[first][0] > t) { return first; } while (first < last) { var mid = Math.floor((first + last) / 2); if (arr[mid][0] <= t) { first = mid + 1; if (arr[first][0] > t) { return first; } } else { last = mid; } } return first; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function binarySearch(t) {\n\t\tlet low = 0;\n\t\tlet high = records.length - 1;\n\t\tlet curr = Math.floor((high + low) / 2);\n\t\twhile(low < high) {\n\t\t\tif(t < records[curr]['to']) {\n\t\t\t\thigh = curr;\n\t\t\t}\n\t\t\telse if(t > records[curr]['to']) {\n\t\t\t\tlow = curr + 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn curr;\n\t\t\t}\n\t\t\tcurr = Math.floor((high + low) / 2);\n\t\t}\n\t\treturn curr;\n\t}", "binarySearch(target, array) {\n let min = 0;\n let max = array.length - 1;\n let index = null;\n\n // Checking that target is contained in the array.\n if (target >= array[min] && target <= array[max]) {\n // Perform binary search to find the closest, rounded down element to the target in the array .\n while (index === null) {\n // Divide the array in half\n let mid = Math.floor((min + max) / 2);\n // Target date is in the right half\n if (target > array[mid]) {\n if (target < array[mid + 1]) {\n index = mid;\n } else if (target === array[mid + 1]) {\n index = mid + 1;\n } else {\n // Not found yet proceed to divide further this half in 2.\n min = mid;\n }\n // Target date is exactly equal to the middle element\n } else if (target === array[mid]) {\n index = mid;\n // Target date is on the left half\n } else {\n if (target >= array[mid - 1]) {\n index = mid - 1;\n } else {\n max = mid;\n }\n }\n }\n } else {\n return null;\n }\n return [array[index], index];\n }", "function search(value, myArray){\n for (var i=0; i < myArray.length; i++) {\n if (myArray[i][0].timestamp == value.timestamp && myArray[i][0].user_id == value.user_id) {\n return i;\n }\n\n }\n return -1;\n }", "function callIndexSearch (calls, t)\r\n{\r\n var tot = calls.length;\r\n var upper = tot;\r\n var lower = 0;\r\n while(upper - lower > 1) {\r\n var curr = Math.floor((upper + lower)/2);\r\n if(calls[curr].startTime <= t) {\r\n lower = curr + 1;\r\n }\r\n else {\r\n upper = curr;\r\n }\r\n }\r\n return lower;\r\n}", "function binarySearch(array, key) {\n var low = 0;\n var high = array.length - 1;\n var mid;\n var element;\n \n while (low <= high) {\n mid = Math.floor((low + high) / 2, 10);\n element = array[mid];\n if (element < key) {\n low = mid + 1;\n } else if (element > key) {\n high = mid - 1;\n } else {\n return mid;\n }\n }\n return -1;\n}", "function binarySearch(array, key) {\n var low = 0;\n var high = array.length - 1;\n var mid;\n var element;\n\n while(low <= high) {\n mid = Math.floor((low + high) / 2, 10);\n element = array[mid];\n if (element < key) {\n high = mid - 1;\n }else if (element > key){\n high = mid - 1;\n }else{\n return mid;\n }\n }\n return - 1;\n}", "sortFunction(input) {\n input.sort((a, b) => {\n if (a.timestamp === b.timestamp) {\n return input.indexOf(a) - input.indexOf(b);\n } else {\n return b.timestamp - a.timestamp;\n }\n });\n }", "function binarySearch(arr, element) {\n if (arr.length < 1) return -1\n return binarySearchRecur(arr, 0, arr.length-1, element)\n}", "function binarySearch(array, item) {\n let min = 0;\n let max = array.length - 1;\n\n\n while(true) {\n let currentMid = Math.floor((min + max) / 2);\n let currentItem = array[currentMid];\n\n if (currentItem === item) {\n return currentMid;\n }\n\n if (currentItem > item) {\n max = currentMid - 1;\n }\n\n if (currentItem < item) {\n min = currentMid + 1;\n }\n\n if(max < min) {\n return null;\n }\n }\n}", "function binarySearch(arr, value) {\n\n}", "function magicIdx(arr) {\n let left = 0;\n let right = arr.length - 1;\n let mid = Math.floor((left + right) / 2);\n while (left <= right) {\n const val = arr[mid];\n if (val === mid) return mid;\n if (val > mid) {\n right = mid - 1;\n }\n if (val < mid) {\n left = mid + 1\n }\n mid = Math.floor((left + right) / 2)\n }\n return null;\n}", "function binarySearch(array, pred) {\n var lo = -1,\n hi = array.length;\n while (1 + lo < hi) {\n var mi = lo + ((hi - lo) >> 1);\n if (pred(array[mi], array, mi)) {\n hi = mi;\n } else {\n lo = mi;\n }\n }\n return hi;\n}", "function binarySearch(arr, target) {\n\n\tarr = arr.sort(); // sort arr so its always ascending order\n\t// O(n logn)\n\n\tlet start = 0,\n\t\tend = arr.length - 1; \n\n\twhile(start <= end) {\n\n\t\tlet mid = Math.floor(start + (end-start) / 2); \n\n\t\tif(target === arr[mid]) {\n\t\t\treturn mid;\n\t\t}\n\n\t\tif(target < arr[mid]) {\n\t\t\tend = mid - 1; // update ceiling if key is left half\n\t\t} else if (target > arr[mid]) {\n\t\t\tstar = mid + 1; // update floor if key is right half\n\t\t}\n\t}\n\n\treturn -1 // we dont have the ele\n}", "function binarySearch(arr, val) {\n\n}", "function binarySearch(array, pred) {\r\n let lo = -1,\r\n hi = array.length;\r\n while (1 + lo < hi) {\r\n const mi = lo + ((hi - lo) >> 1);\r\n if (pred(array[mi])) {\r\n hi = mi;\r\n } else {\r\n lo = mi;\r\n }\r\n }\r\n return hi;\r\n}", "function binarySearch(d, t, s, e) {\r\n s = s || 0;\r\n if (e === undefined) {\r\n e = d.length - 1;\r\n if (!e) {\r\n return d[0] === t;\r\n }\r\n }\r\n const m = Math.floor((s + e) / 2);\r\n if (t === d[m]) return d[m];\r\n if (e - 1 === s) return d[s] === t || d[e] === t;\r\n if (t > d[m]) return binarySearch(d, t, m, e);\r\n if (t < d[m]) return binarySearch(d, t, s, m);\r\n}", "function bSearch(arr, val) {\n let start = 0;\n let end = arr.length - 1;\n\n while (start < end) {\n const mid = Math.floor((end - start) / 2) + start;\n if (arr[mid] === val) {\n return mid;\n }\n if (arr[mid] < val) {\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n\n return start;\n}", "function bsearch(arr, target) {\n if (arr.length === 0) {\n return null;\n }\n\n const mid = Math.floor(arr.length / 2);\n if (arr[mid] === target) {\n return mid;\n } else if (arr[mid] > target) {\n return bsearch(arr.slice(0, mid), target);\n } else if (arr[mid] < target) {\n let result = bsearch(arr.slice(mid + 1), target);\n return result === null ? null : result + mid + 1;\n }\n}", "function indexEqualsValueSearch(arr) {\n let min = undefined \n let hi = arr.length-1\n let lo = 0\n while (hi >= lo) {\n let mid = lo + Math.floor((hi - lo)/2)\n if (arr[mid] === mid) {\n min = mid\n if (mid > 0 && arr[mid-1] !== (mid-1)) return min\n hi = mid - 1\n }\n else if (mid < arr[mid]) hi = mid - 1\n else if (mid > arr[mid]) lo = mid + 1\n }\n return (min !== undefined) ? min : -1\n}", "function binarySearch(ar, el, compare_fn) {\n var m = 0;\n var n = ar.length - 1;\n while (m <= n) {\n var k = (n + m) >> 1;\n var cmp = compare_fn(el, ar[k]);\n if (cmp > 0) {\n m = k + 1;\n } else if(cmp < 0) {\n n = k - 1;\n } else {\n return k;\n }\n }\n return -m - 1;\n}", "function searchTag(arr, tag) {\n /* jshint bitwise: false */\n var imin = 0;\n var imax = arr.length - 1;\n while (imin <= imax) {\n var imid = (imin + imax) >>> 1;\n var val = arr[imid].tag;\n if (val === tag) {\n return imid;\n } else if (val < tag) {\n imin = imid + 1;\n } else {\n imax = imid - 1;\n }\n }\n // Not found: return -1-insertion point\n return -imin - 1;\n }", "function binarySearch(array, value) {\n var low = 0;\n var high = array.length - 1;\n while (low <= high) {\n var middle = low + ((high - low) >> 1);\n var midValue = array[middle];\n if (midValue === value) {\n return middle;\n }\n else if (midValue > value) {\n high = middle - 1;\n }\n else {\n low = middle + 1;\n }\n }\n return ~low;\n }", "function binarySearch(arr,val) {\n let start = 0\n let end = arr.length-1\n let mid = Math.floor((start+end)/2)\n\n while (arr[mid] !== val && start <= end) {\n\n if (arr[mid] < val) {\n start = mid + 1\n } else {\n end = mid - 1\n }\n mid = Math.floor((start+end)/2)\n }\n if (arr[mid] === val) {\n return mid\n }\n return -1\n}", "function binarySearch(array, value) {\n let left = 0;\n let right = array.length - 1;\n let middle = Math.round((left + right) / 2);\n while (array[middle] !== value && left <= right) {\n middle = Math.round((left + right) / 2);\n if (array[middle] > value) {\n right = middle - 1;\n } else {\n left = middle + 1;\n } \n }\n \n if (array[middle] === value) {\n return middle\n }\n\n return -1\n}", "function binarySearch(array, value) {\r\n //check if value is within the range (i.e. between arry[0]-array[array.length-1])\r\n if (array[0] > value || array[array.length - 1] < value) {\r\n return false;\r\n }\r\n //base case when array has only one element\r\n if (array.length === 1) {\r\n if (array[0] === value) {\r\n return value;\r\n } else {\r\n return false;\r\n }\r\n }\r\n let mid = Math.ceil(array.length / 2) - 1;\r\n if (array[mid] >= value) {\r\n return binarySearch(array.slice(0, mid + 1), value);\r\n }\r\n return binarySearch(array.slice(mid + 1), value);\r\n}", "function binarySearch(array, target) {\n\tvar mid = Math.floor((array.length - 1) / 2);\n\tvar start = 0;\n\tvar end = array.length - 1;\n\twhile (start <= end) {\n\t\tif (array[mid] === target) {\n\t\t\treturn mid;\n\t\t} if (array[mid] < target) {\n\t\t\tstart = mid + 1;\n\t\t} else {\n\t\t\tend = mid - 1;\n\t\t}\n\t\tmid = Math.floor((start + end) / 2);\n\t}\n\treturn -1;\n}", "function binarySearch(arr, val) {\n var start = 0;\n var end = arr.length-1;\n while (start <= end) {\n var mid = Math.floor((start + end)/2);\n if (arr[mid] === val) {\n return mid;\n }\n else if (arr[mid] > val) {\n end = mid - 1;\n }\n else if (arr[mid] < val) {\n start = mid + 1;\n }\n }\n return -1;\n}", "function binarySearch(arr, elem) {\n let start = 0;\n let end = arr.length - 1;\n let middle = Math.floor((start + end) / 2);\n while(arr[middle] !== elem && start <= end) {\n if(elem < arr[middle]) {\n end = middle - 1;\n } else {\n start = middle + 1;\n }\n middle = Math.floor((start + end) / 2);\n }\n return arr[middle] === elem ? middle : -1;\n}", "function searchTag(arr, tag) {\n /* jshint bitwise: false */\n let imin = 0;\n let imax = arr.length - 1;\n while (imin <= imax) {\n const imid = (imin + imax) >>> 1;\n const val = arr[imid].tag;\n if (val === tag) {\n return imid;\n } else if (val < tag) {\n imin = imid + 1;\n } else { imax = imid - 1; }\n }\n // Not found: return -1-insertion point\n return -imin - 1;\n}", "function binarySearch(array, target){\n return binaryHelper(array, target, 0, array.length -1)\n}", "function binarySearch(searchElement, array) {\n var currentElement;\n var minIndex = 0;\n var maxIndex = array.length - 1;\n while (minIndex <= maxIndex) {\n currentIndex = (minIndex + maxIndex) / 2 | 0;\n currentElement = array[currentIndex];\n \t\tconsole.log(\"currentIndex \" + currentIndex, \"currentElement \" + currentElement);\n if (currentElement < searchElement) {\n minIndex = currentIndex + 1;\n }\n else if (currentElement > searchElement) {\n maxIndex = currentIndex - 1;\n }\n else {\n return currentIndex;\n }\n }\n \n return -1;\n}", "function binarySearch(arr, val) {\n if(arr.length == 0){\n return -1\n } else if(arr[arr.length - 1] == val){\n return arr.length - 1;\n }\n return 0 + findIndex(arr.slice(0, arr.length - 1), val);\n}", "function binarySearch_2(arr, elem) {\n let start = 0;\n let end = arr.length - 1;\n let middle = Math.floor((start + end) / 2);\n\n while (arr[middle] !== elem && start <= end) {\n if (elem < arr[middle]) {\n end = middle - 1;\n } else {\n start = middle + 1;\n }\n\n middle = Math.floor((start + end) / 2);\n }\n\n if (arr[middle] === elem) {\n return middle;\n }\n\n return -1;\n}", "function binarySearch(array, target) {\n\treturn binarySearchHelper(array, target, 0, array.length - 1)\n}", "function compareTimestamp( a, b ) {\n if ( a.timestamp < b.timestamp ){\n return 1;\n }\n if ( a.timestamp > b.timestamp ){\n return -1;\n }\n return 0;\n}", "function binarySearch2(myArray, key) {\n let lowerPointer = 0;\n let upperPointer = myArray.length - 1;\n while (lowerPointer <= upperPointer) {\n // get the midpoint of the array,\n // check if midpoint is equal to the key, if so, return the midpoint index\n let midpoint = Math.floor(\n lowerPointer + (upperPointer - lowerPointer) / 2,\n );\n if (myArray[midpoint] === key) return midpoint;\n\n // check if key is less than midpoint value\n // take the array less than midpoint\n if (key < myArray[midpoint]) {\n upperPointer = midpoint - 1;\n }\n\n // check if key is greater than midpoint value\n // take the array greater than midpoint\n if (key > myArray[midpoint]) {\n lowerPointer = midpoint + 1;\n }\n }\n return -1;\n}", "function binarySearch(arr, elem) {\n var start = 0;\n var end = arr.length - 1;\n var middle = Math.floor((start + end) / 2);\n\n while(arr[middle] !== elem && start <= end) {\n if(elem < arr[middle]) {\n end = middle - 1;\n } else {\n start = middle + 1;\n };\n\n middle = Math.floor((start + end) / 2);\n };\n\n if(arr[middle] === elem) {\n return middle;\n };\n\n return -1;\n}", "function binarySearch(arr, value, start=0, end=arr.length) {\n console.log(`${start}, ${end}`);\n if(start > end ) return null; \n \n let index = Math.floor((start + end) /2); \n\n if(arr[index] === value) {\n return index; \n }\n if(arr[index] > value) {\n return binarySearch(arr, value, start, index - 1); \n }\n if(arr[index] < value) {\n return binarySearch(arr, value, index + 1, end);\n }\n}", "function searchTag(arr, tag) {\r\n\t /* jshint bitwise: false */\r\n\t let imin = 0;\r\n\t let imax = arr.length - 1;\r\n\t while (imin <= imax) {\r\n\t const imid = (imin + imax) >>> 1;\r\n\t const val = arr[imid].tag;\r\n\t if (val === tag) {\r\n\t return imid;\r\n\t } else if (val < tag) {\r\n\t imin = imid + 1;\r\n\t } else { imax = imid - 1; }\r\n\t }\r\n\t // Not found: return -1-insertion point\r\n\t return -imin - 1;\r\n\t}", "function binarySearchBonus(arr, val) {\r\n var start = 0;\r\n var end = arr.length-1;\r\n var counter = 0;\r\n while (start <= end && counter == 0){\r\n var pointer = Math.floor((end-start)/2)+start;\r\n if (arr[pointer]==val){\r\n counter ++;\r\n break;\r\n }\r\n else if (arr[pointer]<val){\r\n start = pointer+1;\r\n }\r\n else if (arr[pointer]>val){\r\n end = pointer-1;\r\n }\r\n }\r\n if (counter>0){\r\n var x = 1\r\n while (arr[pointer+x]==val){\r\n counter++;\r\n x++;\r\n }\r\n x = 1\r\n while (arr[pointer-x]==val){\r\n counter++;\r\n x++;\r\n }\r\n }\r\n return counter\r\n }", "function binarySearch(arr, target) {\n let startIdx = 0,\n endIdx = arr.length - 1;\n\n while (startIdx < endIdx) {\n let midIdx = Math.floor((startIdx + endIdx) / 2);\n if (target === arr[midIdx]) {\n return midIdx;\n } else if (target > arr[midIdx]) {\n startIdx = midIdx;\n } else {\n endIdx = midIdx;\n }\n }\n return -1;\n}", "function binarySearch (array, value) {\n var start = 0;\n var end = array.length - 1;\n var middle;\n\n while (start <= end) {\n middle = Math.floor((start + end) / 2);\n\n if (array[middle] === value) {\n return middle;\n }\n if (value < array[middle]) {\n end = middle - 1;\n } else {\n start = middle + 1;\n }\n }\n return -1;\n}", "function binarySearch(arr, val) {\n let idx = -1;\n\n function _binarySearch(high, low) {\n if (low > high) return -1;\n\n let mid = Math.floor((high + low) / 2);\n\n if (val === arr[mid]) {\n return idx = mid;\n } else if (val > arr[mid]) {\n return _binarySearch(high, mid + 1);\n } else if (val < arr[mid]) {\n return _binarySearch(mid - 1, low);\n } \n }\n\n _binarySearch(arr.length, 0);\n return idx;\n}", "function linearSearch(arr, value) {\n for (let i = 0; i < arr.length; i++) {\n if(arr[i] === value) {\n return i;\n }\n }\n return null; \n}", "search(element) {\n // Average time complexity = O(n)\n // Worst time complexity = O(n)\n // Worst space complexity = O(n)\n\n let ii = 0;\n while (ii < this._array.length) {\n if (this._array[ii] === element) {\n return ii;\n }\n ii++;\n }\n return null;\n }", "function search(arr, val) {\n let left = 0;\n let right = arr.length - 1;\n\n while (left <= right) {\n const mid = Math.floor((left + right) / 2);\n if (arr[mid] === val) {\n return mid;\n } else if (arr[mid] < val) {\n left = mid + 1;\n } else {\n right = mid - 1;\n }\n }\n\n return -1;\n}", "function binarySearch(arr, elem){\n let start = 0;\n let end = (arr.length - 1); \n let middle = Math.floor((start + end) / 2);\n while (start <= end) {\n if (arr[middle] > elem){\n end = middle - 1\n } else if (arr[middle] < elem) {\n start = middle + 1\n } else {\n return middle\n }\n middle = Math.floor((start + end) / 2);\n }\n return -1\n}", "function binarySearch(arr, value) {\n var left = 0;\n var right = arr.length - 1;\n var middle = Math.floor((left + right) / 2);\n\n while (arr[middle] !== value && left <= right) {\n if (value < arr[middle]) right = middle - 1;\n else left = middle + 1;\n middle = Math.floor((left + right) / 2);\n }\n return arr[middle] === value ? middle : -1;\n}", "function locateHigh(array) {\n return array.indexOf(highestNumber(array))\n}", "function nextt(data, t, ti) {\n if (ti === void 0) {\n ti = 0;\n }\n\n var i0 = 0;\n var iN = data.length - 1;\n\n while (i0 <= iN) {\n var mid = Math.floor((i0 + iN) / 2);\n\n if (data[mid][ti] === t) {\n return mid;\n } else if (data[mid][ti] < t) {\n i0 = mid + 1;\n } else {\n iN = mid - 1;\n }\n }\n\n return t < data[mid][ti] ? mid : mid + 1;\n} // Estimated size of datasets", "function nextt(data, t, ti) {\n if (ti === void 0) {\n ti = 0;\n }\n\n var i0 = 0;\n var iN = data.length - 1;\n\n while (i0 <= iN) {\n var mid = Math.floor((i0 + iN) / 2);\n\n if (data[mid][ti] === t) {\n return mid;\n } else if (data[mid][ti] < t) {\n i0 = mid + 1;\n } else {\n iN = mid - 1;\n }\n }\n\n return t < data[mid][ti] ? mid : mid + 1;\n} // Estimated size of datasets", "function efficientSearch(array, item) {\n\n let minIndex = 0;\n let maxIndex = array.length - 1;\n let currentIndex;\n let currentElement;\n\n while (minIndex <= maxIndex) {\n currentIndex = Math.floor((minIndex + maxIndex) / 2);\n currentElement = array[currentIndex];\n\n if (currentElement < item) {\n minIndex = currentIndex + 1;\n }\n else if (currentElement > item) {\n maxIndex = currentIndex - 1;\n }\n else {\n return currentIndex;\n }\n }\n return -1;\n}", "function efficientSearch(array, item) {\n let minIndex = 0;\n let maxIndex = array.length - 1;\n let currentIndex;\n let currentElement;\n\n while (minIndex <= maxIndex) {\n currentIndex = Math.floor((minIndex + maxIndex) / 2);\n currentElement = array[currentIndex];\n\n if (currentElement < item) {\n minIndex = currentIndex + 1;\n }\n else if (currentElement > item) {\n maxIndex = currentIndex - 1;\n }\n else {\n return currentIndex;\n }\n }\n return -1;\n}", "function efficientSearch(array, item) {\n let minIndex = 0;\n let maxIndex = array.length - 1;\n let currentIndex;\n let currentElement;\n\n while (minIndex <= maxIndex) {\n currentIndex = Math.floor((minIndex + maxIndex) / 2);\n currentElement = array[currentIndex];\n\n if (currentElement < item) {\n minIndex = currentIndex + 1;\n }\n else if (currentElement > item) {\n maxIndex = currentIndex - 1;\n }\n else {\n return currentIndex;\n }\n }\n return -1;\n}", "function binarySearch(arr, val){\n var left = 0;\n var right = arr.length - 1;\n var middle = Math.floor((left + right)/2);\n while(arr[middle] !== val) {\n if(val < arr[middle]) {\n right = middle - 1;\n }\n else {\n left = middle + 1;\n }\n middle = Math.floor((left + right) / 2);\n }\n if(arr[middle] === elem){\n return middle;\n }\n return -1;\n}", "function binarySearch(arr, elem) {\n if (!Array.isArray(arr)) {\n return -1;\n }\n\n let left = 0;\n let right = arr.length - 1;\n\n while (left <= right) {\n const middle = Math.floor((right + left) / 2);\n\n if (elem === arr[middle]) {\n return middle;\n } else if (elem > arr[middle]) {\n left = middle + 1;\n } else {\n right = middle - 1;\n }\n }\n\n return -1;\n}", "function findTail(array) {\n return Math.min.apply(Math, array)\n}", "function efficientSearch(array, item) {\n let minIndex = 0;\n let maxIndex = array.length - 1;\n let currentIndex;\n let currentElement;\n\n while (minIndex <= maxIndex) {\n currentIndex = Math.floor((minIndex + maxIndex) / 2);\n currentElement = array[currentIndex];\n\n if (currentElement < item) {\n minIndex = currentIndex + 1;\n } else if (currentElement > item) {\n maxIndex = currentIndex - 1;\n } else {\n return currentIndex;\n }\n }\n return -1;\n}", "function efficientSearch(array, item) {\n let minIndex = 0; \t\t\t\t\t\t//--> constant\n let maxIndex = array.length - 1;\t//--> constant\n let currentIndex;\t\t\t\t\t\t\t\t\t//--> constant\n let currentElement;\t\t\t\t\t\t\t\t//--> constant\n\n while (minIndex <= maxIndex) {\t\t//--> logarithmic O(log(n))\n currentIndex = Math.floor((minIndex + maxIndex) / 2);\n currentElement = array[currentIndex];\n\n if (currentElement < item) {\n minIndex = currentIndex + 1;\n }\n else if (currentElement > item) {\n maxIndex = currentIndex - 1;\n }\n else {\n return currentIndex;\t\t\t\t\t//--> constant\n }\n }\n return -1;\t\t\t\t\t\t\t\t\t\t\t\t//--> constant\n}", "function efficientSearch(array, item) {\n let minIndex = 0;\n let maxIndex = array.length - 1;\n let currentIndex;\n let currentElement;\n\n while (minIndex <= maxIndex) {\n currentIndex = Math.floor((minIndex + maxIndex) / 2);\n currentElement = array[currentIndex];\n\n if (currentElement < item) {\n minIndex = currentIndex + 1;\n }\n else if (currentElement > item) {\n maxIndex = currentIndex - 1;\n }\n else {\n return currentIndex;\n }\n }\n return -1;\n}", "function binarySearch(arr, val) {\n if (arr.length === 0) return -1;\n let leftpointer = 0, rightPointer = arr.length - 1, guessIndex = Math.floor((rightPointer) / 2);\n\n while (arr[guessIndex] !== val && leftpointer <= rightPointer) {\n console.log(leftpointer, guessIndex, rightPointer);\n if (arr[guessIndex] < val) leftpointer = guessIndex + 1;\n else rightPointer = guessIndex - 1;\n guessIndex = Math.floor((rightPointer - leftpointer) / 2) + leftpointer;\n }\n\n return arr[guessIndex] === val ? guessIndex : -1;\n}", "function binarySearch(title, inputArray) {\n var low = 0,\n high = inputArray.length - 1,\n mid;\n while (low <= high) {\n mid = low + (high - low) / 2;\n if ((mid % 1) > 0) {\n mid = Math.ceil(mid);\n }\n if (title < inputArray[mid]) {\n high = mid - 1;\n }\n else if (title < inputArray[mid]) {\n low = mid + 1;\n }\n else {\n return mid;\n }\n }\n return null;\n }", "_binarySearchUpperIndexByKey(arr, x, makeKey) {\n if (!arr.length) return null;\n if (makeKey) {\n arr = arr.map(makeKey);\n x = makeKey(x);\n }\n let start = 0;\n let end = arr.length - 1;\n let mid;\n\n if (arr[end] < x) return null;\n\n while (start < end) {\n mid = Math.floor((start + end) / 2);\n if (arr[mid] < x) start = mid + 1;\n else end = mid;\n }\n\n return start;\n }", "function efficientSearch(array, item) {\n let minIndex = 0;\n let maxIndex = array.length - 1;\n let currentIndex;\n let currentElement;\n\n while (minIndex <= maxIndex) {\n currentIndex = Math.floor((minIndex + maxIndex) / 2);\n currentElement = array[currentIndex];\n\n if (currentElement < item) {\n minIndex = currentIndex + 1;\n }\n else if (currentElement > item) {\n maxIndex = currentIndex - 1;\n }\n else {\n return currentIndex;\n }\n }\n return -1;\n }", "function binarySearch(array, value, start, end) {\n start = start === undefined ? 0 : start;\n end = end === undefined ? array.length : end;\n\n if (start > end) {\n return -1;\n }\n\n const index = Math.floor((start + end) / 2);\n const item = array[index];\n\n\n if (item === value) {\n return index;\n }\n else if (item < value) {\n return binarySearch(array, value, index + 1, end);\n }\n else if (item > value) {\n return binarySearch(array, value, start, index - 1);\n }\n}", "function indexOf(arr, val) {\n let l = 0;\n let r = arr.length - 1;\n let p = Math.floor(r / 2);\n\n while (val !== arr[p] && l < r) {\n\n if (val < arr[p]) r = p - 1;\n else l = p + 1;\n p = Math.floor((l + r) / 2);\n \n }\n\n return arr[p] === val ? p : -1;\n}", "function bsearch(arr, target) {\n if (arr.length === 0) { return -1; }\n\n let midIdx = Math.floor(arr.length / 2);\n\n if (arr[midIdx] === target) {\n return midIdx;\n } else if (arr[midIdx] > target) {\n return bsearch(arr.slice(0, midIdx), target);\n } else {\n let result = bsearch(arr.slice(midIdx + 1), target);\n if (result === -1) {\n return -1;\n } else {\n return midIdx + 1 + result;\n }\n }\n}", "function where(arr, val) {\n var x = arr.length;\n for (var i=0; i<arr.length; i++) {\n if (val < arr[i]) { \n x = i;\n break;\n } \n }\n return x;\n}", "function binarySearch(array, value, compare) {\n var index = lowerBound(array, value, compare);\n if (index === array.length) {\n return -1;\n }\n var item = array[index];\n if (compare(item, value) !== 0) {\n return -1;\n }\n return index;\n }", "function findIndex(array, id) {\n var low = 0, high = array.length, mid;\n while (low < high) {\n mid = (low + high) >>> 1;\n array[mid]._id < id ? low = mid + 1 : high = mid\n }\n return low;\n }", "function binarySearch(array, number){\n let high = array.length - 1;\n let low = 0;\n\n if(!Array.isArray(array)){\n throw(\"Wrong file type - send an array of numbers\")\n }\n \n let mid = low + Math.floor((high - low) / 2);\n\n while(mid >= low){\n if(array[mid] === number){\n return true;\n }\n if(number < array[mid]){\n high = mid-1;\n mid = Math.floor((low + high)/2);\n\n\n }\n else {\n low = mid + 1;\n mid = Math.floor((low + high)/2);\n \n }\n \n }\n return false; \n}", "function getStartIndex(currentTimestamp, hourCount, data) {\n\tconst lastTimestamp = currentTimestamp - hourCount * 60 * 60;\n\tlet startIndex = 0;\n\tfor (let i = data.length - 1; i >= 0; i--) {\n\t\tif (data[i].timestamp < lastTimestamp) {\n\t\t\tstartIndex = i + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn startIndex;\n}", "function binarySearch(arr, val) {\r\n var start = 0;\r\n var end = arr.length-1;\r\n while (start <= end){\r\n var pointer = start + Math.floor((end-start)/2);\r\n if (arr[pointer]==val){\r\n return true;\r\n }\r\n else if (arr[pointer]<val){\r\n start = pointer+1;\r\n }\r\n else if (arr[pointer]>val){\r\n end = pointer-1;\r\n }\r\n }\r\n return false;\r\n }", "function bSearch(arr, target) {\n if (arr.length === 1) {\n if (arr[0] === target) {\n return target;\n } else {\n return null;\n }\n } else if (arr.length === 0) {\n return null;\n } else {\n let midpoint = Math.floor(arr.length / 2);\n if (arr[midpoint] === target) {\n return target;\n } else if (arr[midpoint] < target) {\n return bSearch(arr.slice(midpoint + 1, arr.length), target);\n } else {\n return bSearch(arr.slice(0, midpoint - 1), target);\n }\n }\n\n}", "function binarySearch(array, number) {\n var low = 0;\n var high = array.length - 1;\n var mid;\n while (low <= high) {\n mid = (low + high) / 2;\n mid = Math.round(mid);\n if (array[mid] == number) {\n return true;\n } else if (number > array[mid]) {\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n\n }\n return false;\n}", "function compare(a, b) {\n if (a['timestamp'] < b['timestamp'])\n return -1\n if (a['timestamp'] > b['timestamp'])\n return 1;\n return 0;\n}", "function findMin (x) {\r\n let tmp = timeArr.map((t) => {\r\n return xScale(d3.utcParse(t * 1000))\r\n })\r\n let index = d3.bisectLeft(tmp, x)\r\n return index\r\n }", "function binarySearch(a, target) {\n target += 1;\n var start = 0,\n end = a.length - 1;\n\n while (start <= end) {\n var mid = ~~((start + end) >> 1);\n if (a[mid] >= target) end = mid - 1;\n else start = mid + 1;\n }\n\n return start;\n}", "function search(x, a, cmp)\n {\n let lo = 0, hi = a.length - 1;\n while (lo <= hi) {\n let m = Math.floor((lo + hi)/2), r = cmp(x, a[m]);\n if (r < 0) hi = m - 1;\n else if (r > 0) lo = m + 1;\n else return m;\n }\n return -1;\n }", "function findIndex(array, id) {\n var low = 0, high = array.length, mid;\n while (low < high) {\n mid = (low + high) >>> 1;\n array[mid]._id < id ? low = mid + 1 : high = mid\n }\n return low;\n }", "function binarySearch(a, x, key, leftMost, lo, hi) {\n\tif (lo == null) {\n\t\tlo = 0;\n\t}\n\telse if (lo < 0) {\n\t\tthrow \"ERROR: lo must be non-negative\";\n\t}\n\t\t\n\tif (hi == null) {\n\t\thi = a.length;\n\t}\n\telse if (hi > a.length) {\n\t\tthrow \"Error: hi must be <= a.length\";\n\t}\n\t\n\tif (leftMost == null) {\n\t\tleftMost = false;\n\t}\n\t\n\tif (key != null) {\n\t\tx = x[key]; \n\t}\n\tif (leftMost) {\n\t\twhile (lo < hi) {\n\t\t\tmid = ~~((lo+hi)/2);\n\t\t\tif (key == null) {\n\t\t\t\tvalue = a[mid];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvalue = a[mid][key]; \n\t\t\t}\n\t\t\tif (x <= value) {\n\t\t\t\thi = mid;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlo = mid+1;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\twhile (lo < hi) {\n\t\t\tmid = ~~((lo+hi)/2);\n\t\t\tif (key == null) {\n\t\t\t\tvalue = a[mid];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvalue = a[mid][key]; \n\t\t\t}\n\t\t\tif (x < value) {\n\t\t\t\thi = mid;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlo = mid+1;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn lo;\n}", "function binarySearch(arr, val, left=0, right=arr.length) {\n if (right<left) return -1;\n const idx = left+ Math.floor((right-left)/2);\n if (right===left && arr[left]===val) return left;\n if (right===left && arr[left]!==val) return -1;\n \n if (arr[idx] === val){\n return idx;\n }else if (arr[idx] > val){\n return binarySearch(arr, val, left, idx-1);\n }else if (arr[idx] < val){\n return binarySearch(arr, val, idx+1, right);\n }\n}", "function findIndex(array, id) {\n var low = 0, high = array.length, mid;\n while (low < high) {\n mid = (low + high) >>> 1;\n array[mid]._id < id ? low = mid + 1 : high = mid\n }\n return low;\n }", "function findIndex(array, id) {\n var low = 0, high = array.length, mid;\n while (low < high) {\n mid = (low + high) >>> 1;\n array[mid]._id < id ? low = mid + 1 : high = mid\n }\n return low;\n }", "function binarySearch(arr, val) {\n let left = 0;\n let right = arr.length - 1;\n let middle = Math.floor((left + right) / 2);\n\n while (arr[middle] !== val && left <= right) {\n if (val < arr[middle]) right = middle - 1\n\n else left = middle + 1;\n\n middle = Math.floor((left + right) / 2);\n }\n\n return arr[middle] === val ? middle: -1;\n}", "function binarySearch(arr, key, insertIndex) {\n var len = arr.length;\n var sp = -1;\n var m;\n var retVal = -1;\n\n while (len - sp > 1) {\n var index = m = len + sp >> 1;\n if (arr[index] < key) {\n sp = m;\n } else {\n len = m;\n }\n }\n \n if (arr[len] == key || insertIndex ) {\n retVal = len; \n }\n return retVal;\n}", "function rBinarySearch(array, num ) {\n\n}", "function search(array, val) {\n let min = 0;\n let max = array.length - 0;\n while (min <= max){\n let middle = Math.floor((min+max)/2);\n if ( array[middle] < val ) {\n min = middle + 1;\n } else if ( array[middle] > val) {\n max = middle -1;\n } else { return middle }\n }\n return -1\n}", "function binarySearch(arr, value) {\n let middle = 0;\n let left = 0;\n let right = arr.length - 1;\n while (left <= right) {\n if (arr[right] < value || arr[left] > value) return -1;\n middle = Math.ceil((left + right) / 2);\n if (arr[middle] === value) return middle;\n if (arr[middle] > value) {\n right = middle - 1;\n } else if (arr[middle] < value) {\n left = middle + 1;\n }\n }\n return -1;\n}", "function sortByTimestamp(transactionsArr) {\n transactionsArr.sort((a, b) => (a.timestamp < b.timestamp ? -1 : 1));\n }", "function binarySearch(arr, searchValue) {\n function find(arr, searchValue, left, right) {\n if (right < left)\n return -1;\n\n /*\n int mid = mid = (left + right) / 2;\n There is a bug in the above line;\n Joshua Bloch suggests the following replacement:\n */\n var mid = Math.floor((left + right) >>> 1);\n if (searchValue > arr[mid])\n return find(arr, searchValue, mid + 1, right);\n\n if (searchValue < arr[mid])\n return find(arr, searchValue, left, mid - 1);\n\n return mid;\n };\n\n return find(arr, searchValue, 0, arr.length - 1);\n}", "function getIndex(countArray, loser) {\n var i, n = countArray.length;\n var point = loser ? Infinity : -Infinity;\n var index = [-1];\n for (i = 0; i < n; i++) {\n if ( loser ? point > countArray[i] : point < countArray[i]) {\n point = countArray[i];\n index = [i];\n } else if (point === countArray[i]) {\n index.push(i);\n }\n }\n return index;\n}", "function binarySearch2(arry, n) {\n start = 0;\n end = arry.length - 1;\n middle = Math.floor(start + end / 2);\n while (arry[middle] !== n && middle < end && middle > start) {\n if (n > arry[middle]) start = middle + 1;\n else end = middle - 1;\n\n middle = Math.floor((start + end) / 2);\n }\n return arry[middle] === n ? middle : -1;\n}", "function binarySearch(arr, searchValue) {\n function find(arr, searchValue, left, right) {\n if (right < left)\n return -1;\n\n /*\n int mid = mid = (left + right) / 2;\n There is a bug in the above line;\n Joshua Bloch suggests the following replacement:\n */\n var mid = Math.floor((left + right) >>> 1);\n if (searchValue > arr[mid])\n return find(arr, searchValue, mid + 1, right);\n\n if (searchValue < arr[mid])\n return find(arr, searchValue, left, mid - 1);\n\n return mid;\n }\n return find(arr, searchValue, 0, arr.length - 1);\n}", "function binarySearch(arr, value){\n var middle = Math.floor(arr.length/2)\n var li = 0\n var ri = arr.length-1\n if (arr[0]>value || arr[arr.length-1]<value) {\n return false\n }\n while (arr[middle] != value) {\n if (arr[middle] < value) {\n li = middle\n middle = Math.floor(((ri-li)/2)+li)\n }\n if (arr[middle] > value) {\n ri = middle\n middle = Math.floor(((ri-li)/2)+li)\n }\n }\n return true\n}", "function _arrayIndexOfSorted(array, value, shift) {\n ngDevMode && assertEqual(Array.isArray(array), true, 'Expecting an array');\n var start = 0;\n var end = array.length >> shift;\n\n while (end !== start) {\n var middle = start + (end - start >> 1); // find the middle.\n\n var current = array[middle << shift];\n\n if (value === current) {\n return middle << shift;\n } else if (current > value) {\n end = middle;\n } else {\n start = middle + 1; // We already searched middle so make it non-inclusive by adding 1\n }\n }\n\n return ~(end << shift);\n }", "function _arrayIndexOfSorted(array, value, shift) {\n ngDevMode && assertEqual(Array.isArray(array), true, 'Expecting an array');\n var start = 0;\n var end = array.length >> shift;\n\n while (end !== start) {\n var middle = start + (end - start >> 1); // find the middle.\n\n var current = array[middle << shift];\n\n if (value === current) {\n return middle << shift;\n } else if (current > value) {\n end = middle;\n } else {\n start = middle + 1; // We already searched middle so make it non-inclusive by adding 1\n }\n }\n\n return ~(end << shift);\n }", "function FindSum(arr = [], T) {\n for (elem in arr) {\n if (binarySearch(T - elem) > -1)\n return true\n }\n return false;\n}", "function findInsertionPoint(sortedArr, val, comparator) { \n\t var low = 0, high = sortedArr.length;\n\t var mid = -1, c = 0;\n\t while(low < high) {\n\t mid = parseInt((low + high)/2);\n\t c = comparator(sortedArr[mid], val);\n\t if(c > 0) {\n\t low = mid + 1;\n\t }else if(c < 0) {\n\t high = mid;\n\t }else {\n\t return mid;\n\t }\n\t //alert(\"mid=\" + mid + \", c=\" + c + \", low=\" + low + \", high=\" + high);\n\t }\n\t return low;\n\t}", "function binarySearch(arr, k) {\n //assumption that arr is ordered & comprised of numbers\n // k is desired number\n // returns index of k or -1 if there is no match\n\n var low = 0;\n var high = arr.length-1;\n var mid = Math.floor((high + low)/2);\n\n while(low !== mid ){\n if(arr[mid] === k){\n console.log('FOUND!', mid);\n return mid;\n } else if (arr[mid] > k) {\n high = mid;\n mid = Math.floor((high + low)/2);\n } else if (arr[mid] < k) {\n low = mid;\n mid = Math.floor((high + low)/2);\n }\n }\n console.log('NOT FOUND! ', -1);\n return -1;\n}" ]
[ "0.6692026", "0.603222", "0.58841443", "0.5838607", "0.5710833", "0.5693896", "0.56424975", "0.56329405", "0.56132275", "0.560815", "0.55794936", "0.5572304", "0.55640244", "0.55564404", "0.55507666", "0.55328894", "0.551211", "0.5504179", "0.55022097", "0.5498574", "0.5492041", "0.5477364", "0.546409", "0.54625523", "0.54549146", "0.54506373", "0.5443258", "0.54362583", "0.5435441", "0.5425986", "0.54228824", "0.5414699", "0.5411062", "0.5400089", "0.5391778", "0.53908145", "0.5390334", "0.5379689", "0.53793275", "0.537165", "0.5368546", "0.5366092", "0.53595245", "0.5351267", "0.53419983", "0.5338294", "0.5337397", "0.5320794", "0.5304338", "0.52992296", "0.52992296", "0.529037", "0.528273", "0.528273", "0.5279657", "0.52789533", "0.52757597", "0.5275303", "0.5272304", "0.52673036", "0.5260111", "0.5259408", "0.52539593", "0.5252497", "0.5248575", "0.5242913", "0.5236478", "0.5236", "0.5235654", "0.5228892", "0.522068", "0.52178264", "0.5214246", "0.52055657", "0.52028483", "0.52003276", "0.51927835", "0.5192132", "0.5186359", "0.5186321", "0.5185759", "0.5183033", "0.5180565", "0.5180565", "0.51764333", "0.5174342", "0.5168307", "0.51680833", "0.516713", "0.5164427", "0.5160364", "0.51590705", "0.5154118", "0.51416504", "0.5141493", "0.5140719", "0.5140719", "0.51344824", "0.5131111", "0.51273614" ]
0.71609294
0
Concatenate or merge two sorted arrays with timestamps. In most cases, it should be a simple concatenation. Return the merged array
function concatT(old_array, new_array) { if (old_array.length <= 0) { return new_array; } if (new_array.length <= 0) { return old_array; } if (old_array[old_array.length - 1][0] < new_array[0][0]) { return old_array.concat(new_array); } var i = bsearchT(new_array[0][0], old_array); if (i == null) { i = old_array.length - 1; while ((i > 0) && (old_array[i - 1][0] == new_array[0][0])) { i--; } } // clone the old array because we will be modifying it with splice() var merged_array = old_array.slice(0); for (var n = 0; n < new_array.length; n++) { while ((i < merged_array.length) && (merged_array[i][0] <= new_array[n][0])) { while (merged_array[i][0] == new_array[n][0]) { // consoleLog("skipping duplicate element ", i, n); n++; if (n >= new_array.length) { // consoleLog("returning early, duplicates"); return merged_array; } } i++; } if (i == merged_array.length) { // consoleLog("returning now"); while ((n < new_array.length) && (merged_array[i - 1][0] == new_array[n][0])) { n++; } if (n < new_array.length) { return merged_array.concat(new_array.slice(n)); } else { return merged_array; } } // consoleLog("inserting element", n, "at", i, "(", new_array[n], ")"); merged_array.splice(i, 0, new_array[n]); i++; } // consoleLog("returning merged array"); return merged_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mergeTime(arr1,arr2) {\n let results = [];\n let i=0;\n let j=0;\n while(i < arr1.length && j < arr2.length) {\n if (arr1[i] < arr2[j]) {\n results.push(arr1[i]);\n i++;\n } else {\n results.push(arr2[j]);\n j++\n }\n\n }\n while(i < arr1.length) {\n results.push(arr1[i]);\n i++;\n }\n while(j < arr2.length) {\n results.push(arr2[j]);\n j++;\n }\n return results;\n }", "function merge(array1, array2) {\n let newArray = [];\n\n const lengths = array1.length + array2.length;\n\n for (let i = 0; i < lengths; i++) {\n (array1[0] > array2[0]) ? newArray.push(array2.shift()) : newArray.push(array1.shift());\n }\n\n return newArray;\n}", "function merge(arr1, arr2) {\n var result = [];\n\n while (arr1.length && arr2.length) {\n fs.stat(`./uploads/${arr1[0].name}`, function (err, stats) {\n let mtime1 = stats.mtime.getTime();\n console.log(arr1[0].name, mtime);\n\n fs.stat(`./uploads/${arr2[0].name}`, function (err, stats) {\n let mtime2 = stats.mtime.getTime();\n console.log(arr2[0].name, mtime);\n\n if (mtime1 >= mtime2) {\n result.push(arr1.shift());\n } else {\n result.push(arr2.shift());\n }\n });\n });\n }\n\n return result.concat(arr1, arr2);\n }", "function merge(arr1, arr2) {\n var result = [];\n\n while (arr1.length && arr2.length) {\n if(arr1[0] <= arr2[0]) {\n result.push(arr1.shift());\n } else {\n result.push(arr2.shift());\n }\n }\n\n return result.concat(arr1, arr2);\n}", "function merge(arr1, arr2) {\n let res = [];\n while (arr1.length && arr2.length) {\n if (arr1[0] > arr2[0]) {\n res.push(arr2.shift());\n } else {\n res.push(arr1.shift());\n }\n }\n return (res.concat(arr1.concat(arr2)));\n}", "function merge(array1,array2) {\n var newArray = [];\n newArray = array1.concat(array2);\n return newArray.sort()\n}", "function merge (arr1, arr2) {\n\t\tlet results = [];\n\n\t\t// while there's anything left in both arrays, compare the first el of each array\n\t\twhile (arr1.length > 0 && arr2.length > 0) {\n\t\t\tif (arr1[0] <= arr2[0]) {\n\t\t\t\tresults.push(arr1.shift());\n\t\t\t} else {\n\t\t\t\tresults.push(arr2.shift());\n\t\t\t}\n\t\t}\n\n\t\t// a slightly fancy way of saying 'concatenate whatever is left in arr1 and arr2'\n\t\treturn [].concat(results, arr1, arr2);\n\t}", "function merge(arrayOne, arrayTwo){\n var merged = [];\n //while either arary is not empty\n while(arrayOne.length > 0 && arrayTwo.length > 0){\n //add the smaller of the first elements into merged\n if (arrayOne[0] < arrayTwo[0] ){\n merged.push(arrayOne[0]);\n arrayOne.shift();\n } else {\n merged.push(arrayTwo[0]);\n arrayTwo.shift();\n }\n }\n\n merged = merged.concat(arrayOne).concat(arrayTwo);\n return merged;\n}", "function mergeSorted(array1, array2) {\n let res = [];\n let i = 0;\n let j = 0;\n while (i < array1.length && j < array2.length) {\n if (array1[i] <= array2[j]) {\n res.push(array1[i]);\n i++\n } else {\n res.push(array2[j]);\n j++;\n }\n }\n return res.concat(array1.slice(i)).concat(array2.slice(j));\n}", "function merge(array1, array2){\n var result = [];\n while(array1.length && array2.length){\n var minElem;\n if (array1[0] < array2[0]) minElem = array1.shift();\n else minElem = array2.shift();\n result.push(minElem);\n }\n if(array1.length) result = result.concat(array1);\n else result = result.concat(array2);\n return result;\n}", "function merge(arr1, arr2) {\n let finalArr = [];\n\n while (arr1.length && arr2.length) {\n if (arr1[0] > arr2[0]) {\n finalArr.push(arr2.shift());\n } else {\n finalArr.push(arr1.shift());\n }\n }\n\n for (let i = 0; i < arr1.length; i++) {\n finalArr.push(arr1[i]);\n }\n for (let i = 0; i < arr2.length; i++) {\n finalArr.push(arr2[i]);\n }\n\n return finalArr;\n}", "function merge(arr1, arr2) {\n return arr1.length === 0\n ? arr2\n : arr2.length === 0\n ? arr1\n : is_earlier(arr1[0], arr2[0])\n ? [arr1[0]].concat(merge(arr1.splice(1), arr2))\n : [arr2[0]].concat(merge(arr1, arr2.splice(1)));\n }", "function merge(arr1, arr2) {\n let combined = [];\n let i = 0;\n let j = 0;\n while (i < arr1.length && j < arr2.length) {\n if (arr1[i] < arr2[j]) {\n combined.push(arr1[i]);\n i++;\n } else {\n combined.push(arr2[j]);\n j++;\n }\n }\n\n while (i < arr1.length) {\n combined.push(arr1[i]);\n }\n\n while (i < arr2.length) {\n combined.push(arr2[i]);\n }\n\n return combined;\n}", "function merge(firstArray, secondArray) {\n let sorted = []\n\n while (firstArray.length !== 0 && secondArray.length !== 0) {\n if (firstArray[0] < secondArray[0]) {\n sorted.push(findMinAndRemoveSorted(firstArray))\n } else {\n sorted.push(findMinAndRemoveSorted(secondArray))\n }\n }\n return sorted.concat(firstArray).concat(secondArray)\n}", "function merge(a, b){\n var arr = [];\n while (a.length && b.length) {\n if (a[0] < b[0]) {\n arr.push(a.shift());\n } else {\n arr.push(b.shift());\n }\n }\n while (a.length) {\n arr.push(a.shift());\n }\n while (b.length) {\n arr.push(b.shift());\n }\n return arr;\n}", "function merge(array1, array2) {\n let merged = []\n while (array1.length && array2.length) {\n if (array1[0] < array2[0]) {\n merged.push(array1.shift())\n } else if (array1[0] > array2[0]) {\n merged.push(array2.shift())\n } else {\n merged.push(array1.shift(), array2.shift())\n }\n }\n // After looping ends, one array is empty, and other array contains only\n // values greater than all values in `merged`\n \n\n return [...merged, ...array1, ...array2]\n }", "function merge(array1,array2) {\n let mergedArray = [];\n\n while (array1.length && array2.length) {\n\n if(array1[0] <= array2[0]) {\n\n mergedArray.push(array1[0]);\n array1 = array1.slice(1);\n\n } else {\n\n mergedArray.push(array2[0]);\n array2 = array2.slice(1);\n\n }\n\n }\n \n while (array1.length)\n\n mergedArray.push(array1.shift());\n\n while (array2.length)\n\n mergedArray.push(array2.shift());\n\n return mergedArray;\n\n\n}", "function merge(arr1, arr2) {\n let merged = new Array();\n while (arr1.length > 0 && arr2.length > 0) {\n (arr1[arr1.length - 1] > arr2[arr2.length - 1]) ? merged.unshift(arr1.pop()) : merged.unshift(arr2.pop());\n (arr1.length == 0) ? Array.prototype.unshift.apply(merged, arr2) :\n ((arr2.length == 0) ? Array.prototype.unshift.apply(merged, arr1) : null);\n };\n return merged;\n}", "function merger(arr1, arr2) {\n let i = 0, j = 0, mergedArr = [];\n while (i < arr1.length && j < arr2.length) {\n if (arr1[i] > arr2[j]) mergedArr.push(arr2[j++]);\n else mergedArr.push(arr1[i++]);\n }\n while (i < arr1.length) {\n mergedArr.push(arr1[i++]);\n }\n while (j < arr2.length) {\n mergedArr.push(arr2[j++]);\n }\n return mergedArr;\n}", "function mergeSortedArray(a,b){\n var tempArray = [];\n var currentPos = {\n a: 0,\n b: 0\n }\n while(currentPos.a < a.length || currentPos.b < b.length) {\n if(typeof a[currentPos.a] === 'undefined') {\n tempArray.push(b[currentPos.b++]);\n } else if(a[currentPos.a] > b[currentPos.b]){\n tempArray.push(b[currentPos.b++]);\n } else {\n tempArray.push(a[currentPos.a++]);\n }\n }\n return tempArray;\n}", "function mergeTime(left, right) {\n let result = []\n let indexLeft = 0\n let indexRight = 0\n\n while (indexLeft < left.length && indexRight < right.length) {\n if (left[indexLeft].split(\":\")[2] < right[indexRight].split(\":\")[2]) {\n result.push(left[indexLeft])\n indexLeft++\n } else {\n result.push(right[indexRight])\n indexRight++\n }\n }\n\n return result.concat(left.slice(indexLeft)).concat(right.slice(indexRight))\n}", "function mergeSortedArrays(arr1, arr2) {\n var len1 = arr1.length,\n len2 = arr2.length;\n var combinedLength = len1 + len2 - 1;\n\n for (var i = combinedLength; i >= 0; i--) {\n if (arr1[len1 - 1] >= arr2[len2 - 1]) {\n arr1[i] = arr1[len1 - 1];\n len1--;\n } else if (arr1[len1 - 1] < arr2[len2 - 1]) {\n arr1[i] = arr2[len2 - 1];\n len2--;\n }\n if (len1 == 0) {\n if (len2 == 0) {\n break;\n }\n arr1[i - 1] = arr2[len2 - 1];\n len2--;\n }\n }\n return arr1;\n}", "function mergedArraysA(arr1, arr2) {\n return [...arr1, ...arr2].sort((a,b) => a-b)\n}", "function mergeSortedArray(arr1, arr2) {\n let pointer1 = 0, pointer2 = 0;\n const answer = [];\n\n while(answer.length < arr1.length + arr2.length) {\n let el1 = arr1[pointer1], el2 = arr2[pointer2];\n\n if (!el1 || el1 > el2) {\n answer.push(el2);\n pointer2++;\n } else {\n answer.push(el1);\n pointer1++;\n }\n }\n\n return answer;\n}", "function mergeArray (arr1, arr2) {\nvar input1 = arr1\nvar input2 = arr2\n\nvar input1Last = input1.slice(-1)\n\nvar combine = input1Last.concat(input2)\n\nreturn(combine)\n}", "function sortCombineArrays(arr1, arr2) {\n let arr = [];\n while (arr1.length && arr2.length) {\n if (arr1[0][0] < arr2[0][0]) { // since using shift can continually check for the first element\n arr.push(arr1.shift());\n } else {\n arr.push(arr2.shift());\n }\n }\n return arr.concat(arr1.slice().concat(arr2.slice()));\n}", "function mergeUnsortedArrays(arr, arr2) {\n let concatArr = arr.concat(arr2)\n\n return concatArr.sort((a, b) => {\n return a - b;\n})\n}", "function merge(arr1, arr2) {\n let i = 0,\n j = 0;\n let res = [];\n while (i < arr1.length && j < arr2.length) {\n if (arr1[i] < arr2[j]) {\n res.push(arr1[i]);\n i++;\n } else {\n res.push(arr2[j]);\n j++;\n }\n }\n while (i < arr1.length) {\n res.push(arr1[i]);\n i++;\n }\n while (j < arr2.length) {\n res.push(arr2[j]);\n j++;\n }\n\n // Enqueue this state of merged arrays\n queue.push(res);\n return res;\n }", "function merge (arr1, arr2) {\n const newArr = [];\n let i1 = 0;\n let i2 = 0;\n\n while (i1 < arr1.length && i2 < arr2.length) {\n if (arr1[i1] < arr2[i2]) {\n newArr.push(arr1[i1]);\n i1 += 1;\n } else {\n newArr.push(arr2[i2]);\n i2 += 1;\n }\n }\n\n return newArr.concat(arr1.slice(i1)).concat(arr2.slice(i2));\n}", "function merge(arr1, arr2) {\n let arr1copy = arr1.slice();\n let arr2copy = arr2.slice();\n let results = [];\n\n while (arr1copy.length > 0 && arr2copy.length > 0) {\n results.push(copy1[0] <= copy2[0] ? copy1.shift() : copy2.shift());\n }\n\n console.log(result.concat(copy1.length === 0 ? copy2 : copy1));\n}", "function mergeSortedArray(arr1, arr2) {\n if (arr1.length === 0) {\n return arr2;\n }\n if (arr2.length === 0) {\n return arr1;\n }\n //Idea: keep a pointer with arr1 and arr2\n //result arr is concatenation of 2 given array\n var i = 0,\n j = 0,\n mergedArr = []; //result array\n //continue to loop to finish the array\n while (i < arr1.length || j < arr2.length) {\n if (arr1[i] <= arr2[j]) { //arr1 has smaller value\n mergedArr.push(arr1[i]);\n i++;\n } else { //if arr2 has smaller value\n mergedArr.push(arr2[j]);\n j++;\n }\n }\n return mergedArr;\n}", "function merge(array1, array2) {\n let arrayFinal = [];\n // place the contents of array1 into arrayFinal\n for (let i = 0; i < array1.length; i++) {\n arrayFinal.push(array1[i]);\n }\n \n // place the contents of array2 into arrayFinal\n for (let j = 0; j < array2.length; j++) {\n arrayFinal.push(array2[j]);\n }\n \n // sort arrayFinal\n arrayFinal.sort();\n\n return arrayFinal;\n}", "function concatArrays(arr1, arr2){\n\n}", "function mergeSorted(arr1, arr2) {\n let result = []\n let i = 0\n let j = 0\n while (arr1.length !=0 && arr2.length !=0) {\n if (arr1[0]<=arr2[0]) {\n result.push(arr1.shift())\n } else {\n result.push(arr2.shift())\n }\n }\n return result.concat(arr1).concat(arr2)\n}", "function mergeSortArray(arr1, arr2) {\n return arr1.concat(arr2).sort((x, z) => x- z);\n}", "function mergeSortedArrays2(a, b) {\n // first create an empty array\n const sortedArray = [];\n\n // then do a while loop as long as a or b have any length\n // we will be using the shift method. this method removes the\n // first element of an array and returns it. therefor we only need to check for the elements\n // at [0] as they will always be different once we shift the array\n while (a.length && b.length) {\n if (a[0] < b[0]) {\n sortedArray.push(a.shift());\n } else {\n sortedArray.push(b.shift());\n }\n }\n\n // eventually one array will have no more elements. In that case we will push the remaining\n // elements from the other array into the combined array\n if (a.length) {\n sortedArray.push(...a);\n } else {\n sortedArray.push(...b);\n }\n\n return sortedArray;\n}", "function mergeSortedArrays2(arr1, arr2) {\n return arr1.concat(arr2).sort(function (a, b) {\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n return 0;\n });\n}", "merge (left, right) {\n let resultArray = [], leftIndex = 0, rightIndex = 0;\n\n // We will concatenate values into the resultArray in order\n while (leftIndex < left.length && rightIndex < right.length) {\n if (left[leftIndex] < right[rightIndex]) {\n resultArray.push(left[leftIndex]);\n leftIndex++; // move left array cursor\n } else {\n resultArray.push(right[rightIndex]);\n rightIndex++; // move right array cursor\n }\n }\n\n // We need to concat here because there will be one element remaining\n // from either left OR the right\n return resultArray\n .concat(left.slice(leftIndex))\n .concat(right.slice(rightIndex));\n }", "function mergeArrays(arr1, arr2) {\n \n}", "function merge(arr1, arr2) {\n const last1 = arr1.length - 1;\n const last2 = arr2.length - 1;\n \n if (arr1[last1] <= arr2[0]) {\n return arr1.concat(arr2);\n }\n \n if (arr2[last2] <= arr1[0]) {\n return arr2.concat(arr1);\n }\n \n const res = [];\n let leftPointer = 0;\n let rightPointer = 0;\n \n while (res.length < arr1.length + arr2.length) {\n if (leftPointer === arr1.length && rightPointer !== arr2.length) {\n res.push(arr2[rightPointer]);\n rightPointer++;\n } else if (rightPointer === arr2.length && leftPointer !== arr1.length) {\n res.push(arr1[leftPointer]);\n leftPointer++;\n } else {\n const leftElem = arr1[leftPointer];\n const rightElem = arr2[rightPointer];\n if (leftElem <= rightElem) {\n res.push(leftElem);\n leftPointer++;\n } else {\n res.push(rightElem);\n rightPointer++;\n }\n }\n }\n return res;\n }", "function merge(arr1, arr2) {\n for (let i=0; i<arr2.length; i++) {\n arr1.push(arr2[i])\n }\n return arr1.sort((a,b) => a - b)\n}", "function arrCombine (arr1, arr2){\n var newArr= arr1.concat(arr2);\n return newArr;\n}", "function merge(arr1, arr2) {\n let results = [];\n let i = 0;\n let j = 0;\n\n while (i < arr1.length && j < arr2.length) {\n if (arr1[i] < arr2[j]) {\n results.push(arr1[i]);\n i++;\n } else {\n results.push(arr2[j]);\n j++;\n }\n }\n while (i < arr1.length) {\n results.push(arr1[i]);\n i++;\n }\n while (j < arr2.length) {\n results.push(arr2[j]);\n j++;\n }\n return results;\n}", "function mergeArrays(firstArray, secondArray) {\n let firstIdx = 0;\n let secondIdx = 0;\n const firstArrLength = firstArray.length;\n const secondArrLength = secondArray.length;\n\n const mergedArr = [];\n while (firstIdx < firstArrLength && secondIdx < secondArrLength) {\n const firstEle = firstArray[firstIdx];\n const secondEle = secondArray[secondIdx];\n if (firstEle <= secondEle) {\n // smaller or equal so add it into mergedArr first\n mergedArr.push(firstEle);\n firstIdx++;\n } else {\n // add secondEle since it is smaller\n mergedArr.push(secondEle);\n secondIdx++;\n }\n }\n\n // Final cleanup: check if any of the arrays did not reach the final index\n if (firstIdx < firstArrLength) {\n while (firstIdx < firstArrLength) {\n const ele = firstArray[firstIdx];\n mergedArr.push(ele);\n firstIdx++;\n }\n } else {\n while (secondIdx < secondArrLength) {\n const ele = secondArray[secondIdx];\n mergedArr.push(ele);\n secondIdx++;\n }\n }\n\n return mergedArr;\n}", "function merge(left, right) {\n if (left[0] < right[0]) {\n mergeArr.push(left[0])\n left.shift()\n }else {\n mergeArr.push(right[0])\n right.shift()\n }\n}", "function mergeSortedArrays(arr1, arr2) {\n let sort = [];\n\n while (arr1.length && arr2.length) {\n if (arr1[0] < arr2[0]) {\n // shift pops from the front, not ideal.\n sort.push(arr1.shift());\n } else {\n sort.push(arr2.shift());\n }\n }\n\n // takes remainders and squashes them together in cases with one array\n return sort.concat(arr1.slice().concat(arr2.slice()));\n}", "function merge(left, right, array){\n if (left.length == 0 && right.length == 0) {\n return array;\n } else if (left.length == 0) {\n return array.concat(right);\n } else if (right.length == 0) {\n return array.concat(left);\n } else if (left[0] < right[0]) {\n array.push(left.shift());\n } else if (left[0] > right[0]) {\n array.push(right.shift());\n } else {\n array.push(left.shift());\n right.shift();\n }\n return merge(left, right, array);\n}", "function merge(arrayA, arrayB) {\n const arraySize = arrayA.length + arrayB.length;\n const result = Array(arraySize);\n let indexA = 0;\n let indexB = 0;\n for (let i = 0; i < arraySize; i++) {\n if (indexA < arrayA.length && (arrayA[indexA] <= arrayB[indexB] || indexB == arrayB.length)) {\n result[i] = arrayA[indexA];\n indexA ++;\n } else if (indexB < arrayB.length && (arrayB[indexB] <= arrayA[indexA] || indexA == arrayA.length)) {\n result[i] = arrayB[indexB];\n indexB ++;\n }\n }\n return result;\n}", "function merge(arr1, arr2) {\n let results = [];\n let i = 0;\n let j = 0;\n\n while (i < arr1.length && j < arr2.length) {\n if (arr2[j] > arr1[i]) {\n results.push(arr1[i]);\n i++;\n } else {\n results.push(arr2[j]);\n j++;\n }\n }\n\n while (i < arr1.length) {\n results.push(arr1[i]);\n i++;\n }\n while (j < arr2.length) {\n results.push(arr2[j]);\n j++;\n }\n\n return results;\n}", "function merge(arr1, arr2) {\n\n let results = [];\n\n let i = 0;\n let j = 0;\n\n while (i < arr1.length && j < arr2.length) {\n if (arr2[j] > arr1[i]) {\n results.push(arr1[i]);\n i++;\n } else {\n results.push(arr2[j]);\n j++;\n }\n }\n while (i < arr1.length) {\n results.push(arr1[i]);\n i++;\n }\n while (j < arr2.length) {\n results.push(arr2[j]);\n j++;\n }\n\n return results;\n}", "function concat(array1, array2) {\n var result = [];\n\n for (var i = 0; i < array1.length; i++) {\n result[result.length] = array1[i];\n }\n\n for (var j = 0; j < array2.length; j++) {\n result[result.length] = array2[j];\n }\n\n return result;\n}", "function merge(arr1, arr2) {\n\n// the merge function takes two sorted arrays and merge them to produce\n// a single sorted array.\n\n var T, // references the array items will be merged into.\n F, // references the array items will be taken from.\n j = 0;\n\n// the T array is the one with the smallest first item.\n\n if (arr1[0] <= arr2[0]) {\n T = arr1;\n F = arr2;\n } else {\n T = arr2;\n F = arr1;\n }\n\n// knowing the arrays are sorted, we can observe that if the last element\n// of the T array is less than the first element of the F array, we only\n// need to concatenate them.\n\n if (T[T.length-1] <= F[0]) {\n return T.concat(F);\n } else {\n for (var i = 0; i < T.length-1; i++) {\n\n// we need to insert the elements from F in T. in order to know where to\n// insert them, we go through each elements of T to see if an element of F\n// fits.\n\n if (F[j] >= T[i] && F[j] <= T[i+1]) {\n T.splice(i+1, 0, F[j]);\n j++;\n }\n }\n\n// if any element remains in F, they can be directly appended to T, since\n// they are already sorted.\n\n if (j < F.length) {\n T = T.concat(F.splice(j));\n }\n\n return T;\n }\n}", "function mergeDay(arr1, arr2) {\n let sorted =[];\n let i = 0;\n let j = 0;\n\n while(i < arr1.length && j < arr2.length){\n //compare values and push larger day onto sorted\n if(arr1[i].day === arr2[j].day){\n sorted.push({...arr1[i], ...arr2[j]});\n i++;\n j++; \n } else if(arr1[i].day > arr2[j].day){\n sorted.push(arr1[i]);\n i++;\n } else {\n sorted.push(arr2[j]);\n j++;\n }\n }\n\n while(i < arr1.length){\n sorted.push(arr1[i]);\n i++;\n }\n\n while(j < arr2.length){\n sorted.push(arr2[j]);\n j++;\n }\n \n return sorted;\n}", "function merge(arr1, arr2) {\n let results = [];\n let i = 0;\n let j = 0;\n while (i < arr1.length && j < arr2.length) {\n if (arr2[j] > arr1[i]) {\n results.push(arr1[i]);\n i++;\n } else {\n results.push(arr2[j])\n j++;\n }\n }\n\n while (i < arr1.length) {\n results.push(arr1[i])\n i++;\n }\n\n while (j < arr2.length) {\n results.push(arr2[j])\n j++;\n }\n\n return results;\n}", "function merge(arr1, arr2) {\n let results = [],\n i = 0,\n j = 0;\n while (i < arr1.length && j < arr2.length) {\n if (arr2[j] >= arr1[i]) {\n results.push(arr1[i]);\n i++;\n } else {\n results.push(arr2[j]);\n j++;\n }\n }\n while (i < arr1.length) {\n results.push(arr1[i]);\n i++;\n }\n while (j < arr2.length) {\n results.push(arr2[j])\n j++;\n }\n return results;\n}", "function timestampSort(a, b) {\n return (a.startTime - b.startTime);\n }", "function concat(a1, a2) {\n var l1 = a1.length;\n var l2 = a2.length;\n var a1a2 = new Array(l1 + l2 | 0);\n for(var i = 0 ,i_finish = l1 - 1 | 0; i <= i_finish; ++i){\n a1a2[i] = a1[i];\n }\n for(var i$1 = 0 ,i_finish$1 = l2 - 1 | 0; i$1 <= i_finish$1; ++i$1){\n a1a2[l1 + i$1 | 0] = a2[i$1];\n }\n return a1a2;\n }", "function merge(arr1, arr2) {\n let results = []\n let i = 0\n let j = 0\n while (i < arr1.length && j < arr2.length) {\n if (arr2[j] > arr1[i]) {\n results.push(arr1[i])\n i++\n } else {\n results.push(arr2[j])\n j++\n }\n }\n while (i < arr1.length) {\n results.push(arr1[i])\n i++\n }\n while (j < arr2.length) {\n results.push(arr2[j])\n j++\n }\n return results\n}", "function merge(arr1, arr2) {\n let results = [];\n let i = 0;\n let j = 0;\n while (i < arr1.length) {\n if (arr2[j] >= arr1[i]) {\n results.push(arr1[i]);\n i++;\n } else {\n results.push(arr2[j]);\n j++;\n }\n }\n while ( i < arr1.length) {\n results.push(arr1[i]);\n i++;\n }\n while ( j < arr2.length) {\n results.push(arr2[j]);\n j++;\n}\n return results;\n}", "function joinArrayInSortedWay(ar1, ar2) {\n let resArray = [];\n\n while (true) {\n if (ar1[0] > ar2[0]) {\n resArray.push(ar2.shift())\n } else if (ar1[0] < ar2[0]) {\n resArray.push(ar1.shift())\n } else if (ar1[0] === ar2[0]){\n resArray.push(ar2.shift())\n resArray.push(ar1.shift())\n }\n\n if (!ar2.length) {\n return resArray.concat(ar1) \n } else if (!ar1.length){\n return resArray.concat(ar2) \n }\n }\n}", "function merge(left, right, array) {\n let leftIndex = 0;\n let rightIndex = 0;\n let outputIndex = 0;\n while (leftIndex < left.length && rightIndex < right.length) {\n if (left[leftIndex] < right[rightIndex]) {\n array[outputIndex++] = left[leftIndex++];\n }\n else {\n array[outputIndex++] = right[rightIndex++];\n }\n }\n\n for (let i = leftIndex; i < left.length; i++) {\n array[outputIndex++] = left[i];\n }\n\n for (let i = rightIndex; i < right.length; i++) {\n array[outputIndex++] = right[i];\n }\n return array;\n}", "function merge(arr1, arr2) {\n let results = [];\n let i = 0;\n let j = 0;\n while (i < arr1.length && j < arr2.length) {\n if (arr2[j] > arr1[i]) {\n results.push(arr1[i]);\n i++;\n } else {\n results.push(arr2[j])\n j++;\n }\n }\n while (i < arr1.length) {\n results.push(arr1[i])\n i++;\n }\n while (j < arr2.length) {\n results.push(arr2[j])\n j++;\n }\n return results;\n}", "function mergedArraysB(arr1, arr2) {\n let merged = []\n let i = 0\n let j = 0\n while ((i < arr1.length) && (j < arr2.length)) {\n if (arr1[i] < arr2[j]) {\n merged.push(arr1[i]);\n i++;\n } else {\n merged.push(arr2[j]);\n j++;\n }\n };\n if (i <= (arr1.length - 1)) {\n arr1.splice(0, i)\n merged = merged.concat(arr1);\n } else if (j <= (arr2.length - 1)) {\n arr2.splice(0,j)\n merged = merged.concat(arr2)\n };\n return merged;\n}", "function concat(arr1, arr2) {\n var result = [];\n for (var i = 0; i < arr1.length; i++) { push(result, arr1[i]); }\n for (var i = 0; i < arr2.length; i++) { push(result, arr2[i]); }\n return result;\n}", "function merge(arr1, arr2) {\n var results = [], i = 0, j = 0;\n while (i < arr1.length && j < arr2.length) {\n if (arr1[i] < arr2[j] ) {\n results.push(arr1[i]);\n i++;\n } else {\n results.push(arr2[j]);\n j++;\n }\n }\n while (i < arr1.length) {\n results.push(arr1[i]);\n i++;\n }\n while (j < arr2.length) {\n results.push(arr2[j]);\n j++;\n }\n return results;\n}", "function joinArray(array1, array2){\n array1 = array1.concat(array2);\n let temp;\n for(let i = 0; i < array1.length; i++){\n for(let j = i + 1; j < array1.length; j++){\n if(array1[i] > array1[j]){\n temp = array1[i];\n array1[i] = array1[j];\n array1[j] = temp;\n }\n }\n for(let i = 0; i < array1.length; i++){\n for(let j = i + 1; j < array1.length; j++){\n if(array1[i] === array1[j]){\n array1.splice(j--, 1);\n }\n }\n }\n }\n return array1;\n}", "function merge(arr1, arr2) {\n let emptyArr = [];\n let pointer1 = 0;\n let pointer2 = 0;\n while (emptyArr.length < arr1.length + arr2.length) {\n if (pointer1 === arr1.length) {\n emptyArr.push(arr2[pointer2]);\n pointer2++;\n } else if (pointer2 === arr2.length) {\n emptyArr.push(arr1[pointer1]);\n pointer1++;\n }\n if (arr1[pointer1] < arr2[pointer2]) {\n emptyArr.push(arr1[pointer1]);\n pointer1++;\n } else if (arr1[pointer1] > arr2[pointer2]) {\n emptyArr.push(arr2[pointer2]);\n pointer2++;\n }\n }\n return emptyArr;\n}", "function arrConcat(arr1, arr2){\n var arr = [];\n var index = -1;\n for (var i = 0; i < arr1.length; i++){\n arr[i] = arr1[i];\n index +=1;\n }\n for (var i = 1; i < arr2.length+1; i++){\n arr[index+i] = arr2[i-1]; \n // console.log(arr);\n }\n console.log(arr);\n}", "function union(arrayOne, arrayTwo){\n\tvar combinedArray = arrayOne.concat(arrayTwo);\n\treturn combinedArray.sort();\n\n\n}", "function mergeTwo(arr1, arr2) {\n let output = [];\n let i = 0;\n let j = 0;\n let current = 0;\n\n while (current < (arr1.length + arr2.length)) {\n\n if (arr1[i] < arr2[j]) {\n output[current] = arr1[i];\n i++;\n } else {\n output[current] = arr2[j];\n j++;\n }\n current++;\n }\n return output;\n}", "function merge (left, right) {\n let resultArray = [], leftIndex = 0, rightIndex = 0;\n\n //concatenate values into the resultArray in order\n while (leftIndex < left.length && rightIndex < right.length) {\n if (left[leftIndex] < right[rightIndex]) {\n resultArray.push(left[leftIndex]);\n leftIndex++; // move left array cursor\n } else {\n resultArray.push(right[rightIndex]);\n\t\t\trightIndex++; // move right array cursor\n }\n }\n\n // concat two array after loop\n return resultArray\n .concat(left.slice(leftIndex))\n .concat(right.slice(rightIndex));\n}", "function mergeArray(array1,array2){\n let newarray=[...array1,...array2];\n \n return newarray.sort(function(a,b){return a-b;});\n\n}", "function merge(arr1, arr2) {\n let p1 = 0;\n let p2 = 0;\n let newArr = [];\n\n while (p1 < arr1.length && p2 < arr2.length) {\n if (arr1[p1] > arr2[p2]) {\n newArr.push(arr2[p2]);\n p2++;\n } else {\n newArr.push(arr1[p1]);\n p1++;\n }\n }\n while (p1 < arr1.length) {\n newArr.push(arr1[p1]);\n p1++;\n }\n while (p2 < arr2.length) {\n newArr.push(arr2[p2]);\n p2++;\n }\n return newArr;\n}", "function merge(a, b) {\n const combinedLen = a.length + b.length\n const merged = []\n let idxA = 0\n let idxB = 0\n\n while (merged.length < combinedLen) {\n if (idxB === b.length || a[idxA] < b[idxB]) {\n merged.push(a[idxA++]) // eslint-disable-line\n } else {\n merged.push(b[idxB++]) // eslint-disable-line\n }\n }\n return merged\n}", "function merge(arr1, arr2) {\n let results = []\n let p1 = 0\n let p2 = 0\n while (p1 < arr1.length && p2 < arr2.length) {\n if (arr2[p2] > arr1[p1]) {\n results.push(arr1[p1])\n p1++\n } else {\n results.push(arr2[p2])\n p2++\n }\n }\n\n while (p1 < arr1.length) {\n results.push(arr1[p1])\n p1++\n }\n while (p2 < arr2.length) {\n results.push(arr2[p2])\n p2++\n }\n return results\n}", "mergeArray (sourceArr, extArr) {\n // note: Array.prototype.push.apply(arr1,arr2) is unreliable\n extArr.forEach((el) => {\n sourceArr.push(el)\n })\n }", "function merge(left, right) {\n let arr = [];\n \n while ((left.length >0 ) && (right.length >0)) {\n if (left[0] < right[0]) {\n arr.push(left.shift());\n } else {\n arr.push(right.shift());\n }\n }\n return arr.concat(left.slice().concat(right.slice()));\n }", "function merge(arr1, arr2) {\n let merged = [...arr1, ...arr2];\n return merged.sort((a, b) => a - b);\n}", "function merge_arrays(arr1, arr2) {\n var merged_arr = [];\n var j_start = 0;\n var reached_end = false;\n for (var i = 0; i < arr1.length; i++) {\n for (var j = j_start; j < arr2.length; j++) {\n if (arr1[i] > arr2[j]) {\n merged_arr.push(arr2[j]);\n // Need to improve this to avoid repeating myself.\n } else {\n merged_arr.push(arr1[i]);\n // if last element from i push the rest of arr2\n if (i + 1 >= arr1.length) {\n merged_arr.push(...arr2.slice(j));\n }\n break;\n }\n if (j + 1 >= arr2.length) {\n reached_end = true;\n }\n }\n j_start = j;\n if (reached_end) {\n merged_arr.push(arr1[i]);\n }\n }\n\n return merged_arr;\n}", "function mergesorted(a, b) {\n var aCount = 0;\n var bCount = 0;\n var aLen = a.length;\n var bLen = b.length;\n var result = [];\n \n while (aCount < aLen && bCount < bLen) {\n if (a[aCount] < b[bCount]) {\n result.push(a[aCount])\n aCount++;\n } else {\n result.push(b[bCount])\n bCount++;\n }\n }\n \n if (aCount === aLen) {result = result.concat(b.slice(bCount));}\n if (bCount === bLen) {result = result.concat(a.slice(aCount));}\n \n return result;\n}", "function mergeArray(arr1, arr2) {\n mergedArray = []\n counter1 = 0\n counter2 = 0\n\n while (true) {\n if (counter1 == arr1.length) {\n for (i = counter2; i < arr2.length; i++) {\n mergedArray.push(arr2[i])\n }\n return mergedArray\n }\n if (counter2 == arr2.length) {\n for (i = counter1; i < arr1.length; i++) {\n mergedArray.push(arr1[i])\n }\n return mergedArray\n }\n \n if (arr1[counter1] < arr2[counter2]) {\n mergedArray.push(arr1[counter1])\n counter1++\n } else {\n mergedArray.push(arr2[counter2])\n counter2++\n }\n }\n}", "function mergesorted(a, b) {\n var r = [];\n while(a.length && b.length){\n if(a[0] < b[0]) r.push(a.shift());\n else r.push(b.shift());\n }\n return r.concat(a).concat(b);\n}", "function arrConcat(arr1,arr2){\n var newArr = [];\n for(var i = 0; i < arr1.length + arr2.length; i++){\n if(i < arr1.length){\n newArr.push(arr1[i]);\n }\n else{\n newArr.push(arr2[i-arr1.length]);\n }\n }\n return newArr;\n}", "function merge(array1, array2) {\n let merged = [];\n while (array1.length && array2.length) {\n if (array1[0] < array2[0]) {\n merged.push(array1.shift());\n } else if (array1[0] > array2[0]) {\n merged.push(array2.shift());\n } else {\n merged.push(array1.shift(), array2.shift());\n }\n }\n // Una vez finalizado el ciclo, una matriz está vacía y la otra matriz contiene solo\n // valores mayores que todos los valores en merged\n return [...merged, ...array1, ...array2];\n }", "function mergedSortedArrays (a, b) {\n var merged = [],\n aElement = a[0],\n bElement = b[0],\n i = 1,\n j = 1;\n if (a.length == 0) {\n return b;\n }\n \n if( b.length == 0) {\n return a;\n }\n //As long as there are items in one of the arrays, perform the merge.\n while(aElement || bElement) {\n //if A element exists but B doesn't, or if A element is less than B element, push the A element to the merged array\n if (aElement && !bElement || aElement < bElement) {\n merged.push(aElement);\n aElement = a[i++];\n } else {\n merged.push(bElement);\n bElement = b[j++];\n }\n }\n\n return merged;\n}", "function concat(arr1, arr2) {\n return arr1.concat(arr2);\n }", "function combine(arr1, arr2) {\n\t if (arr2 == null) {\n\t return arr1;\n\t }\n\n\t var i = -1, len = arr2.length;\n\t while (++i < len) {\n\t if (indexOf(arr1, arr2[i]) === -1) {\n\t arr1.push(arr2[i]);\n\t }\n\t }\n\n\t return arr1;\n\t }", "function mergeArrays(arrayFirst, arraySecond) {\n let merged = [];\n let indexFirst = 0;\n let indexSecond = 0;\n\n while (indexFirst < arrayFirst.length && indexSecond < arraySecond.length) {\n if (arrayFirst[indexFirst] < arraySecond[indexSecond]) {\n merged.push(arrayFirst[indexFirst]);\n indexFirst++;\n } else {\n merged.push(arraySecond[indexSecond]);\n indexSecond++;\n }\n }\n\n if (indexFirst < arrayFirst.length) {\n while (indexFirst < arrayFirst.length) {\n merged.push(arrayFirst[indexFirst]);\n indexFirst++;\n }\n }\n\n if (indexSecond < arraySecond.length) {\n while (indexSecond < arraySecond.length) {\n merged.push(arraySecond[indexSecond]);\n indexSecond++;\n }\n }\n\n return merged;\n}", "function concat (array1, array2)\n{\n for (var i = 0 ; i < array2.length ; i++)\n {\n array1.push(array2[i]); \n }\n return array1;\n}", "function merge(arr1,arr2) {\n let results=[];\n let i=0;\n let j=0;\n while(i<arr1.length && j<arr2.length) {\n if(arr1[i]>arr2[j]) {\n results.push(arr2[j]);\n j++;\n } else{\n results.push(arr1[i]);\n i++;\n }\n }\n while(i<arr1.length){\n results.push(arr1[i]);\n i++;\n }\n while(j<arr2.length){\n results.push(arr2[j]);\n j++;\n }\n return results;\n}", "function concatArrays (arr1, arr2) {\n return;\n}", "function merge(arr1, arr2){\n let output = [];\n let i = 0;\n let j = 0;\n while(i < arr1.length && j < arr2.length){\n if(arr1[i] < arr2[j]){\n output.push(arr1[i]);\n i++;\n }else{\n output.push(arr2[j]);\n j++;\n }\n }\n while(i < arr1.length){\n output.push(arr1[i]);\n i++;\n }\n while(j < arr2.length){\n output.push(arr2[j]);\n j++;\n }\n return output;\n}", "function mergeArrays(arr1, arr2) {\n\tvar result = [];\n\tvar pointer1 = 0;\n\tvar pointer2 = 0;\n\n\twhile(pointer1 < arr1.length && pointer2 < arr2.length) {\n\t\tif(arr1[pointer1] < arr2[pointer2]) {\n\t\t\tresult.push(arr1[pointer1]);\n\t\t\tpointer1++;\n\t\t} else {\n\t\t\tresult.push(arr2[pointer2]);\n\t\t\tpointer2++;\n\t\t}\n\t}\n\n\twhile(pointer1 < arr1.length) {\n\t\tresult.push(arr1[pointer1]);\n\t\tpointer1++;\n\t}\n\n\twhile(pointer2 < arr2.length) {\n\t\tresult.push(arr2[pointer2]);\n\t\tpointer2++;\n\t}\n\n\treturn result;\n}", "function concat(firstArray, secondArray) {\n for (var i = 0; i < secondArray.length; i++) {\n firstArray.push(secondArray[i]);\n }\n return firstArray;\n}", "function\tCombine\t\t(first, second)\t\t\t\t\t\t\t// Combine, and concatenate two arrays.\r\n\t{\r\n\t\treturn first.concat(second);\r\n\t}", "async function merge(arr1, arr2, delayMs) { \n // figure out which elements of the original array are in play\n const arr3 = arr1.slice().concat(arr2.slice());\n const indexInPlay = getIndexInPlayList(arr3, renderedArrayMergeSort);\n\n let notInPlay = [];\n let i = 0;\n renderedArrayMergeSort.forEach( pair => {\n if (!indexInPlay.includes(i)) {\n notInPlay.push(i);\n }\n i++\n });\n\n if (delayMs) {\n // render the \n renderArray(pairsToSingle(renderedArrayMergeSort, 0), indexInPlay, notInPlay);\n await timeout(delayMs);\n }\n\n // filter the two arrays passed in\n const joinArrs = sortCombineArrays(arr1, arr2);\n\n // update the array to be rendered\n i = 0;\n indexInPlay.forEach( ind => {\n renderedArrayMergeSort[ind] = joinArrs[i]; \n i++;\n });\n\n return new Promise( resolve => {\n resolve( joinArrs );\n });\n}", "function merge(arr1,arr2){\n var output = []\n //run loop while arr1 & arr2 have a length\n while(arr1.length && arr2.length){\n //if arr1[x] is less than arr2[x] push to output list\n output.push(arr1[0] < arr2[0] ? arr1.shift() : arr2.shift())\n }\n while(arr1.length){\n output.push(arr1.shift())\n }\n while(arr2.length){\n output.push(arr2.shift())\n }\n console.log(output)\n return output\n\n}", "function merge(left, right) {\n let resultArray = [];\n let leftIndex = 0;\n let rightIndex = 0;\n\n //we will concatenate values into the resultArray in order\n while (leftIndex < left.length && rightIndex < right.length) {\n if(left[leftIndex] < right[rightIndex]) {\n resultArray.push(left[leftIndex]);\n leftIndex++; //move left array cursor\n } else {\n resultArray.push(right[rightIndex]);\n rightIndex++; //move right array cursor\n }\n }\n return resultArray.concat(left.slice(leftIndex)).concat(right.slice(rightIndex));\n}", "function merge(arr1, arr2) {\n // Create an empty array to hold our result\n let result = [];\n // Create a pointer for each array\n let i = 0;\n let j = 0;\n // Compare Value in Array 1 to Value in Array 2\n while(i < arr1.length && j < arr2.length) {\n if(arr2[j] > arr1[i]) {\n result.push(arr1[i]);\n // Increment the pointer\n i++;\n } else {\n result.push(arr2[j]);\n // Increment the pointer\n j++;\n }\n }\n // If we have left over values in Array 1 push the rest onto RESULT\n while(i < arr1.length) {\n result.push(arr1[i]);\n i++;\n }\n // If we have left over values in Array 2 push the rest onto RESULT\n while(j < arr2.length) {\n result.push(arr2[j]);\n j++;\n }\n // Return the combined sorted array\n return result;\n}", "function union(arr1, arr2){\n return arr1.concat(arr2);\n}", "function mergeSortedArray(a, b){\n /////// empty array to push the sorted arrays into\n var merged = [];\n /////// starting at the [0] index of the existing first array\n var aElement = a[0];\n /////// starting at the [0] index of the existing second array\n var bElement = b[0];\n /////// for iterating to the next index of the existing arrays\n var i = 1;\n var j = 1;\n /////// While it is either a or b\n while(aElement || bElement) {\n /////// (if this a number and not b number) or (a number is less than b number)\n if((aElement && !bElement) || aElement < bElement) {\n //////// push a number into the merged array\n merged.push(aElement);\n //////// then iterate to the next number in a\n aElement = a[i++];\n } else {\n ////// else push the b number\n merged.push(bElement);\n //// then iterate to the next number in b\n bElement = b[j++];\n }\n }\n return merged; //// returns the new merged number\n}" ]
[ "0.6954699", "0.6610238", "0.6475205", "0.64210343", "0.64019394", "0.6389138", "0.6382141", "0.63683087", "0.6358739", "0.63477653", "0.6313073", "0.631112", "0.6281394", "0.627489", "0.62728834", "0.62665325", "0.62655294", "0.6260682", "0.6214105", "0.620859", "0.6207264", "0.6203166", "0.6197331", "0.6183131", "0.6183015", "0.61777407", "0.61715984", "0.616699", "0.61604017", "0.61573184", "0.6147396", "0.6146655", "0.61284053", "0.61268866", "0.61213315", "0.61091197", "0.6103746", "0.6100304", "0.6085239", "0.60829246", "0.60818547", "0.60810524", "0.6074539", "0.6060106", "0.60567206", "0.6050591", "0.6044133", "0.6036066", "0.60302967", "0.6029832", "0.60290426", "0.6023109", "0.60143733", "0.60133094", "0.6006457", "0.5999222", "0.5999091", "0.59961903", "0.59960824", "0.5995774", "0.5995024", "0.5994062", "0.5990972", "0.5985466", "0.5982653", "0.5979158", "0.5977322", "0.5971429", "0.59714", "0.59703803", "0.59687704", "0.59641135", "0.5962682", "0.59625417", "0.59616464", "0.5959887", "0.5950448", "0.59464484", "0.5943263", "0.59370285", "0.5928374", "0.5922268", "0.59183735", "0.5907244", "0.58983237", "0.58949846", "0.5891714", "0.5885601", "0.58832955", "0.5880442", "0.5880076", "0.5879492", "0.5875037", "0.5871226", "0.58618206", "0.5858175", "0.58580345", "0.58568174", "0.58551955", "0.58528167", "0.5851694" ]
0.0
-1
Inventory handling managing the database of network elements (nodes)
function node_new(new_node_id) { if (new_node_id in nodes) { consoleWarn("Trying to add already existing node '" + new_node_id + "'."); return; } consoleLog("Adding new node: '" + new_node_id + "'."); nodes[new_node_id] = { events: [], load: [], state: { updated: 0, owner: null, }, vms: {}, }; // monitor that new node once nodes_monitored.push('&,' + new_node_id); nodes_redraw = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inventory() { }", "function addInventory() {\n var sqlQuery = 'SELECT * FROM products';\n connection.query(sqlQuery, function(error, data) {\n if (error) throw error;\n selectAddInventory(data);\n });\n}", "function inventory() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n displayForManager(res);\n purchasePrompt();\n });\n}", "function itemInventoryTable() { }", "function inventory(){\n connection.query(\"SELECT * FROM products\", function(err, res){\n if (err) throw err;\n res.forEach(function(item){\n console.log(`Item Name: ${item.product_name} \\n Department: ${item.department_name} \\n Price: ${item.price} \\n Quantity: ${item.stock_quantity}`);\n console.log(\"----------------------------------------------------\")\n })\n returntoMenu();\n });\n}", "function Inventory() {\n var inventory = this;\n this.elements = new ElementSet(this);\n this.tools = [];\n\n // What should go in the inventory\n var moveTool = new toolTypes.Move(this, \"Move\", \"move\");\n this.defaultTool = moveTool;\n this.addTool(moveTool);\n\n // Define tools for each of the active elements\n $.each(ElementSet.activeElements, function(index, element) {\n var addElementTool = new toolTypes.Add(inventory, {\n type : 'element',\n label : element.symbol,\n id : \"add_\" + element.symbol,\n element : element,\n rate : 5,\n });\n inventory.addTool(addElementTool);\n });\n\n var reactions = [{\n input : {\n \"hydrogen\" : 2,\n \"helium\" : 1,\n \"minTemp\" : 1000,\n },\n output : {\n \"gold\" : 1,\n \"adamantium\" : 20,\n \"heat\" : 100,\n }\n }, {\n input : {\n \"carbon\" : 2,\n \"oxygen\" : 1,\n \"minTemp\" : 5000,\n },\n output : {\n \"iron\" : 1,\n \"heat\" : -10000,\n }\n }];\n\n // Add heat and cold tools\n var heatTool = new toolTypes.Add(inventory, {\n type : 'temperature',\n label : \"Heat\",\n id : \"add_heat\",\n rate : 50,\n });\n\n var coldTool = new toolTypes.Add(inventory, {\n type : 'temperature',\n label : \"Cold\",\n id : \"add_cold\",\n rate : -50,\n });\n\n inventory.addTool(heatTool);\n inventory.addTool(coldTool);\n\n // Add inflate and squeeze tools\n var squeezeTool = new toolTypes.Add(inventory, {\n type : 'pressure',\n label : \"Squeeze\",\n id : \"add_pressure\",\n rate : 50,\n });\n\n var inflateTool = new toolTypes.Add(inventory, {\n type : 'pressure',\n label : \"Inflate\",\n id : \"sub_pressure\",\n rate : -50,\n });\n\n inventory.addTool(squeezeTool);\n inventory.addTool(inflateTool);\n\n var spawnables = [{\n name : \"Star\",\n constructor : particleTypes.Star,\n spacing : 50\n }];\n\n $.each(spawnables, function(index, spawnable) {\n var spawnTool = new toolTypes.Spawn(inventory, \"Spawn \" + spawnable.name, \"spawn\" + \"_\" + spawnable.name);\n inventory.addTool(spawnTool);\n\n });\n\n this.defaultTool.activate();\n }", "function displayInventory() {\n\tconnection.query('SELECT * FROM Products', function (err, res) {\n\t\tif (err) { console.log(err) };\n\t\tvar table = new Table({\n\t\t\thead: ['item_id', 'item_name', 'department_name', 'price', 'stock_quantity'],\n\t\t\tcolWidths: [10, 30, 30, 20, 20]\n\t\t});\n\t\tfor (i = 0; i < res.length; i++) {\n\t\t\ttable.push(\n\t\t\t\t[res[i].item_id, res[i].product_name, res[i].department_name, res[i].price, res[i].stock_quantity]\n\t\t\t);\n\t\t}\n\t\tconsole.log(table.toString());\n\t\tinventoryUpdates();\n\t});\n}", "function addInventory() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n\n console.log(\"ID | QUANTITY | ITEM(PRICE)\");\n console.log(\"-----+----------+----------------------------\");\n for (var i = 0; i < res.length; i++) {\n var id = res[i].item_id.toString() + \" \"; \n var stock = res[i].stock_quantity.toString() + \" \";\n console.log(id.substr(0,4) + \" | \" + stock.substr(0,6)+ \" | \" + res[i].product_name + \" ($\" + res[i].price + \")\");\n }\n console.log(\"-----+----------+----------------------------\");\n //connection.end();\n addInventoryProduct(res);\n });\n}", "function listInventory() {\n //Variable creation from DB connection\n connection.query(\"SELECT * FROM products\", function (err, results) {\n for (var i = 0; i < results.length; i++) {\n\n var itemId = results[i].item_id,\n productName = results[i].product_name,\n price = results[i].price,\n stockQuantity = results[i].stock_quantity;\n\n table.push(\n [itemId, productName, price, stockQuantity]\n );\n }\n console.log(\"\");\n console.log(chalk.blue(\"==================================== \") + chalk.yellowBright(\"CURRENT BAMAZON PRODUCT INVENTORIES\") + chalk.blue(\" =========================================\"));\n console.log(\"\");\n console.log(chalk.greenBright(table.toString()));\n console.log(\"\");\n console.log(\"\");\n console.log(\"\");\n newTransaction();\n // connection.end();\n });\n }", "function showInventory() {\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n console.table(results);\n selectItem();\n })\n}", "function populateInventory() {\n\tvar baseDiv = document.getElementById(\"baseItems\");\n\tvar baseChildren = baseDiv.childNodes;\n\tfor (var i = 0; i < baseChildren.length; i++) {\n\t\tbaseDiv.removeChild(baseChildren[i]);\n\t}\n\tvar p = document.createElement(\"p\");\n\tp.innerHTML = \"There are currently no items defined; please add some if you wish your customers to be able to place an order. here are a few things to remember:<ul><li>Each combination of name and type must be unique.</li><li>types may not contain blank spaces.</li><li>Types are used to group items together so that the customer may choose one of them, which means:</li><ul><li>Types holding multiple items will be presented to the customer as an option group.</li><li>Types containing a single item will be presented to the customer as an optional (checkbox) item.</li><li>Since all base items are required, it only makes sense to have types with single item in the optional group</li></ul></ul>\";\n\tif (baseItems.count === 0) {\n\t\tbaseDiv.appendChild(p);\n\t} else {\n\t\tvar table = getTableFromGroup(baseItems);\n\t\ttable.getElementsByTagName(\"caption\")[0].innerHTML = \"Inventory: Base Items\";\n\t\tbaseDiv.appendChild(table);\n\t}\n\tvar optionalDiv = document.getElementById(\"optionalItems\");\n\tvar optionalChildren = optionalDiv.childNodes;\n\tfor (var i = 0; i < optionalChildren.length; i++) {\n\t\toptionalDiv.removeChild(optionalChildren[i]);\n\t}\n\tif (optionalItems.count === 0 && baseItems.count > 0) {\n\t\tp.innerHTML = p.innerHTML.replace(\"items\", \"optional items\");\n\t\toptionalDiv.appendChild(p);\n\t} else {\n\t\tvar table = getTableFromGroup(optionalItems);\n\t\ttable.getElementsByTagName(\"caption\")[0].innerHTML = \"Inventory: Optional Items\";\n\t\toptionalDiv.appendChild(table);\n\t}\n}", "function createInventory() {\n\tvar newInventory = [];\n\tcolumnHeights = [0,0,0,0,0,0,0,0,0,0];\n\tfor (var i=0;i<10;i++) {\n\t\t//push a blank array to represent each column of the inventory\n\t\tnewInventory.push([]);\n\t}\n\n\t//set the previous inventory to the latest inventory used\n\tpreviousInventory = nextInventory || currentInventory || undefined;\n\t//the new blank inventory is now the current inventory\n\tcurrentInventory = newInventory;\n}", "function viewProducts(query){\n \n //query mysql to see all info in table\n connection.query(query,\n function(err, res){\n if (err) throw err;\n // connection.end();\n itemsList=[];\n for (var i=0; i<res.length;i++){\n var item={}; //obj of each item for sale, holds...\n item.id=res[i].item_id; //item id from results\n item.name=res[i].product_name; //name\n item.price=res[i].price; //price\n item.quantity=res[i].stock_quantity; //quantity\n item={id:item.id, name:item.name, price:item.price, quantity:item.quantity};//put info into object\n itemsList.push({item:item}); //push object into array holding all items\n if (!addingInventory){\n console.log(item.id+\" \"+item.name+\" $\"+item.price+\" \"+item.quantity);\n };\n }\n console.log(\"\\n\"); \n // console.log(itemsList); \n if (!addingInventory){menu();}\n else {addInventory();};\n }\n );\n}", "function inventory() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n //organizes the collumns i wish to display for each item\n for (var i = 0; i < res.length; i++) {\n console.log(`ID: ${res[i].id} || Name: ${res[i].product_name} || Department: ${res[i].department_name} || Price: $${res[i].price}`)\n }\n shopping();\n })\n}", "recordInventory(){\r\n this._listProduct();\r\n }", "function getInventory() {\n connection.query(\"SELECT * FROM products\", function(err, inventoryRes) {\n if (err) {\n console.log(\"ERROR: \", err);\n }\n\n console.log(\"CURRENT INVENTORY: \");\n printTable(inventoryRes);\n console.log(\"\");\n\n purchase();\n });\n}", "function displayInventory() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity);\n }\n console.log(\"-----------------------------------\");\n });\n }", "constructor(inv){\n this.inventory = inv;\n }", "function computeItemNode() {\n items.forEach(function (item) {\n item.node.forEach(function (node) {\n var node_id = node;\n node = {};\n node.cluster = nodes[node];\n })\n item.start.node_id = item.start.node;\n item.start.node = nodes[item.start.node_id];\n })\n\n }", "function loadXMLInventories(xml) {\n\t\t\t\n\t\tvar i;\n\t\tvar xmlDoc = xml.responseXML;\n\t\tif(xmlDoc==null){ siteOfflineError();}\n\t\t\n\t\tvar list = document.getElementById(\"elementGrid\");\n\t\tvar x = xmlDoc.getElementsByTagName(\"inventory\");\n\n\t\tlist.innerHTML = \"\";\n\t\t\n\t\tfor (i = 0; i <x.length; i++) { \n\t\t\tvar inventory = [];\n\t\t\tinventory.id = x[i].getElementsByTagName(\"id\")[0].childNodes[0].nodeValue;\n\t\t\tinventory.name = x[i].getElementsByTagName(\"name\")[0].childNodes[0].nodeValue;\n\t\t\tinventory.color = x[i].getElementsByTagName(\"color\")[0].childNodes[0].nodeValue;\n\t\n\t\t\tlist.innerHTML+=inventoryString(inventory);\n\t\t}\n\t\t\n\t\t//aggiorno le dimensioni\n\t\tonResize();\n}", "function displayInventory() {\n\tconnection.query('SELECT * FROM products', function(err, res){\n\t\tif (err) throw err;\n console.log('=============================What would you like to buy?==============================');\n \n for(var i = 0; i<res.length;i++){\n console.log(\"ID: \" + res[i].item_id + \" | \" + \n \"Product: \" + res[i].product_name + \" | \" + \n \"Department: \" + res[i].department_name + \" | \" + \n \"Price: \" + res[i].price + \" | \" + \n \"QTY: \" + res[i].stock_quantity);\n console.log('======================================================================================'); \n };\n buyItem();\n });\n}", "function readInventory() {\n connection.query(\" SELECT * FROM products \", function(err, res) {\n if (err) throw err;\n\n console.log(\"====================Processing====================\");\n console.log(\"====================Completed=====================\");\n // For loop to display all current products id, name, price, and quantity\n for (var i = 0; i < res.length; i++) {\n console.log(\"Product ID : \" + res[i].item_id +\n \" || Product: \" + res[i].product_name + \n \" || Price: $\" + res[i].price + \n \" || Stock: \" + res[i].stock_quantity + \n \" || Product Sales: $\" + res[i].product_sales + \n \"\\n\");\n }\n nexusBuildsProbes()\n });\n}", "function viewProducts() {\n console.log('Here is the current inventory: ');\n var table = new Table({\n head: ['Item ID', 'Product Name', 'Price', 'Quantity']\n });\n connection.query(\"SELECT * FROM products\", function (err, res) {\n for (let i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, res[i].price, res[i].stock_quantity]\n );\n }\n console.log(table.toString());\n console.log('\\n*******************');\n managerOptions();\n })\n}", "save_inventory()\n\t{\n\t\tvar Player = this;\n\t\t\n\t\t$( \"#inventory > li\" ).each(function( index ) {\n\t\t\tlet name = \"\";\n\t\t\tlet desc = \"\";\n\t\t\tlet nb = \"\";\n\n\t\t\tname = $(this).find(\"#name_item\").text();\n\t\t\tdesc = $(this).find(\"#desc_item\").text();\n\t\t\tnb = $(this).find(\"#nb_item\").val();\n\t\t\tif (nb == \"\" ||nb == null)\n\t\t\t\tnb = 0;\n\t\t\tPlayer.inventory[name].desc = desc;\n\t\t\tPlayer.inventory[name].nb = nb;\n\t\t});\n\t}", "function showInventory() {\n var query = \"SELECT * FROM products\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n var table = new Table({\n chars: {\n 'top': '═', 'top-mid': '╤', 'top-left': '╔', 'top-right': '╗'\n , 'bottom': '═', 'bottom-mid': '╧', 'bottom-left': '╚', 'bottom-right': '╝'\n , 'left': '║', 'left-mid': '╟', 'mid': '─', 'mid-mid': '┼'\n , 'right': '║', 'right-mid': '╢', 'middle': '│'\n }, head: ['ID', 'PRODUCT', 'DEPARTMENT', 'PRICE', 'IN STOCK']\n });\n for (let i = 0; i < res.length; i++) {\n table.push([res[i].item_id, res[i].product_name, res[i].department_name, res[i].price, res[i].stock_quantity]);\n }\n console.log(table.toString());\n menu();\n });\n}", "function addInventory(){\n\tconsole.log(\"Take a look! Products are listed as ID#) ITEM | QUANTITY(#)\");\n\n\tvar ids = [];\n\n\t// Query: Read information from the products table\n\tconnection.query(\"SELECT * FROM products\", function(itemsErr, itemsRes){\n\t\tif (itemsErr) throw itemsErr;\n\n\t\tfor (var k = 0; k < itemsRes.length; k++){\n\t\t\tvar itemsDisplay = itemsRes[k].item_id + \") \" + itemsRes[k].product_name + \" | quantity: \" + itemsRes[k].stock_quantity;\n\t\t\tids.push(itemsRes[k].item_id);\n\t\t\tconsole.log(itemsDisplay);\n\t\t}\n\n\t\t// Prompt user to select an item by id and to enter the units they want\n\t\t// to add to the stock\n\t\tinquirer.prompt([{\n\t\t\ttype: \"input\",\n\t\t\tmessage: \"Enter the id of the product you want to stock: \",\n\t\t\tname: \"itemEntered\",\n\t\t\tvalidate: function(value){\n\t\t\t\t// If the entry is a product that is listed...\n\t\t\t\tif (ids.indexOf(parseInt(value)) > -1) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},{\n\t\t\ttype: \"input\",\n\t\t\tmessage: \"Enter the number of units you want to stock: \",\n\t\t\tname: \"quantityEntered\",\n\t\t\tvalidate: function(stock){\n\t\t\t\t// If the entry is a number and an integer...\n\t\t\t\tif (isNaN(stock) === false && Number.isInteger(Number(stock)) === true) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}]).then(function(selectionAnswers){\n\t\t\tvar product = parseInt(selectionAnswers.itemEntered);\n\t\t\tvar quantity = parseInt(selectionAnswers.quantityEntered);\n\t\t\tvar chosenItem;\n\n\t\t\t// Match user's selection to product from the bamazon table\n\t\t\tfor (var l = 0; l < itemsRes.length; l++) {\n\t\t\t\tif (product === itemsRes[l].item_id) {\n\t\t\t\t\tchosenItem = itemsRes[l];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// New quantity reflecting stock added\n\t\t\tvar updatedQuantity = quantity + chosenItem.stock_quantity;\n\n\t\t\t// Query: Updates the stock_quantity to reflect the stock changes\n\t\t\tconnection.query(\"UPDATE products SET ? WHERE ?\", [{\n\t\t\t\tstock_quantity: updatedQuantity\n\t\t\t},{\n\t\t\t\titem_id: chosenItem.item_id\n\t\t\t}], function(addStockErr, addStockRes){\n\t\t\t\tif (addStockErr) throw addStockErr;\n\n\t\t\t\tconsole.log(quantity + \" unit(s) was added to \" + chosenItem.product_name);\n\n\t\t\t\t// Asks user if they want to continue adding inventory or return\n\t\t\t\t// to Main Menu\n\t\t\t\tinquirer.prompt([{\n\t\t\t\t\ttype: \"confirm\",\n\t\t\t\t\tname: \"restartAddStock\",\n\t\t\t\t\tmessage: \"Would you like to continue adding inventory?\"\n\t\t\t\t}]).then(function(restartStock){\n\t\t\t\t\tif (restartStock.restartAddStock === true) {\n\t\t\t\t\t\taddInventory();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\trestartMenu(); \n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n}", "function lowinventory() {\n console.log(\"Low inventory items: \");\n var tableLow = new Table({\n head: ['Item ID', 'Product Name', 'Quantity']\n });\n connection.query(\"SELECT item_id, product_name, stock_quantity FROM products WHERE stock_quantity <= 5\", function (err, res) {\n for (let j = 0; j < res.length; j++) {\n tableLow.push(\n [res[j].item_id, res[j].product_name, res[j].stock_quantity]\n );\n }\n console.log(tableLow.toString());\n console.log('\\n*******************');\n managerOptions();\n })\n}", "function displayInventory() {\n\t// console.log('___ENTER displayInventory___');\n\n\t// Construct the db query string\n\tqueryStr = 'SELECT * FROM products';\n\n\t// Make the db query\n\tconnection.query(queryStr, function(err, data) {\n\t\tif (err) throw err;\n\n\t\tconsole.log('Existing Inventory: ');\n\t\tconsole.log('...................\\n');\n\n\t\tvar strOut = '';\n\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\tstrOut = '';\n\t\t\tstrOut += 'Item ID: ' + data[i].item_id + ' // ';\n\t\t\tstrOut += 'Product Name: ' + data[i].product_name + ' // ';\n\t\t\tstrOut += 'Department: ' + data[i].department_name + ' // ';\n\t\t\tstrOut += 'Price: $' + data[i].price + '\\n';\n\n\t\t\tconsole.log(strOut);\n\t\t}\n\n\t \tconsole.log(\"---------------------------------------------------------------------\\n\");\n\n\t \t//Prompt the user for item/quantity they would like to purchase\n\t \tpromptUserPurchase();\n\t})\n}", "function Inventory() {\n this.action = ACTION;\n this.status = STATUS;\n}", "function displayInventory() {\n //retrieving all fields\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) {\n throw err;\n console.log(\"Unable to connect to Inventory Management System.\\n\".red);\n } \n console.log(\"\\nCurrent Inventory:\\n\".bold.cyan);\n //reset table so it is refreshed each time function is called\n tto.reset();\n //using terminal-table-output package for formatting, first line is header\n tto.pushrow([\"item_id\", \"product_name\", \"department_name\", \"price\", \"stock_quantity\"]).line();\n for(i = 0; i < res.length; i++) {\n //passing in table data retrieved with query, row by row\n tto.pushrow([res[i].item_id,res[i].product_name,res[i].department_name,res[i].price,res[i].stock_quantity]);\n //once final row has been read in, print to console\n if(i === res.length - 1) {\n tto.print(true);\n }\n }\n //calling manager menu function\n managerMenu();\n });\n \n}", "update() {\n const location = this.hero.getPlayerLoc();\n const terrain = this.hero.getPlayerLocInfo();\n const money = this.hero.getMoney();\n const energy = this.hero.getEnergy();\n let item = this.hero.getPlayerLocItem();\n const inventory = this.hero.getPlayerInventory();\n if(inventory.length > this.currInvLen) {\n this.updateInventory();\n }\n\n const locationText = `Current Location: (${location.x + 1}, ${location.y + 1})`;\n const moneyText = `Whiffles: ${money}`;\n const energyText = `Energy: ${energy}`;\n const terrainText = `Terrain: ${terrain}`;\n if (item !== \"None\") {\n item = item.name;\n }\n const itemText = `Item: ${item}`;\n const invText = `Inventory: ${invItems.toString()}`;\n\n try {\n this.lNode.replaceData(0, 50, locationText);\n this.eNode.replaceData(0, 50, energyText);\n this.mNode.replaceData(0, 50, moneyText);\n this.tNode.replaceData(0, 50, terrainText);\n this.iNode.replaceData(0, 50, itemText);\n this.inNode.replaceData(0, 50, invText);\n } catch (err) {\n // Makes sure duplicates are not created during HMR\n this.displayEl.innerHTML = \"\";\n this.createNodes();\n }\n\n\n return true;\n }", "function displayInventory() {\n\tqueryStr = 'SELECT * FROM bamazondb.products';\n\tconnection.query(queryStr, function(err, data) {\n\t\tif(err) throw err;\n\n\t\tconsole.log(\"Current Inventory: \");\n\t\tconsole.log(\"...........................................................................................................\\n\");\n\n\t\tvar strOut = '';\n\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\tstrOut = '';\n\t\t\tstrOut = 'Item ID: ' + data[i].item_id + ' // ';\n\t\t\tstrOut += 'Product Name: ' + data[i].product_name + ' // ';\n\t\t\tstrOut += 'Department: ' + data[i].department_name + ' // ';\n\t\t\tstrOut += 'Price: $' + data[i].customer_price + ' // ';\n\t\t\tstrOut += 'Quantity: ' + data[i].stock_quantity + '\\n';\n\n\t\t\tconsole.log(strOut);\n\t\t}\n\n\t\tconsole.log(\"-----------------------------------------------------------------------------------------------------------\\n\");\n\t\tpromptUserPurchase();\n\t})\n}", "function showInventory() {\n connection.query('SELECT ItemID, ProductName, Price FROM products', function(err, rows, fields) {\n if (err) throw err;\n console.log('Available products:');\n for(var i = 0; i < rows.length; i++) {\n console.log('Item ID: ' + rows[i].ItemID + ' Product Name: ' + rows[i].ProductName + ' Price: $' + rows[i].Price);\n }\n runPrompt();\n });\n}", "function updateInventory(newInventory) {\n setInventory(newInventory)\n\n }", "function listinventory() {\n\n //Variables from my DataBase\n \n connection.query(\"SELECT * FROM products\", function(err,res) {\n for (var i = 0; i < res.lenght; i++) {\n\n var itemId = res[i].item_id,\n productName = res[i].product_name,\n departmentName = res[i].department_name,\n price = res[i].price,\n stockQuantity = res[i].stock_quantity;\n\n table.push(\n [itemId, productName, departmentName, price, stockQuantity]\n );\n }\n console.log(\"\");\n console.log(\"============================ Zohars Bamazon inventory =================\");\n console.log(\"\");\n console.log(table.toString());\n console.log(\"\");\n continuePrompt();\n });\n\n \n }", "function enable_inventory(maxItems) {\n if (this.prototype) {\n this.prototype.pickupItem = function(item) {\n if (this.items.size < this.maxItems) {\n this.items.set(item.id,item)\n item.owner = this\n }\n }\n this.prototype.dropItems = function(itemsArr) {\n\n // drop item(s) should drop an item beacon with contents = item(s)\n\n }\n }\n else {\n this.items = new Map()\n this.maxItems = maxItems || 1\n }\n }", "function addInventory() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err;\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"---------------------------------------\" + \n\t\t\t\"\\nItem Id: \" + res[i].item_id + \"\\nProduct: \" + \n\t\t\tres[i].product_name + \"\\nPrice: \" + res[i].price + \n\t\t\t\"\\nQuantity in Stock: \" + res[i].stock_quantity);\n\t\t}\n\t\tinquirer.prompt([\n\t\t\t{\n\t\t\t\tname: \"id\",\n\t\t\t\tmessage: \"Please enter the 'Item Id' of the product you would like to increase inventory for:\",\n\t\t\t\tvalidate: function(value) {\n\t\t\t\t\tif (isNaN(value) === false) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"quantity\",\n\t\t\t\tmessage: \"Please enter the quantity of the product you would like to add to inventory:\",\n\t\t\t\tvalidate: function(value) {\n\t\t\t\t\tif (isNaN(value) === false) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t]).then(function(answers) {\n\t\t\tvar chosenItem;\n\t\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\t\tif (res[i].item_id === parseInt(answers.id)) {\n\t\t\t\t\tchosenItem = res[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tconnection.query(\"UPDATE products SET ? WHERE ?\", [{stock_quantity: parseInt(chosenItem.stock_quantity) + parseInt(answers.quantity)}, {item_id: chosenItem.item_id}], function(err, res) {\n\t\t\t\tif (err) throw err;\n\t\t\t\tconsole.log(\"Inventory added succesfully.\");\n\t\t\t\tstartOver();\n\t\t\t});\n\t\t});\n\t});\n}", "function obtainItem() {\n if (itemObtainingOK) {\n //Is Thor next to an item?\n if (thor.nextToType == \"Item\") {\n //work out which item\n for (var i = 0; i < thor.currentTile.items.length; i++) {\n //find the item within the currentTile.items array\n if (thor.currentTile.items[i].id == thor.nextToID) {\n // increase health to 100 if powerup taken\n if (thor.nextToID == \"powerup\") {\n thor.health = 100;\n console.log(\"Yummy powerup!\");\n\n underText1 = \"Yummy powerup!\";\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n } else {\n //add it to Thors inventory\n thor.items.push(thor.currentTile.items[i]);\n console.log(thor.currentTile.items[i].name + \": added to Thors inventory\");\n underText1 = (thor.currentTile.items[i].name + \": added to Thors inventory\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n //change NPC chat if required, loop through each and update a required\n for (var k = 0; k < thor.currentTile.npcs.length; k++) {\n if (typeof thor.currentTile.npcs[k].dialogueList[1] !== 'undefined') {\n thor.currentTile.npcs[k].currentDialogue = thor.currentTile.npcs[k].dialogueList[2];\n thor.currentTile.npcs[k].chatPosition = 0;\n }\n }\n //if its a key, unlock door key is for\n if (thor.currentTile.items[i].id == \"key\") {\n thor.currentTile.items[i].unlocks.locked = false;\n }\n }\n\n //remove it from the current tile\n thor.currentTile.items.splice(i, 1);\n\n //enable inventory to be shown directly after pick up, without need to move\n thor.nextToID = \"nothing\";\n thor.nextToType = \"nothing\";\n\n //No need to complete redundent cycles of for loop\n break;\n\n }\n }\n }\n //Is Thor next to an NPC?\n else if (thor.nextToType == \"NPC\") {\n //work out which NPC\n for (var j = 0; j < thor.currentTile.npcs.length; j++) {\n //find the npc within the currentTile.items array\n if (thor.currentTile.npcs[j].id == thor.nextToID) {\n //does the NPC have a questItem\n\n if (thor.currentTile.npcs[j].questItem === undefined) {\n console.log(thor.currentTile.npcs[j].name.toUpperCase() + \": Sorry, nothing to give you, onwards with your quest!\");\n underText1 = (thor.currentTile.npcs[j].name.toUpperCase() + \": Sorry, nothing to give you, onwards with your quest!\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n //NPC - nothing to give convo\n } else if (thor.items.indexOf(thor.currentTile.npcs[j].questItem) == -1) {\n //if Thor doesn't already have item, add the whole object\n thor.items.push(thor.currentTile.npcs[j].questItem);\n console.log(thor.currentTile.npcs[j].questItem.name + \": added to Thors inventory\");\n underText1 = (thor.currentTile.npcs[j].questItem.name + \": added to Thors inventory\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n if (thor.currentTile.npcs[j].questItem.id == \"key\") {\n //console.log(\"State 1: \" + thor.currentTile.npcs[j].questItem.id); \t\t\t\t\t\n thor.currentTile.npcs[j].questItem.unlocks.locked = false;\n //console.log(\"State 2: \" + thor.currentTile.items[m].unlocks.locked);\t \n }\n\n\n /*\n \t\t\t\tconsole.log(\"current tile id: \" +thor.currentTile.id + \" length: \" + thor.currentTile.items.length);\n //if thor is being given a key, unlock door{\n \t\t\tfor (var m = 0; m < thor.currentTile.items.length; m++) { \t\n \t\t\t\tconsole.log(\"All items: \" + thor.currentTile.items[m].id);\n \tif (thor.currentTile.items[m].id == \"key\") {\n \t\t\t\t\tconsole.log(\"State 1: \" + thor.currentTile.items[m].unlocks.locked);\n \t thor.currentTile.items[m].unlocks.locked = false;\n \t\t\t\t\tconsole.log(\"State 2: \" + thor.currentTile.items[m].unlocks.locked);\t \n \t }\n }\n */\n\n\n\n //Updating the NPC's conversation array based on\n if (thor.currentTile.npcs[j].convoStatus == \"Initial\") {\n //Make sure the NPC has a secondary conversation set up, if so use it\n if (thor.currentTile.npcs[j].dialogueList.length > 1) {\n //Move the array to point to the next item\n thor.currentTile.npcs[j].currentDialogue = thor.currentTile.npcs[j].dialogueList[1];\n //start at the beginning of the array\n thor.currentTile.npcs[j].chatPosition = 0;\n //Update NPC for next convo\n thor.currentTile.npcs[j].convoStatus = \"Given\";\n }\n }\n /*\n else if (convoStatus == \"Given\" && thor.currentTile.npcs[i].id == <specificNPC> ){\n Specific use cases for setting NPC conversation can be put in here\n }\n */\n } else {\n console.log(thor.currentTile.npcs[j].questItem.name + \": already in Thors inventory\");\n underText1 = (thor.currentTile.npcs[j].questItem.name + \": already in Thors inventory\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n }\n\n //No need to complete redundent cycles of for loop\n break;\n }\n }\n } else if (thor.nextToType == \"Obstacle\") {\n //Work out which obstacle\n //The Obstacle array contains wall obstacles as well as game obstacles\n //Need to filter out the wall obstacles\n var replacementObstacleArray = [];\n for (var a = 0; a < thor.currentTile.obstacles.length; a++) {\n if (thor.currentTile.obstacles[a].id != \"wall\") {\n replacementObstacleArray.push(thor.currentTile.obstacles[a]);\n }\n }\n for (var m = 0; m < replacementObstacleArray.length; m++) {\n\n //find the npc within the currentTile.items array\n if (replacementObstacleArray[m].id == thor.nextToID) {\n //does the obstacle have a questItem\n if (replacementObstacleArray[m].questItem === undefined) {\n console.log(\"I'm a mere obstacle, move along!\");\n } else if (thor.items.indexOf(replacementObstacleArray[m].questItem) == -1) {\n //if Thor doesn't already have item, add the whole object\n thor.items.push(replacementObstacleArray[m].questItem);\n console.log(replacementObstacleArray[m].questItem.name + \": added to Thors inventory\");\n underText1 = (replacementObstacleArray[m].questItem.name + \": added to Thors inventory\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n } else {\n console.log(replacementObstacleArray[m].questItem.name + \": already in Thors inventory\");\n underText1 = (replacementObstacleArray[m].questItem.name + \": already in Thors inventory\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n }\n\n //No need to complete redundent cycles of for loop\n break;\n }\n }\n } else if (thor.nextToType == \"PuzzlePeice\") {\n\n //Is Thor next to an puzzle Obstacle?\n if (thor.nextToType == \"PuzzlePeice\" && !thor.currentTile.PuzzleComplete) {\n //work out which obstacle\n for (var i = 0; i < thor.currentTile.PuzzlePeices.length; i++) {\n //find the item within the currentTile.items array\n if (thor.currentTile.PuzzlePeices[i].id == thor.nextToID) {\n\n //If a colour is defined in original instantiation of object, it is assumed colour is to be cycled\n if (thor.currentTile.PuzzlePeices[i].colour != undefined) {\n thor.currentTile.PuzzlePeices[i].colour = thor.currentTile.PuzzlePeices[i].allPossibleVals[thor.currentTile.PuzzlePeices[i].puzzlePointer];\n } else if (1 === 0) {\n //A deliberate false above as this is just a placeholder for expected future code.\n //This is the code to cater for cycling images if puzzle obstacle instantiated with an image.\n }\n\n\n if (thor.currentTile.PuzzlePeices[i].puzzleCompleteVal == thor.currentTile.PuzzlePeices[i].allPossibleVals[thor.currentTile.PuzzlePeices[i].puzzlePointer]) {\n thor.currentTile.PuzzlePeices[i].puzzleSuccess = true;\n //Now go over all of the title puzzle items, if they are all set correctly then perform action!\n var puzzleCompleted = true;\n for (var j = 0; j < thor.currentTile.PuzzlePeices.length; j++) {\n if (thor.currentTile.PuzzlePeices[j].puzzleSuccess === false) {\n puzzleCompleted = false;\n }\n }\n\n\n if (puzzleCompleted) {\n thor.currentTile.PuzzleComplete = true;\n //console.log(\"PUZZLE COMPLETED! - KICKING OFF SUPPLIED PUZZLE FUNCTION!\");\n\n //Wall alert flash to let player know puzzle complete\n var backgroundAlert = thor.currentTile.colour;\n thor.currentTile.colour = \"#ffff\";\n window.setTimeout(function(){\n thor.currentTile.colour = backgroundAlert;\n }, 250);\n\n //Is an item being placed?\n if (thor.currentTile.hasOwnProperty(\"itemToPlace\")) {\n thor.currentTile.targetMapTile.items.push(thor.currentTile.itemToPlace);\n \n\n } \n //Does NPC chat need to be updated?\n if (thor.currentTile.hasOwnProperty(\"newChatNPC_id\")) {\n //find out which NPC\n for (var k = 0; k < thor.currentTile.npcs.length; k++) {\n if (thor.currentTile.npcs[k].id == thor.currentTile.newChatNPC_id) {\n thor.currentTile.npcs[k].currentDialogue = thor.currentTile.npcs[k].dialogueList[2];\n //start any new dialogue from beginning, irrispective of where last one finished\n thor.currentTile.npcs[k].chatPosition = 0;\n }\n }\n } \n \n //Is key being issued? Then unlock the door on the given tile\n for (var m = 0; m < thor.currentTile.items.length; m++) {\n //if its a key, unlock door key is for\n if (thor.currentTile.items[m].id == \"key\") {\n thor.currentTile.items[m].unlocks.locked = false;\n }\n }\n }\n } else {\n //ensure that value is correct is used if user cycles past correct value\n thor.currentTile.PuzzlePeices[i].puzzleSuccess = false;\n }\n\n //If the puzzle is complete then don't let obstacles cycle through anymore\n if (!thor.currentTile.PuzzleComplete) {\n thor.currentTile.PuzzlePeices[i].puzzlePointer += 1;\n\n //Ensure the pointer doesn't get incremented beyond array length\n if (thor.currentTile.PuzzlePeices[i].puzzlePointer == (thor.currentTile.PuzzlePeices[i].allPossibleVals.length)) {\n thor.currentTile.PuzzlePeices[i].puzzlePointer = 0;\n }\n }\n\n //No need to complete redundent cycles of for loop\n break;\n }\n }\n }\n //Not near anything? Then just list inventory.\n else {\n //As the thor items is list of objects, need to iterate through and add names to a new array to be output\n\n var thorInventoryOutput = [];\n for (var k = 0; k < thor.items.length; k++) {\n thorInventoryOutput.push(thor.items[k].name);\n }\n console.log(\"Thor's Swag Bag: \" + thorInventoryOutput);\n\n }\n }\n itemObtainingOK = false;\n}\n}", "loadInventory(size, data) {\n this.inventory = new Inventory(this.game, size);\n this.inventory.load(data);\n }", "function showInventory(job) {\n console.log(\"Your answer was \" + job);\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n console.log(\"\\n\");\n console.log(\" CURRENT INVENTORY \".bgRed.white);\n console.log(\"\\n\");\n console.log(\"\\n\");\n// build our table using table NPM\n var table = new Table({\n head: ['Item ID', 'Product', 'Price', 'Quantity']\n , colWidths: [20, 21, 25, 17]\n });\n for (var i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, \"$\" + res[i].price, res[i].stock_quantity]\n );\n };\n console.log(table.toString());\n console.log(\"\\n\");\n console.log(\"\\n\");\n continueManaging();\n });\n \n}", "itemClickHandler({ itemName, itemType, quality }) {\n let eCost = energyCost.plantingSeed;\n let tCost = timeCost.plantingSeed;\n\n if (this.props.player.energy[0] >= eCost) {\n let [field, player, time] = this.initializeDataDef(eCost, tCost, 0);\n let inventory = new Inventory({ items: player.inventory });\n inventory.removeItemFromInventory(\n new Item({ name: itemName, quantity: 1, quality })\n );\n player.updateInventory(inventory.items);\n\n if (itemType === \"Fertilizer\") {\n let fertRate = fertilizerRate[itemName]\n ? fertilizerRate[itemName].rate(quality)\n : 0;\n field.isFertilized = true;\n field.plant.buff.positive.push({ rate: fertRate, name: itemName });\n } else {\n let plant = new Plant({ seed: itemName });\n field = new Field({\n id: this.props.item.id,\n name: this.props.item.name,\n imageName: plant.getPlantImage(), //image name\n label: plant.name,\n type: \"Plant\", //Obstacle, Plowed, Unplowed, Plant, Yield\n isWorked: false,\n health: [100, 100, 0],\n plant, //{} for obstacle, plowed, unplowed})\n });\n }\n\n this.props.saveFarm({\n newField: field,\n fieldType: this.props.fieldType, //smallField, mediumField, largeField\n player,\n time,\n });\n } else {\n alert(\"You don't have enough energy\");\n }\n this.modalCloseHandler();\n }", "function displayInventory() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].price);\n }\n console.log(\"-----------------------------------\");\n startQuestions();\n });\n \n}", "function listlowInventory() {\n //Variable creation from DB connection\n connection.query(\"SELECT * FROM products WHERE stock_quantity <= 3\", function (err, results) {\n for (var i = 0; i < results.length; i++) {\n\n var itemId = results[i].item_id,\n productName = results[i].product_name,\n stockQuantity = results[i].stock_quantity;\n\n table.push(\n [itemId, productName, stockQuantity]\n );\n }\n console.log(\"\");\n console.log(chalk.blue(\"============================ \") + chalk.yellowBright(\"BAMAZON LOW PRODUCT INVENTORIES\") + chalk.blue(\" =================================\"));\n console.log(\"\");\n console.log(chalk.greenBright(table.toString()));\n console.log(\"\");\n console.log(\"\");\n console.log(\"\");\n newTransaction();\n // connection.end();\n });\n }", "function TakeItem() {\n if (currentLoc == 1) {\n if (key.check == 0) {\n inventory.push(key.name);\n console.log(inventory);\n UpdateInventory(key.description)\n key.check = 1;\n }\n }\n if (currentLoc == 8) {\n if (hoagie.check == 0) {\n inventory.push(hoagie.name);\n console.log(inventory);\n UpdateInventory(hoagie.description)\n hoagie.check = 1;\n }\n }\n if (currentLoc == 0) {\n if (map.check == 0) {\n inventory.push(map.name);\n console.log(inventory);\n UpdateInventory(map.description)\n map.check = 1;\n }\n }\n if (currentLoc == 3) {\n if (coat.check == 0) {\n inventory.push(coat.name);\n console.log(inventory);\n UpdateInventory(coat.description)\n coat.check = 1;\n }\n }\n }", "function selectEquipment(nodeIndex) {\n\n var node = nodes[nodeIndex];\n var option = $('#equipment').val();\n\n if (option == -1) {\n node['component'] = null;\n node['subcomponents'] = [];\n } else {\n node['component'] = components[option];\n var amplificacao = $('#amplificacao').val();\n var nivelSinal = $('#nivelSinal').val();\n node['properties']['amplificacao'] = amplificacao;\n node['properties']['nivelSinal'] = nivelSinal;\n }\n //shoppingCart.push(node);\n\n closeModal();\n}", "function addInventory() {\n var query = \"SELECT * FROM products\";\n\n connection.query(query, (err, results) => {\n console.log(\"--------------------------------\\n\");\n if (err) throw err;\n\n var table = new Table({\n head: [\"Item Id\", \"Product Name\", \"Department Name\", \"Quantity\"],\n colWidths: [15, 25, 20, 10],\n colAligns: [\"center\", \"left\", \"left\", \"right\"]\n });\n\n // Displaying all the products in the table\n results.forEach(element => table.push([element.item_id, element.product_name, element.department_name, element.stock_quantity]));\n\n console.log(table.toString());\n\n inquirer.prompt([{\n name: \"product\",\n type: \"input\",\n message: \"Which department would you like to add more?\",\n }, {\n name: \"units\",\n type: \"input\",\n message: \"How many units would you like to add?\"\n\n }]).then(answer => {\n var query = \"SELECT item_id, product_name, stock_quantity FROM products WHERE ?\";\n\n connection.query(query, {\n item_id: answer.product,\n },\n (err, results) => {\n if (err) throw err;\n\n // If the manager enters an invalid product ID item by mistake\n if (results.length === 0) {\n console.log(\"\\n-------------------------------- \\nProduct NOT found... Please try again.\\n\");\n\n // Here we run the addInventory function again to ask the manager what product they would like to add.\n addInventory();\n\n // The amount of stock quantity the manager is going to placed\n } else if (parseInt(answer.units)) {\n\n // Will determine the total of units the manager added to the inventory.\n var total = parseInt(answer.units) + results[0].stock_quantity;\n\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\", [{\n // This will add the amount of stock quantity stored in the database when the manager adds to their inventory\n stock_quantity: results[0].stock_quantity + parseInt(answer.units)\n },\n {\n item_id: answer.product,\n }\n ], (err) => {\n if (err) throw err;\n console.log(`\\n----------------------- \\nSuccess!! You added ${answer.units} new items to your inventory. \\nYour new product total is ${total} on ${results[0].product_name}`);\n connection.end();\n });\n\n // Alert the manager that the item was not successful\n } else {\n console.log(`\\n----------------------- \\nNOT successful! \\nPlease try again..\\n`);\n // Run the addInventory function to ask what product they would like to add again.\n addInventory();\n }\n });\n });\n });\n}", "function lowInventory (err, results) {\n if (err) {\n console.log(err)\n }\n console.table(results)\n mainMenu()\n}", "function populateNetworkNodes() {\n\tvar nodes = null;\n\t$\n\t\t\t.ajax({\n\t\t\t\turl : sdnControllerURL\n\t\t\t\t\t\t// + \"/controller/nb/v2/switchmanager/default/nodes\",\n\t\t\t\t\t\t+ \"/restconf/operational/opendaylight-inventory:nodes\",\n\t\t\t\ttype : \"GET\",\n\t\t\t\tasync : false,\n\t\t\t\tcontentType : \"application/json\",\n\t\t\t\tsuccess : function(data, textStatus, jqXHR) {\n\t\t\t\t\t// console.log(data);\n\t\t\t\t\tnodes = data.nodes;\n\t\t\t\t},\n\t\t\t\terror : function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\talert(\"Unable to fetch OpenDaylight Nodes.\\nDid you supply the credentials correct?\");\n\t\t\t\t},\n\t\t\t\tbeforeSend : function(xhr) {\n\t\t\t\t\t// Default Base64 Encoding for (admin/admin)\n\t\t\t\t\txhr\n\t\t\t\t\t\t\t.setRequestHeader(\"Authorization\",\n\t\t\t\t\t\t\t\t\tbase64EncodedPassword);\n\t\t\t\t}\n\t\t\t});\n\n\tif (nodes != null && nodes != undefined) {\n\t\t// Construct divs\n\t\t// $.each(nodes.nodeProperties, function(index, value) {\n\t\t// \tvar div = getNetworkDeviceDiv(value.properties.description.value,\n\t\t// \t\t\tvalue.node.id, value.properties.macAddress.value,\n\t\t// \t\t\tvalue.properties.timeStamp.value);\n\t\t// \t$(\"#nodesDiv\").append(div);\n\t\t// });\n\t\t/*Table style*/\n\t\tdiv = '<div><table class=\"table table-hover\">'\n\t\t\t+ '<thead><tr>'\n\t\t\t+ '<th>No.</th>'\n\t\t\t+ '<th>Node Id</th>'\n\t\t\t+ '<th>IP address</th>'\n\t\t\t+ '<th>Type</th>'\n\t\t\t+ '<th>SW version</th>'\n\t\t\t+ '<th>N_connectors</th>'\n\t\t\t+ '<th>Stats</th>'\n\t\t\t+ '</tr></thead><tbody>';\n\n\t\tvar prefix = \"flow-node-inventory:\"\n\t\t$.each(nodes.node, function(index, node) {\n\t\t\t// console.log(node);\n\t\t\tdiv += getNetworkDeviceDiv(\n\t\t\t\tindex + 1,\n\t\t\t\tnode.id,\n\t\t\t\tnode[prefix+'ip-address'],\n\t\t\t\tnode[prefix+'hardware'],\n\t\t\t\tnode[prefix+'software'],\n\t\t\t\tnode['node-connector'].length\n\t\t\t\t);\n\t\t\t/*Thumbnail style*/\n\t\t\t// $(\"#nodesDiv\").append(div);\n\t\t});\n\t\tdiv += '</tbody></table></div>';\n\t\t/*Table style*/\n\t\t$(\"#nodesDiv\").append(div);\n\n\t\t$(\"#nodesDiv\").removeClass(\"hidden\").addClass(\"visible\");\n\t\t$(\"#nodesButton\").removeClass(\"visible\").addClass(\"hidden\");\n\n\t}\n\n}", "function loadLowInventory() {\n // Selects all of the products that have a quantity of 5 or less\n connection.query(\"SELECT * FROM products WHERE stock_quantity <= 5\", function(err, res) {\n if (err) throw err;\n // Draw the table in the terminal using the response, load the manager menu\n console.table(res);\n loadManagerMenu();\n });\n}", "function updateInventory() {\n ul_inventoryList.empty();\n let li;\n $(inventory).each(function (index, element) {\n li = $(\"<li>\");\n li.data(\"name\", element[\"name\"]);\n li.html(element[\"name\"] + \": \" + element[\"count\"]);\n ul_inventoryList.append(li);\n });\n }", "function add_to_inventory (gObject, slot) {\r\n\r\n\tvar inventory_array_item = new Object();\r\n\tinventory_array_item.slot = slot;\r\n\tinventory_array_item.gObject = gObject;\r\n\t\r\n\tinventory_array.push(inventory_array_item);\r\n\t\r\n\tvar slot_icon = document.getElementById(\"gui_slot\" + slot + \"_item_icon\");\r\n\tslot_icon.style.backgroundImage = \"url(\"+gObject.icon2+\")\";\r\n\tslot_icon.style.backgroundSize = \"100% 100%\";\r\n\t\r\n\tconsole.log(\"pera added inventory item: \" + gObject.icon);\r\n\t\r\n\tgObject.mesh.noremove = true;\r\n}", "function InventoryItem(imageName, type, use, risk, effect, text, container, array, tooltipOn, quantity) {\n // Item attributes\n this.quantity = quantity;\n this.imageUrl = imageName;\n this.index = array.length;\n this.risk = risk;\n this.effect = effect;\n this.rarity = \"common\";\n this.item = type;\n this.use = use;\n this.useable = false;\n this.desc = text;\n this.position;\n this.itemData;\n\n // HTML tags\n this.$itemContainer = $('<div data-id=\"' + this.index + '\" class=\"inventory-item\" ' +\n 'data-html=\"true\" data-toggle=\"tooltip\" title=\"' +\n this.item + \":\" + this.desc + '\"></div>');\n this.$itemImg = $(\"<img src='\" + this.imageUrl + \"'>\");\n this.$itemDisplay = $(\"<h1>\" + this.quantity + \"</h1>\");\n\n // Prevents creating a ghost image when dragging the image\n this.$itemImg.attr('draggable', false);\n\n // Puts the image and quantity into a container\n this.$itemContainer.append(this.$itemImg);\n this.$itemContainer.append(this.$itemDisplay);\n\n // Creates a tooltip using the title of the html element\n this.$itemContainer.tooltip();\n\n this.useItem = function () {\n console.log(\"Used Item: \" + this.item);\n\n if (this.quantity == 1) {\n // Removes the item if there is only 1 left\n this.$itemContainer.remove();\n } else {\n this.increaseQuantity(-1);\n }\n\n // Change resources\n $(document.body).trigger('update-resources', {\n effect: this.effect,\n event: 'item-used'\n });\n\n let tempUseCases = [cardDataArray[cardNum].event];\n highlightItem(tempUseCases);\n };\n\n this.increaseQuantity = function (num) {\n this.quantity += num;\n this.$itemDisplay.text(this.quantity);\n };\n\n this.disableUse = function () {\n this.useable = false;\n };\n\n this.enableUse = function () {\n this.useable = true;\n };\n\n this.checkEffect = function () {\n console.log(this.effect);\n let effectString = \"\";\n if (this.effect.physical != 0) {\n effectString += \"Health Points <br>\";\n }\n if (this.effect.mental != 0) {\n effectString += \"Mental Health Points <br>\";\n }\n if (this.effect.supplies != 0) {\n effectString += \"Supplies <br>\";\n }\n if (this.effect.wealth != 0) {\n effectString += \"Wealth <br>\";\n }\n return (effectString);\n }\n\n // Disable selection of items\n $(container).disableSelection();\n\n // Put the image container inside the inventory\n $(container).append(this.$itemContainer);\n}", "function displayInventory() {\n var query = \"SELECT * FROM products\";\n connection.query(query, function(err, inv) {\n console.log(\"========================\\n\"); \n console.log(\"Current available products for sale:\\n\");\n var table = new Table({\n head: [\"ITEM_ID\", \"PRODUCT NAME\", \"DEPARTMENT NAME\", \"PRICE\", \"STOCK \\nQTY\"],\n colWidths: [10, 40, 20, 9, 8]\n }); \n for (var i=0; i < inv.length; i++) {\n var productArray = [inv[i].item_id, inv[i].product_name, inv[i].department_name, inv[i].price, inv[i].stock_quantity];\n table.push(productArray);\n }\n console.log(table.toString());\n managerOptions();\n })\n}", "_prepareItems(actorData) {\n\n // Inventory\n const inventory = {\n weapon: { label: \"Weapons\", items: [] },\n equipment: { label: \"Equipment\", items: [] },\n consumable: { label: \"Consumables\", items: [] },\n tool: { label: \"Tools\", items: [] },\n backpack: { label: \"Backpack\", items: [] },\n };\n\n // Spellbook\n const spellbook = {};\n\n // Feats\n const feats = [];\n\n // Classes\n const classes = [];\n\n // Iterate through items, allocating to containers\n let totalWeight = 0;\n for ( let i of actorData.items ) {\n i.img = i.img || DEFAULT_TOKEN;\n\n // Inventory\n if ( Object.keys(inventory).includes(i.type) ) {\n i.data.quantity.value = i.data.quantity.value || 1;\n i.data.weight.value = i.data.weight.value || 0;\n i.totalWeight = Math.round(i.data.quantity.value * i.data.weight.value * 10) / 10;\n i.hasCharges = (i.type === \"consumable\") && i.data.charges.max > 0;\n inventory[i.type].items.push(i);\n totalWeight += i.totalWeight;\n }\n\n // Spells\n else if ( i.type === \"spell\" ) this._prepareSpell(actorData, spellbook, i);\n\n // Classes\n else if ( i.type === \"class\" ) {\n classes.push(i);\n classes.sort((a, b) => b.levels > a.levels);\n }\n\n // Feats\n else if ( i.type === \"feat\" ) feats.push(i);\n }\n\n // Assign and return\n actorData.inventory = inventory;\n actorData.spellbook = spellbook;\n actorData.feats = feats;\n actorData.classes = classes;\n\n // Inventory encumbrance\n actorData.data.attributes.encumbrance = this._computeEncumbrance(totalWeight, actorData);\n }", "function viewLowInventory() {\n con.query(\"SELECT * from vw_LowInventory\", function (err, result) {\n if (err) {\n throw err;\n }\n else {\n var table = new Table({\n\t\t head: ['Product Id', 'Product Name', 'Department','Price', 'Quantity'],\n\t\t style: {\n\t\t\t head: ['blue'],\n\t\t\t compact: false,\n\t\t\t colAligns: ['center','left','left','right', 'right']\n\t\t }\n\t });\n\n\t //loops through each item in the mysql database and pushes that information into a new row in the table\n\t for(var i = 0; i < result.length; i++) {\n\t\t table.push(\n\t\t\t [result[i].Product_Id, result[i].Product_Name, result[i].Department, result[i].Price, result[i].Quantity]\n\t\t );\n\t }\n \n console.log(table.toString());\n runManageBamazon();\n }\n });\n}", "function addToInventory(determine) {\n App[App.myRole].inventory[determine-1].quantity++;\n }", "function addInv() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n let table = new Table({\n head: ['Product ID', 'Product Name', 'Price', 'Department'],\n color: [\"blue\"],\n colAligns: [\"center\"]\n })\n res.forEach(function(row) {\n let newRow = [row.item_id, row.product_name, row.price, row.stock_quantity, row.department_name]\n table.push(newRow)\n })\n console.log(\"Current Bamazon Products\")\n console.log(\"\\n\" + table.toString())\n \n inquirer.prompt([\n {\n \"name\": \"item_selection\",\n \"message\": \"To add inventory or an item, select the item by typing in the item id below.\",\n \"type\": \"input\"\n },\n {\n \"name\": \"quantity\",\n \"message\": \"How much inventory would you like to add?\",\n \"type\": \"input\"\n }\n ]).then(function(answer) {\n connection.query(`UPDATE products SET stock_quantity=stock_quantity + ${answer.quantity} WHERE item_id=${answer.item_selection}`, function(err, res) {\n console.log(\"You have added \" + answer.quantity + \" stock to the selected item.\\n\")\n menu();\n })\n })\n })\n}", "function productItems() \n{\n connection.connect(function(err) \n {\n connection.query(\"SELECT * FROM products\", function(err, res) \n {\n\tif (err) throw err\n\telse console.table(res , \"\\n\");\n\tproductId();\n\t});\n});\n}", "function readInventory() {\n connection.query(\"SELECT * FROM inventory\", function(err, res) {\n if (err) throw err;\n\n // For loop to display all current products id, name, price, and quantity\n for (var i = 0; i < res.length; i++) {\n console.log(\"Product: \" + res[i].product_name + \n \" || Price: $\" + res[i].product_price + \n \" || Stock: \" + res[i].product_quantity + \n \" || ID: \" + res[i].id + \"\\n\");\n }\n firstSheBang();\n });\n}", "SetInventory(scene, dialogue) {\n this.invent = new Inventory({\n scene: scene,\n x: this.scene.cameras.main.width*0.14,\n y: this.scene.cameras.main.height * 0.95,\n l: {},\n dialogue:dialogue\n });\n\n this.invent.setScrollFactor(0);\n this.invent.setDepth(20);\n }", "static activateEquipment() {\n let selected = [];\n\n //MAKE INVETORY ITEMS DRAGABLE\n $(\".inventory-item, .equiped-item\").draggable({\n revert: \"invalid\",\n containment: '#hangar-equipment-container',\n scroll: false,\n helper: \"clone\",\n appendTo: '#hangar-equipment-container',\n zIndex: 100,\n start: function (event, ui) {\n if ($(this).hasClass(\"ui-selected\")) {\n selected = $(\".ui-selected:not(.ui-draggable-dragging)\").each(function () {\n });\n } else {\n selected = [];\n $(\".ship-inventory-content > .inventory-item\").removeClass(\"ui-selected\");\n }\n }\n })\n //RESGISTER CLICK EVENTS\n .click(function (event) {\n\n let moveToIventory = true;\n if ($(this).hasClass('inventory-item')) {\n moveToIventory = false;\n $('.equiped-item').removeClass(\"ui-selected\");\n } else {\n $('.inventory-item').removeClass(\"ui-selected\");\n }\n\n //ON CONTROL-CLICK MOVE ALL SELECTED ITEMS\n if (event.metaKey || event.ctrlKey) {\n //GET SELECTED ITEMS\n selected = $(\".ui-selected:not(.ui-draggable-dragging)\").each(function () {\n });\n let ITEMS = [],\n ITEM_CATEGORY = null,\n ITEM = null,\n ITEM_NAME = null,\n ITEM_ID = null;\n\n if (selected.length > 1) {\n for (let i = 0; i < selected.length; i++) {\n ITEM_NAME = $(selected[i]).data(\"item-name\");\n ITEM_CATEGORY = $(selected[i]).data(\"type\");\n ITEM_ID = $(selected[i]).data(\"item-id\");\n ITEM = {\n 'NAME': ITEM_NAME,\n 'CATEGORY': ITEM_CATEGORY,\n 'ID': ITEM_ID\n };\n ITEMS.push(ITEM);\n }\n } else {\n ITEM_NAME = $(this).data(\"item-name\");\n ITEM_CATEGORY = $(this).data(\"type\");\n ITEM_ID = $(this).data(\"item-id\");\n ITEM = {\n 'NAME': ITEM_NAME,\n 'CATEGORY': ITEM_CATEGORY,\n 'ID': ITEM_ID\n };\n ITEMS.push(ITEM);\n }\n\n if (moveToIventory) {\n equipment.moveItemsTo(null, ITEMS);\n } else {\n equipment.moveItemsTo(null, ITEMS, 'equip');\n }\n\n }\n //ON SHIFT-CLICK SELECT ALL SAME ITEM\n else if (event.shiftKey) {\n $(\".ui-selected\").removeClass(\"ui-selected\");\n if (!moveToIventory) {\n $(\".ship-inventory-content .inventory-item[data-item-name=\" + $(this).data(\"item-name\") + \"]\").addClass(\"ui-selected\");\n } else {\n console.log(\"MoveToInventory\");\n $(\".\" + equipment.display + \"-equipment-container .equiped-item[data-item-name=\" + $(this).data(\"item-name\") + \"]\").addClass(\"ui-selected\");\n }\n }\n //ON NORMAL CLICK UNSELECT ALL\n else {\n if (!moveToIventory) {\n $(\".ship-inventory-content .inventory-item\").removeClass(\"ui-selected\");\n } else {\n $(\".equiped-item\").removeClass(\"ui-selected\");\n }\n }\n });\n\n //REGISTER DROPZONES FOR IVENTORY ITEMS\n $(\".ship-equipment-slots, .drone-equipment-slots, .pet-equipment-slots\").droppable({\n accept: \".inventory-item\",\n drop: function (event, ui) {\n let categories = $(this).data('category').split('|');\n\n if (categories.includes($(ui.draggable).data('type'))) {\n //GET SELECTED ITEMS\n selected = $('.ui-selected:not(.ui-draggable-dragging)[data-type=\"' + $(ui.draggable).data('type') + '\"]').each(function () {\n });\n let ITEMS = [],\n ITEM_CATEGORY = null,\n ITEM = null,\n ITEM_NAME = null,\n ITEM_ID = null,\n DRONE_ID = null,\n PET_ID = null;\n\n if (selected.length > 1) {\n for (let i = 0; i < selected.length; i++) {\n ITEM_NAME = $(selected[i]).data(\"item-name\");\n ITEM_CATEGORY = $(selected[i]).data(\"type\");\n ITEM_ID = $(selected[i]).data(\"item-id\");\n PET_ID = $(this).parent().data(\"pet-id\");\n ITEM = {\n 'NAME': ITEM_NAME,\n 'CATEGORY': ITEM_CATEGORY,\n 'ID': ITEM_ID\n };\n\n if (PET_ID !== undefined) {\n ITEM.PET_ID = PET_ID;\n }\n\n ITEMS.push(ITEM);\n }\n } else {\n ITEM_NAME = $(ui.draggable).data(\"item-name\");\n ITEM_CATEGORY = $(ui.draggable).data(\"type\");\n ITEM_ID = $(ui.draggable).data(\"item-id\");\n PET_ID = $(this).parent().data(\"pet-id\");\n ITEM = {\n 'NAME': ITEM_NAME,\n 'CATEGORY': ITEM_CATEGORY,\n 'ID': ITEM_ID\n };\n\n if (PET_ID !== undefined) {\n ITEM.PET_ID = PET_ID;\n }\n\n ITEMS.push(ITEM);\n }\n\n if (selected.length > 1) {\n for (let i = 0; i < selected.length; i++) {\n ITEM_NAME = $(selected[i]).data(\"item-name\");\n ITEM_CATEGORY = $(selected[i]).data(\"type\");\n ITEM_ID = $(selected[i]).data(\"item-id\");\n DRONE_ID = $(this).parent().data(\"drone-id\");\n ITEM = {\n 'NAME': ITEM_NAME,\n 'CATEGORY': ITEM_CATEGORY,\n 'ID': ITEM_ID\n };\n\n if (DRONE_ID !== undefined) {\n ITEM.DRONE_ID = DRONE_ID;\n }\n\n ITEMS.push(ITEM);\n }\n } else {\n ITEM_NAME = $(ui.draggable).data(\"item-name\");\n ITEM_CATEGORY = $(ui.draggable).data(\"type\");\n ITEM_ID = $(ui.draggable).data(\"item-id\");\n DRONE_ID = $(this).parent().data(\"drone-id\");\n ITEM = {\n 'NAME': ITEM_NAME,\n 'CATEGORY': ITEM_CATEGORY,\n 'ID': ITEM_ID\n };\n\n if (DRONE_ID !== undefined) {\n ITEM.DRONE_ID = DRONE_ID;\n }\n\n ITEMS.push(ITEM);\n }\n\n equipment.moveItemsTo(null, ITEMS, 'equip');\n }\n }\n });\n\n $(\".ship-inventory-container\").droppable({\n accept: \".equiped-item\",\n drop: function (event, ui) {\n\n //GET SELECTED ITEMS\n selected = $(\".ui-selected:not(.ui-draggable-dragging)\").each(function () {\n });\n let ITEMS = [],\n ITEM_CATEGORY = null,\n ITEM = null,\n ITEM_NAME = null,\n ITEM_ID = null,\n DRONE_ID = null,\n PET_ID = null;\n\n if (selected.length > 1) {\n for (let i = 0; i < selected.length; i++) {\n ITEM_NAME = $(selected[i]).data(\"item-name\");\n ITEM_CATEGORY = $(selected[i]).data(\"type\");\n ITEM_ID = $(selected[i]).data(\"item-id\");\n ITEM = {\n 'NAME': ITEM_NAME,\n 'CATEGORY': ITEM_CATEGORY,\n 'ID': ITEM_ID\n };\n ITEMS.push(ITEM);\n }\n } else {\n ITEM_NAME = $(ui.draggable).data(\"item-name\");\n ITEM_CATEGORY = $(ui.draggable).data(\"type\");\n ITEM_ID = $(ui.draggable).data(\"item-id\");\n DRONE_ID = $(ui.draggable).parent().data(\"drone-id\");\n ITEM = {\n 'NAME': ITEM_NAME,\n 'CATEGORY': ITEM_CATEGORY,\n 'ID': ITEM_ID\n };\n ITEMS.push(ITEM);\n }\n\n if (selected.length > 1) {\n for (let i = 0; i < selected.length; i++) {\n ITEM_NAME = $(selected[i]).data(\"item-name\");\n ITEM_CATEGORY = $(selected[i]).data(\"type\");\n ITEM_ID = $(selected[i]).data(\"item-id\");\n ITEM = {\n 'NAME': ITEM_NAME,\n 'CATEGORY': ITEM_CATEGORY,\n 'ID': ITEM_ID\n };\n ITEMS.push(ITEM);\n }\n } else {\n ITEM_NAME = $(ui.draggable).data(\"item-name\");\n ITEM_CATEGORY = $(ui.draggable).data(\"type\");\n ITEM_ID = $(ui.draggable).data(\"item-id\");\n PET_ID = $(ui.draggable).parent().data(\"pet-id\");\n ITEM = {\n 'NAME': ITEM_NAME,\n 'CATEGORY': ITEM_CATEGORY,\n 'ID': ITEM_ID\n };\n ITEMS.push(ITEM);\n }\n\n equipment.moveItemsTo(null, ITEMS);\n }\n });\n\n //MAKE INVENTROY TIEMS SELECTABLE\n $(\".ship-inventory-content\").selectable({ filter: '.inventory-item' });\n\n //ACTIVATE HANGAR SWITCH\n $('.hangar-slot').off('click').click(function (event) {\n let hangarID = $(this).data('hangar-id');\n\n if (hangarID !== undefined && !$(this).hasClass('active')) {\n equipment.switchHangar(null, hangarID);\n }\n });\n\n //ACTIVATE DESIGN SWITCH\n $('#design-select').off('change').change(function (event) {\n let designID = $(this).val();\n\n if (designID !== undefined && !$(this).selected) {\n equipment.switchDesign(null, designID);\n }\n });\n\n //ACTIVATE FILTER SWITCH\n $('#filter-select').off('change').change(function (event) {\n let filterID = $(this).val();\n\n if (filterID !== undefined && !$(this).selected) {\n equipment.switchFilter(filterID);\n }\n });\n\n //ITEM MENU\n $('.inventory-item').contextmenu(function (event) {\n let selected = $(\".ui-selected:not(.ui-draggable-dragging)\").each(function () {\n });\n\n if (selected.length > 1) {\n let ITEMS = [],\n ITEM_CATEGORY = null,\n ITEM = null,\n ITEM_NAME = null,\n ITEM_ID = null,\n SELL_VALUE = 0;\n\n for (let i = 0; i < selected.length; i++) {\n ITEM_NAME = $(selected[i]).data(\"item-name\");\n ITEM_CATEGORY = $(selected[i]).data(\"type\");\n ITEM_ID = $(selected[i]).data(\"item-id\");\n SELL_VALUE += parseInt($(selected[i]).data('item-credits'));\n ITEM = {\n 'NAME': ITEM_NAME,\n 'CATEGORY': ITEM_CATEGORY,\n 'ID': ITEM_ID\n };\n ITEMS.push(ITEM);\n }\n\n swal('Sell item?', 'For selling ' + selected.length + ' of ' + ITEM_NAME + ' you will get ' + SELL_VALUE + ' Credits.', {\n buttons: {\n sell: {\n text: \"Sell Item\"\n },\n cancel: true\n }\n }).then((value) => {\n switch (value) {\n case \"sell\":\n equipment.sellItems(null, ITEMS);\n break;\n }\n });\n } else {\n event.preventDefault();\n let itemID = parseInt($(this).data('item-id')),\n itemName = $(this).data('item-name'),\n itemSell = parseInt($(this).data('item-credits'));\n swal('Sell item?', 'For selling ' + itemName + ' you will get ' + itemSell + ' Credits.', {\n buttons: {\n sell: {\n text: \"Sell Item\"\n },\n cancel: true\n }\n }).then((value) => {\n switch (value) {\n case \"sell\":\n equipment.sellItem(null, itemID);\n break;\n }\n });\n }\n });\n\n //DRONE MENU\n $('.drone-container').contextmenu(function (event) {\n event.preventDefault();\n let droneID = parseInt($(this).data('drone-id'));\n swal('What do you want to do?', {\n buttons: {\n sell: {\n text: \"Sell Drone\"\n },\n repair: {\n text: \"Repair Drone\"\n },\n cancel: true\n }\n }).then((value) => {\n switch (value) {\n case \"sell\":\n equipment.sellDrone(null, droneID);\n break;\n case \"repair\":\n swal(\"Error!\", \"Repair Function not in yet!\", \"error\");\n break;\n }\n });\n });\n\n //SHIP MENU\n $('.ship-equipment-box').click(function (event) {\n swal('What do you want to do?', {\n buttons: {\n sell: {\n text: \"Sell Ship\"\n },\n cancel: true\n }\n }).then((value) => {\n switch (value) {\n case \"sell\":\n equipment.sellShip(null, 0);\n break;\n }\n });\n });\n\n //PET MENU\n $('.pet-equipment-box').click(function (event) {\n swal('What do you want to do?', {\n buttons: {\n sell: {\n text: \"Sell Pet\"\n },\n change: {\n text: \"Change Name\"\n },\n cancel: true\n }\n }).then((value) => {\n switch (value) {\n case \"sell\":\n equipment.sellPet(null);\n break;\n case \"change\":\n equipment.changeName(null);\n break;\n }\n });\n });\n\n //RESET\n $('#reset-config').click(function(event) {\n swal('Are you sure you would like to reset your config?', {\n buttons: {\n reset: {\n text: \"Reset config\"\n },\n cancel: true\n }\n }).then((value) => {\n switch (value) {\n case \"reset\":\n equipment.resetCurrentConfig(null);\n break;\n }\n });\n });\n }", "function displayInventory(hero){\n let heroInventory = document.getElementById(\"heroInventory\");\n heroInventory.innerHTML = \"Hero's inventory is \" + hero.inventory;\n hero.inventory.forEach(function(entry){ \n let newWeaponType = document.createElement(\"weaponType\");\n let newWeaponTypeContent = document.createTextNode(\"new weapon\");\n newWeaponType.appendChild(newWeaponTypeContent);\n let newWeaponDamage = document.createElement(\"weaponDamage\");\n let newWeponDamageValue = document.createTextNode(\"new weapon damage\");\n newWeaponDamage.appendChild(newWeponDamageValue);\n });\n // console.log(hero.inventory);\n}", "function inventorySearch() {\n var query = \"SELECT * FROM bamazon.products;\";\n connection.query(query, function (err, res) {\n for (var i = 0; i < res.length; i++) {\n console.table(res[i]);\n }\n idSearch();\n });\n}", "function productItems() {\n\tconnection.connect(function(err) {\n\n\t\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err\n\t\telse console.table(res , \"\\n\");\n\t\tproductId();\n\t\t});\n\t});\n}", "function addInventory() {\n inquirer.prompt([\n {\n name: \"item_id\",\n type: \"input\",\n message: \"ID:\"\n },\n {\n name: \"units\",\n type: \"input\",\n message: \"UNITS:\"\n }\n ])\n .then(function (inquirerResponse) {\n item_id = parseInt(inquirerResponse.item_id);\n units = parseInt(inquirerResponse.units);\n if (Number.isNaN(item_id) || Number.isNaN(units)) {\n console.log(\"INVALID ID OR QUANTITY\");\n promptChoice();\n } else {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var j = 0; j < res.length; j++) {\n if (item_id == res[j].item_id) {\n newQuantity = parseInt(res[j].stock_quantity) + units;\n console.log(newQuantity);\n // Adjust quantities from schema using mysql npm\n connection.beginTransaction(function (err) {\n if (err) { throw err; }\n connection.query(\"UPDATE products SET stock_quantity =(\" + newQuantity + \") WHERE item_id = \" + item_id + \";\", function (error, results, fields) {\n if (error) {\n throw error;\n }\n connection.commit(function (err) {\n if (err) {\n return connection.rollback(function () {\n throw err;\n });\n }\n });\n });\n promptChoice();\n\n });\n }\n }\n });\n }\n });\n}", "function displayInventory() {\n var i, item, inventory;\n inventory = document.querySelector(\"#inventory > ul\");\n clearContent(inventory);\n for (i in player.items) {\n item = document.createElement (\"li\");\n item.textContent = player.items[i];\n inventory.appendChild(item);\n }\n}", "set_listener_on_inventory(inventory)\n\t{\n\t\tvar regex = /['\"() \\[\\]]/gi;\n\t\tfor (var i in inventory) {\n\t\t\tif (inventory.hasOwnProperty(i)) {\n\t\t\t\tlet tmp = null;\n\n\t\t\t\ttmp = jQuery(\"#remove_\" + i.replace(regex, '_'));\n\t\t\t\ttmp.data(\"owner\", i);\n\t\t\t\ttmp.on('click', () => {\n\t\t\t\t\t\tdelete inventory[tmp.data(\"owner\")];\n\t\t\t\t\t\tjQuery(\"#inventory\").empty();\n\t\t\t\t\t\tjQuery(\"#inventory\").append(do_inventory_list(this.inventory));\n\t\t\t\t\t\tthis.set_listener_on_inventory(this.inventory);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}", "function displayInventory(){\n var query = \"SELECT productID, product_name, price FROM products\";\n connection.query(query, (err, result) => {\n if(err) throw err;\n for(var i = 0; i < result.length; i++){\n console.log(`ID: ${result[i].productID} || Product: ${result[i].product_name} || Price: ${result[i].price} `)\n }\n })\n}", "function unequipItem() {\n var unequipSlot = clickedEventId.replace('equip', '');\n player.armor -= player[unequipSlot].armor;\n // Finding an empty inventory slot\n for (var g = 1; g < 27; g++) {\n inventorySpace = \"i\" + g;\n if (jQuery.isEmptyObject(inventory[inventorySpace])) {\n // Removing Affixes\n for (var i = 0; i < item.affixes.length; i++) {\n var upperCase = item.affixes[i].name;\n var affix = upperCase.toLowerCase();\n player[affix] -= item.affixes[i].value;\n }\n inventory[inventorySpace] = player[unequipSlot];\n imageIcon = player[unequipSlot].type + player[unequipSlot].quality; // The Lower case for image.png\n document.getElementById(clickedEventId).style.backgroundImage = \"none\";\n document.getElementById(inventorySpace).style.backgroundImage = 'url(itemIcons/' + player[unequipSlot].type + '/' + imageIcon + '.png)';\n // Adding the tooltip onto the inventory slot\n $(inventorySpace).attr(\"title\", \"\" + player[unequipSlot].quality + \" \" + player[unequipSlot].type + \"\\nArmor: \" + player[unequipSlot].armor);\n player[unequipSlot] = {};\n break;\n }\n }\n updateUI();\n updateInventory();\n updateEquipment();\n}", "function displayInv() {\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n console.log(\"\\n______________WELCOME TO BAMAZON!______________\")\n console.log(\"\\n-------------- Current Inventory --------------\\n\")\n console.log(\" ID: | Name: | Dept: | Price: |\");\n for (let i = 0; i < results.length; i++) {\n var inv = results[i];\n console.log(\"\\n\" + \" \" + inv.item_id + \" | \" + inv.product_name +\n \" | \" + inv.department_name + \" | \" + inv.price +\n \" | \");\n }\n console.log(\"\\n---------------------------------------------\\n\")\n\n shop();\n })\n\n}", "function inventoryMenu() {\n $scope.menuTitle = createText(\"Inventory\", [20, 10]);\n\n var datas = CharServ.getAllDatas();\n\n var i = 30;\n _.forIn(datas.inventory, function(value) {\n if (value.quantity > 0) {\n createItem(value, i);\n i += 30;\n }\n });\n }", "function displayAllInventory() {\r\n\r\n var query = \"SELECT item_id, department_name, product_name, price, stock_quantity FROM bamazon.products \" +\r\n \"INNER JOIN bamazon.departments ON products.department_id = departments.department_id \" +\r\n \"ORDER BY department_name, product_name ASC\";\r\n bamazon.query(query, function (err, res) {\r\n if (err) throw (err);\r\n\r\n displayInventoryTable(res);\r\n start();\r\n });\r\n}", "showInventory() {\n // set effect start time and turn it on\n // intercept clicks and send them to Inventory query method\n // set selected inventory object in game state and set icon\n // wtf now\n }", "function lowInventory() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if(err) throw err;\n var table = new Table({\n head: ['Item ID', 'Product', 'Price', 'Quantity']\n , colWidths: [20, 21, 25, 17]\n });\n for (var i = 0; i < res.length; i++) {\n if (res[i].stock_quantity < 5) {\n table.push(\n [res[i].item_id, res[i].product_name, res[i].price, res[i].stock_quantity]\n );\n }\n\n }\n console.log(table.toString());\n console.log(\"\\n\");\n continueManaging();\n })\n \n}", "function createItemElement(invItem, index) {\n // Make sure the item is actually an item\n if (invItem != ITEM_NONE) {\n // Create a new div element for the item and add the CSS class\n var itemDiv = document.createElement(\"div\");\n itemDiv.classList.add(\"inv-item\");\n\n // The ID is constructed from the item name and a random integer as a UID\n itemDiv.id = \"inv-item-\" + invItem.item.name + \"-\" + (Math.floor(Math.random() * 1024));\n\n // Register a onclick handler for attaching the item to the mouse\n itemDiv.onclick = function(event) {\n // Ignore if the player already has an item in hand\n if (hasItemInHand) {\n return;\n }\n \n // Will hold the inventory this item originates from\n var sourceInventory;\n\n // Check if the item was contained in a chest or in the player's inv by checking down the event bubble path\n if (event.path.includes(document.getElementsByClassName(\"inventory\")[0])) {\n sourceInventory = window.game.player.inventory;\n } else if (event.path.includes(document.getElementsByClassName(\"inv-grid\")[0])) {\n sourceInventory = window.game.currentChest.inventory;\n }\n\n // Get the item we want to move around\n var sourceItem = sourceInventory.items[index];\n\n // Set flags\n hasItemInHand = true;\n itemInHandIndex = index;\n\n // We'll store the item the player has in hands globally, e.g. for farm fields\n window.game.itemInHand = sourceItem;\n window.game.itemInHandIdx = index;\n\n // Get the original item div which was clicked, and clone it (the cloned version is the one we attach to the mouse)\n var e = document.getElementById(event.target.id);\n var clone = e.cloneNode(true);\n\n // Calculate an offset for moving the attached element\n var offsetX = -1 * clone.getBoundingClientRect().width / 1;\n var offsetY = -1 * clone.getBoundingClientRect().height / 1;\n \n // The object attached to the mouse needs to be at fixed screen position\n clone.style.position = \"fixed\";\n clone.style.left = (event.clientX + offsetX) + \"px\";\n clone.style.top = (event.clientY + offsetY) + \"px\";\n clone.style.pointerEvents = \"none\"; // Disable mouse hit-testing\n\n itemInHandElem = clone;\n\n // Remove the original node from screen and append the clone to the game-ui container\n e.remove();\n document.getElementById(\"game-ui\").appendChild(clone);\n\n // Register a GLOBAL onmousemove handler\n document.onmousemove = function(mouseMoveEvent) {\n // Update the clone's screen position to the mouse position\n clone.style.left = (mouseMoveEvent.clientX + offsetX) + \"px\";\n clone.style.top = (mouseMoveEvent.clientY + offsetY) + \"px\";\n }\n\n // Register a GLOBAL oncontextmenu handler: this is used for right clicking, weird enough\n document.oncontextmenu = function(contextMenuEvent) {\n // Decide the target inventory by looking at the target div slot\n var targetInventory;\n if (contextMenuEvent.target.id.includes(\"inv-hotbar\")) {\n targetInventory = window.game.player.inventory;\n\n // Parse out the target index\n var idxStr = contextMenuEvent.target.id.replace(\"inv-hotbar-\", \"\");\n var idx = parseInt(idxStr) - 1;\n\n // Add one item to the target slot, and decimate the item amount the player holds in hands\n targetInventory.addItemTo(sourceItem.item, 1, idx);\n targetInventory.setItemAmount(index, sourceItem.amount-1);\n } else if (contextMenuEvent.target.id.includes(\"inv-grid\")) {\n targetInventory = window.game.currentChest.inventory;\n\n // Parse out the hotbar item index we clicked\n var idxStr = contextMenuEvent.target.id.replace(\"inv-grid-\", \"\");\n var idx = parseInt(idxStr) - 1;\n\n // Add one item to the target slot, and decimate the item amount the player holds in hands\n targetInventory.addItemTo(sourceItem.item, 1, idx);\n targetInventory.setItemAmount(index, sourceItem.amount-1);\n }\n\n // The clone's small number needs to be updated\n clone.childNodes[0].innerHTML = targetInventory.getItemAmount(index);\n\n // Call this again to rerender the hotbar\n updateInventoryHotbar();\n updateInventoryChest();\n\n // Disables the browser built-in functionality\n return false;\n }\n\n // Register a GLOBAL onclick handler: used for dropping the item\n document.onclick = function(clickEvent) {\n // Stores whether the transaction worked\n var wasAbleToMoveItem = false;\n\n // First of all, check if we tried to drop the item on a hotbar or grid slot\n if (clickEvent.target.id.includes(\"inv-hotbar\") || clickEvent.target.id.includes(\"inv-grid\")) {\n // Decide the target inventory\n var targetInventory;\n if (clickEvent.target.id.includes(\"inv-hotbar\")) {\n targetInventory = window.game.player.inventory;\n } else if (clickEvent.target.id.includes(\"inv-grid\")) {\n targetInventory = window.game.currentChest.inventory;\n }\n\n // Now differentiate, did we click the hotbar?\n if (clickEvent.target.id.includes(\"inv-hotbar\")) {\n // Parse out the hotbar item index we clicked\n var idxStr = clickEvent.target.id.replace(\"inv-hotbar-\", \"\");\n var idx = parseInt(idxStr) - 1;\n\n // Make sure we update the transaction in the player's inventory\n wasAbleToMoveItem = window.game.player.inventory.transactItem(sourceInventory, index, targetInventory, idx);\n } else if (clickEvent.target.id.includes(\"inv-grid\")) {\n // Parse out the hotbar item index we clicked\n var idxStr = clickEvent.target.id.replace(\"inv-grid-\", \"\");\n var idx = parseInt(idxStr) - 1;\n\n wasAbleToMoveItem = window.game.player.inventory.transactItem(sourceInventory, index, targetInventory, idx);\n }\n\n if (!wasAbleToMoveItem) {\n console.log(\"Can't move item - target slot is probably full\");\n return;\n }\n\n // Create a new div for the item, again by cloning the clone we have in hand\n var newE = clone.cloneNode(true);\n\n // Reset the style variables we set during the mouse attachment\n newE.style.left = null;\n newE.style.top = null;\n newE.style.position = \"absolute\";\n newE.style.pointerEvents = \"all\";\n\n // Reset the global event handlers\n document.onmousemove = null;\n document.onclick = null;\n document.oncontextmenu = null;\n\n // Add the newly created element to the clicked inventory slot and remove the clone\n document.getElementById(clickEvent.target.id).appendChild(newE);\n clone.remove();\n\n wasAbleToMoveItem = false;\n hasItemInHand = false;\n itemInHandIndex = -1;\n window.game.itemInHand = undefined;\n window.game.itemInHandIdx = -1;\n itemInHandElem = undefined;\n \n // Call this again to rerender the hotbar\n updateInventoryHotbar();\n updateInventoryChest();\n } else if (clickEvent.target.id.includes(\"inv-item\") && hasItemInHand) {\n /*console.log(\"Stacking\");\n\n // Find the slot index this item sits in\n var slotIdx = -1;\n var targetInventory;\n clickEvent.path.forEach(function(p, i) {\n //console.dir(p);\n if (p.id) {\n if (p.id.includes(\"inv-hotbar\")) {\n targetInventory = window.game.player.inventory;\n if (slotIdx < 0) {\n var idxStr = p.id.replace(\"inv-hotbar-\", \"\");\n var idx = parseInt(idxStr) - 1;\n\n slotIdx = idx;\n }\n } else if (p.id.includes(\"inv-grid\")) {\n targetInventory = window.game.currentChest.inventory;\n if (slotIdx < 0) {\n var idxStr = p.id.replace(\"inv-grid-\", \"\");\n var idx = parseInt(idxStr) - 1;\n\n slotIdx = idx; \n }\n }\n }\n })\n\n console.log(\"This item chills in \" + slotIdx);\n\n console.dir(sourceInventory);\n console.dir(targetInventory);*/\n\n }\n }\n }\n\n // Put the sprite's URL relative to the root of the game folder\n var spriteURL = \"../../../../\" + invItem.item.sprite;\n\n // Apply the sprite to the div element of the item\n itemDiv.style.backgroundImage = \"url(\\\"\" + spriteURL + \"\\\")\";\n\n // If we have more than one item in the current stack\n if (invItem.amount > 1) {\n // Create a label displaying the stack amount\n var amountLabel = document.createElement(\"p\");\n amountLabel.classList.add(\"inv-item-amount\");\n amountLabel.innerHTML = invItem.amount;\n\n // And add it to the item's div\n itemDiv.appendChild(amountLabel);\n }\n\n return itemDiv;\n } else {\n return null;\n }\n}", "function addInventory () {\n con.query(\"SELECT * FROM vw_ProductsForSale\", function (err, result) {\n if (err) {\n throw err;\n }\n else {\n var table = new Table({\n head: ['Product Id', 'Product Name', 'Department','Price', 'Quantity'],\n style: {\n head: ['blue'],\n compact: false,\n colAligns: ['center','left','left','right', 'right']\n }\n });\n\n //loops through each item in the mysql database and pushes that information into a new row in the table\n for(var i = 0; i < result.length; i++) {\n table.push(\n [result[i].Product_Id, result[i].Product_Name, result[i].Department, result[i].Price, result[i].Quantity]\n );\n }\n \n console.log(table.toString());\n inquirer.prompt([{\n type: \"input\",\n name: \"addItem\",\n message: \"Enter product id to increase:\"\n },\n {\n type: \"input\",\n name: \"addQuantity\",\n message: \"Enter quantity to add:\"\n }\n ]).then(function(answers){\n con.query(\"update products set stock_quantity=stock_quantity + ? where item_id= ?\", [parseInt(answers.addQuantity),parseInt(answers.addItem)], function(err,result) {\n if (err) {\n throw err;\n }\n else {\n console.log('\\r\\nQuantity='+answers.addQuantity + ' has been added to Item Id=' + answers.addItem + \".\\r\\n\")\n runManageBamazon();\n } \n })\n });\n }\n });\n}", "function displayInventory() {\n\n // // Query db for all items\n querySelect = 'SELECT * FROM products';\n\n // build the db query\n connection.query(querySelect, function (err, data) {\n if (err) throw err;\n\n console.log(` \n ______ \n (____ \\ \n ____) ) ____ ____ ____ _____ ___ ____ \n | __ ( / _ | \\ / _ (___ ) _ \\| _ \\ \n | |__) | ( | | | | ( ( | |/ __/ |_| | | | |\n |______/ \\_||_|_|_|_|\\_||_(_____)___/|_| |_| \\n \n \\n-------------------------------------------------------------------\\n`);\n console.log('Existing Inventory: ');\n console.log('<___________________>\\n');\n\n let inventory = '';\n for (let i = 0; i < data.length; i++) {\n inventory = '';\n inventory += 'Item ID: ' + data[i].item_id + ' | ';\n inventory += 'Product Name: ' + data[i].product_name + ' | ';\n inventory += 'Department: ' + data[i].department_name + ' | ';\n inventory += 'Price: $' + data[i].price + ' | ';\n inventory += 'In Stock: ' + data[i].stock_quantity + '\\n';\n\n console.log(inventory);\n }\n\n console.log(\"---------------------------------------------------------------------\\n\");\n\n //Prompt the user for item/quantity\n promptBuyer();\n })\n}", "function readInv() {\n var table1 = new Table({\n head: ['ID', 'Item', 'Department', 'Price', 'Stock'],\n colWidths: [8, 25, 25, 25, 10]\n });\n\n listInv();\n\n function listInv() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n\n var id = res[i].item_id,\n product = res[i].product_name,\n department = res[i].department_name,\n price = res[i].price,\n quantity = res[i].stock_quantity;\n\n table1.push(\n [id, product, department, price, quantity]\n );\n }\n // console.log(\"\");\n console.log(\"\");\n console.log(\" Current Inventory \\n\");\n // console.log(\"\");\n console.log(table1.toString());\n console.log(\"\");\n orderPrompt();\n });\n }\n}", "function displayInventory() {\n console.log(\"\");\n console.log(\"------------------------------------------------\");\n console.log(\"Here's a look at our current inventory selection\");\n console.log(\"------------------------------------------------\");\n console.log(\"\");\n\n // Instantiate CLI table\n var table = new Table({\n head: ['Item', 'Product Name', 'Price', 'Avail.'],\n colWidths: [10, 20, 10, 10]\n });\n\n // Code below pulls back all data from the productstable\n connection.query(\"SELECT * FROM productstable\", function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n // Code below pushing this into the CLI table package to display the inventory\n table.push(\n [res[i].item_id, res[i].product_name, res[i].price, res[i].stock_quantity]\n );\n }\n console.log(table.toString());\n console.log(\"\");\n });\n setTimeout(userPrompt, 1000);\n}", "function addInv() {\n //first show table of existing products\n connection.query(\"SELECT * FROM products\",\n function (err, res) {\n if (err) throw err;\n const products = res;\n console.table(res);\n //inquirer prompt to select by ID an item to increase inventory\n inquirer.prompt([{\n type: \"input\",\n message: \"Select an item by ID number.\",\n name: \"id\",\n //input validation for id number\n validate: function (input) {\n let n = parseFloat(input);\n if (n != Math.floor(n)) {\n return \"Choose a valid ID number\";\n }\n else if (n < 1) {\n return \"Choose a valid ID number\";\n }\n else if (n > res.length) {\n return \"Choose a valid ID number\";\n }\n else {\n return true;\n }\n }\n }, {\n type: \"input\",\n message: \"How many should be added?\",\n name: \"quantity\",\n //input validation for added quantity\n validate: function (input) {\n let q = parseFloat(input);\n if (q != Math.floor(q)) {\n return \"Must be an integer\";\n }\n else if (q < 1) {\n return \"Must be positive\";\n }\n else {\n return true;\n }\n }\n }]).then(function (res) {\n //specify product by parsing id into index\n const product = products[parseInt(res.id) - 1];\n //update table in database with new quantity\n const total = product.stock + parseInt(res.quantity);\n connection.query(\"UPDATE products SET stock = ? WHERE id = ?\", [total, res.id],\n function (err, res) {\n if (err) throw err;\n console.log(\"success\");\n connection.end();\n }\n );\n });\n }\n );\n}", "function addInventory() {\n connection.query(\"select * from products\", function (err, res) {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(res);\n\n // Empty array to push all products available in the database to display as \"1: PRODUCT NAME\" in the terminal.\n var productArr = [];\n\n for (var i = 0; i < res.length; i++) {\n productArr.push(res[i].item_id + \": \" + res[i].product_name);\n }\n\n inquirer.prompt([\n {\n type: \"list\",\n name: \"product\",\n message: \"Which product would you like to add to?\",\n choices: productArr\n },\n {\n type: \"input\",\n name: \"units\",\n message: \"How many units of the product would you like to add?\"\n }\n ]).then(function (arg) {\n var add;\n var arr = arg.product.split(\":\");\n\n // For loop to match the selected item ID to the item ID in the database table.\n for (var i = 0; i < res.length; i++) {\n\n if (parseInt(arr[0]) == parseInt(res[i].item_id)) {\n // Adding the user input units and current stock quantity.\n add = parseInt(res[i].stock_quantity) + parseInt(arg.units);\n\n var sql = \"UPDATE products SET ? WHERE ?\";\n var values = [\n { stock_quantity: add },\n { item_id: res[i].item_id }\n ];\n connection.query(sql, values, function (err) {\n if (err) throw err;\n });\n\n console.log(\"Additional inventory has been added successfully.\");\n quit();\n }\n }\n });\n });\n}", "function addInventory() {\n prompt.start();\n prompt.get([\n {\n name: \"id\",\n description: colors.blue(\"What is the product id of the item you'd like to add to?\"),\n type: \"integer\",\n required: true\n },\n {\n name: \"quantity\",\n description: colors.blue(\"How many units would you like to add?\"),\n type: \"integer\",\n required: true\n }\n ], function (err, response) {\n if (err) throw err;\n connection.query(\"SELECT id FROM products\", function(err, ids) {\n var idArray = [];\n for (var i = 0; i < ids.length; i++) {\n idArray.push(ids[i].id);\n }\n //if id doesn't exist, display message\n if (idArray.indexOf(response.id) === -1) {\n console.log (colors.red(\"Oops. We don't have an item with that id. Please try again.\"));\n addInventory();\n }\n //if id exits, complete order\n else {\n connection.query(\"SELECT * FROM products WHERE ?\" , {id: response.id}, function(err, itemInfo) {\n if (err) throw err;\n //updates database with new quantity\n var quantity = response.quantity;\n var updatedQuantity = itemInfo[0].stockQuantity + quantity;\n connection.query(\"UPDATE products SET stockQuantity = ? WHERE id = ?\", [updatedQuantity, itemInfo[0].id], function(err, response) {\n if (err) throw err;\n console.log(colors.green(\"You have successfulled added \" + quantity + \" units of \" + itemInfo[0].productName + \".\\n\"));\n //asks if user wants to add to more inventory\n inquirer.prompt([\n {\n type: \"confirm\",\n message: colors.blue(\"Would you like to add units to another item?\"),\n name: \"confirm\"\n }\n ]).then(function(user) {\n if (user.confirm) {\n addInventory();\n }\n else {\n actionPrompt();\n }\n });\n });//ends connection.query(\"UPDATE...\n });//ends connection.query(\"SELECT *\n }//ends else { connection.query(\"SELECT * \n });//ends connection.query(\"SELECT id\n });//ends ], function (err, response) \n}//ends addInventory()", "function viewInventory(){\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5\", function(err, res){\n if (err) throw err;\n for (var i = 0; i < res.length; i++){\n table.push(\n [\n res[i].item_id,\n res[i].product_name,\n res[i].department_name,\n res[i].price,\n res[i].stock_quantity\n ]);\n }\n console.log(table.toString());\n start(); \n })\n }", "function addToInventory() {\n\n // console.log(\"Inside addToInventory()\");\n\n //Ask Manager which product he wants to add more to\n console.log(\"\\n\\nWhich item would you like to add more to?\\n\");\n\n //Display all the items for sale to the Manager\n viewProductsForSale(false, async function () {\n console.log(\"\\n\\n\");\n\n const itemInfo = await addToInventoryPrompt();\n\n let queryString = `SELECT * FROM products WHERE item_id=${itemInfo.item_id}`;\n\n let query = connection.query(queryString, function (err, res) {\n\n if (err) throw err;\n\n console.log(\"\\n\\n\");\n\n const productName = res[0].product_name;\n let updatedStockQuantity = parseInt(res[0].stock_quantity) + parseInt(itemInfo.noOfUnites);\n\n //Update the SQL database to reflect the added quantity\n let queryString = `UPDATE products SET stock_quantity = ? WHERE item_id = ?`;\n\n let query = connection.query(queryString, [updatedStockQuantity, itemInfo.item_id], function (err, res) {\n\n if (err) throw err;\n\n console.log(`\\n\\tStock Quantity increased to ${updatedStockQuantity} for ${productName}.`);\n\n //Call manager view\n console.log(\"\\n\\n\");\n bamazonManagerView();\n\n });\n\n });\n });\n\n\n\n} //End of addToInventory()", "function displayInventory(myArray) {\r\n\tvar space = 0; //inventory space\r\n\tfor(var i = 0; i < myArray.length; i++) {\r\n\t\tfor(var j = 0; j < itemStorageArray.length; j++) {\r\n\t\t\tif(myArray[i] == itemStorageArray[j].code) {\r\n\t\t\t\tget(\"item\" + i).style.display = \"block\";\r\n\t\t\t\tget(\"item\" + i).innerHTML = itemStorageArray[j].simpleName;\r\n\t\t\t\t\r\n\t\t\t\tif(itemStorageArray[j].category == \"item\") {\r\n\t\t\t\t\tget(\"icon\" + i).style.display = \"block\";\r\n\t\t\t\t\tget(\"icon\" + i).style.background = \"url(images/item-icon.png)\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(itemStorageArray[j].category == \"potion\") {\r\n\t\t\t\t\tget(\"icon\" + i).style.display = \"block\";\r\n\t\t\t\t\tget(\"icon\" + i).style.background = \"url(images/potion-icon.png)\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(itemStorageArray[j].category == \"weapon\") {\r\n\t\t\t\t\tget(\"icon\" + i).style.display = \"block\";\r\n\t\t\t\t\tget(\"icon\" + i).style.background = \"url(images/weapon-icon.png)\";\r\n\t\t\t\t}\r\n\t\t\t\telse if(itemStorageArray[j].category == \"armor\") {\r\n\t\t\t\t\tget(\"icon\" + i).style.display = \"block\";\r\n\t\t\t\t\tget(\"icon\" + i).style.background = \"url(images/armor-icon.png)\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\tspace += 1; //set space to the amount of items\r\n\t}\r\n\t//displaySpace(space);\r\n}", "function inventoryAdd(item) {\n item.show();\n\titem.moveTo(inventory_layer);\n item.clearCache();\n\titem.scale({x: 1, y: 1});\n\titem.size({width: 80, height: 80});\n\n\tif (inventory_list.indexOf(item) > -1)\n\t\tinventory_list.splice(inventory_list.indexOf(item), 1, item);\n\telse\n\t\tinventory_list.push(item);\n\n // The picked up item should be visible in the inventory. Scroll inventory\n // to the right if necessary.\n if (inventory_list.indexOf(item) > inventory_index + inventory_max - 1)\n inventory_index = Math.max(inventory_list.indexOf(item) + 1 - inventory_max, 0);\n\n current_layer.draw();\n\tredrawInventory();\n}", "function loadEquipmentSlots() {\n\tslotNames.forEach(function(item){\n\t\tmakeSlot(item[0], item[1], item[2], item[3]);\n\t\tloadDatalist(item[2], item[3]);\n\t});\n\tmakeTotal();\n}", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function (err, res) {\n //error occurs\n if (err) {\n throw err;\n }\n\n console.table(\"\\nInventory\", res);\n returnToMenu();\n });\n}", "addInventory (params) {\r\n return Api().post('/saveinventory', params)\r\n }", "function storeFront() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\n \"Item # \" + res[i].item_id + \n \" \" + res[i].product_name +\n \" Qty: \" + res[i].stock_quantity + \n \" Price: $\" + res[i].price \n );\n }\n purchaseReqeust();\n });\n}", "function take_item() {\r\n\r\n\t\titem_ladle \t\t= new proto_item(0, \"Ladle\", \"This is a very dull wooden ladle its mostly for soup and acid, but mostly soup.\");\r\n\t\titem_silver_key = new proto_item(1, \"Silver Key\", \"This is a key, and it happens to be silver, who would have thought.\");\r\n\t\titem_lockbox \t= new proto_item(2, \"Lockbox\", \"This is a box shaped container, it is also locked. You need a key to open it.\");\r\n\t\titem_keycard \t= new proto_item(3, \"Keycard\", \"This is a card that can open doors, much like a real key, but however it is in the shape of a card.\");\r\n\r\n\r\n\t\tswitch (currentlocation) {\r\n\t\t\tcase 0: \r\n\t\t\t\t\tinventoryArray[0] = item_ladle\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the Ladle.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 9:\r\n\t\t\t\t\tinventoryArray[3] = item_card\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the card.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 8:\r\n\t\t\t\t\tinventoryArray[2] = item_lockbox\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the lockbox.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 7:\r\n\t\t\t\t\tinventoryArray[1] = item_silver_key\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the Silver Key.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}", "function AddNodes() {\n $('.grid').isotope({\n itemSelector: '.grid-item', // use a separate class for itemSelector, other than .col-\n masonry: {\n columnWidth: 440,\n gutter: 30\n }\n })\n $.getJSON( \"state\", function( data ) {\n var len = data.nodes.length\n for (var i = 0; i < len; i++) {\n NewNode(data.nodes[i], i)\n }\n // Set main chart data.\n var qpsdata = normData(data[\"qpsdata\"])\n mainchart.series[0].setData(qpsdata)\n lastTS = qpsdata[qpsdata.length-1][0]\n $('.grid').isotope( 'reloadItems' ).isotope()\n })\n}", "function showInventory() {\n inquirer\n .prompt([\n {\n type: \"confirm\",\n message: \"\\nVIEW INVENTORY\",\n name: \"confirm\",\n default: true\n }\n ])\n .then(function (inquirerResponse) {\n if (inquirerResponse.confirm) {\n connection.query(\"SELECT item_id, product_name, price FROM products\", function (err, res) {\n if (err) throw err;\n\n console.log(\"\\n \\n PRODUCTS LIST: \");\n console.log(\"---------------------------\\n\")\n\n var table = new Table({\n head: ['ID#', 'PRODUCT', 'PRICE']\n , colWidths: [10, 30, 20]\n });\n for (var i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name,\n res[i].price]\n );\n\n }\n placeOrder();\n console.log(table.toString());\n });\n }\n else {\n console.log(\"\\nThat's okay, maybe next time.\\n\");\n }\n });\n\n}", "function lowInv() {\n var query = \"SELECT * FROM products WHERE stock_quantity < 5\"\n connection.query(query, function(err, res) {\n if (err) throw err;\n let table = new Table({\n head: ['Product ID', 'Product Name', 'Price', 'Stock', 'Department'],\n color: [\"blue\"],\n colAligns: [\"center\"]\n })\n console.log(\"Here is a list of low inventory products\\n\")\n res.forEach(function(row) {\n let newRow = [row.item_id, row.product_name, \"$\" + row.price, row.stock_quantity, row.department_name]\n table.push(newRow)\n })\n console.log(\"\\n\" + table.toString())\n menu();\n })\n}", "function Inventory(instrument, card) {\n let inventory = card.querySelector('.Inventory');\n let inventoryList = inventory.querySelector('.InventoryList');\n inventoryList.innerHTML = '';\n instrument.data.modules.forEach(instrumentModule => {//each module has an inventory loop through them\n let hasBulk = false;\n let instrumentName = document.createElement(\"div\"); instrumentName.className = \"InstrumentInventoryNAme\";\n instrumentName.textContent = instrumentModule.Type + \" \" + instrumentModule.Side + \" (\" + instrumentModule.InstrumentSerialNumber + \")\"\n inventoryList.appendChild(instrumentName);\n inventoryList.appendChild((document.createElement(\"hr\")));\n instrumentModule.Inventory.forEach(element => {\n if (element.ConsumableCode.includes(\"BULK_CHANNEL\")) { hasBulk = true; return; }//if this module has bulk diluent inventory we will display it later\n let elm = human_readable_consumable(element);\n //console.log(elm.height);\n inventoryList.appendChild(elm);\n });\n if (hasBulk) {\n inventoryList.appendChild(makeDiluentDisplay(instrumentModule));\n }\n });\n //inventory.hidden = false;\n inventory.style.transform = \"scale(1)\";\n document.getElementById(\"overlaySource\").innerHTML = \".Inventory\";\n //inventory.style.top = (inventory.clientHeight / 2) - (card.clientHeight / 2) + \"px\";//InventoryOverLay\n}", "function listItems() {\n connection.query(\"SELECT * FROM products\", function(err, results){\n console.log(\"\\nHere is the Current Inventory: \\n\");\n for(var i = 0; i < results.length; i++) {\n console.log(results[i].item_id + \" \" + results[i].product_name + \" $\" + results[i].price + \" quantity: \" + results[i].stock_quantity);\n };\n console.log(\"\\n============================================\\n\");\n askIfDone();\n });\n}", "function lowInventory() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n // Create new table\n var table = new Table({\n head: [\"Product ID\".headder, \"Product Name\".headder, \"Product Price\".headder, \"Units in Stock\".headder],\n colWidths: [12, 25, 15, 20]\n });\n for(var i = 0; i < res.length; i++) {\n if(res[i].stock_quantity < 5) {\n // Pushing all info from the DB into the new table\n table.push(\n [res[i].product_id, res[i].product_name, \"$\" + res[i].price, res[i].stock_quantity]\n );\n }\n }\n // Displaying the table to the user\n console.log(table.toString());\n // Ending connection\n connection.end();\n });\n}", "function displayInventory() {\n\n var inventMsg = \"Inventory:\" + inventory;\n\n updateDisplay(inventMsg);\n\n }", "function addInventory() {\n console.log(\"Add to Current Products Inventory\");\n connection.query(\"SELECT * FROM `products`\", function(err, results) {\n if (err)\n throw err;\n inquirer.prompt([{\n type: 'list',\n name: \"addProduct\",\n message: \"Add more of any product that is currently in the store\",\n choices: function() {\n var choiceArray = [];\n for (var i = 0; i < results.length; i++) {\n choiceArray.push(results[i].product_name + \" \" + \"$ \" + results[i].price);\n }\n return choiceArray;\n }\n }]).then(function(answer) {\n results.stock_quantity++;\n // results coming up undefined\n console.log(\"you added another \" + results.product_name);\n })\n });\n }", "function viewInventory() {\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5\",\n function (err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].product_name + \"\\n----------------------\\n\");\n }\n }\n )\n }", "function viewLowInventory() {\n\n // console.log(\"Inside viewLowInventory()\");\n\n let queryString = \"SELECT * FROM products WHERE stock_quantity < 5\";\n\n let query = connection.query(queryString, function (err, res) {\n\n if (err) throw err;\n\n console.log(\"\\n\\n\");\n console.log(\"\\t\\t\\t---- Low Inventory Products ---- \\n\");\n\n console.log(\"\\t\" + \"ITEM ID\" + \"\\t\\t|\\t\" + \"ITEM NAME\" + \"\\t\\t|\\t\" + \"QUANTITY\");\n console.log(\"\\t\" + \"-------\" + \"\\t\\t|\\t\" + \"---------\" + \"\\t\\t|\\t\" + \"--------\");\n\n res.forEach(item =>\n console.log(\"\\t\" + item.item_id + \"\\t\\t|\\t\" + item.product_name + \"\\t\\t|\\t\" + item.stock_quantity)\n );\n\n //Call manager view\n console.log(\"\\n\\n\");\n bamazonManagerView();\n\n });\n}" ]
[ "0.6748815", "0.6406075", "0.61015695", "0.60950416", "0.5859845", "0.5858853", "0.58533084", "0.58446", "0.5832837", "0.57878", "0.5770771", "0.5763984", "0.5655934", "0.5634753", "0.5616509", "0.558508", "0.5581621", "0.5580245", "0.5557528", "0.5539375", "0.5536774", "0.55128676", "0.5501168", "0.548747", "0.54783", "0.5475395", "0.5458984", "0.54518604", "0.54327494", "0.5417875", "0.5407799", "0.5397126", "0.5396939", "0.5393405", "0.5392198", "0.53844285", "0.53789306", "0.5375863", "0.53695744", "0.5363945", "0.53573763", "0.53535956", "0.5351447", "0.5347249", "0.5336564", "0.5329501", "0.5326477", "0.5326219", "0.53237104", "0.53177", "0.5316187", "0.5311998", "0.5304761", "0.52889365", "0.52845186", "0.52816427", "0.5273144", "0.52667665", "0.5266411", "0.525936", "0.52565724", "0.52546084", "0.52470464", "0.52450913", "0.5243854", "0.5232305", "0.52266014", "0.5226251", "0.52222645", "0.52108747", "0.52076757", "0.5206851", "0.5206307", "0.52009356", "0.5185738", "0.5176117", "0.51711524", "0.51701045", "0.5169079", "0.51667583", "0.5166541", "0.5163239", "0.5161211", "0.51573604", "0.5155994", "0.51481557", "0.51475227", "0.5146104", "0.5141322", "0.5131351", "0.51226336", "0.51196647", "0.51181155", "0.5117372", "0.51159704", "0.51094353", "0.50983083", "0.5091348", "0.50891554", "0.5081641", "0.5079431" ]
0.0
-1
Display Left sidebar with list of network elements and VMs obj can be any object with the fields ._html_id and ._expanded
function appendExpandableItem(selector, obj, extraCss, htmlHeader, htmlContent) { var liCss = "expandable"; if (extraCss) { liCss += " " + extraCss; } $(selector).append("<li class=\"" + liCss + "\" id=\"" + obj._html_id + "\">" + "<div class=\"exphead\">" + htmlHeader + "</div>" + "<div class=\"expcontent\">" + htmlContent + "</div>" + "</li>\n"); if (obj._expanded) { $("#" + obj._html_id).addClass("expanded");; } else { $("#" + obj._html_id + " .expcontent").hide(); obj._expanded = false; } $("#" + obj._html_id + " .expander").toggle(function(_obj) { return function() { $("#" + _obj._html_id + " .expcontent").show("fast"); $("#" + _obj._html_id).addClass("expanded");; $("#" + _obj._html_id + " .expander").removeClass("ui-icon-circle-triangle-s");; $("#" + _obj._html_id + " .expander").removeClass("ui-icon-minus");; $("#" + _obj._html_id + " .expander").addClass("ui-icon-circle-triangle-n");; _obj._expanded = true; }; }(obj), function(_obj) { return function () { $("#" + _obj._html_id + " .expcontent").hide("fast"); $("#" + _obj._html_id).removeClass("expanded"); $("#" + _obj._html_id + " .expander").removeClass("ui-icon-circle-triangle-n");; $("#" + _obj._html_id + " .expander").removeClass("ui-icon-minus");; $("#" + _obj._html_id + " .expander").addClass("ui-icon-circle-triangle-s");; _obj._expanded = false; }; }(obj)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function NetworksListView(){\n\tclearNav();\n\t\n\tclearSection();\n\tvar local_simulation = get_local_simulation();\n\tvar local_device = get_local_device();\n\tvar lists = getRealNetworks(local_simulation.partition_list);\n\tvar html = NetworksListTemplate(lists, local_device);\n\t\n\tgetContainer().innerHTML = html;\n\tremoveClass('active');\n\tdocument.getElementById('my-networks-link').className='active';\n}", "function openCaseList() {\n displayElement('leftPanel');\n}", "function openNav() {\n\t\n\tvar html=\"\";\n\n\n\tStore.treeIterate(function(node){\n\t\thtml+='<li class=\"list-group-item node-treeview4\" data-nodeid=\"0\" style=\"color:undefined;background-color:undefined;\" data-cell=\"'+node.cell+'\">'+node.title+'</li>';\t\t\n\t});\n\t\n\t// Store.iterate(function(index,row){\n\t// \tvar value=row[\"id\"];\n\t//\n\t// \tif (value){\n\t// \t\thtml+='<li class=\"list-group-item node-treeview4\" data-nodeid=\"0\" style=\"color:undefined;background-color:undefined;\">Article '+index+'</li>';\n\t// \t\t// html+=\"<button class='btn btn-default'> Article \"+value+\". </button>\";\n\t// \t}\n\t// });\n\n\tvar el=$(\"#mySidenav\");\n\tel.html('<ul class=\"list-group\">'+\n\t\t\thtml+\n\t\t\t'</ul>');\n\t\n\tel.css(\"width\",\"200px\");\n\t\n document.getElementById(\"main\").style.marginLeft = \"200px\";\n}", "function leftNav() {\n\tapp.getView().render('content/folder/customerserviceaboutusleftnav');\n}", "show() {\n for (let node of this.nodes) {\n node.show();\n node.showLinks();\n }\n }", "function viewsectiontree() {\n $.each(treesectionArray, function(i, data) {\n checkdraft = data[\"draft\"];\n if (!checkdraft) {\n if (treesectionArray.length) {\n /* var content = \"<a href='\" + data[\"url\"] + \"'>\" + data[\"name\"] + \"</a>\";\n var list = $('<li class=\"treeline\" id=\"treelist\"/>').html(content);\n */\n var hold = document.createElement(\"a\");\n hold.href = data[\"url\"];\n var temp = document.createTextNode(data[\"name\"]);\n hold.appendChild(temp);\n var list = document.createElement(\"li\");\n list.className = \"treeline\";\n list.appendChild(hold);\n showData.css('display', 'none').append(list);\n }\n }\n });\n }", "function xcustom_showSelectedObjectDataOnViewer(theObject) {\r\n if (theObject) {\r\n // console.log(theObject);\r\n xcustom_resetAndClosePanelSelectedObjectContent();\r\n $('#xcustom-div-prop-grid').html(xcustom_createSelectedObjectPanelContet(theObject));\r\n $('#xcustom-div-error-grid').html(xcustom_createSelectedErrorPanelContet(theObject));\r\n $('#xcustom-div-right-panel').show();\r\n }\r\n}", "function createStructure(obj, side) {\n //console.log('createStructure',side);\n var elem = side === 'front' ? $('.js-block-front[data-clone=true]') : $('.js-block-back[data-clone=true]');\n\n //clean\n elem.find('.js-ingridiets').html('');\n elem.find('.js-details').removeClass('show').removeClass('hide');\n elem.find('.js-nutrition').removeClass('show').removeClass('hide');\n\n elem.find('.js-title').html(obj.name);\n\n elem.find('.js-cook').html(obj.details.cook);\n elem.find('.js-prep').html(obj.details.prep);\n elem.find('.js-skill').html(obj.details.skill);\n elem.find('.js-serves').html(obj.details.serves);\n\n elem.find('.js-kcal').html(obj.nutrition.kcal);\n elem.find('.js-salt').html(obj.nutrition.salt);\n elem.find('.js-sugars').html(obj.nutrition.sugars);\n elem.find('.js-protein').html(obj.nutrition.protein);\n\n var subArr = [];\n var it = 0;\n subArr[it] = [];\n\n for (var i = 0; obj.ingridiets.length > i; i++) {\n if (i % 5 == 0) {\n it++;\n subArr[it] = [];\n subArr[it].push(obj.ingridiets[i]);\n } else {\n subArr[it].push(obj.ingridiets[i]);\n }\n }\n\n subArr.splice(0, 1)\n //console.log(subArr);\n\n for (var i = 0; subArr.length> i;i++) {\n var ul = '<ul class=\"ul_'+ i +' animated\"></ul>';\n elem.find('.js-ingridiets').append(ul);\n\n for (var it = 0; subArr[i].length> it;it++) {\n elem.find('.ul_' + i).append('<li>' + subArr[i][it] + '</li>');\n }\n }\n\n }", "function build_left_content() {\n\t\t\tvar obj = '';\n var buttons_content='';\n // extract data from json\n var obj = eval(\"(\" + global_data['data_left'] + \")\");\n\n //add label\n if (global_settings.layout==1 && global_settings.toolbar_label && global_settings.share_tooltip != 1){\n buttons_content = '<li class=\"labelLeftContent\">'+socialToolbarSettings.labelLeftContent+'</li>';\n }\n \n if (global_settings.recommend_email==1) buttons_content += '<li class=\"mailButton\" id=\"social_toolbar_mail_button\"><a href=\"#\" onclick=\"{socialtoolbar.mail_win_init(this); return false;}\"><img src=\"'+global_settings.module_path+'/themes/default/images/sm_ico_0.png\" border=\"0\" /></a></li>';\n\n var x, i = left_buttons.length, buttonsContent = new Array(i);\n while(i--) {\n x='recommend_'+i;\n // check if button is enabled\n if (obj[x]==1)\n buttonsContent[i] = '<li class=\"leftButton '+left_label[i]+'\">'+left_buttons[i]+'</li>';\n }\n\n var content = '<ul>'+buttons_content + buttonsContent.join(\"\")+'</ul>';\n return content;\n\n }", "function createSideBarList(data) {\n //Creating HTML elements\n var listgroup = document.getElementById('list-group');\n //div item\n var listdiv = document.createElement('div');\n\n listdiv.id = '' + data.facilityName;\n listdiv.classList.add(\"animated\", \"visable\");\n //list item\n var listitem = document.createElement('a');\n listitem.value = '{\"lat\":' + data.lat + ',\"lng\":' + data.lng + '}';\n listitem.onclick = gotoNode;\n\n\n listitem.id = '' + data.facilityName;\n listitem.classList.add(\"list-group-item\");\n listitem.classList.add(\"list-group-item-action\");\n listitem.classList.add(\"flex-column\");\n listitem.classList.add(\"align-items-start\");\n\n //list item header\n var listheader = document.createElement('div');\n listheader.classList.add(\"d-flex\");\n listheader.classList.add(\"w-100\");\n listheader.classList.add(\"justify-content-between\");\n\n var icon = getSportsIcon(data.sports);\n if (icon === \"\"){\n icon = data.sports; // If the icon is not available, just show the sports activity name\n }\n listheader.innerHTML = '<h5 class=\"mb-1\">' + data.facilityName + '</h5></a><small style=\"white-space:nowrap\">';\n\n //list item main\n var listmain = document.createElement('p');\n listmain.classList.add(\"mb-1\");\n listmain.innerHTML = 'Address: ' + data.address;\n var listActivity = document.createElement('p');\n listActivity.classList.add(\"mb-1\");\n listActivity.innerHTML = '<h5 class=\"mb-1\">' + icon+ '</h5><small style=\"white-space:nowrap\">';\n\n listitem.appendChild(listheader);\n listitem.appendChild(listActivity);\n listitem.appendChild(listmain);\n listdiv.appendChild(listitem);\n listgroup.appendChild(listdiv);\n}", "function xcustom_createSelectedObjectPanelContet(theObject) {\r\n if (theObject) {\r\n \r\n\t\tvar html = '<ol> <li class=\"tree\">';\r\n\t\t\r\n\t\thtml += '<label for=\"ifcData\">Données IFC</label><input type=\"checkbox\" id=\"ifcData\" />';\r\n\t\thtml += '<ol><li><table class=\"table table-striped\"><tbody>';\r\n\t\thtml += '<tr><th scope=\"row\" class=\"xcustom-th-prop-grid\">'+'ifcGuid'+'</th><td class=\"xcustom-td-prop-grid\">'+theObject['uri']+'</td></tr>';\r\n\t\thtml += '<tr><th scope=\"row\" class=\"xcustom-th-prop-grid\">'+'Classification Ifc'+'</th><td class=\"xcustom-td-prop-grid\">'+theObject['group']+'</td></tr>';\r\n\t\thtml += '</tbody></table></li></ol></li></ol>';\r\n\t\t\r\n\t\tifcObjectProp = ifcData[theObject['uri']];\r\n\t\tObject.entries(ifcObjectProp).forEach(([propSetName, propSet]) => {\r\n\t\t\t\r\n\t\t\thtml += '<ol> <li class=\"tree\">';\r\n\t\t\thtml += '<label for=\"' + propSetName + '\">' + propSetName + '</label><input type=\"checkbox\" id=\"' + propSetName + '\" />';\r\n\t\t\thtml += '<ol><li><table class=\"table table-striped\"><tbody>';\r\n\t\t\t\r\n\t\t\tObject.entries(propSet).forEach(([propName, propValue]) => {\r\n\t\t\t\thtml += '<tr><th scope=\"row\" class=\"xcustom-th-prop-grid\">'+propName+'</th><td class=\"xcustom-td-prop-grid\">'+propValue+'</td></tr>';\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\thtml += '</tbody></table></li></ol></li></ol>';\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n return html;\r\n }\r\n return '';\r\n}", "function node_page_pageshow() {\n try {\n // Grab some recent content and display it.\n views_datasource_get_view_result(\n 'drupalgap/views_datasource/drupalgap_content', {\n success: function(content) {\n // Extract the nodes into items, then drop them in the list.\n var items = [];\n $.each(content.nodes, function(index, object) {\n items.push(l(object.node.title, 'node/' + object.node.nid));\n });\n drupalgap_item_list_populate('#node_listing_items', items);\n }\n }\n );\n }\n catch (error) { console.log('node_page_pageshow - ' + error); }\n}", "function displayTreeView() {\n if ($('#toggle_explorer_button').hasClass('okit-bar-panel-displayed')) {\n let okit_tree = new OkitJsonTreeView(okitJsonModel, 'explorer_panel');\n okit_tree.draw();\n }\n}", "function node_page_pageshow() {\n try {\n // Grab some recent content and display it.\n views_datasource_get_view_result(\n 'drupalgap/views_datasource/drupalgap_content', {\n success: function(content) {\n // Extract the nodes into items, then drop them in the list.\n var items = [];\n for (var index in content.nodes) {\n if (!content.nodes.hasOwnProperty(index)) { continue; }\n var object = content.nodes[index];\n items.push(l(object.node.title, 'node/' + object.node.nid));\n }\n drupalgap_item_list_populate('#node_listing_items', items);\n }\n }\n );\n }\n catch (error) { console.log('node_page_pageshow - ' + error); }\n}", "function showSwimlaneWindow() {\n $(\"#currentSwimlane\").html(\"\");\n var sw = $(\"#kanban th\");\n for (var i = 0; i < sw.length; i++) {\n\n // Attributes\n var name = $(\".swName\", sw[i]).html();\n var id = $(sw[i]).attr(\"data-id\");\n var type = $(sw[i]).attr(\"data-type\");\n\n var objtext = getSwimlaneDisplay(name, id, type);\n\n // Append to container\n $(\"#currentSwimlane\").append(objtext);\n }\n}", "function printPageLabOpen(lab) {\n if ( $.cookie(\"topo\") == undefined ) $.cookie(\"topo\", 'light');\n var html = '<div id=\"lab-sidebar\"><ul></ul></div><div id=\"lab-viewport\" data-path=\"' + lab + '\"></div>';\n $('#body').html(html);\n // Print topology\n $.when(printLabTopology(),getPictures()).done( function (rc,pic) {\n if ((ROLE == 'admin' || ROLE == 'editor') && LOCK == 0 ) {\n $('#lab-sidebar ul').append('<li class=\"action-labobjectadd-li\"><a class=\"action-labobjectadd\" href=\"javascript:void(0)\" title=\"' + MESSAGES[56] + '\"><i class=\"glyphicon glyphicon-plus\"></i></a></li>');\n }\n $('#lab-sidebar ul').append('<li class=\"action-nodesget-li\"><a class=\"action-nodesget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[62] + '\"><i class=\"glyphicon glyphicon-hdd\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-networksget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[61] + '\"><i class=\"glyphicon glyphicon-transfer\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-configsget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[58] + '\"><i class=\"glyphicon glyphicon-align-left\"></i></a></li>');\n $('#lab-sidebar ul').append('<li class=\"action-picturesget-li\"><a class=\"action-picturesget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[59] + '\"><i class=\"glyphicon glyphicon-picture\"></i></a></li>');\n if ( Object.keys(pic) < 1 ) {\n $('.action-picturesget-li').addClass('hidden');\n }\n\n $('#lab-sidebar ul').append('<li><a class=\"action-textobjectsget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[150] + '\"><i class=\"glyphicon glyphicon-text-background\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-moreactions\" href=\"javascript:void(0)\" title=\"' + MESSAGES[125] + '\"><i class=\"glyphicon glyphicon-th\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-labtopologyrefresh\" href=\"javascript:void(0)\" title=\"' + MESSAGES[57] + '\"><i class=\"glyphicon glyphicon-refresh\"></i></a></li>');\n $('#lab-sidebar ul').append('<li class=\"plus-minus-slider\"><i class=\"fa fa-minus\"></i><div class=\"col-md-2 glyphicon glyphicon-zoom-in sidemenu-zoom\"></div><div id=\"zoomslide\" class=\"col-md-5\"></div><div class=\"col-md-5\"></div><i class=\"fa fa-plus\"></i><br></li>');\n $('#zoomslide').slider({value:100,min:10,max:200,step:10,slide:zoomlab});\n //$('#lab-sidebar ul').append('<li><a class=\"action-freeselect\" href=\"javascript:void(0)\" title=\"' + MESSAGES[151] + '\"><i class=\"glyphicon glyphicon-check\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-status\" href=\"javascript:void(0)\" title=\"' + MESSAGES[13] + '\"><i class=\"glyphicon glyphicon-info-sign\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-labbodyget\" href=\"javascript:void(0)\" title=\"' + MESSAGES[64] + '\"><i class=\"glyphicon glyphicon-list-alt\"></i></a></li>');\n $('#lab-sidebar ul').append('<li><a class=\"action-lock-lab\" href=\"javascript:void(0)\" title=\"' + MESSAGES[166] + '\"><i class=\"glyphicon glyphicon-ok-circle\"></i></a></li>');\n if ( $.cookie(\"topo\") == 'dark' ) {\n $('#lab-sidebar ul').append('<li><a class=\"action-lightmode\" href=\"javascript:void(0)\" title=\"' + MESSAGES[236] + '\"><i class=\"fas fa-sun\"></i></a></li>');\n } else {\n $('#lab-sidebar ul').append('<li><a class=\"action-nightmode\" href=\"javascript:void(0)\" title=\"' + MESSAGES[235] + '\"><i class=\"fas fa-moon\"></i></a></li>');\n }\n $('#lab-sidebar ul').append('<div id=\"action-labclose\"><li><a class=\"action-labclose\" href=\"javascript:void(0)\" title=\"' + MESSAGES[60] + '\"><i class=\"glyphicon glyphicon-off\"></i></a></li></div>');\n $('#lab-sidebar ul').append('<li><a class=\"action-logout\" href=\"javascript:void(0)\" title=\"' + MESSAGES[14] + '\"><i class=\"glyphicon glyphicon-log-out\"></i></a></li>');\n $('#lab-sidebar ul a').each(function () {\n var t = $(this).attr(\"title\");\n $(this).append(t);\n\n\n })\n if ( LOCK == 1 ) {\n lab_topology.setDraggable($('.node_frame, .network_frame, .customShape'), false);\n $('.customShape').resizable('disable');\n }\n })\n}", "toHtml() {\n\t\tlet node = document.createElement('div');\n\t\tnode.classList.add('fold-list-node');\n\t\tnode.classList.add('fold-list-hidden');\n\n\t\tlet toggle = document.createElement('button');\n\t\ttoggle.className = 'fold-list-toggle';\n\t\ttoggle.innerText = this.name;\n\n\t\tlet remove = document.createElement('button');\n\t\tremove.className = 'fold-list-remove';\n\t\tremove.innerText = 'X';\n\n\t\tlet data = document.createElement('div');\n\t\tdata.className = 'fold-list-data';\n\n\t\tfor(let c in this.contents) {\n\t\t\tdata.appendChild(this.contents[c]);\n\t\t}\n\n\t\tnode.appendChild(toggle);\n\t\tnode.appendChild(remove);\n\t\tnode.appendChild(data);\n\n\t\treturn node;\n\t}", "function renderList(treeData, element, object_id, treeProperties){\n var html = \"<ul>\";\n\n var qMatrix = treeData.qHyperCube.qDataPages[0].qMatrix;\n\n var data = qMatrix.map(function(d) {\n return {\n \"NodeID\": d[1].qNum,\n \"parentNodeID\": d[2].qNum,\n \"qElemNumber\": d[3].qElemNumber\n }\n });\n\n // Sort by Alphabetic order\n qMatrix.sort(function(a, b){\n var nameA=a[3].qText.toLowerCase(), nameB=b[3].qText.toLowerCase();\n if (nameA < nameB) //sort string ascending\n return -1;\n if (nameA > nameB)\n return 1;\n return 0; //default return value (no sorting)\n });\n\n // Creating listbox\n qMatrix.forEach( function ( row ) {\n html += '<li class=\"data state' + row[3].qState + '\" data-value=\"' + row[3].qElemNumber + '\">' + row[3].qText;\n html += '</li>';\n } );\n html += \"</ul>\";\n element.html( html );\n\n // Event triggered by selection\n element.find( 'li' ).on( 'qv-activate', function (d) {\n \t\t\t if ( this.hasAttribute( \"data-value\" ) ) {\n \t\t\t \tvar value = parseInt( this.getAttribute( \"data-value\" ), 10 ), dim = 0;\n\n //Define arrays to store queue and selected node list\n var q = [], selected = [];\n\n //Get the top node's NodeID\n var topNode = _.findWhere(data, {\"qElemNumber\": value});\n var topNodeID = topNode.NodeID;\n\n //Add topNodeID to the queue and selected node\n q.push(topNodeID);\n selected.push(value);\n\n //Repeat to include all child nodes into selected node list\n while( q.length > 0 ) {\n var res = _.where(data, {\"parentNodeID\": q.pop()});\n _.each(res, function(d) {\n q.push(d.NodeID);\n selected.push(d.qElemNumber);\n })\n }\n\n //Apply selection\n self.selectValues( dim, selected , true );\n \t\t\t }\n \t\t} );\n\n }", "renderNodes() {\n\t\tlet nodes = [];\n\t\tthis.props.data.nodes.forEach((node, index) => {\n\t\t\tif (!node) return;\n\t\t\t// let index = this.props.data.nodes.indexOf(node);\n\t\t\tswitch (node.type) {\n\t\t\t\tcase 'header': {\n\t\t\t\t\tnodes.push(\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<div className=\"panel panel-default\" style={'display:none'}>\n\t\t\t\t\t\t\t\t<div className=\"panel-heading tab\">\n\t\t\t\t\t\t\t\t\t<h3 className=\"panel-title tab-title\">Header</h3>\n\t\t\t\t\t\t\t\t\t<div className=\"toggle-group\">\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"btn btn-success tab-toggle\"\n\t\t\t\t\t\t\t\t\t\t\tid={`page${this.props.index}node${index}`}\n\t\t\t\t\t\t\t\t\t\t\tindex={`${index}`}\n\t\t\t\t\t\t\t\t\t\t\tpage={`${this.props.index}`}\n\t\t\t\t\t\t\t\t\t\t\tonClick={e => {\n\t\t\t\t\t\t\t\t\t\t\t\tthis.toggle(e, 'node');\n\t\t\t\t\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t\t\t\t\t{document.getElementById(`page${this.props.index}nodepanel${index}`) ? (document.getElementById(`page${this.props.index}nodepanel${index}`).getAttribute('data-toggle') === 'hide' ? 'Edit' : 'Done') : 'Edit'}\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"panel-hide modal-wrap\" data-toggle=\"hide\" id={`page${this.props.index}nodepanel${index}`}>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName=\"backdrop\"\n\t\t\t\t\t\t\t\t\tid={`page${this.props.index}node${index}`}\n\t\t\t\t\t\t\t\t\tindex={`${index}`}\n\t\t\t\t\t\t\t\t\tpage={`${this.props.index}`}\n\t\t\t\t\t\t\t\t\tonClick={e => {\n\t\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t// e.nativeEvent.stopImmediatePropagation();\n\t\t\t\t\t\t\t\t\t\t// e.nativeEvent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\tthis.toggle(e, 'node');\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<div className=\"panel-body nodepanel\">\n\t\t\t\t\t\t\t\t\t<h4>Header Text</h4>\n\t\t\t\t\t\t\t\t\t<div className=\"input-group\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" className=\"form-control\" name=\"heading\" aria-describedby=\"sizing-addon2\" value={node.data.text} onChange={e => this.handleNodeChange(e, this.props.data.nodes.indexOf(node), 'text', false, this.props.index)} />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t{/* <form>\n\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\t\t\t\t\tvalue={node.data.layout}\n\t\t\t\t\t\t\t\t\t\t\tonChange={e => {\n\t\t\t\t\t\t\t\t\t\t\t\tthis.handleNodeChange(e, index, 'layout');\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</form> */}\n\t\t\t\t\t\t\t\t\t<form>\n\t\t\t\t\t\t\t\t\t\t<label Htmlfor=\"show-border\">Show Border</label>\n\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\t\t\t\tname=\"show-border\"\n\t\t\t\t\t\t\t\t\t\t\tonChange={e => {\n\t\t\t\t\t\t\t\t\t\t\t\tthis.handleNodeChange(e, index, 'header', 'border', this.props.index);\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\tchecked={node.data.border}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t<div className=\"tab\">\n\t\t\t\t\t\t\t\t\t\t<button className=\"btn btn-success\" id={`page${this.props.index}node${index}`} index={`${index}`} page={`${this.props.index}`} onClick={e => this.toggle(e, 'node')}>\n\t\t\t\t\t\t\t\t\t\t\t{/* {document.getElementById(`page${this.props.index}nodepanel${index}`) ? (document.getElementById(`page${this.props.index}nodepanel${index}`).getAttribute('data-toggle') === 'hide' ? 'Edit' : 'Done') : 'Edit'} */}\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"glyphicon glyphicon-ok\" style='pointer-events: none;' />\n\t\t\t\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t\t\t\tDone\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t<button className=\"btn btn-danger\" onClick={e => this.handleNodeChange(e, this.props.data.nodes.indexOf(node), 'delete', false, this.props.index)}>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"glyphicon glyphicon-alert\" />\n\t\t\t\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t\t\t\tRemove\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'desc': {\n\t\t\t\t\tnodes.push(\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<div className=\"panel panel-default\" style={'display:none'}>\n\t\t\t\t\t\t\t\t<div className=\"panel-heading tab\">\n\t\t\t\t\t\t\t\t\t<h3 className=\"panel-title tab-title\">Description</h3>\n\t\t\t\t\t\t\t\t\t<div className=\"toggle-group\">\n\t\t\t\t\t\t\t\t\t\t<button className=\"btn btn-success tab-toggle\" id={`page${this.props.index}node${index}`} index={`${index}`} onClick={e => this.toggle(e, 'node')}>\n\t\t\t\t\t\t\t\t\t\t\t{document.getElementById(`page${this.props.index}nodepanel${index}`) ? (document.getElementById(`page${this.props.index}nodepanel${index}`).getAttribute('data-toggle') === 'hide' ? 'Edit' : 'Done') : 'Edit'}\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"panel-hide modal-wrap\" data-toggle=\"hide\" id={`page${this.props.index}nodepanel${index}`}>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName=\"backdrop\"\n\t\t\t\t\t\t\t\t\tid={`page${this.props.index}node${index}`}\n\t\t\t\t\t\t\t\t\tindex={`${index}`}\n\t\t\t\t\t\t\t\t\tpage={`${this.props.index}`}\n\t\t\t\t\t\t\t\t\tonClick={e => {\n\t\t\t\t\t\t\t\t\t\tthis.toggle(e, 'node');\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<div className=\"panel-body nodepanel\" data-toggle=\"hide\">\n\t\t\t\t\t\t\t\t\t<h4>Description Text</h4>\n\t\t\t\t\t\t\t\t\t<div className=\"input-group\">\n\t\t\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\t\t\t// className=\"form-control\"\n\t\t\t\t\t\t\t\t\t\t\tstyle=\"width: 100%; height: 100px\"\n\t\t\t\t\t\t\t\t\t\t\tname=\"desc\"\n\t\t\t\t\t\t\t\t\t\t\taria-describedby=\"sizing-addon2\"\n\t\t\t\t\t\t\t\t\t\t\tvalue={node.data.text}\n\t\t\t\t\t\t\t\t\t\t\tonChange={e => this.handleNodeChange(e, this.props.data.nodes.indexOf(node), 'text', false, this.props.index)}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div className=\"tab\">\n\t\t\t\t\t\t\t\t\t\t<button className=\"btn btn-success\" id={`page${this.props.index}node${index}`} index={`${index}`} onClick={e => this.toggle(e, 'node')}>\n\t\t\t\t\t\t\t\t\t\t\t{/* {document.getElementById(`page${this.props.index}nodepanel${index}`) ? (document.getElementById(`page${this.props.index}nodepanel${index}`).getAttribute('data-toggle') === 'hide' ? 'Edit' : 'Done') : 'Edit'} */}\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"glyphicon glyphicon-ok\" style='pointer-events: none;' />\n\t\t\t\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t\t\t\tDone\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t<button className=\"btn btn-danger\" onClick={e => this.handleNodeChange(e, this.props.data.nodes.indexOf(node), 'delete', false, this.props.index)}>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"glyphicon glyphicon-alert\" />\n\t\t\t\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t\t\t\tRemove\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'image': {\n\t\t\t\t\tnodes.push(\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<div className=\"panel panel-default\" style={'display:none'}>\n\t\t\t\t\t\t\t\t<div className=\"panel-heading tab\">\n\t\t\t\t\t\t\t\t\t<h3 className=\"panel-title tab-title\">Image</h3>\n\t\t\t\t\t\t\t\t\t<div className=\"toggle-group\">\n\t\t\t\t\t\t\t\t\t\t<button className=\"btn btn-success tab-toggle\" id={`page${this.props.index}node${index}`} index={`${index}`} onClick={e => this.toggle(e, 'node')}>\n\t\t\t\t\t\t\t\t\t\t\t{document.getElementById(`page${this.props.index}nodepanel${index}`) ? (document.getElementById(`page${this.props.index}nodepanel${index}`).getAttribute('data-toggle') === 'hide' ? 'Edit' : 'Done') : 'Edit'}\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"panel-hide modal-wrap\" data-toggle=\"hide\" id={`page${this.props.index}nodepanel${index}`}>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName=\"backdrop\"\n\t\t\t\t\t\t\t\t\tid={`page${this.props.index}node${index}`}\n\t\t\t\t\t\t\t\t\tindex={`${index}`}\n\t\t\t\t\t\t\t\t\tpage={`${this.props.index}`}\n\t\t\t\t\t\t\t\t\tonClick={e => {\n\t\t\t\t\t\t\t\t\t\tthis.toggle(e, 'node');\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<div className=\"panel-body nodepanel\">\n\t\t\t\t\t\t\t\t\t<h4 className=\"text-center\">Selected Image:</h4>\n\t\t\t\t\t\t\t\t\t<div className=\"plugin-thumbnail\" title=\"Click to change Image.\" style={`background: url('${node.data.src}')`} onClick={() => this.addImg('node', this.props.data.nodes.indexOf(node), this.props.index)} />\n\t\t\t\t\t\t\t\t\t<h6 className=\"text-center\">Click to change</h6>\n\t\t\t\t\t\t\t\t\t<div className=\"container\">\n\t\t\t\t\t\t\t\t\t\t<div className=\"item row margin-bottom-twenty clearfix\">\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"col-md-3 padding-right-zero pull-left\">\n\t\t\t\t\t\t\t\t\t\t\t\t<span>Sizing: </span>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"main col-md-9 pull-right\">\n\t\t\t\t\t\t\t\t\t\t\t\t{/* <div className=\"tab\"> */}\n\t\t\t\t\t\t\t\t\t\t\t\t<span title=\"Makes this image full screen with a header and subtext.\" style=\"pointer-events: all\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<label>Full screen {' '}</label>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"hero\" id={`${node.instanceId}`} onChange={e => this.handleNodeChange(e, this.props.data.nodes.indexOf(node), 'img', false, this.props.index)} checked={node.format === 'hero' ? true : false} />\n\t\t\t\t\t\t\t\t\t\t\t\t\t{/* </div> */}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{/* <div className=\"tab\"> */}\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span title=\"Allows you to define a custom height for this image.\" style=\"pointer-events: all\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<label>Custom {' '}</label>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"custom\" id={`${node.instanceId}`} onChange={e => this.handleNodeChange(e, this.props.data.nodes.indexOf(node), 'img', false, this.props.index)} checked={node.format === 'custom' ? true : false} />\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t{node.format === 'custom' ? (\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t{/* <div className=\"input-group\" style=\"line-height: 32px;\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label htmlFor=\"size\">Image height: </label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitle=\"Sets the image height\"\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstep=\"0.01\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"form-control\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle=\"width: 66vw; float: right;\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tname=\"size\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={node.data.height}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={e => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet height = parseFloat(e.target.value);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.handleNodeChange(height, this.props.data.nodes.indexOf(node), 'img', false, this.props.index);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</div> */}\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"input-group\" style=\"line-height: 32px;\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label htmlFor=\"size\">Image height: </label>\n\t\t\t\t\t\t\t\t\t\t\t\t{/* <input\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={node.data.height * 100}\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle=\"width: 9vw\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={e => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet height = parseFloat(e.target.value) / 100;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.handleNodeChange(height, this.props.data.nodes.indexOf(node), 'img', false, this.props.index);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t/> */}\n\t\t\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitle=\"Sets the image height\"\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"range\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tmax=\"150\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"form-control img-slider\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle=\"width: 60vw; float: right;\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tname=\"size\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={node.data.height * 100}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={e => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlet height = parseFloat(e.target.value) / 100;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.handleNodeChange(height, this.props.data.nodes.indexOf(node), 'img', false, this.props.index);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div style='text-align: center; margin-top: -10px;'>{Math.floor(node.data.height * 100)}% of screen width</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<div />\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t{node.format === 'hero' ? (\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"input-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" className=\"form-control\" name=\"header\" aria-describedby=\"sizing-addon2\" value={node.data.header} onChange={e => this.handleNodeChange(e, this.props.data.nodes.indexOf(node), 'hero-header', false, this.props.index)} />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"input-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" className=\"form-control\" name=\"subtext\" aria-describedby=\"sizing-addon2\" value={node.data.subtext} onChange={e => this.handleNodeChange(e, this.props.data.nodes.indexOf(node), 'hero-subtext', false, this.props.index)} />\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<div />\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t<div className=\"tab\">\n\t\t\t\t\t\t\t\t\t\t<button className=\"btn btn-success\" id={`page${this.props.index}node${index}`} index={`${index}`} onClick={e => this.toggle(e, 'node')}>\n\t\t\t\t\t\t\t\t\t\t\t{/* {document.getElementById(`page${this.props.index}nodepanel${index}`) ? (document.getElementById(`page${this.props.index}nodepanel${index}`).getAttribute('data-toggle') === 'hide' ? 'Edit' : 'Done') : 'Edit'} */}\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"glyphicon glyphicon-ok\" style='pointer-events: none;' />\n\t\t\t\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t\t\t\tDone\n\t\t\t\t\t\t\t\t\t\t</button>\n\n\t\t\t\t\t\t\t\t\t\t<button className=\"btn btn-danger\" onClick={e => this.handleNodeChange(e, this.props.data.nodes.indexOf(node), 'delete', false, this.props.index)}>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"glyphicon glyphicon-alert\" />\n\t\t\t\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t\t\t\tRemove\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'plugin': {\n\t\t\t\t\tif (!node.data) return;\n\t\t\t\t\tnodes.push(\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<div className=\"panel panel-default\" style={'display:none'}>\n\t\t\t\t\t\t\t\t<div className=\"panel-heading tab\">\n\t\t\t\t\t\t\t\t\t<h3 className=\"panel-title tab-title\">\n\t\t\t\t\t\t\t\t\t\t{node.data._buildfire.pluginType.result[0].name} ({node.data.title})\n\t\t\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t\t\t<div className=\"toggle-group\">\n\t\t\t\t\t\t\t\t\t\t<button className=\"btn btn-success tab-toggle\" id={`page${this.props.index}node${index}`} index={`${index}`} onClick={e => this.toggle(e, 'node')}>\n\t\t\t\t\t\t\t\t\t\t\t{document.getElementById(`page${this.props.index}nodepanel${index}`) ? (document.getElementById(`page${this.props.index}nodepanel${index}`).getAttribute('data-toggle') === 'hide' ? 'Edit' : 'Done') : 'Edit'}\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"panel-body panel-hide nodepanel\" id={`page${this.props.index}nodepanel${index}`} data-toggle=\"hide\">\n\t\t\t\t\t\t\t\t<div className=\"plugin\">\n\t\t\t\t\t\t\t\t\t<div className=\"plugin-thumbnail\" style={`background: url(\"${node.data.iconUrl}\")`} alt=\"...\" onClick={e => this.addImg(null, this.props.data.nodes.indexOf(node), this.props.index)} />\n\t\t\t\t\t\t\t\t\t{/* <h3 className=\"plugin-title\">{node.data.title}</h3> */}\n\t\t\t\t\t\t\t\t\t<div className=\"input-group tab-toggle\" style=\"margin-left:15px;\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" className=\"plugin-title form-control\" name=\"plugin\" aria-describedby=\"sizing-addon2\" value={node.data.title} onChange={e => this.handleNodeChange(e, this.props.data.nodes.indexOf(node), 'plugin', false, this.props.index)} />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<hr />\n\t\t\t\t\t\t\t\t<div className=\"tab\">\n\t\t\t\t\t\t\t\t\t<button className=\"btn btn-success tab-toggle\" id={`page${this.props.index}node${index}`} index={`${index}`} onClick={e => this.toggle(e, 'node')}>\n\t\t\t\t\t\t\t\t\t\t{document.getElementById(`page${this.props.index}nodepanel${index}`) ? (document.getElementById(`page${this.props.index}nodepanel${index}`).getAttribute('data-toggle') === 'hide' ? 'Edit' : 'Done') : 'Edit'}\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t<button className=\"btn btn-danger tab-toggle\" onClick={e => this.handleNodeChange(e, index, 'delete', false, this.props.index)}>\n\t\t\t\t\t\t\t\t\t\t<span className=\"glyphicon glyphicon-alert\" />\n\t\t\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t\t\tRemove\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'action': {\n\t\t\t\t\tif (!node.data) return;\n\t\t\t\t\tlet defaultImgDiag = (\n\t\t\t\t\t\t<div style={'position: absolute; right: 15px; z-index: 10000'}>\n\t\t\t\t\t\t\t<label Htmlfor=\"defaultImg\">Use Default Plugin Image</label>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tname=\"defaultImg\"\n\t\t\t\t\t\t\t\tid={`defaultImg${index}`}\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\tonChange={e => {\n\t\t\t\t\t\t\t\t\tswitch (e.target.checked) {\n\t\t\t\t\t\t\t\t\t\tcase true:\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tlocalStorage.setItem(`prevImg${node.instanceId}`, node.data.iconUrl);\n\t\t\t\t\t\t\t\t\t\t\t\tbuildfire.pluginInstance.get(node.data.instanceId, (err, inst) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (err) throw err;\n\t\t\t\t\t\t\t\t\t\t\t\t\tnode.data.iconUrl = inst.iconUrl;\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.update();\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase false:\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tlet prevImg = localStorage.getItem(`prevImg${node.instanceId}`);\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (prevImg === 'undefined') prevImg = false;\n\t\t\t\t\t\t\t\t\t\t\t\tif (prevImg) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.handleNodeChange(prevImg, index, 'src', false, this.props.index);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.addImg('action', this.props.data.nodes.indexOf(node), this.props.index);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tchecked={node.data.iconUrl ? (node.data.iconUrl.indexOf('/plugins/') > -1 ? true : false) : false}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\n\t\t\t\t\tlet linkOnly = (\n\t\t\t\t\t\t<div style={'position: absolute; right: 15px; z-index: 10000'}>\n\t\t\t\t\t\t\t<label Htmlfor=\"link-only\">Link Only</label>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tname=\"link-only\"\n\t\t\t\t\t\t\t\tid={`linkOnly${index}`}\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\tonChange={e => {\n\t\t\t\t\t\t\t\t\tswitch (e.target.checked) {\n\t\t\t\t\t\t\t\t\t\tcase true:\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tnode.format = 'linkOnly';\n\t\t\t\t\t\t\t\t\t\t\t\tthis.update();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase false:\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tnode.format = 'default';\n\t\t\t\t\t\t\t\t\t\t\t\tthis.update();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tchecked={node.format === 'linkOnly' ? true : false}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t\tlet image;\n\t\t\t\t\tnode.data.iconUrl ? (image = node.data.iconUrl) : (image = './assets/noImg.PNG');\n\t\t\t\t\tnodes.push(\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<div className=\"panel panel-default\" style={'display:none'}>\n\t\t\t\t\t\t\t\t<div className=\"panel-heading tab\">\n\t\t\t\t\t\t\t\t\t<h3 className=\"panel-title tab-title\">Action</h3>\n\t\t\t\t\t\t\t\t\t<div className=\"toggle-group\">\n\t\t\t\t\t\t\t\t\t\t<button className=\"btn btn-success tab-toggle\" id={`page${this.props.index}node${index}`} index={`${index}`} onClick={e => this.toggle(e, 'node')}>\n\t\t\t\t\t\t\t\t\t\t\t{document.getElementById(`page${this.props.index}nodepanel${index}`) ? (document.getElementById(`page${this.props.index}nodepanel${index}`).getAttribute('data-toggle') === 'hide' ? 'Edit' : 'Done') : 'Edit'}\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"panel-hide modal-wrap\" data-toggle=\"hide\" id={`page${this.props.index}nodepanel${index}`}>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName=\"backdrop\"\n\t\t\t\t\t\t\t\t\tid={`page${this.props.index}node${index}`}\n\t\t\t\t\t\t\t\t\tindex={`${index}`}\n\t\t\t\t\t\t\t\t\tpage={`${this.props.index}`}\n\t\t\t\t\t\t\t\t\tonClick={e => {\n\t\t\t\t\t\t\t\t\t\tthis.toggle(e, 'node');\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<div className=\"panel-body nodepanel\">\n\t\t\t\t\t\t\t\t\t{node.data.action === 'linkToApp' ? defaultImgDiag : null}\n\t\t\t\t\t\t\t\t\t{node.data.action === 'linkToWeb' ? linkOnly : null}\n\t\t\t\t\t\t\t\t\t{/* <div className=\"panel-hide\">\n\t\t\t\t\t\t\t\t\t\t{node.data.iconUrl\n\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t: setTimeout(() => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(`defaultImg${index}`).checked = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbuildfire.pluginInstance.get(node.data.instanceId, (err, inst) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (err) throw err;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnode.data.iconUrl = inst.iconUrl;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.update();\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t }, 100)}\n\t\t\t\t\t\t\t\t\t</div> */}\n\t\t\t\t\t\t\t\t\t{/* <div className=\"action\"> */}\n\t\t\t\t\t\t\t\t\t<h4 className=\"text-center\">Selected Image:</h4>\n\t\t\t\t\t\t\t\t\t{node.format === 'linkOnly' ? (\n\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"plugin-thumbnail\" title=\"Click to change Image. You can change the appearance of Action Items in the Design tab.\" style={`background: url(\"${image}\")`} alt=\"...\" onClick={e => this.addImg('action', this.props.data.nodes.indexOf(node), this.props.index)} />\n\t\t\t\t\t\t\t\t\t\t\t<h6 className=\"text-center\">Click to change</h6>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\t\t\t<h3 className=\"action-title\">Action Text: {node.data.title ? node.data.title : 'Untitled'}</h3>\n\t\t\t\t\t\t\t\t\t{/* </div> */}\n\t\t\t\t\t\t\t\t\t<hr />\n\t\t\t\t\t\t\t\t\t<div className=\"tab\">\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"btn btn-success\"\n\t\t\t\t\t\t\t\t\t\t\tid={`page${this.props.index}node${index}`}\n\t\t\t\t\t\t\t\t\t\t\tpage={`${this.props.index}`}\n\t\t\t\t\t\t\t\t\t\t\tindex={`${index}`}\n\t\t\t\t\t\t\t\t\t\t\tonClick={e => {\n\t\t\t\t\t\t\t\t\t\t\t\tlocalStorage.removeItem(`prevImg${node.instanceId}`);\n\t\t\t\t\t\t\t\t\t\t\t\tthis.toggle(e, 'node');\n\t\t\t\t\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"glyphicon glyphicon-ok\" style='pointer-events: none;' />\n\t\t\t\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t\t\t\tDone\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"btn btn-primary\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={e => {\n\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t\t\tbuildfire.actionItems.showDialog(node.data, {}, (err, res) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (err) throw err;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!res) return;\n\t\t\t\t\t\t\t\t\t\t\t\t\tnode.data = res;\n\t\t\t\t\t\t\t\t\t\t\t\t\tnode.title = `Action Item: ${res.title}`;\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.update();\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"glyphicon glyphicon-wrench\" />\n\t\t\t\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t\t\t\tEdit\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t<button className=\"btn btn-danger\" onClick={e => this.handleNodeChange(e, index, 'delete', false, this.props.index)}>\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"glyphicon glyphicon-alert\" />\n\t\t\t\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t\t\t\tRemove\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t\tlet applyIcons = () => {\n\t\t\t\n\t\t\t\n\t\t\tif (this.apply) return;\n\t\t\t// REPLACE DEFAULT SORTABLE LIST DELETE BUTTON\n\t\t\tthis.apply = setTimeout(() => {\n\t\t\t\tlet listItems = document.querySelector(`#nodelist${this.props.index}`).childNodes[0].childNodes[1].childNodes[2].childNodes;\n\t\t\t\tlistItems.forEach((item, index) => {\n\t\t\t\t\tlet btn = item.childNodes[1].childNodes[1].childNodes[0];\n\t\t\t\t\tlet tab = btn.parentNode;\n\t\t\t\t\tlet clone = btn.cloneNode();\n\n\t\t\t\t\tlet view = document.createElement('span');\n\t\t\t\t\tview.setAttribute('title', 'Scrolls this Element into view and highlights it.');\n\t\t\t\t\tlet label = document.createElement('span');\n\t\t\t\t\tlabel.innerHTML = 'Peek ';\n\t\t\t\t\tlet icon = document.createElement('span');\n\t\t\t\t\ticon.classList.add('glyphicon');\n\t\t\t\t\ticon.classList.add('glyphicon-eye-open');\n\n\t\t\t\t\tview.appendChild(label);\n\t\t\t\t\tview.appendChild(icon);\n\n\t\t\t\t\ttab.removeChild(btn);\n\t\t\t\t\ttab.appendChild(view);\n\t\t\t\t\ttab.appendChild(clone);\n\t\t\t\t\tclone.addEventListener('click', e => this.handleNodeChange(e, index, 'delete', false, this.props.index));\n\t\t\t\t\tview.addEventListener('click', e => {\n\t\t\t\t\t\tbuildfire.messaging.sendMessageToWidget({\n\t\t\t\t\t\t\tnodeIndex: index,\n\t\t\t\t\t\t\tpageIndex: this.props.index\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tthis.apply = false;\n\t\t\t}, 200);\n\t\t};\n\t\tapplyIcons();\n\t\treturn nodes;\n\t}", "function createPMTreeView(data){\n\tvar parser = new DOMParser();\n\tvar xmlDoc = parser.parseFromString( data , \"text/xml\" );\n\tvar device = xmlDoc.getElementsByTagName('DEVICE');\n\tvar outlet = xmlDoc.getElementsByTagName('OUTLET');\n\tvar str2 = \"<ul id='ulOutlet'>\";\n\tfor(x=0; x<device.length; x++){\n\t\tvar devName = device[x].getAttribute('HostName');\n\t\tvar ip = device[x].getAttribute('ManagementIp');\n\t\tvar devId = device[x].getAttribute('DeviceId');\n\t\tvar deviceOCP = device[x].getAttribute('availableocp');\n\t\tif (deviceOCP != undefined && deviceOCP.toLowerCase()!=\"none\" && deviceOCP != ''){\n\t\t\tvar label = devName;\n\t\t\tif(devName == \"\"){\n\t\t\t\tlabel = ip;\n\t\t\t}\n\t\t\tstr2 += \"<li><a id='powerstrip_\"+devId+\"' did='\"+ip+\"' name='\"+devId+\"' onclick=\\\"showPMTable(1);PMRibbon('','\"+label+\"');LoadPowerController('\"+ip+\"');\\\">\"+label+\"</a>\";\n\t\t\tstr2 += \"<ul>\";\n\t\t\tvar avin=device[x].getAttribute('availableinlet');\n\t\t\tif (avin !=null){\n\t\t\tstr2 += \"<li id='powerInlet'>Inlet<ul>\";\n\t\t\t\tvar availInlet = avin.split(\",\");\n\t\t\t\tfor (var a =0; a<availInlet.length; a++){\n\t\t\t\t\tvar inHdr = label+\" >> Inlet\";\n\t\t\t\t\tstr2 += \"<li id='powerinlet_\"+devId+\"_\"+availInlet[a]+\"' did='\"+ip+\"' onclick=\\\"showPMTable(2);PMRibbon('\"+inHdr+\"','\"+availInlet[a]+\"');LoadInlet('\"+ip+\"',this.id);\\\"><a>\"+availInlet[a]+\"</a></li>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tstr2+=\"</ul></li>\";\n\t\t\tvar availOCP =deviceOCP.split(\",\");\n\t\t\tfor (var i=0; i<availOCP.length; i++){\n\t\t\t\tvar ocp = availOCP[i];\n\t\t\t\t\tvar str4 = \"\";\n\t\t\t\t\tstr2+=\"<li><a id='\"+devId+\"' did='\"+ip+\"' onclick=\\\"PMRibbon('\"+label+\"','\"+ocp+\"');showPMTable(4);LoadOCP('\"+ip+\"','\"+ocp+\"');\\\">\"+ocp+\"</a>\";\n\t\t\t\t\tstr2+=\"<ul id='ulDevices\"+devId+\"'>\";\n\t\t\t\t\tstr4 = createOutletTreeViewOCP(outlet,ip,devId,ocp,devName,ip);\n\t\t\t\t\tstr2+=str4;\n\t\t\t\t\tstr2+=\"</ul></li>\";\n\t\t\t\t}\n\t\t\tstr2+=\"<li id='ocpLog\"+devId+\"' myname='\"+devName+\"' onclick=\\\"showPMTable(5);PMRibbon('\"+label+\"','Logs');LoadPDULogs('\"+ip+\"');\\\"><a>Logs</a></li>\";\n\t\t\tstr2+=\"</ul></li>\";\n\t\t}else{\n\n\t\t\tvar label = devName;\n\t\t\tif(devName == \"\"){\n\t\t\t\tlabel = ip;\n\t\t\t}\n\t\t\tstr2 += \"<li><a id='powerstrip_\"+devId+\"' did='\"+ip+\"' name='\"+devId+\"'onclick=\\\"showPMTable(1);PMRibbon('','\"+label+\"');LoadPowerController('\"+ip+\"')\\\">\"+label+\"</a>\";\n\t\t\tstr2 += \"<ul>\";\n\t\t\tvar avin=device[x].getAttribute('availableinlet');\n\t\t\tstr2 += \"<li id='powerInlet'>Inlet<ul>\";\n\t\t\tif (avin !=null){\n\t\t\t\tvar availInlet = avin.split(\",\");\n\t\t\t\tfor (var a =0; a<availInlet.length; a++){\n\t\t\t\t\tvar inHdr = label+\" >> Inlet\";\n\t\t\t\t\tstr2 += \"<li id='powerinlet_\"+devId+\"_\"+availInlet[a]+\"' did='\"+ip+\"' onclick=\\\"showPMTable(2);PMRibbon('\"+inHdr+\"','\"+availInlet[a]+\"');LoadInlet('\"+ip+\"',this.id)\\\"><a>\"+availInlet[a]+\"</a></li>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tstr2+=\"</ul></li>\";\n\t\t\tstr2 += \"<li><a id='powerStrip\"+devId+\"' did='\"+ip+\"' onclick=\\\"showPMTable(3);PMRibbon('\"+label+\"','Outlet');LoadOutlet('\"+ip+\"')\\\">Outlet</a><ul id='ulDevices\"+devId+\"'>\";\n\t\t\tvar str4 = \"\";\n\t\t\tstr4 = createOutletTreeView(outlet,ip,devId);\n\t\t\tif(str4 != \"\"){\n\t\t\t\tstr2+=str4;\n\t\t\t}\n\t\t\tstr2+=\"</ul></li>\";\n\n\t\t\tstr2+=\"<li id='ocpLog\"+devId+\"' myname='\"+devName+\"' did='\"+ip+\"' onclick=\\\"showPMTable(5);PMRibbon('\"+label+\"','Logs');LoadPDULogs('\"+ip+\"')\\\"><a>Logs</a></li>\";\n\t\t\tstr2+=\"</ul></li>\";\n\t\t}\n\t}\n\t$('#ulPDU').html(str2);\n\t$(\"#PMtree\").treeview({collapsed: true});\n}", "function display(obj,id) {\n\t\n\tvar val=\"https://people.rit.edu/~sarics/web_proxy.php?path=\"+obj;\n\t$.getJSON(val)\n .done(function (data) {\n \n\tif(id == 1) {\n\t\t\n\t\tvar newdiv1 = document.createElement(\"div\");\n\t\tvar newdiv2 = document.createElement(\"div\");\n\t\t\n\t\tvar newdiv3 = document.createElement(\"div\");\n\t\tvar newdiv4 = document.createElement(\"div\");\n\t\t\t\t\t\n\t\t$(newdiv1).append(document.createTextNode(data.title));\n\t\t\t\t\t\n\t\t$(newdiv1).attr(\"id\",\"title\");\n\t\t$(newdiv2).attr(\"id\",\"dscrp\");\n\t\t$(newdiv3).attr(\"id\",\"quote\");\n\t\t$(newdiv4).attr(\"id\",\"Author\");\n\t\t\t\t\t\n\t\t$(newdiv2).append(document.createTextNode(data.description));\n\t\t$(newdiv3).append(document.createTextNode(data.quote));\n\t\t$(newdiv4).append(document.createTextNode(data.quoteAuthor));\n\t\t\t\t\t\n\t\t$(\"#about\").append(newdiv1);\n\t\t$(\"#about\").append(newdiv2);\n\t\t$(\"#about\").append(newdiv3);\n\t\t$(\"#about\").append(newdiv4);\n\t\t}\n\t\t\n\t\telse if(id == 2) {\n\t\t$(\"#list1\").append(document.createTextNode(data.undergraduate[0].title));\n\t\t$(\"#list2\").append(document.createTextNode(data.undergraduate[1].title));\n\t\t$(\"#list3\").append(document.createTextNode(data.undergraduate[2].title));\n\t\t\t\t\t\n\t\t$(\"#descrp1\").append(document.createTextNode(data.undergraduate[0].description));\n\t\t$(\"#descrp2\").append(document.createTextNode(data.undergraduate[1].description));\n\t\t$(\"#descrp3\").append(document.createTextNode(data.undergraduate[2].description));\n\t\t\t\t\t\n\t\tfor(j=0;j<data.undergraduate.length;j++){\n\t\tfor(i=0;i<data.undergraduate[j].concentrations.length;i++) {\n\t\t\tvar li = document.createElement(\"li\");\n\t\t\t$(li).append(document.createTextNode(data.undergraduate[j].concentrations[i]));\n\t\t\tif(j == 0) {\n\t\t\t$(\"#conc1\").append(li);\n\t\t\t}\n\t\t\telse if(j == 1) {\n\t\t\t$(\"#conc2\").append(li);\n\t\t\t}\t\t\n\t\t\telse {\n\t\t\t$(\"#conc3\").append(li);\n\t\t\t}\n\t\t}\n\t\t}\n\t\t$(\"#gradlist1\").append(document.createTextNode(data.graduate[0].title));\n\t\t$(\"#gradlist2\").append(document.createTextNode(data.graduate[1].title));\n\t\t$(\"#gradlist3\").append(document.createTextNode(data.graduate[2].title));\n\t\t\t\t\n\t\t$(\"#graddescrp1\").append(document.createTextNode(data.graduate[0].description));\n\t\t$(\"#graddescrp2\").append(document.createTextNode(data.graduate[1].description));\n\t\t$(\"#graddescrp3\").append(document.createTextNode(data.graduate[2].description));\n\t\t\t\t\n\t\tfor(j=0;j<3;j++){\n\t\t\t\t\t\n\t\tfor(i=0;i<data.graduate[j].concentrations.length;i++) {\n\t\t\t\t\t\n\t\t\tvar li = document.createElement(\"li\");\n\t\t\t$(li).append(document.createTextNode(data.graduate[j].concentrations[i]));\n\t\t\t\t\t\n\t\t\tif(j == 0) {\n\t\t\t\t$(\"#gradconc1\").append(li);\n\t\t\t}\n\t\t\telse if(j == 1) {\n\t\t\t\t$(\"#gradconc2\").append(li);\n\t\t\t}\n\t\t\t\t\t\n\t\t\telse {\n\t\t\t\t$(\"#gradconc3\").append(li);\n\t\t\t}\n\t\t}\n\t\t}\n\t\t}\n\t\t\t\t\n })\n \n\t\t.fail(function () {\n alert('Some Problem Occured');\n });\n\t}", "function qll_module_hotchicks_sidebar()\r\n{\r\n\tif(!qll_GMSupport)\r\n\t{\treturn;\t}\r\n\t\r\n\tobject = document.createElement(\"div\");\r\n\tobject.setAttribute('class', 'QLLBoxModHotChicks');\r\n\tobject.setAttribute('id', 'QLLBoxModHotChicks');\r\n\tobject.innerHTML=\"<img class='QLLIMGLoading' src='\" + qll_loadingImg + \"'>\";\r\n\tadv=document.getElementById('eads');\r\n\tadv.parentNode.insertBefore(object,adv);\r\n\tGM_xmlhttpRequest(\r\n\t{\r\n\t\tmethod: 'GET',\r\n\t\turl: qll_serverURI + '/modules/hotchicks/request.php',\r\n\t\t\tonload:function(responseDetails)\r\n\t\t\t{\t\t\r\n\t\t\t\tvar responseText = responseDetails.responseText;\r\n\t\t\t\turi=responseText.substring(responseText.lastIndexOf(\"http\"));\r\n\t\t\t\tobj=document.getElementById('QLLBoxModHotChicks');\r\n\t\t\t\tobj.innerHTML = \"<img alt='\" + uri + \"' src='\" + uri + \"' border='0'>\";\r\n\t\t\t\t$(\"#QLLBoxModHotChicks\").click(function(){qll_fun_showDisplayBox(qll_lang[19], \"<a href='\" + uri + \"' target='_blank'><img alt='\" + uri + \"' src='\" + uri + \"' border='0'></a>\");});\r\n\t\t\t}\r\n\t});\t\t\r\n}", "displayTree(list) {\n\t\tlet tree = new PreorderedTree(list),\n\t\t\tview = new PreorderedView(tree, this._svgContainer);\n\n\t\tview.render();\n\t}", "function repoInfo(data) {\r\n const leftContainer = document.getElementById('leftContainer');\r\n leftContainer.innerHTML = '';\r\n\r\n const ul = createAndAppend('ul', leftContainer, {\r\n id: 'ulLeftContr'\r\n });\r\n\r\n fetchJSON(data)\r\n .then(data => {\r\n createAndAppend('li', ul, {\r\n html: 'Name : ' + \"<a href=\" + data.html_url + ' target=\"_blank\" >' + data.name + \"</a>\",\r\n });\r\n createAndAppend('li', ul, {\r\n html: 'Description : ' + data.description\r\n });\r\n createAndAppend('li', ul, {\r\n html: 'Forks : ' + data.forks\r\n });\r\n createAndAppend('li', ul, {\r\n html: 'Updated : ' + data.updated_at\r\n });\r\n })\r\n .catch(error => {\r\n console.log(error.message);\r\n });\r\n}", "function showLiChildren(myListId, instanceId){\n\tvar e = document.getElementById(myListId).getElementsByClassName(instanceId)[0].children;\n\tif(e[0].style.display == 'block') {\n\t\tfor (var child of e) {\n\t\t\tchild.style.display = 'none';\n\t\t\tvar f = child.children;\n\t\t\tfor (var g of f) { g.style.display = 'none'; }\n\t\t}\n\t}\n\telse{\n\t\tfor (var child of e) {\n\t\t\tchild.style.display = 'block';\n\t\t\tvar f = child.children;\n\t\t\t/*\n\t\t\tfor (var g of f){\n\t\t\t\tg.style.display = 'none'; \n\t\t\t}\n\t\t\t*/\n\t\t\t// non mostrare i figli <li> degli <ul> tranne il primo figlio di ogni <ul>, cioè il link a wikipedia\n\t\t\tfor (var g = 0; g < f.length; g++) {\n\t\t\t\tif (g === 0) {f[g].style.display = \"inline-block\";}\n\t\t\t\telse {f[g].style.display = 'none';}\n\t\t\t}\n\n\t\t}\n\t}\n}", "function showNavigator() {\n console.log('>> Wunderlist Navigator shortcut clicked');\n $(Config.LIST_SWITCHER).show();\n $(Config.LIST_INPUT).focus();\n var lists = [];\n $(Config.LIST_LINKS).each(function (index, element) {\n var list = {};\n var $this = $(this);\n list.href = $this.attr('href');\n list.title = $this.find('.title').text();\n lists.push(list);\n });\n allLists = lists;\n populateLists(lists);\n }", "function toggle_vm_control() {\n // Update selected count\n elements.vms_selected.html(_.size(server_list));\n\n if ($.isEmptyObject(server_list)) {\n vm_control_disable_all();\n //elements.tfoot.slideUp(400, vm_control_update_all);\n } else {\n vm_control_update_all();\n //elements.tfoot.slideDown(400);\n }\n }", "function showleftrightContent(jsondata,$state,$rootScope,$cookieStore,parentid,child_id,stateName,clickedID)\n{\n\n try{\n //for each for load left content\n angular.forEach(jsondata,function(values,keys){\n\n if (parseInt(values.parent_id,10) === parseInt(parentid,10)) {\n\n $(\"#dvleftcontent\").show();\n\t\t\t$(\"#dvleftcontent\").removeClass();\n\t\t\t$(\"#dvleftcontent\").addClass('slide');\n\n \n\n // $(\"#div\"+values.leftPositionID).removeClass('poly_active').addClass('polygon');\n\n $(\"#div\"+values.leftPositionID).removeClass('leftpoly_active').addClass('leftpolygon');\n\n if (parseInt(clickedID,10)=== parseInt(values.id,10)) {\n // $(\"#div\"+values.leftPositionID).removeClass('polygon').addClass('poly_active');\n $(\"#div\"+values.leftPositionID).removeClass('leftpolygon').addClass('leftpoly_active');\n //bind event to back button \n $(\"#dvgoback\").unbind(\"click\");\n $(\"#dvgoback\").on('click', function(){\n if ($rootScope.isAntivirusScanned) {\n $rootScope.isAntivirusScanned=false;\n window.external.resetAntivirus(); \n }\n if ($rootScope.isNetworkSpeed) {\n $rootScope.isNetworkSpeed=false;\n window.external.resetNetworkSpeed(); \n } \n $rootScope.homeClicked=true;\n if (parseInt(parentid,10)=== 0 && !$rootScope.isnewpage) {\n $state.go('home');\n }\n else if ($rootScope.isnewpage) {\n $rootScope.isnewpage=false;\n if (values.statename === 'messagecenter' || values.statename === 'knowledgebase') {\n $state.reload();\n }\n else{\n $state.go(values.statename);\n }\n }\n else{\n\n backButton(values.parent_id,values.id,$state,$rootScope,$cookieStore);\n }\n \n });\n }\n\n\n\n //used to load the current page when no session key available in remote support\n if (parseInt(parentid,10)=== 1 && stateName!=='remotesupport') {\n $rootScope.homeClicked=false;\n localStorage.setItem('clickedID',clickedID);\n localStorage.setItem('stateName',stateName);\n }\n\n //based the clicked menu we need to bind the click event dynamically\n if (stateName !== values.statename) {\n \n //bind the click event for dynamic left menu\n if((values.hasOwnProperty(\"active\") && values.active==='Y') || (!values.hasOwnProperty(\"active\"))) {\n $(\"#div\"+values.leftPositionID).show(); \n $(\"#spnimg\"+values.leftPositionID).removeClass().addClass(values.classname);\n $(\"#spn\"+values.leftPositionID).text(values.name);\n $(\"#div\"+values.leftPositionID).on('click', function(){\n if ($rootScope.userDetails.IsNetwork === 'False' && (parseInt(values.id,10) === 1 || parseInt(values.id,10) === 2 || parseInt(values.id,10) === 4 || parseInt(values.id,10) === 314 || parseInt(values.id,10) === 315 || parseInt(values.id,10) === 333)){\n $rootScope.offlineerrorUpgrade();\n }\n \n else{\n //\n if ((parseInt($rootScope.userDetails.ContractAvailability,10) ===0) && ((parseInt(values.id,10) === 1 || parseInt(values.id,10) === 3))) {\n $rootScope.inActiveUserErrorMessage(); \n }\n else\n {\n $rootScope.leftclicked=true;\n loadPageContent(jsondata,$state,$rootScope,$cookieStore,values.parent_id,values.id,values.statename,values.id);\n }\n \n }\n\n });\n\n $(\"#spn\"+values.leftPositionID).on('click', function(){\n // $rootScope.leftclicked=true;\n // loadPageContent(jsondata,$state,$rootScope,$cookieStore,values.parent_id,values.id,values.statename,values.id);\n if ($rootScope.userDetails.IsNetwork === 'False' && (parseInt(values.id,10) === 1 || parseInt(values.id,10) === 2 || parseInt(values.id,10) === 4 || parseInt(values.id,10) === 314 || parseInt(values.id,10) === 315 || parseInt(values.id,10) === 333)){\n $rootScope.offlineerrorUpgrade();\n }\n else{\n if ((parseInt($rootScope.userDetails.ContractAvailability,10) ===0) && ((parseInt(values.id,10) === 1 || parseInt(values.id,10) === 3))) {\n $rootScope.inActiveUserErrorMessage(); \n }\n else\n {\n $rootScope.leftclicked=true;\n loadPageContent(jsondata,$state,$rootScope,$cookieStore,values.parent_id,values.id,values.statename,values.id);\n }\n \n }\n });\n }\n }\n else\n {\n $(\"#div\"+values.leftPositionID).show(); \n $(\"#spnimg\"+values.leftPositionID).removeClass().addClass(values.classname);\n $(\"#spn\"+values.leftPositionID).text(values.name);\n //unbind the click event of the selected menu\n $(\"#div\"+values.leftPositionID).unbind(\"click\");\n $(\"#spn\"+values.leftPositionID).unbind(\"click\");\n }\n\n //check and load right content of the selected menu\n if (parseInt(clickedID,10)=== parseInt(values.id,10)) {\n //for each for load right content\n angular.forEach(jsondata[keys].submenu,function(values,index){\n\n $(\"#rightCont\").hide();\n \n \n //add mouseenter and mouseleave event when hover on system tools menu\n if (parseInt(clickedID,10) === 3) {\n showsystemToolsDescription(values.statename,values.rightPositionID);\n }\n\n if (values.statename === \"remotesupport\") {\n $(\"#divright\"+values.rightPositionID).show();\n $(\"#spnright\"+values.rightPositionID).text(values.name);\n $(\"#spnrgtimg\"+values.rightPositionID).removeClass().addClass(values.classname);\n $(\"#divright\"+values.rightPositionID).on('click', function(){\n $rootScope.leftclicked=false;\n $state.go(values.statename);\n });\n }\n else\n {\n //bind the click event for dynamic right menu\n if((values.hasOwnProperty(\"active\") && values.active==='Y') || (!values.hasOwnProperty(\"active\"))) {\n $(\"#divright\"+values.rightPositionID).show();\n $(\"#spnright\"+values.rightPositionID).text(values.name);\n $(\"#spnrgtimg\"+values.rightPositionID).removeClass().addClass(values.classname);\n $(\"#divright\"+values.rightPositionID).on('click', function(){\n if ($rootScope.userDetails.IsNetwork === 'False' && (parseInt(values.id,10) === 1 || parseInt(values.id,10) === 2 || parseInt(values.id,10) === 4 || parseInt(values.id,10) === 314 || parseInt(values.id,10) === 315 || parseInt(values.id,10) === 333)){\n $rootScope.offlineerrorUpgrade();\n }\n \n else{\n $rootScope.leftclicked=false; \n $rootScope.kbFlag = null;\n // if (parseInt(clickedID,10) !== 3) {\n loadPageContent(jsondata[keys].submenu,$state,$rootScope,$cookieStore,values.parent_id,values.id,values.statename,values.id);\n }\n // }\n\n });\n $(\"#spnright\"+values.rightPositionID).on('click', function(){\n if ($rootScope.userDetails.IsNetwork === 'False' && (parseInt(values.id,10) === 1 || parseInt(values.id,10) === 2 || parseInt(values.id,10) === 4 || parseInt(values.id,10) === 314 || parseInt(values.id,10) === 315 || parseInt(values.id,10) === 333)){\n $rootScope.offlineerrorUpgrade();\n }\n \n else{\n $rootScope.leftclicked=false;\n $rootScope.kbFlag = null;\n // loadPageContent(jsondata[keys].submenu,$state,$rootScope,$cookieStore,values.parent_id,values.id,values.statename,values.id);\n // if (parseInt(clickedID,10) !== 3) {\n loadPageContent(jsondata[keys].submenu,$state,$rootScope,$cookieStore,values.parent_id,values.id,values.statename,values.id);\n // }\n }\n\n });\n }\n }\n\n }); //right foreach end\n\n\t\t\t\t$(\"#dvrightcontent\").show();\n\t\t\t\t$(\"#dvrightcontent\").addClass('slide');\n\n } //right if end\n \n \n } //if end\n }); //foreach end\n} catch (e) {\n // stackTrace(e);\n stackTrace('CommonUtil','showleftrightContent ',e,offlineGlobalData.Client);\n }\n\n}", "function showContent(obj) {\n const content = `\n <section class=\"content-card\">\n <h2 class=\"card-title\" id=\"card-title\">${obj.name}</h2>\n <div class=\"card-info\">\n <img src=\"${obj.img}\" alt=\"img\" class=\"card-img\" id=\"card-img\">\n <p class=\"card-text\" id=\"card-text\">${obj.text}</p>\n </div>\n </section>\n `;\n mainContent.innerHTML = content;\n }", "function loadModuleStartnavThree(objectname) {\n\tvar object = window[objectname];\n\tvar objectFirst = objectname.substr(0, 1);\n\tvar objectnameCaps = objectFirst.toUpperCase() + objectname.substr(1);\n\tvar num_modules = window[objectname+'_num_modules'];\n\t\n\tvar h = object.$layoutWest.height();\n\t$('#'+objectname+' div.radius-helper').height(h);\n\t$('#'+objectname+' .secondLevelOuter').css('top',h-27);\n\t$('#'+objectname+' .thirdLevelOuter').css('top',150);\n\tobject.$first.data('status','open');\n\tobject.$second.data('status','closed');\n\tobject.$third.data('status','closed');\n\tobject.$first.height(h-98);\n\t$('#'+objectname+'1 .module-inner').height(h-98);\n\t$('#'+objectname+'1 .module-actions').show();\n\t$('#'+objectname+'2 .module-actions').hide();\n\t$('#'+objectname+'2 li').show();\n\tobject.$second.height(h-125-num_modules*27).removeClass(\"module-active\");\n\t$('#'+objectname+'2 .module-inner').height(h-125-num_modules*27);\n\t$('#'+objectname+'3 .module-actions').hide();\n\tobject.$third.height(h-150);\n\t$('#'+objectname+'3 .'+objectname+'3-content').height(h-(object.modules_height+152));\n\tobject.$thirdDiv.height(h-(object.modules_height+150-27));\n\t$('#'+objectname+'-current').val(\"folder\");\n\tobject.$thirdDiv.each(function(i) { \n\t\tvar position = $(this).position();\n\t\tvar t = position.top+h-150;\n\t\t$(this).animate({top: t})\n\t})\n\t$.ajax({ type: \"GET\", url: \"/\", dataType: 'json', data: \"path=apps/\"+objectname+\"&request=getFolderList\", success: function(data){\n\t\t$('#'+objectname+'1 ul').html(data.html);\n\t\t$('#'+objectname+'Actions .actionNew').attr(\"title\",data.title);\n\t\tif(data.access == \"guest\") {\n\t\t\twindow[objectname+'Actions']();\n\t\t} else {\n\t\t\tif(data.html == \"<li></li>\") {\n\t\t\t\twindow[objectname+'Actions'](3);\n\t\t\t} else {\n\t\t\t\twindow[objectname+'Actions'](9);\n\t\t\t}\n\t\t}\n\t\t$('#'+objectname+'1 li').show();\n\t\t$('#'+objectname+'1 .sort').attr(\"rel\", data.sort).addClass(\"sort\"+data.sort);\n\t\tvar id = $('#'+objectname+'1 .module-click:eq(0)').attr(\"rel\");\n\t\tif(id === undefined) {\n\t\t\tid = 0;\n\t\t}\n\t\tobject.$app.data({ \"current\" : \"folders\" , \"first\" : id , \"second\" : 0 , \"third\" : 0});\n\t\t$('#'+objectname+'1 .module-click:eq(0)').addClass('active-link');\n\t\t$.ajax({ type: \"GET\", url: \"/\", dataType: 'json', data: \"path=apps/\"+objectname+\"&request=getFolderDetails&id=\"+id, success: function(text){\n\t\t\tobject.$appContent.html(text.html);\n\t\t\t\twindow['init'+objectnameCaps+'ContentScrollbar']();\n\t\t\t}\n\t\t});\n\t}\n\t});\n}", "function showTiles() {\n\tvar tiles = getTiles();\n\tvar formHTML = \"<ul>\";\n\tfor (var i = 0; i < tiles.length; i++)\n\t{\n\t\tformHTML = formHTML + '<li>' + tiles[i].title + '</li>';\n\t}\n\tformHTML = formHTML + \"</ul>\";\n\t$( \"div#tilesList\" ).html(formHTML);\n}", "function leftPageMenu() {\n \"use strict\";\n jQuery(\"#secondary .widget_pages ul\").addClass('page-list');\n jQuery(\"#secondary .widget_pages ul.page-list\").treeview({\n animated: \"slow\",\n collapsed: true,\n unique: true\n });\n}", "function nmsDevices(data,item){\r\n\tvar html=\"\";\r\n\tvar l=data.length;\r\n\thtml+=\"<ul>\";\r\n\tif (l > 0)\r\n\t{\r\n\t\tfor(var i=0;i<l;i++){\r\n\t\t\tvar dddd = data[i];\r\n\t\t\thtml+=\"<li id=\"+dddd.name+\"><a href=# style=\\\"text-decoration: none\\\" onClick=\\\"nmsHostDetails('\"+dddd.name+\"')\\\">\"+dddd.name+\"</a></li>\";\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\thtml+=\"<li> No NMS exists.</li>\";\r\n\t}\r\n\thtml+=\"</ul>\";\r\n\t$('div#'+item).html(html);\r\n\r\n}", "function displayList(items, displayModeOn) {\r\n leftCount = Math.round(items.length / 2);\r\n\r\n if (displayModeOn) {\r\n document.getElementById(\"left-column\").innerHTML = \"\";\r\n document.getElementById(\"right-column\").innerHTML = \"\";\r\n for (i = 0; i < items.length; i++) {\r\n displayItem((i % 2 == 0), items[i]);\r\n }\r\n } else {\r\n document.getElementById(\"left-column-edit\").innerHTML = \"\";\r\n document.getElementById(\"right-column-edit\").innerHTML = \"\";\r\n for (i = 0; i < items.length; i++) {\r\n displayItemEdit(i, items[i]);\r\n }\r\n }\r\n\r\n}", "function renderNodes(dataInstance){\n currentDisplay.innerHTML +=\n `<i class=\"fab fa-first-order-alt selector\" data-id = ${dataInstance.id} style=\"position:\n fixed;top:${dataInstance.position_top}%;left:${dataInstance.position_left}%;\n font-size: 1.5em; \"></i>`\n}", "function GetFlightULDSTACKDetails() {\n ShowIndexView(\"divStackDetail\", \"Services/FlightControl/FlightControlService.svc/GetFlightTransGridData/FLIGHTCONTROL/FlightControl/ULDSTACK/\" + CurrentFlightSno + \"/STACK\");\n}", "function displayOkitJson() {\n // $(jqId(JSON_MODEL_PANEL)).html('<pre><code>' + JSON.stringify(okitJsonModel, null, 2) + '</code></pre>');\n // $(jqId(JSON_VIEW_PANEL)).html('<pre><code>' + JSON.stringify(okitJsonView, null, 2) + '</code></pre>');\n // $(jqId(JSON_REGION_PANEL)).html('<pre><code>' + JSON.stringify(regionOkitJson, null, 2) + '</code></pre>');\n}", "function showActions(elem){\n \n if(elem instanceof HTMLLIElement){\n console.dir(elem);\n if(actionBox == null){\n actionBox = document.getElementById(\"itemActions\")\n }\n actionBox.style.display = 'block';\n currentLi = elem;\n currentLi.appendChild(actionBox)\n var ul = elem.querySelector('ul');\n if(ul){\n \n }\n }\n }", "function openNav() {\n $('#nav-list li').removeClass('treelisthidden');\n storage.setItem(treesettings, '1');\n $('#sideNavigation').css('display', 'block');\n\n $('#sideNavigation').css('width', '300px');\n $('body.support_kb').find('.cover').css('display', 'none');\n $('body.support_kb').find('#sidefoot').css({\n 'width': '300px',\n 'margin-left': ''\n });\n $('#sidefoot').css('display', 'block');\n $('.footer-inner').css('padding-left', '300px');\n $('body').find('main').css('width', 'calc(100% - 100px)');\n $('body.support_kb').find('#sideNavigation').css('margin-left', '0');\n $('body').find('main').css('width', 'calc(100% - 350px)');\n\n (function() {\n try {\n $('#sideNavigation').resizable(\"enable\");\n } catch (err) {\n setTimeout(arguments.callee, 200)\n }\n })();\n\n $('#side-toggle').attr('class', 'fa fa-angle-double-left');\n\n }", "function cuselShowList(cuselWrap) {\n var cuselMain = cuselWrap.parent(\".cusel\"),\n cb = cuselGetBox();\n\n // remove from all selects \n $(\".cuselOpen\").removeClass(\"cuselOpen\");\n \n /* если выпадающее меню скрыто - показываем */\n if(cb.is(\":hidden\")) {\n cb.empty();\n cuselWrap.clone(true)\n .appendTo(cb)\n .show();\n \n cb.show()\n // store node on data for future usage\n .data(\"cusel-select\", cuselMain[0]);\n \n if ($.ui) {\n // using more intelligent position method from $.ui here\n cb.position({\n my: \"left top\",\n at: \"left bottom\",\n of: cuselMain,\n });\n } else {\n var pos = cuselMain.offset();\n cb.offset({\n left: pos.left,\n top: pos.top + cuselMain.outerHeight()\n });\n }\n cb.css(\"min-width\", cuselMain.outerWidth() + \"px\");\n\n cuselMain.addClass(\"cuselOpen\");\n \n var cuselArrows = cuselMain.hasClass(\"cuselScrollArrows\");\n cb.find(\".cusel-scroll-pane\")\n .jScrollPaneCusel({showArrows: cuselArrows});\n \n /* прокручиваем к текущему оптиону */\n cuselScrollToCurent(cb.find(\".cusel-scroll-wrap\"));\n } else {\n // otherwise hide menu\n cb.hide()\n .removeData(\"cusel-select\");\n }\n }", "function getSidebarItemNodes(mode) {\n\t\tlogTrace('invoking getSidebarItemNodes($)', mode);\n\n\t\tif (typeof mode !== 'string') {\n\n\t\t\tthrow new Error('Argument \"mode\" is required. Expected a string.');\n\t\t}\n\n\t\tconst modes = {\n\t\t\t'visible': { prefix: '', suffix: ':not([data-uttv-hidden])' },\n\t\t\t'hidden': { prefix: '', suffix: '[data-uttv-hidden]' },\n\t\t\t'unprocessed': { prefix: '', suffix: ':not([data-uttv-processed])' },\n\t\t\t'processed': { prefix: '', suffix: '[data-uttv-processed]' },\n\t\t\t'recommended': { prefix: '', suffix: ':not([data-uttv-hidden])' }\n\t\t};\n\n\t\tlet selector;\n\t\tlet subSelector = { prefix: '', suffix: '' };\n\n\t\tif (modes[mode]) {\n\n\t\t\tsubSelector = modes[mode];\n\n\t\t} else {\n\n\t\t\tthrow new Error('Value of argument \"mode\", which is \"' + mode + '\", is unknown.');\n\t\t}\n\n\t\t// \"!\" will be replaced with prefix, \"%\" will be replaced with suffix\n\t\tselector = [\n\n\t\t\t'!a[data-a-id^=\"followed-channel-\"]%',\n\t\t\t'!a[data-a-id^=\"recommended-channel-\"]%',\n\t\t\t'!a[data-a-id^=\"popular-channel-\"]%',\n\t\t\t'!a[data-a-id^=\"similarity-channel-\"]%',\n\t\t\t'!a.side-nav-card%'\n\n\t\t].join(', ');\n\n\t\t// replace selector wildcards\n\t\tif (typeof selector === 'string') {\n\n\t\t\tselector = selector.replace(/!/g, subSelector.prefix);\n\t\t\tselector = selector.replace(/%/g, subSelector.suffix);\n\t\t}\n\n\t\tlet nodes = [];\n\n\t\tconst sidebarSelector = '[data-a-target^=\"side-nav-bar\"]';\n\t\tconst sidebarNode = rootNode.querySelector(sidebarSelector);\n\n\t\tif (sidebarNode !== null) {\n\n\t\t\t// if there are two or more sections in the sidebar, the second section is for recommended channels\n\t\t\tif (mode === 'recommended') {\n\n\t\t\t\tconst sidebarSectionsSelector = '.side-nav-section';\n\t\t\t\tconst sidebarSectionsNodes = sidebarNode.querySelectorAll(sidebarSectionsSelector);\n\n\t\t\t\tlogVerbose('Looking for recommended channels section in sidebar.', sidebarSectionsSelector);\n\n\t\t\t\tlet sidebarLabel = null;\n\t\t\t\tif (sidebarSectionsNodes.length === 1) {\n\n\t\t\t\t\tsidebarLabel = sidebarSectionsNodes[0].getAttribute('aria-label');\n\n\t\t\t\t} else if (sidebarSectionsNodes.length >= 2) {\n\n\t\t\t\t\tsidebarLabel = sidebarSectionsNodes[1].getAttribute('aria-label');\n\n\t\t\t\t} else {\n\n\t\t\t\t\tlogVerbose('Unable to determine recommended channels section.');\n\t\t\t\t}\n\n\t\t\t\tif (sidebarLabel !== null) {\n\n\t\t\t\t\tlogVerbose('Determined recommended channels section to be:', sidebarLabel, sidebarSectionsNodes);\n\n\t\t\t\t\t// prefix selector with more specific section\n\t\t\t\t\tselector = ('.side-nav-section[aria-label=\"' + sidebarLabel + '\"] ' + selector);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnodes = sidebarNode.querySelectorAll(selector);\n\t\t\tconst nodesLength = nodes.length;\n\n\t\t\tif (nodesLength > 0) {\n\n\t\t\t\tlogTrace('Found ' + nodesLength + ' nodes in sidebar.', nodes);\n\n\t\t\t} else {\n\n\t\t\t\tlogTrace('Unable to find nodes in sidebar. Expected:', selector);\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tlogWarn('Unable to find sidebar on the current page. Expected:', sidebarSelector);\n\t\t}\n\n\t\treturn nodes;\n\t}", "function initServerviewSidebar(id) {\n document.getElementsByClassName('main-title')[0].innerHTML = ``;\n document.getElementsByClassName('title')[0].innerHTML = `Server ${id}`;\n document.getElementsByClassName('info')[0].remove();\n document.getElementsByClassName('preview')[0].remove();\n\n var info = document.createElement('div');\n info.className = 'info';\n info.style.overflowY = 'scroll';\n info.style.height = '85vh';\n info.style.marginBottom = '2vh';\n\n document.getElementsByClassName('sidebar')[0].appendChild(info);\n\n servers.transition() \n .duration(1000)\n .style('opacity', 0)\n .remove()\n .call(endAll, initPlayerList, id);\n}", "function populateNetworkNodes() {\n\tvar nodes = null;\n\t$\n\t\t\t.ajax({\n\t\t\t\turl : sdnControllerURL\n\t\t\t\t\t\t// + \"/controller/nb/v2/switchmanager/default/nodes\",\n\t\t\t\t\t\t+ \"/restconf/operational/opendaylight-inventory:nodes\",\n\t\t\t\ttype : \"GET\",\n\t\t\t\tasync : false,\n\t\t\t\tcontentType : \"application/json\",\n\t\t\t\tsuccess : function(data, textStatus, jqXHR) {\n\t\t\t\t\t// console.log(data);\n\t\t\t\t\tnodes = data.nodes;\n\t\t\t\t},\n\t\t\t\terror : function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\talert(\"Unable to fetch OpenDaylight Nodes.\\nDid you supply the credentials correct?\");\n\t\t\t\t},\n\t\t\t\tbeforeSend : function(xhr) {\n\t\t\t\t\t// Default Base64 Encoding for (admin/admin)\n\t\t\t\t\txhr\n\t\t\t\t\t\t\t.setRequestHeader(\"Authorization\",\n\t\t\t\t\t\t\t\t\tbase64EncodedPassword);\n\t\t\t\t}\n\t\t\t});\n\n\tif (nodes != null && nodes != undefined) {\n\t\t// Construct divs\n\t\t// $.each(nodes.nodeProperties, function(index, value) {\n\t\t// \tvar div = getNetworkDeviceDiv(value.properties.description.value,\n\t\t// \t\t\tvalue.node.id, value.properties.macAddress.value,\n\t\t// \t\t\tvalue.properties.timeStamp.value);\n\t\t// \t$(\"#nodesDiv\").append(div);\n\t\t// });\n\t\t/*Table style*/\n\t\tdiv = '<div><table class=\"table table-hover\">'\n\t\t\t+ '<thead><tr>'\n\t\t\t+ '<th>No.</th>'\n\t\t\t+ '<th>Node Id</th>'\n\t\t\t+ '<th>IP address</th>'\n\t\t\t+ '<th>Type</th>'\n\t\t\t+ '<th>SW version</th>'\n\t\t\t+ '<th>N_connectors</th>'\n\t\t\t+ '<th>Stats</th>'\n\t\t\t+ '</tr></thead><tbody>';\n\n\t\tvar prefix = \"flow-node-inventory:\"\n\t\t$.each(nodes.node, function(index, node) {\n\t\t\t// console.log(node);\n\t\t\tdiv += getNetworkDeviceDiv(\n\t\t\t\tindex + 1,\n\t\t\t\tnode.id,\n\t\t\t\tnode[prefix+'ip-address'],\n\t\t\t\tnode[prefix+'hardware'],\n\t\t\t\tnode[prefix+'software'],\n\t\t\t\tnode['node-connector'].length\n\t\t\t\t);\n\t\t\t/*Thumbnail style*/\n\t\t\t// $(\"#nodesDiv\").append(div);\n\t\t});\n\t\tdiv += '</tbody></table></div>';\n\t\t/*Table style*/\n\t\t$(\"#nodesDiv\").append(div);\n\n\t\t$(\"#nodesDiv\").removeClass(\"hidden\").addClass(\"visible\");\n\t\t$(\"#nodesButton\").removeClass(\"visible\").addClass(\"hidden\");\n\n\t}\n\n}", "function createSmallNetworkTabHTML(){\n\t\t// This function may not be useful following one of the github ui refreshes since it was first implemented; Leaving it here for now.\n\t\t// Exclude analytical \"data-ga-click\" and \"data-selected-links\" attributes\n\t\treturn\t'<a class=\"js-selected-navigation-item reponav-item\" href=\"/' + here + '/network\">\\n' +\n\t\t\t\t'\tNetwork\\n' +\n\t\t\t\t'</a>';\n\t}", "function toggleTree() {\n // Do the actual toggling by modifying the class on the body element. That way we can get some nice CSS transitions going.\n if (sidebarVisible) {\n document.body.className = document.body.className.replace(/\\s*sidebar/g, '');\n sidebarVisible = false;\n } else {\n document.body.className += ' sidebar';\n sidebarVisible = true;\n }\n if (window.localStorage) {\n if (sidebarVisible) {\n window.localStorage.docker_showSidebar = 'yes';\n } else {\n window.localStorage.docker_showSidebar = 'no';\n }\n }\n}", "function createPMTreeViewJSON(data){\n//\tvar parser = new DOMParser();\n//\tvar xmlDoc = parser.parseFromString( data , \"text/xml\" );\n//\tvar device = data.MAINCONFIG[0].DEVICE;\n\tvar str2 = \"<ul id='ulOutlet'>\";\n\tif (data.MAINCONFIG[0].DEVICE){\n\t\tdevice = data.MAINCONFIG[0].DEVICE;\n\t\tfor(x=0; x<device.length; x++){\n\t\t\tvar outlet = device[x].OUTLET; \n\t\t\tvar devName = device[x].HostName;\n\t\t\tvar ip = device[x].ManagementIp;\n\t\t\tvar devId = device[x].DeviceId;\n\t\t\tvar deviceOCP = device[x].availableocp;\n\t\t\tif (deviceOCP != undefined && deviceOCP.toLowerCase()!=\"none\" && deviceOCP != ''){\n\t\t\t\tvar label = devName;\n\t\t\t\tif(devName == \"\"){\n\t\t\t\t\tlabel = ip;\n\t\t\t\t}\n\t\t\t\tstr2 += \"<li><a id='powerstrip_\"+devId+\"' did='\"+ip+\"' name='\"+devId+\"' onclick=\\\"showPMTable(1);PMRibbon('','\"+label+\"');LoadPowerController('\"+ip+\"');\\\">\"+label+\"</a>\";\n\t\t\t\tstr2 += \"<ul>\";\n\t\t\t\tvar avin=device[x].availableinlet;\n\t\t\t\tif (avin !=null){\n\t\t\t\tstr2 += \"<li id='powerInlet'>Inlet<ul>\";\n\t\t\t\t\tvar availInlet = avin.split(\",\");\n\t\t\t\t\tfor (var a =0; a<availInlet.length; a++){\n\t\t\t\t\t\tvar inHdr = label+\" >> Inlet\";\n\t\t\t\t\t\tstr2 += \"<li id='powerinlet_\"+devId+\"_\"+availInlet[a]+\"' did='\"+ip+\"' onclick=\\\"showPMTable(2);PMRibbon('\"+inHdr+\"','\"+availInlet[a]+\"');LoadInlet('\"+ip+\"',this.id);\\\"><a>\"+availInlet[a]+\"</a></li>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstr2+=\"</ul></li>\";\n\t\t\t\tvar availOCP =deviceOCP.split(\",\");\n\t\t\t\tfor (var i=0; i<availOCP.length; i++){\n\t\t\t\t\tvar ocp = availOCP[i];\n\t\t\t\t\t\tvar str4 = \"\";\n\t\t\t\t\t\tstr2+=\"<li><a id='\"+devId+\"' did='\"+ip+\"' onclick=\\\"PMRibbon('\"+label+\"','\"+ocp+\"');showPMTable(4);LoadOCP('\"+devId+\"','\"+ip+\"','\"+ocp+\"');\\\">\"+ocp+\"</a>\";\n\t\t\t\t\t\tstr2+=\"<ul id='ulDevices\"+devId+\"'>\";\n\t\t\t\t\t\tstr4 = createOutletTreeViewOCPJSON(outlet,ip,devId,ocp,devName,ip);\n\t\t\t\t\t\tstr2+=str4;\n\t\t\t\t\t\tstr2+=\"</ul></li>\";\n\t\t\t\t\t}\n\t\t\t\tstr2+=\"<li id='ocpLog\"+devId+\"' myname='\"+devName+\"' onclick=\\\"showPMTable(5);PMRibbon('\"+label+\"','Logs');LoadPDULogs('\"+ip+\"');\\\"><a>Logs</a></li>\";\n\t\t\t\tstr2+=\"</ul></li>\";\n\t\t\t}else{\n\t\n\t\t\t\tvar label = devName;\n\t\t\t\tif(devName == \"\"){\n\t\t\t\t\tlabel = ip;\n\t\t\t\t}\n\t\t\t\tstr2 += \"<li><a id='powerstrip_\"+devId+\"' did='\"+ip+\"' name='\"+devId+\"'onclick=\\\"showPMTable(1);PMRibbon('','\"+label+\"');LoadPowerController('\"+ip+\"')\\\">\"+label+\"</a>\";\n\t\t\t\tstr2 += \"<ul>\";\n\t\t\t\tvar avin=device[x].availableinlet;\n\t\t\t\tstr2 += \"<li id='powerInlet'>Inlet<ul>\";\n\t\t\t\tif (avin !=null){\n\t\t\t\t\tvar availInlet = avin.split(\",\");\n\t\t\t\t\tfor (var a =0; a<availInlet.length; a++){\n\t\t\t\t\t\tvar inHdr = label+\" >> Inlet\";\n\t\t\t\t\t\tstr2 += \"<li id='powerinlet_\"+devId+\"_\"+availInlet[a]+\"' did='\"+ip+\"' onclick=\\\"showPMTable(2);PMRibbon('\"+inHdr+\"','\"+availInlet[a]+\"');LoadInlet('\"+ip+\"',this.id)\\\"><a>\"+availInlet[a]+\"</a></li>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstr2+=\"</ul></li>\";\n\t\t\t\tstr2 += \"<li><a id='powerStrip\"+devId+\"' did='\"+ip+\"' onclick=\\\"showPMTable(3);PMRibbon('\"+label+\"','Outlet');LoadOutlet('\"+ip+\"')\\\">Outlet</a><ul id='ulDevices\"+devId+\"'>\";\n\t\t\t\tvar str4 = \"\";\n\t\t\t\tstr4 = createOutletTreeViewJSON(outlet,ip,devId);\n\t\t\t\tif(str4 != \"\"){\n\t\t\t\t\tstr2+=str4;\n\t\t\t\t}\n\t\t\t\tstr2+=\"</ul></li>\";\n\t\n\t\t\t\tstr2+=\"<li id='ocpLog\"+devId+\"' myname='\"+devName+\"' did='\"+ip+\"' onclick=\\\"showPMTable(5);PMRibbon('\"+label+\"','Logs');LoadPDULogs('\"+ip+\"')\\\"><a>Logs</a></li>\";\n\t\t\t\tstr2+=\"</ul></li>\";\n\t\t\t}\n\t\t}\n\t\t$('#ulPDU').html(str2);\n\t\t$(\"#PMtree\").treeview({collapsed: true});\n\t}\n}", "function createMainView() {\n $mainpageContent = $('<div class=\"vis-gl-main-wrap\">');\n\n // get User Element Column ID\n var paramStr = VIS.context.getWindowContext($self.windowNo, \"AD_Column_ID\", true);\n if (paramStr == \"\") {\n VIS.ADialog.error(\"VIS_DimensionColNotSelected\", true, \"\", \"\");\n return false;\n }\n\n // get User Element Column Name\n var columnName = VIS.dataContext.getJSONRecord(\"GlJournall/ColumnName\", paramStr);\n\n // Row 1\n $formWrap = $('<div class=\"vis-gl-form-wrap\">');\n $formDataRow = $('<div class=\"vis-gl-form-row\">');\n\n $formData = $('<div class=\"vis-gl-form-col\">');\n $lblUserElement = $('<label>' + VIS.Msg.translate(ctx, columnName) + '</label>');\n $formData.append($lblUserElement);\n\n $formDataR = $('<div class=\"vis-gl-form-col2\">');\n var valueInfo = VIS.MLookupFactory.getMLookUp(ctx, $self.windowNo, VIS.Utility.Util.getValueOfString(paramStr), VIS.DisplayType.Search);\n $infoUserElement = new VIS.Controls.VTextBoxButton(columnName, false, false, true, VIS.DisplayType.Search, valueInfo);\n $formDataR.append($('<div>').append($infoUserElement).append($infoUserElement.getControl()).append($infoUserElement.getBtn(0)));\n\n $formDataRow.append($formData).append($formDataR);\n $formWrap.append($formDataRow);\n\n //Action \n $actionPanel = $('<div class=\"VIS_buttons-wrap .vis-gl-buttons-wrap\">');\n\n $buttons = $('<div class=\"pull-right\">');\n $btnOk = $('<span class=\"btn vis-gl-buttons-wrap-span\">' + VIS.Msg.translate(ctx, \"VIS_OK\") + '</span>');\n $btnCancel = $('<span class=\"btn vis-gl-buttons-wrap-span\">' + VIS.Msg.translate(ctx, \"Cancel\") + '</span>');\n $buttons.append($btnOk).append($btnCancel);\n $actionPanel.append($buttons);\n $mainpageContent.append($formWrap).append($actionPanel);\n $root.append($mainpageContent).append($bsyDiv);\n }", "function showElements( id ) {\n showElement( id );\n showElement( id + '-toc' );\n}", "function visLande() {\n console.log(\"Funktion visLande\");\n // container til lande og info fra json:\n const dest = document.querySelector(\"#liste\");\n const skabelon = document.querySelector(\"template\").content;\n // Fjern al eksisterende tekst:\n dest.textContent = \"\";\n // loop igennem lande/json:\n lande.forEach(land => {\n if (filter == land.kontinent || filter == \"alle\") {\n const klon = skabelon.cloneNode(true);\n klon.querySelector(\".h2_land\").textContent = land.land;\n klon.querySelector(\".foto\").src = medieurl + land.billede;\n klon.querySelector(\".kort_beskrivelse\").textContent = land.kortBeskrivelse;\n //kommer ind på single view ved klik på info knap\n klon.querySelector(\".info\").addEventListener(\"click\", () => visDetaljer(land));\n dest.appendChild(klon);\n }\n })\n}", "function openListContent() {\n $(\"#sidebar2\").css(\"display\",\"block\");\n}", "function paginatedPlaces(data) {\n var paginatedPlaces = $(\"#tab-places .related-places\");\n\n var contentPl = '';\n $.each(data.features, function(rInd, rElm) {\n contentPl += '<li>';\n contentPl += '<a href=\"' + Settings.placesPath + '#id=' + rElm.id + '&que=tab-overview\">';\n contentPl += rElm.header;\n contentPl += '</a>';\n contentPl += '</li>';\n });\n\n paginatedPlaces.empty().html(contentPl);\n}", "function readCategories_index(obj) {\n // Create tag div for categories\n $.each(obj.categories, function(index, value){\n var category = value.toLowerCase().replace(/ /g, '-');\n\n // Add sidebar\n var temp = `<a class=\"list-group-item list-group-item-action\" \n id=\"list-${category}-list\" \n data-toggle=\"list\" \n href=\"#list-${category}\" \n role=\"tab\" \n aria-controls=\"${category}\">\n ${value}\n </a>`;\n $(\".sidebar-js\").append(temp);\n \n // Add main-content\n temp = `<div class=\"tab-pane fade\" id=\"list-${category}\" role=\"tabpanel\" aria-labelledby=\"list-${category}-list\">\n <h4>${value}</h4>\n <hr>\n <div class=\"card-columns mt-4 list-${category}-js\">\n\n </div>\n </div>`;\n $(\".content-js\").append(temp);\n })\n $(`#list-${obj.categories[0].toLowerCase().replace(/ /g, '-')}-list`).addClass('active')\n $(`#list-${obj.categories[0].toLowerCase().replace(/ /g, '-')}`).addClass('active show')\n}", "function renderLeftNews(data) {\n const firstArticleElement = document.getElementsByClassName(\"left\"); // Cai nay return ve 1 array chua' nhung element co class la left\n firstArticleElement[0].innerHTML = `\n <div class=\"posts\">\n <a href=\"#\"><p class=\"title\" style ='color: white;'>${data.title}</p></a>\n <p class=\"author\">${data.by}</p>\n <p>I think your best bet would be to start or join a startup. That's been a reliable way to get rich\n for hundreds of years.The word \"startup\" dates from the 1960s, but what happens in one is very\n similar.</p>\n </div>\n `;\n}", "function displayInfo(element) {\n const container = document.getElementById('container');\n const divInfo = createAndAppend('div', container, {\n id: 'leftSide',\n class: 'left-div whiteframe',\n });\n // Table info\n createAndAppend('table', divInfo, { id: 'table' });\n const table = document.getElementById('table');\n createAndAppend('tbody', table, { id: 'tbody' });\n function createTableRow(label, description) {\n const tableR = createAndAppend('tr', table);\n createAndAppend('td', tableR, { text: label, class: 'label' });\n createAndAppend('td', tableR, { text: description });\n }\n\n createTableRow('Repository: ', element.name);\n createTableRow('Description: ', element.description);\n createTableRow('Forks : ', element.forks);\n const newDate = new Date(element.updated_at).toLocaleString();\n createTableRow('Updated: ', newDate);\n }", "function OLshowObject(obj){\r\nvar theObj=(OLns4?obj:obj.style);o3_showid=0;\r\nif(((OLfilterPI)&&!OLchkFilter(theObj))||!OLfilterPI)theObj.visibility=\"visible\";\r\nif(OLshadowPI)OLshowShadow();if(OLiframePI)OLshowIfShim();if(OLhidePI)OLhideUtil(1,1,0);\r\n}", "function originList(){\r\n var rootN = document.getElementById('root');\r\n rootN.innerHTML = '';\r\n makePreviewObject(tanks)\r\n}", "function loadTree() {\n main.loadWindowResize(\"web/vis.html\", 1200, 800);\n}", "function showTools(){\r\n\t\r\n\tif (actFilterNum<0){\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t//Delete all non-permanent childs of filtertools\r\n\t$('#filter_tools').find('.tool_element').remove();\r\n\t$('#filter_tools').find('#toolH3').remove();\r\n\t\r\n\t// Add the Toolname\r\n\tvar h3 = document.createElement('H3');\r\n\tvar t = document.createTextNode(filter[actFilterNum].name); \r\n\th3.id = 'toolH3';\r\n\th3.appendChild(t);\r\n\tdocument.getElementById('filter_tools').appendChild(h3);\r\n\t\r\n\t// go over all tools and create the UI elements\r\n\tfor (var i=0; i<filter[actFilterNum].tools.length; i++){\r\n\t\tvar div = document.createElement('DIV');\r\n\t\tdiv.classList.add('area');\r\n\t\tdiv.classList.add('tool_element');\r\n\t\t\r\n\t\tswitch (filter[actFilterNum].tools[i].tooltype){\r\n\t\t\tcase 'int':\r\n\t\t\t\tcreateIntTool(div, false, filter[actFilterNum].tools[i], filter[actFilterNum]);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'int-slider':\r\n\t\t\t\tcreateIntTool(div,true, filter[actFilterNum].tools[i], filter[actFilterNum]);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'switch':\r\n\t\t\t\tcreateSwitchTool(div, filter[actFilterNum].tools[i], filter[actFilterNum]);\r\n\t\t\tbreak;\r\n\t\t\tcase 'check':\r\n\t\t\t\tcreateCheckTool(div, filter[actFilterNum].tools[i], filter[actFilterNum]);\r\n\t\t\tdefault:\r\n\t\t}\r\n\t\tdocument.getElementById('filter_tools').appendChild(div);\r\n\t}\r\n}", "function do_tabpanel(group,idnode)\r\n{\r\n\r\n\t\tvar c = new class_compat();\r\n\t\tc.showgroupelement(group,idnode);\r\n\t\t\r\n\r\n}", "printList() {\n \n while (this.listContainer.hasChildNodes()) {\n this.listContainer.removeChild(this.listContainer.firstChild);\n }\n \n let currentNode = this.head;\n while (currentNode !== null) {\n let nodeDiv = document.createElement('div');\n let nodeData = document.createElement('h3');\n nodeDiv.classList.add('node-container');\n nodeData.classList.add('node-data');\n nodeDiv.style.borderColor = currentNode.getColor();\n //nodeDiv.style.backgroundColor = currentNode.getColor();\n \n nodeData.innerHTML = currentNode.data;\n nodeDiv.appendChild(nodeData);\n this.listContainer.appendChild(nodeDiv);\n \n this.addArrow();\n \n currentNode = currentNode.getNext();\n }\n \n this.addNull();\n }", "function showExplorer() {\n\t\t\tconsoleDiv.find('div').load(\n\t\t\t\t'/explorer/_console.html', function() {\n\t\t\t\tgdn.apiExplorer.init(consoleDiv);\n\t\t\t\tsizeIt();\n\t\t\t});\n\t\t}", "function loadNavigationDetails(divId, indexString, operation, section, docViewId){\r\n\tvar divComponent = divId.substring(0,divId.lastIndexOf(\"-\")+1);\r\n\tvar activeDiv = divId.substring(divId.lastIndexOf(\"-\")+1,divId.length);\r\n\tgetElemnt(divComponent + activeDiv + \"-cell\").className=\"clsNavChildren\";\r\n\tvar i = 0;\r\n\tvar collapse = false;\r\n\tvar arrowComponent = getElemnt(divId+\"-arrow\");\r\n\tvar presentImage = arrowComponent.src;\r\n\tif(operation == 'getChildren'){\r\n\t\tvar imagePath = presentImage.substring(0,presentImage.lastIndexOf(\"/\")+1);\r\n\t\tif(presentImage && presentImage.substring(presentImage.lastIndexOf(\"/\")+1, presentImage.length) == \"right_arrow_black.gif\"){\r\n\t\t\tarrowComponent.src = imagePath + \"down_arrow_black.gif\";\r\n\t\t\tcollapse = false;\r\n\t\t} else {\r\n\t\t\tarrowComponent.src = imagePath + \"right_arrow_black.gif\";\r\n\t\t\tcollapse = true;\r\n\t\t\tgetElemnt(divComponent + activeDiv + \"-cell\").className = \"clsNavChildren\";\r\n\t\t}\r\n\t\twhile(getElemnt(divComponent + i + \"-anchor\") != null){\r\n\t\t\tif(i != activeDiv)\r\n\t\t\t{\r\n\t\t\t\tgetElemnt(divComponent + i + \"-row\").style.display = \"none\";\r\n\t\t\t\tgetElemnt(divComponent + i + \"-anchor\").style.display = \"none\";\r\n\t\t\t\tgetElemnt(divComponent + i + \"-anchor1\").style.display = \"none\";\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tgetChildren(divId ,indexString, section, collapse);\r\n\t}\r\n\telse{\r\n\t\tvar imagePath = presentImage.substring(0,presentImage.lastIndexOf(\"/\")+1);\r\n\t\tif(presentImage.substring(presentImage.lastIndexOf(\"/\")+1, presentImage.length) == \"down_arrow_black.gif\"){\r\n\t\t\tarrowComponent.src = imagePath + \"right_arrow_black.gif\";\r\n\t\t}\r\n\t\tgetElemnt(divComponent + activeDiv + \"-cell\").className = \"selectedNodes\";\r\n\t\twhile(getElemnt(divComponent + i + \"-anchor\") != null){\r\n\t\t\tif(i != activeDiv)\r\n\t\t\t{\r\n\t\t\t\tgetElemnt(divComponent + i + \"-row\").style.display = \"none\";\r\n\t\t\t\tgetElemnt(divComponent + i + \"-anchor\").style.display = \"none\";\r\n\t\t\t\tgetElemnt(divComponent + i + \"-anchor1\").style.display = \"none\";\r\n\t\t\t\tvar arrowComponent = getElemnt(divComponent+i+\"-arrow\");\r\n\t\t\t\tarrowComponent.src = imagePath + \"right_arrow_black.gif\";\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tvar component = getElemnt(divId);\r\n\t\tcomponent.style.display = \"none\";\r\n\t\tloadWorkArea('menu.do','NAV-MENU&docViewId='+docViewId+'&searchBy='+indexString+'&menu=' + section,'',loadNavigationGrid);\r\n\t}\r\n}", "function display_card_lists(left_card_list, left_expand, left_visible, left_action, right_card_list, right_expand, right_visible, right_action) {\n\tvar card_list_div = document.createElement(\"div\");\n\tcard_list_div.setAttribute(\"class\", \"card_lists\");\n\tdocument.getElementById(\"game\").appendChild(card_list_div);\n\tdisplay_card_list(left_card_list, left_expand, card_list_div, left_visible, left_action);\n\tdisplay_card_list(right_card_list, right_expand, card_list_div, right_visible, right_action);\n}", "function buildList(){\n var medOut = '';\n var researchOut = '';\n var academicOut = '';\n var athleticOut = '';\n var adminOut = '';\n \n for(i = 0; i < data.features.length; i++){\n var object = data.features[i];\n var button = '<button class=\"list-group-item building-button\">'+object.properties.name+'</button>';\n switch(object.properties.type){\n case \"medical\" : medOut += button; break;\n case \"research\" : researchOut += button; break;\n case \"athletic\" : athleticOut += button; break;\n case \"academic\" : academicOut += button; break;\n case \"admin\" : adminOut += button; break; \n default: medOut += button;\n }\n \n }\n \n $(\"#medical-list\").html(medOut);\n $(\"#research-list\").html(researchOut);\n $(\"#academic-list\").html(academicOut);\n $(\"#athletic-list\").html(athleticOut); \n $(\"#admin-list\").html(adminOut); \n \n}", "function displayDocuManager() {\n\n\t// clear\n\t$(\".controlContentBlock[id=compare-manage] > ol\").empty();\n\n\t// show each corpus\n\tfor (let corpusName in _dataset) {\n\t\tif (typeof _dataset[corpusName] !== 'object') continue;\n\t\tlet manageItem = \"<li name=\\\"\" + corpusName + \"\\\">\" + corpusName + \"</li>\";\n\t\tlet className = (_dataset[corpusName].isShow) ?\"glyphicon-eye-open\" :\"glyphicon-eye-close\";\n\t\tlet hideBtn = \"<span class=\\\"glyphicon \" + className + \"\\\" name=\\\"\" + corpusName + \"\\\" onclick=\\\"hideOrShowCorpus(this, '\"+corpusName+\"')\\\"></span>\";\n\t\tlet deleteBtn = \"<span class=\\\"glyphicon glyphicon-trash\\\" name=\\\"\" + corpusName + \"\\\" onclick=\\\"deleteCorpus('\" + corpusName + \"')\\\"></span>\";\n\t\t$(\".controlContentBlock[id=compare-manage] > ol\").append(manageItem + hideBtn + deleteBtn);\n\t}\n}", "searchInnerListLayer() {\n this.layer.contentEle.forEach((activeLayer) => {\n this.setShowInnerListLayer(activeLayer);\n this.setHiddenInnerListLayer(activeLayer);\n });\n }", "function Sidebar() {\n return _structureBuilder.default.list().title(\"Slick's Slices\").items([// create new sub item\n _structureBuilder.default.listItem().title('Home Page').icon(() => /*#__PURE__*/_react.default.createElement(\"strong\", null, \"\\uD83D\\uDD25\")).child(_structureBuilder.default.editor().schemaType('storeSettings') // make a new document ID, so we don't have a random string of numbers\n .documentId('downtown')), // add in the rest of our document items\n ..._structureBuilder.default.documentTypeListItems().filter(item => item.getId() !== 'storeSettings')]);\n}", "function extendSidePreview(){\n\t$('#ne-list').animate({\n\t\twidth: '30%'\n\t}, 300, function(){\n\t\t$('#ne-side').show();\n\t\t$('#ne-side').animate({\n\t\t\topacity: 1\n\t\t}, 700);\n\t});\n}", "function generateNEListDIV(response, su, role, options) {\n\n\tvar context = \"ne\"\n\tvar res = response['result']\n\tvar canadmin = (su || role.toLowerCase() == \"col-admin\")\n\tvar editinplace = (canadmin ? \"\"+editinplace+\"\" : \"\")\n\n\t// newdiv\n\tvar newdiv = $(\"<DIV ID='rrs-entity-list' CLASS='main-slidable-div' \"+\n\t\" TITLE='\"+i18n[context+'_list'][lang]+\"' STYLE='display:none;overflow:auto;'></DIV>\")\n\t\n\t// Set pageable area for paging reposition\n\tt = \"<DIV CLASS='rrs-pageable'>\" \n\t\n\t// pager\n\tt += createPagerNavigation({\n\t\t\"context\":context, \n\t\t\"contexts\":\"nes\", \n\t\t\"response\":response,\n\t\t\"role\":role, \n\t\t\"allowedSearchableFields\":{\n\t\t\t\"ne_id\":i18n['id'][lang], \n\t\t\t\"ne_name\":i18n['name'][lang],\n\t\t\t\"ne_lang\":i18n['lang'][lang],\n\t\t\t\"ne_category\":i18n['ne_category'][lang], \n\t\t\t\"ne_type\":i18n['ne_type'][lang],\n\t\t\t\"ne_subtype\":i18n['ne_subtype'][lang],\n\t\t\t\"ne_entity\":i18n['entity'][lang]\n\t\t}\n\t})\n\t\n\tvar res = response['result']\n\t\t\n\t// buttons\n\tt += \"<DIV CLASS='rrs-buttonrow'>\"\n\tif (su) {\n\t\tt += \"<A HREF='#' CLASS='\"+context.toUpperCase()+\"_CREATE main-button' \"\n\t\tt += \"ROLE='\"+role+\"' TITLE='\"+i18n['create_new_'+context][lang]+\"'><SPAN>\"\n\t\tt += i18n['create_new_'+context][lang]+\"</SPAN></A>\";\n\t}\n\tt += \"</DIV>\"\n\t\n\t// table \n\tt += \"<DIV>\"\n\tt += \"<TABLE ID='rrs-\"+context+\"-list-table' CLASS='tablesorter \"+ role + \"'>\"\n\tt += \"<THEAD><TR><TH></TH>\"\n\tt += \"<TH>\"+i18n['id'][lang]+\"</TH>\";\n\tt += \"<TH>\"+i18n['name'][lang]+\"</TH>\";\n\tt += \"<TH>\"+i18n['lang'][lang]+\"</TH>\";\n\tt += \"<TH>\"+i18n['ne_category'][lang]+\"</TH>\";\n\tt += \"<TH>\"+i18n['ne_type'][lang]+\"</TH>\";\n\tt += \"<TH>\"+i18n['ne_subtype'][lang]+\"</TH>\";\n\tt += \"<TH>\"+i18n['ne_entity'][lang]+\"</TH>\";\n\tif (su) {t += \"<TH></TH>\";}\n\tt += \"</TR></THEAD><TBODY>\"\n\t\n\tfor(i in res) {\n\t\t\n\t\tvar id = res[i]['ne_id']\n\t\t\n\t\tt += \"<TR><TD><INPUT TYPE='CHECKBOX' CLASS='sec-checkbox'></TD>\"\n\t\tt += \"<TH><A CLASS='\"+context.toUpperCase()+\"_SHOW' ROLE='\"+role+\"' \"+\n\t\t \"TARGET='rrs-\"+context+\"-show-\"+id+\"' \"+\n\t\t \"TITLE='\"+res[i]['ent_name']+\"' HREF='#'>\"+id+\"</A></TH>\"\n\n\t\t// begin of a saskia object\t\t\t\t\t\t\t\n\t\tt += \"<TD><DIV CONTEXT='\"+context+\"' COL='ne_name' COL2='nen_name' ID='\"+id+\"' \"\n\t\tt += \"CLASS='\"+editinplace+\" autocompletetextfield'><DIV CLASS='saskia_object_tag'>\"+res[i]['ne_name']['nen_name']+\n\t\t\"</DIV></DIV></TD>\"\t\t\n\t\t// end of a saskia object\n\n\t\tt += \"<TD><DIV CONTEXT='\"+context+\"' COL='ne_lang' ID='\"+id+\"' \"\n\t\tt += \"CLASS='\"+editinplace+\" textfield'>\"+res[i]['ne_lang']+\"</DIV></TD>\"\t\n\t\t\n\t\t// begin of a saskia object\t\t\t\t\t\t\t\n\t\tt += \"<TD><DIV CONTEXT='\"+context+\"' COL='ne_category' COL2='nec_category' ID='\"+id+\"' \"\n\t\tt += \"CLASS='\"+editinplace+\" autocompletetextfield'><DIV CLASS='saskia_object_tag'>\"+res[i]['ne_category']['nec_category']+\n\t\t\"</DIV></DIV></TD>\"\t\t\n\t\t// end of a saskia object\n\t\t\n\t\t// begin of a saskia object\t\t\t\t\t\t\t\n\t\tt += \"<TD><DIV CONTEXT='\"+context+\"' COL='ne_type' COL2='net_type' ID='\"+id+\"' \"\n\t\tt += \"CLASS='\"+editinplace+\" autocompletetextfield'><DIV CLASS='saskia_object_tag'>\"+res[i]['ne_type']['net_type']+\n\t\t\"</DIV></DIV></TD>\"\t\t\n\t\t// end of a saskia object\n\n\t\t// begin of a saskia object\t\t\t\t\t\t\t\n\t\tt += \"<TD><DIV CONTEXT='\"+context+\"' COL='ne_subtype' COL2='nes_subtype' ID='\"+id+\"' \"\n\t\tt += \"CLASS='\"+editinplace+\" autocompletetextfield'><DIV CLASS='saskia_object_tag'>\"+res[i]['ne_subtype']['nes_subtype']+\n\t\t\"</DIV></DIV></TD>\"\t\t\n\t\t// end of a saskia object\n\t\t\n\t\t// begin of a saskia object\t\t\t\t\t\t\t\n\t\tt += \"<TD><DIV CONTEXT='\"+context+\"' COL='ne_entity' COL2='ent_dbpedia_resource' ID='\"+id+\"' \"\n\t\tt += \"CLASS='\"+editinplace+\" autocompletetextfield'><DIV CLASS='saskia_object_tag'>\"+res[i]['ne_entity']['ent_dbpedia_resource']+\n\t\t\"</DIV></DIV></TD>\"\t\t\n\t\t// end of a saskia object\n\t\tif (su) {\n\t\t\tt += \"<TD><A HREF='#' ROLE='\"+role+\"' ID='\"+id+\"' TITLE='\"+res[i]['geo_name']+\"' CLASS='\"+context+\"_DELETE main-button'>\"\n\t\t\tt += \"<SPAN>\"+i18n['delete'][lang]+\"...</SPAN></A></TD>\";\n\t\t}\n\t\tt += \"</TR>\"\n\t}\t\n\n\tt += \"<TFOOT><TR><TD><INPUT TYPE='CHECKBOX' CLASS='main-checkbox'></TD>\"\n\tt += \"<TH>\"+i18n['all'][lang]+\"</TH>\"\n\tt += \"<TD><DIV CONTEXT='\"+context+\"' COL='ne_name' \"\n\tt += \"CLASS='\"+editinplace+\" autocompletetextfield group'></DIV></TD>\"\n\tt += \"<TD><DIV CONTEXT='\"+context+\"' COL='ne_lang' \"\n\tt += \"CLASS='\"+editinplace+\" textfield group'></DIV>\"\n\tt += \"<TD><DIV CONTEXT='\"+context+\"' COL='ne_category' \"\n\tt += \"CLASS='\"+editinplace+\" autocompletetextfield group'></DIV></TD>\"\n\tt += \"<TD><DIV CONTEXT='\"+context+\"' COL='ne_type' \"\n\tt += \"CLASS='\"+editinplace+\" autocompletetextfield group'></DIV></TD>\"\n\tt += \"<TD><DIV CONTEXT='\"+context+\"' COL='ne_subtype' \"\n\tt += \"CLASS='\"+editinplace+\" autocompletetextfield group'></DIV></TD>\"\n\tt += \"<TD><DIV CONTEXT='\"+context+\"' COL='ne_entity' \"\n\tt += \"CLASS='\"+editinplace+\" autocompletetextfield group'></DIV></TD>\"\n\tif (su) {t += \"<TD></TD>\"}\n\tt += \"</TR></TFOOT>\"\n\tt += \"</TABLE></DIV>\"\n\tt += \"</DIV></DIV>\"\n\t\n\tnewdiv.append(t)\n\treturn newdiv\n}", "function func (){\n var element = document.getElementById('display_pane');\n element.innerHTML = printObj(object);\n }", "function nodeClick(d) {\n EdInActions.selectIp(d.ip);\n OniActions.toggleMode(OniConstants.DETAILS_PANEL, OniConstants.VISUAL_DETAILS_MODE);\n EdInActions.reloadVisualDetails();\n}", "function toggle_details()\n{ \n var flag = 0; \n if ( $('toggle_details').innerHTML == \"Expanded view\" ) \n {\n flag = 0;\n $('toggle_details').innerHTML = \"List view\";\n }\n else \n {\n flag = 1;\n $('toggle_details').innerHTML = \"Expanded view\"; \n }\n \n details = document.getElementsByClassName( 'log_params', $('content') );\n for( var i = 0; i < details.length; i++ )\n {\n if ( flag == 0 ) \n\t Element.hide( details[i].id );\t\t \n else \n\t Element.show( details[i].id );\n\t }\n}", "function showData(theDiv) {\n var markerList = document.getElementById(theDiv);\n featureLayer.eachLayer(function(layer) {\n var item = markerList.appendChild(document.createElement('li'));\n item.className = \"collection-item avatar\";\n item.innerHTML = \"<img src='\"+layer.toGeoJSON().properties.icon.iconUrl + \"'alt='' class='circle'>\"+ \"<span class='title'>\"+layer.toGeoJSON().properties.title+\"</span>\"+ \"<p>\"+layer.toGeoJSON().properties.services+\"</p>\"+\"<a href='#!' class='secondary-content'><i class='material-icons'>send</i></a>\";\n item.onclick = function() {\n $('.button-collapse').sideNav('hide');\n map.setView(layer.getLatLng(), 14);\n layer.openPopup();\n };\n });\n (function($) {\n $(function() {\n $(\"li\", \"#marker-list\").sort(function(a, b) {\n return\n $(a).text() > $(b).text();\n }).appendTo(\"#\" + theDiv);\n });\n })(jQuery);\n }", "async show() {\n // Anzuzeigenden Seiteninhalt nachladen\n let html = await fetch(\"page-overview/page-overview.html\");\n let css = await fetch(\"page-overview/page-overview.css\");\n\n if (html.ok && css.ok) {\n html = await html.text();\n css = await css.text();\n } else {\n console.error(\"Fehler beim Laden des HTML/CSS-Inhalts\");\n return;\n }\n\n // Seite zur Anzeige bringen\n let pageDom = document.createElement(\"div\");\n pageDom.innerHTML = html;\n\n this._renderBoatTiles(pageDom);\n\n this._app.setPageTitle(\"Startseite\");\n this._app.setPageCss(css);\n this._app.setPageHeader(pageDom.querySelector(\"header\"));\n this._app.setPageContent(pageDom.querySelector(\"main\"));\n }", "function showHideContentGrids(ww, rows, $el) {\n var contentType = $el.closest('.tg-content-grid').attr('data-content-grid-type');\n\n $el.find('.l-gi').show();\n\n if (contentType == '2') {\n switch (true) {\n case ww > 760:\n break;\n default:\n $el.find('.l-gi').slice(-rows).hide();\n }\n }\n \n if (contentType == '3') {\n switch (true) {\n case ww > 1140:\n $el.find('.tg-list-no-border').removeClass('tg-list-no-border');//Alignment ticket\n break;\n case ww > 760:\n $el.find('.l-gi').slice(-rows).hide();\n $el.find('.l-gi').not(':hidden').slice(-2).addClass('tg-list-no-border');//Alignment ticket\n break;\n default:\n $el.find('.l-gi').slice(-rows * 2).hide();\n $el.find('.tg-list-no-border').removeClass('tg-list-no-border');//Alignment ticket\n }\n }\n\n // Rests load more button on resize\n if (ww <= 760) {\n $el.siblings('.tg-load-more').show();\n }\n }", "function fnViewAllOS() {\n\t$('#mainContainer').html('<div id=\"ViewOSPage\"></div>');\n\tsetLoadImage('ViewOSPage');\n\tsendHTMLAjaxRequest(false, 'getView/getViewOSPage.html', null, fnDisplayContent, null,'ViewOSPage');\n}", "function loadModuleStartnavThreeArchives(objectname) {\n\tvar object = window[objectname];\n\tvar objectFirst = objectname.substr(0, 1);\n\tvar objectnameCaps = objectFirst.toUpperCase() + objectname.substr(1);\n\t//var num_modules = window[objectname+'_num_modules'];\n\t//console.log(object)\n\t\n\tvar h = object.$layoutWest.height();\n\t$('#'+objectname+' div.radius-helper').height(h);\n\t$('#'+objectname+' .secondLevelOuter').css('top',h-27);\n\t$('#'+objectname+' .thirdLevelOuter').css('top',150);\n\tobject.$first.data('status','open');\n\tobject.$second.data('status','closed');\n\tobject.$third.data('status','closed');\n\tobject.$first.height(h-98);\n\t$('#'+objectname+'1 .module-inner').height(h-98);\n\t$('#'+objectname+'1 .module-actions').show();\n\t$('#'+objectname+'2 .module-actions').hide();\n\t$('#'+objectname+'2 li').show();\n\t\n\t$('#'+objectname+'-current').val(\"folder\");\n\t\n\t\n\t$.ajax({ type: \"GET\", url: \"/\", data: \"path=apps/\"+objectname+\"&request=getFolderList\", success: function(data){\n\t\t$('#'+objectname+'1 ul').html(data);\n\n\t\t//$('#'+objectname+'Actions .actionNew').attr(\"title\",data.title);\n\t\t/*if(data.access == \"guest\") {\n\t\t\twindow[objectname+'Actions']();\n\t\t} else {*/\n\t\t\t\n\t\twindow[objectname+'Actions'](1);\n\t\t\t\n\t\t/*}*/\n\t\t$('#'+objectname+'1 li').show();\n\t\t//$('#'+objectname+'1 .sort').attr(\"rel\", data.sort).addClass(\"sort\"+data.sort);\n\n\t\t//var module = $('#'+objectname+'1 .module-click:eq(0)').attr(\"rel\");\n\t\t\n\t\t\n\t\t// Module\n\tvar module = $('#'+objectname+'1 .module-click:eq(0)').attr(\"rel\");\n\tvar moduleFirst = module.substr(0, 1);\n\tvar moduleCaps = moduleFirst.toUpperCase() + module.substr(1);\n\tvar moduleCapsSingular = moduleCaps.slice(0,-1);\n\tvar num_modules = window[module+'_num_modules'];\n\t\t\n\t\t\n\t\tobject.$second.height(h-125-num_modules*27).removeClass(\"module-active\");\n\t$('#'+objectname+'2 .module-inner').height(h-125-num_modules*27);\n\t\t\n\t\t/*if(id === undefined) {\n\t\t\tid = 'projects';\n\t\t}*/\n\t\t$.ajax({ type: \"GET\", url: \"/\", data: \"path=apps/\"+module+\"&request=getArchiveModules\", success: function(html){\n\t\t\t$('#archives3').html(html);\n\t\t\t//var h = object.$layoutWest.height();\n\t\t\t//console.log(h);\n\t\t\t$('#'+objectname+'3 .module-actions').hide();\n\t\t\tvar h = object.$layoutWest.height();\n\t$('#archives3').height(h-150);\n\t$('#'+objectname+'3 .'+objectname+'3-content').height(h-(num_modules*module_title_height+152));\n\t$('#archives3 div.thirdLevel').height(h-(num_modules*module_title_height+150-27));\n\t\t\t$('#archives3 div.thirdLevel').each(function(i) { \n\t\tvar position = $(this).position();\n\t\tvar t = position.top+h-150;\n\t\t$(this).css('top',t+'px');\n\t\t//$(this).animate({top: t})\n\t})\n\t\t\t}\n\t\t});\n\t\t\n\n\t\tobject.$app.data({ \"current\" : \"folders\" , \"first\" : module , \"second\" : 0 , \"third\" : 0});\n\t\t$('#'+objectname+'1 .module-click:eq(0)').addClass('active-link');\n\t\t//console.log('yoyo');\n\t\t$.ajax({ type: \"GET\", url: \"/\", dataType: 'json', data: \"path=apps/\"+module+\"&request=getArchive\", success: function(data){\n\t\t\tobject.$appContent.html(data.html);\n\t\t\twindow['init'+objectnameCaps+'ContentScrollbar']();\n\t\t\t}\n\t\t});\n\t\t\n\t}\n\t});\n}", "render1(lectLst) {\n var rootNode = this.rootNode;\n document.getElementById(rootNode.id + \"_childs\").innerHTML = \"\";\n rootNode.visible = true;\n\n for (var i in lectLst) {\n this.addLectItem(rootNode, lectLst[i]);\n }\n }", "function renderDom() {\n stackList.innerHTML = \"\";\n myStack.stackControl.forEach(el => {\n stackList.innerHTML += `<li>${el}</li>`;\n })\n }", "function parseNetworkData( data ){\n $('div#dashboard-select').html('');\n // Setup the dashboard\n var active = true;\n // For each \"object\" in the \"network\"\n if ( data.hasOwnProperty(\"objects\") ) {\n for ( var object_id in data.objects ){\n //console.log( object_id );\n if ( data.objects.hasOwnProperty(object_id) ) {\n //console.log( data.objects[object_id] );\n // For each \"stream\" in the \"object\"\n if ( data.objects[object_id].hasOwnProperty(\"streams\") ) {\n for ( var stream_id in data.objects[object_id].streams ){\n //console.log( stream_id );\n if (data.objects[object_id].streams.hasOwnProperty(stream_id)) {\n //console.log( data.objects[object_id].streams[stream_id] );\n\n // Load a plot for this stream\n loadStreamPlot( object_id, stream_id, active );\n\n // Load an icon for this stream\n loadStreamIcon( object_id, stream_id, active );\n\n // Set the \"first\" stream as active\n if( active ){\n active = false;\n }\n }\n }\n }\n }\n }\n }\n\n\n}", "function initCommCollLists(id){\n var checkedButton = $('input[@name=\"scope\"]:checked');\n var selectedValue = checkedButton.val();\n var mainlist = $('ul#' + id);\n mainlist.attr('style', 'margin-top:0px; padding-left:0px;margin-left:5px;');\n $('ul#aspect_metadataquality_QualityAssurance_list_firstList').attr('style', 'margin-bottom:0px;');\n var ulArr = $('ul#' + id + ' ul');\n for(var i = 0; i < ulArr.length; i++){\n var current = $(ulArr.get(i));\n// current.find(':checkbox').hide\n\n var label = current.prev().find(\"label\");\n label.closest('li').addClass('collapsibleSubTreeLabel');\n var input = label.find(\"input\");\n if (input.length > 0) {\n input.insertBefore(label);\n }\n var lbltext = label.attr('innerHTML');\n label.attr('innerHTML', '');\n label.append('<a href=\"\" onclick=\"return false;\"><span class=\"ui-icon ui-icon-triangle-1-e communityCollapser\">&nbsp;</span>' + lbltext + '</span></a>');\n label.attr('target', 'ul#' + current.attr('id'));\n current.hide();\n label.bind('click', function(){\n// $($(this).attr('target')).slideToggle(\"fast\"); //Werkt niet in IE\n var list = $($(this).attr('target'));\n if(list.is(':visible')){\n list.hide();\n $(this).find('span.ui-icon-triangle-1-s').removeClass('ui-icon-triangle-1-s').addClass('ui-icon-triangle-1-e');\n }\n else {\n list.show();\n $(this).find('span.ui-icon-triangle-1-e').removeClass('ui-icon-triangle-1-e').addClass('ui-icon-triangle-1-s');\n }\n try {\n matchHeights();\n } catch(e) {\n }\n });\n }\n// if(selectedValue == undefined || selectedValue == 'all')\n// mainlist.hide();\n// else {\n //doorloop alle 'ul's die ancestor zijn van het geselecteerde element en 'click' erop, zodat ze openklappen\n ulArr = checkedButton.parents('ul');\n for(var i = 0; i < ulArr.length; i++){\n var current = $(ulArr.get(i));\n //Als de bovenste (relevante) 'ul' bereikt is mag de lus beindigd worden\n if (current.attr('id') == id)\n break;\n current.prev().find('label').click();\n }\n\n //door de clicks in de for lus hierboven wordt in IE het verkeerde element geselecteerd, dus selecteer terug het juiste\n checkedButton.attr('checked', 'true');\n// $('p#aspect_metadataquality_QualityAssurance_p_openTreePara').hide();\n// }\n}", "function resetDrilldown(obj, wrapper){\r\n\t\t\tvar $header = $('.'+defaults.header_class, wrapper);\r\n\t\t\t$('ul',$header).remove();\r\n\t\t\t$('a',$header).remove();\r\n\t\t\t$('li',obj).show();\r\n\t\t\t$('a',obj).show();\r\n\t\t\tvar totalWidth = $(obj).outerWidth(true);\r\n\t\t\tif(defaults.link_type == \"link\"){\r\n\t\t\t\tif($('a.'+defaults.active_class+':last',obj).parent('li').length){\r\n\t\t\t\t\tvar lastActive = $('a.'+defaults.active_class+':last',obj).parent('li');\r\n\t\t\t\t\t$('ul',lastActive).css('margin-right',-totalWidth+'px');\r\n\t\t\t\t}else {\r\n\t\t\t\t$('ul',obj).css('margin-right',-totalWidth+'px');\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$('ul',obj).css('margin-right',-totalWidth+'px');\r\n\t\t\t}\r\n\t\t\tupdateHeader($header, defaults.default_text);\r\n\r\n\t\t\t// Write cookie if save state is on\r\n\t\t\tif(defaults.save_state == true){\r\n\t\t\t\tvar cookieId = $(wrapper).attr('id');\r\n\t\t\t\tcreateCookie(cookieId, obj);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// mewsoft\r\n\t\t\tvar activeObj = obj;\r\n\r\n\t\t\t$('a.'+defaults.active_class,obj).each(function(i){\r\n\t\t\t\tvar $activeLi = $(this).parent('li').stop();\r\n\t\t\t\tactionDrillDown($activeLi, wrapper, obj);\r\n\t\t\t\t// mewsoft\r\n\t\t\t\tactiveObj = $(this).parent('li');\r\n\t\t\t});\r\n\t\t\t//-----------------------------------\r\n\t\t\t// mewsoft\r\n\t\t\tvar showObj;\r\n\t\t\tif ($('> ul', activeObj).length){\r\n\t\t\t\tshowObj = $('> ul', activeObj);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// root ul\r\n\t\t\t\tvar showObj = activeObj;\r\n\t\t\t}\r\n\t\t\tvar itemCount = $('>li', showObj).length;\r\n\t\t\tvar itemHeight = $('li',showObj).outerHeight(true);\r\n\t\t\tvar menuHeight = (itemHeight * itemCount) + $($header).outerHeight(true);\r\n\t\t\t\r\n\t\t\tif (defaults.menu_height) {\r\n\t\t\t\t$(wrapper).css({height: defaults.menu_height,'overflow-y':'auto', 'overflow-x':'hidden'});\r\n\t\t\t\t$(obj).css({height: defaults.menu_height});\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$(wrapper).css({height: menuHeight+'px'});\r\n\t\t\t\t$(obj).css({height: menuHeight+'px'});\r\n\t\t\t}\r\n\r\n\t\t\t//-----------------------------------\r\n\t\t}", "function networkTopologyView(){\n\tremoveClass('active');\n\tdocument.getElementById('nav-option-viewTopology').className='active';\n\n\tdocument.getElementById('')\n\t//removes previously occuring stylesheets and javascript files if they occured before\n\tremoveFile('topologyView.css', 'css');\n\tremoveFile('Manipulation.js', 'js');\n\tremoveFile('Drawing.js','js');\n\tdefaultheaderView(); \n\t\n\tclearNav();\n\t\n\tclearSection();\n\n\tvar content = getContainer();\n\tloadStyleSheet('../css/topologyView.css');\n\tvar html=NetworkTopologyTemplate(get_local_simulation());\n\tvar content=getContainer();\n\tcontent.innerHTML=html;\n\tloadJSFile('../gui/Drawing.js');\n\tloadJSFile('/view/TopologyView.js');\n\tloadJSFile('/gui/Manipulation.js',setTimeout(function(){generateTopology(get_local_simulation().partition_list,800);}, 800));\n\t//sets the topology to be able to be interacted with\n\tinteractable =true;\n\n}", "function JSON2Html(articles, articlesElmId, navElmId, startIndex, max)\n{\n var articlesElm=document.getElementById(articlesElmId);\n var navElm=document.getElementById(navElmId);\n if(articlesElm&&navElm)\n {\n articlesElm.innerHTML=articlesHtml(articles);\n navElm.innerHTML=navHtml(startIndex, articles.articles.length,articles.meta.totalCount);\n }\n}", "function folderDisplay(){\n\n\t$('#main').empty();\n\n\tif(collection.length > 0){\n\n\t\t$.each(collection, function(position, el){\n\t\t\tfolderlElement(el, position).appendTo('#main');\n\t\t});\n\n\t\tmakeDragAndDrop();\n\t\tmaskByClass();\n\t}\n}", "function OpenListOfWorldVisits() {\n document.getElementById(\"countryToVisitSelector\").innerHTML =\n \"<div class='switchlink_l float_l'><a title='Перейти до списку країн' onclick='javascript:OpenListOfWorldCountries()' onmouseover='' style='cursor: pointer;'>Мої країни</a></div>\" +\n \"<div class='switchlink float_l'>Мої візити...</div>\" +\n \"<br><br>\" + createListOfVisites();\n}", "function createListRow(rowdata){\n\n // Check already have the div\n var div_id = \"#datarow_\" + rowdata.id;\n if($(div_id).length){\n return;\n }\n\n \n ///////////////////////////////////\n // Side bar\n\n if(params.id){\n\n var html = `\n <div id=\"datarow_`+ rowdata.id +`\">\n <ul class=\"nav nav-sidebar\">\n <li class=\"dataset_status_updater\"><div><b>Query status:</b></div></li>\n <li class=\"dataset_status_converter\"><div>Updated: <span class=\"dataset_updated\">updated</span></div></li>\n <li class=\"dataset_status_converter\"><div>Rows: <span class=\"dataset_status_rows\"></span></div></li>\n </ul>\n\n <hr>\n\n <ul class=\"nav nav-sidebar\">\n <li class=\"dataset_status_updater\"><div><b>Actions:</b></div></li>\n <li><a href=\"#\"> <span class=\"glyphicon glyphicon-ok icon-green\" aria-hidden=\"true\"></span> Save query</a></li>\n </ul>\n \n <hr>\n\n \n <ul class=\"nav nav-sidebar\">\n <li class=\"dataset_status_updater\"><div><b>Debug:</b></div></li>\n\n <li><a href=\"#log_display\" class=\"btn-show-log\"> <span class=\"glyphicon glyphicon-align-left icon-black btn-show-log\" aria-hidden=\"true\"></span> Show log</a></li>\n <li><a href=\"#tabulator_display\" class=\"btn-show-table\"> <span class=\"glyphicon glyphicon-arrow-right icon-black \" aria-hidden=\"true\"></span> Preview as table</a></li>\n <li><a href=\"#taboo_display\" class=\"btn-show-tabloo\"> <span class=\"glyphicon glyphicon-arrow-right icon-black \" aria-hidden=\"true\"></span> Preview design</a></li>\n <li><a href=\"#map\" class=\"btn-show-map\"> <span class=\"glyphicon glyphicon-arrow-left icon-black \" aria-hidden=\"true\"></span> Preview map</a></li>\n\n </ul>\n </div>\n `;\n\n // $(\"#sidebar\").prepend(html);\n \n\n } else {\n \n ///////////////////////////////////\n // List\n\n if(!rowdata.meta.title.et){\n rowdata.meta.title = {\"et\" : \"no name!!\"};\n }\n\n var html = `\n\n <div class=\"row\" style=\"border-bottom: 0px solid black;padding:0.5rem 0 0.5rem 0; width:100%\" id=\"datarow_`+ rowdata.id +`\">\n\n <div class=\"col-md-6 col-sm-6 col-xs-6\"><b> <a href=\"?p=provider&id=`+ rowdata.id +`\" >` + rowdata.meta.title.et + `</a></b></div>\n\n <div class=\"col-md-2 col-sm-2 col-xs-2\"><span class=\"dataset_update_button\"></span> <span>`+ rowdata.id +`</span></div>\n\n <div class=\"col-md-4 col-sm-1 col-xs-1\" style=\"text-align:right\">\n\n \n\n </div>\n </div>\n `;\n\n \n $(\".container\").append(html );\n\n\n }\n\n\n } // function createListRow", "function expand(id) {\n var node = document.getElementById(id);\n var nodes = node.children;\n var titleStyle = nodes[0].style.display;\n var listStyle = nodes[1].style.display;\n\n nodes[1].style.display = \"block\";\n nodes[0].style.display = \"none\";\n}", "function showAPIActionContent(obj_Id) {\n $(\".each_api_action\").hide();\n $(\"#\"+obj_Id).show();\n}", "function openNav() {\n closeGraphNav()\n document.getElementById(\"mySidenav\").style.height = \"40vh\";\n document.getElementById(\"main\").style.marginTop = \"40vh\";\n var navElement = document.getElementsByClassName(\"list-group\");\n navElement[0].style.height = \"49vh\";\n\n document.getElementById(\"mini-panel\").style.height = \"60vh\";\n\n var navElement2 = document.getElementsByClassName(\"mini-panel-btn\");\n navElement2[0].style.height = \"15vh\";\n navElement2[1].style.height = \"15vh\";\n navElement2[2].style.height = \"15vh\";\n navElement2[3].style.height = \"15vh\";\n navElement2[4].style.height = \"15vh\";\n navElement2[5].style.height = \"15vh\";\n\n document.getElementById(\"showFiltersButton\").style.display = \"none\";\n document.getElementById(\"hideFiltersButton\").style.display = \"inline-block\";\n document.getElementById(\"showFiltersButton2\").style.display = \"none\";\n document.getElementById(\"hideFiltersButton2\").style.display = \"inline-block\";\n}", "function displaySampleListTree(treeName, isLocalOnly, isFolderOnly,\n\t\t\t\t\t\t\t clickFunction) {\n\t'use strict';\n\tvar lazyLoadUrlGetChildren = '/Fieldbook/SampleListTreeManager/expandTree/';\n\tvar initLoadUrl = '/Fieldbook/SampleListTreeManager/loadInitTree';\n\tinitLoadUrl += '/' + isFolderOnly;\n\n\tvar authParams =\n\t\t'authToken=' + authToken\n\t\t+ '&selectedProjectId=' + selectedProjectId\n\t\t+ '&loggedInUserId=' + loggedInUserId;\n\n\tif (selectedProjectId) {\n\t\tinitLoadUrl += '?' + authParams\n\t}\n\n\tvar dynaTreeOptions = {\n\t\ttitle : treeName,\n\t\tcheckbox : false,\n\t\tnoLink : false,\n\t\tautoFocus : false,\n\t\timagePath : '/Fieldbook/static/img/',\n\t\tactiveVisible : true,\n\t\tinitAjax : {\n\t\t\turl : initLoadUrl,\n\t\t\tdataType : 'json'\n\t\t},\n\t\tonLazyRead : function(node) {\n\t\t\tdoSampleLazyLoad(node);\n\t\t},\n\t\tonRender : function(node, nodeSpan) {\n\t\t\tif (node.data.key !== 'LISTS'\n\t\t\t\t&& node.data.key !== 'CROPLISTS'\n\t\t\t\t&& node.data.key !== '_statusNode'\n\t\t\t\t&& node.data.isFolder === false) {\n\t\t\t\t$(nodeSpan)\n\t\t\t\t\t.find('a.dynatree-title')\n\t\t\t\t\t.hover(\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\tif ($(nodeSpan).find(\n\t\t\t\t\t\t\t\t\t'a.dynatree-title')\n\t\t\t\t\t\t\t\t\t.hasClass('has-popover') === false) {\n\t\t\t\t\t\t\t\t$(nodeSpan)\n\t\t\t\t\t\t\t\t\t.find(\n\t\t\t\t\t\t\t\t\t\t'a.dynatree-title')\n\t\t\t\t\t\t\t\t\t.addClass('has-popover');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tclassNames : {\n\t\t\tcontainer : 'fbtree-container',\n\t\t\texpander : 'fbtree-expander',\n\t\t\tnodeIcon : 'fbtree-icon',\n\t\t\tcombinedIconPrefix : 'fbtree-ico-',\n\t\t\tfocused : 'fbtree-focused',\n\t\t\tactive : 'fbtree-active',\n\t\t\tnodeLoading : ''\n\t\t},\n\t\tonFocus : function(node) {\n\t\t\tvar nodeSpan = node.span;\n\t\t\tif (node.data.key !== 'LISTS'\n\t\t\t\t&& node.data.key !== 'CROPLISTS'\n\t\t\t\t&& node.data.key !== '_statusNode'\n\t\t\t\t&& node.data.isFolder === false) {\n\t\t\t\t$(nodeSpan)\n\t\t\t\t\t.find('a.dynatree-title')\n\t\t\t\t\t.hover(\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\tif ($(nodeSpan).find(\n\t\t\t\t\t\t\t\t\t'a.dynatree-title')\n\t\t\t\t\t\t\t\t\t.hasClass('has-popover') === false) {\n\t\t\t\t\t\t\t\t$(nodeSpan)\n\t\t\t\t\t\t\t\t\t.find(\n\t\t\t\t\t\t\t\t\t\t'a.dynatree-title')\n\t\t\t\t\t\t\t\t\t.addClass('has-popover');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\tif ($(nodeSpan).find('a.dynatree-title').hasClass(\n\t\t\t\t\t\t'has-popover') === false) {\n\t\t\t\t\t$(nodeSpan).find('a.dynatree-title').addClass(\n\t\t\t\t\t\t'has-popover');\n\t\t\t\t} else {\n\t\t\t\t\t$('.popover').hide();\n\t\t\t\t\t$(nodeSpan).find('a.dynatree-title')\n\t\t\t\t\t\t.popover('show');\n\t\t\t\t}\n\t\t\t}\n\t\t\tsampleFocusNode = node;\n\t\t},\n\t\tonActivate : function(node) {\n\t\t\tif (node.data.isFolder === false) {\n\t\t\t\tchangeBrowseSampleButtonBehavior(false);\n\t\t\t} else {\n\t\t\t\tif (node.data.key === 'LISTS' || node.data.key === 'CROPLISTS') {\n\t\t\t\t\tchangeBrowseSampleButtonBehavior(true);\n\t\t\t\t\t$('.edit-germplasm-folder').addClass(\n\t\t\t\t\t\t'disable-image');\n\t\t\t\t\t$('.delete-germplasm-folder').addClass(\n\t\t\t\t\t\t'disable-image');\n\t\t\t\t\tif ( node.data.key === 'CROPLISTS') {\n\t\t\t\t\t\t$('.create-germplasm-folder').addClass(\n\t\t\t\t\t\t\t'disable-image');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tchangeBrowseSampleButtonBehavior(true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$('.germplasm-tree-section a.dynatree-title').off('keyup');\n\t\t\t$('.germplasm-tree-section a.dynatree-title').on('keyup',\n\t\t\t\tfunction(e) {\n\t\t\t\t\tif (e.keyCode === 13) {\n\t\t\t\t\t\tchooseListNode(sampleFocusNode, true);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t$(node.span).trigger('bms.tree.node.activate');\n\t\t},\n\t\tonDblClick : function(node, event) {\n\t\t\tchooseList(node);\n\t\t},\n\t\tdnd : {\n\t\t\tonDragStart : function(node) {\n\t\t\t\treturn true;\n\t\t\t},\n\t\t\tpreventVoidMoves : true, // Prevent dropping nodes 'before self', etc.\n\t\t\tonDragEnter : function(node, sourceNode) {\n\t\t\t\treturn true;\n\t\t\t},\n\t\t\tonDragOver : function(node, sourceNode, hitMode) {\n\n\t\t\t},\n\t\t\tonDrop : function(node, sourceNode, hitMode, ui, draggable) {\n\t\t\t\t/** This function MUST be defined to enable dropping of items on\n\t\t\t\t * the tree.\n\t\t\t\t */\n\t\t\t\tif (sourceNode.hasChildren()) {\n\t\t\t\t\tshowErrorMessage(getMessageErrorDiv(), cannotMove\n\t\t\t\t\t\t+ ' ' + sourceNode.data.title + ' '\n\t\t\t\t\t\t+ hasChildrenString);\n\t\t\t\t} else if (node.data.key === 'CROPLISTS' && sourceNode.data.isFolder) {\n\t\t\t\t\tshowErrorMessage(getMessageErrorDiv(), cannotMoveFolderToCropListError);\n\t\t\t\t} else {\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\turl : lazyLoadUrlGetChildren\n\t\t\t\t\t\t+ sourceNode.data.key,\n\t\t\t\t\t\ttype : 'GET',\n\t\t\t\t\t\tcache : false,\n\t\t\t\t\t\taysnc : false,\n\t\t\t\t\t\tsuccess : function(data) {\n\t\t\t\t\t\t\tvar childCount = $.parseJSON(data).length;\n\t\t\t\t\t\t\tif (childCount === 0) {\n\t\t\t\t\t\t\t\tmoveSamplesListFolder(sourceNode, node).done(function () {\n\t\t\t\t\t\t\t\t\tsourceNode.remove();\n\t\t\t\t\t\t\t\t\tdoSampleLazyLoad(node);\n\t\t\t\t\t\t\t\t\tnode.focus();\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tshowErrorMessage(getMessageErrorDiv(),\n\t\t\t\t\t\t\t\t\tcannotMove + ' '\n\t\t\t\t\t\t\t\t\t+ sourceNode.data.title\n\t\t\t\t\t\t\t\t\t+ ' '\n\t\t\t\t\t\t\t\t\t+ hasChildrenString);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t\tonDragLeave : function(node, sourceNode) {\n\t\t\t\t/** Always called if onDragEnter was called.\n\t\t\t\t */\n\t\t\t}\n\t\t}\n\t};\n\n\tif (clickFunction) {\n\t\tdynaTreeOptions.onClick = clickFunction;\n\t}\n\n\t$('#' + treeName).dynatree(dynaTreeOptions);\n}", "function showFeatureList(){\r\n\t\tdocument.getElementById('featureListDiv').style.display = 'block';\r\n\t\tdocument.getElementById('resultcontainer').style.display = 'none';\r\n\t\tdocument.getElementById('search_text_took').style.display = 'none';\r\n}", "function createVisualPanel() {\n const articleVisualElAll = document.querySelectorAll('.element-image:not(.header-image), .element-interactive, .element-atom--media');\n\n const visualPanelEl = document.createElement('div');\n const visualPanelInnerEl = document.createElement('div');\n\n visualPanelEl.classList.add('visual-panel');\n visualPanelInnerEl.classList.add('visual-panel__inner');\n visualPanelEl.appendChild(visualPanelInnerEl);\n\n articleVisualElAll.forEach(function (articleVisualEl) {\n const articleVisualElClone = articleVisualEl.cloneNode(true);\n visualPanelInnerEl.appendChild(articleVisualElClone);\n });\n\n const mainColEl = document.querySelector('.content__main .gs-container:not(.u-cf');\n mainColEl.insertBefore(visualPanelEl, mainColEl.firstChild);\n}", "function showRuns(){\n //get runs object\n \n var runs = getRunsObject();\n \n //Check if empty\n if(runs != '' && runs !=null){\n for(var i=0; i<runs.length;i++){\n $('#stats').append('<li class=\"ui-body-inherit ui-li-static\"><strong>Date: </strong> '+runs[i].date+'<br/><strong>Distance: </strong>'+runs[i].miles+'m<div class=\"controls\"><a href=\"#edit\" id=\"editLink\" data-miles=\"'+runs[i].miles+'\" data-date=\"'+runs[i].date+'\">Edit</a> | <a href=\"#delete\">Delete</a> </div> </li>');\n \n }\n \n $('#home').bind('pageinit',function(){\n $('#stats').listview('refresh');\n \n });\n \n }\n \n }", "function leftCatMenu() {\n \"use strict\";\n jQuery('.product-categories,.widget_nav_menu').addClass('treeview-list');\n jQuery(\".product-categories.treeview-list,.widget_nav_menu.treeview-list\").treeview({\n animated: \"slow\",\n collapsed: true,\n unique: true\n });\n jQuery('.treeview-list a.active').parent().removeClass('expandable');\n jQuery('.treeview-list a.active').parent().addClass('collapsable');\n jQuery('.treeview-list .collapsable ul').css('display', 'block');\n}", "function showDivMenu(thisObject) {\n\tthisObject.style.visibility='visible';\n}", "function displayArticles () {\n articleDiv.show();\n }", "function ListBox_UpdateContent(theHTML, theObject)\n{\n\t//existing objects?\n\tif (theObject.Items)\n\t{\n\t\t//loop through them\n\t\tfor (var items = theObject.Items, iItem = 0, cItems = items.length; iItem < cItems; iItem++)\n\t\t{\n\t\t\t//destroy this\n\t\t\titems[iItem].NotifyDestruction();\n\t\t}\n\t}\n\t//start by cleaning up the current content\n\ttheHTML.innerHTML = \"\"; // SAFE\n\t//force the scrollbar\n\ttheHTML.style.overflowY = \"auto\";\n\t//create item lists\n\ttheObject.Items = [];\n\ttheObject.MapItems = {};\n\t//has valid content?\n\tif (!String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_CONTENT]))\n\t{\n\t\t//helpers\n\t\tvar i, c, nTop, nHeight;\n\t\t//set multi selection\n\t\ttheObject.MultiSelection = Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_MULTISELECTION], false);\n\t\t//get column number (seems we only care that this exists)\n\t\ttheObject.HasColumns = Get_String(theObject.Properties[__NEMESIS_PROPERTY_NPARTS], null) != null;\n\t\t//get column widths\n\t\ttheObject.ColumnWidths = Get_String(theObject.Properties[__NEMESIS_PROPERTY_PARTSWIDTH], \"\").split(__LISTBOX_CONTENT_SEPARATOR);\n\t\t//correct the column widths\n\t\tfor (i = 0, c = theObject.ColumnWidths.length; i < c; i++)\n\t\t{\n\t\t\t//convert to number\n\t\t\ttheObject.ColumnWidths[i] = Get_Number(theObject.ColumnWidths[i], null);\n\t\t}\n\t\t//calculate the height of each option\n\t\ttheObject.LineHeight = Get_Number(theObject.Properties[__NEMESIS_PROPERTY_ITEM_HEIGHT], 0);\n\t\t//height is 0 or less?\n\t\tif (theObject.LineHeight < 1)\n\t\t{\n\t\t\t//auto compute it\n\t\t\ttheObject.LineHeight = Get_StringSize(__FONTS_STRING_SIZE_TEXT, theObject.Properties[__NEMESIS_PROPERTY_FONT]).height;\n\t\t}\n\t\t//get content (we dont store any properties on it so keep it like that)\n\t\tvar aContent = theObject.Properties[__NEMESIS_PROPERTY_CONTENT].split(__LISTBOX_CONTENT_SEPARATOR);\n\t\t//get font\n\t\tvar strFont = Basic_GetFontStyle(theObject.Properties[__NEMESIS_PROPERTY_FONT]);\n\t\t//original colors\n\t\tvar colorFG = Get_Color(theObject.HTML.style.color, theObject.FGColours[__STATE_DEFAULT]);\n\t\tvar colorBG = Get_Color(theObject.HTML.style.backgroundColor, theObject.BGColours[__STATE_DEFAULT]);\n\t\t//get colours\n\t\tvar aColorFG = String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_CB_OPTION_COLORS]) ? new Array(theObject.FGColours[__STATE_DEFAULT]) : theObject.Properties[__NEMESIS_PROPERTY_CB_OPTION_COLORS].split(__COMBOBOX_CONTENT_SEPARATOR);\n\t\tvar aColorBG = String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_CB_OPTION_BGCOLORS]) ? new Array(theObject.BGColours[__STATE_DEFAULT]) : theObject.Properties[__NEMESIS_PROPERTY_CB_OPTION_BGCOLORS].split(__COMBOBOX_CONTENT_SEPARATOR);\n\t\tvar aColorFGSelected = String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_CB_OPTION_FG_COLORS_SELECTED]) ? new Array(theObject.FGColours[__STATE_SELECTED]) : theObject.Properties[__NEMESIS_PROPERTY_CB_OPTION_FG_COLORS_SELECTED].split(__COMBOBOX_CONTENT_SEPARATOR);\n\t\tvar aColorBGSelected = String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_CB_OPTION_BG_COLORS_SELECTED]) ? new Array(theObject.BGColours[__STATE_SELECTED]) : theObject.Properties[__NEMESIS_PROPERTY_CB_OPTION_BG_COLORS_SELECTED].split(__COMBOBOX_CONTENT_SEPARATOR);\n\t\tvar interfaceLook = theObject.InterfaceLook;\n\t\t//now loop for the item creation\n\t\tfor (i = 0, c = aContent.length, nTop = 0, nHeight = theObject.LineHeight; i < c; i++ , nTop += theObject.LineHeight)\n\t\t{\n\t\t\t//create the item\n\t\t\tvar newItem =\n\t\t\t{\n\t\t\t\tValue: aContent[i],\n\t\t\t\tInterpreterObject: theObject,\n\t\t\t\tHTML: null,\n\t\t\t\tTop: nTop,\n\t\t\t\tHeight: nHeight,\n\t\t\t\tIndex: i,\n\t\t\t\tSelected: false,\n\t\t\t\tColorFG: Get_Color(aColorFG[i % aColorFG.length], colorFG, interfaceLook),\n\t\t\t\tColorBG: Get_Color(aColorBG[i % aColorBG.length], colorBG, interfaceLook),\n\t\t\t\tColorFGSelected: Get_Color(aColorFGSelected[i % aColorFGSelected.length], \"\", interfaceLook),\n\t\t\t\tColorBGSelected: Get_Color(aColorBGSelected[i % aColorBGSelected.length], \"\", interfaceLook),\n\t\t\t\tFont: strFont,\n\t\t\t\tShow: ListBox_Item_Show,\n\t\t\t\tHide: ListBox_Item_Hide,\n\t\t\t\tNotifyDestruction: ListBox_Item_Destroy\n\t\t\t};\n\t\t\t//store it in the items\n\t\t\ttheObject.Items.push(newItem);\n\t\t\t//set the map\n\t\t\ttheObject.MapItems[newItem.Index] = newItem;\n\t\t}\n\t\t//has combobox styles?\n\t\tvar comboContentStyle = Get_String(theObject.Properties[__NEMESIS_PROPERTY_CONTENT_STYLE], null);\n\t\t//valid?\n\t\tif (comboContentStyle)\n\t\t{\n\t\t\t//convert to json object\n\t\t\tcomboContentStyle = JSON.parse(comboContentStyle);\n\t\t\t//now confirm this is valid\n\t\t\tif (comboContentStyle.styles && comboContentStyle.headers && comboContentStyle.appliedStyles && comboContentStyle.hoverStyles)\n\t\t\t{\n\t\t\t\t//get styles\n\t\t\t\tvar styles = comboContentStyle.styles;\n\t\t\t\t//get max style\n\t\t\t\tvar maxStyles = styles.length;\n\t\t\t\t//now loop through it all (headers length == appliedStyles.length && hoverStyles.length)\n\t\t\t\tfor (i = 0, c = comboContentStyle.headers.length; i < c; i++)\n\t\t\t\t{\n\t\t\t\t\t//switch on the header\n\t\t\t\t\tswitch (Get_Number(comboContentStyle.headers[i], 0))\n\t\t\t\t\t{\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t//default content\n\t\t\t\t\t\t\ttheObject.Items[i].IsHeader = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t//this is a header\n\t\t\t\t\t\t\ttheObject.Items[i].IsHeader = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//get applied style index\n\t\t\t\t\tvar index = Get_Number(comboContentStyle.appliedStyles[i], -1);\n\t\t\t\t\t//set it\n\t\t\t\t\ttheObject.Items[i].AppliedStyle = index >= 0 && index < maxStyles ? styles[index] : null;\n\t\t\t\t\t//get hover style index\n\t\t\t\t\tindex = Get_Number(comboContentStyle.hoverStyles[i], -1);\n\t\t\t\t\t//set it\n\t\t\t\t\ttheObject.Items[i].HoverStyle = index >= 0 && index < maxStyles ? styles[index] : null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//want to sort content?\n\t\tif (Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_SORTED], false))\n\t\t{\n\t\t\t//sort it\n\t\t\ttheObject.Items.sort(function (a, b) { return a.Value.localeCompare(b.Value); });\n\t\t\t//now loop to reset top\n\t\t\tfor (i = 0, c = theObject.Items.length, nTop = 0; i < c; i++ , nTop += theObject.LineHeight)\n\t\t\t{\n\t\t\t\t//correct the top\n\t\t\t\ttheObject.Items[i].Top = nTop;\n\t\t\t}\n\t\t}\n\t\t//now create our scroll spacer\n\t\ttheObject.Spacer = theHTML.appendChild(document.createElement(\"div\"));\n\t\ttheObject.Spacer.id = \"ListBox_Spacer\";\n\t\ttheObject.Spacer.style.cssText = \"position:absolute;left:0px;top:0px;background-color:transparent;height:\" + theObject.Items.length * theObject.LineHeight + \"px;width:1px;\";\n\t}\n\t//finally update selection (will trigger refresh)\n\tListBox_UpdateSelection(theHTML, theObject);\n}", "function printListNetworks(networks) {\n logger(1, 'DEBUG: printing network list');\n var body = '<table><thead><tr><th>' + MESSAGES[92] + '</th><th>' + MESSAGES[19] + '</th><th>' + MESSAGES[95] + '</th><th>' + MESSAGES[97] + '</th><th>' + MESSAGES[99] + '</th></tr></thead><tbody>';\n $.each(networks, function (key, value) {\n if ( value['visibility'] == 1 ) {\n body += '<tr class=\"network' + value['id'] + '\"><td>' + value['id'] + '</td><td>' + value['name'] + '</td><td>' + value['type'] + '</td><td>' + value['count'] + '</td><td><a class=\"action-networkedit\" data-path=\"' + value['id'] + '\" data-name=\"' + value['name'] + '\" href=\"javascript:void(0)\" title=\"' + MESSAGES[71] + '\"><i class=\"glyphicon glyphicon-edit\"></i></a><a class=\"action-networkdelete\" data-path=\"' + value['id'] + '\" data-name=\"' + value['name'] + '\" href=\"javascript:void(0)\" title=\"' + MESSAGES[65] + '\"><i class=\"glyphicon glyphicon-trash\"></i></a></td></tr>';\n }\n });\n body = $(body);\n if ( ROLE == \"user\" || LOCK == 1 ) {\n body.find(\".action-networkedit,.action-networkdelete\").remove();\n }\n body = '<div class=\"table-responsive\"><table class=\"table\">' + body.html() + '</tbody></table></div>';\n addModalWide(MESSAGES[96], body, '');\n}", "function refreshDomObjects() {\n // must update this, as sometimes after finishing page load the position changes, like when dnn adds the toolbar\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].bodyOffset = Positioning.getBodyPosition();\n if (___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].config.innerBlocks.enable) {\n // get all content-block lists which are empty, or which allow multiple child-items\n var lists = Object(_interfaces_sxc_controller_in_page__WEBPACK_IMPORTED_MODULE_1__[\"$jq\"])(___WEBPACK_IMPORTED_MODULE_0__[\"QeSelectors\"].blocks.cb.listSelector).filter(\":not(.\" + ___WEBPACK_IMPORTED_MODULE_0__[\"QeSelectors\"].blocks.cb.singleItem + \"), :empty\");\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].contentBlocks = lists\n .find(___WEBPACK_IMPORTED_MODULE_0__[\"QeSelectors\"].blocks.cb.selector)\n .add(lists);\n }\n if (___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].config.modules.enable)\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].modules = ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].cachedPanes\n .find(___WEBPACK_IMPORTED_MODULE_0__[\"QeSelectors\"].blocks.mod.selector)\n .add(___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].cachedPanes);\n}", "createDefaultHTMLStructure() {\n const that = this,\n context = that.context,\n firstList = document.createElement('smart-drop-down-list'),\n operatorList = document.createElement('smart-drop-down-list'),\n secondList = document.createElement('smart-drop-down-list'),\n fragment = document.createDocumentFragment();\n\n firstList.classList.add('smart-filter-panel-list');\n firstList.dataSource = that.defaultListSource;\n firstList.selectedIndexes = [that.defaultListSelection];\n\n operatorList.classList.add('smart-filter-panel-operator-list');\n operatorList.dataSource = [{ value: 0, label: context.localize('and') }, { value: 1, label: context.localize('or') }];\n\n secondList.classList.add('smart-filter-panel-list');\n secondList.dataSource = that.defaultListSource;\n secondList.selectedIndexes = [that.defaultListSelection];\n\n that.firstList = firstList;\n that.logicalOperatorList = operatorList;\n that.secondList = secondList;\n\n that.appendInputs();\n that.firstInput.classList.add('smart-filter-panel-input');\n that.secondInput.classList.add('smart-filter-panel-input');\n\n operatorList.dropDownHeight = 'auto';\n operatorList.selectedIndexes = [0];\n\n [firstList, that.firstInput, operatorList, secondList, that.secondInput].forEach(function (element) {\n element.animation = context.animation;\n element.disabled = context.disabled;\n element.unfocusable = context.unfocusable;\n element.dropDownPosition = 'bottom';\n element.dropDownAppendTo = 'body';\n element.dropDownMaxHeight = 200;\n element.rightToLeft = context.rightToLeft;\n fragment.appendChild(element);\n });\n\n that.context.$.mainContainer.appendChild(fragment);\n that.cacheFilter(that.defaultListSelection, 0, that.defaultListSelection);\n }" ]
[ "0.5827435", "0.5647786", "0.5639772", "0.55595374", "0.5522421", "0.54525256", "0.5373643", "0.5274206", "0.5258011", "0.52563655", "0.5255725", "0.52402157", "0.5239843", "0.5203601", "0.51751214", "0.5164824", "0.51629835", "0.51415753", "0.51398903", "0.5106465", "0.5101456", "0.50826937", "0.5062334", "0.50580674", "0.50343084", "0.50260997", "0.50178736", "0.5009952", "0.4996646", "0.4989397", "0.49715504", "0.49701786", "0.49699825", "0.49632984", "0.49610245", "0.49581286", "0.49539292", "0.4950031", "0.49327233", "0.49257398", "0.49220172", "0.4921488", "0.49121535", "0.49078876", "0.49076518", "0.4907439", "0.4905288", "0.4899697", "0.48954576", "0.48846045", "0.48837137", "0.4878244", "0.48769638", "0.4874884", "0.4870775", "0.48661122", "0.48616308", "0.4860008", "0.48456576", "0.48448288", "0.48425284", "0.48409322", "0.4840927", "0.48338887", "0.4825301", "0.48227587", "0.48199117", "0.48175123", "0.48094475", "0.48087317", "0.48068717", "0.48046225", "0.47998482", "0.4795559", "0.4791185", "0.4789159", "0.47873923", "0.47855255", "0.47843394", "0.47842956", "0.47841665", "0.47743204", "0.47722128", "0.47692844", "0.47691438", "0.47682512", "0.47643882", "0.4763157", "0.47541717", "0.47530094", "0.47506666", "0.47470987", "0.4747048", "0.473966", "0.47387743", "0.4737718", "0.47346005", "0.47344357", "0.47336525", "0.4733437", "0.47297376" ]
0.0
-1
Display Tabs (settings, load graph, other)
function inputCheck(boolvar, idname) { return boolvar ? '<input type="checkbox" id="' + idname + '" value="' + idname + '" checked="checked"/>' : '<input type="checkbox" id="' + idname + '" value="' + idname + '"/>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display_tabs( tabs ) {\n var tabs_code = $(tabs);\n\n set_active_tab( tabs_code );\n preapare_tabs_interface( tabs_code );\n\n $('#app-table>header').empty();\n $('#app-table>header').append( tabs_code );\n }", "loadOneTab() { }", "function Tabs(category) {\n var category = category;\n\n // Create the tab structure\n function htmlCode(tab_labels, msg) {\n var keys = Object.keys(tab_labels).sort();\n // Add tab buttons\n var tabs = '<ul class=\"tab-list\">';\n for (var idx in keys) {\n var d = keys[idx];\n var label = category === 'switches' ? 'SW_' + tab_labels[d] : tab_labels[d];\n tabs += '<li class=\"tab-control\" data-tab=\"tab-' + tab_labels[d] + '\">' + label + '</li>';\n }\n tabs += '</ul>';\n\n for (var idx in keys) {\n var s = keys[idx]\n tabs += '<div class=\"tab-panel\" id=\"tab-' + tab_labels[s] + '\"><h1>' + msg + '</h1></div>';\n }\n return tabs;\n }\n\n /**\n * Set listeners to user events.\n */\n function listenToEvents() {\n // only one tab list is allowed per page\n $('.tab-list').on('click', '.tab-control', function () {\n //var tab_id = $(this).attr('data-tab');\n var tab_id = $(this).data('tab');\n\n $('.tab-control').removeClass('active');\n $('.tab-panel').removeClass('active');\n\n $(this).addClass('active');\n $(\"#\" + tab_id).addClass('active');\n\n // Save active tab per category\n saveInSession('activetab', '', tab_id);\n })\n }\n\n // Append HTML\n function buildTabs(parent, tab_labels, msg) {\n var html_code = htmlCode(tab_labels, msg)\n $(parent).empty().append(html_code);\n listenToEvents();\n }\n\n // Fill tab panel\n function buildContent(id, envelope) {\n envelope.children('.tableframe').each(function (i, v) {\n $(v).data('order', i);\n })\n var order_list = getFromSession('order', 'tab-' + id);\n if (order_list) {\n var $cards = envelope.children('.tableframe');\n if ($cards.length != order_list.length) {\n // pass, a table added/removed so we cannot use the previous order\n saveInSession(\"order\", null);\n } else {\n //var $clone = envelope.clone().empty();\n for (var i in order_list) {\n var $card = $cards.eq(order_list[i]).detach();\n envelope.append($card);\n }\n //envelope = $clone;\n }\n }\n $('#tab-' + id).empty().append(envelope);\n }\n\n // Set active tab\n function setActive() {\n $('.tab-control').removeClass('active');\n $('.tab-panel').removeClass('active');\n\n var tab_id = getFromSession('activetab', '');\n if (tab_id) { // Active tab has been saved\n var $first = $('[data-tab=' + tab_id + ']')\n $first.addClass('active');\n $(\"#\" + tab_id).addClass('active');\n } else { // No active tab saved\n var $first = $('.tab-control').first();\n //var tab_id = $first.attr('data-tab');\n var tab_id = $first.data('tab');\n $first.addClass('active');\n $(\"#\" + tab_id).addClass('active');\n saveInSession('activetab', '', tab_id);\n }\n }\n\n return {\n buildTabs: buildTabs,\n buildContent: buildContent,\n setActive: setActive\n };\n}", "function loadTabs() {\n\t\tvar htmlToAppend = '';\n\t\thtmlToAppend += '<ul class=\"nav nav-tabs\">';\n\t\t\n\t\tvar tabsMade = 0;\n\t\tfor(var i = 0; i <tuneJSON.tracks.length; i++) {//create the nav tabs for each nonempty track\n\t\t\tif(typeof tuneJSON.tracks[i].instrument !== 'undefined') {\n\t\t\t\tif(tabsMade === 0) {//if first tab add an active class to it\n\t\t\t\t\ttabsMade++;\n\t\t\t\t\thtmlToAppend +='<li class=\"active\"><a href=\"#track' + i +\n\t\t\t\t\t '\" data-toggle=\"tab\"><span class=\"instrument-name\">' + midiHelper.getInstrumentName(tuneJSON.tracks[i].instrument) + \n\t\t\t\t\t '</span></a></li>';\n\t\t\t\t} else {\n\t\t\t\t\thtmlToAppend += '<li role=\"presentation\"><a href=\"#track' + i + '\" role=\"tab\" data-toggle=\"tab\"><span class=\"instrument-name\">' +\n\t\t\t\t\tmidiHelper.getInstrumentName(tuneJSON.tracks[i].instrument) + \n\t\t\t\t\t'</span><button class=\"remove-tab-button\" id=\"remove-tab' + i + '\"><span class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></span></button></a></li>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\thtmlToAppend += '</ul><div class=\"tab-content\">';\n\t\t//now add the tab panels\n\t\t\n\t\ttabsMade = 0;\n\n\t\tfor(var i = 0; i <tuneJSON.tracks.length; i++) {//create the tab pane for each nonempty track\n\t\t\tif(typeof tuneJSON.tracks[i].instrument !== 'undefined') {\n\t\t\t\tif(tabsMade === 0) {\n\t\t\t\t\thtmlToAppend += '<div class=\"tab-pane active\" id=\"track' + i +'\"></div>';\n\t\t\t\t\ttabsMade++;\n\t\t\t\t} else {\n\t\t\t\t\thtmlToAppend+= '<div class=\"tab-pane\" id=\"track' + i +'\"></div>';\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\thtmlToAppend += '</div>';\n\t\t$('.canvas').append(htmlToAppend);\n\n\t\t$('.remove-tab-button').click(function() {//add remove event to delete button\n\t\t\tdeleteInstrument(parseInt($(this).attr('id').substring(10), 10));//get index of track\n\t\t});\n\t\t\n\t}", "function onClickTab(tab) {\n if (d3.select(\"#tab_\"+tab).classed(\"active\")) { return; }\n active_tab = tab;\n // hide all tab_content\n d3.selectAll(\".tab_content\").style(\"display\", \"none\");\n // show selected tab_content\n d3.select(\"#div_\"+tab).style(\"display\", \"unset\");\n // mark tab as selected\n d3.selectAll(\".tab\").classed(\"active\", false);\n d3.select(\"#tab_\"+tab).classed(\"active\", true);\n drawgraphs();\n}", "function openGraph(evt, graphName) {\n var i, tabcontent, tablinks\n tabcontent = document.getElementsByClassName(\"tabcontent\")\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\"\n }\n tablinks = document.getElementsByClassName(\"tablinks\")\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\")\n }\n document.getElementById(graphName).style.display = \"block\"\n evt.currentTarget.className += \" active\"\n}", "function showMyAuctionTab()\r\n{\r\n\r\n\tvar open=getTabIndexByTitle('My Auction');\r\n\tif (open<0)// if the tab is not open yet\r\n\t{\t\r\n\t\tvar aTab= createMyAuctionTab('tabPanel','My Auction', true);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tshowTab('tabPanel',open[1]);\r\n\t}\r\n}", "function draw_tabs() {\n // Get tab area\n var tabX = 0;\n var tabY = display.getHeight() - 4;\n var tabW = display.getWidth();\n var tabH = 4;\n\n // Draw the red area\n display.fill(tabX, tabY, tabW, tabH, \"white\", \"red\", ' ');\n\n // Draw instruction text\n display.text(tabX + Math.floor(tabW / 2) - 7, tabY + 1, \"Press <TAB> to\");\n display.text(tabX + Math.floor(tabW / 2) - 10, tabY + 2, \"switch between panes.\");\n\n // Width tab\n display.text(tabX + 2, tabY + 1, \" WIDTH \", 'red', 'white');\n if (tabSelected === 0) {\n display.fill(tabX + 2, tabY + 2, 11, 1, 'red', 'white', ' ');\n }\n display.text(tabX + 6, tabY + 2, etch.getWidth().toString());\n // Height tab\n display.text(tabX + 15, tabY + 1, \" HEIGHT \", 'red', 'white');\n if (tabSelected === 1) {\n display.fill(tabX + 15, tabY + 2, 11, 1, 'red', 'white', ' ');\n }\n display.text(tabX + 19, tabY + 2, etch.getHeight().toString());\n // Clear tab\n display.text(tabX + tabW - 26, tabY + 1, \" CLEAR \", 'red', 'white');\n if (tabSelected === 2) {\n display.text(tabX + tabW - 26, tabY + 2, \" [ENTER] \", 'red', 'white');\n }\n // Exit tab\n display.text(tabX + tabW - 13, tabY + 1, \" EXIT \", 'red', 'white');\n if (tabSelected === 3) {\n display.text(tabX + tabW - 13, tabY + 2, \" [ENTER] \", 'red', 'white');\n }\n}", "function getView(content){\n $('#tabView').html(content);\n $('#tabViewLink').css(\"display\",\"block\");\n $('.nav-tabs li:eq(1) a').tab('show');\n}", "function opentab(tab){\n let tabcontent = $(\".tabcontents\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n $(\"#\"+tab+\"tab\").css(\"display\", \"block\");\n if(tab!=\"options\"){\n $(\"#exportfailsave\").css(\"display\", \"none\")\n }\n}", "function tab(tab) {\n\tif ($.inArray(tab, availableTabs) == -1) {\n\t\tconsole.log(\"invalid tab. Please update your available tabs\");\n\t} else {\n\t\tvar arrayLength = availableTabs.length;\n\t\tfor (var i = 0; i < arrayLength; i++) {\n\t\t\t//maybe have problems where tab doesn't exist\n\t\t $(\"#\"+availableTabs[i] + 'Content').hide(); \n\t\t $(\"#\"+availableTabs[i] + 'Content').css({'class': ''});\n\t\t $(\"#\"+availableTabs[i]).css({'background': 'rgb(0, 45, 60)'});\n\t\t}\n\t\t$(\"#\" + tab + 'Content').show();\n\t\t$(\"#\" + tab + 'Content').css({'class': 'active'});\n\t\tactiveTab = tab;\n\t\t$(\"#\" + tab).css({'background': 'rgb(67, 153, 152)'});\n\t\tif ($.inArray(tab, loadedTabs) == -1) {\n\t\t\tloadTab(activeTab);\n\t\t}\n\t\tif (window.mobilecheck()) {\n\t\t\tlayoutMobileMasonry(activeTab + 'Grid');\n\t\t} else {\n\t\t\tlayoutMasonry(activeTab + 'Grid');\n\t\t}\n\t}\n}", "function changeTab (activeTab, activeComp, activeChart) {\n /* allows you to leave opening info page */\n $('#opening-info').click(function() {\n changePage('#opening-code');\n $('.navbar').hide();\n });\n\n $('#home-tab').click(function() {\n $(activeTab).removeClass('nav-item-active');\n activeTab = '#home-tab';\n $(activeTab).addClass('nav-item-active');\n changePage('#main');\n });\n\n /* this deals with clicking the save money button on home page */\n $('#save-button').click(function() {\n changePage('#save-money');\n });\n\n $('#comparisons-tab').click(function() {\n $(activeTab).removeClass('nav-item-active');\n activeTab = '#comparisons-tab';\n $(activeTab).addClass('nav-item-active');\n if (activeComp == '.to-fb') {\n changePage('#comp-fb');\n } else if (activeComp == '.to-reg') {\n changePage('#comp-reg');\n } else {\n changePage('#comp-you');\n }\n });\n\n $('#statistics-tab').click(function() {\n $(activeTab).removeClass('nav-item-active');\n activeTab = '#statistics-tab';\n $(activeTab).addClass('nav-item-active');\n if (activeChart == '.to-cost') {\n changePage('#charts-cost');\n } else if (activeChart == '.to-energy') {\n changePage('#charts-energy');\n } else if (activeChart == '.to-temp') {\n changePage('#charts-temp');\n } else {\n changePage('#charts-goals');\n }\n });\n\n /* this deals with the different settings pages */\n $('#settings-tab').click(function() {\n $(activeTab).removeClass('nav-item-active');\n activeTab = '#settings-tab';\n $(activeTab).addClass('nav-item-active');\n changePage('#settings');\n });\n\n $('#settings-to-thermo').click(function() {\n changePage('#settings-thermo');\n $('.change-code-info').hide();\n $('#change-code-general').show();\n });\n\n $('#settings-to-house').click(function() {\n changePage('#settings-house');\n });\n\n $('#settings-to-fb').click(function() {\n changePage('#settings-fb');\n });\n\n $('#settings-to-custom').click(function() {\n changePage('#settings-custom');\n });\n\n $('#settings-to-support').click(function() {\n changePage('#settings-support');\n });\n\n $('.settings-return').click(function() {\n changePage('#settings');\n });\n\n /* deals with the toggle on fb settings page */\n $('#settings-fb-share').click(function() {\n if ($('#settings-fb-toggle').hasClass('fa-toggle-on')) {\n $('#settings-fb-toggle').removeClass('fa-toggle-on');\n $('#settings-fb-toggle').addClass('fa-toggle-off');\n $('#settings-fb-toggle').css('color', '#000');\n } else {\n $('#settings-fb-toggle').removeClass('fa-toggle-off');\n $('#settings-fb-toggle').addClass('fa-toggle-on');\n $('#settings-fb-toggle').css('color', '#1b9af7');\n }\n });\n\n /* this is for the circle nav in the competitions page */\n $('.to-fb').click(function() {\n $(activeComp).removeClass('nav-item-active');\n activeComp = '.to-fb';\n $(activeComp).addClass('nav-item-active');\n changePage('#comp-fb');\n });\n\n $('.to-reg').click(function() {\n $(activeComp).removeClass('nav-item-active');\n activeComp = '.to-reg';\n $(activeComp).addClass('nav-item-active');\n changePage('#comp-reg');\n });\n\n $('.to-you').click(function() {\n $(activeComp).removeClass('nav-item-active');\n activeComp = '.to-you';\n $(activeComp).addClass('nav-item-active');\n changePage('#comp-you');\n });\n\n /* this is for the circle nav in the charts page */\n $('.to-cost').click(function() {\n $(activeChart).removeClass('nav-item-active');\n activeChart = '.to-cost';\n $(activeChart).addClass('nav-item-active');\n changePage('#charts-cost');\n });\n\n $('.to-energy').click(function() {\n $(activeChart).removeClass('nav-item-active');\n activeChart = '.to-energy';\n $(activeChart).addClass('nav-item-active');\n changePage('#charts-energy');\n });\n\n $('.to-temp').click(function() {\n $(activeChart).removeClass('nav-item-active');\n activeChart = '.to-temp';\n $(activeChart).addClass('nav-item-active');\n changePage('#charts-temp');\n });\n\n $('.to-goals').click(function() {\n $(activeChart).removeClass('nav-item-active');\n activeChart = '.to-goals';\n $(activeChart).addClass('nav-item-active');\n changePage('#charts-goals');\n });\n}", "function change_tab(clicked_tab){\n\n if (clicked_tab.id === \"tab_1\"){\n currentPage = \"EPG\";\n showEPG();\n } else if (clicked_tab.id === \"tab_2\"){\n // it's the settings tab -> we need to show the user the current resolution\n showResolution();\n }\n else\n {\n currentPage = \"Not EPG page\";\n }\n\n //close all open_tabs and open_panels\n var open_tabs = document.getElementsByClassName('open_tab');\n for(var i = 0; i < open_tabs.length; i++){\n open_tabs[i].className = '';\n }\n\n var open_panels = document.getElementsByClassName('open_panel');\n for(var i = 0; i < open_panels.length; i++){\n open_panels[i].className = 'closed_panel';\n }\n\n //open tab and panel\n document.getElementById(clicked_tab.id).className = 'open_tab';\n var clicked_tab_nr = clicked_tab.id.charAt(clicked_tab.id.length - 1);\n var panel_id_string = \"panel_\" + clicked_tab_nr;\n document.getElementById(panel_id_string).className = \"open_panel\";\n}", "display()\n {\n $(this.element).html(`\n <link rel=\"stylesheet\" href=\"views/tab-view/tab-view.css\">\n <link rel=\"stylesheet\" href=\"views/tab-content/tab-content.css\">\n <link rel=\"stylesheet\" href=\"views/list-tasks/list-tasks.css\">\n <link rel=\"stylesheet\" href=\"views/diagram-view/diagram-view.css\">\n\n <ul id=\"tabs\">\n </ul>\n <div id=\"tab-content\"></div>\n `);\n\n this.ulTabs = document.getElementById('tabs');\n this.divsContent = document.getElementById('tab-content');\n\n //adapt the height of the div to the full width\n $(window).resize(function()\n {\n $('#tab-content').height($('#tab-content').parent().height() - $('#tabs').height());\n });\n\n $(document).ready(function()\n {\n $(window).trigger('resize');\n });\n }", "function cp_tab_control() {\n\tvar tabs = [];\n\tvar tabContainers = [];\n\tjQuery('ul.tabnavig a').each(function() {\n\t\tif ( window.location.pathname.match(this.pathname) ) {\n\t\t\ttabs.push(this);\n\t\t\ttabContainers.push( jQuery(this.hash).get(0) );\n\t\t}\n\t});\n\n\t//hide all contrainers except execpt for the one from the URL hash or the first container\n\tif ( window.location.hash !== \"\" && window.location.hash.search('block') >= 0 ) {\n\t\tjQuery(tabContainers).hide().filter(window.location.hash).show();\n\t\t//detecting <a> tab using its \"href\" which should always equal the hash\n\t\tjQuery(tabs).filter( function(index) {\n\t\t\treturn ( jQuery(this).attr('href') === window.location.hash );\n\t\t}).addClass('selected');\n\t\tjQuery('html').scrollTop( jQuery(window.location.hash).parent().position().top );\n\t} else {\n\t\tjQuery(tabContainers).hide().filter(':first').show();\n\t\tjQuery(tabs).filter(':first').addClass('selected');\n\t}\n\n\tjQuery(tabs).click(function() {\n\t\t// hide all tabs\n\t\tjQuery(tabContainers).hide().filter(this.hash).fadeIn(100);\n\t\tjQuery(tabs).removeClass('selected');\n\t\tjQuery(this).addClass('selected');\n\t\treturn false;\n\t});\n}", "function tabSystem() {\n //define the variables\n const $wrapper = $('.tab-container'),\n $allTabs = $('.tab-inhalt > div'),\n $tabMenu = $('.tab-auswahl li')\n\n //hide tabs-content that are not the first tab\n $allTabs.not(':first-of-type').hide()\n\n //for every tab, assign a data attribute to the li (itterate)\n $tabMenu.each(function(i) {\n $(this).attr('data-tab', 'tab' + i)\n })\n\n //now do the same for the tabs themselves (the content)\n $allTabs.each(function(i) {\n $(this).attr('data-tab', 'tab' + i)\n })\n\n //when we click one of the tabs:\n $tabMenu.on('click', function() {\n const dataTab = $(this).data('tab'),\n $getWrapper = $(this).closest($wrapper)\n\n //we remove the active class of all tabs, add it to the one we clicked\n $getWrapper.find($tabMenu).removeClass('active')\n $(this).addClass('active')\n\n //we hide all the tabs\n $getWrapper.find($allTabs).hide()\n // show the tab which was clicked using the data attribute of the clicked menu\n $getWrapper.find($allTabs).filter(`[data-tab=\"${dataTab}\"]`).show()\n })\n\n }", "function tabs(evt, tabName) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n document.getElementById(\"defaultOpen\").click();\n}", "function pageTabs_helm_set(mode) {\n\n var defaultTab = \"\";\n\n if (mode === \"loanDetails\") {\n $(\"#RecentlyViewedTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#LoanDetailsTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#AuditTrackingTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#AdvancedSearchTab_helm\").toggleClass(\"displayNone\", true);\n defaultTab = \"LoanDetailsTab_helm\";\n } else if (mode === \"search\") {\n $(\"#RecentlyViewedTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#AdvancedSearchTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#LoanDetailsTab_helm\").toggleClass(\"displayNone\", true);\n $(\"#AuditTrackingTab_helm\").toggleClass(\"displayNone\", true);\n defaultTab = \"AdvancedSearchTab_helm\";\n }\n else if (mode === \"recentlyViewedMinimized\") {\n //only show recently viewed tab and disable the tab selected appearance and give it a neutral look.\n $(\"#RecentlyViewedTab_helm\").toggleClass(\"displayNone\", false).toggleClass(\"ui-state-active\", false);\n $(\"#AdvancedSearchTab_helm\").toggleClass(\"displayNone\", true);\n $(\"#LoanDetailsTab_helm\").toggleClass(\"displayNone\", true);\n $(\"#AuditTrackingTab_helm\").toggleClass(\"displayNone\", true);\n }\n helm.ActiveTabId = defaultTab; //store the active tab in js property that will be accessible to other functions\n\n var $helmTabs = $(\"#Tabs_helm\");\n $helmTabs.tabs({\n // //active: Compass.Utils.jQueryTabs_GetTabIndex(defaultTab, \"Tabs_helm\"), //Activate Loan Details Tab\n // //beforeActivate: optimizeIE7Rendering,\n activate: jQueryTabs_TabSelect\n });\n\n //set active jquery page tab to helm default tab.\n var activeTabIndex = Compass.Utils.jQueryTabs_GetTabIndex(defaultTab, \"Tabs_helm\");\n $helmTabs.tabs({ active: activeTabIndex });\n $(\"#Tabs_HtmlList_helm\").toggleClass(\"displayNone\", false);\n \n // All Tab Content Area Div's had to be hidden initially otherwise\n // the screen would jumble around during rendering until the jquery \n // page tabs could be intialized. Unhide the tab content with this next line of code.\n $(\".jqPageTabsContent_helm\").toggleClass(\"displayNone\", false);\n }", "function addTab(title) {\n var tab_title = (title.length==0)?'Graph '+tab_counter:title;\n var panelId = 'graphTab'+tab_counter++;\n\n var tabsLength = $(common.mustache(templates.graphTab, {\n title: tab_title,\n href: panelId\n }))\n .appendTo($graphTabs.find('.ui-tabs-nav'))\n .find('li').length;\n $graphTabs.append(common.mustache(templates.graphDiv, {\n panelId: panelId\n }));\n $graphTabs\n .tabs(\"refresh\")\n .tabs( \"option\", \"active\", tabsLength-1)\n .find('li.graph-tab span.ui-icon-close').off().click(removeTab);\n\n //this causes problem when deleting tabs\n $graphTabs.find( \".ui-tabs-nav\" ).sortable({ axis: \"x\", distance: 10 });\n $(\".ui-tabs-selected a\").each(function(){$(this).attr(\"title\", $(this).html())});\n resizeCanvas();\n\n //in revised layout, show only if graph tabs and search tables are shown $(\"#show-hide-pickers\").show();\n $('#graph-tabs a:last').click(function(){\n hideGraphEditor()\n });\n return panelId;\n}", "function display_statistic(country_hash, gender_hash, friends_hash, emotion_hash) {\n\n var statistic_tabs = document.getElementById(\"statistics\");\n\n var pie_chart = document.getElementById(\"pie\");\n\n $(\"#statistics\").tabs();\n\n // Default selection\n var Hometowntab = document.getElementById(\"HomeTown\");\n Hometowntab.appendChild(pie_chart);\n statistic_tabs.appendChild(Hometowntab);\n drawChart(country_hash, \"Where are your friends from?\");\n\n $(\"#statistics a[href=#HomeTown]\").click(function()\n {\n var Hometowntab = document.getElementById(\"HomeTown\");\n Hometowntab.appendChild(pie_chart);\n statistic_tabs.appendChild(Hometowntab);\n drawChart(country_hash, \"Where are your friends from?\");\n });\n\n $(\"#statistics a[href=#Gender]\").click(function()\n {\n var Gendertab = document.getElementById(\"Gender\");\n Gendertab.appendChild(pie_chart);\n statistic_tabs.appendChild(Gendertab);\n drawChart(gender_hash, \"what is the sex ratio of your friends?\");\n });\n\n $(\"#statistics a[href=#Relationship]\").click(function()\n {\n var Relationshiptab = document.getElementById(\"Relationship\");\n Relationshiptab.appendChild(pie_chart);\n statistic_tabs.appendChild(Relationshiptab);\n drawChart(friends_hash, \"How are they related to you?\");\n });\n\n $(\"#statistics a[href=#Emotion]\").click(function()\n {\n var Emotiontab = document.getElementById(\"Emotion\");\n Emotiontab.appendChild(pie_chart);\n statistic_tabs.appendChild(Emotiontab);\n drawChart(emotion_hash, \"How is their reaction to your picture?\");\n });\n}", "function showFriendTab()\r\n{\r\n\t\r\n\tvar open=getTabIndexByTitle('My Friends');\r\n\tif (open<0)// if the tab is not open yet\r\n\t{\t\r\n\t\tvar aTab= createFriendTab('tabPanel','My Friends', true);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tshowTab('tabPanel',open[1]);\r\n\t}\r\n}", "function openTab (builder, map) {\n\n d3_select('#tab_container').style('display', 'block')\n\n d3_select('#reaction_tab_button').style('background-color', 'lightgrey')\n d3_select('#metabolite_tab_button').style('background-color', 'lightgrey')\n d3_select('#both_tab_button').style('background-color', 'lightgrey')\n\n var tabs = document.getElementsByClassName('tab')\n\n for (var i = 0; i < tabs.length; i++) {\n tabs[i].style.display = 'none'\n }\n\n if (builder.type_of_data === 'reaction') {\n d3_select('#reaction_tab_button').style('background-color', 'white')\n update(builder, builder.map)\n } else if (builder.type_of_data === 'gene') {\n d3_select('#reaction_tab_button').style('background-color', 'white')\n update(builder, builder.map)\n } else if (builder.type_of_data === 'metabolite') {\n d3_select('#metabolite_tab_button').style('background-color', 'white')\n update(builder, builder.map)\n }\n\n}", "function setLayout() {\n\t// Create title page\n\tvar p = document.createElement(\"p\");\n\tp.innerHTML = \"One particle in static electric and \" +\n\t\t\"magnetic field\";\n\tp.style.fontWeight = \"bold\";\n\tdocument.body.append(p);\n\n\t// Define first Tabs\n\ttabs1 = new Tabs(\"tabs1\");\n\ttabs1.setWidth(\"450px\");\n\ttabs1.setHeight(\"240px\");\n\ttabs1.addTab(\"Log\", 0);\n\ttabs1.addTab(\"Params\", 0);\n\ttabs1.addTab(\"Results\", 0);\n\t\n\t// Define second Tabs\n\ttabs2 = new Tabs(\"tabs2\");\n\ttabs2.setWidth(\"300px\");\n\ttabs2.setHeight(\"300px\");\n\ttabs2.addTab(\"xy\", 1);\n\ttabs2.addTab(\"yz\", 1);\n\ttabs2.addTab(\"xz\", 1);\n\ttabs2.addTab(\"xyz\", 1);\n\t\n\t// Clear all tabs\n\ttabs1.text(\"Params\").clear();\n\ttabs1.text(\"Results\").clear();\n\ttabs1.text(\"Log\").clear();\n\ttabs2.graphic(\"xy\").clear();\n\ttabs2.graphic(\"yz\").clear();\n\ttabs2.graphic(\"xz\").clear();\n\ttabs2.graphic(\"xyz\").clear();\n\n\t// Define bgroup\n\tbgroup = new Bgroup(\"bgroup\");\n\tbgroup.setWidth(\"60px\");\n\tbgroup.setHeight(\"147px\");\n\tbgroup.addButton(\"Clear\");\n\tbgroup.addButton(\"Load\");\n\tbgroup.addButton(\"Read\");\n\tbgroup.addButton(\"Start\");\n\tbgroup.addButton(\"Draw\");\n\tbgroup.addButton(\"Help\");\n\tbgroup.addButton(\"About\");\n\tbgroup.disable(\"Read\");\n\tbgroup.disable(\"Start\");\n\tbgroup.disable(\"Draw\");\n}", "function activaTab(tab){\n $('.nav-tabs-chart-selector a[href=\"#' + tab + '\"]').tab('show');\n }", "function showGraphs() {\n\t\tshowdone = 0;\n\t\tshowOneGraph(1);\n\t\tshowOneGraph(2);\n\t\tshowOneGraph(3);\n\t}", "function ConfigureTabs() {\n\n // hide/show pricing tab\n var priceTab = $find(tabStripId).findTabByValue(\"pricing\");\n var accountsTab = $find(tabStripId).findTabByValue(\"accounting\");\n if (GetRegTypeValue() == \"Fee\") {\n priceTab.set_enabled(true);\n accountsTab.set_enabled(true);\n } else {\n priceTab.set_enabled(false);\n accountsTab.set_enabled(false);\n }\n }", "async function tab(tab) {\n setLoading(true);\n setActiveTab(tab);\n setSecondTab(\"results\");\n setActiveTest(\"\");\n setPatientSelected(null);\n if (tab == \"new\") {\n setPatient(null);\n var result = await client.postApi(`${endpoints.user.getPatients}`, null, true);\n if (result.statusCode === 200) {\n setPatient(result.response);\n setLoading(false);\n } else {\n setLoading(false);\n }\n } else {\n setLoading(false);\n }\n }", "function drawChartOnTab(data){ // draw in the current active tab\n if(data !== null){\n resizeContent(); // adjust size: chart content and table content\n var href = $(\".tabs\").find(\"a.active\").attr(\"href\");\n if(href === '#stat-chart'){\n drawChartBar(data); // bar\n }else if(href === '#stat-table'){\n drawChartTable(data); // table\n }\n }\n }", "function openSettingsTab(evt, tabName) {\n var i;\n var x = document.getElementsByClassName(\"settingstab\");\n for (i = 0; i < x.length; i++) {\n x[i].style.display = \"none\";\n }\n var tablinks = document.getElementsByClassName(\"settingstablink\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" w3-dark-grey\", \"\");\n }\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" w3-dark-grey\";\n}", "allTabs() {\n return [\n [\"Intro\", this.renderIntroTab()],\n [\"Globals\", this.renderGlobalsTab()],\n [\"Basic Interventions\", this.renderBasicsTab()],\n [\"Far Future\", this.renderFarFutureTab()],\n [\"Veg Advocacy\", this.renderVegTab()],\n [\"Cage Free\", this.renderCageFreeTab()],\n [\"AI Safety\", this.renderAISafetyTab()],\n [\"Targeted Values Spreading\", this.renderTargetedValuesSpreadingTab()],\n ]\n }", "function displayMode(evt, mode) {\n var i, tabcontent, tablinks;\n document.getElementById(\"OUTPUT\").innerHTML = \"\";\n this.output_displayed = false;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(mode).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n\n}", "function IMcTabsConfig() { }", "function ShowTab1(obj){\n $(obj).addClass('active1');\n $(\"#tab1_info\").addClass('d-block');\n\n //color reset of tabs\n $(\"#t2\").removeClass(\"active2\");\n $(\"#t3\").removeClass(\"active3\");\n $(\"#t4\").removeClass(\"active4\");\n\n //hide show information\n $(\"#tab2_info\").removeClass('d-block');\n $(\"#tab3_info\").removeClass('d-block');\n $(\"#tab4_info\").removeClass('d-block');\n \n //hide information\n $(\"#tab2_info\").addClass('d-none');\n $(\"#tab3_info\").addClass('d-none');\n $(\"#tab4_info\").addClass('d-none');\n\n }", "setTabProperties() { }", "function updateTab (tabs) {\n if (tabs[0]) {\n currentTab = tabs[0]\n let currentURL = currentTab.url\n if (!isValidURL(currentURL)) {\n hideIcon()\n } else {\n getOptions()\n .then(updateStatus)\n .then(updateUI)\n }\n }\n}", "function initTabs() {\n jQuery(\".product-comparison-tabset\").tabset({\n tabLinks: \"a\",\n addToParent: !0,\n defaultTab: !0\n });\n}", "function showTab(tabData) {\n $('.tab__title').html(objAjax[tabData - 1].name + '<br/>');\n $('.name-service>span').text(objAjax[tabData - 1].name.toUpperCase());\n $('.tab-body').empty();\n var tr;\n var employees = objAjax[tabData - 1].employees;\n\n for (var i = 0; i < employees.length; ++i) {\n tr = $('<tr/>');\n var employee = employees[i];\n tr.append('<td class=\"employee\">' + employee.employeeName + '</td>');\n tr.append('<td class=\"price\">' + employee.price + '</td>');\n tr.append('<td class=\"price\">' + employee.commonPrice + '</td>');\n $('.tab-body').append(tr);\n }\n\n descriptionTitle = '<h3>' + objAjax[tabData - 1].name + '</h3>';\n description = '<p>' + objAjax[tabData - 1].description + '</p>';\n descriptionPs = '<p>' + objAjax[tabData - 1].descriptionPs + '</p>';\n $('.description-tab').html(descriptionTitle + description + descriptionPs);\n }", "function displayStat(tabname) {\n\t\t\n\t\tvar area = document.getElementById(\"selection\" + tabname).value;\n\t\tdocument.getElementById(\"statisticsAreaToAppear\" + tabname).style.display=\"none\";\n\t\tif (document.getElementById(\"selection\" + tabname).value != \"\") {\n\t\t\tdocument.getElementById('loading_img_' + tabname).style.display = \"\";\n\t\t\tjQuery('#' + tabname + 'Table').html(\"\");\n\t\t\t\n\t\t\tif(navigator.onLine){\n\t\t\t\tjQuery.getJSON(\"myjson/stat?area=\" + area + \"&tabname=\" + tabname, function(data){\n\t\t\t\t\tdisplayStatPage(data,tabname);\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\tvar retrievedObject = JSON.parse(localStorage.getItem(\"myjson/stat?area=\" + area + \"&tabname=\" + tabname));\n\t\t\t\tif(retrievedObject != null){\n\t\t\t\t\tdisplayStatPage(retrievedObject,tabname);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tvar selectedOption = document.getElementById(\"selection\" + tabname).options[document.getElementById(\"selection\" +tabname).selectedIndex];\n\t\t\tdocument.getElementById(\"areaName\" + tabname).innerHTML = selectedOption.text;\n\t\t\tsetTimeout(function(){\n\t\t\t\tdocument.getElementById('loading_img_' +tabname).style.display = \"none\";\n\t\t\t\tdocument.getElementById(\"statisticsAreaToAppear\" + tabname).style.display = \"\";\n\t\t\t}, 1000);\n\t\t\t\n\t\t}\n\t}", "renderTabs() {\n return (\n <Tabs defaultActiveKey={1} id=\"tab\" >\n <Tab eventKey={1} title=\"Projects\">\n {this.renderProjs()}\n </Tab>\n <Tab eventKey={2} title=\"Users\">\n {this.renderUsers()}\n </Tab>\n <Tab eventKey={3} title=\"Search\">\n {this.renderSearch()}\n <ListGroup><br /><br />\n {this.renderResult()}\n </ListGroup>\n </Tab>\n </Tabs>\n );\n }", "function Tabs(props){\n const allTabs = ['synopsis', 'cast', 'episodes', 'related'];\n const tabNames = ['Story', 'Cast', 'Eps.', 'Related'];\n\n const tabs = allTabs.map((tab, index) => {\n const load = (tab === 'synopsis' ? null : 'MAL'); // Whether to load MAL or not\n const onTab = props.currentTab === tab // See if it's on\n const className = `tab-${tab} ` + (onTab ? 'on' : null); // If on, add \"on\"\n\n return(<div key={tab} className={className} onClick={() => props.handleTab(tab, load)}> {tabNames[index]}</div>)\n });\n\n return(\n <div className=\"window-tabs\">\n {tabs}\n </div>\n )\n }", "function showNewAuctionTab()\r\n{\r\n\t\tvar open=getTabIndexByTitle('New Auction');\r\n\t\tif (open<0)// if the tab is not open yet\r\n\t\t{\r\n\t\t\tcreateNewTab('tabPanel','New Auction','','createAuctionTable.jsp',true);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tshowTab('tabPanel',open[1]);\r\n\t\t}\r\n\t\r\n}", "function setUpTabs() {\n var divs = document.getElementsByTagName('div');\n var tabCount = 0;\n for (var i = 0; i < divs.length; i++) {\n if (divs[i].className == 'name') {\n tabs.addTab(divs[i]);\n } else if (divs[i].className == 'content') {\n tabs.addPanel(divs[i]);\n divs[i].style.display = 'none';\n \n }\n }\n tabs.showPanel(0);\n zoomFactor=.9;\n document.getElementById('img1').src=servername+tmapname+\".png\";\n document.getElementById('img2').src=servername+tmapname+\"fed.png\";\n makeDraggable('img1');\n tmapObject=\"img1\";\n setFull('layer2');\n setFull('layer1');\n}", "function options(evt, opName) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(opName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function changeData(tab) {\n\ttab1 = document.getElementById('ContactInfo');\n\ttab2 = document.getElementById('About');\n\ttab3 = document.getElementById('People');\n\n\tif(tab == 1) {\n\t\ttab2.style.display = \"none\";\n\t\ttab3.style.display = \"none\";\n\t\ttab1.style.display = \"block\";\n\t} else if(tab == 2) {\n\t\ttab1.style.display = \"none\";\n\t\ttab3.style.display = \"none\";\n\t\ttab2.style.display = \"block\";\n\t} else {\n\t\ttab2.style.display = \"none\";\n\t\ttab1.style.display = \"none\";\n\t\ttab3.style.display = \"block\";\n\t}\n}", "function changeTab(){\n\n\t// Hide all tabs\n\tfor( var i=0; i<allSections.length; i++){\n\t\tallSections[i].style.display = \"none\";\n\n\n\t}\n\n\t//Switch based on the id of the button clicked\n\tswitch( this.id ){\n\n\t\tcase \"button-one\":\n\t\t\tallSections[0].style.display = \"block\";\n\t\tbreak;\n\n\t\tcase \"button-two\":\n\t\t\tallSections[1].style.display = \"block\";\n\n\t\tbreak;\n\n\t\tcase \"button-three\":\n\t\t\tallSections[2].style.display = \"block\";\n\n\t\tbreak;\n\n\t\tcase \"button-four\":\n\t\t\tallSections[3].style.display = \"block\";\n\n\t\tbreak;\n\n\t\tcase \"button-five\":\n\t\t\tallSections[4].style.display = \"block\";\n\n\t\tbreak;\n\n\t}\n\n\n\n}", "function navGraph(){\r\n document.getElementById(\"card-container\").style.display = 'none';\r\n document.getElementById(\"settings\").style.display = 'none';\r\n document.getElementById(\"chart-container\").style.display = 'block';\r\n document.getElementById(\"runButton\").style.marginTop = \"5%\";\r\n document.getElementById(\"killButton\").style.marginTop = \"5%\";\r\n document.getElementById(\"runButton\").innerText = 'RETURN HOME';\r\n}", "function initDisplay(){\n ns.stateString = '';\n\n const selectedTabQueryParamMatches = location.search.match(/\\bselectedTab=([^&]+)/);\n const selectedTab = selectedTabQueryParamMatches ? selectedTabQueryParamMatches[1] : undefined;\n\n // it doesn't make sense for this to be in util\n wdk.util.showLoading();\n fetchStrategies(_.partial(updateStrategies, _, _, _, _, selectedTab));\n }", "function refreshCurrentTab() {\r\n chartAnimationReady = true;\r\n showTab(currentPage, true);\r\n}", "function initDashboard() {\n\n // the 'layout' JSON array defines the internal structure of the layout\n // The sequence is always layoutGroup --> tabbedGroup --> layoutPanel\n // The layoutGroup has the orientation which tells whether to add child tabs (panels) in\n // verticle fashion or hoizontal fashion.\n var layout = [\n {\n // Main panel\n type: \"layoutGroup\",\n // Horrizontal orientation determines the layout of city search panel groups and the weather data panel groups\n orientation: \"horizontal\",\n width: \"100%\",\n height: \"100%\",\n items: [\n {\n // Search city panel group: Left parent panel (layout-group) that holds all tabs in left side of the splitter\n type: \"layoutGroup\",\n // Actually the orientation=verticle is not required as there is only one panel in this.items[]\n orientation: \"vertical\",\n allowPin: false,\n width: \"30%\",\n items: [\n {\n // 1st and the only Tab panel for 'Search City'\n type: \"tabbedGroup\",\n height: \"100%\",\n pinnedHeight: 30,\n items: [\n {\n // Layout pannel for the 'Search City' tab\n type: \"layoutPanel\",\n title: \"Search for a City\",\n contentContainer: \"SearchCityPanel\",\n initContent: function () {\n initCitiesTable();\n },\n },\n ],\n },\n ],\n },\n {\n // Weather data panel group: Right parent panel (layout-group) for displaying weather details\n type: \"layoutGroup\",\n // The orientation: \"vertical\" here ensures the Today's weather panel and the forecast panel are \n // laid out vertically - one above and one below \n orientation: \"vertical\",\n allowPin: false,\n width: \"70%\",\n items: [\n {\n // Tab group for today's weather panel\n type: \"tabbedGroup\",\n height: \"52%\",\n pinnedHeight: 30,\n items: [\n {\n type: \"layoutPanel\",\n title: \"Today's Weather\",\n contentContainer: \"TodaysWeatherPanel\",\n\n },\n ],\n },\n {\n // Tab group for forecast panel\n type: \"tabbedGroup\",\n height: \"48%\",\n pinnedHeight: 30,\n items: [\n {\n type: \"layoutPanel\",\n title: \"5 Day Forecast\",\n contentContainer: \"ForecastPanel\",\n\n },\n ],\n }\n ],\n }\n ],\n },\n ];\n $(\"#jqxLayout\").jqxLayout({\n width: 1250,\n //width: '100%',\n //width: getWidth(\"layout\"),\n height: 650,\n layout: layout,\n contextMenu: true,\n });\n //alert(\"initDashboardComp\");\n loadWeatherData(0);\n}", "function TabContainer () {\n\t\t//create the tab container\n\t\tvar me = this;\n\t\tthis.$tabs = $( \"#vistabs\" );\n\t\tthis.$content = $( \"#viscontent\" );\n\t\tthis.tabCounter = 0;\n\t\t//visualizations showed in this tab\n\t\tthis.visualizations = {};\n\t\t//enable tab click\n\t\tthis.$tabs.delegate( 'a[data-toggle=\"tab\"]', \"click\", function ( e ) {\n\t\t\te.preventDefault();\n\t\t\t$( '#propPanel' ).hide();\n\t\t\t$( this ).tab( 'show' );\n\t\t} );\n\t\t//call qlik resize when tab is shown\n\t\tthis.$tabs.delegate( 'a[data-toggle=\"tab\"]', 'shown.bs.tab', function () {\n\t\t\tqlik.resize();\n\t\t} );\n\t\t//enable the close button\n\t\tthis.$tabs.delegate( '.icon-close', \"click\", function () {\n\t\t\tvar li = $( this ).closest( \"li\" ), tabid = li.find( 'a' ).attr( \"href\" );\n\t\t\t$( tabid ).remove();\n\t\t\tli.remove();\n\t\t\ttabid = tabid.replace( /#/, '' );\n\t\t\tif ( me.visualizations[tabid] ) {\n\t\t\t\tme.visualizations[tabid].close();\n\t\t\t}\n\t\t\t//show first tab\n\t\t\tme.$tabs.find( 'a:first' ).tab( 'show' );\n\t\t} );\n\t\t//enable the edit button\n\t\tthis.$tabs.delegate( '.icon-edit', \"click\", function () {\n\t\t\tvar tabid = $( this ).closest( \"li\" ).find( 'a' ).attr( \"href\" );\n\t\t\ttabid = tabid.replace( /#/, '' );\n\t\t\tif ( me.visualizations[tabid] ) {\n\t\t\t\tmodifyVis( me.visualizations[tabid] );\n\t\t\t}\n\t\t} );\n\n\t}", "function setTabs(){\n\tjQuery(\"#tabs\").tabs();\n}", "function showDetailViewTab()\r\n{\r\n\r\n\tvar open=getTabIndexByTitle('View Detail');\r\n\tif (open<0)// if the tab is not open yet\r\n\t{\t\r\n\t\tvar aTab= createDetailViewTab('tabPanel','View Detail' , true);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tshowTab('tabPanel',open[1]);\r\n\t}\r\n}", "function tabLogic() {\n\t// tabbed content\n\t// http://www.entheosweb.com/tutorials/css/tabs.asp\n\t$('.tab-container').each( function() {\n\t\tvar $t = $(this); // the wrapper of all the tabbed content\n\t\tvar $tabset = $t.find('.tab-content'); // the set of chunks of tabbed content\n\t\tvar $tablinkset = $t.siblings('ul.tabs').find('li'); // the set of buttons to hide/reveal\n\t\tvar $tabdrawerset = $t.find('.tab-drawer-heading'); // the set of buttons to fold/unfold\n\t\t$tabset.hide();\n\t\tif (!$t.find('.tab-drawer-heading').is(':visible')) {\n\t\t\t$tabset.eq(0).show();\n\t\t}\n\t\t// when in tab (desktop) mode\n\t\t$tablinkset.click( function() {\n\t\t\t$tabset.hide().removeClass('active');\n\t\t\t$tablinkset.removeClass('active');\n\t\t\t$(this).addClass('active');\n\t\t\tvar activeTab = $(this).attr('data-rel');\n\t\t\t$(\"#\" + activeTab).fadeIn().addClass('active');\n\t\t\t$t.find(\".tab-drawer-heading\").removeClass(\"d-active\");\n\t\t\t$t.find(\".tab-drawer-heading[data-rel^='\" + activeTab + \"']\").addClass(\"d-active\");\n\t\t});\n\t\t// when in drawer (mobile) mode\n\t\t$tabdrawerset.click( function() {\n\t\t\t$tabset.hide().removeClass('active');\n\t\t\tif ($(this).hasClass('d-active')) {\n\t\t\t\t$tabdrawerset.removeClass(\"d-active\").find('span.icon-minus').removeClass('icon-minus').addClass('icon-plus');\n\t\t\t\t$(\"ul.tabs li\").removeClass(\"active\")\n\t\t\t\t$tablinkset.removeClass('active');\n\t\t\t} else {\n\t\t\t\tvar d_activeTab = $(this).attr(\"data-rel\");\n\t\t\t\t$(\"#\" + d_activeTab).fadeIn();\n\t\t\t\t$tabdrawerset.removeClass(\"d-active\").find('span.icon-minus').removeClass('icon-minus').addClass('icon-plus');\n\t\t\t\t$(this).addClass(\"d-active\").find('span.icon-plus').removeClass('icon-plus').addClass('icon-minus');\n\t\t\t\t$tablinkset.removeClass(\"active\");\n\t\t\t\t$tablinkset.filter(\"[data-rel^='\" + d_activeTab + \"']\").addClass(\"active\");\n\t\t\t\t// animate scrolling to the section we just opened\n\t\t\t\t$('html, body').animate({\n\t\t\t\t\tscrollTop: $(\"#\" + d_activeTab).offset().top - $tabdrawerset.outerHeight()\n\t\t\t\t}, 750);\n\t\t\t}\n\t\t});\n\t\t// Extra class \"tab-last\" to add border to right side of last tab\n\t\t$tablinkset.last().addClass(\"tab-last\");\n\t});\n}", "function setupTabs() {\n _setupSetupSheet();\n _setupUserRolePermissionsSheet();\n _setupSubaccountsSheet();\n _setupAdvertiserGroupsSheet();\n _setupAdvertisersSheet();\n _setupFlConfigShareSheet();\n}", "function tabchange(tab) {\n\tswitch (tab) {\n\t\tcase \"situations\":\n\t\t\tviewstack = new Moobile.ViewControllerStack;\n\t\t\twindowcontroller.setRootViewController(viewstack).getRootViewController().pushViewController(new ViewController.Situations(), new Moobile.ViewTransition.None);\n\t\t\tbreak;\n\t\tcase \"revivification\":\n\t\t\tviewstack = new Moobile.ViewControllerStack;\n\t\t\twindowcontroller.setRootViewController(viewstack).getRootViewController().pushViewController(new ViewController.Revivification(), new Moobile.ViewTransition.None);\n\t\t\tbreak;\n\t\tcase \"emergency\":\n\t\t\tviewstack = new Moobile.ViewControllerStack;\n\t\t\twindowcontroller.setRootViewController(viewstack).getRootViewController().pushViewController(new ViewController.Emergency(), new Moobile.ViewTransition.None);\n\t\t\tbreak;\n\t\tcase \"more\":\n\t\t\tviewstack = new Moobile.ViewControllerStack;\n\t\t\twindowcontroller.setRootViewController(viewstack).getRootViewController().pushViewController(new ViewController.More(), new Moobile.ViewTransition.None);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n}", "function setTabAcs(){\n\t$(\".tab-titles\").siblings().wrapAll(\"<div class='tab-content'></div>\");\n\tul = $('.tab-content');\n\tul.children().each(function(i,li){ul.prepend(li)})\n\t\n\t$(document).find(\".tab-titles li\").each(function(i,value){\n\t\tvar elem = $(this).find(\"a\").clone();\n\t\tvar elem_id = $(this).find(\"a\").attr('href');\n\t\telem.addClass(\"ac-panel\");\n\t\t$(this).find(\"a\").attr(\"id\" , elem_id.replace('#', '') + \"_alink\");\n\t\telem.attr(\"id\" , elem_id.replace('#', '') + \"_plink\");\n\t\tsetAccordionPanel(elem, elem_id);\n\t});\n\t/* Set Default active states */\n\t$(\".tab-content>div\").addClass(\"tab-pane\");\n\t$(\".tab-titles\").find(\"li:nth-child(1)\").addClass(\"active\");\n\t$(\".tab-content\").find(\".ac-panel:nth-child(1)\").addClass(\"active\");\n\t$(\".tab-content\").find(\".tab-pane:first\").addClass(\"active\");\n\t/* Show Content */\n\t$(\"#contentBox\").fadeIn(\"slow\");\n}", "function openTab(tabName) {\n var i;\n var x = document.getElementsByClassName(\"tabPage\");\n for (i = 0; i < x.length; i++) {\n x[i].style.display = \"none\";\n }\n document.getElementById(tabName).style.display = \"block\";\n}", "function showDict(evt, letter) {\n var i, tabcontent, tablinks;\n let tabContainer = document.getElementById(\"tabs\");\n\n // Hide EVERY view: cancel display for all elements with class=\"tabcontent\"\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Deselect EVERY tab: remove class \"active\" for all class=\"tablinks\"\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n\n // If viewing stats, hide all the filter options and the summary count\n if (letter === 'stat') {\n document.getElementById(\"length_group\").style.display = \"none\";\n document.getElementById(\"filter_group\").style.display = \"none\";\n document.getElementById(\"settings_group\").style.display = \"none\";\n document.getElementById(\"summary\").style.display = \"none\";\n } else {\n document.getElementById(\"length_group\").style.display = \"inline\";\n document.getElementById(\"filter_group\").style.display = \"inline\";\n document.getElementById(\"settings_group\").style.display = \"inline\";\n document.getElementById(\"summary\").style.display = \"block\";\n }\n\n // If viewing tabs, make sure the tab bar is visible\n if (letter !== 'full' && letter != 'stat') {\n tabContainer.style.display = \"block\";\n\n // If letter is a blank character, then reset to the last selected tab\n if (letter === ' ') {\n selectedView = selectedTab;\n document.getElementById(`${selectedTab}_tab`).className += \" active\";\n\n // Otherwise make the selected tab active\n } else {\n evt.currentTarget.className += \" active\";\n selectedTab = letter;\n selectedView = letter;\n }\n\n // Hide the tab buttons if viewing full display or stats\n } else {\n tabContainer.style.display = \"none\";\n selectedView = letter\n }\n\n // Now display the currently selected view\n document.getElementById(selectedView).style.display = \"block\";\n}", "function displaySelectedCUHybridCompTab(){\n var url = parent.location.href;\n s=url.indexOf(\"summary\");\n if (s!=-1){\n obj= document.getElementById('summary-li');\n if(obj){\n document.getElementById('summary').style.display=\"\";\n }\n }\n if (url.indexOf(\"basiccontrol\")!=-1){\n obj= document.getElementById('basiccontrol-li');\n if(obj){\n document.getElementById('basiccontrol').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"cprating\")!=-1){\n obj= document.getElementById('cprating-li');\n if(obj){\n document.getElementById('cprating').style.display=\"\";\n }\n }\n if (url.indexOf(\"auditreadyasmt\")!=-1){\n obj= document.getElementById('auditreadyasmt-li');\n if(obj){\n document.getElementById('auditreadyasmt').style.display=\"\";\n }\n }\n if (url.indexOf(\"riskmsdcommit\")!=-1){\n obj= document.getElementById('riskmsdcommit-li');\n if(obj){\n document.getElementById('riskmsdcommit').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"auditreview\")!=-1){\n obj= document.getElementById('auditreview-li');\n if(obj){\n document.getElementById('auditreview').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"kctest\")!=-1){\n obj= document.getElementById('kctest-li');\n if(obj){\n document.getElementById('kctest').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"opmetric\")!=-1){\n obj= document.getElementById('opmetric-li');\n if(obj){\n document.getElementById('opmetric').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"other\")!=-1){\n obj= document.getElementById('other-li');\n if(obj){\n document.getElementById('other').style.display=\"\";\n }\n }\n}", "function switchPrefsTab(tab) {\n\t\t// hide all\n\t\tdocument.getElementById('info').className='tab_hidden';\n\t\tdocument.getElementById('messages').className='tab_hidden';\n\t\tdocument.getElementById('signature').className='tab_hidden';\n\t\tdocument.getElementById('trash').className='tab_hidden';\n\t\tdocument.getElementById('skin').className='tab_hidden';\n\t\tdocument.getElementById('filters').className='tab_hidden';\n\t\t\n\t\tdocument.getElementById('tab_info').className='tab_info_hidden';\n\t\tdocument.getElementById('tab_messages').className='tab_info_hidden';\n\t\tdocument.getElementById('tab_signature').className='tab_info_hidden';\n\t\tdocument.getElementById('tab_trash').className='tab_info_hidden';\n\t\tdocument.getElementById('tab_skin').className='tab_info_hidden';\n\t\tdocument.getElementById('tab_filters').className='tab_info_hidden';\n\t\t\n\t\t// show needed\n\t\tdocument.getElementById('tab_'+tab).className='tab_info_visible';\n\t\tdocument.getElementById(tab).className='tab_visible';\n\t}", "function openTab(which,title){\n\n\t\t\tvar filename = which;\n\n\t\t\tapiMatch = new RegExp('/');\n\t\t\tif (filename.match(apiMatch)){\n\t\t\t\tfilename = which;\n\t\t\t} else {\n\t\t\t\tfilename = which.replace(\" \",\"_\").toLowerCase() + \".html\";\n\t\t\t}\n\n\t\t\tvar tabs = Ext.getCmp(\"tabPanel\");\n\t\t\tif (tabs.items.length==0){\n\t\t\t\t$('.introtext').hide();\n\t\t\t\t$('#tabs').fadeIn();\n\t\t\t}\n\n\n\t\t\tvar haveTabAlready=0;\n\t\t\tfor (tabId in tabs.items.keys){\n\t\t\t\tlogMessage(tabId,tabs.items.keys[tabId]);\n\t\t\t\tif (tabs.items.keys[tabId]==title){\n\t\t\t\t\thaveTabAlready=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!haveTabAlready){\n\t\t\t\ttabs.add({\n\t\t\t\t\t closable: true,\n\t\t\t\t\t html: '<div id=\"info_' + title + '\"><div style=\"width:100%; text-align:center;\">Loading data for api:' + which + ' <br/><img style=\"margin:20px auto;\" src=\"images/spinner.gif\" /></div></div>',\n\t\t\t\t\t autoLoad:{url:filename},\n\t\t\t\t\t iconCls: 'tabs',\n\t\t\t\t\t id: title,\n\t\t\t\t\t title:title,\n\t\t\t\t\t name: title\n\t\t\t\t\t\t}\n\t\t\t\t).show();\n\t\t\t} else {\n\t\t\t\ttabs.setActiveTab(title);\n\t\t\t}\n}", "function initializeTabs() {\n\t\tvar previousArrow = '<span class=\"wd-previousArrow\">' + '❮' + '</span>' ;\n\t\tvar nextArrow = '<span class=\"wd-nextArrow\">' + '❯' + '</span>' ;\n\t\t// add visible class to every item by default\n\t\t$('.wd-tablist').children().addClass('visibleTab');\n\t\t// remove right padding for the last element\n\t\t$('.wd-tablist .wd-tabitem:last').css('padding-right', '0px');\n\n\t\t// remove the tabs that are out of the window\n\t\t// theoretically, overflow:hidden should work, but\n\t\t// setting overflow and span and float seems a bit tricky\n\t\tvar tablistright = $('.wd-tablist').outerWidth(true) + $('.wd-tablist').offset().left ;\n\t\twhile( tablistright + 30 > $(window).width() ) {\n\t\t\t// remove tabs on the right until it fits in the window\n\t\t\t$('.wd-tablist .visibleTab:last')\n\t\t\t.addClass('hiddenTab').removeClass('visibleTab' )\n\t\t\t.hide();\n\t\t\ttablistright = $('.wd-tablist').outerWidth(true) + $('.wd-tablist').offset().left ;\n\t\t}\n\n\t\t// add arrows\n\t\t$('.wd-tablist .wd-tabitem:first').before( previousArrow ) ;\n\t\t$('.wd-previousArrow').hide();\n\t\t$('.wd-tablist ').after( nextArrow );\n\n\t\t// if the last element is visible, we don't need the nextArrow\n\t\tif ( $('.wd-tablist .wd-tabitem:last').hasClass('visibleTab') ) {\n\t\t\t$('.wd-nextArrow').hide();\n\t\t}\n\n\t\t// next arrow click\n\t\t$('.wd-nextArrow').click(function() {\n\t\t\t// show next tab = first hidden tab after the next visible tab\n\t\t\t$('.wd-tablist .visibleTab:last').next()\n\t\t\t.addClass('visibleTab').removeClass('hiddenTab')\n\t\t\t.show();\n\n\t\t\t// show previous arrow\n\t\t\t$('.wd-previousArrow').show();\n\n\t\t\t// remove visible tabs on the left until it fits the window\n\t\t\tvar tablistright = $('.wd-tablist').outerWidth(true) + $('.wd-tablist').offset().left ;\n\t\t\twhile( tablistright + 30 > $(window).width() ) {\n\t\t\t\t// remove visible tabs on the left until it fits in the window\n\t\t\t\t$('.wd-tablist .visibleTab:first')\n\t\t\t\t.addClass('hiddenTab').removeClass('visibleTab')\n\t\t\t\t.hide();\n\t\t\t\ttablistright = $('.wd-tablist').outerWidth(true) + $('.wd-tablist').offset().left ;\n\t\t\t}\n\n\t\t\t// check if maybe we can display more elements on the right\n\t\t\twhile( ( tablistright + 30 < $(window).width() ) && $('.wd-tabitem:last').hasClass('hiddenTab') ) {\n\t\t\t\t$('.wd-tablist .visibleTab:last').next()\n\t\t\t\t.addClass('visibleTab').removeClass('hiddenTab')\n\t\t\t\t.show();\n\t\t\t\ttablistright = $('.wd-tablist').outerWidth(true) + $('.wd-tablist').offset().left ;\n\t\t\t}\n\t\t\t// remove last tab if we have been to far\n\t\t\tif ( tablistright + 30 > $(window).width() ) {\n\t\t\t\t$('.wd-tablist .visibleTab:last')\n\t\t\t\t.addClass('hiddenTab').removeClass('visibleTab')\n\t\t\t\t.hide();\n\t\t\t}\n\n\t\t\t// remove next arrow if last tab is visible\n\t\t\tif ( $('.wd-tablist .wd-tabitem:last').hasClass('visibleTab') ) {\n\t\t\t\t$('.wd-nextArrow').hide();\n\t\t\t}\n\n\n\t\t}); // nextArrow click\n\n\t\t// previous arrow click\n\t\t$('.wd-previousArrow').click(function() {\n\t\t\t// show previous tab = the one before the first visible tab\n\t\t\t$('.wd-tablist .visibleTab:first').prev()\n\t\t\t.addClass('visibleTab').removeClass('hiddenTab')\n\t\t\t.show();\n\n\t\t\t// show next arrow\n\t\t\t$('.wd-nextArrow').show();\n\n\t\t\t// remove previous arrow if first tab is visible\n\t\t\tif ( $('.wd-tablist .wd-tabitem:first').hasClass('visibleTab') ) {\n\t\t\t\t$('.wd-previousArrow').hide();\n\t\t\t} // if\n\n\t\t\t// remove visible tabs on the right until it fits the window\n\t\t\tvar tablistright = $('.wd-tablist').outerWidth(true) + $('.wd-tablist').offset().left ;\n\t\t\twhile( tablistright + 30 > $(window).width() ) {\n\t\t\t\t// remove tabs on the right until it fits in the window\n\t\t\t\t$('.wd-tablist .visibleTab:last')\n\t\t\t\t.addClass('hiddenTab').removeClass('visibleTab')\n\t\t\t\t.hide();\n\t\t\t\ttablistright = $('.wd-tablist').outerWidth(true) + $('.wd-tablist').offset().left ;\n\t\t\t}\n\t\t}); // click\n\t} // initializeTabs", "function addGraphTabs() {\n const graphContainer = document.getElementById(\"graphs-container\");\n const graphListTarget = document.querySelector(\"#graph-btn\");\n\n // Add buttons to display graphs\n graphContainer.childNodes.forEach(element => {\n if (element.nodeType !== Node.TEXT_NODE) {\n const button = document.createElement(\"button\");\n button.classList.add(\"btn\", \"btn-sm\", \"btn-outline-secondary\");\n button.textContent = element.dataset.graphName;\n graphListTarget.appendChild(button);\n\n button.addEventListener(\"click\", (e) => {\n document.querySelectorAll(\"#graph-btn button\").forEach((otherBtn) => {\n otherBtn.classList.remove('active');\n });\n e.target.classList.add('active');\n document.querySelectorAll(\".graph-display\").forEach((otherGraph) => {\n otherGraph.classList.add(\"hidden\");\n });\n\n element.classList.remove(\"hidden\");\n });\n }\n });\n\n document.querySelector(\"#graph-btn button\").classList.add('active');\n}", "function showTab(n){\n let display = document.getElementsByClassName(\"tab-pane\");\n display[n].style.display = \"inline\";\n}", "function showPanel(panelIndex){\n //array for tabs\n tabText=[\n \"On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document.\",\n \"You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks.\",\n \"When you create pictures, charts, or diagrams, they also coordinate with your current document look.\",\n \"You can easily change the formatting of selected text in the document text by choosing a look for the selected text from the Quick Styles gallery on the Home tab.\"\n ];\n //show on display\n this.tab.style.display=\"block\"; \n //change content when click on another tab\n this.tab.textContent = tabText[panelIndex];\n}", "function show(evt, sectName) {\n // Declare all variables\n var i, tabcontent, tablinks;\n \n // Get all elements with class=\"tabcontent\" and hide them\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n \n // Get all elements with class=\"tablinks\" and remove the class \"active\"\n tablinks = document.getElementsByClassName(\"tab-link\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n \n // Show the current tab, and add an \"active\" class to the link that opened the tab\n document.getElementById(sectName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n }", "function showTab() {\n var url = window.location.href;\n if(url.indexOf('/get_started/why_mxnet') != -1) return;\n for(var i = 0; i < TITLE.length; ++i) {\n if(url.indexOf(TITLE[i]) != -1) {\n var tab = $($('#main-nav').children().eq(i));\n if(!tab.is('a')) tab = tab.find('a').first();\n tab.css('border-bottom', '3px solid');\n }\n }\n}", "function jscoverage_selectTab(tab) {\n\t$(tab).tab('show');\n}", "async updateTabs() {\r\n // Make sure the selected tab ID is valid\r\n let tab = await this.getTab(this.state.selectedTabID);\r\n if (!tab) {\r\n tab = this.state.tabs.find(tab => tab.visible);\r\n if (tab)\r\n await this.selectTab(tab.ID);\r\n }\r\n // Only show the tabs if multiple tabs are opened\r\n const shouldShowTabs = this.state.tabs.length > 1;\r\n if (this.state.tabsVisible != shouldShowTabs) {\r\n this.changeState({\r\n tabsVisible: shouldShowTabs,\r\n });\r\n }\r\n }", "function tabSwitch( $tab ) {\n\n var id, content, tab;\n\n // if $tab was not set, get the tab from the query string\n if (typeof($tab) === 'undefined') {\n tab = getQ('tab').length ? getQ('tab') : null;\n if (!tab) return;\n $tab = $('#' + tab);\n }\n\n // get id and content location from the chosen tab\n id = $tab.attr('id');\n content = $tab.data('optcontent');\n\n // hide all tab content areas, show current one\n $('.opt-content').hide();\n $(content).show();\n\n // set the active tab head\n $('.opt-tab').removeClass('nav-tab-active');\n $tab.addClass('nav-tab-active').blur();\n\n if (history.pushState) {\n var stateObject = {dummy: true};;\n var url = window.location.protocol\n + \"//\"\n + window.location.host\n + window.location.pathname\n + '?page=integrity-checker_options&tab=' + id;\n\n history.pushState(stateObject, $(document).find('title').text(), url);\n }\n }", "function initTabs() {\n\t$(\"#report-content .tabs\").each(function(){\n\t\t$(this).tabs({\n\t\t\t\"show\": function(event, ui) {\n\t\t\t var table = $.fn.dataTable.fnTables(true);\n\t\t\t if ( table.length > 0 ) {\n\t\t\t $(table).dataTable().fnAdjustColumnSizing();\n\t\t\t }\n\t\t\t},\n\t\t\t\"activate\": function(event, ui) {\n\t\t\t\tvar table = ui.newPanel.find(\"table.dataTable\");\n\t\t\t\t//console.log(table);\n\t\t\t\tupdateFooter(table);\n\t\t\t}\n\t\t});\n\t});\n}", "function openTab(evt, tab) {\n var i, x, tablinks;\n\tx = document.getElementsByClassName(\"beamTabs\");\n\tfor (i = 0; i < x.length; i++) {\n x[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablink\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" w3-indigo\", \"\");\n }\n evt.currentTarget.className += \" w3-indigo\";\n\tdocument.getElementById(tab).style.display = \"block\";\n\tupdateDiagramGeometry();\n}", "setup() {\n\t\t\tvar that = this;\n\t\t\tthis._forEach(this._activeTabs, function(index, tab) {\n\t\t\t\tthat._forEach(tab.children, function(index, child) {\n\t\t\t\t\tvar target = that.getTarget(child);\n\t\t\t\t\tthat.showPanel(child, target);\n\t\t\t\t});\n\t\t\t});\n\t\t}", "function changeTab(pageName, tabElement){\n var tabcontent;\n var tablinks;\n\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n tabcontent2 = document.getElementsByClassName(\"tabcontent\").value;\n\n for (var i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n\n }\n\n tablinks = document.getElementsByClassName(\"tablink\");\n\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].style.backgroundColor = \"\";\n\n }\n tabElement.style.backgroundColor = \"AntiqueWhite\";\n document.getElementById(pageName).style.display = \"block\";\n\n\n\n}", "function tabLoad() {\n // Tab load safety check\n if (tabHasLoaded) {\n return;\n }\n tabHasLoaded = true;\n\n setupPage();\n\n getTaskStatuses();\n getTasks();\n }", "tick() {\n this.navigation_pane.tick(this.tabs);\n for (var tab of this.tabs) {\n tab.tick();\n };\n }", "show() {\n if (\n $.getDataset(this._target, 'uiAnimating') ||\n $.hasClass(this._target, 'active') ||\n !$.triggerOne(this._node, 'show.ui.tab')\n ) {\n return;\n }\n\n const active = this._siblings.find((sibling) =>\n $.hasClass(sibling, 'active'),\n );\n\n if (!active) {\n this._show();\n } else {\n const activeTab = this.constructor.init(active);\n\n if (activeTab.animating) {\n return;\n }\n\n if (!$.triggerOne(active, 'hide.ui.tab')) {\n return;\n }\n\n $.addEventOnce(active, 'hidden.ui.tab', (_) => {\n this._show();\n });\n\n activeTab._hide();\n }\n }", "function showTab(n) {\n\n\tvar x = document.getElementsByClassName(\"tab\");\n\tx[n].style.display = \"block\";\n\tif (n == 0) {\n\tdocument.getElementById(\"prevBtn\").style.display = \"none\";\n\t}\n\telse {\n\tdocument.getElementById(\"prevBtn\").style.display = \"inline\";\n\t}\n\n\tif (n == (x.length - 1)) {\n\tdocument.getElementById(\"nextBtn\").innerHTML = \"Finish\";\n\t}\n\telse {\n\tdocument.getElementById(\"nextBtn\").innerHTML = \"Next\";\n\t}\n\n\tfixStepIndicator(n) //run a function that displays the correct step indicator\n}", "function openTab(evt, tabName) {\n // Declare all variables\n var i, tabcontent, tablinks;\n // Get all elements with class=\"tabcontent\" and hide them\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Get all elements with class=\"tablinks\" and remove the class \"active\"\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n // Show the current tab, and add an \"active\" class to the button that opened the tab\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n\n //if Tab is not by default, call the appropriate tab\n if(tabName===\"schedule\")\n displayByDay(\"26 April\");\n if(tabName===\"Speakers\")\n displaySpeakers();\n }", "function showTab(n) {\n // This function will display the specified tab of the form ...\n\n\n $(\".tab\").eq(n).css(\"display\", \"block\");\n\n // ... and fix the Previous/Next buttons:\n if (n == 0) {\n $(\"#prevBtn\").css('display', 'none');\n $(\"#endBtn\").css('display', 'none');\n } else {\n $(\"#prevBtn\").css('display', 'inline');\n }\n if (n == ($(\".tab\").length - 1)) {\n $(\"#doniraj-text\").html('Hvala Vam!');\n $(\"#nextBtn\").css('display', 'none');\n $(\"#prevBtn\").css('display', 'none');\n $(\"#endBtn\").css('display', 'block');\n } else {\n $(\"#nextBtn\").html('Dalje');\n }\n\n // ... and run a function that displays the correct step indicator:\n fixStepIndicator(n)\n}", "function chooseTab() {\n // console.debug( \"pfFunctions.js:chooseTab\" );\n // see if the showTab variable points to tab that actually exists in\n // the page\n if( ! ( showTab === undefined ) && $(showTab) ) {\n // console.debug( \"chooseTab: using param setting: \" + showTab );\n\n // yes; show that tab\n show( showTab );\n\n } else {\n // console.debug( \"chooseTab: no param setting; checking cookie\" );\n \n // no; see if there's a cookie to tell us the last tab\n var cookieTab = readCookie( \"lastTab\" );\n // console.debug( \"cookieTab: |\" + cookieTab + \"|\" );\n\n if( cookieTab && $(cookieTab) ) {\n // console.debug( \"chooseTab: found a cookie; switching to |\" + cookieTab + \"|\" );\n \n // yes; show that tab\n show( cookieTab );\n } else {\n // console.debug( \"chooseTab: no cookie switching to default\" );\n\n // no; get the first block in the page and show that instead\n var block = document.getElementsByClassName( \"block\" )[0];\n if( block && block.id ) {\n show( block.id );\n }\n }\n }\n}", "function initTabStatus(){\n\tvar isVirtual = getParameter(\"IsVirtual\");\n\tif(Ext.isTrue(isVirtual)){\n\t\tvar channelType = getParameter(\"channelType\");\n\t\t//由于只使用检索条件的栏目会变成虚栏目,但这3类权限设置都要有,所以不能这样return,否则都不会显示了\n\t\t//if(channelType == \"\" || channelType == 0) return; \n\t\tvar tableObj = document.getElementById(\"id_TRSSimpleTab\").childNodes[0];\n\t\tif(!tableObj)return;\n\t\tif(channelType != \"\" && channelType != 0){\n\t\t\ttableArray = tableObj.getElementsByTagName(\"table\");\n\t\t\ttableArray[m_aRightTypeIds[\"template\"]].parentNode.parentNode.style.display = 'none';\n\t\t}\n\t}\n\tElement.removeClassName('tabTd', 'hideChild');\n}", "function WEB_show_load_graph_subform() {\n\tWEB_hide_graph_info_subform();\n\t$('#graph_load_subform').show();\n}", "function ac_createTabs() {\n\n\t//Create Tabs Container\n\t$(\"#ac_tool_box\").append('<ul id=\"ac_toolbar\" class=\"clearfix\"></div>');\n\n\t// Configuration Icon\n\t$(\"#ac_toolbar\").append('<li id=\"ac_tool_cfg\" class=\"ac_tool ac_tool_off\">&nbsp;</li>');\n\t$(\"#ac_tool_cfg\").attr('style', 'background-image:url(' + AC_IMAGE_CONFIG + ')');\n\t$(\"#ac_tool_cfg\").attr('title', \"Configure ActionChat\");\n\t$(\"#ac_tool_cfg\").click(function () { \n\t\tac_showConfigPanel();\n\t});\n\n\t// Create Calendar Icon and attach event handler\n\tif (ac_getValue('showcalendar')) {\n\t\t$(\"#ac_toolbar\").append('<li id=\"ac_tool_cal\" class=\"ac_tool ac_tool_off\">&nbsp;</li>');\n\t\t$(\"#ac_tool_cal\").attr('style', 'background-image:url(' + AC_IMAGE_NOCAL + ')');\n\t\t$(\"#ac_tool_cal\").attr('title', \"Noblesse Oblige Calendar Info\");\n\t\t$(\"#ac_tool_cal\").click(function () { \n\t\t\tac_showCalendarPanel();\n\t\t});\n\t}\n\n\t// Create Log Notes Icon and attach event handler\n\tif (ac_getValue('showlog') && (isRelay)) {\n\t\t$(\"#ac_toolbar\").append('<li id=\"ac_tool_log\" class=\"ac_tool ac_tool_off\">&nbsp;</li>');\n\t\t$(\"#ac_tool_log\").attr('style', 'background-image:url(' + AC_IMAGE_LOG + ')');\n\t\t$(\"#ac_tool_log\").attr('title', \"Ascension Log Notes\");\n\t\t$(\"#ac_tool_log\").click(function () { \n\t\t\tac_showLogPanel();\n\t\t});\n\t}\n\t\n\t// Create CLI Icon and attach event handler\n\tif (ac_getValue('showcli') && (isRelay)) {\n\t\t$(\"#ac_toolbar\").append('<li id=\"ac_tool_cli\" class=\"ac_tool ac_tool_off\">&nbsp;</li>');\n\t\t$(\"#ac_tool_cli\").attr('style', 'background-image:url(' + AC_IMAGE_CLI + ')');\n\t\t$(\"#ac_tool_cli\").attr('title', \"Integrated Mafia gCLI\");\n\t\t$(\"#ac_tool_cli\").click(function () { \n\t\t\tac_showCLIPanel();\n\t\t});\n\t}\n\n\t// Create Events Icon and attach event handler\n\tif (true) {\n\t\t$(\"#ac_toolbar\").append('<li id=\"ac_tool_events\" class=\"ac_tool ac_tool_off\">&nbsp;</li>');\n\t\t$(\"#ac_tool_events\").attr('style', 'background-image:url(' + AC_IMAGE_EVENTS[0] + ')');\n\t\t$(\"#ac_tool_events\").attr('title', \"Events\");\n\t\t$(\"#ac_tool_events\").click(function () { \n\t\t\tac_showEventsPanel();\n\t\t});\n\t\tif (ac_getValue('eventstarget') != 'docked') {\n\t\t\t$(\"#ac_tool_events\").hide();\n\t\t}\n\t}\n\n\t\n}", "function onSwitchTab()\n\t{\n\t\tvar idx = jQuery(this).index();\n\t\t_preferences.tab = parseInt(idx, 10);\n\n\t\tClient.loadFile(DB.INTERFACE_PATH + 'basic_interface/tab_itm_0'+ (idx+1) +'.bmp', function(data){\n\t\t\tCashShop.ui.find('.tabs').css('backgroundImage', 'url(' + data + ')');\n\t\t\t//requestFilter();\n\t\t});\n\t}", "function showProfileInfo() {\n $(\"#monitoredContent\").children().hide();\n $(\"#profileContainer\").show();\n $(\".tab button\").css(\"background-color\",\"initial\");\n}", "function showAllItemTab()\r\n{\r\n\r\n\t\tvar open=getTabIndexByTitle('All Auction');\r\n\t\tif (open<0)// if the tab is not open yet\r\n\t\t{\t\r\n\t\t\tvar aTab= createAllItemViewTab('tabPanel','All Auction', true);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tshowTab('tabPanel',open[1]);\r\n\t\t}\r\n}", "function TabsPage() {\n this.tab1Root = __WEBPACK_IMPORTED_MODULE_3__home_home__[\"a\" /* HomePage */];\n this.tab2Root = __WEBPACK_IMPORTED_MODULE_1__courses_courses__[\"a\" /* CoursesPage */];\n this.tab3Root = __WEBPACK_IMPORTED_MODULE_2__enroll_now_enroll_now__[\"a\" /* EnrollNowPage */];\n this.tab4Root = __WEBPACK_IMPORTED_MODULE_4__personal_details_personal_details__[\"a\" /* PersonalDetailsPage */];\n this.tab5Root = __WEBPACK_IMPORTED_MODULE_5__program_calender_program_calender__[\"a\" /* ProgramCalenderPage */];\n this.tab6Root = __WEBPACK_IMPORTED_MODULE_6__my_program_my_program__[\"a\" /* MyProgramPage */];\n this.tab7Root = __WEBPACK_IMPORTED_MODULE_7__admin_admin__[\"a\" /* AdminPage */];\n }", "function showTab(n) {\r\n // Esta funcion muestra el tab recibido por parametro...\r\n var x = document.getElementsByClassName(\"tab\");\r\n x[n].style.display = \"block\";\r\n // ... and fix the Previous/Next buttons:\r\n if (n == 0) {\r\n document.getElementById(\"prevBtn\").style.display = \"none\";\r\n } else {\r\n document.getElementById(\"prevBtn\").style.display = \"inline\";\r\n }\r\n if (n == (x.length - 1)) {\r\n document.getElementById(\"nextBtn\").innerHTML = \"Submit\";\r\n } else {\r\n document.getElementById(\"nextBtn\").innerHTML = \"Next\";\r\n }\r\n // ... and run a function that displays the correct step indicator:\r\n fixStepIndicator(n)\r\n}", "render () {\n\t\tlet { tabStates } = this.state;\n\t\tlet { project, diagram } = this.props;\n\t\tlet tabs = [];\n\n\t\ttabs.push(Tab(0, project ? project.name : 'No Project selected', ProjectMenu, this.props));\n\n\t\tif (project) {\n\t\t\ttabs.push(Tab(1, diagram ? diagram.name : 'No Diagram selected', DiagramMenu, this.props));\n\t\t\tif (diagram) {\n\t\t\t\ttabs.push(Tab(2, `Components [${diagram.type}]`, ComponentMenu, this.props));\n\t\t\t}\n\t\t}\n\n\t\treturn <div className=\"side\">\n\t\t\t<Tabs tabs={tabs} toggle={this.setTabState} states={tabStates}/>\n\t\t</div>;\n\t}", "function initStrategyTabs() {\n // Fetch sample, new strat, and help tab contents\n // If no page is found for a given tab, remove\n // that tab from the page\n $.ajax({\n url: \"wdkCustomization/jsp/strategies/samplesTab.jsp\",\n type: \"GET\",\n dataType: \"html\",\n success: function(data) {\n $(\"#sample_strat\").html(data);\n try {\n customSampleTab();\n }\n catch(e) {}\n },\n error: function() {\n $(\"#tab_sample_strat\").parent(\"li\").remove();\n }\n });\n\n $.ajax({\n url: \"wdkCustomization/jsp/strategies/newTab.jsp\",\n type: \"GET\",\n dataType: \"html\",\n success: function(data) {\n $(\"#strategy_new\").html(data);\n },\n error: function() {\n $(\"#tab_strategy_new\").parent(\"li\").remove();\n }\n });\n\n $.ajax({\n url: \"wdkCustomization/jsp/strategies/helpTab.jsp\",\n type: \"GET\",\n dataType: \"html\",\n success: function(data) {\n $(\"#help\").html(data);\n try {\n customHelpTab();\n }\n catch(e) {}\n },\n error: function() {\n $(\"#tab_help\").parent(\"li\").remove();\n },\n complete: function() {\n wdk.dyk.initHelp();\n }\n });\n }", "function handleSwitchTabs(e) {\n\t\t\tvar tab = e.currentTarget.id;\n\n\t\t\tfor (var i = 0; i < orsTabs.length; i++) {\n\t\t\t\tif (orsTabs[i] == tab) {\n\t\t\t\t\t//show\n\t\t\t\t\t$('#' + orsTabs[i]).parent().attr('class', 'active');\n\t\t\t\t\t$('#' + orsTabs[i] + 'Panel').css('display', 'inline');\n\t\t\t\t} else {\n\t\t\t\t\t//hide\n\t\t\t\t\t$('#' + orsTabs[i]).parent().attr('class', '');\n\t\t\t\t\t$('#' + orsTabs[i] + 'Panel').css('display', 'none');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function switchTabs (obj) {\n // select proper tab\n if(!$(obj).hasClass(\"active\")) {\n var objClass = $(obj).attr(\"class\");\n var parentClass = $(obj).parent().attr(\"class\");\n $(\".\"+parentClass).children(\".active\").removeClass(\"active\");\n $(\".\"+parentClass).find(\".\"+objClass).addClass(\"active\");\n \n // switch tab contents\n $(\"#simulator-army-top\").toggle();\n $(\"#simulator-parameters-top\").toggle();\n \n $(\"#simulator-army-bottom\").toggle();\n $(\"#simulator-parameters-bottom\").toggle();\n }\n}", "function init_tab_pages() {\n\t$('#streams-filter-tabs li').click(function() {\n\t\t$('#streams-filter-tabs li').removeClass('active');\n\t\t$(this).addClass('active');\n\n\t\tif ($('#streams-filter-tabs li').index($(this)) == 0) {\n\t\t\tif (!$('#all-streams').hasClass('current')) {\n\t\t\t\t$('#all-streams').addClass('current');\n\t\t\t\t$('#my-streams').removeClass('current');\n\t\t\t\t$('#atme-streams').removeClass('current');\n\t\t\t}\n\t\t}\n\t\tif ($('#streams-filter-tabs li').index($(this)) == 1) {\n\t\t\tif (!$('#my-streams').hasClass('current')) {\n\t\t\t\t$('#all-streams').removeClass('current');\n\t\t\t\t$('#my-streams').addClass('current');\n\t\t\t\t$('#atme-streams').removeClass('current');\n\t\t\t}\n\t\t}\n\t\tif ($('#streams-filter-tabs li').index($(this)) == 2) {\n\t\t\tif (!$('#atme-streams').hasClass('current')) {\n\t\t\t\t$('#all-streams').removeClass('current');\n\t\t\t\t$('#my-streams').removeClass('current');\n\t\t\t\t$('#atme-streams').addClass('current');\n\t\t\t\trender_atme_streams();\n\t\t\t\t//need to be fixed, now renders everytime tab clicked\n\t\t\t}\n\t\t}\n\n\t});\n}", "function initTabs(){\n\t\n\tvar tabListItems = document.getElementById('tabs').childNodes;\n\tfor(var i = 0; i<tabListItems.length; i++){\n\t\tif(tabListItems[i].nodeName == \"LI\"){\n\t\t\tvar tabLink = getFirstChildWithTagName(tabListItems[i], 'A');\n\t\t\tvar id = getHash(tabLink.getAttribute('href'));\n\t\t\ttabLinks[id] = tabLink;\n\t\t\tcontentDivs[id] = document.getElementById( id );\n\t\t}\n\t}\n\tvar i = 0;\n\n\tfor (var id in tabLinks){\n\t\ttabLinks[id].onclick = showTab;\n\t\ttabLinks[id].onfocus = function() {this.blur()};\n\t\tif(i == 0) \n\t\t\ttabLinks[id].className = 'selected';\n\t\ti++;\n\t}\n\tvar i = 0;\n\n\tfor (var id in contentDivs){\n\t\tif (i != 0) contentDivs[id].className = 'tabContent hide';\n\t\ti++;\n\t}\n}", "function do_show_extra_info() {\n\t// {{{\n\n\tvar outtab = document.getElementById('tat_panel');\n\n\tvar tmpdiv;\n\n\tvar prefdiv;\n\tprefdiv = document.createElement(\"div\");\n\tprefdiv.setAttribute(\"id\", \"rbt_prefs\");\n\tprefdiv.innerHTML += \"<b>The Abyss Tuning</b> \" + user_script_version + \"&nbsp;\";\n\touttab.appendChild(prefdiv);\n\n\tbutton_toggle_config = document.createElement(\"button\");\n\tbutton_toggle_config.style.border = \"dotted grey 1px;\";\n\tbutton_toggle_config.innerHTML = \"Configuration\";\n\tprefdiv.appendChild(button_toggle_config);\n\n\ttmpdiv = document.createElement(\"div\");\n\ttmpdiv.setAttribute(\"id\", \"rbt_config\");\n\ttmpdiv.style.display = (show_config) ? 'block' : 'none';\n\tprefdiv.appendChild(tmpdiv);\n\n\t\ttmpdiv.innerHTML = \"<hr><b>CONFIGURATION</b><br>\";\n\n\t\tfor (var i = 0; i < array_object.length; ++i) {\n\t\t\tvar tmpobj = array_object[i];\n\t\t\tvar button_toggle = document.createElement(\"button\");\n\t\t\tbutton_toggle.style.border = \"dotted grey 1px;\";\n\t\t\tbutton_toggle.innerHTML = tmpobj.button_name;\n\t\t\ttmpdiv.appendChild(button_toggle);\n\t\t\ttmpobj.toggle_button = button_toggle;\n\t\t}\n\n\t\ttmpdiv.appendChild(document.createElement(\"br\"));\n\n\t\tbutton_toggle_extra_links = document.createElement(\"button\");\n\t\tbutton_toggle_extra_links.style.border = \"dotted grey 1px;\";\n\t\tbutton_toggle_extra_links.innerHTML = \"Web links\";\n\t\ttmpdiv.appendChild(button_toggle_extra_links);\n\n\t\tbutton_toggle_route = document.createElement(\"button\");\n\t\tbutton_toggle_route.style.border = \"dotted grey 1px;\";\n\t\tbutton_toggle_route.innerHTML = \"Route\";\n\t\ttmpdiv.appendChild(button_toggle_route);\n\n\t\tbutton_toggle_hud = document.createElement(\"button\");\n\t\tbutton_toggle_hud.style.border = \"dotted grey 1px;\";\n\t\tbutton_toggle_hud.innerHTML = \"HUD\";\n\t\ttmpdiv.appendChild(button_toggle_hud);\n\n\t\ttmpdiv.appendChild(document.createElement(\"br\"));\n\n\t\tbutton_toggle_num_coord = document.createElement(\"button\");\n\t\tbutton_toggle_num_coord.style.border = \"dotted grey 1px;\";\n\t\tbutton_toggle_num_coord.innerHTML = \"Numerical coordinates on the map\";\n\t\ttmpdiv.appendChild(button_toggle_num_coord);\n\n\t\ttmpdiv.appendChild(document.createElement(\"br\"));\n\n\t\tbutton_check_update = document.createElement(\"button\");\n\t\tbutton_check_update.style.border = \"dotted grey 1px;\";\n\t\tbutton_check_update.innerHTML = \"Check update online\";\n\t\ttmpdiv.appendChild(button_check_update);\n\n\t// Just a test container\n\ttmpdiv = document.createElement(\"div\");\n\ttmpdiv.setAttribute(\"id\", \"rbt_test\");\n\touttab.appendChild(tmpdiv);\n\n\t// Just the container\n\ttmpdiv = document.createElement(\"div\");\n\ttmpdiv.setAttribute(\"id\", \"rbt_check_update\");\n\touttab.appendChild(tmpdiv);\n\n\t// BUTTONS\n\tfor (var i = 0; i < array_object.length; ++i) {\n\t\tvar tmpobj = array_object[i];\n\t\ttmpdiv = document.createElement(\"div\");\n\t\ttmpdiv.setAttribute(\"id\", tmpobj.div_id);\n\t\touttab.appendChild(tmpdiv);\n\t\tsort_places(current_x, current_y, tmpobj.places);\n\t\ttmpdiv.innerHTML += \"<hr><b>\" + tmpobj.name_title + \"</b> - the \" + tmpobj.nearest + \" nearest within \" + tmpobj.dist_threshold + action_point_str +\"<br>\";\n\t\ttmpdiv.appendChild(show_nearest(tmpobj.places, tmpobj.nearest, tmpobj.dist_threshold));\n\t\ttmpdiv.style.display = (tmpobj.show) ? 'block' : 'none';\n\t}\n\n\ttmpdiv = document.createElement(\"div\");\n\ttmpdiv.setAttribute(\"id\", \"rbt_extra_links\");\n\ttmpdiv.style.display = (show_extra_links) ? 'block' : 'none';\n\ttmpdiv.innerHTML += \"<hr><b>EXTRALINKS</b><br>\";\n\tfor (var i = 0; i < extra_links.length; ++i) {\n\t\ttmpdiv.innerHTML += \"<a href=\\\"\" + extra_links[i][1] + \"\\\">\"+extra_links[i][0]+\"</a><br>\";\n\t}\n\touttab.appendChild(tmpdiv);\n\n\n\tvar route_div = document.createElement(\"div\");\n\troute_div.setAttribute(\"id\", \"rbt_route\");\n\troute_div.style.display = (show_route) ? 'block' : 'none';\n\touttab.appendChild(route_div);\n\n\n\t// {{{ Destination selection - select menus generation\n\ttmpdiv = document.createElement(\"div\");\n\ttmpdiv.setAttribute(\"id\", \"rbt_destination_selection\");\n\troute_div.appendChild(tmpdiv);\n\n\ttmpdiv.innerHTML += \"<hr><b>ROUTE</b><br>\" +\n\t\t\t\"You are at \" + streets_name[parseInt(current_x)] + \" (\" + current_x + \") x \" + current_y +\n\t\t\t\", where do you want to go&nbsp;?<br>\";\n\n\tvar tmpOption;\n\n\t// vertical streets\n\tvar dest_x = GM_getValue(\"destination_x\", -1);\n\tselect_dest_x = document.createElement(\"select\");\n\tselect_dest_x.name = \"select_dest_x\";\n\tselect_dest_x.id = \"select_dest_x\";\n\tselect_dest_x.style.width = \"15em\";\n\n\tfor (var i = 0.5; i <= 100; i+= 0.5) {\n\t\ttmpOption = document.createElement(\"option\");\n\t\ttmpOption.setAttribute(\"value\", i);\n\t\tif (i == parseInt(i) + 0.5) {\n\t\t\ttmpOption.innerHTML += streets_name[parseInt(i)] + \" East (\" + i + \")\";\n\t\t} else {\n\t\t\ttmpOption.innerHTML += streets_name[parseInt(i)] + \" (\" + i + \")\";\n\t\t}\n\t\tif (i == dest_x) {\n\t\t\ttmpOption.setAttribute(\"selected\", \"selected\");\n\n\t\t}\n\t\tselect_dest_x.appendChild(tmpOption);\n\t}\n\ttmpdiv.appendChild(select_dest_x);\n\n\ttmpdiv.appendChild(document.createElement(\"br\"));\n\n\t// horizontal streets\n\tvar dest_y = GM_getValue(\"destination_y\", -1);\n\tselect_dest_y = document.createElement(\"select\");\n\tselect_dest_y.name = \"select_dest_y\";\n\tselect_dest_y.id = \"select_dest_y\";\n\tselect_dest_y.style.width = \"15em\";\n\n\tfor (var i = 0.5; i <= 100; i += 0.5) {\n\t\ttmpOption = document.createElement(\"option\");\n\t\ttmpOption.setAttribute(\"value\", \"\" + i);\n\t\tif (i == parseInt(i) + 0.5) {\n\t\t\ttmpOption.innerHTML += ordinal(parseInt(i)) + \" South \" + \" (\" + i + \")\";\n\t\t} else {\n\t\t\ttmpOption.innerHTML += ordinal(parseInt(i)) + \" (\" + i + \")\";\n\t\t}\n\t\tif (i == dest_y) {\n\t\t\ttmpOption.setAttribute(\"selected\", \"selected\");\n\n\t\t}\n\t\tselect_dest_y.appendChild(tmpOption);\n\t}\n\ttmpdiv.appendChild(select_dest_y);\n\n\ttmpdiv.appendChild(document.createElement(\"br\"));\n\n\troute_use_stations = GM_getValue(\"route_use_stations\", 1);\n\tselect_use_stations = document.createElement(\"select\");\n\tselect_use_stations.name = \"use_stations\";\n\tselect_use_stations.id = \"use_stations\";\n\n\ttmpOption = document.createElement(\"option\");\n\ttmpOption.setAttribute(\"value\", 0);\n\ttmpOption.innerHTML += (\"Do not use stations\");\n\tif (route_use_stations == 0) {\n\t\ttmpOption.setAttribute(\"selected\", \"selected\");\n\t}\n\tselect_use_stations.appendChild(tmpOption);\n\ttmpOption = document.createElement(\"option\");\n\ttmpOption.setAttribute(\"value\", 1);\n\ttmpOption.innerHTML += (\"Use stations\");\n\tif (route_use_stations == 1) {\n\t\ttmpOption.setAttribute(\"selected\", \"selected\");\n\t}\n\tselect_use_stations.appendChild(tmpOption);\n\n\ttmpdiv.appendChild(select_use_stations);\n\n\t// }}}\n\n\ttmpdiv = document.createElement(\"div\");\n\ttmpdiv.setAttribute(\"id\", \"rbt_route_path\");\n\troute_div.appendChild(tmpdiv);\n\n\t// Update the display\n\tcommon_func(null, null);\n\n\t// Bind the event listeners - for the select items\n\tselect_dest_x.addEventListener('change', function(event) { common_func(event, this); } , true);\n\tselect_dest_y.addEventListener('change', function(event) { common_func(event, this); } , true);\n\tselect_use_stations.addEventListener('change', function(event) { common_func(event, this); } , true);\n\n\t// Bind the event listeners - for the button items\n\tbutton_toggle_config.addEventListener('click', function(event) { toggle_display(event, this); }, true);\n\n\t// BUTTONS\n\tfor (var i = 0; i < array_object.length; ++i) {\n\t\tvar tmpobj = array_object[i];\n\t\ttmpobj.toggle_button.addEventListener('click', function(event) { toggle_display(event, this); }, true);\n\t}\n\n\tbutton_toggle_extra_links.addEventListener('click', function(event) { toggle_display(event, this); }, true);\n\tbutton_toggle_route.addEventListener('click', function(event) { toggle_display(event, this); }, true);\n\tbutton_toggle_hud.addEventListener('click', function(event) { toggle_display(event, this); }, true);\n\n\tbutton_toggle_num_coord.addEventListener('click', function(event) { toggle_display_num_coord(event, this); }, true);\n\n\tbutton_check_update.addEventListener('click', function(event) { check_update(event, this); }, true);\n\n\treturn true;\n\t// }}}\n}", "function loadTab(id) {\n document.body.hidden = false;\n for (var i = 0; i < tabs.length; i++) {\n document.getElementById(tabs[i]).hidden=true;\n }\n document.getElementById(id).hidden = false;\n}", "function opentab(evt, punNum) {\n // Declaring variables \n var i, tabContent, tablink;\n tabContent = document.getElementsByClassName(\"tabContent\");\n for (i = 0; i < tabContent.length; i++) {\n tabContent[i].style.display = \"none\";\n }\n tablink = document.getElementsByClassName(\"tablink\");\n for (i = 0; i < tablink.length; i++) {\n tablink[i].className = tablink[i].className.replace(\"active\", \"\")\n }\n\n document.getElementById(punNum).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function openTab(tabName) {\n let i;\n let tabContent;\n\n tabContent = document.getElementsByClassName(\"tab-content\");\n\n for (i = 0; i < tabContent.length; i++) {\n tabContent[i].style.display = \"none\";\n }\n\n document.getElementById(tabName).style.display = \"flex\";\n}", "function showlevelGraph() {\n switch (LevelIdentifier) {\n case 1:\n if (noDataAvailable && hasProgramChanged == false)\n $('#divlevelchart').css(\"display\", \"none\");\n else\n $('#divlevelchart').css(\"display\", \"block\");\n\n $('#divleveldata').css(\"display\", \"none\");\n $('#divleveldetail').css(\"display\", \"none\");\n break;\n case 2:\n $('#divlevel2chart').css(\"display\", \"block\");\n $('#divlevel2data').css(\"display\", \"none\");\n $('#divlevel2detail').css(\"display\", \"none\");\n break;\n case 3:\n $('#divlevel3chart').css(\"display\", \"block\");\n $('#divlevel3data').css(\"display\", \"none\");\n $('#divlevel3detail').css(\"display\", \"none\");\n break;\n\n }\n}", "function showTab(selectedID, _refresh, _animationOn ) {\r\n\r\n //parametrit muuttujiksi\r\n var refresh = (typeof _refresh === 'undefined') ? false : _refresh;\r\n var animation = (typeof _animationOn === 'undefined') ? true : _animationOn;\r\n\r\n // korosta menun valintaa\r\n if (chartAnimationReady === true) {\r\n for (var id in tabLi) {\r\n if (id == selectedID) {\r\n tabLi[id].className = 'active';\r\n } else {\r\n tabLi[id].className = '';\r\n }\r\n }\r\n }\r\n\r\n //Vaihda sisalto\r\n doTabChange(selectedID, refresh, animation);\r\n\r\n}" ]
[ "0.7116724", "0.67973834", "0.6741595", "0.6683811", "0.6567229", "0.65133363", "0.6511479", "0.6489277", "0.64860547", "0.6441037", "0.6407865", "0.63903385", "0.63262546", "0.63157994", "0.631398", "0.631018", "0.62997675", "0.6296913", "0.62897027", "0.628574", "0.6282097", "0.62682897", "0.6265471", "0.6263988", "0.62531614", "0.624584", "0.622702", "0.6211417", "0.6195266", "0.6162677", "0.6123413", "0.6115865", "0.611195", "0.6111092", "0.6101959", "0.61014193", "0.6090205", "0.60879076", "0.6087223", "0.608698", "0.6085801", "0.60831404", "0.60765207", "0.60680884", "0.60628915", "0.60609245", "0.6046531", "0.6043436", "0.6040879", "0.60324275", "0.60296637", "0.6027614", "0.60151005", "0.6012688", "0.60109323", "0.6004413", "0.5991768", "0.59909785", "0.5989249", "0.5982506", "0.59749156", "0.5970943", "0.59625465", "0.59540427", "0.5951768", "0.5951417", "0.59438413", "0.59333193", "0.59317493", "0.59315675", "0.59314847", "0.59215987", "0.59191394", "0.59144276", "0.59128684", "0.59094983", "0.5905706", "0.59022063", "0.58959717", "0.58882457", "0.58819777", "0.5881073", "0.58801824", "0.58760244", "0.5875226", "0.58744746", "0.5871318", "0.586857", "0.58648115", "0.5864245", "0.5856671", "0.5854971", "0.5853066", "0.58505857", "0.584418", "0.5831039", "0.5823362", "0.5822742", "0.5822535", "0.5822252", "0.58188564" ]
0.0
-1
global, used for tooltips
function displayLoadGraph(node_id) { if (! (node_id in nodes)) { consoleWarn("Cannot display load graph for unknown node:", node_id); return; } load_redraw = false; var node_name = node_id; var low_threshold = 0; var high_threshold = 100; var max_tps = 4.999; if ("state" in nodes[node_id]) { if ("name" in nodes[node_id].state) { node_name = nodes[node_id].state.name; } if ("low_threshold" in nodes[node_id].state) { low_threshold = nodes[node_id].state.low_threshold; } if ("high_threshold" in nodes[node_id].state) { high_threshold = nodes[node_id].state.high_threshold; } if ("hard_max_tp" in nodes[node_id].state) { max_tps = +nodes[node_id].state.hard_max_tp + 0.999; } } var load_data = []; if ("load" in nodes[node_id]) { load_data = nodes[node_id].load; } var t1 = new Date().getTime(); // now var t0 = t1 - oldLoadGraphPeriod * 60 * 1000; // default: -20 minutes // rdcchhb - check the received tp_data and load_data // consoleAddMessage("#console1", CONSOLE_INFO, '[rdcchhb] current time is "' +t1 + '"'); // setup plot var colors = [ "#d1d2d4", "#89ba17", "#e32119", "#00a9d4", "#d1d2d4" ]; var colorsbg = [ "#e1e2e3", "#d5e4af", "#f6b495", "#badeee", "#e1e2e3" ]; var options = { series: { shadowSize: 0 }, grid: { hoverable: true }, xaxis: { min: t0, max: t1, mode: "time", timezone: "browser" }, yaxes: [ { min: 0, max: 100, color: "#00a9d4", tickFormatter: function(v, axis) { return v + "% "; } }, { min: 0, max: max_tps, tickDecimals: 0, position: "right", color: "#b1b3b4" } ], legend: { position: 'nw', sorted: true }, colors: colors }; var lowLine = [[t0, low_threshold], [t1, low_threshold]]; var highLine = [[t0, high_threshold], [t1, high_threshold]]; var tp_data = []; tp_labels = []; if ("events" in nodes[node_id]) { var num_tp = 0; for (var e = 0; e < nodes[node_id].events.length; e++) { var event_type = nodes[node_id].events[e][1]; if (( event_type >= EVENT_NE_SCALE_OUT && event_type <= EVENT_NE_SCALE_IN_FAIL) || (event_type == EVENT_NE_UPDATED_INV)) { num_tp = nodes[node_id].events[e][2]; var event_time = nodes[node_id].events[e][0] // protect against events happening exactly at the same time if ((tp_data.length == 0) || (tp_data[tp_data.length - 1][0] != event_time)) { tp_data.push( [ event_time, num_tp ] ); if (event_type == EVENT_NE_SCALE_OUT) { tp_labels.push("Scaling out"); } else if (event_type == EVENT_NE_SCALE_OUT_DONE) { tp_labels.push("Finished scaling out"); } else if (event_type == EVENT_NE_SCALE_OUT_FAIL) { tp_labels.push("Failed scaling"); } else if (event_type == EVENT_NE_SCALE_IN) { tp_labels.push("Scaling in"); } else if (event_type == EVENT_NE_SCALE_IN_DONE) { tp_labels.push("Finished scaling in"); } else if (event_type == EVENT_NE_SCALE_IN_FAIL) { tp_labels.push("Failed scaling"); } else if (event_type == EVENT_NE_UPDATED_INV) { tp_labels.push("Updated inventory"); } else { tp_labels.push(""); } } } } // set a point in the future for the number of TPs if (num_tp > 0) { if (nodes[node_id].state.status == STATUS_SCALING_IN) { num_tp--; } else if (nodes[node_id].state.status == STATUS_SCALING_OUT) { num_tp++; } tp_data.push( [ t1 + 600 * 1000, num_tp ] ); } } loadGraph = $.plot($("#loadgraph"), [ { data: tp_data, lines: { fill: true }, label: "Number of traffic processors", yaxis: 2 }, lowLine, highLine, { data: load_data, label: node_name + " load" }, ], options); // rdcchhb - check the received tp_data and load_data // consoleAddMessage("#console1", CONSOLE_INFO, '[rdcchhb] loadgraph subroutine. load_data is "' +load_data + '"'); // consoleAddMessage("#console1", CONSOLE_INFO, '[rdcchhb] loadgraph subroutine. tp_data is "' +tp_data + '"'); // consoleAddMessage("#console1", CONSOLE_INFO, '[rdcchhb] loadgraph subroutine. numb_tp is "' +num_tp + '"'); /* var tx = (t0 + t1) / 2; var o = loadGraph.pointOffset( { x: tx, y: 1, yaxis: 2 } ); var ctx = loadGraph.getCanvas().getContext("2d"); ctx.beginPath(); o.left += 4; ctx.moveTo(o.left, o.top); ctx.lineTo(o.left, o.top - 10); ctx.lineTo(o.left + 10, o.top - 5); ctx.lineTo(o.left, o.top); ctx.fillStyle = "#000"; ctx.fill(); */ $("#loadgraph").bind("plothover", function (event, pos, item) { if (item) { if (previousPoint != item.dataIndex) { previousPoint = item.dataIndex; $("#graphtooltip").remove(); var d = new Date(item.datapoint[0]); var h = d.getHours(); if (h < 10) { h = '0' + h; } var m = d.getMinutes(); if (m < 10) { m = '0' + m; } var s = d.getSeconds(); if (s < 10) { s = '0' + s; } var msg = "Time: " + h + ":" + m + ":" + s + "<br />"; if (item.seriesIndex == 0) { if ((item.dataIndex >= 0) && (item.dataIndex <= tp_labels.length) && tp_labels[item.dataIndex]) { msg += tp_labels[item.dataIndex] + "<br />"; } msg += "Number of TPs: <b>" + item.datapoint[1] + "</b>"; } else if (item.seriesIndex == 1) { msg = "Low threshold: <b>" + item.datapoint[1] + "%</b>"; } else if (item.seriesIndex == 2) { msg = "High threshold: <b>" + item.datapoint[1] + "%</b>"; } else if (item.seriesIndex == 3) { msg += node_name + " load: <b>" + item.datapoint[1].toFixed(2) + "%</b>"; } else if (item.seriesIndex == 4) { msg += "Event: ???"; } graphShowTooltip(item.pageX, item.pageY, colorsbg[item.seriesIndex], colors[item.seriesIndex], msg); } } else { $("#graphtooltip").remove(); previousPoint = null; } }); var tphtml = '<table><tbody><tr>'; var sorted_vms = Object.keys(nodes[node_id].vms).sort(); for (var i = 0; i < sorted_vms.length; i++) { var vm = nodes[node_id].vms[sorted_vms[i]]; // rdcchhb - check the received tp_data and load_data // consoleAddMessage("#console1", CONSOLE_INFO, '[rdcchhb] vm"'+i+'".status is "' +vm.status+ '"'); if (vm.type == VM_TSP_CSCF_TP || vm.type == VM_TSP_MTAS_TP || vm.type == VM_CBA_CSCF_PL || vm.type == VM_CBA_MTAS_PL || vm.type == VM_LAPZ_MSC_CP || vm.type == VM_SEA_MSC_CP) { if (vm.status == "poweredOn") { if (("load" in vm) && (vm.load.length > 0)) { tphtml += add_tp_bar(vm.load[vm.load.length - 1][1]); } else { tphtml += add_tp_bar(0); } } else { tphtml += add_tp_bar(-1); } } } tphtml += '</tr></tbody></table>'; $("#loadtps").html(tphtml); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n setUpToolTip();\n}", "function tooltips ( ) {\r\n\r\n\t\t// Tooltips are added with options.tooltips in original order.\r\n\t\tvar tips = scope_Handles.map(addTooltip);\r\n\r\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\r\n\r\n\t\t\tif ( !tips[handleNumber] ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvar formattedValue = values[handleNumber];\r\n\r\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\r\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\r\n\t\t\t}\r\n\r\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\r\n\t\t});\r\n\t}", "get tooltip() {}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips() {\n\n // Tooltips are added with options.tooltips in original order.\n var tips = scope_Handles.map(addTooltip);\n\n bindEvent('update', function (values, handleNumber, unencoded) {\n\n if (!tips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n tips[handleNumber].innerHTML = formattedValue;\n });\n }", "function tooltips() {\n removeTooltips();\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n bindEvent(\"update\" + INTERNAL_EVENT_NS.tooltips, function (values, handleNumber, unencoded) {\n if (!scope_Tooltips || !options.tooltips) {\n return;\n }\n if (scope_Tooltips[handleNumber] === false) {\n return;\n }\n var formattedValue = values[handleNumber];\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }", "_addTooltips() {\n $(this.el.querySelectorAll('[title]')).tooltip({\n delay: { show: 500, hide: 0 }\n });\n }", "function tooltips() {\n removeTooltips();\n\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n\n bindEvent(\"update.tooltips\", function(values, handleNumber, unencoded) {\n if (!scope_Tooltips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }", "function tooltips() {\n removeTooltips();\n\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n\n bindEvent(\"update.tooltips\", function(values, handleNumber, unencoded) {\n if (!scope_Tooltips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }", "function tooltips() {\n removeTooltips();\n\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n\n bindEvent(\"update.tooltips\", function(values, handleNumber, unencoded) {\n if (!scope_Tooltips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }", "function tooltips() {\n removeTooltips();\n\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n\n bindEvent(\"update.tooltips\", function(values, handleNumber, unencoded) {\n if (!scope_Tooltips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }", "function initializeTooltips() {\n // Download document link\n $('.download-document').tooltip({\n 'show': true,\n 'placement': 'top',\n 'title': \"Download the document\"\n });\n\n // Delete document link\n $('.delete-document').tooltip({\n 'show': true,\n 'placement': 'top',\n 'title': \"Delete the document\"\n });\n\n // Upload document link\n $('.upload-document').tooltip({\n 'show': true,\n 'placement': 'top',\n 'title': \"Upload document\"\n });\n\n // Create new folder link\n $('.create-folder').tooltip({\n 'show': true,\n 'placement': 'top',\n 'title': \"Create new folder\"\n });\n}", "getTooltip(){return this.__tooltip}", "addHighlighTooltip () {\n }", "tooltipClicked() {}", "function initInstanceInfoTooltip() {\n jQuery('#instance-tooltip').tooltip();\n}", "function toolTipInit() {\n\t\n\t\t$('.menu li a').tooltip({\n\t\t\tplacement: 'right'\n\t\t});\n\t}", "function tooltips() {\r\n\t$('.tooltip-link').tooltip();\r\n}", "function bindTooltip(){\n bindTooltipSkin(\".b-tooltip, .b-panel-icons-item a,.b-tool, .b-image-nav, .b-help, .b-title\",\"qtip-light\");\n }", "showToolTip_(event) {\n this.updateToolTip_(event);\n }", "function initTooltip() {\n angular.element(elem).tooltip({\n title: scope.bsTip,\n placement: scope.bsTipPlacement\n });\n }", "init() {\n tooltipsList.push( this );\n\n // First initiated tooltip -> add the global tooltip element\n if ( tooltipsList.length === 1 ) appendTooltipElement();\n }", "function setTooltips()\r\n{\r\n $(function()\r\n {\r\n if ($(\".tooltip\").length > 0)\r\n {\r\n $(\".tooltip\").tooltip({showURL: false});\r\n }\r\n });\r\n}", "function toolTipInit() {\r\n\t\r\n\t\t$('.social-icon-top ul li a, ul.footer-social li a').tooltip({\r\n\t\t\tplacement: 'bottom'\r\n\t\t});\r\n\t}", "function tooltips ( ) {\r\n\r\n\t\t\tif ( options.dir ) {\r\n\t\t\t\toptions.tooltips.reverse();\r\n\t\t\t}\r\n\r\n\t\t\t// Tooltips are added with options.tooltips in original order.\r\n\t\t\tvar tips = scope_Handles.map(addTooltip);\r\n\r\n\t\t\tif ( options.dir ) {\r\n\t\t\t\ttips.reverse();\r\n\t\t\t\toptions.tooltips.reverse();\r\n\t\t\t}\r\n\r\n\t\t\tbindEvent('update', function(f, o, r) {\r\n\t\t\t\tif ( tips[o] ) {\r\n\t\t\t\t\ttips[o].innerHTML = options.tooltips[o] === true ? f[o] : options.tooltips[o].to(r[o]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}", "function doTooltip(e, msg) {\nif ( typeof Tooltip == \"undefined\" || !Tooltip.ready ) return;\nTooltip.show(e, msg);\n}", "function init_tooltips(){\n \n $(\".tooltip-bot, .tooltip-bot a, .nav-social-links a\").tooltip({\n placement: \"bottom\"\n });\n \n $(\".tooltip-top, .tooltip-top a\").tooltip({\n placement: \"top\"\n });\n \n \n $(\".tooltip-right, .tooltip-right a\").tooltip({\n placement: \"right\"\n });\n \n \n $(\".tooltip-left, .tooltip-left a\").tooltip({\n placement: \"left\"\n });\n \n }", "function Tip() {\n tt_Tip(arguments, null);\n}", "function init_tooltips(){\n\n $(\".tooltip-bot, .tooltip-bot a, .nav-social-links a\").tooltip({\n placement: \"bottom\"\n });\n\n $(\".tooltip-top, .tooltip-top a\").tooltip({\n placement: \"top\"\n });\n\n }", "function tooltips ( ) {\n\n\t\tif ( options.dir ) {\n\t\t\toptions.tooltips.reverse();\n\t\t}\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tif ( options.dir ) {\n\t\t\ttips.reverse();\n\t\t\toptions.tooltips.reverse();\n\t\t}\n\n\t\tbindEvent('update', function(f, o, r) {\n\t\t\tif ( tips[o] ) {\n\t\t\t\ttips[o].innerHTML = options.tooltips[o] === true ? f[o] : options.tooltips[o].to(r[o]);\n\t\t\t}\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\tif ( options.dir ) {\n\t\t\toptions.tooltips.reverse();\n\t\t}\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tif ( options.dir ) {\n\t\t\ttips.reverse();\n\t\t\toptions.tooltips.reverse();\n\t\t}\n\n\t\tbindEvent('update', function(f, o, r) {\n\t\t\tif ( tips[o] ) {\n\t\t\t\ttips[o].innerHTML = options.tooltips[o] === true ? f[o] : options.tooltips[o].to(r[o]);\n\t\t\t}\n\t\t});\n\t}", "function TipMenu()\n{\n\tm_tt_Tip(arguments, null);\n}", "function tooltips ( ) {\r\n\r\n\t\tif ( options.dir ) {\r\n\t\t\toptions.tooltips.reverse();\r\n\t\t}\r\n\r\n\t\t// Tooltips are added with options.tooltips in original order.\r\n\t\tvar tips = scope_Handles.map(addTooltip);\r\n\r\n\t\tif ( options.dir ) {\r\n\t\t\ttips.reverse();\r\n\t\t\toptions.tooltips.reverse();\r\n\t\t}\r\n\r\n\t\tbindEvent('update', function(f, o, r) {\r\n\t\t\tif ( tips[o] ) {\r\n\t\t\t\ttips[o].innerHTML = options.tooltips[o] === true ? f[o] : options.tooltips[o].to(r[o]);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function tooltips ( ) {\n\t\n\t\t\tif ( options.dir ) {\n\t\t\t\toptions.tooltips.reverse();\n\t\t\t}\n\t\n\t\t\t// Tooltips are added with options.tooltips in original order.\n\t\t\tvar tips = scope_Handles.map(addTooltip);\n\t\n\t\t\tif ( options.dir ) {\n\t\t\t\ttips.reverse();\n\t\t\t\toptions.tooltips.reverse();\n\t\t\t}\n\t\n\t\t\tbindEvent('update', function(f, o, r) {\n\t\t\t\tif ( tips[o] ) {\n\t\t\t\t\ttips[o].innerHTML = options.tooltips[o] === true ? f[o] : options.tooltips[o].to(r[o]);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "set tooltip(value) {}", "function toolTipHTML() {\n return \"100\";\n }", "function tooltip_show(rootNode)\n \t\t\t\t{\n \t\t\t\t\tglobal_hover={id:rootNode.data.id,label:rootNode.data.label,category:rootNode.data.type};\n \t\t\t\t\t$(\"#hover_tooltip\").css({'left':rootNode.x+60,'top':rootNode.y+141});\n \t\t\t\t\t$(\"#hover_tooltip\").css({'display':'block'});\n\t\t\t\t\t}", "function enableToolTipForHeader(){\r\n\t$('#merchantUpload').tooltip({title: \"Upload new set of images for an application.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"/search\"]').tooltip({title: \"Search existing or previously uploaded application from the system.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"/followup\"]').tooltip({title: \"Search applications for document followup from Head office.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"/signup\"]').tooltip({title: \"Register new merchant promoter or staff in Online Submission Application.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"#logout\"]').tooltip({title: \"Logout to OSA-PH.\", animation: true,placement: \"auto\"});\r\n}", "function setTooltip(uniqueID){\n\t\tvar tempObject = $fp.courseObject[uniqueID];\t\t\n\t\tvar courseID = tempObject.courseID;\n\t\tvar uniqueID = tempObject.uniqueID;\n\t\tvar courseNo = tempObject.courseNo;\n\t\tvar department = tempObject.department;\n\t\tvar name = tempObject.name;\n\t\tvar description = tempObject.description;\n\t\tvar noCredits = tempObject.noCredits;\n\t\tvar gradeOption = tempObject.gradeOption;\n\t\tvar prerequisites = tempObject.prerequisites;\n\t\tvar corequisites = tempObject.corequisites;\n\t\tvar countsAs = tempObject.countsAs;\n\t\tvar title = \"<div style='max-height: 150px; overflow: auto; position: relative;'>\";\n\t\t\n\t\ttitle += \"<b>Name:</b> <span class='editable' contenteditable='true' id='tooltip_name_\" + uniqueID + \"'>\" + name + \"</span><br>\";\n\t\ttitle += \"<b>Department & Course No:</b> <span class='editable' contenteditable='true' id='tooltip_department_course_\" + uniqueID + \"'>\" + department + \" \" + courseNo + \"</span><br>\";\n\t\ttitle += \"<b>Counts As:</b> <span class='editable' contenteditable='true' id='tooltip_countsAs_\" + uniqueID + \"'>\" + countsAs + \"</span><br>\";\n\t\ttitle += \"<b>Description:</b> <span class='editable' contenteditable='true' id='tooltip_description_\" + uniqueID + \"'>\" + description + \"</span><br>\";\n\t\ttitle += \"<b>No. Credits:</b> <span class='editable' contenteditable='true' id='tooltip_noCredits_\" + uniqueID + \"'>\" + noCredits + \"</span><br>\";\n\t\ttitle += \"<b>Grade Option:</b> <span class='editable' contenteditable='true' id='tooltip_gradeOption_\" + uniqueID + \"'>\";\n\t\tswitch (gradeOption){\n\t\t\tcase \"S\":\n\t\t\t\ttitle += \"(S)atisfactory/No Credit</span><br>\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"L\":\n\t\t\t\ttitle += \"(L)etter Grade</span><br>\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"B\":\n\t\t\t\ttitle += \"(B)oth S/NC or Letter Grade</span><br>\";\n\t\t\t\tbreak;\t\n\t\t\t\n\t\t\tcase \"O\":\n\t\t\t\ttitle += \"(O)ther</span><br>\";\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\ttitle += \"</span><br>\";\n\t\t\t\tbreak;\n\t\t}\n\t\t \n\t\ttitle += \"<b>Prerequisites:</b> <span class='editable' contenteditable='true' id='tooltip_prerequisites_\" + uniqueID + \"'>\" + prerequisites + \"</span><br>\";\n\t\ttitle += \"<b>Corequisites:</b> <span class='editable' contenteditable='true' id='tooltip_corequisites_\" + uniqueID + \"'>\" + corequisites + \"</span><br>\";\n\t\ttitle += \"<br></div>\";\n\t\t \n\t\t//updates the courseObject subobject for the unique course to reflect the correct data (replaces old object)\n\t\t\t\t\t\t\t\t\n\t\t$('#' + uniqueID).prop(\"title\",title);\n\t\t\n\t\t$('#' + uniqueID).tooltip({\n\t\t\tposition: \t'top center',\n\t\t\toffset:\t\t[10, 50],\n\t\t\ttipClass:\t'tooltip',\n\t\t\tevents: \t{\n\t\t\t\tdef:\t\t'click, mouseout mousedown'\t\n\t\t\t},\n\t\t\tonBeforeShow: function(){\n\t\t\t\tvar item = this.getTrigger();\n\t\t\t\t$(item).toggleClass('selected',true);\n\t\t\t},\n\t\t\t\n\t\t\tonHide: function(){\n\t\t\t\tvar item = this.getTrigger();\n\t\t\t\t$(item).toggleClass('selected',false);\n\t\t\t}\n\t\t});\n\t\t\n\t\t//function for editing\n\t\t$('[contenteditable]').live('focus', function() {\n \t\tvar $this = $(this);\n \t\t\t$this.data('before', $this.html());\n\t\t\t\n\t\t\tvar idArray = $this.attr(\"id\").split(\"_\");\n\t\t\t\t\n\t\t\tvar type = idArray[1];\n\t\t\tvar uniqueID = idArray[2];\n\t\t\t\n\t\t\tif (type == \"countsAs\"){\n\t\t\t\t$fp.courseObject[uniqueID].previousCountsAs = $this.html();\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $this;\n\t\t}).live('blur keyup paste', function(event) {\n\t\t\tvar $this = $(this);\n \t\tif ($this.data('before') !== $this.html()) {\n \t\t\t\t\t\t\t\n\t\t\t\t$this.data('before', $this.html());\n\t\t\t\t\n\t\t\t\tvar change = jQuery.Event(\"change\");\n\t\t\t\t\n\t\t\t\t//**********<event_handling>**********//\n\t\t\t\t\t\n\t\t\t\tvar idArray = $this.attr(\"id\").split(\"_\");\n\t\t\t\t\n\t\t\t\tvar type = idArray[1];\n\t\t\t\tvar uniqueID = idArray[2];\n\t\t\t\tvar selector = \"#\" + uniqueID;\n\t\t\t\t\t\t\t\t\n\t\t\t\tif (type != \"corequisites\" && type != \"prerequisites\" && type != \"countsAs\"){\n\t\t\t\t\t$fp.courseObject[uniqueID][type] = $this.html();\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if (type == \"countsAs\"){\n\t\t\t\t\t$fp.courseObject[uniqueID][type] = $this.html();\n\t\t\t\t\tvalidateOnCourse(uniqueID);\n\t\t\t\t\t$fp.courseObject[uniqueID].previousCountsAs = $this.html();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\tvar tempString = $this.text();\n\t\t\t\t\tvar tempArray = tempString.split(\",\");\n\t\t\t\t\tfor (var req in tempArray){\n\t\t\t\t\t\tvar temp = tempArray[req].toUpperCase();\n\t\t\t\t\t\ttempArray[req] = trim(temp);\n\t\t\t\t\t}\n\t\t\t\t\t$fp.courseObject[uniqueID][type] = tempArray; \n\t\t\t\t\t\n\t\t\t\t\tvar currentLocation = $(selector).closest('ul').attr('id');\n\t\t\t\t\tvalidateCourse(uniqueID, currentLocation);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($this.text() == \"\"){\n\t\t\t\t\tvar blankFieldTimeout = setTimeout(function(){\n\t\t\t\t\t\tif ($this.text() == \"\") $this.text(\"n/a\");\n\t\t\t\t\t},1000);\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\telse{\n\t\t\t\t\tif (window.blankFieldTimeout){\n\t\t\t\t\t\tclearTimeout(blankFieldTimeout);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//**********</event_handling>**********//\n \t\t}\n \t\t return $this;\n\t\t});\n}", "function updateTooltips() {\n jQuery('.tooltip').tooltip({showURL: false });\n}", "function showTooltip_onMouseOver(){\n//----------------------------------------------------------------------------------------------------------------------------\t\n\n\n this.dispalyTooltips = function(toolz){ //args(tooplips array)\n // request mousemove events\n $(\"#graph\").mousemove(function (e) {\n\t\t var onMouseOver_file = new onMouseOver();//uses other module in this very file\n onMouseOver_file.handleMouseMoveAction(e, toolz); //args(mouse event, tooplips array)\n });\n\n } \n}", "function tooltips() {\n if (options.dir) {\n options.tooltips.reverse();\n }\n // Tooltips are added with options.tooltips in original order.\n var tips = scope_Handles.map(addTooltip);\n if (options.dir) {\n tips.reverse();\n options.tooltips.reverse();\n }\n bindEvent('update', function(f, o, r) {\n if (tips[o]) {\n tips[o].innerHTML = options.tooltips[o] === true ? f[o] :\n options.tooltips[o].to(r[o]);\n }\n });\n }", "toggleTooltips() {\n self.enableTooltips = !self.enableTooltips;\n }", "function tooltipInit() {\n $('[data-toggle=\"tooltip\"]').tooltip();\n}", "function title(){\n\n}", "function initToolTips() {\n $(\"[title]:not([data-hasqtip])\").each(function() {\n var $this = $(this);\n $this.qtip({\n style: {\n classes: 'qtip-bootstrap',\n },\n position: {\n my: 'top center', // Position my top left...\n at: 'bottom center', // at the bottom right of...\n target: $this, // my target,\n viewport: $(window)\n },\n events: {\n render: function(event, api) {\n // Extract the title translation ID\n var transIDs = $this.data('i18n').split(';');\n var titleTransID = transIDs[0].split(']')[1];\n\n // Remove the translation data-i18ns for title (but not text node)\n if (transIDs.length === 1) {\n $this.removeAttr('data-i18n'); // Only had title, delete it\n } else if (transIDs.length === 2) {\n $this.attr('data-i18n', transIDs[1]); // Set to the main text ID\n }\n\n // Chuck the new title trans ID (without the [title]) onto the tooltip\n api.elements.content.attr('data-i18n', titleTransID);\n }\n }\n });\n });\n}", "function load_tooltips() {\n $('[data-toggle=\"tooltip\"]').tooltip()\n}", "function titleTooltip(elem){\n $(elem).hover(function(){\n /// Hover over code\n var title = $(this).attr('title');\n $(this).data('tipText', title).removeAttr('title');\n $('<p class=\"jtt\"></p>')\n .text(title)\n .appendTo('body')\n .fadeIn('slow');\n }, function() {\n /// Hover out code\n $(this).attr('title', $(this).data('tipText'));\n $('.jtt').remove();\n }).mousemove(function(e) {\n var mousex = e.pageX + 20; /// Get X coordinates\n var mousey = e.pageY + 10; /// Get Y coordinates\n $('.jtt').css({ top: mousey, left: mousex })\n });\n}", "function toolTip() {\n $('[data-toggle=\"tooltip\"]').tooltip();\n}", "function init() {\r\n\tlogopos = document.getElementById('logostrip');\r\n\twindow.tooltip = document.createElement('div');\r\n\tlogopos.parentNode.insertBefore(tooltip, logopos.nextSibling);\r\n\t\r\n\twindow.tooltip.setAttribute(\"style\",\"-moz-border-radius:10px;\");\r\n\twindow.tooltip.style.position = \"absolute\";\r\n\twindow.tooltip.style.top = \"0\";\r\n\twindow.tooltip.style.left = \"0\";\r\n\twindow.tooltip.style.zIndex = \"10\";\r\n\twindow.tooltip.style.visibility = \"hidden\";\r\n\twindow.tooltip.style.backgroundColor = \"#EFF1F3\";\r\n\twindow.tooltip.style.width = \"500px\";\r\n\twindow.tooltip.style.borderWidth = \"1px\";\r\n\twindow.tooltip.style.borderStyle = \"solid\";\r\n\twindow.tooltip.innerHTML = \"Loading...\";\r\n\twindow.tooltip.style.textAlign = \"left\";\r\n\twindow.tooltip.style.maxHeight = \"300px\";\r\n\twindow.tooltip.style.overflow = \"scroll\";\r\n\twindow.tooltip.style.padding = \"5px\";\r\n\twindow.tooltip.setAttribute(\"onMouseOut\",\"if (mouseReallyOut(this, event)) { window.tooltip.style.visibility='hidden';}\");\r\n\t\r\n}", "function enableTooltip() {\n\tvar hoverMsg = ( _sessLang == SESS_LANG_CHN ) ? \"如果選擇列表中沒有,選擇任何稱謂然後用“更改”的方式去更正!\" : \"If not found in the dropdown selection list, select any and then use Edit to correct it!\";\n\t$(document).tooltip({content: hoverMsg});\n\t$(document).tooltip(\"enable\");\n} // enableTooltip()", "function updateTooltips(){\r\n\t//Bind Tooltips with Buttons\r\n\t$(\"button[rel='tooltip']\").tooltip({\r\n\t\tplacement:'top',\r\n\t\ttrigger:'hover',\r\n\t\tanimation:'true'\r\n\t});\r\n}", "getToolTip () {\n if (this._toolTip) {\n return this._toolTip;\n }\n }", "function setResultTooltips()\n {\n var textLength = my.current.subunitText.length\n var charNoun = textLength == 1 ? 'character' : 'characters'\n\n // Speed tooltip\n my.html.speed.title =\n 'You have typed ' + textLength + ' ' + charNoun +\n ' in\\n' +\n Util.prettyTime(my.current.timeElapsed) + '.\\n\\n' +\n 'Your typing speed is\\n' +\n my.current.wpm + ' words per minute, or\\n' +\n my.current.cpm + ' characters per minute.'\n\n\n // Error rate tooltip\n var errorRateTooltip\n var accuracyTooltip\n\n // Update error rate\n if (my.current.errorRate == Number.POSITIVE_INFINITY) {\n errorRateTooltip = '\\u221e'\n accuracyTooltip = 0\n } else {\n errorRateTooltip = parseFloat(my.current.errorRate.toFixed(1))\n accuracyTooltip = 100 - errorRateTooltip\n }\n\n var errorNoun = my.current.errors == 1 ? 'error' : 'errors'\n\n var title =\n 'You have typed ' + textLength + ' ' + charNoun +\n '.\\n' +\n 'You have made ' + my.current.errors + ' ' +\n errorNoun + '.\\n' +\n 'Your error rate is ' + errorRateTooltip + '%.\\n' +\n 'Your accuracy is ' + accuracyTooltip + '%.\\n'\n\n my.html.error.title = title\n }", "function init() { \n \n posHTML.setDragnDrop()\n \n //Tooltip\n $(\"a\").tooltip('show')\n $('a').tooltip({html: true}) \n $(\"a\").tooltip('hide') \n}", "function ttMouseOver() {\nif (tooltipsOn && wgCanonicalNamespace != \"Special\" && (itemTooltips || npcTooltips || questTooltips || quickTooltips || abilityTooltips || otherTooltips)) {\n$(\"body\").mouseover(hideTip);\n$(\"#bodyContent\").append('<div id=\"tfb\" class=\"htt\"></div><div id=\"templatetfb\" class=\"htt\"><div>');\nif (itemTooltips) $(\"span.itemlink,span.setlink\").each(bindTT);\nif (npcTooltips) $(\"span.npclink\").each(bindTT);\nif (questTooltips) $(\"span.questlink\").each(bindTT);\nif (achievementTooltips) $(\"span.achievementlink\").each(bindTT);\nif (abilityTooltips) $(\"span.abilitylink\").each(bindTT);\nif (otherTooltips) $(\"span.ajaxttlink\").each(bindTT);\nif (quickTooltips) $(\"span.tttemplatelink\").each(function () {\n$(this).mouseover(showTemplateTip);\n$(this).mouseout(hideTemplateTip);\n$(this).mousemove(moveTip);\n});\n}\n}", "function updateHotkeyTooltips() {\n Engine.GetGUIObjectByName(\"chatInput\").tooltip =\n translateWithContext(\"chat input\", \"Type the message to send.\") +\n \"\\n\" +\n colorizeAutocompleteHotkey() +\n colorizeHotkey(\n \"\\n\" + translate(\"Press %(hotkey)s to open the public chat.\"),\n \"chat\"\n ) +\n colorizeHotkey(\n \"\\n\" +\n (g_IsObserver\n ? translate(\"Press %(hotkey)s to open the observer chat.\")\n : translate(\"Press %(hotkey)s to open the ally chat.\")),\n \"teamchat\"\n ) +\n colorizeHotkey(\n \"\\n\" +\n translate(\n \"Press %(hotkey)s to open the previously selected private chat.\"\n ),\n \"privatechat\"\n );\n\n Engine.GetGUIObjectByName(\"idleWorkerButton\").tooltip =\n colorizeHotkey(\"%(hotkey)s\" + \" \", \"selection.idleworker\") +\n translate(\"Find idle worker\");\n\n Engine.GetGUIObjectByName(\"diplomacyColorsButton\").tooltip =\n colorizeHotkey(\"%(hotkey)s\" + \" \", \"session.diplomacycolors\") +\n translate(\"Toggle Diplomacy Colors\");\n\n Engine.GetGUIObjectByName(\"diplomacyColorsWindowButton\").tooltip =\n colorizeHotkey(\"%(hotkey)s\" + \" \", \"session.diplomacycolors\") +\n translate(\"Toggle Diplomacy Colors\");\n\n Engine.GetGUIObjectByName(\"tradeHelp\").tooltip = colorizeHotkey(\n translate(\n \"Select one type of goods you want to modify by clicking on it, and then use the arrows of the other types to modify their shares. You can also press %(hotkey)s while selecting one type of goods to bring its share to 100%%.\"\n ),\n \"session.fulltradeswap\"\n );\n}", "function jsuGoogleAnalFreeTip (event){\n\tvar szTip='<div style=\"width:300px;\" align=\"left\">Click to show <b>Google Analytics Page</b><BR/>' + \n 'with the <b>Number of JSU downloads</b></div>';\n\tTip (szTip);\n}", "function ActivateTooltip() {\n // creates the tooltip to display the y point\n $(\"<div id='tooltip'></div>\").css({\n position: \"absolute\",\n display: \"none\",\n border: \"1px solid #fdd\",\n padding: \"2px\",\n \"background-color\": \"#fee\",\n opacity: 0.80\n }).appendTo(\"body\");\n // displays the tooltip on hover\n $(\"#placeholder\").bind(\"plothover\", function (event, pos, item) {\n if (item) {\n var x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2);\n $(\"#tooltip\").html(y)\n .css({ top: item.pageY + 5, left: item.pageX + 5 })\n .fadeIn(200);\n }\n else {\n $(\"#tooltip\").hide();\n }\n });\n }", "function updateTooltipMessage(message) {\n // Update the tooltip for the next time it mouses in/out\n tooltipMessage = message;\n}", "function updateTips(t) {\n\t\ttips.text(t)\n\t}", "function display_tip() {\n if (pause_on_tile === true) {\n g.paused = true;\n }\n\n show_description(g.progress); //description.js\n\n g.progress = g.progress + 1;\n}", "displayToolTip(item) {\n console.log(\"Hovering Over Item: \", item.name);\n }", "function showTooltips(evt) {\n\t\tif (tooltips_element) {\n\t\t\ttooltips_element.style.display = '';\n\t\t}\n\t}", "function displayTipFeed() {\n /* Build recent tips table on load */\n open_tiplink_tbl();\n}", "get tooltipClass() { return this._tooltipClass; }", "static get defaultTitle() { return 'Tool'; }", "function initTooltip() {\n\t if (!tooltip || !tooltip.node()) {\n\t // Create new tooltip div if it doesn't exist on DOM.\n\n\t var data = [1];\n\t tooltip = d3.select(document.body).select('#'+id).data(data);\n\n\t tooltip.enter().append('div')\n\t .attr(\"class\", \"nvtooltip \" + (classes ? classes : \"xy-tooltip\"))\n\t .attr(\"id\", id)\n\t .style(\"top\", 0).style(\"left\", 0)\n\t .style('opacity', 0)\n\t .style('position', 'fixed')\n\t .selectAll(\"div, table, td, tr\").classed(nvPointerEventsClass, true)\n\t .classed(nvPointerEventsClass, true);\n\n\t tooltip.exit().remove()\n\t }\n\t }", "function showTooltips(frame) {\n\n var tools = frame.tools;\n\n for (var i = 0; i < tools.length; i++) {\n var tool = tools[i];\n drawTip(tool, \"tool \" + i);\n saveTip(tool, i);\n }\n\n}", "function setHistoryTips() {\n setTips(\".author-pic\", \"left\");\n setTips(\".time-ago\");\n setTips(\".cut-content\");\n setTips(\".cut-url\", \"left\");\n setTimeAgo();\n}", "function prepareTooltip() {\n\t ttScope.title = attrs[prefix + 'Title'];\n\t if (contentParse) {\n\t ttScope.content = contentParse(scope);\n\t } else {\n\t ttScope.content = attrs[ttType];\n\t }\n\n\t ttScope.popupClass = attrs[prefix + 'Class'];\n\t ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n\t var placement = $position.parsePlacement(ttScope.placement);\n\t lastPlacement = placement[1] ? placement[0] + '-' + placement[1] : placement[0];\n\n\t var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n\t var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n\t ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n\t ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n\t }", "function ttMouseOver(foo) {\nif (tooltipsOn && getCookie(\"wiki-tiploader\") != \"no\") {\n$(\"#WikiaArticle\").mouseover(hideTip);\n$(\"#WikiaArticle\").append('<div id=\"tfb\" class=\"htt\"></div><div id=\"templatetfb\" class=\"htt\"><div>');\n$tfb = $(\"#tfb\");\n$ttfb = $(\"#templatetfb\");\n$htt = $(\"#tfb,#templatetfb\");\nif(foo==1){\n$(\"#WikiaArticle span.ajaxttlink\").each(bindTT);\n}\n$(\"#WikiaArticle span.tttemplatelink\").mouseover(showTemplateTip).mouseout(hideTemplateTip).mousemove(moveTip);\n}\n}", "function initTooltip() {\n if (!tooltip) {\n var body;\n if (chartContainer) {\n body = chartContainer;\n } else {\n body = document.body;\n }\n //Create new tooltip div if it doesn't exist on DOM.\n tooltip = d3.select(body).append(\"div\")\n .attr(\"class\", \"nvtooltip \" + (classes ? classes : \"xy-tooltip\"))\n .attr(\"id\", id);\n tooltip.style(\"top\", 0).style(\"left\", 0);\n tooltip.style('opacity', 0);\n tooltip.selectAll(\"div, table, td, tr\").classed(nvPointerEventsClass, true);\n tooltip.classed(nvPointerEventsClass, true);\n tooltipElem = tooltip.node();\n }\n }", "getTipIntrebare(){\n return INTREBARE_RASPUNS_SIMPLU\n }", "function registerTooltips()\n{\n\ttooltips=[];\n\t$(svgRoot).find(\"g[name]\").each(function( index ) \n\t{\n\t\tvar elem=$(this);\n\t\tvar name=elem.attr(\"name\");\n\t\tvar type=elem.attr(\"type\");\n\t\tvar comment=elem.attr(\"comment\");\n\t\tif(!type)\n\t\t\ttype=\"\";\n\t\tif(!comment)\n\t\t\tcomment=\"\";\n\t\t\t\n\t\tif(comment!=\"\")//only if comments exist\n\t\t{\t\t \n\t\t\tvar tooltip = new Opentip(elem, comment, type);\n\t\t\ttooltips.push(tooltip);\n\t\t}\n\t});\n\t\n}", "function clearResultTooltips()\n {\n my.html.speed.title = ''\n my.html.error.title = ''\n }", "function ShowHelp() {\n $('img').tooltip('show');\n}", "function updateProgressTooltip()\n {\n my.html.progress.title =\n 'This lesson contains ' + my.current.subunitText.length +\n ' characters.'\n }", "function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }", "get currentTooltip() {\n return this._defaultOrToggled(\n this.tooltip,\n this.toggledTooltip,\n this.isToggled\n );\n }", "function tooltip($parentId){\n\t\t$infoTooltip = $parentId.find('[id^=durMapInfo]');\n\t\tvar $input = $parentId.find('[id^=dCompressType]');\t\t\n\t\tvar $selected = $input.find(\"option:selected\");\n\n\t\tvar tooltipText = information.getText($selected.text());\n\t\n\t\t$infoTooltip.attr(\"data-original-title\",tooltipText); \n\t}", "function initTooltips() {\n $('span[class^=\"pl-\"]').each(function () {\n $(this).mouseenter(function () {\n showTooltip($(this));\n });\n\n $(this).mouseleave(function () {\n hideTooltip($(this));\n });\n });\n}", "setupTooltipHandlers() {\n this.button.onmouseenter = () => {\n this.tooltip.showTooltip();\n };\n\n this.button.onmouseleave = () => {\n this.tooltip.hideTooltip();\n };\n }", "function showImpTooltip(datum) {\r\n sitespan = imp_tooltip.select(\"#site\")\r\n .text(site_lookup[datum.site].name || 'zah?')\r\n ;\r\n sitespan = imp_tooltip.select(\"#area\")\r\n .text(da_lookup[datum[\"data area\"]].name)\r\n ;\r\n sitespan = imp_tooltip.select(\"#freq\")\r\n .text(datum[\"update frequency\"])\r\n ;\r\n sitespan = imp_tooltip.select(\"#lag\")\r\n .text(datum.lag)\r\n ;\r\n sitespan = imp_tooltip.select(\"#notes\")\r\n .text(datum.notes)\r\n ;\r\n\r\n // Move the tooltip over to where the mouse pointer is\r\n const xpos = d3.event.pageX ;\r\n const ypos = d3.event.pageY ;\r\n imp_tooltip\r\n .style(\"transform\", `translate(${xpos}px, ${ypos}px)`)\r\n .style(\"opacity\", 0.85)\r\n ;\r\n\r\n // console.log(table._groups[0][0].clientHeight) ;\r\n\r\n }", "function showHelpTooltip() {\n $('#tooltip_help').show();\n}", "function initializeTooltips(){\n\t$('.tooltip').tooltipster({\n\t\tcontentAsHTML: true, // set title content to html\n\t\ttrigger: 'custom', // add custom trigger\n\t\ttriggerOpen: { // open tooltip when element is clicked, tapped (mobile) or hovered\n\t\t mouseenter: true\n\t\t},\n\t\ttriggerClose: { // close tooltip when element is clicked again, tapped or when the mouse leaves it\n\t\t\tmouseleave: true\n\t\t},\n\t\ttheme: ['tooltipster-light'/*, 'tooltipster-light-custom'*/]\n \t});\n}", "function updateTooltip(e) { \n styleTip( element, tooltip, ops.placement, ops.container, e )\n }", "function tooltip(e,t,title) {\r\n\t\t$('<div id=\"tooltip\" />')\r\n .appendTo('body')\r\n .text(title)\r\n .hide()\r\n .css({\r\n backgroundImage : 'url(./assets/images/skins/'+settings.skin+'/'+settings.skin+'_controlpanel.png)',\r\n\t\t\tbackgroundPosition : 'top left',\r\n\t\t\tbackgroundRepeat : 'repeat-x',\r\n\t\t\tcolor : settings.label,\r\n\t\t\tborder: '1px solid ' + settings.label,\r\n\t\t\ttop: e.pageY - 20,\r\n left: e.pageX + 20\r\n })\r\n .fadeIn(350);\r\n\t\t\r\n\t\tt.mousemove(function(e) {\r\n\t\t $('#tooltip').css({\r\n\t\t\ttop: e.pageY - 20,\r\n\t\t\tleft: e.pageX + 20\r\n\t\t });\r\n\t\t});\r\n\t }", "function setTitle() {\n dt = formatDate(myDateFormat, appstate.date);\n dtextra = (appstate.date2 === null) ? '' : ' to ' + formatDate(myDateFormat, appstate.date2);\n $('#maptitle').html(\"Viewing \" + vartitle[appstate.ltype] +\n \" for \" + dt + \" \" + dtextra);\n $('#variable_desc').html(vardesc[appstate.ltype]);\n}", "function showCountryName() {\n toolTip.innerHTML = event.target.getAttribute('title');\n}", "function showHelpStrip() {\n // loadInputControls();\n helpTip = $(document).tooltip({ disabled: false });\n helpTip = $(document).tooltip({ track: true });\n}", "function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n var placement = $position.parsePlacement(ttScope.placement);\n lastPlacement = placement[1] ? placement[0] + '-' + placement[1] : placement[0];\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }" ]
[ "0.71197665", "0.7032768", "0.6950251", "0.6947077", "0.6947077", "0.6947077", "0.6947077", "0.6947077", "0.6947077", "0.6947077", "0.6947077", "0.6947077", "0.6947077", "0.692834", "0.68173313", "0.6794768", "0.67702866", "0.67702866", "0.67702866", "0.67702866", "0.67418414", "0.67289037", "0.6701694", "0.6579582", "0.6578534", "0.65742475", "0.6545366", "0.65266", "0.65037423", "0.64688736", "0.6449678", "0.64244294", "0.6393481", "0.63636166", "0.63584054", "0.6353993", "0.63465154", "0.6338802", "0.63306296", "0.63306296", "0.6319722", "0.62945294", "0.62737304", "0.6262871", "0.62555707", "0.6249036", "0.623026", "0.6186947", "0.61671406", "0.61583996", "0.61538714", "0.6150326", "0.61349475", "0.6092213", "0.6085319", "0.6083329", "0.60805583", "0.6069432", "0.60617816", "0.6053454", "0.60505235", "0.6046516", "0.60284203", "0.60141194", "0.5997232", "0.5993135", "0.5990347", "0.59742343", "0.59620136", "0.5958122", "0.59566075", "0.5945408", "0.5943999", "0.59395933", "0.59372944", "0.59352887", "0.5930997", "0.5929341", "0.5925972", "0.5920381", "0.59199935", "0.5919109", "0.5912963", "0.59019536", "0.58923525", "0.58909297", "0.58907586", "0.58903515", "0.5881627", "0.58781606", "0.58762854", "0.5856571", "0.5855422", "0.584841", "0.58453697", "0.5844952", "0.58246416", "0.58238065", "0.5823186", "0.5818255", "0.58157927" ]
0.0
-1
Communication with the server
function serverResponse(data) { if (data == null) { consoleAddMessage("#console1", CONSOLE_ERROR, "Cannot communicate with server!"); consoleWarn('Null server response'); updates_failed++; return; } var timestamp = new Date().getTime(); consoleLog("data =", data); // DEBUG if (data.id != server_id) { consoleClear("#console1"); if (server_id != '0') { consoleAddMessage("#console1", CONSOLE_INFO, "Server restarted."); } server_id = data.id; nodes_updated = 0; } updates_failed = 0; for (var key in data) { if (key == "id") { // skip } else if (key == GLOBAL_EVENT) { consoleLog('Updating global events ', data[key]); // DEBUG nodes[key].events = concatT(nodes[key].events, data[key].events); for (var e in data[key].events) { consoleAddMessage("#console1", data[key].events[e][1], data[key].events[e][2], data[key].events[e][0]); } } else if (key == "nodes") { consoleLog('Updating list of nodes ', data.nodes); // DEBUG for (var n in data.nodes) { var node_id = data.nodes[n]; if (! (node_id in nodes)) { node_new(node_id); } nodes[node_id]._updated = timestamp; } for (var node_id in nodes) { if ((nodes[node_id]._updated != timestamp) && (node_id != '*')) { node_destroy(node_id); } } } else if (key == "nodes_t") { nodes_updated = data.nodes_t; } else { consoleLog('Updating node ' + key + ': ', data[key]); // DEBUG if (! data[key]) { // node does not exist (maybe already deleted by the code above) if (key in nodes) { node_destroy(key); } continue; } if ("events" in data[key]) { nodes[key].events = concatT(nodes[key].events, data[key].events); var name = key; if (("state" in data[key]) && ("name" in data[key].state)) { name = data[key].state.name; } else if ("name" in nodes[key].state) { name = nodes[key].state.name; } for (var e in data[key].events) { consoleAddMessage("#console1", data[key].events[e][1], data[key].events[e][2], data[key].events[e][0], key); } } if ("load" in data[key]) { nodes[key].load = concatT(nodes[key].load, data[key].load); if (key == tmp_monitor) { load_redraw = true; } } if ("state" in data[key]) { nodes[key].state = data[key].state; nodes_redraw = true; } if ("vms" in data[key]) { for (var vm_name in data[key].vms) { if (data[key].vms[vm_name]) { if (! nodes[key].vms) { nodes[key].vms = {}; } if (! nodes[key].vms[vm_name]) { node_add_vm(key, vm_name); } nodes[key].vms[vm_name].type = data[key].vms[vm_name].type; nodes[key].vms[vm_name].status = data[key].vms[vm_name].status; if ("events" in data[key].vms[vm_name]) { nodes[key].vms[vm_name].events = concatT(nodes[key].vms[vm_name].events, data[key].vms[vm_name].events); } if ("load" in data[key].vms[vm_name]) { nodes[key].vms[vm_name].load = concatT(nodes[key].vms[vm_name].load, data[key].vms[vm_name].load); load_redraw = true; } if ("proc_status" in data[key].vms[vm_name]) { nodes[key].vms[vm_name].proc_status = nodes[key].vms[vm_name].proc_status; } } else { if (nodes[key].vms && (vm_name in nodes[key].vms)) { node_del_vm(key, vm_name); } } } } } } if (nodes_redraw) { nodes_redraw = false; displayNodes('#vmlist'); } if (load_redraw && tmp_monitor) { displayLoadGraph(tmp_monitor); } consoleScroll("#console1"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sendHello() {\n this.write({cmd: 'hello', str: 'Hello, client!'})\n this.write({cmd: 'hello2', str: 'Hello again, client!'})\n }", "run() {\n this.reset();\n this.socket = net.createConnection({\n 'host': this.host.address, \n 'port': this.port,\n }).setKeepAlive(true); // .setNoDelay(true)\n this.socket.on('connect', this.onConnect);\n this.socket.on('error', this.onError);\n this.socket.on('data', this.onData);\n this.socket.on('close', this.onClose);\n }", "function call_server(command, dataObj) {\n print(\"Server call - Command, DataObject -> \" + command + \" \"\n + JSON.stringify(dataObj));\n print(\"\");\n var msg = {\n \"action\" : command,\n \"data\" : dataObj.content\n };\n ws.send(JSON.stringify(msg));\n}", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"onConnect\");\r\n client.subscribe(\"State\", { qos: Number(1) });\r\n client.subscribe(\"Content\", { qos: Number(1) });\r\n\r\n }", "sendMessage(msg){\n this.socket.emit(\"client\", msg);\n }", "function connect() {\n // Create a new WebSocket to the SERVER_URL (defined above). The empty\n // array ([]) is for the protocols, which we are not using for this\n // demo.\n ws = new WebSocket(SERVER_URL, []);\n // Set the function to be called when we have connected to the server.\n ws.onopen = handleConnected;\n // Set the function to be called when an error occurs.\n ws.onerror = handleError;\n\n\n ws.onmessage = MsjRecibido;\n // Set the function to be called when we have connected to the server.\n }", "listen() {\r\n this.client.on('message', message => this.onMessage(message));\r\n }", "send(message) {\n if (port) {\n port.postMessage(message);\n }\n }", "function onrecieveData(data)\n{\n\t for (myConnection in connections) \n\t { // iterate over the array of connections\n\t\tconnections[myConnection].send(data); // send the data to each connection\n\t }\n\tconsole.log(\"Received data: \" + data);\n}", "function client(){\n \n const net = require('net');\n var input = document.getElementById(\"message\").value;\n\n const client = net.createConnection({ port: server_port, host: server_addr }, () => {\n // 'connect' listener.\n console.log('connected to server!');\n // send the message\n client.write(`${input}\\r\\n`);\n });\n \n // get the data from the server\n client.on('data', (data) => {\n document.getElementById(\"bluetooth\").innerHTML = data;\n console.log(data.toString());\n client.end();\n client.destroy();\n });\n\n client.on('end', () => {\n console.log('disconnected from server');\n });\n}", "connect() {\n\t\tthis._communicator.connect();\n\t}", "send(data) {\n var self = this;\n if (self.currentStatus.connected) {\n self.client.send(data);\n }\n }", "Listen() {\n this.server.listen(this.port, () => {\n console.log(` ---> Servidor corriendo en ${Constants_1.HOST}${this.port}`);\n });\n }", "function ServidorNET(){\n var server = net.createServer(function (socket) { \t\n \tsocket.name = socket.remoteAddress + \":\" + socket.remotePort; // Identifica al cliente\n \tserverDB.clients.push(socket);// Añade el cliente al array de clientes del objeto serverDB\n \t\n \t//Muestra la ip:puerto de todos los sockets en el array de clientes del objeto serverDB\n \t\n\n LoginMessage(socket);\n \n ConnectedClients(socket);\n\n\t console.log('\\n______________________________\\n Received command#> ');\n \tsocket.write('\\n__________NETZULO.com__________\\n Send command$> ');\n \t// socket.pipe(socket);\n\n \t/**Eventos internos del servidor*******************************************/\n \tsocket.on('data', function (data) {\n\t Broadcast(socket.name + \"> \" + data, socket);\n\n \tsocket.write('Send command#> ');\n \t});\n \t/*FUNCTIONs internas del servidor******************************************/\n \t// Envia mensajes a todos los clientes\n \tfunction Broadcast(message, sender) {\n\t serverDB.clients.forEach(function (client) {\n \tif (client === sender) return; // evita que el mensaje sea recibido por el cliente que lo envio\n \tclient.write(message); // escribe el mensaje enviado en el cliente\n \t});\n \t// Log it to the server output too\n \tprocess.stdout.write(message); // escribe el message recibido en la consola del servidor\n \t}\n });\n server.listen(netConfig.port, netConfig.host);\n \n /*\n * Escribe un mensaje de bienvenida en la consola del servidor y en la consola remota\n */\n function LoginMessage(socket) {\n var strConsole = [\n '-------------------------------------------------------------------',\n '----- Manager Connections -----------------------------------------',\n '-------------------------------------------------------------------',\n '---------------------- Ready to Chat! -----------------------------',\n '-------------------------------------------------------------------'\n ];\n console.log(strConsole.join('\\n'));\n socket.write(strConsole.join('\\n'));\n }\n\n function ConnectedClients(socket) { \n for (client in serverDB.clients) {\n console.log(\"Conectado desde: \"+socket.name + \"\\n\");\n }\n }\n}", "connect() {\n if (this.host === undefined || this.port === undefined) {\n log.error('No host or port specified: %s:%d', this.host. this.port);\n return;\n }\n\n if (!this.connected) {\n var scope = this;\n scope.clearState();\n this.server = net.connect(this.port, this.host, () => {\n scope.connected = true;\n log.info('Connected to server @%s:%d', scope.host, scope.port);\n log.debug('Running callbacks for connect @%s:%d', scope.host, scope.port);\n for (var i in scope.callbacks.connected) {\n scope.callbacks.connected[i](scope);\n }\n });\n this.server.on('data', this.processData.bind(this));\n this.server.on('end', this.onDisconnect.bind(this));\n }\n }", "function connectToServer() {\n\t\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\t\txhr.open('GET','http://127.0.0.1:5000');\n\t\t\t\txhr.onload = function() {\n\t\t\t\t\tif(this.status === 200) {\n\t\t\t\t\t\tconsole.log(this.responseText)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\txhr.send();\n\t\t\t}", "_sendData() {\n\n }", "sending () {\n }", "connect() {\n communicator.sendMessage('connected');\n }", "function createConnection() {\n // Start a connection to the server\n let socket = jot.connect(SERVER_CONNECTION_PORT, function() {\n // Send the initial message once connected\n socket.write({\n question: \"Send me your directory\"\n })\n })\n\n // Whenever the server sends us an object...\n socket.on('data', function(data) {\n console.log(data)\n // Output the answer property of the server's message to the console\n if (data.type === 'dir') {\n if (data.action === \"create\") {\n fs.mkdir(ROOT_DIR + data.path)\n console.log(\"Created directory \" + data.path)\n }\n else if (data.action === \"delete\") {\n console.log(\"client side Deleted directory \" + ROOT_DIR + data.path)\n rimraf(ROOT_DIR + data.path,function(){\n console.log(\"Deleted\")\n })\n }\n\t} else {\n if (data.action === \"create\") {\n console.log(\"Created file \" + ROOT_DIR + data.path)\n let buffer = new Buffer(data.contents, 'base64')\n mkdirp(path.dirname(path.join(ROOT_DIR, data.path)))\n fs.writeFile(ROOT_DIR + data.path, buffer)\n }\n else if (data.action === \"delete\") {\n console.log(\"Deleted file \" + ROOT_DIR + data.path)\n fs.unlink(ROOT_DIR + data.path)\n }\n else if (data.action === \"update\") {\n console.log(\"Updated file \" + ROOT_DIR + data.path)\n let buffer = new Buffer(data.contents, 'base64')\n fs.truncate(ROOT_DIR + data.path, 0)\n fs.writeFile(ROOT_DIR + data.path, buffer)\n }\n\t}\n\n })\n}", "function ConnectDbServer(data) {\n var client = net.connect(8888, 'localhost', function() {\n //console.log('\\n}1}Connected to db driver, envío .. ' + data);\n\tclient.write(data+'\\n');\n\tclient.end();\n });\n client.on('error', function(ex) {\n console.log(\"handled error\");\n console.log(ex);\n });\n client.on('data', function(data) {\n\t//console.log(' }2}Received: ' + data.slice(0,60));\n\tif ( query_actv && cnnstate && (data.length > 60) ) {\n\t\tsendtoWSapp.emit( 'data', data );\n\t}\n\t////client.destroy(); // kill client after server's response\n });\n\n client.on('close', function() {\n\tconsole.log(' }3}Connection closed');\n\tquery_actv = false;\n });\n}", "function onopen() {\n\tconsole.log ('connection open!');\n\t//connection.send('echo\\r\\n'); // Send the message 'Ping' to the server\n}", "send(data) {\n if (this.currentStatus.connected) {\n this.socket.send(data);\n }\n }", "listen() {\n this.server.listen( this.port, () => {\n console.log('Servidor corriendo en puerto', this.port );\n });\n }", "function ConnectToServer () {\n Network.Connect(\"127.0.0.1\", 25000);\n}", "function wst_client() {\n this.tcpServer = net.createServer();\n }", "function SendPortSync() {\n}", "function sendWriteRequest(){\n\tif(typeof(socket) != 'undefined' && writeBuffer.length > 0){\n\t\tsocket.emit('command', writeBuffer.shift());\n\t}\n}", "function sendToServer_switch() {\r\n socket.emit('control', {\r\n 'room': ROOM_ID,\r\n 'username': USER,\r\n 'category': SWITCH,\r\n 'playtime': null\r\n });\r\n}", "function Connection(type){\n\tthis.type = type;\n\tthis.sock = 0;\n\tthis.id = 0;\n\tthis.ProcessConnection = function(data){\n\t\tsock.on('test' , function(data){\n\t\tconsole.log(data);});\n\t};\n}", "function serverConnected(){\nconsole.log('connected to the server');\n}", "function serverConnected() {\n infoData=\"Connected to Server\";\n println(\"Connected to Server\");\n}", "function client() {\n var j = jotan(PORT, HOST)\n j.send(new Buffer('abc'))\n j.send(new Buffer('hello world!'))\n j.send(new Buffer('café'))\n j.send('a')\n j.send('b')\n j.send('c')\n\n setTimeout(function() {\n j.send('life rocks!')\n\n // fails due to default 1000ms timeout on the server\n setTimeout(function() {\n j.send('life rocks!')\n j.end()\n }, 1100)\n\n }, 500)\n}", "function updateChat() {\n console.log(\"Update\");\n socket = io.connect('http://localhost:1337');\n console.log(\"Connected\");\n socket.on(\"newsSC\", function (data) {\n console.log(\"Receive Data: \" + data.myText);\n writeText(data.myText);\n });\n }", "function sendMessage() {\n \t\tvar message = data.value;\n\t\tdata.value = \"\";\n\t\t// tell server to execute 'sendchat' and send along one parameter\n\t\tsocket.emit('sendchat', message);\n\t}", "function msgToServer(e){\n\t\t\n\tvar message = document.getElementById(\"message\");\n\tvar chat = document.querySelector(\"#chat\");\n\t\t\n\tvar socket = io.connect();\n\tvar m = message.value; \n\t\n\t\n\tsocket.emit(\"msgToServer\", { msg: m}); \n\t\t\n}", "onConnect() {\n console.log(\"connected to broker\");\n this.client.subscribe(\"common/reply\");\n this.emit('onConnected');\n }", "function serverConnected() {\n infoData=\"Connected to /node backend\";\n println(\"Connected to /node backend\");\n}", "function go(e) {\n e.preventDefault();\n // create socket\n socket = new WebSocket(process.env.SOCKET_URL);\n socket.onmessage = ((event) => {\n const msg = JSON.parse(event.data);\n const id = parseInt(msg.id);\n\n // !! NEW !!\n if (msg.warning) {\n // Warnings can come for many reasons, here we are dealing \n // with headset connections\n data_obj['warning'] = msg.warning;\n return;\n }\n\n // !! NEW !!\n if(msg.sid && response_funcs.has(msg.sid)) {\n // handle subscription data...\n response_funcs.get(msg.sid)(msg);\n return\n }\n\n if (!response_funcs.has(id)) { \n console.log(\"Got a bad message??\");\n console.log(event.data);\n return\n }\n response_funcs.get(id)(msg); // send the data to the callback\n });\n socket.onerror = (() => {\n alert(\"Web socket got an error?!?\");\n });\n socket.onopen = (() => {\n requestAccess();\n });\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and save a message to a txt.\n client.subscribe(\"mebaris01/nurusallam/\");\n \n}", "sendSendSerialPortsMessageToServer() {\n var message = {};\n this.sendMessageToServer('sendSerialPorts', message);\n }", "function SystemSocketOpen()\n{\n ws.onmessage = SystemSocketMessageHandler;\n document.getElementById(\"Command_Reply\").innerHTML = \"Server Connection Initiated\"\n\n // Get a list from the server of all linuxcnc status items\n ws.send( JSON.stringify({ \"id\":\"STATUS_CHECK\", \"command\":\"watch\", \"name\":\"estop\" }) ) ;\n ws.send( JSON.stringify({ \"id\":\"INI_MONITOR\", \"command\":\"watch\", \"name\":\"ini_file_name\" }) ) ;\n}", "function send(data) {\n //console.log(data);\n client.send(JSON.stringify(data))\n }", "function Send(command, data) \n{\t\n\tpostMessage({\"command\": command, \"data\": data});\n}", "connect() {\n log.info('connection constructing.');\n const WebSocketServer = WebSocket.Server;\n const wss = new WebSocketServer({\n port: PORT\n });\n\n wss.on('connection', (ws) => {\n log.info('connection established.');\n this.ws = ws;\n ws.on('message', this.handleMessage);\n });\n\n listener.subscribe('_send', this.send.bind(this));\n }", "connect() {\r\n socket = new WebSocket(\"ws://localhost:4567/profesor\");\r\n socket.onopen = this.openWs;\r\n socket.onerror = this.errorWs;\r\n socket.onmessage = this.messageWs;\r\n app.recarga();\r\n }", "respondAllSockets(info) {\n\n this.io.of('admin').emit('response', info);\n\n }", "function Socket() {}", "sendMessage(message) {\n self.socket.emit('message', message);\n }", "function sendRequest() {\n var req = $req.val();\n var user = $username.val();\n socket.emit('req-send', req, user);\n }", "sendData(message, data){\n this.socket.emit(message, data);\n }", "function SocketConnection(onResponse) {\n\n\t\tvar socket;\n\t\tvar valid = true;\n\t\tvar closeListener = function(){};\n\t\tvar queue = [];\n\t\tvar timer;\n\n\t\t// attempt to connect using a web socket\n\t\tvar host = 'ws://' + document.location.hostname;\n\t\tif(document.location.port) {\n\t\t\thost = host + ':' + document.location.port\n\t\t}\n\n\t\ttry{\n\t\t\tsocket = new WebSocket(host, 'visaevus-client');\n\t\t\tsocket.onmessage = response;\n\t\t\tsocket.onclose = closed;\n\t\t\tsocket.onerror = logError;\n\t\t}\n\t\tcatch(ex) {\n\t\t\tvalid = false;\n\t\t}\n\n\t\tfunction logError() {\n\t\t\tif(console) {\n\t\t\t\tconsole.log(arguments);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction closed() {\n\t\t\tvalid = false;\n\t\t\tcloseListener();\n\t\t}\n\t\t\n\t\tfunction response(message) {\n\t\t\tonResponse(message.data);\n\t\t}\n\t\t\n\t\tfunction checkOpen() {\n\t\t\tif(socket.readyState === WebSocket.OPEN) {\n\t\t\t\tme.send = send;\n\t\t\t\twhile(queue.length) {\n\t\t\t\t\tsend(queue.shift());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\ttimer = setTimeout(checkOpen, 50);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction opening(message) {\n\t\t\tqueue.push(message);\n\t\t\tcheckOpen();\n\t\t\t\n\t\t\tif(socket.readyState > WebSocket.OPEN) {\n\t\t\t\tthrow \"failed to init\";\n\t\t\t}\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = setTimeout(checkOpen, 50);\n\t\t}\n\t\t\n\t\tfunction send(message) {\n\t\t\tsocket.send(message);\n\t\t}\n\n\t\tthis.onclose = function(newListener) {\n\t\t\tclearTimeout(timer);\n\t\t\tcloseListener = newListener;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Used to send a messag to the server\n\t\t */\n\t\tthis.send = opening;\n\n\t\tthis.isValid = function() {\n\t\t\treturn valid;\n\t\t}\n\t}", "play(): void {\n var message = Protocol.createMessage(\n false,\n this.clientID,\n 0,\n Protocol.PLAY\n );\n this.socket.emit('postData', JSON.stringify(message));\n }", "function handleServerRequest()\n{\n\t//send data to the div or html element for notifications\n}", "askForInfo(){\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"PLAYERS\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"CPUUSAGE\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"RAMUSAGE\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\t}", "send_message(message) {\n this.socket.send(message)\n }", "function DataCommunication(){\n \n\n\tvar gResourceUrl = \"http://162.243.146.199:8080/reybot/webapi/messages\";\n\tvar gResourceSendUrl = \"http://162.243.146.199:8080/reybot/webapi/messages?\";\n\tvar gDataReturned = \"\";\n\n\tthis.getBotMessage = function(_updateFunc)\n\t{\n\n\t\t// _updateFunc(\"Hey hows it going?\");\n\t\t// return;\n\n\t\tvar messageObj = new MessageObject(false, \"\");\n\n\t\tthis.sendAJAX_GETRequest(messageObj, _updateFunc);\n\n\t}\n\n\tthis.sendBotMessageFromHuman = function(_updateFunc, _humantext, _simulateMessage)\n\t{\n\n\t\tif(_simulateMessage)\n\t\t{\n\t\t\t_updateFunc(_humantext);\n\t\t\treturn;\n\t\t}\n\t\t// _updateFunc(\"Its nice to see you today.\");\n\t\t// return;\n\n\t\tvar messageObj = new MessageObject(true, _humantext);\n\n\t\tthis.sendAJAX_GETRequest(messageObj, _updateFunc);\n\n\t}\n\n\n\tthis.sendAJAX_GETRequest = function(_messageObj, _updateFunc)\n\t{\n\t\tvar xobj = new XMLHttpRequest();\n\t\t\n\t\txobj.overrideMimeType(\"application/json\");\n\n\t\tvar withM = _messageObj.withMessage();\n\n\t\tif(withM == true)\n\t\t{\n\t\t\tvar sendUrl = gResourceSendUrl + \"messagetobot=\" + _messageObj.text()\n\t\t\txobj.open('GET', sendUrl, true); \n\t\t}\n\t\telse\n\t\t{\n\t\t\txobj.open('GET', gResourceUrl, true); \n\t\t}\n\n\n\t\txobj.onreadystatechange = function () {\n\t\t \n\t\t if (xobj.readyState == 4 && (xobj.status == \"200\" || xobj.status == \"201\")) {\n\t\t // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n\t\t gDataReturned = xobj.responseText;\n\t\t \n\t\t \t\n\t\t if(gDataReturned != undefined)\n\t\t {\n\t\t \n\t\t \t_updateFunc(gDataReturned);\n\n\t\t }\n\t\t else\n\t\t {\n\t\t return null;\n\t\t }\n\n\t\t }\n\t\t };\n\n\n\t\t\txobj.send(null); \n\t}\n\n\t\n}", "function CommunicationManager(onJob, onNotification, knownHosts){\n\t\t//console.log(\"creating communication manager\");\n\t\tvar WHY_CLIENT_HELLO = \"why client hello\";\n\t\tvar ABOUTME = \"aboutme\";\n\t\tvar _knownHosts = knownHosts;\n\t\tvar _onJob = onJob;\n\t\tvar _onNotification = onNotification;\n\n\t\tvar io = {\n\t\t\tclient : null, // making connections to servers from browser / gateway\n\t\t\tserver : null // recieving connections from clients / gateways on gateway / server\n\t\t}\n\t\t\n\n\t\tif ( typeof(window) != 'undefined' ) {\n\t\t\t//console.log(\"configuring as a browser element\");\n\t\t\tio.client = window.io;\n\t\t} else {\n\t\t\t//console.log(\"configuring as a node element\");\n\t\t}\n\t\t\n\t\t\n\t\tfunction Message(type, payload) {\n\t\t\t//console.log(\"creatign new message, type \" + type)\n\t\t\tthis.type = type;\n\t\t\tthis.payload = payload;\n\t\t}\n\t\t\n\t\tvar liveconnections = new Array();\n\t\n\t\tfunction storeConnection(socket, metadata){ // upsert\n\t\t\t//console.log(\"storing connection for url[\" + metadata.url + \"] >\" + metadata.guid );\n\t\t\tvar key = metadata.storageKey();\n\t\t\tif ( key != null ) {\n\t\t\t\tliveconnections[key] = socket;\n\t\t\t} else {\n\t\t\t\t//console.log(\"warning, connection cannot be stored!!!!\")\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction findConnection(metadata) {\n\t\t\t//console.log(\"searching for an active connection to url[\" + metadata.url + \"] >\" + metadata.guid );\n\t\t\tvar retval = null;\n\t\t\tif ( metadata.url != \"http://null\" && metadata.url != null ) {\n\t\t\t\tif ( metadata.url in liveconnections ) {\n\t\t\t\t\t//console.log(\"found active connection for \" + metadata.url);\n\t\t\t\t\tretval = liveconnections[metadata.url];\n\t\t\t\t}\n\t\t\t} else if ( metadata.guid != null ) {\n\t\t\t\tif( metadata.guid in liveconnections ) {\n\t\t\t\t\t//console.log(\"found connection for \" + metadata.guid );\n\t\t\t\t\tretval = liveconnections[metadata.guid];\n\t\t\t\t} else {\n\t\t\t\t\t//console.log(\"I've not found a connection\");\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn retval;\n\t\t}\n\t\t\n\t\tfunction removeConnection(metadata) {\n\t\t\t//console.log(\"removeConnection\");\n\t\t\tvar keyToDelete = metadata.storageKey();\n\t\t\tif (keyToDelete in liveconnections ) {\n\t\t\t\tdelete liveconnections[keyToDelete];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction generateArrayOfMyMetaData(destinationMetadata) {\n\t\t\t//console.log(\"generateArrayOfMyMetaData\");\n\t\t\tvar retval = new Array();\n\t\t\tswitch ( $sis. myMetaData.nodeType ) {\n\t\t\t\tcase $sis.NodeType.CLIENT:\n\t\t\t\tcase $sis.NodeType.SERVER:\n\t\t\t\t\tretval.push($sis.myMetaData);\n\t\t\t\tbreak;\n\n\t\t\t\tcase $sis.NodeType.GATEWAY: {\n\t\t\t\t\tif (typeof(destinationMetadata) != 'undefined' && destinationMetadata != null ) {\n\t\t\t\t\t\tknownHosts.forall( function(i) {\n\t\t\t\t\t\t\tif ( i.isMe() ) {\n\t\t\t\t\t\t\t\tretval.push(i);\n\t\t\t\t\t\t\t}else if (destinationMetadata.guid != i.guid) {\n\t\t\t\t\t\t\t\tvar duplicate = new MetaData();\n\t\t\t\t\t\t\t\tduplicate.copy(i);\n\t\t\t\t\t\t\t\tduplicate.url = $sis.myMetaData.url;\n\t\t\t\t\t\t\t\tretval.push(duplicate);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tknownHosts.forall( function(i) {\n\t\t\t\t\t\t\tif ( i.isMe() ) {\n\t\t\t\t\t\t\t\tretval.push(i);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tvar duplicate = new MetaData();\n\t\t\t\t\t\t\t\tduplicate.copy(i);\n\t\t\t\t\t\t\t\tduplicate.url = $sis.myMetaData.url;\n\t\t\t\t\t\t\t\tretval.push(duplicate);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn retval;\n\t\t}\n\t\t\n\t\tfunction handleArrayOfReceivedMetaData(data) {\n\t\t\t//console.log(\"handleArrayOfReceivedMetaData\");\n\t\t\tvar retval= new Array();\n\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\tvar metadata = deserialise_MetaData(data[i]);\n\t\t\t\tretval.push(metadata);\n\t\t\t}\n\t\t\treturn retval;\n\t\t}\n\t\t\n\t\tfunction job_handler(data) {\n\t\t\t//console.log(\"job_handler\");\n\t\t\t//console.log(\"received JOB!\");\n\t\t\tif ( _onJob != null ) {\n\t\t\t\t//console.log(\"handler available - sending for processing\");\n\t\t\t\tvar job = deserialise_Job(data);\n\t\t\t\tjob.destinationMetaData = knownHosts.getLocalVersionOfMetadata(job.destinationMetaData);\n\t\t\t\t_onJob(job);\n\t\t\t} else {\n\t\t\t\t//console.log(\"no handler is registered for processing job\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction notification_handler(data) {\n\t\t\t//console.log(\"notificaiton_handler\");\n\t\t\t//console.log(\"received Notification : \" + JSON.stringify(data));\n\t\t\t\n\t\t\tif ( _onNotification != null ) {\n\t\t\t\t//console.log(\"handler available - sending for processing\");\n\t\t\t\tvar notification = deserialise_Notification(data);\n\t\t\t\t_onNotification(notification);\n\t\t\t} else {\n\t\t\t\t//console.log(\"no handler is registered for processing notification\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction client_handle_why_client_hello(data, socket) {\n\t\t\t//console.log(\"as a client I've just received about me info from a node or gateway - processing it here\") ;\n\t\t\tvar receivedMetaData = handleArrayOfReceivedMetaData(data);\n\t\t\tknownHosts.upsert(receivedMetaData);\n\t\t\t// I do not update liveconnections - as it will already be assigned the url from which I've received this data\t\t\t\n\t\t\tsend_aboutme(socket, receivedMetaData[0]);\n\t\t}\n\n\t\tfunction client_handle_aboutme(data, socket) {\n\t\t\t//console.log(\"as a client I've just received about me info from a node or gateway - processing it here\") ;\n\t\t\tvar receivedMetaData = handleArrayOfReceivedMetaData(data);\n\t\t\tknownHosts.upsert(receivedMetaData);\n\t\t\t// I do not update liveconnections - as it will already be assigned the url from which I've received this data\t\t\t\n\t\t\t//send_aboutme(socket, receivedMetaData[0]);\n\t\t}\t\t\n\t\t\n\t\tfunction server_handle_aboutme(data, socket) {\n\t\t\t//console.log(\"As a server I've just received about me info\");\n\t\t\t// we can record the connection here too\n\t\t\t//console.log(\"recording connection in live connections\");\n\t\t\tvar receivedMetaData = handleArrayOfReceivedMetaData(data);\n\t\t\tstoreConnection(socket, receivedMetaData[0]);\n\t\t\tknownHosts.upsert(receivedMetaData);\n\t\t\t// I do not send about me... \n\t\t\treturn receivedMetaData[0];\n\t\t}\n\t\t\n\t\tfunction send_aboutme(socket, metadata) {\n\t\t\t//console.log(\"send_aboutme\");\n\t\t\tif ( metadata != null ) {\n\t\t\t\t//console.log(\"sening about me information to \" + metadata.guid)\t;\t\t\t} else {\n\t\t\t\t//console.log(\"sending about me information to an unknown connection...\");\n\t\t\t}\n\t\t\t\n\t\t\tvar dataToSend = generateArrayOfMyMetaData(metadata);\n\t\t\tsocket.emit(ABOUTME, dataToSend);\n\t\t\t//console.log(\"about me sent\");\n\t\t}\n\n\t\tfunction send_why_client_hello(socket, metadata) {\n\t\t\t//console.log(\"send_why_client_hello\");\n\t\t\tif ( metadata != null ) {\n\t\t\t\t//console.log(\"sening about me information to \" + metadata.guid)\t;\t\t\t} else {\n\t\t\t\t//console.log(\"sending about me information to an unknown connection...\");\n\t\t\t}\n\t\t\t\n\t\t\tvar dataToSend = generateArrayOfMyMetaData(metadata);\n\t\t\tsocket.emit(WHY_CLIENT_HELLO, dataToSend);\n\t\t\t//console.log(\"about me sent\");\n\t\t}\t\t\n\t\t\n\t\tfunction handleConnectionDisconnectAndInformOthers(metadata) {\n\t\t\t//console.log( \" handleConnectionDisconnectAndInformOthers\" );\t\t\t\n\t\t\t//todo: remove hosts associated with this socket / guid from our knownhosts and live connections\n\t\t\tremoveConnection(metadata);\n\t\t\tknownHosts.deleteHost(metadata);\n\t\t\t// send an about me to anone remaining to let them know about the disconnect and lost of connection\n\t\t\tknownHosts.forall(function(host){\n\t\t\t\t//console.log(\"found :\" + host.guid);\n\t\t\t\tif ( !host.isMe() ) {\n\t\t\t\t\t//console.log( host.guid + \" should be send an about me message\");\n\t\t\t\t\tsendAboutMeMessageTo(host);\n\t\t\t\t\t//console.log(\"about message sent\");\n\t\t\t\t} else {\n\t\t\t\t\tvar str = \"\";\n\t\t\t\t\tif ( host.isMe() ) str = \" me!\";\n\t\t\t\t\t//console.log(host.guid + \" is \" + str );\n\t\t\t\t}\n\t\t\t});\t\t\n\t\t}\n\t\t\n\t\tfunction handleConnectionDisconnect(metadata) {\n\t\t\t//todo: remove hosts associated with this socket / guid from our knownhosts and live connections\n\t\t\t//console.log(\" handleConnectionDisconnect\");\n\t\t\tremoveConnection(metadata);\n\t\t\tknownHosts.deleteHost(metadata);\t\t\n\t\t}\n\t\t\n\t\tfunction retryEstablishConnection(metadata, callback, existingSocket) {\n\t\t\t//console.log(\"retryEstablishConnection\");\n\t\t\tsetTimeout(function(){\n\t\t\t\t//console.log(\"retryEstablishConnection, timeout expired... \");\n\t\t\t\testablishConnection(metadata, callback, existingSocket);\n\t\t\t\t}, 1000);\n\t\t}\n\t\t\n\t\tfunction establishConnection(metadata, callback, existingSocket) {\n\t\t\t//console.log(\"establishing a connection to \" + metadata.url);\n\t\t\tvar newSocket = true;\n\t\t\tvar socket = null;\n\t\t\tif ( typeof(existingSocket) != 'undefined') {\n\t\t\t\tnewSocket = false;\n\t\t\t\tsocket = existingSocket;\n\t\t\t\tsocket.reconnect();\n\t\t\t} else {\n\t\t\t\tsocket = io.client.connect(metadata.url);\n\t\t\t}\n\t\t\tstoreConnection(socket, metadata);\n\t\t\t\n\t\t\tif (newSocket){\n\t\t\t\tsocket.on(WHY_CLIENT_HELLO, function(data){\n\t\t\t\t\tclient_handle_why_client_hello(data, socket);\n\t\t\t\t\tcallback(resultIs.OK);\n\t\t\t\t});\n\n\t\t\t\tsocket.on(ABOUTME, function(data) {\n\t\t\t\t\tclient_handle_aboutme(data, socket);\t\t\t\t\n\t\t\t\t});\n\t\t\t\tsocket.on(messageTypeIs.JOB, job_handler);\n\t\t\t\tsocket.on(messageTypeIs.NOTIFICATION, notification_handler);\t\n\t\t\t\tsocket.on('disconnect', function() {\n\t\t\t\t\t//console.log(\"registered a disconnection from : \" + metadata.guid);\n\t\t\t\t\tswitch( $sis.myMetaData.nodeType ) {\n\t\t\t\t\t\tcase $sis.NodeType.CLIENT:\t\t\t\t\t\t\t\n\t\t\t\t\t\t\thandleConnectionDisconnect(metadata);\n\t\t\t\t\t\t\tretryEstablishConnection(metadata, callback, socket);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase $sis.NodeType.SERVER: // this should never happen - servers never establish a connection\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase $sis.NodeType.GATEWAY:\n\t\t\t\t\t\t\thandleConnectionDisconnectAndInformOthers(metadata);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\tsocket.on('error', function() {\n\t\t\t\t\t//console.log(\"error connecting to \" + metadata.url);\n\t\t\t\t\tretryEstablishConnection(metadata, callback);\n\t\t\n\t\t\t\t});\n\n\t\t\t\tsocket.on('connect_failed', function() {\n\t\t\t\t\t//console.log(\"error connecting to socket \" + metadata.url);\n\t\t\t\t\tretryEstablishConnection(metadata, callback);\n\t\t\t\t});\t\t\t\t\t\n\t\t\t}\n\n\t\t\t\t\t\n\t\t}\n\t\t\n\t\t// this function sends a message to a client only if it is already connected.. avoiding an about me game of tennis\n\t\tfunction sendAboutMeMessageTo(metadata) {\n\t\t\t//console.log(\"sending an about me message\");\n\t\t\tvar connection = findConnection(metadata);\n\t\t\tif (connection != null) {\n\t\t\t\t//console.log(\"connection exists sending about me message\");\n\t\t\t\tsend_aboutme(connection, metadata);\n\t\t\t}\n\t\t}\n\n\n\t\tthis.clientUpdateOfAboutmeInfo = function() {\n\t\t\t//console.log(\"clientUpdateOfAboutmeInfo\");\n\t\t\tknownHosts.foreachendpoint(function(host){\n\t\t\t\t//console.log(\"found :\" + host.guid);\n\t\t\t\tif ( !host.isMe()) {\n\t\t\t\t\t//console.log( host.guid + \" should be send an about me message\");\n\t\t\t\t\tsendAboutMeMessageTo(host);\n\t\t\t\t\t//console.log(\"about message sent\");\n\t\t\t\t} \n\t\t\t});\t\t\t\n\t\t}\n\t\t\t\t\n\t\tthis.sendMessage = function (metadata, type, message, doneCB) {\n\t\t\t//console.log(\"sending a message\");\n\t\t\t//console.log(\"checking meta data\");\n\t\t\tif ( metadata.hasGuidButNoUrl() ) {\n\t\t\t\t//console.log(\"there is no URL for this destination, and an existing link was not found\");\n\t\t\t\t_knownHosts.populateWithKnownUrl( metadata );\n\t\t\t} else {\n\t\t\t\t//console.log(\"metadata ok\");\n\t\t\t}\n\t\t\t\n\t\t\tvar connection = findConnection(metadata);\n\t\t\tif ( connection == null ) {\n\t\t\t\t//console.log(\"connection could not be found\");\t\t\t\t\n\t\t\t\t//console.log(\"creating a missing connection\");\n\t\t\t\tconnection = establishConnection(metadata, function(result){\n\t\t\t\t\tif ( result == resultIs.OK ) {\n\t\t\t\t\t\t//console.log(\"connection establoshed, sending message\");\n\t\t\t\t\t\tconnection.emit(type, message);\n\t\t\t\t\t}\n\t\t\t\t\tdoneCB(result);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t//console.log(\"connection exists sending message\");\n\t\t\t\tconnection.emit(type, message);\n\t\t\t\tdoneCB(resultIs.OK);\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.startConnectionsToKnownHosts = function(socketioclient) {\n\t\t\t//console.log(\"startConnectionsToKnownHosts\");\n\t\t\tif ( typeof(socketioclient) != 'undefined' ) {\n\t\t\t\tio.client = socketioclient;\n\t\t\t}\n\t\t\t\n\t\t\tvar max = knownHosts.length();\n\t\t\t//console.log(\"startConnectionsToKnownHosts (\" + max + \")\");\n\t\t\tif ( max > 1 ) {\n\t\t\t\t// try to establish connections first, then tell the developer\n\t\t\t\tknownHosts.forall(function(host){\n\t\t\t\t\t//console.log(\"host[\" + host.guid + \"]\");\n\t\t\t\t\tif ( ! host.isMe() ) {\n\t\t\t\t\t\t//console.log(\"this host isn't me, creating connection to \" + host.url);\n\t\t\t\t\t\testablishConnection(host, function(result) {\n\t\t\t\t\t\t\t//console.log(\"connection established to \" + host.url);\n\t\t\t\t\t\t\t// call back...\n\t\t\t\t\t\t\t// if ( result == resultIs.OK)\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// theer is only one known host, that's us... so just tell the developer what the status is\n\t\t\t\t//console.log(\"the only host available is me, not establishing connections\");\n\t\t\t\tknownHosts.invokeChangeCallback();\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.startReceivingIncomingConnections = function(socketio) {\n\t\t\t//console.log(\"startReceivingIncomingConnections\");\n\t\t\tio.server = socketio;\n\t\t\tio.server.sockets.on('connection', function (socket) {\n\t\t\t\t//console.log(\"connection received, sending about me\");\n\t\t\t\tvar socketsMetaData = null;\n\t\t\t\tsend_why_client_hello(socket, null);\n\t\t\t\tsocket.on(ABOUTME, function(data) {\n\t\t\t\t\t//console.log(\"received about me information\");\n\t\t\t\t\tsocketsMetaData = server_handle_aboutme(data, socket);\n\t\t\t\t\t//console.log(\"about me information delt with, sending update description of self to everyone else\");\n\t\t\t\t\tknownHosts.forall(function(host){\n\t\t\t\t\t\t//console.log(\"found :\" + host.guid);\n\t\t\t\t\t\tif ( !host.isMe() && host.guid != socketsMetaData.guid ) {\n\t\t\t\t\t\t\t//console.log( host.guid + \" should be send an about me message\");\n\t\t\t\t\t\t\tsendAboutMeMessageTo(host);\n\t\t\t\t\t\t\t//console.log(\"about message sent\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar str = \"\";\n\t\t\t\t\t\t\tif ( host.isMe() ) str = \" me!\";\n\t\t\t\t\t\t\tif ( host.guid == socketsMetaData.guid ) str = \" the recently joined dude\";\n\t\t\t\t\t\t\tconsole.log(host.guid + \" is \" + str );\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tsocket.on('disconnect', function() {\n\t\t\t\t\thandleConnectionDisconnectAndInformOthers(socketsMetaData);\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tsocket.on(messageTypeIs.JOB, job_handler);\n\t\t\t\tsocket.on(messageTypeIs.NOTIFICATION, notification_handler);\t\n\t\t\t});\t\t\t\n\t\t}\n\t\t\n\t}", "function talktoServer(){\n\tvar req = newXMLHttpRequest();\n\t//register the callback handler function\n \tvar callbackHandler = getReadyStateHandler(req, updateMsgOnBrowser);\n \treq.onreadystatechange = callbackHandler;\n \treq.open(\"POST\", \"servertime.php\", true);\n \treq.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n \t//get the value from the text input element and send it to server\n \tvar testmsg = document.getElementById(\"testmsg\");\n \tvar msg_value = testmsg.value;\n \treq.send(\"msg=\"+msg_value);\n}", "sendCommand(params) {\n var commandconn = new OwnConnection(this.host, this.port, this.password, MODE.COMMAND,params.log||this.log);\n commandconn.on('connected', function () {\n commandconn.sendPacket(params.command);\n });\n commandconn.on('packet', function (packet) {\n function done(packet, index) {\n commandconn.end();\n if (params.done)\n params.done(packet, index);\n }\n\n /* check if data is in stopon variable */\n if (params.stopon !== undefined) {\n if (Array.isArray(params.stopon)) {\n var i = params.stopon.indexOf(packet);\n if (i != -1) return done(packet, i);\n } else if (packet == params.stopon)\n return done(packet, 0);\n }\n if (params.packet)\n params.packet(packet);\n });\n commandconn.connect();\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(SUBSCRIBER);\n }", "onConnect() {\n this.setState({\n connected: true,\n serverResponse: {\n event: 'subscribe comments',\n status: 'waiting'\n }\n });\n this.socket.emit('subscribe comments');\n }", "function syncWithServer(){\n\tvar route = '/getSync';\n\tvar event_data = '';\n\t//gets the stored event queue on the client\n\tlocal_events = get_local_events();\n\tif(local_events == null){\n\t\t//if the event queue is null create a new one\n\t\tevent_data = JSON.stringify(newEventQueue());\t\n\t}\n\telse{\n\t\t//stringify the event queue for sending\n\t\tvar event_data = JSON.stringify(local_events);\n\t}\t\n\t//emit the event queue to our listening socket server\n\tsocket.emit(route, event_data );\n}", "sendMessage(message) {\n this.socket.emit('message', message);\n }", "function serverConnected(){\n \tconsole.log(\"connected\");\n }", "async connect(){\n\t\ttry {\n\t\t\tthis.token = await Global.key('token');\n\t\t\tLogger.info(\"Connecting to Ably message service...\");\n\t\t\tthis.client = new Ably.Realtime({\n\t\t\t\tclientId: Global.mac, \n\t\t\t\ttoken: this.token,\n\t\t\t\tauthUrl: 'https://mystayapp.ngrok.io/devices/v1/tokens', \n\t\t\t\tauthMethod: 'POST',\n\t\t\t\tauthHeaders: {\n\t\t\t\t\t'x-device-id': Global.mac\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Here we are setting up the various listeners for Ably realtime\n\t\t\t// client connection state events:\n\t\t\t// https://ably.com/documentation/realtime/connection\n\t\t\t// These should all be bound to this class in order\n\t\t\t// to call methods on the class itself:\n\n\t\t\tthis.client.connection.on(this.stateChange.bind(this));\n\t\t\tthis.client.connection.on('connected', this.connected.bind(this));\n\t\t\tthis.client.connection.on('disconnected', this.disconnected.bind(this));\n\n\t\t} catch(err){\n\t\t\tLogger.error(err);\n\t\t}\n\t}", "function makeConnection () {\n console.log('makeConnection');\n client.connect(port, host);\n }", "openConnection() {\n\n this.socket = io()\n\n this.socket.on('Welcome', data => {\n this.username = data.username\n this.avatar = data.avatar\n })\n\n this.socket.on('chatMessageFromServer', (data) => { // arrow function keeps \"this.\" from changing \n\n // alert(data.message) // debug +++\n\n this.displayMessageFromServer(data)\n\n })\n\n }", "function MessageClient(serverUrls, serverPath) {\r\n\r\n //Maps web socket commands to event types\r\n var MESSAGE_MAP = {\r\n \"camera\" : \"cameraChange\",\r\n \"pointer\": \"pointerMove\",\r\n \"joystick\" : \"joystick\",\r\n \"state\" : \"viewerState\",\r\n \"txt\": \"chatReceived\",\r\n \"joinok\" : \"userListChange\",\r\n \"sessionId\" : \"connectSucceeded\",\r\n \"joined\" : \"userListChange\",\r\n \"left\" : \"userListChange\",\r\n \"private\" : \"privateMessage\",\r\n \"join_error\": \"socketError\"\r\n };\r\n\r\n\r\n var _socket;\r\n var _myID = null;\r\n\r\n var _serverURL = Array.isArray(serverUrls) ? serverUrls : [serverUrls];\r\n var _currentServer = 0;\r\n \r\n var _pendingJoins = {};\r\n\r\n var _channels = {\r\n };\r\n\r\n var _this = this;\r\n\r\n function getUserName() {\r\n if (avp.config.userName && avp.config.userName.length)\r\n return avp.config.userName;\r\n\r\n if (_myID)\r\n return _myID.slice(0,5);\r\n\r\n return \"Unknown\";\r\n }\r\n\r\n\r\n\r\n function onRecv(msg) {\r\n\r\n //See if the message requires internal processing\r\n switch(msg.type) {\r\n\r\n\t\t\t\tcase \"txt\": onChat(msg);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"joinok\": onJoinOK(msg);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tcase \"join_error\": break;\r\n\r\n\t\t\t\tcase \"sessionId\":\r\n avp.logger.info(\"Connect successful, your id is: \" + msg.id);\r\n\t\t\t\t\t\t\t\t_myID = msg.id;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"joined\": msg.userStatus = \"joined\";\r\n onJoined(msg);\r\n break;\r\n case \"left\": msg.userStatus = \"left\";\r\n onLeft(msg);\r\n break;\r\n case \"camera\":\r\n case \"pointer\": break;\r\n default: avp.logger.log(msg);\r\n break;\r\n }\r\n\r\n //Determine what channel we are receiving the event on.\r\n //For example, a user list change can occur on either the collaboration channel (users in current session)\r\n //or on the presence channel (all users logged in), and the various GUI event handlers have to make decisions based\r\n //on that.\r\n var channelId = msg.roomId;\r\n\r\n //And send it to all listeners\r\n var evt = { type: MESSAGE_MAP[msg.type], data:msg, channelId:channelId };\r\n _this.dispatchEvent(evt);\r\n }\r\n\r\n function onJoined(evt) {\r\n if (!evt.user.name || !evt.user.name.length)\r\n evt.user.name = evt.user.id.slice(0,5);\r\n\r\n if (evt.roomId) {\r\n var channel = _channels[evt.roomId];\r\n if (channel) {\r\n channel.users.push(evt.user);\r\n avp.logger.info(evt.user + \" joined room \" + evt.roomId);\r\n } else {\r\n avp.logger.warn(\"Channel \" + evt.roomId + \" does not exist for socket \" + _myID);\r\n }\r\n }\r\n }\r\n\r\n function onLeft(evt) {\r\n avp.logger.info(evt.user + \" left room \" + evt.room);\r\n for (var channelId in _channels) {\r\n var users = _channels[channelId].users;\r\n\r\n var idx = -1;\r\n for (var i=0; i<users.length; i++) {\r\n if (users[i].id == evt.user) {\r\n idx = i;\r\n break;\r\n }\r\n }\r\n\r\n if (idx != -1)\r\n users.splice(idx, 1);\r\n\r\n delete _channels[channelId].userSet[evt.user];\r\n }\r\n }\r\n\r\n function onJoinOK(evt) {\r\n\r\n var channel = _channels[evt.roomId];\r\n\r\n avp.logger.info(\"joined channel \" + evt.roomId);\r\n\r\n if (evt.users && evt.users.length) {\r\n channel.users = evt.users;\r\n } else {\r\n channel.users = [];\r\n }\r\n\r\n for (var i=0; i<channel.users.length; i++) {\r\n\r\n //Make up a user name if one is not known\r\n if (!channel.users[i].name || !channel.users[i].name.length) {\r\n channel.users[i].name = channel.users[i].id.slice(0,5);\r\n }\r\n }\r\n\r\n var name = getUserName();\r\n var you = Autodesk.Viewing.i18n.translate(\"you\");\r\n var me = { id:_myID, name: name + \" (\" + you + \")\", isSelf : true, status:0 };\r\n if (!channel.userSet[_myID]) {\r\n channel.users.push(me);\r\n channel.userSet[_myID] = me;\r\n }\r\n\r\n //In case user name is already known, update the server.\r\n if (me.id.indexOf(name) != 0) {\r\n _this.sendChatMessage(\"/nick \" + name, evt.roomId);\r\n }\r\n }\r\n\r\n\r\n function onChat(evt) {\r\n if (evt.msg.indexOf(\"/nick \") == 0) {\r\n var user = _this.getUserById(evt.from, evt.roomId);\r\n var newname = evt.msg.slice(6);\r\n\r\n if (newname.length) {\r\n user.name = newname;\r\n if (user.id == _myID) {\r\n var you = Autodesk.Viewing.i18n.translate(\"you\");\r\n user.name += \" (\" + you + \")\";\r\n }\r\n }\r\n\r\n _this.dispatchEvent({ type: \"userListChange\", data: evt, channelId: evt.roomId });\r\n }\r\n }\r\n \r\n function onConnectError(evt) {\r\n\r\n //Attempt to connect to another server in case\r\n //the primary fails. If they all fail, then we give up.\r\n if (_currentServer < _serverURL.length) {\r\n \r\n avp.logger.info(\"Connect failed, trying another server...\");\r\n \r\n _socket.disconnect();\r\n _socket = null;\r\n _currentServer++;\r\n _this.connect(_this.sessionID);\r\n \r\n } else {\r\n\r\n _this.dispatchEvent({ type: \"socketError\", data: evt });\r\n\r\n }\r\n }\r\n \r\n function onError(evt) {\r\n\r\n _this.dispatchEvent({ type: \"socketError\", data: evt });\r\n\r\n }\r\n \r\n function onConnect(evt) {\r\n _currentServer = 0;\r\n \r\n //Join any channels that were delayed while the\r\n //connection is established.\r\n for (var p in _pendingJoins) {\r\n _this.join(p);\r\n }\r\n }\r\n\r\n /**\r\n * Establish initial connection to the server specified when constructing the message client.\r\n */\r\n this.connect = function (sessionID) {\r\n\r\n //TODO: Maintain multiple sockets to the same server, identifier by sessionID.\r\n\r\n if (_socket)\r\n return; //already connected to socket server.\r\n\r\n if (typeof window.WebSocket !== \"undefined\") {\r\n\r\n if (!myio)\r\n myio = (typeof lmv_io !== \"undefined\") ? lmv_io : io;\r\n\r\n this.sessionID = sessionID;\r\n\r\n _socket = myio.connect(_serverURL[_currentServer] + \"?sessionID=\" + sessionID, {path: serverPath, forceNew:true});\r\n _socket.on(\"connect\", onConnect);\r\n _socket.on(\"message\", onRecv);\r\n _socket.on(\"connect_error\", onConnectError);\r\n _socket.on(\"error\", onError);\r\n\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n\r\n /**\r\n * Subscribe to a messaging channel. Requires connection to be active (i.e. connect() called before join()).\r\n */\r\n\t\tthis.join = function(channelId) {\r\n\r\n if (!_socket || !_socket.connected) {\r\n _pendingJoins[channelId] = 1;\r\n return;\r\n }\r\n \r\n delete _pendingJoins[channelId];\r\n\r\n _channels[channelId] = {\r\n id : channelId,\r\n users: [],\r\n userSet: {}\r\n };\r\n\r\n _socket.emit('join', { roomId : channelId, name : getUserName() });\r\n\t\t};\r\n\r\n /**\r\n * Disconnect from message server.\r\n */\r\n this.disconnect = function () {\r\n if (_socket) {\r\n _socket.disconnect();\r\n //_socket.close();\r\n _socket = null;\r\n _channels = {};\r\n _myID = null;\r\n }\r\n };\r\n\r\n\r\n /**\r\n * Send a message of a specific type, containing given data object to a channel.\r\n * Subscription (listening) to that channel is not required.\r\n */\r\n this.sendMessage = function(type, data, channelId) {\r\n\r\n var evt = { type:type, from:_myID, msg: data, roomId: channelId };\r\n\r\n _socket.emit(\"message\", evt);\r\n };\r\n\r\n /**\r\n * Send a message object to an individual user.\r\n */\r\n this.sendPrivateMessage = function(targetId, msg) {\r\n\r\n var evt = { type: \"private\", target: targetId, from:_myID, msg: msg };\r\n\r\n _socket.emit(\"message\", evt);\r\n };\r\n\r\n /**\r\n * A convenience wrapper of sendMessage to send a simple text chat message to a channel.\r\n */\r\n this.sendChatMessage = function(msg, channelId) {\r\n\r\n var evt = { type:\"txt\", from: _myID, msg: msg, roomId: channelId };\r\n\r\n _socket.emit(\"message\", evt);\r\n\r\n //This is done to handle /nick commands\r\n onRecv(evt);\r\n };\r\n\r\n /**\r\n * Returns the user info object for a given user on a specific channel.\r\n * User lists are maintained per channel.\r\n */\r\n this.getUserById = function(id, channelId) {\r\n var users = _channels[channelId].users;\r\n for (var i=0; i<users.length; i++) {\r\n if (users[i].id == id)\r\n return users[i];\r\n }\r\n return null;\r\n };\r\n\r\n /**\r\n * Returns the local user's (randomly assigned) connection ID. Can be used to\r\n * maintain hashmaps of users, since it's unique per server.\r\n */\r\n this.getLocalId = function() { return _myID; };\r\n\r\n /**\r\n * Returns a channel's info object.\r\n */\r\n this.getChannelInfo = function(channelId) { return _channels[channelId]; };\r\n\r\n this.isConnected = function() { return _socket; };\r\n }", "function onConnect() {\n\t // Once a connection has been made, make a subscription and send a message.\n\t console.log(\"onConnect\");\n\t //document.getElementById(\"tds\").innerHTML = \"Connected\";\n\t client.subscribe(\"/data\");\n\t client.subscribe(\"/temp\");\n\t message = new Paho.MQTT.Message(\"0\");\n\t message.destinationName = \"/temp\";\n\t client.send(message);\n\t\tmessage2 = new Paho.MQTT.Message(\"1\");\n\t\tmessage2.destinationName = \"/temp\";\n\t\ttemp=message.payloadString;\n\t\tconsole.log(\"onConnection:\"+temp);\n\t }", "async connect() {\n this._mav = await this._getMavlinkInstance();\n this._socket = await this._getSocket();\n this._registerMessageListener();\n this._registerSocketListener();\n }", "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n }", "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n }", "send() {}", "send() {}", "send() {}", "send() {}", "send() {}", "send() {}", "function pushDataToClient() {\n twitchSocket.emit('update client', twitchData);\n }", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"Conectado...\");\r\n\r\n client.subscribe(\"[email protected]/IoT\");\r\n\r\n\r\n}", "function serverConnected() {\n print(\"Connected to Server\");\n}", "function handleControlConnection(connection) {\n\t\tconnection.on('data', function (data) {\n\t\t\tconsole.log('Got command:', data.toString().trim());\n\t\t\tvar request = data.toString().trim().split(' '),\n\t\t\t\tcmd = request[0],\n\t\t\t\ttarget = request[1],\n\t\t\t\tnewline = '\\r\\n',\n\t\t\t\tresponse;\n\t\t\tconsole.log('Command is:', cmd);\n\t\t\tswitch (cmd) {\n\t\t\t\tcase 'start':\n\t\t\t\t\tconsole.log('got here');\n\t\t\t\t\tself.store.broadcast('worker:start', target);\n\t\t\t\t\tresponse = lib.format('Starting {0} servers.', (target || 'all'));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'pause':\n\t\t\t\t\tself.store.broadcast('worker:pause', target);\n\t\t\t\t\tresponse = lib.format('Pausing {0} servers.', (target || 'all'));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'stop':\n\t\t\t\t\tself.store.broadcast('worker:stop', target);\n\t\t\t\t\tresponse = lib.format('Stopping {0} servers.', (target || 'all'));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'resume':\n\t\t\t\t\tself.store.broadcast('worker:resume', target);\n\t\t\t\t\tresponse = lib.format('Resuming {0} servers.', (target || 'all'));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'heartbeat':\n\t\t\t\t\tvar id = lib.guid();\n\t\t\t\t\tself.store.broadcast('worker:heartbeat', id);\n\t\t\t\t\twait(id, function () {\n\t\t\t\t\t\tvar args = Array.prototype.slice.call(arguments),\n\t\t\t\t\t\t\tresponse = {};\n\t\t\t\t\t\tlib.each(args, function (data) {\n\t\t\t\t\t\t\tvar message = data[0],\n\t\t\t\t\t\t\t\tworker = data[1];\n\t\t\t\t\t\t\tresponse[worker] = message;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tconnection.write(JSON.stringify(response));\n\t\t\t\t\t\tconnection.end(newline);\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'stats':\n\t\t\t\t\tvar id = lib.guid();\n\t\t\t\t\tself.store.broadcast('worker:stats', id);\n\t\t\t\t\twait(id, function () {\n\t\t\t\t\t\tvar args = Array.prototype.slice.call(arguments),\n\t\t\t\t\t\t\tresponse = {};\n\t\t\t\t\t\tlib.each(args, function (data) {\n\t\t\t\t\t\t\tvar message = data[0],\n\t\t\t\t\t\t\t\tworker = data[1];\n\t\t\t\t\t\t\tresponse[worker] = message;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tconnection.write(JSON.stringify(response));\n\t\t\t\t\t\tconnection.end(newline);\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tresponse = lib.format('Unknown command: {0}.', cmd);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (response) {\n\t\t\t\tconnection.write(response);\n\t\t\t\tconnection.end(newline);\n\t\t\t}\n\t\t});\n\t}", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"Conectado...\");\r\n client.subscribe(\"[email protected]/IoT\");\r\n enviarInfo(\"00:00/00:00/0/0/0/0\")\r\n \r\n}", "function connect() {\n $scope.socket = io.connect(constants.backendUrlEcran);\n\n $scope.socket.io.on('connect_error', function (err) {\n console.log('Error connecting to server');\n });\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"Conectado...\");\n\t\n client.subscribe(\"[email protected]/WEB\");\n\n\t\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"X\");\n client.subscribe(\"Y\");\n client.subscribe(\"smile\");\n}", "_onRecieveMessage() {\n this.client.on(\"data\", data => {\n console.log(data.toString());\n });\n }", "_onConnected() {\n this.emit(\"connected\");\n for (let marketSymbol of this._tickerSubs.keys()) {\n this._sendSubTicker(marketSymbol);\n }\n for (let marketSymbol of this._tradeSubs.keys()) {\n this._sendSubTrades(marketSymbol);\n }\n for (let marketSymbol of this._level2SnapshotSubs.keys()) {\n this._sendSubLevel2Snapshots(marketSymbol);\n }\n for (let marketSymbol of this._level2UpdateSubs.keys()) {\n this._sendSubLevel2Updates(marketSymbol);\n }\n for (let marketSymbol of this._level3UpdateSubs.keys()) {\n this._sendSubLevel3Updates(marketSymbol);\n }\n this._watcher.start();\n }", "function serverConnected() {\n print(\"Connected to Server\");\n}", "function sendCommand(cmd, data) {\n serverWindow.postMessage({cmd: cmd, data: data}, \"*\")\n }", "send(msg) {\n if (this.connectionId < 0) {\n throw 'Invalid connection';\n }\n chrome.serial.send(this.connectionId, str2ab(msg), function () {\n });\n }", "function send(command, message) {\n var socket = new net.Socket();\n\n // Print any data received from the daemon\n socket.on(\"data\", function(buffer) {\n console.log(buffer.toString().trim());\n });\n\n // Exit the script if deityd terminates the TCP connection.\n socket.on(\"end\", function() {\n process.exit();\n });\n\n socket.connect(PORT);\n socket.write(command + message);\n // Socket will be ended by deityd\n}", "function onsocketConnected () {\n\tconsole.log(\"connected to server\"); \n}", "componentDidMount() {\n this.socket = io(\"localhost:8080\");\n\n // Listen event id\n this.socket.on(\"id\", res => this.setState({ user: res }));\n\n // Listen event newMessage\n this.socket.on(\"newMessage\", response => {\n this.newMessage(response);\n });\n }", "connect() {}", "start() {\n if (this.server) {\n throw Error(\"InvokeServer already started\")\n }\n this.cb = null\n this.err = null\n this.msg = null\n\n this.server = http.createServer((request,response) => this._recieve(request,response))\n this.server.listen(8999)\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n cliente.subscribe(\"MangoProject\");\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"bdcc/itaxi\");\n}", "function SendCommand() {\n\t// Don't send any message if not connected.\n\tif (clc.state < CA.CONNECTED) {\n\t\treturn;\n\t}\n\n\tCreateNewCommands();\n\tWritePacket();\n}", "function serverConnected(){\n\tconsole.log('connected to the server');\n}" ]
[ "0.67716396", "0.67308176", "0.6476318", "0.6284817", "0.6275366", "0.6255781", "0.62358505", "0.622459", "0.6172239", "0.61685896", "0.61518735", "0.61375487", "0.6124304", "0.61196613", "0.61148095", "0.61144704", "0.6103114", "0.6086432", "0.6082501", "0.6021248", "0.60173565", "0.59988505", "0.5995669", "0.5992695", "0.5991431", "0.59754753", "0.59740967", "0.5962583", "0.59574", "0.5946941", "0.5945086", "0.5944943", "0.59422827", "0.5936399", "0.5926478", "0.5924827", "0.5923889", "0.59052163", "0.59039193", "0.5901707", "0.59012496", "0.5898709", "0.58970475", "0.5895643", "0.5892547", "0.5887472", "0.58798826", "0.5879308", "0.5878384", "0.5874656", "0.5872747", "0.58661103", "0.5865628", "0.5863643", "0.5858208", "0.5846401", "0.5845661", "0.5844477", "0.58355117", "0.58331454", "0.58247584", "0.58242446", "0.58164185", "0.5816256", "0.5805059", "0.58021045", "0.57959604", "0.57943994", "0.5787461", "0.57859915", "0.57853717", "0.5778219", "0.5778219", "0.5775662", "0.5775662", "0.5775662", "0.5775662", "0.5775662", "0.5775662", "0.5773814", "0.5772672", "0.57713217", "0.5768298", "0.5761026", "0.5760676", "0.5754405", "0.5751868", "0.5743156", "0.5739289", "0.5735897", "0.5720633", "0.57189643", "0.57168955", "0.5716525", "0.57022756", "0.5701325", "0.5698072", "0.5694761", "0.5692938", "0.56904906", "0.5690141" ]
0.0
-1
Requests to the vappcontroller AJAX server. The option parameter 'nodes_params' will be added to the query string. The list of nodes to be monitored is in 'nodes_monitored'. Each element of that list is a node_id, optionally followed by a commaseparated list of VMs to monitor for that node. Prepending '&' to a node means that it should be removed after requesting the update once.
function queryServer(nodes_params) { //consoleLog("XXX nodes_params = ", nodes_params); if (! nodes_params) { nodes_params = ""; } if (! nodes_owner) { consoleAddMessage("#console1", CONSOLE_ERROR, "Missing operator name, cannot query server"); return; } //consoleLog('AJAX init for nodes: ', nodes_monitored); // DEBUG //consoleLog('nodes = ', nodes); // DEBUG // Subscribe to the global events if (nodes[GLOBAL_EVENT].events && nodes[GLOBAL_EVENT].events.length > 0) { nodes_params += "&ns=" + GLOBAL_EVENT + "," + nodes[GLOBAL_EVENT].events.slice(-1)[0][0] + ",-,-"; } else { nodes_params += "&ns=*,0,-,-"; } // Subscribe to changes to specific nodes for (var i = 0; i < nodes_monitored.length; i++) { var vm_info = nodes_monitored[i].split(","); var node_id = vm_info[0]; var temp_monitoring = false; if (node_id == '&') { vm_info.splice(0, 1); node_id = vm_info[0]; temp_monitoring = true; } if (! (node_id in nodes)) { consoleWarn('Cannot monitor unknown node:', node_id); nodes_monitored.splice(i, 1); i--; continue; } consoleLog('nodes[' + node_id + '] = ', nodes[node_id]); // DEBUG var event_time = 0; if (temp_monitoring) { event_time = '-'; } else if (nodes[node_id].events && nodes[node_id].events.length > 0) { event_time = nodes[node_id].events.slice(-1)[0][0]; } var load_time = 0; if (temp_monitoring) { load_time = '-'; } else if (nodes[node_id].load && nodes[node_id].load.length > 0) { load_time = nodes[node_id].load.slice(-1)[0][0]; } var state_time = 0; if (nodes[node_id].state && nodes[node_id].state.updated > 0) { state_time = nodes[node_id].state.updated; } // Parameters: node_id, event_time, load_time, state_time nodes_params += "&ns=" + encodeURIComponent(node_id) + "," + event_time + "," + load_time + "," + state_time; // Now check if we have to monitor any VMs for that node var vm_list_changed = false; for (var j = 1; j < vm_info.length; j++) { var vm_name = vm_info[j]; if (vm_name == '&') { vm_name = vm_info[j + 1]; vm_info.splice(j, 2); j--; vm_list_changed = true; } else if (! (vm_name in nodes[node_id].vms)) { consoleWarn('Cannot monitor unknown VM:', vm_name, 'for node:', node_id); continue; } consoleLog('nodes[' + node_id + '].vms[' + vm_name + '] = ', nodes[node_id].vms[vm_name]); // DEBUG if (nodes[node_id].vms[vm_name]) { var event_time = 0; if (nodes[node_id].vms[vm_name].events && nodes[node_id].vms[vm_name].events.length > 0) { event_time = nodes[node_id].vms[vm_name].events.slice(-1)[0][0]; } var load_time = 0; if (nodes[node_id].vms[vm_name].load && nodes[node_id].vms[vm_name].load.length > 0) { load_time = nodes[node_id].vms[vm_name].load.slice(-1)[0][0]; } // (node info) + vm_name, event_time, load_time nodes_params += "," + encodeURIComponent(vm_name) + "," + event_time + "," + load_time; } } // Check if the monitoring of this node was only temporary if (temp_monitoring) { nodes_monitored.splice(i, 1); i--; } else if (vm_list_changed) { consoleLog("@@@@@@@@@@@", nodes_monitored[i]); // DEBUG consoleLog("@@@@@@@@@@@", vm_info); // DEBUG nodes_monitored[i] = vm_info.join(","); consoleLog("@@@@@@@@@@@", nodes_monitored[i]); // DEBUG } } //consoleLog('AJAX nodes_params: ', nodes_params); // DEBUG // Send the request to the server $.getJSON('ajax?id=' + server_id + "&on=" + nodes_owner + "&nt=" + nodes_updated + nodes_params) .done(serverResponse) .fail(serverError); /* if (timer_test > 0) { timer_test--; consoleLog("----- Next automatic update in 5 seconds (" + timer_test + " left)."); consoleAddMessage("#console1", CONSOLE_DEBUG, "TEST: Next update in 5 seconds."); setTimeout(queryServer, 5000, ""); } else { consoleLog("----- End of automatic updates."); consoleAddMessage("#console1", CONSOLE_DEBUG, "TEST: Stopping automatic updates."); } */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doGetNodes() {\r\n\tvar req = new XMLHttpRequest();\r\n\treq.open('GET', httpNodesUri, true);\r\n\treq.setRequestHeader('Cache-Control', 'no-cache');\r\n\r\n\treq.onreadystatechange = function () {\r\n\t\tif (this.readyState == 4 && this.status == 200) {\r\n\t\t\tnodesPayload = JSON.parse(req.responseText);\r\n\t\t\tmapNodes();\r\n\t\t\tdoGetSensors();\r\n\t\t}\r\n\t};\r\n\treq.send();\r\n}", "function populateNetworkNodes() {\n\tvar nodes = null;\n\t$\n\t\t\t.ajax({\n\t\t\t\turl : sdnControllerURL\n\t\t\t\t\t\t// + \"/controller/nb/v2/switchmanager/default/nodes\",\n\t\t\t\t\t\t+ \"/restconf/operational/opendaylight-inventory:nodes\",\n\t\t\t\ttype : \"GET\",\n\t\t\t\tasync : false,\n\t\t\t\tcontentType : \"application/json\",\n\t\t\t\tsuccess : function(data, textStatus, jqXHR) {\n\t\t\t\t\t// console.log(data);\n\t\t\t\t\tnodes = data.nodes;\n\t\t\t\t},\n\t\t\t\terror : function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\talert(\"Unable to fetch OpenDaylight Nodes.\\nDid you supply the credentials correct?\");\n\t\t\t\t},\n\t\t\t\tbeforeSend : function(xhr) {\n\t\t\t\t\t// Default Base64 Encoding for (admin/admin)\n\t\t\t\t\txhr\n\t\t\t\t\t\t\t.setRequestHeader(\"Authorization\",\n\t\t\t\t\t\t\t\t\tbase64EncodedPassword);\n\t\t\t\t}\n\t\t\t});\n\n\tif (nodes != null && nodes != undefined) {\n\t\t// Construct divs\n\t\t// $.each(nodes.nodeProperties, function(index, value) {\n\t\t// \tvar div = getNetworkDeviceDiv(value.properties.description.value,\n\t\t// \t\t\tvalue.node.id, value.properties.macAddress.value,\n\t\t// \t\t\tvalue.properties.timeStamp.value);\n\t\t// \t$(\"#nodesDiv\").append(div);\n\t\t// });\n\t\t/*Table style*/\n\t\tdiv = '<div><table class=\"table table-hover\">'\n\t\t\t+ '<thead><tr>'\n\t\t\t+ '<th>No.</th>'\n\t\t\t+ '<th>Node Id</th>'\n\t\t\t+ '<th>IP address</th>'\n\t\t\t+ '<th>Type</th>'\n\t\t\t+ '<th>SW version</th>'\n\t\t\t+ '<th>N_connectors</th>'\n\t\t\t+ '<th>Stats</th>'\n\t\t\t+ '</tr></thead><tbody>';\n\n\t\tvar prefix = \"flow-node-inventory:\"\n\t\t$.each(nodes.node, function(index, node) {\n\t\t\t// console.log(node);\n\t\t\tdiv += getNetworkDeviceDiv(\n\t\t\t\tindex + 1,\n\t\t\t\tnode.id,\n\t\t\t\tnode[prefix+'ip-address'],\n\t\t\t\tnode[prefix+'hardware'],\n\t\t\t\tnode[prefix+'software'],\n\t\t\t\tnode['node-connector'].length\n\t\t\t\t);\n\t\t\t/*Thumbnail style*/\n\t\t\t// $(\"#nodesDiv\").append(div);\n\t\t});\n\t\tdiv += '</tbody></table></div>';\n\t\t/*Table style*/\n\t\t$(\"#nodesDiv\").append(div);\n\n\t\t$(\"#nodesDiv\").removeClass(\"hidden\").addClass(\"visible\");\n\t\t$(\"#nodesButton\").removeClass(\"visible\").addClass(\"hidden\");\n\n\t}\n\n}", "function node_view(nid, callback) {\n var method = 'node.view';\n var timestamp = get_timestamp();\n var nonce = get_nonce();\n \n // Generating hash according to ServicesAPI Key method\n hash = get_hash(key, timestamp, domain, nonce, method);\n \n //array to pass all parameters\n var params = new Array(hash, domain, timestamp, nonce, nid);\n \n //formatted xmlrpc call\n var xml = xmlrpc_encode(method, params);\n \n Ti.API.info(hash);\n \n var xhr = Titanium.Network.createHTTPClient();\n xhr.open(\"POST\",url);\n xhr.onload = callback;\n \n Titanium.API.info(\"xmlrpc: xml: \"+xml);\n xhr.send(xml);\n Titanium.API.info(\"xmlrpc: end\");\n}", "function updateVMachinesView(request, vmachine_list){\n var vmachine_list_array = [];\n\n active_vms = 0;\n pending_vms = 0;\n failed_vms = 0;\n off_vms = 0;\n\n var total_real_cpu = 0;\n var total_allocated_cpu = 0;\n\n var total_real_mem = 0;\n var total_allocated_mem = 0;\n\n $.each(vmachine_list,function(){\n vmachine_list_array.push( vMachineElementArray(this));\n\n if(this.VM.STATE == 3 && this.VM.STATE == 3){ // ACTIVE, RUNNING\n total_real_cpu += parseInt(this.VM.CPU);\n total_allocated_cpu += parseInt(this.VM.TEMPLATE.CPU * 100);\n\n total_real_mem += parseInt(this.VM.MEMORY);\n total_allocated_mem += parseInt(this.VM.TEMPLATE.MEMORY);\n }\n });\n\n updateView(vmachine_list_array,dataTable_vMachines);\n\n var usage = 0;\n if(total_allocated_cpu != 0){\n usage = parseInt(100 * total_real_cpu / total_allocated_cpu);\n }\n //var info_str = usage+'%';\n //$(\"#dash_vm_real_cpu\").html(usageBarHtml(usage, 100, info_str, true));\n\n $(\"#dashboard_cpu_usage\").html(quotaDashboard(\n \"dashboard_cpu_usage\",\n tr(\"REAL CPU USAGE\"),\n \"40px\",\n \"14px\",\n {\"percentage\": usage, \"str\": (total_real_cpu + \" / \" + total_allocated_cpu)})\n );\n\n usage = 0;\n if(total_allocated_mem != 0){\n usage = parseInt(100 * total_real_mem / 1024 / total_allocated_mem);\n }\n //info_str = usage+'%';\n //$(\"#dash_vm_real_mem\").html(usageBarHtml(usage, 100, info_str, true));\n\n $(\"#dashboard_memory_usage\").html(quotaDashboard(\n \"dashboard_memory_usage\",\n tr(\"REAL MEMORY USAGE\"),\n \"40px\",\n \"14px\",\n {\"percentage\": usage, \"str\": (humanize_size(Math.floor((total_real_mem))) + \" / \" + humanize_size(total_allocated_mem * 1024)) })\n );\n\n $(\".total_vms\").text(vmachine_list.length);\n $(\".active_vms\").text(active_vms);\n $(\".pending_vms\").text(pending_vms);\n $(\".failed_vms\").text(failed_vms);\n $(\".off_vms\").text(off_vms);\n}", "function updateVMachinesView(request, vmachine_list){\n\tvmachine_list_json = vmachine_list;\n\tvar vmachine_list_array = [];\n\n\t$.each(vmachine_list,function(){\n\t\tvmachine_list_array.push( vMachineElementArray(this));\n\t});\n\n\tupdateView(vmachine_list_array,dataTable_vMachines);\n\tupdateDashboard(\"vms\",vmachine_list_json);\n}", "querySingleNode(params) {\n return axios({\n method: 'get',\n url: 'v1/mindinsight/datavisual/graphs/single-node',\n params: params,\n });\n }", "queryAllGraphNodesData(params) {\n return axios({\n method: 'get',\n url: 'v1/mindinsight/datavisual/graphs/nodes/all',\n params: params,\n });\n }", "function setNodesPosition(nodes) {\n var deferred = $.Deferred();\n if ( nodes.length == 0 ) { deferred.resolve(); return deferred.promise(); }\n var lab_filename = $('#lab-viewport').attr('data-path');\n var form_data = [];\n form_data=nodes;\n var url = '/api/labs' + lab_filename + '/nodes' ;\n var type = 'PUT';\n $.ajax({\n cache: false,\n timeout: TIMEOUT,\n type: type,\n url: encodeURI(url),\n dataType: 'json',\n data: JSON.stringify(form_data),\n success: function (data) {\n if (data['status'] == 'success') {\n logger(1, 'DEBUG: node position updated.');\n deferred.resolve();\n } else {\n // Application error\n logger(1, 'DEBUG: application error (' + data['status'] + ') on ' + type + ' ' + url + ' (' + data['message'] + ').');\n deferred.reject(data['message']);\n }\n },\n error: function (data) {\n // Server error\n var message = getJsonMessage(data['responseText']);\n logger(1, 'DEBUG: server error (' + data['status'] + ') on ' + type + ' ' + url + '.');\n logger(1, 'DEBUG: ' + message);\n deferred.reject(message);\n }\n });\n return deferred.promise();\n}", "querySingleNode(params) {\n return axios({\n method: 'get',\n url: 'v1/mindinsight/datavisual/graphs/single-node',\n params: params,\n });\n }", "function updateVMInfo(request,vm){\n\tvar vm_info = vm.VM;\n\tvar info_tab = {\n title : \"VM information\",\n content: '<table id=\"info_vm_table\" class=\"info_table\">\\\n\t\t\t<thead>\\\n\t\t\t\t<tr><th colspan=\"2\">Virtual Machine information - '+vm_info.NAME+'</th></tr>\\\n\t\t\t</thead>\\\n\t\t\t<tr>\\\n\t\t\t\t<td class=\"key_td\">ID</td>\\\n\t\t\t\t<td class=\"value_td\">'+vm_info.ID+'</td>\\\n\t\t\t</tr>\\\n\t\t\t<tr>\\\n\t\t\t\t<td class=\"key_td\">Name</td>\\\n\t\t\t\t<td class=\"value_td\">'+vm_info.NAME+'</td>\\\n\t\t\t</tr>\\\n\t\t\t<tr>\\\n\t\t\t\t<td class=\"key_td\">State</td>\\\n\t\t\t\t<td class=\"value_td\">'+OpenNebula.Helper.resource_state(\"vm\",vm_info.STATE)+'</td>\\\n\t\t\t</tr>\\\n\t\t\t<tr>\\\n\t\t\t\t<td class=\"key_td\">LCM State</td>\\\n\t\t\t\t<td class=\"value_td\">'+OpenNebula.Helper.resource_state(\"vm_lcm\",vm_info.LCM_STATE)+'</td>\\\n\t\t\t</tr>\\\n\t\t\t<tr>\\\n\t\t\t\t<td class=\"key_td\">Start time</td>\\\n\t\t\t\t<td class=\"value_td\">'+pretty_time(vm_info.STIME)+'</td>\\\n\t\t\t</tr>\\\n\t\t\t<tr>\\\n\t\t\t\t<td class=\"key_td\">Deploy ID</td>\\\n\t\t\t\t<td class=\"value_td\">'+(typeof(vm_info.DEPLOY_ID) == \"object\" ? \"-\" : vm_info.DEPLOY_ID)+'</td>\\\n\t\t\t</tr>\\\n\t\t</table>\\\n\t\t<table id=\"vm_monitoring_table\" class=\"info_table\">\\\n\t\t\t<thead>\\\n\t\t\t\t<tr><th colspan=\"2\">Monitoring information</th></tr>\\\n\t\t\t</thead>\\\n\t\t\t<tr>\\\n\t\t\t\t<td class=\"key_td\">Net_TX</td>\\\n\t\t\t\t<td class=\"value_td\">'+vm_info.NET_TX+'</td>\\\n\t\t\t</tr>\\\n\t\t\t<tr>\\\n\t\t\t\t<td class=\"key_td\">Net_RX</td>\\\n\t\t\t\t<td class=\"value_td\">'+vm_info.NET_RX+'</td>\\\n\t\t\t</tr>\\\n\t\t\t<tr>\\\n\t\t\t\t<td class=\"key_td\">Used Memory</td>\\\n\t\t\t\t<td class=\"value_td\">'+humanize_size(vm_info.MEMORY)+'</td>\\\n\t\t\t</tr>\\\n\t\t\t<tr>\\\n\t\t\t\t<td class=\"key_td\">Used CPU</td>\\\n\t\t\t\t<td class=\"value_td\">'+vm_info.CPU+'</td>\\\n\t\t\t</tr>\\\n\t\t</table>'\n }\n \n var template_tab = {\n title: \"VM Template\",\n content: '<table id=\"vm_template_table\" class=\"info_table\">\\\n\t\t<thead><tr><th colspan=\"2\">VM template</th></tr></thead>'+\n\t\tprettyPrintJSON(vm_info.TEMPLATE)+\n\t\t'</table>' \n }\n \n var log_tab = {\n title: \"VM log\",\n content: '<pre>'+spinner+'</pre>'\n }\n \n\tSunstone.updateInfoPanelTab(\"vm_info_panel\",\"vm_info_tab\",info_tab);\n Sunstone.updateInfoPanelTab(\"vm_info_panel\",\"vm_template_tab\",template_tab);\n Sunstone.updateInfoPanelTab(\"vm_info_panel\",\"vm_log_tab\",log_tab);\n \n \n //Here it is special, as we will let the callback from the VM.log\n //action popUp the info panel again when the info is received.\n Sunstone.popUpInfoPanel(\"vm_info_panel\");\n Sunstone.runAction(\"VM.log\",vm_info.ID);\n\n}", "function pingUpdate()\n{\n\t// Reset variables\n\tjoomlaupdate_stat_files = 0;\n\tjoomlaupdate_stat_inbytes = 0;\n\tjoomlaupdate_stat_outbytes = 0;\n\n\t// Do AJAX post\n\tvar post = {task : 'ping'};\n\tdoAjax(post, function(data){\n\t\tstartUpdate(data);\n\t});\n}", "function ping_the_rest() {\n this._pinger.addNodes(this._nodesToPing.map(a => a.url), false, \"app_init.check_latency_feedback_rest\");\n\n this._pinger.pingNodes(this._callback);\n }", "function SearcheInAllMachines() {\n requestQueryForBakimAriza.machineNo = $(Inputs.bakimAriza_searchMachineNo).val();\n AllMachinesAjaxRequest();\n}", "function ajaxRequest(params) {\n $.ajax({\n type: \"GET\",\n url: \"/vuln/api/getcurrenthostvuln\",\n data: params.data,\n dataType: \"json\",\n success: function(data) {\n if(data.status == 0){\n params.success({\n \"rows\": data.object.rows,\n \"total\": data.object.total\n })\n }\n },\n error: function (er) {\n params.error(er);\n }\n });\n}", "function updateServer(params) {\n var http = new XMLHttpRequest();\n http.open(\"POST\", SERVER + 'bustabit/finished', true);\n http.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n http.send(params)\n}", "function startVM(node){\n let vmid = node.parentNode.id;\n \n let requestUrl = url+'/vm/start?ccId='+getccId()+'&&vmId='+vmid;\n updateVMRequest(node,requestUrl);\n}", "function refreshVMList(){\n \n let requestUrl = url+'/consumer/'+getccId()+'/all';\n\n let request = new Request(requestUrl, {\n method: 'GET',\n headers: new Headers({\"Accept-Charset\":\"charset=utf-8\"})\n });\n \n fetch(request)\n .then(response=>{\n return response.json();\n })\n .then(json=> {\n console.log(json);\n \n for(i = 0,len=json.length; i< len; i++){\n \n let VM = json[i];\n let id = VM.vmId;\n if(document.getElementById(id)){\n existNode = document.getElementById(id);\n updateTableNode(VM,existNode);\n }else if(VM.eventType==\"CREATED\"||VM.eventType==\"RUNNING\"){\n createVMTableNode(VM);\n }\n\n // console.log(fruit);\n \n }\n\n\n }).catch(err => {\n console.log(err);\n });\n\n}", "function getServers(db) {\n var nodeRect = {'startX': 0, 'x': 0, 'startY': 0, 'y': 0, 'h': 150, 'w': 150, 'offset': 10, 'color': '#FFF'};\n var nodeTitle = {'startX': 0, 'x': 0, 'startY': 0, 'y': 0, 'h': 15, 'w': 0, 'offset': 10, 'color': '#000', 'text': 'none'};\n var rows = 1;\n nodeArr = []; // Reset Servers Array\n nodesUp = []; // Save nodes which are up\n nodesDown = []; // Save nodes which are down\n\n docUrl = cloudant_url + '/_membership'; // CouchDB URL for servers\n ajaxGet(docUrl, parse); // Make Request\n\n function parse(data) { // Parse request\n var myData = JSON.parse(data); // Parse data\n\n var nodes = myData.cluster_nodes.length;\n rows = Math.ceil( ( (nodes+0.5)*(nodeRect.w + nodeRect.offset)) / c.width );\n\n c.width = $('#wrapper-main').width()-20; // Calculate Canvas width based on total width\n c.height = rows*(nodeRect.h+nodeRect.offset); // Change canvas height based on number of rows\n cState = new CanvasState(document.getElementById('nodesCanvas')); // Create new CanvasState\n\n var y = 0; // Count active(all)_nodes\n for(var x in myData.cluster_nodes) {\n if(nodeRect.x + nodeRect.w >= 800) { // Check if yPos need to be changed\n nodeRect.y += nodeRect.h + nodeRect.offset;\n nodeRect.x = nodeRect.startX; // Reset xPos\n rows ++;\n }\n\n if(myData.cluster_nodes[x] == myData.all_nodes[y]) { // Detect if server is down or not\n nodeRect.color = \"#FFF\"; // Boxes Style + Pos\n nodesUp.push(myData.cluster_nodes[x]);\n }else{\n nodeRect.color = \"#CCC\"; // Boxes Style + Pos\n nodesDown.push(myData.cluster_nodes[x]);\n y--;\n\n }\n\n nodeTitle.x = nodeRect.x;\n nodeTitle.y = nodeRect.y;\n nodeTitle.text = myData.cluster_nodes[x];\n\n var currentNode = new Node(x); // Create a new Node Object\n currentNode.addNode({'shape': nodeRect, 'title': nodeTitle}); // Add Rectangle\n var btnStop = new cButton({'x': nodeRect.x+10, 'y': nodeRect.y+nodeRect.h-30, 'color': '#CCC', 'size': 14, 'text': 'Shutdown', 'id': x});\n btnStop.addListener(\"foo\", function(data) {\n docUrl = \"http://\"+nodeArr[data.target.getID()].nodeTitle.text+\":4730/stop\";\n ajaxGet(docUrl, parseIt);\n function parseIt(data) {\n console.log(data);\n }\n });\n currentNode.addButton(btnStop); // Button: x, y, bg-color, textSize, text\n\n var btnStart = new cButton({'x': currentNode.buttons[0].x+ctx.measureText(currentNode.buttons[0].text).width+40, 'y': nodeRect.y+nodeRect.h-30, 'color': '#CCC', 'size': 14, 'text': 'Start', 'id': x})\n btnStart.addListener(\"foo\", function(data) {\n docUrl = \"http://\"+nodeArr[data.target.getID()].nodeTitle.text+\":4730/start\";\n ajaxGet(docUrl, parseIt);\n function parseIt(data) {\n console.log(data);\n }\n });\n currentNode.addButton(btnStart); // Button: x, y, bg-color, textSize, text\n\n nodeArr.push(currentNode); // Save the Node Object\n\n // Change Positions\n nodeRect.x += nodeRect.w + nodeRect.offset;\n y++;\n }\n\n if( (db == '-nodes-') ) {\n for(var count in nodeArr) {\n nodeArr[count].draw(cState); // Draw everything\n }\n }else{\n getDbNumber(db); // Now find the Db and the shards\n }\n }\n }", "function callLabServer() {\n\n\n removeOptionSelected(dataSourceClientID);\n var oSelField = document.getElementById(dataSourceClientID);\n var elOptNew = document.createElement('option');\n elOptNew.text = \"...Fetching DataSources...\";\n elOptNew.value = 0;\n try {\n oSelField.add(elOptNew, null); // Other browsers\n }\n catch (ex) {\n oSelField.add(elOptNew);\n }\n\n\n var urlAppend = \"FormRequest/GetVolumes?request=\";\n var root = window.location\n\n var re = new RegExp('^(?:f|ht)tp(?:s)?\\://(.*?)/(.*?)/', 'im');\n var mat = root.toString().match(re)[0];\n\n var Url = mat + urlAppend + lab;\n //alert(Url);\n\n xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = ProcessRequestLab;\n xmlHttp.open(\"GET\", Url, true);\n\n xmlHttp.send(null);\n\n}", "function vm_control_update_all() {\n elements.vms_start.removeClass('disabled');\n elements.vms_reboot.removeClass('disabled');\n elements.vms_stop.removeClass('disabled');\n elements.vms_export.removeClass('disabled');\n if (admin) {\n elements.vms_update.removeClass('disabled').show();\n elements.vms_deploy.removeClass('disabled').show();\n elements.vms_delete.removeClass('disabled').show();\n elements.vms_destroy.removeClass('disabled').show();\n elements.vms_freeze.removeClass('disabled').show();\n elements.vms_unfreeze.removeClass('disabled').show();\n }\n\n _.each(server_list, function(data, hostname, i) {\n if (data.locked) {\n elements.vms_deploy.addClass('disabled');\n elements.vms_delete.addClass('disabled');\n elements.vms_destroy.addClass('disabled');\n }\n\n switch(data.status_display) {\n case 'running':\n elements.vms_start.addClass('disabled');\n elements.vms_deploy.addClass('disabled').hide();\n elements.vms_delete.addClass('disabled').hide();\n if (admin) {\n elements.vms_destroy.addClass('disabled');\n elements.vms_unfreeze.addClass('disabled').hide();\n }\n break;\n\n case 'stopped':\n elements.vms_stop.addClass('disabled');\n elements.vms_reboot.addClass('disabled');\n if (admin) {\n elements.vms_deploy.addClass('disabled').hide();\n elements.vms_delete.addClass('disabled').hide();\n elements.vms_unfreeze.addClass('disabled').hide();\n }\n break;\n\n case 'stopped-':\n case 'running-':\n case 'frozen-':\n case 'notcreated-':\n case 'stopping':\n case 'notready':\n case 'pending':\n case 'creating':\n case 'deploying':\n case 'unknown':\n case 'error':\n elements.vms_start.addClass('disabled');\n elements.vms_stop.addClass('disabled');\n elements.vms_reboot.addClass('disabled');\n if (admin) {\n elements.vms_update.addClass('disabled');\n elements.vms_deploy.addClass('disabled').hide();\n elements.vms_delete.addClass('disabled').hide();\n elements.vms_destroy.addClass('disabled');\n elements.vms_freeze.addClass('disabled');\n elements.vms_unfreeze.addClass('disabled').hide();\n }\n break;\n\n case 'notcreated':\n elements.vms_start.addClass('disabled');\n elements.vms_stop.addClass('disabled');\n elements.vms_reboot.addClass('disabled');\n if (admin) {\n elements.vms_update.addClass('disabled').hide();\n elements.vms_destroy.addClass('disabled').hide();\n elements.vms_freeze.addClass('disabled').hide();\n elements.vms_unfreeze.addClass('disabled').hide();\n }\n break;\n\n case 'frozen':\n elements.vms_start.addClass('disabled');\n elements.vms_stop.addClass('disabled');\n elements.vms_reboot.addClass('disabled');\n if (admin) {\n elements.vms_update.addClass('disabled');\n elements.vms_deploy.addClass('disabled').hide();\n elements.vms_delete.addClass('disabled').hide();\n elements.vms_destroy.addClass('disabled');\n elements.vms_freeze.addClass('disabled').hide();\n }\n break;\n\n default:\n vm_control_disable_all();\n break;\n }\n\n });\n }", "function reqNodesMap(req, res) {\n Nodes.find({\"status\": true}, (err, data) => {\n if(err) {\n res.send(err)\n }\n res.json(data)\n })\n}", "function reLoadNetworkView(searchWord, searchType, Nmax){\r\n if(Nmax==_lastNum){\r\n return;\r\n }\r\n _lastNum=Nmax;\r\n $('#reloading').show();\r\n $.ajax({\r\n type: 'POST',\r\n url: _getNewDataUrl,\r\n //url:_testUrl, //FOR TEST\r\n dataType: \"JSON\",\r\n //dataType: \"script\", //FOR TEST\r\n data: {\r\n 'query': searchWord, \r\n 'qtype': searchType, \r\n 'count': Nmax\r\n },\r\n async: false,\r\n success:function(data){\r\n //initialize the choosebox\r\n var gd=$('#network_container').attr('class').split('_')[1];\r\n $('.chooseitem input:eq(0)').attr('value',gd); \r\n var total_type = 6;\r\n for(var i=0;i<total_type;i++){\r\n var type = $('.chooseitem input:eq('+ i +')').attr('value').replace(/\\s/g,'');\r\n edge_checked[type] = true;\r\n }\r\n $('.chooseitem input').each(function(){ \r\n $(this).attr(\"checked\",\"checked\"); \r\n });\r\n //initialize the reset button\r\n $('#reSetNum').attr('disabled',false);\r\n //initialize the select form\r\n $('#layout').get(0).selectedIndex = 0; \r\n //$('#layout').get(0).options[0].selected = true;\r\n //$('#layout').get(0).value=1;\r\n $('#export').get(0).selectedIndex = 0;\r\n //var d=eval('(' +data+ ')'); //FOR TEST\r\n //makeCytoscapeWebView(\"show_networkview\",d.cw_node_data ,d.cw_edge_data); //FOR TEST\r\n makeCytoscapeWebView(\"show_networkview\",eval('(' + data.cw_node_data + ')'),eval('(' + data.cw_edge_data + ')'));\r\n $('#reloading').hide();\r\n }\r\n });\r\n}", "function list() {\n return request({\n url: `/nodes`,\n method: 'GET'\n })\n}", "function vms_update() {\n _.each(server_list, function(data, hostname, i) {\n vm_update(hostname);\n });\n //self.reset_server_list();\n }", "function ajax_updtr(node1,callerfunc,shape,number)\n\t{\n\t\tvar string1 = (new XMLSerializer()).serializeToString(node1);\n\t\t\n\t\t\t\n\t\t\tvar xhr=XMLHttpRequest();\n\t\t\t//xhr.onreadystatechange=function(){}\n\t\t\txhr.open(\"POST\",\"rcvr_server.php\",true);\n\t\t\txhr.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\n\t\t\txhr.send(\"var1=\"+string1 + \"&var2=\"+callerfunc + \"&var3=\" +shape + \"&var4=\"+ number);\n }", "function refreshFromServer() {\r\n\t// Setup the information we need for querying.\r\n\tvar busStatusUrl = location.origin + \"/VehicleLocations\";\r\n\tvar ajaxData = {};\r\n\tif( document.location.search === \"?cachedTestData\" ) {\r\n\t\tajaxData.cachedTestData = 1;\r\n\t}\r\n\r\n\t$.ajax({\r\n\t\turl: busStatusUrl,\r\n\r\n\t\t// Additional data for the query.\t\r\n\t\tdata: ajaxData,\r\n\t\t\r\n\t\t// Tell jQuery we're expecting JSONP.\r\n\t\tdataType: \"jsonp\",\r\n\r\n\t\t// Process the response.\r\n\t\tsuccess: function( response ) {\r\n\t\t\tvar package = response[\"soap:Envelope\"][\"soap:Body\"].FleetlocationResponse;\r\n\t\t\tvehicles = package.Vehicles.Vehicle;\r\n\t\t\taugmentVehicleInfo();\r\n\t\t\tfinishLoad();\r\n\t\t},\r\n\t\t\r\n\t\t// Handle errors.\r\n\t\terror: function( jqXHR, statusText, error ) {\r\n\t\t\tconsole.log( statusText );\r\n\t\t}\r\n\t});\r\n}", "function start_monitor(){\n ap = document.getElementById(\"setup_ap\")\n ap = ap.options[ap.selectedIndex].text\n pass = document.getElementById(\"setup_pass\").value\n console.log(\"Start Monitoring on \"+ap+\" \"+pass)\n\n monitor_info = {\"essid\":ap,\"password\":pass}\n $.ajax(startMon_endpoint,{\n data: JSON.stringify(monitor_info),\n contentType: \"application/json\",\n type: \"POST\"\n });\n\n\n $(\"#setup_ap\").prop('disabled',true)\n $(\"#setup_pass\").prop('disabled',true)\n $(\"#setup_btn\").prop('disabled',true)\n\n return false;\n}", "function loadNodeInfo(){\n $.ajax({\n url:'node_layout/',\n type: 'GET',\n async: true,\n cache: false,\n statusCode: {\n 500: function(){\n alert('Unable to retrieve node information');\n }\n },\n success: function(response){\n nodeInfo = jQuery.parseJSON(response);\n console.log(nodeInfo);\n }\n });\n }", "function populateMonitors(){\n $.get('/monitoring', function(data){\n if(data['error']){\n \t$('#enableMonitoring').val(\"False\");\n $('#monitors').css('display', 'none');\n \t$('#monitoringWarning').css(\"display\", \"\");\n \tconfig['monitoring'] = false;\n \twriteUpdate(true);\n }\n else{\n $('#hostMonitors').empty();\n for(var key in data){\n $('#hostMonitors').append('<tr><td>'+key+'</td><td>'+data[key]['status']+'</td><td>'+data[key]['uptime']+'</td><td>'+data[key]['users']+'</td><td>'+data[key]['1min']+', '+data[key]['5min']+', '+data[key]['15min']+'</td></tr>');\n }\n }\n });\n}", "function loadQueryListUpdate(){\n\treturn $.ajax({\n\t\turl: 'index.php',\n\t\ttype: 'post',\n\t\tdataType: \"json\",\n\t\tdata: {'site' : VAR_SITE, 'ajaxCont' : 'LCQueries' },\n\t});\n}", "function node_resource_update(node, callback) {\n var method = 'node_resource.update';\n var timestamp = get_timestamp();\n var nonce = get_nonce();\n \n // Generating hash according to ServicesAPI Key method\n hash = get_hash(key, timestamp, domain, nonce, method);\n \n node_json = json_encode(node);\n \n //array to pass all parameters\n var params = new Array(hash, domain, timestamp, nonce, node_json);\n \n //formatted xmlrpc call\n var xml = xmlrpc_encode(method, params);\n \n var xhr = Titanium.Network.createHTTPClient();\n xhr.open(\"POST\",url);\n xhr.onload = callback;\n \n Titanium.API.info(\"xmlrpc: xml: \"+xml);\n xhr.send(xml);\n Titanium.API.info(\"xmlrpc: end\");\n}", "function updateVMachineElement(request, vm_json){\n var id = vm_json.VM.ID;\n var element = vMachineElementArray(vm_json);\n updateSingleElement(element,dataTable_vMachines,'#vm_'+id)\n}", "function initPowerManagement() {\n//\tvar cgiURL=\"https://\"+CURRENT_IP+\"/cgi-bin/Final/M2_CGI/FastQueryCgi.py?\";\n\turl = getURL(\"Power\",\"JSON\");\n\t$.ajax({\n\t\turl: url,\n\t\tdata: {\n\t\t\t\"action\": \"getpowercontroller\"\n\t\t},\n\t\tdataType: 'html',\n\t\tsuccess: function(data) {\n\t\t\tvar dat2 = data.replace(/'/g,'\"');\n\t\t\tvar dat = $.parseJSON(dat2);\n\t\t\tcreatePMTreeViewJSON(dat);\n\t\t},\n\t\terror: function(data) {\n\t\t\tdata = \"\";\n\t\t\tcreatePMTreeView(data);\n\t\t}\n\t});\n}", "function watchlist_endpoint(event){\r\n\r\n // Create param string\r\n var stockList = document.getElementById(\"stock_list\");\r\n var stock = stockList.options[stockList.selectedIndex].value;\r\n var clientList = document.getElementById(\"client_list\");\r\n var client = clientList.options[clientList.selectedIndex].value;\r\n var param = \"stock=\" + stock + \"&client=\" + client;\r\n\r\n // Get output object\r\n var toggle = document.getElementById(\"cardToggle\");\r\n\r\n // AJAX server request\r\n var xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = function(){\r\n\r\n // Valid response\r\n if(this.readyState==4 && this.status==200){\r\n\r\n // Security check\r\n if(this.responseText === \"SECURITY BREACH\"){\r\n window.location.replace(\"/\");\r\n return;\r\n }\r\n\r\n // Set button accordingly and update graph\r\n if(this.responseText === \"t\")\r\n toggle.checked = true;\r\n else\r\n toggle.checked = false;\r\n graph_endpoint(\"-\", \"-\");\r\n\r\n }\r\n\r\n }\r\n xhttp.open(\"POST\", \"/watchlist\", true);\r\n xhttp.setRequestHeader('content-type',\r\n 'application/x-www-form-urlencoded;charset=UTF-8');\r\n xhttp.send(param);\r\n\r\n}", "function get_server_status() {\n var target = 'cgi_request.php';\n var data = {\n action: 'is_online'\n };\n var callback = parse_server_status;\n send_ajax_request(target, data, callback, true);\n}", "function updateMonitoringData () {\n // Get HTML elements where results are displayed\n // ...\n}", "function run_vtk_vis(tURL) {\n stop_vtkweb();\n d3.select(\"body\").style(\"cursor\",\"wait\");\n proc = d3.json(tURL);\n proc.post(function (e, resp) {\n console.log(resp);\n if (resp.status !== \"complete\") {\n console.log(\"oops :(\");\n console.log(e);\n console.log(resp);\n return;\n }\n\n var connection = {\n sessionURL: resp.url,\n name: \"WebTree\",\n description: \"Simple VTK Web demo application\",\n application: \"tree\"\n },\n loading = $(\".loading\");\n app.viewport = null;\n\n app.key = resp.key;\n\n console.log(connection.sessionURL);\n\n // Connect to remote server\n vtkWeb.connect(connection, function(serverConnection) {\n app.connection = serverConnection;\n\n // Create viewport\n app.viewport = vtkWeb.createViewport(\n {\n session:app.connection.session,\n \"interactiveQuality\": 100\n });\n //app.viewport.bind(\".viewport-container\");\n app.viewport.bind(\"#viewport\");\n\n loading.hide();\n d3.select(\"body\").style(\"cursor\",\"default\");\n\n // Handle window resize\n $(window).resize(function() {\n if(app.viewport) {\n app.viewport.render();\n }\n }).trigger('resize');\n }, function(code, reason) {\n loading.hide();\n d3.select(\"body\").style(\"cursor\",\"default\");\n alert(reason);\n });\n\n\n function updateView() {\n if(app.viewport) {\n app.viewport.invalidateScene(function(){\n d3.select(\"body\").style(\"cursor\",\"default\");});\n }\n console.log(\"updateView\");\n }\n\n });\n}", "function setNodeData(id){\n var lab_filename = $('#lab-viewport').attr('data-path');\n var form_data = form2ArrayByRow('node', id);\n var promises = [];\n logger(1, 'DEBUG: posting form-node-edit form.');\n var url = '/api/labs' + lab_filename + '/nodes/' + id;\n var type = 'PUT';\n form_data['id'] = id;\n form_data['count'] = 1;\n form_data['postfix'] = 0;\n for (var i = 0; i < form_data['count']; i++) {\n form_data['left'] = parseInt(form_data['left']) + i * 10;\n form_data['top'] = parseInt(form_data['top']) + i * 10;\n var request = $.ajax({\n cache: false,\n timeout: TIMEOUT,\n type: type,\n url: encodeURI(url),\n dataType: 'json',\n data: JSON.stringify(form_data),\n success: function (data) {\n if (data['status'] == 'success') {\n logger(1, 'DEBUG: node \"' + form_data['name'] + '\" saved.');\n // Close the modal\n $(\"#node\" + id + \" .node_name\").html('<i class=\"node' + id + '_status glyphicon glyphicon-stop\"></i>' + form_data['name'])\n $(\"#node\" + id + \" a img\").attr(\"src\", \"/images/icons/\" + form_data['icon'])\n addMessage(data['status'], data['message']);\n } else {\n // Application error\n logger(1, 'DEBUG: application error (' + data['status'] + ') on ' + type + ' ' + url + ' (' + data['message'] + ').');\n addModal('ERROR', '<p>' + data['message'] + '</p>', '<button type=\"button\" class=\"btn btn-flat\" data-dismiss=\"modal\">Close</button>');\n }\n },\n error: function (data) {\n // Server error\n var message = getJsonMessage(data['responseText']);\n logger(1, 'DEBUG: server error (' + data['status'] + ') on ' + type + ' ' + url + '.');\n logger(1, 'DEBUG: ' + message);\n addModal('ERROR', '<p>' + message + '</p>', '<button type=\"button\" class=\"btn btn-flat\" data-dismiss=\"modal\">Close</button>');\n }\n });\n promises.push(request);\n }\n\n $.when.apply(null, promises).done(function () {\n logger(1,\"data is sent\");\n });\n return false;\n}", "function refreshHostLoad() {\n\n var url = '/ajax/refreshHostLoad/';\n var params = {\n 'dummy' : \"111278\" \n };\n var post = jQuery.post(url, params, function(response) {\n var content = jQuery(response);\n jQuery('#hostLoad').empty().append(content);\n });\n post.fail(function() {\n alert('Could not perform request!');\n });\n }", "function node_get(nid, callback) {\n var method = 'node.get';\n var timestamp = get_timestamp();\n var nonce = get_nonce();\n \n // Generating hash according to ServicesAPI Key method\n hash = get_hash(key, timestamp, domain, nonce, method);\n \n //array to pass all parameters\n var params = new Array(hash, domain, timestamp, nonce, nid);\n \n //formatted xmlrpc call\n var xml = xmlrpc_encode(method, params);\n \n Ti.API.info(hash);\n \n var xhr = Titanium.Network.createHTTPClient();\n \n var rest_url = 'http://dataset2.6:8888/services/rest/node';\n \n xhr.open('POST','http://dataset2.6:8888/services/json');\n xhr.onload = callback;\n \n Titanium.API.info(\"xmlrpc: xml: \"+xml);\n xhr.send({json: JSON.stringify(node)});\n Titanium.API.info(\"xmlrpc: end\");\n}", "function psstatus_request() {\n $.ajax({\n url: \"xml.php?plugin=PSStatus\",\n dataType: \"xml\",\n error: function psstatus_error() {\n $.jGrowl(\"Error loading XML document for Plugin PSStatus!\");\n },\n success: function psstatus_buildblock(xml) {\n populateErrors(xml);\n psstatus_populate(xml);\n if (psstatus_show) {\n plugin_translate(\"PSStatus\");\n $(\"#Plugin_PSStatus\").show();\n }\n }\n });\n}", "function vardata_request() {\n\t$('body').css('cursor', 'wait');\n\tvar var1 = $('select[name=\"var1\"]').val();\n\tvar var2 = $('select[name=\"var2\"]').val();\n\tvar var1_min = $('input[name=\"var1_min\"]').val();\n\tvar var1_max = $('input[name=\"var1_max\"]').val();\n\tvar var2_min = $('input[name=\"var2_min\"]').val();\n\tvar var2_max = $('input[name=\"var2_max\"]').val();\n var url = \"/vardata?var1=\"+var1+\"&var2=\"+var2+\"&var1_min=\"+var1_min+\"&var1_max=\"+var1_max+\"&var2_min=\"+var2_min+\"&var2_max=\"+var2_max;\n $('#vardata-link').html(\"<p>Click here to launch a <a href=\\\"\"+url+\"\\\">direct REST Api call.</a></p>\");\n vardata_req.open(\"GET\", url, true);\n vardata_req.onreadystatechange = vardata_reply;\n vardata_req.send(null);\n}", "function printListNodes(nodes) {\n logger(1, 'DEBUG: printing node list');\n var body = '<div class=\"table-responsive\"><form id=\"form-node-edit-table\" ><table class=\"configured-nodes table\"><thead><tr><th>' + MESSAGES[92] + '</th><th>' + MESSAGES[19] + '</th><th>' + MESSAGES[111] + '</th><th>' + MESSAGES[163] + '</th><th>' + MESSAGES[105] + '</th><th>' + MESSAGES[203] + '</th><th>' + MESSAGES[106] + '</th><th>'+ MESSAGES[107] + '</th><th>' + MESSAGES[108] + '</th><th>' + MESSAGES[109] + '</th><th>' + MESSAGES[110] + '</th><th>' + MESSAGES[112] + '</th><th>' + MESSAGES[164] + '</th><th>' + MESSAGES[123] + '</th><th>' + MESSAGES[99] + '</th></tr></thead><tbody>';\n var html_rows = [];\n var promises = [];\n\n var composePromise = function (key, value) {\n var defer = $.Deferred();\n var cpu = (value['cpu'] != null) ? value['cpu'] : '';\n var cpulimit = (value['cpulimit'] != null) ? value['cpulimit'] : '';\n var ethernet = (value['ethernet'] != null) ? value['ethernet'] : '';\n var idlepc = (value['idlepc'] != null) ? value['idlepc'] : '';\n var image = (value['image'] != null) ? value['image'] : '';\n var nvram = (value['nvram'] != null) ? value['nvram'] : '';\n var serial = (value['serial'] != null) ? value['serial'] : '';\n\n $.when(createNodeListRow(value['template'], value['id'])).done(function (data) {\n html_rows.push(data);\n\n defer.resolve();\n });\n return defer;\n };\n\n $.each(nodes, function (key, value) {\n promises.push(composePromise(key, value));\n })\n\n $.when.apply($, promises).done(function () {\n var html_data = html_rows.sort(function(a, b){\n return (a.id < b.id) ? -1 : (a.id > b.id) ? 1 : 0\n })\n $.each(html_data, function(key, value){\n body += value.html;\n });\n body += '</tbody></table></form></div>';\n $(\"#progress-loader\").remove();\n addModalWide(MESSAGES[118], body, '');\n $('.selectpicker').selectpicker();\n })\n}", "function nodeSearch(hostname){\n \t$.getScript(\"static/js/spin.js\", function(){\n \t\tif(mode == 'night'){\n\t\t\t\tvar color = '#fff';\n\t\t\t} else {\n\t\t\t\tcolor = '#000';\n\t\t\t}\n \t\tif($('#nodeSearch_window').length != 0){\n\t \t\t$('#nodeSearch_window').find('.tile-contents').empty();\n\t \t} else {\n\t \t\tvar new_tile = '<li id=\"' + \"nodeSearch\" + '_window\" class=\"tile\">' + header1 + \"nodeSearch\" + header2 + header3 +'</li>';\n\t \t\tadd_tile(new_tile, \"nodeSearch_window\");\n\t \t}\n\t \tvar searchWindow = $('#nodeSearch_window').find('.tile-contents');\n\t \tvar opts = {\n\t\t\t\tlines: 17, // The number of lines to draw\n\t\t\t\tlength: 40, // The length of each line\n\t\t\t\twidth: 10, // The line thickness\n\t\t\t\tradius: 30, // The radius of the inner circle\n\t\t\t\tcorners: 1, // Corner roundness (0..1)\n\t\t\t\trotate: 0, // The rotation offset\n\t\t\t\tdirection: 1, // 1: clockwise, -1: counterclockwise\n\t\t\t\tcolor: color, // #rgb or #rrggbb or array of colors\n\t\t\t\tspeed: 1, // Rounds per second\n\t\t\t\ttrail: 100, // Afterglow percentage\n\t\t\t\tshadow: false, // Whether to render a shadow\n\t\t\t\thwaccel: false, // Whether to use hardware acceleration\n\t\t\t\tclassName: 'spinner', // The CSS class to assign to the spinner\n\t\t\t\tzIndex: 2e9, // The z-index (defaults to 2000000000)\n\t\t\t\ttop: '50%', // Top position relative to parent\n\t\t\t\tleft: '50%' // Left position relative to parent\n\t\t\t};\n\t \tvar spinner = new Spinner(opts).spin();\n\t \tdocument.getElementById('nodeSearch_window').appendChild(spinner.el);\n\t \tvar csrfToken = getCookie('csrftoken');\n\t\t\t$.ajaxSetup({\n\t\t\t\tbeforeSend: function(xhr){\n\t\t\t\t\txhr.setRequestHeader('X-CSRFToken', csrfToken);\n\t\t\t\t}\n\t\t\t});\n\t\t\tvar data = {\n\t\t\t\tnode:'http://'+hostname+'/esg-search/',\n\t\t\t\ttest_connection: true\n\t\t\t};\n\t\t\tvar data = JSON.stringify(data);\n\t\t\t$.ajax({\n\t\t\t\turl:'node_search/',\n\t\t\t\tdata: data,\n\t\t\t\ttype: 'POST',\n\t\t\t\tsuccess: function(response){\n\t\t\t\t\tspinner.stop();\n\t\t\t\t\tvar facet_options = JSON.parse(response);\n\t\t\t\t\tsearchWindow.empty();\n\t\t\t\t\tvar form = ['<form>',\n\t\t\t\t\t\t\t\t'Facet options<br>',\n\t\t\t\t\t\t\t\t'<select id=\"select-filter\"></select>',\n\t\t\t\t\t\t\t\t'<br><p>Filter value</p><select id=\"filter-value\"></select>',\n\t\t\t\t\t\t\t\t'<br><p id=\"search-string\">Search string: </p>',\n\t\t\t\t\t\t\t\t'<input type=\"submit\" id=\"search-submit\" value=\"Search\" style=\"color: #000;\">',\n\t\t\t\t\t\t\t\t'</form>'\n\t\t\t\t\t\t\t\t].join('');\n\t\t\t\t\tsearchWindow.append(form);\n\t\t\t\t\t$('#select-filter').on('change', function(){\n\t\t\t\t\t\t$('#filter-value').empty();\n\t\t\t\t\t\tvar facet_option_values = facet_options[document.getElementById('select-filter').value]\n\t\t\t\t\t\tfor( key in facet_option_values ){\n\t\t\t\t\t\t\t$('#filter-value').append('<option value=\"' + key + '\">' + key + ' : ' + facet_option_values[key] + '</option>');\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\tfor( key in facet_options){\n\t\t\t\t\t\tvar facet = '<option value=' + key + '>' + key+ '</option>';\n\t\t\t\t\t\tsearchWindow.find('#select-filter').append(facet);\n\t\t\t\t\t}\n\n\t\t\t\t\tsearchTerms = {};\n\t\t\t\t\t$('#filter-value').on('change', function(){\n\t\t\t\t\t\tsearchTerms[document.getElementById(\"select-filter\").value] = document.getElementById('filter-value').value;\n\t\t\t\t\t\t$('#search-string').html('Search string: ');\n\t\t\t\t\t\tfor(key in searchTerms){\n\t\t\t\t\t\t\tif(key == 'node')\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t$('#search-string').append('<a href=\"#\" class=\"search-term\" id=\"'+key+'\">' + key + '=' + searchTerms[key] + ',</a>');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$('.search-term').click(function(){\n\t\t\t\t\t\t\tdelete searchTerms[$(this).attr('id')];\n\t\t\t\t\t\t\t$(this).remove();\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t\t$('#search-submit').click(function(){\n\t\t\t\t\t\tesgfSearch(searchTerms, hostname);\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tstatusCode:{\n\t\t\t\t\t404: function(){\n\t\t\t\t\t\tspinner.stop();\n\t\t\t\t\t\talert('Node not found');\n\t\t\t\t\t},\n\t\t\t\t\t500: function(){\n\t\t\t\t\t\tspinner.stop();\n\t\t\t\t\t\talert('Unable to connect');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t});\n \t});\n }", "function pag_configureNodeServices() {\n document.pag_venueClientController.configureNodeServices();\n}", "function updateVMachineElement(request, vm_json){\n\tvar id = vm_json.VM.ID;\n\tvar element = vMachineElementArray(vm_json);\n\tupdateSingleElement(element,dataTable_vMachines,'#vm_'+id)\n}", "function requestServerStat() {\n\t\t\t\tvar infoContainers = $('.serverInfoContainer');\n\t\t\t\tfor(var index = 0; index< infoContainers.length; index++){\n\t\t\t\t\tvar request = new InfoRequest(infoContainers[index]);\n\t\t\t\t\trequest.request();\n\t\t\t\t\trequest.startInterval();\n\t\t\t\t}\n\t\t\t}", "function execRequest() {\n setInterval(handleRefresh, 3000);\n}", "function refreshServerInfo() {\n const $serverInfo = $('.serverInfo');\n $.get('http://localhost:7070').then(\n // successful return\n function (data) {\n Object.keys(data).forEach(p => {\n $(`[data-replace=\"${p}\"]`).text(data[p]);\n });\n },\n function (jqXHR, textStatus, err) {\n console.error(err);\n $serverInfo.addClass('error')\n .html('Error connecting to server.');\n }\n );\n}", "function sendMsg(checknum,msg,parameters) {\n\tvar http_request = false;\n\tvar url = 'index.php';\n\tif (window.XMLHttpRequest) { \n\t\thttp_request = new XMLHttpRequest();\n\t} else if (window.ActiveXObject) {\n\t\ttry {\n \thttp_request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n \t} catch (e) {\n \ttry {\n \thttp_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n \t} catch (e) {}\n \t}\n \t}\n \tif (!http_request) {\n \talert('Sorry, but eyeOS only works with AJAX capable browsers!');\n \treturn false;\n \t}\n \thttp_request.onreadystatechange = function() {\n if (http_request.readyState == 4) {\n \tif(http_request.responseText != 'pong') {\n \t\tnotifyEndOfLoadingRequest();\n try {\n xmlDoc=new ActiveXObject(\"Microsoft.XMLDOM\");\n xmlDoc.async=\"false\";\n xmlDoc.loadXML(http_request.responseText);\n } catch(e) {\n parser=new DOMParser();\n parser.async=\"false\";\n xmlDoc=parser.parseFromString(http_request.responseText,\"text/xml\");\n }\n localEngine(xmlDoc);\n \t}\n }\n }\n if (msg != 'ping' && msg != 'baseapp') {\n \tnotifyLoadingRequest();\n }\n \thttp_request.open('POST', url+'?checknum=' + checknum + '&msg=' + msg, true);\n \thttp_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');\n \thttp_request.send('params=' + encodeURIComponent(parameters));\n}", "function updateVMInfo(request,vm){\n var vm_info = vm.VM;\n var vm_state = OpenNebula.Helper.resource_state(\"vm\",vm_info.STATE);\n var hostname = \"--\"\n if (vm_state == tr(\"ACTIVE\") || vm_state == tr(\"SUSPENDED\") || vm_state == tr(\"POWEROFF\")) {\n if (vm_info.HISTORY_RECORDS.HISTORY.constructor == Array){\n hostname = vm_info.HISTORY_RECORDS.HISTORY[vm_info.HISTORY_RECORDS.HISTORY.length-1].HOSTNAME\n } else {\n hostname = vm_info.HISTORY_RECORDS.HISTORY.HOSTNAME;\n };\n };\n\n // Get rid of the unwanted (for show) SCHED_* keys\n var stripped_vm_template = {};\n var unshown_values = {};\n\n for (key in vm_info.USER_TEMPLATE)\n if(!key.match(/^SCHED_*/))\n stripped_vm_template[key]=vm_info.USER_TEMPLATE[key];\n else\n unshown_values[key]=vm_info.USER_TEMPLATE[key];\n\n $(\".resource-info-header\", $(\"#vms-tab\")).html(vm_info.NAME);\n\n var info_tab = {\n title : tr(\"Info\"),\n icon: \"fa-info-circle\",\n content:\n '<div class=\"row\">\\\n <div class=\"large-6 columns\">\\\n <table id=\"info_vm_table\" class=\"dataTable extended_table\">\\\n <thead>\\\n <tr><th colspan=\"3\">'+tr(\"Information\")+'</th></tr>\\\n </thead>\\\n <tbody>\\\n <tr>\\\n <td class=\"key_td\">'+tr(\"ID\")+'</td>\\\n <td class=\"value_td\">'+vm_info.ID+'</td>\\\n <td></td>\\\n </tr>'+\n insert_rename_tr(\n 'vms-tab',\n \"VM\",\n vm_info.ID,\n vm_info.NAME)+\n '<tr>\\\n <td class=\"key_td\">'+tr(\"State\")+'</td>\\\n <td class=\"value_td\">'+tr(vm_state)+'</td>\\\n <td></td>\\\n </tr>\\\n <tr>\\\n <td class=\"key_td\">'+tr(\"LCM State\")+'</td>\\\n <td class=\"value_td\">'+tr(OpenNebula.Helper.resource_state(\"vm_lcm\",vm_info.LCM_STATE))+'</td>\\\n <td></td>\\\n </tr>\\\n <tr>\\\n <td class=\"key_td\">'+tr(\"Host\")+'</td>\\\n <td class=\"value_td\">'+ hostname +'</td>\\\n <td></td>\\\n </tr>\\\n <tr>\\\n <td class=\"key_td\">'+tr(\"Start time\")+'</td>\\\n <td class=\"value_td\">'+pretty_time(vm_info.STIME)+'</td>\\\n <td></td>\\\n </tr>\\\n <tr>\\\n <td class=\"key_td\">'+tr(\"Deploy ID\")+'</td>\\\n <td class=\"value_td\">'+(typeof(vm_info.DEPLOY_ID) == \"object\" ? \"-\" : vm_info.DEPLOY_ID)+'</td>\\\n <td></td>\\\n </tr>\\\n <tr>\\\n <td class=\"key_td\">'+tr(\"Reschedule\")+'</td>\\\n <td class=\"value_td\">'+(parseInt(vm_info.RESCHED) ? tr(\"yes\") : tr(\"no\"))+'</td>\\\n <td></td>\\\n </tr>\\\n </tbody>\\\n </table>\\\n </div>\\\n <div class=\"large-6 columns\">' +\n insert_permissions_table('vms-tab',\n \"VM\",\n vm_info.ID,\n vm_info.UNAME,\n vm_info.GNAME,\n vm_info.UID,\n vm_info.GID) +\n\n '</div>\\\n </div>\\\n <div class=\"row\">\\\n <div class=\"large-9 columns\">'+\n insert_extended_template_table(stripped_vm_template,\n \"VM\",\n vm_info.ID,\n \"Attributes\",\n unshown_values) +\n '</div>\\\n </div>'\n };\n\n var hotplugging_tab = {\n title: tr(\"Storage\"),\n icon: \"fa-tasks\",\n content: printDisks(vm_info)\n };\n\n var network_tab = {\n title: tr(\"Network\"),\n icon: \"fa-globe\",\n content: printNics(vm_info)\n };\n\n var capacity_tab = {\n title: tr(\"Capacity\"),\n icon: \"fa-laptop\",\n content: printCapacity(vm_info)\n };\n\n var snapshot_tab = {\n title: tr(\"Snapshots\"),\n icon: \"fa-camera\",\n content: printSnapshots(vm_info)\n };\n\n var template_tab = {\n title: tr(\"Template\"),\n icon: \"fa-file-o\",\n content:\n '<div class=\"row\">\\\n <div class=\"large-9 columns\">\\\n <table id=\"vm_template_table\" class=\"info_table dataTable\">'+\n prettyPrintJSON(vm_info.TEMPLATE)+\n '</table>\\\n </div>\\\n </div>'\n };\n\n var log_tab = {\n title: tr(\"Log\"),\n icon: \"fa-file-text\",\n content: '<div>'+spinner+'</div>'\n };\n\n var actions_tab = {\n title: tr(\"Actions\"),\n icon: \"fa-calendar\",\n content: printActionsTable(vm_info)\n };\n\n\n var placement_tab = {\n title: tr(\"Placement\"),\n icon: \"fa-sitemap\",\n content: generatePlacementTable(vm_info)\n };\n\n Sunstone.updateInfoPanelTab(\"vm_info_panel\",\"vm_info_tab\",info_tab);\n Sunstone.updateInfoPanelTab(\"vm_info_panel\",\"vm_capacity_tab\",capacity_tab);\n Sunstone.updateInfoPanelTab(\"vm_info_panel\",\"vm_hotplugging_tab\",hotplugging_tab);\n Sunstone.updateInfoPanelTab(\"vm_info_panel\",\"vm_network_tab\",network_tab);\n Sunstone.updateInfoPanelTab(\"vm_info_panel\",\"vm_snapshot_tab\",snapshot_tab);\n Sunstone.updateInfoPanelTab(\"vm_info_panel\",\"vm_placement_tab\",placement_tab);\n Sunstone.updateInfoPanelTab(\"vm_info_panel\",\"vm_actions_tab\",actions_tab);\n Sunstone.updateInfoPanelTab(\"vm_info_panel\",\"vm_template_tab\",template_tab);\n Sunstone.updateInfoPanelTab(\"vm_info_panel\",\"vm_log_tab\",log_tab);\n\n // TODO: re-use pool_monitor data?\n\n //Pop up the info panel and asynchronously get vm_log and stats\n Sunstone.popUpInfoPanel(\"vm_info_panel\", \"vms-tab\");\n\n $(\"[href='#vm_capacity_tab']\").on(\"click\", function(){\n Sunstone.runAction(\"VM.monitor\",vm_info.ID,\n { monitor_resources : \"CPU,MEMORY\"});\n })\n\n $(\"[href='#vm_network_tab']\").on(\"click\", function(){\n Sunstone.runAction(\"VM.monitor\",vm_info.ID,\n { monitor_resources : \"NET_TX,NET_RX\"});\n })\n\n $(\"[href='#vm_log_tab']\").on(\"click\", function(){\n Sunstone.runAction(\"VM.log\",vm_info.ID);\n })\n\n var $info_panel = $('div#vm_info_panel');\n var $hotplugging_tab = $('div#vm_hotplugging_tab', $info_panel);\n $('tr.at_volatile',$hotplugging_tab).hide();\n $('tr.at_image',$hotplugging_tab).show();\n\n // Populate permissions grid\n setPermissionsTable(vm_info,'');\n\n // Enable / disable vnc button\n $(\".vnc-right-info\").prop(\"disabled\", !enableVnc(vm_info));\n}", "function getViewNodes(dbTarget, usr, pwd, conn) {\n\n\tif(usr && pwd)\n\t\trequest.get(\"http://\" + usr + ':' + pwd + '@' + dbTarget + \":8091/pools/default\", function (err, res, body) {\n\n\t\t\tnodes = JSON.parse(body).nodes;\n\t\t\t\n\t\t\tfor (var i in nodes) {\n\t\t\t\tnodes[i] = nodes[i].couchApiBase.replace(\"http://\", \"http://\" + usr + ':' + pwd + '@');\n\t\t\t}\n\n\t\t\tconn.nodes = nodes;\n\n\t\t\t/* \n\t\t\t * We're ready to go!\n\t\t\t */\n\t\t\tconn.emit('ready');\n\t\t});\n\telse\n\t\trequest.get(\"http://\" + dbTarget + \":8091/pools/default\", function (err, res, body) {\n\t\t\tnodes = JSON.parse(body).nodes;\n\n\t\t\tconn.nodes = nodes;\n\n\t\t\t/* \n\t\t\t * We're ready to go!\n\t\t\t */\n\t\t\tconn.emit('ready');\n\t\t});\n}", "function testServer(){\n let _tempUrl = \"http://greenvelvet.alwaysdata.net/kwick/api/ping\";\n $.ajax({\n url: _tempUrl,\n dataType: \"jsonp\",\n type: \"POST\",\n contentType: \"application/json; charset=utf-8\",\n success: function (result, status, xhr) {\n let version = getResultKwick(result, 'ping', 'version');\n let completed_in = getResultKwick(result, 'ping', 'completed_in');\n let _status = getResultKwick(result, 'ping', 'status');\n console.log(version, completed_in,_status);\n },\n error: function (xhr, status, error) {\n console.log(\"Error\");\n }\n });\n }", "function sendAjaxRequest(params){\n\n // Instantiating xhr object\n var xmlhttp = new XMLHttpRequest();\n\n // On state change will change the contents of the output div\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n document.getElementById(\"output\").innerHTML = this.responseText;\n /* TODO: Change width of output based on frames */\n }\n };\n\n // Setting up post request\n xmlhttp.open(\"POST\", \"filter.php\", true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\n // Sending\n xmlhttp.send(params);\n}", "function keepAlive()\n{\n //if (debug) debugLog(\"Calling keepalive \" );\n var listIPs = tokenRing;\n for( var i = 0; i < listIPs.length; i++) \n {\n var post_data = { myIP : i, role: node_functionality };\n if (listIPs[i] != getMyIP())\n {\n generalPOST ( listIPs[i], '/do_keepalive', post_data, tokeRingPort );\n }\n }\n \n setTimeout( keepAlive, keepAliveTimeout );\n}", "NodesOfTheCluster(serviceName, softwareProfile) {\n let url = `/cluster/hadoop/${serviceName}/node?`;\n const queryParams = new query_params_1.default();\n if (softwareProfile) {\n queryParams.set('softwareProfile', softwareProfile.toString());\n }\n return this.client.request('GET', url + queryParams.toString());\n }", "function nodeRequest(req, dat, callback = null){\n\t$.ajax({\t\t\t\n type: 'GET',\n\t\tdataType: 'json',\n data: dat,\n url: req,\n success: function(data){\n\t if(callback != null){\n\t\t callback(data);\n\t }\n }\n });\n}", "function processWidgetEv(event){\n\n if(event.data.type=='update_oraclize_node_list'){\n ethnode_name_list = event.data.value;\n }\n\n // Update IPFS select box\n if(event.data.type=='ipfs_update_box'){\n $('#ipfs_gateways').empty();\n $.each(event.data.value, function (i, item) {\n $('#ipfs_gateways').append($('<option>', {\n value: getUrlClean(event.data.value[i]),\n text : getUrlClean(event.data.value[i])\n }));\n });\n $('#ipfs_gateways').append($('<option>', {\n value: 'CUSTOM',\n text : 'Enter custom node...'\n }));\n }\n // update ethnode select box\n else if(event.data.type=='ethnode_update_box'){\n $('#ethnode_node').empty();\n $.each(event.data.value, function (i, item) {\n $('#ethnode_node').append($('<option>', {\n value: getUrlClean(event.data.value[i]),\n text : (ethnode_name_list[event.data.value[i]]!=undefined) ? ethnode_name_list[event.data.value[i]]['desc'] : getUrlClean(event.data.value[i])\n }));\n });\n $('#ethnode_node').append($('<option>', {\n value: 'CUSTOM',\n text : 'Enter custom node...'\n }));\n }\n\n // update first IPFS change\n if(event.data.type=='ipfs_change_start'){\n $('.active_ipfs_gateway').html(event.data.value);\n $('#ipfs_gateways').val(event.data.value); \n }\n\n // Update ethnode and IPFS gateway (select box and text)\n if(event.data.type=='ipfs_change'){\n\n $('.active_ipfs_gateway').hide();\n $('#ipfs_gateways').show();\n\n $('.active_ipfs_gateway').html(event.data.value);\n if($('#ipfs_gateways option[value=\"'+event.data.value+'\"]').length==1){\n $('#ipfs_gateways').val(event.data.value);\n setTimeout(function(){$('#ipfs_gateways').val(event.data.value);}, 100);\n }\n else {\n $('#ipfs_gateways').val('http://'+event.data.value+'/ipfs/');\n }\n }\n else if(event.data.type=='ethnode_change'){\n start_ethnode_text += 1;\n\n $('.active_ethnode_node').hide();\n $('#ethnode_node').show(); \n\n $('.active_ethnode_node').html(event.data.value);\n $('#ethnode_node').val(event.data.value);\n\n setTimeout(function(){$('#ethnode_node').val(event.data.value);}, 100);\n }\n\n // Show select box when ipfs and ethnode connection is stable\n if(event.data.type=='ipfs_change_to_select' && event.data.value==1){\n //$('.active_ipfs_gateway').hide();\n //$('#ipfs_gateways').show();\n }\n else if(event.data.type=='ethnode_change_to_select' && event.data.value==1){\n //$('.active_ethnode_node').hide();\n //$('#ethnode_node').show();\n }\n\n if(event.data.type=='ethnode_retry'){\n $('.active_ethnode_node').hide();\n\n if($('#ethnode_busy').html().indexOf(\"Retry # 3\")>=0){\n $('#ethnode_busy').html('<span style=\"\" class=\"fa fa-spin fa-spinner\"></span> Connecting to Insight node, ');\n }\n\n if($('#ethnode_busy').html().indexOf(\"Retry\")>=0) $('#ethnode_busy').html($('#ethnode_busy').html().replace(/Retry.+, /,\"\"));\n $('#ethnode_busy').append('Retry # '+event.data.value+', ');\n }\n else if(event.data.type=='ipfs_retry'){\n\n $('.active_ipfs_gateway').hide();\n\n if($('#ipfs_busy').html().indexOf(\"Retry # 3\")>=0){\n $('#ipfs_busy').html('<span style=\"\" class=\"fa fa-spin fa-spinner\"></span> Connecting to IPFS node, ');\n }\n\n if($('#ipfs_busy').html().indexOf(\"Retry\")>=0) $('#ipfs_busy').html($('#ipfs_busy').html().replace(/Retry.+, /,\"\"));\n $('#ipfs_busy').append('Retry # '+event.data.value+', ');\n\n }\n\n // check the different type of events and update HTML accordingly\n if (event.data.type == 'blockLoad_update'){\n if($(\".txmon text\").last().html().indexOf(\"verified\")!=-1 || event.data.value>100) return;\n $(\".txmon text\").last().html(\"Loading blocks.. \"+event.data.value+\"%\");\n } else if (event.data.type == 'depsLoad_update'){\n $(\".txmon text\").last().html(event.data.value);\n } else if (event.data.type == 'chartUpdate'){\n\n // Prevent chart to update too fast for the user (less than 1.5 seconds)\n if ((new Date().getTime() - lastChartUpdate) < 1.5*1000) return;\n processWidgetEv({data: { type: 'hlUpdate', value: ['chart', true] }});\n lastChartUpdate = new Date().getTime();\n document.dataSource = event.data.value;\n\n $(\".txmon\").dxChart({ dataSource: event.data.value });\n $(\".txmon\").dxChart({ dataSource: event.data.value });\n setTimeout(function(){ processWidgetEv({data: { type: 'hlUpdate', value: ['chart', false] }}) }, 300);\n\n // Force a chart update\n } else if (event.data.type == 'chartUpdate_force'){\n processWidgetEv({data: { type: 'hlUpdate', value: ['chart', true] }});\n $(\".txmon\").dxChart({ dataSource: event.data.value });\n $(\".txmon\").dxChart({ dataSource: event.data.value });\n setTimeout(function(){ processWidgetEv({data: { type: 'hlUpdate', value: ['chart', false] }}) }, 300);\n } else if (event.data.type == 'honesty_show'){\n $(\"#oraclehonesty\").parent().css(\"visibility\", \"visible\");\n } else if (event.data.type == 'honesty_update'){\n $(\"#oraclehonesty\").html(event.data.value);\n $(\"#oraclehonesty_msg\").css(\"visibility\", \"visible\");\n if (event.data.value.indexOf(\"verified\") > -1){\n verifiedProgress();\n $(\"#loading_badge\").hide();\n $(\"#live_badge\").show();\n }\n // Update chart event\n } else if (event.data.type == 'hlUpdate'){\n if (event.data.value[0] == 'chart'){\n if (event.data.value[1]) $(\"#widget_chart\").addClass(\"borderhover1Active\");\n else $(\"#widget_chart\").removeClass(\"borderhover1Active\");\n\n // is a Ethereum event \n } else if (event.data.value[0] == 'ethnode'){\n if (event.data.value[1]){\n $(\"#widget_\"+event.data.value[0]).addClass(\"borderhover1Active\");\n $(\"#descr_\"+event.data.value[0]).css(\"color\", \"rgba(0, 185, 233, .75)\");\n $(\"#descr_\"+event.data.value[0]+\" span\").css(\"color\", \"black\");\n }\n else {\n $(\"#widget_\"+event.data.value[0]).removeClass(\"borderhover1Active\");\n $(\"#descr_\"+event.data.value[0]).css(\"color\", \"inherit\");\n $(\"#descr_\"+event.data.value[0]+\" span\").css(\"color\", \"inherit\");\n }\n // is a IPFS event \n } else if (event.data.value[0] == 'ipfs'){ \n if (event.data.value[1]){\n $('.active_ipfs_gateway').hide();\n $('#ipfs_gateways').show();\n $(\"#widget_\"+event.data.value[0]).addClass(\"borderhover1Active\");\n $(\"#descr_\"+event.data.value[0]).css(\"color\", \"rgba(0, 185, 233, .75)\");\n $(\"#descr_\"+event.data.value[0]+\" span\").css(\"color\", \"black\");\n }\n else {\n $(\"#widget_\"+event.data.value[0]).removeClass(\"borderhover1Active\");\n $(\"#descr_\"+event.data.value[0]).css(\"color\", \"inherit\");\n $(\"#descr_\"+event.data.value[0]+\" span\").css(\"color\", \"inherit\");\n }\n\n // is a proof event \n } else if (availableProofs.indexOf(event.data.value[0]) > -1){\n updateProof(event.data.value[1],event.data.value[0]);\n } else if(event.data.value[0]==\"reset\"){\n $(\"#proofLinkURL\").attr('href',\"\");\n $(\"#proofImage\").attr('src',\"\");\n }\n\n // is a text update event\n // ( i.e. IPFS current downloading file, Ethereum blocks progress, IPFS KBytes etc.. )\n } else if (event.data.type == 'textUpdate'){\n //console.log('****** '+event.data.value);\n if(event.data.value[1]==\"reset\"){\n $(\"#\"+event.data.value[0]).html('');\n return;\n }\n $(\"#\"+event.data.value[0]).html(event.data.value[1]);\n $(\"#\"+event.data.value[0]).parent().css(\"visibility\", \"visible\");\n } else if (event.data.type == 'statusUpdate'){\n if (event.data.value[1] == 0){\n $(\"#\"+event.data.value[0]+\"_ready\").hide();\n $(\"#\"+event.data.value[0]+\"_busy\").hide();\n $(\"#\"+event.data.value[0]+\"_loading\").show();\n } else if (event.data.value[1] == 1){\n if($('#ipfs_busy').html().indexOf(\"Retry #\")>=0){\n $('#ipfs_busy').html($('#ipfs_busy').html().replace(/Retry.+, /,\"\"));\n }\n else if($('#ethnode_busy').html().indexOf(\"Retry #\")>=0){\n $('#ethnode_busy').html($('#ethnode_busy').html().replace(/Retry.+, /,\"\"));\n }\n $(\"#\"+event.data.value[0]+\"_loading\").hide();\n $(\"#\"+event.data.value[0]+\"_busy\").hide();\n $(\"#\"+event.data.value[0]+\"_ready\").show();\n } else if (event.data.value[1] == 2){\n $(\"#\"+event.data.value[0]+\"_loading\").hide();\n $(\"#\"+event.data.value[0]+\"_ready\").hide();\n $(\"#\"+event.data.value[0]+\"_busy\").show();\n }\n }\n}", "function updateAMIStatus() {\n // First check to make sure the cookie has not expired\n var uuid = getCookie(\"wcm_uuid_cookie\");\n if (uuid === \"\") {\n // If the cookie has expired, reload the index page to force the entry of a new cookie value\n window.location = \"/index.php\";\n return;\n }\n // Set a variable for requesting data from the server\n var getDatabaseValues = new XMLHttpRequest();\n // Setup the location for th data to be called and pass in the uuid based on the cookie value\n getDatabaseValues.open(\"GET\", \"json_wcm_get_status.php?uuid=\" + uuid, true);\n // Kick off the GET request\n getDatabaseValues.send();\n // Wait for request to hit level 4 (Ready for processing)\n getDatabaseValues.onreadystatechange = function() {\n if (getDatabaseValues.readyState === 4) {\n // Parse the json data into an array\n var currentValues = JSON.parse(getDatabaseValues.response);\n // Check to see if the return status was an \"OK\" or 200\n if ((currentValues.mchp.device.status === 200) && (buttonPressed === false)) {\n // If it is \"OK\" and there has not been a button pressed on the webpage,\n // then set the buttons, LEDs, and Pot value based on the data\n setButtonColor(\"button1\", currentValues.mchp.device.data.button1);\n setButtonColor(\"button2\", currentValues.mchp.device.data.button2);\n setButtonColor(\"button3\", currentValues.mchp.device.data.button3);\n setButtonColor(\"button4\", currentValues.mchp.device.data.button4);\n setLedStatus(\"led1\", currentValues.mchp.device.data.led1);\n setLedStatus(\"led2\", currentValues.mchp.device.data.led2);\n setLedStatus(\"led3\", currentValues.mchp.device.data.led3);\n setLedStatus(\"led4\", currentValues.mchp.device.data.led4);\n setPotentiometerValue(currentValues.mchp.device.data.potentiometer);\n }\n }\n };\n}", "function callServer() {\n\n \n\n var urlAppend = \"FormRequest/GetTopStructures?request=\";\n var root = window.location\n\n var re = new RegExp('^(?:f|ht)tp(?:s)?\\://(.*?)/(.*?)/', 'im');\n var mat = root.toString().match(re)[0];\n\n var Url = mat + urlAppend + lab + \",\" + source + \",\" + typeOfCall;\n //alert(Url);\n\n document.getElementById('circuitButton').style.display = \"none\";\n\n xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = ProcessRequest;\n xmlHttp.open(\"GET\", Url, true);\n\n xmlHttp.send(null);\n\n}", "function updateNodeInfo() {\n\n var hasErrors = false;\n\n // input elements\n var heightElement = $('#nodeHeight');\n var amplificacaoElement = $('#amplificacao');\n var atenuacaoDerivacaoElement = $('#atenuacaoDerivacao');\n var atenuacaoInsercaoElement = $('#atenuacaoInsercao');\n var nivelSinalElement = $('#nivelSinal');\n\n // input values\n var height = parseInt(heightElement.val());\n var amplificacao = (!amplificacaoElement.val()) ? null : parseInt(amplificacaoElement.val());\n var atenuacaoDerivacao = (!atenuacaoDerivacaoElement.val()) ? null : parseInt(atenuacaoDerivacaoElement.val());\n var atenuacaoInsercao = (!atenuacaoInsercaoElement.val()) ? null : parseInt(atenuacaoInsercaoElement.val());\n var nivelSinal = (!nivelSinalElement.val()) ? null : parseInt(nivelSinalElement.val());\n var applicationId = $('#nodeApplication').val() || null;\n var application = (applicationId) ? getTipoAplicacao(applicationId) : null;\n var label = $('#labelValue').val();\n\n // amp elements\n var atenuadorElement = $('#atenuador');\n var atenuador1Element = $('#atenuador1');\n var atenuador2Element = $('#atenuador2');\n var equalizadorElement = $('#equalizador');\n var ganhoElement = $('#ganho');\n var ganho1Element = $('#ganho1');\n var ganho2Element = $('#ganho2');\n var nivelSaidaElement = $('#nivelSaida');\n var nivelSaidaRetornoElement = $('#nivelSaidaRetorno');\n var preAcentuadorElement = $('#preAcentuador');\n\n // amp values\n var atenuador = (!atenuadorElement.val()) ? null : parseInt(atenuadorElement.val());\n var atenuador1 = (!atenuador1Element.val()) ? null : parseInt(atenuador1Element.val());\n var atenuador2 = (!atenuador2Element.val()) ? null : parseInt(atenuador2Element.val());\n var equalizador = (!equalizadorElement.val()) ? null : parseInt(equalizadorElement.val());\n var ganho = (!ganhoElement.val()) ? null : parseInt(ganhoElement.val());\n var ganho1 = (!ganho1Element.val()) ? null : parseInt(ganho1Element.val());\n var ganho2 = (!ganho2Element.val()) ? null : parseInt(ganho2Element.val());\n var nivelSaida = (!nivelSaidaElement.val()) ? null : parseInt(nivelSaidaElement.val());\n var nivelSaidaRetorno = (!nivelSaidaRetornoElement.val()) ? null : parseInt(nivelSaidaRetornoElement.val());\n var preAcentuador = (!preAcentuadorElement.val()) ? null : parseInt(preAcentuadorElement.val());\n\n // verifica erros no amplificador\n\n // verifica se há erros (atenuador)\n if (isNaN(atenuador) && atenuador != null) {\n atenuadorElement.parent().addClass('has-error');\n hasErrors = true;\n } else\n atenuadorElement.parent().removeClass('has-error');\n\n // verifica se há erros (atenuador1)\n if (isNaN(atenuador1) && atenuador1 != null) {\n atenuador1Element.parent().addClass('has-error');\n hasErrors = true;\n } else\n atenuador1Element.parent().removeClass('has-error');\n\n // verifica se há erros (atenuador2)\n if (isNaN(atenuador2) && atenuador2 != null) {\n atenuador2Element.parent().addClass('has-error');\n hasErrors = true;\n } else\n atenuador2Element.parent().removeClass('has-error');\n\n // verifica se há erros (equalizador)\n if (isNaN(equalizador) && equalizador != null) {\n equalizadorElement.parent().addClass('has-error');\n hasErrors = true;\n } else\n equalizadorElement.parent().removeClass('has-error');\n\n // verifica se há erros (ganho)\n if (isNaN(ganho) && ganho != null) {\n ganhoElement.parent().addClass('has-error');\n hasErrors = true;\n } else\n ganhoElement.parent().removeClass('has-error');\n\n // verifica se há erros (ganho1)\n if (isNaN(ganho1) && ganho1 != null) {\n ganho1Element.parent().addClass('has-error');\n hasErrors = true;\n } else\n ganho1Element.parent().removeClass('has-error');\n\n // verifica se há erros (ganho2)\n if (isNaN(ganho2) && ganho2 != null) {\n ganho2Element.parent().addClass('has-error');\n hasErrors = true;\n } else\n ganho2Element.parent().removeClass('has-error');\n\n // verifica se há erros (nivelSaida)\n if (isNaN(nivelSaida) && nivelSaida != null) {\n nivelSaidaElement.parent().addClass('has-error');\n hasErrors = true;\n } else\n nivelSaidaElement.parent().removeClass('has-error');\n\n // verifica se há erros (nivelSaidaRetorno)\n if (isNaN(nivelSaidaRetorno) && nivelSaidaRetorno != null) {\n nivelSaidaRetornoElement.parent().addClass('has-error');\n hasErrors = true;\n } else\n nivelSaidaRetornoElement.parent().removeClass('has-error');\n\n // verifica se há erros (preAcentuador)\n if (isNaN(preAcentuador) && preAcentuador != null) {\n preAcentuadorElement.parent().addClass('has-error');\n hasErrors = true;\n } else\n preAcentuadorElement.parent().removeClass('has-error');\n\n ////////////////////////////////////////////////////////\n\n // verifica se há erros (altura)\n if (isNaN(parseInt(height))) {\n heightElement.parent().addClass('has-error');\n hasErrors = true;\n } else\n heightElement.parent().removeClass('has-error');\n\n // verifica se há erros (nivel de sinal)\n if (isNaN(nivelSinal) && nivelSinal != null) {\n nivelSinalElement.parent().addClass('has-error');\n hasErrors = true;\n } else\n nivelSinalElement.parent().removeClass('has-error');\n\n // verifica se há erros (ajuste de amplificacao)\n if (isNaN(amplificacao) && amplificacao != null) {\n amplificacaoElement.parent().addClass('has-error');\n hasErrors = true;\n } else\n amplificacaoElement.parent().removeClass('has-error');\n\n // verifica se há erros (atenuação de derivação))\n if (isNaN(atenuacaoDerivacao) && atenuacaoDerivacao != null) {\n atenuacaoDerivacaoElement.parent().addClass('has-error');\n hasErrors = true;\n } else\n atenuacaoDerivacaoElement.parent().removeClass('has-error');\n\n // verifica se há erros (atenuação de inserção)\n if (isNaN(atenuacaoInsercao) && atenuacaoInsercao != null) {\n atenuacaoInsercaoElement.parent().addClass('has-error');\n hasErrors = true;\n } else\n atenuacaoInsercaoElement.parent().removeClass('has-error');\n\n // cancela atualização de houver erros\n if (hasErrors)\n return;\n\n // check if changes were made\n var save = (\n // amplificador\n atenuador != selected_node['properties']['atenuador'] ||\n atenuador1 != selected_node['properties']['atenuador1'] ||\n atenuador2 != selected_node['properties']['atenuador2'] ||\n equalizador != selected_node['properties']['equalizador'] ||\n ganho != selected_node['properties']['ganho'] ||\n ganho1 != selected_node['properties']['ganho1'] ||\n ganho2 != selected_node['properties']['ganho2'] ||\n nivelSaida != selected_node['properties']['nivelSaida'] ||\n nivelSaidaRetorno != selected_node['properties']['nivelSaidaRetorno'] ||\n preAcentuador != selected_node['properties']['preAcentuador'] ||\n // ati\n amplificacao != selected_node['properties']['amplificacao'] ||\n nivelSinal != selected_node['properties']['nivelSinal'] ||\n // derivador\n atenuacaoDerivacao != selected_node['properties']['atenuacaoDerivacao'] ||\n atenuacaoInsercao != selected_node['properties']['atenuacaoInsercao'] ||\n // geral\n height != selected_node.height ||\n application != selected_node.application ||\n label != selected_node.label\n );\n\n // atualizar altura\n if (height)\n selected_node.height = height;\n\n // atualizar ajuste de amplificação\n if (amplificacao)\n selected_node['properties']['amplificacao'] = amplificacao;\n\n // atualizar atenuação de derivação\n if (atenuacaoDerivacao)\n selected_node['properties']['atenuacaoDerivacao'] = atenuacaoDerivacao;\n\n // atualizar atenuação de inserção\n if (atenuacaoInsercao)\n selected_node['properties']['atenuacaoInsercao'] = atenuacaoInsercao;\n\n // atualizar nivel de sinal\n if (nivelSinal)\n selected_node['properties']['nivelSinal'] = nivelSinal;\n\n ///////////////////////////////////////////////////////////\n // atualizar info dos amplificadores\n\n // atualizar atenuador\n if (atenuador)\n selected_node['properties']['atenuador'] = atenuador;\n\n // atualizar atenuador1\n if (atenuador1)\n selected_node['properties']['atenuador1'] = atenuador1;\n\n // atualizar atenuador2\n if (atenuador2)\n selected_node['properties']['atenuador2'] = atenuador2;\n\n // atualizar equalizador\n if (equalizador)\n selected_node['properties']['equalizador'] = equalizador;\n\n // atualizar ganho\n if (ganho)\n selected_node['properties']['ganho'] = ganho;\n\n // atualizar ganho1\n if (ganho1)\n selected_node['properties']['ganho1'] = ganho1;\n\n // atualizar ganho2\n if (ganho2)\n selected_node['properties']['ganho2'] = ganho2;\n\n // atualizar nivel de saida\n if (nivelSaida)\n selected_node['properties']['nivelSaida'] = nivelSaida;\n\n // atualizar nivel de saída de retorno\n if (nivelSaidaRetorno)\n selected_node['properties']['nivelSaidaRetorno'] = nivelSaidaRetorno;\n\n // atualizar pre acentuador\n if (preAcentuador)\n selected_node['properties']['preAcentuador'] = preAcentuador;\n\n ///////////////////////////////////////////////////////////\n\n // atualizar tipo de aplicação\n if (applicationId)\n selected_node.application = application;\n\n // atualizar label\n if (label.trim() == '')\n selected_node.label = null;\n else\n selected_node.label = label;\n\n // guardar alterações\n if (save) {\n saveOperation();\n restart();\n }\n\n closeModal();\n}", "function loadXMLDoc_admin(url, params)\n{\n if(window.XMLHttpRequest) {\n try {\n req = new XMLHttpRequest();\n } catch(e) {\n req = false;\n }\n } else if(window.ActiveXObject) {\n try {\n req = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch(e) {\n try {\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch(e) {\n req = false;\n }\n }\n }\n if(req) {\n req.onreadystatechange = processReqChange_admin;\n req.open(\"POST\", url, true);\n req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n req.send(params);\n return true;\n }\n}", "function doRefresh(server, alerts, nb, cur) {\n\tvar configuration = chrome.extension.getBackgroundPage().configuration;\n\tvar a = alerts.shift();\n\tcur = cur ? cur : 0;\n\tif(a) {\n\t\tif(a.type != 'info') {\n\t\t\tvar params = 'host=' + a.host;\n\t\t\tparams+= '&service=' + a.service;\n\t\t\tparams+= '&start_time=' + dateFormat(new Date(), \"dd-mm-yyyy HH:MM:ss\");\n\t\t\tparams+= '&force_check=on&cmd_typ=';\n\t\t\tparams+= a.service != '' ? 7 : 96;\n\t\t\tparams+= '&cmd_mod=2';\n\n\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\txhr.host = a.host;\n\t\t\txhr.service = a.service;\n\t\t\txhr.onreadystatechange = function() {\n\t\t\t\tif(this.readyState != 4 || this.status != 200) return;\n\t\t\t\tif(this.responseText.indexOf('Your command request was successfully submitted to Nagios for processing.') < 0) {\n\t\t\t\t\t// Error\n\t\t\t\t\t$(\"#loadMask\").append(a.service == '' ? 'Error : ' + this.host + '<br />' : 'Error : ' + this.host + '/' + this.service + '<br />');\n\t\t\t\t}\n\t\t\t\t$('#progressbar').progressbar('option', 'value', (cur + 1) * 100 / nb);\n\t\t\t\tdoRefresh(server, alerts, nb, cur + 1);\n\t\t\t};\n\t\t\txhr.open(\"POST\", configuration.getServerUrl(server) + configuration.servers[server].cmdPath, true);\n\t\t\txhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\t\t\txhr.send(params);\n\t\t} else {\n\t\t\t$('#progressbar').progressbar('option', 'value', (cur + 1) * 100 / nb);\n\t\t\tdoRefresh(server, alerts, nb, cur + 1);\n\t\t}\n\t} else {\n\t\tsetTimeout(\"$('#loadMask').dialog('close');\", 1000);\n\t}\n}", "function doPOST(data)//, on_load_function)\n{\n\tvar req = new XMLHttpRequest();\n\t\n\t// TODO: use webstorage to store configuration such as server name\n\t// (http://www.w3.org/TR/webstorage/).\n\t\n\treq.open('POST','http://192.168.178.106:80/jsonrpc');\n\treq.setRequestHeader(\"Content-Type\", \"application/json\");\n\t//if (on_load_function) { req.onload = on_load_function; }\n\treq.send(data);\n}", "function appRequest(port, dataUrl, genomeID, mergeFlag, locusString, trackName) {\n\n // be good and remove the previous cytoscape script element\n // although, based on debugging, i'm not sure this really does anything\n var oldScript = document.getElementById(SCRIPT_ELEMENT_ID);\n if (oldScript) {\n oldScript.parentNode.removeChild(oldScript);\n }\n\n var localURL;\n sessionURL = dataUrl;\n genome = genomeID;\n locus = locusString;\n merge = mergeFlag;\n name = trackName;\n\n if(dataUrl) {\n localURL = \"http://127.0.0.1:\" + port + \"/load?callback=callBack();\";\n localURL += \"&file=\" + dataUrl;\n if (genomeID) {\n localURL += \"&genome=\" + genomeID;\n }\n if (locusString) {\n localURL += \"&locus=\" + locusString;\n }\n if (mergeFlag) {\n localURL += \"&merge=\" + mergeFlag;\n }\n if (trackName) {\n localURL += \"&name=\" + trackName;\n }\n }\n else {\n localURL = \"http://127.0.0.1:\" + port + \"/goto?callback=callBack();&locus=\" + locusString;\n }\n // create new script\n var newScript = document.createElement(\"script\");\n newScript.id = SCRIPT_ELEMENT_ID;\n newScript.setAttribute(\"type\", \"text/javascript\");\n newScript.setAttribute(\"src\", localURL);\n\n // add new script to document (head section)\n var head = document.getElementsByTagName(\"head\")[0];\n head.appendChild(newScript);\n\n // disable link\n // we do this because some browsers\n // will not fetch data if the url has been fetched in the past\n //disableLink(\"1\");\n\n // set timeout - handler for when IGV is not running\n timeoutVar = setTimeout(\"timeoutHandler()\", 2000);\n\n}", "function ajaxSetUpForTotalCpuUsage2(cpuTotalUsageDBIdIndexArg) {\n console.log(\"setting up things for pulling total cpu usage...\");\n\n // display the spinner until the ajax call being requested\n // $('#ajaxLoader').show();\n\n let url = \"http://localhost:8080/api/ajax/cpus/\" + cpuTotalUsageDBIdIndexArg;\n console.log(\"Endpoint requested: \", url);\n\n $.get(url, populateTotalCpuInfo2);\n console.log(\"call made...\");\n}", "function serverResponse(data) {\n if (data == null) {\n\tconsoleAddMessage(\"#console1\", CONSOLE_ERROR,\n\t\t\t \"Cannot communicate with server!\");\n\tconsoleWarn('Null server response');\n updates_failed++;\n return;\n }\n var timestamp = new Date().getTime();\n consoleLog(\"data =\", data); // DEBUG\n if (data.id != server_id) {\n\tconsoleClear(\"#console1\");\n\tif (server_id != '0') {\n\t consoleAddMessage(\"#console1\", CONSOLE_INFO,\n\t\t\t \"Server restarted.\");\n\t}\n server_id = data.id;\n nodes_updated = 0;\n }\n updates_failed = 0;\n for (var key in data) {\n if (key == \"id\") {\n // skip\n } else if (key == GLOBAL_EVENT) {\n consoleLog('Updating global events ', data[key]); // DEBUG\n nodes[key].events = concatT(nodes[key].events, data[key].events);\n for (var e in data[key].events) {\n consoleAddMessage(\"#console1\",\n data[key].events[e][1],\n data[key].events[e][2],\n data[key].events[e][0]);\n }\n } else if (key == \"nodes\") {\n consoleLog('Updating list of nodes ', data.nodes); // DEBUG\n for (var n in data.nodes) {\n var node_id = data.nodes[n];\n if (! (node_id in nodes)) {\n node_new(node_id);\n }\n nodes[node_id]._updated = timestamp;\n }\n for (var node_id in nodes) {\n if ((nodes[node_id]._updated != timestamp)\n && (node_id != '*')) {\n node_destroy(node_id);\n }\n }\n } else if (key == \"nodes_t\") {\n nodes_updated = data.nodes_t;\n } else {\n consoleLog('Updating node ' + key + ': ', data[key]); // DEBUG\n if (! data[key]) {\n // node does not exist (maybe already deleted by the code above)\n if (key in nodes) {\n node_destroy(key);\n }\n continue;\n }\n if (\"events\" in data[key]) {\n nodes[key].events = concatT(nodes[key].events,\n data[key].events);\n var name = key;\n if ((\"state\" in data[key]) && (\"name\" in data[key].state)) {\n name = data[key].state.name;\n } else if (\"name\" in nodes[key].state) {\n name = nodes[key].state.name;\n }\n for (var e in data[key].events) {\n consoleAddMessage(\"#console1\",\n data[key].events[e][1],\n data[key].events[e][2],\n data[key].events[e][0],\n key);\n }\n }\n if (\"load\" in data[key]) {\n nodes[key].load = concatT(nodes[key].load, data[key].load);\n if (key == tmp_monitor) {\n load_redraw = true;\n }\n }\n if (\"state\" in data[key]) {\n nodes[key].state = data[key].state;\n nodes_redraw = true;\n }\n if (\"vms\" in data[key]) {\n for (var vm_name in data[key].vms) {\n if (data[key].vms[vm_name]) {\n if (! nodes[key].vms) {\n nodes[key].vms = {};\n }\n if (! nodes[key].vms[vm_name]) {\n node_add_vm(key, vm_name);\n }\n nodes[key].vms[vm_name].type\n = data[key].vms[vm_name].type;\n nodes[key].vms[vm_name].status\n = data[key].vms[vm_name].status;\n if (\"events\" in data[key].vms[vm_name]) {\n nodes[key].vms[vm_name].events\n = concatT(nodes[key].vms[vm_name].events,\n data[key].vms[vm_name].events);\n }\n if (\"load\" in data[key].vms[vm_name]) {\n nodes[key].vms[vm_name].load\n = concatT(nodes[key].vms[vm_name].load,\n data[key].vms[vm_name].load);\n load_redraw = true;\n }\n if (\"proc_status\" in data[key].vms[vm_name]) {\n nodes[key].vms[vm_name].proc_status\n = nodes[key].vms[vm_name].proc_status;\n }\n } else {\n if (nodes[key].vms && (vm_name in nodes[key].vms)) {\n node_del_vm(key, vm_name);\n }\n }\n }\n }\n }\n }\n if (nodes_redraw) {\n nodes_redraw = false;\n displayNodes('#vmlist');\n }\n if (load_redraw && tmp_monitor) {\n displayLoadGraph(tmp_monitor);\n }\n consoleScroll(\"#console1\");\n}", "function getServiceList() {\n var hostID = document.getElementById(\"selectAgent\").value;\n // for\n var agentName = $(\"#selectAgent option:selected\").text(); //document.getElementById(\"selectAgent\")[index].text;\n if (agentName == \"ServerMonitor\") {\n\n receiveServiceListReq.open(\"POST\", serverURL + \"/MonitorData\", true);\n\n receiveSourceFilterReq.open(\"POST\", serverURL + \"/MonitorData\", true);\n //Set the function that will be called when the XmlHttpRequest objects state changes.\t\t\n receiveServiceListReq.onreadystatechange = loadServiceAndSourceList;\n receiveServiceListReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\n //Make the actual request.\t\t\n // var query2 = \"SELECT * FROM InovoMonitor.tblAlarms t WHERE currentstatus<>'RESET'\";\n var queryService = \"SELECT InovoMonitor.tblSvrServiceInfo.serviceDisplayName FROM InovoMonitor.tblSvrServiceInfo WHERE InovoMonitor.tblSvrServiceInfo.runid=(SELECT InovoMonitor.tblTransactionList.transactionid FROM InovoMonitor.tblTransactionList WHERE InovoMonitor.tblTransactionList.id=(SELECT MAX(InovoMonitor.tblTransactionList.id) FROM InovoMonitor.tblTransactionList where InovoMonitor.tblTransactionList.hostid=\" + hostID + \"));\";\n receiveServiceListReq.send(\"action=runopenquery&query=\" + queryService);\n } else {\n document.getElementById(\"selectServiceDiv\").hidden = true;\n document.getElementById(\"selectSourceDiv\").hidden = true;\n document.getElementById(\"selectService\").disabled = true;\n document.getElementById(\"selectSource\").disabled = true;\n }\n\n\n}", "static sendRequest(callback, action, params = \"\") {\n equipment.sendPacket();\n\n let data = {\n 'action': action,\n 'handler': 'equipment',\n 'params': params\n };\n\n $.ajax({\n type: \"POST\",\n url: './core/ajax/ajax.php',\n data: data,\n cache: false,\n xhrFields: {\n withCredentials: true\n },\n success: function (resultData) {\n equipment[callback](resultData);\n }\n });\n }", "function show_node(id)\n{\n\turl = 'getNCBI.php';\n\tpars = 'id=' + id;\n\t\n\tvar myAjax = new Ajax.Request( url, \n\t\t{method: 'get', parameters: pars, onLoading: showLoad, onComplete: showResponse} );\n\n}", "function sendRequest(params) {\n return axios({\n method: \"get\",\n url: \"http://localhost:5000/api/\"+params.path+\"?mode=\"+params.mode+\"&input=\"+params.query,\n headers: {\"Content-Type\": \"application/json\"}\n });\n }", "function request_listings( new_params ){\n\t\t\t\t\n\t\t\t\t//checking if the request url is provided\n\t\t\t\tif(settings.request_uri != ''){\n\t\t\t\t\t\n\t\t\t\t\t//Add loading indicator class\n\t\t\t\t\t$(el).addClass( settings.loading_class );\n\t\t\t\t\t$(settings.listings_el).addClass( settings.loading_class );\n\t\t\t\t\t\n\t\t\t\t\t//make the ajax request with all the parameters as get variables\n\t\t\t\t\t$.get(settings.request_uri+ '?' + $.param( $.extend(params , new_params) ), function(data){\n\t\t\t\t\t\t\n\t\t\t\t\t\t//deleting old markers\n\t\t\t\t\t\tdeleteMarkers();\n\t\t\t\t\t\t\n\t\t\t\t\t\t//removing old listings\n\t\t\t\t\t\t$(settings.listings_el).empty();\n\t\t\t\t\t\t\n\t\t\t\t\t\t//processing the returned data. Adding listings to the page and create markers\n\t\t\t\t\t\t$.each(data[ settings.results_key ] , function( index , value ){\n\t\t\t\t\t\t\tinsert_listing( index , value );\n\t\t\t\t\t\t\taddMarker( index , value );\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t//remove the previous pagination and add new one\n\t\t\t\t\t\t$(settings.pagination_el).empty().prepend(create_pagination(settings.page_number(data)));\n\t\t\t\t\t\t//bind click events to pagination buttons\n\t\t\t\t\t\t$('.'+settings.pagi_link_class).click(function(){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\textra_params['page'] = $(this).data('href');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$.fn.mapSearch.update(extra_params);\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//add markers to the map\n\t\t\t\t\t\tif(settings.marker_clusterer && typeof MarkerClusterer === 'function'){\n\t\t\t\t\t\t\tmarkerClusterer.clearMarkers();\n\t\t\t\t\t\t\tmarkerClusterer.addMarkers(markers);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tshowMarkers();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//remove loading class\n\t\t\t\t\t\t$(el).removeClass( settings.loading_class );\n\t\t\t\t\t\t$(settings.listings_el).removeClass( settings.loading_class );\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}", "function ajaxSetUpForTotalCpuUsage3(cpuTotalUsageDBIdIndexArg) {\n console.log(\"setting up things for pulling total cpu usage...\");\n\n // display the spinner until the ajax call being requested\n // $('#ajaxLoader').show();\n\n let url = \"http://localhost:8080/api/ajax/cpus/\" + cpuTotalUsageDBIdIndexArg;\n console.log(\"Endpoint requested: \", url);\n\n $.get(url, populateTotalCpuInfo3);\n console.log(\"call made...\");\n}", "radkitServer(objectFramePath,objectFrameNodePath,reqParam){\n var vm = this;\n var dfd = new $.Deferred();\n //var component = vm.getClientAppData().composerDOM[objectFrameNodePath];\n var renderedNode = vm.findRenderedNode(objectFrameNodePath);\n\n var compilerEndPoint = objectFramePath.substring(0,objectFramePath.indexOf(\"{}\")+2).replace(\"//\",\"/\");\n var param = {\n \"solvent_radkit_composer_on\":vm.getBrowserParam(\"solvent_radkit_composer_on\"),\n \"solvent_radkit_composer_action\":\"compile-node\",\n \"solvent_radkit_composer_nodepath\":renderedNode.path,\n \"solvent_radkit_composer_requested_resource\":renderedNode.path\n };\n if(reqParam)\n {\t\n param = Object.assign(param,reqParam);\n }\n\n vm.setClientAppData(\"progressOverlay\",true);\n $.ajax({\n method: \"POST\",\n url: compilerEndPoint,\n data:param,\n dataType:\"json\"\n })\n .done(function( node ) {\n vm.setClientAppData(\"progressOverlay\",false);\n //var nodeDescription = node[node.solvent_radkit_composer_node_path];\n //vm.getClientAppData().composerDOM[node.solvent_radkit_composer_node_path] = nodeDescription;\n\n var recompileData = vm.getObjectByType(node,\"InstanceDataModel{}\");\n if(recompileData)\n {\n var DnDcontainers = recompileData.DnDcontainers;\n var DnDcomponentTree = recompileData.composerDOM;\n var DnDcomponentTreePaths = recompileData.composerDOMPaths;\n\n //console.log(\"vm.getClientAppData(\"DnDcontainers\")\")\n //console.log(JSON.stringify(vm.getClientAppData(\"DnDcontainers\")));\n\n //vm.getClientAppData(\"DnDcontainers\") = Object.assign(vm.getClientAppData(\"DnDcontainers\"),DnDcontainers);\n //vm.getClientAppData().composerDOM = Object.assign(vm.getClientAppData().composerDOM,DnDcomponentTree);\n vm.setClientAppData(\"DnDcontainers\",DnDcontainers); \n vm.setClientAppData(\"composerDOM\",DnDcomponentTree);\n vm.setClientAppData(\"composerDOMPaths\",DnDcomponentTreePaths);\n\n vm.mergeObjects(vm.getClientAppData(),recompileData);\n }\n\n var nodeDescription = vm.getClientAppData().composerDOM[node.solvent_radkit_composer_node_path];\n vm.setNodeDescriptions(node);\n\n //console.log(\"Render function before calling compile\");\n //console.log(vm.render);\n\n var nodeYield = vm.getNodeYield(node);\n //strip out inner frame wrapping\n //nodeYield = nodeYield.substring(node.xsolvent_radkit_composer_uicomponent_frame_yield.length);\n\n if(nodeYield.startsWith(\"<solvent-radkit-composer-node-frame\"))\n {\n nodeYield = vm.stripLeadingTag(nodeYield);\n nodeYield = nodeYield.substring(0,nodeYield.lastIndexOf(\"</solvent-radkit-composer-node-frame>\"));\n }\n else\n if(nodeYield.startsWith(\"<template\"))//climb up until a non-template node\n {\n var parentNodePath = renderedNode.path.substring(0,renderedNode.path.lastIndexOf(\"/\"));\n vm.radkitServer(objectFramePath,parentNodePath,reqParam)\n .then(function(node){\n dfd.resolve(node);\n });\n return;\n }\n\n var renderFN = Vue.compile(nodeYield);\n var staticRenderFns = vm.clientApp.$options.staticRenderFns;\n var render = vm.clientApp.render;\n var _staticTrees = vm.clientApp._staticTrees;\n\n vm.clientApp._staticTrees = [];\n vm.clientApp.$options.staticRenderFns = [];\n renderFN.staticRenderFns.map(fn => (vm.clientApp.$options.staticRenderFns.push(fn)));\n\n nodeDescription.xsolvent_radkit_composer_uicomponent_slot = renderFN.render.call(vm.clientApp);\n\n vm.clientApp.$options.staticRenderFns = [];\n staticRenderFns.map(fn => (vm.clientApp.$options.staticRenderFns.push(fn)));\n vm.clientApp._staticTrees = _staticTrees;//so WRONG\n \n console.log(\"radkitServer:Triggering Render Function\");\n //trigger render\n //nodeDescription.xsolvent_radkit_composer_uicomponent_initialized = true;\n nodeDescription.xsolvent_radkit_composer_uicomponent_refId = new Date().getTime();\n dfd.resolve(node);\n }); \n return dfd.promise();\n }", "function ajaxForVehicles(){\n\t\tcreateDropDown(maxNumberOfVehicles, $dropDownVehicles);\n\t\thideTheRestDropDowns($dropDownVehicles);\n\t\t$spanInfo.text(\"Number of Vehicles\");\n\t\t$divContent.show();\n\t\t//initial value when link is clicked\n\t\tgenerateVehicles(initialNumberDisplayed);\n\t\t// get the ajax request\n\t\t$.get(\"http://swapi.co/api/vehicles/\", {\t\n\t\t}).done(function(data) {\n\t\t\t$dropDownVehicles.on( \"change\", function(){\n\t\t\t\tgenerateVehicles($(this).val());\n\t\t\t});\n\t\t\t$table.show();\t\n\t\t}).fail(function() {\n\t\t\talert('something went wrong in the ajaxForVehicles()! FIRST');\n\t\t});\n\t\t//end of ajax request\n\t}", "function createVM() {\r\n\tnodeFormVm = new Vue({\r\n\t\tel: '#manage-nodes-container',\r\n\t\tdata: {\r\n\t\t\tnodes: [],\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\tremoveNodeForm(index) {\r\n\t\t\t\tthis.nodes.splice(index, 1);\r\n\t\t\t},\r\n\t\t\taddNodeForm(node) {\r\n\t\t\t\tthis.nodes.push(node);\r\n\t\t\t},\r\n\t\t\tcontains(nodeId) {\r\n\t\t\t\tvar len = this.nodes.length;\r\n\t\t\t\tvar found = false;\r\n\t\t\t\tvar i = 0;\r\n\t\t\t\twhile (!found && i < len) {\r\n\t\t\t\t\tif (this.nodes[i].nodeId == nodeId) found = true;\r\n\t\t\t\t\telse i++;\r\n\t\t\t\t}\r\n\t\t\t\treturn found;\r\n\t\t\t},\r\n\t\t\tnameChanged(index) {\r\n\t\t\t\tlet node = this.nodes[index];\r\n\t\t\t\tif (node.name.length > 3) {\r\n\t\t\t\t\tnode.isNotValid = false;\r\n\t\t\t\t\tnode.disableButton = false;\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tnode.disableButton = true;\r\n\t\t\t\t\tnode.isNotValid = true;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tavailabilityChanged(index) {\r\n\t\t\t\tlet node = this.nodes[index];\r\n\t\t\t\tnode.disableButton = !this.nameChanged(index);\r\n\t\t\t},\r\n\t\t\tchangeNode(index) {\r\n\t\t\t\tif (this.nameChanged(index)) {\r\n\t\t\t\t\tvar formNode = this.nodes[index];\r\n\t\t\t\t\tvar node = nodes[formNode.nodeId];\r\n\t\t\t\t\tnode.isAvailable = JSON.parse(formNode.isAvailable);\r\n\t\t\t\t\tnode.name = formNode.name;\r\n\t\t\t\t\tupdateNode(node);\r\n\t\t\t\t\tconsole.log(node);\r\n\t\t\t\t\twindow.alert('Node: ' + node.nodeId + ' has been updated!');\r\n\t\t\t\t\tformNode.disableButton = true;\r\n\t\t\t\t\tremoveNodeScrollBar();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\temptyNodes() {\r\n\t\t\t\tthis.nodes = [];\r\n\t\t\t},\r\n\t\t},\r\n\t});\r\n\r\n\tsensorFormVm = new Vue({\r\n\t\tel: '#manage-sensors-container',\r\n\t\tdata: {\r\n\t\t\tsensors: [],\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\taddSensorForm(sensor) {\r\n\t\t\t\tthis.sensors.push(sensor);\r\n\t\t\t},\r\n\t\t\tcontains(code) {\r\n\t\t\t\tvar len = this.sensors.length;\r\n\t\t\t\tvar found = false;\r\n\t\t\t\tvar i = 0;\r\n\t\t\t\twhile (!found && i < len) {\r\n\t\t\t\t\tif (this.sensors[i].code == code) found = true;\r\n\t\t\t\t\telse i++;\r\n\t\t\t\t}\r\n\t\t\t\treturn found;\r\n\t\t\t},\r\n\t\t\temptySensors() {\r\n\t\t\t\tthis.sensors = [];\r\n\t\t\t},\r\n\t\t\tavailabilityChanged(index) {\r\n\t\t\t\tlet sensor = this.sensors[index];\r\n\t\t\t\tsensor.disableButton = !this.sampleTimeChanged(index);\r\n\t\t\t},\r\n\t\t\tprecisionChanged(index) {\r\n\t\t\t\tlet sensor = this.sensors[index];\r\n\t\t\t\tsensor.disableButton = !this.sampleTimeChanged(index);\r\n\t\t\t},\r\n\t\t\tsampleTimeChanged(index) {\r\n\t\t\t\tlet sensor = this.sensors[index];\r\n\t\t\t\tlet sampleTime = parseInt(sensor.sampleTime);\r\n\t\t\t\tlet enabled = false;\r\n\t\t\t\tif (sampleTime < 1000) {\r\n\t\t\t\t\tsensor.isNotValid =\r\n\t\t\t\t\t\t'Invalid sample time. Min = 1000. Up arrow to fix';\r\n\t\t\t\t} else if (sampleTime > 86400000) {\r\n\t\t\t\t\tsensor.isNotValid =\r\n\t\t\t\t\t\t'Invalid sample time. Max = 86400000. Down arrow to fix.';\r\n\t\t\t\t} else if (sampleTime % 1000 != 0) {\r\n\t\t\t\t\tsensor.isNotValid =\r\n\t\t\t\t\t\t'Invalid sample time. Step = 1000. Any arrow to fix.';\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsensor.isNotValid = '';\r\n\t\t\t\t\tenabled = true;\r\n\t\t\t\t}\r\n\t\t\t\tsensor.disableButton = !enabled;\r\n\t\t\t\treturn enabled;\r\n\t\t\t},\r\n\t\t\tchangeSensor(index) {\r\n\t\t\t\tif (this.sampleTimeChanged(index)) {\r\n\t\t\t\t\tvar formSensor = this.sensors[index];\r\n\t\t\t\t\tvar sensor = sensors[formSensor.code];\r\n\t\t\t\t\tsensor.isAvailable = JSON.parse(formSensor.isAvailable);\r\n\t\t\t\t\tsensor.sampleTime = parseInt(formSensor.sampleTime);\r\n\t\t\t\t\tsensor.precision =\r\n\t\t\t\t\t\t'+/-' +\r\n\t\t\t\t\t\tformSensor.precision +\r\n\t\t\t\t\t\tevaluateContext(sensor.context);\r\n\t\t\t\t\tupdateSensor(sensor);\r\n\t\t\t\t\twindow.alert(\r\n\t\t\t\t\t\t'Sensor: ' + sensor.code + ' has been updated!'\r\n\t\t\t\t\t);\r\n\t\t\t\t\tformSensor.disableButton = true;\r\n\t\t\t\t\tremoveNodeScrollBar();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t},\r\n\t});\r\n}", "function file_getNodeFiles(nid, callback) {\n var method = 'file.getNodeFiles';\n var timestamp = get_timestamp();\n var nonce = get_nonce();\n \n // Generating hash according to ServicesAPI Key method\n hash = get_hash(key, timestamp, domain, nonce, method);\n \n //array to pass all parameters\n var params = new Array(hash, domain, timestamp, nonce, nid);\n \n //formatted xmlrpc call\n var xml = xmlrpc_encode(method, params);\n \n var xhr = Titanium.Network.createHTTPClient();\n xhr.open(\"POST\",url);\n xhr.onload = callback;\n \n Titanium.API.info(\"xmlrpc: xml: \"+xml);\n xhr.send(xml);\n Titanium.API.info(\"xmlrpc: end\");\n}", "getNodes(latenciesMap = null, latencies = true, hidden = false, unsuitableSecurity = false, testNet = false) {\n if (latenciesMap == null) {\n latenciesMap = stores_SettingsStore__WEBPACK_IMPORTED_MODULE_7__[\"default\"].getState().apiLatencies;\n }\n\n if (latencies) {\n // if there are no latencies, return all that are left after filtering\n latencies = Object.keys(latenciesMap).length > 0;\n }\n\n let filtered = this.getAllApiServers().filter(a => {\n // Skip hidden nodes\n if (!hidden && a.hidden) return false; // do not automatically connect to TESTNET\n\n if (!testNet && this._isTestNet(a.url)) return false; // remove the automatic fallback dummy url\n\n if (a.url.indexOf(\"fake.automatic-selection\") !== -1) return false; // Remove insecure websocket urls when using secure protocol\n\n if (!unsuitableSecurity && !this._apiUrlSecuritySuitable(a.url)) {\n return false;\n } // we don't know any latencies, return all\n\n\n if (!latencies) return true; // only keep the ones we were able to connect to\n\n return !!latenciesMap[a.url];\n }); // create more info in the entries\n\n filtered = filtered.map(a => {\n a.hidden = !!a.hidden;\n a.name = a.location || \"Unknown\";\n\n if (latenciesMap != null && a.url in latenciesMap) {\n a.latency = latenciesMap[a.url];\n } else {\n a.latency = null;\n }\n\n return a;\n }); // now sort\n\n filtered = filtered.sort((a, b) => {\n // if both have latency, sort according to that\n if (a.latency != null && b.latency != null) {\n return a.latency - b.latency; // sort testnet to the bottom\n } else if (a.latency == null && b.latency == null) {\n if (this._isTestNet(a.url)) return -1;\n return 1; // otherwise prefer the pinged one\n } else if (a.latency != null && b.latency == null) {\n return -1;\n } else if (b.latency != null && a.latency == null) {\n return 1;\n }\n\n return 0;\n });\n /*\n * We've somehow filtered out all nodes, revert to the full list of\n * nodes in that case\n */\n\n if (!filtered.length) {\n console.warn(\"No nodes length, returning all of them\");\n return this.getAllApiServers();\n }\n\n return filtered;\n }", "function updateAvailableNodes() {\r\n\tvar availableNodesSpan = document.getElementById('available-nodes-span');\r\n\tif (availableNodesSpan != null || availableNodesSpan != undefined) {\r\n\t\tavailableNodesSpan.innerText = countAvailableNodes();\r\n\t}\r\n}", "function RefreshOtherUsers(){\n $.ajax({\n type: 'GET',\n url: '/index.pl?node=Other Users XML Ticker II&nosort=1',\n dataType: 'xml',\n success: ParseOtherUsers\n });\n}", "function refresh_predic_status() {\n // https://www.w3schools.com/js/js_ajax_http.asp\n\n var myREQ = new XMLHttpRequest();\n\n // Will trigger an action when HttpRequest has completed: page_update\n myREQ.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n page_update(this.responseText);\n }\n };\n\n // the http request:\n myREQ.open(method=\"GET\", url=\"php/functions.php?command=status\", async=true);\n myREQ.send();\n}", "function ai_dist_endpoint(event){\r\n\r\n // AJAX server request\r\n var xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = function(){\r\n\r\n // Valid response\r\n if(this.readyState==4 && this.status==200){\r\n\r\n // Security check\r\n if(this.responseText === \"SECURITY BREACH\"){\r\n window.location.replace(\"/\");\r\n return;\r\n }\r\n\r\n // Process response - create heatmap\r\n visualise_heatmap(JSON.parse(this.responseText));\r\n\r\n }\r\n\r\n }\r\n xhttp.open(\"POST\", \"/ai_dist\", true);\r\n xhttp.setRequestHeader('content-type',\r\n 'application/x-www-form-urlencoded;charset=UTF-8');\r\n xhttp.send();\r\n\r\n}", "function setRunningProcessInstances() {\n\t$.ajax({\n type: 'GET',\n url: JODA_ENGINE_ADRESS + '/api/navigator/status/running-instances',\n success: function(data) {\n \tnumberOfRunningInstances = data.length;\n },\n dataType: \"json\"\n });\n}", "function doHttpRequestForTempSensor (){\n\tvar reqLV = new XMLHttpRequest(); // Make object to do this HTTP request\n\treqLV.onreadystatechange = cbHttpReqListenerGetTempValAndPlot;\n\treqLV.open(\"get\", \"http://\" + host + \":8001/WebService1/Lab5_LV_TempSensor\", true);\t\t\t \n\treqLV.send();\n}", "radkitServer(objectFramePath,objectFrameNodePath,reqParam){\n var vm = this;\n var dfd = new $.Deferred();\n var renderedNode = vm.findRenderedNode(objectFrameNodePath);\n\n var compilerEndPoint = objectFramePath.substring(0,objectFramePath.indexOf(\"{}\")+2).replace(\"//\",\"/\");\n var param = {\n \"solvent_radkit_composer_on\":vm.getBrowserParam(\"solvent_radkit_composer_on\"),\n \"solvent_radkit_composer_action\":\"compile-node\",\n \"solvent_radkit_composer_nodepath\":renderedNode.path,\n \"solvent_radkit_composer_requested_resource\":renderedNode.path\n };\n if(reqParam)\n {\t\n param = Object.assign(param,reqParam);\n } \n vm.setClientAppData(\"progressOverlay\",true);\n $.ajax({\n method: \"POST\",\n url: compilerEndPoint,\n data:param,\n dataType:\"json\"\n })\n .done(function( node ) {\n vm.setClientAppData(\"progressOverlay\",false);\n //var nodeDescription = node[node.solvent_radkit_composer_node_path];\n //vm.composerDOM[node.solvent_radkit_composer_node_path] = nodeDescription;\n\n var recompileData = vm.getObjectByType(node,\"InstanceDataModel{}\");\n if(recompileData)\n {\n var DnDcontainers = Object.assign({},recompileData.DnDcontainers);\n var composerDOM = Object.assign({},recompileData.composerDOM);\n var composerDOMPaths = Object.assign({},recompileData.composerDOMPaths);\n\n //console.log(\"vm.getClientAppData(\"DnDcontainers\")\")\n //console.log(JSON.stringify(vm.getClientAppData(\"DnDcontainers\")));\n vm.setClientAppData(\"DnDcontainers\",DnDcontainers);\n vm.setClientAppData(\"composerDOM\",composerDOM);\n vm.setClientAppData(\"composerDOMPaths\",composerDOMPaths);\n\n vm.mergeObjects(vm.state,recompileData);\n }\n\n var nodeDescription = vm.getClientAppData(\"composerDOM\")[node.solvent_radkit_composer_node_path];\n vm.setNodeDescriptions(node);\n\n //console.log(\"Render function before calling compile\");\n //console.log(vm.render);\n\n var nodeYield = vm.getNodeYield(node);\n\n\n if(nodeYield.startsWith(\"<SolventRadkitComposerNodeFrame\"))\n {\n nodeYield = vm.stripLeadingTag(nodeYield);\n nodeYield = nodeYield.substring(0,nodeYield.lastIndexOf(\"</SolventRadkitComposerNodeFrame>\"));\n }\n else\n if(nodeYield.startsWith(\"<template\"))//climb up until a non-template node\n {\n var parentNodePath = renderedNode.path.substring(0,renderedNode.path.lastIndexOf(\"/\"));\n vm.radkitServer(objectFramePath,parentNodePath,reqParam)\n .then(function(node){\n dfd.resolve(node);\n });\n return;\n } \n\n //strip out inner frame wrapping\n //nodeYield = nodeYield.substring(node.xsolvent_radkit_composer_uicomponent_frame_yield.length);\n //nodeYield = nodeYield.substring(0,nodeYield.lastIndexOf(\"</SolventRadkitComposerNodeFrame>\"));\n\n\n nodeDescription.xsolvent_radkit_composer_uicomponent_slot = nodeYield;\n\n /**\n var jsxCode = Babel.\n transform(\"nodeDescription.xsolvent_radkit_composer_uicomponent_slot= ()=> (\"+nodeYield+\")\", { \n //\"plugins\": [\"@babel/plugin-transform-react-jsx\"],\n \"presets\": [\"react\"]\n }).code;\n //eval(jsxCode);\n console.log(nodeDescription.xsolvent_radkit_composer_uicomponent_slot);\n **/\n console.log(\"radkitServer:Triggering Render Function\");\n //trigger render\n //nodeDescription.xsolvent_radkit_composer_uicomponent_initialized = true;\n\n //nodeDescription.xsolvent_radkit_composer_uicomponent_refId = new Date().getTime();\n if(nodeDescription.forceUpdate)\n nodeDescription.forceUpdate();\n\n //vm.setState({\"composerDOM\"})\n\n dfd.resolve(node);\n }); \n return dfd.promise();\n }", "function listRunningKernels(options) {\n if (options === void 0) { options = {}; }\n var baseUrl = options.baseUrl || utils.getBaseUrl();\n var url = utils.urlPathJoin(baseUrl, KERNEL_SERVICE_URL);\n var ajaxSettings = utils.copy(options.ajaxSettings || {});\n ajaxSettings.method = 'GET';\n ajaxSettings.dataType = 'json';\n ajaxSettings.cache = false;\n return utils.ajaxRequest(url, ajaxSettings).then(function (success) {\n if (success.xhr.status !== 200) {\n return utils.makeAjaxError(success);\n }\n if (!Array.isArray(success.data)) {\n return utils.makeAjaxError(success, 'Invalid kernel list');\n }\n for (var i = 0; i < success.data.length; i++) {\n try {\n validate.validateKernelModel(success.data[i]);\n }\n catch (err) {\n return utils.makeAjaxError(success, err.message);\n }\n }\n return success.data;\n }, Private.onKernelError);\n}", "function getProcessUpdate() {\n\n\tdojo\n\t\t\t.xhrGet({\n\t\t\t\t// The following URL must match the destination\n\t\t\t\t// url:\n\t\t\t\t// \"http://webcomponentdemo13.alpha.vmforce.com/getProcessUpdate\",\n\t\t\t\turl : \"http://localhost:9090/webcomponent/getProcessUpdate\",\n\t\t\t\t//url : \"http://mdmoncloud.alpha.vmforce.com/getProcessUpdate\",\n\t\t\t\thandleAs : \"text\",\n\t\t\t\ttimeout : 5000, // Time in milliseconds\n\n\t\t\t\t// The LOAD function will be called on a successful response.\n\t\t\t\tload : function(response, ioArgs) { //\n\t\t\t\t\tvar updatedVal = response * 1;\n\t\t\t\t\t// alert(\"updatedVal\"+updatedVal);\n\t\t\t\t\tjsProgress.update({\n\t\t\t\t\t\tmaximum : 100,\n\t\t\t\t\t\tprogress : updatedVal\n\t\t\t\t\t});\n\t\t\t\t\tif (updatedVal == 100) {\n\n\t\t\t\t\t\t// needToGetProcessUpdate = false;\n\t\t\t\t\t\tconfirm(\"Page refresh will happen. Please confirm?\");\n\t\t\t\t\t\tlocation.reload(true);\n\t\t\t\t\t}\n\t\t\t\t\treturn response; // \n\t\t\t\t},\n\n\t\t\t\t// The ERROR function will be called in an error case.\n\t\t\t\terror : function(response, ioArgs) { // \n\t\t\t\t\tconsole.error(\"HTTP status code: \", ioArgs.xhr.status); //\n\t\t\t\t\tdojo.byId(\"replace\").innerHTML = 'Loading the ressource from the server has failed'; // \n\t\t\t\t\treturn response; // \n\t\t\t\t},\n\n\t\t\t\t// Here you put the parameters to the server side program\n\t\t\t\t// We send two hard-coded parameters\n\t\t\t\tcontent : {\n\t\t\t\t\tname : \"lars\",\n\t\t\t\t\turl : \"testing\"\n\t\t\t\t}\n\t\t\t});\n\n}", "getAllNodes () {\n client.getAllNodes(this.host, 4369, function (err, nodes) {\n if (err) {\n console.error(err)\n return\n }\n console.log(nodes)\n })\n }", "function getStatus(host_copy) {\n document.getElementById(host_copy + \"-status\").innerHTML = \"<img src=\\\"/images/indicator.gif\\\"></img>\";\n document.getElementById(host_copy + \"-ip\").innerHTML = \"Resolving...\";\n request = createRequest();\n if (request == null) {\n alert(\"Unable to create request\");\n return;\n }\n var url = wol_url + \"/wol-ajax.php\";\n var params = \"function=host_status\";\n params += \"&host=\" + escape(host_copy);\n //asynchronous request\n request.open(\"GET\",url+\"?\"+params,true);\n request.setRequestHeader(\"Cache-control\", \"no-cache, no-store, must-revalidate\");\n request.setRequestHeader(\"Connection\", \"close\");\n request.onreadystatechange = (function(request_copy) {\n return function() {\n if (request_copy.readyState == 4 && request_copy.status == 200) {\n var response = request_copy.responseText;\n response = response.trim();\n var response_array = response.split(\" \");\n //set host status in global array\n host_status[response_array[0]] = response_array[1];\n fillStatusRow(response_array);\n }\n }\n }(request));\n request.send(null);\n}", "function serializeData(nodes) {\n\t\tvar querystring = '', subelm, i, j;\n\t\tif (nodes.constructor === Object) { // Serialize JSON data\n\t\t\tfor (subelm in nodes) {\n\t\t\t\tif (nodes.hasOwnProperty(subelm)) {\n\t\t\t\t\tif (nodes[subelm].constructor === Array) {\n\t\t\t\t\t\tfor (i = 0; i < nodes[subelm].length; i += 1) {\n\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm][i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // Serialize node data\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (elm.nodeName === 'FORM') {\n\t\t\t\t\tfor (i = 0; i < elm.elements.length; i += 1) {\n\t\t\t\t\t\tsubelm = elm.elements[i];\n\n\t\t\t\t\t\tif (!subelm.disabled) {\n\t\t\t\t\t\t\tswitch (subelm.type) {\n\t\t\t\t\t\t\t\t// Ignore buttons, unsupported XHR 1 form fields\n\t\t\t\t\t\t\t\tcase 'button':\n\t\t\t\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\t\tcase 'submit':\n\t\t\t\t\t\t\t\tcase 'reset':\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-one':\n\t\t\t\t\t\t\t\t\tif (subelm.length > 0) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'select-multiple':\n\t\t\t\t\t\t\t\t\tfor (j = 0; j < subelm.length; j += 1) {\n\t\t\t\t\t\t\t\t\t\tif (subelm[j].selected) {\n\t\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm[j].value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\t\tif (subelm.checked) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t// Everything else including shinny new HTML5 input types\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t\t// Tidy up first &\n\t\treturn (querystring.length > 0) ? querystring.substring(1) : '';\n\t}", "function requestcommand(jeedomcmd) {\n\n var myKeyValue, myIPValue, myHttps;\n\n myKeyValue = localStorage.getItem(\"KEY\");\n myIPValue = localStorage.getItem(\"IP\");\n myHttps = \"\";\n if (JSON.parse(localStorage.getItem(\"HTTPS\"))) {\n myHttps = \"s\";\n }\n\n var client = new XMLHttpRequest();\n client.open(\"GET\", \"http\" + myHttps + \"://\" + myIPValue + \"/core/api/jeeApi.php?apikey=\" + myKeyValue + \"&type=cmd&id=\" + jeedomcmd);\n console.log(\"http\" + myHttps + \"://\" + myIPValue + \"/core/api/jeeApi.php?apikey=\" + myKeyValue + \"&type=cmd&id=\" + jeedomcmd);\n client.onreadystatechange = function () {\n if (client.readyState == 4) {\n if (client.status == 200) {\n console.log(client.responseText);\n navigator.vibrate([500, 500, 500]);\n }\n }\n };\n client.send();\n}", "function start_cloud(section,plugin,cloud)\n{\n submit_data=\"section=\"+section+\"&plugin=\"+plugin+\"&cloud=\"+cloud+\"&type=start_cloud\";\n $.ajax({\n type: \"POST\",\n url: \"index.php\",\n data: submit_data,\n beforeSend: function() {\n $('#daemonStatus').removeClass(\"stopped\");\n $('#daemonStatus').removeClass(\"running\");\n $('#daemonStatus').addClass(\"loading\");\n },\n error: function(xhr) {\n notify(\"fail.png\", \"Error occurred. Please, refresh the page.\");\n },\n success: function(datos) {\n $('#daemonStatus').removeClass(\"loading\");\n $('#daemonStatus').addClass(\"running\");\n }\n });\n}", "function swapToManageNodes() {\r\n\tnodeFormVm.emptyNodes();\r\n\tvar node;\r\n\tfor (var i = 0; i < nodesPayload.length; i++) {\r\n\t\tnode = JSON.stringify(nodesPayload[i]);\r\n\t\tnode = JSON.parse(node);\r\n\t\tdelete node._id;\r\n\t\tdelete node.sensors;\r\n\t\tnode.disableButton = true;\r\n\t\tif (!nodeFormVm.contains(node.nodeId)) nodeFormVm.addNodeForm(node);\r\n\t}\r\n\r\n\tclearCoreFrame();\r\n\tcoreFrame.append(manageNodesFrame);\r\n\tmanageNodesFrame.style.display = 'block';\r\n}", "function sendUpdateRequest(){\n var x = $(\"#select-compareX-dataset\").val();\n var y = $(\"#select-compareY-dataset\").val();\n var z = $(\"#select-compareZ-dataset\").val();\n var dataurl = $(\"#compare-vis\").data(\"url\");\n dataurl = dataurl + \"?x=\" + x + \"&y=\" + y + \"&z=\" + z;\n\n // Show loading screen and make sure starter message is no longer displayed\n d3.select(\".start-message\").style(\"display\", \"none\").remove();\n $(\".loading-compare\").fadeIn(\"slow\");\n\n // Get new data\n $.ajax({\n type: 'GET',\n contentType: 'application/json; charset=utf-8',\n url: dataurl,\n dataType: 'json',\n success: function (data) {\n updateBubbleGraph(data.data, data.xLabel, data.yLabel);\n $(\".loading-compare\").fadeOut(\"slow\");\n },\n error: function (result) {\n console.log('Error');\n }\n });\n}", "function update() {\n\tIPC.sendToHost('api-call', '/daemon/version', 'version');\n\t\n\tupdating = setTimeout(update, 50000);\n}", "function listFormTree(){\n var idsis = $('idsistema').value;\n var url = '../../ccontrol/control/control.php';\n var data = 'p1=listFormTree&idsistema='+idsis;\n new Ajax.Request (url,\n {method : 'get',\n parameters \t: data,\n onLoading\t: function(transport){est_cargador(1);},\n onComplete\t: function(transport){est_cargador(0);\n eval(transport.responseText);\n }\n }\n )\n}", "function updateCycle(){\n $.ajax({\n url: '../../simulation/update.php',\n data: {data: serverStatus},\n type: \"POST\",\n success: function(result){\n doorStatus = result;\n }\n });\n $(\".sim-deur-status\").text(doorStatus);\n}", "function ajaxFunction(controller,errElementID,successElementID,hideElementID,showElementID)\r\n{\r\n\txmlHttp=GetXmlHttpObject()\r\n\tif (xmlHttp==null)\r\n\t{\r\n\t\talert (\"Browser does not support HTTP Request\")\r\n\t\treturn\r\n\t}\r\n\tvar url = controller;\r\n\t\r\n\txmlHttp.onreadystatechange = function() { handleStateChange(xmlHttp,errElementID,successElementID,hideElementID,showElementID);};\r\n\t\r\n\txmlHttp.open(\"GET\",url,true)\r\n\t\r\n\txmlHttp.send(null)\r\n}", "function getPathStatus() {\n // Call a 'local' CGI script that outputs data in JSON format\n var query = \"wmap.cgi\";\n log( \"getPathStatus: Calling cgi script \\\"\" + query + \"\\\"\" );\n var doreq = MochiKit.Async.doSimpleXMLHttpRequest( query );\n doreq.addCallback( handleUpdate );\n MochiKit.Async.callLater( refresh, getPathStatus );\n}", "function selectNodes(event,selectedNodes) {\n if(event.target.className !== \"network\") {\n //console.log(\"about to do a network.selectNodes off selectNodes called from EventBus with nodeNames: \" + selectedNodes);\n /* note this should not be necessary since the network display is a superset of map and spreadsheet\n // now figure out which if these are in the network display and select the ones that are\n var selectedNetworkNodes = [];\n if(all_hivtrace_nodes !== undefined) {\n for( var idx = 0; idx < selectedNodes.length; idx++ ) {\n if(all_hivtrace_nodes.indexOf(selectedNodes[idx]) != -1) {\n selectedNetworkNodes.push(selectedNodes[idx]);\n }\n }\n } else if(all_edge_csv_nodes !== undefined) {\n for( var idx = 0; idx < selectedNodes.length; idx++ ) {\n if(all_edge_csv_nodes.indexOf(selectedNodes[idx]) != -1) {\n selectedNetworkNodes.push(selectedNodes[idx]);\n }\n }\n } */\n // Because selectNodes deselects all previously selected nodes, we must preserve them\n var prevSelectedNodes = network.getSelectedNodes();\n // now add the newly selected ones to them\n var allNodes = union_arrays(prevSelectedNodes,selectedNodes);\n // here we call the network select nodes function\n network.selectNodes(allNodes, true); // note that this method does not propagate events!\n // this zooms in and out around a the selected nodes.\n doTheShow(selectedNodes, allNodes);\n }\n}" ]
[ "0.5795913", "0.5479802", "0.5242063", "0.5240739", "0.5190827", "0.5136627", "0.5118279", "0.50525594", "0.50485504", "0.5048341", "0.49593544", "0.49365163", "0.49307957", "0.49262488", "0.49098712", "0.49049285", "0.48844138", "0.48787758", "0.48362127", "0.4832406", "0.48299012", "0.48186913", "0.47960484", "0.47752404", "0.47584325", "0.4756239", "0.47514066", "0.47401726", "0.47401434", "0.4702607", "0.47008577", "0.4699239", "0.46974933", "0.46921924", "0.4691843", "0.46883595", "0.46766323", "0.46664855", "0.46636948", "0.4658617", "0.4652292", "0.4634452", "0.46150506", "0.4612902", "0.46107993", "0.4608002", "0.46074378", "0.4598358", "0.45938802", "0.4588556", "0.45774263", "0.45513573", "0.45465523", "0.4520901", "0.45166466", "0.4513318", "0.45123565", "0.4509342", "0.45084155", "0.4504403", "0.44889763", "0.44780427", "0.44770908", "0.44740504", "0.44739267", "0.4472744", "0.44663164", "0.44640955", "0.44618604", "0.44547856", "0.4451738", "0.44494364", "0.44439042", "0.4441488", "0.44402662", "0.4433812", "0.44325304", "0.44281244", "0.44253573", "0.44183254", "0.44147223", "0.44098732", "0.44090676", "0.4408925", "0.44077522", "0.44061294", "0.44025946", "0.44001803", "0.4398032", "0.43945855", "0.4383354", "0.43751958", "0.43704897", "0.43698528", "0.43662718", "0.43622923", "0.4360615", "0.4357606", "0.43570828", "0.43517196" ]
0.716084
0
Generate a random integer between min inclusive and max exclusive
function randomNumGenerator(min, max) { return Math.floor(Math.random() * (max - min) + min); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randInt(min, max) { return Math.random() * (max - min) + min; }", "function randInt(min, max) { return Math.random() * (max - min) + min; }", "function generateRandomInteger(min, max) {\n return Math.floor(min + Math.random()*(max + 1 - min))\n }", "function randomIntGen(min, max){\n return Math.floor(Math.random() * (max - min +1)) + min;\n }", "function generateRandomInt (min, max) {\n return Math.floor(Math.random() * (max - min)) + min\n }", "generateRandomInteger(min, max){\n return Math.floor(min + Math.random()*(max+1 - min));\n }", "function RandomInt(max, min)\n{\n return Math.floor(Math.random() * ( max + 1 - min) + min);\n}", "static randomInt(min, max) {\n const minVal = Math.ceil(min);\n const maxVal = Math.floor(max);\n return Math.floor(Math.random() * (maxVal - minVal)) + minVal; //Inclusive min Esclusive max\n }", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n } //max is excluded", "function randomNumberGenerator(min, max) {return Math.floor(Math.random() * (max - min + 1) ) + min;}", "function getRandomIntEx(min, max) {//max not inclusive\r\n return Math.floor(Math.random() * (max - min)) + min;\r\n}", "function randint(min, max) {\n return Math.floor(Math.random() * ((max+1) - min) + min);\n }", "function getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive\n }", "function randomInteger(min, max) { \n return Math.random() * (max - min) + min; \n}", "getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive\n }", "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n }", "getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n let number = Math.floor(Math.random() * (max - min + 1)) + min;\n return number;\n }", "function randomIntFromInterval(min,max)\n{return Math.floor(Math.random()*(max-min+1)+min);}", "function getRandomIntegerInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function randomInteger (min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "getRandomIntInclusive (min, max) {\n min = Math.ceil(this.min);\n max = Math.floor(this.max);\n return Math.floor(Math.random() * (max-min +1)) +min;\n }", "function getRandomInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min) + min);\r\n}", "function getRandomInteger(min, max) {\r\n return Math.floor(Math.random() * (max - min) + min);\r\n}", "static randomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "static randomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "static getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min) + min)\n }", "getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "function generateNumber(min, max) {\r\n return Math.floor(Math.random()* (max - min) + min);\r\n}", "function randomInteger(min, max) {\n return Math.floor(min + Math.random() * (max + 1 - min));\n}", "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive\n }", "function randomGenerator(max, min) {\n min = Math.ceil(min);\n max = Math.floor(max);\n var intNUm = Math.floor(Math.random() * (max - min + 1)) + min;\n return intNUm;\n}", "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive\n }", "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function randomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function randomInt(min,max){\n return Math.floor(Math.random()*(max-min+1)+min);\n }", "function getRandomIntInclusive (min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "function genRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "getRandomInt(min, max)\n {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function randomint(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n}", "getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "static randomInt(min, max){\n \n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n \n }", "function getRandomInteger(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "function randomInteger(min, max) {\n return Math.round(Math.random() * (max - min) + min);\n}", "function randomInt(min, max){\r\n\treturn Math.floor(Math.random() * (max - min) + min);\r\n} // END - random value.", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}", "function generateRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min\n}", "function getRandomInt(min, max) {\n return Math.random() * (max - min) + min;\n }", "function randInt(min, max){\n return(Math.floor(Math.random() * (+max - +min)) + +min); \n }", "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "function getRandomInt(min, max) {\n min = ceil(min);\n max = floor(max);\n return floor(random() * (max - min + 1)) + min;\n }", "function getRandomIntInclusive(min, max) { // impure\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function rndInt(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n}", "function getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n }", "getRandomInt (min:Number = 0, max:Number) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function getRandomInt(min, max) {\n\t\t\t\t\t\t\t\t\treturn Math.floor(Math.random()\n\t\t\t\t\t\t\t\t\t\t\t* (max - min + 1))\n\t\t\t\t\t\t\t\t\t\t\t+ min;\n\t\t\t\t\t\t\t\t}", "function getRandomIntInclusive(min, max) {\n\tmin = Math.ceil(min);\n\tmax = Math.floor(max);\n\tdeltaInclusive = (max - min + 1)\n\treturn Math.floor(Math.random() * deltaInclusive) + min;\n}", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRandomIntInclusive(min,max) {\n min = Math.ceil(min)\n max = Math.floor(max)\n return Math.floor(Math.random() * (max - min + 1)) + min\n }", "function getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive\n }", "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function intRandom(min, max)\n{\n return Math.floor(Math.random() * (max - Math.abs(min) + 1)) + min;\n\n}", "function _getRandomIntInclusive(min, max) {\n var min = Math.ceil(min),\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "randomInteger(min, max) {\n let rand = min + Math.random() * (max + 1 - min);\n return Math.floor(rand);\n }", "function getRandomInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive\n }", "getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function rndInt(min, max) {\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function getRandomInteger(min, max){\r\n return Math.floor(( Math.random() * (max - min + 1)) + min);\r\n}", "function getRandomIntInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function generateNumber(min, max){\n return Math.floor(Math.random() * (max - min) + min)\n}", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "function getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min) ) + min;\n }", "function randomNumberGenerate(min, max) {\n return Math.floor(Math.random() * max - min + 1) + 1;\n}", "function RandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive\n}", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n }", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min)) + min; \n }", "function random_int(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "function getRandomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }" ]
[ "0.8915418", "0.8915418", "0.8751571", "0.8751237", "0.87481505", "0.8747737", "0.8727775", "0.8721387", "0.872062", "0.870209", "0.8697077", "0.8678767", "0.8676859", "0.86742", "0.8672972", "0.8669338", "0.8662761", "0.86609805", "0.8645277", "0.8638868", "0.86385864", "0.8638517", "0.8636238", "0.8636238", "0.86339056", "0.86339056", "0.86308116", "0.8629519", "0.862692", "0.8619808", "0.86179984", "0.861772", "0.8614274", "0.86088336", "0.86074585", "0.86074585", "0.8606142", "0.86061054", "0.86061054", "0.86061054", "0.8606026", "0.8602146", "0.85999906", "0.8596667", "0.8590603", "0.8588361", "0.8588064", "0.85858923", "0.8583872", "0.8583872", "0.8583872", "0.8583872", "0.8583872", "0.8583872", "0.8583872", "0.8583824", "0.85829705", "0.8579034", "0.85784507", "0.8577039", "0.8575652", "0.85751146", "0.8573938", "0.85738593", "0.8573072", "0.85725397", "0.85721296", "0.857004", "0.8568156", "0.85664856", "0.8562806", "0.85620683", "0.85618067", "0.85613275", "0.85610837", "0.85610837", "0.85610837", "0.85610837", "0.8559922", "0.85589725", "0.8558969", "0.85580796", "0.85575897", "0.8557373", "0.8556927", "0.8555598", "0.8554601", "0.8553387", "0.8553169", "0.8552707", "0.85524476", "0.855196", "0.8550912", "0.8550905", "0.85502523", "0.85502523", "0.85502523", "0.8549946", "0.8546402", "0.8543494", "0.8541356" ]
0.0
-1
Given a string, return the character that is most commonly used in the string. Examples maxChar("abcccccccd") === "c" maxChar("apple 1231111") === "1"
function maxChar(str) { let max = 0; let winner = ''; const obj = [...str].reduce((acc, el) => { const element = acc[el] ? (acc[el] + 1) : 1 return Object.assign(acc, {[el]: element}) } , {}) for (let prop in obj) { if (obj[prop] > max) { max = obj[prop] winner = prop } } return winner; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maxChar(string){\n\tlet max = 1;\n\tconst chars = {};\n\tlet maxChar = '';\n\n\tfor(let char of string){\n\t\tif(!chars[char]){\n\t\t\tchars[char] = 1;\n\t\t} else {\n\t\t\tchars[char]++;\n\t\t\tif(chars[char] > max){\n\t\t\t\tmax = chars[char];\n\t\t\t\tmaxChar = char;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn maxChar;\n}", "function maxCharacter(str)\n{\n let mostCommonCharacter = '';\n let latestHighestCount = 0;\n let blacklistedCharacters = [' '];\n \n for(let i = 0; i < str.length; i++)\n {\n if(blacklistedCharacters.includes(str.charAt(i)))\n {\n continue;\n }\n \n let reg = new RegExp(str.charAt(i), 'gi');\n let matches = str.match(reg);\n if (matches.length > 0)\n {\n let matchStr = matches.toString().replace('/,/g', '');\n if(latestHighestCount < matchStr.length)\n {\n mostCommonCharacter = str.charAt(i);\n latestHighestCount = matchStr.length;\n }\n \n blacklistedCharacters.push(str.charAt(i));\n }\n }\n\n return mostCommonCharacter;\n}", "function maxCharacter(str) {\n\n // const charMap = {};\n // let maxNum = 0;\n // let maxChar = '';\n\n // str.split('').forEach(function (char) { \n\n // if(charMap[char]) {\n // charMap[char]++;\n // }else {\n // charMap[char] = 1;\n // }\n // });\n\n\n // for (let char in charMap ) {\n // if(charMap[char] > maxNum) {\n // maxNum = charMap[char];\n // maxChar = char;\n // }\n // }\n // return maxChar;\n\n\n}", "function maxCharacter(str) {\r\n const charMap = {};\r\n let maxNum = 0;\r\n let maxChar = '';\r\n \r\n str.split('').forEach(function(char) {\r\n if(charMap[char]) {\r\n charMap[char]++;\r\n } else {\r\n charMap[char] = 1;\r\n }\r\n });\r\n \r\n for(let char in charMap) {\r\n\r\n if(charMap[char] > maxNum) {\r\n maxNum = charMap[char];\r\n maxChar = char;\r\n }\r\n }\r\n \r\n return maxChar;\r\n}", "function maxChar(str) {\n let charMap = {}, mostUses = 0, mostUsed;\n\n for (let char of str.split('')) {\n charMap[char] ? charMap[char] += 1 : charMap[char] = 1;\n }\n\n for(let char in charMap) {\n if(charMap[char] > mostUses) {\n mostUses = charMap[char];\n mostUsed = char;\n }\n }\n \n return mostUsed;\n}", "function maxCharacter(str) {\n const charMap = {};\n let maxNum = 0;\n let maxChar = '';\n\n str.split('').forEach(char => {\n if(charMap[char]){\n charMap[char]++;\n }\n else{\n charMap[char] = 1;\n }\n });\n for(let char in charMap){\n if(charMap[char] > maxNum){\n maxNum = charMap[char];\n maxChar = char;\n }\n }\n\n return maxChar;\n}", "function maxCharacter(str) {\n let strArray = str.toLowerCase().split(''),\n record = {},\n greatest = 0,\n maxChar = ''\n strArray.forEach(letter => record[letter] = 0)\n strArray.forEach(letter => record[letter]++)\n for (e in record){\n if (record[e] > greatest){\n greatest = record[e]\n maxChar = e\n }\n }\n return maxChar\n}", "function maxChar(str) {\n const characterCount = {};\n let highestNumRep = 0;\n let mostUsedChar = '';\n\n for (let char of str) {\n characterCount[char] ? characterCount[char]++ : (characterCount[char] = 1);\n }\n // maxChar('hello')\n // characterCount = {\n // 'h': 1,\n // 'e': 1,\n // 'l': 2,\n // 'o': 1\n // }\n\n for (let key in characterCount) {\n if (characterCount[key] > highestNumRep) {\n highestNumRep = characterCount[key];\n mostUsedChar = key;\n }\n }\n return mostUsedChar;\n}", "function maxCharacter(str) {\n // const charMap = {};\n // let maxNum = 0;\n // let maxChar = '';\n // str.split('').forEach(function(char) {\n // if(charMap[char]){\n // charMap[char]++;\n // } else {\n // charMap[char]= 1;\n // }\n // });\n // for(let char in charMap) {\n // // debugger; // node inspect index.js then hit c enter to run.\n // if(charMap[char] > maxNum) {\n // maxNum = charMap[char];\n // maxChar = char;\n // }\n // }\n // return maxChar;\n}", "function maxChar(str) {\r\n\tvar i,j;\r\n\tvar character;\r\n\tvar counterArray = Array();\r\n\tvar max;\r\n\tvar maxAux;\r\n\tvar MaxChar;\r\n\tfor( i = 0 ; i < str.length ; i++)\r\n\t{\r\n\t\tcharacter = str[i];\r\n\t\tcounterArray[i] = 0; \r\n\r\n\t\tfor( j = 0; j < str.length ; j++){\r\n\t\t\tif(character == str[j])\r\n\t\t\t{\r\n\t\t\t\tcounterArray[i] = counterArray[i] + 1;\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\t\tmax = Math.max.apply(null, counterArray);\r\n\t\tif(maxAux !== max)\r\n\t\t{\r\n\t\t\tMaxChar = character;\r\n\t\t}\r\n\t\tmaxAux = max;\r\n\r\n\t}\r\n\treturn MaxChar;\r\n}", "function maxChar(str){\n\tconst charMap = {}\n\tlet max = 0\n\tlet retVal = ''\n\n\tfor(let ch of str){\n\t\tcharMap[ch] = charMap[ch] + 1 || 1\n\t}\n\n\tfor(let obj in charMap){\n\t\tif(charMap[obj] > max){\n\t\t\tmax = charMap[obj]\n\t\t\tretVal = obj\n\t\t}\n\t}\n\n\treturn retVal\n}", "function maxChar(str) {\n let freq = {};\n for (let i = 0; i < str.length; i++) {\n if (freq[str[i]] === undefined) {\n freq[str[i]]+=1;\n }else {\n freq[str[i]] = 1;\n }\n }\n let max=0;\n let result=str[0];\n for(let ch in freq){\n if (freq[ch] > max) {\n max = freq[ch];\n result = ch;\n }\n }\n return result;\n}", "function maxCharacter(str) {\n const charMap = {};\n let maxNum = 0;\n let maxChar = '';\n\n str.split('').forEach(i => charMap[i] ? charMap[i]++ : charMap[i] = 1);\n // for in to loop through an object\n for(let i in charMap){\n if(charMap[i] > maxNum){\n maxNum = charMap[i];\n maxChar = i;\n }\n }\n console.log(`Letter ${maxChar} is the most common character in ${str} with ${maxNum} repeats`);\n // return maxChar;\n}", "function maxChar(str) {\n let dict = new Map();\n let maxVal = '';\n let currentMax = 0;\n for (const char of str) {\n let val = 1;\n if (dict.has(char)) {\n val = dict.get(char);\n dict.set(char, ++val);\n } else {\n dict.set(char, val);\n }\n if (val > currentMax) {\n currentMax = dict.get(char);\n maxVal = char;\n }\n } \n return maxVal;\n}", "function maxChar(str) {\n let dic = str.split('').\n\treduce((m, c) => m.has(c) ? m.set(c, m.get(c) + 1): m.set(c, 1), new Map())\n\n var maxChar = ''\n dic.set(maxChar, -1)\n \n dic.forEach((v, k) => {\n\tif (v > parseInt(dic.get(maxChar))) {\n\t maxChar = k\n\t}\n })\n\n return maxChar\n}", "function maxCharacter(str) {\n const charMap = {};\n let maxNum = 0;\n let maxChar = '';\n \n str.split('').forEach(function(char){\n if(charMap[char]) {\n charMap[char]++;\n } else {\n charMap[char] = 1;\n }\n\n });\n\n for(let char in charMap) {\n // debugger\n if(charMap[char] > maxNum) {\n maxNum = charMap[char];\n maxChar = char;\n }\n }\n return maxChar;\n}", "function maxChar(str) {\n const charTracker = {};\n\n str.split(\"\").map(elem => {\n charTracker[elem] = charTracker[elem] + 1 || 1;\n });\n\n return Object.keys(charTracker).reduce((prevVal, elem) => {\n return charTracker[prevVal] < charTracker[elem] ? elem : prevVal;\n });\n}", "function maxChar(str) {\n\tlet count = {};\n \tfor (let i in str){\n \tif( count[str[i]] ){\n \t\tcount[str[i]] += 1;\n \t}else{\n \t\tcount[str[i]] = 1;\n \t}\n \t}\n\n \tlet counter = 0;\n \tlet returnChar = '';\n \tfor (let s in count){\n \t\tif(count[s]>counter){\n \t\t\tcounter = count[s];\n \t\t\treturnChar = s;\n \t\t}\n \t}\n\n \treturn returnChar;\n}", "function maxChar(str) {\n\n\t//// CM Solution\n\t// var arr = str.split('')\n\t// var obj = {};\n\t// arr.map((char) => {\n\t// \treturn obj[char] ? obj[char]++ : obj[char] = 1;\n\t// })\n\t// var maxValue = 0;\n\t// for(var prop in obj) {\n\t// \tif(maxValue < obj[prop]) {\n\t// \t\tmaxValue = obj[prop];\n\t// \t\tvar high = prop;\n\t// \t}\n\t// }\n\t// return high;\n\n\t// Incomplete - pre-Solution play-around\n\t// var chars = {};\n\t// for(let char of string) {\n\t// \t// if(!chars[char]) {\n\t// \t// \tchars[char] = 1;\n\t// \t// } else {\n\t// \t// \tchars[char]++\n\t// \t// }\n\t// \t// I like this! ** #cool #RememberThis\n\t// \tchars[char] = chars[char] + 1 || 1;\n\t// }\n\n\t// Solution #1\n\tconst charMap = {};\n\tlet max = 0;\n\tlet maxChar = '';\n\n\tfor(let char of str) {\n\t\tif(charMap[char]) {\n\t\t\tcharMap[char]++;\n\t\t} else {\n\t\t\tcharMap[char] = 1;\n\t\t}\n\t}\n\n\tfor(let char in charMap) {\n\t\tif(charMap[char] > max) {\n\t\t\tmax = charMap[char];\n\t\t\tmaxChar = char;\n\t\t}\n\t}\n\n\treturn maxChar;\n\n}", "function maxChar(str) {\n const map = new Map();\n for(c of str) {\n if(map.get(c) === undefined) {\n map.set(c,1);\n } else {\n map.set(c, map.get(c)+1);\n }\n }\n let maxVal = 0;\n let keyRet = '';\n for(var [key, value] of map) {\n if(value > maxVal) {\n maxVal = value;\n keyRet = key;\n }\n }\n\n return keyRet;\n}", "function maxChar(str) {\n\n var mp= {};\n var mx= 0;\n var maxChar= '';\n\n for(var ch of str){\n if(mp[ch]) mp[ch]++;\n else mp[ch]=1;\n\n\n }\n for(var ch in mp){\n if(mp[ch]> mx){\n mx= mp[ch];\n maxChar= ch;\n }\n }\nreturn maxChar;\n\n\n}", "function maxCharA(str) {\n let charMap = {};\n let maxNum = 0;\n let maxChar = '';\n \n str.toLowerCase().split('').forEach(function(char) {\n if(charMap[char]) {\n charMap[char]++;\n } else {\n charMap[char] = 1;\n }\n });\n \n for(let i in charMap) {\n // debugger;\n if(charMap[i] > maxNum) { \n maxNum = charMap[i];\n maxChar = i;\n }\n }\n\n return maxChar;\n}", "function maxChars(str) {\n const charsMap = {};\n let max = 0;\n let maxChar = \"\";\n for (let char of str) {\n charsMap[char] = charsMap[char] + 1 || 1;\n }\n for (let char in charsMap) {\n if (charsMap[char] > max) {\n max = charsMap[char];\n maxChar = char;\n }\n }\n return maxChar;\n}", "function maxChar(str) {\n let obj={}\n for (let l of str){\n obj[l] ? obj[l]++ : obj[l]=1\n }\n\n let max = 0\n let maxChar = ''\n\n for (o in obj){\n if(obj[o]>max){\n max = obj[o]\n maxChar = o\n }\n }\n\n return maxChar\n\n}", "function maxChar(str) {\n let chars = {};\n let maxC = {\n char: '',\n num: 0\n };\n // normalize all letters\n str = str.toLowerCase();\n\n // populate char object with counts\n for (let char in str) {\n console.log(char, str[char], chars[str[char]]);\n chars[str[char]] = chars[str[char]] + 1 || 1;\n }\n\n // determine highest count char\n for (let char in chars) {\n console.log(char, chars[char]);\n if (chars[char] > maxC.num) {\n maxC.char = char;\n maxC.num = chars[char];\n } \n \n }\n\n return maxC.char;\n}", "function maxCharacter(str) {\n const characterMap = {};\n let maxNum = 0;\n let maxChar = \"\";\n // NOTE TURn the string into an array and turn it into key value pairs\n // and the value being the numbers\n str.split(\"\").forEach(alphabet => {\n if (characterMap[alphabet]) {\n characterMap[alphabet]++;\n } else {\n characterMap[alphabet] = 1;\n }\n });\n\n for (let alphabet in characterMap) {\n if (characterMap[alphabet] > maxNum) {\n maxNum = characterMap[alphabet];\n maxChar = alphabet;\n }\n }\n let characters = maxChar.toUpperCase() + \" is repeated \" + maxNum + \" times\";\n return characters;\n}", "function maxChar(str) {\n let obj = {};\n q = str.split(\"\");\n let n = 2;\n let max = 0;\n let maxChar = \"\";\n\n q.forEach((char, i) => {\n if (!obj[char]) {\n obj[`${char}`] = 1;\n } else {\n obj[char]++;\n }\n });\n for (let key in obj) {\n if (obj[key] > max) {\n max = obj[key];\n maxChar = key;\n }\n }\n return maxChar;\n}", "function maxChar(str) {\n\n // if you want to ignore casing\n // str = str.toLowerCase() ; \n\n // my solution\n /* \n let set={};\n str.split('').map(char=>{\n let keyArr = Object.keys(set);\n if (keyArr.includes(char)){\n set[char]= set[char]+1\n }\n else{\n set[char]=1\n }\n })\n\n let maxChar;\n let value = 1;\n let keyArr= Object.keys(set);\n keyArr.map(key=>{\n if (set[key]>value) {\n value = set[key]\n maxChar= key\n }\n })\n if (maxChar) {\n console.log(maxChar);\n } else {\n console.log(\"there is no max Character.\");\n }\n */\n\n// standard solution\nlet charMap = {}\nfor (const char of str) {\n // charMap[char] = charMap[char]+1 || 1 ; or\n if (charMap[char]) {\n charMap[char]++;\n }else{\n charMap[char] = 1\n }\n} \n\nlet maxChar = \"\";\nlet maxValue = 0; // or 1\nfor (const key in charMap) {\n if (charMap[key]>maxValue) {\n maxValue = charMap[key]\n maxChar = key\n }\n}\nreturn maxChar;\n\n}", "function maxChar(str) {\n\n let lastBiggerNumber = 0;\n let biggerChar = '';\n let array = {};\n for (let char of str) {\n if(array[char]) {\n array[char]++; \n if (array[char] > lastBiggerNumber) {\n lastBiggerNumber = array[char];\n biggerChar = char;\n }\n }\n array[char] = 1;\n }\n\n return biggerChar;\n\n}", "function maxChar(str) {\n let max = 0;\n let counter = {};\n let solution;\n \n for (let i = 0; i < str.length; i++) {\n let char = str[i];\n if (counter[char]) {\n counter[char] += 1;\n } else {\n counter[char] = 1;\n }\n }\n for (let key in counter) {\n if (counter[key] > max) {\n max = counter[key];\n solution = key;\n }\n }\n\n return solution;\n}", "function maxChar(str) {\n var dict = {};\n var max = 0;\n var maxLetter = '';\n\n for(let letter of str){\n if(!dict[letter]){\n dict[letter] = 1;\n }else{\n dict[letter]++;\n }\n }\n // iterate through object -> in\n for(let char in dict){\n if(dict[char] > max){\n max = dict[char]\n maxLetter = char;\n }\n }\n return maxLetter;\n}", "function maxChar(str) {\n\n var strObj = {};\n var splitStr = str.split('');\n splitStr.forEach(function(el) {\n if (strObj[el]){\n strObj[el]++;\n } else {\n strObj[el] = 1;\n }\n });\n\n // for (let char of str) {\n // strObj[char] = strObj[char] + 1 || 1;\n // }\n\n var maxKey = '';\n var currentMax = 0;\n for (var key in strObj) {\n if ((strObj[key]) > currentMax) {\n currentMax = strObj[key];\n maxKey = key;\n };\n };\n console.log('');\n console.log('final max: ' + currentMax);\n console.log('maxed character: ' + maxKey);\n console.log('');\n return maxKey;\n}", "function charMapper(s) {\n let arr = s.split(\"\");\n let charmap = {};\n arr.forEach (function(c) {\n if (charmap[c]) {\n charmap[c]++;\n } else {\n charmap[c] = 1;\n }\n });\n\n let maxchar = '';\n let max = 0;\n for (let [key, value] of Object.entries(charmap)) {\n if (value > max) {\n maxchar = key;\n max = value;\n }\n }\n\n return maxchar;\n}", "function maxChar(str) {\n const holdingObject = {};\n let max = 0;\n let maxKey = undefined;\n\n for (let char of str) {\n if (holdingObject[char] === undefined) {\n holdingObject[char] = 1;\n } else {\n holdingObject[char]++;\n }\n }\n\n for (let key in holdingObject) {\n if (holdingObject[key] > max) {\n max = holdingObject[key];\n maxKey = key;\n }\n }\n\n return maxKey;\n}", "function maxChar(str) {\n const charMap = {};\n let max = 0;\n let maxChar = \"\";\n\n for (let char of str) {\n if (charMap[char]) {\n charMap[char]++;\n } else {\n charMap[char] = 1;\n }\n }\n console.log(charMap);\n\n for (let char in charMap) {\n if (charMap[char] > max) {\n max = charMap[char];\n maxChar = char;\n }\n }\n return maxChar;\n}", "function maxChar(str) {\n let hash = {}\n str.split('').map(el => hash[el] = hash[el] + 1 || 1 )\n return Object.keys(hash)[0]\n\n}", "function maxRep(str) {\n let charObj = {};\n let max = 0;\n let maxChar = '';\n for (let item of str) {\n charObj[item] = charObj[item] + 1 || 1;\n }\n\n for (let item in charObj) {\n if (charObj[item] > max) {\n max = charObj[item]\n maxChar = item\n }\n }\n return maxChar\n}", "function maxCharacter(str) {\r\n let results = [,];\r\n for(i = 0; i < str.length(); i++) {\r\n let repeats = 0;\r\n str.forEach(char => {\r\n if(char == str[i]) {\r\n repeats++;\r\n }\r\n results.pop(repeats,str[i]);\r\n });\r\n }\r\n return \"Not implemented\"\r\n}", "function mostLetter(str) {\n let charMap = new Map();\n\n //iterate through string, add new letters to map, and increase value of\n //repeating letters\n for (let char of str) {\n //gets value of map key (if it exists)\n let count = charMap.get(char);\n //adds to key's value, if key didn't exist, initializes value to 1\n charMap.set(char, count ? ++count : 1);\n }\n\n //compare all entries, keep and return entry with largest value\n return [...charMap.entries()].reduce((char1, char2) => {\n return char1[1] > char2[1] ? char1 : char2;\n });\n}", "function maxCharacter(str) {\n let dict = {};\n let maxCntChar = 0;\n let entries = [];\n\n str.split('').forEach((char) => {\n if(dict[char]) {\n dict[char]++;\n } else {\n dict[char] = 1;\n }\n });\n maxCntChar = Math.max(...Object.values(dict));\n entries = Object.keys(dict).filter((value) => dict[value] == maxCntChar);\n entries = entries.length == 1 ? entries[0] : entries;\n return entries;\n}", "function maxChar(str) {\n let string = \"The max Character\" //Getting the max character\n let chars = {}; // Initializing an empty chars array\n\n for(let char of string) { // Looping through the string\n if(!chars[char]) { // Checking if the position in the string is not present in the array\n char = 1; // if it is true it will initialize char to 1\n } else {\n char++; // if it is present it will increment the value of char\n }\n }\n\n return chars; // Returning the array of characters\n}", "maximumOccurringCharacter(string) {\n \n let maxChar = \"\";\n let max = 0;\n\n let hashMap = {};\n\n for(let i = 0; i < string.length; i++) {\n if (hashMap[string[i]] !== undefined) {\n hashMap[string[i]]++;\n } else {\n hashMap[string[i]] = 1;\n }\n }\n\n // Object.entries(hashMap).forEach(([key,value]) => console.log(`${key}: ${value}`));\n\n // Find the key that occurs the most times in the string\n // If keys occur the same number of times, find the first key\n\n Object.entries(hashMap).forEach(([key,value]) => {\n if (value > max) {\n max = value;\n maxChar = key;\n }\n });\n console.log(maxChar);\n return maxChar;\n }", "function mostCommonLetter(string){\n var max_val = 0;\n var max = [];\n const hash = makeObject(string.split(\"\"));\n for (var property in hash){\n var value = hash[property];\n if (value > max_val && property.match(/[a-z]/)){\n max_val = value;\n max = [property,value];\n }\n }\n \n \n return max;\n}", "function maxChar(str) {\n obj = {};\n maxValue = 0;\n objKey = '';\n //Para iterar sobre string o arrays, usamos un \"For-of loop\"\n for (let char of str) {\n if (!obj[char]) {\n obj[char] = 1\n } else {\n obj[char]++\n }\n }\n //Para iterar sobre un objeto, usamos un \"For-in loop\"\n for (let key in obj) {\n if (obj[key] > maxValue) {\n maxValue = obj[key];\n objKey = key\n }\n }\n\n return objKey\n}", "function high(s){\n let as = s.split(' ').map(s=>[...s].reduce((a,b)=>a+b.charCodeAt(0)-96,0));\n return s.split(' ')[as.indexOf(Math.max(...as))];\n }", "function freqStr(str) {\n var chars = {};\n chars[str.charAt(0)] = 1;\n // first = str.charAt(0);\n // chars[first] = 1;\n var maxChar = str.charAt(0);\n var maxCount = 1;\n for (var i = 1; i < str.length; i++) {\n if (chars[str.charAt(i)]) {\n chars[str.charAt(i)]++;\n\n } else {\n chars[str.charAt(i)] = 1;\n }\n if (chars[str.charAt(i)] > maxCount) {\n maxCount = chars[str.charAt(i)];\n maxChar = str.charAt(i);\n\n }\n }\n return maxChar;\n}", "function maxCharacter(str) {\r\n final = new Array\r\n for(i = 0; i< str.length; i++)\r\n {\r\n contained = false\r\n for(j=0; j<final.length && !contained; j++)\r\n {\r\n if(final[j][0] === str[i])\r\n {\r\n final[j][1]++;\r\n contained=true;\r\n } \r\n \r\n }\r\n if(!contained)\r\n {\r\n a = [str[i], 1]\r\n final.push(a)\r\n } \r\n }\r\n\r\n let highest=['z',0];\r\n console.log(final)\r\n for(i=0; i<final.length; i++)\r\n {\r\n if(final[i][1] > highest[1])\r\n {\r\n highest[0] = final[i][0]\r\n highest[1] = final[i][1]\r\n }\r\n }\r\n return highest;\r\n}", "function mostFrequent (myString) {\n if ( 't' > 'e' || 's') {\n return ( '(t) is the most frequent character');\n }\n}", "function high(x){\n let alpha = 'abcdefghijklmnopqrstuvwxyz'\n let highest = ''\n \n x.split(' ').forEach((word)=>{\n let total = 0\n let highestTotal = 0\n for(let i=0; i<word.length; i++){\n total += alpha.indexOf(word[i]) + 1\n }\n for(let i=0; i<highest.length; i++){\n highestTotal += alpha.indexOf(highest[i]) + 1\n }\n if(total > highestTotal){\n highest = word\n }\n })\n \n return highest\n }", "function longestString(longStr){\n var mostAmntOfCharacters = longStr.reduce((x,y) => x.length >= y.length ? x : y);\n return mostAmntOfCharacters\n}", "function highestFreq (str) {\n\t// Create an object displaying the character count for each character.\n \tlet count = str.split('').reduce((a,b) => {\n \ta[b] ? a[b] ++ : a[b] = 1;\n \treturn a;\n \t},{});\n \t// Reduce the keys of our count object\n \treturn Object.keys(count).reduce((a,b,c) => {\n \t\t// If the array provided to reduce is empty. Push in the first element.\n \t\t// We need to start comparing elements.\n \tif(!a.length) {\n \t\ta.push(b); \n \t// If the first element in the array is appears less times than the current character.\n \t// Empty out the checker array and push in the new element.\n \t} else if(count[a[0]] < count[b]) {\n \t\twhile(a.length){\n \t\t\ta.pop();\n \t\t}\n \t\t a.push(b);\n \t// If the current element appears the same amount of times as the first element in the array.\n \t// Push it in the array as well.\n \t} else if(count[a[0]] === count[b]) {\n \t\ta.push(b);\n \t}\n \t// Return the array after each iteration. \n \treturn a;\n \t// Finally sort the array and join it into a string.\n \t}, []).sort().join('');\n}", "function findLongestWord(str) {\n return str.split(' ').reduce( (max, item) => max < item.length ? item.length : max, 0);\n}", "function most_common_letter(string) {\n var array = string.split(\"\").sort();\n var returnedArray = [array[i],0];\n var i =0;\n while(i<array.length){\n var difference = array.lastIndexOf(array[i]) - i +1;\n if(difference> returnedArray[1]){\n returnedArray[0] = array[i]\n returnedArray[1] = difference;\n }\n i=i+difference; \n }\n return returnedArray;\n}", "function findLongest(str)\n{\n return str.split(' ')\n .reduce(function (total, val) {\n return Math.max(total, val.length);\n }, 0);\n}", "function megaFriend(arr) {\n\n var maxChar = arr[0];\n\n if (arr.length == 0) { //Empty array validation\n return \"Empty array\";\n }\n\n if (maxChar == \"\" || typeof maxChar == \"number\") { //invalid input validation\n return \"invalid input\";\n }\n\n for (var i = 0; i < arr.length; i++) {\n\n if (arr[i].length > maxChar.length) {\n maxChar = arr[i];\n }\n\n }\n\n return maxChar;\n}", "function findLongestWord(str) {\n return str.split(' ').reduce((accumulator, currentValue) => {\n return Math.max(accumulator, currentValue.length);\n }, 0); // Initialize accumulator to 0\n}", "function LongestWord(str){\n var arr = StringToWordArr(str);\n var max = arr[0];\n for (var i = 0; i < arr.length; i++){\n if (arr[i].length > max){\n max = arr[i];\n }\n }\n return max; \n }", "function findLongestWord(str) {\n var strArray = str.split(' ');\n var biggestWord = '';\n for (var i = 0; i < strArray.length; i++) {\n if (strArray[i].length > biggestWord.length) {\n biggestWord = strArray[i];\n }\n }\n return biggestWord.length;\n}", "function high(x){\n let highestScore = 0;\n let highestWord = '';\n const words = x.split(' ');\n for (let i = words.length - 1; i >= 0; i--) {\n const word = words[i];\n let wordScoreCounter = 0;\n word.split('').forEach(letter => {\n // a: 97 - 96 = 1\n wordScoreCounter = wordScoreCounter + (letter.charCodeAt(0) - 96);\n });\n console.log(word, wordScoreCounter);\n \n if(wordScoreCounter >= highestScore) {\n highestScore = wordScoreCounter;\n highestWord = word;\n }\n }\n return highestWord;\n}", "function most_common_letter(string) {\n\n\tvar list = {};\n\tvar array = string.split(\"\");\n\n\tarray.forEach(function(letter){\n\t\tif(list[letter]!==undefined){\n\t\t\tlist[letter]+=1;\n\t\t}else{\n\t\tlist[letter] = 1;\n\t\t}\n\t})\n\tconsole.log(list);\n\n\tvar higher = 0;\n\tvar higher_letter\n\n\tfor (var letter in list){\n\t\tif(list[letter]>higher){\n\t\t\thigher = list[letter];\n\t\t\thigher_letter = letter;\n\t\t}\n\t}\n\n\tconsole.log([String(higher_letter), higher]);\n\treturn [String(higher_letter), higher];\n}", "function getWordsNums(str) {\n const lettersCount = {}\n str.split('').forEach(letter => {\n if (lettersCount[letter]) {\n lettersCount[letter] += 1\n } else {\n lettersCount[letter] = 1\n }\n })\n const maxNum = Math.max.apply(null, Object.values(lettersCount))\n let mostCommonLetters = [];\n for (let letter in lettersCount) {\n if (lettersCount[letter] === maxNum) {\n mostCommonLetters.push(letter)\n }\n }\n return mostCommonLetters\n}", "function findLongestWord(str) {\n return str.split(/\\W+/).reduce(function(item1, item2) {\n return item1.length < item2.length ? item2 : item1;\n }, \"\").length;\n}", "function mostFreqWord(str) {\n var words = str.split(' ');\n var counter = {};\n var mostFreqWord = '';\n var count = 0;\n var maxCount = 0;\n\n words.forEach(function (word) {\n\t if (!counter[word])\n\t\tcounter[word] = 0;\n\t count = ++counter[word];\n\t if (count>maxCount) {\n\t\tmaxCount = count;\n\t\tmostFreqWord = word;\n\t }\n\t});\n return mostFreqWord;\n}", "function charFreq(string) {\n //...\n}", "function charFreq(string) {\n //...\n}", "function maxWord2(s) {\n l=s.split(\" \");\n return maxWord(l);\n }", "function frequency(str){\n var result = str[0]; // first letter of str\n var storage = 0; // store biggest found number\n for (i=0 ; i < str.length ; i++){\n var berapa = countLetter(str[i],str);\n if(berapa > storage){\n result = str[i];\n storage = berapa;\n }\n }\n return result;\n }", "function findLongestWord(string){\n return string.reduce((longStr, string)=> {\n return longStr > string.length ? longStr :string.length\n });\n}", "function charFreq(string){\n //...\n}", "function charFreq(string){\n //...\n}", "function high(x) {\n let arrOfSum = [];\n let arrOfWords = x.split(' ');\n for (let i = 0; i < arrOfWords.length; i++) {\n arrOfSum.push(arrOfWords[i].split('')\n .map(item => item.charCodeAt() - 96)\n .reduce((current, sum) => sum + current, 0));\n }\n let position = arrOfSum.indexOf(Math.max(...arrOfSum));\n return arrOfWords[position];\n}", "function findLongestWord(str) {\r\n var s = Math.max.apply(null, str.split(\" \").map(function(str){return str.length;}).sort());\r\n return str.split(\" \").filter(function(word){\r\n return word.length == s;\r\n }) \r\n}", "function findLongestWord(str) {\n return str.split(\" \").reduce(function(longest, currentWord) {\n return currentWord.length > longest.length ? currentWord : longest;\n }, \"\").length;\n}", "function findLongestWord(string) {\n return string.length;\n}", "function findLongestWord(str) {\n return str.split(\" \").sort(function(a, b) { return a.length > b.length;}).pop().length;\n}", "function findLongestWord(str) {\n let arr = str.split(\" \");\n let max = 0;\n for(var i = 0; i < arr.length; i++){\n if(max < arr[i].length){\n max = arr[i].length\n }\n }\n\n return max; \n}", "function findLongestWord(str) {\n var longestWord = str.split(' ').reduce(function(longest, currentWord) {\n return currentWord.length > longest.length ? currentWord : longest;\n }, \"\");\n return longestWord;\n}", "function getLastCharacter(str) {\n let lastCharacter = str[str.length - 1];\n\n return lastCharacter;\n}", "function findLongestWord(str) {\n str = str.split(' ');\n let res = '';\n for (i = 0; i < str.length; i++) {\n if (res < str[i].length) {\n res = str[i].length;\n }\n }\n return res;\n}", "function findLongestWord(str) {\n var myArr = str.split(\" \");\n /* 1st variant - loop and array\n var res = myArr[0].length;\n for(var i = 1; i < myArr.length; i++) {\n if(myArr[i].length > res) {\n res = myArr[i].length;\n }\n }\n */\n var res = myArr.reduce(function(max,current) {\n return current.length > max ? current.length : max;\n }, myArr[0].length);\n return res;\n}", "function longestWord (str) {\n\tvar arr = str.split(' ')\n\tvar a = '';\n\tfor (i=0 ; i<arr.length ; i++) {\n\t\tif (arr[i].length > a.length) {\n\t\t\ta = arr[i] ;\n\t\t}\n\t}\n\treturn a ;\n}", "function longestSubstringWithoutRepeatingCharacters(str) {\n\n let max = '';\n\n for (let i = 0; i < str.length; i++) {\n\n let j = i;\n let current = '';\n\n while (current.indexOf(str[j]) == -1 || str[j] == ' ') {\n\n if (j == str.length) break;\n current += str[j];\n j++;\n\n }\n\n if (current.length >= max.length) {\n max = current;\n }\n\n\n }\n\n return max;\n}", "function findLongestWord(str) {\n\tvar words = str.split(' ');\n\tvar words_length = [];\n\tfor(var i = 0; i < words.length; i++){\n\t\twords_length[i] = words[i].length;\n\t}\n\treturn Math.max(...words_length);\n}", "function getLongestWord(str){\n var arr = str.split(' ');\n var longestWord = arr[0];\n for( var i = 1 ; i < arr.length ; i++ ) {\n if (arr[i].length > longestWord.length) longestWord = arr[i];\n }\n return longestWord;\n}", "function find_longest_word(str)\n{\n var array1 = str.match(/\\w[a-z]{0,}/gi);\n var result = array1[0];\n\n for(var x = 1 ; x < array1.length ; x++)\n {\n if(result.length < array1[x].length)\n {\n result = array1[x];\n } \n }\n return result;\n}", "function find_longest_word(str)\n{\n var array1 = str.match(/\\w[a-z]{0,}/gi);\n var result = array1[0];\n\n for(var x = 1 ; x < array1.length ; x++)\n {\n if(result.length < array1[x].length)\n {\n result = array1[x];\n } \n }\n return result;\n}", "function findLongestSubstring(str){\n let letters = {}\n let max = 0\n let left = 0\n let right = 0\n\n while(right < str.length){\n let x = str[right]\n // console.log('l',left, 'r',right, 'm',max)\n if (letters[x]){\n left = Math.max(left, letters[x])\n }\n max = Math.max(max, right-left+1)\n letters[x] = right + 1\n right++\n }\n return max\n}", "function findLongestWordsLength(str) {\n let words = str.split(/[ \\s,-]/);\n let max = '';\n\n for (let i = 0; i < words.length; i++) {\n\n words[i] = words[i].replace(/[^a-zA-Z ]/g, \"\")\n if (words[i].length > max.length) {\n max = words[i];\n }\n }\n\n return max;\n}", "function lengthOfLongestSubstring(s) {\n let temp = '';\n let count = 0;\n let max = 0;\n for (let i = 0; i < s.length; i++) {\n\n let cha = s[i];\n if (temp.indexOf(cha) == -1) { temp += cha; count++; if (count > max) { max = count; } }\n else {\n let chaIndex = temp.indexOf(cha);\n temp = temp.slice(chaIndex + 1, temp.length) + cha;\n\n count = temp.length;\n }\n }\n return max;\n}", "function findLongestWord(str) { \r\n var word = str.split(\" \");\r\n var s = Math.max.apply(null, word.map(function(str){return str.length;}));\r\n return word.filter(function(val){\r\n return val.length == s;\r\n }) \r\n}", "function strLongest(str) {\n var str = str.split(' ')\n var longestWord = 0\n for(var i =0; i < str.length; i++) {\n if(str[i].length > longestWord) {\n longestWord = str[i].length\n }\n }\n return longestWord \n}", "function maxConsecutiveCharactersList(combinedWords) {\n let maxChar = \"\";\n let maxCount = 0;\n let maxResults = [];\n\n // Check consecutive characters and update maxCount and maxChar\n for (let word of combinedWords) {\n let currentChar = word[0];\n let charCount = 1;\n\n maxChar = currentChar;\n maxCount = charCount;\n\n for (let i = 0; i < word.length; i++) {\n if (word[i + 1] !== currentChar) {\n if (maxCount <= charCount) {\n maxCount = charCount;\n maxChar = currentChar;\n maxResults.push({ letter: maxChar, length: maxCount });\n }\n\n currentChar = word[i + 1];\n charCount = 1;\n } else if (word[i + 1] === currentChar) {\n charCount++;\n\n if (maxCount < charCount) {\n maxCount = charCount;\n maxChar = currentChar;\n maxResults.push({ letter: maxChar, length: maxCount });\n }\n }\n }\n // console.log(word, charCount, maxChar, maxCount, maxResults); // check\n }\n\n // Find result with most consecutive characters\n let mxLengthValues = maxResults[0].length;\n let result;\n\n for (let i = 0; i < maxResults.length; i++) {\n if (maxResults[i].length > mxLengthValues) {\n mxLengthValues = maxResults[i].length;\n result = maxResults[i];\n }\n }\n\n return result;\n}", "function getLongest () {\n var longest = '';\n for (var i = 0; i < strings.length; i++) {\n if (strings[i].length > longest.length) {\n longest = strings[i];\n }\n }return longest;\n}", "function findLongestWord(str) {\r\n var splitWords = str.split(\" \");\r\n var counter = 0;\r\n var longest;\r\n\r\n for (var i = 0; i < splitWords.length; i++) {\r\n if (splitWords[i].length > counter) {\r\n counter = splitWords[i].length;\r\n longest = splitWords[i];\r\n }\r\n }\r\n return capitalize(longest) + \" is the longest word at \"+ counter +\" letters.\";\r\n}", "function longestLength(string){\n return string.split(' ').reduce(function(acc, word){\n return Math.max(acc, word.length)\n }, 0);\n}", "function findLongestWordLength(str) {\n let long=str.split(\" \");\n let palabra=[];\n long.forEach(element =>palabra.push(element.length));\n let max = Math.max(...palabra);\n return max;\n }", "function longestword(str)\r\n{\r\n var arr = str.match(/\\w[a-z]{0,}/gi)\r\n document.write(\"Example String: \"+arr+\"<br>\")\r\n var result = arr[0]\r\n for (var i = 1; i < arr.length; i++)\r\n {\r\n if (result.length < arr[i].length)\r\n {\r\n result = arr[i]\r\n }\r\n } \r\n\r\n return result\r\n\r\n}", "function findLongestWord(str) {\n let words = str.split(' ');\n let longestWord = '';\n for (let word of words) {\n if (word.length > longestWord.length) {\n longestWord = word;\n }\n }\n return longestWord;\n}", "function high(x){\n var biggest = {\n points: 0,\n word: \"\",\n };\n x.split(\" \").forEach(currentWord => {\n var totalPoints = 0;\n currentWord.split(\"\").forEach((letter) => {\n var points = letter.charCodeAt(0) - 96;\n totalPoints += points;\n });\n if (totalPoints > biggest.points) {\n biggest.points = totalPoints;\n biggest.word = currentWord;\n }\n });\n return biggest.word;\n}", "function findLongestSubstring (str) {\n\tlet start = 0;\n\tlet end = 0;\n\tlet maxLen = -Infinity;\n\tlet charCounter = {};\n\n\tif (str.length === 0) return 0;\n\n\twhile (end < str.length) {\n\t\tif (!charCounter[str[end]]) {\n\t\t\tcharCounter[str[end]] = (charCounter[str[end]] || 0) + 1;\n\t\t\tend++;\n\t\t\tmaxLen = Math.max(maxLen, end - start);\n\t\t} else if (charCounter[str[end]] >= 1) {\n\t\t\tdelete charCounter[str[start]];\n\t\t\tstart++;\n\t\t}\n\n\t\tif (end >= str.length) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn maxLen;\n}" ]
[ "0.8330308", "0.8295609", "0.8291538", "0.82900286", "0.8285804", "0.82841825", "0.82707596", "0.8268139", "0.82586545", "0.822154", "0.8205577", "0.8173499", "0.8163964", "0.8142509", "0.8108902", "0.8102258", "0.8016007", "0.80000407", "0.7979679", "0.79759455", "0.7967235", "0.79629767", "0.78986037", "0.78707635", "0.7842449", "0.7822287", "0.78111523", "0.77925676", "0.77531147", "0.7696819", "0.7695147", "0.7688842", "0.76757705", "0.7657392", "0.76243716", "0.7583701", "0.7480659", "0.7416189", "0.73875505", "0.7354436", "0.72726905", "0.7140446", "0.7111204", "0.7035628", "0.70134056", "0.69541854", "0.6803673", "0.6800352", "0.66503334", "0.66385394", "0.64184606", "0.6398054", "0.6380069", "0.6365653", "0.6327056", "0.62978774", "0.62752926", "0.62586063", "0.6226681", "0.62204343", "0.6217976", "0.6214621", "0.62032294", "0.62001634", "0.62001634", "0.61893463", "0.6162174", "0.615136", "0.6150521", "0.6150521", "0.6146496", "0.61390376", "0.6137113", "0.6124723", "0.61170495", "0.6108476", "0.6107715", "0.61014247", "0.60591245", "0.6050062", "0.6030291", "0.6020107", "0.5999628", "0.5991049", "0.59811574", "0.59811574", "0.598059", "0.59749067", "0.5967433", "0.5962628", "0.592424", "0.5921079", "0.5919827", "0.59118396", "0.5910205", "0.5908371", "0.5906192", "0.5906076", "0.59011626", "0.5893557" ]
0.74749255
37
FIn Espesores.js Funcion calcular presion aplicada por el plato de carga
function PresionPlato(){ var carga = document.getElementById("carga").value; var radio = document.getElementById("radioPlato").value; var total = (carga/(Math.PI *Math.pow(radio,2))); var total2 = total.toFixed(3); document.getElementById("presionPlato").value = total2; //Reporte document.getElementById('recibeformulaPres').innerHTML = "p = "+carga+" lb / (3.14 * "+radio+" in ^ 2)"; document.getElementById('recibeformulaPres1').innerHTML = "p = "+total.toFixed(3)+" psi"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculocompraslocales(cant,costo)\n{\n var ret; \n var pu//preciounitario\n pu=costo/cant;// calculamos el costo unitario \n //if($(\"#nfact_imp\").val()!=\"SF\") //si tiene el texto SF es sin factura \n // ret=pu*glob_factorIVA; //confactura\n //else \n // ret=pu*glob_factorRET+pu; //sinfactura \n // return ret;\n\n}", "function getBaseCalculo() {\n var pfaEng = config_isEng && isEng ? Number($('#pct-pfa-eng').html()) : 0;\n var pfaDes = config_isDes && isDes ? Number($('#pct-pfa-des').html()) : 0;\n var pfaImp = config_isImp && isImp ? Number($('#pct-pfa-imp').html()) : 0;\n var pfaTes = config_isTes && isTes ? Number($('#pct-pfa-tes').html()) : 0;\n var pfaHom = config_isHom && isHom ? Number($('#pct-pfa-hom').html()) : 0;\n var pfaImpl = config_isImpl && isImpl ? Number($('#pct-pfa-impl').html()) : 0;\n var V = Number((pfaEng + pfaDes + pfaImp + pfaTes + pfaHom + pfaImpl) * config_aumentoEsforco).toFixed(4);\n return V;\n}", "function datosCostoPA(producto_id) {\n tipo_movimiento = document.getElementById('tipo_movimiento').value;\n costo_abc = document.getElementById('costo_abc').value;\n if (tipo_movimiento != '0' && costo_abc != '0') {\n costo = '0';\n //contado\n if (tipo_movimiento == 'CONTADO') {\n if (costo_abc == 'A') {\n costo = precio_a[producto_id];\n }\n if (costo_abc == 'B') {\n costo = precio_b[producto_id];\n }\n if (costo_abc == 'C') {\n costo = precio_c[producto_id];\n }\n }\n\n //FACTURA\n if (tipo_movimiento == 'FACTURA') {\n if (costo_abc == 'A') {\n costo = precio_a_factura[producto_id];\n }\n if (costo_abc == 'B') {\n costo = precio_b_factura[producto_id];\n }\n if (costo_abc == 'C') {\n costo = precio_c_factura[producto_id];\n }\n }\n\n //CONSIGNACION\n if (tipo_movimiento == 'CONSIGNACION') {\n if (costo_abc == 'A') {\n costo = precio_a_consignacion[producto_id];\n }\n if (costo_abc == 'B') {\n costo = precio_b_consignacion[producto_id];\n }\n if (costo_abc == 'C') {\n costo = precio_c_consignacion[producto_id];\n }\n }\n\n //planpago\n if (tipo_movimiento == 'PLANPAGO') {\n if (costo_abc == 'A') {\n costo = precio_a_pp[producto_id];\n }\n if (costo_abc == 'B') {\n costo = precio_b_pp[producto_id];\n }\n if (costo_abc == 'C') {\n costo = precio_c_pp[producto_id];\n }\n }\n\n //stock ids\n stock_ids = document.getElementById('stock_ids_' + producto_id).value;\n if (Trim(stock_ids) != '') {\n division = stock_ids.split(',');\n for (i = 0; i < division.length; i++) {\n costo_obj = document.getElementById('costo_' + division[i]);\n costo_obj.value = costo;\n }\n }\n\n }\n}", "function calcular() {\n qtdCadeiras = Number(nCadeiras.value);\n var resp = 0;\n\n if ((qtdCadeiras.value) <= 0) {\n alert(\"A quantidade deve ser maior que 0!\");\n nCadeiras.value = '';\n }\n else {\n // ATRIBUINDO O VALOR DE ACORDO COM O MATERIAL E TIPO DA CADEIRA\n if (materialCadeira == 'aluminio' && tipoCadeira == 'praia'){\n resp = 75 * qtdCadeiras;\n }\n else if (materialCadeira == 'plastico' && tipoCadeira == 'praia') {\n resp = 50 * qtdCadeiras;\n }\n else if (materialCadeira == 'ferro' && tipoCadeira == 'praia') {\n resp = 80 * qtdCadeiras;\n }\n else if (materialCadeira == 'aluminio' && tipoCadeira == 'jardim') {\n resp = 70 * qtdCadeiras;\n }\n else if (materialCadeira == 'plastico' && tipoCadeira == 'jardim') {\n resp = 35 * qtdCadeiras;\n }\n else {\n resp = 55 * qtdCadeiras;\n }\n\n // DESCONTO DE 3%\n if (qtdCadeiras > 50) {\n resp -= (resp * 0.03);\n }\n\n // DESCONTO UNITARIO PGTO. À VISTA\n desconto = 0;\n console.log(resp);\n materialCadeira == 'aluminio' ? desconto = resp * 0.035 : desconto = resp * 0.05;\n respDesconto = resp - desconto;\n materialCadeira == 'aluminio' ? desco = 3.5 : desco = 5;\n \n\n respCalculo.innerHTML = `<p>O orçamento para a compra de <b>${qtdCadeiras}</b> <i>cadeira(s) de ${tipoCadeira}</i> de <i>${materialCadeira}</i> é R$ <b>${resp.toFixed(2)}</b></p>\n <p>Para pagamento a vista o desconto é de <b>${desco}%</b> e seu pedido ficará por R$ <b>${respDesconto.toFixed(2)}</b></p>`; \n }\n}", "calcularPorcentaje() {\n this._programaService.getPrograma().subscribe((resp) => {\n let infoEstudiante = JSON.parse(localStorage.getItem('estudiante'));\n let credAprob = infoEstudiante.creditos_aprobados;\n let programa = resp.programa;\n let creditosTotales = programa.creditos_totales;\n let porcent = (credAprob * 100) / creditosTotales;\n this.porcentaje = porcent.toFixed(1);\n return this.porcentaje;\n });\n }", "function calcPorcentajeMoras(){\r\n\r\n\tif (pm_called == 0){\r\n\t\tgetFiscalMoraInfo();\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tvar norectificativa = 1;\r\n\tif (document.getElementById('declarationType').value=='| 2 | RECTIFICATIVA'){\r\n\t\tnorectificativa = 0;\r\n\t}\r\n\tif(CONTRAVENSION_CMOV && CONTRAVENSION_CMOV != null){//Si es rectificativa no hay contravenci�n\r\n\t\tdocument.getElementById('c39').value = CONTRAVENSION_CMOV * norectificativa;\t\t\r\n\t\tif(document.getElementById('c39').value != null)\r\n \t\t colocarpuntos(document.getElementById('c39'));//NUevo\r\n\t}\r\n\trefreshVars();\r\n\tTRGc40();\r\n\tTRGc40_0();\r\n\tTRGc41();\r\n\tTRGc41_0();\r\n\t\r\n\tvar tmp1 = removeCommas(document.getElementById('c41').value);\r\n\tvar tmp2 = removeCommas(document.getElementById('c39').value);\r\n\tvar op = tmp1 - tmp2;\r\n\tif(op < 0){\r\n\t\top = 0;\r\n\t}\r\n\r\n\tif (PORC_MORA && PORC_MORA != null){\r\n\t\tdocument.getElementById('c42').value = (PORC_MORA * op).toFixed(0);\r\n\t\tif(document.getElementById('c42').value != null)\r\n \t\t colocarpuntos(document.getElementById('c42'));\r\n\t}\t\t\r\n\t\r\n\tif (PORC_INTERES && PORC_INTERES != null){\r\n\t\tdocument.getElementById('c43').value = (PORC_INTERES * op).toFixed(0);\r\n\t\tif(document.getElementById('c43').value != null)\r\n \t\t colocarpuntos(document.getElementById('c43'));\r\n\t}\r\n\t\r\n\trefreshVars();\r\n\tTRGc44();\r\n\t\r\n\tvar tmp = (0).toFixed(0);\r\n}", "function botonCalcular(event) {\n event.preventDefault();\n\n let subtotalCamisa = camisaEvento.value * valorCamisa;\n let totalCamisa = subtotalCamisa - (subtotalCamisa * 0.07);\n\n let totalEtiqueta = etiquetaEvento.value * valorEtiquetas;\n let oculto = document.querySelector('#totalPagado');\n\n let paseTotalDia = campoDia.value * paseDia;\n let paseTotalCompleto = campoCompleto.value * paseCompleto;\n let paseTotalDos = campoDos.value * paseDos;\n\n\n if (regalo.value == \"\" || undefined ) {\n errorRegalo.innerHTML = 'Debes escoger un regalo!!!'\n errorRegalo.style.visibility = \"visible\"\n regalo.focus();\n } else {\n errorRegalo.style.visibility = \"hidden\"\n let totalReserva = paseTotalCompleto + paseTotalDia + paseTotalDos + totalCamisa + totalEtiqueta;\n\n sumaTotal.innerHTML = `$ ${totalReserva.toFixed(2)}`;\n oculto.value = totalReserva;\n }\n \n \n let resumenProductos = [];\n\n if (campoDia.value >= 1) {\n resumenProductos.push(`${campoDia.value} Boletos de un dia`)\n }\n if (campoDos.value >= 1) {\n resumenProductos.push(`${campoDos.value} Boletos de dos dias`)\n }\n if (campoCompleto.value >= 1) {\n resumenProductos.push(`${campoCompleto.value} Boletos de todos los dias`)\n }\n if (camisaEvento.value >= 1) {\n resumenProductos.push(`${camisaEvento.value} Camisas del evento`)\n }\n if (etiquetaEvento.value >= 1) {\n resumenProductos.push(`${etiquetaEvento.value} etiquetas del evento `)\n }\n\n if(regalo.value !== \"\"){\n resumenProductos.push(`${regalo.value} es el regalo`)\n }\n\n listaProductos.innerHTML = '';\n\n resumenProductos.forEach(element => {\n if (regalo.value !== \"\") {\n listaProductos.innerHTML += `${element} </br>`\n } else {\n errorRegalo.innerHTML = 'Debes escoger un regalo!!!'\n errorRegalo.style.visibility = \"visible\"\n regalo.focus();\n }\n })\n //si no le agregamos el += solo nos imprimira un solo elemento, ademas debemos inicializar listaProductos.innerHTML = ''; \n // vacio, ya que si no lo hacemos de esta manera, se sobre escribira el array\n\n botonRegistro.disabled = false;\n \n \n }", "function calcularValor(qntPedida, preco_und){\n let qnt = qntPedida;\n let preco_undReais = preco_und/100;\n let total = qntPedida*preco_undReais;\n\n return total;\n}", "function calculateTotal_pr_cm() {\n //Aqui obtenemos el precio total llamando a nuestra funcion\n\t//Each function returns a number so by calling them we add the values they return together\n\t'use strict';\n var cakePrice = traerDensidadSeleccionada() * traerDensidadSeleccionada2() / getIndiceDeLogro() / 1000000, densidadimplantada = traerDensidadSeleccionada() / getIndiceDeLogro(), densidadobjetivo = traerDensidadSeleccionada();\n\t\t\t\t\n\t//Aqui configuramos los decimales que queremos que aparezcan en el resultado\n\tvar resultadodosdecimales1 = cakePrice.toFixed(2), resultadodosdecimales2 = densidadimplantada.toFixed(2), resultadodosdecimales3 = densidadobjetivo.toFixed(2);\n \n\t//Aqui exponemos el calculo\n\tvar divobj = document.getElementById('totalPrice_pr_cm');\n\tdivobj.style.display = 'block';\n\tdivobj.innerHTML = 'Você vai precisar plantar ' + resultadodosdecimales2 + ' sementes por hectare, que representa ' + resultadodosdecimales1 + ' sementes em um metro linear para atingir o seu alvo população de ' + resultadodosdecimales3;\n}", "function getPrecioSoporte(an, al) {\n\t\n\tvar idSoporte = $('#productoId').val();\n\tvar idTejido = $('#tejidoId').val();\n\t\n\tif (localStorage['idSoporte'] != 6) {\n\t\tvar ancho = $('input[name=\"ancho\"]').val();\n\t\tvar alto = $('input[name=\"alto\"]').val();\n\t} else {\n\t\tvar ancho = $('input[name=\"ancho\"]').val()/localStorage[\"vias\"];\n\t\tvar alto = $('input[name=\"alto\"]').val();\n\t} \n\t\n\tif (an && al) {\t\t\n\t\tvar ancho = an;\n\t\tvar alto = al;\n\t}\n\n\t$.ajax({\n\t url: url+\"calcularPrecioTejido.json\",\n\t type: \"POST\",\n \t data: {idsoporte : idSoporte, idtejido : idTejido, ancho : ancho, alto: alto, securitySession: sessionSecurity },\n\t success: function(data) {\n\t \t\n\t \tvar result = jQuery.parseJSON(data);\n\t \t\n\t \tif (localStorage[\"vias\"] > 0) {\n\t \t\t\n\t \t\tif ($('.viasPD .pvp span').text() == \"\") {\n\t \t\t\t\n\t\t \t\tfor (var i = 0; i < localStorage['vias']; i++) {\n\t\t \t\t\tvar viaSoporte = viasCarrito.at(i);\t\t\n\t\t\t\t\tviaSoporte.set({precio: result.precio});\n\t\t\t \t}\t\t\t \t\n\t\t\t \tsoporteProducto.set({precio: result.precio*localStorage[\"vias\"]});\n\t\t \t\n\t\t \t\n\t\t \t} else {\n\t\t \t\t\n\t\t \t\tvar pvp = 0;\n\t\t \t\t$('.livia').each(function(index, elem) {\t\t \t\t\t\n\t\t \t\t\tpvp += parseFloat($('.pvp span', elem).text());\t\t \t\t\t\n\t\t \t\t});\t \t\t\n\t\t \t\t\n\t\t \t\tsoporteProducto.set({precio: pvp.toFixed(2)});\n\t\t \t}\n\t \t} else {\n\t \t\tsoporteProducto.set({precio: result.precio});\n\t \t}\n\t \t\n\t \t\n\t \t\n\t },\n\t complete: function() {\n\t \t calcularTotal();\n\t }\n\t});\n\t\n}", "function calcular_promedio(type_calification, pr1, pr2, pr3, pa1, pa2, pe){\n if (type_calification === 'A') {\n\n pro_pr = 3*((pr1+pr2+pr3)/3)\n pro_pa = 2*((pa1 + pa2)/2)\n pro_gen = (pro_pr + pro_pa + pe)/6\n return Math.round(pro_gen)\n\n } else if (type_calification === 'B') {\n\n pro_pr = 3*((pr1+pr2+pr3)/3)\n pro_pa = 3*((pa1 + pa2)/2)\n pro_gen = (pro_pr + pro_pa + pe)/7\n return Math.round(pro_gen)\n\n } else if (type_calification === 'C') {\n\n pro_pr = 2*((pr1+pr2+pr3)/3)\n pro_pa = 4*((pa1 + pa2)/2)\n pro_gen = (pro_pr + pro_pa + pe)/7\n return Math.round(pro_gen)\n\n } else if (type_calification === 'D') {\n\n pro_pr = 2*((pr1+pr2+pr3)/3)\n pro_pa = 3*((pa1 + pa2)/2)\n pro_gen = (pro_pr + pro_pa + pe)/6\n return Math.round(pro_gen)\n\n } else if (type_calification === 'E') {\n pro_pa = 3*((pa1 + pa2)/2)\n pro_gen = (pro_pa + pe)/4\n return Math.round(pro_gen)\n\n } else {\n\n pro_pr = 4*((pr1+pr2+pr3)/3)\n pro_gen = (pro_pr + pe)/5\n return Math.round(pro_gen)\n }\n }", "function resolver(){\n var res = 0;\n switch(operacion){\n case \"+\":\n res += parseFloat(operandoa) + parseFloat(operandob);\n break;\n case \"-\":\n res += parseFloat(operandoa) - parseFloat(operandob);\n break;\n case \"*\":\n res += parseFloat(operandoa) * parseFloat(operandob);\n break;\n case \"/\":\n res += parseFloat(operandoa) / parseFloat(operandob);\n break;\n }\n limpiar();\n resultado.innerHTML += (Math.round(res * 100) / 100).toFixed(2);;\n }", "function calcPorcentajeMoras(){\r\n\r\n\tif (pm_called == 0){\r\n\t\tgetFiscalMoraInfo();\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tvar norectificativa = 1;\r\n\tif (document.getElementById('declarationType').value=='| 2 | RECTIFICATIVA'){\r\n\t\tnorectificativa = 0;\r\n\t}\r\n\tif(CONTRAVENSION_CMOV && CONTRAVENSION_CMOV != null){//Si es rectificativa no hay contravenci?n\r\n\t\tdocument.getElementById('c103').value = CONTRAVENSION_CMOV * norectificativa;\t\t\r\n\t\tif(document.getElementById('c103').value != null)\r\n \t\t colocarpuntos(document.getElementById('c103'));\r\n\t}\r\n\t\r\n\tvar tmp1 = removeCommas(document.getElementById('c107').value);\r\n\tvar tmp2 = removeCommas(document.getElementById('c103').value);\r\n\tvar op = tmp1 - tmp2;\r\n\tif(op < 0){\r\n\t\top = 0;\r\n\t}\r\n\r\n\tif (PORC_MORA && PORC_MORA != null){\r\n\t\tdocument.getElementById('c108').value = (PORC_MORA * op).toFixed(0);\r\n\t\tif(document.getElementById('c108').value < 0){\r\n\t\t\tdocument.getElementById('c18').value = 0;\r\n\t\t}\r\n\t\tif(document.getElementById('c108').value != null)\r\n \t\t colocarpuntos(document.getElementById('c108'));\r\n\t}\t\t\r\n\tif (PORC_INTERES && PORC_INTERES != null){\r\n\t\tdocument.getElementById('c109').value = (PORC_INTERES * op).toFixed(0);\r\n\t\tif(document.getElementById('c109').value < 0){\r\n\t\t\tdocument.getElementById('c109').value = 0;\r\n\t\t}\r\n\t\tif(document.getElementById('c109').value != null)\r\n \t\t colocarpuntos(document.getElementById('c109'));\r\n\t}\r\n\t\r\n\trefreshVars();\r\n\tTRGc105();\r\n\tTRGc106();\r\n\tTRGc106_0();\r\n\tTRGc107();\r\n\tTRGc107_0();\r\n\tTRGc110();\r\n\t\r\n\tvar tmp = (0).toFixed(0);\r\n\r\n}", "function ReiniciarCalcularPrecioFinal() {\n var total = $(\"#total\").text();\n\n $(\"#mostrardescuento\").text(0);\n $(\"#descuentos\").val(1);\n $(\"#descuentos option:selected\").val(1);\n $('#descuentos').material_select();\n $('#calculoEfectivoBs').val(0);\n $('#calculoEfectivoSus').val(0);\n\n $('#efectivoBs').val(\"0.00\");\n $('#efectivoSus').val(\"0.00\");\n $('#dBancoBs').val(\"\");\n $('#dBancoSus').val(\"\");\n $('#chequeBs').val(\"\");\n $('#chequeSus').val(\"\");\n $('#tDebitoBs').val(\"\");\n $('#tDebitoSus').val(\"\");\n $('#tCreditoBs').val(\"\");\n $('#tCreditoSus').val(\"\");\n var idmoned = $(\"#idMoneda\").val();\n\n if (idmoned == 1) {//Bolivianos\n $(\"#money1\").text(\"Bs.\");\n $(\"#money2\").text(\"Bs.\");\n $(\"#money3\").text(\"Bs.\");\n $(\"#money4\").text(\"Bs.\");\n $(\"#money5\").text(\"Bs.\");\n $(\"#money6\").text(\"Bs.\");\n $(\"#money7\").text(\"Bs.\");\n totalConDescuento = $(\"#total\").text();\n document.getElementById('totalfijo').innerHTML = total;\n $(\"#datosfactura tr\").remove();\n var valor = LITERAL(total);\n var tabladatos = $('#datosfactura');\n $(\"#totalacobrarcondescuentoenlaventa\").text(total);\n $(\"#saldoCredito\").text(total);\n tabladatos.append(\"<tr><td id='totalcondescuentoventa'>\" + total + \"</td><td id='totalventaliteral'>\" + valor + \"</td><tr>\");\n var porcentaje = total * 0.3;\n porcentaje = porcentaje.toFixed(2);\n var saldo = total - porcentaje;\n $(\"#aCuenta\").val(0);\n $(\"#saldo\").val(total);\n\n calcular_Bs();\n calcular_Sus();\n calcular_Banco_Bs();\n calcular_Banco_Sus();\n calcular_Cheque_Bs();\n calcular_Cheque_Sus();\n calcular_tCredito_Bs();\n calcular_tCredito_Sus();\n calcular_tDebito_Bs();\n calcular_tDebito_Sus();\n\n } else {\n $(\"#money1\").text(\"Sus.\");\n $(\"#money2\").text(\"Sus.\");\n $(\"#money3\").text(\"Sus.\");\n $(\"#money4\").text(\"Sus.\");\n $(\"#money5\").text(\"Sus.\");\n $(\"#money6\").text(\"Sus.\");\n $(\"#money7\").text(\"Sus.\");\n totalConDescuento = $(\"#total\").text();\n document.getElementById('totalfijo').innerHTML = total;\n $(\"#datosfactura tr\").remove();\n\n var tipoCV = parseFloat($(\"#TCV\").text());\n var totalConversion = parseFloat(total);\n var totaltotal = totalConversion * tipoCV;\n var redondeo = totaltotal.toFixed(2);\n var valorConversion = LITERAL(redondeo);\n $(\"#totalventaliteralSus\").text(valorConversion);\n\n\n var valor = LITERALDOLAR(total);\n var tabladatos = $('#datosfactura');\n $(\"#totalacobrarcondescuentoenlaventa\").text(total);\n $(\"#saldoCredito\").text(total);\n tabladatos.append(\"<tr><td id='totalcondescuentoventa'>\" + total + \"</td><td id='totalventaliteral'>\" + valor + \"</td><tr>\");\n var porcentaje = total * 0.3;\n porcentaje = porcentaje.toFixed(2);\n var saldo = total - porcentaje;\n $(\"#aCuenta\").val(0);\n $(\"#saldo\").val(total);\n\n calcular_Bs();\n calcular_Sus();\n calcular_Banco_Bs();\n calcular_Banco_Sus();\n calcular_Cheque_Bs();\n calcular_Cheque_Sus();\n calcular_tCredito_Bs();\n calcular_tCredito_Sus();\n calcular_tDebito_Bs();\n calcular_tDebito_Sus();\n }\n\n\n\n}", "function calcPorcentajeMoras(){\n\n\tif (pm_called == 0){\n\t\tgetFiscalMoraInfo();\n\t\treturn;\n\t}\n\t\n\tvar norectificativa = 1;\n\tif (document.getElementById('declarationType').value=='| 2 | RECTIFICATIVA'){\n\t\tnorectificativa = 0;\n\t}\n\tif(CONTRAVENSION_SMOV && CONTRAVENSION_CMOV != null){\n\t\tdocument.getElementById('c76').value = CONTRAVENSION_CMOV * norectificativa;\t\n\t\tif(document.getElementById('c76').value == 0){\n\t\t\tdocument.getElementById('c76').value == \"\";\n\t\t}\n\t\tif(document.getElementById('c76').value != null)\n \t\t colocarpuntos(document.getElementById('c76'));\n\t}\n\trefreshVars();\n\tTRGc78();\n\tTRGc80();\n\tTRGc80_0();\n\tvar tmp = (0).toFixed(0);\n}", "calcularIMC() {\n const peso = this.peso;\n const altura = this.altura;\n return (peso / altura * altura)\n }", "function CalcolaCostoTotale() {\r\n var totale = 0.0;\r\n\t\t\tvar CostoPranzoAbbonamento = NumberEU(document.getElementById(\"prezzoAbbPranzo\").innerHTML);\r\n var CostoCenaAbbonamento = NumberEU(document.getElementById(\"prezzoAbbCena\").innerHTML);\r\n var CostoPranzoCenaAbbonamento = NumberEU(document.getElementById(\"prezzoAbbPranzoCena\").innerHTML);\r\n var CostoEventoSpecialeER = NumberEU(document.getElementById(\"prezzoEventoSpecialeER\").innerHTML);\r\n\t\t\t\r\n var Iscrizione = document.getElementById(\"Iscrizione\"); \r\n var PranzoAbbonamento = document.getElementById(\"AbbonamentoPranzo\");\r\n \tvar CenaAbbonamento = document.getElementById(\"AbbonamentoCena\");\r\n \tvar EventoSpecialeER = document.getElementById(\"EventoSpecialeER\");\r\n\r\n\t\t\tvar ruoloIscr = document.getElementById(\"RuoloIscritto\");\r\n\t\t\t\r\n\t\t\t// calcolo l'iscrizione\t\t\t\r\n\t\t\tif (IsStringNumeric(document.getElementById(\"prezzoIscrizione\").innerHTML)) {\r\n\t\t\t\tCostoIscrizione = document.getElementById(\"prezzoIscrizione\").innerHTML;\r\n\t\t\t} \r\n\t\t\tif (Iscrizione.checked){\r\n\t\t\t\ttotale += NumberEU(CostoIscrizione);\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t// calcolo i pranzi e le cene settimanali\r\n\t\t\tif (PranzoAbbonamento.checked && CenaAbbonamento.checked) {\r\n\t\t\t\t// abbonamento completo\r\n\t\t\t\ttotale += CostoPranzoCenaAbbonamento;\r\n\t\t\t} else {\t\t\t\r\n\t\t\t\tif (!PranzoAbbonamento.checked) {\r\n\t\t\t\t\t// pranzi singoli\r\n\t\t\t\t\tvar Pranzi = document.getElementsByName(\"Pranzo[]\");\r\n\t\t var CostoPranzi = document.getElementsByName(\"CostoPranzo[]\");\r\n\t\t var PranziGratis = document.getElementsByName(\"GratisPranzo[]\");\r\n\t\t for (i=0; i < PranziGratis.length; i++) {\r\n\t\t\t\t\t\tif (!PranziGratis[i].checked) {\r\n\t\t\t\t\t\t\tif (Pranzi[i].checked) {\r\n\t\t\t\t\t\t\t\tif (IsStringNumeric(CostoPranzi[i].value)) {\r\n\t\t\t\t\t\t\t\t\ttotale += NumberEU(CostoPranzi[i].value);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//abbonamento pranzo\r\n\t\t\t\t\ttotale += CostoPranzoAbbonamento;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (!CenaAbbonamento.checked) {\r\n\t\t\t\t\t// cene singole\r\n\t\t\t\t\tvar Cene = document.getElementsByName(\"Cena[]\");\r\n\t\t var CostoCene = document.getElementsByName(\"CostoCena[]\");\r\n\t\t var CeneGratis = document.getElementsByName(\"GratisCena[]\");\r\n\t\t for (i=0; i < CeneGratis.length; i++) {\r\n\t\t\t\t\t\tif (!CeneGratis[i].checked) {\r\n\t\t\t\t\t\t\tif (Cene[i].checked) {\r\n\t\t\t\t\t\t\t\tif (IsStringNumeric(CostoCene[i].value)) {\r\n\t\t\t\t\t\t\t\t\ttotale += NumberEU(CostoCene[i].value);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// abbonamento cena\r\n\t\t\t\t\ttotale += CostoCenaAbbonamento;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// calcolo la cena finale e gli ospiti\r\n\t\t\tif (document.getElementById(\"CenaFinale\").checked) {\r\n\t\t\t\tvar CostoCenaFinale = 0;\r\n\t\t\t\tvar NrOspiti = document.getElementById(\"NrOspiti\");\r\n\t var CostoTotale = document.getElementById(\"CostoTotaleEuroCalcolato\"); \r\n\t\t\t\tif (IsStringNumeric(document.getElementById(\"prezzoCenaFinale\").innerHTML)) {\r\n\t\t\t\t\tCostoCenaFinale = NumberEU(document.getElementById(\"prezzoCenaFinale\").innerHTML);\r\n\t\t\t\t}\r\n\t\t\t\tif (IsStringNumeric(NrOspiti.value)) {\r\n\t\t\t\t\t// se hanno l'abbonamento la cena finale e' gratis\t\t\t\t\t\r\n\t\t\t\t\tif (PranzoAbbonamento.checked && CenaAbbonamento.checked) {\t\t\t\t\t\r\n\t\t\t\t\t\ttotale += ((NrOspiti.value) * CostoCenaFinale);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttotale += ((NrOspiti.value) * CostoCenaFinale) + CostoCenaFinale;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// calcolo l'evento speciale\r\n\t\t\tif (EventoSpecialeER.checked) {\r\n\t\t\t\ttotale += CostoEventoSpecialeER;\r\n\t\t\t}\r\n\t\t\treturn totale;\r\n\t\t}", "function calcPorcentajeMoras(){\n\n\tif (pm_called == 0){\n\t\tgetFiscalMoraInfo();\n\t\treturn;\n\t}\n\t\n\tvar norectificativa = 1;\n\tif (document.getElementById('declarationType').value=='| 2 | RECTIFICATIVA'){\n\t\tnorectificativa = 0;\n\t}\n\tif(CONTRAVENSION_CMOV && CONTRAVENSION_CMOV != null){//Si es rectificativa no hay contravenci?n\n\t\tdocument.getElementById('c48').value = CONTRAVENSION_CMOV * norectificativa;\t\t\n\t\tif(document.getElementById('c48').value != null)\n \t\t colocarpuntos(document.getElementById('c48'));\n\t}\n\t\n\tvar tmp1 = removeCommas(document.getElementById('c52').value);\n\tvar tmp2 = removeCommas(document.getElementById('c48').value);\n\tvar op = tmp1 - tmp2;\n\tif(op < 0){\n\t\top = 0;\n\t}\n\n\tif (PORC_MORA && PORC_MORA != null){\n\t\tdocument.getElementById('c53').value = (PORC_MORA * op).toFixed(0);\n\t\tif(document.getElementById('c53').value < 0){\n\t\t\tdocument.getElementById('c18').value = 0;\n\t\t}\n\t\tif(document.getElementById('c53').value != null)\n \t\t colocarpuntos(document.getElementById('c53'));\n\t}\t\t\n\tif (PORC_INTERES && PORC_INTERES != null){\n\t\tdocument.getElementById('c54').value = (PORC_INTERES * op).toFixed(0);\n\t\tif(document.getElementById('c54').value < 0){\n\t\t\tdocument.getElementById('c54').value = 0;\n\t\t}\n\t\tif(document.getElementById('c54').value != null)\n \t\t colocarpuntos(document.getElementById('c54'));\n\t}\n\t\n\trefreshVars();\n\tTRGc50();\n\tTRGc51();\n\tTRGc51_0();\n\tTRGc52();\n\tTRGc52_0();\n\tTRGc55();\n\t\n\tvar tmp = (0).toFixed(0);\n\n}", "function custoFinal(custoFabrica, percDistribuidor, percImpostos ){\n let custoFinal = custoFabrica + ((custoFabrica * percDistribuidor) / 100 ) + ((custoFabrica * percImpostos ) / 100)\n\n return custoFinal;\n}", "function calcular_precio(id,pos){\n\tvar cant=document.getElementById(\"numCant_\"+id+\"_\"+_numero_ticket+\"_\"+pos);\n\tvar i=Number(pos);\n\tif(cant!=null){\n\t\tconsole.log(cant);\n\t\tconsole.log(cant.value);\n\t\tconsole.log(\"numCant_\"+id+\"_\"+_numero_ticket+\"_\"+pos);\n\t\tvar prec=0;\n\t\tvar valor_venta=document.getElementById(\"valor_venta_\"+id+\"_\"+_numero_ticket+\"_\"+pos);\n\t\tvar pre=document.getElementById(\"precio_\"+id+\"_\"+_numero_ticket+\"_\"+pos);\n\t\t\n\t\t\n\t\tconsole.log(Number(cant.value));\n\t\tconsole.log(Number(valor_venta.value));\n\t\t//calculo el precio \n\t\tvar ps=mi_ticket[_numero_ticket-1].productos[i];\n\t\tconsole.log(ps);\n\t\tif((ps.promocion==\"1\" && ps.tipo_venta_promo==\"unidad\") && \n\t\t\t\t(Number(cant.value)>=ps.promo_desde) && \n\t\t\t\t\t(Number(cant.value)<=ps.promo_hasta)){\n\t\t\t\n\t\t\t\tvalor_venta.value=ps.precio_promo_venta;\n\t\t\t\tvalor_venta.innerHTML=\"$ \"+formato_numero(ps.precio_promo_venta,\"0\",\",\",\".\");\n\n\t\t}else{\n\t\t\t\tvalor_venta.value=ps.precio_producto;\n\t\t\t\tvalor_venta.innerHTML=\"$ \"+formato_numero(ps.precio_producto,\"0\",\",\",\".\");\n\t\t}\n\n\t\t\n\t\t\n\t\t//for(var i in mi_ticket[_numero_ticket-1].productos){\n\t\t\t\n\t\t\t\t\tif(mi_ticket[_numero_ticket-1].productos[i].id==id){\n\t\t\t\t\t\tconsole.log(mi_ticket[_numero_ticket-1].productos[i].cantidad_existencias<=cant.value);\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(cambiar_cantidad(i,cant)==true){\n\t\t\t\t\t\t\tprec=Number(cant.value) * Number(valor_venta.value);\n\t\t\t\t\t\t\tpre.innerHTML=\"$ \"+formato_numero(prec,\"0\",\",\",\".\");\n\t\t\t\t\t\t\tpre.value=prec;\n\t\t\t\t\t\t\tactualizar_unidades_reservadas(mi_ticket[_numero_ticket-1].productos[i]);\n\t\t\t\t\t\t\tcalcular_total(mi_ticket[_numero_ticket-1]);\n\t\t\t\t\t\t\tagregar_local_storage(\"mis_tickets_\"+_usuario.id_usuario+\"_\"+_IdSede,mi_ticket);\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tdocument.getElementById(\"numCant_\"+id+\"_\"+_numero_ticket+\"_\"+pos).value=mi_ticket[_numero_ticket-1].productos[i].cantidad_para_venta;\n\t\t\t\t\t\t\tconsole.log(\"Ha dicidico no pedir producto\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t\tconsole.log(mi_ticket[_numero_ticket-1].productos[i].id);\n\t\t\t\t\t\t\tconsole.log(id);\n\t\t\t\t\t}\n\t\t//}\n\n\t}\n\n\t\n}", "function calculaParcelaFinanciamento (valor,meses){\n var parcela={parcela:0, seguro:0, txadm:0}; \n //caso o prazo seja menor que 12 meses, não há incidência de juros\n if (meses<=12){\n parcela[\"parcela\"]=valor/meses;\n \n return parcela;\n }else{\n //caso contrário, procede ao cálculo financeiro \n var i=0.009488793;\n var numerador= i*Math.pow(1+i,meses);\n var denominador= Math.pow(1+i,meses)-1; \n var valorparcela=valor*(numerador/denominador);\n \n parcela[\"parcela\"]=valorparcela;\n parcela[\"seguro\"]=0.00019*valor;\n parcela[\"txadm\"]=25.00;\n \n return parcela;\n \n }//fim do else\n}//fim da função calculaParcelaFinanciamento ", "async function calcularEnvio(e) {\n e.preventDefault;\n const costoEnvioHTML = document.querySelector(\"#costoEnvio\");\n let cp = document.querySelector(\"#codigo-postal\").value;\n let precioEnvio = 0;\n if (cp !== \"\") {\n if(msgError.classList.contains( 'msg-visible' )){\n msgError.classList.add(\"msg-oculto\") \n msgError.classList.remove(\"msg-visible\");\n }\n costoEnvioHTML.value = 0;\n let url = `https://apis.andreani.com/v1/tarifas?cpDestino=${cp}&contrato=300006611&bultos[0][valorDeclarado]=1`;\n\n let response = await fetch(url);\n if (response.status === 200) {\n const precio = await response.json();\n precioEnvio = parseInt(precio.tarifaConIva.total); \n \n\n } else {\n msgError.classList.remove(\"msg-oculto\") \n msgError.textContent= 'No se encontro codigo postal';\n msgError.classList.add(\"msg-visible\");\n }\n } else {\n msgError.classList.remove(\"msg-oculto\") \n msgError.textContent ='Ingrese un codigo postal';\n msgError.classList.add(\"msg-visible\");\n }\n costoEnvioHTML.innerText = `$${precioEnvio}`;\n precioEnvioGlobal = precioEnvio;\n calcularSubTotal();\n // total += precioEnvio;\n spanTotal.innerText = total;\n}", "function get_soma_peso() {\r\r /*\r * REMOVE A CLASSE HIDE PARA EXIBIR O PRELOAD\r */\r $(\".Loader\").removeClass('hide');\r /*\r * CARREGA O CEP DA LOJA MARIA DE BARRO\r */\r var cep_remetente = $(\"#cep_remetente\").val();\r /*\r * CARREGA O CEP DO DESTINATARIO\r */\r var cep_destinatario = $(\"#cep_destinatario_2\").val();\r /*\r * CARREGA O PESO TOTAL DA COMPRA\r */\r var total_peso = $(\"#total_peso\").val();\r /*\r * CARREGA A FORMA DE ENVIO SELECIONADA\r */\r var forma_envio = $(\"#forma_envio\").val();\r /*\r * REMOVE O IFEM DOS CEP'S CASO EXISTA\r */\r var cr = cep_remetente.replace(\"-\", \"\");\r var cd = cep_destinatario.replace(\"-\", \"\");\r /*\r * CARREGA O VALOR TOTAL DA COMPRA JUNTAMENTE COM PS IMPOSTOS\r */\r var total_parcial = $(\"#total_parcial\").html();\r var total_impostos = $(\"#total_impostos\").html();\r\r /*\r * CHECA SE O CEP DO CLIENTE E UM CEP VALIDO\r */\r if (cd.length == 8) {\r /*\r * MONTA OS DADOS QUE SERAO PASSADOS VIA POST PELO AJAX\r */\r var url = \"cep_remetente=\" + cr\r + \"&cep_destinatario=\" + cd\r + \"&total_peso=\" + total_peso\r + \"&forma_envio=\" + forma_envio\r + \"&total_geral=\" + total_parcial.trim()\r + \"&total_impostos=\" + total_impostos.trim();\r /*\r * REALIZA A CHAMADA AJAX\r */\r $.ajax({\r type: 'post',\r data: url,\r url: getMyFolderRoot() + '/web-files/server/get_valor_frete.php',\r success: function (data) {\r\r /*\r * RETIRA O PRELOAD \r */\r $(\".Loader\").addClass('hide');\r\r /*\r * CASO TENHA ESCOLHIDO ALGUMA FORMA DE ENVIO TANTO CORREIOS QUANTO TRANSPORTADORA\r */\r if (forma_envio == \"total_express\"\r || forma_envio == \"41106\"\r || forma_envio == \"40010\"\r || forma_envio == \"40215\"\r || forma_envio == \"40290\")\r {\r /*\r * EXIBE O PRAZO DE ENTREGA\r */\r $(\".prazo_entrega_tr\").removeClass(\"hide\");\r /*\r * MONTA STRING BASEADO EM REGRA DE NEGOCIO DA LOJA\r */\r var pz = data[\"prazo_entrega\"];\r if (!isNaN(pz)) {\r var pzd = parseInt(pz);\r var str = \"\";\r if (pzd == 0) {\r str = \"de 2 a 3 dias úteis\";\r } else {\r str = \"de \" + pzd + \" a \" + (pzd + 4) + \" dias úteis\";\r }\r } else {\r str = \"\";\r }\r /*\r * EXIBE O PRAZO DE ENTREGA ESTIMADO PELOS WEBSERVICE OU PELA LOJA\r */\r $(\"#prazo_entrega\").html(str);\r\r } else {\r\r /*\r * CASO TENHA ESCOLHIDO BUSCAR NA LOJA ESCONDE O PRAZO DE ENTREGA\r */\r $(\".prazo_entrega_tr\").addClass(\"hide\");\r\r /*\r * REMOVE ALGUM HTML EXISTENTE DO PRAZO DE ENTREGA\r */\r $(\"#prazo_entrega\").html(null);\r }\r /*\r * ATUALIZA A SOMATORIA NO QUADRO DE DESCONTOS\r */\r $(\"#total_geral\").html(data[\"soma\"]);\r $(\"#taxa_entrega\").html(data[\"frete\"]);\r $(\"#msg_erro\").html(data[\"msg_erro\"]);\r $(\"#total_impostos\").html(data[\"total_impostos\"]);\r\r /*\r * MANTEM A EXIBICAO DO PASSO TRES\r */\r if (data[\"frete\"] != \"Gratis\") {\r $(\".step-3\").removeClass(\"hide\");\r }\r\r forma_pgto();\r }\r });\r } else {\r $(\".Loader\").addClass('hide');\r }\r\r}", "function calcularValorDeCustoPorPorcentagem(porcentagem) {\r\n let valorCusto = (parseFloat(document.getElementById('precovendaproduto').value ? document.getElementById('precovendaproduto').value : 0.0) * parseInt(porcentagem)) / 100;\r\n document.getElementById('precocustoproduto').value = valorCusto.toFixed(2);\r\n}", "function calcularIVA(precioSinIVA){\n return precioSinIVA*1.21;\n}", "function calcular() {\n num2 = obtenerResultado();\n resolver();\n}", "function calcularValorFinal(id_prato, valor) {\n let prato = $.map(pratos, function (n) {\n if (n.id_prato == id_prato) {\n return n;\n }\n });\n\n if ($(\"#promocaoIsPorcentagem:checked\").val())\n valorFinal = prato[0].vl_prato - calcularPorcentagem(prato[0].vl_prato, valor);\n else\n valorFinal = prato[0].vl_prato - valor;\n return valorFinal;\n }", "calc()\n\t{\n\t\tlet filas = this.controlFilas; // Obtenemos el control\n\t\tlet columnas = this.controlColumnas; // Obtenemos el control\n\t\tlet sumaClase = 0.0; // Suma para la frecuencia\n\t\tlet resClase = 0.0; // Resultado del porcentaje\n\t\tlet totalClase = 0.0;\n\t\tlet totalFrecuencia = 0.0;\n\n\t\t// Recorremos la tabla\n\t\tfor(let i = 0; i < filas; i++){\n\t\t\tfor(let j = 0; j < columnas; j++){\n\t\t\t\t// Verificamos si hay un dato\n\t\t\t\tif(document.getElementById((i+1)+''+(j+1)).value.length > 0){\n\t\t\t\t\t// Verificamos que solo se sumen columnas 1 y 2\n\t\t\t\t\tif(j == 0 || j == 1){\n\t\t\t\t\t\tsumaClase += parseFloat(document.getElementById((i+1)+''+(j+1)).value);\n\t\t\t\t\t} else if(j == 2){\n\t\t\t\t\t\ttotalFrecuencia += parseFloat(document.getElementById((i+1)+''+(j+1)).value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresClase = sumaClase / 2;\n\t\t\tdocument.getElementById((i+1)+'f').innerHTML = resClase; // Intectamos\n\t\t\ttotalClase += resClase;\n\t\t\tsumaClase = 0; // Reseteamos la suma\n\t\t\tresClase = 0;\n\t\t}\n\n\t\t// Inyectamos los totales\n\t\tdocument.getElementById('suma1').innerHTML = totalClase;\n\t\tdocument.getElementById('suma2').innerHTML = totalFrecuencia;\n\t}", "function calculateTotal_usa_cm() {\n //Aqui obtenemos el precio total llamando a nuestra funcion\n\t//Each function returns a number so by calling them we add the values they return together\n\t'use strict';\n var cakePrice = traerDensidadSeleccionada() * traerDensidadSeleccionada2() / getIndiceDeLogro() / 1000000, densidadimplantada = traerDensidadSeleccionada() / getIndiceDeLogro(), densidadobjetivo = traerDensidadSeleccionada();\n \n //Aqui configuramos los decimales que queremos que aparezcan en el resultado\n\tvar resultadodosdecimales1 = cakePrice.toFixed(2), resultadodosdecimales2 = densidadimplantada.toFixed(2), resultadodosdecimales3 = densidadobjetivo.toFixed(2);\n\t\n\t//Aqui exponemos el calculo\n\tvar divobj = document.getElementById('totalPrice');\n\tdivobj.style.display = 'block';\n\tdivobj.innerHTML = 'You will need to plant ' + resultadodosdecimales2 + ' seeds per hectare wich represents ' + resultadodosdecimales1 + ' seeds in a lineal meter for achieving your population target of ' + resultadodosdecimales3;\n}", "function botonPrecionado(peso) {\n\n switch (peso) {\n case 10:\n addPeso(peso);\n break;\n case 7.5://6.6\n addPeso(peso);\n break;\n case 4.3://3.3\n addPeso(peso);\n break;\n case 0:\n addPeso(peso);\n break;\n default:\n }\n indicePregunta++;\n if(indicePregunta < preguntas.length){\n cambiarPregunta();\n }\n else {\n analizarAptitudes();\n // document.getElementById(\"con1\").value = 1\n // document.getElementById(\"con2\").value = 1\n // document.getElementById(\"con3\").value = 1\n // document.getElementById(\"con4\").value = 1\n // document.getElementById(\"con5\").value = 1\n // document.getElementById(\"con6\").value = 1\n\n //enviar resultados a\n document.getElementById(\"voc-form\").submit();\n\n }\n }", "function calculaPrecio(precio) {\n \n for (let i = 0; i < productoPrecio.length; i++) {\n \n \n if ( precio==productoPrecio[i] ) {\n \n \n console.log(productoPrecio.length + ' productos con precios iniciales:');\n console.log((productoPrecio[0]*1000) + ' pesos el Vainilla');\n console.log((productoPrecio[1]*1000) + ' pesos el Chocolate');\n console.log((productoPrecio[2]*1000) + ' pesos la Cacao');\n console.log((productoPrecio[3]*1000) + ' pesos las Trufas');\n\n console.log('El precio inicial del producto que se eligió era de ' + precio*1000 + ' pesos');\n\n \n precioFinal = precio * descuentoOperativo;\n\n\n\n alert('El precio se rebajó un ' + Math.round((1-descuentoOperativo)*100) + '% quedando en ' + Math.round(precioFinal*1000) + ' pesos por 100 grs')\n \n return console.log('El precio se rebajó un ' + Math.round((1-descuentoOperativo)*100) + '% quedando en ' + Math.round(precioFinal*1000) + ' pesos por 100 grs');\n \n }\n\n } \n}", "function fn_calcular(fila) {\n\n\n var enfoque = $(\"#cbo-enfoque\").val();\n if (enfoque == 1) {\n if (validarCampoE(fila)) {\n var item = {\n ANNOB: $(\"#cbo-det-1-\" + fila).val(),\n ID_TIPO_VEHICULOB: $(\"#cbo-det-2-\" + fila).val(),\n ID_TIPO_COMBUSTIBLEB: $(\"#cbo-det-3-\" + fila).val(),\n KRVB: $(\"#txt-det-1-\" + fila).val(),\n CANTIDADB: $(\"#txt-det-2-\" + fila).val(),\n FACTOR_RENDIMIENTO: $(\"#txt-det-3-\" + fila).val(),\n ID_TIPO_FUENTEI: 1,\n ID_ENFOQUE: enfoque\n }\n fn_enviarDatos(item, fila, enfoque)\n }\n } else if (enfoque == 2) {\n if (validarCampoH(fila)) {\n var item = {\n ANNOB: $(\"#cbo-det-1-\" + fila).val(),\n ID_TIPO_VEHICULOB: $(\"#cbo-det-2-\" + fila).val(),\n ID_TIPO_COMBUSTIBLEB: $(\"#cbo-det-3-\" + fila).val(),\n KRVB: $(\"#txt-det-1-\" + fila).val(),\n KRV_COMBUSTIBLE: $(\"#txt-det-2-\" + fila).val(),\n CANTIDADB: $(\"#txt-det-3-\" + fila).val(),\n FACTOR_RENDIMIENTO: $(\"#txt-det-4-\" + fila).val(),\n ID_TIPO_FUENTEI: 2,\n ID_ENFOQUE: enfoque\n }\n fn_enviarDatos(item, fila, enfoque)\n }\n } else if (enfoque == 3) {\n if (validarCampoEC(fila)) {\n var item = {\n ANNOB: $(\"#cbo-det-1-\" + fila).val(),\n ID_TIPO_VEHICULOB: $(\"#cbo-det-2-\" + fila).val(),\n ID_TIPO_COMBUSTIBLEB: $(\"#cbo-det-3-\" + fila).val(),\n CONSUMO_ELECTRICIDAD: $(\"#txt-det-1-\" + fila).val(),\n ID_ENFOQUE: enfoque\n //ID_TIPO_FUENTEI: $(\"#cbo-enfoque\").val(),\n }\n fn_enviarDatos(item, fila, enfoque)\n }\n } else if (enfoque == 4) {\n if (validarCampoHC(fila)) {\n var item = {\n ANNOB: $(\"#cbo-det-1-\" + fila).val(),\n ID_TIPO_VEHICULOB: $(\"#cbo-det-2-\" + fila).val(),\n ID_TIPO_COMBUSTIBLEB: $(\"#cbo-det-3-\" + fila).val(),\n CONSUMO_ELECTRICIDAD: $(\"#txt-det-1-\" + fila).val(),\n CONSUMO_COMBUSTIBLE: $(\"#txt-det-2-\" + fila).val(),\n ID_ENFOQUE: enfoque\n //ID_TIPO_FUENTEI: $(\"#cbo-enfoque\").val(),\n }\n fn_enviarDatos(item, fila, enfoque)\n }\n }\n}", "calcula(i){\n let vP = this.arrCamisas[i].camisap*10;\n let vM = this.arrCamisas[i].camisam*12;\n let vG = this.arrCamisas[i].camisag*15;\n\n let valortotal = vP+vM+vG;\n\n return valortotal;\n }", "ajuste_potencia(){\n if (this.energia_disponible()){\n let danio_total = this.calcular_danio_total();\n let inyect_total = this.inyectores_disponibles();\n let plasma_inyector = (danio_total+this._plasma_requerido - inyect_total * limit_plasma)/this.inyectores_disponibles();\n for (let i = 0; i < this._injectores.length; i++) {\n if (this._injectores[i]._danio_por!==100){\n if (plasma_inyector<0){\n this._injectores[i].set_plasma = this._injectores[i].calcular_poder()+plasma_inyector;\n } else {\n this._injectores[i].set_plasma = this._injectores[i].calcular_poder();\n this._injectores[i].set_extra_plasma = plasma_inyector;\n\n }\n }\n }\n this._potencia_disponible = true;\n } else {\n this._potencia_disponible = false;\n\n }\n }", "function calcularMontos() {\n validarBotonCLiente();\n\n var rowCountFactura = $('#tblDetalleFactura tr').length;\n if (rowCountFactura > 1) {\n var estado = false;\n var tipoCambio = parseFloat($('#txtTipoCambio').val());\n var totalRecibos = 0;\n var totalBase = 0;\n var totalImpuesto = 0;\n var totalRetencion = 0;\n var totalNeto = 0;\n var totalDescuento = 0;\n\n var totalAplicar = 0;\n\n //variables para validar que no se esta dejando saldo pendiente en el cobro \n var MontoPendienteDoc = 0;\n var MontoaAplicarDoc = 0;\n var MontoDepositadoTotal = $(\"#txtMVoucher\").val();\n\n $('#tblDetalleFactura tr').each(function () {\n var IdFacturaTmp = $(this).find(\".tmpIdFactura\").html();\n if (!isNaN(IdFacturaTmp) && IdFacturaTmp != null) {\n var Base = $(this).find(\".tmpBase\").html();\n var Impuesto = $(this).find(\".tmpImpuesto\").html();\n var Retencion = $(this).find(\".tmpRetencion\").html();\n var Descuento = $(this).find(\".tmpDescuento\").html();\n\n\n\n var saldo = $(this).find(\".tmpFinal\").html();\n var pendienteAplicacion = $(this).find(\".tmpPendienteAplicacion\").html();\n var montoAplicar = quitarformatoMoneda($('#txtFactMontoAplicar' + IdFacturaTmp).val());\n var estadoEnDB = $(this).find(\".tmpEnDB\").html();\n\n MontoPendienteDoc = saldo;\n MontoaAplicarDoc = montoAplicar;\n\n //VALIDACION MONTO MENOR\n if (estadoEnDB == false) {\n if (parseFloat(montoAplicar) != 0 && parseFloat(montoAplicar) <= parseFloat(saldo - pendienteAplicacion)) {\n $('#txtFactMontoAplicar' + IdFacturaTmp).css('border', '1px solid gray');\n } else {\n if (isNaN(montoAplicar) || montoAplicar == null || montoAplicar == '') {\n $('#txtFactMontoAplicar' + IdFacturaTmp).val(0);\n montoAplicar = 0;\n }\n $('#txtFactMontoAplicar' + IdFacturaTmp).css('border', '1px solid red');\n }\n }\n\n var detalleFactura = {\n IdFactura: IdFacturaTmp,\n montoAplicarNuevo: montoAplicar\n };\n\n ActualizarFacturaDetalle(detalleFactura);\n var IdMonedaTmp = $(this).find(\".tmpIdMonedaFact\").html();\n if (IdMonedaTmp == '44') { //Moneda Dolar\n montoAplicar = (parseFloat(montoAplicar) * tipoCambio);\n }\n\n totalAplicar = parseFloat(totalAplicar) + parseFloat(montoAplicar);\n totalRecibos += 1;\n estado = true;\n }\n });\n\n\n if (estado == true) {\n\n\n $(\"#txtMAplicar\").val(formatoCurrency(totalAplicar));\n $(\"#hidMAplicar\").val(totalAplicar);\n ValidaMontosAplicarSaldo(MontoDepositadoTotal, totalAplicar, MontoaAplicarDoc, MontoPendienteDoc);\n }\n } else {\n LimpiarTotalAplicarFactura();\n }\n}", "function prom(){\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"php/calculos.php\",\n\t\tsuccess: function (resp) {\n\t\t\tvar valor = resp.split(\"|\");\n\t\t\t$('#estadisticas').find('#prom').text(parseFloat(valor[0]).toFixed(1));\n\t\t\t$('#estadisticas').find('#porcent').text(parseFloat(valor[1]).toFixed(1));\n\t\t\t$('#estadisticas').find('#porcentm').text(100-(parseFloat(valor[1])).toFixed(1));\n\t\t}\n\t});\n}", "function calcular2() {\r\n\r\n //PESO\r\n if(document.getElementById(\"select-conversionpeso\").value == 4)\r\n {\r\n document.getElementById(\"resultado-conversionpeso\").value= document.getElementById(\"input-pesoconversion\").value / 1000 +\" Kilogramos\";\r\n }\r\n\r\n if(document.getElementById(\"select-conversionpeso\").value == 5)\r\n {\r\n document.getElementById(\"resultado-conversionpeso\").value= document.getElementById(\"input-pesoconversion\").value * 1000 +\" Kilogramos\";\r\n }\r\n\r\n //DISTANCIA\r\n if(document.getElementById(\"select-conversiondistancia\").value == 6)\r\n {\r\n document.getElementById(\"resultado-conversiondistancia\").value= document.getElementById(\"input-distanciaconversion\").value / 100 +\" Metros\";\r\n }\r\n\r\n if(document.getElementById(\"select-conversiondistancia\").value == 7)\r\n {\r\n document.getElementById(\"resultado-conversiondistancia\").value= document.getElementById(\"input-distanciaconversion\").value * 1000 +\" Metros\";\r\n }\r\n\r\n //TIEMPO\r\n if(document.getElementById(\"select-conversiontiempo\").value == 8)\r\n {\r\n document.getElementById(\"resultado-conversiontiempo\").value= document.getElementById(\"input-tiempoconversion\").value * 60 +\" Segundos\";\r\n }\r\n\r\n if(document.getElementById(\"select-conversiontiempo\").value == 9)\r\n {\r\n document.getElementById(\"resultado-conversiontiempo\").value= document.getElementById(\"input-tiempoconversion\").value * 3600 +\" Segundos\";\r\n }\r\n}", "fecharCompra() {\n let total = 0;\n\n // 20% de desconto para novos clientes\n if (this.novoCliente) {\n total = this.valorTotal * 0.8;\n // desconto de XX% do cupom \n } else if (this.cupom) {\n total = this.valorTotal * (1 - this.cupom);\n // 5% de desconto para compras acima de 100 reais\n } else if (this.valorTotal > 100) {\n fintotalal = this.valorTotal * 0.95;\n };\n\n return this.valorTotal = total.toFixed(2);;\n }", "function resolver(){\r\n\t\tvar res = 0;//variable que me guarda los resultados\r\n\r\n\t\tswitch(operacion){\r\n\t\t\tcase \"+\":\r\n\t\t\tres = parseFloat(operandoA) + parseFloat(operandoB);\r\n\t\t\tbreak;\r\n\t\t\tcase \"-\":\r\n\t\t\tres = parseFloat(operandoA) - parseFloat(operandoB);\r\n\t\t\tbreak;\r\n\t\t\tcase \"*\":\r\n\t\t\tres = parseFloat(operandoA) * parseFloat(operandoB);\r\n\t\t\tbreak;\r\n\t\t\tcase \"/\":\r\n\t\t\tres = parseFloat(operandoA) / parseFloat(operandoB);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tresetear();//esta linea invoca la funcion de reiniciar la calculadora\r\n\t\tresultado.textContent = res.toString().substring(0,8);//esta linea realiza una conversion del resultado a texto para mostralo en pantalla hasta max 8 num.\r\n\t}", "function calcularPrecioTotal (){\n let precioTotal = 0;\n for (properly of carrito){\n precioTotal += properly.price * properly.count;\n }\n precioTotal = precioTotal > discountLimit ? aplicaDescuentoCarrito(precioTotal) : precioTotal ;\n return precioTotal;\n}", "function getPercentuais(fase) {\n var percentuais = {\"pctFase\": Number(0), \"pctTotal\": Number(0)};\n switch (fase) {\n case 'ENG':\n percentuais.pctTotal = parseFloat(config_isEng ? parseFloat(config_pctEng) : 0);\n percentuais.pctFase = parseFloat(config_isEng ? parseFloat(config_pctEng) : 0);\n break;\n case 'DES':\n percentuais.pctTotal = parseFloat(config_isEng ? parseFloat(config_pctEng) : 0);\n percentuais.pctFase = parseFloat(config_isEng ? parseFloat(config_pctDes) : 0);\n break;\n case 'IMP':\n percentuais.pctTotal = parseFloat(config_isEng ? parseFloat(config_pctEng) : 0) +\n parseFloat(config_isDes ? parseFloat(config_pctDes) : 0);\n percentuais.pctFase = parseFloat(config_isImp ? parseFloat(config_pctImp) : 0);\n break;\n case 'TES':\n percentuais.pctTotal = parseFloat(config_isEng ? parseFloat(config_pctEng) : 0) +\n parseFloat(config_isDes ? parseFloat(config_pctDes) : 0) +\n parseFloat(config_isImp ? parseFloat(config_pctImp) : 0);\n percentuais.pctFase = parseFloat(config_isTes ? parseFloat(config_pctTes) : 0);\n break;\n case 'HOM':\n percentuais.pctTotal = parseFloat(config_isEng ? parseFloat(config_pctEng) : 0) +\n parseFloat(config_isDes ? parseFloat(config_pctDes) : 0) +\n parseFloat(config_isImp ? parseFloat(config_pctImp) : 0) +\n parseFloat(config_isTes ? parseFloat(config_pctTes) : 0);\n percentuais.pctFase = parseFloat(config_isHom ? parseFloat(config_pctHom) : 0);\n break;\n case 'IMPL':\n percentuais.pctTotal = parseFloat(config_isEng ? parseFloat(config_pctEng) : 0) +\n parseFloat(config_isDes ? parseFloat(config_pctDes) : 0) +\n parseFloat(config_isImp ? parseFloat(config_pctImp) : 0) +\n parseFloat(config_isTes ? parseFloat(config_pctTes) : 0) +\n parseFloat(config_isHom ? parseFloat(config_pctHom) : 0);\n percentuais.pctFase = parseFloat(config_isImpl ? parseFloat(config_pctImpl) : 0);\n break;\n }\n return percentuais;\n}", "function calcularPromedioTemperatura(...temperaturas){\r\n\r\n let temperaturaMaxima= Math.max(...temperaturas);\r\n\r\n let temperaturaMinima =Math.min(...temperaturas);\r\n\r\n let promedio = (temperaturaMaxima+temperaturaMinima)/2;\r\n\r\n return (promedio);\r\n}", "function calcularTasaMuerta(id) {\r\n //Obtener el valor de la Amortizacion\r\n var lista1 = document.getElementById(\"amortizacion1\");\r\n var amort_cf1 = lista1.options[lista1.selectedIndex].text;\r\n //Si el usuario ingresa el valor Efectivo anual\r\n if (id == \"EA1\") {\r\n \t\r\n //Si es mensual\r\n if (amort_cf1 == \"Mensual\") {\r\n\t\t\r\n tasa_ip_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_EA_cf1\").value) / 100)), (30 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 12;\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 30)) - 1) * 100;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n //alert(document.getElementById(\"tasa_EA_cf1\").value);\r\n \r\n\r\n } else {\r\n //Si es trimestral\r\n tasa_ip_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_EA_cf1\").value) / 100)), (90 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 4;\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 90)) - 1) * 100;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n }\r\n }\r\n\r\n if (id == \"NA1\") {\r\n //Si es mensual\r\n if (amort_cf1 == \"Mensual\") {\r\n tasa_ip_cf1 = (parseFloat(document.getElementById(\"tasa_NA_cf1\").value) / 12);\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 30)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 12;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n } else {\r\n //Si es trimestral\r\n tasa_ip_cf1 = (parseFloat(document.getElementById(\"tasa_NA_cf1\").value) / 4);\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 90)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 4;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n }\r\n }\r\n\r\n if (id == \"Ip1\") {\r\n //Si es mensual\r\n if (amort_cf1 == \"Mensual\") {\r\n tasa_ea_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_Ip_cf1\").value) / 100)), (360 / 30)) - 1) * 100;\r\n tasa_ip_cf1 = (Math.pow((1 + (tasa_ea_cf1 / 100)), (30 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 12;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n } else {\r\n //Si es trimestral\r\n tasa_ea_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_Ip_cf1\").value) / 100)), (360 / 90)) - 1) * 100;\r\n tasa_ip_cf1 = (Math.pow((1 + (tasa_ea_cf1 / 100)), (90 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 4;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n }\r\n }\r\n}", "CalcImporte(prd) {\n //alert('calculando');\n insumo.UltPrd = prd; //validar\n insumo.precio = $(`#prec_${prd}`).val();\n insumo.cantBueno = $(`#cantBueno_${prd}`).val();\n insumo.cantMalo = $(`#cantMalo_${prd}`).val();\n insumo.valorBueno = parseFloat(insumo.precio) * parseInt(insumo.cantBueno);\n insumo.valorMalo = parseFloat(insumo.precio) * parseInt(insumo.cantMalo);\n insumo.subTotal = insumo.valorBueno + insumo.valorMalo; // subTotal linea\n //\n $(`#valorBueno_v${prd}`).val(insumo.valorBueno.toFixed(10));\n $(`#valorBueno_d${prd}`).val(\"¢\" + insumo.valorBueno.toFixed(2).replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\"));\n $(`#valorMalo_v${prd}`).val(insumo.valorMalo.toFixed(10));\n $(`#valorMalo_d${prd}`).val(\"¢\" + insumo.valorMalo.toFixed(2).replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\"));\n $(`#subtotal_v${prd}`).val(insumo.subTotal.toFixed(10));\n $(`#subtotal_d${prd}`).val(\"¢\" + insumo.subTotal.toFixed(2).replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\"));\n }", "function calcularTotal(precioHabitacion) {\n\t\tfechaInicio=$(\"#fechaInicio\").val();\n\t\tfechaFin=$(\"#fechaFin\").val();\n\t\tvar totalMilisegundos = Date.parse(fechaFin) - Date.parse(fechaInicio);\n\t\tvar totalDias= totalMilisegundos / 1000 / 60 / 60 / 24;\n\t\tprecioTotal=parseInt(precioHabitacion)*parseInt(totalDias);\n\t\t$('#precioTotal').val(precioTotal);\n\t\t$(\"#precioTotal\").fadeIn(\"slow\");\n\t\t$(\".labelPrecio\").fadeIn(\"slow\");\n\t\t$(\"#reserva\").removeAttr('disabled');\n\t}", "function calculate(porc) {\n nmrbill = document.getElementById(\"bill\").value;\n nmrpessoa = document.getElementById(\"ppl\").value;\n if (nmrbill >= 1 && nmrpessoa >= 1) {\n resultP = (nmrbill * porc) / 100 / nmrpessoa;\n resultT = resultP + nmrbill / nmrpessoa;\n document.getElementById(\"ppscreen\").innerHTML = \"$\" + Math.floor((resultP * 100)) / 100;\n document.getElementById(\"ttscreen\").innerHTML = \"$\" + Math.floor((resultT * 100)) / 100;\n setTheme(\"resBtc-2\")\n }\n else if (nmrpessoa < 1) {\n document.getElementById(\"ppl\").style.border = \"2px solid brown\";\n document.getElementById(\"err2\").style.display = \"block\";\n setTimeout(() => {\n pplRestore()\n }, 3000);\n }\n else if (nmrbill < 1) {\n document.getElementById(\"bill\").style.border = \"2px solid brown\";\n document.getElementById(\"err1\").style.display = \"block\";\n setTimeout(() => {\n pplRestore()\n }, 3000);\n }\n}", "function calcular() {\n etanol = parseFloat (calcForm.txtEtanol.value.replace(\",\",\".\"));\n gasolina = parseFloat (calcForm.txtGas.value.replace(\",\",\".\"));\n/**Convertendo variaveis para o tipo numérico */\n if (etanol < 0.7 * gasolina){\n /*verdadeiro*/\n document.getElementById(\"status\").src=\"./img/etanol.PNG\";\n }else{\n /*falso*/\n document.getElementById(\"status\").src=\"./img/gasolina.PNG\";\n }\n\n \n }", "function calculoDescuento () {\n precioTotal = parseFloat(precio) - ( (precio * parseFloat(descuento/100) ));\n alert (\"El precio final es de \" + parseFloat(precioTotal))\n}", "function calcularPerimetroCudrado(){\nconst input=document.getElementById(\"inputcuadrado\");\nconst value=input.value;\nconst perimetro=perimetroCuadrado(value);\nalert(perimetro);\n}", "function calcularPremio() {\n return ($(\"#numJugadores\").val() * $(\"#valCarton\").val()) * 0.8;\n}", "_calcularIRPF(){\n if (this._baseIRPF <= 1903.98){\n return this._valorIRPF = 0;\n }\n else if (this._salarioBruto > 1903.98 && this._salarioBruto <= 2826.65){\n return this._valorIRPF = ((this._baseIRPF - 142.80) * 7.5 / 100);\n }\n else if (this._salarioBruto > 2826.65 && this._salarioBruto <= 3751.05){\n return this._valorIRPF = ((this._baseIRPF - 354.80) * 15 / 100);\n }\n else if (this._salarioBruto > 3751.05 && this._salarioBruto <= 4664.68){\n return this._valorIRPF = ((this._baseIRPF - 636.13) * 22.5 / 100);\n }\n else {\n return this._valorIRPF = ((this._baseIRPF - 869.36) * 27.5 / 100);\n } \n }", "asistenciasTotalesPorDia(equipo){\n let len = equipo.length;\n let asistencia_total = [];\n let total_lunes=0;\n let total_martes=0;\n let total_miercoles=0;\n let total_jueves=0;\n let total_viernes=0;\n let total_sabado=0;\n let total_domingo=0;\n \n for (var i = 0; i <len; ++i) {\n total_lunes = total_lunes + (equipo[i].asistencia.lunes * equipo[i].factor_dias_laborados);\n total_martes = total_martes+ (equipo[i].asistencia.martes * equipo[i].factor_dias_laborados);\n total_miercoles = total_miercoles + (equipo[i].asistencia.miercoles * equipo[i].factor_dias_laborados);\n total_jueves = total_jueves + (equipo[i].asistencia.jueves * equipo[i].factor_dias_laborados);\n total_viernes = total_viernes + (equipo[i].asistencia.viernes * equipo[i].factor_dias_laborados);\n total_sabado = total_sabado + (equipo[i].asistencia.sabado * equipo[i].factor_dias_laborados);\n // total_domingo = total_domingo + (equipo[i].asistencia.domingo * equipo[i].factor_dias_laborados);\n }\n\n asistencia_total.push(total_lunes);\n asistencia_total.push(total_martes);\n asistencia_total.push(total_miercoles);\n asistencia_total.push(total_jueves);\n asistencia_total.push(total_viernes);\n asistencia_total.push(total_sabado);\n // asistencia_total.push(total_domingo);\n\n \n return asistencia_total;\n }", "function CalculoPrecio() {\n var margen = document.getElementById(\"Margen\").value/100;\n var costo = document.getElementById(\"Costo\").value;\n var oferta = document.getElementById(\"Oferta\").value; \n var aux = +costo+(+costo*margen);\n var discount = aux * (oferta/100);\n aux = aux - discount;\n document.getElementById(\"Precio\").value= new Number(JSON.parse(aux));\n }", "getEleccionPaquete(){\r\n\r\n if( eleccion == \"IGZ\" ){\r\n //Igz - descuento del 15\r\n console.log(\"Elegiste Iguazú y tiene el 15% de decuento\");\r\n return this.precio - (this.precio*0.15);\r\n }\r\n else if (eleccion == \"MDZ\"){\r\n //mdz - descuento del 10\r\n console.log(\"Elegiste Mendoza y tiene el 10% de descuento\");\r\n return this.precio - (this.precio*0.10);\r\n }\r\n else if (eleccion == \"FTE\"){\r\n //fte - no tiene descuento \r\n console.log(\"Elegiste El Calafate, lamentablemente no tiene descuento\");\r\n return \"\";\r\n }\r\n \r\n }", "function newCost() {\n let precioSubtotal = 0;\n let precioTotal = 0;\n let productos = cart_products_info.articles\n for(let i = 0; i <productos.length; i++) {\n let units = document.getElementById(\"cart_\"+i+\"_units\").value;\n precioSubtotal += convertir(productos[i].currency)*units*productos[i].unitCost;\n }\n // precioTotal = precioSubtotal*(1+precioEnvio()).toFixed(0)\n\n document.getElementById(\"precioSubtotal\").innerHTML = \"UYU \" + precioSubtotal.toFixed(0)\n document.getElementById(\"precioEnvio\").innerHTML = \"UYU \" + (precioSubtotal*precioEnvio()).toFixed(0)\n document.getElementById(\"precioTotal\").innerHTML = \"UYU \" + (precioSubtotal*(1+precioEnvio())).toFixed(0)\n\n}", "function calcularMedia(puntuacionesPartidos) {\n let sumaPuntos = 0;\n for (let i = 0; i < puntuacionesPartidos.length; i++) {\n sumaPuntos += puntuacionesPartidos[i];\n }\n return Math.round(sumaPuntos / puntuacionesPartidos.length);\n}", "function calcular (cantidad, valor,gastocomb,gastolub,gastooperador)\n {\n this.cantidad = cantidad;\n this.valor = valor;\n this.gastocomb = gastocomb;\n\tthis.gastolub = gastolub;\n\tthis.gastooperador = gastooperador;\t\n\t\n\t\n\tvar valorgalon =parseInt( document.getElementById('galon').value);\n var valorfactura =parseInt( document.getElementById('facturalu').value);\n\t\n\t \n\tvar glub=valorgalon*this.gastolub;\n\tvar goperador=this.gastooperador*this.cantidad;\n\t\n\tvar minutos=this.cantidad*60/1;\n\tvar valormin=this.valor/60;\n\tvar ingresosant=valormin*minutos;\n\tvar ingresos=parseFloat(ingresosant).toFixed(2);\n\tvar gastos= this.gastocomb+goperador+glub;\n\tvar ingtotales=ingresos-gastos;\t\n\tif(isNaN(ingtotales))\n\t {\n\t\t\n\t }\n\telse\n\t {\n\t\tdocument.trabajo.cantidaduso.value=this.cantidad; \n\t document.trabajo.ingtotales.value=ingresos;\n\t document.trabajo.gastotales.value=gastos;\n\t document.trabajo.gananciastotales.value=ingtotales;\n\t\tdocument.trabajo.factura2.value=valorfactura ;\n\t }\n }", "function enviataxaaula(percent_aula, id_aula, id_projeto) {\n var envio = {}\n envio.id_contato = get_data('geral').id\n envio.id_aula = id_aula\n envio.percentual = percent_aula\n envio.email = get_data('geral').email \n envio.id_projeto = id_projeto \n\n set_tempo_ondemand(envio, (stst) => {\n //console.log('inserido - ' + id_aula + ' - ' + percent_aula + ' - ' + envio.id_contato)\n })\n}", "function calculaElTotal(elEvento) {\n\t\t//Añade el encabezado de la tabla\n\t\tdocument.getElementById(\"tablaTotal\").innerHTML='<tr><td class=\"ima\"><b>Imagen</b></td><td class=\"pro\"><b>Producto</b></td><td class=\"uni\"><b>Unidades</b></td><td class=\"preUni\"><b>Precio Unidad</b></td><td class=\"preTotal\"><b>Total</b></td></tr>';\n\t\t//Inicializacion de las variables para esta funcion:\n\t\tvar carroTotal = 0;\n\t\t//Muestra el carrito de la compra\n\t\tfor (i in pro){\n\t\t\tvar tablaTotal = document.getElementById(\"tablaTotal\").innerHTML;\n\t\t\tvar preTotal = 0;\n\t\t\t//Cuenta el numero de productos\n\t\t\tif (uniUser[i].value != 0){\n\t\t\t\t//Calcula el totalUnidades y rellena el carro de la compra\n\t\t\t\tpreTotal = pro[i].precio * uniUser[i].value;\n\t\t\t\tcarroTotal = carroTotal + preTotal;\n\t\t\t\tdocument.getElementById(\"tablaTotal\").innerHTML = tablaTotal + '<tr class=\"proCarrito\"><td><img class=\"rounded\" src=\"'+pro[i].imagen+ '\" alt=\"'+pro[i]+'\"></td><td>' +pro[i].nombre+ '</td><td>' +uniUser[i].value+ '</td><td>' +pro[i].precio+ '</td><td id=\"preTotal' +i+'\" name=\"preTotal\">' +preTotal+ '</td></tr>';\n\t\t\t}\t}\n\t\t//Se obtiene el subTotal\n\t\tif(carroTotal>0){\n\t\t\tvar totalIVA = (carroTotal * IVA);\n\t\t\tvar totalAPagar = carroTotal + totalIVA;\n\t\t}\n\t\ttotalIVA=totalIVA*100;\n\t\ttotalIVA=Math.floor(totalIVA);\n\t\ttotalIVA=totalIVA/100;\n\n\t\ttotalAPagar=totalAPagar*100;\n\t\ttotalAPagar=Math.floor(totalAPagar);\n\t\ttotalAPagar=totalAPagar/100;\n\t\t//Se añade a la tabla el TOTAL que suma el carrito:\n\t\ttablaTotal = document.getElementById(\"tablaTotal\").innerHTML;\n\t\tdocument.getElementById(\"tablaTotal\").innerHTML = tablaTotal + '<tr><td>&nbsp;</td>&nbsp;<td></td><td></td><td class=\"preUni\"><b>Subtotal: </b></td><td class=\"preTotal\"><b>' +\"$ \"+carroTotal+ '</b></td></tr>' +'<tr><td>&nbsp;</td>&nbsp;<td></td><td></td><td class=\"preUni\"><b>IVA ('+(IVA*100)+'%): </b></td><td class=\"preTotal\"><b>' +\"$ \"+totalIVA+ '</b></td></tr>' + '<tr><td>&nbsp;</td>&nbsp;<td></td><td></td><td class=\"preUni\"><b>Total: </b></td><td class=\"preTotal\" id=\"totalAPagar\"><b>'+\"$ \"+totalAPagar+ '</b></td></tr>';\n\t}", "function reglaAumPrecioFullCobertura(){\n if(producto.f_cobertura.sellIn -1){\n precio_FullCobertura + 1;\n }else{\n\n }\n}", "function calcularPerimetroCuadrado() {\n const input = document.getElementById(\"InputCuadrado\");\n const value = input.value;\n // llamamos a la funcion perimetroCuadrado la cual va arealizar el calculo!\n const perimetro = perimetroCuadrado(value);\n // nos mostrara en una ventana de alerta el resultado!\n alert(perimetro);\n}", "function cambiodeprecios(idselect, produ) {\n console.log(idselect);\n var data = {id: document.getElementById(idselect).value};\n fetch('/buscar/propiedad/producto/id', {\n method: 'POST', // or 'PUT'\n body: JSON.stringify(data),\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then(res => res.json())\n .catch(error => console.error('Error:', error))\n .then(response => {\n console.log(response);\n let precioparcial = parseInt(document.getElementById('preciounitario' + produ).value);\n let acumulado = 0;\n for (let x = 0; x < response.length; x++) {\n acumulado += parseInt(response[x]['precio']);\n }\n console.log(acumulado);\n let totalparcial = acumulado + precioparcial;\n\n document.getElementById('preciounitario' + produ).value = totalparcial;\n });\n\n}", "function actualizarPrecio() {\n var precioModelo = precioModelos[almohadonNuevo.modelo];\n var precioForma = precioFormas[almohadonNuevo.forma];\n var precioColor = precioColores[almohadonNuevo.color];\n var precioTexto = 0;\n if (hayTexto)\n precioTexto = 50;\n var total = parseFloat(precioModelo)+parseFloat(precioForma)+parseFloat(precioColor)+parseFloat(precioTexto);\n $(\"#precioModelo\").text(\"$\"+precioModelo);\n $(\"#precioForma\").text(\"$\"+precioForma);\n $(\"#precioColor\").text(\"$\"+precioColor);\n $(\"#precioTexto\").text(\"$\"+precioTexto);\n $(\"#precioTotal\").text(\"$\"+total);\n}", "function calcularPerimetroCirculo() {\n const input = document.getElementById(\"InputCirculo\");\n const value = input.value;\n const perimetro = perimetroCirculo(value);\n resultTagCirculo.innerHTML = perimetro.toFixed(2);\n}", "calcPay() {\n //filter\n // gaunu sarasa kuriame yra tik done projektai\n let doneProjektai = this.#currentProjects.filter((prObj) => prObj.projectDone === true);\n // console.log(\"doneProjektai\", doneProjektai);\n\n // paskaiciuoju bendra visu projektu kaina\n let moketinaSuma = doneProjektai.reduce((total, prObj) => total + prObj.price, 0);\n // console.log(\"moketinaSuma\", moketinaSuma);\n\n // gale turi likti currentProjects tik tie el kuriu done yra lygu false\n // console.table(this.#currentProjects);\n this.#currentProjects = this.#currentProjects.filter((prObj) => prObj.projectDone === false);\n // console.table(this.#currentProjects);\n // grazinti moketina suma\n return moketinaSuma;\n }", "function calculaPR(){\n let bonusRS = 0;\n if(jogador1.arma.forca == undefined){\n bonusRS = 0;\n }else{\n jogador1.powerRS = parseInt(jogador1.powerRS);\n bonusRS = jogador1.arma.forca + (jogador1.powerRS * (jogador1.arma.pBonus));\n }\n\n let bonusColete = 0;\n if(jogador1.colete.resBonus == undefined){\n bonusColete = 0;\n }else{\n jogador1.colete.resBonus = parseInt(jogador1.colete.resBonus)\n bonusColete = jogador1.colete.resBonus;\n }\n\n let pr = ((jogador1.atributosJ*4)/4)*(70/100) + bonusRS + bonusColete;\n pr = pr + (.5/100);\n pr = pr.toFixed(0);\n return pr \n}", "function somaProdutos(){\n\tvalores = jQuery(\".valorProduto\").text();\n\tarrayValores = valores.split(\"R$\");\n\tqtdValores = (arrayValores.length) - 1;\n\tsoma = 0;\t\n\tfor(i = 1; i <= qtdValores; i++){\n\t\tarrayValores[i] = parseFloat(arrayValores[i]);\n\t\tsoma += arrayValores[i];\n\t}\n\t\n\tif(jQuery(\"select[name='custeio']\").val() == \"50% Loja e 50% DMcard\")\n\t{\n\t\tsoma=soma/2;\n\t\tjQuery(\"select[name='formaPagamento']\").val(\"\");\n\t\t\n\t}else if(jQuery(\"select[name='custeio']\").val() == \"100% Loja\")\n\t{\n\t\tsoma = 0;\n\t\tjQuery(\"select[name='formaPagamento']\").val(\"Sem Forma de Pagamento\");\n\t\t\n\t}else if(jQuery(\"select[name='custeio']\").val() == \"100% DMcard\")\n\t{\n\t\tjQuery(\"select[name='formaPagamento']\").val(\"\");\n\t}\n\t\n\tjQuery(\".valorTotal span\").text(\"R$\" + soma.toFixed(2));\n\tjQuery(\"input[name='valorTotal']\").val(soma.toFixed(2));\n}", "function calcularTotal() {\n // Limpiamos precio anterior\n total = 0;\n // Recorremos el array del carrito\n carrito.forEach((item) => {\n // De cada elemento obtenemos su precio\n const miItem = baseDeDatos.filter((itemBaseDatos) => {\n return itemBaseDatos.id === parseInt(item);\n });\n total = total + miItem[0].precio;\n });\n // Renderizamos el precio en el HTML\n DOMtotal.textContent = total.toFixed(2);\n}", "function aplicaDescuentoCarrito(precioTotal){\n let priceDiscount = precioTotal * discountPrice;\n precioTotal = precioTotal - priceDiscount;\n document.getElementById(\"chopping-price-discount\").innerHTML = \"( Descuento del \" + discountPrice*100 + \"% )\";\n return precioTotal;\n}", "function CalcImporte(prd){\n producto.UltPrd = prd;//validar\n pUnit = $(`#prec_${prd}`)[0].textContent.replace(\"¢\",\"\");\n cant = parseInt($(`#cant_${prd}`)[0].value);\n\n if(cant <= parseInt($(`#cant_${prd}`)[0].attributes[3].value)){\n $(`#impo_${prd}`)[0].textContent = \"¢\" + (parseFloat(pUnit) * parseFloat(cant)).toString();\n }\n else{\n // alert(\"Cantidad invalida, la cantidad maxima disponible es: \"+ $(`#cant_${prd}`)[0].attributes[3].value)\n alertSwal(producto.cantidad)\n $(\"#cant_\"+ producto.UltPrd).val($(`#cant_${prd}`)[0].attributes[3].value); \n }\n \n $(`#impo_${prd}`)[0].textContent = \"¢\" + (parseFloat(pUnit) * parseInt($(`#cant_${prd}`)[0].value)).toString();\n // $(`#importe_${prd}`)[0].textContent\n $(`#cant_${prd}`).keyup(function(e) {\n if(e.which == 13) {\n if (cant==0){\n BorraRow(prd);\n calcTotal();\n }\n $(`#impo_${prd}`)[0].textContent = \"¢\" + (parseFloat(pUnit) * parseInt($(`#cant_${prd}`)[0].value)).toString();\n calcTotal();\n $(\"#p_searh\").focus();\n }\n });\n if (cant==0){\n BorraRow(prd);\n calcTotal();\n $(\"#p_searh\").focus();\n }\n}", "function calcularPerimetroCuadrado(params) {\n const input = document.getElementById(\"InputCuadrado\");\n const value = input.value;\n const perimetro = perimetroCuadrado (value);\n alert (perimetro);\n}", "function calcular(){ \n\n\n \n let total = soma(rend) - soma(des)\n \n if( Number(rend) == 0 || Number(des) == 0 ) {\n erro.style.display = 'block'\n } else if(total >0) {\n res.style.display='block'\n form.style.display = 'none'\n botaodecalcular.style.display = 'none'\n document.body.style.background= '#0000FF'\n retorno.style.display = 'block'\n res.innerHTML+= `SALDO POSITVO`\n res.innerHTML+= ` <p> O final e de: R$${total.toFixed(2)}</p>`\n \n } else {\n res.style.display='block'\n form.style.display = 'none'\n botaodecalcular.style.display = 'none'\n document.body.style.background= '#FF0000'\n retorno.style.display = 'block'\n res.innerHTML+= `SALDO NEGATIVO \\u{2716}`\n res.innerHTML+= `<p> O saldo negativo e de: R$${total.toFixed(2)}</p> `\n }\n\n \n \n///Boatao para voltar ao formulario\n}", "function calculaTotalVenda(){\n\n let totalGeral = 0;\n $('#vendaPainelTable #itensTable').find('tbody tr').each(function(){\n let val = $(this).find('td:eq(6)').text(); \n totalGeral+=parseFloat(foramtCalcCod(val));\n\n })\n\n totalComGlob = totalGeral;\n\n totalGeral = formatMoney(totalGeral)\n $('form#vendaPainelTable #totGeralVenda').text(totalGeral);//adiciona o valor formatado no campo total\n\n return foramtCalcCod(totalGeral);//retorna o valor pronto para calculos\n}", "function calcular(){\n\tvar result = eval(document.fo.valores.value);\n document.fo.valores.value = resultado;\n}", "function CalcularMedia(fecha, hoy, presupuesto, consumido, total, correo, nombre_alerta) {\r\n \r\n var difference = (hoy - fecha);\r\n\r\n var years = Math.floor(difference / (1000 * 60 * 60 * 24 * 365));\r\n difference -= years * (1000 * 60 * 60 * 24 * 365);\r\n var months = Math.floor(difference / (1000 * 60 * 60 * 24 * 30.4375));\r\n var day = Math.floor(difference / (1000 * 60 * 60 * 24));\r\n \r\n var dif = '';\r\n if (years > 0)\r\n dif = years;\r\n\r\n if (months > 0) {\r\n if (years > 0) dif;\r\n dif += day;\r\n }else { \r\n dif = day;\r\n }\r\n \r\n \r\n Logger.log('\\nConsumido ' + consumido + '€ en ' + dif + ' dias');\r\n \r\n var resultado = (total * dif) / consumido; \r\n resultado = Math.round(resultado);\r\n var resultado_final = resultado.toFixed();\r\n \r\n Logger.log('Queda un total de ' + total + '€, aproximadamente ' + resultado_final + ' dias' );\r\n \r\n EventoCalendar(presupuesto, consumido, total, correo, nombre_alerta, resultado_final);\r\n\r\n}", "function AtrazoBoco (mês, valorAnuidade) {\n switch(mês) {\n case 1:\n return `Valor da Anuidade: ${valorAnuidade}`\n break\n\n case 2:\n const juroscomposto1 = valorAnuidade * ((1 + 0.05)**1)\n return `Valor da Anuidade com Juros: ${juroscomposto1.toFixed(2)}`\n break\n\n case 3:\n const juroscomposto2 = valorAnuidade * ((1 + 0.05)**2)\n return `Valor da Anuidade com Juros: ${juroscomposto2.toFixed(2)}`\n break\n\n case 4:\n const juroscomposto3 = valorAnuidade * ((1 + 0.05)**3)\n return `Valor da Anuidade com Juros: ${juroscomposto3.toFixed(2)}`\n break\n\n case 5:\n const juroscomposto4 = valorAnuidade * ((1 + 0.05)**4)\n return `Valor da Anuidade com Juros: ${juroscomposto4.toFixed(2)}`\n break\n\n case 6:\n const juroscomposto5 = valorAnuidade * ((1 + 0.05)**5)\n return `Valor da Anuidade com Juros: ${juroscomposto5.toFixed(2)}`\n break\n\n case 7:\n const juroscomposto6 = valorAnuidade * ((1 + 0.05)**6)\n return `Valor da Anuidade com Juros: ${juroscomposto6.toFixed(2)}`\n break\n\n case 8:\n const juroscomposto7 = valorAnuidade * ((1 + 0.05)**7)\n return `Valor da Anuidade com Juros: ${juroscomposto7.toFixed(2)}`\n break\n\n case 9:\n const juroscomposto8 = valorAnuidade * ((1 + 0.05)**8)\n return `Valor da Anuidade com Juros: ${juroscomposto8.toFixed(2)}`\n break\n\n case 10:\n const juroscomposto9 = valorAnuidade * ((1 + 0.05)**9)\n return `Valor da Anuidade com Juros: ${juroscomposto9.toFixed(2)}` \n break\n\n case 11:\n const juroscomposto10 = valorAnuidade * ((1 + 0.05)**10)\n return `Valor da Anuidade com Juros: ${juroscomposto10.toFixed(2)}`\n break\n\n case 12:\n const juroscomposto11 = valorAnuidade * ((1 + 0.05)**11)\n return `Valor da Anuidade com Juros: ${juroscomposto11.toFixed(2)}`\n break\n }\n }", "function eq_tempo(){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) ottobre 2011.\n // funzione per il calcolo del valore dell'equazione del tempo per la data odierna.\n // algoritmo di P.D. SMITH.\n \nvar njd=calcola_jd(); // giorno giuliano in questo istante a Greenwich.\n njd=jdHO(njd)+0.5; // g. g. a mezzogiorno di Greenwich.\n\nvar ar_sole=pos_sole(njd); // calcolo dell'ascensione retta del sole.\nvar anno=jd_data(njd); // anno di riferimento.\n\nvar Tempo_medio_Greenw=tsg_tmg_data(ar_sole[0],anno[2],njd); // tempo medio di Greenwich.\nvar valore_et=12-Tempo_medio_Greenw; // valore dell'equazione del tempo.\n\n valore_et=valore_et*60; // valore in minuti.\n\n valore_et=valore_et.toFixed(6);\n\n\n\nreturn valore_et\n\n}", "function calculTempsPreparationRestant(commandes){\n angular.forEach(commandes,function(commande){\n angular.forEach(commande.detailCommandes,function(detailCommande){\n detailCommande.plat.dureePreparation = getDureeRestant(commande.dateCommande,detailCommande.plat.dureePreparation*1000)*detailCommande.quantite;\n })\n });\n }", "function calcularPerimetroCuadrado(){\n const input = document.getElementById(\"InputCuadrado\");\n const value = input.value;\n\n const perimetro = perimetroCuadrado(value);\n alert(\"El perimetro es: \" + perimetro + \"cm\");\n}", "function crepuscolo(njd,tempo_rif,longitudine,latitudine,altitudine){\n\n // funzione per il calcolo del crepuscolo astronomico.\n // FUNZIONE DA ELIMINARE e sostituire con crepuscolo_UT\n \n var tempo_rifst=0; // tempo di riferimento per il sorgere e il tramonto.\n // \nif (tempo_rif==\"TL\") { tempo_rifst=-fuso_loc(); } // riferimento al tempo locale.\nelse if (tempo_rif==\"TU\") { tempo_rifst=0 ;} // il riferimento rimane il TU\n\n\n var ps_sole=pos_sole(njd);\n var DEs=ps_sole[1];\n\n var LATr=latitudine/180*Math.PI;\n var DEr=DEs/180*Math.PI;\n\n var H=Math.acos(-Math.tan(LATr)*Math.tan(DEr));\n\n var H1=Math.acos((Math.cos(1.88495556)-Math.sin(LATr)*Math.sin(DEr))/(Math.cos(LATr)*Math.cos(DEr)));\n\n var H= H*180/Math.PI;\n var H1=H1*180/Math.PI;\n\n var T=((H1-H)/15)*0.9973;\n\n// new Array(azimut_sorgere,azimut_tramonto,tempo_sorgere,tempo_transito,tempo_tramonto)\n// 0 1 2 3 4\n\n var p_sole=ST_ASTRO_DATA(njd,ps_sole[0],ps_sole[1],longitudine,latitudine,altitudine,0.25);\n\n var crep_m=ore_24(p_sole[2]-T+tempo_rifst); // crepuscolo del mattino.\n var crep_s=ore_24(p_sole[4]+T+tempo_rifst); // crepuscolo serale\n\n crep_m=sc_ore_hm(crep_m); // crepuscolo del mattino.\n crep_s=sc_ore_hm(crep_s); // crepuscolo serale\n\n var tempi_crep= new Array(crep_m,crep_s);\n\n return tempi_crep;\n \n}", "function calcularPerimetroCuadrado (){\n const input = document.getElementById(\"inputCuadrado\");\n const value = input.value;\n\n const resultadoPerimetro = perimetroCuadrado(value); \n alert(\"El resultado del perimetro es: \" + resultadoPerimetro)\n }", "function calcularPrecio()\n{\n\tvar precioTotal = 0;\n\t$(\".precioTotal\").each(function() {\n precioTotal += parseFloat($(this).text());\n });\n $(\"#botonPrecio\").text(\"Precio total: \" + precioTotal);\n}", "function recalcularTotalAPrazo() {\n var subTotalChequesECartao = parseFloat(trim(document.formPagamento.totalChequesAPrazo.value.toString())) + parseFloat(trim(document.formPagamento.totalCartaoAPrazo.value.toString()));\n var totalDinheiroAPrazo;\n\n // Verifica se o campo estah em branco\n if (trim(document.formPagamento.totalAPrazoEmDinheiro.value.toString()) != '') {\n totalDinheiroAPrazo = parseFloat(trim(document.formPagamento.totalAPrazoEmDinheiro.value.toString()));\n }\n else {\n document.formPagamento.totalAPrazoEmDinheiro.value = parseFloat(\"0\");\n totalDinheiroAPrazo = parseFloat(\"0\");\n }\n\n // Verifica se foi inserido cheque ou cartao verificando a soma dos valores dos campos hidden 'totalChequesAVista' e 'totalCartaoAVista'\n if (subTotalChequesECartao > parseFloat(\"0\")) {\n var subTotal = subTotalChequesECartao + totalDinheiroAPrazo;\n // Marca o subtotal e o total com a soma do subtotal de cheques mais cartao e total de dinheiro\n document.formPagamento.subtotalAPrazo.value = subTotal.toFixed(2);\n document.formPagamento.totalAPrazo.value = subTotal.toFixed(2);\n }\n else {\n // Marca o subtotal e o total com o total em dinheiro\n document.formPagamento.subtotalAPrazo.value = totalDinheiroAPrazo.toFixed(2);\n document.formPagamento.totalAPrazo.value = totalDinheiroAPrazo.toFixed(2);\n }\n}", "function calcularIVA3(precioSinIVA,IVA=21){\n return precioSinIVA*(1+(IVA/100));\n}", "function calcularPorcentajeTranscurrido(tiempoTrans, tiempoTotal){\n return (tiempoTrans/tiempoTotal)*100;\n}", "function calcularPerimetroTriangulo() {\n const input1 = document.getElementById(\"InputTrianguloLado1\");\n const lado1 = Number(input1.value);\n\n const input2 = document.getElementById(\"InputTrianguloLado2\");\n const lado2 = Number(input2.value);\n \n const input3 = document.getElementById(\"InputTrianguloBase\");\n const base = Number(input3.value);\n \n // llamamos a la funcion perimetroCuadrado la cual va arealizar el calculo!\n const perimetro = perimetroTriangulo(lado1, lado2, base);\n alert('El Perímetro Total es de: ' + perimetro + 'cm');\n}", "function CalculoRecargo(informacion) {\n\n var calculo = recargoEdad(informacion.edad);\n\n if (\"SI\" == informacion.casado.toUpperCase()) {\n calculo += recargoEdad(informacion.edadConyuge);\n }\n\n calculo += precio_base * recargos.hijos * informacion.numHijos;\n\n /** recargos extras: prpiedad y salario */\n calculo += informacion.valorPropiedad * recargos.propiedades;\n calculo += informacion.salario * recargos.salario;\n\n return calculo;\n}", "function probaDeEspera(intesidad, numServ, po){\n return ((intesidad**numServ) * 2 * po)/(factorial(numServ) * (numServ - intesidad))\n}", "function calcularPerimetroCuadrado(){\n const lado = document.getElementById(\"inputCudrado\").value\n const perimetro = perimetroCuadrado(lado)\n alert(`El perímetro del cuadrado es: ${perimetro}`)\n}", "function calcularPerimetroCuadrado () {\n const input = document.getElementById(\"InputCuadrado\");\n const value = input.value;\n const perimetro = perimetroCuadrado(value);\n resultTagCuadrado.innerHTML = perimetro;\n}", "function calcular(){\r\n\t\"use strict\";\r\n\tvar pack=document.getElementById(\"pack\").value;\r\n\tvar array=pack.split(\",\");\r\n\tvar precio=array[1];\r\n\tvar cantidad=document.getElementById(\"cantidad\").value;\r\n\tdocument.getElementById(\"total\").innerHTML=\"$\"+precio*cantidad;\r\n}", "function reglaRebajaPrecios(){\n if(producto.super_avance.sellIn = 0)\n {\n precio_SuperAvance - 2;\n\n if(producto.fc_superduper.sellIn = 0){\n precio_FullSuperDuper - 2;\n\n if(producto.f_cobertura.sellIn = 0){\n precio_FullCobertura - 2;\n }\n }\n }else{\n }\n}", "function calcularTotal(carrito) {\r\n //Recorrer el array de productos en el carrito, calcular su precio final y sumarlo todo\r\n let precioTotal = 0;\r\n for (const producto of carrito) {\r\n precioTotal += producto.precioFinal();\r\n }\r\n return precioTotal;\r\n}", "function evalPermiso(event) {\n msjClean();\n\n let permiso = gestor.getPeticiones()[0];\n\n let peticion = {};\n peticion[\"idUsuario\"] = permiso.getIdUsuario();\n peticion[\"cola\"] = event.target.value;\n peticion[\"nombreSolicitante\"] = $(\"#donya\").val();\n peticion[\"comentarios\"] = permiso.getComentarios();\n peticion[\"fechaCreacion\"] = gestor.getDate();\n peticion[\"fechaLlegada\"] = gestor.getDate();\n peticion[\"motivo\"] = $(\"input[name=motivo-permiso]:checked\").val();\n peticion[\"motivoRepresentativas\"] = $(\"#valor-funciones-representativas\").val();\n peticion[\"motivoInexcusable\"] = $(\"#valor-deber-inexcusable\").val();\n\n\n peticion[\"jornada\"] = {\n \"completa\": {\n \"diaInicio\": $(\"#completa-fecha-desde\").val(),\n \"diaFin\": $(\"#completa-fecha-hasta\").val(),\n },\n \"parcial\": {\n \"diaInicio\": $(\"#incompleta-fecha-desde\").val(),\n \"diaFin\": $(\"#incompleta-fecha-hasta\").val(),\n \"horaInicio\": $(\"#incompleta-hora-desde\").val(),\n \"horaFin\": $(\"#incompleta-hora-hasta\").val(),\n }\n };\n\n peticion[\"horario\"] = gestor.getPeticiones()[0].getHorario();\n\n peticion[\"observaciones\"] = $(\"#documentacion-observaciones\").val();\n peticion[\"fechaFirma\"] = $(\"#firma-anyo\").val()+\"-\"+$(\"#firma-mes\").val()+\"-\"+$(\"#firma-dia\").val();\n peticion[\"firma\"] = $(\"#firma-firma\").val();\n peticion[\"firmaDireccion\"] = $(\"#direccion-visto-firma\").val();\n\n\n if( $(\"#tipoAusencia\").prop(\"checked\")){\n peticion[\"tipoAusencia\"] = \"ausencia\";\n }\n else if( $(\"#tipoRetraso\").prop(\"checked\")){\n peticion[\"tipoAusencia\"] = \"retraso\";\n }\n\n if( $(\"#motivoEnfermedad\").prop(\"checked\")){\n peticion[\"motivoAusencia\"] = \"enfermedad\";\n }\n else if( $(\"#motivoPermiso\").prop(\"checked\")){\n peticion[\"motivoAusencia\"] = \"permiso\";\n }\n\n peticion[\"horAusencias\"] = {\n \"lectivas\": $(\"#horas-lectivas-ausencia\").val(),\n \"otras\": $(\"#horas-otras-ausencia\").val(),\n \"complementarias\": $(\"#horas-complementarias-ausencia\").val(),\n \"evaluacion\": $(\"#horas-evaluacion-ausencia\").val(),\n \"claustro\": $(\"#horas-claustro-ausencia\").val(),\n \"ccp\": $(\"#horas-ccp-ausencia\").val(),\n \"consejo\": $(\"#horas-consejo-ausencia\").val(),\n \"reunionDep\": $(\"#horas-reunion-dep-ausencia\").val(),\n \"reunionTutores\": $(\"#horas-reunion-tutores-ausencia\").val()\n };\n\n\n let log = {};\n log[\"idUsuario\"] = gestor.getLocal()[\"id\"];\n log[\"nombre\"] = gestor.getLocal()[\"nombre\"];\n log[\"fecha\"] = gestor.getDate();\n log[\"hora\"] = gestor.getTime();\n log[\"colaInicio\"] = permiso.getCola();\n log[\"colaDestino\"] = event.target.value;\n\n gestor.addLogs(new Log(log));\n\n peticionManager.updatePeticion(peticion, gestor.getPeticiones()[0].getIdPeticion(), 'evalExistAnexo');\n}", "function totales()\n{\n var subtotal = 0;\n var total = 0.00;\n var totalcantidad = 0;\n var subcantidad = 0;\n var total_dinero = 0;\n var total_cantidad = 0;\n var sub_exento=0;\n $(\"#inventable>tbody tr\").each(function()\n {\n var compra = $(this).find(\".precio_compra\").val();\n var unidad = $(this).find(\".unidad\").val();\n var venta = $(this).find(\".precio_venta\").val();\n var cantidad = parseInt($(this).find(\".cant\").val());\n var vence = $(this).find(\".vence\").val();\n var exento = parseInt($(this).find(\".exento\").val());\n console.log(cantidad);\n if (isNaN(cantidad) == true)\n {\n cantidad = 0;\n }\n subtotal = compra * cantidad;\n\n totalcantidad += cantidad;\n if (isNaN(subtotal) == true)\n {\n subtotal = 0;\n }\n\n if(exento==1)\n {\n sub_exento=sub_exento+subtotal;\n }\n else\n {\n total += subtotal;\n }\n\n });\n if (isNaN(total) == true)\n {\n total = 0;\n }\n sumas_sin_iva=total;\n sumas_sin_iva=round(total, 2);\n\n if(isNaN(sub_exento))\n {\n sub_exento=0;\n }\n\n tipo_doc=$('#tipo_doc').val();\n\n percepcion = $('#percepcion').val();\n\n var monto_percepcion = $('#monto_percepcion').val();\n var iva = $('#porc_iva').val();\n\n total_percepcion=0;\n iva = round((total * iva), 4);\n sub_exento = round(sub_exento, 2);\n\n if (total >= monto_percepcion)\n total_percepcion = round((total * percepcion), 4);\n\n total += total_percepcion;\n if(tipo_doc=='CCF')\n {\n total += iva;\n }\n else\n {\n iva=0;\n\n }\n\n\n total+= sub_exento;\n total_dinero =parseFloat(total).toFixed(2);\n /*if(total_dinero=='0'){\n total_dinero=\"0.00\";\n }else{\n total_dinero=total_dinero =parseFloat(total).toFixed(2);;\n }*/\n total_cantidad = round(totalcantidad,2);\n $('#totcant').html(total_cantidad);\n $('#sumas_sin_iva').html(round(sumas_sin_iva,2));\n $('#subtotal').html(round((sumas_sin_iva+iva), 2));\n $('#iva').html(round(iva,2));\n $('#venta_exenta').html(sub_exento);\n $('#total_percepcion').html(round(total_percepcion, 2));\n $('#total_dinero').html(total_dinero);\n $('#totaltexto').load('compras.php?' + 'process=total_texto&total=' + total_dinero);\n}", "function CalConceptos() {\n datos = {\n \"id_radica\": 0\n };\n var route = \"/traeconceptos\";\n var token = $(\"#token\").val();\n var type = 'GET';\n __ajax(route, token, type, datos)\n .done(function(info) {\n var conceptos = info.conceptos;\n var res = 0;\n for (item in conceptos) {\n res = parseInt($(\"#total\" + conceptos[item].id_concep).val()) + res;\n }\n $(\"#totalconceptos\").html(formatNumbderechos(Math.round(res)));\n $(\"#totalconcept\").val(res);\n })\n\n\n /***************NOTE:IVA CONCEPTOS*******************/\n var id_tar = 9; //NOTE:Tarifa Iva\n var datos = {\n \"id_tar\": id_tar\n };\n var route = \"/tarifas\";\n var token = $(\"#token\").val();\n var type = 'GET';\n __ajax(route, token, type, datos)\n .done(function(info) {\n var iva = info.porcentajeiva / 100;\n var totaliva = $(\"#totalconcept\").val() * iva;\n totaliva = parseFloat($(\"#totiva\").val()) + totaliva;\n $(\"#totaliva\").html(formatNumbderechos(Math.round(totaliva)));\n var totalrecaudos = 0;\n totalrecaudos = totaliva + parseFloat($(\"#totrecsuper\").val()) +\n parseFloat($(\"#totrecfondo\").val()) + parseFloat($(\"#totrtf\").val()) +\n parseFloat($(\"#totreteconsumo\").val()) + \n parseFloat($(\"#totaporteespecial\").val()) + \n parseFloat($(\"#total_impuesto_timbre\").val());\n \n $(\"#totalrecaudos\").html(formatNumbderechos(Math.round(totalrecaudos)));\n $(\"#totrecaudos\").val(totalrecaudos);\n $(\"#totivacompleto\").val(totaliva);\n var grantotal = 0;\n grantotal = parseFloat($(\"#totderechos\").val()) + parseFloat($(\"#totrecaudos\").val()) +\n parseFloat($(\"#totalconcept\").val());\n $(\"#grantotal\").html(formatNumbderechos(Math.round(grantotal)));\n $(\"#grantot\").val(grantotal);\n })\n}", "function calcularPerimetroCuadrado(){\n const input = document.getElementById('inputCuadrado');\n const value = input.value;\n\n const perimetro = perimetroCuadrado(value);\n alert('El perimétro del cuadrado es: ' + perimetro);\n}", "function procesoPrecio(){\n\n var getMinimo = minimo.slice(-1);\n var getMaximo = maximo.slice(-1);\n \nif(getMinimo != 0 && getMaximo != 0){\n formdata.append(\"minimo\",getMinimo);\n formdata.append(\"maximo\",getMaximo);\n}\n}", "function perevod(money, currency, crypt)\n{\n //console.log(CURRENCY_DATA[crypt][currency])\n var result = money*0.9/CURRENCY_DATA[crypt][currency]\n $(\"#result\").attr(\"value\", result)\n}", "function buscarFechaProximaCalibracion() {\r\n\t\r\n\tvar d = new Date();\r\n let month = String(d.getMonth() + 1);\r\n let day = String(d.getDate());\r\n const year = String(d.getFullYear());\r\n \r\n if (month.length < 2) month = '0' + month;\r\n if (day.length < 2) day = '0' + day;\r\n var anio = year.toString().substring(2);\r\n\r\n var fpcx = `${month}/${day}/${anio}`;\r\n\t\r\n\t $.ajax({\r\n\t url:baseURL + \"pages/VerificarProcesosVencidos/BuscarFechaProxCalibracion\",\r\n\t type:'post',\r\n\t async:false,\r\n\t data:{\r\n\t \tfechaProximaCalibracion: fpcx\r\n\t },\r\n\t beforeSend:muestraLoading,\r\n\t success:function(data){\r\n\t \t\r\n\t ocultaLoading();\r\n\t $.each(data.filas, function( index, value ) {\r\n\t \tvar idEquipo = value.idEquipoCertificado;\r\n\t \t\r\n\t \t//alert(\"EL EQUIPO CON EL ID \"+ idEquipo + \", HOY ES LA FECHA DE PROXIMA CALIBRACION\");\r\n\t \t\r\n\t \t$.ajax({\r\n\t url:baseURL + \"pages/VerificarProcesosVencidos/EditarEstadoEquipoCertificado\",\r\n\t type:'POST',\r\n\t async:false,\r\n\t data:{\r\n\r\n\t \tid: idEquipo,\r\n\t \testado:\t\t\t\t \"I\",\r\n\t \tidTipoMotivo:\t\t \"1491\",\r\n\t \tobservacion:\t\t \"Cambio automatico realizado por el sistema\"\r\n\t },\r\n\t beforeSend:muestraLoading,\r\n\t success:function(data){\r\n\t ocultaLoading();\r\n\t if(data.resultado==\"0\"){ \r\n\t \t$('#MensajeFinalCron1').html(\"EQUIPOS CON PROXIMA FECHA DE CALIBRACION, VERIFICADO CON EXITO...\");\r\n\t }\r\n\t },\r\n\t error:errorAjax\r\n\t \t});\t\r\n\t \t \r\n\t });\r\n\t },\r\n\t error:errorAjax\r\n\t });\r\n}" ]
[ "0.69221264", "0.691029", "0.66571826", "0.6635655", "0.65938306", "0.6586226", "0.6525497", "0.6522207", "0.6504812", "0.6486524", "0.6456231", "0.6447204", "0.64306766", "0.6379339", "0.63753706", "0.6370662", "0.63400877", "0.63332224", "0.63327044", "0.6323712", "0.6317626", "0.6293875", "0.6284101", "0.62821937", "0.62563306", "0.6251442", "0.6249064", "0.62460405", "0.6243742", "0.6231757", "0.62055206", "0.6193621", "0.6177706", "0.61762923", "0.6169935", "0.6169395", "0.61573696", "0.6151677", "0.6148714", "0.6144027", "0.61431944", "0.60992634", "0.60945874", "0.60945255", "0.6093675", "0.60932803", "0.6089899", "0.6075051", "0.60744417", "0.6065338", "0.6061401", "0.6060225", "0.60393333", "0.6036428", "0.6032433", "0.6029353", "0.60239226", "0.60206616", "0.60204893", "0.60014886", "0.59996396", "0.59956205", "0.5989979", "0.5986527", "0.597918", "0.59770685", "0.5969499", "0.596429", "0.59632194", "0.5963063", "0.5962614", "0.59616953", "0.59578717", "0.5950723", "0.5947639", "0.5947383", "0.5944995", "0.5944089", "0.5939386", "0.5937234", "0.59331775", "0.59303427", "0.5929036", "0.5918948", "0.5913765", "0.5912718", "0.59084094", "0.5904335", "0.5903718", "0.58998704", "0.5883223", "0.5881354", "0.58769214", "0.5860706", "0.58594656", "0.5856867", "0.5852282", "0.58512443", "0.584988", "0.58474743" ]
0.61425966
41
Funcion Tipo de Base
function TipoDeBase(){ var selec= document.getElementById("cmbBases").value; var Temperatura = document.getElementById("temperatura").value; var carpetaAsfal = document.getElementById('espesorCarpAs').value; //Base Granular var g2=(-9.75931139328379E-17*Math.pow(Temperatura,9))+(5.46986907807787E-14*Math.pow(Temperatura,8))+(-1.27654962067594E-11*Math.pow(Temperatura,7))+(1.58864156551974E-09*Math.pow(Temperatura,6))+(-1.1023753410111E-07*Math.pow(Temperatura,5))+(3.76645182242896E-06*Math.pow(Temperatura,4))+(-6.53196229905006E-06*Math.pow(Temperatura,3))+(-0.00407329228255549*Math.pow(Temperatura,2))+(0.123821446090005*Temperatura)+(0.000495264121354921); var g4=(-1.19715687597883E-16*Math.pow(Temperatura,9))+(6.79683571074634E-14*Math.pow(Temperatura,8))+(-1.60371776893476E-11*Math.pow(Temperatura,7))+(2.0109845212668E-09*Math.pow(Temperatura,6))+(-1.39768070117618E-07*Math.pow(Temperatura,5))+(4.71830866821676E-06*Math.pow(Temperatura,4))+(-3.37913871817364E-06*Math.pow(Temperatura,3))+(-0.00521489431412192*Math.pow(Temperatura,2))+(0.149310492735822*Temperatura)+(0.000428946767669913); var g8=(-7.50532015925703E-17*Math.pow(Temperatura,9))+(4.60559688217666E-14*Math.pow(Temperatura,8))+(-1.17563329134641E-11*Math.pow(Temperatura,7))+(1.59756213119477E-09*Math.pow(Temperatura,6))+(-1.20932032943166E-07*Math.pow(Temperatura,5))+(4.55586268444108E-06*Math.pow(Temperatura,4))+(-2.08575530109556E-05*Math.pow(Temperatura,3))+(-0.00468997049392783*Math.pow(Temperatura,2))+(0.14747257163981*Temperatura)+(0.000354921151597409); var g12=(-3.97208981691757E-17*Math.pow(Temperatura,9))+(2.82342417162375E-14*Math.pow(Temperatura,8))+(-8.15889925607528E-12*Math.pow(Temperatura,7))+(1.23533836632328E-09*Math.pow(Temperatura,6))+(-1.03286285635384E-07*Math.pow(Temperatura,5))+(4.33938206434448E-06*Math.pow(Temperatura,4))+(-0.000035185010801797*Math.pow(Temperatura,3))+(-0.00417231872415869*Math.pow(Temperatura,2))+(0.14392283334746*Temperatura)+(0.000308782636238902); //Base Tratada Por Cemento var c2=(-4.15310099556024E-17*Math.pow(Temperatura,9))+(2.62622743173115E-14*Math.pow(Temperatura,8))+(-6.92666125737089E-12*Math.pow(Temperatura,7))+(9.76354528475776E-10*Math.pow(Temperatura,6))+(-7.7207082727071E-08*Math.pow(Temperatura,5))+(3.10215372678613E-06*Math.pow(Temperatura,4))+(-2.27882734407103E-05*Math.pow(Temperatura,3))+(-0.00299030349196983*Math.pow(Temperatura,2))+(0.106457175686955*Temperatura)+(0.000500063442871124); var c4=(2.59127222627986E-17*Math.pow(Temperatura,9))+(-7.03767350978749E-15*Math.pow(Temperatura,8))+(-3.45853147553157E-13*Math.pow(Temperatura,7))+(3.26213264734143E-10*Math.pow(Temperatura,6))+(-4.58844016115734E-08*Math.pow(Temperatura,5))+(2.69893461890547E-06*Math.pow(Temperatura,4))+(-4.66467863020625E-05*Math.pow(Temperatura,3))+(-0.0020598167211574*Math.pow(Temperatura,2))+(0.0982200116850436*Temperatura)+(0.000428806348963917); var c8=(2.95215822351919E-17*Math.pow(Temperatura,9))+(-8.20861037376417E-15*Math.pow(Temperatura,8))+(-3.1408641692262E-13*Math.pow(Temperatura,7))+(3.57151756086305E-10*Math.pow(Temperatura,6))+(-5.07102067004439E-08*Math.pow(Temperatura,5))+(2.96892653928182E-06*Math.pow(Temperatura,4))+(-4.98725004263179E-05*Math.pow(Temperatura,3))+(-0.00230019488662947*Math.pow(Temperatura,2))+(0.105814001726685*Temperatura)+(0.000345136123030443); var c12=(3.10255979038948E-17*Math.pow(Temperatura,9))+(-7.95009115370183E-15*Math.pow(Temperatura,8))+(-6.29136947074595E-13*Math.pow(Temperatura,7))+(4.26954924540035E-10*Math.pow(Temperatura,6))+(-5.75614386155721E-08*Math.pow(Temperatura,5))+(3.27351174611579E-06*Math.pow(Temperatura,4))+(-5.21425059218927E-05*Math.pow(Temperatura,3))+(-0.00259911620742059*Math.pow(Temperatura,2))+(0.114594311249675*Temperatura)+(0.000306507428604164); if (Temperatura!=68) { if (selec == 1) { if(carpetaAsfal >= 0 && carpetaAsfal <=2) {//0 a 2 var total = (g2 -1)/2+1; document.getElementById("FactorCorrec").value=total.toFixed(7); document.getElementById('tipoBase').innerHTML = 'G'+carpetaAsfal; }else if (carpetaAsfal >= 2 && carpetaAsfal <=4) {//2 a 4 var total = (((g4 -g2)*(carpetaAsfal-2))/2)+g2; document.getElementById("FactorCorrec").value=total.toFixed(7); document.getElementById('tipoBase').innerHTML = 'G'+carpetaAsfal; }else if (carpetaAsfal >= 4 && carpetaAsfal <=8) {//4 a 8 var total = (((g8 -g4)*(carpetaAsfal-4))/4)+g4; document.getElementById("FactorCorrec").value=total.toFixed(7); document.getElementById('tipoBase').innerHTML = 'G'+carpetaAsfal; }else if (carpetaAsfal >= 8 && carpetaAsfal <=12) {//8 a 12 var total = (((g12 -g8)*(carpetaAsfal-8))/4)+g8; document.getElementById("FactorCorrec").value=total.toFixed(7); document.getElementById('tipoBase').innerHTML = 'G'+carpetaAsfal; } }else if (selec == 2) { if(carpetaAsfal >= 0 && carpetaAsfal <=2) { var total = (c2 -1)/2+1; document.getElementById("FactorCorrec").value=total.toFixed(7); document.getElementById('tipoBase').innerHTML = 'G'+carpetaAsfal; }else if (carpetaAsfal >= 2 && carpetaAsfal <=4) { var total = (((c4 -c2)*(carpetaAsfal-2))/2)+c2; document.getElementById("FactorCorrec").value=total.toFixed(7); document.getElementById('tipoBase').innerHTML = 'G'+carpetaAsfal; }else if (carpetaAsfal >= 4 && carpetaAsfal <=8) { var total = (((c8 -c4)*(carpetaAsfal-4))/4)+c4; document.getElementById("FactorCorrec").value=total.toFixed(7); document.getElementById('tipoBase').innerHTML = 'G'+carpetaAsfal; }else if (carpetaAsfal >= 8 && carpetaAsfal <=12) { var total = (((c12 -c8)*(carpetaAsfal-8))/4)+c8; document.getElementById("FactorCorrec").value=total.toFixed(7); document.getElementById('tipoBase').innerHTML = 'G'+carpetaAsfal; } } }else if (Temperatura==68) { document.getElementById("FactorCorrec").value=1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Base() {}", "function Base() {\n}", "function inherit(){}", "function UHRBase() {\n\n}", "function UHRBase() {\n\n}", "function Base() {\n }", "function heredaDe(prototipoHijo, prototipoPadre) { // Esta es una funcion que recibe funciones\n var fn = function () {} // Creamos una funcion vacia\n fn.prototype = prototipoPadre.prototype // Hacemos una copia del prototipo del Padre para guardarlo en el protitipo de nuestra funcion vacia\n prototipoHijo.prototype = new fn // De esa forma evitamos acceder directamente a la funcion y no la pizamos\n prototipoHijo.prototype.constructor = prototipoHijo //Asignamos la funcion constructora\n //Si no agregamos la ultima linea se estaria llamando al constructor de prototipo padre\n}", "function heredaDe(prototipoHijo, prototipoPadre){\n var fn = function () {}\n fn.prototype = prototipoPadre.prototype\n prototipoHijo.prototype = new fn\n //asignamos la funcion constructora de la clase claseHija\n prototipoHijo.prototype.constructor = prototipoHijo\n}", "function RgbaBase() {\n\n}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function addBase(id,name,type){\n return {\n _id: id, // identification arrays\n _name: name,\n _type: type,\n _textureName:`i${id}`,\n description:$GameString.itemsId[id],\n rateFound: { //stastitiques indiquer au joueur drop sur monstre et planet ex: monster1:\"5:14\"35% (sur x rencontre, trouver x fois)\n monster:{},\n planet:{},\n },\n };\n }", "metodoAbstrato(){\n throw new Error(\"Este é um método abstrato e portanto não pode ser instanciado pelo objeto Conta\")\n }", "function miFuncion (){}", "setBase(x,y) {\n this.base.create(x, y, \"baseE\");\n }", "function Generica(param) {\n console.log(\"El tipo es: \" + typeof (param));\n return param;\n}", "addBase(arg, callback) {\n\t\tvar current_dt = getDateTime();\n\t\tconsole.log('base cont : ' + JSON.stringify(arg))\n\t\tvar frm_data = arg;\n\t\tdb.get(\"SELECT * FROM base_mast WHERE bname = '\" + frm_data.base_name + \"' \", function (err, row) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log(err.message);\n\t\t\t}\n\t\t\tconsole.log('Error : ' + JSON.stringify(row))\n\t\t\tif (!row) {\n\t\t\t\tdb.run(\"INSERT INTO base_mast (bname,uentdt) VALUES (?,?)\", [frm_data.base_name, current_dt], function (err) {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tcallback(err.message);\n\t\t\t\t\t}\n\t\t\t\t\tcallback('1');\n\t\t\t\t})\n\t\t\t\t//callback('2');\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tcallback('2');\n\t\t\t}\n\n\n\t\t})\n\n\n\t}", "function inherited() { }", "function Derived() {} // private", "function BaseClass() {}", "function BaseClass() {}", "function Type() {\r\n}", "function CNodeBase() {\n\n}", "function Base(fn) {\n name = this.getFnName(fn);\n this.fn = fn;\n this.name = name;\n }", "function heredaDe(prototipoHijo, prototipoPadre) {\n var fn = function() {};\n fn.prototype = prototipoPadre.prototype;\n prototipoHijo.prototype = new fn;\n prototipoHijo.prototype.constructor = prototipoHijo;\n}", "function CNodeBase() {\r\n\r\n}", "function Interfaz(){}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function superClass(...args) {}", "function Type() {}", "initCustomFunctions() {/*To be overridden in sub class as needed*/}", "function SegmentBase() {\n}", "function RequestBase(obj) {\n\t if (obj) return mixin(obj);\n\t}", "function RequestBase(obj) {\n\t if (obj) return mixin(obj);\n\t}", "function RequestBase(obj) {\n\t if (obj) return mixin(obj);\n\t}", "function RequestBase(obj) {\n\t if (obj) return mixin(obj);\n\t}", "function RequestBase(obj) {\n\t if (obj) return mixin(obj);\n\t}", "function addBase(base) {\n\n return (num) => {\n\n // console.log('BaseValue', base)\n \n // console.log('NewValue', num)\n \n return base + num;\n }\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function RequestBase(obj) {\n if (obj) return mixin(obj);\n}", "function Type() {\n}", "function Oo(){}", "function definir_bases()\r\n{\r\n if(bebida_escolhida == BEBIDA.COCA)\r\n bases_refri = BASES_COCA;\r\n else if(bebida_escolhida == BEBIDA.PEPSI)\r\n bases_refri = BASES_PEPSI;\r\n}", "function super(_type, _object) {\n //TODO: Validar que sea una instancia a subclase del tipo dado\n //TODO: soportar distintos tipos incluso el mismo tipo de la base que le pase el primero de __bases__\n var obj = {};\n if (type(_object) == Function) {\n if (_type && issubclass(_object, _type))\n var base = _type.__base__;\n else if (!_type)\n var base = window.object;\n else\n var base = _type;\n } else {\n if (isinstance(_object, _type))\n var base = _type.prototype;\n else\n throw new TypeError('Nonno');\n }\n var object = _object;\n obj.__noSuchMethod__ = function(name, args) {\n if (args[args.length - 1] && args[args.length - 1] instanceof Arguments)\n return base[name].apply(_object, args.slice(0, -1).concat(args[args.length -1].argskwargs));\n else\n return base[name].apply(_object, args);\n };\n return obj;\n }", "function inheritFrom(subfn,superfn) {\n\tvar r = function () {}\n\tr.prototype = superfn.prototype;\n\tsubfn.prototype = new r();\n}", "static getActionByType(type,obj){\n return {\n type:type,\n name:obj.name||\"增删改查\",\n id:obj.id||\"-1\",\n index:obj.index\n }\n }", "getType(){return this.__type}", "function oi(){}", "function ea(){}", "getType(){\n console.log(\"Needs an override\");\n }", "get base() {\n\t\treturn this.__base;\n\t}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function Common(){}", "constructor(type) {\n super()\n this.type = type \n }", "get_type(){\n return this.type;\n }", "isBase() {\n return isBase(this.unitList);\n }", "function base (_entity) {\n entity = _entity;\n return methods;\n }", "function LightType() {}", "function LoggerBase(){\n\n\t}", "getType() {}", "constructor(prix, type, proprietaire, nbALouer, nbAVendre, nbEtage){\n super(prix, type, proprietaire) //appeler le constructor de la class mere\n this.nbALouer = nbALouer\n this.nbAVendre = nbAVendre\n this.nbEtages = nbEtages\n }", "static FindObjectOfType() {}", "static FindObjectOfType() {}", "static FindObjectOfType() {}", "static FindObjectOfType() {}", "static FindObjectOfType() {}", "static FindObjectOfType() {}", "function BaseElement() {\n }", "function Mobilmodern(nama,tahun_keluar){\n let mobil = Object.create(methodMobil) //* Terbaca sebagai Prototype di console log, inilah yang akan jadi cikal bakal class pada javascript\n mobil.nama = nama, \n mobil.tahun_keluar = tahun_keluar,\n mobil.bensin = 100\n\n return mobil\n}", "function ResponseBase() {}", "function o(){}", "function __func(){}", "function make(base) {\n return Base.make.apply(base, slice.call(arguments, 1)) }" ]
[ "0.6532928", "0.6197199", "0.60917866", "0.5872962", "0.5872962", "0.5781031", "0.5775686", "0.57492447", "0.5748079", "0.57284015", "0.57284015", "0.57284015", "0.57158786", "0.5667755", "0.5624914", "0.5551917", "0.55508125", "0.5547337", "0.55472785", "0.55345565", "0.552604", "0.552604", "0.5502853", "0.54997677", "0.54906577", "0.54810065", "0.5467674", "0.54336685", "0.54254407", "0.54254407", "0.54230833", "0.53944427", "0.53942966", "0.5388818", "0.53412986", "0.53412986", "0.53412986", "0.53412986", "0.53412986", "0.5312665", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5306652", "0.5295812", "0.5264776", "0.5262863", "0.52507496", "0.5247372", "0.52447903", "0.5239489", "0.52296484", "0.52227235", "0.5217695", "0.52106625", "0.51706254", "0.51706254", "0.51706254", "0.51706254", "0.51588446", "0.5156582", "0.51432824", "0.5142296", "0.51241356", "0.5117206", "0.5106027", "0.5101808", "0.5093126", "0.5092378", "0.5092378", "0.5092378", "0.5092378", "0.5092378", "0.5092378", "0.5078796", "0.50766534", "0.50655276", "0.5065012", "0.5051057", "0.504826" ]
0.0
-1
Shares the Etherpad name with other participants.
function shareEtherpad() { connection.emuc.addEtherpadToPresence(etherpadName); connection.emuc.sendPresence(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shareEtherpad() {\n APP.xmpp.addToPresence(\"etherpad\", etherpadName);\n}", "assignGuestName (socket, guestNumber, nickNames, namesUsed) {\n const name = `Guest_${guestNumber}`;\n nickNames[socket.id] = name;\n socket.emit('nameResult', {\n success: true,\n name\n });\n namesUsed.push(name);\n return guestNumber + 1;\n }", "function assignGuestName(socket, guestNumber, nickNames, namesUsed) {\n // Genera un nuovo guest name\n var name = 'Ospite_' + guestNumber;\n // Associa al nuovo nome l' ID della connessione\n nickNames[socket.id] = name;\n // Comunica all'utente il suo nome\n socket.emit('nameResult', {\n success : true,\n name : name\n });\n\n // Inserisci nella lista namesUsed il nuovo nome generato in maniera tale che non sia\n // più utilizzato\n\n namesUsed.push(name);\n // Incrementa la variabile guestNumber per generare un nuovo nome in futuro\n return guestNumber + 1;\n\n}", "function shareHostId(){\t\t\n\t\tif (tokbox.getHost_id.call() != \"\") {\n\t\t\tsocket.emit('host_id', {\n\t\t\t\thost_id: tokbox.getHost_id.call()\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tsetTimeout(function(){\n\t\t\t\tshareHostId();\n\t\t\t}, 1000);\n\t\t}\n\t\t\n\t}", "sendToMember(data) {\n\t\t// extract necessary data\n\t\tlet text = data.text.split(\" \");\n\n\t\tconst receiver = Array.from(this.members).filter(\n\t\t\t(user) => user.name === text[1]\n\t\t)[0];\n\t\tconst sender = Array.from(this.members).filter(\n\t\t\t(user) => user.name === data.name\n\t\t)[0];\n\n\t\tif (receiver) {\n\t\t\tdata.text = text.slice(2).join(\" \");\n\t\t\tdata.otherName = text[1];\n\t\t\treceiver.send(JSON.stringify(data));\n\t\t\tsender.send(JSON.stringify(data));\n\t\t} else {\n\t\t\tdata.text = `Unfortunately either ${text[1]} left the room or not in the room at the moment`;\n\t\t\tdata.name = \"Server\";\n\t\t\tsender.send(JSON.stringify(data));\n\t\t}\n\t}", "_signalOtherPeeer() {\n console.log('Signal other peer');\n const propseId = shortid.generate();\n this.setRemotePeerId(propseId);\n SocketService.getInstance().send({\n\t\t\ttype: SOCKET_MESSAGE_TYPES.PEER_SIGNAL,\n\t\t\tpeerData: {\n\t\t\t\tsignal: this._rawLocalDescription,\n toUser: this._user,\n fileModel: this._fileModel,\n remotePeerId: this._id,\n propseId\n\t\t\t}\n\t\t}, SOCKET_EVENTS.MESSAGE);\n\t}", "addPeer() {\n const {\n updateSessionPeers,\n }= this.props;\n\n const peerEmail = this.peerinput.value;\n const reviewer = this.getPeerObject(peerEmail);\n\n updateSessionPeers(reviewer);\n }", "function formatSharedKey(sk) {\n return sk.toUpperCase()\n .replace(/...../g, function (match, orig) { return match + ' '; });\n}", "function attachAddress (address) {\n semaphore.take(() => {\n iota.api.sendTransfer(seed, 3, 14, [{\"address\": address, \"value\": 0, \"message\": \"\", \"tag\": \"\"}], (error, transfers) => {\n semaphore.leave()\n if(transfers){\n console.log(address + ' - ' + transfers[0].hash)\n } else {\n console.log(error)\n console.log('trying again')\n attachAddress(address)\n }\n })\n })\n}", "function transferLetterOne() {\n const index = Math.floor(Math.random() * letterPool.length);\n const letter = letterPool[index];\n setLettersOne({\n type: 'add',\n value: letter\n })\n setLetterPool({\n type: 'remove',\n value: letter\n })\n }", "getPointerAccount(namespace) {\n var passphrase = nem.crypto.js.SHA256(namespace);\n var privateKey = nem.crypto.helpers.derivePassSha(passphrase, 1).priv; \n var keyPair = nem.crypto.keyPair.create(privateKey); \n var publicKey = keyPair.publicKey.toString();\n var address = nem.model.address.toAddress(publicKey, this._Wallet.network);\n this.formData.pointerAdd = address;\n this.formData.recipient = address;\n this.formData.recipientPublicKey = publicKey;\n }", "function transferLetterTwo() {\n const index = Math.floor(Math.random() * letterPool.length);\n const letter = letterPool[index];\n setLettersTwo({\n type: 'add',\n value: letter\n })\n setLetterPool({\n type: 'remove',\n value: letter\n })\n }", "function assignGuestName(socket, guestNumber, nickNames, namesUsed) {\n //Set the user guest name and push it into an array\n var name = 'Guest'+guestNumber;\n nickNames[socket.id] = name;\n\n //Tell the users they are in a new room\n socket.emit('nameResult', {\n success: true,\n name: name\n });\n\n //Pus the user's name a list of used names\n namesUsed.push(name);\n return guestNumber + 1;\n}", "function setCardNicknames(cardSectionSelector, cardDigitsSelector, cardNameSelector) {\n const cardNames = document.querySelectorAll(cardSectionSelector);\n\n chrome.storage.sync.get(['cardData'], (result) => {\n const {cardData} = result;\n cardNames.forEach((card) => {\n const cardName = card.querySelector(cardNameSelector);\n\n const cardLastFour = card.querySelector(cardDigitsSelector).textContent;\n const cardLastFourHash = forge_sha256( formatCardDigits(cardLastFour) );\n \n const cardNickname = cardData[cardLastFourHash];\n\n if(cardNickname) {\n cardName.textContent = cardNickname;\n }\n\n })\n })\n\n}", "function winnerName() {\n if(winnerAddress === myAddress) {\n return \"Me\";\n }\n if(winnerAddress === oppAddress) {\n return \"Opponent\";\n }\n }", "function namestatus() {\n //alert('hi')\n web3 = new Web3(new Web3.providers.HttpProvider(\"http://localhost:8545\"));\n web3.eth.defaultAccount = web3.eth.accounts[];\n\n function namehash(name) {\n var node = '0x0000000000000000000000000000000000000000000000000000000000000000';\n if (name !== '') {\n var labels = name.split(\".\");\n for(var i = labels.length - 1; i >= 0; i--) {\n node = web3.sha3(node + web3.sha3(labels[i]).slice(2), {encoding: 'hex'});\n }\n }\n return node.toString();\n}\n\n\n///START OF ENSUTILS-TEST.JS Script////////////////////////////////////////\nvar ensContract = web3.eth.contract([\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"resolver\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"owner\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"label\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"owner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"setSubnodeOwner\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"ttl\",\n \"type\": \"uint64\"\n }\n ],\n \"name\": \"setTTL\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"ttl\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint64\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"resolver\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"setResolver\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"owner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"setOwner\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"owner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"Transfer\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": true,\n \"name\": \"label\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"owner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"NewOwner\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"resolver\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"NewResolver\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"ttl\",\n \"type\": \"uint64\"\n }\n ],\n \"name\": \"NewTTL\",\n \"type\": \"event\"\n }\n]);\nvar ens = ensContract.at('0x112234455c3a32fd11230c42e7bccd4a84e02010');\n\nvar auctionRegistrarContract = web3.eth.contract([\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"releaseDeed\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"getAllowedTime\",\n \"outputs\": [\n {\n \"name\": \"timestamp\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"unhashedName\",\n \"type\": \"string\"\n }\n ],\n \"name\": \"invalidateName\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"owner\",\n \"type\": \"address\"\n },\n {\n \"name\": \"value\",\n \"type\": \"uint256\"\n },\n {\n \"name\": \"salt\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"shaBid\",\n \"outputs\": [\n {\n \"name\": \"sealedBid\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"bidder\",\n \"type\": \"address\"\n },\n {\n \"name\": \"seal\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"cancelBid\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"entries\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint8\"\n },\n {\n \"name\": \"\",\n \"type\": \"address\"\n },\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n },\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n },\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"ens\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"_value\",\n \"type\": \"uint256\"\n },\n {\n \"name\": \"_salt\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"unsealBid\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"transferRegistrars\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n },\n {\n \"name\": \"\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"sealedBids\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"state\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint8\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"newOwner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"transfer\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"_timestamp\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"isAllowed\",\n \"outputs\": [\n {\n \"name\": \"allowed\",\n \"type\": \"bool\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"finalizeAuction\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"registryStarted\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"sealedBid\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"newBid\",\n \"outputs\": [],\n \"payable\": true,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"labels\",\n \"type\": \"bytes32[]\"\n }\n ],\n \"name\": \"eraseNode\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_hashes\",\n \"type\": \"bytes32[]\"\n }\n ],\n \"name\": \"startAuctions\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"deed\",\n \"type\": \"address\"\n },\n {\n \"name\": \"registrationDate\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"acceptRegistrarTransfer\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"startAuction\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"rootNode\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"hashes\",\n \"type\": \"bytes32[]\"\n },\n {\n \"name\": \"sealedBid\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"startAuctionsAndBid\",\n \"outputs\": [],\n \"payable\": true,\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"name\": \"_ens\",\n \"type\": \"address\"\n },\n {\n \"name\": \"_rootNode\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"_startDate\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"type\": \"constructor\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"registrationDate\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"AuctionStarted\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": true,\n \"name\": \"bidder\",\n \"type\": \"address\"\n },\n {\n \"indexed\": false,\n \"name\": \"deposit\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"NewBid\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": true,\n \"name\": \"owner\",\n \"type\": \"address\"\n },\n {\n \"indexed\": false,\n \"name\": \"value\",\n \"type\": \"uint256\"\n },\n {\n \"indexed\": false,\n \"name\": \"status\",\n \"type\": \"uint8\"\n }\n ],\n \"name\": \"BidRevealed\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": true,\n \"name\": \"owner\",\n \"type\": \"address\"\n },\n {\n \"indexed\": false,\n \"name\": \"value\",\n \"type\": \"uint256\"\n },\n {\n \"indexed\": false,\n \"name\": \"registrationDate\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"HashRegistered\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"HashReleased\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": true,\n \"name\": \"name\",\n \"type\": \"string\"\n },\n {\n \"indexed\": false,\n \"name\": \"value\",\n \"type\": \"uint256\"\n },\n {\n \"indexed\": false,\n \"name\": \"registrationDate\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"HashInvalidated\",\n \"type\": \"event\"\n }\n]);\nvar ethRegistrar = auctionRegistrarContract.at(ens.owner(namehash('eth')));\n\nvar deedContract = web3.eth.contract([\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"creationDate\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [],\n \"name\": \"destroyDeed\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"newOwner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"setOwner\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"registrar\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"value\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"previousOwner\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"owner\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"newValue\",\n \"type\": \"uint256\"\n },\n {\n \"name\": \"throwOnFailure\",\n \"type\": \"bool\"\n }\n ],\n \"name\": \"setBalance\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"refundRatio\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"closeDeed\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"newRegistrar\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"setRegistrar\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"name\": \"_owner\",\n \"type\": \"address\"\n }\n ],\n \"payable\": true,\n \"type\": \"constructor\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": false,\n \"name\": \"newOwner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"OwnerChanged\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [],\n \"name\": \"DeedClosed\",\n \"type\": \"event\"\n }\n]);\n\nvar fifsRegistrarContract = web3.eth.contract([\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"ens\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"expiryTimes\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"subnode\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"owner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"register\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"rootNode\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"name\": \"ensAddr\",\n \"type\": \"address\"\n },\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"type\": \"constructor\"\n }\n]);\nvar testRegistrar = fifsRegistrarContract.at(ens.owner(namehash('test')));\n\nvar resolverContract = web3.eth.contract([\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"interfaceID\",\n \"type\": \"bytes4\"\n }\n ],\n \"name\": \"supportsInterface\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"bool\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"contentTypes\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"ABI\",\n \"outputs\": [\n {\n \"name\": \"contentType\",\n \"type\": \"uint256\"\n },\n {\n \"name\": \"data\",\n \"type\": \"bytes\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"x\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"y\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"setPubkey\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"content\",\n \"outputs\": [\n {\n \"name\": \"ret\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"addr\",\n \"outputs\": [\n {\n \"name\": \"ret\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"contentType\",\n \"type\": \"uint256\"\n },\n {\n \"name\": \"data\",\n \"type\": \"bytes\"\n }\n ],\n \"name\": \"setABI\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"name\",\n \"outputs\": [\n {\n \"name\": \"ret\",\n \"type\": \"string\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"name\",\n \"type\": \"string\"\n }\n ],\n \"name\": \"setName\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"setContent\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"pubkey\",\n \"outputs\": [\n {\n \"name\": \"x\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"y\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"addr\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"setAddr\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"name\": \"ensAddr\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"constructor\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"a\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"AddrChanged\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"ContentChanged\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"name\",\n \"type\": \"string\"\n }\n ],\n \"name\": \"NameChanged\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": true,\n \"name\": \"contentType\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"ABIChanged\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"x\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"y\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"PubkeyChanged\",\n \"type\": \"event\"\n }\n]);\nvar publicResolver = resolverContract.at('0x4c641fb9bad9b60ef180c31f56051ce826d21a9a');\n\n\nvar reverseRegistrarContract = web3.eth.contract([\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"owner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"claim\",\n \"outputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"ens\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"addr\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"node\",\n \"outputs\": [\n {\n \"name\": \"ret\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"rootNode\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"name\": \"ensAddr\",\n \"type\": \"address\"\n },\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"constructor\"\n }\n]);\nvar reverseRegistrar = reverseRegistrarContract.at(ens.owner(namehash('addr.reverse')));\n\nfunction getAddr(name) {\n var node = namehash(name)\n var resolverAddress = ens.resolver(node);\n if (resolverAddress === '0x0000000000000000000000000000000000000000') {\n return resolverAddress;\n }\n return resolverContract.at(resolverAddress).addr(node);\n}\n\nfunction getContent(name) {\n var node = namehash(name)\n var resolverAddress = ens.resolver(node);\n if (resolverAddress === '0x0000000000000000000000000000000000000000') {\n return \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n }\n return resolverContract.at(resolverAddress).content(node);\n}\n\n\n///////////////////END OF ENSUTILS-TEST.js SCRIPT////////////////////\n\n alert(\"default Account:\" + web3.eth.defaultAccount)\n //alert(ethRegistrar.entries(web3.sha3('name'))[0])\n alert(ethRegistrar.entries(web3.sha3(name)))\n\n\n\n\n 'use strict';\n var name = document.getElementById (\"namesrch\");\n var x = ensutils.ethRegistrar.entries(web3.sha3(name))[0]; output = \"\";\n //x = ENSresponse;\n// ENS registrar returns status as an integer between 0 and 5\n \nfunction namestatus(){}\n if (x === 0) {\n output = \"Name is available and the auction hasn’t started!\";\n } else if (x === 1) {\n output = \" Name is available and the auction has been started\";\n } else if (x === 2) {\n output = \"Name is taken and currently owned by someone\";\n } else if (x === 3) {\n output = \"Name is forbidden\";\n } else if (x === 4) {\n output = \"Name is currently in the ‘reveal’ stage of the auction\";\n } else if (x === 5) {\n output = \"Name is not yet available due to the ‘soft launch’ of names.\";\n } else {\n output = \"unknown status\";\n }\n document.getElementById(\"namestatus\").innerHTML = \"<h3><b>\" + output + \"</b></h3>\";\n}", "function transmitAppName() {\n let options = {\n showName: false,\n manufacturer: ESPRUINO_COMPANY_CODE,\n manufacturerData: JSON.stringify({ name: APP_ID }),\n interval: 2000\n }\n\n NRF.setAdvertising({}, options);\n}", "function initTogetherJS() {\n if (typeof TogetherJS === \"undefined\") {\n return;\n }\n\n if (togetherjsInUrl) {\n $(\"#ssDiv\").hide(); // hide ASAP!\n $(\"#togetherjsStatus\").html(\"Please wait ... loading shared session\");\n }\n\n\n // clear your name from the cache every time to prevent privacy leaks\n if (supports_html5_storage()) {\n localStorage.removeItem('togetherjs.settings.name');\n }\n\n\n // This event triggers when you first join a session and say 'hello',\n // and then one of your peers says hello back to you. If they have the\n // exact same name as you, then change your own name to avoid ambiguity.\n // Remember, they were here first (that's why they're saying 'hello-back'),\n // so they keep their own name, but you need to change yours :)\n TogetherJS.hub.on(\"togetherjs.hello-back\", function(msg) {\n // do NOT use a msg.sameUrl guard since that will miss some signals\n // due to our funky URLs\n\n var p = TogetherJS.require(\"peers\");\n\n var peerNames = p.getAllPeers().map(function(e) {return e.name});\n\n if (msg.name == p.Self.name) {\n var newName = undefined;\n var toks = msg.name.split(' ');\n var count = Number(toks[1]);\n\n // make sure the name is truly unique, incrementing count as necessary\n do {\n if (!isNaN(count)) {\n newName = toks[0] + ' ' + String(count + 1); // e.g., \"Tutor 3\"\n count++;\n }\n else {\n // the original name was something like \"Tutor\", so make\n // newName into, say, \"Tutor 2\"\n newName = p.Self.name + ' 2';\n count = 2;\n }\n } while ($.inArray(newName, peerNames) >= 0); // i.e., is newName in peerNames?\n\n p.Self.update({name: newName}); // change our own name\n }\n });\n\n TogetherJS.hub.on(\"updateOutput\", function(msg) {\n // do NOT use a msg.sameUrl guard since that will miss some signals\n // due to our funky URLs\n\n if (isExecutingCode) {\n return;\n }\n\n if (myVisualizer) {\n // to prevent this call to updateOutput from firing its own TogetherJS event\n updateOutputSignalFromRemote = true;\n try {\n myVisualizer.renderStep(msg.step);\n }\n finally {\n updateOutputSignalFromRemote = false;\n }\n }\n });\n\n TogetherJS.hub.on(\"executeCode\", function(msg) {\n // do NOT use a msg.sameUrl guard since that will miss some signals\n // due to our funky URLs\n\n if (isExecutingCode) {\n return;\n }\n\n executeCodeSignalFromRemote = true;\n try {\n executeCode(msg.forceStartingInstr, msg.rawInputLst);\n }\n finally {\n executeCodeSignalFromRemote = false;\n }\n\n });\n\n TogetherJS.hub.on(\"hashchange\", function(msg) {\n // do NOT use a msg.sameUrl guard since that will miss some signals\n // due to our funky URLs\n\n if (isExecutingCode) {\n return;\n }\n\n console.log(\"TogetherJS RECEIVE hashchange\", msg.appMode);\n if (msg.appMode != appMode) {\n updateAppDisplay(msg.appMode);\n\n if (appMode == 'edit' && msg.codeInputScrollTop !== undefined &&\n pyInputGetScrollTop() != msg.codeInputScrollTop) {\n // hack: give it a bit of time to settle first ...\n $.doTimeout('pyInputCodeMirrorInit', 200, function() {\n pyInputSetScrollTop(msg.codeInputScrollTop);\n });\n }\n }\n });\n\n TogetherJS.hub.on(\"codemirror-edit\", function(msg) {\n // do NOT use a msg.sameUrl guard since that will miss some signals\n // due to our funky URLs\n $(\"#codeInputWarnings\").hide();\n $(\"#someoneIsTypingDiv\").show();\n\n $.doTimeout('codeMirrorWarningTimeout', 1000, function() { // debounce\n $(\"#codeInputWarnings\").show();\n $(\"#someoneIsTypingDiv\").hide();\n });\n });\n\n TogetherJS.hub.on(\"requestSync\", function(msg) {\n // do NOT use a msg.sameUrl guard since that will miss some signals\n // due to our funky URLs\n\n if (TogetherJS.running) {\n TogetherJS.send({type: \"myAppState\",\n myAppState: getAppState(),\n codeInputScrollTop: pyInputGetScrollTop(),\n pyCodeOutputDivScrollTop: myVisualizer ?\n myVisualizer.domRoot.find('#pyCodeOutputDiv').scrollTop() :\n undefined});\n }\n });\n\n TogetherJS.hub.on(\"myAppState\", function(msg) {\n // do NOT use a msg.sameUrl guard since that will miss some signals\n // due to our funky URLs\n\n // if we didn't explicitly request a sync, then don't do anything\n if (!togetherjsSyncRequested) {\n return;\n }\n\n togetherjsSyncRequested = false;\n\n var learnerAppState = msg.myAppState;\n\n if (learnerAppState.mode == 'display') {\n if (appStateEq(getAppState(), learnerAppState)) {\n // update curInstr only\n console.log(\"on:myAppState - app states equal, renderStep\", learnerAppState.curInstr);\n myVisualizer.renderStep(learnerAppState.curInstr);\n\n if (msg.pyCodeOutputDivScrollTop !== undefined) {\n myVisualizer.domRoot.find('#pyCodeOutputDiv').scrollTop(msg.pyCodeOutputDivScrollTop);\n }\n }\n else if (!isExecutingCode) { // if already executing from a prior signal, ignore\n console.log(\"on:myAppState - app states unequal, executing\", learnerAppState);\n syncAppState(learnerAppState);\n\n executeCodeSignalFromRemote = true;\n try {\n if (msg.pyCodeOutputDivScrollTop !== undefined) {\n pendingCodeOutputScrollTop = msg.pyCodeOutputDivScrollTop; // NASTY global\n }\n executeCode(learnerAppState.curInstr);\n }\n finally {\n executeCodeSignalFromRemote = false;\n }\n }\n }\n else {\n assert(learnerAppState.mode == 'edit');\n if (!appStateEq(getAppState(), learnerAppState)) {\n console.log(\"on:myAppState - edit mode sync\");\n syncAppState(learnerAppState);\n enterEditMode();\n }\n }\n\n if (msg.codeInputScrollTop !== undefined) {\n // give pyInputAceEditor a bit of time to settle with\n // its new value. this is hacky; ideally we have a callback function for\n // when setValue() completes.\n $.doTimeout('pyInputCodeMirrorInit', 200, function() {\n pyInputSetScrollTop(msg.codeInputScrollTop);\n });\n }\n });\n\n TogetherJS.hub.on(\"syncAppState\", function(msg) {\n syncAppState(msg.myAppState);\n });\n\n TogetherJS.hub.on(\"codeInputScroll\", function(msg) {\n // do NOT use a msg.sameUrl guard since that will miss some signals\n // due to our funky URLs\n\n // don't sync for Ace since I can't get it working properly yet\n });\n\n TogetherJS.hub.on(\"pyCodeOutputDivScroll\", function(msg) {\n // do NOT use a msg.sameUrl guard since that will miss some signals\n // due to our funky URLs\n\n if (myVisualizer) {\n myVisualizer.domRoot.find('#pyCodeOutputDiv').scrollTop(msg.scrollTop);\n }\n });\n\n $(\"#sharedSessionBtn\").click(startSharedSession);\n $(\"#stopTogetherJSBtn\").click(TogetherJS); // toggles off\n\n // fired when TogetherJS is activated. might fire on page load if there's\n // already an open session from a prior page load in the recent past.\n TogetherJS.on(\"ready\", function () {\n console.log(\"TogetherJS ready\");\n\n $(\"#sharedSessionDisplayDiv\").show();\n $(\"#adInfo\").hide();\n $(\"#ssDiv\").hide();\n $(\"#adHeader\").hide();\n\n // send this to the server for the purposes of logging, but other\n // clients shouldn't do anything with this data\n if (TogetherJS.running) {\n TogetherJS.send({type: \"initialAppState\",\n myAppState: getAppState(),\n user_uuid: supports_html5_storage() ? localStorage.getItem('opt_uuid') : undefined,\n // so that you can tell whether someone else\n // shared a TogetherJS URL with you to invite you\n // into this shared session:\n togetherjsInUrl: togetherjsInUrl});\n }\n\n requestSync(); // immediately try to sync upon startup so that if\n // others are already in the session, we will be\n // synced up. and if nobody is here, then this is a NOP.\n\n TogetherjsReadyHandler(); // needs to be defined in each frontend\n redrawConnectors(); // update all arrows at the end\n });\n\n // emitted when TogetherJS is closed. This is not emitted when the\n // webpage simply closes or navigates elsewhere, ONLY when TogetherJS\n // is explicitly stopped via a call to TogetherJS()\n TogetherJS.on(\"close\", function () {\n console.log(\"TogetherJS close\");\n\n $(\"#togetherjsStatus\").html(''); // clear it\n $(\"#sharedSessionDisplayDiv\").hide();\n $(\"#adInfo\").show();\n $(\"#ssDiv\").show();\n $(\"#adHeader\").show();\n\n TogetherjsCloseHandler(); // needs to be defined in each frontend\n redrawConnectors(); // update all arrows at the end\n });\n}", "function broadcast(event,data,from,roomname,to){\n var username = _.findWhere(peoples,{socket:from});\n\n debug('peoples send is '+from+'\\n to '+roomname,username);\n //TODO broadcast to all client\n var keyList = (to == undefined)?keys:to;\n\n for(var index in keyList){\n var dataEncrypt = encrypt(data,index);\n\n if(username == null){\n io.sockets.connected[index].emit(event,dataEncrypt);\n }else{\n var usernames = encrypt(username,index);\n var roomEncrypt = encrypt(roomname,index);\n io.sockets.connected[index].emit(event,dataEncrypt,usernames,roomEncrypt);\n }\n }\n\n\n\n}", "linkSocketToPlayer(socket, name) {\n this.players[name].socketId = socket.id;\n this.socketNames[socket.id] = name;\n this.host = this.host === null ? socket.id : this.host;\n }", "async function transferNameOwnership(connection, name, newOwner, nameClass, nameParent) {\n const hashed_name = await utils_2.getHashedName(name);\n const nameAccountKey = await utils_2.getNameAccountKey(hashed_name, nameClass, nameParent);\n let curentNameOwner;\n if (nameClass) {\n curentNameOwner = nameClass;\n }\n else {\n curentNameOwner = (await state_1.NameRegistryState.retrieve(connection, nameAccountKey)).owner;\n }\n const transferInstr = instructions_1.transferInstruction(exports.NAME_PROGRAM_ID, nameAccountKey, newOwner, curentNameOwner, nameClass);\n return transferInstr;\n}", "sendPad(data) {\n this.broadcastLobby({ cmd: 'pad', ...data }, true);\n }", "function sharing(data){\n\n\tvar ccid = data.changingCard.id\n\twindow[data.changingCard.cardholder].thisCard = undefined;\n\twindow[data.changingCard.cardholder].innerHTML = '';\n\tcard[ccid].location = data.location\n\n\tif (data.location === 'table'){\n\t\tcard[ccid].cardholder = 'tCh'+data.i;\n\t}\n\telse if (data.location === 'one') {\n\t\tcard[ccid].cardholder = 'oneCh'+data.i;\n\t}\n\telse if (data.location === 'two') {\n\t\tcard[ccid].cardholder = 'twoCh'+data.i;\n\t}\n\telse if (data.location === 'three') {\n\t\tcard[ccid].cardholder = 'threeCh'+data.i;\n\t}\n\telse if (data.location === 'four') {\n\t\tcard[ccid].cardholder = 'fourCh'+data.i;\n\t}\n\n\tkimiShuffle();\n}", "function connectPlayerOther(data) {\n let player = components.PlayerRemote();\n player.initialize(data);\n playerOthers[data.clientId] = player;\n activePlayerCount++;\n }", "function saveUserAddress(device, wallet) {\n db.query(`INSERT INTO xwf_obyfit_user_challenge (device, wallet)\n VALUES (?,?)`, [device, wallet]);\n device.sendMessageToDevice(device, 'text', 'Your address is saved');\n device.sendMessageToDevice(device, 'text', \"Please send me your google id\");\n //toPlay.stackGame(device_address, wallet_address); // ask user to play\n}", "function combine_hwaddr(hwaddr_name, split) {\n\tvar obj;\n\tvar mac = \"\";\n\tvar empty = \"\";\n\tvar tmp;\n\tfor (i=0;i<6;i++) {\n\t\tobj = get_by_name(hwaddr_name)[i];\n\t\tobj.value = obj.value.toUpperCase();\n\t\ttmp = obj.value;\n\t\tif (tmp.length == 1)\n\t\t\tobj.value = '0' + obj.value;\n\t\tmac += obj.value;\n\t\tif (i<5)\n\t\t\tif (split)\n\t\t\t\tmac += split;\n\t\t\telse\n\t\t\t\tmac += \":\";\n\t}\n\tif (split)\n\t\tfor (i=0;i<5;i++)\n\t\t\tempty += split;\n\t\t\n\tif (mac == \":::::\" || mac == empty)\n\t\tmac = \"\";\n\treturn mac;\n}", "initiate_key_exchange(recipients, offchain=0, peer=null) {\n\n let recipient = \"\";\n let parties_to_exchange = 2;\n\n if (Array.isArray(recipients)) {\n if (recipients.length > 0) {\n recipients.sort();\n recipient = recipients[0];\n parties_to_exchange = recipients.length;\n }\n else {\n recipient = recipients;\n parties_to_exchange = 2;\n }\n } else {\n recipient = recipients;\n parties_to_exchange = 2;\n }\n\nconsole.log(\"recipient is: \" + recipient);\n if (recipient == \"\") { return; }\n\n let tx = this.app.wallet.createUnsignedTransactionWithDefaultFee(recipient, (parties_to_exchange * this.app.wallet.wallet.default_fee));\n\n //\n // we had an issue creating the transaction, try zero-fee\n //\n if (!tx) {\nconsole.log(\"zero fee tx creating...\");\n tx = this.app.wallet.createUnsignedTransaction(recipient, 0.0, 0.0);\n }\n\n tx.msg.module = this.name;\n tx.msg.request = \"key exchange request\";\n tx.msg.alice_publickey = this.app.keys.initializeKeyExchange(recipient);\n\n //\n // does not currently support n > 2\n //\n if (parties_to_exchange > 2) {\n for (let i = 1; i < parties_to_exchange; i++) {\n tx.transaction.to.push(new saito.slip(recipients[i], 0.0));\n }\n }\n\n tx = this.app.wallet.signTransaction(tx);\n\n if (offchain == 0) {\n this.app.network.propagateTransaction(tx);\n } else {\n let data = {};\n data.module = \"Encrypt\";\n\t data.tx = tx;\nconsole.log(\"sending request on network\");\n this.app.network.sendPeerRequest(\"diffie hellman key exchange\", data, peer);\n }\n this.saveEncrypt();\n\n }", "function action_shareBoardToEmail(){\n var toEmail = $('#input-shareEmail').val();\n if(toEmail == \"\") {\n return;\n }\n\n outConsole(\"Share Board ID\", shareBoardID);\n\n var boardData = boardList.find(function(oneBoard) {\n return oneBoard.id === shareBoardID;\n });\n\n if(boardData) {\n var dataObj = {\n from: userSelf.email,\n to: toEmail\n };\n shareBoardUser = toEmail;\n shareBoardContent = boardData;\n socket.emit('shareBoardToEmail', dataObj);\n $('#shareStatus').text(\"Sending invite to the email...\");\n }\n else {\n $('#shareStatus').text(\"Failed to share!\");\n }\n}", "function TellOurName(name : String, info : NetworkMessageInfo){\n\tvar netPlayer : NetworkPlayer = info.sender;\n\tif(netPlayer+\"\"==\"-1\"){\n\t\t//This hack is required to fix the local players networkplayer when the RPC is sent to itself.\n\t\tnetPlayer=Network.player;\n\t}\n\t\n\tvar newEntry : FPSPlayerNode = new FPSPlayerNode();\n\tnewEntry.playerName=name;\n\tnewEntry.networkPlayer=netPlayer;\n\tplayerList.Add(newEntry);\n\t\n\tif(Network.isServer){\n\t\tchatScript.addGameChatMessage(name+\" joined the game\");\n\t}\n}", "function setUsername() {\n const name = document.getElementById(\"name\").value;\n myUsername = name;\n\n var msg = {\n name,\n date: Date.now(),\n id: clientID,\n type: \"username\"\n };\n connection.send(JSON.stringify(msg));\n}", "function join() {\n var roomName = roomField.value\n , userName = userField.value\n\n roomStore.set(\"room-name\", roomName)\n roomStore.set(\"user-name\", userName)\n\n roomField.value = \"\"\n userField.value = \"\"\n\n room.emit(\"join\", roomName, userName)\n}", "sendJoke(name, data) {\n\t\tlet member = Array.from(this.members).filter((user) => user.name === name);\n\t\tmember[0].send(JSON.stringify(data));\n\t}", "function SarahTransferToRoom() {\n\tSarahLeaveRoom();\n\tCharacterRelease(Sarah);\n\tInventoryWear(Sarah, \"CollegeOutfit1\", \"Cloth\");\n\tInventoryWear(Sarah, \"CollegeSkirt\", \"ClothLower\");\n\tInventoryWear(Sarah, \"Socks4\", \"Socks\", \"#AAAAAA\");\n\tInventoryWear(Sarah, \"Shoes2\", \"Shoes\", \"#222222\");\n\tInventoryAdd(Player, \"StuddedBlindfold\", \"ItemHead\");\n\tCommonSetScreen(\"Room\", \"Private\");\n\tPrivateAddCharacter(Sarah, null, true);\n\tvar C = PrivateCharacter[PrivateCharacter.length - 1];\n\tC.Trait = [];\n\tNPCTraitSet(C, \"Submissive\", 70);\n\tNPCTraitSet(C, \"Violent\", 50);\n\tNPCTraitSet(C, \"Horny\", 40);\n\tNPCTraitSet(C, \"Dumb\", 20);\n\tNPCTraitSet(C, \"Playful\", 90);\n\tC.Love = 20;\n\tif (Sarah.Owner == Player.Name) {\n\t\tNPCEventAdd(C, \"NPCCollaring\", CurrentTime);\n\t\tInventoryWear(C, \"SlaveCollar\", \"ItemNeck\");\n\t\tC.Owner = Player.Name;\n\t\tC.Love = 100;\n\t}\n\tif (Player.Lover == \"NPC-Sarah\") {\n\t\tNPCEventAdd(C, \"Girlfriend\", CurrentTime);\n\t\tC.Lover = Player.Name;\n\t\tC.Love = 100;\n\t}\n\tif (LogQuery(\"AmandaSarahLovers\", \"NPC-AmandaSarah\")) C.Lover = \"NPC-Amanda\";\n\tNPCTraitDialog(C);\n\tServerPrivateCharacterSync();\n}", "function Socket_SetName(nickname) {\n socket.emit('setName', nickname)\n}", "function onSendClicked() {\n var target=vw.getPeerName();// NOT from mc.userParams.targetUsername, so that you can chat and speak with different users \n if ( ! target) {\n //vw.showAlert(\"Peer user name required\");\n alert(\"Peer user name required\");\n return false;\n }\n var msg = {\n text: vw.getTextInp(),\n type: \"message\",\n id: up.clientID,\n date: Date.now(),\n user: up.user,\n }; \n //alert(target);\n if (target) msg.target=target;\n signallingConnection.sendRelay(msg);\n vw.clearTextInp();\n}", "async sign() {\n const { room, storage } = this.swap\n\n this.storage.update({\n isSignFetching: true,\n })\n\n await this.ethSwap.sign(\n {\n myAddress: storage.data.me.ethData.address,\n participantAddress: storage.data.participant.eth.address,\n },\n (signTransactionUrl) => {\n this.storage.update({\n signTransactionUrl,\n })\n }\n )\n\n this.storage.update({\n isSignFetching: false,\n isMeSigned: true,\n })\n\n room.sendMessage(storage.data.participant.peer, [\n {\n event: 'swap:signed',\n data: {\n orderId: storage.data.id,\n },\n },\n ])\n\n const { isMeSigned, isParticipantSigned } = this.storage.data\n\n if (isMeSigned && isParticipantSigned) {\n this.finishStep()\n }\n }", "static async sendEtherAction (senderAddress, senderPrivateKey, receiverAddress, sendAmount) {\n let privateKey = Buffer.from(senderPrivateKey, 'hex')\n // Get the neccessary information to create raw transaction\n let nonce = await EtherscanServices.getNounce(senderAddress)\n let gasPrice = await EtherscanServices.getGasPrice()\n // gasPrice *= countPercent\n let gasLimit = await this.getGasLimit(receiverAddress)\n let value = new BigNumber(this.convertBalanceToWei(sendAmount))\n value = '0x' + value.toString(16)\n\n let data = ''\n // Create raw transaction\n gasPrice = parseFloat(gasPrice.toFixed(0))\n let rawTransaction = {\n nonce: nonce,\n gasPrice: '0x' + gasPrice.toString(16),\n gasLimit: '0x' + gasLimit.toString(16),\n to: receiverAddress,\n value: value,\n data: data\n }\n // Create transaction and sign with private key\n var transaction = new EthereumTx(rawTransaction)\n transaction.sign(privateKey)\n\n // Serialize and convert transaction to hex\n let serializedTransaction = transaction.serialize()\n let hexSerializedTransaction = '0x' + serializedTransaction.toString('hex')\n return EtherscanServices.sendRawTransaction(hexSerializedTransaction)\n }", "function sendToEsp(serialData, name) {\n\n try {\n\n\n var port = ESPCLIENTS[name].port\n var host = ESPCLIENTS[name].ip\n\n\n\n // error checking\n if (port == \"\" || host == \"\") {\n console.log(\"user key fob is not connected to udp server\")\n throw \"err\"\n }\n\n // login status checking\n else if (serialData == \"Authenticated\") {\n LoggedIn.add(name)\n }\n else if (serialData == \"Denied\" && LoggedIn.has(name)) {\n LoggedIn.delete(name)\n }\n\n //send message to esp\n server.send(serialData, port, host,function(error){\n if(error) {\n console.log('ERROR: Sending ' + serialData + ' Signal to ESP.');\n }\n else {\n console.log('- Sending ' + serialData + ' to ESP: ' + port + ':' + host);\n }\n });\n \n\n }\n catch {\n console.log(\"no one with the name: \"+ name + \" connected to udp server\")\n }\n}", "function makeId() {\n //create an id from praxis number, username and suffix\n //complete version\n vm.setId = praxis+''+vm.name+''+vm.ownId;\n console.log('Setting own id from '+vm.setId+' to '+vm.ownId);\n //send complete peer id to all clients\n socket.emit('update:pid', vm.setId);\n }", "function sendOffer(){\n\tconsole.log('offer sent')\n\tconsole.log(peerID);\n\tsignalServer.send(JSON.stringify({\"sessionDescriptionProtocol\": peerConnection[currentPeer].localDescription, \"peerID\": peerID, \"senderID\": senderID, \"sendTo\": currentPeer}));\n}", "transfer(fromAddress, toAddress, amountETH, privateKey) { \n throw new Error('You must implement this method')\n }", "function setName(name) {\n socket.emit('setName', name);\n}", "function register(bytes32 mySystemID) {\n if(keysWallet[mySystemID].mySystemID == 0 && mySystemID != \"\"){\n keysWallet[mySystemID].ethereum = msg.sender;\n }\n }", "function TellOurName(name : String,info : NetworkMessageInfo){\n\tvar netPlayer : NetworkPlayer = info.sender;\n\tif(netPlayer+\"\"==\"-1\"){\n\t\t//This hack is required to fix the local players networkplayer when the RPC is sent to itself.\n\t\tnetPlayer=Network.player;\n\t}\n\tDebug.Log(\"NetworkPlayer: \"+netPlayer.ToString());\n\t\n\tvar newEntry : FPSPlayerNode = new FPSPlayerNode();\n\tnewEntry.playerName=name;\n\tnewEntry.networkPlayer=netPlayer;\n\tfor (var i=0;i<10;i=i+1){\n\t\tif (playerNumbers[i]==0){\n\t\t\tplayerNumbers[i]=1;\n\t\t\tplayerID=i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tnewEntry.playerID=playerID;\n\tplayerList.Add(newEntry);\n\t\n\tnetworkView.RPC(\"clearLists\",RPCMode.Others);\n\t\n\tfor(var entry : FPSPlayerNode in playerList as List.<FPSPlayerNode>){\n\t\tnetworkView.RPC(\"sendList\",RPCMode.Others,entry.networkPlayer,entry.playerName,entry.playerID,entry.kills,entry.deaths,entry.mode);\n\t}\t\n\t\n\tif(Network.isServer){\n\t\tchatScript.addGameChatMessage(name+\" joined the game\");\n\t}\n}", "function peer_register(socket, msg)\n{\n\tlet id = jwk2id(msg.jwk);\n\tlet name = words(\"0x\" + id);\n\n\t// sanitize the room name to only be normal characters\n\tconst room = msg.room;\n\tif ((/[^-\\w]/.test(room))) {\n\t\tconsole.log(name + \": invalid room name\", room);\n\t\treturn;\n\t}\n\n\tif (socket.key)\n\t{\n\t\t// disconnect the old key (and update the room if\n\t\t// the room has changed)\n\t\tpeer_disconnect(socket, room != socket.room);\n\t}\n\n\tsocket.join(room);\n\tsocket.room = room;\n\tsocket.name = name;\n\tsocket.key = msg.jwk;\n\n\tif (!(room in peers))\n\t\tpeers[room] = {};\n\n\tpeers[room][name] = msg.jwk;\n\n\tconsole.log(room + ': register', name);\n\n\tio.to(room).emit('peers', Object.values(peers[room]));\n\tconsole.log(room + ': peers', Object.keys(peers[room]));\n}", "handleNameChangeAttempts (socket, nickNames, namesUsed) {\n socket.on('nameAttempt', (name) => {\n if (name.toLowerCase().startsWith('guest')) {\n socket.emit('nameResult', {\n success: false,\n message: 'Names cannot begin with \"Guest\"'\n });\n } else {\n if (!namesUsed.includes(name)) {\n const prevName = nickNames[socket.id];\n const prevNameIdx = namesUsed.indexOf(prevName);\n nickNames[socket.id] = name;\n namesUsed = [\n ...namesUsed.slice(0, prevNameIdx),\n ...namesUsed.slice(prevNameIdx + 1),\n name\n ];\n socket.emit('nameResult', {\n success: true,\n name\n });\n socket.broadcast.to(currentRoom[socket.id]).emit('message', {\n text: `${prevName} is now known as ${name}.`\n });\n } else {\n socket.emit('nameResult', {\n success: false,\n message: 'That name is already in use.'\n });\n }\n }\n });\n }", "function saveName() {\n\n localStorage.setItem('receivedName', userName);\n}", "setName(address, name) {\n name = name.length > 16 ? name.substr(0, 16) : name;\n models.Account.findOne({\n where: {\n address,\n sid: this.sid\n }\n }).then((account) => {\n if (account) {\n account.name = name;\n this.finishLogin(account);\n }\n });\n }", "function BroadcastParty(party_index, action) {\n if (Parties[party_index]) {\n console.log(Parties[party_index]);\n\n var party = {\n 'id' : Parties[party_index].id,\n 'name' : Parties[party_index].name,\n 'index' : Parties[party_index].index,\n 'host' : Parties[party_index].host,\n 'open' : Parties[party_index].open,\n 'nbRound' : Parties[party_index].nbRound,\n 'token' : Parties[party_index].token,\n 'players' : [],\n 'rolled' : Parties[party_index].rolled,\n };\n var playersList = [];\n\n Parties[party_index].players.forEach(function (player) {\n if (player.name !== ''){\n playersList.push(player.getId());\n }\n });\n\n party.players = playersList;\n\n var message = JSON.stringify({\n 'action' : action,\n 'data' : party\n });\n\n Parties[party_index].players.forEach(function (player) {\n player.connection.sendUTF(message);\n });\n }\n}", "function joinGame (evt) {\r\n let instance = getInstance ();\r\n let sender = web3.eth.accounts[0];\r\n console.log (\"calling joinGame\");\r\n instance.joinGame (\r\n { from : sender, gas : 200000 },\r\n function (error, result) { \r\n if (!error) {\r\n console.log (result.toString ());\r\n } else {\r\n console.error (error); \r\n }\r\n }\r\n ); \r\n}", "function VerifySharedPPTName()\n{\n LogMessage(\"DataCollabTest :: VerifySharedPPTName\");\n var selfDisplayName = GetTestCaseParameters(\"DisplayName1\");\n var presenterName = GetBuddyDisplayName(0);\n var pptName1 = GetPPTName();\n var pptName2 = GetPPTName();\n \n //Share PPT from Bot\n GotoMyInfo();\n SetNote(\"VerifySharedPPTName \" + pptName1 + \" \" + pptName2);\n \n AceptRejectCallToast(AcceptString);\t\n \n //Confirm that conference join is successful\n WaitForCallToGetConnected();\n\n WaitForCollabPane();\n VerifyPPTName(pptName1);\n WaitForContentToBeLoaded();\n \n //Ask bot to stop PPT1\n SendStopPPTMessage(selfDisplayName);\n \n try\n {\n var messageToRecieve = presenterName + \" - \" + \"PPT Sharing Stopped\";\n messageToRecieve = messageToRecieve.split(\" \").join(\" \");\n VerifyReceivedIM(GetBuddyDisplayName(0), messageToRecieve);\n }\n catch(error)\n {}\n DelayInSec(5);\n \n //Ask bot to share another PPT\n SendStartPPTMessage(selfDisplayName);\n \n WaitForCollabPane();\n VerifyPPTName(pptName2);\n \n //Ask bot to stop PPT2\n SendStopPPTMessage(selfDisplayName);\n \n EndConversation();\n \n}", "function senderCheck(){\n var sender = $('#sender3').val().trim().toUpperCase();\n localStorage.setItem(\"senderName\", sender);\n}", "function shareLink(groupID) {\n share.setAttribute(\"value\", `https://jus-watch.web.app/invite.html?${groupID}`); // *** need to change to hosted link \n nominateBtn.addEventListener(\"click\", function (e) {\n e.preventDefault;\n window.location.href = `nominate.html?${groupID}`;\n })\n voteBtn.addEventListener(\"click\", function (e) {\n e.preventDefault;\n window.location.href = `vote.html?${groupID}`;\n })\n chatBtn.addEventListener(\"click\", function (e) {\n e.preventDefault;\n window.location.href = `group-msgs.html?${groupID}`;\n })\n}", "function pairSystems(req, res) {\n\n console.log(\"PAIRING\");\n\n var data = JSON.parse(req.body.qrcode);\n\n if (data.auth) {\n if (!verifyAuth(data.signee_key, data.auth)) {\n console.log(\"[!!!] ERROR: Pairing failed due to incorrect authentication!\");\n console.log(\"[!!!] --> Keep old shared key\");\n\n crypt_log(\"Pairing\", 'authentication failed', '');\n return;\n }\n }\n\n var dh = crypto.createECDH('secp521r1');\n var signer_key = dh.generateKeys('hex', 'compressed');\n\n var shared_key = dh.computeSecret(data.signee_key, 'hex', 'hex');\n\n var dh_exchange = {};\n dh_exchange['signer_key'] = signer_key;\n\n if (SHARED_KEY != \"\") {\n dh_exchange['auth'] = generateAuthToken(signer_key);\n }\n\n SHARED_KEY = shared_key;\n console.log(SHARED_KEY);\n\n fs.writeFileSync(constant.SECRET_KEYPATH + 'auth_key', SHARED_KEY);\n\n res.json(dh_exchange);\n\n}", "async function main(){\n \n const bobChain = new KeyChain( )\n\n await bobChain.open()\n \n await bobChain.generateKey({\n email: '[email protected]',\n name: 'Bob bob',\n unattend: true,\n })\n\n const who = await bobChain.whoami()\n console.log('bob whoami',who)\n\n const bobPub = await bobChain.exportPublicKey(who[0])\n console.log(bobPub)\n\n const aliceChain = new KeyChain()\n\n await aliceChain.open()\n\n await aliceChain.generateKey({\n email: '[email protected]',\n name: 'Alice alice',\n unattend: true,\n })\n\n const imported = await aliceChain.importKey(bobPub)\n console.log('imported', imported)\n\n await aliceChain.trustKey(imported[0], '3')\n await aliceChain.signKey(imported[0])\n\n const secrets = await aliceChain.listSecretKeys(false)\n console.log('secrets', secrets)\n\n const other = await aliceChain.whoami()\n console.log('alice whoami',other)\n\n const alicePub = await aliceChain.exportPublicKey(other[0])\n\n const bobImported = await bobChain.importKey(alicePub)\n\n await bobChain.trustKey(bobImported[0], '3')\n await bobChain.signKey(bobImported[0])\n\n\n\n let toEmails = ['[email protected]']\n\n\n const enc = await bobChain.encrypt('hello world', who.concat(toEmails), who[0])\n console.log('encrypt -', enc)\n\n const dec = await aliceChain.decrypt(enc, {from: '[email protected]'})\n console.log('decrypt -', dec.toString())\n\n return\n}", "function AddPlayerOnJoin(player)\n{\n jcmp.players.forEach((p) =>\n {\n if (p.c && p.c.ready && p.friends && p.networkId != player.networkId)\n {\n const data = {\n name: player.c.general.name,\n id: player.networkId,\n level: player.c.exp.level,\n steam_id: player.c.general.steam_id,\n ping: player.client.ping,\n friend_status: p.is_friends(player.c.general.steam_id) ? \"Friends\" : \n p.friends_has_invited(player.c.general.steam_id) ? \"Pending\" : \n p.friends_was_requested(player.c.general.steam_id) ? \"Requested\" : \"None\",\n color: player.c.general.color\n };\n\n if (player.tag && player.tag.name && player.tag.color)\n {\n data.tag = \n {\n tagname: player.tag.name,\n tagcolor: player.tag.color\n }\n }\n\n jcmp.events.CallRemote('friends/network/add_entry', p, JSON.stringify(data));\n }\n })\n}", "function saveNickName() {\n localStorage.setItem('receivedNickName', userNickName); //1st argument is a keyword to get the info, 2nd argument - info that has to be rememeber \n userNickName = localStorage.getItem('receivedNickName');\n}", "sendAllMembers(name, data) {\n\t\tlet member = Array.from(this.members).filter((user) => user.name === name);\n\t\tconst memNames = [];\n\t\tfor (let member of this.members) {\n\t\t\tmember.name === name ? memNames.push(\"you\") : memNames.push(member.name);\n\t\t}\n\t\tdata.text = \"In room: \".concat(memNames.join(\",\"));\n\t\tmember[0].send(JSON.stringify(data));\n\t}", "function joinGame() {\n let userName = gameNameInput.value;\n if (checkUserName(userName)) {\n if (userName === \"\") {\n userName = \"$guest\";\n }\n const code = gameCodeInput.value;\n if (code == \"\") {\n sock.emit('newGame', userName);\n } else {\n sock.emit('joinGame', code, userName);\n }\n } else {\n gameNameInput.value = \"\";\n }\n}", "sameAs(other) {\n return other.address === this.address && other.name === this.name;\n }", "function wishlist_ui_share(emailList) {\n\tvar emailString = \"\";\n\tfor (var i = 0; i < emailList.length; i++) {\n\t\temailString = emailList[i] + \", \" + emailString;\n\t}\n\temailString = emailString.substring(0, emailString.length-2);\n\t$(\"#alreadySharedWith\").html(emailString);\n}", "function encryptWithFriendsPublic() {\n encryptFriendsPublic();\n}", "function sendName() {\n\tvar clientMsg = document.getElementById('enterName');\n\tif (clientMsg.value) {\n\t\tPlayerName = clientMsg.value;\n\t\tvar data = JSON.stringify({\n\t\t\t'newName' : $(\"#enterName\").val()\n\t\t})\n\t\tsocketConn.send(data);\n\t\tdocument.getElementById('title').innerHTML = \"Welcome to the Quest of The Round Table - \"\n\t\t\t\t+ clientMsg.value + \"'s View\";\n\t\tchangeColor();\n\t\tdocument.getElementById('nameparagraph').style.display = \"none\";\n\t\tdocument.getElementById('send').style.display = \"none\";\n\t\tdocument.getElementById('rigger').style.display = \"none\";\n\t\tdocument.getElementById('riggerAI').style.display = \"none\";\n\t\tvar serverMsg = document.getElementById('serverMsg');\n\t\tserverMsg.value = \"> waiting for other players \\n> to create AI player(s), open a new browser window and click AI Player button\";\n\t}\n}", "setWalletName(store, { name }) {}", "function associateUsername(username) {\n USERNAME = username;\n addSystemMessage(textElement('Your username is:'), usernameElement(username));\n}", "async function testTokenSend(token_to_ota_addr, token_to_ota, stamp, stampHoderKeystore, tokenHoderKeystore) {\n console.log(\"testTokenSend...\");\n let cxtInterfaceCallData = TokenInstance.otatransfer.getData(token_to_ota_addr, token_to_ota, 888);\n\n let otaSet = web3.wan.getOTAMixSet(stamp, 8);\n console.log(\"fetch ota stamp set: \",otaSet);\n\n let otaSetBuf = [];\n for(let i=0; i<otaSet.length; i++){\n let rpkc = new Buffer(otaSet[i].slice(2,68),'hex');\n let rpcu = secp256k1.publicKeyConvert(rpkc, false);\n otaSetBuf.push(rpcu);\n }\n\n let otaSk = wanUtil.computeWaddrPrivateKey(stamp, stampHoderKeystore.privKeyA,stampHoderKeystore.privKeyB);\n let otaPub = wanUtil.recoverPubkeyFromWaddress(stamp);\n\n let ringArgs = wanUtil.getRingSign(new Buffer(tokenHoderKeystore.address.slice(2),'hex'), otaSk,otaPub.A,otaSetBuf);\n if(!wanUtil.verifyRinSign(ringArgs)){\n console.log(\"ring sign is wrong@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\");\n return;\n }\n let KIWQ = generatePubkeyIWQforRing(ringArgs.PubKeys,ringArgs.I, ringArgs.w, ringArgs.q);\n let glueContractDef = web3.eth.contract([{\"constant\":false,\"type\":\"function\",\"inputs\":[{\"name\":\"RingSignedData\",\"type\":\"string\"},{\"name\":\"CxtCallParams\",\"type\":\"bytes\"}],\"name\":\"combine\",\"outputs\":[{\"name\":\"RingSignedData\",\"type\":\"string\"},{\"name\":\"CxtCallParams\",\"type\":\"bytes\"}]}]);\n let glueContract = glueContractDef.at(\"0x0000000000000000000000000000000000000000\");\n let combinedData = glueContract.combine.getData(KIWQ, cxtInterfaceCallData);\n //let all = TokenInstance.\n var serial = '0x' + web3.eth.getTransactionCount(tokenHoderKeystore.address).toString(16);\n var rawTx = {\n Txtype: '0x06',\n nonce: serial,\n gasPrice: gGasPrice,\n gasLimit: gGasLimit,\n to: TokenAddress,\n value: '0x00',\n data: combinedData\n };\n console.log(\"payload: \" + rawTx.data.toString('hex'));\n\n var tx = new Tx(rawTx);\n tx.sign(tokenHoderKeystore.privKeyA);\n var serializedTx = tx.serialize();\n let hash = web3.eth.sendRawTransaction('0x' + serializedTx.toString('hex'));\n console.log(\"serializeTx:\" + serializedTx.toString('hex'));\n console.log('tx hash:'+hash);\n let receipt = await getTransactionReceipt(hash);\n console.log(receipt);\n console.log(\"Token balance of \",token_to_ota_addr, \" is \", TokenInstance.otabalanceOf(token_to_ota_addr).toString(), \"key is \", TokenInstance.otaKey(token_to_ota_addr));\n}", "function stealthDualSend (e, R, Q) {\n const eQ = ecc.pointMultiply(Q, e) // shared secret\n const c = bitcoin.crypto.sha256(eQ)\n const Rc = ecc.pointAddScalar(R, c)\n const vG = bitcoin.ECPair.fromPublicKey(Rc)\n\n return vG\n}", "async function transferContractOwnership() {\n let accounts = await web3.eth.getAccounts();\n let result = await contract.methods\n .transferOwnership(transferOwnershipAddress)\n .send({ from: accounts[0] });\n console.log(\"result====\", result);\n }", "static async saveAccount(encryptedWalletJSON)\n {\n /* var password = acct.password;\n var dk = acct.dk;\n var name = 'eth_acct_'+acct.address;\n var options = {};\n\n var keyObject = keythereum.dump(password, new Buffer(dk.privateKey), new Buffer(dk.salt), new Buffer(dk.iv), {options});\n*/\n console.log('saving acct ', encryptedWalletJSON)\n\n var encryptedWallet = JSON.parse(encryptedWalletJSON);\n\n\n var address = encryptedWallet.address;\n\n if(!address.startsWith('0x')){\n address = '0x' + encryptedWallet.address;\n }\n\n var name = 'eth_acct_'+address;\n\n\n var storage = await StorageHelper.storeFile(name,encryptedWallet);\n\n\n return {success:true}\n }", "function socket_emitUsername() {\n socket.emit('username declared', {\n username: username\n });\n}", "function secureMessageExchange(oAlice, oBob, p, g) {\n keyExchange(oAlice, oBob, p, g);\n \n oAlice.transmit(oBob);\n oBob.transmit(oAlice);\n}", "sendMessage({ sender, receiver, message }) {\n\t\tconsole.log(`${sender.userName} dice ${message} a ${receiver.userName}`);\n\t}", "function updateName() {\n const name = document.getElementById('input-name').value;\n socket.emit('name', name);\n}", "set owner(ownerName) {\n // debugger;\n console.log(\"We are setting the name of the owner. Please wait...\");\n\n ownerName.length > 1 ? this._owner = ownerName : (() => {throw new Error(\"Owner name too short\")})();\n }", "function setUsername (username) { socket.emit('add user', username); }", "function joinGame(nickname, id){\n\tg_socket.emit(\"usernameUpdate\", {username: nickname, gameToJoinId: id});\n}", "_addToSwarm(peer) {\n if(!(peer.connectionString in this.swarm)) {\n this.swarm[peer.connectionString] = peer;\n return true;\n } else {\n if(this.swarm[peer.connectionString].socket !== peer.socket) {\n this.swarm[peer.connectionString].socket = peer.socket;\n return true;\n } else {\n return false;\n }\n // console.log(\"peer is already in swarm\");\n }\n }", "function setUsername() {\n up.user = vw.getUsername();\n\n signallingConnection.sendToServer({\n user: up.user,\n date: Date.now(),\n id: up.clientID,\n type: \"username\",\n act: \"username\"\n });\n}", "async sendEther(amount, to_address) {\n\n params: [{\n \"from\": accounts[0] ,\n \"to\": to_address,\n \"gas\": \"0x76c0\", // 30400\n \"gasPrice\": \"0x9184e72a000\", // 10000000000000\n \"value\": ethers.utils.parseEther(amount)\n }]\n\n ethereum.sendAsync({\n method: 'eth_sendTransaction',\n params: params,\n from: accounts[0], // Provide the user's account to use.\n }, (err, response) => {\n if (error) {\n if (error.code === 4001) { // EIP 1193 userRejectedRequest error\n console.log('Please connect to MetaMask.')\n } else {\n console.error(error)\n }\n } else {\n // this method will return a transaction hash on success.\n const result = response.result\n console.log(result)\n }\n })\n }", "createAccount(){\n\n console.log('ACCOUNT CREATED')\n\n // // Ropsten URL \n let ropstenRPC = 'https://ropsten.infura.io/c7b70fc4ec0e4ca599e99b360894b699'\n\n // Create a Web3 instance with the url. \n var web3js = new web3(new web3.providers.HttpProvider(ropstenRPC));\n\n\n\n let newAccount = web3js.eth.accounts.create();\n let newAccount_public = newAccount.address\n let newAccount_private = newAccount.privateKey\n\n\n //JSON that is supporting all chains. \n let newJSON = {\n eth : [\n {\n privateKey : newAccount_private,\n publicKey : newAccount_public, \n }\n ],\n eos : [] \n }\n // 0xf65edc67222a17bdb9979e9560f75ac34fae6dc30e6d2145458295bf11739390\n\n //Turn array to string to store in keychain. \n let stored_string = JSON.stringify(newJSON);\n\n\n //Store array with keys in keychain. \n (async function() {\n\n // Store the credentials\n await Keychain.setGenericPassword('null', stored_string);\n \n })();\n\n this.props.navigator.push({\n id : 'AccountCreated',\n passProps : {\n privateKey : newAccount_private,\n publicKey : newAccount_public\n }\n })\n \n }", "function getPlayerName(message, dupArr, namesArr){\n\tvar name;\n\tdupArr.push('Computer');\n\treturn promtAndInput(message)\n\t.then(function(name){\n\t\tif (dupArr.some(function(choice){\n\t\t\treturn choice === name;\n\t\t})) {\n\t\t\tprocess.stdout.write('Sorry, you can\\'t pick the same name as someone else or Computer. Please enter a different name. ');\n\t\t\treturn getPlayerName(message, dupArr, namesArr);\n\t\t} else {\n\t\t\tnamesArr.push(name);\n\t\t\treturn namesArr;\n\t\t}\n\t});\n}", "function getOtherMemberNick()\r\n {\r\n return otherMemberNick; \r\n }", "computeSharedSecret(other) {\n const pubKey = SigningKey.computePublicKey(other);\n return hexlify(secp256k1.getSharedSecret(getBytesCopy(this.#privateKey), getBytes(pubKey)));\n }", "async function renounceOwnershipCall() {\n let accounts = await web3.eth.getAccounts();\n let ownRenounce = await contract.methods\n .renounceOwnership()\n .send({ from: accounts[0] });\n console.log(\"result====\", ownRenounce);\n }", "function sendPlayerDetails(player) {\n\n var sessionID = player.sessionID;\n console.log(player.params.name);\n \n io.sockets.sockets[sessionID].emit('loadPlayerDetails', player);\n return;\n}", "send() {\n // Disable send button;\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) return this.okPressed = false;\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Reset all\n this.init();\n return;\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n }", "function user(){\n\n var person = usuario.name+\" - (\"+usuario.username+\")\";\n socket.emit(\"nickname\", person);\n\n return false;\n }", "function addPlayerName(youIndex, pcIndex) {\n player[pcIndex].innerHTML = \"Computer\";\n player[youIndex].innerHTML = \"You\";\n}", "function sendTransaction(generateAccount, algodClient, kmdClient) {\n let note = '';\n let amount = 0;\n const from = { addr: '', sk: '' };\n let to = ''; // 'KI6TMKHUQOGJ7EDZLOWFOGHBBWBIMBMKONMS565X7NSOFMAM6S2EK4GBHQ';\n let walletName = '';\n let walletPassword = '';\n let walletId = null;\n let walletHandle = null;\n let txId = '';\n\n (async () => {\n if (generateAccount) {\n // Create an account\n const account = algosdk.generateAccount();\n console.log(`Address: ${account.addr}`);\n\n // Get backup phrase for account\n const mnemonic = algosdk.secretKeyToMnemonic(account.sk);\n console.log(`Mnemonic: ${mnemonic}`);\n\n // Recover the account\n const recoveredAccount = algosdk.mnemonicToSecretKey(mnemonic);\n // console.log(recoveredAccount.addr);\n\n // Check to see if account is valid\n const isValid = algosdk.isValidAddress(recoveredAccount.addr);\n if (isValid) {\n from.addr = recoveredAccount.addr;\n from.sk = recoveredAccount.sk;\n }\n } else {\n const wallets = await kmdClient.listWallets();\n const walletsLength = wallets.wallets.length;\n if (typeof walletsLength === 'undefined' || walletsLength <= 0) {\n console.log(\"No wallets could be found in `kmd'.\");\n process.exit(1);\n }\n\n console.log('\\nGot wallets list:'); // + JSON.stringify(wallets));\n for (let i = 0; i < walletsLength; i++) {\n console.log(`[${i + 1}] ${wallets.wallets[i].name}`);\n }\n\n if (!walletName) {\n const walletIndex = readlineSync.keyIn(\n `Pick the wallet to use [1${walletsLength > 1 ? `-${walletsLength}` : ''}]: `,\n // eslint-disable-next-line comma-dangle\n { limit: `$<1-${walletsLength}>` }\n );\n walletName = wallets.wallets[walletIndex - 1].name;\n walletId = wallets.wallets[walletIndex - 1].id;\n }\n\n if (!walletPassword) {\n walletPassword = readlineSync.question(`\\nType the '${walletName}' wallet's password: `, {\n hideEchoBack: true,\n mask: '',\n });\n }\n\n walletHandle = (await kmdClient.initWalletHandle(walletId, walletPassword)).wallet_handle_token;\n\n const keys = await kmdClient.listKeys(walletHandle);\n const keysLength = keys.addresses.length;\n if (typeof keysLength === 'undefined' || keysLength <= 0) {\n console.log(`No keys could be found in \\`kmd' for '${walletName}'.`);\n process.exit(1);\n }\n console.log('\\nGot keys list:'); // + keys);\n for (let i = 0; i < keysLength; i++) {\n console.log(`[${i + 1}] ${keys.addresses[i]}`);\n }\n\n const keyIndex = readlineSync.keyIn(\n `Pick the account address to send from [1${keysLength > 1 ? `-${keysLength}` : ''}]: `,\n { limit: `$<1-${keysLength}>` },\n );\n from.addr = keys.addresses[keyIndex - 1];\n from.sk = (await kmdClient.exportKey(walletHandle, walletPassword, from.addr)).private_key;\n // console.log('sk', from.sk);\n }\n\n if (!to) {\n to = readlineSync.question('\\nSpecify the account address to send to: ');\n }\n\n if (!amount) {\n amount = readlineSync.questionInt('\\nSpecify the amount to be transferred: ');\n }\n\n if (!note) {\n note = readlineSync.question('\\nSpecify some note text (optional): ');\n }\n\n // Get the relevant params from the algod\n const params = await algodClient.getTransactionParams();\n const endRound = params.lastRound + parseInt(1000, 10);\n\n // Create a transaction\n const txn = {\n from: from.addr,\n to, // 'NJY27OQ2ZXK6OWBN44LE4K43TA2AV3DPILPYTHAJAMKIVZDWTEJKZJKO4A',\n fee: params.fee,\n amount,\n firstRound: params.lastRound,\n lastRound: endRound,\n genesisID: params.genesisID,\n note: note ? algosdk.encodeObj(note) : new Uint8Array(0),\n };\n\n // Sign the transaction\n console.log('\\nSigning transaction: \\n', txn);\n const signedTxn = algosdk.signTransaction(txn, from.sk);\n\n // Submit the transaction\n console.log('\\nSubmitting transaction...');\n const tx = await algodClient.sendRawTransaction(signedTxn.blob);\n txId = tx.txId; // eslint-disable-line prefer-destructuring\n console.log(`Transaction: tx-${txId}`);\n })().catch((e) => {\n console.log(e.error.text);\n process.exit(1);\n });\n}", "function updateName(id) {\n\t\twindow.localStorage.name = $(\"#client-\" + id + \"-input\").val();\n\t\tsocket.emit(\"update_name\", $(\"#client-\" + id + \"-input\").val());\n\t}", "function shareDeck(){\n\tif(selectedDeck == null){alert(\"No Deck Selected.\"); return;}\n\tif(Object.keys(selectedDeck).length < 1){alert(\"No Deck Selected.\"); return;}\n\n\tvar deckData = $(\"#deckListSelect\").val() + \">\";\n\t$.each(selectedDeck, function(index, card){\n\t\tdeckData += getGlobalCardIndex(card) + \"|\";\n\t});\n\tvar encodedDeck = btoa(deckData);\n\twindow.prompt(\"Press Ctrl+C to copy!\", documentRoot + \"cards.html?d=\" + encodedDeck);\n}", "function joinClient() {\n\tvar playerName = document.getElementById('playerName').value;\n\tif (playerName.length != 0) {\n\t\tsocket.emit('join', {name: playerName});\n\t}\n}", "function saveName(e) {\n e.preventDefault();\n var name = formInput.value.trim();\n if (name.length > 0) {\n device.classList.add('hasName');\n debugEl.classList.add('isDisplayed');\n formButton.disabled = true;\n formInput.readOnly = true;\n socket.emit(\"name\", name);\n }\n }", "function changeName(oldname, name){\n if(oldname===username){\n username = name;\n addCookie('chatname', name);\n $('#socketchatbox-username').text(username);\n }\n }", "function SarahTransferAmandaToRoom() {\n\tSarahAmandaLeaveRoom();\n\tCharacterRelease(Amanda);\n\tif ((InventoryGet(Amanda, \"ItemPelvis\") != null) && (InventoryGet(Amanda, \"ItemPelvis\").Asset.Name == \"StraponPanties\")) InventoryRemove(Amanda, \"ItemPelvis\");\n\tInventoryWear(Amanda, \"CollegeOutfit1\", \"Cloth\");\n\tInventoryWear(Amanda, \"CollegeSkirt\", \"ClothLower\");\n\tInventoryWear(Amanda, \"Socks4\", \"Socks\", \"#AAAAAA\");\n\tInventoryWear(Amanda, \"Shoes1\", \"Shoes\", \"#222222\");\n\tInventoryWear(Amanda, \"Bra1\", \"Bra\", \"#bbbbbb\");\n\tInventoryWear(Amanda, \"Panties1\", \"Panties\", \"#bbbbbb\");\n\tInventoryAdd(Player, \"StraponPanties\", \"ItemPelvis\");\n\tCommonSetScreen(\"Room\", \"Private\");\n\tPrivateAddCharacter(Amanda, null, true);\n\tvar C = PrivateCharacter[PrivateCharacter.length - 1];\n\tC.Trait = [];\n\tNPCTraitSet(C, \"Peaceful\", 70);\n\tNPCTraitSet(C, \"Wise\", 90);\n\tNPCTraitSet(C, \"Serious\", 30);\n\tNPCTraitSet(C, \"Polite\", 50);\n\tC.Love = 20;\n\tif (Amanda.Owner == Player.Name) {\n\t\tNPCEventAdd(C, \"NPCCollaring\", CurrentTime);\n\t\tInventoryWear(C, \"SlaveCollar\", \"ItemNeck\");\n\t\tC.Owner = Player.Name;\n\t\tC.Love = 100;\n\t}\n\tif (Player.Lover == \"NPC-Amanda\") {\n\t\tNPCEventAdd(C, \"Girlfriend\", CurrentTime);\n\t\tC.Lover = Player.Name;\n\t\tC.Love = 100;\n\t}\n\tif (Player.Owner == \"NPC-Amanda\") {\n\t\tNPCEventAdd(C, \"PlayerCollaring\", CurrentTime);\n\t\tNPCEventAdd(C, \"LastGift\", CurrentTime);\n\t\tC.Love = 100;\n\t}\n\tif (LogQuery(\"AmandaSarahLovers\", \"NPC-AmandaSarah\")) C.Lover = \"NPC-Sarah\";\n\tNPCTraitDialog(C);\n\tServerPrivateCharacterSync();\n}", "makeAddress() {\n let kp = keypair();\n let addr = utils.calcAddress(kp.public);\n this.addresses[addr] = kp;\n return addr;\n }", "function syncAccounts () {\n master = runtime.getAccount(masterAddr);\n issuer = runtime.getAccount(issuerAddr);\n investor = runtime.getAccount(investorAddr);\n trader = runtime.getAccount(traderAddr);\n greenVerifier = runtime.getAccount(greenVerifierAddr);\n if (bondEscrow) bondEscrow = runtime.getAccount(bondEscrow.address);\n if (stablecoinEscrow) stablecoinEscrow = runtime.getAccount(stablecoinEscrow.address);\n }", "function swapAgent(agentName){\n localStorage.setItem(\"agentName\", agentName);\n agentE.hide();\n nextAgent(agentName);\n}", "function encryptFriendsPublic() {\n var message = document.getElementById(\"messageArea\").value;\n friendsKeyPair.setType(\"public\");\n message = RSA.encryptWithKey(message, friendsKeyPair);\n document.getElementById(\"messageArea\").value = message;\n}", "function sendMessageToThird(message) {\n\tconsole.log('Client sending message to third peer: ', message);\n\tsocket.emit('messagetothird', message, isInitiator);\n}" ]
[ "0.7512528", "0.5725569", "0.5453142", "0.53935593", "0.5236883", "0.51516825", "0.5109399", "0.5108649", "0.5088656", "0.5067909", "0.5035694", "0.50278795", "0.4972351", "0.49517295", "0.4935706", "0.49336493", "0.49251348", "0.49026814", "0.48963198", "0.4892752", "0.48908317", "0.48779243", "0.4876569", "0.48710117", "0.48703587", "0.48629105", "0.48531476", "0.48449072", "0.4840814", "0.48407215", "0.48308513", "0.48253787", "0.48088032", "0.48021615", "0.4788397", "0.47830448", "0.4782035", "0.47730148", "0.47469765", "0.47452196", "0.4739448", "0.4734037", "0.47293758", "0.47262394", "0.4721923", "0.4718823", "0.47149214", "0.47126666", "0.47076693", "0.47021484", "0.4698338", "0.46979517", "0.4696338", "0.46936432", "0.4691706", "0.46871883", "0.46562108", "0.46490002", "0.46428382", "0.46410102", "0.46405393", "0.46397585", "0.4634433", "0.46308208", "0.46241388", "0.4619541", "0.46145707", "0.46104747", "0.46055937", "0.46039358", "0.46010855", "0.4591944", "0.4586091", "0.45738554", "0.45655546", "0.4564522", "0.4563325", "0.45567173", "0.4553306", "0.45365334", "0.45286775", "0.45215768", "0.45200706", "0.4519498", "0.4516695", "0.4515147", "0.45139313", "0.45125", "0.44999728", "0.44967562", "0.44959065", "0.44953477", "0.44923007", "0.44909102", "0.4480204", "0.44749323", "0.4466836", "0.44630983", "0.4460152", "0.4453787" ]
0.77199477
0
Creates the Etherpad button and adds it to the toolbar.
function enableEtherpadButton() { if (!$('#etherpadButton').is(":visible")) $('#etherpadButton').css({display: 'inline-block'}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderToolbarButton() {\n const toolbars = this.instance.getChildByClass(this.instance.root, 'gm-toolbar');\n if (!toolbars) {\n return; // if we don't have toolbar, we can't spawn the widget\n }\n\n const toolbar = toolbars.children[0];\n this.toolbarBtn = document.createElement('li');\n this.toolbarBtnImage = document.createElement('div');\n this.toolbarBtnImage.className = 'gm-icon-button gm-iothrottling-button';\n this.toolbarBtnImage.title = this.i18n.IOTHROTTLING_TITLE || 'Disk I/O';\n this.toolbarBtn.appendChild(this.toolbarBtnImage);\n this.toolbarBtn.onclick = this.toggleWidget.bind(this);\n toolbar.appendChild(this.toolbarBtn);\n }", "function addButton(app) {\n var template;\n var button;\n\n template = document.querySelector(\"#appButtonTemplate\");\n button = document.importNode(template.content.firstElementChild, false);\n\n button.className = \"appButton\";\n button.style.backgroundColor = app.backgroundColor;\n button.style.backgroundImage = \"url(\" + app.img + \")\";\n dock.appendChild(button);\n dock.style.width = dock.offsetWidth + 45;\n\n button.addEventListener(\"click\", function(event) {\n event.preventDefault();\n launcher.launcher(app);\n });\n\n buttons.push(button);\n}", "function createButton(wysiwyg, number) {\n if (WYSIWYG_BUTTONS_AS_FORM_ELEMENTS) {\n var button = document.createElement(\"input\");\n button.type = \"button\";\n button.value = wysiwyg_toolbarButtons[number][1];\n } else {\n if (document.all) { // IE needs the buttons to be anchors\n var button = document.createElement(\"a\");\n button.href = \"\";\n } else {\n var button = document.createElement(\"span\");\n }\n button.appendChild(document.createTextNode(wysiwyg_toolbarButtons[number][1]));\n }\n button.number = number;\n button.className = \"toolbarButton toolbarButton\" + number;\n button.command = wysiwyg_toolbarButtons[number][0];\n if (wysiwyg_toolbarButtons[number][2]) button.commandValue = wysiwyg_toolbarButtons[number][2];\n if (wysiwyg_toolbarButtons[number][3]) button.title = wysiwyg_toolbarButtons[number][3];\n button.wysiwyg = wysiwyg;\n return button;\n }", "function enableEtherpadButton() {\n if (!$('#etherpadButton').is(\":visible\"))\n $('#etherpadButton').css({display: 'inline-block'});\n}", "function mkToolBtnTop(iconLoc, label) {\t//make tool button top part, always visiable\n\tvar btn = insertInto(div(\"math-button\"), [\n\t\t \t\tdiv(\"math-button-icon\", {background: \"url(assets/img/toolbar/\" + iconLoc + \")\"}),\n\t\t\t\tinsertInto(div(\"math-button-label\"), [\n\t\t\t\t\tdocument.createTextNode(label),\n\t\t\t\t\tmake(\"br\"),\n\t\t\t\t\tdiv(\"math-button-sign\")\n\t\t\t\t])\t\t\n \t]);\n\tbtn.setAttribute(\"tabindex\",\"0\");\n\tbtn.addEventListener('click', btn1, false);\n\tbtn.addEventListener('blur', btn2, false);\n\treturn btn;\n}", "function addButtons() {\n\t\tcreateButton(\"Outdent\");\n\t\tcreateButton(\"Indent\");\n\t}", "function boton1() {\n var x = document.createElement(\"BUTTON\");\n var t = document.createTextNode(\"Nothing\");\n x.appendChild(t);\n EJERCICIO2.appendChild(x);\n}", "createButtonNode(button) {\n const e = document.createElement('button');\n e.className = this.createItemClass(button);\n e.appendChild(this.renderIcon(button));\n e.appendChild(this.renderLabel(button));\n return e;\n }", "addToolbarButton(type, name, title) {\n const canvas = document.createElement('canvas');\n const draw = new Draw(canvas, 1, 1);\n const tool = document.createElement('div');\n tool.dataset.type = name;\n tool.className = \"gate\";\n tool.title = title || '';\n draw.clear();\n if (name == 'swap') {\n draw.swap(20, 20);\n } else if (name == 'control') {\n draw.control(20, 20);\n } else if (name == 'cnot') {\n draw.not(20, 20);\n } else {\n draw.gate(20, 20, 1, name.toUpperCase());\n }\n const img = document.createElement('img');\n img.src = canvas.toDataURL();\n tool.appendChild(img);\n tool.appendChild(document.createElement('div'));\n document.querySelector('#toolbar .' + type).appendChild(tool);\n }", "function mkToolBtnTop(iconLoc, label) {\t//make tool button top part, always visiable\r\n\tvar btn = Util.div(\"math-button\")\r\n\t\t\t\t\t.attr(\"tabindex\",\"0\")\r\n\t\t\t\t\t.append(Util.div(\"math-button-icon\")\r\n\t\t\t\t\t\t\t\t .styles(\"background\", \"url(assets/img/toolbar/\" + iconLoc + \")\"))\r\n\t\t\t\t\t.append(Util.div(\"math-button-label\")\r\n\t\t\t\t\t\t\t\t .append(document.createTextNode(label))\r\n\t\t\t\t\t \t\t\t .append(Util.br())\r\n\t\t\t\t\t \t\t\t .append(Util.div(\"math-button-sign\")));\r\n\tbtn.addEventListener('click', btn1);\r\n\tbtn.addEventListener('blur', btn2);\r\n\treturn btn;\r\n}", "createToolbar() {\n const toolbar = document.createElement(\"div\");\n toolbar.className = this.options.className;\n toolbar.style.visibility = \"hidden\";\n\n const buttonsContainer = document.createElement(\"div\");\n buttonsContainer.className = `${this.options.className}__buttons`;\n\n this.options.buttons.map((button) => {\n const buttonElement = document.createElement(\"button\");\n buttonElement.innerHTML = button.innerHTML;\n buttonElement.dataset.action = button.name;\n buttonsContainer.appendChild(buttonElement);\n });\n\n toolbar.appendChild(buttonsContainer);\n document.body.appendChild(toolbar);\n return toolbar;\n }", "function createToolBtn(obj) {\n var btn = $('<button/>', {\n title: obj.title,\n name: obj.name,\n text: obj.text\n }).addClass(obj.classes);\n return btn;\n }", "function setupBuyButton(){\n\t//if(location.href.indexOf(\"webdesign-flash.ro\") == -1) return;\n\tFWDBuyButton.setPrototype();\n\tbuyButton = new FWDBuyButton(\"graphics/buy.png\",\"graphics/hello.png\", 70,70,30,60);\n\tbuyButton.setX(0);\n\tbody_el.appendChild(buyButton.screen);\n\tself.positionBuyButton();\n}", "function ToolBar_CreateCloneButton(theHTML, theObject, szImage, extraContent, imageList)\n{\n\t//helpers\n\tvar buttonDROPDOWN;\n\t//type of the button to use\n\tvar strType;\n\t//by default we do not allow custom dropdowns\n\tvar bCustomDropDown = false;\n\t//we choose the type according to the look\n\tswitch (theObject.InterfaceLook)\n\t{\n\t\tcase __NEMESIS_LOOK_SAP_ENJOY:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_DESIGN:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_CORBU:\n\t\tcase __NEMESIS_LOOK_SAP_CORBUS:\n\t\tcase __NEMESIS_LOOK_SAP_BLUE_CRYSTAL:\n\t\tcase __NEMESIS_LOOK_SAP_BELIZE:\n\t\t\t//use div (font bugs on buttons!)\n\t\t\tstrType = \"div\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_TRADESHOW:\n\t\t\t//not main toolbar?\n\t\t\tif (!theHTML.SAPMainToolBar)\n\t\t\t{\n\t\t\t\t//use button\n\t\t\t\tstrType = \"button\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//use div (font bugs on buttons!)\n\t\t\t\tstrType = \"div\";\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t//use button\n\t\t\tstrType = \"button\";\n\t\t\t//check if we want a custom dropdown\n\t\t\tbCustomDropDown = extraContent && extraContent.CustomDropDown;\n\t\t\tbreak;\n\t}\n\t//create the button itself\n\tvar button = document.createElement(strType);\n\t//set its styles\n\tbutton.style.cssText = \"position:absolute;background-color:transparent;padding:0px;margin:0px;cursor:default;text-overflow:ellipsis;overflow:\" + (__BROWSER_IE8_OR_LESS ? \"visible\" : \"hidden\") + \";color:\" + theObject.FGColours[__STATE_DEFAULT] + \";\";\n\t//make it unselectable\n\tBrowser_SetSelectable(button, false);\n\n\t//create the image\n\tvar buttonIMAGE = button.appendChild(document.createElement(\"img\"));\n\tbuttonIMAGE.src = __NEMESIS_EMPTY_BG;\n\t//set styles\n\tbuttonIMAGE.style.cssText = \"position:absolute;display:none;\";\n\tbuttonIMAGE.style.width = szImage.w + \"px\";\n\tbuttonIMAGE.style.height = szImage.h + \"px\";\n\n\t//if we have a custom drop down\n\tif (bCustomDropDown)\n\t{\n\t\t//this using a caption?\n\t\tvar bHasCaption = extraContent.CustomDropDown.Caption;\n\t\t//create dropdown button\n\t\tbuttonDROPDOWN = button.appendChild(document.createElement(bHasCaption ? \"div\" : \"img\"));\n\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;right:1px;display:none;background-repeat:no-repeat;background-position:center center;\" + Basic_GetFontStyle(Get_String(extraContent.CustomDropDown.Font, theObject.Properties[__NEMESIS_PROPERTY_FONT]));\n\t\tbuttonDROPDOWN.style.borderTop = extraContent.CustomDropDown.BorderTop;\n\t\tbuttonDROPDOWN.style.borderLeft = extraContent.CustomDropDown.BorderLeft;\n\t\tbuttonDROPDOWN.style.borderBottom = extraContent.CustomDropDown.BorderBottom;\n\t\tbuttonDROPDOWN.style.borderRight = extraContent.CustomDropDown.BorderRight;\n\t\tbuttonDROPDOWN.style.width = Get_Number(extraContent.CustomDropDown.Width, 6) + \"px\";\n\t\tbuttonDROPDOWN.style.height = Get_Number(extraContent.CustomDropDown.Height, 4) + \"px\";\n\t\t//has it got an image?\n\t\tif (extraContent.CustomDropDown.Image)\n\t\t{\n\t\t\t//image is a number?\n\t\t\tvar imageIndex = Get_Number(extraContent.CustomDropDown.Image, null);\n\t\t\t//valid?\n\t\t\tif (imageIndex != null && imageList)\n\t\t\t{\n\t\t\t\t//set it\n\t\t\t\timageList.SetImage(buttonDROPDOWN, imageIndex);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//has caption?\n\t\t\t\tif (bHasCaption)\n\t\t\t\t{\n\t\t\t\t\t//set it as a background image\n\t\t\t\t\tbuttonDROPDOWN.style.backgroundImage = \"url('\" + __HOST_LESSON_RESOURCES + extraContent.CustomDropDown.Image + \"')\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//set it as full image\n\t\t\t\t\tbuttonDROPDOWN.src = __HOST_LESSON_RESOURCES + extraContent.CustomDropDown.Image;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//has it got a caption?\n\t\tif (bHasCaption)\n\t\t{\n\t\t\t//set it\n\t\t\tbuttonDROPDOWN.innerHTML = extraContent.CustomDropDown.Caption.ToPlainText(theObject.DataObject.Id); // SAFE BY ENCODING\n\t\t}\n\t}\n\telse\n\t{\n\t\t//create dropdown button\n\t\tbuttonDROPDOWN = button.appendChild(document.createElement(\"img\"));\n\t\tbuttonDROPDOWN.src = __NEMESIS_EMPTY_BG;\n\t}\n\n\t//create text node\n\tvar buttonCAPTION = button.appendChild(document.createElement(\"div\"));\n\tbuttonCAPTION.style.cssText = \"position:absolute;padding:2px;padding-bottom:4px;display:none;text-overflow:ellipsis;word-wrap:normal;white-space:nowrap;\" + Basic_GetFontStyle(theObject.Properties[__NEMESIS_PROPERTY_FONT]);\n\n\t//finaly, switch on interface style\n\tswitch (theObject.InterfaceLook)\n\t{\n\t\tdefault:\n\t\t\t//if its not custom?\n\t\t\tif (!bCustomDropDown)\n\t\t\t{\n\t\t\t\t//update dropdown\n\t\t\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;right:1px;display:none;width:7px;height:5px;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_classic_sprite.png');background-repeat:no-repeat;background-position:-170px -54px;\";\n\t\t\t}\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_ENJOY:\n\t\t\t//not main toolbar?\n\t\t\tif (!theHTML.SAPMainToolBar)\n\t\t\t{\n\t\t\t\t//update button itself\n\t\t\t\tbutton.style.border = \"1px solid #73716b\";\n\t\t\t\tbutton.style.background = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_sapenjoy_buttonbg.png')\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set the highlight border\n\t\t\t\tbutton.style.border = \"2px outset #d3d1cb\";\n\t\t\t}\n\t\t\t//update dropdown\n\t\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;right:1px;display:none;width:11px;height:13px;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_sapenjoy_stream.png');background-repeat:no-repeat;background-position:-105px -136px;border-left:1px solid #808080;\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_TRADESHOW:\n\t\t\t//not main toolbar?\n\t\t\tif (!theHTML.SAPMainToolBar)\n\t\t\t{\n\t\t\t\t//update button itself\n\t\t\t\tbutton.style.background = \"#f2e1af\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set the highlight border\n\t\t\t\tbutton.style.border = \"2px solid #D9D9D9\";\n\t\t\t}\n\t\t\t//update dropdown\n\t\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;right:1px;display:none;width:11px;height:13px;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_tradeshow_stream.png');background-repeat:no-repeat;background-position:-105px -136px;border-left:1px solid #808080;\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_CORBU:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_DESIGN:\n\t\t\t//not main toolbar?\n\t\t\tif (!theHTML.SAPMainToolBar)\n\t\t\t{\n\t\t\t\t//update button itself\n\t\t\t\tbutton.style.border = \"1px solid #73716b\";\n\t\t\t\tbutton.style.background = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_signature_buttonbg.png')\";\n\t\t\t\tbutton.style.borderRadius = \"2px\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set the highlight border\n\t\t\t\tbutton.style.border = \"1px solid #73716b\";\n\t\t\t}\n\t\t\t//update dropdown\n\t\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;right:1px;display:none;width:8px;height:12px;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_signature_stream.png');background-repeat:no-repeat;background-position:-99px -640px;margin-top:5px;\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_CORBUS:\n\t\t\t//not main toolbar?\n\t\t\tif (!theHTML.SAPMainToolBar)\n\t\t\t{\n\t\t\t\t//update button itself\n\t\t\t\tbutton.style.border = \"1px solid #A3A3A3\";\n\t\t\t\tbutton.style.backgroundColor = Get_Color(\"<SAPCLR:61>\", null, theObject.InterfaceLook);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set the highlight border\n\t\t\t\tbutton.style.border = \"1px solid #73716b\";\n\t\t\t}\n\t\t\t//update dropdown\n\t\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;right:1px;display:none;width:11px;height:13px;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_corbus_stream.png');background-repeat:no-repeat;background-position:-105px -138px;\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_BLUE_CRYSTAL:\n\t\t\t//not main toolbar?\n\t\t\tif (!theHTML.SAPMainToolBar)\n\t\t\t{\n\t\t\t\t//update button itself\n\t\t\t\tbutton.style.borderRadius = \"1px\";\n\t\t\t\tbutton.style.border = \"1px solid #BFBFBF\";\n\t\t\t\tbutton.style.backgroundColor = \"Transparent\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set the highlight border\n\t\t\t\tbutton.style.border = \"1px solid #73716b\";\n\t\t\t}\n\t\t\t//update dropdown\n\t\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;bottom:1px;right:1px;display:none;width:7px;height:7px;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_bluecrystal_stream.png');background-repeat:no-repeat;background-position:-117px -369px;\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_BELIZE:\n\t\t\t//update button itself\n\t\t\tbutton.style.borderRadius = \"2px\";\n\t\t\tbutton.style.border = \"1px solid #ABABAB\";\n\t\t\tbutton.style.backgroundColor = \"transparent\";\n\t\t\t//set dropdown\n\t\t\tbuttonDROPDOWN.style.cssText = \"position:absolute;left:23px;top:0px;width:24px;height:26px;display:none;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_belize_sprite.png');background-repeat:no-repeat;background-position:-62px 0px;\";\n\t\t\t//correct image position\n\t\t\tbuttonIMAGE.style.left = \"3px\";\n\t\t\tbuttonIMAGE.style.top = \"5px\";\n\t\t\tbreak;\n\t}\n\t//return the button\n\treturn button;\n}", "function makeButton(){\r\n\t// Sperate the menu\r\n\tuserbar.innerHTML += ' | ';\r\n\t//Btn part\r\n\tbtn = document.createElement('a');\r\n\tbtn.setAttribute('href','#');\r\n\tbtn.setAttribute('id','liveTopics');\r\n\tbtn.innerHTML = BTN_STRINGS[mode];\r\n\tuserbar.appendChild(btn);\r\n\tbtn.addEventListener('click',toggleLT,false);\r\n}", "function createButton (action, name) {\n var button = document.createElement('button');\n button.innerHTML = name;\n button.setAttribute('id', action);\n document.getElementById('visualizer').appendChild(button);\n}", "buy_tower_btns() {\n var tt = this;\n var ph = loadImage(\"img/ph.jpg\");\n\t//create 3 btns\n tt.normal_tower = tt.add_btn(0, -30, 10, 10, ph);\n tt.ice_tower = tt.add_btn(0, 0, 10, 10, ph);\n tt.poison_tower = tt.add_btn(0, 30, 10, 10, ph);\n //hide the tooltip\n\ttt.hide();\n }", "function createToolbarButton(options, enableActions, enableTooltips, shortcuts, markup, parent) {\n options = options || {};\n var el = document.createElement(markup);\n el.className = options.name;\n el.setAttribute('type', markup);\n enableTooltips = (enableTooltips == undefined) ? true : enableTooltips;\n\n // Properly hande custom shortcuts\n if (options.name && options.name in shortcuts) {\n bindings[options.name] = options.action;\n }\n\n if (options.title && enableTooltips) {\n el.title = createTooltip(options.title, options.action, shortcuts);\n\n if (isMac) {\n el.title = el.title.replace('Ctrl', '⌘');\n el.title = el.title.replace('Alt', '⌥');\n }\n }\n\n if (options.noDisable) {\n el.classList.add('no-disable');\n }\n\n if (options.noMobile) {\n el.classList.add('no-mobile');\n }\n\n // Prevent errors if there is no class name in custom options\n var classNameParts = [];\n if(typeof options.className !== 'undefined') {\n classNameParts = options.className.split(' ');\n }\n\n // Provide backwards compatibility with simple-markdown-editor by adding custom classes to the button.\n var iconClasses = [];\n for (var classNameIndex = 0; classNameIndex < classNameParts.length; classNameIndex++) {\n var classNamePart = classNameParts[classNameIndex];\n // Split icon classes from the button.\n // Regex will detect \"fa\", \"fas\", \"fa-something\" and \"fa-some-icon-1\", but not \"fanfare\".\n if (classNamePart.match(/^fa([srlb]|(-[\\w-]*)|$)/)) {\n iconClasses.push(classNamePart);\n } else {\n el.classList.add(classNamePart);\n }\n }\n\n el.tabIndex = -1;\n\n // Create icon element and append as a child to the button\n var icon = document.createElement('i');\n for (var iconClassIndex = 0; iconClassIndex < iconClasses.length; iconClassIndex++) {\n var iconClass = iconClasses[iconClassIndex];\n icon.classList.add(iconClass);\n }\n el.appendChild(icon);\n\n // If there is a custom icon markup set, use that\n if (typeof options.icon !== 'undefined') {\n el.innerHTML = options.icon;\n }\n\n if (options.action && enableActions) {\n if (typeof options.action === 'function') {\n el.onclick = function (e) {\n e.preventDefault();\n options.action(parent);\n };\n } else if (typeof options.action === 'string') {\n el.onclick = function (e) {\n e.preventDefault();\n window.open(options.action, '_blank');\n };\n }\n }\n\n return el;\n}", "createButtons() {\n this.settingsButton = this._createConnectionButton(TEXTURE_NAME_SETTINGS);\n this.deleteButton = this._createConnectionButton(TEXTURE_NAME_DELETE);\n }", "function createTopButtonToolbarToggle()\n{\n toolbarToggle.createToolbar();\n}", "function addExtraButtons () {\n\tmw.toolbar.addButtons(\n\t{\n\t\t'imageId': 'button-redirect',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_redirect.png', \n\t\t'speedTip': 'Redirect',\n\t\t'tagOpen': '#REDIRECT[[',\n\t\t'tagClose': ']]',\n\t\t'sampleText': 'Target page name'\n\t},\n\t{\n\t\t'imageId': 'button-strike',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_strike.png', \n\t\t'speedTip': 'Strike',\n\t\t'tagOpen': '<s>',\n\t\t'tagClose': '</s>',\n\t\t'sampleText': 'Strike-through text'\n\t},\n\t{\n\t\t'imageId': 'button-enter',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_enter.png', \n\t\t'speedTip': 'Line break',\n\t\t'tagOpen': '<br/>',\n\t\t'tagClose': '',\n\t\t'sampleText': ''\n\t}, \n\t\t'imageId': 'button-hide-comment',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_hide_comment.png', \n\t\t'speedTip': 'Insert hidden Comment',\n\t\t'tagOpen': '<!-- ',\n\t\t'tagClose': ' -->',\n\t\t'sampleText': 'Comment'\n\t}, \n\t{\n\t\t'imageId': 'button-blockquote',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_blockquote.png',\n\t\t'speedTip': 'Insert block of quoted text',\n\t\t'tagOpen': '<blockquote>\\n',\n\t\t'tagClose': '\\n</blockquote>',\n\t\t'sampleText': 'Block quote'\n\t},\n\t{\n\t\t'imageId': 'button-insert-table',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_insert_table.png',\n\t\t'speedTip': 'Insert a table',\n\t\t'tagOpen': '{| class=\"wikitable\"\\n|',\n\t\t'tagClose': '\\n|}',\n\t\t'sampleText': '-\\n! header 1\\n! header 2\\n! header 3\\n|-\\n| row 1, cell 1\\n| row 1, cell 2\\n| row 1, cell 3\\n|-\\n| row 2, cell 1\\n| row 2, cell 2\\n| row 2, cell 3'\n\t},\n\t{\n\t\t'imageId': 'button-insert-reflink',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_reflink.png',\n\t\t'speedTip': 'Insert a reference',\n\t\t'tagOpen': '<ref>',\n\t\t'tagClose': '</ref>',\n\t\t'sampleText': 'Insert footnote text here'\n\t}\n\t);\n}", "function createNodeButton(nodeTypeId, nodeType, first, widget) {\n\n if (first) {\n var css_clear = 'left';\n } else {\n css_clear = 'none';\n }\n\n var backgroundNormal = widget.options.button_background_node_normal;\n var backgroundHover = widget.options.button_background_node_hover;\n var backgroundClicked = widget.options.button_background_node_clicked;\n \n var iconWidth = widget.options.button_width;\n var iconHeight = widget.options.button_height-5;\n var buttonWidth = widget.options.button_width+9;\n var buttonHeight = widget.options.button_height+10;\n\n if (nodeType.no_separate_symbol) { // E.g. the 'variable' node in System Dynamics\n if (nodeType.button_text) {\n var buttonText = nodeType.button_text;\n } else {\n buttonText = 'X';\n }\n var buttonCanvas = $('<div title=\"'+nodeType.button_label+'\" width=\"'+iconWidth+'\" height=\"'+iconHeight+'\" style=\"padding-top:0px; padding-left:0px; width:'+iconWidth+'px; height:'+iconHeight+'px; max-width:'+iconWidth+'px; max-height:'+iconHeight+'px; float:left; clear:'+css_clear+'; background-color:rgba(255,255,255,0); font-size:12px; text-align:center;line-height:24px; \">'+buttonText+'</div>');\n\n } else { // Node has a symbol (all node types, except for 'variable' in System Dynamics)\n buttonCanvas = $('<canvas title=\"'+nodeType.button_label+'\" width=\"'+iconWidth+'\" height=\"'+iconHeight+'\" style=\"float:left; clear:'+css_clear+'; float:left; background-color:rgba(255,255,255,0);\"></canvas>');\n var context = buttonCanvas[0].getContext(\"2d\");\n if (nodeType.shape === 'rectangle') {\n if (!nodeType.no_separate_symbol) {\n var wscale = (iconWidth-8)/nodeType.width;\n var hscale = (iconHeight-8)/nodeType.height;\n if (wscale<hscale) {\n var buttonScale = wscale;\n } else {\n buttonScale = hscale;\n }\n var width = nodeType.width*buttonScale;\n var height = nodeType.height*buttonScale;\n context.beginPath();\n context.strokeStyle = nodeType.border_colour.set.normal;\n context.lineWidth = nodeType.line_width.set.normal;\n context.fillStyle = nodeType.fill_colour.set.normal;\n context.fillRect(buttonWidth/2-width/2-4, buttonHeight/2-height/2-8, width, height);\n context.strokeRect(buttonWidth/2-width/2-4, buttonHeight/2-height/2-8, width, height);\n }\n\n // Note that there are two different scalings going on here. \n // buttonScale is the scaling of the node symbol to fit into the button size.\n // xyScale is the scaling of the x and y axes of a circle to make it into an oval.\n } else if (nodeType.shape === 'oval') {\n var wscale = (buttonWidth-4)/nodeType.width;\n var hscale = (buttonHeight-4)/nodeType.height;\n if (wscale<hscale) {\n var buttonScale = wscale;\n } else {\n buttonScale = hscale;\n }\n var width = nodeType.width*buttonScale;\n var height = nodeType.height*buttonScale;\n context.beginPath();\n context.strokeStyle = nodeType.border_colour.set.normal;\n context.lineWidth = nodeType.line_width.set.normal;\n context.fillStyle = nodeType.fill_colour.set.normal;\n context.textAlign = 'center';\n context.textBaseline = 'middle';\n var xyScale = width/height;\n context.save()\n context.translate(buttonWidth/2, buttonHeight/2);\n context.scale(xyScale, 1);\n context.beginPath();\n context.arc(0,0, height/2, 0, Math.PI*2, true); \n context.restore();\n context.stroke(); \n context.fill(); \n }\n }\n\n var buttonDiv = $('<div class=\"node_arc_toolbar_button node_arc_button\" width=\"'+buttonWidth+'\" height=\"'+buttonHeight+'\" style=\"padding-top:0px; padding-left:0px; width:'+buttonWidth+'px; height:'+buttonHeight+'px; max-width:'+buttonWidth+'px; max-height:'+buttonHeight+'px; float:left; clear:'+css_clear+'; border:none; font-size:12px; text-align:center;line-height:10px; overflow:hidden;\"></div>');\n\n $(buttonDiv).append(buttonCanvas);\n $(buttonDiv).append('<span style=\"height:10px; font-size:12px; overflow:hidden;\">'+nodeType.button_label+'</span>');\n\n $(buttonDiv).\n hover(\n function() {\n $( this ).css({'border':'solid 1px black', 'background-color':backgroundHover})},\n function() {\n if (widget.state.toolbarButton !== nodeTypeId || SYSTO.state.mode === 'pointer') {\n $( this ).css({'border':'solid 1px white', 'background-color':backgroundNormal});\n }\n }\n ).\n click({nodeTypeId:nodeTypeId}, // Not sure why this works! See below.\n function(event) {\n SYSTO.clearSelection(SYSTO.models[SYSTO.state.currentModelId]); \n try {\n SYSTO.clearAll(SYSTO.currentDiagramWidget);\n }\n catch(err) {}\n\n if (SYSTO.state.mode === 'add_node' && widget.state.statusDetail === event.data.nodeTypeId) {\n widget.state.status = 'pointer';\n widget.state.statusDetail = null;\n SYSTO.revertToPointer();\n return;\n }\n\n SYSTO.revertToPointer();\n\n var model = SYSTO.models[SYSTO.state.currentModelId]\n var language = SYSTO.languages[model.meta.language];\n var nodeType = language.NodeType[nodeTypeId]; // Not sure why this works! See below.\n if (nodeType.instructions && nodeType.instructions.diagram) {\n var instructions = language.NodeType[nodeTypeId].instructions.diagram;\n } else {\n instructions = '';\n }\n SYSTO.trigger({\n file:'jquery.toolbar.js', \n action:'clicked on node ('+nodeTypeId+') button', \n event_type: 'message_listener', \n parameters: {message:instructions}});\n\n $( this ).css({'border':'solid 1px black', 'background-color':backgroundClicked});\n widget.state.toolbarButton = nodeTypeId;\n widget.state.status = 'add_node';\n widget.state.statusDetail = event.data.nodeTypeId;\n SYSTO.state.mode = 'add_node';\n SYSTO.state.languageId = widget.options.languageId;\n SYSTO.state.nodeTypeId = nodeTypeId;\n }\n );\n\n // Comment for \"Not sure why this works!\" above.\n // Passing data into the event: \n // See http://stackoverflow.com/questions/3273350/jquery-click-pass-parameters-to-user-function\n // According to that, the data (in this case, nodeTypeId) should be picked up as even.data.nodeTypeId.\n // That's what I had to do in SYSTO.createOptionsDialog (in systo.js) for the help string. Simply\n // mirroring what seems to work here didn't work there.\n\n return buttonDiv;\n}", "createAddButton() {\n let addSourceButton = document.createElement('button')\n addSourceButton.innerText = 'Add ' + this.capitalize(this.type)\n addSourceButton.addEventListener('click', () => this.toggleFormVisibility())\n this.div.appendChild(addSourceButton)\n }", "static createButton(){\n let button = document.createElement('button');\n button.className = \"btn btn-warning viewBtn\";\n button.innerText = \"More Details\";\n return button;\n }", "function buildButton(code) {\n\n var btn = document.createElement(\"button\");\n btn.className = \"tb-btn\";\n btn.type = \"button\";\n btn.style.fontFamily = \"FontAwesome\";\n btn.style.fontStyle = \"normal\";\n btn.style.fontWeight = \"normal\";\n btn.style.fontVariant = \"normal\";\n btn.style.lineHeight = 1;\n btn.innerHTML = '&#xf1c5';\n\n var existing = document.querySelector(\"button.tb-btn.img-btn\");\n existing.parentElement.insertBefore(btn, existing.nextSibling);\n\n return btn;\n }", "function insertButton() {\n\t\tconst button = paymentsClient.createButton({\n\t\t\tbuttonColor: window.gpay_button_color,\n\t\t\tbuttonSizeMode: 'fill',\n\t\t\tonClick: handleClick\n\t\t});\n\t\tbutton.id = 'checkoutcom-google-pay';\n\n\t\tif($selectedPaymentMethodId === $ckoPaymentMethodId) {\n\t\t\t$buttonArea.append(button);\n\t\t} else {\n\t\t\t$buttonArea.remove(button);\n\t\t}\n\t}", "function createButtons() {\n\t\tvar buttonHTML = '<input id=\"CustomNextButton\" class=\"FakeButton Button\" title=\"→\" ' \n\t\t+ 'type=\"button\" name=\"CustomNextButton\" value=\"→\" aria-label=\"Next\">'\n\t\t+ '<input id=\"ShowAnswerButton\" style = \"display:none\" class=\"FakeButton Button\" title=\"Show Answer\" ' \n\t\t+ 'type=\"button\" name=\"ShowAnswerButton\" value=\"Show Answer\" aria-label=\"Show Answer\">'\n\t\t+ '<style>.Total {display: none !important;}</style>';\n\t\tjQuery('#showbuttons').append(buttonHTML);\n\t}", "function InsertButtonsToToolBar()\n{\n//Strike-Out Button\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png\",\n \"speedTip\": \"Strike\",\n \"tagOpen\": \"<s>\",\n \"tagClose\": \"</s>\",\n \"sampleText\": \"Strike-through text\"}\n//Line break button\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png\",\n \"speedTip\": \"Line break\",\n \"tagOpen\": \"<br />\",\n \"tagClose\": \"\",\n \"sampleText\": \"\"}\n//Superscript\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png\",\n \"speedTip\": \"Superscript\",\n \"tagOpen\": \"<sup>\",\n \"tagClose\": \"</sup>\",\n \"sampleText\": \"Superscript text\"}\n//Subscript\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/7/70/Button_lower_letter.png\",\n \"speedTip\": \"Subscript\",\n \"tagOpen\": \"<sub>\",\n \"tagClose\": \"</sub>\",\n \"sampleText\": \"Subscript text\"}\n//Small Text\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/5/58/Button_small.png\",\n \"speedTip\": \"Small\",\n \"tagOpen\": \"<small>\",\n \"tagClose\": \"</small>\",\n \"sampleText\": \"Small Text\"}\n//Comment\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/3/34/Button_hide_comment.png\",\n \"speedTip\": \"Insert hidden Comment\",\n \"tagOpen\": \"<!-- \",\n \"tagClose\": \" -->\",\n \"sampleText\": \"Comment\"}\n//Gallery\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/1/12/Button_gallery.png\",\n \"speedTip\": \"Insert a picture gallery\",\n \"tagOpen\": \"\\n<gallery>\\n\",\n \"tagClose\": \"\\n</gallery>\",\n \"sampleText\": \"Image:Example.jpg|Caption1\\nImage:Example.jpg|Caption2\"}\n//Block Quote\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png\",\n \"speedTip\": \"Insert block of quoted text\",\n \"tagOpen\": \"<blockquote>\\n\",\n \"tagClose\": \"\\n</blockquote>\",\n \"sampleText\": \"Block quote\"}\n// Table\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/commons/0/04/Button_array.png\",\n \"speedTip\": \"Insert a table\",\n \"tagOpen\": '{| class=\"wikitable\"\\n|-\\n',\n \"tagClose\": \"\\n|}\",\n \"sampleText\": \"! header 1\\n! header 2\\n! header 3\\n|-\\n| row 1, cell 1\\n| row 1, cell 2\\n| row 1, cell 3\\n|-\\n| row 2, cell 1\\n| row 2, cell 2\\n| row 2, cell 3\"}\n}", "__createMerchantButton() {\n const market_button = document.createElement(\"button\");\n market_button.id = \"gold_manager__button\";\n market_button.textContent = \"Visit merchant >\";\n market_button.style.background = \"none\";\n market_button.style.border = \"none\";\n market_button.addEventListener(\"click\", async function () {\n await this.openStore();\n }.bind(this));\n market_button.addEventListener(\"mouseenter\", function () {\n this.style.color = \"red\";\n });\n\n market_button.addEventListener(\"mouseleave\", function () {\n this.style.color = \"Black\";\n });\n return market_button;\n }", "function createToolbarButton(options, enableActions, enableTooltips, shortcuts, markup, parent) {\n options = options || {};\n var el = document.createElement(markup);\n\n // Add 'custom' attributes as early as possible, so that 'official' attributes will never be overwritten.\n if (options.attributes) {\n for (var attribute in options.attributes) {\n if (Object.prototype.hasOwnProperty.call(options.attributes, attribute)) {\n el.setAttribute(attribute, options.attributes[attribute]);\n }\n }\n }\n\n var classNamePrefix = parent.options.toolbarButtonClassPrefix ? parent.options.toolbarButtonClassPrefix + '-' : '';\n el.className = classNamePrefix + options.name;\n el.setAttribute('type', markup);\n enableTooltips = (enableTooltips == undefined) ? true : enableTooltips;\n\n if (options.text) {\n el.innerText = options.text;\n }\n\n // Properly handle custom shortcuts\n if (options.name && options.name in shortcuts) {\n bindings[options.name] = options.action;\n }\n\n if (options.title && enableTooltips) {\n el.title = createTooltip(options.title, options.action, shortcuts);\n\n if (isMac) {\n el.title = el.title.replace('Ctrl', '⌘');\n el.title = el.title.replace('Alt', '⌥');\n }\n }\n\n if (options.title) {\n el.setAttribute('aria-label', options.title);\n }\n\n if (options.noDisable) {\n el.classList.add('no-disable');\n }\n\n if (options.noMobile) {\n el.classList.add('no-mobile');\n }\n\n // Prevent errors if there is no class name in custom options\n var classNameParts = [];\n if (typeof options.className !== 'undefined') {\n classNameParts = options.className.split(' ');\n }\n\n // Provide backwards compatibility with simple-markdown-editor by adding custom classes to the button.\n var iconClasses = [];\n for (var classNameIndex = 0; classNameIndex < classNameParts.length; classNameIndex++) {\n var classNamePart = classNameParts[classNameIndex];\n // Split icon classes from the button.\n // Regex will detect \"fa\", \"fas\", \"fa-something\" and \"fa-some-icon-1\", but not \"fanfare\".\n if (classNamePart.match(/^fa([srlb]|(-[\\w-]*)|$)/)) {\n iconClasses.push(classNamePart);\n } else {\n el.classList.add(classNamePart);\n }\n }\n\n el.tabIndex = -1;\n\n if (iconClasses.length > 0) {\n // Create icon element and append as a child to the button\n var icon = document.createElement('i');\n for (var iconClassIndex = 0; iconClassIndex < iconClasses.length; iconClassIndex++) {\n var iconClass = iconClasses[iconClassIndex];\n icon.classList.add(iconClass);\n }\n el.appendChild(icon);\n }\n\n // If there is a custom icon markup set, use that\n if (typeof options.icon !== 'undefined') {\n el.innerHTML = options.icon;\n }\n\n if (options.action && enableActions) {\n if (typeof options.action === 'function') {\n el.onclick = function (e) {\n e.preventDefault();\n options.action(parent);\n };\n } else if (typeof options.action === 'string') {\n el.onclick = function (e) {\n e.preventDefault();\n window.open(options.action, '_blank');\n };\n }\n }\n\n return el;\n}", "function createButton (text) {\n //console.log(\"Creating a button\");\n var element = document.createElement(\"BUTTON\");\n var textNode = document.createTextNode(text);\n element.appendChild(textNode);\n return element;\n }", "_initToolbar() {\n if (this._$toolbar) {\n return this._$toolbar;\n }\n const $toolbar = this._$websiteDocument.createElement('div');\n $toolbar.classList.add(this.utils.cls('_toolbar'));\n $toolbar.setAttribute('s-carpenter-website-ui', 'true');\n this._$toolbar = $toolbar;\n const html = [];\n html.push(`\n <div class=\"_title\"></div>\n `);\n if (this.props.features.node.save) {\n html.push(`\n <button s-carpenter-app-action=\"save\" class=\"_save\" confirm=\"Save?\">\n ${this.props.icons.save}\n </button>\n `);\n }\n html.push(`\n <button s-carpenter-app-action=\"edit\" class=\"_edit\">\n ${this.props.icons.edit} <span>Edit</span>\n </button>\n `);\n if (this.props.features.node.delete) {\n html.push(`\n <button s-carpenter-app-action=\"delete\" class=\"_delete\" confirm=\"Confirm?\">\n ${this.props.icons.delete}\n </button>\n `);\n }\n this._$toolbar.innerHTML = html.join('');\n // append toolbar to viewport\n this._$websiteDocument.body.appendChild($toolbar);\n return this._$toolbar;\n }", "static addCoffeeTeaBtn(){\n const coffeeTeaBtn = document.createElement('button')\n coffeeTeaBtn.innerText = \"Coffee & Tea Items\"\n smallBizBtns.append(coffeeTeaBtn)\n\n coffeeTeaBtn.addEventListener('click', this.handleCoffeeTeaFilter)\n }", "function addAddEventButton() {\n\t$('#add_event_span').html('' + '<button ' +\n\t\t'id=\"add_event_button\" ' +\n\t\t'class=\"btn btn-large btn-block btn-primary\"' +\n\t\t' type=\"button\">Add event</button><br/>');\n}", "build() {\n \n // create a container for the header\n this.button = document.createElement(\"input\");\n this.button.setAttribute(\"type\", \"button\");\n this.button.value = this.buttonText;\n \n return this.button;\n }", "function createInsertButton(panel, translator) {\n const trans = (translator || nullTranslator).load('jupyterlab');\n return new ToolbarButton({\n icon: addIcon,\n onClick: () => {\n NotebookActions.insertBelow(panel.content);\n },\n tooltip: trans.__('Insert a cell below')\n });\n }", "function addCannedResponseButton() {\n var spacer = document.createElement('div'),\n button = document.createElement('button'),\n i = document.createElement('i');\n\n spacer.classList.add(\"d-editor-spacer\");\n button.classList.add(\"ember-view\", \"btn\", \"no-text\", \"canned-response\");\n button.setAttribute(\"id\", \"canned-response-button\");\n button.setAttribute(\"title\", \"Canned responses\");\n button.setAttribute(\"aria-label\", \"Canned responses\");\n i.classList.add(\"fa\", \"fa-pencil-square-o\");\n\n ebb.appendChild(spacer);\n button.appendChild(i);\n ebb.appendChild(button);\n }", "create($parent) {\n $(`<button id=\"${this.idDOM}\" class=\"${this.cssClass}\" type=\"button\">${this.active ? this.activeText : this.inactiveText}</button>`)\n .appendTo($parent)\n .click(() => this.onClick());\n }", "function createTrace() {\n\ttraceButton = createButton(\"Trace ON\");\n\ttraceButton.id(\"mainButton\");\n\ttraceButton.position(traceX, traceY);\n\ttraceButton.style(\"background-color\", \"green\");\n\ttraceButton.mousePressed(traceToggle);\n}", "function addToolbarButton() {\r\n var navBar = document.getElementById('nav-bar');\r\n if (!navBar) {\r\n return;\r\n };\r\n \r\n //Main Button\r\n var btn = document.createElement('toolbarbutton'); \r\n btn.setAttribute('id', 'reportButton'); //id de l'element\r\n btn.setAttribute('tooltiptext', 'Report bug'); // text on hover\r\n btn.setAttribute('type', 'menu-button'); //menu-button permet d'afficher la petite fleche pour le menu\r\n btn.setAttribute('class', 'toolbarbutton-1'); //permet d'encadrer le bouton\r\n btn.setAttribute('image', data.url('img/GreyMainIcon.png'));\r\n btn.setAttribute('orient', 'horizontal');\r\n btn.setAttribute('label', 'Report');\r\n \r\n \r\n //menu popup\r\n var menupopup = document.createElement('menupopup');\r\n menupopup.setAttribute('id', 'menupopup');\r\n \r\n \r\n //menu items\r\n var menuitem1 = document.createElement('menuitem');\r\n menuitem1.setAttribute('id', 'menuitem1');\r\n menuitem1.setAttribute('label', 'Default Values');\r\n menuitem1.setAttribute('class', 'menuitem-iconic');\r\n menuitem1.addEventListener('command', function(event) {\r\n Panels.manageMenu(2, \"Hide\");\r\n Panels.manageMenu(3, \"Hide\");\r\n Panels.manageMenu(1, \"Show\");\r\n event.stopPropagation();\r\n }\r\n , false);\r\n \r\n var menuitem2 = document.createElement('menuitem'); \r\n menuitem2.setAttribute('id', 'menuitem2');\r\n menuitem2.setAttribute('label', 'Configuration');\r\n menuitem2.addEventListener('command', function(event) {\r\n Panels.manageMenu(1, \"Hide\");\r\n Panels.manageMenu(3, \"Hide\");\r\n Panels.manageMenu(2, \"Show\");\r\n event.stopPropagation();\r\n }\r\n , false);\r\n \r\n var menuitem3 = document.createElement('menuitem'); \r\n menuitem3.setAttribute('id', 'menuitem3');\r\n menuitem3.setAttribute('label', 'Documentation');\r\n menuitem3.addEventListener('command', function(event) {\r\n Panels.manageMenu(1, \"Hide\");\r\n Panels.manageMenu(2, \"Hide\");\r\n Panels.manageMenu(3, \"Show\");\r\n event.stopPropagation();\r\n }\r\n , false);\r\n \r\n //construction des dépendances\r\n menupopup.appendChild(menuitem1);\r\n menupopup.appendChild(menuitem2);\r\n menupopup.appendChild(menuitem3);\r\n\tbtn.appendChild(menupopup);\r\n navBar.appendChild(btn);\r\n \r\n}", "function buttonFunc() {\n var btn = document.createElement(\"BUTTON\");\n btn.innerHTML = \"MFF!\";\n document.body.appendChild(btn);\n}", "createTagButtons() {\n this.parentElement.append(this.getTagButtonContent());\n }", "function addDisemvowelButton()\r\n{\r\n\tvar bar = ensureButtonBar();\r\n\t\r\n\tvar butt = document.createElement('input');\r\n\tbutt.id = 'ed_disemvowel_gm';\r\n\tbutt.className = 'ed_button';\r\n\tbutt.setAttribute('type', 'button');\r\n\tbutt.setAttribute('value', 'Disemvowel');\r\n\tbutt.setAttribute('title', 'Irreversibly remove all vowels from the comment text.');\r\n\tbutt.addEventListener('click', disemvowelOnce, false);\r\n\t\r\n\tbar.appendChild(butt);\r\n}", "function getTransportBar() {\n const b = document.createElement('button');\n b.innerText = 'PRESS';\n return b;\n }", "function createEnterButton()\n{\n\tvar buttonCreated = document.createElement('button');\n\tvar buttonText = document.createTextNode(\"Show me the mad lib!\");\n\n\tbuttonCreated.setAttribute('type','submit');\n\tbuttonCreated.setAttribute('onclick','enterButtonClicked()');\n\tbuttonCreated.setAttribute('id', 'submit-button');\n\n\tbuttonCreated.appendChild(buttonText);\n\n\tdocument.getElementById('madlibs-entry').appendChild(buttonCreated);\n}", "function createButton() {\n const parent = $('#my_indv_tab')\n\n const button = $('<div>').attr({\n id: 'get_cal',\n type: 'button',\n name: 'Download',\n style: 'padding:5px; margin:0px 10px 10px 0px; font-weight:600; font-size:115%; background-color:#F26A38; color:white; float:left; cursor:pointer;'\n })\n\n parent.prepend(button)\n\n $('#get_cal').html('Download Calendar')\n $('#get_cal').on('click', main)\n\n checkPeriod()\n}", "function makeNextButton() {\n \t\t// Set up styling for the button\n \t var styleSheet = placeholder.parentNode.appendChild(document.createElement('style'));\n \t styleSheet.innerHTML = \"#SpaceBar {color:#000000;text-align:center;margin-left:auto; margin-right:auto; border:none; width: 640px; background-color: #ff6688; font-family: Courier, sans-serif; font-size: 14px; font-weight:bold; cursor: pointer; text-transform:uppercase;}\";\n \t // Now create the button element below the demo screen.\n \t nextButton = placeholder.parentNode.appendChild(document.createElement('div'));\n \t nextButton.type = \"button\";\n \t nextButton.innerHTML = \"Press the any key for the Credits Screen!!!!!!\";\n \t nextButton.id = \"SpaceBar\";\n \t nextButton.style.opacity = \"0\";\t\t\t\t\t\t\t// Hide at first.\n \t nextButton.addEventListener('mousedown', spaceBar);\t\t// Set up click events (Yes, you can click it even when it's hidden!)\n \t nextButton.addEventListener('touchend', spaceBar);\n \t}", "function appendButton(cont, oncommand, attr)\n{\n var btn = document.createElement(\"button\");\n if (attr)\n for (var a in attr)\n btn.setAttribute(a, attr[a]);\n if (oncommand)\n btn.setAttribute(\"oncommand\", \"gPrefWindow.\" + oncommand + \"(this);\");\n else\n btn.setAttribute(\"disabled\", \"true\");\n cont.appendChild(btn);\n}", "function createButtonHTML(button) {\n return '<li class=\"'+ button.styleClassDisabled +'\" id=\"' + button.id + '\" ' +'onclick=\"toggleAction(\\'' + button.id + '\\');\"'+\n '\">'+\n //'<a href=\"#\">' +\n '<img ' +\n 'alt=\"' + button.alt + '\" ' +\n 'title=\"' + button.alt + '\" ' +\n 'id=\"' + button.id + '-img\" ' +\n 'src=\"' + button.imageSrcDisabled + '\" ' +\n '/>' +\n //(button.label ? ('<div class=\"toolbar-button-label\">'+ button.label+'</div>') :'')+\n //'</a>'+\n '</li>';\n}//createButtonHTMLbutton()", "createNew(panel, context) {\n let callback = () => {\n NotebookActions.runAll(panel.content, context.sessionContext);\n };\n let button = new ToolbarButton({\n className: 'myButton',\n iconClass: 'fast-forward',\n icon: fastForwardIcon,\n onClick: callback,\n tooltip: 'Run all cells',\n label: 'RunAll'\n });\n console.log('new ButtonExtension with: ' + context.contentsModel)\n panel.toolbar.insertItem(10, 'runAll', button);\n return new DisposableDelegate(() => {\n button.dispose();\n });\n }", "function createOverrideDom(){\n\n var btn = document.getElementById(\"wearHF_root_button\")\n\n if(btn != undefined)\n document.body.removeChild(btn);\n // Lets make sure its not already made\n var btn = document.createElement(\"BUTTON\"); // Create a <button> element\n btn.id = \"wearHF_root_button\";\n\n var t = document.createTextNode(\"hf_wearml_override:\" + generateXML()); // Create a text node\n btn.appendChild(t); // Append the text to <button>\n btn.style.top = 0;\n btn.style.left = 0;\n btn.style.opacity = \"0.01\";\n btn.style.position = \"fixed\";\n // Get a reference to the first child\n var theFirstChild = document.body.firstChild;\n // document.body.appendChild(btn);\n document.body.insertBefore(btn, theFirstChild);\n}", "function InitOMButton(){\n objWindow.AddToolButton(\"document\", \"OMButton\", \"Org2Wiz\", \"\", \"OnOMButtonClicked\");\n\n var omAttachmentsOption = otw_getAttachOption();\n if((omAttachmentsOption === 'addtex') || (omAttachmentsOption === 'addpdf') || (omAttachmentsOption === 'addtexpdf')){\n objWindow.AddToolButton(\"document\", \"OMAttach\", \"AddAttach\", \"\", \"OnOMAttachClicked\");\n }\n}", "activateButton(){\n //If the button already exists, we want to remove and rebuilt it\n if(this.button)\n this.button.dispose();\n\n //Create button called but with Activate SpeedBoost as its text\n this.button = Button.CreateSimpleButton(\"but\", \"Activate\\nSpeedBoost\");\n this.button.width = 0.8;\n this.button.height = 0.8;\n this.button.color = \"white\";\n this.button.background = \"red\";\n this.button.alpha = 0.8;\n this.stackPanel.addControl(this.button);\n //Scope these attributes so they can be used below\n var button = this.button;\n var app = this.app;\n\n //Function for if they click it\n //Function is a member of the button object, not of this class\n this.button.onPointerDownObservable.add(function() {\n if(button.textBlock.text != \"Activate\\nSpeedBoost\")\n return;\n app.buttonPressed(\"speedBoost\");\n button.textBlock.text = \"SpeedBoost\\nActivated\";\n }); \n }", "function newPngButton() {\n const pngLink = document.createElement('button');\n pngLink.type = 'button';\n pngLink.className = 'export';\n pngLink.title = 'Export PNG';\n pngLink.textContent = 'PNG';\n return pngLink;\n}", "function makeBtn() {\n // Deleting the gifs prior to adding new gifs\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#btnDump\").empty();\n // Looping through the array of movies\n for (var i = 0; i < topics.length; i++) {\n var b = $(\"<button>\");\n b.addClass(\"gifButton\");\n // Adding a data-attribute\n b.attr(\"data-subject\", topics[i]);\n // Providing the initial button text\n b.text(topics[i]);\n // Adding the button to the HTML\n $(\"#btnDump\").append(b);\n }\n }", "function createButtons () {\r\n $(\".toc-parent\").prepend (\"<button>+</button>\");\r\n $(\".toc-leaf\").prepend (\"<button>.</button>\");\r\n}", "function createButtons()\r\n{\r\n if (!button)\r\n {\r\n button = document.createElement(\"div\");\r\n button.innerHTML = \"<center><div id='remove_activity_buttons'> \\\r\n\t\t<span id=\\\"expand_all_older_posts_button\\\" style='margin-bottom: 10px; margin-left:10px; padding:3px 8px' class='uiButton uiButtonDefault uiButtonMedium'>Wall Auto Expander</span>\";\r\n var a;\r\n\t\ta = $('#profile_stream_blankstate');\r\n\t\tif (a.length)\r\n\t\t\t$(button).insertBefore($('#profile_stream_blankstate'));\r\n\t\ta = $('#pagelet_event_wall');\r\n\t\tif (a.length)\r\n\t\t\t$(button).insertBefore($('#pagelet_event_wall'));\r\n\t\ta = $('#MessagingMainContent');\r\n\t\tif (a.length)\r\n\t\t\t$(button).insertBefore($('#MessagingMainContent'));\r\n\t\t// Third button\r\n $('#expand_all_older_posts_button').click(function()\r\n {\r\n expandOlderPosts(true);\r\n });\r\n }\r\n}", "renderButton () {\n this.btnWatchAd = new IconButton({\n game: this.game,\n x: 0,\n y: this.mainFrame.height / masterScale(2),\n scale: 1.3,\n key: 'start-screen-bottom',\n callback: () => this.playAd(),\n callbackContext: this,\n outFrame: 'button_empty.png',\n overFrame: 'button_empty.png',\n downFrame: 'button_empty.png',\n upFrame: 'button_empty.png'\n });\n\n this.btnWatchAd.input.priorityID = 16; // mid priority\n\n this.btnWatchAd.anchor.set(0.5);\n\n this.txtStyle.fontSize = 48;\n const txtWatchAd = this.game.add.text(5, 0, 'Watch Ad', this.txtStyle);\n txtWatchAd.anchor.set(0.5);\n\n this.btnWatchAd.addChild(txtWatchAd);\n\n this.mainFrame.addChild(this.btnWatchAd);\n }", "function initThreadButton() { \n var addThreadButton = getCustomButton('Add New Thread', 'addThreadButton');\n addThreadButton.set('class', 'grid_2');\n var img = new Element('img', {\n 'src' : 'images/add.png',\n styles: {\n marginRight: '2px'\n }\n });\n addThreadButton.addEvent('click', function(){\n if($('newThreadForm') == null) {\n var threadForm = new ThreadForm();\n threadForm.display().inject($('formArea'));\n }\n });\n img.inject(addThreadButton, 'top');\n addThreadButton.inject($('buttonArea'));\n}", "function createcitybtn(city) {\n var citybutton = $(\"<button>\").addClass(\"citybutton button\");\n citybutton.text(city);\n $(\"#citylist\").append(citybutton);\n $(\"#citylist\").append(\"<br />\");\n}", "init() { // Write the button to the dom\n const spacer = '<li class=\"acl-write separator\"></li>';\n var buttonHTML = '<li class=\"acl-write\" id=\"button1\"><a class=\"grouped-left\" data-l10n-id=\"pad.toolbar.add_buttons.title\" title=\"Task list Checkbox\"><span class=\"buttonicon buttonicon-add_buttons\"></span></a></li>';\n $('.menu_left').append(spacer);\n $('.menu_left').append(buttonHTML);\n\n var buttonHTML = '<li class=\"acl-write\" id=\"button2\"><a class=\"grouped-right\" data-l10n-id=\"pad.toolbar.add_buttons.title\" title=\"Task list Checkbox\"><span class=\"buttonicon buttonicon-add_buttons\"></span></a></li>';\n $('.menu_left').append(buttonHTML);\n\n $('#button1, #button2').click(() => {\n exports.add_buttons.onButton();\n });\n }", "function addSpeakButton() {\n const excersice = document.querySelector(excersiceSelector)\n const speakerButton = document.createElement('button');\n speakerButton.setAttribute('class', 'speaker-button');\n excersice.insertAdjacentElement('afterend', speakerButton);\n speakerButton.addEventListener('click', speakExcersie);\n}", "function mobileKeyboard(){\n \n\n for (i=0; i < letterArray.length; i++){\n var btn = document.createElement(\"BUTTON\"); \n btn.className = \"mobile-button\";\n btn.id = letterArray[i]; \n var t = document.createTextNode(letterArray[i]);\n btn.appendChild(t); \n document.body.appendChild(btn); \n }\n}", "function addBtn(){\n\t//disable add button until screen is returned to focus. Issue #28\n\t$.addTransect.enabled = false;\n\t\n\tvar addTransect = Alloy.createController(\"addTransect\", {siteGUID: $.tbl.siteGUID}).getView();\n\tvar nav = Alloy.Globals.navMenu;\n\tnav.openWindow(addTransect);\n}", "function buttonSetter(){\n footer.appendChild(btnUp)\n btnUp.innerHTML = '^';\n btnUp.setAttribute('onClick',\"goToTop()\");\n \n}", "function createButton(btnFunction) {\n\t var btn = document.createElement(\"button\");\n\t var btnDisplay = document.createTextNode(btnFunction);\n\t btn.appendChild(btnDisplay);\n\t \n\t switch (btnFunction) {\n\t\t case \"Up\":\n\t\t\tdocument.getElementById(\"BtnUp\").appendChild(btn);\n\t\t\tbreak;\n\t\t case \"Down\":\n\t\t\tdocument.getElementById(\"BtnDown\").appendChild(btn);\n\t\t\tbreak;\n\t\t case \"Left\":\n\t\t\tdocument.getElementById(\"BtnLeft\").appendChild(btn);\n\t\t\tbreak;\n\t\t case \"Right\":\n\t\t\tdocument.getElementById(\"BtnRight\").appendChild(btn);\n\t\t\tbreak;\n\t\t case \"Mark Cell\":\n\t\t\tdocument.getElementById(\"BtnMarkCell\").appendChild(btn);\n\t\t\tbreak;\n\t\t default:\n\t\t\tbreak;\n\t }\n}", "function addDownloadButtonModern(){\n\t\n\t\n\t\tvar form = window.document.getElementById('iFrameWidget-0').contentWindow.document.getElementById('courseFormActions');\n\t\tvar toolbar = form.getElementsByTagName('span')[0];\n\t\tconsole.log(toolbar);\n\t\t\n\t\t// var toolbar = window.document.getElementById('courseFormActions:j_id135');\n\t\t\n\t\t\n\t\tvar li = document.createElement('li');\n\t\tvar a = document.createElement('a');\n\t\ta.innerHTML = 'test';\n\t\ta.className='edit no-text route-button-text';\n\t\ta.style.backgroundPosition = \"-2px -1136px\";\n\t\t\n\n\t\ta.target = '_blank';\n\n\t\tli.appendChild(a);\n\t\t\n\t\tvar firstChild = toolbar.childNodes[0];\n\t\t\n\t\ttoolbar.insertBefore(li, firstChild);\n\n\t\treturn a;\n}", "function createButton(clsName,btntype,btnid,btnparrent,slug){\n const button = document.createElement(\"button\")\n //button.className = \"close\"\n button.className = clsName\n button.type = btntype\n button.id = btnid\n button.innerHTML = btnid\n button.addEventListener(\"click\",(e) => {\n e.preventDefault()\n let country = slug\n let status = btnid\n let url = \"https://api.covid19api.com/dayone/country/\" + country + \"/status/\" + status\n console.log(url)\n getval(url).then(values => {renderChart(values,\"canvas2\")})\n })\n btnparrent.appendChild(button)\n}", "function ensureButtonBar()\r\n{\r\n\tvar butts = document.getElementById('ed_toolbar');\r\n\tif(!butts)\r\n\t{\r\n\t\t//create quicktags div\r\n\t\tvar qts = document.createElement('div');\r\n\t\tqts.id = 'quicktags';\r\n\t\t\r\n\t\t//insert quicktags div\r\n\t\tvar contentBox = document.getElementById('content').parentNode;\r\n\t\tcontentBox.parentNode.insertBefore(qts, contentBox);\r\n\t\t\r\n\t\t//create ed_toolbar div\r\n\t\tbutts = document.createElement('div');\r\n\t\tbutts.id = 'ed_toolbar';\r\n\t\t\r\n\t\t//insert ed_toolbar div\r\n\t\tqts.appendChild(butts);\r\n\t}\r\n\treturn butts;\r\n}", "function createButton() {\n var newButton = new HmiObject();\n newButton.uid = Date.now();\n newButton.typeId = 'button';\n newButton.type = 'button';\n return newButton;\n }", "addButtonToToolbar() {\n const undos = ['Undo', 'Redo'];\n\n for (const undoType of undos) {\n const div = document.createElement('div');\n const undoMenu = document.createElement('button');\n undoMenu.id = `ribs-wysiwyg-toolbar-undoRedo-${undoType}`;\n undoMenu.classList.add('disabled');\n undoMenu.innerHTML = undoType;\n undoMenu.addEventListener('click', (event) => this.undoRedo(event, undoType));\n div.append(undoMenu);\n this.toolbarDiv.append(div);\n sessionStorage.removeItem('undoCount');\n sessionStorage.removeItem('redoCount');\n }\n }", "function myEnableButton(){\n\n\t\t\tvar d2 = document.createElement(\"BUTTON\");\n\t\t\tvar t2 = document.createTextNode(\"Enable\");\n\t\t\td2.setAttribute(\"id\",\"blocke\");\n\t\t\td2.onclick =function ()\n\t\t\t\t {\n\t\t\t\t\t\t$(element).find(\"#\"+lastid).get(0).removeAttribute(\"readonly\");\n $(element).find(\"#\"+lastid).get(0).removeAttribute(\"style\", \"background-color: grey;\"); \n\t\t\t\t\t}\n\t\t\td2.appendChild(t2);\t\t\t\n\t\t \n $(element).find(\"#hello\").get(0).appendChild(d2); \n\t\n\t\t\tvar line = document.createElement(\"BR\");\n\t\t\tdocument.body.appendChild(line);\n\t\t\tdocument.body.appendChild(line);\n\t\t\tdocument.body.appendChild(line);\t\n\t\t\t\n\t\t\tvar line = document.createElement(\"BR\");\n\t\t\t\n document.getElementById(\"hello\").appendChild(line);\n\t\t}", "function addButton(location) {\n let button = $(\"<button>\");\n button.addClass(\"list-group-item list-group-item-action city-button bgWhiteTransparent\");\n button.attr(\"type\", \"button\");\n button.attr(\"data-city\", location);\n button.text(location)\n $(\"#history\").prepend(button);\n}", "createButton(x, y, text, callback){\n const button = this.add.text(x, y, text, { fill: '#0f0' });\n button.setOrigin(0.5, 0.5);\n button.setInteractive()\n .on('pointerup', () => callback())\n .on('pointerover', () => this.enterButtonHoverState(button) )\n .on('pointerout', () => this.enterButtonRestState(button) );\n return button;\n }", "function newLayerButton (canvasState) {\n return button('button', {\n on: {\n click: () => {\n // Create and append a new layer, saving undo/redo history actions for it\n const layer = Layer(canvasState)\n canvasState.addLayer(layer)\n }\n }\n }, [icon('plus'), ' Layer'])\n}", "addButtonToToolbar() {\n const lists = ['OrderedList', 'UnorderedList'];\n\n for (const listType of lists) {\n const div = document.createElement('div');\n const indentMenu = document.createElement('button');\n indentMenu.id = `ribs-wysiwyg-toolbar-lists-${listType}`;\n indentMenu.innerHTML = listType;\n indentMenu.addEventListener('click', () => this.createLists(listType));\n div.append(indentMenu);\n this.toolbarDiv.append(div);\n }\n }", "function startScreen() {\n var div = document.getElementById('insertHere');\n var btn = document.createElement('button');\n\n var txt = document.createTextNode(String(\"START\"));\n btn.appendChild(txt);\n\n btn.setAttribute('type', 'button');\n \n btn.setAttribute('id', 'button1' );\n btn.setAttribute('class', 'btn btn-primary btn-lg btn-block');\n div.appendChild(btn);\n\n }", "function toolbarAddIns(toolbarobj) {\n toolbarobj.add({id: \"insert\", hint: javaMessages.ins_line, icon: \"fa fa-plus\", caption: \"\", type: \"button\"});\n}", "function btnCreate() {\n\n // number counter, used to give each topic a unique identifier\n num++;\n\n // creation of the dynamic buttons\n userBtn = $(\"<button>\")\n userBtn\n .addClass(\"btn search-term-btn dynamicElement\")\n .appendTo($(\".btn-holder\"))\n .text(topics)\n .attr(\"data-name\", topics);\n\n // pushes the topic out of the array, into a new \"used\" array, this is used as a flag.\n usedTopics.push(topics + num);\n topics = [];\n console.log(num);\n\n\n // create space between buttons ___ Ying\n space = $(\"<span>\")\n\n space\n .text(\"\\xa0\\xa0\")\n .appendTo($(\".btn-holder\"));\n\n\n }", "function addInstrument() {\r\n // Hide all elements with class=\"tabcontent\" by default */\r\n\tvar btn = document.createElement(\"INPUT\"); // Create a <button> element\r\n\tvar txt = document.createTextNode(\"Instrument\"); // Create a <button> element\r\n\tvar div = document.createElement(\"DIV\"); // Create a <button> element\r\n\tdocument.body.appendChild(txt);\r\n\tdocument.body.appendChild(btn);\r\n\tdocument.body.appendChild(div);\r\n}", "function createBoxButtons(){\n\t//creates the toolbar\n\tvar tb = Ext.create('Ext.toolbar.Toolbar', {\n\t\tid:'BoxButtonsToolbar',\n\t\titems: [{\n\t\t\tid:'btnLogin',\n\t\t\t//text: 'Login',\n\t\t\ticonAlign:'top',\n\t\t\ticonCls: 'icon-login',\n\t\t\ttooltip: 'Clique para fazer login no sistema',\n\t\t\twidth:60,\n\t\t\theight:50,\n\t\t\thandler: function(){\n\t\t\t\tcreateLoginForm();\n\t\t\t}\n\t\t},\n\t\t\t'->'\n\t\t,{\n\t\t\tid:'btnCadastro',\n\t\t\t//text: 'Cadastro',\n\t\t\ticonAlign:'top',\n\t\t\ticonCls: 'icon-cadastrar',\n\t\t\tcls: 'makeVisible',\n\t\t\ttooltip: 'Cadastrar um novo usuário',\n\t\t\twidth:60,\n\t\t\theight:50,\n\t\t\thandler: function(){\n\t\t\t\tcreateRegisterForm();\n\t\t\t}\n\t\t},{\n\t\t\tid:'btnLogout',\n\t\t\t//text: 'Logout',\n\t\t\thidden:true,\n\t\t\ticonAlign:'top',\n\t\t\ticonCls: 'icon-logout',\n\t\t\ttooltip: 'Sair do sistema',\n\t\t\tcls: 'makeVisible',\n\t\t\twidth:60,\n\t\t\theight:50,\n\t\t\thandler: function(){\n\t\t\t\t//createRegisterForm();\n\t\t\t\tlocation.href = 'logout.php';\n\t\t\t}\n\t\t}]\n\t});\n\n\n\t//creates the filter window overlaying the map\n var win = new Ext.Window({\n\t\tid:'BoxButtons',\n\t\tcls: 'makeInvisible',\n\t\t//layout:'fit',\n\t\t//width: 140,\n\t\tborder:false,\n\t\tresizable:false,\n\t\theader:false,\n items: [tb]\n });\n win.show();\n\n}", "function createVREnabler () {\n var enable_vr_button = document.createElement('button');\n enable_vr_button.className = 'switch_to_vr';\n enable_vr_button.addEventListener('click',enableVR);\n enable_vr_button.innerHTML = 'Enable VR';\n document.body.appendChild(enable_vr_button);\n\n return enable_vr_button;\n}", "function TabControl_CreateTabButton(theHTML, strTabText, nIndex, nInterfaceLook, bEnabled, style)\n{\n\t//create a div\n\tvar button = theHTML.ButtonPanel.appendChild(document.createElement(\"div\"));\n\t//set special values\n\tbutton.InterpreterObject = theHTML.InterpreterObject;\n\tbutton.noWrap = true;\n\tbutton.Exception = strTabText;\n\tbutton.Index = nIndex;\n\tbutton.Selected = false;\n\tbutton.Visible = true;\n\tbutton.Enabled = bEnabled;\n\tbutton.TabStyle = style;\n\tbutton.BordersRadius = theHTML.InterpreterObject.Properties[__TABS_PROPERTY_BORDER_RADIUS];\n\t//button enabled\n\tif (button.Enabled)\n\t{\n\t\t//add event\n\t\tBrowser_AddEvent(button, __BROWSER_EVENT_CLICK, TabControl_TabButton_MouseDown);\n\t}\n\t//get button size\n\tbutton.Size = { w: Get_Number(button.InterpreterObject.Properties[__NEMESIS_PROPERTY_ITEM_WIDTH], 0), h: Get_Number(button.InterpreterObject.Properties[__NEMESIS_PROPERTY_ITEM_HEIGHT], 0) };\n\t//switch on look\n\tswitch (nInterfaceLook)\n\t{\n\t\tdefault:\n\t\t\t//button not enabled?\n\t\t\tif (!button.Enabled)\n\t\t\t{\n\t\t\t\t//set opacity (same as toolbar)\n\t\t\t\tBrowser_SetOpacity(button, 30);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//add mouseover listener\n\t\t\t\tBrowser_AddEvent(button, __BROWSER_EVENT_MOUSEOVER, TabControl_TabButton_MouseOver);\n\t\t\t\tBrowser_AddEvent(button, __BROWSER_EVENT_MOUSEOUT, TabControl_TabButton_MouseOut);\n\t\t\t}\n\t\t\t//set its values\n\t\t\tbutton.style.cssText = \"position:absolute;white-space:nowrap;\";\n\t\t\t//set the update display\n\t\t\tbutton.UpdateDisplay = TabControl_TabButton_UpdateDisplay;\n\t\t\t//and trigger it immediately\n\t\t\tbutton.UpdateDisplay();\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_CORBUS:\n\t\t\t//set its values\n\t\t\tbutton.style.cssText = \"position:absolute;padding:3px;white-space:nowrap;\";\n\t\t\tbutton.style.backgroundColor = theHTML.style.backgroundColor;\n\t\t\tbutton.style.border = theHTML.InterpreterObject.Properties[__TABS_PROPERTY_BORDER_LOWLIGHT];\n\t\t\tbutton.Borders = \"1px solid #A3A3A3\";\n\t\t\tbutton.BordersRadius = theHTML.InterpreterObject.Properties[__TABS_PROPERTY_BORDER_RADIUS];\n\t\t\tbutton.innerHTML = TabControl_TabButton_ParseExceptionIntoText(strTabText, theHTML.InterpreterObject.DataObject.Id); // SAFE BY ENCODING\n\t\t\tbutton.UpdateDisplay = TabControl_TabButton_UpdateDisplayCorbus;\n\t\t\t//button not enabled?\n\t\t\tif (!button.Enabled)\n\t\t\t{\n\t\t\t\t//set opacity (same as toolbar)\n\t\t\t\tBrowser_SetOpacity(button, 30);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_BLUE_CRYSTAL:\n\t\t\t//set its values\n\t\t\tbutton.style.cssText = \"position:absolute;padding:3px;white-space:nowrap;\";\n\t\t\tbutton.style.backgroundColor = theHTML.style.backgroundColor;\n\t\t\tbutton.style.border = theHTML.InterpreterObject.Properties[__TABS_PROPERTY_BORDER_LOWLIGHT];\n\t\t\tbutton.Borders = \"1px solid #A3A3A3\";\n\t\t\tbutton.BordersRadius = theHTML.InterpreterObject.Properties[__TABS_PROPERTY_BORDER_RADIUS];\n\t\t\tbutton.innerHTML = TabControl_TabButton_ParseExceptionIntoText(strTabText, theHTML.InterpreterObject.DataObject.Id); // SAFE BY ENCODING\n\t\t\tbutton.UpdateDisplay = TabControl_TabButton_UpdateDisplayBlueCrystal;\n\t\t\t//button not enabled?\n\t\t\tif (!button.Enabled)\n\t\t\t{\n\t\t\t\t//set opacity (same as toolbar)\n\t\t\t\tBrowser_SetOpacity(button, 30);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_ENJOY:\n\t\tcase __NEMESIS_LOOK_SAP_TRADESHOW:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_DESIGN:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_CORBU:\n\t\t\t//set its sap look values\n\t\t\tbutton.style.cssText = \"position:absolute;white-space:nowrap;background-color:transparent;height:21px;\";\n\t\t\tbutton.UpdateDisplay = TabControl_TabButton_UpdateDisplaySAP;\n\t\t\t//create first tab part\n\t\t\tbutton.Part1 = button.appendChild(document.createElement(\"div\"));\n\t\t\tbutton.Part1.style.cssText = \"position:relative;width:21px;height:21px;vertical-align:middle;\" + __BROWSER_INLINE_BLOCK_CSS;\n\t\t\t//the second tab part (text one)\n\t\t\tbutton.Part2 = button.appendChild(document.createElement(\"div\"));\n\t\t\tbutton.Part2.style.cssText = \"position:relative;white-space:nowrap;height:21px;vertical-align:middle;\" + __BROWSER_INLINE_BLOCK_CSS;\n\t\t\tbutton.Part2.innerHTML = \"<div style='position:relative;top:3px;'>\" + TabControl_TabButton_ParseExceptionIntoText(strTabText, theHTML.InterpreterObject.DataObject.Id) + \"</div>\"; // SAFE BY ENCODING\n\t\t\t//the third part, the end of tabs\n\t\t\tbutton.Part3 = button.appendChild(document.createElement(\"div\"));\n\t\t\tbutton.Part3.style.cssText = \"position:relative;width:10px;height:21px;vertical-align:middle;\" + __BROWSER_INLINE_BLOCK_CSS;\n\t\t\t//switch on look\n\t\t\tswitch (nInterfaceLook)\n\t\t\t{\n\t\t\t\tcase __NEMESIS_LOOK_SAP_ENJOY:\n\t\t\t\t\tbutton.Part1.style.backgroundImage = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_sapenjoy_tab_bgs.png')\";\n\t\t\t\t\tbutton.Part3.style.backgroundImage = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_sapenjoy_tab_bgs.png')\";\n\t\t\t\t\tbutton.Part2.BG_SELECTED = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_sapenjoy_tab_bgtextselected.png')\";\n\t\t\t\t\tbutton.Part2.BG_UNSELECTED = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_sapenjoy_tab_bgtextunselected.png')\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase __NEMESIS_LOOK_SAP_TRADESHOW:\n\t\t\t\t\tbutton.Part1.style.backgroundImage = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_tradeshow_tab_bgs.png')\";\n\t\t\t\t\tbutton.Part3.style.backgroundImage = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_tradeshow_tab_bgs.png')\";\n\t\t\t\t\tbutton.Part2.BG_SELECTED = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_tradeshow_tab_bgtextselected.png')\";\n\t\t\t\t\tbutton.Part2.BG_UNSELECTED = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_tradeshow_tab_bgtextunselected.png')\";\n\t\t\t\t\tbutton.Part2.FG_SELECTED = Get_Color(button.InterpreterObject.Properties[__NEMESIS_PROPERTY_FG_COLOR_DEFAULT], false);\n\t\t\t\t\tbutton.Part2.FG_UNSELECTED = Get_Color(button.InterpreterObject.Properties[__NEMESIS_PROPERTY_FG_COLOR_SELECTED], false);\n\t\t\t\t\tbreak;\n\t\t\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_DESIGN:\n\t\t\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_CORBU:\n\t\t\t\t\tbutton.Part1.style.backgroundImage = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_signature_tab_bgs.png')\";\n\t\t\t\t\tbutton.Part3.style.backgroundImage = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_signature_tab_bgs.png')\";\n\t\t\t\t\tbutton.Part2.BG_SELECTED = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_signature_tab_bgtextselected.png')\";\n\t\t\t\t\tbutton.Part2.BG_UNSELECTED = \"url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_signature_tab_bgtextunselected.png')\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//button not enabled?\n\t\t\tif (!button.Enabled)\n\t\t\t{\n\t\t\t\t//disable the text part\n\t\t\t\tBrowser_SetOpacity(button.Part2.firstChild, 30);\n\t\t\t}\n\t\t\tbreak;\n\t}\n\t//get button size\n\tbutton.Size = { w: Browser_GetOffsetWidth(button), h: Browser_GetOffsetHeight(button) };\n\t//return the new button\n\treturn button;\n}", "function addMainButonsMultiple(){\n var obj = $(tdpersonnalised.mainButtonDiv);\n\n obj.append(\"<button disabled title='\"+tdpersonnalised.ToSavetitle+\"' class=\\\"\" + tdpersonnalised.buttunClass+ \" \" + tdpersonnalised.ToSaveclass +\"\\\"><span class=\\\"\"+ tdpersonnalised.ToSaveglyph +\"\\\" aria-hidden=\\\"true\\\">\"+tdpersonnalised.ToSavetext+\"</span></button>\");\n\n\n }", "function OnGUI()\n{\n\tif(isActionGUIEnabled)\n\t{\n\t\tGUI.Box(actionGUIBox, \"\");\n\t\ttoolbarInt = GUI.Toolbar (Rect (Screen.width-buttonSize.x*3,0,buttonSize.x,buttonSize.y), toolbarInt, toolbarTextures);\n\t\t\n\t}\n}", "createButton(symbol, style) {\n\t\tlet b = $('<span>')\n\t\tb.addClass('btn border small m-1 p-1')\n\t\tb.addClass(style)\n\t\tb.html(symbol)\n\t\treturn b\n\t}", "function createDeleteButton() {\n const deleteButtonElement = document.createElement('button');\n deleteButtonElement.className = \"btn bg-transparent delete-button\";\n\n const trashImgElement = document.createElement(\"img\");\n trashImgElement.src = \"images/recycle.png\";\n\n deleteButtonElement.appendChild(trashImgElement);\n return deleteButtonElement;\n}", "function createBtn() {\n for (i = 0; i < topics.length; i++) {\n buttonsDiv.append(\"<button tvShow='\" + topics[i] + \"'>\" + topics[i] + \"</button>\");\n }\n}", "function CreateButton(id, text){\n this.button = document.createElement('button');\n this.button.id = id;\n this.button.innerHTML = text;\n document.getElementById('buttons').appendChild(this.button);\n}", "initButtons() {\n this.setupButton(\"efecBtn\", (e) => {\n\n })\n\n }", "function showButton() {\n let treeviz = _panelWindow.document.getElementById('treeVisualization');\n _panelWindow.document.getElementById('treeContainer').insertBefore(timeTravelButton, treeviz);\n }", "RenderButtonAction(Name = null, Action = null, TreeDotsAction = null){\n let Conteneur= NanoXBuild.DivFlexRowSpaceEvenly(null, \"ConteneurDevice Largeur\", null)\n let DivDevice = NanoXBuild.DivFlexRowStart(null, \"DeviceCard\", null)\n //let DivImage = NanoXBuild.DivFlexColumn(null, null, \"height: 100%; width: 20%; margin-right: 0.5rem;\")\n //DivImage.innerHTML = IconModule.Start()\n //DivDevice.appendChild(DivImage)\n DivDevice.appendChild(NanoXBuild.DivText(Name, null, \"Text\", \"\"))\n DivDevice.onclick = Action\n Conteneur.appendChild(DivDevice)\n // Div Trois points\n let DivTroisPoints = NanoXBuild.DivFlexRowStart(null, \"DeviceTroisPoints\", null)\n let DivImageTroisPoints = NanoXBuild.DivFlexColumn(null, null, \"height: 100%; width: 100%;\")\n DivImageTroisPoints.innerHTML = IconModule.ThreeDots()\n DivTroisPoints.appendChild(DivImageTroisPoints)\n DivTroisPoints.onclick = TreeDotsAction\n Conteneur.appendChild(DivTroisPoints)\n return Conteneur\n }", "setup(rootElement) {\n this.toolbar = rootElement;\n const selector = \"button[data-notetaker-type], input[data-notetaker-type]\";\n for (const widget of rootElement.querySelectorAll(selector)) {\n const widgetInfo = widgetTypes[widget.dataset.notetakerType];\n switch(widgetInfo.type) {\n case \"property\":\n let propertyGroup = this.properties[widgetInfo.property];\n propertyGroup.add(widget);\n break;\n case \"tool\":\n this.toolButtons.add(widget, {});\n break;\n case \"undo\":\n this.undoButtons.push(widget);\n widget.disabled = true;\n widget.addEventListener(\"click\", () => {\n this.activeNotetaker.undo();\n }, false);\n break;\n case \"redo\":\n this.redoButtons.push(widget);\n widget.disabled = true;\n widget.addEventListener(\"click\", () => {\n this.activeNotetaker.redo();\n }, false);\n break;\n }\n }\n // Now create all the NotetakerTools for the tool buttons. \n // Note: This must be done *after* creating the property widgets, \n // because the tool constructor checks to see how many property \n // widgets there are for each property, and acts accordingly. \n this.paperScope.activate(); // <-- IMPORTANT! To create paper.Tools\n for (const [button, data] of this.toolButtons.widgets) {\n const widgetInfo = widgetTypes[button.dataset.notetakerType];\n data.tool = new widgetInfo.controller(button, this);\n }\n this.toolButtons.currentTool.activate();\n }", "function appendButton(button){\n\tlet page = document.getElementById(\"buttonDiv\");\n\n\tpage.appendChild(button);\n\n}", "function setupButtons()\n{\n // Hacky-hacky-hack. Looks like the new toolkit does provide a solution,\n // but we need to support SeaMonkey too. :)\n \n var dialog = document.documentElement;\n dialog.getButton(\"extra1\").label = dialog.getAttribute(\"extra1Label\");\n}", "function createButton() {\n\t\tvar termLink = document.getElementById(\"DERIVED_SSS_SCT_SSS_TERM_LINK\");\n\t\tif (!termLink)\n\t\t\treturn null;\n\n\t\tvar buttonSpan = document.createElement(\"span\");\n\t\tbuttonSpan.className = \"SSSBUTTON_ACTIONLINK\";\n\t\tbuttonSpan.setAttribute(\"title\", \"Download timetable in iCalendar format\");\n\n\t\tvar buttonLink = document.createElement(\"a\");\n\t\tbuttonLink.className = \"SSSBUTTON_ACTIONLINK\";\n\t\tbuttonLink.setAttribute(\"id\", \"--nucalendar-download-button\");\n\t\tbuttonLink.setAttribute(\"tabindex\", +(termLink.getAttribute(\"tabindex\") || 0) + 1);\n\t\tbuttonLink.textContent = \"download\";\n\n\t\tbuttonSpan.appendChild(buttonLink);\n\n\t\ttermLink.parentElement.parentElement.parentElement.appendChild(buttonSpan);\n\n\t\treturn buttonLink;\n\t}", "function addDownloadButtonClassic(){\n\t\tvar form = window.document.getElementById('courseFormActions');\n\t\tconsole.log(form);\n\t\tvar toolbar = form.getElementsByTagName('span')[0];\n\t\tconsole.log(toolbar);\n\t\t\n\t\t// var toolbar = window.document.getElementById('courseFormActions:j_id135');\n\t\t\n\t\t\n\t\tvar li = document.createElement('li');\n\t\tvar a = document.createElement('a');\n\t\ta.innerHTML = 'test';\n\t\ta.className='gpx button-text route-button-text no-text';\n\t\ta.style.backgroundPosition = \"-2px -1136px\";\n\t\t\n\n\t\ta.target = '_blank';\n\n\t\tli.appendChild(a);\n\t\t\n\t\tvar firstChild = toolbar.childNodes[0];\n\t\t\n\t\ttoolbar.insertBefore(li, firstChild);\n\n\t\treturn a;\n}", "addButtonComponent(component) {\nthis\n.addInfoToComponent(component, formEditorConstants.COMPONENT_TYPE_BUTTON)\n.addProperty(component, 'name', this._componentList.findComponentText(component.type, 'name', 'Button'))\n.addProperty(component, 'zIndex', 0)\n.addProperty(component, 'value', component.name)\n.addProperty(component, 'title', component.name)\n.addProperty(component, 'color', 'green');\nreturn component;\n}", "function createGenericButton(buttonId, buttonOptions, widget) {\n\n var backgroundNormal = widget.options.button_background_node_normal; // TODO; Do *not* use node settings!\n var backgroundHover = widget.options.button_background_node_hover;\n var backgroundClicked = widget.options.button_background_node_clicked;\n \n var buttonWidth = widget.options.button_width+7;\n var buttonHeight = widget.options.button_height+10;\n\n var base64Image = {\n pointer: {padding_top:'4px', title:'Pointer', label:'Pointer', data:'data:image/gif;base64,R0lGODlhEAAPAPcAAAAAAAAAQAAAgAAA/wAgAAAgQAAggAAg/wBAAABAQABAgABA/wBgAABgQABggABg/wCAAACAQACAgACA/wCgAACgQACggACg/wDAAADAQADAgADA/wD/AAD/QAD/gAD//yAAACAAQCAAgCAA/yAgACAgQCAggCAg/yBAACBAQCBAgCBA/yBgACBgQCBggCBg/yCAACCAQCCAgCCA/yCgACCgQCCggCCg/yDAACDAQCDAgCDA/yD/ACD/QCD/gCD//0AAAEAAQEAAgEAA/0AgAEAgQEAggEAg/0BAAEBAQEBAgEBA/0BgAEBgQEBggEBg/0CAAECAQECAgECA/0CgAECgQECggECg/0DAAEDAQEDAgEDA/0D/AED/QED/gED//2AAAGAAQGAAgGAA/2AgAGAgQGAggGAg/2BAAGBAQGBAgGBA/2BgAGBgQGBggGBg/2CAAGCAQGCAgGCA/2CgAGCgQGCggGCg/2DAAGDAQGDAgGDA/2D/AGD/QGD/gGD//4AAAIAAQIAAgIAA/4AgAIAgQIAggIAg/4BAAIBAQIBAgIBA/4BgAIBgQIBggIBg/4CAAICAQICAgICA/4CgAICgQICggICg/4DAAIDAQIDAgIDA/4D/AID/QID/gID//6AAAKAAQKAAgKAA/6AgAKAgQKAggKAg/6BAAKBAQKBAgKBA/6BgAKBgQKBggKBg/6CAAKCAQKCAgKCA/6CgAKCgQKCggKCg/6DAAKDAQKDAgKDA/6D/AKD/QKD/gKD//8AAAMAAQMAAgMAA/8AgAMAgQMAggMAg/8BAAMBAQMBAgMBA/8BgAMBgQMBggMBg/8CAAMCAQMCAgMCA/8CgAMCgQMCggMCg/8DAAMDAQMDAgMDA/8D/AMD/QMD/gMD///8AAP8AQP8AgP8A//8gAP8gQP8ggP8g//9AAP9AQP9AgP9A//9gAP9gQP9ggP9g//+AAP+AQP+AgP+A//+gAP+gQP+ggP+g///AAP/AQP/AgP/A////AP//QP//gP///yH5BAEAAP8ALAAAAAAQAA8AQAg4AP8JHEhwIAAABf8dRKiQYcKGCxcSlPiwYsGIDhNifEix4kGLIDV+9LiRI8aRJiOSzJgyZEeQAQEAOw=='},\n\n undo: {padding_top:'3px', title:'Undo', label:'Undo', clear:'left', data:'data:image/gif;base64,R0lGODlhFgAWAOMKADljwliE33mOrpGjuYKl8aezxqPD+7/I19DV3NHa7P///////////////////////yH5BAEKAA8ALAAAAAAWABYAAARR8MlJq7046807TkaYeJJBnES4EeUJvIGapWYAC0CsocQ7SDlWJkAkCA6ToMYWIARGQF3mRQVIEjkkSVLIbSfEwhdRIH4fh/DZMICe3/C4nBQBADs='},\n\n redo: {padding_top:'3px', title:'Redo', label:'Redo', data:'data:image/gif;base64,R0lGODlhFgAWAMIHAB1ChDljwl9vj1iE34Kl8aPD+7/I1////yH5BAEKAAcALAAAAAAWABYAAANKeLrc/jDKSesyphi7SiEgsVXZEATDICqBVJjpqWZt9NaEDNbQK1wCQsxlYnxMAImhyDoFAElJasRRvAZVRqqQXUy7Cgx4TC6bswkAOw=='},\n\n new: {padding_top:'5px', title:'New model', label:'New', clear:'left', data:'data:image/gif;base64,R0lGODlhEAAPAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwMDcwKTI8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/78KCgpICAgP8AAAD/AP//AAAA//8A/wD//////yH5BAEAAAcALAAAAAAQAA8AAAhHAA8IHEiwIEEACBMiNCgQwL+HEBcadAjxoUMAEytaTFiQokaLHT9GDCnyH8aDJU2SFHlyoMePLRumjHngpUaaCnNKZMjzQEAAOw=='},\n\n open: {padding_top:'5px', title:'Open model', label:'Open', data:'data:image/gif;base64,R0lGODlhEAAPAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwMDcwKTI8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/78KCgpICAgP8AAAD/AP//AAAA//8A/wD//////yH5BAEAAAcALAAAAAAQAA8AAAhRAA8IHEiwoEGCABIeLAhgYMOGCxlCTAjRIMUDAPb920exI8ONIDVqrCgwY8iQJDGi7MgyoUgAA2LKlPlwI8yZMydyxJnT4U2eA0i2ZBmxqMCAADs='},\n\n save: {padding_top:'6px', title:'Save model', label:'Save', data:'data:image/gif;base64,R0lGODlhEAAPAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwMDcwKTI8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/78KCgpICAgP8AAAD/AP//AAAA//8A/wD//////yH5BAEAAAcALAAAAAAQAA8AAAhPAA8IHEiwoEAACBMqVHhwAACDBw88lOgQokSEDScaBFCRosaCHCeGtDjSI8mOHB0uRDgAZcuXMF+KbLkyoUuVDE1SxJkwY0OeGHVerMkwIAA7'},\n\n tutorial: {padding_top:'3px', title:'Tutorial', label:'Tutor', clear:'left', data:'data:image/gif;base64,R0lGODlhEgASAOefAAAALgAAMAAAMwAANAAANQAAOQAAQAAAQQAARAECNwAATwMDLwADPQAEOwMENwQENgEFPAUFPQQESgYHOwgIOgMJSAgLQwoKSwoLRAoJYQ0NQxARHBAQLA4QNxAPRhAPRxESQxISRhQULxYWGhATTxMTTRgYGBUUSxgWMhUVSxQYShwaJxIZUhgZThoZTx8cKhscNxgbTBwcOBocQBwdNxwcQhwbUxocTxwcTxwcURwcUx0cURsdTx0eQR4dSxwdUhwdUx4fRSguZjIxfDo6MjY3XTc3XTY4Yzs7WTpEeFFRdFhXg1lad1tZfF5ee2BegGNifmpphmtsnHRzjXR0k3l5kH59mnmGtIWMvYWNvYaNvYaNvoeOvpCPp4uRvZSVrJeXsJ6cnZadxp2ftKKisKSjt6mptLq6y72+ycTE0cbG0s3O2dTT3NTU29XV3NXV3djY4/bkm+fm6unp8urq8Oru6O/w8fPz9PPz9vX2+vb3+fb3+vf4+Pf4+vj4+fj5+fn5/Pr6+/r6/fr7+/v7+vv7+/v7/Pz7/fv8/Pz8+/z8/Pz8/fz8/v38/P38/fz9/f39/P39/f39/v79/v3+/f3+//7+/f7+/v7+///+/v/+//7//f7//v///f///v///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ywAAAAAEgASAAAI4wAvYbpEsKDBg5wIKjoU6ZPDhxAjGXq0pkyTIzwsMIBQQQCAAgYQKMggJY2aL0mEsCCBIYGAAAQkXFgy5g0eQw7rfAqzQQQIFTFuhKDQxuGgSJEWXalExMSKGjmAuNDggMknQwUhxQFEY8SLGThstPDwAMmnRQ4vRdKSJ5AjNgtOlCjgBtIiS5fSRsKix5CiT2ScQDHzCVFBTp/UbtmDteFDS5Mu4dWUONLiRQQ5IeUkiROmT570XoZIGqLiPWhLlz6dWrVpy6hdk1abJbbsh2rF9MF6sDfBSH+Q/v6NtHikSwEBADs='},\n\n technical: {padding_top:'6px', title:'Technical', label:'Tech', data:'data:image/gif;base64,R0lGODlhEAAPAPcAAAAAAAAAQAAAgAAA/wAgAAAgQAAggAAg/wBAAABAQABAgABA/wBgAABgQABggABg/wCAAACAQACAgACA/wCgAACgQACggACg/wDAAADAQADAgADA/wD/AAD/QAD/gP///yAAACAAQCAAgCAA/yAgACAgQCAggCAg/yBAACBAQCBAgCBA/yBgACBgQCBggCBg/yCAACCAQCCAgCCA/yCgACCgQCCggCCg/yDAACDAQCDAgCDA/yD/ACD/QCD/gCD//0AAAEAAQEAAgEAA/0AgAEAgQEAggEAg/0BAAEBAQEBAgEBA/0BgAEBgQEBggEBg/0CAAECAQECAgECA/0CgAECgQECggECg/0DAAEDAQEDAgEDA/0D/AED/QED/gED//2AAAGAAQGAAgGAA/2AgAGAgQGAggGAg/2BAAGBAQGBAgGBA/2BgAGBgQGBggGBg/2CAAGCAQGCAgGCA/2CgAGCgQGCggGCg/2DAAGDAQGDAgGDA/2D/AGD/QGD/gGD//4AAAIAAQIAAgIAA/4AgAIAgQIAggIAg/4BAAIBAQIBAgIBA/4BgAIBgQIBggIBg/4CAAICAQICAgICA/4CgAICgQICggICg/4DAAIDAQIDAgIDA/4D/AID/QID/gID//6AAAKAAQKAAgKAA/6AgAKAgQKAggKAg/6BAAKBAQKBAgKBA/6BgAKBgQKBggKBg/6CAAKCAQKCAgKCA/6CgAKCgQKCggKCg/6DAAKDAQKDAgKDA/6D/AKD/QKD/gKD//8AAAMAAQMAAgMAA/8AgAMAgQMAggMAg/8BAAMBAQMBAgMBA/8BgAMBgQMBggMBg/8CAAMCAQMCAgMCA/8CgAMCgQMCggMCg/8DAAMDAQMDAgMDA/8D/AMD/QMD/gMD///////8AQP8AgP8A//8gAP8gQP8ggP8g//9AAP9AQP9AgP9A//9gAP9gQP9ggP9g//+AAP+AQP+AgP+A//+gAP+gQP+ggP+g///AAP/AQP/AgP/A////AP//QP//gP///yH5BAEAAOMALAAAAAAQAA8AAAhCAMcJHDgQgEEABBMKPIhQIcGDDx2Og7iwoUKKEy0mZMjQIUeMDwFI4uhRpEGJFUdqvGhy5caWKDOqjDlxJk2QKAMCADs='},\n\n help: {padding_top:'5px', title:'Help', label:'Help', data:'data:image/gif;base64,R0lGODlhEAARAMZ4AAcHCAgHCg4JCAoMFBQNCg8OEREODBAQDxgQCRMTFgsVHhgTDBQTIBsTDBgUEA0WKBUXGBMZGhkYGBgYHRgYHhYZGhEaJhoZGBkZGxoZGhgaHBwaGRkbHyMbFD4WFBkfLSYeGScgGigiHCUkICslHT4sHk42IVA3JFo1I24xHms4KDBPeDFRcSNSkSRSj3BHLzhVfkFWbTpXflRUVmNaVkdhj01mlkRwnkxxmU90tVZ3pnp0cJN6Y3GKpmWVz6CUinWo492baJKozpawyOmmauSpc+upbeqqcdrDo/XAgvHGnvrIhvXLmNnZ2+3Xv9za2fbaqdPf5PzbnfXbxvbhvufn5dHx/+bs9+3t7e7t7e7v8PPx79v3//Dy9fvy6d/6/9z7//P1+N37/+P9/+j8/+v8//349Oj///z69//90e3+/+r////91u3///z+//n///7+/v7+//v////+/v/+//3///7//////v///////////////////////////////ywAAAAAEAARAAAHuIB4eHNxeGhbWFhaYXV4cHaCd4VOPCUCABYxQ2V3cIKeTCYFBgojBAcPOmuSd3hpKhAMOFFVSCcSH0CCgkkkGSxWeJBBIBQ2bbtTPztCcneQRSETNWd4nbuDnlQvGxo+da3Y11AoFwsuX3h02LtSHhUOLWN4hex4bCkRHDdq1/Z4S0RggMGF3j9BRhoMyPEm3EEvT5pcGXRQkBIaM3qQqSjoSIcEMsRwxEMEQYAVYEaayYKlixt2gQAAOw=='},\n\n replay: {padding_top:'3px', title:'Replay', label:'Replay', clear:'left', data:'data:image/gif;base64,R0lGODlhEgARAMZHAAAAAAEBAQICAgMDAwQEBAUFBQYGBggICAkJCQoKCgsLCw0NDQ4ODhUVFTc3Nz09PT4+PkJCQkNDQ0REREdHR0xMTE1NTU5OTk9PT1NTU1dXV1hYWFtbW2JiYmRkZG5ubnp6en19fZubm5+fn6CgoKampqioqKmpqaqqqqurq7W1tba2tru7u9LS0tPT09XV1dnZ2dra2tvb29zc3N3d3d7e3t/f3+Pj4+Tk5Ofn5+jo6Ozs7O3t7fLy8vPz8/b29vf39/j4+Pr6+vv7+/z8/P39/f7+/v///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ywAAAAAEgARAAAH2oBHgkdEgjovLzmCRUdGR0CCjkEmCwCWAAwoQYIeLY1ENgsBAwGXAwAIPB0AMII1CaUTKi4uKxKjB5YwQ0QNAgYmg4MnAqOsRyOlJD+Mg0QYl8cFBBSNjEaOF6QApTE3liLN2EMiGxznHBs4MJYsjpGFwoJEMpYq7435jT03N0I93EBEEvYuhAAAPo44OKDgyJBmi4YcSXAAAiEaAQJEcChMYoSMM4oUMbLB0oMXwl48sMQBWz4LAQ4u0KChkgABFfQZEVkimqVSJowQwTeIR4oPGTJ8QLFjkKNAADs='}\n };\n\n if (base64Image[buttonId].clear) {\n var css_clear = base64Image[buttonId].clear;\n } else {\n css_clear = 'none';\n }\n var buttonDiv = $('<div id=\"toolbar_button_'+buttonId+'\" class=\"node_arc_toolbar_button\" width=\"'+buttonWidth+'\" height=\"'+buttonHeight+'\" style=\"padding-top:0px; padding-left:0px; width:'+buttonWidth+'px; height:'+buttonHeight+'px; max-width:'+buttonWidth+'px; max-height:'+buttonHeight+'px; float:left; clear:'+css_clear+'; border:none; font-size:12px; text-align:center;line-height:10px; \"></div>');\n\n $(buttonDiv).append('<img title=\"'+base64Image[buttonId].title+'\" style=\"padding-top:'+base64Image[buttonId].padding_top+'; title=\"Redo\" src=\"'+base64Image[buttonId].data+'\" />');\n $(buttonDiv).append('<span style=\"height:10px; overflow:hidden;\"><br/>'+base64Image[buttonId].label+'</span>');\n\n $(buttonDiv).\n hover(\n function() {\n $( this ).css({'border':'solid 1px black', 'background-color':backgroundHover})},\n function() {\n if (widget.state.toolbarButton !== buttonId) {\n $( this ).css({'border':'solid 1px white', 'background-color':backgroundNormal});\n }\n }\n );\n\n if (buttonOptions.type === 'latch') {\n $(buttonDiv).\n click({buttonId:buttonId}, \n function(event) {\n SYSTO.revertToPointer();\n $( this ).css({'border':'none', 'background-color':backgroundClicked});\n widget.state.toolbarButton = buttonId;\n widget.state.status = buttonId;\n widget.state.statusDetail = event.data.buttonId;\n SYSTO.state.mode = buttonId;\n SYSTO.state.languageId = widget.options.languageId;\n SYSTO.state.buttonId = buttonId;\n }\n );\n }\n\n return buttonDiv;\n}", "function do_btn( )\n{ \n\n g_button2 = createButton( \"Save Image\" );\n g_button2.position( 150, 900 );\n g_button2.mousePressed( save_image ); // the callback // will call mousePressed( ) function below\n}" ]
[ "0.6851485", "0.66250414", "0.64830184", "0.6451737", "0.642687", "0.6409139", "0.63990515", "0.6396914", "0.6383983", "0.63486415", "0.6343713", "0.6335535", "0.6272856", "0.6271495", "0.62020123", "0.6180282", "0.61585486", "0.61349076", "0.61278486", "0.61225927", "0.6110634", "0.60947317", "0.6084403", "0.60682845", "0.6066829", "0.6049616", "0.60373086", "0.6024382", "0.6022022", "0.6003152", "0.6000261", "0.59959275", "0.5992107", "0.59786916", "0.5973756", "0.5969873", "0.59645617", "0.5962432", "0.5953518", "0.59372437", "0.5919983", "0.59182245", "0.5909989", "0.5899673", "0.5897838", "0.58929825", "0.58798176", "0.58673126", "0.58660936", "0.5860755", "0.58449906", "0.58346593", "0.58198816", "0.58030975", "0.5797585", "0.5793886", "0.5790179", "0.5777501", "0.5769838", "0.5762729", "0.5761936", "0.5757383", "0.5754359", "0.5752771", "0.57494724", "0.5748722", "0.5747889", "0.5743267", "0.57421356", "0.57395446", "0.5735235", "0.57340825", "0.5733957", "0.57272637", "0.5719919", "0.5718284", "0.5711672", "0.5706454", "0.57029164", "0.5701834", "0.5700971", "0.5689908", "0.56897247", "0.5683606", "0.5664953", "0.5661257", "0.565875", "0.56582296", "0.5651677", "0.5648564", "0.56478924", "0.5647478", "0.5639655", "0.5638399", "0.5636552", "0.56354946", "0.56306076", "0.56227785", "0.56192344", "0.5611852" ]
0.67477375
1
Creates the IFrame for the etherpad.
function createIFrame() { etherpadIFrame = document.createElement('iframe'); etherpadIFrame.src = domain + etherpadName + options; etherpadIFrame.frameBorder = 0; etherpadIFrame.scrolling = "no"; etherpadIFrame.width = $('#largeVideoContainer').width() || 640; etherpadIFrame.height = $('#largeVideoContainer').height() || 480; etherpadIFrame.setAttribute('style', 'visibility: hidden;'); document.getElementById('etherpad').appendChild(etherpadIFrame); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createIFrame() {\n etherpadIFrame = document.createElement('iframe');\n etherpadIFrame.src = domain + etherpadName + options;\n etherpadIFrame.frameBorder = 0;\n etherpadIFrame.scrolling = \"no\";\n etherpadIFrame.width = $('#largeVideoContainer').width() || 640;\n etherpadIFrame.height = $('#largeVideoContainer').height() || 480;\n etherpadIFrame.setAttribute('style', 'visibility: hidden;');\n\n document.getElementById('etherpad').appendChild(etherpadIFrame);\n\n etherpadIFrame.onload = function() {\n\n document.domain = document.domain;\n bubbleIframeMouseMove(etherpadIFrame);\n setTimeout(function() {\n // the iframes inside of the etherpad are\n // not yet loaded when the etherpad iframe is loaded\n var outer = etherpadIFrame.\n contentDocument.getElementsByName(\"ace_outer\")[0];\n bubbleIframeMouseMove(outer);\n var inner = outer.\n contentDocument.getElementsByName(\"ace_inner\")[0];\n bubbleIframeMouseMove(inner);\n }, 2000);\n };\n}", "function createOuiseoFrame() {\n var frame = document.createElement('div');\n frame.id = 'ouiseo_frame';\n return frame;\n }", "function makeIssueScanningFrame() {\n miro.board.widgets.create([\n {\n type: \"frame\",\n x: -4684,\n y: 979,\n width: bmcWidth,\n height: bmcHeight,\n style: {\n backgroundColor: \"#ffffff\",\n },\n },\n ]);\n}", "initIframe() {\n console.log('EomnibarOut initIframe');\n\n // create shadow dom\n var shadowWrapper = document.createElement(\"div\");\n shadowWrapper.id = 'myroot';\n const shadowDOM = shadowWrapper.createShadowRoot();\n\n // create shadowDOM style\n const url = chrome.extension.getURL(\"evernote_qs.css\");\n const urlStar = chrome.extension.getURL(\"eomnibar.css\");\n $(shadowDOM).append(`<style>\n //iframe {display: none;}\n @import url(\"${url}\");\n @import url(\"${urlStar}\");\n </style>`);\n\n // create iframe with given html\n const iframeURL = chrome.extension.getURL(\"eomnibar.html\");\n const $iframe = $('<iframe src=\"' + iframeURL + '\" seamless class=\"eomnibarFrame evernote_qsUIComponentHidden\"></iframe>')\n this.iframe = $iframe;\n\n\n //const shadow = $('#myroot')[0].shadowRoot;\n //const ifr = $(shadow).find('iframe')[0];\n //$iframe.on('load', (e) => {\n //this.iframeWin = $iframe[0].contentWindow;\n //this.iframeWin.postMessage('Message: from main window', '*', [this.channel.port2]);\n //});\n\n $(shadowDOM).append($iframe);\n $('body').append(shadowWrapper);\n }", "function playWallCreateIframe() {\n var iframe = document.createElement('iframe');\n iframe.id = 'playwall-frame';\n iframe.src = playwallLocationUrl;\n iframe.style.width = '300px';\n iframe.style.minHeight = '560px';\n iframe.style.border = '0';\n iframe.style.borderRadius = '10px';\n iframe.style.display = 'table';\n iframe.style.zIndex = '999';\n iframe.style.position = 'absolute';\n iframe.style.top = '50px';\n iframe.style.left = '0';\n iframe.style.right = '0';\n iframe.style.margin = '0 auto';\n document.body.appendChild(iframe);\n}", "function createIframe(authToken) {\n // //////////////////// IFRAME CREATION ////////////////////////////////////\n const formIframe = document.createElement('iframe');\n // append to body\n const parent = document.getElementById(parentId);\n parent.appendChild(formIframe);\n\n // add attr to the iframe\n // formIframe.frameBorder = '0'; this is obsolet\n // formIframe.scrolling = 'no'; this has been deprecated\n // formIframe.style = 'border:0; overflow:hidden;';\n formIframe.frameBorder = '0';\n formIframe.scrolling = 'no';\n formIframe.title = 'Consolidated Credit Callback Scheduler';\n formIframe.id = 'callbackScheduler';\n formIframe.sandbox = 'allow-forms allow-scripts allow-same-origin allow-popups';\n\n // Dcom URL: https://ewc.debt.com/fef/\n // eslint-disable-next-line prettier/prettier\n formIframe.src = `https://resources.venturetechsolutions.com/iframes/callback-scheduler?pageUrl=${clientUrl}&pageDomain=${clientDomain}&ip_address=${ip_address}&twoColumn=${twoColumn}&language=${language}&token=${authToken.token}&bordered=${bordered}&formBackground=${formBackground}&fontColor=${fontColor}&calendarColorON=${calendarColorON}&calendarColorOFF=${calendarColorOFF}&calendarColorHOVER=${calendarColorHOVER}&calendarColorACTIVE=${calendarColorACTIVE}&calendarColorLines=${calendarColorLines}&btnCTANormalColor=${btnCTANormalColor}&btnCTAHoveredColor=${btnCTAHoveredColor}&btnCTAFontColor=${btnCTAFontColor}&fieldsBorderColor=${fieldsBorderColor}&timeLaps=${timeLaps}&numberOfDays=${numberOfDays}&daysOff=${JSON.stringify(daysOff)}&sun=${JSON.stringify(sun)}&mon=${JSON.stringify(mon)}&tue=${JSON.stringify(tue)}&wed=${JSON.stringify(wed)}&thu=${JSON.stringify(thu)}&fri=${JSON.stringify(fri)}&sat=${JSON.stringify(sat)}&source=${source}&name=${name}&lastname=${lastname}&phone=${phone}&email=${email}`;\n\n // Remove Loading\n removeLoading();\n }", "function createIframe() {\n var doc = document\n\n // On IE use an ActiveXObject to prevent the \"throbber of doom\"\n // see: http://stackoverflow.com/a/1066729\n if (window.ActiveXObject) {\n doc = new ActiveXObject(\"htmlfile\")\n doc.write('<html><body></body></html>')\n\n // set a global variable to prevent the document from being garbage\n // collected which would close the connection:\n window.eventStreamDocument = doc\n\n // Expose a global function that can be invoked from within the iframe:\n doc.parentWindow.handleSentEvent = handle\n\n appendIframe(doc, url)\n }\n else {\n // Most likely an old Android device. The trick here is not to send\n // the 4KB padding, but to immediately reload the iframe afer a message\n // was received.\n window.handleSentEvent = handle\n setTimeout(function() { appendIframe(document, url+'?close') }, 1000)\n }\n }", "_createWidget() {\n try {\n createWidget(this.iframeEl, (widget) => {\n if (widget) {\n this._setupWidget(widget);\n this._reloadWidget();\n }\n });\n } catch (err) {\n console.log(err)\n }\n }", "function CIfFrame(windowId, left, top, width, height, appearance) {\n\n\n var wleft = left;\n var wtop = top;\n var wwidth = width;\n var wheight = height;\n var zindex = appearance.zindex;\n var wborderwidth = null;\n\n\n var me = this;\n\n\n this.minFrameWidth = 128;\n this.minWindowHeight = 32;\n\n /**\n * If this value is true, the focus will move when tapping the iframe area,\n * but if the window do not have the focus, you can not click on the element in the iframe.\n */\n this.overrayTransparentScreenEnabled = false;\n\n /**\n * Only in the case of resizing a transparent screen can be displayed on the iframe\n * and the size can be adjusted smoothly.\n * true is recommended.\n */\n this.overrayTransparentScreenOnResize = true;\n\n\n this.titleBarColorFocused = appearance.titleBarColorFocused;\n this.titleBarColorDefault = appearance.titleBarColorDefault;\n\n this.titleBarCaptionColorDefault = appearance.titleBarCaptionColorDefault;\n this.titleBarCaptionColorFocused = appearance.titleBarCaptionColorFocused;\n\n //call super constructor\n CIfFrame.superConstructor.call(me, windowId, wleft, wtop, wwidth, wheight, zindex, wborderwidth, appearance);\n\n //border color\n me.frameBorderColorDefault = appearance.frameBorderColorDefault;\n me.frameBorderColorFocused = appearance.frameBorderColorFocused;\n\n //border width\n me.frameBorderWidthDefault = appearance.frameBorderWidthDefault;\n me.frameBorderWidthFocused = appearance.frameBorderWidthFocused;\n\n\n me.iframe = null;\n\n\n //Offset value for width adjustment of iframe\n me.ifDelta = 0;\n\n me.resizable = true;\n\n\n me.onMouseMoveOnIframe = null;\n me.onMouseUpOnIframe = null;\n\n me._hasFocus = false;\n me._hasFocusTime = 0;\n\n\n me.htmlElement.typeName = 'cifwindow';\n\n //name of iframe\n var exIframeName = 'riversun_' + windowId;\n\n\n me.dframe = document.createElement('div');\n\n\n me.iframe = document.createElement('iframe');\n\n\n me.iframe.name = exIframeName;\n\n me.iframe.id = exIframeName;\n\n me.iframe.frameBorder = '0';\n me.iframe.scrolling = 'no';\n\n me.iframe.zIndex = -1;\n\n //Allow transparent of iframe background.\n me.iframe.allowTransparency = 'true';\n me.iframe.width = me.canvasNetWidth - me.ifDelta + 0;\n me.iframe.height = me.canvasNetHeight - me.ifDelta + 0;\n\n me.showTitleBar = appearance.showTitleBar;\n\n me.getFrameInnerBorderRadius = appearance.getFrameInnerBorderRadius;\n\n me.frameBorderRadius = appearance.frameBorderRadius;\n\n\n me.adjustFrameBorderRadius();\n\n me.useIframe = false;\n\n\n\n me.canvas.canvasElement.appendChild(me.iframe);\n\n me.canvas.canvasElement.appendChild(me.dframe);\n\n\n this.setUseIframe = function (useIframe) {\n me.useIframe = useIframe;\n me.iframe.style.visibility = 'hidden';\n me.iframe.style.position = 'absolute';\n me.iframe.style.left = '0px';\n me.iframe.style.top = '0px';\n me.iframe.style.width = '100%';\n me.iframe.style.height = '100%';\n\n me.dframe.style.visibility = 'hidden';\n me.dframe.style.position = 'absolute';\n me.dframe.style.left = '0px';\n me.dframe.style.top = '0px';\n me.dframe.style.width = '100%';\n me.dframe.style.height = '100%';\n\n\n if (useIframe) {\n me.iframe.style.visibility = 'visible';\n me.dframe.style.visibility = 'hidden';\n } else {\n\n\n me.iframe.style.visibility = 'hidden';\n me.dframe.style.visibility = 'visible';\n }\n };\n\n me.setUseIframe(appearance.useIframe);\n\n //If it is IE, set the canvasElement of the canvas which is the parent of the iframe to transparent.\n\n if (me.overrayTransparentScreenEnabled || me.overrayTransparentScreenOnResize) {\n //Create a transparent screen.\n me.transparence = document.createElement('span');\n //me.transparence.style.backgroundImage = 'url(img/img_baron_tp.gif)';\n\n me.transparence.style.position = 'absolute';\n me.transparence.style.left = '0px';\n me.transparence.style.top = '0px';\n\n //Transparent screen is 0px when creating window\n me.transparence.style.width = '0px';\n me.transparence.style.height = '0px';\n\n me.transparence.style.zIndex = 4;\n me.transparence.style.borderWidth = '0px';\n me.transparence.style.borderColor = '#ff00ee';\n //this.transparence.style.borderStyle='none';\n me.transparence.style.cursor = 'default';\n\n me.canvas.canvasElement.style.backgroundColor = appearance.frameBackgroundColor;\n\n\n me.canvas.canvasElement.appendChild(me.transparence);\n }\n\n }", "function make_frame_content(rte) {\n\t var opt = rte.options,\n\t hd,\n\t bd = rte._input.val();\n\n\t if (opt.link) {\n\t hd = ('<link type=\"text/css\" rel=\"stylesheet\" href=\"'+ opt.link + '\" />');\n\t }\n\t else if (opt.style) {\n\t hd = ('<style type=\"text/css\">' + opt.style + '</style>');\n\t }\n\n\t bd = $.trim(bd) || '';\n\t return ('<html><head>' + hd + '</head><body class=\"frame\">' + bd + '</body></html>');\n }", "function Widget(src, opaId, isFz59) {\n const ACTION_ID = 'js-show-iframe-wrapper';\n const BLOCK_ACTION_CLASS = 'pos-block-action';\n\n let fz59 = isFz59 ? 'true' : 'false';\n src += '?opaId=' + opaId + '&fz59=' + fz59;\n\n let div = document.createElement('div');\n let header = document.createElement('header');\n let overlay = document.createElement('div');\n let body = document.getElementsByTagName('body')[0];\n\n // css\n div.style.background = 'white';\n div.style.position = 'fixed';\n div.style.maxWidth = '620px';\n div.style.maxHeight = '768px';\n div.style.margin = 'auto';\n div.style.top = '0';\n div.style.bottom = '0';\n div.style.left = '0';\n div.style.right = '0';\n div.style.zIndex = '999999999';\n\n overlay.style.position = 'fixed';\n overlay.style.zIndex = '999999998';\n overlay.style.width = '100%';\n overlay.style.height = '100%';\n overlay.style.top = '0';\n overlay.style.left = '0';\n overlay.style.backgroundColor = 'rgba(0,0,0,.3)';\n\n // attr\n div.setAttribute('id', 'js-iframe-wrapper');\n overlay.setAttribute('id', 'js-iframe-overlay');\n let iframe = document.createElement('iframe');\n\n iframe.style.width = '100%';\n iframe.style.height = '100%';\n iframe.style.border = '0';\n\n iframe.setAttribute('src', src);\n iframe.setAttribute('id', 'js-iframe-widget');\n iframe.referrerPolicy = 'unsafe-url';\n\n div.appendChild(iframe);\n header.innerHTML = 'Новое обращение';\n\n function destroy() {\n let body = document.getElementsByTagName('body')[0];\n let wOverlay = document.getElementById('js-iframe-overlay');\n let wWrapper = document.getElementById('js-iframe-wrapper');\n wWrapper && body.removeChild(wWrapper);\n wOverlay && body.removeChild(wOverlay);\n }\n\n function create() {\n body.appendChild(div);\n body.appendChild(overlay);\n }\n\n function closeWidget() {\n destroy();\n }\n\n function showWidget() {\n create();\n }\n\n const openWidgetBtn = document.getElementById(ACTION_ID);\n\n if (openWidgetBtn) {\n\n openWidgetBtn.addEventListener('click', function (e) {\n\n e.preventDefault();\n showWidget();\n });\n\n openWidgetBtn.addEventListener('touchend', function (e) {\n\n if (!document.getElementById(ACTION_ID).classList.contains(BLOCK_ACTION_CLASS)) {\n\n showWidget();\n } else {\n\n setTimeout(function () {\n document.getElementById(ACTION_ID).classList.remove(BLOCK_ACTION_CLASS);\n }, 0);\n\n }\n\n });\n\n openWidgetBtn.addEventListener('touchmove', function (e) {\n\n document.getElementById(ACTION_ID).classList.add(BLOCK_ACTION_CLASS); // предотвращаем экшен при скролле на лаптопах\n });\n }\n\n window.addEventListener('message', function (event) {\n if (event.data.close) {\n closeWidget();\n }\n }, false);\n\n // переопределяем слоган\n (function overrideSlogan() {\n const posBanner = document.getElementById(ACTION_ID);\n const posButton = posBanner.querySelector('.pos-banner-btn_2');\n \n if (posBanner) {\n const sloganTag = posBanner.querySelector('.bf-1__slogan') || posBanner.querySelector('.bf-2__slogan');\n\n if (sloganTag) {\n sloganTag.innerHTML = 'Решаем вместе';\n }\n \n if(posButton){\n posButton.innerHTML = 'Сообщить о проблеме';\n posButton.style.width = '240px';\n }\n }\n\n })();\n\n}", "_renderWireFrames() {\n\t\tlet ctx = this.shadowCtx;\n\n\t\tctx.fillStyle = 'rgba(75, 241, 228, 0.2)';\n\t\t// Draw boxes for the derivations\n\t\tfor(let col = 0; col <= 1; col++) {\n\t\t\tfor(let row = 0; row <= 5; row++) {\n\t\t\t\t// draw the fields with a border\n\t\t\t\tctx.fillRect(\n\t\t\t\t\t2 + (this.state().ecgDisplay.horizontalMargin + ((col===1) ? this.state().ecgDisplay.horizontalMargin*2+this.variables.derivation.width : 0)),\n\t\t\t\t\t2 + (this.state().ecgDisplay.verticalMargin + row * this.variables.derivation.height),\n\t\t\t\t\tthis.variables.derivation.width-4,\n\t\t\t\t\tthis.variables.derivation.height-4\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "function _createIframe( selector ) {\n var element = selector || 'body',\n iframe = document.createElement( 'iframe' );\n\n iframe.setAttribute( 'src', _getWidgetUrl() );\n document.querySelector( element ).appendChild( iframe );\n }", "function Iframe() {\n this.doc = document.createElement('iframe');\n // Checks will store all the tests done on the animations in the iframe.\n // Developers can add to it using the addCheck function.\n this.checks = [];\n // Time stores the defualt animation time. It controls how long the hidden\n // animation runs and therefore the default animation timer.\n this.time = 5;\n\n this.pass = false;\n\n this.doc.setAttribute('id', 'display');\n this.doc.setAttribute('class', 'display');\n this.doc.setAttribute('src', 'iframe-contents.html');\n}", "function make_iframe() {\n\tvar iframe = document.createElement('iframe');\n\tiframe.sandbox = \"allow-same-origin\";\n\tiframe.className = 'w-100p resize-height';\n\tdocument.body.appendChild(iframe);\n\treturn iframe;\n}", "showIFrame(data, element) {\n let that = this;\n let v = that.cnf.v;\n let size = that.popupCosySize();\n let repair = $(element).prev().attr('id');\n data.location = that.setParams({iframe: true, repair}, data.location);\n\n let mode = data.shape || 'modal';\n let clsName = ['bsw-iframe', `bsw-iframe-${mode}`].join(' ');\n let options = that.jsonFilter(Object.assign(data, {\n width: data.width || size.width,\n title: data.title === false ? data.title : (data.title || that.lang.please_select)\n }));\n\n if (mode === 'drawer') {\n\n options = Object.assign(options, {\n content: `<iframe class=\"${clsName}\" src=\"${data.location}\"></iframe>`\n });\n\n that.showDrawer(options);\n v.$nextTick(function () {\n let iframe = $(`.bsw-iframe-${mode}`);\n let headerHeight = options.title ? 55 : 0;\n let footerHeight = options.footer ? 73 : 0;\n let height = that.popupCosySize(true).height;\n if (options.placement === 'top' || options.placement === 'bottom') {\n height = options.height || 512;\n }\n iframe.height(height - headerHeight - footerHeight);\n iframe.parents('div.ant-drawer-body').css({margin: 0, padding: 0});\n });\n\n } else {\n\n let headerHeight = options.title ? 55 : 0;\n let footerHeight = options.footer ? 53 : 0;\n let height = data.height || (size.height - headerHeight - footerHeight);\n\n let attributes = [];\n let overOffset = typeof data.overOffset !== 'undefined' ? data.overOffset : that.cnf.autoHeightOverOffset;\n attributes.push(`data-over-offset=${overOffset}`);\n\n let debugHeight = typeof data.debugRealHeight !== 'undefined' ? data.debugRealHeight : false;\n attributes.push(`data-debug-height=${debugHeight}`);\n\n if (typeof data.minHeight === 'undefined' && that.cnf.autoHeightOffset) {\n data.minHeight = Math.max(height - that.cnf.autoHeightOffset, 0);\n }\n if (data.minHeight) {\n attributes.push(`data-min-height=\"${data.minHeight}\"`);\n }\n\n if (typeof data.maxHeight === 'undefined' && that.cnf.autoHeightOffset) {\n data.maxHeight = height + that.cnf.autoHeightOffset;\n }\n if (data.maxHeight) {\n attributes.push(`data-max-height=\"${data.maxHeight}\"`);\n }\n\n attributes = bsw.arrayUnique(attributes).join(' ');\n options = Object.assign(options, {\n content: `<iframe class=\"${clsName}\" ${attributes} src=\"${data.location}\"></iframe>`\n });\n\n that.showModal(options);\n v.$nextTick(function () {\n let iframe = $(`.bsw-iframe-${mode}`);\n iframe.height(height);\n iframe.parents('div.ant-modal-body').css({margin: 0, padding: 0});\n });\n }\n }", "constructor() {\n super({ node: Private.createNode() });\n this.addClass('jp-IFrame');\n }", "function WebBrowser_CreateHTMLObject(theObject)\n{\n\t//create the div\n\tvar theHTML = document.createElement(\"iframe\");\n\t//remove its frame border\n\ttheHTML.frameBorder = 0;\n\t//simple add\n\ttheHTML = Basic_SetParent(theHTML, theObject);\n\t//set its Basic Properties\n\tBasic_SetBasicProperties(theHTML, theObject);\n\t//set interpreter methods\n\ttheHTML.UpdateProperties = WebBrowser_UpdateProperties;\n\ttheHTML.NotifyLoaded = WebBrowser_NotifyLoaded;\n\t//block all of our events (they will be handled internaly)\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_MOUSEDOWN, Browser_CancelBubbleAndMenu);\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_CLICK, Browser_CancelBubbleOnly);\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_MOUSERIGHT, Browser_CancelBubbleOnly);\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_DOUBLECLICK, Browser_CancelBubbleOnly);\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_SCROLL, Simulator_OnScroll);\n\t//add a post display command\n\t__SIMULATOR.Interpreter.AddPostDisplayCmd(theObject.DataObject.Id, __INTERPRETER_CMD_NOTIFY_LOADED);\n\t//are we in safari?\n\tif (__BROWSER_TYPE == __BROWSER_SAFARI)\n\t{\n\t\t//create the parent div\n\t\tvar parentDiv = document.createElement(\"div\");\n\t\t//set it up\n\t\tparentDiv.id = \"iPad_iFrame_kContainer\";\n\t\tparentDiv.style.cssText = \"position:absolute;overflow:auto;\";\n\t\tparentDiv.style.left = theHTML.style.left;\n\t\tparentDiv.style.top = theHTML.style.top;\n\t\tparentDiv.style.width = theHTML.style.width;\n\t\tparentDiv.style.height = theHTML.style.height;\n\t\t//and reset the position of the iframe\n\t\ttheHTML.style.left = \"0px\";\n\t\ttheHTML.style.top = \"0px\";\n\t\t//save this in our html\n\t\ttheHTML.ParentDiv = parentDiv;\n\t\t//we will need to destroy it\n\t\ttheHTML.NotifyDestruction = WebBrowser_NotifyDestruction;\n\t\t//now add parentDiv to real parent just before our html\n\t\ttheObject.Parent.HTMLParent.insertBefore(parentDiv, theHTML);\n\t\t//remove the webbrowser from the parent\n\t\ttheObject.Parent.HTMLParent.removeChild(theHTML);\n\t\t//and return this\n\t\treturn parentDiv.appendChild(theHTML);\n\t}\n\telse\n\t{\n\t\t//return the newly created object\n\t\treturn theHTML;\n\t}\n}", "function Clover(){\n const renderElement = (identifier) => {\n addElement(identifier);\n };\n return {\n init: (identifier)=> {\n var content = `<div class=\"App\" id=\"iframeapp\">\n <div id=\"card-errors\" role=\"alert\"/>\n <div className=\"flex justify-center mt-16\">\n <form id=\"payment-form\" noValidate autoComplete=\"off\">\n <fieldset className=\"FormGroup\">\n <div className=\"FormRow\">\n <div id=\"card-number\" className=\"field card-number\"/>\n </div>\n\n <div className=\"FormRow\">\n <div id=\"card-date\" className=\"field third-width\">Car Number</div>\n <div id=\"card-cvv\" className=\"field third-width\"/>\n <div id=\"card-postal-code\" className=\"field third-width\"/>\n </div>\n </fieldset>\n </form>\n <Button type=\"button\" variant=\"contained\" size=\"large\">\n Back\n </Button>\n <Button variant=\"contained\" color=\"primary\" size=\"large\">\n PAY $25.00\n </Button>\n\n </div>\n </div>`;\n // create a new div element\n var newDiv = document.createElement(\"div\");\n // and give it some content\n var newContent = document.createTextNode(content);\n // add the text node to the newly created div\n newDiv.appendChild(newContent);\n\n // add the newly created element and its content into the DOM\n var mountDiv = document.getElementById(identifier);\n mountDiv.appendChild(newDiv);\n },\n render: renderElement\n\n }\n}", "function recreateIframe($frame) {\r\n\t\tvar width = $frame.css(\"width\");\r\n\t\tvar height = $frame.css(\"height\");\r\n\t\tvar margin = $frame.css(\"margin\");\r\n\t\t$frame.remove();\r\n\t\t//$frame.remove();\r\n\t\t$frame = $(\"<iframe id='theFrame' style='width:\" + width + \";height:\" + height + \";margin:\" + margin + \";'></iframe>\").appendTo($(\"#frameTray\"));\r\n\t\treturn $frame;\r\n\t}", "function initIframe() {\n // Set iframe to session viewport size\n iframe.width = session.viewport.width;\n iframe.height = session.viewport.height;\n browserContent.style.cssText = `height: ${session.viewport.height}px; width: ${session.viewport.width}px;`;\n iframe.onload = () => {\n iframeDocument = iframe.contentDocument;\n clickPath.appendTo(iframeDocument.body);\n heatMap.appendTo(iframeDocument.body);\n scrollMap.appendTo(iframeDocument.body);\n };\n iframe.src = site.url;\n}", "function createSecureIframe(data) {\n\tvar url = data.url,\n\t\tparams = data.params;\n\n\tvar body = Ember.$('body');\n\n\tvar iframe = document.createElement('iframe');\n\tiframe.className = 'paymil-iframe';\n\tiframe.setAttribute('data-paymill', 'iframe');\n\n\tbody.prepend(iframe);\n\n\tvar iframeDoc = iframe.contentWindow || iframe.contentDocument;\n\n\tif (iframeDoc.document) {\n\t\tiframeDoc = iframeDoc.document;\n\t}\n\n\tvar form = iframeDoc.createElement('form');\n\tform.method = 'post';\n\tform.action = url;\n\n\tfor (var k in params) {\n\t\tvar input = iframeDoc.createElement('input');\n\t\tinput.type = 'hidden';\n\t\tinput.name = k;\n\t\tinput.value = decodeURIComponent(params[k]);\n\t\tform.appendChild(input);\n\t}\n\n\tif (iframeDoc.body) {\n\t\tiframeDoc.body.appendChild(form);\n\t} else {\n\t\tiframeDoc.appendChild(form);\n\t}\n\n\tform.submit();\n}", "function setupIFrame(src) {\n iframe = document.createElement(\"iframe\");\n iframe.src = src;\n iframe.setAttribute(\n \"style\",\n \"height: 100%; width: 100%; border: 0; margin: 0;\"\n );\n iframe.addEventListener(\n \"load\",\n () => {\n window.parent.postMessage(\n { eventName: \"innerFrameLoaded\" },\n parentOrigin\n );\n },\n false\n );\n document.body.appendChild(iframe);\n}", "function iframe(pageid) {\n var iw;\n if (inbrowser) {\n // represent the iframe as an iframe (of course)\n var iframe = document.createElement(\"iframe\");\n iframe.style.display = \"none\";\n document.body.appendChild(iframe);\n iw = iframe.contentWindow;\n iw.document.write(\"<script type=\\\"text/javascript\\\">Function.prototype.bind = null; var JSBNG_Replay_geval = eval;</script>\");\n iw.document.close();\n } else {\n // no general way, just lie and do horrible things\n var topwin = window;\n (function() {\n var window = {};\n window.window = window;\n window.top = topwin;\n window.JSBNG_Replay_geval = function(str) {\n eval(str);\n }\n iw = window;\n })();\n }\n return iw;\n }", "function render() {\n return react.createElement(\"section\", null, [\n react.createElement(\"iframe\", {\n className: \"jqbx\",\n src: \"https://app.jqbx.fm/rooms\",\n frameborder: \"0\",\n sandbox:\n \"allow-forms allow-popups allow-scripts allow-same-origin allow-top-navigation allow-popups-to-escape-sandbox\",\n style: { width: \"100%\", height: \"80vh\" },\n }),\n ]);\n}", "function IFrame(instanceName) {\r\n\r\n var o = this;\r\n var frame;\r\n\r\n o.load = function(url) {\r\n\r\n o.log(instanceName + '.load', url);\r\n if (!frame) {frame = getFrame();}\r\n frame.src = url;\r\n o.poll();\r\n\r\n }\r\n\r\n o.poll = function() {\r\n\r\n var data = null;\r\n\r\n if (typeof this.contentDocument != 'undefined') {\r\n data = String(this.contentDocument.body.innerHTML);\r\n } else if (frame && typeof frame.readyState != 'undefined') {\r\n if (frame.readyState == 'complete') {\r\n data = String(window.frames[frame.id].document.documentElement.innerText);\r\n } else {\r\n window.setTimeout(instanceName + '.poll();', 100);\r\n }\r\n }\r\n\r\n if (Base.getType(data) == 'string') {\r\n data = data.trim();\r\n onLoad(data);\r\n }\r\n\r\n }\r\n\r\n o.log = function(member, msg) {\r\n return member + ' :\\n' + msg;\r\n }\r\n\r\n getFrame = function() {\r\n\r\n var frame = document.createElement('iframe');\r\n frame.src = '';\r\n frame.style.display = 'none';\r\n frame.onload = o.poll;\r\n\r\n document.getElementsByTagName('body')[0].appendChild(frame);\r\n Base.getIdAttr(frame);\r\n return frame;\r\n\r\n }\r\n\r\n onLoad = function(msg) {\r\n o.log(instanceName + '.onload', msg);\r\n }\r\n\r\n}", "function newFrame() {\n \n\n }", "function opt_FRAME(frm) {\r\n \to3_frame = frm; \t\r\n\tover = createDivContainer('overDiv');\t\r\n\treturn 0;\r\n}", "function create() {\n _this.background = document.createElement('div');\n _this.background.classList.add('video-modal-background', 'is-hidden');\n\n _this.player = document.createElement('div');\n _this.player.classList.add('video-modal-player', 'is-hidden');\n\n _this.close = document.createElement('div');\n _this.close.classList.add('video-modal-close');\n _this.player.appendChild(_this.close);\n\n _this.iframe = document.createElement('iframe');\n _this.iframe.setAttribute('frameborder', '0');\n _this.iframe.setAttribute('width', '100%');\n _this.iframe.setAttribute('height', '100%');\n _this.iframe.setAttribute('allowfullscreen', true);\n _this.iframe.setAttribute('src', _this.embedURL);\n _this.player.appendChild(_this.iframe)\n\n document.body.appendChild(_this.background)\n document.body.appendChild(_this.player)\n }", "function SetupPortableTag( ) {\n //write the frame to the DOM\n document.write('<iframe id=\"ps-frame\" frameborder=\"0\" scrolling=\"0\" marginheight=\"0\" marginwidth=\"0\" width=\"0\" height=\"0\" topmargin=\"0\" leftmargin=\"0\" allowtransparency=\"true\" style=\"display: none;\"></iframe>');\n //get the frame\n var ps_iframe = document.getElementById('ps-frame');\n //get the dynamic celtra tag\n\n var tagceltra = \"{{htmlString}}\";\n\n /*=============================================\n = trick : create a div to pass the tagceltra html in order to convert escaped characters back to normal \n =============================================*/\n /*\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#x27;',\n '`': '&#x60;',\n '=': '&#x3D;' */\n /*===== End of Section comment block ======*/\n\n var div = document.createElement('div'); \n div.innerHTML = tagceltra\n var decoded = div.firstChild.nodeValue;\n\n //open the frame and add the celtra tag html in it\n ps_iframe.contentWindow.document.open('text/html', 'replace');\n ps_iframe.contentWindow.document.write(\"<sc\" + \"ript>inDapIF = true</scr\" + \"ipt>\" + decoded );\n ps_iframe.contentWindow.document.close();\n}", "function Add_Product_Gallery_Iframe (endpoint)\n{\n document.getElementById(\"offline-label-div\").style.display = \"none\";\n let ProductsGalleryDiv = document.getElementById(\"product-pics-div\");\n let ProductsIframe = document.createElement(\"iframe\");\n ProductsIframe.className = \"products-iframe\";\n ProductsIframe.setAttribute(\"src\", products_url + endpoint);\n ProductsGalleryDiv.appendChild(ProductsIframe);\n}", "initEmbed() {\n const { br } = this;\n // IA-specific\n const thisLink = (window.location + \"\")\n .replace(\"?ui=embed\", \"\")\n .replace(\"/stream/\", \"/details/\")\n .replace(\"#\", \"/\");\n const logoHtml = br.showLogo\n ? `<a class=\"logo\" href=\"${br.logoURL}\" target=\"_blank\"></a>`\n : \"\";\n\n br.refs.$BRfooter = this.$root = $('<div class=\"BRfooter\"></div>');\n br.refs.$BRnav = this.$nav = $(\n `<div class=\"BRnav BRnavEmbed\">\n ${logoHtml}\n <span class=\"BRembedreturn\">\n <a href=\"${thisLink}\" target=\"_blank\">${br.bookTitle}</a>\n </span>\n <span class=\"BRtoolbarbuttons\">\n <button class=\"BRicon book_left\"></button>\n <button class=\"BRicon book_right\"></button>\n <button class=\"BRicon full\"></button>\n </span>\n </div>`\n );\n this.$root.append(this.$nav);\n br.refs.$br.append(this.$root);\n }", "function setReaderFrame() {\r\n\r\n var readerFrame = newNode('div');\r\n readerFrame.id = 'readerFrame';\r\n readerFrame.className = 'thc';\r\n \r\n var readerFrameTop = newNode('div');\r\n readerFrameTop.className = 'tbc';\r\n \r\n var readerFrameLinks = newNode('div');\r\n readerFrameLinks.id = 'readerFrameLinks';\r\n readerFrameLinks.className = 'tbcs';\r\n \r\n var readerLink = newNode ('div');\r\n readerLink.id = 'readerLink';\r\n readerLink.className = 'l';\r\n readerLink.innerHTML = '<img id=\"readerLinkImg\" src=\"images/triangle.gif\"></img> Google Reader';\r\n \r\n readerLink.addEventListener ('click', setReaderVisibility, false);\r\n \r\n readerFrame.appendChild (readerFrameTop);\r\n readerFrameTop.appendChild (readerFrameLinks);\r\n readerFrameLinks.appendChild(readerLink);\r\n \r\n var mailFrame = getNode('co');\r\n var separator = newNode('div');\r\n separator.innerHTML = '<br>';\r\n \r\n mailFrame.appendChild(separator);\r\n mailFrame.appendChild(readerFrame);\r\n \r\n}", "function zoto_photo_frame(options){\n\tthis.options = options||{};\n\tthis.box_height = this.options.height || 100;\n\tthis.box_width = this.options.width || 100;\n\tthis.spacer_src = this.options.spacer_src || '/image/clear.gif';\n\t\n\tthis.el = SPAN({'class':'photo_frame'});\n\t\n\tthis.__init = false;\n\tthis.__name = 'zoto_photo_frame';\n}", "_build() {\n if ( typeof this._options.body === 'string' ) {\n this._body.innerHTML = this._options.body;\n }\n else if ( this._options.body instanceof Element ) {\n this._body.appendChild( this._options.body );\n }\n this._header.appendChild( this._title );\n this._header.appendChild( this._close );\n this._container.appendChild( this._header );\n this._container.appendChild( this._body );\n this._overlay.appendChild( this._container );\n document.body.appendChild( this._overlay );\n setTimeout( () => { this._overlay.classList.add( 'visible' ); }, 300 );\n }", "function CFrame(windowId, w_left, w_top, w_width, w_height, zindex, w_border_width, appearance) {\n\n var me = this;\n\n //call constructor of superclass\n CFrame.superConstructor.call(this, windowId, w_left, w_top, w_width, w_height, zindex);\n\n\n me.anchor = CALIGN.LEFT_TOP;\n\n me.showTitleBar = appearance.showTitleBar;\n\n me.canvasNetHeight = null;\n me.canvasNetWidth = null;\n me.frameHeightAdjust = appearance.frameHeightAdjust;\n\n me.frameComponentMap = {};\n\n //initialize the field\n me.canvas = null;\n\n //canvas id\n me.myCanvasId = null;\n\n //Buttons to be placed on the screen (positioning same as the close button)\n me.floatingButton = null;\n\n me.titleBarClassNameDefault = DEF.CFRAME.TITLE_BAR_CLASS_DEFAULT;\n me.titleBarClassNameFocused = DEF.CFRAME.TITLE_BAR_CLASS_FOCUSED;\n\n\n //height of titlebar\n me.titleBarHeight = appearance.titleBarHeight;\n\n me.titleBarCaption = appearance.titleBarCaption;\n me.titleBarCaptionLeftMargin = appearance.titleBarCaptionLeftMargin;\n me.titleBarCaptionFontSize = appearance.titleBarCaptionFontSize;\n me.titleBarCaptionFontWeight = appearance.titleBarCaptionFontWeight;\n me.titleBarBorderBottomDefault = appearance.titleBarBorderBottomDefault;\n me.titleBarBorderBottomFocused = appearance.titleBarBorderBottomFocused;\n //Title bar width adjustment value\n me.titleAdjustWidth = 0;\n\n me.windowId = windowId;\n\n me.exBorderWidth = 0;\n\n\n me.myCanvasId = windowId + '_canvas';\n\n\n //img element for icon placed on the left-top\n var appIcon = document.createElement('img');\n //\t\tappIcon.src='img/ico_app_file16.gif';\n\n //url of icon image\n appIcon.src = '';\n appIcon.style.position = 'absolute';\n appIcon.style.left = '2px';\n appIcon.style.top = '2px';\n appIcon.style.width = '16px';\n appIcon.style.height = '16px';\n appIcon.style.visibility = 'hidden';\n\n\n //The title bar must be on the front of the canvas.\n me.titleBar = document.createElement('div');\n\n me.titleBar.className = '.jsFrame.titlebar';\n\n if (me.showTitleBar) {\n\n me.titleBar.id = windowId + '_title';\n me.titleBar.style.position = 'absolute';\n me.titleBar.style.top = '0px';\n me.titleBar.style.left = '0px';\n me.titleBar.style.width = (w_width - me.titleAdjustWidth) + 'px';\n me.titleBar.style.userSelect = 'none';\n\n\n if (me.titleBarHeight) {\n\n var titleBarAdjust = 0;\n\n if (me.titleBarBorderBottomDefault) {\n titleBarAdjust = -1;\n }\n\n\n me.titleBar.style.height = (parseInt(me.titleBarHeight, 10) + 0) + 'px';\n }\n\n me.titleBar.style.backgroundColor = me.titleBarColorDefault;\n me.titleBar.style.zIndex = 0;\n\n me.titleBar.style.color = me.titleBarCaptionColorDefault;\n me.titleBar.style.fontSize = me.titleBarCaptionFontSize;\n me.titleBar.style.fontWeight = me.titleBarCaptionFontWeight;\n\n me.titleBar.style.textAlign = 'center';\n me.titleBar.style.lineHeight = me.titleBar.style.height;\n\n\n me.titleBar.style.borderBottom = me.titleBarBorderBottomDefault;\n //me.titleBar.style.boxShadow = '0 1px 0 rgba(255,255,255,0.5)';\n\n\n //Set not to display overflow character string\n me.titleBar.style.overflow = 'hidden';\n\n\n var titleBarText = document.createTextNode('');\n\n //'span' to store text\n var titleBarTextSpan = document.createElement('span');\n\n titleBarTextSpan.id = me.id + '_titleBarText';\n if (me.titleBarCaptionLeftMargin != null) {\n titleBarTextSpan.style.position = 'absolute';\n titleBarTextSpan.style.left = parseInt(me.titleBarCaptionLeftMargin, 10) + 'px';\n } else {\n titleBarTextSpan.style.position = 'absolute';\n titleBarTextSpan.style.left = '0px';\n titleBarTextSpan.style.right = '0px';\n }\n titleBarTextSpan.style.top = '0px';\n titleBarTextSpan.appendChild(titleBarText);\n me.titleBar.appendChild(titleBarTextSpan);\n\n //Discontinue appicon(20061011)\n //me.titleBar.appendChild(appIcon);\n }\n\n\n me.htmlElement.appendChild(me.titleBar);\n\n\n //Set Canvas throughout the window\n\n //parseInt(me.titleBar.style.height);//me.titleBarHeight);\n var canvasMoreHeight = parseInt(me.titleBarHeight, 10) - titleBarAdjust;\n var canvasMoreSpacing = parseInt(me.titleAdjustWidth, 10);\n\n if (me.showTitleBar) {\n\n\n } else {\n canvasMoreHeight = 0;\n canvasMoreSpacing = 0;\n titleBarAdjust = 0;\n }\n\n\n me.canvasNetWidth = w_width - canvasMoreSpacing;\n me.canvasNetHeight = w_height - canvasMoreHeight - canvasMoreSpacing - 1 - titleBarAdjust + me.frameHeightAdjust;\n\n\n //Change the style of htmlElement of CFrame (CBean).\n me.htmlElement.style.cursor = 'move';\n\n\n //Create a canvas\n me.canvas = new CCanvas(me.htmlElement, me.myCanvasId, 0, canvasMoreHeight, w_width - canvasMoreSpacing, w_height - canvasMoreHeight - canvasMoreSpacing);\n\n me.canvas.canvasElement.style.backgroundColor = DEF.CFRAME.CANVAS_ELEMENT_BGCOLOR;\n me.canvas.canvasElement.style.cursor = 'default';\n\n //Handling the omousedown event that occurred in Canvas which is a child element of CFrame\n me.canvas.canvasElement.onmousedown = me.canvasMouseDown;\n\n //Set the canvas as a reference to the parent of the canvas html element canvasElement.\n me.canvas.canvasElement.parentCFrame = me;\n\n\n var tmpCanvasWidth = parseInt(me.canvas.canvasElement.style.width, 10);\n var tmpCanvasHeight = parseInt(me.canvas.canvasElement.style.height, 10);\n\n var markerWidth = 16;\n var markerHeight = 16;\n\n //Offset from marker edge\n var edgeMargin = 16;\n\n //Lower right(R-D)\n var markerRD = new CMarkerWindow(\n me.myCanvasId + '_RD',\n tmpCanvasWidth - markerWidth + edgeMargin,\n tmpCanvasHeight - markerHeight + edgeMargin,\n markerWidth,\n markerHeight,\n 0,\n 'RD');\n\n markerRD.htmlElement.style.cursor = 'se-resize';//nw-resize';\n\n //Since only the deltaX and deltaY are acquired and the movement of the marker itself is\n // performed by CFrame_resize, the movement coefficient of the marker itself is set to 0.\n markerRD.htmlElement.argX = 0;\n markerRD.htmlElement.argY = 0;\n\n\n //Bottom(D-D)\n var markerDD = new CMarkerWindow(\n me.myCanvasId + '_DD',\n 0,\n tmpCanvasHeight - markerHeight + edgeMargin,\n tmpCanvasWidth - markerWidth + edgeMargin,\n markerHeight,\n 0,\n 'DD');\n\n markerDD.htmlElement.style.cursor = 'n-resize';\n\n //Since only the deltaX and deltaY are acquired and the movement of the marker itself is\n // performed by CFrame_resize, the movement coefficient of the marker itself is set to 0.\n markerDD.htmlElement.argX = 0;\n markerDD.htmlElement.argY = 0;\n\n //Right(R-R)\n var markerRR = new CMarkerWindow(\n me.myCanvasId + '_RR',\n tmpCanvasWidth - markerWidth + edgeMargin,\n 0,\n markerWidth,\n tmpCanvasHeight - markerHeight + edgeMargin,\n 0,\n 'RR');\n\n markerRR.htmlElement.style.cursor = 'w-resize';\n\n //Since only the deltaX and deltaY are acquired and the movement of the marker itself is\n // performed by CFrame_resize, the movement coefficient of the marker itself is set to 0.\n markerRR.htmlElement.argY = 0;\n markerRR.htmlElement.argX = 0;\n\n //Add size change marker to canvas.\n me.canvas.addBean(markerRD);\n me.canvas.addBean(markerDD);\n me.canvas.addBean(markerRR);\n\n //Method to remove size change marker (can not resize)\n me.removeMarkers = function () {\n me.canvas.removeBean(markerRD.id);\n me.canvas.removeBean(markerDD.id);\n me.canvas.removeBean(markerRR.id);\n me.htmlElement.style.cursor = 'default';\n };\n\n\n me.removeMarkers2 = function () {\n me.canvas.removeBean(markerRD.id);\n me.canvas.removeBean(markerDD.id);\n me.canvas.removeBean(markerRR.id);\n };\n\n\n //add frameComponents[begin]\n for (var idx in appearance.frameComponents) {\n\n var frameComponent = appearance.frameComponents[idx];\n\n frameComponent.setFrame(me);\n\n //if frameComponent has special name 'closeButton', it will act as a close button.\n if ('closeButton' == frameComponent.id) {\n frameComponent.htmlElement.onclick = me.close;\n }\n\n me.addFrameComponent(frameComponent);\n }\n //add frameComponents[end]\n\n //override the field\n me.htmlElement.style.backgroundColor = 'transparent';\n\n me.htmlElement.oncontextmenu = this.contextMenu;\n\n\n //The policy of Border drawing seems to be different between IE and FF.\n var caribVal = 0;\n\n\n me.caribValue = caribVal;\n\n me.htmlElement.style.borderWidth = me.exBorderWidth + 'px';\n\n me.htmlElement.style.width = (parseInt(me.htmlElement.style.width, 10) - caribVal) + 'px';\n me.htmlElement.style.height = (parseInt(me.htmlElement.style.height, 10) - caribVal + 1) + 'px';\n me.htmlElement.typeName = 'cwindow';\n me.htmlElement.overflow = 'auto';\n\n\n if (appearance.frameBorderStyle) {\n me.htmlElement.style.borderStyle = appearance.frameBorderStyle;\n }\n\n if (appearance.frameBoxShadow) {\n me.htmlElement.style.boxShadow = appearance.frameBoxShadow;\n }\n\n //TODO deprecation(because CIfFrame is extended this operation)\n if (parseInt(appearance.frameBorderWidthDefault, 10) > 0) {\n me.htmlElement.style.borderWidth = appearance.frameBorderWidthDefault;\n me.htmlElement.style.borderColor = appearance.frameBorderColorDefault;\n }\n if (parseInt(appearance.frameBorderRadius, 10) > 0) {\n me.htmlElement.style.borderRadius = appearance.frameBorderRadius;\n }\n\n\n }", "frame(slots) {\n if (typeof slots === 'string') slots = [this.id, slots];\n let f = new Frame(this, slots);\n this.add(f);\n return f;\n }", "function buildParserFrame () {\n if (document.implementation && document.implementation.createHTMLDocument) {\n return document.implementation.createHTMLDocument('')\n }\n var frame = document.createElement('iframe')\n frame.style.cssText = 'position:absolute; left:0; top:-999em; width:1px; height:1px; overflow:hidden;'\n frame.setAttribute('sandbox', 'allow-forms')\n document.body.appendChild(frame)\n return frame.contentWindow.document\n}", "function buildUI(thisObj) {\n try{\n var pal = (thisObj instanceof Panel) ? thisObj : new Window(\"palette\", \"Marker Maker\", [200, 200, 600, 500], {resizeable: true});\n var ui = \"group{orientation:'column', alignment:['fill','fill'],spacing:10,\\\n logoGroup: Group{alignment:['fill','top'],preferredSize:[200,17],\\\n logoImage: Image{preferredSize:[58,17], alignment:['left','bottom']},\\\n },\\\n mainGroup:Group{orientation:'column',alignment:['fill','top'],alignChildren:['fill','top'],\\\n mainText: StaticText {minimumSize:[160,50],alignment:['middle','top']},\\\n dynBtn: Button{preferredSize:[100,-1]},\\\n tvaMidBtn: Button{preferredSize:[100,-1]},\\\n tvaBtmBtn: Button{preferredSize:[100,-1]},\\\n hrGroupTop: Panel{orientation:'row', preferredSize:[200,-1]},\\\n removerBtn: Button{preferredSize:[100,-1]}\\\n }\\\n }\";\n pal.grp = pal.add(ui);\n pal.layout.layout(true);\n pal.layout.resize();\n pal.onResizing = pal.onResize = function () {this.layout.resize();}\n \n var logoBinary = [\"\\u0089PNG\\r\\n\\x1A\\n\\x00\\x00\\x00\\rIHDR\\x00\\x00\\x008\\x00\\x00\\x00\\x11\\b\\x06\\x00\\x00\\x00\\u0088%o\\u00E0\\x00\\x00\\x00\\x19tEXtSoftware\\x00Adobe ImageReadyq\\u00C9e<\\x00\\x00\\x03!iTXtXML:com.adobe.xmp\\x00\\x00\\x00\\x00\\x00<?xpacket begin=\\\"\\u00EF\\u00BB\\u00BF\\\" id=\\\"W5M0MpCehiHzreSzNTczkc9d\\\"?> <x:xmpmeta xmlns:x=\\\"adobe:ns:meta/\\\" x:xmptk=\\\"Adobe XMP Core 5.5-c021 79.154911, 2013/10/29-11:47:16 \\\"> <rdf:RDF xmlns:rdf=\\\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\\\"> <rdf:Description rdf:about=\\\"\\\" xmlns:xmp=\\\"http://ns.adobe.com/xap/1.0/\\\" xmlns:xmpMM=\\\"http://ns.adobe.com/xap/1.0/mm/\\\" xmlns:stRef=\\\"http://ns.adobe.com/xap/1.0/sType/ResourceRef#\\\" xmp:CreatorTool=\\\"Adobe Photoshop CC (Windows)\\\" xmpMM:InstanceID=\\\"xmp.iid:1343C5D9ED1C11E3BEB684BFE5DB83CE\\\" xmpMM:DocumentID=\\\"xmp.did:1343C5DAED1C11E3BEB684BFE5DB83CE\\\"> <xmpMM:DerivedFrom stRef:instanceID=\\\"xmp.iid:1343C5D7ED1C11E3BEB684BFE5DB83CE\\\" stRef:documentID=\\\"xmp.did:1343C5D8ED1C11E3BEB684BFE5DB83CE\\\"/> </rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket end=\\\"r\\\"?>\\u00CE\\u00DD\\\"2\\x00\\x00\\x04\\u00A8IDATx\\u00DA\\u0094\\u0097\\tlTE\\x18\\u00C7\\u00DF\\u00B6]\\u00B0U\\u00A0h\\u00A9\\x07\\\"G\\x03\\x1E\\u0088G4\\u00E2E\\u00A1\\x01\\x1B1\\u00A2\\x10\\u00AB\\\"\\x06\\x05%x\\x11\\x15\\x15\\x11E\\t\\u00A8\\u00A4\\u0092\\x12\\x0EA0M\\x05\\u00AC\\nh\\u00B5x\\u00C4\\u00A21\\u0082G\\u00A0\\u008A&@\\x10\\x04#\\u00E0\\x19\\u0085bj\\u00B4\\u0096\\u00B6l\\u00F1\\u00FF\\u0099\\u00DF3\\u00C38[\\u00EA$\\u00BF}\\u00BB3o\\u00DE\\u009B\\u00EF\\u00FE6\\u00D1\\u00D8\\u00D4tq\\x14E\\x13E\\x17\\u00D1\\\"\\u00F6\\u008BN\\u00A2\\u00A7\\u00F8\\u0099\\u00B92\\u00B1-\\u00FA\\u00EF\\u00B8A\\f\\x15wDm\\u008Fk\\u00C4Hq\\u0097h\\n\\u00AC\\u009F/&\\u008B\\u0093E7\\u00E6\\u00EA\\u00C5nQ*v\\u0089\\x1Eb\\u009C\\u00C8\\x14\\u00F9\\\"+\\u00CD\\u00BB\\u00EC\\u00BCu\\\"[\\u00BC\\u0098\\u00A1\\u008F\\u00E1b\\u00B4\\u00D8(\\u00DE\\x17\\u00FD\\u00C5\\u00ADb\\u009F\\u00A8\\u00E5\\u00C6M\\u00DC\\u00E3\\u008FSP\\u008E\\u00AD\\u008F\\n\\u00AC\\u00E7\\u008A*\\u00F1\\u00A6(\\x16\\u00CD\\u0081{*xoR,\\u00E2=\\u00C6\\x1C\\u00D1Q\\u00EC\\x14\\u00BD\\u00C5\\tb\\u0096\\u0098!~\\x15\\u00A9\\x00\\u0087X{\\x02\\u00B9\\u00FE0-\\u00B4\\u008A\\u00F5X\\u00C9\\u00C6C\\u00E2F\\u00F1*\\u00BF\\u009F\\x15W\\u008Aw\\x10\\u00E4[\\u00E7p\\u00FFhI\\u00D4\\u0088\\x05b\\u00BC\\x18#\\u00FEDIv\\u00C8\\u008F\\u00C40q\\u009F\\u00C8\\x11\\r\\u00CE\\u00FE\\u00F7\\x10\\u00FC<\\u00B1\\u00C5\\x13\\u00FCkq\\u0081\\u00D8\\u00CA\\u00A1O\\x17\\x1F\\u008B\\u00E3E%\\u00D6\\r\\u008DB\\u00B1\\u0097\\u00BD\\u00CDYH~\\f\\u008B\\x0F\\u008B\\u00EF\\x1C\\u00E1\\u00E2\\u00B1V\\u00BC,\\x1E\\x14w;\\u00F3\\x1D\\u00D0\\u00FC*\\u00ACd\\u00EE\\u00B4Y\\u00FC\\u0080\\u00F6o\\x16\\x1F\\u00E0^\\u00B9\\x01\\u00CB\\x15\\u00E3\\u00BE[\\x02\\x075\\u00B7\\u009F)\\u00BA\\u008A\\u00BF\\u00C4\\u00A9\\u00E23\\u008C\\u00B1]\\u00E4\\u00A1Hw\\u00F4B\\u00A1\\u0083bo\\u00C9\\u00F0n8+M\\u00AC\\u00D9\\u00D8 N\\u00F2\\u00E6\\x0E#\\u00A4\\u008DF\\u00DC\\u00A9@\\u009C\\u00C1\\u00EF/X\\u00EB\\u00CC5\\u00C1\\u00F5*b\\u00F2\\x13\\u00F1U\\u00E0]\\u00E7\\u0088\\u00A5\\u00E2R\\u00F1;s\\u00E6~}\\u00C5\\u00BBP\\x1D\\u00D8\\u00F7\\u00A1\\u0098'>\\u008D'|\\x01M\\u00B83\\u00D3\\b8P\\u00FC\\x14\\u0098\\u00FF\\u008D\\x03}\\u0089\\x1B\\u00F6#Y|Nr\\u00B0\\u00989h\\u00F1@8\\u00D8xL\\u00DC/\\u00F6p\\u00E8\\u00C8s\\u00FB\\r\\u0084J\\u00AD\\u00A7\\u00CC8\\u00B1\\u0094\\u0088\\u00CB\\u00C5\\x04g}\\x11J}\\u00C0}\\u0098/\\u00E0\\u00F3h\\u00ED\\u0096\\u0080p\\u00F6\\u00C0\\u00F9\\u00DE\\u00BC%\\u00A2\\x11b\\u00A1x\\u008B8\\u00F9\\u0086\\u00B5i\\u00E2j\\u00B2\\u00AC\\u00AD\\x1D\\u00C7\\x01\\u00F2\\b\\u0089J\\u00E2\\u00F9\\u00C9\\u0080\\x15\\u008C\\u00B9\\x01e\\u00B6:W\\u00F3\\u0082r\\u0084\\u00BEP\\u00DCCb9b\\u00F8\\u00A9\\u00D6\\u00B4|\\x1B\\x1B\\u008B\\u0088\\u00ABal~\\u00DBK0\\x11\\u00961\\u00B7}& |\\u0084\\x15\\x0B\\u00D1\\u00FE\\x01\\u00AE\\u00FD\\x1D\\u00B7+EA\\u00E6\\u008EK(;9\\u00C4\\u00E5\\u00D1\\u00C6:\\u00F14\\x19\\u00D8\\x12\\u00CFM\\u00E2{\\u00FF\\u00A6\\u008C\\u00C0\\u00C65\\u00E2\\\"\\u0084\\u00AD&\\u00C3\\u00AD\\u00E4p\\u00BB\\u00B0p<r\\b\\u00F8\\x12\\u0094\\u0092\\x1D\\u00A8\\u0093\\u00DB\\t\\u00FC\\u00CD\\u00CC%yvD\\\"\\u0088\\u00EB\\u00A8\\x1D\\u00F8Q\\x0E\\u00DA\\u00DE1\\x1DC\\x1C&\\u00D1E\\u00ED\\x110\\\"6\\u00EE\\u00C5\\x02E\\u00A4\\u00FEk\\u00C9\\u00A4\\u00EB\\u009D\\u00B8\\u00C9'u\\u00DBZw\\x12\\u00C6%4\\r\\u00CBp\\u00DD\\u00D9\\u00EC?\\u00E4\\b\\u00D5\\u00C5\\u00F1 \\u00CB\\u00B2+p\\u00B9\\x05\\u00ECk\\u00EF\\x18K3r\\u00AC\\x18\\x10\\u00BA!\\u00AB\\u008D\\u00CDyh\\u00A6\\u00C5\\u0099\\u009B\\u0089R\\u00E6P\\u00D8S\\by\\u0080\\x03^G\\u0082\\u0088\\u0088\\u00BB8\\u00EB\\x0E\\u00C0\\u00DAY\\u00D4\\u00B5\\u00CEd\\u00D4\\u00A9Xt\\x1C\\u00F7\\u00D5\\u00A2\\u00D45d\\u00D9\\u00B6F?j\\u00F0i\\u0094\\x1BS\\u00D4\\u0089\\u00ED\\u00B5`\\x1C_V\\u00BB\\x1E\\x11\\u00B7\\u008B;\\u0089O\\x1B}\\u00B8\\u00A6\\u00A8Q\\x11\\u00B15\\x1Ew\\\\A\\u00CB5\\u00C6i\\u00BB\\x12\\bSO\\u00E6\\u009D\\u00C4!\\u00A7z\\u00EF\\x1D\\u008C\\u00DBN\\x0F\\u009C)\\u00E1|\\u00B7\\u00F7<E\\u00CD\\u00AD \\u00C3/\\u00FB?\\x16l!\\u00DB\\r\\u00E5@I\\u00E6:`\\u00D9\\u0088\\u0098,$\\u00E5[\\u00FC\\u00BCN\\u00BF\\x19a\\u00E1\\u0085d\\u00B6\\u008D\\u00B8f#k\\u00B3\\u00A8eV7wx\\u00EFm\\u00A4\\x0B\\u00D9I\\u00E9\\u00A9q\\u0084\\u008B\\u00B3h9\\x19\\u00FCqg_1}\\u00F4J\\x12\\u00CFQ\\x05\\u00EC\\u00C4CFz\\u00ED\\u00D5e\\u0094\\u00938!\\u00BD\\u0086k\\f$v\\u00E3QM\\x16\\u00B6\\x18\\\\\\u008C\\u00C5\\u00E2aq\\u00FB\\u009C\\u0098B\\u00D7\\u00F1\\u008A\\u00F7nS\\u00DC\\u00F5(\\u00A1\\u0080\\u00B6,I\\t\\x1AL\\u00FD\\u00EB\\u00E6\\u00ED\\u00A9\\u00A3\\u00BC\\u00AD\\u00C50\\u00FFv2\\u0099i\\u009A\\u00E0:\\\\\\u00B0\\u00C1\\u009B\\u00B7C/w\\u00BA\\u008Bi4\\u00C2{\\u00D3\\u00D4\\u00AD_X\\u00AB\\u00F0\\u00D6\\u00AC-\\\\M\\u00E2*\\n\\u00EC\\u00AD\\\",6!\\u00CCn\\u00EA\\u00DD\\x0B\\bY\\x17\\u00D8S\\u00C9\\u00F3\\u00AA\\\\\\x0B\\u009A\\u0080\\u00E7R\\u008FZ\\x11:\\u00C5\\u00A1\\u00CF&\\u00AE\\u00F6p\\u00CF$\\u00B4_\\u00E6<\\u00B4\\u0094\\u00BFV?\\u00E2:\\u00ABp\\u00E1\\x02:\\u0096\\u00EE\\u00D4\\u00D2\\u0083\\u0081\\x03\\u008D\\u00C6\\x15\\u00DF 9\\u00D5`\\u00BD\\x04\\u00FB\\x07\\u00D1 \\u00E4\\u00E2MCP\\u00F0\\u008E4\\x1DW\\u008A\\x04\\u00B8\\u0095\\u00B0\\u0099\\u009F\\u00D0\\u00FF\\u00C1+h\\u008B\\u0092\\u00DC\\x10\\u00FBz\\u0082\\u00DF\\u0099|o\\u00C6\\u00ED\\u00CA\\u00D3\\u00B8t\\t\\u00AE\\u0093O\\u00A3\\u00BD\\u009F&zJ\\x1A\\x0FqG\\x0FZ\\u00AC\\u009ENS^\\u008F\\u00B0\\u00A5|\\u00B7\\x10x\\u0089\\u00B2\\u0090\\u00DDF\\u0082l\\u00E0\\x19v\\u009D\\u00F0\\u00B7\\x00\\x03\\x00\\u0098\\x12CR\\u00C5\\u00A3\\u00F0\\u00D2\\x00\\x00\\x00\\x00IEND\\u00AEB`\\u0082\"];\n var logoFile = new File(new Folder(Folder.temp).fsName+\"/tempLogoImage.png\"); //temporary file for binary image\n logoFile.encoding = \"BINARY\";\n logoFile.open( \"w\" );\n logoFile.write( logoBinary );\n logoFile.close();\n \n pal.grp.logoGroup.logoImage.image = logoFile;\n \n //no longer need the temp file, remove it.\n logoFile.remove();\n \n pal.grp.mainGroup.mainText.text = \"Mark selected layers with\\nthe following text:\";\n \n // dynamic\n pal.grp.mainGroup.dynBtn.text = \"dynamic\";\n pal.grp.mainGroup.dynBtn.onClick = function () {setMarker (\"dynamic\")};\n \n // text middle align\n pal.grp.mainGroup.tvaMidBtn.text = \"textVAlign=.5\";\n pal.grp.mainGroup.tvaMidBtn.onClick = function () {setMarker (\"textVAlign=.5\")};\n \n // text bottom align\n pal.grp.mainGroup.tvaBtmBtn.text = \"textVAlign=1\";\n pal.grp.mainGroup.tvaBtmBtn.onClick = function () {setMarker (\"textVAlign=1\")};\n \n // marker remover button\n pal.grp.mainGroup.removerBtn.text = \"Remove markers\";\n pal.grp.mainGroup.removerBtn.onClick = removeMarkers;\n \n return pal;\n } catch(e) {\n alert(e.line+\"\\r\"+e.toString());\n }\n }", "function TryItDisplay(containerElement) {\n this.iframe = new Iframe();\n this.create(containerElement);\n}", "function CBeanFrame(beanId, left, top, width, height, zindex) {\n\n var me = this;\n\n //fields\n me.id = beanId;\n\n me.parentCanvas = null;\n me.htmlElement = null;\n\n\n //initialize\n me.htmlElement = document.createElement(DEF.CBEAN.HTML_ELEMENT);\n me.htmlElement.id = DEF.CBEAN.HTML_ELEMENT_ID_PREFIX + beanId;\n me.htmlElement.style.position = 'absolute';\n me.htmlElement.style.left = parseInt(left, 10) + 'px';\n me.htmlElement.style.top = parseInt(top, 10) + 'px';\n me.htmlElement.style.width = parseInt(width, 10) + 'px';\n me.htmlElement.style.height = parseInt(height, 10) + 'px';\n\n //Zindex may become 'undefined' in some cases.\n if (zindex !== null) {\n me.htmlElement.style.zIndex = zindex;\n }\n me.htmlElement.style.borderColor = '#000000';\n\n //If I set a larger font size, width and height of window will be affected....\n me.htmlElement.style.fontSize = '1px';\n\n //Refer parents to each other.(sougo-sansho)\n me.htmlElement.parent = me;\n\n //Note that 'mouseDown' is mapped to 'onmousedown' of htmlElement,\n //so when 'onmouseDown' fires ,the 'this' will indicate 'htmlElement'\n me.htmlElement.onmousedown = me.onmouseDown;\n\n //Type name of this class\n me.htmlElement.typeName = DEF.CBEAN.TYPE_NAME;\n\n //Special field indicating usage of this class\n me.htmlElement.usage = 'nothing';\n\n //Whether it can move outside the frame(waku).\n me.htmlElement.isRangeLimited = false;\n\n //Movement magnification in the X direction\n //(If it is 0, it can not move in the X direction.)\n me.htmlElement.argX = 1;\n\n //Movement magnification in Y direction\n // (If it is 0, it can not move in Y direction)\n me.htmlElement.argY = 1;\n\n }", "function buildToolbox() {\n\t//adding stylesheet for to dom\n\tvar cssURL = chrome.extension.getURL('/content_new/'+dirName+'/css/content.css');\n\tvar styleElem = document.createElement('link');\n\tstyleElem.setAttribute('href', cssURL);\n\tstyleElem.setAttribute('rel', 'stylesheet');\n\tstyleElem.setAttribute('type', 'text/css');\n\tdocument.body.appendChild(styleElem);\n\t//adding iframe to dom\n\tvar frameURL = chrome.extension.getURL('/content_new/'+dirName+'/html/frame.html');\n\tvar appendCode = '';\n\tvar frameStyle = '';\n\tappendCode += '<iframe id='+targetFrameId+' style=\"' + frameStyle + '\" src=\"' + frameURL + '\" class=\"fst_inner_frame\">';\n\tvar appendDiv = document.createElement('div');\n\tappendDiv.innerHTML = appendCode;\n\tappendDiv.setAttribute('class', 'fst_fbvid_container fst_container');\n\tappendDiv.setAttribute('id', targetDivId);\n\tdocument.body.appendChild(appendDiv);\n\tsetEventListener();\n}", "function buildToolbox() {\n\t//adding stylesheet for to dom\n\tvar cssURL = chrome.extension.getURL('/content_new/'+dirName+'/css/content.css');\n\tvar styleElem = document.createElement('link');\n\tstyleElem.setAttribute('href', cssURL);\n\tstyleElem.setAttribute('rel', 'stylesheet');\n\tstyleElem.setAttribute('type', 'text/css');\n\tdocument.body.appendChild(styleElem);\n\t//adding iframe to dom\n\tvar frameURL = chrome.extension.getURL('/content_new/'+dirName+'/html/frame.html');\n\tvar appendCode = '';\n\tvar frameStyle = '';\n\tappendCode += '<iframe id='+targetFrameId+' style=\"' + frameStyle + '\" src=\"' + frameURL + '\" class=\"fst_inner_frame\">';\n\tvar appendDiv = document.createElement('div');\n\tappendDiv.innerHTML = appendCode;\n\tappendDiv.setAttribute('class', 'fst_fbvid_container fst_container');\n\tappendDiv.setAttribute('id', targetDivId);\n\tdocument.body.appendChild(appendDiv);\n\tsetEventListener();\n}", "function buildToolbox() {\n\t//adding stylesheet for to dom\n\tvar cssURL = chrome.extension.getURL('/content_new/'+dirName+'/css/content.css');\n\tvar styleElem = document.createElement('link');\n\tstyleElem.setAttribute('href', cssURL);\n\tstyleElem.setAttribute('rel', 'stylesheet');\n\tstyleElem.setAttribute('type', 'text/css');\n\tdocument.body.appendChild(styleElem);\n\t//adding iframe to dom\n\tvar frameURL = chrome.extension.getURL('/content_new/'+dirName+'/html/frame.html');\n\tvar appendCode = '';\n\tvar frameStyle = '';\n\tappendCode += '<iframe id='+targetFrameId+' style=\"' + frameStyle + '\" src=\"' + frameURL + '\" class=\"fst_inner_frame\">';\n\tvar appendDiv = document.createElement('div');\n\tappendDiv.innerHTML = appendCode;\n\tappendDiv.setAttribute('class', 'fst_fbvid_container fst_container');\n\tappendDiv.setAttribute('id', targetDivId);\n\tdocument.body.appendChild(appendDiv);\n\tsetEventListener();\n}", "_initWebsiteIframeContent() {\n // create page from html\n this._updateCarpenterPage();\n // update the element stack\n this._updateCarpenterNodesStack();\n // inject the scrollbat styling\n __injectStyle(`\n body::-webkit-scrollbar {\n width: 2px;\n height: 2px;\n }\n body::-webkit-scrollbar-track { \n background-color: hsla(calc(var(--s-color-accent-h, 0) + var(--s-color-accent-spin ,0)),calc((var(--s-color-accent-s, 0)) * 1%),calc((var(--s-color-accent-l, 0)) * 1%),0.1); \n }\n body::-webkit-scrollbar-thumb {\n background-color: hsla(calc(var(--s-color-accent-h, 0) + var(--s-color-accent-spin ,0)),calc((var(--s-color-accent-s, 0)) * 1%),calc((var(--s-color-accent-l, 0)) * 1%),var(--s-color-accent-a, 1)); \n }\n .s-wireframe body::-webkit-scrollbar-track{\n background-color: rgba(0,0,0,0.05);\n } \n ${__websiteUiCss} \n `, {\n rootNode: this._$websiteDocument.body,\n });\n // create the toolbar element\n this._initToolbar();\n this._initToolbarPositioning();\n // listen for toolbar actions\n this._listenToolbarActions();\n // watch for hover on carpenter elements\n this._initMoveMode();\n // prevent default links behaviors\n this._preventExternalLinksBehaviors();\n // // add a \"container\" in the s-root element if it is empty\n // const $root = this._$websiteDocument.querySelector('[s-root]');\n // if (!$root) {\n // throw new Error(\n // `<red>[SCarpenter]</red> in order to work, the SCarpenter editor need an element with the \"s-root\" attribute on it. This element represent where your nodes are going to be rendered`,\n // );\n // }\n // if (!$root.children.length) {\n // $root.setAttribute('s-container', 'root');\n // }\n // listen for click on links in the iframe to close the editor\n this._$websiteDocument.addEventListener('click', (e) => {\n let $link = e.target;\n if (e.target.tagName !== 'A') {\n $link = __traverseUp(e.target, ($elm) => $elm.tagName === 'A' && $elm.hasAttribute('href'));\n }\n if (!$link) {\n return;\n }\n if ($link.hasAttribute('target') &&\n $link.getAttribute('target') === '_blank') {\n return;\n }\n // close the editor\n this._closeEditor();\n });\n if (this.props.escape) {\n __escapeQueue(() => {\n this._closeEditor();\n }, {\n rootNode: this._$websiteDocument,\n });\n }\n // mode\n this._setMode(this.state.mode);\n }", "function addIframe() {\n var iframe = document.createElement('iframe');\n iframe.id = 'form-iframe';\n //iframe.classList.add('embed-responsive-item');\n iframe.setAttribute('src', 'http://contact.colinshaw.org');\n var p = document.createElement('p');\n p.innerHTML = 'Your browser does not support iframes.';\n iframe.appendChild(p);\n document.getElementById('contact-info').appendChild(iframe);\n iframe.onload = function() {\n document.getElementById('loading').classList.add('hide');\n document.getElementById('contact-info').classList.remove('hide');\n }\n}", "function addDigg() {\n var digg = document.getElementById('digg');\n if (digg) {\n \n var ds=typeof digg_skin=='string'?digg_skin:'';var h=80;var w=52;if(ds=='compact'){h=18;w=120;}\n else if(ds=='icon'){h=16;w=16;}\n var u=typeof digg_url=='string'?digg_url:(typeof DIGG_URL=='string'?DIGG_URL:window.location.href);\n\n var output = \"<iframe src='http://digg.com/tools/diggthis.php?u=\"+\n escape(u).replace(/\\+/g,'%2b')+\n (typeof digg_title=='string'?('&t='+escape(digg_title)):'')+\n (typeof digg_bodytext=='string'?('&b='+escape(digg_bodytext)):'')+\n (typeof digg_topic=='string'?('&c='+escape(digg_topic)):'')+\n (typeof digg_bgcolor=='string'?('&k='+escape(digg_bgcolor)):'')+\n (ds?('&s='+ds):'')+\"' height='\"+h+\"' width='\"+w+\"' frameborder='0' scrolling='no'></iframe>\"; \n \n digg.innerHTML = output + digg.innerHTML; \n }\n}", "function addDigg() {\n var digg = document.getElementById('digg');\n if (digg) {\n \n var ds=typeof digg_skin=='string'?digg_skin:'';var h=80;var w=52;if(ds=='compact'){h=18;w=120;}\n else if(ds=='icon'){h=16;w=16;}\n var u=typeof digg_url=='string'?digg_url:(typeof DIGG_URL=='string'?DIGG_URL:window.location.href);\n\n var output = \"<iframe src='http://digg.com/tools/diggthis.php?u=\"+\n escape(u).replace(/\\+/g,'%2b')+\n (typeof digg_title=='string'?('&t='+escape(digg_title)):'')+\n (typeof digg_bodytext=='string'?('&b='+escape(digg_bodytext)):'')+\n (typeof digg_topic=='string'?('&c='+escape(digg_topic)):'')+\n (typeof digg_bgcolor=='string'?('&k='+escape(digg_bgcolor)):'')+\n (ds?('&s='+ds):'')+\"' height='\"+h+\"' width='\"+w+\"' frameborder='0' scrolling='no'></iframe>\"; \n \n digg.innerHTML = output + digg.innerHTML; \n }\n}", "function dataFrame(options) {\n\t\tvar o = $.extend({\n\t\t\t\t\"parent\" : 'body',\n\t\t\t}, options),\n\t\t\tkey = makeKey();\n\t\t\t\n\t\t$(\"body\").append('<div id=\"'+dataDivId||'dataDiv'+'\"></div>');\n\t\t\n\t\t// Fix! We'll want to instantiate a secondary frame for secure processing and communications.\n\t\t// v.dataFrame = new OmniCommFrame({\n\t\t\t// \"url\" : 'https://codapt.com/o/',\n\t\t\t// \"parent\" : o.parent,\n\t\t\t// \"visible\" : false,\n\t\t\t// \"query\" : { \n\t\t\t\t// \"a\" : Date.now(),\n\t\t\t\t// \"cmd\" : 'load',\n\t\t\t\t// \"Url\" : window.location.href,\n\t\t\t\t// \"Origin\" : window.location.origin,\n\t\t\t\t// \"Pub\" : key,\n\t\t\t\t// \"Old\" : localStore({\"cmd\":'get',\"key\":'Old'})\n\t\t\t// },\n\t\t\t// \"callback\" : function(data) {\n\t\t\t\t// var cmd = data.cmd;\n\t\t\t\t// if (cmd == \"ping\") {\n\t\t\t\t\t// adminUpdate(data);\n\t\t\t\t// } else if (cmd == \"msg\") {\n\t\t\t\t\t// adminMsg(data);\n\t\t\t\t// } else if (cmd == \"load\") {\n\t\t\t\t\t// adminLoad(data);\n\t\t\t\t// }\n\t\t\t// }\n\t\t// });\n\t\t\n\t\t\n\t\t\t\n\t\to.comm = new CommObj(); // Fix! Transition this into iframe.\n\t\t\n\t\t\n\t\t\n\t\tfunction adminUpdate(data) {\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tfunction adminMsg(data) {\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tfunction adminLoad(data) {\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\n\t\t// Used for all communications with central server, ACE, client server, etc. Abstracts mechanisms behind these transmissions to simplify use.\n\t\tfunction CommObj() { // Fix. We'll want to relay this through ACE in a secondary frame.\n\t\t\tvar _this = this,\n\t\t\t\tlog = [],\n\t\t\t\tque = { // Stores requests to be made to server and items returned but not loaded yet.\n\t\t\t\t\t\"wait\" : [], // a JSON containing callObjs that are to be sent to the server but in wait due to lack of connectivity or other cases. Ordered by time placed.\n\t\t\t\t\t\"out\" : [], // a JSON containing callObjs that have been sent to the server, ordered by time placed.\n\t\t\t\t\t\"back\" : [] // Array of sequentially returned aceObjs, to be processed locally and returned.\n\t\t\t\t};\n\t\t\t\n\t\t\tajaxInit();\n\t\t\n\t\t\n\t\t\t/////// CommObj Exposed Methods /////////////////////\n\t\t\n\t\t\n\t\t\t// Packages and initiates the actual call to the server.\n\t\t\tthis.send = function makeCall(dat, cmd) {\n\t\t\t\tvar timeNow = Date.now();\n\t\t\t\tlocalStore({\"cmd\":'set',\"key\":'Pub',\"val\":(key=makeKey())});\n\t\t\t\tvar callObj = {\n\t\t\t\t\t\"a\" : timeNow,\n\t\t\t\t\t\"cmd\" : cmd || 0,\n\t\t\t\t\t\"dat\" : dat,\n\t\t\t\t\t\"Pub\" : key,\n\t\t\t\t\t\"Old\" : localStore({\"cmd\":'get',\"key\":'Old'})\n\t\t\t\t};\n\t\t\t\tque.out[timeNow] = callObj;\n\t\t\t\t$.ajax({\"data\":callObj});\n\t\t\t\t// logMsg('makeCall() data sent.', callObj);\n\t\t\t};\n\t\t\t\n\t\t\t\n\t\t\t/////// CommObj Private Functions /////////////////////\n\t\t\n\t\t\t\n\t\t\t// Sets ajax defaults and establishes generic connection with an appropriate ACE server.\n\t\t\tfunction ajaxInit() {\n\t\t\t\t$.ajaxSetup({\n\t\t\t\t\turl : 'https://codapt.com/o/',\n\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t// crossDomain: false,\n\t\t\t\t\tbeforeSend: ajaxPreCall,\n\t\t\t\t\tsuccess: ajaxSuccess,\n\t\t\t\t\terror: ajaxError,\n\t\t\t\t\tcomplete: ajaxComplete\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t$.ajax({\"data\":{\n\t\t\t\t\t\"a\" : Date.now(),\n\t\t\t\t\t\"cmd\" : 'load',\n\t\t\t\t\t\"Url\" : window.location.href,\n\t\t\t\t\t\"Origin\" : window.location.origin,\n\t\t\t\t\t\"Pub\" : key,\n\t\t\t\t\t\"Old\" : localStore({\"cmd\":'get',\"key\":'Old'})\n\t\t\t\t}});\n\t\t\t}\n\t\n\t\n\t\t\t// Used for low level ajax call tracking and error handling.\n\t\t\tfunction ajaxPreCall(xhrObj, ajaxObj) {\n\t\t\t\t// var callObj = {\n\t\t\t\t\t// \"url\" : ajaxObj.url,\n\t\t\t\t\t// \"type\" : ajaxObj.type,\n\t\t\t\t\t// \"data\" : ajaxObj.data\n\t\t\t\t// };\n\t\t\t\t// logMsg('ajax pre-call...', callObj); // Fix?\n\t\t\t\t// if (!ajaxObj.data || !ajaxObj.data.a) {\n\t\t\t\t\t// var errorObj = {\n\t\t\t\t\t\t// \"error\" : \"ajaxObj.data.a is not set!\",\n\t\t\t\t\t\t// \"data\" : ajaxObj.data,\n\t\t\t\t\t\t// \"ajaxObj\" : ajaxObj\n\t\t\t\t\t// }\n\t\t\t\t\t// flagError(\"iframe ajaxPreCall error\", errorObj);\n\t\t\t\t// }\n\t\t\t}\n\t\n\t\n\t\t\t// Called on completion of each ajax request to handle returned data.\n\t\t\tfunction ajaxSuccess(data, status, xhrObj) {\n\t\t\t\tif (!data || !_.isObject(data)) {\n\t\t\t\t\tvar errorObj = {\n\t\t\t\t\t\t\"data\" : data,\n\t\t\t\t\t\t\"xhrObj\" : xhrObj,\n\t\t\t\t\t\t\"status\" : status\n\t\t\t\t\t};\n\t\t\t\t\t// flagError(\"iframe ajaxSuccess returned bad data.\", errorObj);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar backTime = Date.now(),\n\t\t\t\t\tdataObj = jsonToObj(data),\n\t\t\t\t\tcallTime = dataObj.a || 0,\n\t\t\t\t\tlag = backTime-callTime,\n\t\t\t\t\tcmd = dataObj.cmd;\n\t\t\t\t\n\t\t\t\tlocalStore({\"cmd\":'set',\"key\":'Old'});\n\t\t\t\t// if (!callTime) { flagError('No returned callTime for this ajax data.') }\n\t\t\t\tif (cmd == \"ping\") {\n\t\t\t\t\tadminUpdate(data);\n\t\t\t\t} else if (cmd == \"msg\") {\n\t\t\t\t\tadminMsg(data);\n\t\t\t\t} else if (cmd == \"load\") {\n\t\t\t\t\tadminLoad(data);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// Handles errors for iframe AJAX requests.\n\t\t\tfunction ajaxError(xhrObj, status, error) {\n\t\t\t\t// flagError(\"iframe AJAX eror\", {\n\t\t\t\t\t// \"error\" : error,\n\t\t\t\t\t// \"status\" : status,\n\t\t\t\t\t// \"xhrObj\" : xhrObj\n\t\t\t\t// });\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Called after all other handlers have been called for request.\n\t\t\tfunction ajaxComplete(jqXHR, status) {\n\t\t\t\t//logMsg('ajax completed. Status: ', status);\n\t\t\t\t// if (status != \"success\") {\n\t\t\t\t\t// logMsg(\"Problem with ajax call\", status);\n\t\t\t\t\t// // flagError(\"Problem initiating connection. Status: \"+status, jqXHR);\n\t\t\t\t// }\n\t\t\t}\n\t\t\t\n\t\n\t\t};//CommObj();\n\t\t\n\t\t\n\t}//dataFrame()", "function Element(tag, styles, inner, parent) {\n var el = document.createElement(tag);\n if ($(parent)) { $(parent).get(0).appendChild(el); }\n if (styles) { for (var i in styles) {$(el).css(i, styles[i]); } }\n if (inner) { $(el).html(inner); }\n $(el).addClass('frame');\n return el;\n}", "function main() {\n let iframe, plugin_service, styles; // Declare our variables\n const elms = document.querySelectorAll(\"[id='musaeus-app-widget']\"); // Get all musaeus-app-widget id's\n for (let i = 0; i < elms.length; i++) { // Loop over each id\n plugin = elms[i].dataset.plugin; // Get the correct plugin data\n if (typeof(plugin) == 'undefined') { break } // If no plugin data is specified break the loop \n url = \"https://app.julenu.dk/\" + plugin; // Set the url for the iframe\n iframe = document.createElement('iframe'); // Let's create our iframe\n iframe.setAttribute('src', url); // The website to use in the Iframe\n iframe.setAttribute('id', 'frame' + i); // Set a unique id\n iframe.setAttribute('frameborder', '0'); // Here we make the border = 0\n iframe.setAttribute('scrolling', 'no'); // Make sure the iframe can't be scrolled\n plugin_service = plugin.split('/')[0]; // Here we access the specific plugin service\n if (plugin_service == 'video') { // We need diferent atributes for the video plugin\n styles = 'min-width: 100%; min-height: 100%; border: none; margin: 0 auto; display: table; !important;'\n iframe.setAttribute('allowFullScreen', ''); // Set the allow fulscreen to true. Used for the video\n } else {\n styles = 'min-width: 100%; min-height: 100%; border: none; margin: 0 auto; border-radius: 12px; box-shadow: 0 2px 5px rgba(0, 0, 0, .1); display: table; !important;'\n }\n iframe.setAttribute('style', styles); // Assign the styles that we declared eariler to the iframe tag\n elms[i].parentNode.replaceChild(iframe, elms[i]); // And now we replace the old child with our new one (the iframe)\n iFrameResize({ log: false, bodyMargin: '10px' }, '#frame' + i); // And we use Iframe Resizer library to determine the height\n }\n }", "async displayIframe() {\n return this.display(checkIsMobile())\n }", "function createNode() {\n let node = document.createElement('div');\n let iframe = document.createElement('iframe');\n iframe.style.height = '100%';\n iframe.style.width = '100%';\n node.appendChild(iframe);\n return node;\n }", "function generateIframeSrc() {\n return [\n 'https://', host, '/frame/web/v1/auth?tx=', duoSig,\n '&parent=', encodeURIComponent(document.location.href),\n '&v=2.8'\n ].join('');\n }", "function attachIFrameContext({\n generator_api = '',\n automatic_beacon = false,\n html = '',\n headers = [],\n attributes = [],\n origin = ''\n} = {}) {\n return attachFrameContext(\n 'iframe', generator_api, resolve_to_config = false, ad_with_size = false,\n requested_size = null, automatic_beacon, html, headers, attributes,\n origin);\n}", "function fBox() {\n\t$('#fbox').append('<iframe marginheight=\"0\" marginwidth=\"0\" src=\"http://www.facebook.com/connect/connect.php?id=126686564044617&amp;connections=10\" align=\"top\" frameborder=\"0\" width=\"300\" height=\"250\" scrolling=\"no\" />');\n}", "_buildUI(parent) {\n var row, elem;\n var table = document.createElement('table');\n table.classList.add('controlPad');\n\n this._makerow(table,\n [null, null,\n ['keyboard_arrow_up', 'offsetY', 1],\n null,\n ['zoom_in', 'scaleUp']]);\n\n this._makerow(table,\n [null, null,\n ['keyboard_double_arrow_up', 'offsetY', 10],\n null, null]);\n\n this._makerow(table,\n [['keyboard_arrow_left', 'offsetX', 1],\n ['keyboard_double_arrow_left', 'offsetX', 10],\n ['restart_alt', 'reset'],\n ['keyboard_double_arrow_right', 'offsetX', -10],\n ['keyboard_arrow_right', 'offsetX', -1]]);\n\n this._makerow(table,\n [null, null,\n ['keyboard_double_arrow_down', 'offsetY', -10],\n null, null]);\n\n this._makerow(table,\n [['zoom_out', 'scaleDown', 1.1],\n null,\n ['keyboard_arrow_down', 'offsetY', -1],\n null, null]);\n\n parent.appendChild(table);\n\n // The UI is fully built, declare the containing parent as a UI\n // element of type controlPad\n parent.classList.add('UIdata');\n parent.setAttribute('type', 'controlPad');\n\n parent.UIharness = this;\n return parent;\n }", "_createCanvas() {\n\n const canvasId = \"xeokit-canvas-\" + math.createUUID();\n const body = document.getElementsByTagName(\"body\")[0];\n const div = document.createElement('div');\n\n const style = div.style;\n style.height = \"100%\";\n style.width = \"100%\";\n style.padding = \"0\";\n style.margin = \"0\";\n style.background = \"rgba(0,0,0,0);\";\n style.float = \"left\";\n style.left = \"0\";\n style.top = \"0\";\n style.position = \"absolute\";\n style.opacity = \"1.0\";\n style[\"z-index\"] = \"-10000\";\n\n div.innerHTML += '<canvas id=\"' + canvasId + '\" style=\"width: 100%; height: 100%; float: left; margin: 0; padding: 0;\"></canvas>';\n\n body.appendChild(div);\n\n this.canvas = document.getElementById(canvasId);\n }", "function setupBuyButton(){\n\t//if(location.href.indexOf(\"webdesign-flash.ro\") == -1) return;\n\tFWDBuyButton.setPrototype();\n\tbuyButton = new FWDBuyButton(\"graphics/buy.png\",\"graphics/hello.png\", 70,70,30,60);\n\tbuyButton.setX(0);\n\tbody_el.appendChild(buyButton.screen);\n\tself.positionBuyButton();\n}", "function iFrame(element, index, src, ariaHiddenTest, isAriaHidden, accessibleName, ariaLabel, ariaLabelledby, ariaRole, ariaLabeledby, alerts) {\n this.element = element;\n this.index = index;\n this.src = src;\n this.ariaHiddenTest = ariaHiddenTest;\n this.isAriaHidden = isAriaHidden;\n this.accessibleName = accessibleName\n this.ariaLabel = ariaLabel\n this.ariaLabelledby = ariaLabelledby;\n this.ariaRole = ariaRole;\n this.ariaLabeledby = ariaLabeledby;\n this.alerts = alerts;\n }", "function iFrame(element, index, src, ariaHiddenTest, isAriaHidden, accessibleName, ariaLabel, ariaLabelledby, ariaRole, ariaLabeledby, alerts) {\n this.element = element;\n this.index = index;\n this.src = src;\n this.ariaHiddenTest = ariaHiddenTest;\n this.isAriaHidden = isAriaHidden;\n this.accessibleName = accessibleName\n this.ariaLabel = ariaLabel\n this.ariaLabelledby = ariaLabelledby;\n this.ariaRole = ariaRole;\n this.ariaLabeledby = ariaLabeledby;\n this.alerts = alerts;\n }", "function objectTag() {\n // Return the html tag that should be inserted\n\n var curDOM = dreamweaver.getDocumentDOM('document');\n var pDOM = dreamweaver.getDocumentDOM('parent');\n\n // Check to see if current document is a frameset.\n if (curDOM.body.tagName.toUpperCase() == 'FRAMESET') {\n\t var curOffsets = curDOM.getSelection();\n\t var curNode = curDOM.offsetsToNode(curOffsets[0], curOffsets[1]);\n // Wrap current selection with new Frameset.\n\n wrapFrame(curDOM, curNode, getFrameSpec());\n // Otherwise, check if there is a parent frameset.\n } else if (pDOM == null) {\n // No parent, create new frameset and wrap current document\n newFrame(curDOM, getFrameSpec());\n } else {\n // Wrap current Frameset with new Frameset.\n if (!pDOM) {return;} // Check for invalid DOM.\n wrapFrame(pDOM, activeFrameNode(), getFrameSpec());\n }\n pDOM = dreamweaver.getDocumentDOM('parent');\n curDOM = dreamweaver.getDocumentDOM('document');\n if (pDOM){\n dreamweaver.setActiveWindow(pDOM, true);\n if (pDOM.body)\n pDOM.setSelectedNode(pDOM.body)\n }\n else if(curDOM.body)\n curDOM.setSelectedNode(curDOM.body);\n\n // if the original doc was XHTML, convert the frameset doc to XHTML,\n // to clean up the syntax\n if (curDOM.getIsXHTMLDocument())\n dreamweaver.getDocumentDOM().convertToXHTML();\n\n // Finally return nothing. No values actually inserted.\n\n\tprefsAccessibilityOption = dw.getPreferenceString(\"Accessibility\", \"Accessibility Frame Options\", \"\");\n\tif (prefsAccessibilityOption =='TRUE') {\n\n\t var cmdFile = dreamweaver.getConfigurationPath() + \"/Commands/FrameOptions.htm\";\n\t var cmdDOM = dreamweaver.getDocumentDOM(cmdFile);\n \n if (pDOM) {cmdDOM.parentWindow.setFormItem(pDOM);}\n\t else {cmdDOM.parentWindow.setFormItem(curDOM);}\n\t dreamweaver.popupCommand(\"FrameOptions.htm\");\n }\n}", "function getPreviewElement(width, height, channel, dummyFrame) {\n var previewElement = \"\";\n if (dummyFrame === true) {\n previewElement = $(\"<div id='streamPreview'></div>\");\n previewElement.css(\"height\", height);\n previewElement.css(\"width\", width);\n previewElement.css(\"border\", \"5px solid red\");\n previewElement.css(\"background-color\", \"black\");\n } else {\n if (browser === 'CHROME') {\n //crappy work around using flash\n previewElement = $(\"<div id='streamPreview'><iframe src='https://www-cdn.jtvnw.net/swflibs/TwitchPlayer.swf?channel=\" + channel + \"' height=\" + height + \" width=\" + width + \" frameborder='0' scrolling='no'></iframe></div>\");\n } else if (browser === 'FIREFOX') { \n //must click lock in browser to left of url and disable protection for twitch site\n previewElement = $(\"<div id='streamPreview'><iframe src='https://player.twitch.tv/?channel=\" + channel + \"' height=\" + height + \" width=\" + width + \" frameborder='0' scrolling='no'></iframe></div>\");\n } else {\n //if it's unrecognized browser I'm gonna go with flash working but doubtful it would work\n previewElement = $(\"<div id='streamPreview'><iframe src='https://www-cdn.jtvnw.net/swflibs/TwitchPlayer.swf?channel=\" + channel + \"' height=\" + height + \" width=\" + width + \" frameborder='0' scrolling='no'></iframe></div>\");\n }\n }\n return previewElement;\n }", "initRDMFrame() {\n const { document: doc, gBrowser } = this.browserWindow;\n const rdmFrame = doc.createElement(\"iframe\");\n rdmFrame.src = \"chrome://devtools/content/responsive/toolbar.xhtml\";\n rdmFrame.classList.add(\"rdm-toolbar\");\n\n this.browserContainerEl = gBrowser.getBrowserContainer(\n gBrowser.getBrowserForTab(this.tab)\n );\n this.browserStackEl = this.browserContainerEl.querySelector(\n \".browserStack\"\n );\n\n this.browserContainerEl.classList.add(\"responsive-mode\");\n\n // Prepend the RDM iframe inside of the current tab's browser stack.\n this.browserStackEl.prepend(rdmFrame);\n\n // Wait for the frame script to be loaded.\n message.wait(rdmFrame.contentWindow, \"script-init\").then(async () => {\n // Notify the frame window that the Resposnive UI manager has begun initializing.\n // At this point, we can render our React content inside the frame.\n message.post(rdmFrame.contentWindow, \"init\");\n // Wait for the tools to be rendered above the content. The frame script will\n // then dispatch the necessary actions to the Redux store to give the toolbar the\n // state it needs.\n message.wait(rdmFrame.contentWindow, \"init:done\").then(() => {\n rdmFrame.contentWindow.addInitialViewport({\n userContextId: this.tab.userContextId,\n });\n });\n });\n\n this.rdmFrame = rdmFrame;\n }", "function ofmeetEtherpadClicked()\n{\n console.log(\"ofmeet.etherpadClicked\", OFMEET_CONFIG.bgWin.pade.activeUrl);\n\n if (OFMEET_CONFIG.bgWin.pade.activeUrl)\n {\n if (OFMEET_CONFIG.documentShare)\n {\n if (OFMEET_CONFIG.documentOwner)\n {\n OFMEET_CONFIG.documentShare = false;\n OFMEET_CONFIG.documentOwner = false;\n OFMEET_CONFIG.documentUser = null;\n OFMEET_CONFIG.largeVideoContainer = null;\n\n document.getElementById(\"largeVideoContainer\").innerHTML = OFMEET_CONFIG.largeVideoContainer;\n\n // above code does not work properly\n // brute force solution is to reload\n\n APP.conference._room.sendOfMeet('{\"event\": \"ofmeet.event.url.end\"}');\n window.location.href = \"chrome.index.html?room=\" + OFMEET_CONFIG.room;\n }\n }\n else {\n OFMEET_CONFIG.documentShare = true;\n OFMEET_CONFIG.documentOwner = true;\n\n OFMEET_CONFIG.largeVideoContainer = document.getElementById(\"largeVideoContainer\").innerHTML;\n\n var url = OFMEET_CONFIG.bgWin.pade.activeUrl;\n\n if (OFMEET_CONFIG.bgWin.pade.activeUrl.indexOf(\".pdf\") > -1)\n {\n url = chrome.extension.getURL(\"pdf/index.html?pdf=\" + OFMEET_CONFIG.bgWin.pade.activeUrl);\n }\n\n document.getElementById(\"largeVideoContainer\").innerHTML = OFMEET_CONFIG.iframe(url);\n }\n }\n}", "drawFrame() {\n const term = this._terminal,\n width = term.getWidth(),\n height = term.getHeight();\n\n let chars = '',\n i;\n\n // generate the top and bottom frames\n for (i = 1; i < width - 1; i++) {\n chars += TerminalFrame.FRAME_SYMBOLS.HORIZONTAL;\n }\n\n term\n // print the top frame\n .move(2, 0)\n .print(chars)\n // print the bottom frame\n .move(2, height)\n .print(chars)\n ;\n\n const sideChar = TerminalFrame.FRAME_SYMBOLS.VERTICAL;\n\n // print the left and right frames\n for (i = 2; i < height; i++) {\n term\n // left frame\n .move(0, i)\n .print(sideChar)\n // right frame\n .move(width - 1, i)\n .print(sideChar)\n ;\n }\n\n // draw corners\n term\n // top left\n .move(0, 0)\n .print(TerminalFrame.FRAME_SYMBOLS.TOP_LEFT_CORNER)\n // top right\n .move(width, 0)\n .print(TerminalFrame.FRAME_SYMBOLS.TOP_RIGHT_CORNER)\n // bottom left\n .move(0, height)\n .print(TerminalFrame.FRAME_SYMBOLS.BOTTOM_LEFT_CORNER)\n // bottom right\n .move(width, height)\n .print(TerminalFrame.FRAME_SYMBOLS.BOTTOM_RIGHT_CORNER)\n ;\n }", "function setHtml() {\n\n\t\tvar div = document.createElement('div');\n\t\tdiv.id = \"box-window\";\n\t\tdiv.innerHTML =\n\t\t\t\t'<header>' +\n\t\t\t\t\t'<p id=\"close-btn\"></p><p id=\"storage-btn\"></p><p id=\"wide-btn\"></p>' +\n\t\t\t\t'</header>' +\n\t\t\t\t'<div id=\"content\">' +\n\t\t\t\t\t'<nav>' +\n\t\t\t\t\t\t'<ol>' +\n\t\t\t\t\t\t\t'<li><p id=\"nav-home\" class=\"active\">HOME</p></li>' +\n\t\t\t\t\t\t\t'<li><p id=\"nav-about\">ABOUT</p></li>' +\n\t\t\t\t\t\t\t'<li><p id=\"nav-work\">WORK</p></li>' +\n\t\t\t\t\t\t\t'<li><p id=\"nav-board\">BOARD</p></li>' +\n\t\t\t\t\t\t'</ol>' +\n\t\t\t\t\t'</nav>' +\n\t\t\t\t\t'<div class=\"inner\">' +\n\t\t\t\t\t\t'<div id=\"contet-home\" class=\"show contents\">' +\n\t\t\t\t\t\t\t'<p>サイトタイトル : ' + document.title + '</p>' +\n\t\t\t\t\t\t\t'<p>最終更新日時 : ' + document.lastModified + '</p>' +\n\t\t\t\t\t\t\t'<p>画像数 : ' + document.images.length + '</p>' +\n\t\t\t\t\t\t\t'<p>リンク数 : ' + document.links.length + '</p>' +\n\t\t\t\t\t\t'</div>' +\n\t\t\t\t\t\t'<div id=\"contet-about\" class=\"contents\">' +\n\t\t\t\t\t\t\t'<p id=\"status-image-size\">画像の大きさ : <span>なし</span></p>' +\n\t\t\t\t\t\t'</div>' +\n\t\t\t\t\t\t'<div id=\"contet-work\" class=\"contents\">' +\n\t\t\t\t\t\t\t'<iframe id=\"desk-nets\" src=\"http://graphic-tokyo.dn-cloud.com/cgi-bin/dneo/dneo.cgi?\" width=\"100%\" height=\"300px\"></iframe>' +\n\t\t\t\t\t\t\t'<p id=\"open-secretWindow\">シークレットウィンドウで開く</p>' +\n\t\t\t\t\t\t\t'<p id=\"mail-auto-reload\">Mail自動更新</p>' +\n\t\t\t\t\t\t\t'<p id=\"test\"><' + '?' + ' php echo 11111; ?' + '></p>' +\n\t\t\t\t\t\t'</div>' +\n\t\t\t\t\t\t'<div id=\"contet-board\" class=\"contents\">' +\n\t\t\t\t\t\t\t'<div id=\"board-area\">' +\n\t\t\t\t\t\t\t\t'<input id=\"board-input\" type=\"text\" name=\"name\" size=\"30\" maxlength=\"20\" ></input>' +\n\t\t\t\t\t\t\t\t'<p id=\"board-write\">投稿する</p>' +\n\t\t\t\t\t\t\t'</div>' +\n\t\t\t\t\t\t'</div>' +\n\t\t\t\t\t'</div>' +\n\t\t\t\t'</div>';\n\n\t\tdocument.body.appendChild(div);\n\n\t\treturn false;\n\t}", "generateHtml() {\n const captureContainer = document.createElement(\"div\");\n addCssClass(captureContainer, CHANNEL_CAPTURE_CONTAINER_CSS_CLASSES.channelCaptureContainer);\n captureContainer.id = CHANNEL_CAPTURE_CONTAINER_CSS_CLASSES.channelCaptureContainer;\n let label, smsInputElement, emailInputElement;\n switch (this.promptOptions.type) {\n case DelayedPromptType.Sms:\n label = this.promptOptions.text.smsLabel || \"Phone Number\";\n smsInputElement = this.getInputWithValidationElement(DelayedPromptType.Sms, label);\n captureContainer.appendChild(smsInputElement);\n break;\n case DelayedPromptType.Email:\n label = this.promptOptions.text.emailLabel || \"Email\";\n emailInputElement = this.getInputWithValidationElement(DelayedPromptType.Email, label);\n captureContainer.appendChild(emailInputElement);\n break;\n case DelayedPromptType.SmsAndEmail:\n label = this.promptOptions.text.emailLabel || \"Email\";\n emailInputElement = this.getInputWithValidationElement(DelayedPromptType.Email, label);\n captureContainer.appendChild(emailInputElement);\n label = this.promptOptions.text.smsLabel || \"Phone Number\";\n smsInputElement = this.getInputWithValidationElement(DelayedPromptType.Sms, label);\n captureContainer.appendChild(smsInputElement);\n break;\n default:\n break;\n }\n return captureContainer;\n }", "function createPad(gamepad) {\n\t\tvar index = gamepad.index;\n\t\tvar i, e, e2, e3, html;\n\t\tvar padElemStruct = {};\n\t\tvar gamepadsElem = eid('gamepads');\n\n\t\t// insert empty divs as necessary, up through this index\n\t\tfor (i = 0; i <= index; i++) {\n\t\t\tif (!gamepadsElem.children[i]) {\n\t\t\t\tvar newDiv = document.createElement('div');\n\t\t\t\tgamepadsElem.appendChild(newDiv);\n\t\t\t}\n\t\t}\n\n\t\tvar outer = gamepadsElem.children[gamepad.index];\n\n\t\tpadElemStruct.elem = outer;\n\t\tpadElemStruct.index = index;\n\n\t\touter.className = \"gamepad\";\n\t\t//outer.setAttribute('data-index', index);\n\n\t\t// title\n\t\thtml = '<div class=\"gamepad-title\">' +\n\t\t\t\"Gamepad \" + index + \", \" + (gamepad.connected?'':'dis') + \"connected\" +\n\t\t\t'</div>';\n\n\t\t// id\n\t\thtml += ('<div class=\"gamepad-id\">' + gamepad.id + '</div>');\n\n\t\t// mapping\n\t\thtml += ('<div class=\"gamepad-mapping\">Mapping: ' + gamepad.mapping + '</div>');\n\n\t\t// buttons\n\t\thtml += '<div class=\"gamepad-button-box\">'\n\n\t\tfor (i = 0; i < gamepad.buttons.length; i++) {\n\t\t\thtml += '<div class=\"gamepad-button-inner-box\">';\n\t\t\thtml += '<div class=\"gamepad-button\">0</div>';\n\t\t\thtml += ('<div class=\"gamepad-button-label\">' + i + '</div>');\n\t\t\thtml += '</div>'; // gamepad-button-inner-box\n\t\t}\n\n\t\thtml += '</div>'; // gamepad-button-box\n\n\t\t// axes\n\t\thtml += '<div class=\"gamepad-axes-box\">';\n\n\t\tfor (i = 0; i < gamepad.axes.length; i += 2) {\n\t\t\tvar oddManOut = (i == gamepad.axes.length - 1);\n\n\t\t\thtml += '<div class=\"gamepad-axes-inner-box\">';\n\n\t\t\thtml += ('<div class=\"gamepad-axis-panel\">' +\n\t\t\t\t'<div class=\"gamepad-axis-pip\"></div>' +\n\t\t\t\t'</div>' +\n\t\t\t\t'<div class=\"gamepad-axis-labels\">' + i);\n\t\t\t\t\n\t\t\tif (!oddManOut) {\n\t\t\t\thtml += (',' + (i+1));\n\t\t\t}\n\n\t\t\thtml += ('</div>' +\n\t\t\t\t'<div class=\"gamepad-axis-values\">' +\n\t\t\t\t'<span class=\"gamepad-axis-value-' + i + '\">0</span>');\n\n\t\t\tif (!oddManOut) {\n\t\t\t\thtml += (',<span class=\"gamepad-axis-value-' + (i+1) + '\">0</span>');\n\t\t\t}\n\n\t\t\thtml += '</div>'; // gamepad-axis-values\n\t\t\thtml += '</div>'; // gamepad-axes-inner-box\n\t\t}\n\n\t\thtml += '</div>'; // gamepad-axes-box\n\n\t\touter.innerHTML = html;\n\n\t\tpadElemStruct.buttons = outer.querySelector('.gamepad-button-box');\n\t\tpadElemStruct.axes = outer.querySelector('.gamepad-axes-box');\n\n\t\tpadElem[index] = padElemStruct;\n\t}", "function ready() {\n\t if (!host) {\n\t host = getDataAttribute(iframe, 'host');\n\t\n\t if (!host) {\n\t throwError('No API hostname is given for Duo to use. Be sure to pass ' + 'a `host` parameter to Duo.init, or through the `data-host` ' + 'attribute on the iframe element.', 'https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe');\n\t }\n\t }\n\t\n\t if (!duoSig || !appSig) {\n\t parseSigRequest(getDataAttribute(iframe, 'sigRequest'));\n\t\n\t if (!duoSig || !appSig) {\n\t throwError('No valid signed request is given. Be sure to give the ' + '`sig_request` parameter to Duo.init, or use the ' + '`data-sig-request` attribute on the iframe element.', 'https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe');\n\t }\n\t }\n\t\n\t // if postAction/Argument are defaults, see if they are specified\n\t // as data attributes on the iframe\n\t if (postAction === '') {\n\t postAction = getDataAttribute(iframe, 'postAction') || postAction;\n\t }\n\t\n\t if (postArgument === 'sig_response') {\n\t postArgument = getDataAttribute(iframe, 'postArgument') || postArgument;\n\t }\n\t\n\t // point the iframe at Duo\n\t iframe.src = ['https://', host, '/frame/web/v1/auth?tx=', duoSig, '&parent=', encodeURIComponent(document.location.href), '&v=2.6'].join('');\n\t\n\t // listen for the 'message' event\n\t onMessage(onReceivedMessage);\n\t }", "showIFrameInParent(data, element) {\n bsw.showIFrame(data.response.sets, element);\n }", "function insertContentIFrame(width) {\n\t\tif (typeof(width)==\"undefined\") {\n\t\t\twidth = \"100%\";\n\t\t}\n\n\t\tvar s = \"\";\n\t\t\n\t\ts += createIframeHtml(\"main\", elemParams.CONTENTIFRAME, \"block\", width);\n\t\ts += createIframeHtml(\"mytemplate\", \"mytemplate\", \"none\", width);\n\n\t\tdocument.write(s);\n\t}", "function createPaint(parent) {\n var canvas = elt(\"canvas\", {width: 640, height: 480});\n var cx = canvas.getContext(\"2d\");\n cx.fillStyle = 'white';\n cx.fillRect(0,0,canvas.width, canvas.height);\n var toolbar = elt(\"div\", {class: \"toolbar\"});\n for (var name in controls)\n toolbar.appendChild(controls[name](cx));\n\n var panel = elt(\"div\", {class: \"picturepanel\"}, canvas);\n parent.appendChild(elt(\"div\", null, panel, toolbar));\n}", "function SetFrame(){\n\tvar h = $(\"header\").height() + environment.height + $(\"footer\").height() + 110;\n\tlog(h);\n\tFB.Canvas.setSize({ width: environment.width, height: h });\n}", "function IFrame(props){\n return(\n <div>\n <iframe className=\"Resume-Iframe\" name={props.name} src={props.src} title=\"Resume\" />\n </div>\n );\n}", "function GetButtonFrameInformation(View)\n{\n\t__View = View;\n\t\n\tvar Static = true;\n\n\tif (TimeCard.View == 4 && TimeCard.Status != 2 && TimeCard.Status != 3)\n\t{\n\t\tStatic = false;\t\n\t}\n\t\n\tGetTimeCardView(TimeCard.View);\n\n\tvar arg = '<div style=\"width:100%\"><form name=\"frmButtonFrame\">'\n\targ += '<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;margin-left:auto;margin-right:auto\"><tr>'\t\t\t\t\t\n\targ += '<td style=\"vertical-align:top;text-align:center;width:100%\">';\n\t\n\t// Direct Report Select\t\n\tif (TimeCard.ManagerFlag)\n\t{\n\t\targ += '<span style=\"white-space:nowrap\"><span class=\"plaintablecellbold\" style=\"vertical-align:top;padding-right:5px\">'+getSeaPhrase(\"REPORTS\",\"TE\")+'</span>';\n\t\targ += '<select class=\"inputbox\" name=\"cmbReports\" onchange=\"parent.NewEmployeeSelected();\">';\n\t\tfor (var i=0; i<Reports.Detail.length; i++)\n\t\t{\n\t\t\tif (Employee.EmployeeNbr == Reports.Detail[i].Employee)\n\t\t\t{\n\t\t\t\targ += '<option value=\"'+Reports.Detail[i].Employee+'\" selected>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\targ += '<option value=\"'+Reports.Detail[i].Employee+'\">';\n\t\t\t}\n\t\t\targ += Reports.Detail[i].FullName + '</option>';\n\t\t}\n\t\targ += '</select></span>';\n\t}\t\n\t\n\tif (TimeCard.View == 4 && ((TimeCard.Status != 2 && TimeCard.Status != 3) || TimeCard.ManagerFlag))\n\t{\n\t\t// Update Button\n\t\tif (View == \"Period\")\n\t\t{\n\t\t\tif (Static)\n\t\t\t{\n\t\t\t\targ += uiButton(getSeaPhrase(\"UPDATE_CARD\",\"TE\"),\"parent.UpdateClicked_Period();return false\",\"margin-left:5px\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\targ += uiButton(getSeaPhrase(\"UPDATE_CARD\",\"TE\"),\"parent.CheckTextChanged_Period();return false\",\"margin-left:5px\");\n\t\t\t}\n\t\t}\n\t\telse if (View == \"Exception\")\n\t\t{\n\t\t\targ += uiButton(getSeaPhrase(\"UPDATE_CARD\",\"TE\"),\"parent.UpdateClicked_Exception();return false\",\"margin-left:5px\");\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\targ += uiButton(getSeaPhrase(\"UPDATE_CARD\",\"TE\"),\"parent.UpdateClicked_Daily();return false\",\"margin-left:5px\");\n\t\t}\n\t\t\n\t\t// Submit Button\n\t\tif (!TimeCard.ManagerFlag)\n\t\t{\n\t\t\tif (View == \"Period\")\n\t\t\t{\t\n\t\t\t\targ += uiButton(getSeaPhrase(\"SUBMIT_CARD_FOR_APPROVE\",\"TE\"),\"parent.SubmitClicked_Period();return false\",\"margin-left:5px\");\n\t\t\t}\n\t\t\telse if (View == \"Exception\")\n\t\t\t{\n\t\t\t\targ += uiButton(getSeaPhrase(\"SUBMIT_CARD_FOR_APPROVE\",\"TE\"),\"parent.SubmitClicked_Exception();return false\",\"margin-left:5px\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Delete Row Button\n\t\tif (TimeCard.Status != 2 && TimeCard.Status != 3)\n\t\t{\n\t\t\targ += uiButton(getSeaPhrase(\"DEL_DATED_INFO\",\"TE\"),\"parent.DeleteRowClicked('\"+View+\"');return false\",\"margin-left:5px\");\n\t\t}\n\t}\n\n\t// Print Button\n\tif (View == \"Period\")\n\t{\n\t\targ += uiButton(getSeaPhrase(\"PRINT_CURRENT_CARD\",\"TE\"),\"parent.PrintClicked_Period();return false\",\"margin-left:5px\");\n\t}\n\telse if (View == \"Exception\")\n\t{\n\t\targ += uiButton(getSeaPhrase(\"PRINT_CURRENT_CARD\",\"TE\"),\"parent.PrintClicked_Exception();return false\",\"margin-left:5px\");\t\n\t}\n\t\n\t// Copy Paste Buttons\n\tif (View != \"Period\" && View != \"Exception\")\n\t{\n\t\tif (TimeCard.View == 4 && TimeCard.Status != 2 && TimeCard.Status != 3)\n\t\t{\n\t\t\targ += uiButton(getSeaPhrase(\"COPY_DAY\",\"TE\"),\"parent.CopyScreen_Daily();return false\",\"margin-left:5px\");\n\t\t\targ += uiButton(getSeaPhrase(\"PASTE_DAY\",\"TE\"),\"parent.PasteScreen_Daily();return false\",\"margin-left:5px\");\t\t\n\t\t}\n\t}\n\n\t// Done Button\n\tif ((View != \"Daily\" && ScreenWidth == 800) || ScreenWidth >= 1024)\n\t{\t\n\t\targ += uiButton(getSeaPhrase(\"CLOSE_TE\",\"TE\"),\"parent.DoneClicked('\"+View+\"');return false\",\"margin-left:5px\");\t\n\t}\n\t\t\n\t// Go to Period View Button\n\tif (View == \"Daily\")\n\t{\t\n\t\targ += uiButton(getSeaPhrase(\"RETURN_PERIOD_VIEW\",\"TE\"),\"parent.BackToPeriod();return false\",\"margin-left:5px\");\t\n\t}\n\t\t\n\t// Go to Summary View Button\n\tif (TimeCard.ManagerFlag)\n\t{\n\t\tif (!NoSummaryFlag && (View != \"Daily\" && View != \"Period\" && ScreenWidth == 800) || ScreenWidth >= 1024)\n\t\t{\t\t\n\t\t\targ += uiButton(getSeaPhrase(\"GO_TO_SUMMARY_APPROVAL\",\"TE\"),\"parent.BackToSummary(this,'\"+View+\"');return false\",\"margin-left:5px\");\t\t\n\t\t}\n\t}\n\t\n\t// Status Drop Down\n\t// Only show the status select if employee is a manager and the user has not navigated from Daily Time Entry.\n\tif (TimeCard.ManagerFlag && View != \"Daily\" && prm != \"daily\")\n\t{\n \t\targ += '<span style=\"white-space:nowrap\"><span class=\"plaintablecellbold\" style=\"vertical-align:top;padding-left:5px;padding-right:5px\">'+getSeaPhrase(\"STATUS\",\"TE\")+'</span>';\n \t\t\n\t\tif (TimeCard.View != 4)\n\t\t{\n\t\t\targ += '<span class=\"plaintablecell\" style=\"vertical-align:top\">';\n\t\t\tswitch (TimeCard.Status)\n\t\t\t{\n\t\t\t\tcase 1: arg += getSeaPhrase(\"SUBMITTED\",\"TE\"); break;\n\t\t\t\tcase 2: arg += getSeaPhrase(\"APPROVED\",\"TE\"); break;\n\t\t\t\tcase 3: arg += getSeaPhrase(\"ON_HOLD\",\"TE\"); break;\n\t\t\t\tcase 4: arg += getSeaPhrase(\"REJECTED\",\"TE\"); break;\n\t\t\t\tcase 5: arg += getSeaPhrase(\"HISTORICAL_1\",\"TE\"); break; // Entered (Historical)\n\t\t\t\tcase 6: arg += getSeaPhrase(\"HISTORICAL_2\",\"TE\"); break; // Submitted (Historical)\n\t\t\t\tcase 7: arg += getSeaPhrase(\"HISTORICAL_3\",\"TE\"); break; // Approved (Historical)\n\t\t\t\tcase 8: arg += getSeaPhrase(\"HISTORICAL_4\",\"TE\"); break; // On Hold (Historical)\n\t\t\t\tcase 9: arg += getSeaPhrase(\"HISTORICAL_5\",\"TE\"); break; // Rejected (Historical)\n\t\t\t\tdefault: arg += getSeaPhrase(\"NONE\",\"TE\"); break;\n\t\t\t}\n\t\t\targ += '</span>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\targ += '<select class=\"inputbox\" name=\"cmbStatus\" onchange=\"parent.SetStatus()\">';\n\t\t\targ += (TimeCard.Status == 1)?'<option value=\"1\" selected></option>':'<option value=\"1\"></option>';\n\t\t\targ += (TimeCard.Status == 2)?'<option value=\"2\" selected>'+getSeaPhrase(\"APPROVED\",\"TE\")+'</option>':'<option value=\"2\">'+getSeaPhrase(\"APPROVED\",\"TE\")+'</option>';\n\t\t\targ += (TimeCard.Status == 3)?'<option value=\"3\" selected>'+getSeaPhrase(\"HOLD\",\"TE\")+'</option>':'<option value=\"3\">'+getSeaPhrase(\"HOLD\",\"TE\")+'</option>';\n\t\t\targ += (TimeCard.Status == 4)?'<option value=\"4\" selected>'+getSeaPhrase(\"REJECTED\",\"TE\")+'</option>':'<option value=\"4\">'+getSeaPhrase(\"REJECTED\",\"TE\")+'</option>';\n\t\t\targ += '</select>';\n\t\t}\n\t\t\n\t\targ += '</span>';\n\t}\n\t\n\targ += '</td></tr></table></form></div>';\n\treturn arg;\n}", "function GetButtonFrameInformation(View)\n{\n\t__View = View;\n\t\n\tvar Static = true;\n\n\tif (TimeCard.View == 4 && TimeCard.Status != 2 && TimeCard.Status != 3)\n\t{\n\t\tStatic = false;\t\n\t}\n\t\n\tGetTimeCardView(TimeCard.View);\n\n\tvar arg = '<div style=\"width:100%\"><form name=\"frmButtonFrame\">'\n\targ += '<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;margin-left:auto;margin-right:auto\"><tr>'\n\t\t\n\t// Direct Report Select\t\n\tif (TimeCard.ManagerFlag)\n\t{\n\t\targ += '<span style=\"white-space:nowrap\"><span class=\"plaintablecellbold\" style=\"vertical-align:top;padding-right:5px\">'+getSeaPhrase(\"REPORTS\",\"TE\")+'</span>';\n\t\targ += '<select class=\"inputbox\" name=\"cmbReports\" onchange=\"parent.NewEmployeeSelected();\">';\n\t\tfor (var i=0; i<Reports.Detail.length; i++)\n\t\t{\n\t\t\tif (Employee.EmployeeNbr == Reports.Detail[i].Employee)\n\t\t\t{\n\t\t\t\targ += '<option value=\"'+Reports.Detail[i].Employee+'\" selected>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\targ += '<option value=\"'+Reports.Detail[i].Employee+'\">';\n\t\t\t}\n\t\t\targ += Reports.Detail[i].FullName + '</option>';\n\t\t}\n\t\targ += '</select></span>';\n\t}\n\t\n\tif (TimeCard.View == 4 && ((TimeCard.Status != 2 && TimeCard.Status != 3) || TimeCard.ManagerFlag))\n\t{\n\t\t// Update Button\n\t\tif (View == \"Period\")\n\t\t{\n\t\t\tif (Static)\n\t\t\t{\n\t\t\t\targ += uiButton(getSeaPhrase(\"UPDATE_CARD\",\"TE\"),\"parent.UpdateClicked_Period();return false\",\"margin-left:5px\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\targ += uiButton(getSeaPhrase(\"UPDATE_CARD\",\"TE\"),\"parent.CheckTextChanged_Period();return false\",\"margin-left:5px\");\n\t\t\t}\n\t\t}\n\t\telse if (View == \"Exception\")\n\t\t{\n\t\t\targ += uiButton(getSeaPhrase(\"UPDATE_CARD\",\"TE\"),\"parent.UpdateClicked_Exception();return false\",\"margin-left:5px\");\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\targ += uiButton(getSeaPhrase(\"UPDATE_CARD\",\"TE\"),\"parent.UpdateClicked_Daily();return false\",\"margin-left:5px\");\n\t\t}\n\t\t\n\t\t// Submit Button\n\t\tif (!TimeCard.ManagerFlag)\n\t\t{\n\t\t\tif (View == \"Period\")\n\t\t\t{\t\n\t\t\t\targ += uiButton(getSeaPhrase(\"SUBMIT_CARD_FOR_APPROVE\",\"TE\"),\"parent.SubmitClicked_Period();return false\",\"margin-left:5px\");\n\t\t\t}\n\t\t\telse if (View == \"Exception\")\n\t\t\t{\n\t\t\t\targ += uiButton(getSeaPhrase(\"SUBMIT_CARD_FOR_APPROVE\",\"TE\"),\"parent.SubmitClicked_Exception();return false\",\"margin-left:5px\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Delete Row Button\n\t\tif (TimeCard.Status != 2 && TimeCard.Status != 3)\n\t\t{\n\t\t\targ += uiButton(getSeaPhrase(\"DEL_DATED_INFO\",\"TE\"),\"parent.DeleteRowClicked('\"+View+\"');return false\",\"margin-left:5px\");\n\t\t}\n\t}\n\n\t// Print Button\n\tif (View == \"Period\")\n\t{\n\t\targ += uiButton(getSeaPhrase(\"PRINT_CURRENT_CARD\",\"TE\"),\"parent.PrintClicked_Period();return false\",\"margin-left:5px\");\n\t}\n\telse if (View == \"Exception\")\n\t{\n\t\targ += uiButton(getSeaPhrase(\"PRINT_CURRENT_CARD\",\"TE\"),\"parent.PrintClicked_Exception();return false\",\"margin-left:5px\");\t\n\t}\n\t\n\t// Copy Paste Buttons\n\tif (View != \"Period\" && View != \"Exception\")\n\t{\n\t\tif (TimeCard.View == 4 && TimeCard.Status != 2 && TimeCard.Status != 3)\n\t\t{\n\t\t\targ += uiButton(getSeaPhrase(\"COPY_DAY\",\"TE\"),\"parent.CopyScreen_Daily();return false\",\"margin-left:5px\");\n\t\t\targ += uiButton(getSeaPhrase(\"PASTE_DAY\",\"TE\"),\"parent.PasteScreen_Daily();return false\",\"margin-left:5px\");\t\t\n\t\t}\n\t}\n\n\t// Done Button\n\tif ((View != \"Daily\" && ScreenWidth == 800) || ScreenWidth >= 1024)\n\t{\t\n\t\targ += uiButton(getSeaPhrase(\"CLOSE_TE\",\"TE\"),\"parent.DoneClicked('\"+View+\"');return false\",\"margin-left:5px\");\t\n\t}\n\t\t\n\t// Go to Period View Button\n\tif (View == \"Daily\")\n\t{\t\n\t\targ += uiButton(getSeaPhrase(\"RETURN_PERIOD_VIEW\",\"TE\"),\"parent.BackToPeriod();return false\",\"margin-left:5px\");\t\n\t}\n\t\t\n\t// Go to Summary View Button\n\tif (TimeCard.ManagerFlag)\n\t{\n\t\tif (!NoSummaryFlag && (View != \"Daily\" && View != \"Period\" && ScreenWidth == 800) || ScreenWidth >= 1024)\n\t\t{\t\t\n\t\t\targ += uiButton(getSeaPhrase(\"GO_TO_SUMMARY_APPROVAL\",\"TE\"),\"parent.BackToSummary(this,'\"+View+\"');return false\",\"margin-left:5px\");\t\t\n\t\t}\n\t}\n\t\n\t// Status Drop Down\n\t// Only show the status select if employee is a manager and the user has not navigated from Daily Time Entry.\n\tif (TimeCard.ManagerFlag && View != \"Daily\" && prm != \"daily\")\n\t{\n \t\targ += '<span style=\"white-space:nowrap\"><span class=\"plaintablecellbold\" style=\"vertical-align:top;padding-left:5px;padding-right:5px\">'+getSeaPhrase(\"STATUS\",\"TE\")+'</span>';\n \t\t\n\t\tif (TimeCard.View != 4)\n\t\t{\n\t\t\targ += '<span class=\"plaintablecell\" style=\"vertical-align:top\">>';\n\t\t\tswitch (TimeCard.Status)\n\t\t\t{\n\t\t\t\tcase 1: arg += getSeaPhrase(\"SUBMITTED\",\"TE\"); break;\n\t\t\t\tcase 2: arg += getSeaPhrase(\"APPROVED\",\"TE\"); break;\n\t\t\t\tcase 3: arg += getSeaPhrase(\"ON_HOLD\",\"TE\"); break;\n\t\t\t\tcase 4: arg += getSeaPhrase(\"REJECTED\",\"TE\"); break;\n\t\t\t\tcase 5: arg += getSeaPhrase(\"HISTORICAL_1\",\"TE\"); break; // Entered (Historical)\n\t\t\t\tcase 6: arg += getSeaPhrase(\"HISTORICAL_2\",\"TE\"); break; // Submitted (Historical)\n\t\t\t\tcase 7: arg += getSeaPhrase(\"HISTORICAL_3\",\"TE\"); break; // Approved (Historical)\n\t\t\t\tcase 8: arg += getSeaPhrase(\"HISTORICAL_4\",\"TE\"); break; // On Hold (Historical)\n\t\t\t\tcase 9: arg += getSeaPhrase(\"HISTORICAL_5\",\"TE\"); break; // Rejected (Historical)\n\t\t\t\tdefault: arg += getSeaPhrase(\"NONE\",\"TE\"); break;\n\t\t\t}\n\t\t\targ += '</span>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\targ += '<select class=\"inputbox\" name=\"cmbStatus\" onchange=\"parent.SetStatus()\">';\n\t\t\targ += (TimeCard.Status == 1)?'<option value=\"1\" selected></option>':'<option value=\"1\"></option>';\n\t\t\targ += (TimeCard.Status == 2)?'<option value=\"2\" selected>'+getSeaPhrase(\"APPROVED\",\"TE\")+'</option>':'<option value=\"2\">'+getSeaPhrase(\"APPROVED\",\"TE\")+'</option>';\n\t\t\targ += (TimeCard.Status == 3)?'<option value=\"3\" selected>'+getSeaPhrase(\"HOLD\",\"TE\")+'</option>':'<option value=\"3\">'+getSeaPhrase(\"HOLD\",\"TE\")+'</option>';\n\t\t\targ += (TimeCard.Status == 4)?'<option value=\"4\" selected>'+getSeaPhrase(\"REJECTED\",\"TE\")+'</option>':'<option value=\"4\">'+getSeaPhrase(\"REJECTED\",\"TE\")+'</option>';\n\t\t\targ += '</select>';\n\t\t}\n\t\t\n\t\targ += '</span>';\n\t}\n\t\n\targ += '</td></tr></table></form></div>';\n\treturn arg;\n}", "function printSongIframe(){\n $('#iframe').empty();\n var iframe = $('<iframe>')\n iframe.attr({\n src: 'https://embed.spotify.com/?uri=spotify:track:'+currentSong.spotifyID,\n frameborder: '0',\n allowtransparency: 'true'\n });\n $('#iframe').append(iframe);\n}", "function iframe(options, container) {\n if (options === void 0) {\n options = {};\n }\n\n var el = getElement(container);\n var attributes = options.attributes || {};\n var style = options.style || {};\n var frame = createElement('iframe', {\n attributes: Object(esm_extends[\"a\" /* default */])({\n frameBorder: '0',\n allowTransparency: 'true'\n }, attributes),\n style: Object(esm_extends[\"a\" /* default */])({\n backgroundColor: 'transparent'\n }, style),\n html: options.html,\n class: options.class\n }); // $FlowFixMe\n\n awaitFrameLoad(frame);\n el.appendChild(frame);\n\n if (options.url || window.navigator.userAgent.match(/MSIE|Edge/i)) {\n frame.setAttribute('src', options.url || 'about:blank');\n } // $FlowFixMe\n\n\n return frame;\n}", "function buildToolbox() {\n\t//adding stylesheet for to dom\n\tvar cssURL = chrome.extension.getURL('/content_new/'+dirName+'/css/content.css');\n\tvar styleElem = document.createElement('link');\n\tstyleElem.setAttribute('href', cssURL);\n\tstyleElem.setAttribute('rel', 'stylesheet');\n\tstyleElem.setAttribute('type', 'text/css');\n\tdocument.body.appendChild(styleElem);\n\t//adding iframe to dom\n\tvar frameURL = chrome.extension.getURL('/content_new/'+dirName+'/html/frame.html');\n\tvar appendCode = '';\n\tvar frameStyle = '';\n\tappendCode += '<iframe id='+targetFrameId+' style=\"' + frameStyle + '\" src=\"' + frameURL + '\" class=\"fst_inner_frame\">';\n\tvar appendDiv = document.createElement('div');\n\tappendDiv.innerHTML = appendCode;\n\tappendDiv.setAttribute('class', 'fst_fbvid_container fst_container');\n\tappendDiv.setAttribute('id', targetDivId);\n\tdocument.body.appendChild(appendDiv);\n\tsetEventListener();\n\tfriendlist_generate_start();\n}", "function addApp(appId) {\n document.getElementsByClassName(\"app-container\")[0].innerHTML +=\n `<div class=\"app-frame\" id=\"${appId}-frame\">` +\n ' <div class=\"frame-header\">' +\n ' <img class=\"x\" src=\"assets/images/x.png\" alt=\"close app window\">' +\n ' <div class=\"drag-bar\"></div>' +\n \" </div>\" +\n ` <iframe src=\"apps/${appId}/index.html\" id=\"${appId}\"></iframe>` +\n \" </div>\";\n resizeIframes();\n addWindowCloseListeners();\n hideEmptyColumns();\n}", "function buildFrame(content, count){\n parent = document.getElementById(content);\n child = parent.children[0];\n for(var i=1; i < count; i++) {\n clon = child.cloneNode(true);\n parent.appendChild(clon);\n }\n}", "function newIframe(afterID, link, title) {\n\t\t // Create iframe container\n\t\t var div = document.createElement('div');\n\t\t div.classList.add(\"iframeDiv\");\n\n\t\t // Detect embeded \n\t\t var pointer = \"\";\n\t\t if(!link.includes(\"quickparseapi.appspot.com\")) {\n\t\t\t pointer = \"all\";\n\t\t }\n\t\t else {\n\t\t\t pointer = \"none\";\n\t\t }\n\n\t\t // Insert iframe into container\n\t\t div.innerHTML = [{ url: link, title: title, pointer: pointer }].map(iFrameTemplate).join('');\n\n\t\t // Insert container with iframe after current p tag\n\t\t var parent = document.getElementById('articleParent'); \n\t\tparent.insertBefore(div, afterID);\n\t\t //parent.insertBefore(div, document.getElementById(afterID).nextSibling);\n\t\t //parent.insertBefore(div, p.parentNode.nextSibling);\n\n\t\t return div.nextSibling;\n\t}", "function createPopup(src, code){\n var form = document.createElement(\"iframe\");\n form.setAttribute(\"id\", \"save-code-popup\");\n if (code) {\n var textCode = code.replace(/'/g, \"%27\");\n form.setAttribute(\"src\", \"https://www.thiscodeworks.com/new?code=\" + encodeURIComponent(textCode) + \"&url=\" + window.location.href + \"&pagetitle=\" + encodeURIComponent(document.title));\n } else {\n form.setAttribute(\"src\", src);\n }\n var parent = document.getElementById(\"save-code-popup-parent\");\n parent.style.width = \"80%\";\n parent.style.height = \"80%\";\n parent.style.position = \"fixed\";\n parent.style.zIndex = 9999;\n parent.style.top = \"10%\";\n parent.style.left = \"10%\";\n parent.style.border = \"1px solid darkgray\";\n parent.style[\"box-shadow\"] = \"0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22)\";\n form.style.width = \"100%\";\n form.style.height = \"100%\";\n parent.style.background = \"rgba(0, 0, 0, 0.5)\";\n parent.appendChild(form);\n}", "function tryIframeApproach() {\n var iframe = document.createElement(\"iframe\");\n iframe.style.border = \"none\";\n iframe.style.width = \"1px\";\n iframe.style.height = \"1px\";\n iframe.onload = function () {\n document.location = alt;\n };\n iframe.src = custom;\n document.body.appendChild(iframe);\n }", "function _pullUpIFrame(){\n\t\t_element.find('#L-SOUpdaterBarTrigger').toggleClass('opened', true).show();\n\t\t_element.find('.L-SOUpdater_widget_container').show();\n\t\t_element.find('.L-SOUpdater_widget_container').css('cssText', 'display: block !important');\n\t\t_element.find('.L-SOUpdater_view_control a').toggleClass('selected', false);\n\t\t\n\t\t_element.find('.L-SOUpdater_widget_container').animate({opacity:1, right: \"0px\"}, {\n\t\t\tduration: 400,\n\t\t\tqueue: false,\n\t\t\tcomplete: function() {\n\t\t\t\t//Have to shrink the body here.\n\t\t\t\t_element.find('.L-SOUpdater_view_control').fadeIn('fast').css({top: '10px', bottom: 'auto', right: '23px'});\n\t\t\t} \n\t\t});\n\t\t _element.find('#L-SOUpdaterBarTrigger').animate({right: \"560px\",}, { duration: 400, queue: false }).css('overflow', 'visible');\n\t\t //_element.find('#L-SOUpdaterBarTrigger').animate({right: \"560px\",}, { duration: 400, queue: false });\n\t\t var element = $(_element.find('script#L-full-template').html());\n\t\t _element.find('#L-SOUpdaterBarTrigger').before(element);\n element.load(function(){\n\t\t\t_element.find('#L-SOUpdaterBarTrigger').toggleClass('loading', false).toggleClass('opened', true);\n\t\t\t_element.find('#L-SOUpdaterBarTrigger .L-loader').hide();\n\t\t });\n\t}", "function generaLink(animal){\n\tvar link = \"http://www.horoscopomaya2018.com/horoscopo-maya-\";\n\tlink+=animal+\"/\";\n\tvar frameAnimal = \"<iframe name='frameIzdo' src='\"+link+\"' title='Horosocopo Maya' width='500em' height='600em'></iframe>\";\n\n\tdocument.write(frameAnimal);\n}", "_onIframeApiLoad() {\n this._iframe.contentWindow.JitsiMeetElectron = {\n /**\n * Get sources available for screensharing. The callback is invoked\n * with an array of DesktopCapturerSources.\n *\n * @param {Function} callback - The success callback.\n * @param {Function} errorCallback - The callback for errors.\n * @param {Object} options - Configuration for getting sources.\n * @param {Array} options.types - Specify the desktop source types\n * to get, with valid sources being \"window\" and \"screen\".\n * @param {Object} options.thumbnailSize - Specify how big the\n * preview images for the sources should be. The valid keys are\n * height and width, e.g. { height: number, width: number}. By\n * default electron will return images with height and width of\n * 150px.\n */\n obtainDesktopStreams(callback, errorCallback, options = {}) {\n if (semver.lt(process.versions.electron, '5.0.0')) {\n desktopCapturer.getSources(options, (error, sources) => {\n if (error) {\n errorCallback(error);\n return;\n }\n\n callback(sources);\n });\n } else {\n desktopCapturer\n .getSources(options)\n .then((sources) => callback(sources))\n .catch((error) => errorCallback(error));\n }\n }\n };\n }", "function buildZone() {\n /* -- Build the header for the preview zone -- */\n var renderHeader = document.createElement('div');\n renderHeader.className = 'asu-header-render-head';\n var renderText = document.createElement('h3');\n renderText.textContent = 'Header Preview';\n// var renderType = document.createElement('i');\n// renderType.className = 'asu-header-render-type fa fa-toggle-off';\n renderHeader.appendChild(renderText);\n// renderHeader.appendChild(renderType);\n renderer.appendChild(renderHeader);\n \n /* -- Adding Event listener to the toggle button -- */\n// renderType.addEventListener('click', function isMobileEvent(){\n// var status = toggleMobileCss();\n// if(status){\n// document.getElementsByClassName('asu-header-render-type')[0].className = 'asu-header-render-type fa fa-toggle-on';\n// } else{\n// document.getElementsByClassName('asu-header-render-type')[0].className = 'asu-header-render-type fa fa-toggle-off';\n// }\n// }, false);\n\n /* -- Build the Preview zone -- */\n\n var renderZone = document.createElement('div');\n renderZone.className = 'asu-header-render-zone';\n renderZone.innerHTML = headerHTML;\n renderer.appendChild(renderZone);\n }", "function fBox() {\n $('#fbox').append('<iframe scrolling=\"no\" height=\"550\" frameborder=\"0\" align=\"top\" width=\"330\" src=\"http://www.facebook.com/connect/connect.php?id=245359441616&amp;connections=30\" marginwidth=\"0\" marginheight=\"0\"></iframe>');\n}", "function generateCat()\n{\n var gif = document.createElement('iframe')\n var div = document.getElementById('flex-cat-gen')\n gif.src = \"https://giphy.com/embed/Lq0h93752f6J9tijrh\"\n div.appendChild(gif)\n}", "function init() {\n\t\t// safe to reinsert\n\t\t$('#PortableCSSPad-container').remove();\n\n\t\tvar urlclose = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAB3RJTUUH3AgMADgMzadyXQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAARnQU1BAACxjwv8YQUAAAJuSURBVHjaY2AYBZQCRmyC2v6hivJKSjIfX736xP7o5kU3bz+G379/M7CxsTGcO3mE4eY3Ng0OAQmRe5fO3Xp17fgrZL0s2AzkkZDWNI5I6hTg5OI8tXxBblCA/3ZZBUWGj+/fMTx6+1lLUD9gxaNHT16fOLgvE6gcxUBmbAa+Onvi9j95NQEBfevQb4LSVk8PbN9qaaT3bsPmLcJbGHRXvv/No//64IoSd22poxcvnifs5YrycobP79+wrVN1W2hq4Rbx+crpHSqn5gffEvea8IpHJ/X6jElV6yZ6tkvIqDJYmRui6MXqZSUVFQY314xfX1raS3axCqvpSKh6PNSMP/j1p7DR9V1blzalSPf6+PozXLh0E0MvEzYDv3z+zCApKcVQUZj3VHTT9Lwzlx68ufNN0uTM9VtX4xRuFWdm5/9iZWUDRxRRBoLA379/GeSBEWGjI//856dv3169+goU5BASEJIR4+Bghyj6z0CcgSwsLAyMjIwMmzZv5Jr7y3iKMCOXBNvTi6elOQWkJ52VmbJixUo+sGZmJuIMZGZmZti3ZydD3Y43rRK8Kp6Pz++Y8G5jps/Te1eOiIop2qW23+06eGAvAwszZiLBmmwYf39g2HmPM/6rhH3H/TPHdpeZf8ibOHHiu7uHV1268lrYl0FEweHZ2UPPPr27de7w4UMMBIGqe1qgUtbWVwwhi6+7efqrPnzwgOH///8Me/bsAsq6R3Eaz/rOoDHxJQODdzBRLuQWU1b4+vblw2+nt8wy0eA9y8XNy3Dp0iWG16/fMJw+Ne3m90+/H/L8f3OFh+fz4++f790h7MRRQAoAAPJx+xzHC08HAAAAAElFTkSuQmCC',\n\t\t\turlminimize = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAALHRFWHRDcmVhdGlvbiBUaW1lAFN1biAxMiBBdWcgMjAxMiAyMDo0MToxNSAtMDgwMMTklPcAAAAHdElNRQfcCA0DKjlZGh+RAAAACXBIWXMAAB7CAAAewgFu0HU+AAAABGdBTUEAALGPC/xhBQAAAUVJREFUeNrtkjtPAkEUhb+ZfbALrDx8gbG1s9JfYKytrf2h1poYCwtLEyMaY0BkYZd9wMx6gV9gZcNJ7uRmZu6Zc04Gttjiz1Cr5frppmrbLgf6kKbbIvAimt4OgQ6p6Rq+DuSmwtiSwhRkJiE1KXmZMDMxUzPhs/ySesddEe61e9zf3vH48QzdY2jtEjb26YRddoIOdT9Ca022SJhmE8bZkHQew2wE8TdM3jjpnXJ+ebYhrLshnpHGzpAx0Bmlk5I4IcprgA+OVqR2Se7kFFLamYk9IbXJWrkuEWfhhnCUD5mrAioPu6hAWiUnlTLitMSW6dqyMtLnBmeuMZkr+/KSceQi5CLiJx1tMrx4uKr6bo8jv0/kdYncjmQZEaiGZBiKuhqOTFlRWNpM8stIxE2yHJMuJcNFzGA+4CV5/e8/scUWa/wCesmLgiahhgUAAAAASUVORK5CYII=',\n\t\t\turlbeautify = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAIXRFWHRDb3B5cmlnaHQASnVsaWFuIEFkZGluZ3Rvbi1CYXJrZXKLx1i7AAAAB3RJTUUH3AgLCC0WlLQEMgAAAAlwSFlzAAALEgAACxIB0t1+/AAAAARnQU1BAACxjwv8YQUAAAQvSURBVHjatVRtTFNnFH56+0Vb2tIPSqG3LR8rEwJUgzJARbMM0Fl+yMJ0M9v8q8NkyeIfHBu4BM32Y9nMnBs6s4VoZqToHNuCugDO0DkHUiCAQgH5LpRWSr97e3cpCFsWl2myk5z3zb05eXKe87znAf6PoGn6qTISCWfREUpA0+Hod3dXT2V19Qfjdzu7GjnP0gCLhQnm9AMErL3dR+vrvz3a3t4aTxAEudphZDX/a5crtQMDAyeKdhTRyxC5uXl0VdWxJdZjyk8bYw/H9nzx+elLoCmhWCrGufMN+Ojkye+ilDs6LEeYdlkymdyn0ST+IhKJhp8ERFEUQqGQ0txormkxtwhF4nQQsfMwZhuHk5NTTq3pIhSooq3X1Z0YsVgsX/r9/q1Pomyx3DnLg4EuyTxGm8jTtEH2Mv125WFrX19/FnsZ7cPa43ttI8Pq/LzN0On0cV9/U587MTb6ljopUaRUKG+sDIQGi0mvx5t77syl6sDtfImKTUJO6UDNMxKljc4VFe1sigKarzRZeDH8HPeCSzs768D4FTXMrf1EX3fvJjJdRuq12gcEi3As13ZZre9/ctD2olqigZgVB4JBYPtC4GRNukqKixuJ5aI4qfTea6+UV3g9vvHLF38EmZqNMu1+cG5tF1Zuaz90+eK1Tq8nWOjzeNNv3+yt4EMJUqgGn8WB0z+EfuoOTLv3/KzX6R6svcOI3zOVlCC+GsB8pZ9ygk9LEaviI8ezAZ8dGBW5TjVWRdgOWYv5oUws0GIgcA12/wAEvgSwyckwI9Z0wB8IRynX1NSAH8NHKODr6u7vKROOJCufExnBozggOAwdLoGPmxrSI6H72kfecdaSfQlycQrEXBI6GEFGNhLNHVfzEw3CdUA2lwe5RLIU9LrDN9vumdzUNAZD7RiifkMgNIcNQgP8sXbQi0rowtshCZAQSgi442wQeBPgnfHx0kr5Is6KfoxKTKq0GpSZdp+5bxviWXs6jxvdr0rDbg4koiR4KS9mB2lw3YzaYuYtCqbgXnRCxDMgzA0inDnpTVAVmaOisNaWlIesTXl4ff+bzWqFfolaiINAEouwYI4ZMg2FTAFpziK4iY5IrEcIDTsVMcw+D9k7UbLv+Z+2FhR8+g9z4PDFyMsvmEpNbZlytdEatkAIJ3sR/AUCxpfImYxdmguORddMX4Oz0n43oPsdrQgl20bKK36oVSjig38DfExdppD7iksLv3rv/IXNW/z7WAKhDEEsIDVDf33X3sJ3w4xtdWd1tt24/mutyknOHXijui4jI2PgL3647jSR6B2CbdCKdw4fOmLU5/m2GErpF7Sm4B+3LOXrKxjCI5cDLvsE6FBw9V8YxOrw1r0uehLQ6PTYsXPbqcyNCd/T3GmYDhrPpmWnNEff7MpwIJHKIY3XgOZwGXbL/NjPYq//Hn8C2kYoZTy94hkAAAAASUVORK5CYII=',\n\t\t\turlminify = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAALHRFWHRDcmVhdGlvbiBUaW1lAFNhdCAxMSBBdWcgMjAxMiAwMjoyNjo0OSAtMDgwMDEvyr4AAAAHdElNRQfcCAsJMh8h8Ng/AAAACXBIWXMAAB7CAAAewgFu0HU+AAAABGdBTUEAALGPC/xhBQAAAPFJREFUeNqtVLENg0AMfCQaygyQBhZIm4YFMkF65mCGUIQV0qNMEykNBUrLBB8f8icP8Ut8zElH4Tenk+WzMTIqomWWXEsCvQezElcW7IlFoKcmNmsFgQuLvoi5IIa3kfggPomnGKeDJ5oS795YHM9apx3xRtwR98QMxSpypr5TCByXjZabtTOdCVpuXoNWcDoD9qzf2mnBjzFOpZkmnw8XB4VTcflzhdPefGP6I+qctpFObahB43QGLGmmmOkUEgggNogPYtQpnU6BXoYcwU//dYqTg9ODEzTyj/UGM53QCGIO2LPYRAXPuVv+0huLeKXeGFRg5Tjvfi8AAAAASUVORK5CYII=',\n\t\t\turlimportant = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAALHRFWHRDcmVhdGlvbiBUaW1lAFN1biAxMiBBdWcgMjAxMiAyMDo1ODoxMiAtMDgwMDzYXnMAAAAHdElNRQfcCA0EAhUz0MtdAAAACXBIWXMAAB7CAAAewgFu0HU+AAAABGdBTUEAALGPC/xhBQAAAT1JREFUeNpjYKAn+P//PxOIfnH3qltrWfw1tYDcfXeevOGlyNAbl875+Rlr/AeZz8Ag///K1ZsR+NQzETLwLwvXGSdX668gtrKPLwMrjxALxV6/d3zRO5ALa2asOPLx339hilwIAn/+QWgjacHjfIwM3yk28NvLp0BSmEFYXhcUlpMoNvDhvVeMElaGn/W1JWuA3Nv41BIVwNcfPmLQVTBmEWBm/AXkdlLswrt3HrC4BXgfI0YtXgBM2Iwg2lRN7teFG3dcidGD14WMjIz//359Ysyi6sLKzyPITbGBIPDx2ZNsB0edW6LSQnuoYuC9+0+YxJjYXvMwMn6hOAxB4PObFxK37j7RpYphv75/Vbx29XIeVQwDgSn1+Q+B1P9la7ZMppaZ4GJr4pS5O6limpemINjA87cfe1DN26QCAPkZbYRQcJ1jAAAAAElFTkSuQmCC',\n\t\t\turlnonimportant = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAALHRFWHRDcmVhdGlvbiBUaW1lAFN1biAxMiBBdWcgMjAxMiAyMDo1ODoxMiAtMDgwMDzYXnMAAAAHdElNRQfcCA0ECiXd0HH5AAAACXBIWXMAAB7CAAAewgFu0HU+AAAABGdBTUEAALGPC/xhBQAAAitJREFUeNq9VE1oE1EQ/mazTUuTWmpy8IdUSjHUS5FEvSj401aL2Fo9eVO8ivXQWgWlCqJePCgtIkIPIkgV0YOCeNBT8WJQUVPamhJtoo1xDandrTZkd5yNRsTfDQYHHm9m9u233zczb4H/acys2HtqMrr5ZN/u0WDX/vuxpFbzT6BjTx91doab2MYHlvHz6PiuP51Xfky8J7rIqrqxGJtqdWRT21rD9hu3daDCu1AtidENoCXh91u62x0RSuE0sCW5t2uuVxgevTA8MmOxrySGO4F7AU1TrplmE4gilcAJS/LzslrfTEzmaxfsKQnQtjTRjG6a1T3ie1R1VbZl5fwAfKjxBWAaxhlhHX0LeB3LzgCXksAO2z9CZM0ROLhmw2zWZLd0/tA0cEsAOxwDZl0uS1g0FuODRCw15WIsYC55ftax5E/McAGBbx9oD+nH83noIvVriqXV6x0zfE00lSF6KPLIjlcH63NPxmJt5wHrA9FNO6cpiq3iJ0K/ZLiUuT4nI6MRDZlGMqwub62o9dZ54oD7AfP2WUXpVyzLnnS/c5ZyWBhY6VBzvP/U6QmdudBV6fyi+BemLBeg0jFg0VLyoqaqLODD0oy+lAz+YanhiKwsUSwBNPxV8vfmeTe9ODP+slmG+7KES6So3fuAO+sAusrsc1VVhRyzy300Gkajz7pLlvU7Gzx24JVsfOX67YFyYRZ+W+cGh+6WBW3riroC4OMXifayyS7VPgNC5M/cbeX8ZAAAAABJRU5ErkJggg==';\n\n\t\tvar vertical = '';\n\t\tvar horizontal = '';\n\t\tif (window.sessionStorage) {\n\t\t\tvar width = sessionStorage.getItem('PortableCSSPad-width');\n\t\t\tif (width) P.width = width;\n\t\t\tvar height = sessionStorage.getItem('PortableCSSPad-height');\n\t\t\tif (height) P.height = height;\n\t\t\tvar top = sessionStorage.getItem('PortableCSSPad-top');\n\t\t\tif (top) P.top = top;\n\t\t\tvar left = sessionStorage.getItem('PortableCSSPad-left');\n\t\t\tif (left) P.left = left;\n\t\t}\n\t\tif (P.top == -1) {\n\t\t\tvertical = 'bottom:' + P.bottom + 'px;';\n\t\t} else {\n\t\t\tvertical = 'top:' + P.top + 'px;';\n\t\t}\n\t\tif (P.left == -1) {\n\t\t\thorizontal = ' right:' + P.right + 'px;';\n\t\t} else {\n\t\t\thorizontal = ' left:' + P.left + 'px;';\n\t\t}\n\t\tvar htmlbase = '<div id=\"PortableCSSPad-container\" style=\"' + vertical + horizontal + '\"><table><tr><td colspan=\"2\"><div id=\"PortableCSSPad-topbar\"><span id=\"PortableCSSPad-label\">Portable CSS Pad</span><span id=\"PortableCSSPad-top-icons\"><img id=\"PortableCSSPad-icon-minimize\" title=\"Minimize the pad with CSS changes still in effect\" src=\"' + urlminimize + '\"><img id=\"PortableCSSPad-icon-close\" title=\"Close the pad and disable CSS changes\" src=\"' + urlclose + '\"></span></div></td></tr><tr><td><div id=\"PortableCSSPad-left-icons\" style=\"padding-right:4px;\"><img id=\"PortableCSSPad-icon-beautify\" title=\"Beautify CSS to make it well-formatted and readable\" src=\"' + urlbeautify +'\"><br /><img id=\"PortableCSSPad-icon-minify\" title=\"Minify CSS to decrease file size\" src=\"' + urlminify + '\"><br /><img id=\"PortableCSSPad-icon-important\" title=\"Add !important to all rules (test specificity)\" src=\"' + urlimportant + '\"><br /><img id=\"PortableCSSPad-icon-nonimportant\" title=\"Remove !important from all rules\" src=\"' + urlnonimportant + '\"></div></td><td style=\"text-align:center; padding:0;\"><textarea id=\"PortableCSSPad-textarea\" placeholder=\"CSS placed in this text box will be immediately applied to the webpage.\" style=\"width: ' + P.width + 'px; height: ' + P.height + 'px;\"></textarea></td></tr></table></div>';\n\n\t\t// insert html base for the pad\n\t\t$(document.body).append(htmlbase);\n\n\t\t// val: set css rules saved in sessionStorage\n\t\t// keydown: insert \\t character when pressing tab instead of switching focus\n\t\t// keyup: apply style changes when the textarea contents change\n\t\tif (window.sessionStorage) {\n\t\t\tvar text = sessionStorage.getItem('PortableCSSPad-css');\n\t\t}\n\t\tif (\"string\" != typeof text) {\n\t\t\ttext = \"\";\n\t\t}\n\t\t$('#PortableCSSPad-textarea')\n\t\t.keydown(function (e) {\n\t\t\tif (9 == e.which) return false;\n\t\t}).keyup(function (e) {\n\t\t\tupdateStyle($('#PortableCSSPad-textarea').val());\n\t\t})\n\t\t.val(text);\n\t\tupdateStyle(text);\n\n\t\t// make pad draggable and resizable\n\t\tvar computedStyle = getComputedStyleCBJC($('#PortableCSSPad-container'));\n\t\t$('#PortableCSSPad-container')\n\t\t.css({width: computedStyle.width, height: computedStyle.height})\n\t\t.draggable({\n\t\t\tcontainment: 'window',\n\t\t\tscroll: false,\n\t\t\tstop: function (event, ui) {\n\t\t\t\t$(this).css('position', 'fixed'); // restore position: scroll;\n\t\t\t\tP.top = parseInt($('#PortableCSSPad-container').css('top'));\n\t\t\t\tP.left = parseInt($('#PortableCSSPad-container').css('left'));\n\t\t\t\tif (window.sessionStorage) {\n\t\t\t\t\tsessionStorage.setItem('PortableCSSPad-top', P.top);\n\t\t\t\t\tsessionStorage.setItem('PortableCSSPad-left', P.left);\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\t.resizable({\n\t\t\tminWidth: 288,\n\t\t\tminHeight: 152,\n\t\t\thandles: 'se',\n\t\t\talsoResize: '#PortableCSSPad-textarea',\n\t\t\tstop: function (event, ui) {\n\t\t\t\t$(this).css('position', 'fixed'); // restore position: scroll;\n\t\t\t\tP.width = parseInt($('#PortableCSSPad-textarea').css('width'));\n\t\t\t\tP.height = parseInt($('#PortableCSSPad-textarea').css('height'));\n\t\t\t\tif (window.sessionStorage) {\n\t\t\t\t\tsessionStorage.setItem('PortableCSSPad-width', P.width);\n\t\t\t\t\tsessionStorage.setItem('PortableCSSPad-height', P.height);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// close event\n\t\t$('#PortableCSSPad-icon-close').click(function () {\n\t\t\tupdateStyle();\n\t\t\tif (window.sessionStorage) {\n\t\t\t\tsessionStorage.setItem('PortableCSSPad-css', $('#PortableCSSPad-textarea').val());\n\t\t\t}\n\t\t\t$(document).off('keypress', keypressEventHandler);\n\t\t\t$('#PortableCSSPad-container').hide('explode', { pieces:15 }, 1000, function () {\n\t\t\t\t$(document).on('keypress', keypressEventHandler);\n\t\t\t});\n\t\t});\n\t\t\n\t\t// minimize event\n\t\t$('#PortableCSSPad-icon-minimize').click(function () {\n\t\t\tif (window.sessionStorage) {\n\t\t\t\tsessionStorage.setItem('PortableCSSPad-css', $('#PortableCSSPad-textarea').val());\n\t\t\t}\n\t\t\t$(document).off('keypress', keypressEventHandler);\n\t\t\t$('#PortableCSSPad-container').hide('drop', 1000, function () {\n\t\t\t\t$(document).on('keypress', keypressEventHandler);\n\t\t\t});\n\t\t});\n\t\t\n\t\t// beautify event\n\t\t$('#PortableCSSPad-icon-beautify').click(function () {\n\t\t\t$('#PortableCSSPad-textarea').val(prettydiff({\n\t\t\t\tcomments: \"indent\",\n\t\t\t\tcontent: false,\n\t\t\t\tcontext: \"\",\n\t\t\t\tcsvchar: \",\",\n\t\t\t\tdiff: \"\",\n\t\t\t\tdifflabel: \"base\",\n\t\t\t\tdiffview: \"sidebyside\",\n\t\t\t\tforce_indent: false,\n\t\t\t\thtml: false,\n\t\t\t\tinchar: \" \",\n\t\t\t\tindent: \"\",\n\t\t\t\tinsize: 4,\n\t\t\t\tlang: \"auto\",\n\t\t\t\tmode: \"beautify\",\n\t\t\t\tquote: false,\n\t\t\t\tsemicolon: false,\n\t\t\t\tsource: $('#PortableCSSPad-textarea').val(),\n\t\t\t\tsourcelabel: \"base\",\n\t\t\t\tstyle: \"indent\",\n\t\t\t\ttopcoms: false\n\t\t\t})[0]);\n\t\t});\n\t\t\n\t\t// minify event\n\t\t$('#PortableCSSPad-icon-minify').click(function () {\n\t\t\t$('#PortableCSSPad-textarea').val(prettydiff({\n\t\t\t\tcomments: \"indent\",\n\t\t\t\tcontent: false,\n\t\t\t\tcontext: \"\",\n\t\t\t\tcsvchar: \",\",\n\t\t\t\tdiff: \"\",\n\t\t\t\tdifflabel: \"base\",\n\t\t\t\tdiffview: \"sidebyside\",\n\t\t\t\tforce_indent: false,\n\t\t\t\thtml: false,\n\t\t\t\tinchar: \" \",\n\t\t\t\tindent: \"\",\n\t\t\t\tinsize: 4,\n\t\t\t\tlang: \"auto\",\n\t\t\t\tmode: \"minify\",\n\t\t\t\tquote: false,\n\t\t\t\tsemicolon: false,\n\t\t\t\tsource: $('#PortableCSSPad-textarea').val(),\n\t\t\t\tsourcelabel: \"base\",\n\t\t\t\tstyle: \"indent\",\n\t\t\t\ttopcoms: false\n\t\t\t})[0]);\n\t\t});\n\t\t\n\t\t// important event\n\t\t$('#PortableCSSPad-icon-important').click(function () {\n\t\t\tvar text = $('#PortableCSSPad-textarea').val();\n\t\t\ttext = text.replace(/;/g, \" !important;\");\n\t\t\t$('#PortableCSSPad-textarea').val(text);\n\t\t\tupdateStyle(text);\n\t\t});\n\n\t\t// nonimportant event\n\t\t$('#PortableCSSPad-icon-nonimportant').click(function () {\n\t\t\tvar text = $('#PortableCSSPad-textarea').val();\n\t\t\ttext = text.replace(/ !important;/g, \";\");\n\t\t\t$('#PortableCSSPad-textarea').val(text);\n\t\t\tupdateStyle(text);\n\t\t});\n\t}", "function dynaFrame() {\r\n\r\n\t\tvar btnArray = [];\r\n\r\n\t\t// @DBTABLE will fill in this array\r\n\t\tthis.eachItm = function (desc, func) {\r\n\t\t\tbtnArray.push({DESC: desc, FUNC: func});\r\n\t\t}\r\n\r\n\t\t// createButtons dynamically creates the buttons of the dynaframe\r\n\t\t// the width is not the actual width of each button but the number of buttons wide, same with height\r\n\t\t// a zero in either and the system will use a 1x9 (9 high with next/previous in row 10)\r\n\t\tthis.createButtons = function (width, height) {\r\n\t\t\t// set the defaults\r\n\t\t\tif (width === 0) {\r\n\t\t\t\twidth = 1\r\n\t\t\t}\r\n\t\t\tif (height === 0) {\r\n\t\t\t\theight = 9\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\t}", "function createFriendlyIframe() {\n //create friendly iframe to place ourselves inside\n friendlyIframe = document.createElement('iframe');\n\n // friendlyIframe.id = \"friendlyIframe_\" + countSelf.length;\n friendlyIframe.className = \"dwunlinkIframe\"\n friendlyIframe.width = '300';\n friendlyIframe.height = 600 - 250; //250 is the add height\n friendlyIframe.scrolling = 'no';\n friendlyIframe.style.overflow = 'hidden';\n friendlyIframe.name = currentScript.src;\n friendlyIframe.style.border = 'none';\n\n currentScript.parentNode.insertBefore(friendlyIframe, currentScript);\n\n //after getting querystring from js or iframe search query set currentScript to black\n friendlyIframeWindow = friendlyIframe.contentWindow;\n\n //create inline html for friendlyIframe\n friendlyIframeWindow.document.open();\n friendlyIframeWindow.document.write(htmlFile);\n friendlyIframeWindow.document.close();\n\n //listen to when the iframe window content has returned and send in the srcQuery if there is one before it gets\n if (friendlyIframeWindow.document.readyState == \"complete\" || friendlyIframeWindow.document.readyState == \"interactive\") { // if page is already loaded'\n setupIframe();\n } else { // elseonce page has finished loading, so as not to slowdown the page load at all\n friendlyIframeWindow.document.onreadystatechange = function() {\n if (friendlyIframeWindow.document.readyState == \"complete\" || friendlyIframeWindow.document.readyState == \"interactive\") {\n setupIframe();\n }\n }\n }\n }", "function show_card_code() {\n window.open('/card_code.html', '_card_code', 'width=600,height=400'); \n}", "initializeHtmlElement() {\n const elementContainer = document.createElement(\"button\");\n elementContainer.className = \"formElementButton\";\n elementContainer.innerHTML = this.__paramsForCurrentElement.label;\n elementContainer.setAttribute(\"type\", this.__paramsForCurrentElement.type);\n return elementContainer;\n }", "openCardDetails() {\n EnigmailWindows.openWin(\n \"enigmail:cardDetails\",\n \"chrome://openpgp/content/ui/enigmailCardDetails.xhtml\",\n \"centerscreen\"\n );\n }", "createWeatherCard() {\n this.card = document.createElement(\"DIV\");\n\n // Card Header\n this.header = document.createElement(\"DIV\");\n this.header.classList.add(\"weather-card-header\");\n\n // Card Body\n this.weatherContainer = document.createElement(\"DIV\");\n this.weatherContainer.classList.add(\"weather-card-body\");\n\n // Card Body Temp\n this.temperatureContainer = document.createElement(\"DIV\");\n this.temperatureContainer.classList.add(\"weather-temp-container\");\n\n // Card Body Other Container\n this.otherContainer = document.createElement(\"DIV\");\n this.otherContainer.classList.add(\"other-data-container\");\n\n this.card.classList.add(\"weather-node\");\n this.card.id = this.index;\n\n this.addAddress();\n this.addWeatherData();\n\n this.parent.appendChild(this.card);\n }", "function LoadMWETB2(){\r\n\t\tvar PSMWE_div2=document.createElement(\"div\");\r\n\t\t\tPSMWE_div2.id = 'PSMWE_div2';\t\t\t\r\n\t\t\tvar content=document.getElementById('final_wrapper');\r\n\t\t\tcontent.appendChild(PSMWE_div2);\r\n\t\t\tPSMWE_div2.innerHTML = MWETB2; \r\n\t\t\tdocument.getElementById('LOG').addEventListener('click', LOG, false);\r\n\t\t\tdocument.getElementById('BMBAY').addEventListener('click', BMBay, false);\r\n}", "_injectResourcesInsidePreview() {\n const stl = this._iframeRefs.document.createElement('style');\n\n stl.innerHTML = `\n\t\t\tbody {\n\t\t\t\tmargin:0;\n\t\t\t\tpadding:0;\n\t\t\t}\n\t\t\t#wrapper {\n\t\t\t\tpadding: 20px;\n\t\t\t}\n\t\t`;\n\n this._iframeRefs.body.appendChild(stl);\n\n if (this.props.scripts) {\n // make sure it's an array\n const scripts = [].concat(this.props.scripts);\n scripts.forEach(script => {\n const scriptTag = this._iframeRefs.document.createElement('script');\n\n scriptTag.src = script;\n\n this._iframeRefs.body.appendChild(scriptTag);\n });\n }\n\n if (this.props.styles) {\n // make sure it's an array\n const styles = [].concat(this.props.styles);\n styles.forEach(style => {\n const styleTag = this._iframeRefs.document.createElement('link');\n\n styleTag.href = style;\n styleTag.rel = 'stylesheet';\n\n this._iframeRefs.body.appendChild(styleTag);\n });\n }\n }" ]
[ "0.6959947", "0.62934476", "0.5976476", "0.5947101", "0.5905134", "0.58901954", "0.58202726", "0.5731176", "0.5726435", "0.5583179", "0.5579358", "0.5578177", "0.5576883", "0.55499953", "0.552492", "0.54762864", "0.5454121", "0.54252005", "0.5406613", "0.5370379", "0.5299502", "0.5271335", "0.52587616", "0.5254967", "0.5251727", "0.5247477", "0.52324533", "0.52319676", "0.52227575", "0.5209455", "0.52036464", "0.516884", "0.5155677", "0.5148483", "0.51458454", "0.5141793", "0.51405776", "0.5136461", "0.51362413", "0.5128541", "0.51186544", "0.507651", "0.507651", "0.507651", "0.5074195", "0.50735", "0.5072533", "0.5072533", "0.507113", "0.5068528", "0.50679755", "0.5064504", "0.50405663", "0.502658", "0.5024277", "0.50165427", "0.5006584", "0.50004965", "0.49992904", "0.49968302", "0.49968302", "0.49945596", "0.49908432", "0.49878514", "0.4985738", "0.4973311", "0.4960462", "0.4951229", "0.49275655", "0.4924188", "0.49210188", "0.49203926", "0.491957", "0.49174592", "0.49000365", "0.4895249", "0.48933592", "0.48910543", "0.48900825", "0.48899814", "0.48764625", "0.4865861", "0.48648995", "0.4851499", "0.48457646", "0.48384476", "0.4831508", "0.48309562", "0.48038727", "0.48035917", "0.47965434", "0.47921968", "0.47919512", "0.47897673", "0.47766995", "0.47753403", "0.47750086", "0.47693107", "0.47661394", "0.47554135" ]
0.7749555
0
Check if the current addon intends to be hinted. Typically this is for hinting/linting libraries such as eslint or jshint
hintingEnabled() { let isProduction = process.env.EMBER_ENV === 'production'; let testsEnabledDefault = process.env.EMBER_CLI_TEST_COMMAND === 'true' || !isProduction; let explicitlyDisabled = this.app && this.app.options && this.app.options.hinting === false; return testsEnabledDefault && !explicitlyDisabled; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasHint (hints) {\n\tfor (var i in hints) {\n\t\tif (hints[i]) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function check_hint()\n{\n\t\n\t// Did we already show hint? Or are there no ongoing drags/animations?\n\tif (showing_hint){\n\t\tconsole.log(\"Checking hint...\");\n\t\t\n\t\t//Get the time since last action\n\t\ttime_since_last_move = (new Date().getTime()) - lastmove;\n\t\tvar seconds_since_last_move = Math.floor((time_since_last_move % (1000 * 60)) / 1000);\n\t\t\n\t\t// If it's been over 5 seconds since last action, then start the hint\n\t\tif (seconds_since_last_move >= 5)\n\t\t{\n\t\t\t\n\t\t\t\t\n\t\t\tconsole.log(\"Showing hint...\"); //debug\n\t\t\t//Get the random move\n\t\t\trandom_move = rules.getRandomValidMove();\n\t\t\t\n\t\t\t//Are there any possible moves?\n\t\t\tif (random_move == null){\n\t\t\t\t\n\t\t\t\tconsole.log(\"Game Over\");\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Ok time to give the hint!\n\t\t\tcandies_to_pulse = rules.getCandiesToCrushGivenMove(random_move.candy, random_move.direction);\n\t\t\t\n\t\t\t// Clear Board of any animations from past\n\t\t\tdrawgrid(board);\n\t\t\t\n\t\t\t//Pulse each candy of interest individually\n\t\t\tfor (i = 0; i < candies_to_pulse.length; i++) {\n\t\t\t\t// individually pulse each candy\n\t\t\t\tpulse_candy(candies_to_pulse[i].row, candies_to_pulse[i].col);\n\t\t\t}\n\t\t\t\n\t\t\t// No more hints needed\n\t\t\tshowing_hint = false;\n\t\t\n\t\t}\n\t}\n\t\n\t\n}", "function provideHint(){\n\t// add code here\n}", "function check(){\r\n\t// tracking disabilitato\r\n\t//requires(\"/tracking.js\");\r\n\t\r\n\t// funzione legacy\r\n\t_check();\r\n}", "function check() {\n var enabled = true;\n if (!UI.GetValue(\"Misc\", \"JAVASCRIPT\", \"Script items\", \"Show Fixes\")) {\n var enabled = false;\n }\n UI.SetEnabled(\"MISC\", \"JAVASCRIPT\", \"Script items\", \"No FakeLag With Nades Out\", enabled);\n UI.SetEnabled(\"MISC\", \"JAVASCRIPT\", \"Script items\", \"No FakeLag With Revolver\", enabled);\n UI.SetEnabled(\"MISC\", \"JAVASCRIPT\", \"Script items\", \"No AA on knife fix\", enabled);\n if (UI.GetValue(\"Misc\", \"JAVASCRIPT\", \"Script items\", \"No FakeLag With Nades Out\") || GetValue(\"Misc\", \"JAVASCRIPT\", \"Script items\", \"No FakeLag With Revolver\")) {\n LagFix();\n }\n if (UI.GetValue(\"Misc\", \"JAVASCRIPT\", \"Script items\", \"No AA on knife fix\")) {\n knifeFix();\n }\n}", "function examineHintsAndCode() {\n\n const realHints = getHints();\n let fullInHints = 0;\n let halfInHints = 0;\n let fullInRealHints = 0;\n let halfInRealHints = 0;\n\n for (let i = 0; i < currentHints.length; i++) {\n if (currentHints[i] === \"half\") halfInHints++;\n if (currentHints[i] === \"full\") fullInHints++;\n }\n\n for (let i = 0; i < realHints.length; i++) {\n if (realHints[i] === \"half\") halfInRealHints++;\n if (realHints[i] === \"full\") fullInRealHints++;\n }\n return (fullInHints === fullInRealHints) && (halfInHints === halfInRealHints);\n}", "requirements({ msg, suffix }) {\n\t\treturn true;\n\t}", "async checkIfConfigured () {\r\n this.path = await this._getToolPath()\r\n return this.path != null\r\n }", "async checkIfConfigured () {\r\n this.path = await this._getToolPath()\r\n return this.path != null\r\n }", "function needed(key) {\n \tswitch (key) {\n \t\tcase \"addbuttonpopup\":\n \t\tcase \"addtoolbarbutton\":\n \t\tcase \"buttonpopupalways\":\n \t\tcase \"disableautoplay\":\n \t\tcase \"disableautoplayalways\":\n \t\tcase \"firstrun\":\n \t\tcase \"forceplayonfocus\":\n \t\tcase \"onlyonfirstfocus\":\n \t\tcase \"playonfocus\":\n \t\tcase \"popupupdateinterval\":\n \t\tcase \"unapprovedcheck\":\n \t\tcase \"updatecheck\":\n \t\tcase \"updatechecktime\":\n \t\tcase \"updateinterval\":\n \t\tcase \"version\":\n \t\t\treturn false;\n \t}\n\n \treturn true;\n }", "function linting() {\r\n return lintExtension;\r\n}", "function OBSOLETE(what,hint) {\r\n Ezer.fce.echo(\"WARNING - \\\"\",what,\"\\\" is OBSOLETE\",(hint ? ` - use \\\"${hint}\\\" instead` : ''));\r\n}", "function handleHintBtn() {\n if (game.pastGuesses.length < 3) {\n prompt.innerHTML = 'A little early for a hint, don\\'t you think?';\n } else {\n let hints = game.provideHint();\n prompt.innerHTML = `The answer is one of the following: ${hints[0]}, ${hints[1]}, and ${hints[2]}`;\n hint.disabled = true;\n }\n}", "function aliasGetHint(data,callback){\n gun.get(data.alias).once(function(data, key){\n //console.log(data);\n if(data){\n if(data.hint){\n console.log('FOUND HINT');\n callback(data.hint);\n }else{\n console.log('FAIL HINT');\n callback('FAIL');\n }\n }else{\n callback('FAIL');\n }\n });\n}", "function hintWord() {\n\tif (currentNum == null) {\n\t\talert(\"There is no hint right now...try starting a game!\");\n\t} else {\n\t\talert(\"Your hint is: \" + words.hint[currentNum]);\n\t}\n}", "function check() {}", "function showHint(){\n\n hint.giveHint()\n\n}", "checkDependencies() {\n if(os.platform() === \"linux\") {\n Helpers.isPackageInstalled(\"wmctrl\")\n .catch((error) => {\n var message = \"This tool uses <strong>wmctrl</strong> to focus the Path of Exile window. It is recommended to install it for an optimal experience.\";\n new TextEntry(\"Missing dependency\", message, {icon: \"fa-exclamation-triangle yellow\"}).add();\n });\n }\n }", "shouldCoerceAndCheck(context) {\n return !context.helpRequested &&\n !context.helpRequestedImplicitly &&\n !context.versionRequested &&\n !(context.messages && context.messages.length) &&\n (!this._magicCommandAdded || context.explicitCommandMatch(this.name));\n }", "function promptInformingAboutUsingStoryteller(warnAboutOpeningAProject) {\n //notify the user that they can use storyteller\n let message = 'You can use Storyteller by selecting \\'Storyteller: Start Tracking This Project\\' from the command palette or clicking the \\'Start Storyteller\\' button below. ';\n\n if(warnAboutOpeningAProject) {\n message = 'You must open a folder to use Storyteller. ' + message;\n }\n\n //show the message\n vscode.window.showInformationMessage(message);\n}", "get hint() {\n const hints = [];\n const unlocked = App.game.farming.unlockedBerries[this.mutatedBerry]();\n this.hintsSeen.forEach((hintSeen, idx) => {\n if (!hintSeen() && !unlocked) {\n return false;\n }\n hints.push(this.getHint(idx));\n });\n let tempHint = `There's a mysterious berry that requires ${hints.join(', ').replace(/, ([\\w\\s]+)$/, ' and $1')}`;\n if (hints.length === 0) {\n tempHint += 'a specific configuration of Berries';\n }\n tempHint += (hints.length !== 4) ? '. However, there\\'s still something missing...' : '.';\n return tempHint;\n }", "function tryToEnableLint() {\n try {\n cm.setOption(\"lint\", false);\n cm.setOption(\"lint\", true);\n } catch (ignore) {}\n }", "function _checkAi(){return true;}", "function showWarning() {\n return __awaiter(this, void 0, void 0, function* () {\n return apputils_1.showDialog({\n title: 'Enable Extension Manager?',\n body: \"Thanks for trying out JupyterLab's extension manager. \" +\n 'The JupyterLab development team is excited to have a robust ' +\n 'third-party extension community. ' +\n 'However, we cannot vouch for every extension, ' +\n 'and some may introduce security risks. ' +\n 'Do you want to continue?',\n buttons: [\n apputils_1.Dialog.cancelButton({ label: 'DISABLE' }),\n apputils_1.Dialog.warnButton({ label: 'ENABLE' })\n ]\n }).then(result => {\n if (result.button.accept) {\n return true;\n }\n else {\n return false;\n }\n });\n });\n }", "checkCheckers() {\n return this.unusedCheckers.length === 0 ? false : true;\n }", "function aliasGetHint(data,callback){\n gun.get(data.alias).once(function(data, key){\n //console.log(data);\n if(data){\n if(data.hint){\n //console.log('FOUND HINT');\n callback({\n hint:data.hint\n , question1:data.question1\n , question2:data.question2\n });\n }else{\n //console.log('FAIL HINT');\n callback('FAIL');\n }\n }else{\n callback('FAIL');\n }\n });\n}", "handleElectronSpellCheck(text) {\n if (!this.currentSpellchecker) return true;\n\n this.spellCheckInvoked.next(true);\n let result = this.isMisspelled(text);\n if (result) this.spellingErrorOccurred.next(text);\n return !result;\n }", "function jshintNotify(file) {\n\tif (!file.jshint) {\n\t\treturn;\n\t}\n\treturn file.jshint.success ? false : 'JSHint failed';\n}", "function isDef(check) {\n return typeof check!=='undefined' && check!==null;\n}", "handleElectronSpellCheck(text) {\n if (!this.currentSpellchecker) return true;\n\n if (isMac) {\n return !this.isMisspelled(text);\n }\n\n let result = this.isMisspelled(text);\n\n return !result;\n }", "checkIfDependenciesAvailable(resource, memo) {\n\n const isEconsentSpecific = resource.object.startsWith('ec__'),\n isEconsentInstalled = !!memo.availableApps.eConsentConfig,\n isTelevisitSpecific = resource.object.startsWith('tv__'),\n isTelevisitInstalled = !!memo.availableApps.televisitConfig,\n isIntegrationsSpecfic = resource.object.startsWith('int__'),\n isIntegrationsInstalled = !!memo.availableApps.integrationsConfig,\n isOracleSpecific = resource.object.startsWith('orac__'),\n isOracleInstalled = memo.availableApps.oracleConfig\n\n if (isEconsentSpecific && !isEconsentInstalled) {\n // eslint-disable-next-line no-undef\n throw Fault.create('kInvalidArgument', { reason: 'Target environment has not installed eConsent, please install eConsent and try again' })\n }\n\n if (isTelevisitSpecific && !isTelevisitInstalled) {\n // eslint-disable-next-line no-undef\n throw Fault.create('kInvalidArgument', { reason: 'Target environment has not installed Televisit, please install Televisit and try again' })\n }\n\n if (isIntegrationsSpecfic && !isIntegrationsInstalled) {\n // eslint-disable-next-line no-undef\n throw Fault.create('kInvalidArgument', { reason: 'Target environment has not installed Integrations, please install Integrations and try again' })\n }\n\n if (isOracleSpecific && !isOracleInstalled) {\n // eslint-disable-next-line no-undef\n throw Fault.create('kInvalidArgument', { reason: 'Target environment has not installed Oracle Integration, please install Oracle Integration and try again' })\n }\n\n return true\n }", "function checkInstrumenters() {\n var literal;\n for (var pattern in instrumenterOverrides) {\n literal = String(instrumenterOverrides[pattern]).toLowerCase();\n if (Object.keys(instrumenters).indexOf(literal) < 0) {\n log.error('Unknown instrumenter: %s', literal);\n return false;\n }\n }\n return true;\n }", "function isCheckNeeded(packageFileName) {\n return !manuallyCheckedPackages.includes(packageFileName)\n}", "get hint() {\n if (super.hint) {\n return super.hint;\n }\n return 'Legends tell of a mysterious Berry that only appears while surrounded by all types of Berries.';\n }", "function workspaceHasWarnings() {\n let blocks = mainWorkspace.getAllBlocks();\n return !!blocks.find((block) => !!block.warning);\n}", "checkForKnownDependency(dependencyName, bootConfig) {\n let configIndex = bootConfig.findIndex(configElement => configElement.name == dependencyName);\n return configIndex >= 0;\n }", "function checkBeforeInstall() {\n // Node version isn't supported, skip install\n pleaseUpgradeNode(pkg, {\n exitCode: 0,\n message: function (requiredVersion) {\n return `ihook > ihook requires Node ${requiredVersion} , stop Git hooks installation.`;\n }\n });\n\n // Prevent installing hooks if ihook is in nested node_modules\n if (isInNestedNodeModules(__dirname)) {\n log('Trying to install in nested node_modules directory, stop Git hooks installation.', 0);\n }\n}", "function validate_autoinfo_correct(enabled) {\n if (enabled && settings.lightning_enabled) {\n return 'Disable \"Lightning Mode\"!';\n }\n }", "isAssistant(obj){\n var returnType = {'getAssistantName':'string', 'getListeningCommands':'object'};\n for (var func in returnType){\n if(typeof obj[func] != 'function' && typeof obj[func]() != returnType[func]) {\n return false;\n }\n }\n // It quacks like an assistant...\n return true;\n }", "async function checkForEcto() {\n if (!!window.PhantasmaLinkSocket == true) {\n providerHint = 'ecto';\n };\n}", "function _check_modules(){\n // ADD MODULES CHECKS BELOW\n _checkModule('Chrome_serial');\n _checkModule('serial_console'); // check that the neatFramework \"serial_console\" module is present\n }", "function showSpecialWarning() {\r\n return true;\r\n}", "function listenForHintClick() {\r\n\t\t$(\"#hint\").click(function(){\r\n\t\t\tdocument.getElementById(\"hint\").setAttribute(\"disabled\", \"disabled\");\r\n\t\t\tif (difficultyLevel == \"easy\") {\r\n\t\t\t\tdisableCharsBasedOnDifficulty(8);\r\n\t\t\t} else if (difficultyLevel == \"medium\") {\r\n\t\t\t\tdisableCharsBasedOnDifficulty(4);\r\n\t\t\t} \r\n\t\t});\r\n\t}", "isHookApplicable(hook) {\n const fieldname = hook.get('attribute');\n return (fieldname === '*' || this.changes.has(fieldname));\n }", "static _knowSymbol (name) {\n\t\treturn !!subscripted[name];\n\t}", "canInstallRustAnalysis() {\r\n const logger = this.logger.createChildLogger('canInstallRustAnalysis: ');\r\n const nightlyToolchain = this.getUserNightlyToolchain();\r\n if (!nightlyToolchain) {\r\n logger.error('no nightly toolchain');\r\n return false;\r\n }\r\n const components = this.components[nightlyToolchain.toString(true, false)];\r\n if (!components) {\r\n logger.error('no components');\r\n return false;\r\n }\r\n const component = components.find(c => c.startsWith(Rustup.getRustAnalysisComponentName()));\r\n if (!component) {\r\n return false;\r\n }\r\n const componentInstalled = component.endsWith(Rustup.getSuffixForInstalledComponent());\r\n return !componentInstalled;\r\n }", "shouldFarmHackingSkill() {\n return true;\n }", "function checkPitted() {\r\n if (!pitted) {\r\n process.on('exit', function() {\r\n pitchain.forEach(function(fn) {\r\n fn(marks, expects);\r\n });\r\n });\r\n pitted = true;\r\n }\r\n}", "function hasSpecifiers(node) {\n const specifiers = node.specifiers.\n filter(specifier => specifier.type === 'ImportSpecifier');\n return specifiers.length > 0;\n}", "needsPOT() {\n // Has a wrapping mode (either wrapS or wrapT) equal to REPEAT or MIRRORED_REPEAT, or\n // Has a minification filter (minFilter) that uses mipmapping\n // (NEAREST_MIPMAP_NEAREST, NEAREST_MIPMAP_LINEAR,\n // LINEAR_MIPMAP_NEAREST, or LINEAR_MIPMAP_LINEAR).\n return false;\n }", "function checkExtensionImports() {\n console.log('Checking for missing extension imports...');\n\n const pkgjsonFileData = fs.existsSync(pkgjsonFilePath)\n ? fs.readJSONSync(pkgjsonFilePath)\n : undefined;\n if (!pkgjsonFileData) {\n console.error(\"package.json not found!\");\n process.exit(1);\n }\n\n const extensions = pkgjsonFileData.jupyterlab.extensions;\n const mimeExtensions = pkgjsonFileData.jupyterlab.mimeExtensions;\n const extensionsFilePath = path.resolve(__dirname, `../src/browser/extensions/index.ts`);\n let extensionsFileContent = '';\n try {\n extensionsFileContent = fs.readFileSync(extensionsFilePath, \"utf8\");\n } catch (e) {\n console.error('Error loading \"extensions/index.ts\"', e);\n }\n for (const extension of [...extensions, ...mimeExtensions]) {\n if (!extensionsFileContent.includes(`require('${extension}')`)) {\n console.error(`${extension} is not imported in \"extensions/index.ts\"`);\n process.exit(1);\n }\n }\n\n console.log('All extensions are bundled correctly.');\n}", "function areDependenciesAvailable() {}", "function shouldTooltipConfine(tooltipModel) {\n\t var confineOption = tooltipModel.get('confine');\n\t return confineOption != null ? !!confineOption // In richText mode, the outside part can not be visible.\n\t : tooltipModel.get('renderMode') === 'richText';\n\t }", "function allowQuestion() { }", "get allowSpellCheckAndSuggestion() {\n return this.spellSuggestionInternal;\n }", "needsInspection() {\n return this.specialActionNeeded || new Date().getFullYear() - this.yearLastInspected > 10;\n }", "_checkIsEnabled(name) {\n // TODO(crisbeto): we can't use `ngDevMode` here yet, because ViewEngine apps might not support\n // it. Since these checks can have performance implications and they aren't tree shakeable\n // in their current form, we can leave the `isDevMode` check in for now.\n // tslint:disable-next-line:ban\n if (!(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.isDevMode)() || (0,_angular_cdk_platform__WEBPACK_IMPORTED_MODULE_1__._isTestEnvironment)()) {\n return false;\n }\n if (typeof this._sanityChecks === 'boolean') {\n return this._sanityChecks;\n }\n return !!this._sanityChecks[name];\n }", "function watchForInstalledAddon() {\n const watchedEls = document.querySelectorAll(\"firefox-private-relay-addon, .relay-email-address-note\");\n const observerConfig = {\n attributes: true,\n childList: true, // catches legacy addons modifying .relay-email-address-note els\n\t};\n\n const patrollerDuties = (mutations, mutationPatroller) => {\n for (const mutation of mutations) {\n // handle legacy addon labeling\n if (mutation.type === \"childList\" && mutation.target.classList.contains(\"relay-email-address-note\")) {\n handleLegacyAddonLabels(mutation.target);\n }\n }\n\t};\n\n const mutationPatroller = new MutationObserver(patrollerDuties);\n watchedEls.forEach(watchedEl => {\n mutationPatroller.observe(watchedEl, observerConfig);\n });\n}", "handleElectronSpellCheck(text) {\n if (!this.currentSpellchecker) return true;\n\n if (isMac) {\n return !this.isMisspelled(text);\n }\n\n this.spellCheckInvoked.next(true);\n\n let result = this.isMisspelled(text);\n if (result) this.spellingErrorOccurred.next(text);\n return !result;\n }", "function registerComplain() {\n if(getVar(VARIABLE_COMPLAINTS, 0) > 3) {\n changeMeritHigh(true);\n } else if(getVar(VARIABLE_COMPLAINTS) > 1) {\n changeMeritMedium(true);\n } else {\n changeMeritLow(true);\n }\n\n setTempVar(VARIABLE_COMPLAINTS, getVar(VARIABLE_COMPLAINTS, 0) + 1);\n}", "function setHints(){\r\n hints[0]=\"Better luck next time.\";//show if chances=0\r\n hints[1]=\"Country ends with \"+answer[answer.length-1];//show if chances=1\r\n hints[2]=\"Country starts with \"+answer[0];// shows if chances=2\r\n hints[3]=\"Country has \"+answer.length+\" letters\";//show if chances are 3\r\n //check SHOWHINTS();var hint=hints[chances];set the current hint, based on how many chances are left\r\n } //END OF HINT BiZzness", "_checkConfigured() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._pointerTracker) {\n throwMissingPointerFocusTracker();\n }\n if (!this._menu) {\n throwMissingMenuReference();\n }\n }\n }", "isSettingAvailable(setting) {\n if (!setting.requires) return true\n\n const requires = Array.isArray(setting.requires) ? setting.requires : [setting.requires]\n for (let i = 0; i < requires.length; i++) {\n const ruleGroup = requires[i]\n let result = true\n for (const key in ruleGroup) {\n let success = ruleGroup[key].find(value => {\n return this.isSettingAvailable(this.tunes[key]) && this.data[key] === value\n })\n\n result = result && Boolean(success)\n if (!result) break\n }\n\n if (result) return true\n }\n\n return false\n }", "hasGeneralHelpCache() {\n\t\treturn !!this._generalHelpCache;\n\t}", "isSimulatorAddon(addon) {\n return !!this.simulatorAddonVersion(addon);\n }", "function shouldTooltipConfine(tooltipModel) {\n var confineOption = tooltipModel.get('confine');\n return confineOption != null ? !!confineOption // In richText mode, the outside part can not be visible.\n : tooltipModel.get('renderMode') === 'richText';\n}", "function isAvailableBehavior(behaviorToCheck, e, settings) {\n var setting = settings[behaviorToCheck];\n return !behaviorToCheck || setting && (!Object(util[\"C\" /* isString */])(setting) || e.event[setting + 'Key']);\n}", "function isTachyonsModule (module) {\n return module.indexOf('tachyons') !== -1\n}", "function isGeneratedWhenNeededMarker(val) {\n const token = token_map_1.TokenMap.instance().lookupString(val);\n return !!token && GENERATE_IF_NEEDED_SYMBOL in token;\n}", "function needsControls() {\n for(let taskName in allTasksObject) {\n if(allTasksObject[getHomeName(taskName)]) {\n return true;\n }\n }\n return false;\n }", "showHint(hint) {\n if (hint != null) {\n this.grid[hint.x][hint.y].gap = window.GAP_BREAK\n return\n }\n\n var goodHints = []\n var badHints = []\n\n for (var hint of this.hints) {\n if (this.getLine(hint.x, hint.y) > window.LINE_NONE) {\n // Solution will be broken by this hint\n goodHints.push(hint)\n } else {\n badHints.push(hint)\n }\n }\n if (goodHints.length > 0) {\n var hint = goodHints.splice(window.randInt(goodHints.length), 1)[0]\n } else if (badHints.length > 0) {\n var hint = badHints.splice(window.randInt(badHints.length), 1)[0]\n } else {\n return\n }\n this.grid[hint.x][hint.y].gap = window.GAP_BREAK\n this.hints = badHints.concat(goodHints)\n return hint\n }", "function isEnabled() {\n return (tracker.currentWidget !== null &&\n tracker.currentWidget === app.shell.currentWidget);\n }", "function canUse() {\n return fsevents && Object.keys(FSEventsWatchers).length < 128;\n}", "function fx_Hints(data)\n{\n\t//ask the camera to provide current hints\n\treturn __SIMULATOR.Camera.GetCurrentHintMessages();\n}", "function checkCompatability() {\n\tif (typeof my_ubmVersion !== \"string\") {\n\t\tvar s = \"The bookmarklet does not have a setting! Please make sure yours has one!\";\n\t\talert(s);\n\t\tthrow s;\n\t}\n\tif ([-1, NaN].includes(versionCompare(my_ubmVersion, ubm_clientFormatVersion))) { /*aka is the my_ubmVersion less than ubm_clientFormatVersion*/\n\t\tvar s = \"The client has an older version 'v\" + my_ubmVersion + \"' than is compatable with the bookarklet manager 'v\" + ubm_clientFormatVersion + \"'! Because of this, the script will not load until you update your bookmarklet. Possibly will add the ability to redirect to the main site and then update it for you.\";\n\t\talert(s);\n\t\tthrow s;\n\t}\n\tif (typeof repos !== \"undefined\") {\n\t\tconsole.log(\"Reloading script!\");\n\t}\n\tif (typeof my_settings !== \"object\") {\n\t\tconsole.warn(\"The settings object was not found or is not an object!\");\n\t\tsettings = {};\n\t}\n}", "function isAvailableBehavior(behaviorToCheck, e, settings) {\n\t var setting = settings[behaviorToCheck];\n\t return !behaviorToCheck || setting && (!isString(setting) || e.event[setting + 'Key']);\n\t }", "hasWarnings() {\n return this.warningCount > 0;\n }", "get hintLabel() { return this._hintLabel; }", "get partialHint() {\n const idx = this.hintIndex;\n return `There's a mysterious berry that requires ${this.getHint(idx)}.`;\n }", "function isBonusQuestion(grade_opt)\n{\n if (grade_opt.indexOf(GRADING_OPT_EXTRA_CREDIT) != -1)\n {\n return true;\n }\n \n return false;\n}", "function CanAddNonAttributed()\n{\n\ttry\n\t{\n\t\tvar oProj = window.external.ProjectObject;\n\t\t// check for IDL file\n\t\tvar bIDL = false;\n\t\tvar oFiles = oProj.Object.Files;\n\t\tfor (var nCntr = 1; nCntr <= oFiles.Count; nCntr++)\n\t\t{\n\t\t\tvar strFileName = oFiles(nCntr).Name.toUpperCase();\n\t\t\tvar nPos = strFileName.lastIndexOf(\".\");\n\t\t\tif (nPos>0 && strFileName.substr(nPos) == \".IDL\")\n\t\t\t{\n\t\t\t\tbIDL = true;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\tcatch(e)\n\t{ \n\t\tthrow e;\n\t}\n}", "function checkForIntent() {\n\t\t\t// calculate mouse position difference\n\t\t\tvar xDifference = Math.abs(session.previousX - session.currentX),\n\t\t\t\tyDifference = Math.abs(session.previousY - session.currentY),\n\t\t\t\ttotalDifference = xDifference + yDifference;\n\n\t\t\t// check if difference has passed the sensitivity threshold\n\t\t\tif (totalDifference < options.intentSensitivity) {\n\t\t\t\ttipController.showTip(element);\n\t\t\t} else {\n\t\t\t\t// try again\n\t\t\t\tsession.previousX = session.currentX;\n\t\t\t\tsession.previousY = session.currentY;\n\t\t\t\topenTooltip();\n\t\t\t}\n\t\t}", "function isRelayAddonInstalled() {\n const installationIndicator = document.querySelector(\"firefox-private-relay-addon\");\n\treturn (installationIndicator.dataset.addonInstalled === \"true\" || isAddonInstallInLocalStorage());\n}", "function isAnnoyedByTalking() {\n let mood = getMood();\n\n let chance = 0;\n\n //Talking issues\n chance += getVar(VARIABLE_FORGETTING_HONORIFIC_COUNT, 0)*10*mood;\n chance += getVar(VARIABLE_UNALLOWED_TALKS, 0)*10*mood;\n chance += getVar(VARIABLE_COMPLAINTS, 0)*10*mood;\n\n //General mood\n if(chance > 0) {\n //Mood already applied\n chance += mood*5;\n } else {\n //Mood had no effect yet\n chance += mood*10;\n }\n\n sendDebugMessage('Annoyed by talking chance: ' + chance);\n return isChance(chance);\n}", "function lovesCodeChecker(x){\n\tif(x === true){\n\t return true\n\t}\telse {\n\t\treturn false\n\t}\n}", "function checkHeadsetConnected () { return !!getVRDisplay(); }", "_checksAreEnabled() {\n // TODO(crisbeto): we can't use `ngDevMode` here yet, because ViewEngine apps might not support\n // it. Since these checks can have performance implications and they aren't tree shakeable\n // in their current form, we can leave the `isDevMode` check in for now.\n // tslint:disable-next-line:ban\n return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"isDevMode\"])() && !this._isTestEnv();\n }", "_checksAreEnabled() {\n // TODO(crisbeto): we can't use `ngDevMode` here yet, because ViewEngine apps might not support\n // it. Since these checks can have performance implications and they aren't tree shakeable\n // in their current form, we can leave the `isDevMode` check in for now.\n // tslint:disable-next-line:ban\n return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"isDevMode\"])() && !this._isTestEnv();\n }", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "_validateHints() {\n if (this._hintChildren && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n let startHint;\n let endHint;\n this._hintChildren.forEach((hint) => {\n if (hint.align === 'start') {\n if (startHint || this.hintLabel) {\n throw getMatFormFieldDuplicatedHintError('start');\n }\n startHint = hint;\n }\n else if (hint.align === 'end') {\n if (endHint) {\n throw getMatFormFieldDuplicatedHintError('end');\n }\n endHint = hint;\n }\n });\n }\n }", "get isDefined() {\n return !!fastRegistry.getByType(this.type);\n }", "isIntact () {\n return false;\n }" ]
[ "0.6574414", "0.6193216", "0.5987149", "0.5922055", "0.57744765", "0.56574875", "0.55860376", "0.55728495", "0.55728495", "0.55127203", "0.54249", "0.53932047", "0.5368473", "0.53547674", "0.5346847", "0.53449714", "0.5342256", "0.53201014", "0.5317996", "0.5314137", "0.53121114", "0.52655154", "0.52545106", "0.52510864", "0.52482367", "0.52259594", "0.5206127", "0.5203182", "0.5169035", "0.51680785", "0.5152827", "0.5152518", "0.51272273", "0.51106614", "0.51034987", "0.51033103", "0.50995415", "0.50784856", "0.5064576", "0.50553924", "0.50353056", "0.5032517", "0.5017995", "0.5014062", "0.49954414", "0.49930188", "0.49818552", "0.4972663", "0.4969044", "0.4968442", "0.49650392", "0.49638224", "0.49599648", "0.49579737", "0.49548292", "0.49522313", "0.49511272", "0.49495322", "0.49422976", "0.4937515", "0.4937368", "0.49269742", "0.49266604", "0.4923587", "0.4919941", "0.49098757", "0.4895951", "0.48939052", "0.48859775", "0.48854446", "0.48814848", "0.48805803", "0.48803848", "0.48799628", "0.48745662", "0.48680088", "0.48659587", "0.4856422", "0.48487803", "0.4846933", "0.48465756", "0.4843991", "0.48372838", "0.4837169", "0.48362333", "0.48323372", "0.4817117", "0.4817117", "0.48129746", "0.48129746", "0.48129746", "0.48129746", "0.48129746", "0.48129746", "0.48129746", "0.48129746", "0.48129746", "0.481013", "0.4809472", "0.48089218" ]
0.6407347
1
Discovers all child addons of this addon and an AddonInfo about each addon in this.addonPackages (keyed on addon name). Child addons include those from 'dependencies' (not devDependencies) and inrepo addons Any packageInfos that we find that are marked as not valid are excluded.
discoverAddons() { // prefer `packageRoot`, fallback to `root`; this is to maintain backwards compatibility for // consumers who create a new instance of the base addon model class directly and don't set // `packageRoot` let pkgInfo = this.packageInfoCache.getEntry(this.packageRoot || this.root); if (pkgInfo) { let addonPackageList = pkgInfo.discoverAddonAddons(); this.addonPackages = pkgInfo.generateAddonPackages( addonPackageList, (addonInfo) => this.shouldIncludeChildAddon && !this.shouldIncludeChildAddon(addonInfo) ); // in case any child addons are invalid, dump to the console about them. pkgInfo.dumpInvalidAddonPackages(addonPackageList); } else { // There are cases where an addon can be created in memory and not actually // have a root entry (or have one that is not actually pointing to a directory, // like 'foo' in some of the tests. We don't want to crash, but want to let // things continue even though they're empty. this.addonPackages = Object.create(null); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async updateAddonRepositoryData() {\n let addons = await this.getVisibleAddons(null);\n logger.debug(\"updateAddonRepositoryData found \" + addons.length + \" visible add-ons\");\n\n await Promise.all(addons.map(addon =>\n AddonRepository.getCachedAddonByID(addon.id).then(aRepoAddon => {\n if (aRepoAddon || AddonRepository.getCompatibilityOverridesSync(addon.id)) {\n logger.debug(\"updateAddonRepositoryData got info for \" + addon.id);\n addon._repositoryAddon = aRepoAddon;\n this.updateAddonDisabledState(addon);\n }\n })));\n }", "discoverAddons(){\n this._super.discoverAddons.apply(this, arguments);\n delete this.addonPackages[\"in-repo-addon\"];\n delete this.addonPackages[\"in-repo-engine\"];\n delete this.addonPackages[\"in-repo-lazy-engine\"];\n }", "function getAllAddons() {\n self.getAsyncStatement(\"getAllAddons\").executeAsync({\n handleResult: function(aResults) {\n let row = null;\n while (row = aResults.getNextRow()) {\n let internal_id = row.getResultByName(\"internal_id\");\n addons[internal_id] = self._makeAddonFromAsyncRow(row);\n }\n },\n\n handleError: self.asyncErrorLogger,\n\n handleCompletion: function(aReason) {\n if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {\n ERROR(\"Error retrieving add-ons from database. Returning empty results\");\n aCallback({});\n return;\n }\n\n getAllDevelopers();\n }\n });\n }", "resolveDependencies() {\n var _a;\n debug('resolveDependencies');\n const pluginNames = new Set(this._plugins.map((p) => p.name));\n // Handle `plugins` stanza\n this._plugins\n .filter(p => 'plugins' in p && p.plugins.length)\n .map(p => p)\n .forEach(parent => {\n parent.plugins\n .filter(p => !pluginNames.has(p.name))\n .forEach(p => {\n debug('adding missing plugin', p.name);\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n if (parent.filter && !p.filter) {\n // Make child plugins inherit the parents filter if they don't have anything specified\n Object.defineProperty(p, 'filter', {\n get() {\n return parent.filter;\n }\n });\n }\n this.add(p);\n });\n });\n // Handle `dependencies` stanza\n const allDeps = new Map();\n this._plugins\n // Skip plugins without dependencies\n .filter(p => 'dependencies' in p && p.dependencies.size)\n .map(p => p.dependencies)\n .forEach(deps => {\n if (deps instanceof Set) {\n deps.forEach(k => allDeps.set(k, {}));\n }\n if (deps instanceof Map) {\n deps.forEach((v, k) => {\n allDeps.set(k, v); // Note: k,v => v,k\n });\n }\n });\n const missingDeps = new Map([...allDeps].filter(([k]) => !pluginNames.has(k)));\n if (!missingDeps.size) {\n debug('no dependencies are missing');\n return;\n }\n debug('dependencies missing', missingDeps);\n // Loop through all dependencies declared missing by plugins\n for (const [name, opts] of [...missingDeps]) {\n // Check if the dependency hasn't been registered as plugin already.\n // This might happen when multiple plugins have nested dependencies.\n if (this.names.includes(name)) {\n debug(`ignoring dependency '${name}', which has been required already.`);\n continue;\n }\n const hasFullName = name.startsWith('puppeteer-extra-plugin') ||\n name.startsWith('automation-extra-plugin');\n // We follow a plugin naming convention, but let's rather enforce it <3\n const requireNames = hasFullName\n ? [name]\n : [`automation-extra-plugin-${name}`, `puppeteer-extra-plugin-${name}`];\n const pkg = requirePackages(requireNames);\n if (!pkg) {\n throw new Error(`\n A plugin listed '${name}' as dependency,\n which is currently missing. Please install it:\n\n${requireNames\n .map(name => {\n return `yarn add ${name.split('/')[0]}`;\n })\n .join(`\\n or:\\n`)}\n\n Note: You don't need to require the plugin yourself,\n unless you want to modify it's default settings.\n `);\n }\n const plugin = pkg(opts);\n this.add(plugin);\n // Handle nested dependencies :D\n if ((_a = plugin.dependencies) === null || _a === void 0 ? void 0 : _a.size) {\n this.resolveDependencies();\n }\n }\n }", "async getAddons() {\n const addonConfigs = await this.addonStore.getAll();\n return addonConfigs.map(a => this.filterSensitiveFields(a));\n }", "updateAddonAppDisabledStates() {\n for (let addon of this.getAddons()) {\n this.updateAddonDisabledState(addon);\n }\n }", "resolvePluginDependencies() {\r\n // Request missing dependencies from all plugins and flatten to a single Set\r\n const missingPlugins = this._plugins\r\n .map(p => p._getMissingDependencies(this._plugins))\r\n .reduce((combined, list) => {\r\n return new Set([...combined, ...list]);\r\n }, new Set());\r\n if (!missingPlugins.size) {\r\n debug('no dependencies are missing');\r\n return;\r\n }\r\n debug('dependencies missing', missingPlugins);\r\n // Loop through all dependencies declared missing by plugins\r\n for (let name of [...missingPlugins]) {\r\n // Check if the dependency hasn't been registered as plugin already.\r\n // This might happen when multiple plugins have nested dependencies.\r\n if (this.pluginNames.includes(name)) {\r\n debug(`ignoring dependency '${name}', which has been required already.`);\r\n continue;\r\n }\r\n // We follow a plugin naming convention, but let's rather enforce it <3\r\n name = name.startsWith('puppeteer-extra-plugin')\r\n ? name\r\n : `puppeteer-extra-plugin-${name}`;\r\n // In case a module sub resource is requested print out the main package name\r\n // e.g. puppeteer-extra-plugin-stealth/evasions/console.debug => puppeteer-extra-plugin-stealth\r\n const packageName = name.split('/')[0];\r\n let dep = null;\r\n try {\r\n // Try to require and instantiate the stated dependency\r\n dep = require(name)();\r\n // Register it with `puppeteer-extra` as plugin\r\n this.use(dep);\r\n }\r\n catch (err) {\r\n console.warn(`\n A plugin listed '${name}' as dependency,\n which is currently missing. Please install it:\n\n yarn add ${packageName}\n\n Note: You don't need to require the plugin yourself,\n unless you want to modify it's default settings.\n `);\r\n throw err;\r\n }\r\n // Handle nested dependencies :D\r\n if (dep.dependencies.size) {\r\n this.resolvePluginDependencies();\r\n }\r\n }\r\n }", "xdnAllPackages() {\n return [...this.xdnRuntimeDependencies(), ...this.xdnDevDependencies()];\n }", "function determineDependents({\n releases,\n packagesByName,\n dependencyGraph,\n preInfo,\n config\n}) {\n let updated = false; // NOTE this is intended to be called recursively\n\n let pkgsToSearch = [...releases.values()];\n\n while (pkgsToSearch.length > 0) {\n // nextRelease is our dependency, think of it as \"avatar\"\n const nextRelease = pkgsToSearch.shift();\n if (!nextRelease) continue; // pkgDependents will be a list of packages that depend on nextRelease ie. ['avatar-group', 'comment']\n\n const pkgDependents = dependencyGraph.get(nextRelease.name);\n\n if (!pkgDependents) {\n throw new Error(`Error in determining dependents - could not find package in repository: ${nextRelease.name}`);\n }\n\n pkgDependents.map(dependent => {\n let type;\n const dependentPackage = packagesByName.get(dependent);\n if (!dependentPackage) throw new Error(\"Dependency map is incorrect\");\n\n if (config.ignore.includes(dependent)) {\n type = \"none\";\n } else {\n const dependencyVersionRanges = getDependencyVersionRanges(dependentPackage.packageJson, nextRelease.name);\n\n for (const {\n depType,\n versionRange\n } of dependencyVersionRanges) {\n if (shouldBumpMajor({\n dependent,\n depType,\n versionRange,\n releases,\n nextRelease,\n preInfo,\n onlyUpdatePeerDependentsWhenOutOfRange: config.___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH.onlyUpdatePeerDependentsWhenOutOfRange\n })) {\n type = \"major\";\n } else {\n if ( // TODO validate this - I don't think it's right anymore\n (!releases.has(dependent) || releases.get(dependent).type === \"none\") && (config.___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH.updateInternalDependents === \"always\" || !semver__default['default'].satisfies(incrementVersion(nextRelease, preInfo), // to deal with a * versionRange that comes from workspace:* dependencies as the wildcard will match anything\n versionRange === \"*\" ? nextRelease.oldVersion : versionRange))) {\n switch (depType) {\n case \"dependencies\":\n case \"optionalDependencies\":\n case \"peerDependencies\":\n if (type !== \"major\" && type !== \"minor\") {\n type = \"patch\";\n }\n\n break;\n\n case \"devDependencies\":\n {\n // We don't need a version bump if the package is only in the devDependencies of the dependent package\n if (type !== \"major\" && type !== \"minor\" && type !== \"patch\") {\n type = \"none\";\n }\n }\n }\n }\n }\n }\n }\n\n if (releases.has(dependent) && releases.get(dependent).type === type) {\n type = undefined;\n }\n\n return {\n name: dependent,\n type,\n pkgJSON: dependentPackage.packageJson\n };\n }).filter(({\n type\n }) => type).forEach( // @ts-ignore - I don't know how to make typescript understand that the filter above guarantees this and I got sick of trying\n ({\n name,\n type,\n pkgJSON\n }) => {\n // At this point, we know if we are making a change\n updated = true;\n const existing = releases.get(name); // For things that are being given a major bump, we check if we have already\n // added them here. If we have, we update the existing item instead of pushing it on to search.\n // It is safe to not add it to pkgsToSearch because it should have already been searched at the\n // largest possible bump type.\n\n if (existing && type === \"major\" && existing.type !== \"major\") {\n existing.type = \"major\";\n pkgsToSearch.push(existing);\n } else {\n let newDependent = {\n name,\n type,\n oldVersion: pkgJSON.version,\n changesets: []\n };\n pkgsToSearch.push(newDependent);\n releases.set(name, newDependent);\n }\n });\n }\n\n return updated;\n}", "function getDepsFromPlugin(root, options) {\n return __awaiter(this, void 0, void 0, function* () {\n let inspectRes;\n if (options.allProjects) {\n const levelsDeep = options.detectionDepth;\n const ignore = options.exclude ? options.exclude.split(',') : [];\n const targetFiles = yield find_files_1.find(root, ignore, detect_1.AUTO_DETECTABLE_FILES, levelsDeep);\n debug(`auto detect manifest files, found ${targetFiles.length}`, targetFiles);\n if (targetFiles.length === 0) {\n throw errors_1.NoSupportedManifestsFoundError([root]);\n }\n inspectRes = yield get_multi_plugin_result_1.getMultiPluginResult(root, options, targetFiles);\n const analyticData = {\n scannedProjects: inspectRes.scannedProjects.length,\n targetFiles,\n packageManagers: targetFiles.map((file) => detect_1.detectPackageManagerFromFile(file)),\n levelsDeep,\n ignore,\n };\n analytics.add('allProjects', analyticData);\n return inspectRes;\n }\n // TODO: is this needed for the auto detect handling above?\n // don't override options.file if scanning multiple files at once\n if (!options.scanAllUnmanaged) {\n options.file = options.file || detect_1.detectPackageFile(root);\n }\n if (!options.docker && !(options.file || options.packageManager)) {\n throw errors_1.NoSupportedManifestsFoundError([...root]);\n }\n inspectRes = yield get_single_plugin_result_1.getSinglePluginResult(root, options);\n if (!cli_interface_1.legacyPlugin.isMultiResult(inspectRes)) {\n if (!inspectRes.package) {\n // something went wrong if both are not present...\n throw Error(`error getting dependencies from ${options.docker ? 'docker' : options.packageManager} ` + \"plugin: neither 'package' nor 'scannedProjects' were found\");\n }\n return convert_single_splugin_res_to_multi_custom_1.convertSingleResultToMultiCustom(inspectRes, options.packageManager);\n }\n // We are using \"options\" to store some information returned from plugin that we need to use later,\n // but don't want to send to Registry in the Payload.\n // TODO(kyegupov): decouple inspect and payload so that we don't need this hack\n options.projectNames = inspectRes.scannedProjects.map((scannedProject) => scannedProject.depTree.name);\n return convert_multi_plugin_res_to_multi_custom_1.convertMultiResultToMultiCustom(inspectRes, options.packageManager);\n });\n}", "function loadAddons() {\n\tvar modules = getActiveAddonModules(),\n\t\tmodule, options, option, i;\n\n\tfor (i = 0; i < modules.length; i += 1) {\n\t\toptions = modules[i].split(':');\n\n\t\tif (options.length > 1) {\n\t\t\tmodule = options.shift();\n\t\t} else {\n\t\t\t// no options\n\t\t\tmodule = options[0];\n\t\t}\n\n\t\tif (options[0].indexOf('private') !== -1) {\n\t\t\tif (typeof core.modules !== 'object') {\n\t\t\t\tcore.modules = {};\n\t\t\t}\n\t\t\tcore.modules[module] = loadModule(module + '/' + module, 'addon');\n\t\t} else {\n\t\t\tRax.log('loading addon module...', module);\n\t\t\tRax.modules[module] = loadModule(module + '/' + module, 'addon');\n\t\t}\n\t}\n\n}", "async getIdsOfDepsInstalledAsPackages() {\n if (!this.options.objectsOnly) {\n // this is needed only when importing objects. we don't want these components to be written to the fs\n return [];\n }\n\n const authoredNonExportedComponentsIds = this.consumer.bitMap.getAuthoredNonExportedComponents();\n const {\n components: authoredNonExportedComponents\n } = await this.consumer.loadComponents(_bitId().BitIds.fromArray(authoredNonExportedComponentsIds), false);\n const dependencies = (0, _flatten2().default)(authoredNonExportedComponents.map(c => c.getAllDependenciesIds()));\n const missingDeps = [];\n await Promise.all(dependencies.map(async dep => {\n if (!dep.hasScope()) return;\n const isInScope = await this.scope.isComponentInScope(dep);\n if (!isInScope) missingDeps.push(dep);\n }));\n return missingDeps;\n }", "xdnRuntimeDependencies() {\n return Object.entries(this.find('dependencies', {})).filter(([name]) => name.startsWith(this.XDN_PACKAGE_PREFIX));\n }", "async function findPackages() {\n _log('Finding all packages')\n const pkgPromises = [\n time(getLocalPackages),\n time(getGlobalPackages),\n time(getOtherPackages),\n time(getHomePackages)\n ]\n const [local, global, other, home] = await Promise.all(pkgPromises)\n _log('Done finding all packages')\n const packages = local.packages\n packages.push.apply(packages, global.packages)\n packages.push.apply(packages, other.packages)\n\n const dependencies = local.dependencies\n dependencies.push.apply(dependencies, global.dependencies)\n dependencies.push.apply(dependencies, other.dependencies)\n\n if (home) {\n if (home.home) {\n packages.unshift.apply(packages, home.home.packages)\n dependencies.unshift.apply(dependencies, home.home.dependencies)\n }\n if (home.homeOld) {\n packages.unshift.apply(packages, home.homeOld.packages)\n dependencies.unshift.apply(dependencies, home.homeOld.dependencies)\n }\n }\n\n addSetting('Packages', flattenVersions(packages))\n addSetting('Dependencies', flattenVersions(dependencies))\n}", "function getAddonsModules(stats) {\n\tconst addonModules = stats.containers.addon\n\n\tconst selectedAddons = []\n\taddonModules.forEach((container) => {\n\t\tif(container.choosen) {\n\t\t\tselectedAddons.push(container)\n\t\t}\n\n\t\tconst vol = parseInt(stats.volume.total, 10)\n\t\tconst keg = parseInt(stats.containers.threshold.kegStorage, 10)\n\t\tconst bot = parseInt(stats.containers.threshold.bottleMachine, 10)\n\t\tif(container.comment.toLowerCase().indexOf('bott') !== -1) {\n\t\t\tif(vol > bot) {\n\t\t\t\tcontainer.recommended = true\n\t\t\t} else {\n\t\t\t\tcontainer.recommended = false\n\t\t\t}\n\t\t} else if(container.comment.toLowerCase().indexOf('keg') !== -1) {\n\t\t\tif(vol > keg) {\n\t\t\t\tcontainer.recommended = true\n\t\t\t} else {\n\t\t\t\tcontainer.recommended = false\n\t\t\t}\n\t\t}\n\t})\n\treturn selectedAddons\n}", "checkDependencies() {\n console.debug(\"checkDependencies\", this.dependencies);\n if (Object.keys(this.dependencies)) {\n for (let id in this.dependencies) {\n let { dependencies, callback } = this.dependencies[id];\n console.debug(\"checkDependency\", dependencies.services, this.offlineServices);\n if (dependencies.services.length) {\n let servicesAreAllOffline = this.checkServices(dependencies.services);\n if (!servicesAreAllOffline) {\n continue;\n }\n }\n console.debug(\"checkDependencies callback\");\n delete this.dependencies[id];\n if (callback) {\n callback();\n }\n }\n }\n }", "function getPackages() {\n\tvar packages = {};\n\tvar Package = {\n\t\tdescribe: function () {\n\t\t},\n\t\t_transitional_registerBuildPlugin: function () {\n\t\t},\n\t\tregister_extension: function () {\n\t\t},\n\t\tregisterExtension: function () {\n\t\t},\n\t\ton_use: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\tonUse: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\ton_test: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\tonTest: function (callback) {\n\t\t\tcallback(api);\n\t\t},\n\t\tregisterBuildPlugin: function () {\n\t\t}\n\t};\n\tNpm.depends = function () {\n\t};\n\tNpm.strip = function () {\n\t};\n\tvar Cordova = {\n\t\tdepends: function () {\n\t\t}\n\t};\n\tvar api = {\n\t\tadd_files: function () {\n\t\t},\n\t\taddFiles: function () {\n\t\t},\n\t\taddAssets: function () {\n\t\t},\n\t\timply: function () {\n\t\t},\n\t\tuse: function () {\n\t\t},\n\t\texport: function () {\n\t\t},\n\t\tversionsFrom: function() {\n\t\t},\n\t\tmainModule: function() {\n\t\t}\n\t}\n\n\tfs.readdirSync(packagesPath).forEach(handlePackage);\n\tif (fs.existsSync('packages')) {\n\t\tfs.readdirSync('packages').forEach(handlePackage);\n\t}\n\treturn packages;\n\n\tfunction initPackage(name) {\n\t\tif (typeof(packages[name]) === 'undefined') {\n\t\t\tvar packagePath = path.join(packagesPath, name);\n\t\t\tif (fs.existsSync(path.join('packages', name))) {\n\t\t\t\tpackagePath = path.join('packages', name);\n\t\t\t}\n\t\t\tpackages[name] = {\n\t\t\t\tpath: packagePath,\n\t\t\t\tserver: {\n\t\t\t\t\tuses: {},\n\t\t\t\t\timply: {},\n\t\t\t\t\tfiles: []\n\t\t\t\t},\n\t\t\t\tclient: {\n\t\t\t\t\tuses: {},\n\t\t\t\t\timply: {},\n\t\t\t\t\tfiles: []\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction handlePackage(package) {\n\t\tif (package.charAt(0) === '.') {\n\t\t\treturn;\n\t\t}\n\t\tinitPackage(package);\n\t\tvar packageJsPath = path.join(packagesPath, package, 'package.js');\n\t\tif (fs.existsSync(path.join('packages', package))) {\n\t\t\tpackageJsPath = path.join('packages', package, 'package.js');\n\t\t}\n\t\tif (package.charAt(0) === '.' || !fs.existsSync(packageJsPath)) {\n\t\t\treturn;\n\t\t}\n\t\tvar packageJs = fs.readFileSync(packageJsPath).toString();\n\t\tif (packageJs) {\n\t\t\tapi.use = function (name, where) {\n\t\t\t\tvar inServer = !where || where === 'server' || (where instanceof Array && where.indexOf('server') !== -1);\n\t\t\t\tvar inClient = !where || where === 'client' || where === 'web.cordova' || (where instanceof Array && (where.indexOf('client') !== -1 || where.indexOf('web.cordova') !== -1));\n\t\t\t\tif (!(name instanceof Array)) {\n\t\t\t\t\tname = [name];\n\t\t\t\t}\n\t\t\t\tname.forEach(function (item) {\n\t\t\t\t\tinitPackage(item);\n\t\t\t\t\tif (inServer) {\n\t\t\t\t\t\tpackages[package].server.uses[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t\tif (inClient) {\n\t\t\t\t\t\tpackages[package].client.uses[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\t\t\tapi.imply = function (name, where) {\n\t\t\t\tvar inServer = !where || where === 'server' || (where instanceof Array && where.indexOf('server') !== -1);\n\t\t\t\tvar inClient = !where || where === 'client' || where === 'web.cordova' || (where instanceof Array && (where.indexOf('client') !== -1 || where.indexOf('web.cordova') !== -1));\n\t\t\t\tif (!(name instanceof Array)) {\n\t\t\t\t\tname = [name];\n\t\t\t\t}\n\t\t\t\tname.forEach(function (item) {\n\t\t\t\t\tinitPackage(item);\n\t\t\t\t\tif (inServer) {\n\t\t\t\t\t\tpackages[package].server.imply[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t\tif (inClient) {\n\t\t\t\t\t\tpackages[package].client.imply[item] = packages[item];\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\t\t\tapi.add_files = api.addFiles = function (name, where) {\n\t\t\t\tvar inServer = !where || where === 'server' || (where instanceof Array && where.indexOf('server') !== -1);\n\t\t\t\tvar inClient = !where || where === 'client' || where === 'web.cordova' || (where instanceof Array && (where.indexOf('client') !== -1 || where.indexOf('web.cordova') !== -1));\n\t\t\t\tif (!(name instanceof Array)) {\n\t\t\t\t\tname = [name];\n\t\t\t\t}\n\t\t\t\tvar items = name.filter(function (item) {\n\t\t\t\t\tif (item) {\n\t\t\t\t\t\treturn item.substr(item.length - 3) === '.ts';\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif (inServer) {\n\t\t\t\t\tpackages[package].server.files = packages[package].server.files.concat(items);\n\t\t\t\t}\n\t\t\t\tif (inClient) {\n\t\t\t\t\tpackages[package].client.files = packages[package].client.files.concat(items);\n\t\t\t\t}\n\t\t\t};\n\t\t\tPackage.on_use = Package.onUse = function (callback) {\n\t\t\t\tcallback(api);\n\t\t\t};\n\t\t\tPackage.on_test = Package.onTest = function (callback) {\n\t\t\t\tcallback(api);\n\t\t\t};\n\t\t\tPackage.includeTool = function () {\n\t\t\t};\n\t\t\teval(packageJs);\n\t\t}\n\t}\n\n}", "processFileChanges(aManifests, aUpdateCompatibility, aOldAppVersion, aOldPlatformVersion) {\n let loadedManifest = (aInstallLocation, aId) => {\n if (!(aInstallLocation.name in aManifests))\n return null;\n if (!(aId in aManifests[aInstallLocation.name]))\n return null;\n return aManifests[aInstallLocation.name][aId];\n };\n\n // Get the previous add-ons from the database and put them into maps by location\n let previousAddons = new Map();\n for (let a of XPIDatabase.getAddons()) {\n let locationAddonMap = previousAddons.get(a.location);\n if (!locationAddonMap) {\n locationAddonMap = new Map();\n previousAddons.set(a.location, locationAddonMap);\n }\n locationAddonMap.set(a.id, a);\n }\n\n // Build the list of current add-ons into similar maps. When add-ons are still\n // present we re-use the add-on objects from the database and update their\n // details directly\n let currentAddons = new Map();\n for (let installLocation of XPIProvider.installLocations) {\n let locationAddonMap = new Map();\n currentAddons.set(installLocation.name, locationAddonMap);\n\n // Get all the on-disk XPI states for this location, and keep track of which\n // ones we see in the database.\n let states = XPIStates.getLocation(installLocation.name);\n\n // Iterate through the add-ons installed the last time the application\n // ran\n let dbAddons = previousAddons.get(installLocation.name);\n if (dbAddons) {\n for (let [id, oldAddon] of dbAddons) {\n // Check if the add-on is still installed\n let xpiState = states && states.get(id);\n if (xpiState) {\n // Here the add-on was present in the database and on disk\n recordAddonTelemetry(oldAddon);\n\n // Check if the add-on has been changed outside the XPI provider\n if (oldAddon.updateDate != xpiState.mtime) {\n // Did time change in the wrong direction?\n if (xpiState.mtime < oldAddon.updateDate) {\n XPIProvider.setTelemetry(oldAddon.id, \"olderFile\", {\n name: XPIProvider._mostRecentlyModifiedFile[id],\n mtime: xpiState.mtime,\n oldtime: oldAddon.updateDate\n });\n } else {\n XPIProvider.setTelemetry(oldAddon.id, \"modifiedFile\",\n XPIProvider._mostRecentlyModifiedFile[id]);\n }\n }\n\n // The add-on has changed if the modification time has changed, or\n // we have an updated manifest for it. Also reload the metadata for\n // add-ons in the application directory when the application version\n // has changed\n let newAddon = loadedManifest(installLocation, id);\n if (newAddon || oldAddon.updateDate != xpiState.mtime ||\n (aUpdateCompatibility && (installLocation.name == KEY_APP_GLOBAL ||\n installLocation.name == KEY_APP_SYSTEM_DEFAULTS))) {\n newAddon = this.updateMetadata(installLocation, oldAddon, xpiState, newAddon);\n }\n else if (oldAddon.descriptor != xpiState.descriptor) {\n newAddon = this.updateDescriptor(installLocation, oldAddon, xpiState);\n }\n else if (aUpdateCompatibility) {\n newAddon = this.updateCompatibility(installLocation, oldAddon, xpiState,\n aOldAppVersion, aOldPlatformVersion);\n }\n else {\n // No change\n newAddon = oldAddon;\n }\n\n if (newAddon)\n locationAddonMap.set(newAddon.id, newAddon);\n }\n else {\n // The add-on is in the DB, but not in xpiState (and thus not on disk).\n this.removeMetadata(oldAddon);\n }\n }\n }\n\n // Any add-on in our current location that we haven't seen needs to\n // be added to the database.\n // Get the migration data for this install location so we can include that as\n // we add, in case this is a database upgrade or rebuild.\n let locMigrateData = {};\n if (XPIDatabase.migrateData && installLocation.name in XPIDatabase.migrateData)\n locMigrateData = XPIDatabase.migrateData[installLocation.name];\n\n if (states) {\n for (let [id, xpiState] of states) {\n if (locationAddonMap.has(id))\n continue;\n let migrateData = id in locMigrateData ? locMigrateData[id] : null;\n let newAddon = loadedManifest(installLocation, id);\n let addon = this.addMetadata(installLocation, id, xpiState, newAddon,\n aOldAppVersion, aOldPlatformVersion, migrateData);\n if (addon)\n locationAddonMap.set(addon.id, addon);\n }\n }\n }\n\n // previousAddons may contain locations where the database contains add-ons\n // but the browser is no longer configured to use that location. The metadata\n // for those add-ons must be removed from the database.\n for (let [locationName, addons] of previousAddons) {\n if (!currentAddons.has(locationName)) {\n for (let [id, oldAddon] of addons)\n this.removeMetadata(oldAddon);\n }\n }\n\n // Validate the updated system add-ons\n let systemAddonLocation = XPIProvider.installLocationsByName[KEY_APP_SYSTEM_ADDONS];\n let addons = currentAddons.get(KEY_APP_SYSTEM_ADDONS) || new Map();\n\n let hideLocation;\n if (systemAddonLocation.isActive() && systemAddonLocation.isValid(addons)) {\n // Hide the system add-on defaults\n logger.info(\"Hiding the default system add-ons.\");\n hideLocation = KEY_APP_SYSTEM_DEFAULTS;\n }\n else {\n // Hide the system add-on updates\n logger.info(\"Hiding the updated system add-ons.\");\n hideLocation = KEY_APP_SYSTEM_ADDONS;\n }\n\n let previousVisible = this.getVisibleAddons(previousAddons);\n let currentVisible = this.flattenByID(currentAddons, hideLocation);\n let sawActiveTheme = false;\n XPIProvider.bootstrappedAddons = {};\n\n // Pass over the new set of visible add-ons, record any changes that occured\n // during startup and call bootstrap install/uninstall scripts as necessary\n for (let [id, currentAddon] of currentVisible) {\n let previousAddon = previousVisible.get(id);\n\n // Note if any visible add-on is not in the application install location\n if (currentAddon._installLocation.name != KEY_APP_GLOBAL)\n XPIProvider.allAppGlobal = false;\n\n let isActive = !currentAddon.disabled;\n let wasActive = previousAddon ? previousAddon.active : currentAddon.active\n\n if (!previousAddon) {\n // If we had a manifest for this add-on it was a staged install and\n // so wasn't something recovered from a corrupt database\n let wasStaged = !!loadedManifest(currentAddon._installLocation, id);\n\n // We might be recovering from a corrupt database, if so use the\n // list of known active add-ons to update the new add-on\n if (!wasStaged && XPIDatabase.activeBundles) {\n // For themes we know which is active by the current skin setting\n if (currentAddon.type == \"theme\")\n isActive = currentAddon.internalName == XPIProvider.currentSkin;\n else\n isActive = XPIDatabase.activeBundles.indexOf(currentAddon.descriptor) != -1;\n\n // If the add-on wasn't active and it isn't already disabled in some way\n // then it was probably either softDisabled or userDisabled\n if (!isActive && !currentAddon.disabled) {\n // If the add-on is softblocked then assume it is softDisabled\n if (currentAddon.blocklistState == Blocklist.STATE_SOFTBLOCKED)\n currentAddon.softDisabled = true;\n else\n currentAddon.userDisabled = true;\n }\n }\n else {\n // This is a new install\n if (currentAddon.foreignInstall)\n AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_INSTALLED, id);\n\n if (currentAddon.bootstrap) {\n // Visible bootstrapped add-ons need to have their install method called\n XPIProvider.callBootstrapMethod(currentAddon, currentAddon._sourceBundle,\n \"install\", BOOTSTRAP_REASONS.ADDON_INSTALL);\n if (!isActive)\n XPIProvider.unloadBootstrapScope(currentAddon.id);\n }\n }\n }\n else {\n if (previousAddon !== currentAddon) {\n // This is an add-on that has changed, either the metadata was reloaded\n // or the version in a different location has become visible\n AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_CHANGED, id);\n\n let installReason = Services.vc.compare(previousAddon.version, currentAddon.version) < 0 ?\n BOOTSTRAP_REASONS.ADDON_UPGRADE :\n BOOTSTRAP_REASONS.ADDON_DOWNGRADE;\n\n // If the previous add-on was in a different path, bootstrapped\n // and still exists then call its uninstall method.\n if (previousAddon.bootstrap && previousAddon._installLocation &&\n previousAddon._sourceBundle.exists() &&\n currentAddon._sourceBundle.path != previousAddon._sourceBundle.path) {\n\n XPIProvider.callBootstrapMethod(previousAddon, previousAddon._sourceBundle,\n \"uninstall\", installReason,\n { newVersion: currentAddon.version });\n XPIProvider.unloadBootstrapScope(previousAddon.id);\n }\n\n // Make sure to flush the cache when an old add-on has gone away\n flushStartupCache();\n\n if (currentAddon.bootstrap) {\n // Visible bootstrapped add-ons need to have their install method called\n let file = Cc[\"@mozilla.org/file/local;1\"].createInstance(Ci.nsIFile);\n file.persistentDescriptor = currentAddon._sourceBundle.persistentDescriptor;\n XPIProvider.callBootstrapMethod(currentAddon, file,\n \"install\", installReason,\n { oldVersion: previousAddon.version });\n if (currentAddon.disabled)\n XPIProvider.unloadBootstrapScope(currentAddon.id);\n }\n }\n\n if (isActive != wasActive) {\n let change = isActive ? AddonManager.STARTUP_CHANGE_ENABLED\n : AddonManager.STARTUP_CHANGE_DISABLED;\n AddonManagerPrivate.addStartupChange(change, id);\n }\n }\n\n XPIDatabase.makeAddonVisible(currentAddon);\n currentAddon.active = isActive;\n\n // Make sure the bootstrap information is up to date for this ID\n if (currentAddon.bootstrap && currentAddon.active) {\n XPIProvider.bootstrappedAddons[id] = {\n version: currentAddon.version,\n type: currentAddon.type,\n descriptor: currentAddon._sourceBundle.persistentDescriptor,\n multiprocessCompatible: currentAddon.multiprocessCompatible,\n runInSafeMode: canRunInSafeMode(currentAddon),\n };\n }\n\n if (currentAddon.active && currentAddon.internalName == XPIProvider.selectedSkin)\n sawActiveTheme = true;\n }\n\n // Pass over the set of previously visible add-ons that have now gone away\n // and record the change.\n for (let [id, previousAddon] of previousVisible) {\n if (currentVisible.has(id))\n continue;\n\n // This add-on vanished\n\n // If the previous add-on was bootstrapped and still exists then call its\n // uninstall method.\n if (previousAddon.bootstrap && previousAddon._sourceBundle.exists()) {\n XPIProvider.callBootstrapMethod(previousAddon, previousAddon._sourceBundle,\n \"uninstall\", BOOTSTRAP_REASONS.ADDON_UNINSTALL);\n XPIProvider.unloadBootstrapScope(previousAddon.id);\n }\n AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_UNINSTALLED, id);\n\n // Make sure to flush the cache when an old add-on has gone away\n flushStartupCache();\n }\n\n // Make sure add-ons from hidden locations are marked invisible and inactive\n let locationAddonMap = currentAddons.get(hideLocation);\n if (locationAddonMap) {\n for (let addon of locationAddonMap.values()) {\n addon.visible = false;\n addon.active = false;\n }\n }\n\n // If a custom theme is selected and it wasn't seen in the new list of\n // active add-ons then enable the default theme\n if (XPIProvider.selectedSkin != XPIProvider.defaultSkin && !sawActiveTheme) {\n logger.info(\"Didn't see selected skin \" + XPIProvider.selectedSkin);\n XPIProvider.enableDefaultTheme();\n }\n\n // Finally update XPIStates to match everything\n for (let [locationName, locationAddonMap] of currentAddons) {\n for (let [id, addon] of locationAddonMap) {\n let xpiState = XPIStates.getAddon(locationName, id);\n xpiState.syncWithDB(addon);\n }\n }\n XPIStates.save();\n\n XPIProvider.persistBootstrappedAddons();\n\n // Clear out any cached migration data.\n XPIDatabase.migrateData = null;\n XPIDatabase.saveChanges();\n\n return true;\n }", "_initAddons() {\n //\tInvoke \"before\" hook.\n this.trigger('initAddons:before');\n for (let addon in Mmenu.addons) {\n Mmenu.addons[addon].call(this);\n }\n //\tInvoke \"after\" hook.\n this.trigger('initAddons:after');\n }", "updateFilesInRootDependecies() {\n const { outDir } = this.config;\n\n const filesInRootDist = getFilesFromFolder(outDir)\n .filter(file => !isMapFile(file))\n .map(file => path.join(outDir, file));\n\n for (const file of filesInRootDist) {\n const fileProcessor = new FileProcessor(\n file,\n '',\n this.depGraph,\n this.config\n );\n\n fileProcessor.updateDependecies();\n }\n }", "async populateArtifacts() {\n if (!this.scope) {\n // when capsules are written via the workspace, do not write artifacts, they get created by\n // build-pipeline. when capsules are written via the scope, we do need the dists.\n return;\n }\n\n const extensionsNamesForArtifacts = ['teambit.compilation/compiler'];\n const artifactsFiles = (0, _lodash().flatten)(extensionsNamesForArtifacts.map(extName => (0, _artifactFiles().getArtifactFilesByExtension)(this.component.extensions, extName)));\n const scope = this.scope;\n const artifactsVinylFlattened = [];\n await Promise.all(artifactsFiles.map(async artifactFiles => {\n if (!artifactFiles) return;\n\n if (!(artifactFiles instanceof _artifactFiles().ArtifactFiles)) {\n artifactFiles = (0, _artifactFiles().deserializeArtifactFiles)(artifactFiles);\n } // fyi, if this is coming from the isolator aspect, it is optimized to import all at once.\n // see artifact-files.importMultipleDistsArtifacts().\n\n\n const vinylFiles = await artifactFiles.getVinylsAndImportIfMissing(this.component.scope, scope);\n artifactsVinylFlattened.push(...vinylFiles);\n }));\n const artifactsDir = this.getArtifactsDir();\n\n if (artifactsDir) {\n artifactsVinylFlattened.forEach(a => a.updatePaths({\n newBase: artifactsDir\n }));\n }\n\n this.component.dataToPersist.addManyFiles(artifactsVinylFlattened);\n }", "findSimulatorAddons() {\n let deferred = promise.defer();\n AddonManager.getAllAddons(all => {\n let addons = [];\n for (let addon of all) {\n if (Simulators.isSimulatorAddon(addon)) {\n addons.push(addon);\n }\n }\n // Sort simulator addons by name.\n addons.sort(LocaleCompare);\n deferred.resolve(addons);\n });\n return deferred.promise;\n }", "function getDependencies() {\n logger.info('Fetching dependencies');\n return new Promise((resolve, reject) => {\n const dependencies = {};\n\n (0, _readPackageTree2.default)('./', (err, data) => {\n if (err) {\n logger.error('Error fetching dependencies');\n return reject(err);\n }\n const modules = data.children;\n const directDependencies = _extends({}, data.package.dependencies, data.package.devDependencies);\n\n modules.forEach(element => {\n const pkg = element.package;\n const version = pkg.version;\n\n let dependency;\n const direct = directDependencies[pkg.name] !== undefined;\n if (dependencies[pkg.name]) {\n dependency = dependencies[pkg.name];\n dependency.initializeDependency({ title: pkg.name, main_version: version, description: pkg.description, direct });\n } else {\n dependency = new _report_model.Dependency({ title: pkg.name, main_version: version, description: pkg.description, direct });\n dependencies[pkg.name] = dependency;\n }\n\n insertHierarchies(dependencies, { currentDependency: dependency, rptDependency: element, rootDependencies: modules });\n });\n\n logger.info('Finished fetching dependencies');\n\n resolve({ pkg: data.package, dependencies: Object.values(dependencies) });\n });\n });\n}", "async function cleanupAddons(start, end) {\n console.log(\"Start cleanup ...\");\n console.log(\"Initializing DBWriter ...\");\n\n await dbWriter.init();\n\n let all = await dbWriter.countAll();\n if (all < end) {\n end = all;\n }\n let total = end - start + 1;\n let addonList = await dbWriter.findAll();\n\n let remain = total;\n\n let deleted = 0;\n let clean = 0;\n let target = 0;\n let i = 0;\n\n console.log(\"Finding all DB records ...\");\n\n for (let addon = await addonList.next(); addon != null; addon = await addonList.next()) {\n let name = addon['bl_info']['name'];\n let key = addon['key'];\n\n // skip until start comes\n ++i;\n if (i < start) { continue; }\n\n // all addons are checked\n if (remain == 0) { break; }\n\n console.log(\"[\" + (target+1) + \"/\" + total + \"] Checking '\" + name + \"' ...\");\n --remain;\n ++target;\n\n // remove excluded add-ons\n console.log(\" Check: Excluded add-ons\");\n let srcDir = addon['src_dir'];\n // release add-on\n if (srcDir.match(/release\\/scripts\\/addons/)) {\n console.log(\" '\" + name + \"' is release add-on. Trying to delete from DB ...\");\n let ret = await dbWriter.remove({'key': key});\n ++deleted;\n continue;\n }\n // contrib add-on\n else if (srcDir.match(/scripts\\/addons_contrib/) || srcDir.match(/script\\/addons_contrib/)) {\n console.log(\" '\" + name + \"' is contrib add-on. Trying to delete from DB ...\");\n let ret = await dbWriter.remove({'key': key});\n ++deleted;\n continue;\n }\n // extern add-on (meta-androcto's add-on database)\n else if (srcDir.match(/scripts\\/addons_extern/)) {\n console.log(\" '\" + name + \"' is meta-androcto's add-on database. Trying to delete from DB ...\");\n let ret = await dbWriter.remove({'key': key});\n ++deleted;\n continue;\n }\n // test add-on (Nutti's test or sample add-on)\n else if (srcDir.match(/mirror-introduction/)\n || srcDir.match(/Testing_Blender_Addon_By_Travis_CI/)\n || srcDir.match(/Testing_Blender_Addon_With_Travis_CI/)\n || srcDir.match(/gitbook-test/)) {\n console.log( \"'\" + name + \"' is Nutti's test or sample add-on. Trying to delete from DB ...\");\n let ret = await dbWriter.remove({'key': key});\n ++deleted;\n continue;\n }\n\n // check if repository URL is linked down\n console.log(\" Check: Repository URL link\");\n let repoURL = addon['url'];\n let isDown = await isLinkDown(repoURL);\n if (isDown) {\n console.log(\" '\" + name + \"' (Repository URL: \" + repoURL + \") is link down. Trying to delete from DB ...\");\n let ret = await dbWriter.remove({'key': key});\n ++deleted;\n continue;\n }\n\n // check if source URL is linked down\n console.log(\" Check: Source URL link\");\n let srcURL = addon['src_url'];\n isDown = await isLinkDown(srcURL);\n if (isDown) {\n console.log(\" '\" + name + \"' (Source URL: \" + srcURL + \") is link down. Trying to delete from DB ...\");\n let ret = await dbWriter.remove({'key': key});\n ++deleted;\n continue;\n }\n\n // check if bl_info is correct\n console.log(\" Check: Source Raw URL link\");\n let srcRawURL = addon['src_raw_url'];\n isDown = await isLinkDown(srcRawURL);\n if (isDown) {\n console.log(\" '\" + name + \"' (Source Raw URL: \" + srcRawURL + \") is link down. Trying to delete from DB ...\");\n let ret = await dbWriter.remove({'key': key});\n ++deleted;\n continue;\n }\n console.log(\" Check: bl_info\");\n let valid = await blamDB.isBlInfoValid(srcRawURL);\n if (!valid) {\n console.log(\" '\" + name + \"' has an invalid bl_info. Trying to delete from DB ...\");\n let ret = await dbWriter.remove({'key': key});\n ++deleted;\n continue;\n }\n\n ++clean;\n }\n\n console.log(\"Finished cleanup (total: \" + total + \", target: \" + target + \", clean: \" + clean + \", deleted: \" + deleted + \")\");\n\n dbWriter.close();\n}", "async function findDepUpgrades(dep) {\n const npmDependency = await npmApi.getDependency(dep.depName);\n const upgrades =\n await versionsHelper.determineUpgrades(npmDependency, dep.currentVersion, config);\n if (upgrades.length > 0) {\n logger.verbose(`${dep.depName}: Upgrades = ${JSON.stringify(upgrades)}`);\n upgrades.forEach((upgrade) => {\n allUpgrades.push(Object.assign({}, dep, upgrade));\n });\n } else {\n logger.verbose(`${dep.depName}: No upgrades required`);\n }\n }", "function exportTracker() {\n\t/*\n\tOnly data element in datasets included. Include config option for \"placeholder\"\n\tdatasets that is only used to get dependencies, but where the actual dataset is not \n\tincluded in the export file. This also includes other data elements used in \n\tindicators, like those for population.\n\t\n\tFavourites and indicator formulas should still be checked for data elements, \n\tcategory option groups, legend sets etc. For legend sets, category option groups etc\n\tthey should be included, but for data elements we should only show a warning that \n\tthey need to be added to a data set to be included.\n\t*/\n\n\n\tconsole.log(\"1. Downloading metadata\");\n\n\t//Do initial dependency export\n\tvar promises = [];\n\tif( currentExport.programIds ) promises.push( dependencyExport(\"program\", currentExport.programIds) );\n\tif( currentExport.dashboardIds ) promises.push( dependencyExport(\"dashboard\", currentExport.dashboardIds) );\n\tif( currentExport.customObjects ) promises.push( customObjects() );\n\n\tQ.all(promises).then(function (results) {\n\n\n\t\t//Get indicators and categoryOptionGroupSets from favourites and groups\n\t\t//Get validation rules and groups from conf file\n\t\t//Get data element and indicator groups from conf files\n\t\tpromises = [\n\t\t\tindicators(),\n\t\t\tcategoryOptionGroupSetStructure(),\n\t\t\tsaveObject(\"dataElementGroups\", currentExport.dataElementGroupIds),\n\t\t\tsaveObject(\"indicatorGroups\", currentExport.indicatorGroupIds),\n\t\t\tsaveObject(\"programIndicatorGroups\", currentExport.programIndicatorGroupIds),\n\t\t\tuserGroups(),\n\t\t\tusers()\n\t\t];\n\t\tQ.all(promises).then(function (results) {\n\n\t\t\t//Get legends from data elements, indicators and favourites\n\t\t\t//Get indicator types from indicators\n\t\t\t//Get predictors based on data elements\n\t\t\tpromises = [\n\t\t\t\tindicatorTypes(),\n\t\t\t\tlegendSets(),\n\t\t\t\tpredictors()\n\t\t\t];\n\t\t\tQ.all(promises).then(function (results) {\n\n\t\t\t\tprocessTracker();\n\n\t\t\t})\n\t\t\t.catch(function (err) {\n\t\t\t\tconsole.error('An error occured in processTracker():');\n\t\t\t\tconsole.error(err);\n\t\t\t});\n\n\t\t});\n\n\t}, function(fail){\n\t\tconsole.log(\"Fail2:\" + fail );\n\t});\n\n}", "function watchForInstalledAddon() {\n const watchedEls = document.querySelectorAll(\"firefox-private-relay-addon, .relay-email-address-note\");\n const observerConfig = {\n attributes: true,\n childList: true, // catches legacy addons modifying .relay-email-address-note els\n\t};\n\n const patrollerDuties = (mutations, mutationPatroller) => {\n for (const mutation of mutations) {\n // handle legacy addon labeling\n if (mutation.type === \"childList\" && mutation.target.classList.contains(\"relay-email-address-note\")) {\n handleLegacyAddonLabels(mutation.target);\n }\n }\n\t};\n\n const mutationPatroller = new MutationObserver(patrollerDuties);\n watchedEls.forEach(watchedEl => {\n mutationPatroller.observe(watchedEl, observerConfig);\n });\n}", "updateAllExtensions(force){\n\t\t_migrationService.getList('extension').then(extensionList =>{\n\t\t\t// run updates sequentially to minimize engine load\n\t\t\textensionList.reduce((promise, extension) => promise.then(() =>{\n\t\t\t\tconst qExtendsId = extension.properties ? extension.properties.qExtendsId : undefined;\n\n\t\t\t\t// check if update was already performed\n\t\t\t\tif(_updatedObjectIds.indexOf(qExtendsId || extension.id) === -1){\n\n\t\t\t\t\t// in case we have a master item, we need to get the sourceObject before we trigger the update\n\t\t\t\t\tif(qExtendsId){\n\t\t\t\t\t\treturn _qlikService.getMasterObjectProperties(extension)\n\t\t\t\t\t\t\t.then(sourceObject => this.checkUpdates(sourceObject, force))\n\t\t\t\t\t\t\t.catch(err => Logger.warn('Update failed', err));\n\t\t\t\t\t}\n\n\t\t\t\t\t// update normal extension\n\t\t\t\t\treturn this.checkUpdates(extension, force).catch(err => Logger.warn('Update failed', err));\n\t\t\t\t}\n\t\t\t}), Promise.resolve());\n\t\t})\n\t}", "async getAllChildLoaders(selector) {\n return (await this.getAllRawElements(selector)).map(e => this.createEnvironment(e));\n }", "getVisibleAddons(addonMap) {\n let map = new Map();\n\n for (let [location, addons] of addonMap) {\n for (let [id, addon] of addons) {\n if (!addon.visible)\n continue;\n\n if (map.has(id)) {\n logger.warn(\"Previous database listed more than one visible add-on with id \" + id);\n continue;\n }\n\n map.set(id, addon);\n }\n }\n\n return map;\n }", "function discover() {\n let path = process.cwd();\n let previous;\n do {\n const modules = Path.join(path, \"node_modules\");\n if (FS.existsSync(modules) && FS.statSync(modules).isDirectory()) {\n discoverModules(modules);\n }\n previous = path;\n path = Path.resolve(Path.join(previous, \"..\"));\n } while (previous !== path);\n }", "function updateOwnDeps () {\n tools.updateOwnDependenciesFromLocalRepositories(args.depth);\n}", "detectCycles() {\n\t\t\tconst flatOrder = Array.from(this.orderedNodes);\n\n\t\t\tfor (let i = 0; i < flatOrder.length; i++) {\n\t\t\t\tconst node = flatOrder[i];\n\n\t\t\t\tfor (const imp of node.analyze.value.importFirstUsage) {\n\t\t\t\t\tconst subnode = node.getNodeFromRelativeDependency(imp.source);\n\t\t\t\t\tif (subnode === undefined) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst resolved = subnode.resolveImport(imp.imported, imp.loc);\n\t\t\t\t\tif (resolved.type !== \"FOUND\") {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Hoisted exports will always be accessible\n\t\t\t\t\tif (resolved.record.valueType === \"function\") {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst dep = resolved.node;\n\n\t\t\t\t\tconst isBefore = flatOrder.indexOf(dep) > i;\n\t\t\t\t\tif (isBefore) {\n\t\t\t\t\t\tthis.flagCycle(node, dep, imp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function processDependencies(dependencies, components, exclude) {\n Object.keys(dependencies).forEach(function(key) {\n grunt.log.debug(\"Obtaining package version for \" + key);\n\n var dependency = dependencies[key];\n var pkgMeta = dependency.pkgMeta;\n\n if(exclude.indexOf(pkgMeta.name) > -1) {\n grunt.log.ok('Excluding component: ' + pkgMeta.name);\n return;\n }\n\n var componentData = {};\n componentData['version'] = pkgMeta.version;\n componentData['directory'] = dependency.canonicalDir;\n components[pkgMeta.name] = componentData;\n\n grunt.log.debug(key + \" - version: \" + componentData['version'] + \" directory: \" + componentData['directory']);\n\n processDependencies(dependency.dependencies, components, exclude);\n });\n }", "async function findUpgrades(config) {\n logger = config.logger || logger;\n if (config.enabled === false) {\n logger.debug('package is disabled');\n return [];\n }\n // Check schedule\n if (config.schedule && !schedule.isScheduledNow(config)) {\n logger.debug('Skipping package as it is not scheduled');\n return [];\n }\n const npmDep = await npmApi.getDependency(config.depName, logger);\n // If dependency lookup fails then warn and return\n if (!npmDep) {\n logger.warn(`Failed to look up dependency ${config.depName}`);\n return [];\n }\n const upgrades = await versions.determineUpgrades(npmDep, config);\n if (upgrades.length > 0) {\n logger.info(\n { dependency: config.depName },\n `${upgrades.length} upgrade(s) available: ${upgrades.map(\n upgrade => upgrade.newVersion\n )}`\n );\n } else {\n logger.debug(`${config.depName}: No upgrades required`);\n }\n // Flatten the upgrade on top of config, add repositoryUrl\n return upgrades.map(upgrade =>\n configParser.mergeChildConfig(config, upgrade, {\n repositoryUrl: npmDep.repositoryUrl,\n })\n );\n}", "function setupUI(aFailDownloads, aFailInstalls, aCallback) {\n if (gProvider)\n gProvider.unregister();\n\n gProvider = new MockProvider();\n\n for (var i = 1; i < 5; i++) {\n var addon = new MockAddon(\"test\" + i + \"@tests.mozilla.org\",\n \"Test Add-on \" + i, \"extension\");\n addon.version = \"1.0\";\n addon.userDisabled = (i > 2);\n addon.appDisabled = false;\n addon.isActive = !addon.userDisabled && !addon.appDisabled;\n\n addon.findUpdates = function(aListener, aReason, aAppVersion, aPlatformVersion) {\n var newAddon = new MockAddon(this.id, this.name, \"extension\");\n newAddon.version = \"2.0\";\n var install = new MockInstall(this.name, this.type, newAddon);\n install.existingAddon = this;\n\n install.install = function() {\n this.state = AddonManager.STATE_DOWNLOADING;\n this.callListeners(\"onDownloadStarted\");\n\n var self = this;\n executeSoon(function() {\n if (aFailDownloads) {\n self.state = AddonManager.STATE_DOWNLOAD_FAILED;\n self.callListeners(\"onDownloadFailed\");\n return;\n }\n\n self.type = self._type;\n self.addon = new MockAddon(self.existingAddon.id, self.name, self.type);\n self.addon.version = self.version;\n self.addon.pendingOperations = AddonManager.PENDING_INSTALL;\n self.addon.install = self;\n\n self.existingAddon.pendingUpgrade = self.addon;\n self.existingAddon.pendingOperations |= AddonManager.PENDING_UPGRADE;\n\n self.state = AddonManager.STATE_DOWNLOADED;\n self.callListeners(\"onDownloadEnded\");\n\n self.state = AddonManager.STATE_INSTALLING;\n self.callListeners(\"onInstallStarted\");\n\n if (aFailInstalls) {\n self.state = AddonManager.STATE_INSTALL_FAILED;\n self.callListeners(\"onInstallFailed\");\n return;\n }\n\n self.state = AddonManager.STATE_INSTALLED;\n self.callListeners(\"onInstallEnded\");\n });\n }\n\n aListener.onUpdateAvailable(this, install);\n\n aListener.onUpdateFinished(this, AddonManager.UPDATE_STATUS_NO_ERROR);\n };\n\n gProvider.addAddon(addon);\n }\n\n gWin = Services.ww.openWindow(null,\n \"chrome://mozapps/content/extensions/selectAddons.xul\",\n \"\",\n \"chrome,centerscreen,dialog,titlebar\",\n null);\n waitForFocus(function() {\n waitForView(\"select\", function() {\n var row = gWin.document.getElementById(\"select-rows\").firstChild.nextSibling;\n while (row) {\n if (!row.id || row.id.indexOf(\"@tests.mozilla.org\") < 0) {\n // not a test add-on\n row = row.nextSibling;\n continue;\n }\n\n if (row.id == \"[email protected]\" ||\n row.id == \"[email protected]\") {\n row.disable();\n }\n else {\n row.keep();\n }\n row = row.nextSibling;\n }\n\n waitForView(\"confirm\", function() {\n waitForView(\"update\", aCallback);\n EventUtils.synthesizeMouseAtCenter(gWin.document.getElementById(\"next\"), {}, gWin);\n });\n EventUtils.synthesizeMouseAtCenter(gWin.document.getElementById(\"next\"), {}, gWin);\n });\n }, gWin);\n}", "xdnDevDependencies() {\n return Object.entries(this.find('devDependencies', {})).filter(([name]) => name.startsWith(this.XDN_PACKAGE_PREFIX));\n }", "dependencies(){\n for(let key in this.plugins){\n \tlet plugin = this.plugins[key],\n \t \t\tdependencies = {server: this.server};\n \tfor(let keyDep in plugin.props.dependencies){\n dependencies[plugin.props.dependencies[keyDep]] = this.plugins[this.pointPlugin[plugin.props.conf.name]];\n \t}\n \tplugin.setDependencies(dependencies);\n }\n }", "updateActiveAddons() {\n logger.debug(\"Updating add-on states\");\n for (let [, addon] of this.addonDB) {\n let newActive = (addon.visible && !addon.disabled && !addon.pendingUninstall);\n if (newActive != addon.active) {\n addon.active = newActive;\n this.saveChanges();\n }\n }\n\n Services.prefs.setBoolPref(PREF_PENDING_OPERATIONS, false);\n }", "allAvailablePokemon() {\n const encounterInfo = this.allAvailableShadowPokemon();\n // Handling minions\n this.enemyList.forEach((enemy) => {\n var _a;\n // Handling Pokemon\n if (typeof enemy === 'string' || enemy.hasOwnProperty('pokemon')) {\n let pokemonName;\n if (enemy.hasOwnProperty('pokemon')) {\n // Check if requirements have been met\n if ((_a = enemy.options) === null || _a === void 0 ? void 0 : _a.requirement) {\n if (!enemy.options.requirement.isCompleted()) {\n return;\n }\n }\n pokemonName = enemy.pokemon;\n }\n else {\n pokemonName = enemy;\n }\n encounterInfo.push(pokemonName);\n // Handling Trainers\n }\n else { /* We don't include Trainers */ }\n });\n // Handling Bosses\n this.bossList.forEach((boss) => {\n var _a;\n // Handling Pokemon\n if (boss instanceof DungeonBossPokemon) {\n if ((_a = boss.options) === null || _a === void 0 ? void 0 : _a.requirement) {\n if (!boss.options.requirement.isCompleted()) {\n return;\n }\n }\n const pokemonName = boss.name;\n encounterInfo.push(pokemonName);\n // Handling Trainer\n }\n else { /* We don't include Trainers */ }\n });\n this.getCaughtMimics().forEach((mimic) => encounterInfo.push(mimic));\n return encounterInfo;\n }", "function discoverModules(basePath) {\n const candidates = [];\n FS.readdirSync(basePath).forEach((name) => {\n const dir = Path.join(basePath, name);\n if (name.startsWith(\"@\") && FS.statSync(dir).isDirectory()) {\n FS.readdirSync(dir).forEach((n) => {\n candidates.push(Path.join(name, n));\n });\n }\n candidates.push(name);\n });\n candidates.forEach((name) => {\n const infoFile = Path.join(basePath, name, \"package.json\");\n if (!FS.existsSync(infoFile)) {\n return;\n }\n const info = loadPackageInfo(app.logger, infoFile);\n if (isPlugin(info)) {\n result.push(Path.join(basePath, name));\n }\n });\n }", "function traverse(config, dependencies, bindings, root, visit) {\n // a stack\n var stack = new Array();\n stack.push(root);\n\n while (stack.length > 0) {\n var plugin = stack.pop();\n\n visit(config[plugin]);\n\n // get all children\n if (!dependencies.hasOwnProperty(plugin)) {\n console.error('Could not find plugin', plugin);\n break;\n }\n var consumes = dependencies[plugin];\n\n for (var i = 0; i < consumes.length; i++) {\n if (!bindings.hasOwnProperty(consumes[i]) || bindings[consumes[i]].length == 0) {\n console.error('Could not find service implementation', consumes[i]);\n break;\n }\n\n stack.push(bindings[consumes[i]][0]);\n }\n }\n}", "function _eachDependencies( packageName, bowerJson, packageFunc, options, packageList, firstLevel, dotBowerJson ){\n\t\tvar dependenciesPackageName,\n\t\t\t\tdependencies = bowerJson.dependencies || dotBowerJson.dependencies || {};\n\n\t\tpackageFunc(packageName, bowerJson, options, firstLevel, dotBowerJson);\n\n\t\t//Find dependencies\n\t\tfor (dependenciesPackageName in dependencies)\n\t\t\tif ( dependencies.hasOwnProperty(dependenciesPackageName) ){\n\t\t\t\t//If the package already has been check => continue\n\t\t\t\tif (packageList[ dependenciesPackageName ])\n\t\t\t\t continue;\n\t\t\t\tpackageList[ dependenciesPackageName ] = true;\n\n\t\t\t\t//Read the dependences of the package\n\t\t\t\t_eachDependencies(\n\t\t\t\t\tdependenciesPackageName,\n\t\t\t\t\treadJSONFile('bower_components/' + dependenciesPackageName + '/bower.json'),\n\t\t\t\t\tpackageFunc,\n\t\t\t\t\toptions,\n\t\t\t\t\tpackageList,\n\t\t\t\t\tfalse,\n\t\t\t\t\treadJSONFile('bower_components/' + dependenciesPackageName + '/.bower.json')\n\t\t\t\t);\n\t\t}\n\t}", "availableBosses(includeTrainers = true, ignoreRequirement = false) {\n // TODO: HLXII - We need this check as this method is called somewhere during initialization when App isn't initialized yet\n // the requirement.isCompleted call can sometimes use the App object, which will cause this to crash\n // Once App is moved to modules, this check might be able to be removed.\n if (!App.game) {\n return [];\n }\n if (includeTrainers) {\n return this.bossList.filter(boss => {\n var _a;\n return (!ignoreRequirement && ((_a = boss.options) === null || _a === void 0 ? void 0 : _a.requirement)) ? boss.options.requirement.isCompleted() : true;\n });\n }\n else {\n return this.bossList.filter(b => {\n var _a;\n if (b instanceof DungeonBossPokemon) {\n return (!ignoreRequirement && ((_a = b.options) === null || _a === void 0 ? void 0 : _a.requirement)) ? b.options.requirement.isCompleted() : true;\n }\n return false;\n }).map(b => b);\n }\n }", "function discover(...moduleDirs) {\n var _a, _b, _c, _d;\n const jsii = {};\n const discoverJsii = (dir) => {\n const jsiiFile = path.join(dir, '.jsii');\n if (!fs.existsSync(jsiiFile)) {\n return;\n } // no jsii manifest\n const manifest = fs.readJsonSync(jsiiFile);\n for (const [fqn, type] of Object.entries(manifest.types)) {\n jsii[fqn] = type;\n }\n };\n // read all .jsii manifests from all modules (incl. projen itself) and merge\n // them all into a single map of fqn->type.\n for (const dir of [...moduleDirs, PROJEN_MODULE_ROOT]) {\n discoverJsii(dir);\n if (dir.includes('@') && fs.lstatSync(dir).isDirectory()) {\n const childDirs = fs.readdirSync(dir).map(file => path.join(dir, file));\n for (const child of childDirs) {\n discoverJsii(child);\n }\n }\n }\n const result = new Array();\n for (const [fqn, typeinfo] of Object.entries(jsii)) {\n if (!isProjectType(jsii, fqn)) {\n continue;\n }\n // projen.web.ReactProject -> web.ReactProject\n const typename = fqn.substring(fqn.indexOf('.') + 1);\n const docsurl = `https://github.com/projen/projen/blob/master/API.md#projen-${typename.toLocaleLowerCase()}`;\n let pjid = (_c = (_b = (_a = typeinfo.docs) === null || _a === void 0 ? void 0 : _a.custom) === null || _b === void 0 ? void 0 : _b.pjid) !== null && _c !== void 0 ? _c : decamelize(typename).replace(/_project$/, '');\n result.push({\n moduleName: typeinfo.assembly,\n typename,\n pjid,\n fqn,\n options: discoverOptions(jsii, fqn).sort((o1, o2) => o1.name.localeCompare(o2.name)),\n docs: (_d = typeinfo.docs) === null || _d === void 0 ? void 0 : _d.summary,\n docsurl,\n });\n }\n return result.sort((r1, r2) => r1.pjid.localeCompare(r2.pjid));\n}", "findEntryPoints() {\n const unsortedEntryPoints = [];\n for (const basePath of this.basePaths) {\n const entryPoints = this.entryPointManifest.readEntryPointsUsingManifest(basePath) ||\n this.walkBasePathForPackages(basePath);\n entryPoints.forEach(e => unsortedEntryPoints.push(e));\n }\n return this.resolver.sortEntryPointsByDependency(unsortedEntryPoints);\n }", "function dependOn() {\n 'use strict';\n return [\n require(\"util\"),\n require(\"common\"),\n require(\"analytics\"),\n require(\"proxy\")\n ];\n}", "loadAll() {\n logger.info(`Loading plugins...`);\n\n const pluginPath = path.join(__dirname, '..', '..', 'plugins');\n if (!fse.existsSync(pluginPath)) {\n fse.emptyDirSync(pluginPath);\n logger.error(`Plugin directory not found! Creating one...`);\n process.exit(0);\n }\n\n const plugins = this.constructor._read(pluginPath);\n for (const plugin of plugins) this._registerPlugin(require(plugin));\n\n this._emitCommandsd();\n logger.info(`Loaded ${this.plugins.size} plugin(s)!`);\n }", "treeForAddon(tree) {\n const resultingTree = this._mergeTrees(\n tree,\n this._generateTreeForEmojiDefinitions(),\n this._generateTreeForConfig()\n );\n\n return this._super.treeForAddon.call(this, resultingTree);\n }", "async populateFlattenedDependencies() {\n _logger().default.debug(`populateFlattenedDependencies starts with ${this.components.length} components`);\n\n this.createGraphs(this.components);\n await this.importExternalDependenciesInBulk();\n await (0, _pMapSeries().default)(this.components, async component => {\n component.flattenedDependencies = await this.getFlattened(component.id);\n });\n }", "children() {\n\t\treturn Object.values(this[_impls]);\n\t}", "function loadAllAvailableLibraries() {\n\n\t\t// We have a list of known libraries (in the bootstrap) that have to be checked. This list will be dynamically extended below with any new libraries. This static list here is just for fallback purposes.\n\t\tvar mLoadedLibraries = Library.all();\n\n\t\t// Maybe libraries have been added, so discover what is available in order to also test them. But only do this when we are in sapui5.runtime layer, not when this test is executed in dist layer.\n\t\treturn VersionInfo.load().then(function(oInfo) {\n\t\t\treturn Promise.all(\n\t\t\t\toInfo.libraries.map(function(oLibInfo) {\n\t\t\t\t\tvar sInfoLibName = oLibInfo.name;\n\n\t\t\t\t\t// only load known libraries, we won't test others\n\t\t\t\t\tif (!aKnownLibraries.includes(sInfoLibName)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!mLoadedLibraries[sInfoLibName]) {\n\t\t\t\t\t\tLog.info(\"Library '\" + sInfoLibName + \"' is not loaded! Trying...\");\n\t\t\t\t\t\treturn sap.ui.getCore().loadLibrary(sInfoLibName, {async: true})\n\t\t\t\t\t\t\t.then(function(oLibrary) {\n\t\t\t\t\t\t\t\tmLoadedLibraries[sInfoLibName] = oLibrary.controls;\n\t\t\t\t\t\t\t\tLog.info(\"Library '\" + sInfoLibName + \"...successfully.\");\n\t\t\t\t\t\t\t}, function(err) {\n\t\t\t\t\t\t\t\t// not a control lib? This happens for e.g. \"sap.ui.server.java\"...\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmLoadedLibraries[sInfoLibName] = mLoadedLibraries[sInfoLibName].controls; // only the control list is needed\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t}).then(function() {\n\t\t\treturn mLoadedLibraries;\n\t\t});\n\t}", "function processChildIndicators(indis) {\n\tvar indiNodes = [];\n\t$(indis).each(function (index, indi) {\n\t\tvar idRef = getObjIdRefStr($(xpFindSingle(STIXPattern.indi, indi)));\n\t\tif (idRef != \"\") {\n\t\t\tindiNodes.push(createTopDownIdRef(STIXType.indi, idRef));\n\t\t}\n\t});\n return indiNodes;\n}", "async function setup() {\n\n\t// Get the manifest data: names of all interface elements, levels, enemies, and towers\n\t// Await keyword is used to force execution to wait until getJSON is resolved\n\tawait $.getJSON(\"manifest.json\", function(json){\n\t\tgameInfo.manifest = json;\n\t});\n\n\t// Next the level data is added to gameInfo\n\tgameInfo.levels = [];\n\tfor (let levelName of gameInfo.manifest.levels) {\n\t\t// For every level listed in the manifest\n\t\tvar levelFile = gameInfo.manifest.levelsDir + \"/\" + levelName + \"/info.json\";\n\t\t// Get the info.JSON file for that level and add the data to gameInfo\n\t\tawait $.getJSON(levelFile, function(levelData){\n\t\t\tgameInfo.levels[levelData.name] = levelData;\n\t\t\tlevelName = levelData.name;\n\t\t});\n\n\t\t// The background sprite for the level is created and stored\n\t\tgameInfo.levels[levelName].background = game.sprite(gameInfo.levels[levelName].backgroundSource);\n\t\tgameInfo.levels[levelName].background.visible = false;\n\t\t// The no-build areas are stored as a list of rectangles\n\t\tgameInfo.levels[levelName].noBuildRegions = [];\n\t\tfor (let zone of gameInfo.levels[levelName].noBuildAreas) {\n\t\t\tlet noBuildBox = game.rectangle(zone[2], zone[3]);\n\t\t\tnoBuildBox.setPosition(zone[0], zone[1]);\n\t\t\tnoBuildBox.visible = false;\n\t\t\tgameInfo.levels[levelName].noBuildRegions.push(noBuildBox);\n\t\t}\n\t}\n\t\n\t// Next the enemy data is added to gameInfo\n\tgameInfo.enemies = [];\n\tfor (let enemyName of gameInfo.manifest.enemies) {\n\t\t// For every enemy listed in the manifest \n\t\tvar enemyFile = gameInfo.manifest.enemiesDir + \"/\" + enemyName + \"/info.json\";\n\t\t// Get the info.JSON file for that enemy and add the data to gameInfo\n\t\tawait $.getJSON(enemyFile, function(enemyData){\n\t\t\tgameInfo.enemies[enemyData.name] = enemyData;\n\t\t\tenemyName = enemyData.name;\n\t\t});\n\t\t\n\t\t// The animation sprite strips for the enemy are all added to an array of textures\n\t\tvar enemyStrips = [];\n\t\tfor (let animStrip of gameInfo.enemies[enemyName].animations) {\n\t\t\tvar enemyTexture = game.filmstrip(animStrip.source, animStrip.frameWidth, animStrip.frameHeight);\n\t\t\tenemyStrips = enemyStrips.concat(enemyTexture);\n\t\t}\n\t\t// The finished texture array will be used later to initialize sprites for the enemy\n\t\tgameInfo.enemies[enemyName].animations[\"fullTexture\"] = enemyStrips;\n\t}\n\n\t// Next the tower data is added to gameInfo\n\tgameInfo.towers = [];\n\tfor (let towerName of gameInfo.manifest.towers) {\n\t\t// For every tower listed in the manifest\n\t\tvar towerFile = gameInfo.manifest.towersDir + \"/\" + towerName + \"/info.json\";\n\t\t// Get the info.JSON file for that tower and add the data to gameInfo\n\t\tawait $.getJSON(towerFile, function(towerData){\n\t\t\tgameInfo.towers[towerData.name] = towerData;\n\t\t\ttowerName = towerData.name;\n\t\t});\n\n\t\t// The animation sprite strips for the tower are all added to an array of textures\n\t\tvar towerStrips = [];\n\t\tfor (let animStrip of gameInfo.towers[towerName].animations) {\n\t\t\tvar towerTexture = game.filmstrip(animStrip.source, animStrip.frameWidth, animStrip.frameHeight);\n\t\t\ttowerStrips = towerStrips.concat(towerTexture);\n\t\t}\n\t\t// The finished texture array will be used later to initialize sprites for the tower\n\t\tgameInfo.towers[towerName].animations[\"fullTexture\"] = towerStrips;\n\t\t// Towers start out as locked / unavailable\n\t\tgameInfo.towers[towerName].locked = true;\n\t}\n\t\n\t// Next the level select page is setup\n\tgameInfo.levelSelectGroup = game.group();\n\tgameInfo.levelSelectInteractive = [];\n\tlet levelSelectBackground = game.sprite(\"resources/interface/levelselectbackground.png\");\n\tgameInfo.levelSelectGroup.addChild(levelSelectBackground);\n\t\n\t// Set up the button to play each level\n\tfor (let level in gameInfo.levels) {\n\t\tlevel = gameInfo.levels[level];\n\t\tlet levelButton = game.sprite(level.buttonSource);\n\t\t// Level button will be revealed after the level is unlocked\n\t\tlevelButton.alpha = 0;\n\t\tlevelButton.level = level.name;\n\t\tlevelButton.interact = true;\n\t\t// Function for when button is clicked and released\n\t\tlevelButton.release = () => {\n\t\t\tinitLevel(levelButton.level);\n\t\t\tgameInfo.characters[\"Toadsworth\"].sprite.speechRight.visible = false;\n\t\t\tgameInfo.characters[\"Toadsworth\"].sprite.maxTipIndex = 0;\n\t\t\tlevelButton.tint = 0xFFFFFF;\n\t\t\tchangeScenes(gameInfo.levelSelectGroup, gameInfo.levelSelectInteractive, gameInfo.levelInterfaceGroup, gameInfo.levelInterfaceInteractive, function(){\n\t\t\t\tgame.state = play;\n\t\t\t});\n\t\t};\n\t\t// Function for when mouse is over the button\n\t\tlevelButton.over = () => {\n\t\t\tlevelButton.tint = 0xFFFF99;\n\t\t};\n\t\t// Function for when mouse leaves the button\n\t\tlevelButton.out = () => {\n\t\t\tlevelButton.tint = 0xFFFFFF;\n\t\t};\n\t\tgameInfo.levelSelectGroup.addChild(levelButton);\n\t\t//gameInfo.levelSelectInteractive.push(levelButton);\n\t\tlevelButton.interact = false;\n\t\tlevelButton.setPosition(level.buttonPosition[0], level.buttonPosition[1]);\n\t\tlevel.buttonSprite = levelButton;\n\t}\n\tgameInfo.levelSelectGroup.visible = false;\n\t//levelButtons.visible = false;\n\t\n\t// Next the cutscene character data is added to gameInfo\n\t// The backgrounds for the different cutscenes are initialized as sprites and stored\n\tgameInfo.sceneSprites = [];\n\tgameInfo.sceneSprites[\"Gardener\"] = game.group(game.sprite(\"resources/interface/cutsceneBG1.png\"));\n\tgameInfo.sceneSprites[\"Gardener\"].visible = false;\n\tgameInfo.sceneSprites[\"Sorceress\"] = game.group(game.sprite(\"resources/interface/cutsceneBG2.png\"));\n\tgameInfo.sceneSprites[\"Sorceress\"].visible = false;\n\tgameInfo.sceneSprites[\"Engineer\"] = game.group(game.sprite(\"resources/interface/cutsceneBG2.png\"));\n\tgameInfo.sceneSprites[\"Engineer\"].visible = false;\n\tgameInfo.sceneSprites[\"Victory\"] = game.group(game.sprite(\"resources/interface/cutsceneBG2.png\"));\n\tgameInfo.sceneSprites[\"Victory\"].visible = false;\n\t// The character sprites are created and stored\n\tgameInfo.characters = [];\n\tfor (let characterName of gameInfo.manifest.characters) {\n\t\t// For every character listed in the manifest \n\t\tvar characterFile = gameInfo.manifest.charactersDir + \"/\" + characterName + \"/info.json\";\n\t\t// Get the info.JSON file for that character and add the data to gameInfo\n\t\tawait $.getJSON(characterFile, function(characterData){\n\t\t\tgameInfo.characters[characterData.name] = characterData;\n\t\t\tcharacterName = characterData.name;\n\t\t});\n\t\t\n\t\t// The animation sprite strips for the character are all added to an array of textures\n\t\tvar characterStrips = [];\n\t\tfor (let animStrip of gameInfo.characters[characterName].animations) {\n\t\t\tvar characterTexture = game.filmstrip(animStrip.source, animStrip.frameWidth, animStrip.frameHeight);\n\t\t\tcharacterStrips = characterStrips.concat(characterTexture);\n\t\t}\n\t\t// The finished texture array will be used to initialize sprites for the character\n\t\tgameInfo.characters[characterName].animations[\"fullTexture\"] = characterStrips;\n\t\tlet characterInfo = gameInfo.characters[characterName];\n\t\tcharacterInfo.sprite = game.sprite(characterInfo.animations[\"fullTexture\"]);\n\t\tcharacterInfo.sprite.setPosition(-100, -100);\n\t\tcharacterInfo.sprite.lines = characterInfo.lines;\n\t\tcharacterInfo.sprite.offsets = characterInfo.speechBubbleOffsets;\n\t\tcharacterInfo.sprite.states = {};\n\t\t// For each animation the character has\n\t\tfor (let animation of characterInfo.animations) {\n\t\t\t// Specify its name and the frames it uses\n\t\t\tcharacterInfo.sprite.states[animation.name] = animation.frameSpan;\n\t\t}\n\t\t// Speech bubble sprites are created for each character; Toadsworth uses a special speech bubble\n\t\tif (!(characterInfo.name == \"Toadsworth\")) {\n\t\t\tlet speechRight = game.sprite(\"resources/interface/speechRight.png\");\n\t\t\tlet speechTextRight = new PIXI.Text(\"\", {font: '12px Arial', fill: 'black', wordWrap: true, wordWrapWidth: 196});\n\t\t\tspeechTextRight.anchor.x = 0.5;\n\t\t\tspeechTextRight.anchor.y = 0.5;\n\t\t\tspeechTextRight.x = speechRight.centerX;\n\t\t\tspeechTextRight.y = speechRight.centerY - 8;\n\t\t\tlet speechLeft = game.sprite(\"resources/interface/speechLeft.png\");\n\t\t\tlet speechTextLeft = new PIXI.Text(\"\", {font: '12px Arial', fill: 'black', wordWrap: true, wordWrapWidth: 196});\n\t\t\tspeechTextLeft.anchor.x = 0.5;\n\t\t\tspeechTextLeft.anchor.y = 0.5;\n\t\t\tspeechTextLeft.x = speechLeft.centerX;\n\t\t\tspeechTextLeft.y = speechLeft.centerY - 8;\n\t\t\tcharacterInfo.sprite.speechRight = game.group(speechRight, speechTextRight);\n\t\t\tcharacterInfo.sprite.speechLeft = game.group(speechLeft, speechTextLeft);\n\t\t\tcharacterInfo.sprite.speechRight.visible = false;\n\t\t\tcharacterInfo.sprite.speechLeft.visible = false;\n\t\t\tcharacterInfo.sprite.speakNow = 0;\n\t\t\tcharacterInfo.sprite.lastLineSpoken = 0;\n\t\t}\n\t\t// Larger speech bubble for Toadsworth\n\t\telse {\n\t\t\tlet speechRight = game.sprite(\"resources/interface/tipBubble.png\");\n\t\t\tlet speechTextRight = new PIXI.Text(\"\", {font: '12px Arial', fill: 'black', wordWrap: true, wordWrapWidth: 196});\n\t\t\tspeechTextRight.anchor.x = 0.5;\n\t\t\tspeechTextRight.anchor.y = 0;\n\t\t\tspeechTextRight.x = speechRight.centerX;\n\t\t\tspeechTextRight.y = speechRight.centerY - 57;\n\t\t\tcharacterInfo.sprite.speechRight = game.group(speechRight, speechTextRight);\n\t\t\tcharacterInfo.sprite.speechRight.visible = false;\n\t\t}\n\t\t\n\t}\n\tgameInfo.sceneSprites[\"Gardener\"].addChild(gameInfo.characters[\"Princess Peach\"].sprite);\n\tgameInfo.sceneSprites[\"Gardener\"].addChild(gameInfo.characters[\"Toad\"].sprite);\n\tgameInfo.sceneSprites[\"Gardener\"].addChild(gameInfo.characters[\"Monty\"].sprite);\n\t\n\t// The level select page features Toadsworth, who dispenses game tips\n\tgameInfo.levelSelectGroup.addChild(gameInfo.characters[\"Toadsworth\"].sprite);\n\tgameInfo.characters[\"Toadsworth\"].sprite.interact = true;\n\tgameInfo.characters[\"Toadsworth\"].sprite.release = toadsworthTip;\n\tgameInfo.levelSelectInteractive.push(gameInfo.characters[\"Toadsworth\"].sprite);\n\tgameInfo.characters[\"Toadsworth\"].sprite.setPosition(184, 233);\n\tgameInfo.characters[\"Toadsworth\"].sprite.fps = 6;\n\tgameInfo.characters[\"Toadsworth\"].sprite.playAnimation(gameInfo.characters[\"Toadsworth\"].sprite.states.idle);\n\tgameInfo.characters[\"Toadsworth\"].sprite.speechRight.setPosition(151, 101);\n\tgameInfo.characters[\"Toadsworth\"].sprite.tips = gameInfo.characters[\"Toadsworth\"].tips;\n\tgameInfo.characters[\"Toadsworth\"].sprite.tipIndex = 0;\n\tgameInfo.characters[\"Toadsworth\"].sprite.maxTipIndex = 0;\n\tgameInfo.characters[\"Toadsworth\"].sprite.timeout = -1;\n\t\n\t// Next the title page is setup\n\t// Unlike levels, towers, and enemies, UI elements are hardcoded\n\tgameInfo.titleGroup = game.group();\n\tgameInfo.titleInteractive = [];\n\tlet titleBackground = game.sprite(\"resources/interface/titlebackground.png\");\n\ttitleBackground.interact = true;\n\tgameInfo.titleInteractive.push(titleBackground);\n\t// Setting the release function of a sprite with interact set to true\n\t// means that function will run when the sprite is clicked and released\n\ttitleBackground.release = () => {\n\t\t// When the title screen is clicked anywhere, the game begins after a miniscule delay\n\t\tgame.wait(100, () => {\n\t\t\tchangeScenes(gameInfo.titleGroup, gameInfo.titleInteractive, gameInfo.levelSelectGroup, gameInfo.levelSelectInteractive, function() {\n\t\t\t\tgame.state = levelSelect;\n\t\t\t});\n\t\t});\n\t};\n\tgameInfo.titleGroup.addChild(titleBackground);\n\t// Text for the title screen\n\tlet titleText = new PIXI.Text(\"BOWSER'S REVENGE\", {font: '70px mariofont', fill: 'red', stroke: 'black', strokeThickness: 7 });\n\ttitleText.anchor.x = 0.5;\n\ttitleText.anchor.y = 0.5;\n\ttitleText.x = 400;\n\ttitleText.y = 300;\n\tgameInfo.titleGroup.addChild(titleText);\n\tlet titleText2 = new PIXI.Text(\"CLICK ANYWHERE TO PLAY!\", {font: '42px mariofont', fill: 'white', stroke: 'black', strokeThickness: 5 });\n\ttitleText2.anchor.x = 0.5;\n\ttitleText2.anchor.y = 0.5;\n\ttitleText2.x = 400;\n\ttitleText2.y = 550;\n\tgameInfo.titleGroup.addChild(titleText2);\n\n\t// Next the in-level UI elements are setup\n\tgameInfo.levelInterfaceGroup = game.group();\n\tgameInfo.levelInterfaceInteractive = [];\n\tgameInfo.towerPortraits = [];\n\t// Add the current health UI element\n\tlet healthIcon = game.sprite(\"resources/interface/amountHeart.png\");\n\thealthIcon.setPosition(10, 10);\n\tgameInfo.levelInterfaceGroup.addChild(healthIcon);\n\tgameInfo.healthText = new PIXI.Text(\"\", {font: '42px mariofont', fill: 'white', stroke: 'black', strokeThickness: 5});\n\tgameInfo.healthText.x = 70;\n\tgameInfo.healthText.y = 10;\n\tgameInfo.levelInterfaceGroup.addChild(gameInfo.healthText);\n\t// Add the current coins UI element\n\tlet coinIcon = game.sprite(\"resources/interface/amountCoin.png\");\n\tcoinIcon.setPosition(265, 10);\n\tgameInfo.levelInterfaceGroup.addChild(coinIcon);\n\tgameInfo.coinText = new PIXI.Text(\"\", {font: '42px mariofont', fill: 'white', stroke: 'black', strokeThickness: 5});\n\tgameInfo.coinText.x = 325;\n\tgameInfo.coinText.y = 10;\n\tgameInfo.levelInterfaceGroup.addChild(gameInfo.coinText);\n\t// Add the current wave UI element\n\tgameInfo.waveText = new PIXI.Text(\"\", {font: '42px mariofont', fill: 'white', stroke: 'black', strokeThickness: 5});\n\tgameInfo.waveText.x = 515;\n\tgameInfo.waveText.y = 10;\n\tgameInfo.levelInterfaceGroup.addChild(gameInfo.waveText);\n\t// Add the tower builder buttons\n\tlet towerOffset = 0;\n\tgameInfo.priceLabels = [];\n\tfor (let tower in gameInfo.towers) {\n\t\tlet buttonSource = gameInfo.towers[tower].buttonSource;\n\t\tlet towerButton = game.sprite(buttonSource);\n\t\ttowerButton.tower = gameInfo.towers[tower].name;\n\t\ttowerButton.setPosition(20, 70 + towerOffset);\n\t\tlet priceLabel = new PIXI.Text(gameInfo.towers[tower].price, {font: '14px mariofont', fill: 'white', stroke: 'black', strokeThickness: 5});\n\t\tpriceLabel.cost = gameInfo.towers[tower].price;\n\t\tpriceLabel.anchor.x = 0.5;\n\t\tpriceLabel.anchor.y = 0.5;\n\t\tpriceLabel.x = towerButton.centerX;\n\t\tpriceLabel.y = 138 + towerOffset;\n\t\tgameInfo.priceLabels.push(priceLabel);\n\t\tgameInfo.levelInterfaceGroup.addChild(priceLabel);\n\t\tlet towerInfoLabel = game.rectangle(150, 58, \"green\");\n\t\ttowerInfoLabel.alpha = 0.50;\n\t\ttowerInfoLabel.setPosition(towerButton.x + 90, towerButton.y);\n\t\ttowerInfoLabel.visible = false;\n\t\tgameInfo.levelInterfaceGroup.addChild(towerInfoLabel);\n\t\tlet towerInfoText = new PIXI.Text(\"Damage: \" + gameInfo.towers[tower].bulletDamage + \"\\nRange: \" + gameInfo.towers[tower].targetRange + \"\\nCooldown: \" + gameInfo.towers[tower].bulletCooldown, {font: '14px mariofont', fill: 'white', stroke: 'black', strokeThickness: 5});\n\t\ttowerInfoText.x = towerInfoLabel.x + 5;\n\t\ttowerInfoText.y = towerInfoLabel.y;\n\t\ttowerInfoText.visible = false;\n\t\tgameInfo.levelInterfaceGroup.addChild(towerInfoText);\n\t\ttowerOffset += 89;\n\t\ttowerButton.interact = true;\n\t\t// Function for when button is clicked and released\n\t\ttowerButton.release = () => {\n\t\t\t// If already building a tower, delete the preview and range\n\t\t\tif (gameInfo.currentLevelBuilding) {\n\t\t\t\tgame.remove(gameInfo.currentLevelBuildingPreview);\n\t\t\t\tgame.remove(gameInfo.currentLevelBuildingPreviewRange);\n\t\t\t\tgameInfo.currentLevelBuilding = false;\n\t\t\t\tgame.pointer.press = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgameInfo.currentLevelBuilding = true;\n\t\t\tgameInfo.currentLevelBuildingTower = towerButton.tower;\n\t\t\tgameInfo.currentLevelBuildingPreview = game.sprite(gameInfo.towers[towerButton.tower].animations.fullTexture[gameInfo.towers[towerButton.tower].buildFrame]);\n\t\t\tgameInfo.currentLevelBuildingPreview.tint = 0xFF0000;\n\t\t\tgameInfo.currentLevelBuildingPreview.alpha = 0.65;\n\t\t\tgameInfo.currentLevelBuildingPreview.anchor.x = 0.5;\n\t\t\tgameInfo.currentLevelBuildingPreview.anchor.y = 0.5;\n\t\t\tgameInfo.currentLevelBuildingPreview.setPosition(game.pointer.x, game.pointer.y);\n\t\t\tgameInfo.currentLevelBuildingPreview.price = gameInfo.towers[towerButton.tower].price;\n\t\t\tgameInfo.currentLevelBuildingPreviewRange = game.circle((2 * gameInfo.towers[towerButton.tower].targetRange), 0x000000);\n\t\t\tgameInfo.currentLevelBuildingPreviewRange.anchor.x = 0.5;\n\t\t\tgameInfo.currentLevelBuildingPreviewRange.anchor.y = 0.5;\n\t\t\tgameInfo.currentLevelBuildingPreviewRange.alpha = 0.05;\n\t\t\tgameInfo.currentLevelBuildingPreviewRange.setPosition(game.pointer.x, game.pointer.y);\n\t\t\tgame.pointer.press = buildTower;\n\t\t};\n\t\t// Function for when mouse is over the button\n\t\ttowerButton.over = () => {\n\t\t\ttowerButton.tint = 0xFFFF99;\n\t\t\ttowerInfoLabel.visible = true;\n\t\t\ttowerInfoText.visible = true;\n\n\t\t};\n\t\t// Function for when mouse leaves the button\n\t\ttowerButton.out = () => {\n\t\t\ttowerButton.tint = 0xFFFFFF;\n\t\t\ttowerInfoLabel.visible = false;\n\t\t\ttowerInfoText.visible = false;\n\n\t\t};\n\t\tgameInfo.towers[tower].portrait = towerButton;\n\t\tgameInfo.levelInterfaceGroup.addChild(towerButton);\n\t\tgameInfo.towerPortraits.push(towerButton);\n\t\ttowerButton.interact = false;\n\t\t// Tinting is removed and price is shown once the tower is unlocked\n\t\ttowerButton.tint = 0x4d0000;\n\t\ttowerButton.priceLabel = priceLabel;\n\t\ttowerButton.priceLabel.text = \"\";\n\t}\n\tgameInfo.levelInterfaceGroup.visible = false;\n\t\n\t// Next the user's save data (last level completed) is accessed and\n\t// the appropriate towers + levels are automatically unlocked\n\tlet userLevel = localStorage.getItem('Level Completed');\n\tlet userScene = localStorage.getItem('Scene Completed');\n\tlet userTips = localStorage.getItem('Tips Completed');\n\tif (userLevel) {\n\t\tgameInfo.lastLevelCompleted = userLevel;\n\t}\n\telse {\n\t\tgameInfo.lastLevelCompleted = 0;\n\t}\n\tif (userScene) {\n\t\tgameInfo.lastSceneCompleted = userScene;\n\t}\n\telse {\n\t\tgameInfo.lastSceneCompleted = 0;\n\t}\n\tif (userTips) {\n\t\tgameInfo.lastTipsCompleted = userTips;\n\t}\n\telse {\n\t\tgameInfo.lastTipsCompleted = 0;\n\t}\n\t// Unlock towers that have already been unlocked by this player\n\tfor (let tower in gameInfo.towers) {\n\t\tif(gameInfo.towers[tower].locked && gameInfo.towers[tower].unlockAfterScene <= gameInfo.lastSceneCompleted) {\n\t\t\tgameInfo.towers[tower].locked = false;\n\t\t\tgameInfo.towers[tower].portrait.tint = 0xFFFFFF;\n\t\t\tgameInfo.towers[tower].portrait.priceLabel.text = gameInfo.towers[tower].price;\n\t\t\tgameInfo.levelInterfaceInteractive.push(gameInfo.towers[tower].portrait);\n\t\t}\n\t}\n\t// Unlock levels that have already been unlocked by this player\n\tfor (let level in gameInfo.levels) {\n\t\tlevel = gameInfo.levels[level];\n\t\tif (level.number <= (+gameInfo.lastLevelCompleted + 1)) {\n\t\t\tgameInfo.levelSelectInteractive.push(level.buttonSprite);\n\t\t\tlevel.buttonSprite.alpha = 1;\n\t\t}\n\t}\n\t\n\t// Start the game at the title screen\n\tgame.state = title;\n}", "addToGlobalDependencyGraph() {\n for (let entry of this.map) {\n let paginationTagTarget = this.getPaginationTagTarget(entry);\n if (paginationTagTarget) {\n this.config.uses.addDependencyConsumesCollection(entry.inputPath, paginationTagTarget);\n }\n\n if (!entry.data.eleventyExcludeFromCollections) {\n this.config.uses.addDependencyPublishesToCollection(entry.inputPath, \"all\");\n\n if (Array.isArray(entry.data.tags)) {\n for (let tag of entry.data.tags) {\n this.config.uses.addDependencyPublishesToCollection(entry.inputPath, tag);\n }\n }\n }\n\n if (Array.isArray(entry.data.eleventyImport?.collections)) {\n for (let tag of entry.data.eleventyImport.collections) {\n this.config.uses.addDependencyConsumesCollection(entry.inputPath, tag);\n }\n }\n }\n }", "function getExternals (api, pluginOptions) {\n const nodeModulesPath = pluginOptions.nodeModulesPath || './node_modules'\n let nodeModulesPaths = []\n if (Array.isArray(nodeModulesPath)) {\n // Set to user-defined array\n nodeModulesPaths = nodeModulesPath\n } else {\n // Add path to list\n nodeModulesPaths.push(nodeModulesPath)\n }\n const userExternalsWhitelist = []\n const userExternals = (pluginOptions.externals || []).filter((d, i) => {\n // if item is prefixed with \"!\", remove it from list and add it to userExternalsWhitelist\n if (d.match(/^!/)) {\n userExternalsWhitelist.push(d.replace(/^!/, ''))\n return false\n }\n return true\n })\n const { dependencies, optionalDependencies } = require(api.resolve(\n './package.json'\n ))\n const allDependencies = Object.keys(dependencies || {}).concat(\n Object.keys(optionalDependencies || {})\n )\n const externalsList = allDependencies.reduce((depList, dep) => {\n try {\n if (process.env.VCPEB_EXPERIMENTAL_NATIVE_DEP_CHECK) {\n // If dep is in whitelist, don't add it no matter what\n if (userExternalsWhitelist.includes(dep)) {\n return depList\n }\n const name = userExternals.find((name) =>\n new RegExp(`^${dep}(/|$)`).test(name)\n )\n // If dep is listed in user external array, it is an external\n if (name) {\n // Use user-provided name if it exists to support subpaths\n depList.push(name || dep)\n return depList\n }\n for (const path of nodeModulesPaths) {\n // Check if binding.gyp exists\n if (fs.existsSync(api.resolve(`${path}/${dep}/binding.gyp`))) {\n // If it does, dep is native\n // Use user-provided name if it exists to support subpaths\n depList.push(name || dep)\n return depList\n }\n }\n } else {\n let pgkString\n for (const path of nodeModulesPaths) {\n // Check if package.json exists\n if (fs.existsSync(api.resolve(`${path}/${dep}/package.json`))) {\n // If it does, read it and break\n pgkString = fs\n .readFileSync(api.resolve(`${path}/${dep}/package.json`))\n .toString()\n break\n }\n }\n if (!pgkString) {\n throw new Error(`Could not find a package.json for module ${dep}`)\n }\n const pkg = JSON.parse(pgkString)\n const name = userExternals.find((name) =>\n new RegExp(`^${pkg.name}(/|$)`).test(name)\n )\n const fields = ['main', 'module', 'jsnext:main', 'browser']\n if (\n // Not whitelisted\n userExternalsWhitelist.indexOf(dep) === -1 &&\n // Doesn't have main property\n (!fields.some((field) => field in pkg) ||\n // Has binary property\n !!pkg.binary ||\n // Has gypfile property\n !!pkg.gypfile ||\n // Listed in user-defined externals list\n !!name)\n ) {\n // Use user-provided name if it exists, for subpaths\n depList.push(name || dep)\n }\n }\n } catch (e) {\n console.log(e)\n depList.push(dep)\n }\n return depList\n }, [])\n const externals = {}\n externalsList.forEach((d) => {\n // Set external to be required during runtime\n externals[d] = `require(\"${d}\")`\n })\n return externals\n}", "function DBAddonInternal(aLoaded) {\n copyProperties(aLoaded, PROP_JSON_FIELDS, this);\n\n if (aLoaded._installLocation) {\n this._installLocation = aLoaded._installLocation;\n this.location = aLoaded._installLocation.name;\n }\n else if (aLoaded.location) {\n this._installLocation = XPIProvider.installLocationsByName[this.location];\n }\n\n this._key = this.location + \":\" + this.id;\n\n if (aLoaded._sourceBundle) {\n this._sourceBundle = aLoaded._sourceBundle;\n }\n else if (aLoaded.descriptor) {\n this._sourceBundle = Cc[\"@mozilla.org/file/local;1\"].createInstance(Ci.nsIFile);\n this._sourceBundle.persistentDescriptor = aLoaded.descriptor;\n }\n else {\n throw new Error(\"Expected passed argument to contain a descriptor\");\n }\n\n XPCOMUtils.defineLazyGetter(this, \"pendingUpgrade\",\n function DBA_pendingUpgradeGetter() {\n for (let install of XPIProvider.installs) {\n if (install.state == AddonManager.STATE_INSTALLED &&\n !(install.addon.inDatabase) &&\n install.addon.id == this.id &&\n install.installLocation == this._installLocation) {\n delete this.pendingUpgrade;\n return this.pendingUpgrade = install.addon;\n }\n };\n return null;\n });\n}", "function exportAggregate() {\n\t/*\n\tOnly data element in datasets included. Include config option for \"placeholder\"\n\tdatasets that is only used to get dependencies, but where the actual dataset is not \n\tincluded in the export file. This also includes other data elements used in \n\tindicators, like those for population.\n\t\n\tFavourites and indicator formulas should still be checked for data elements, \n\tcategory option groups, legend sets etc. For legend sets, category option groups etc\n\tthey should be included, but for data elements we should only show a warning that \n\tthey need to be added to a data set to be included.\n\t*/\n\n\tconsole.log(\"1. Downloading metadata\");\n\n\t//Do initial dependency export\n\tvar promises = [\n\t\tdependencyExport(\"dataSet\", currentExport.dataSetIds),\n\t\tdependencyExport(\"dashboard\", currentExport.dashboardIds),\n\t\tlimitedDependencyExport(currentExport.exportDataSetIds),\n\t\tcustomObjects()\n\t];\n\tQ.all(promises).then(function (results) {\n\n\n\t\t//Get indicators and categoryOptionGroupSets from favourites and groups\n\t\t//Get validation rules and groups from conf file\n\t\t//Get data element and indicator groups from conf files\n\t\tpromises = [\n\t\t\tindicators(),\n\t\t\tcategoryOptionGroupSetStructure(),\n\t\t\tvalidationRules(),\n\t\t\tsaveObject(\"dataElementGroups\", currentExport.dataElementGroupIds),\n\t\t\tsaveObject(\"indicatorGroups\", currentExport.indicatorGroupIds),\n\t\t\tuserGroups(),\n\t\t\tusers()\n\t\t];\n\t\tQ.all(promises).then(function (results) {\n\n\t\t\t//Get legends from data elements, indicators and favourites\n\t\t\t//Get indicator types from indicators\n\t\t\t//Get predictors based on data elements\n\t\t\tpromises = [\n\t\t\t\tindicatorTypes(),\n\t\t\t\tlegendSets(),\n\t\t\t\tpredictors()\n\t\t\t];\n\t\t\tQ.all(promises).then(function (results) {\n\n\t\t\t\tprocessAggregate();\n\n\t\t\t});\n\n\t\t});\n\n\t});\n\n}", "function getProvenances () {\n\t\t\t\tif (!provenance) return API.Q.resolve();\n\t\t\t\treturn API.Q.denodeify(function (callback) {\n\t\t\t\t\tvar provenances = {\n\t\t\t\t\t\tdeclaredMappings: {},\n\t\t\t\t\t\textends: {}\n\t\t\t\t\t};\n\t\t\t\t\tvar waitfor = API.WAITFOR.serial(function (err) {\n\t\t\t\t\t\tif (err) return callback(err);\n\t\t\t\t\t\treturn callback(null, provenances);\n\t\t\t\t\t});\n\t\t\t\t\tfor (var path in provenance) {\n\n\t\t\t\t\t\twaitfor(path, function (path, callback) {\n\n\t\t\t\t\t\t\treturn findGitRoot(path, function (err, gitRoot) {\n\t\t\t\t\t\t\t\tif (err) return callback(err);\n\t\t\t\t\t\t\t\tif (!gitRoot) {\n\t\t\t\t\t\t\t\t\treturn callback(new Error(\"No git root found for: \" + path));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar extendsRelpath = API.PATH.relative(API.PATH.dirname(gitRoot), path);\n\t\t\t\t\t\t\t\tvar depRelpath = \"{{env.PGS_PACKAGES_DIRPATH}}/\" + extendsRelpath.split(\"/\").shift();\n\t\t\t\t\t\t\t\tif (!provenances.extends[extendsRelpath]) {\n\t\t\t\t\t\t\t\t\tprovenances.extends[extendsRelpath] = {\n\t\t\t\t\t\t\t\t\t\tlocation: \"!{{env.PGS_PACKAGES_DIRPATH}}/\" + extendsRelpath\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn callback(new Error(\"Already declared (use unique containing project basenames for external mappings): \" + extendsRelpath));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tAPI.EXTEND(true, provenances.extends[extendsRelpath], provenance[path]);\n\n\t\t\t\t\t\t\t\tif (!provenances.declaredMappings[depRelpath]) {\n\t\t\t\t\t\t\t\t\tprovenances.declaredMappings[depRelpath] = {\n\t\t\t\t\t\t\t\t\t\tpath: gitRoot,\n\t\t\t\t\t\t\t\t\t\tinstall: false\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\tif (provenances.declaredMappings[depRelpath].path !== gitRoot) {\n\t\t\t\t\t\t\t\t\tconsole.log(\"depRelpath\", depRelpath);\n\t\t\t\t\t\t\t\t\tconsole.log(\"provenances.declaredMappings\", provenances.declaredMappings);\n\t\t\t\t\t\t\t\t\tconsole.log(\"gitRoot\", gitRoot);\n\t\t\t\t\t\t\t\t\treturn callback(new Error(\"Already declared: \" + extendsRelpath));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn callback(null);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn waitfor();\n\t\t\t\t})();\n\t\t\t}", "function collectModules() {\n var mainPaths = (require.main && require.main.paths) || [];\n var paths = getPaths();\n var infos = {};\n var seen = {};\n paths.forEach(function (path) {\n var dir = path;\n /** Traverse directories upward in the search of package.json file */\n var updir = function () {\n var orig = dir;\n dir = path_1.dirname(orig);\n if (!dir || orig === dir || seen[orig]) {\n return undefined;\n }\n if (mainPaths.indexOf(dir) < 0) {\n return updir();\n }\n var pkgfile = path_1.join(orig, 'package.json');\n seen[orig] = true;\n if (!fs_1.existsSync(pkgfile)) {\n return updir();\n }\n try {\n var info = JSON.parse(fs_1.readFileSync(pkgfile, 'utf8'));\n infos[info.name] = info.version;\n }\n catch (_oO) {\n // no-empty\n }\n };\n updir();\n });\n return infos;\n}", "checkDependencies() {\n for (let id in this.dependencies) {\n let dependency = this.dependencies[id];\n let { dependencies, callback } = dependency;\n if (dependencies.clients.length && !this.clientsAreAllOnline[id]) {\n this.clientsAreAllOnline[id] = this.checkClients(dependencies.clients);\n if (!this.clientsAreAllOnline[id]) {\n continue;\n }\n }\n delete this.dependencies[id];\n dependency.clearStartupTimer();\n if (callback) {\n callback();\n }\n }\n }", "function searchChildren(children) {\n const results = [];\n\n for (let index = 0; index < children.length; index++) {\n const child = children[index];\n\n if (child.isActive && child.isDependent) {\n results.push(child);\n } else {\n results.push(...searchChildren(child.$children));\n }\n }\n\n return results;\n}", "function searchChildren(children) {\n const results = [];\n\n for (let index = 0; index < children.length; index++) {\n const child = children[index];\n\n if (child.isActive && child.isDependent) {\n results.push(child);\n } else {\n results.push(...searchChildren(child.$children));\n }\n }\n\n return results;\n}", "function searchChildren(children) {\n const results = [];\n\n for (let index = 0; index < children.length; index++) {\n const child = children[index];\n\n if (child.isActive && child.isDependent) {\n results.push(child);\n } else {\n results.push(...searchChildren(child.$children));\n }\n }\n\n return results;\n}", "function getAllScreenshots() {\n self.getAsyncStatement(\"getAllScreenshots\").executeAsync({\n handleResult: function(aResults) {\n let row = null;\n while (row = aResults.getNextRow()) {\n let addon_internal_id = row.getResultByName(\"addon_internal_id\");\n if (!(addon_internal_id in addons)) {\n WARN(\"Found a screenshot not linked to an add-on in database\");\n continue;\n }\n\n let addon = addons[addon_internal_id];\n if (!addon.screenshots)\n addon.screenshots = [];\n addon.screenshots.push(self._makeScreenshotFromAsyncRow(row));\n }\n },\n\n handleError: self.asyncErrorLogger,\n\n handleCompletion: function(aReason) {\n if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {\n ERROR(\"Error retrieving screenshots from database. Returning empty results\");\n aCallback({});\n return;\n }\n\n getAllCompatOverrides();\n }\n });\n }", "function resolveComponentInfo(data) {\n return checkChildren(data);\n}", "_tryToAddAllChildren(evt) {\n // If this element's elementInst isn't ready, halt and wait until later\n // If this event isn't coming from this element, do not handle\n const localEvt = Polymer.dom(evt);\n if (!this.elementInst || localEvt.rootTarget !== this) return;\n\n // If my own elementInst was just created, loop over children and try to attach them\n this._attachLayerChildren();\n }", "_getRegistryItems() {\n return this.get('_registry').map(i=>i.child);\n }", "function collectDependencies() {\n\tlet pkg;\n\ttry {\n\t\tpkg = {\n\t\t\texports: {}\n\t\t};\n\t\tpkgInfo(pkg, {\n\t\t\tdir: cwd,\n\t\t\tinclude: [\"name\", \"version\", \"dependencies\", \"devDependencies\"]\n\t\t});\n\n\t} catch (e) {\n\t\tconsole.log(chalk.redBright(\"No package.json found. Abort\"));\n\t\tprocess.exit(1); // Exit early if no package.json, since there's no point to continue\n\t}\n\treturn pkg;\n}", "conectingChildrens() {\n\n for (let componentRefId of this.componentsRefId) {\n if (typeof this.graph.components[componentRefId] == 'undefined') {\n this.graph.onXMLError(\"components:: it doens't have any component with that id, \" + componentRefId + \".\");\n } else {\n this.childrens.push(this.graph.components[componentRefId]);\n }\n }\n }", "async findAllResources() {\n var t = this;\n var db = this.__db;\n if (!db.resources) {\n db.resources = {};\n }\n t.__librariesByResourceUri = {};\n this.__allResourceUris = null;\n this.__assets = {};\n\n await qx.Promise.all(\n t.__analyser.getLibraries().map(async library => {\n var resources = db.resources[library.getNamespace()];\n if (!resources) {\n db.resources[library.getNamespace()] = resources = {};\n }\n var unconfirmed = {};\n for (let relFile in resources) {\n unconfirmed[relFile] = true;\n }\n\n const scanResources = async resourcePath => {\n // If the root folder exists, scan it\n var rootDir = path.join(\n library.getRootDir(),\n library.get(resourcePath)\n );\n\n await qx.tool.utils.files.Utils.findAllFiles(\n rootDir,\n async filename => {\n var relFile = filename\n .substring(rootDir.length + 1)\n .replace(/\\\\/g, \"/\");\n var fileInfo = resources[relFile];\n delete unconfirmed[relFile];\n if (!fileInfo) {\n fileInfo = resources[relFile] = {};\n }\n fileInfo.resourcePath = resourcePath;\n fileInfo.mtime = await qx.tool.utils.files.Utils.safeStat(\n filename\n ).mtime;\n\n let asset = new qx.tool.compiler.resources.Asset(\n library,\n relFile,\n fileInfo\n );\n\n this.__addAsset(asset);\n }\n );\n };\n\n await scanResources(\"resourcePath\");\n await scanResources(\"themePath\");\n\n // Check the unconfirmed resources to make sure that they still exist;\n // delete from the database if they don't\n await qx.Promise.all(\n Object.keys(unconfirmed).map(async filename => {\n let fileInfo = resources[filename];\n if (!fileInfo) {\n delete resources[filename];\n } else {\n let stat = await qx.tool.utils.files.Utils.safeStat(filename);\n if (!stat) {\n delete resources[filename];\n }\n }\n })\n );\n })\n );\n\n await qx.tool.utils.Promisify.poolEachOf(\n Object.values(this.__assets),\n 10,\n async asset => {\n await asset.load();\n let fileInfo = asset.getFileInfo();\n if (fileInfo.meta) {\n for (var altPath in fileInfo.meta) {\n let lib = this.findLibraryForResource(altPath);\n if (!lib) {\n lib = asset.getLibrary();\n }\n let otherAsset =\n this.__assets[lib.getNamespace() + \":\" + altPath];\n if (otherAsset) {\n otherAsset.addMetaReferee(asset);\n asset.addMetaReferTo(otherAsset);\n } else {\n qx.tool.compiler.Console.warn(\n \"Cannot find asset \" + altPath + \" referenced in \" + asset\n );\n }\n }\n }\n if (fileInfo.dependsOn) {\n let dependsOn = [];\n fileInfo.dependsOn.forEach(str => {\n let otherAsset = this.__assets[str];\n if (!otherAsset) {\n qx.tool.compiler.Console.warn(\n \"Cannot find asset \" + str + \" depended on by \" + asset\n );\n } else {\n dependsOn.push(otherAsset);\n }\n });\n if (dependsOn.length) {\n asset.setDependsOn(dependsOn);\n }\n }\n return null;\n }\n );\n }", "collectDependencies() {}", "function findAllVersions(toolName, arch) {\n const versions = [];\n arch = arch || os.arch();\n const toolPath = path.join(_getCacheDirectory(), toolName);\n if (fs.existsSync(toolPath)) {\n const children = fs.readdirSync(toolPath);\n for (const child of children) {\n if (_isExplicitVersion(child)) {\n const fullPath = path.join(toolPath, child, arch || '');\n if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {\n versions.push(child);\n }\n }\n }\n }\n return versions;\n}", "getAllDependencies(exclude = []) {\n let dependencyMap = {};\n let dependencyStack = [...this.dependencies];\n //keep walking the dependency graph until we run out of unseen dependencies\n while (dependencyStack.length > 0) {\n let dependency = dependencyStack.pop();\n //if this is a new dependency and we aren't supposed to skip it\n if (!dependencyMap[dependency] && !exclude.includes(dependency)) {\n dependencyMap[dependency] = true;\n //get the node for this dependency\n let node = this.graph.nodes[dependency];\n if (node) {\n dependencyStack.push(...node.dependencies);\n }\n }\n }\n return Object.keys(dependencyMap);\n }", "function findAllVersions(toolName, arch) {\n const versions = [];\n arch = arch || os.arch();\n const toolPath = path.join(cacheRoot, toolName);\n if (fs.existsSync(toolPath)) {\n const children = fs.readdirSync(toolPath);\n for (const child of children) {\n if (_isExplicitVersion(child)) {\n const fullPath = path.join(toolPath, child, arch || '');\n if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {\n versions.push(child);\n }\n }\n }\n }\n return versions;\n}", "function findAllVersions(toolName, arch) {\n const versions = [];\n arch = arch || os.arch();\n const toolPath = path.join(cacheRoot, toolName);\n if (fs.existsSync(toolPath)) {\n const children = fs.readdirSync(toolPath);\n for (const child of children) {\n if (_isExplicitVersion(child)) {\n const fullPath = path.join(toolPath, child, arch || '');\n if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {\n versions.push(child);\n }\n }\n }\n }\n return versions;\n}", "async function exploreModules(auth) {\n const mapping = readModuleMapping();\n const modulesInfo = await queryModulesAPI(auth);\n // Filter out modules that haven't been mapped in MODULES.txt\n const filteredModulesInfo = modulesInfo.filter(moduleInfo => {\n return Object.keys(mapping).includes(moduleInfo['name']);\n });\n // Map module codes according to user-defined module mappings\n const modules = filteredModulesInfo.map(moduleInfo => {\n return new Module(moduleInfo['id'], mapping[moduleInfo['name']], moduleInfo['courseName']);\n });\n\n // Recursively explore its children for folders\n const promises = modules.map(module => {\n return new Promise(async (resolve, reject) => {\n if (PRINT) console.log('Exploring ' + module.code + ': ' + module.name + ' ...');\n const folders = await exploreFolders(auth, module.id);\n module.populateFolders(folders);\n resolve();\n });\n });\n await Promise.all(promises);\n if (PRINT) console.log();\n\n return modules;\n}", "function dependChildArray(array) {\n for (var e, i = 0, l = array.length; i < l; i++) {\n e = array[i];\n if (e != null) {\n if (e instanceof Entity) {\n var observer = getEntityObserver(e, true);\n observer.ensureObservable();\n observer.dep.depend();\n }\n else if (hasOwnProperty$1(e, '__ob__')) {\n e.__ob__.dep.depend();\n }\n if (Array.isArray(e)) {\n dependChildArray(e);\n }\n }\n }\n}", "function buildDeps(arrDeps) {\n arrDeps.forEach(function (deps) {\n var depsId = deps, vmPath;\n\n var depsObj = map[depsId];\n if (!depsObj) {\n console.error('%s is not in map!!', depsId);\n return;\n }\n var hisDeps = depsObj['deps'] || [];\n if (hisDeps && hisDeps.length) {\n buildDeps(hisDeps);\n }\n\n var type = depsObj.type;\n var uri = depsObj.uri;\n\n switch (type) {\n case 'vm':\n\n // 检查deps中的js,添加到arrJsMod里\n // arrJsMod中只放每一个vm同名依赖的js模块,它的依赖已经打包在arrCombJs中提前加载了\n var depsIdPre = depsId.replace(/(.*?)(\\.vm)$/, '$1');\n hisDeps.map(function (item) {\n if (item === depsIdPre + '.js') {\n var modId = map[item] && map[item]['extras']['moduleId'];\n arrJsMod.push({\n moduleId: '\"' + modId + '\"',\n widgetId: deps.idf\n });\n }\n });\n\n break;\n case 'js':\n if (!~conf['arrGlobalJs'].indexOf(uri)) {\n arrCombJs.pushUnique(uri);\n }\n break;\n case 'css':\n if (!~conf['arrGlobalCss'].indexOf(uri)) {\n arrCombCss.pushUnique(uri);\n }\n break;\n default:\n break;\n } //end of switch\n }); //end of forEach\n\n }", "function _resolve() {\n \n // low level dependencies need to be resolved first\n _adapters.resolve(_container);\n _repositories.resolve(_container);\n _services.resolve(_container);\n}", "_addDependentsToPackage (packageNode, depObj, type) {\n Object.keys(depObj).forEach(dependencyName => {\n if (this.packageStore.hasOwnProperty(dependencyName)) {\n // packageNode has a dependency of dependencyName - therefore dependencyName is dependent on packageNode\n const dependentPackageNode = this.packageStore[dependencyName];\n const version = depObj[dependencyName];\n dependentPackageNode.addDependent(packageNode.name, new DependentLinkNode({\n type, version, packageNode\n }));\n }\n });\n }", "get bossEncounterList() {\n const encounterInfo = [];\n // Handling Bosses\n this.bossList.forEach((boss) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;\n // Handling Pokemon\n if (boss instanceof DungeonBossPokemon) {\n const pokemonName = boss.name;\n const pokerus = (_a = App.game.party.getPokemonByName(pokemonName)) === null || _a === void 0 ? void 0 : _a.pokerus;\n const encounter = {\n image: `assets/images/${(App.game.party.alreadyCaughtPokemonByName(pokemonName, true) ? 'shiny' : '')}pokemon/${pokemonMap[pokemonName].id}.png`,\n pkrsImage: pokerus > GameConstants.Pokerus.Uninfected ? `assets/images/breeding/pokerus/${GameConstants.Pokerus[App.game.party.getPokemonByName(pokemonName).pokerus]}.png` : '',\n EVs: pokerus >= GameConstants.Pokerus.Contagious ? `EVs: ${App.game.party.getPokemonByName(pokemonName).evs().toLocaleString('en-US')}` : '',\n shiny: App.game.party.alreadyCaughtPokemonByName(pokemonName, true),\n hide: ((_b = boss.options) === null || _b === void 0 ? void 0 : _b.hide) ? (((_c = boss.options) === null || _c === void 0 ? void 0 : _c.requirement) ? !((_d = boss.options) === null || _d === void 0 ? void 0 : _d.requirement.isCompleted()) : (_e = boss.options) === null || _e === void 0 ? void 0 : _e.hide) : false,\n uncaught: !App.game.party.alreadyCaughtPokemonByName(pokemonName),\n lock: ((_f = boss.options) === null || _f === void 0 ? void 0 : _f.requirement) ? !((_g = boss.options) === null || _g === void 0 ? void 0 : _g.requirement.isCompleted()) : false,\n lockMessage: ((_h = boss.options) === null || _h === void 0 ? void 0 : _h.requirement) ? (_j = boss.options) === null || _j === void 0 ? void 0 : _j.requirement.hint() : '',\n };\n encounterInfo.push(encounter);\n // Handling Trainer\n }\n else {\n const encounter = {\n image: boss.image,\n EVs: '',\n shiny: false,\n hide: ((_k = boss.options) === null || _k === void 0 ? void 0 : _k.hide) ? (((_l = boss.options) === null || _l === void 0 ? void 0 : _l.requirement) ? !((_m = boss.options) === null || _m === void 0 ? void 0 : _m.requirement.isCompleted()) : (_o = boss.options) === null || _o === void 0 ? void 0 : _o.hide) : false,\n uncaught: false,\n lock: ((_p = boss.options) === null || _p === void 0 ? void 0 : _p.requirement) ? !((_q = boss.options) === null || _q === void 0 ? void 0 : _q.requirement.isCompleted()) : false,\n lockMessage: ((_r = boss.options) === null || _r === void 0 ? void 0 : _r.requirement) ? (_s = boss.options) === null || _s === void 0 ? void 0 : _s.requirement.hint() : '',\n };\n encounterInfo.push(encounter);\n }\n });\n return encounterInfo;\n }", "async discoverAllAPIs(discoveryUrl) {\n const headers = this.options.includePrivate\n ? {}\n : { 'X-User-Ip': '0.0.0.0' };\n const res = await this.transporter.request({\n url: discoveryUrl,\n headers,\n });\n const items = res.data.items;\n const apis = await Promise.all(items.map(async (api) => {\n const endpointCreator = await this.discoverAPI(api.discoveryRestUrl);\n return { api, endpointCreator };\n }));\n const versionIndex = {};\n // tslint:disable-next-line no-any\n const apisIndex = {};\n for (const set of apis) {\n if (!apisIndex[set.api.name]) {\n versionIndex[set.api.name] = {};\n apisIndex[set.api.name] = (options) => {\n const type = typeof options;\n let version;\n if (type === 'string') {\n version = options;\n options = {};\n }\n else if (type === 'object') {\n version = options.version;\n delete options.version;\n }\n else {\n throw new Error('Argument error: Accepts only string or object');\n }\n try {\n const ep = \n // tslint:disable-next-line: no-any\n set.endpointCreator(options, this);\n return Object.freeze(ep); // create new & freeze\n }\n catch (e) {\n throw new Error(util.format('Unable to load endpoint %s(\"%s\"): %s', set.api.name, version, e.message));\n }\n };\n }\n versionIndex[set.api.name][set.api.version] = set.endpointCreator;\n }\n return apisIndex;\n }", "function discoverCommon() {\n discoverMany(['npm', 'yarn'])\n}", "function resolveDeferreds() {\n for (var i = 0; i < manager.deferreds.length; i++){\n manager.deferreds[i].resolveWith(root, [root]);\n }\n manager.deferreds = [];\n }", "GetComponentsInChildren() {}", "GetComponentsInChildren() {}", "GetComponentsInChildren() {}", "GetComponentsInChildren() {}", "function dependencyHandlers() {\n // Don't do anything during the DLL Build step\n if (process.env.BUILDING_DLL) { return []; }\n\n // If the package.json does not have a dllPlugin property, use the CommonsChunkPlugin\n if (!dllPlugin) {\n return [\n new webpack.optimize.CommonsChunkPlugin({\n name: 'vendor',\n children: true,\n minChunks: 2,\n async: true,\n }),\n ];\n }\n\n const dllPath = path.resolve(process.cwd(), dllPlugin.path || 'node_modules/react-boilerplate-dlls');\n\n /**\n * If DLLs aren't explicitly defined, we assume all production dependencies listed in package.json\n * Reminder: You need to exclude any server side dependencies by listing them in dllConfig.exclude\n *\n * @see https://github.com/mxstbr/react-boilerplate/tree/master/docs/general/webpack.md\n */\n if (!dllPlugin.dlls) {\n const manifestPath = path.resolve(dllPath, 'reactBoilerplateDeps.json');\n\n if (!fs.existsSync(manifestPath)) {\n logger.error('The DLL manifest is missing. Please run `npm run build:dll`');\n process.exit(0);\n }\n\n return [\n new webpack.DllReferencePlugin({\n context: process.cwd(),\n manifest: require(manifestPath), // eslint-disable-line global-require\n }),\n ];\n }\n\n // If DLLs are explicitly defined, we automatically create a DLLReferencePlugin for each of them.\n const dllManifests = Object.keys(dllPlugin.dlls).map((name) => path.join(dllPath, `/${name}.json`));\n\n return dllManifests.map((manifestPath) => {\n if (!fs.existsSync(path)) {\n if (!fs.existsSync(manifestPath)) {\n logger.error(`The following Webpack DLL manifest is missing: ${path.basename(manifestPath)}`);\n logger.error(`Expected to find it in ${dllPath}`);\n logger.error('Please run: npm run build:dll');\n\n process.exit(0);\n }\n }\n\n return new webpack.DllReferencePlugin({\n context: process.cwd(),\n manifest: require(manifestPath), // eslint-disable-line global-require\n });\n });\n}", "processRequires() {\n let lookUpRes, funcsList,\n workerConfig = this.service.getWorkerConfig()\n\n if (!Reflect.has(workerConfig, 'require')) {\n return\n }\n\n Object.keys(workerConfig.require).forEach((service) => {\n funcsList = workerConfig.require[service]\n if(!this.requireDict[service]){\n this.requireDict[service] = {}\n }\n funcsList.forEach((funcName) => {\n lookUpRes = this.lookUpFn(service, funcName)\n if(lookUpRes) {\n this.requireDict[service][funcName] = lookUpRes\n } else {\n if(!this.requirePending[service]) {\n this.requirePending[service] = []\n }\n this.requirePending[service].push(funcName)\n }\n }, this)\n }, this)\n\n }", "logicallyDeleteChildren(designUpdateComponent){\n\n // Get the children in the Design Version\n let childComponents = DesignVersionComponents.find({\n designVersionId: designUpdateComponent.designVersionId,\n componentParentReferenceIdNew: designUpdateComponent.componentReferenceId\n }).fetch();\n\n let done = false;\n\n childComponents.forEach((child) => {\n\n // If not existing in the Design Update, add them\n let childDuComponent = DesignUpdateComponents.findOne({\n designUpdateId: designUpdateComponent.designUpdateId,\n componentId: child._id\n });\n\n if(!childDuComponent){\n\n // Add as new in scope item - if not already there. If it is there it must already be deleted\n const newDesignUpdateComponentId = this.insertComponentToUpdateScope(child, designUpdateComponent.designUpdateId, UpdateScopeType.SCOPE_IN_SCOPE);\n\n // And mark it as deleted if added\n if(newDesignUpdateComponentId) {\n this.logicallyDeleteComponent(newDesignUpdateComponentId);\n\n // And add a WP component if original component was in WP\n //this.updateWorkPackagesWithNewUpdateItem(designUpdateComponent.designVersionId, designUpdateComponent.designUpdateId, newDesignUpdateComponentId);\n\n childDuComponent = DesignUpdateComponents.findOne({_id: newDesignUpdateComponentId});\n } else {\n\n // No further updates needed\n done = true\n }\n\n } else {\n\n // Mark existing component as deleted\n this.logicallyDeleteComponent(childDuComponent._id);\n }\n\n // Recursively call for these children - if not a Scenario which is the bottom of the tree\n if(child.componentType !== ComponentType.SCENARIO && !done) {\n\n this.logicallyDeleteChildren(childDuComponent);\n }\n });\n\n }", "getDependencies() {\n this.ensureDependenciesInstalled();\n return [];\n }", "function upgradeAllRegisteredInternal() {\n for (var n = 0; n < registeredComponents_.length; n++) {\n upgradeDomInternal(registeredComponents_[n].className);\n }\n }", "function upgradeAllRegisteredInternal() {\n for (var n = 0; n < registeredComponents_.length; n++) {\n upgradeDomInternal(registeredComponents_[n].className);\n }\n }", "function upgradeAllRegisteredInternal() {\n for (var n = 0; n < registeredComponents_.length; n++) {\n upgradeDomInternal(registeredComponents_[n].className);\n }\n }", "function upgradeAllRegisteredInternal() {\n for (var n = 0; n < registeredComponents_.length; n++) {\n upgradeDomInternal(registeredComponents_[n].className);\n }\n }", "function upgradeAllRegisteredInternal() {\n for (var n = 0; n < registeredComponents_.length; n++) {\n upgradeDomInternal(registeredComponents_[n].className);\n }\n }", "async _identify () {\n const nodeVersion = LibPlatform._minVersion(context.recommendedNodeVersion)\n const homebridgeVersion = LibPlatform._minVersion(\n context.recommendedHomebridgeVersion\n )\n this.log(\n '%s v%s, node %s, homebridge v%s',\n context.pluginName, context.pluginVersion,\n context.nodeVersion, context.homebridgeVersion\n )\n this.debug('%s v%s', packageJson.name, packageJson.version)\n if (semver.clean(context.nodeVersion) !== nodeVersion) {\n this.warn('not using recommended node v%s LTS', nodeVersion)\n }\n if (context.homebridgeVersion !== homebridgeVersion) {\n this.warn(\n 'not using recommended homebridge v%s', homebridgeVersion\n )\n }\n const n = Object.keys(this._accessories).length\n if (n > 0) {\n this.log('exposing %d/%d accessories', n, context.maxAccessories)\n }\n this.debug('config.json: %j', this._configJson)\n await this._checkLatest()\n }", "getAllChildren() {\n const children = this.jq.wrapper.find(this.jq.child)\n return children\n }" ]
[ "0.61474013", "0.5913503", "0.58219624", "0.55046535", "0.5239861", "0.5029384", "0.4901486", "0.48491442", "0.4828232", "0.4789205", "0.47610164", "0.4704393", "0.46947834", "0.4628979", "0.45738834", "0.45402002", "0.44923258", "0.4471209", "0.44631553", "0.44427586", "0.442015", "0.4415", "0.43643558", "0.43641657", "0.43527436", "0.43247277", "0.4310105", "0.42943478", "0.42920506", "0.42867404", "0.42740113", "0.4237721", "0.423442", "0.4227627", "0.42258823", "0.42179972", "0.42174867", "0.42038095", "0.41938296", "0.41807437", "0.4163378", "0.4159846", "0.41555727", "0.41515577", "0.41499916", "0.41496405", "0.41458118", "0.41450974", "0.41433874", "0.4132527", "0.41232714", "0.40658194", "0.40552428", "0.4039085", "0.40329716", "0.40244249", "0.4018048", "0.40177357", "0.40161213", "0.40073738", "0.39838034", "0.396496", "0.396496", "0.396496", "0.39636818", "0.39511728", "0.39207023", "0.39186656", "0.39121276", "0.39076266", "0.39061254", "0.39001086", "0.38967267", "0.38814968", "0.387586", "0.387586", "0.38723642", "0.38657475", "0.3861969", "0.3861232", "0.3856697", "0.3855032", "0.3848795", "0.3847835", "0.38370615", "0.38301957", "0.38301957", "0.38301957", "0.38301957", "0.38289613", "0.38273603", "0.38168126", "0.38137668", "0.38119036", "0.38119036", "0.38119036", "0.38119036", "0.38119036", "0.38099593", "0.3807793" ]
0.73463976
0
This method climbs up the hierarchy of addons up to the host application. This prevents previous addons (prior to `this.import`, ca 2.7.0) to break at importing assets when they are used nested in other addons.
_findHost() { let current = this; let app; // Keep iterating upward until we don't have a grandparent. // Has to do this grandparent check because at some point we hit the project. do { app = current.app || app; } while (current.parent.parent && (current = current.parent)); return app; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "discoverAddons() {\n // prefer `packageRoot`, fallback to `root`; this is to maintain backwards compatibility for\n // consumers who create a new instance of the base addon model class directly and don't set\n // `packageRoot`\n let pkgInfo = this.packageInfoCache.getEntry(this.packageRoot || this.root);\n\n if (pkgInfo) {\n let addonPackageList = pkgInfo.discoverAddonAddons();\n this.addonPackages = pkgInfo.generateAddonPackages(\n addonPackageList,\n (addonInfo) => this.shouldIncludeChildAddon && !this.shouldIncludeChildAddon(addonInfo)\n );\n\n // in case any child addons are invalid, dump to the console about them.\n pkgInfo.dumpInvalidAddonPackages(addonPackageList);\n } else {\n // There are cases where an addon can be created in memory and not actually\n // have a root entry (or have one that is not actually pointing to a directory,\n // like 'foo' in some of the tests. We don't want to crash, but want to let\n // things continue even though they're empty.\n this.addonPackages = Object.create(null);\n }\n }", "discoverAddons(){\n this._super.discoverAddons.apply(this, arguments);\n delete this.addonPackages[\"in-repo-addon\"];\n delete this.addonPackages[\"in-repo-engine\"];\n delete this.addonPackages[\"in-repo-lazy-engine\"];\n }", "LoadAssetWithSubAssets() {}", "maybeWrap () {\n if (this.version === 1) {\n this.data.assets.forEach(asset => {\n if (asset.url === 'app.js' || asset.name === 'app.js') {\n const { code } = asset;\n\n if (code && !/(Ext\\.onReady\\(|Ext\\.application\\(|Ext.setup\\()/.test(code)) {\n asset.code = `Ext.onReady(function() {\\n\\n${code}\\n\\n});`;\n }\n }\n });\n }\n }", "async _handlePreviouslyNestedCurrentlyImportedCase() {\n if (!this.consumer) return; // $FlowFixMe this.component.componentMap is set\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n\n if (this.origin === _constants().COMPONENT_ORIGINS.IMPORTED && this.component.componentMap.origin === _constants().COMPONENT_ORIGINS.NESTED) {\n await this._cleanOldNestedComponent();\n this.component.componentMap = this.addComponentToBitMap(this.writeToPath);\n }\n }", "function loadAddons() {\n\tvar modules = getActiveAddonModules(),\n\t\tmodule, options, option, i;\n\n\tfor (i = 0; i < modules.length; i += 1) {\n\t\toptions = modules[i].split(':');\n\n\t\tif (options.length > 1) {\n\t\t\tmodule = options.shift();\n\t\t} else {\n\t\t\t// no options\n\t\t\tmodule = options[0];\n\t\t}\n\n\t\tif (options[0].indexOf('private') !== -1) {\n\t\t\tif (typeof core.modules !== 'object') {\n\t\t\t\tcore.modules = {};\n\t\t\t}\n\t\t\tcore.modules[module] = loadModule(module + '/' + module, 'addon');\n\t\t} else {\n\t\t\tRax.log('loading addon module...', module);\n\t\t\tRax.modules[module] = loadModule(module + '/' + module, 'addon');\n\t\t}\n\t}\n\n}", "function fixImportScript(file){//{filename: STRING, src: STRING}\r\n\r\n\tvar fileName = file.filename.replace(__dirname, '').replace(/\\\\/gm, '/');\r\n\tfileName = fileName.replace(/^\\//, '');\r\n\r\n\t//convert importScripts() to require()\r\n\tif(/importScripts\\s*\\(/g.test(file.src)){\r\n\r\n\t\tconsole.log(' detected importScript for '+fileName);\r\n\r\n\t\tif(/^workers\\//i.test(fileName)){\r\n\r\n\t\t\tif(/importScripts\\s*\\(\\s*'/g.test(file.src)){\r\n\t\t\t\tfile.src = file.src.replace(/importScripts\\s*\\(\\s*(')([^']+)(')/g, function(_match, p1, p2, p3){\r\n\t\t\t\t\treturn 'require(' + p1 + 'workers/' + p2.replace(/\\.js$/i, '') + p3;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif(/importScripts\\s*\\(\\s*\"/g.test(file.src)){\r\n\t\t\t\tfile.src = file.src.replace(/importScripts\\s*\\(\\s*(\")([^\"]+)(\")/g, function(_match, p1, p2, p3){\r\n\t\t\t\t\treturn 'require(' + p1 + 'workers/' + p2.replace(/\\.js$/i, '') + p3;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tfile.src = wrapAsModule(file.src.replace(/importScripts\\s*\\(/g, 'require('));\r\n\r\n\t}\r\n\r\n //DISABLED: env/media/** are now AMD modules (since mmir v5.x)\r\n\t// if(/env\\/media\\//i.test(fileName)){\r\n //\r\n\t// \t//\"pull-up\" simple require-calls (these seem to to not get detected otherwise)\r\n\t// \tdeps = extractSimpleReqCalls(file.src);\r\n //\r\n\t// \tfile.src = wrapAsModule(file.src);//, deps);\r\n\t// }\r\n\r\n if(/tools\\/util_jquery\\//.test(fileName)){\r\n\r\n var jsUtilName = fileName.replace(/.*tools\\/util_jquery\\//, 'tools/util_purejs/').replace(/\\.js$/i, '');\r\n\r\n console.log(' detected jquery module, adding util_purejs variant as depencency -> ', jsUtilName);\r\n\r\n file.src = injectDeps(file.src, [jsUtilName]);\r\n }\r\n\r\n\t//\"convert\" any non-modules to modules\r\n\t// NOTE: this may fail to detect, if a script is not a module (i.e. if there is any \"define(\" contained, but script itself is not a module)\r\n\tif(!/define\\s*\\(/g.test(file.src)){\r\n\t\tfile.src = wrapAsModule(file.src);\r\n\t}\r\n\r\n\r\n\treturn file;\r\n}", "_activeItemContentChanged(newValue,oldValue){if(newValue){var html=newValue;// only append if not empty\nif(null!==html){(0,_haxutils.wipeSlot)(this.themeElement,\"*\");html=(0,_haxutils.encapScript)(newValue);// set in the store\n_haxcmsSiteStore.store.activeItemContent=html;// insert the content as quickly as possible, then work on the dynamic imports\n// @todo this might be why we get a double render some times\nsetTimeout(()=>{if(0===(0,_polymerDom.dom)(this.themeElement).getEffectiveChildNodes().length){let frag=document.createRange().createContextualFragment(html);(0,_polymerDom.dom)(this.themeElement).appendChild(frag);this.dispatchEvent(new CustomEvent(\"json-outline-schema-active-body-changed\",{bubbles:!0,composed:!0,cancelable:!1,detail:html}))}},5);// if there are, dynamically import them\nif(this.manifest.metadata.dynamicElementLoader){let tagsFound=(0,_haxutils.findTagsInHTML)(html);const basePath=(0,_resolveUrl.pathFromUrl)(decodeURIComponent(meta.url));for(var i in tagsFound){const tagName=tagsFound[i];if(this.manifest.metadata.dynamicElementLoader[tagName]&&!window.customElements.get(tagName)){new Promise((res,rej)=>_require.default([`${basePath}../../../../${this.manifest.metadata.dynamicElementLoader[tagName]}`],res,rej)).then(response=>{// useful to debug if dynamic references are coming in\n//console.log(tagName + ' dynamic import');\n}).catch(error=>{/* Error handling */console.log(error);console.log(tagName)})}}}}}}", "parseAssets () {\n const { data : { assets, framework } } = this;\n\n if (framework.frameworkPath) {\n assets.forEach(asset => {\n if (asset.remote) {\n if (asset.code) {\n asset.code = asset.code.replace('{frameworkPath}', framework.frameworkPath);\n }\n\n if (asset.name) {\n asset.name = asset.name.replace('{frameworkPath}', framework.frameworkPath);\n }\n }\n });\n }\n\n assets.forEach(asset => {\n if (asset.remote) {\n if (/^http/i.test(asset.code)) {\n asset.name = asset.code;\n asset.code = '__remote__';\n }\n }\n });\n }", "async populateArtifacts() {\n if (!this.scope) {\n // when capsules are written via the workspace, do not write artifacts, they get created by\n // build-pipeline. when capsules are written via the scope, we do need the dists.\n return;\n }\n\n const extensionsNamesForArtifacts = ['teambit.compilation/compiler'];\n const artifactsFiles = (0, _lodash().flatten)(extensionsNamesForArtifacts.map(extName => (0, _artifactFiles().getArtifactFilesByExtension)(this.component.extensions, extName)));\n const scope = this.scope;\n const artifactsVinylFlattened = [];\n await Promise.all(artifactsFiles.map(async artifactFiles => {\n if (!artifactFiles) return;\n\n if (!(artifactFiles instanceof _artifactFiles().ArtifactFiles)) {\n artifactFiles = (0, _artifactFiles().deserializeArtifactFiles)(artifactFiles);\n } // fyi, if this is coming from the isolator aspect, it is optimized to import all at once.\n // see artifact-files.importMultipleDistsArtifacts().\n\n\n const vinylFiles = await artifactFiles.getVinylsAndImportIfMissing(this.component.scope, scope);\n artifactsVinylFlattened.push(...vinylFiles);\n }));\n const artifactsDir = this.getArtifactsDir();\n\n if (artifactsDir) {\n artifactsVinylFlattened.forEach(a => a.updatePaths({\n newBase: artifactsDir\n }));\n }\n\n this.component.dataToPersist.addManyFiles(artifactsVinylFlattened);\n }", "function optimizeBootModules () {\n\t\t\tgrunt.log.writeln('OK'.green);\n\t\t\tif (!options.dirs || !options.dirs.length) {\n\t\t\t\tfinalize();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgrunt.util.async.forEachSeries(options.dirs, function(dir, next) {\n\t\t\t\tif (typeof dir === 'string') {\n\t\t\t\t\tdir = {\n\t\t\t\t\t\tcombine: false,\n\t\t\t\t\t\tname: dir\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toptimizeDir(dir, next);\n\t\t\t}, function () {\n\t\t\t\tfinalize();\n\t\t\t});\n\t\t}", "function bootstrap(app) {\r\n if (!window['mooa']) {\r\n window.mooa = {};\r\n }\r\n window.mooa.isSingleSpa = true;\r\n window.mooa.name = app.name;\r\n if (app.mode && app.mode === 'iframe') {\r\n var iframeElementExist = isIframeElementExist(app);\r\n if (app.switchMode === 'coexist' && iframeElementExist) {\r\n iframeElementExist.style.display = 'block';\r\n return new Promise(function (resolve, reject) {\r\n resolve();\r\n });\r\n }\r\n createApplicationIframeContainer(app);\r\n if (app.sourceType === 'link') {\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssetsForIframeAndUrl(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n else {\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssetsForIframe(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n }\r\n else if (app.sourceType && app.sourceType === 'link') {\r\n var hasElement = isElementExist(app.appConfig.name);\r\n if (app.switchMode === 'coexist' && hasElement) {\r\n hasElement.style.display = 'block';\r\n return new Promise(function (resolve, reject) {\r\n resolve();\r\n });\r\n }\r\n createApplicationContainer(app);\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssetsByUrl(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n else {\r\n var hasElement = isElementExist(app.appConfig.name);\r\n if (app.switchMode === 'coexist' && hasElement) {\r\n hasElement.style.display = 'block';\r\n return new Promise(function (resolve, reject) {\r\n resolve();\r\n });\r\n }\r\n createApplicationContainer(app);\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssets(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n}", "function hookRequire() {\n if (rootDirs.length > 0) {\n const originalRequire = Module.prototype.require;\n\n Module.prototype.require = function (request) {\n if (!path.isAbsolute(request) && request.startsWith('.')) {\n const moduleDir = path.dirname(this.filename);\n const moduleRootDir = rootDirs.find(rootDir => moduleDir.startsWith(rootDir));\n\n if (moduleRootDir) {\n const moduleRelativeFromRoot = path.relative(moduleRootDir, moduleDir);\n\n if (moduleRootDir) {\n for (const rootDir of rootDirs) {\n const possiblePath = path.join(rootDir, moduleRelativeFromRoot, request);\n\n let resolvedPath;\n try {\n resolvedPath = require.resolve(possiblePath);\n } catch (e) {\n continue;\n }\n\n return originalRequire.call(this, resolvedPath);\n }\n }\n }\n }\n\n return originalRequire.call(this, request);\n };\n }\n}", "_initAddons() {\n //\tInvoke \"before\" hook.\n this.trigger('initAddons:before');\n for (let addon in Mmenu.addons) {\n Mmenu.addons[addon].call(this);\n }\n //\tInvoke \"after\" hook.\n this.trigger('initAddons:after');\n }", "async importAssets (engineData) {\n if (engineData.length === 0) {\n this.addPins()\n this.completlyLoaded = true\n return\n }\n console.log('%c importModel from indexDB', 'background: #222; color: #bada55', engineData)\n await this.import3dModel(engineData, false)\n\n // add component pins\n this.addPins()\n\n this.recreateNets()\n\n this.completlyLoaded = true\n }", "function fixLoadSkipSelf(module) {\n const originalLoad = module.load;\n module.load = function (...args) {\n module.resolveExclusions = new Set();\n return originalLoad.call(this, ...args);\n };\n}", "function getAllAddons() {\n self.getAsyncStatement(\"getAllAddons\").executeAsync({\n handleResult: function(aResults) {\n let row = null;\n while (row = aResults.getNextRow()) {\n let internal_id = row.getResultByName(\"internal_id\");\n addons[internal_id] = self._makeAddonFromAsyncRow(row);\n }\n },\n\n handleError: self.asyncErrorLogger,\n\n handleCompletion: function(aReason) {\n if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {\n ERROR(\"Error retrieving add-ons from database. Returning empty results\");\n aCallback({});\n return;\n }\n\n getAllDevelopers();\n }\n });\n }", "uncacheRoot( root ) {\n\n\t\tconst rootUuid = root.uuid,\n\t\t\tactionsByClip = this._actionsByClip;\n\n\t\tfor ( const clipUuid in actionsByClip ) {\n\n\t\t\tconst actionByRoot = actionsByClip[ clipUuid ].actionByRoot,\n\t\t\t\taction = actionByRoot[ rootUuid ];\n\n\t\t\tif ( action !== undefined ) {\n\n\t\t\t\tthis._deactivateAction( action );\n\t\t\t\tthis._removeInactiveAction( action );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindingByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingByName !== undefined ) {\n\n\t\t\tfor ( const trackName in bindingByName ) {\n\n\t\t\t\tconst binding = bindingByName[ trackName ];\n\t\t\t\tbinding.restoreOriginalState();\n\t\t\t\tthis._removeInactiveBinding( binding );\n\n\t\t\t}\n\n\t\t}\n\n\t}", "uncacheRoot( root ) {\n\n\t\tconst rootUuid = root.uuid,\n\t\t\tactionsByClip = this._actionsByClip;\n\n\t\tfor ( const clipUuid in actionsByClip ) {\n\n\t\t\tconst actionByRoot = actionsByClip[ clipUuid ].actionByRoot,\n\t\t\t\taction = actionByRoot[ rootUuid ];\n\n\t\t\tif ( action !== undefined ) {\n\n\t\t\t\tthis._deactivateAction( action );\n\t\t\t\tthis._removeInactiveAction( action );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindingByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingByName !== undefined ) {\n\n\t\t\tfor ( const trackName in bindingByName ) {\n\n\t\t\t\tconst binding = bindingByName[ trackName ];\n\t\t\t\tbinding.restoreOriginalState();\n\t\t\t\tthis._removeInactiveBinding( binding );\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function ZFarmApp() {\n StageSetup.init();\n\n AssetLib.addManifest(GeneralManifest.NAME, new GeneralManifest());\n AssetLib.addManifest(PlayerManifest.NAME, new PlayerManifest());\n AssetLib.addManifest(GunManifest.NAME, new GunManifest());\n AssetLib.addManifest(SceneryManifest.NAME, new SceneryManifest());\n AssetLib.addManifest(CropManifest.NAME, new CropManifest());\n AssetLib.addManifest(InventoryManifest.NAME, new InventoryManifest());\n AssetLib.addManifest(NavigationManifest.NAME, new NavigationManifest());\n AssetLib.addManifest(ZombieManifest.NAME, new ZombieManifest());\n AssetLib.addManifest(FenceManifest.NAME, new FenceManifest());\n AssetLib.addManifest(MenuManifest.NAME, new MenuManifest());\n\n var root = StageSetup.rootContainer;\n var overlay = StageSetup.overlayContainer;\n var portrait = StageSetup.portraitContainer;\n\n // Start PureMVC core\n this.facade = puremvc.Facade.getInstance(ZFarmApp.CORE_NAME);\n\n // Register commands\n this.facade.registerCommand(PreloaderConstants.DO_START_PRELOADER, StartPreloadCommand);\n this.facade.registerCommand(PreloaderConstants.WHEN_PRELOADER_COMPLETE, PreloadCompleteMacro);\n\n // Register proxies\n this.facade.registerProxy(new PreloaderProxy());\n\n // Register mediators\n var progressBarSkin = new PercentageTextSkin(null);\n progressBarSkin.getContainer().x = 480;\n progressBarSkin.getContainer().y = 270;\n progressBarSkin.addToContainer(overlay);\n\n var progressComponent = new ProgressBarComponent(progressBarSkin);\n\n var preloaderMediator = new PreloaderMediator(progressComponent);\n\n this.facade.registerMediator(preloaderMediator);\n\n var rotatePrompt = new RotatePromptSkin(AssetLib.getManifest(GeneralManifest.NAME));\n rotatePrompt.addToContainer(portrait);\n\n var screenComponent = new ScreenComponent(rotatePrompt, 960, 540, true);\n var screenMediator = new ScreenMediator(screenComponent);\n this.facade.registerMediator(screenMediator);\n\n this.startPreload();\n}", "_manifestChanged(newValue,oldValue){if(newValue&&newValue.metadata&&newValue.items){// ensure there's a dynamicELementLoader defined\n// @todo this could also be a place to mix in criticals\n// that are system required yet we lazy load like grid-plate\nif(!newValue.metadata.dynamicElementLoader){newValue.metadata.dynamicElementLoader={\"a11y-gif-player\":\"@lrnwebcomponents/a11y-gif-player/a11y-gif-player.js\",\"citation-element\":\"@lrnwebcomponents/citation-element/citation-element.js\",\"hero-banner\":\"@lrnwebcomponents/hero-banner/hero-banner.js\",\"image-compare-slider\":\"@lrnwebcomponents/image-compare-slider/image-compare-slider.js\",\"license-element\":\"@lrnwebcomponents/license-element/license-element.js\",\"lrn-aside\":\"@lrnwebcomponents/lrn-aside/lrn-aside.js\",\"lrn-calendar\":\"@lrnwebcomponents/lrn-calendar/lrn-calendar.js\",\"lrn-math\":\"@lrnwebcomponents/lrn-math/lrn-math.js\",\"lrn-table\":\"@lrnwebcomponents/lrn-table/lrn-table.js\",\"lrn-vocab\":\"@lrnwebcomponents/lrn-vocab/lrn-vocab.js\",\"lrndesign-blockquote\":\"@lrnwebcomponents/lrndesign-blockquote/lrndesign-blockquote.js\",\"magazine-cover\":\"@lrnwebcomponents/magazine-cover/magazine-cover.js\",\"media-behaviors\":\"@lrnwebcomponents/media-behaviors/media-behaviors.js\",\"media-image\":\"@lrnwebcomponents/media-image/media-image.js\",\"meme-maker\":\"@lrnwebcomponents/meme-maker/meme-maker.js\",\"multiple-choice\":\"@lrnwebcomponents/multiple-choice/multiple-choice.js\",\"paper-audio-player\":\"@lrnwebcomponents/paper-audio-player/paper-audio-player.js\",\"person-testimonial\":\"@lrnwebcomponents/person-testimonial/person-testimonial.js\",\"place-holder\":\"@lrnwebcomponents/place-holder/place-holder.js\",\"q-r\":\"@lrnwebcomponents/q-r/q-r.js\",\"full-width-image\":\"@lrnwebcomponents/full-width-image/full-width-image.js\",\"self-check\":\"@lrnwebcomponents/self-check/self-check.js\",\"simple-concept-network\":\"@lrnwebcomponents/simple-concept-network/simple-concept-network.js\",\"stop-note\":\"@lrnwebcomponents/stop-note/stop-note.js\",\"tab-list\":\"@lrnwebcomponents/tab-list/tab-list.js\",\"task-list\":\"@lrnwebcomponents/task-list/task-list.js\",\"video-player\":\"@lrnwebcomponents/video-player/video-player.js\",\"wave-player\":\"@lrnwebcomponents/wave-player/wave-player.js\",\"wikipedia-query\":\"@lrnwebcomponents/wikipedia-query/wikipedia-query.js\"}}_haxcmsSiteStore.store.manifest=newValue;this.dispatchEvent(new CustomEvent(\"json-outline-schema-changed\",{bubbles:!0,composed:!0,cancelable:!1,detail:newValue}))}}", "function compCode_20160614_154125() {\r\rapp.beginUndoGroup(\"massiveBusiness\");\r\rtry {\r\r// Create Folder hierarchy\r\tvar zcompcodescripts_folder = getItem(\"Z_Compcode_Scripts\", FolderItem, app.project.rootFolder);\r\tif (zcompcodescripts_folder === null) {\r\t\tzcompcodescripts_folder = app.project.items.addFolder(\"Z_Compcode_Scripts\");\r\t}\r\tvar buildings_folder = getItem(\"Buildings\", FolderItem, zcompcodescripts_folder);\r\tif (buildings_folder === null) {\r\t\tbuildings_folder = app.project.items.addFolder(\"Buildings\");\r\t\tbuildings_folder.parentFolder = zcompcodescripts_folder;\r\t}\r\tvar out_folder = getItem(\"OUT\", FolderItem, buildings_folder);\r\tif (out_folder === null) {\r\t\tout_folder = app.project.items.addFolder(\"OUT\");\r\t\tout_folder.parentFolder = buildings_folder;\r\t}\r\tvar precomps_folder = getItem(\"PreComps\", FolderItem, buildings_folder);\r\tif (precomps_folder === null) {\r\t\tprecomps_folder = app.project.items.addFolder(\"PreComps\");\r\t\tprecomps_folder.parentFolder = buildings_folder;\r\t}\r\r// Create Compositions\r\tvar massivebusiness_comp = app.project.items.addComp(\"massiveBusiness\", 412, 412, 1, 2.8, 25);\r\t\tmassivebusiness_comp.time = 2.76;\r\t\tmassivebusiness_comp.bgColor = [0,0,0];\r\t\tmassivebusiness_comp.parentFolder = out_folder;\r\tvar massivebusinessanimation_comp = getItem(\"massiveBusiness_animation\", CompItem, precomps_folder);\r\tvar massivebusinessanimation_comp_populate = false;\r\tif (massivebusinessanimation_comp === null) {\r\t\tmassivebusinessanimation_comp = app.project.items.addComp(\"massiveBusiness_animation\", 412, 412, 1, 2.8, 25);\r\t\tmassivebusinessanimation_comp.time = 0.04;\r\t\tmassivebusinessanimation_comp.bgColor = [0,0,0];\r\t\tmassivebusinessanimation_comp.workAreaDuration = 1.08010005950928;\r\t\tmassivebusinessanimation_comp.motionBlur = true;\r\t\tmassivebusinessanimation_comp.parentFolder = precomps_folder;\r\t\tmassivebusinessanimation_comp_populate = true;\r\t}\r\r// Working with comp \"massiveBusiness\", varName \"massivebusiness_comp\";\r\tmassivebusiness_comp.openInViewer();\r\t// Add existing composition \"massiveBusiness_animation\", varName \"massivebusinessanimation_comp\";\r\tvar massivebusinessanimation = massivebusiness_comp.layers.add(massivebusinessanimation_comp);\r\t\tmassivebusinessanimation.collapseTransformation = true;\r\t\tmassivebusinessanimation.motionBlur = true;\r\t\tmassivebusinessanimation.moveToEnd();\r\t\tmassivebusinessanimation.timeRemapEnabled = true;\r\t\tvar massivebusinessanimationTimeRemap = massivebusinessanimation.property(\"ADBE Time Remapping\");\r\t\t\tmassivebusinessanimationTimeRemap.setValueAtTime(99999, massivebusinessanimationTimeRemap.keyValue(1));\r\t\t\tmassivebusinessanimationTimeRemap.removeKey(2);\r\t\t\tmassivebusinessanimationTimeRemap.removeKey(1);\r\t\t\tvar massivebusinessanimationTimeRemap_keyTimesArray = [0,1.2,1.6,2.8];\r\t\t\tvar massivebusinessanimationTimeRemap_valuesArray = [0,1.2,1.2,0];\r\t\t\tmassivebusinessanimationTimeRemap.setValuesAtTimes(massivebusinessanimationTimeRemap_keyTimesArray, massivebusinessanimationTimeRemap_valuesArray);\r\t\t\tmassivebusinessanimationTimeRemap.removeKey(massivebusinessanimationTimeRemap.nearestKeyIndex(99999));\r\t\tmassivebusinessanimation.selected = false;\r\t// Add Shape Layer \"Icon_bg_mask\", varName \"iconbgmask\";\r\tvar iconbgmask = massivebusiness_comp.layers.addShape();\r\t\ticonbgmask.name = \"Icon_bg_mask\";\r\t\ticonbgmask.enabled = false;\r\t\ticonbgmask.motionBlur = true;\r\t\ticonbgmask.moveToEnd();\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).name = \"chemicals Outlines - Group 22\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).name = \"Group 22\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgmaskPath = iconbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgmaskPath_newShape = new Shape();\r\t\t\ticonbgmaskPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgmaskPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgmaskPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgmaskPath_newShape.closed = true;\r\t\ticonbgmaskPath.setValue(iconbgmaskPath_newShape);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(12);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Cap\").setValue(2);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).name = \"chemicals Outlines - Group 23\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).name = \"Group 23\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgmaskPath = iconbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgmaskPath_newShape = new Shape();\r\t\t\ticonbgmaskPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgmaskPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgmaskPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgmaskPath_newShape.closed = true;\r\t\ticonbgmaskPath.setValue(iconbgmaskPath_newShape);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(2).property(\"ADBE Vector Fill Color\").setValue([0.14100000718061,0.67099998324525,0.88999998803232,1]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Transform Group\").property(\"ADBE Anchor Point\").setValue([206,206,0]);\r\t\tvar iconbgmaskScale = iconbgmask.property(\"ADBE Transform Group\").property(\"ADBE Scale\");\r\t\t\tvar iconbgmaskScale_keyTimesArray = [0,0.4,2.4,2.76];\r\t\t\tvar iconbgmaskScale_valuesArray = [[0,0,100],[100,100,100],[100,100,100],[0,0,100]];\r\t\t\ticonbgmaskScale.setValuesAtTimes(iconbgmaskScale_keyTimesArray, iconbgmaskScale_valuesArray);\r\t\t\tvar iconbgmaskScale_easeInSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgmaskScale_easeInInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgmaskScale_easeOutSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgmaskScale_easeOutInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgmaskScale_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar iconbgmaskScale_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(iconbgmaskScale, iconbgmaskScale_keyTimesArray, [iconbgmaskScale_easeInSpeedArray, iconbgmaskScale_easeInInfluArray], [iconbgmaskScale_easeOutSpeedArray, iconbgmaskScale_easeOutInfluArray], [iconbgmaskScale_keyInInterpolationType, iconbgmaskScale_keyOutInterpolationType]);\r\r\t\ticonbgmask.selected = false;\r\t// Add existing composition \"massiveBusiness_animation\", varName \"massivebusinessanimation_comp\";\r\tvar shadow = massivebusiness_comp.layers.add(massivebusinessanimation_comp);\r\t\tshadow.name = \"shadow\";\r\t\tshadow.collapseTransformation = true;\r\t\tshadow.motionBlur = true;\r\t\tshadow.moveToEnd();\r\t\tshadow.trackMatteType = TrackMatteType.ALPHA;\r\t\tshadow.timeRemapEnabled = true;\r\t\tvar shadowTimeRemap = shadow.property(\"ADBE Time Remapping\");\r\t\t\tshadowTimeRemap.setValueAtTime(99999, shadowTimeRemap.keyValue(1));\r\t\t\tshadowTimeRemap.removeKey(2);\r\t\t\tshadowTimeRemap.removeKey(1);\r\t\t\tvar shadowTimeRemap_keyTimesArray = [0,1.2,1.6,2.8];\r\t\t\tvar shadowTimeRemap_valuesArray = [0,1.2,1.2,0];\r\t\t\tshadowTimeRemap.setValuesAtTimes(shadowTimeRemap_keyTimesArray, shadowTimeRemap_valuesArray);\r\t\t\tshadowTimeRemap.removeKey(shadowTimeRemap.nearestKeyIndex(99999));\r\t\tshadow.property(\"ADBE Effect Parade\").addProperty(\"ADBE Fill\");\r\t\tshadow.property(\"ADBE Effect Parade\").property(1).property(\"ADBE Fill-0002\").setValue([0,0,0,1]);\r\t\tvar shadowPosition = shadow.property(\"ADBE Transform Group\").property(\"ADBE Position\");\r\t\t\tvar shadowPosition_keyTimesArray = [0.28,0.6,2.2,2.48];\r\t\t\tvar shadowPosition_valuesArray = [[206,206,0],[227.5,218.5,0],[227.5,218.5,0],[206,206,0]];\r\t\t\tshadowPosition.setValuesAtTimes(shadowPosition_keyTimesArray, shadowPosition_valuesArray);\r\t\t\tvar shadowPosition_inSpatialTangents = [[-3.58333325386047,-2.08333325386047,0],[-3.58333325386047,-2.08333325386047,0],[0,0,0],[3.58333325386047,2.08333325386047,0]];\r\t\t\tvar shadowPosition_outSpatialTangents = [[3.58333325386047,2.08333325386047,0],[0,0,0],[-3.58333325386047,-2.08333325386047,0],[-3.58333325386047,-2.08333325386047,0]];\r\t\t\tapplySpatialTangents(shadowPosition, shadowPosition_keyTimesArray, shadowPosition_inSpatialTangents, shadowPosition_outSpatialTangents);\r\t\t\tvar shadowPosition_easeInSpeedArray = [0,0,0,0];\r\t\t\tvar shadowPosition_easeInInfluArray = [16.666666667,50,50,16.666666667];\r\t\t\tvar shadowPosition_easeOutSpeedArray = [0,0,0,0];\r\t\t\tvar shadowPosition_easeOutInfluArray = [50,16.666666667,16.666666667,50];\r\t\t\tvar shadowPosition_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar shadowPosition_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(shadowPosition, shadowPosition_keyTimesArray, [shadowPosition_easeInSpeedArray, shadowPosition_easeInInfluArray], [shadowPosition_easeOutSpeedArray, shadowPosition_easeOutInfluArray], [shadowPosition_keyInInterpolationType, shadowPosition_keyOutInterpolationType]);\r\r\t\tshadow.property(\"ADBE Transform Group\").property(\"ADBE Opacity\").setValue(20);\r\t\tshadow.selected = false;\r\t// Add Shape Layer \"Icon_bg\", varName \"iconbg\";\r\tvar iconbg = massivebusiness_comp.layers.addShape();\r\t\ticonbg.name = \"Icon_bg\";\r\t\ticonbg.motionBlur = true;\r\t\ticonbg.moveToEnd();\r\t\ticonbg.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).name = \"chemicals Outlines - Group 22\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).name = \"Group 22\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgPath = iconbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgPath_newShape = new Shape();\r\t\t\ticonbgPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgPath_newShape.closed = true;\r\t\ticonbgPath.setValue(iconbgPath_newShape);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(12);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Cap\").setValue(2);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).name = \"chemicals Outlines - Group 23\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).name = \"Group 23\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgPath = iconbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgPath_newShape = new Shape();\r\t\t\ticonbgPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgPath_newShape.closed = true;\r\t\ticonbgPath.setValue(iconbgPath_newShape);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(2).property(\"ADBE Vector Fill Color\").setValue([0.1410000026226,0.6710000038147,0.88999998569489,1]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(2).property(\"ADBE Vector Fill Opacity\").setValue(60);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Transform Group\").property(\"ADBE Anchor Point\").setValue([206,206,0]);\r\t\tvar iconbgScale = iconbg.property(\"ADBE Transform Group\").property(\"ADBE Scale\");\r\t\t\tvar iconbgScale_keyTimesArray = [0,0.4,2.4,2.76];\r\t\t\tvar iconbgScale_valuesArray = [[0,0,100],[100,100,100],[100,100,100],[0,0,100]];\r\t\t\ticonbgScale.setValuesAtTimes(iconbgScale_keyTimesArray, iconbgScale_valuesArray);\r\t\t\tvar iconbgScale_easeInSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgScale_easeInInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgScale_easeOutSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgScale_easeOutInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgScale_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar iconbgScale_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(iconbgScale, iconbgScale_keyTimesArray, [iconbgScale_easeInSpeedArray, iconbgScale_easeInInfluArray], [iconbgScale_easeOutSpeedArray, iconbgScale_easeOutInfluArray], [iconbgScale_keyInInterpolationType, iconbgScale_keyOutInterpolationType]);\r\r\t\ticonbg.selected = false;\r// Working with comp \"massiveBusiness_animation\", varName \"massivebusinessanimation_comp\";\rif (massivebusinessanimation_comp_populate === true) {\r\t// Add Shape Layer \"massiveBusiness Outlines - Group 1\", varName \"massivebusinessOutlinesGroup1\";\r\tvar massivebusinessOutlinesGroup1 = massivebusinessanimation_comp.layers.addShape();\r\t\tmassivebusinessOutlinesGroup1.name = \"massiveBusiness Outlines - Group 1\";\r\t\tmassivebusinessOutlinesGroup1.startTime = 0.24;\r\t\tmassivebusinessOutlinesGroup1.inPoint = 0.36;\r\t\tmassivebusinessOutlinesGroup1.outPoint = 3.04;\r\t\tmassivebusinessOutlinesGroup1.motionBlur = true;\r\t\tmassivebusinessOutlinesGroup1.moveToEnd();\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar massivebusinessOutlinesGroup1Path = massivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\t\tvar massivebusinessOutlinesGroup1Path_keyTimesArray = [0.36, 0.48, 0.68, 1.08];\r\t\t\tvar massivebusinessOutlinesGroup1Path_object = {};\r\t\t\t\tmassivebusinessOutlinesGroup1Path_object.closed = true;\r\t\t\t\tmassivebusinessOutlinesGroup1Path_object.vertices = [[[-9.59049987792969, 70.5160064697266], [14.5905151367188, 70.5160064697266], [13.9830322265625, 70.4839935302734], [10.3190307617188, 70.4839935302734], [10.2295227050781, 70.5890045166016], [3.76750183105469, 70.5890045166016], [3.85700988769531, 70.4839935302734], [1.54403686523438, 70.1714935302734], [1.45449829101562, 70.2454986572266], [-2.00997924804688, 70.2884979248047], [-2.04048156738281, 70.2454986572266], [-5.70198059082031, 70.2884979248047], [-5.73248291015625, 70.2454986572266], [-9.39398193359375, 70.2884979248047]], [[-84.5904998779297, 70.5160064697266], [84.5905151367188, 70.5160064697266], [83.9830322265625, 70.4839935302734], [57.8190307617188, 70.4839935302734], [57.7295227050781, 70.5890045166016], [46.2675170898438, 70.5890045166016], [46.3570251464844, 70.4839935302734], [24.0440216064453, 70.1714935302734], [23.9545135498047, 70.2454986572266], [-12.0099792480469, 70.2884979248047], [-12.0404815673828, 70.2454986572266], [-48.2019805908203, 70.2884979248047], [-48.2324829101562, 70.2454986572266], [-84.3939819335938, 70.2884979248047]], [[-84.5904998779297, 70.5160064697266], [84.5905151367188, 70.5160064697266], [79.6790161132812, 6.48399353027344], [57.8900146484375, 6.48399353027344], [57.8005065917969, 6.58900451660156], [46.3385009765625, 6.58900451660156], [46.4280090332031, 6.48399353027344], [24.1150054931641, 6.17149353027344], [24.0254974365234, 5.68299865722656], [-11.9389953613281, 5.72599792480469], [-11.9694976806641, 5.68299865722656], [-48.1309967041016, 5.72599792480469], [-48.1614990234375, 5.68299865722656], [-84.322998046875, 5.72599792480469]], [[-84.5904998779297, 70.5160064697266], [84.5905151367188, 70.5160064697266], [79.5895080566406, -70.5160064697266], [57.8005065917969, -70.5160064697266], [57.8005065917969, 6.58900451660156], [46.3385009765625, 6.58900451660156], [46.3385009765625, -70.5160064697266], [24.0254974365234, -70.5160064697266], [24.0254974365234, 5.68299865722656], [-11.9694976806641, -16.0240020751953], [-11.9694976806641, 5.68299865722656], [-48.1614990234375, -16.0240020751953], [-48.1614990234375, 5.68299865722656], [-84.3535003662109, -16.0240020751953]]];\r\t\t\taddShapeKeyframes(massivebusinessOutlinesGroup1Path, massivebusinessOutlinesGroup1Path_keyTimesArray, massivebusinessOutlinesGroup1Path_object);\r\t\t\tvar massivebusinessOutlinesGroup1Path_easeInSpeedArray = [0,0,2.83349473266731,0];\r\t\t\tvar massivebusinessOutlinesGroup1Path_easeInInfluArray = [65,65,65,65];\r\t\t\tvar massivebusinessOutlinesGroup1Path_easeOutSpeedArray = [0,0,2.83347893605559,0];\r\t\t\tvar massivebusinessOutlinesGroup1Path_easeOutInfluArray = [65,65,65,16.666666667];\r\t\t\tvar massivebusinessOutlinesGroup1Path_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar massivebusinessOutlinesGroup1Path_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(massivebusinessOutlinesGroup1Path, massivebusinessOutlinesGroup1Path_keyTimesArray, [massivebusinessOutlinesGroup1Path_easeInSpeedArray, massivebusinessOutlinesGroup1Path_easeInInfluArray], [massivebusinessOutlinesGroup1Path_easeOutSpeedArray, massivebusinessOutlinesGroup1Path_easeOutInfluArray], [massivebusinessOutlinesGroup1Path_keyInInterpolationType, massivebusinessOutlinesGroup1Path_keyOutInterpolationType]);\r\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(8.55399990081787);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(3).property(\"ADBE Vector Fill Color\").setValue([1,1,1,1]);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Position\").setValue([203.999893188477,194.181503295898]);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Transform Group\").property(\"ADBE Anchor Point\").setValue([203.999893188477,194.181503295898,0]);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Transform Group\").property(\"ADBE Position\").setValue([203.999893188477,194.181503295898,0]);\r\t\tmassivebusinessOutlinesGroup1.selected = false;\r}\rmassivebusiness_comp.openInViewer();\r\r} catch(e) {\r\talert(e.toString() + \"\\nError on line: \" + e.line.toString());\r}\rapp.endUndoGroup();\r\r\rfunction getItem(itemName, itemInstanceName, locationObject) {\r\tif (locationObject.numItems > 0) {\r\t\tfor (var i = 1; i <= locationObject.numItems; i ++) {\r\t\t\tvar curItem = locationObject.item(i);\r\t\t\tif (curItem.name === itemName) {\r\t\t\t\tif (curItem instanceof itemInstanceName || (curItem.mainSource !== \"undefined\" && curItem.mainSource instanceof itemInstanceName)) {\r\t\t\t\t\treturn curItem;\r\t\t\t\t}\r\t\t\t}\r\t\t}\r\t}\r\treturn null;\r}\r\rfunction applyEasing(property, keyTimesArray, easeInArray, easeOutArray, keyInterpolationArray) {\r\tfor (var i = 0; i < keyTimesArray.length; i ++) {\r\t\tif (property.propertyValueType === PropertyValueType.TwoD) {\r\t\t\tvar easeIn0 = new KeyframeEase(easeInArray[0][i][0], easeInArray[1][i][0]);\r\t\t\tvar easeOut0 = new KeyframeEase(easeOutArray[0][i][0], easeOutArray[1][i][0]);\r\t\t\tvar easeIn1 = new KeyframeEase(easeInArray[0][i][1], easeInArray[1][i][1]);\r\t\t\tvar easeOut1 = new KeyframeEase(easeOutArray[0][i][1], easeOutArray[1][i][1]);\r\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn0, easeIn1], [easeOut0, easeOut1]);\r\t\t} else if (property.propertyValueType === PropertyValueType.ThreeD) {\r\t\t\tvar easeIn0 = new KeyframeEase(easeInArray[0][i][0], easeInArray[1][i][0]);\r\t\t\tvar easeOut0 = new KeyframeEase(easeOutArray[0][i][0], easeOutArray[1][i][0]);\r\t\t\tvar easeIn1 = new KeyframeEase(easeInArray[0][i][1], easeInArray[1][i][1]);\r\t\t\tvar easeOut1 = new KeyframeEase(easeOutArray[0][i][1], easeOutArray[1][i][1]);\r\t\t\tvar easeIn2 = new KeyframeEase(easeInArray[0][i][2], easeInArray[1][i][2]);\r\t\t\tvar easeOut2 = new KeyframeEase(easeOutArray[0][i][2], easeOutArray[1][i][2]);\r\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn0, easeIn1, easeIn2], [easeOut0, easeOut1, easeOut2]);\r\t\t} else {\r\t\t\tvar easeIn = new KeyframeEase(easeInArray[0][i], easeInArray[1][i]);\r\t\t\tvar easeOut = new KeyframeEase(easeOutArray[0][i], easeOutArray[1][i]);\r\t\t\tif (keyInterpolationArray[1][i] !== KeyframeInterpolationType.HOLD) {\r\t\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn], [easeOut]);\r\t\t\t} else {\r\t\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn]);\r\t\t\t}\r\t\t}\r\t\tproperty.setInterpolationTypeAtKey(i+1, keyInterpolationArray[0][i], keyInterpolationArray[1][i]);\r\t}\r}\r\rfunction applySpatialTangents(property, keyTimesArray, inSpatialTangentsArray, outSpatialTangentsArray) {\r\tfor (var sp = 0; sp < keyTimesArray.length; sp ++) {\r\t\tproperty.setSpatialTangentsAtKey(sp+1, inSpatialTangentsArray[sp], outSpatialTangentsArray[sp]);\r\t}\r}\rfunction addShapeKeyframes(myPath, keyTimesArray, myShapeObject) {\r\tvar valuesArray = [];\r\tfor (var i = 0, il = keyTimesArray.length; i < il; i ++) {\r\t\tvar newShape = new Shape();\r\t\tfor (var prop in myShapeObject) {\r\t\t\tif (myShapeObject[prop] instanceof Array) { newShape[prop] = myShapeObject[prop][i]; }\r\t\t\telse { newShape[prop] = myShapeObject[prop]; }\r\t\t}\r\t\tvaluesArray.push(newShape);\r\t}\r\tmyPath.setValuesAtTimes(keyTimesArray, valuesArray);\r}\r\r}", "function spSwitchTopAsset() {\n\ttry {\n\t\tvar asset\t\t= document.getElementById('js-article-top-wide-asset');\n\t\tvar articlecol\t= document.getElementById('js-article-column');\n\n\t\tvar nodes = asset.childNodes;\n\t\tfor (var i = 0; i < nodes.length; i++) {\n\t\t\tvar node = nodes[i];\n\t\t\tvar c = node.className;\n\t\t\tif(c && c.toString().indexOf('spXXLPano') > -1){\n\t\t\t\tnode.className = c.replace('spXXLPano', 'panoV9');\n\t\t\t\tnode.removeAttribute('style');\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($('#einestages').length > 0) {\n\t\t\t$('#content-main > .column-both').addClass('einestages-middle1-active');\n\t\t} else {\n\t\t\t$(articlecol).prepend($(asset).html());\n\t\t\t$(asset).empty();\n\t\t}\n\t\t\n\t\t$('#js-article-column .panoV9:first-child a').removeAttr('style');\n\n\t\treturn false;\n\t}\n\tcatch (e) {}\n}", "function loadLevelAssets(event) {\n gameSounds.click();\n fadeOutAnimation();\n\n const eventTargetId = event.target.id;\n removeBackButton(\"#startBackButton\");\n\n setTimeout(function () {\n //Replace back button\n createBackButton(\"levelsBackButton\");\n document.querySelector(\"#levelsBackButton\").addEventListener(\"click\", goBackLevels);\n\n document.querySelector(\"#arrows\").classList.remove(\"hidden\");\n document.querySelector(\".points\").classList.remove(\"hidden\");\n document.querySelector(\".highPoints\").classList.remove(\"hidden\");\n document.querySelector(\"#background-image\").classList.remove(\"hidden\");\n document.querySelector(\"#levelsScreen\").remove();\n uploadBackground(`${eventTargetId}.png`);\n fadeInAnimation();\n\n if (document.querySelector(\"#snifcontainer > svg\")) {\n useSVG(\"#sniffTheFox\", \"snifFox\", \"#sprites\");\n sniff = document.querySelector(\"#snifFox\");\n loadDrops();\n } else {\n loadFox(); //load in the fox\n }\n }, 300);\n\n //also set droplet svgs to appropriate-ones and load both snif and droplets\n}", "_rewriteExternalModuleScriptTagsAsImports(ast) {\n return __awaiter(this, void 0, void 0, function* () {\n for (const scriptTag of dom5.queryAll(ast, matchers.externalModuleScript)) {\n const scriptHref = dom5.getAttribute(scriptTag, 'src');\n const resolvedImportUrl = this.bundler.analyzer.urlResolver.resolve(this.document.parsedDocument.baseUrl, scriptHref);\n if (resolvedImportUrl === undefined) {\n return;\n }\n // We won't inline a module script if its not supposed to be in this\n // bundle.\n if (!this.assignedBundle.bundle.files.has(resolvedImportUrl)) {\n return;\n }\n const scriptContent = `import ${JSON.stringify(scriptHref)};`;\n dom5.removeAttribute(scriptTag, 'src');\n dom5.setTextContent(scriptTag, encode_string_1.default(scriptContent, true));\n }\n });\n }", "function drupalgap_bootstrap() {\n try {\n // Load up any contrib and/or custom modules (the DG core moodules have\n // already been loaded at this point), load the theme and all blocks. Then\n // build the menu router, load the menus, and build the theme registry.\n drupalgap_load_modules();\n drupalgap_load_theme();\n drupalgap_load_blocks();\n menu_router_build();\n drupalgap_menus_load();\n drupalgap_theme_registry_build();\n\n // Attach device back button handler (Android).\n document.addEventListener('backbutton', drupalgap_back, false);\n }\n catch (error) { console.log('drupalgap_bootstrap - ' + error); }\n}", "function initImportAddonDialog(){\r\n\t\t\r\n\t\tvar objDialog = jQuery(\"#dialog_import_addons\");\r\n\t\t\r\n\t\tvar settingsDropzone = g_ucAdmin.getDropzoneSingleLineSettings();\r\n\t\t\r\n\t\tsettingsDropzone.parallelUploads = 1;\r\n\t\tsettingsDropzone.autoProcessQueue = false;\r\n\t\t\r\n\t\tsettingsDropzone.params = {\r\n\t addontype: g_addonsType\r\n\t\t};\r\n\t\t\r\n\t\t//init dropzone\r\n\t\tDropzone.autoDiscover = false;\r\n\t\tvar objDropzone = new Dropzone(\"#dialog_import_addons_form\", settingsDropzone);\r\n\t\t\r\n\t\t//send file\r\n\t\tobjDropzone.on(\"sending\", function(file, xhr, formData){\r\n\t\t\t\r\n\t\t\tvar catID = jQuery(\"#dialog_import_addons\").data(\"catid\");\r\n\t\t\tvar parentID = jQuery(\"#dialog_import_addons\").data(\"parentid\");\r\n\t\t\t\r\n\t\t\tvar isOverwrite = jQuery(\"#dialog_import_check_overwrite\").is(\":checked\");\r\n\t\t\tvar importType = jQuery(\"#dialog_import_catname\").val();\r\n\t\t\t\r\n\t\t\tformData.append(\"catid\", catID);\r\n\t\t\tformData.append(\"parentid\", parentID);\r\n\t\t\tformData.append(\"isoverwrite\", isOverwrite);\r\n\t\t\tformData.append(\"importtype\", importType);\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//on one file complete\r\n\t\tobjDropzone.on(\"complete\", function(response) {\r\n\t\t\t\r\n\t\t\tobjDropzone.removeFile(response);\r\n\t\t\t\r\n\t\t\tvar responseText = response.xhr.responseText;\r\n\t\t\tg_ucAdmin.setErrorMessageID(\"dialog_import_addons_error\");\r\n\t\t\tg_ucAdmin.ajaxReturnCheck(responseText, function(objResponse){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t//store response\r\n\t\t\t\tobjDialog.data(\"last_response\", objResponse);\r\n\t\t\t\t\r\n\t\t\t\t//show log\r\n\t\t\t\tvar objLog = jQuery(\"#dialog_import_addons_log\");\r\n\t\t\t\t\r\n\t\t\t\tobjLog.show();\r\n\t\t\t\tobjLog.append(objResponse.import_log + \"<br>\");\r\n\t\t\t\t\r\n\t\t\t\tobjDropzone.processQueue();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//on all complete\r\n\t\tobjDropzone.on(\"queuecomplete\", function() {\r\n\t\t\t\r\n\t\t\tvar lastResponse = objDialog.data(\"last_response\");\r\n\t\t\t\r\n\t\t\tif(lastResponse)\r\n\t\t\t\tsetHtmlListCombo(lastResponse);\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\t\t\r\n\t\tobjDialog.data(\"dropzone\", objDropzone);\r\n\t\t\r\n\t\t//on action click\r\n\t\tvar objDialog = objDialog;\r\n\t\t\r\n\t\tjQuery(\"#dialog_import_addons_action\").on(\"click\",function(){\r\n\t \r\n\t\t\tvar objDropzone = objDialog.data(\"dropzone\");\r\n\t\t\t\r\n\t\t\tobjDialog.data(\"last_response\", null);\r\n\t\t\t\r\n\t\t\tobjDropzone.processQueue();\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t}", "function buildApp(){\n var idAlias={};\n //idAlias[__dirname + \"/node_modules/react/react.js\"] = \"react\";\n idAlias[__dirname + \"/src/js/vendor/react-v0.12.2.min.js\"] = \"react\";\n idAlias[__dirname + \"/src/js/vendor/jquery.js\"] = \"jquery\";\n\n /**\n * We want to expose our core modules so they can be referenced via 'core/modulename' instead of './js/core/modulename'\n * We also want to alias some of the third party libs, and expose them so they can be referenced via 'jquery', 'react', etc.\n */\n //var labeler = through.obj(function (module, enc, next) {\n // console.log('module id: ' + module.id);\n // //expose id as 'react' rather than 'nodemodules/react/react.js'\n // if(idAlias[module.id]){\n // module.id = idAlias[module.id];\n // //console.log('exposing new id: ' + module.id);\n // }\n //\n // //iterate over each dependency of the module\n // Object.keys(module.deps).forEach(function (key) {\n // console.log('dep: %s key: %s', module.deps[key], key);\n // //expose core by 'core/X' rather than './js/core/X'\n // // if(key.indexOf('js/') >= 0) //only expose/tinker with core\n // module.deps[key] = key;\n //\n // //if there's a dep on something we've aliased, point to the alias.\n // //e.g. instead of 'react':'some/really/long/path/react.js' do 'react':'react'\n // if(idAlias[module.deps[key]]){\n // //console.log('pointing to alias for key:' + key);\n // module.deps[key] = key;\n // }\n // });\n //\n // this.push(module);\n // next();\n //});\n\n\n\n\n function getAppFilePaths(){\n //var files =glob.sync(\"core/**/*.js*\", { //./src/js/\n // cwd: buildConfig.jsBaseDir\n //});\n //files = _.filter(files, function(filePath){\n // return filePath.indexOf('vendor/') < 0;\n //});\n var files = [];\n files.push(\"app2\");\n\n var withoutExtensions=[];\n files.forEach(function(file){\n withoutExtensions.push(file.replace('.jsx', '').replace('.js', ''));\n });\n\n console.log('app file paths:\\n ' + JSON.stringify(withoutExtensions, null, 4));\n return withoutExtensions;\n }\n //mixin some of the common transforms, paths, etc.\n var browserifyConfig = mixinCommonBrowserifyConfig({\n entries:[].concat(getAppFilePaths())\n });\n console.log('build:app browserify config: %s', JSON.stringify(browserifyConfig, null, 2));\n\n var bundler = browserify(browserifyConfig);\n\n // bundler.pipeline.get('label').splice(0, 1, labeler);//rename module ids\n\n //require any third party libraries.\n bundler.require(buildConfig.jsBaseDir + '/vendor/jquery.js', {expose:'jquery'}); //expose is how the modules require it. e.g. require('jquery');\n bundler.require(buildConfig.jsBaseDir + '/vendor/react-v0.12.2.min.js', {expose:'react'});\n\n return bundler\n .bundle()\n .pipe(source('bundle.js'))//the generated file name\n //.pipe(gStreamify(uglify(buildConfig.uglify)))\n .pipe(gulp.dest(buildConfig.jsDistDir));//where to put the generated file name\n}", "function initAddons()\r\n{\r\n\t// Initialize code wrapping\r\n\tinitWrapToggle();\r\n\r\n\t// Initialize the code editor\r\n\tinitEditor();\r\n\r\n\t// Initialize tab persistence\r\n\tinitTabPersistence();\r\n\r\n\t// Initialize line reference\r\n\tinitLineReference();\r\n\r\n\t// Initialize bootstrap components\r\n\tinitBootstrap();\r\n}", "function Extention(){\n var that = this;\n\n /**\n * la classe de gesion des dossiers\n */\n this.fm=new FolderManager();\n\n /**\n * tableau stockant les différentes instance de l'application sur le navigateur\n */\n this.web=[]; // workers for web\n\n /*\n ====================\n EVENTS\n ====================\n */\n\n /**\n * Extention.initEvents - initialisation des événements du navigateur\n */\n this.initEvents=function(){\n var tabs = require(\"sdk/tabs\");\n\n tabs.on('load',that.tabsOnReady);\n //tabs.on('ready',function(tab){console.log('ready '+tab.title);}) });\n //tabs.on('ready', that.tabsOnReady);\n }\n\n // vvv TABS EVENTS vvv //\n\n /**\n * Extention.tabsOnReady - événements lorsque une tablulation est chargée<br>\n * vérifie si c'est une application zmov, si oui attache le script pour l'application\n *\n * @param {sdk_tabs_tab} tab description\n */\n this.tabsOnReady=function(tab){\n setTimeout(function () {\n if(tab.window.title.indexOf(\"ZMov app\")>=0){\n that.webAttach(tab);\n }\n }, 500);\n }\n\n // vvv Workers EVENTS vvv //\n\n /**\n * Extention.setWorkerEvents - initialisation des evenements pour la communication avec le page web\n *\n * @param {worker} wkr lien de communication avec le fichier ./data/web.js\n */\n this.setWorkerEvents=function(wkr){\n debug=function(some){wkr.port.emit('DEBUG',some)};\n wkr.port.on('fopen',Extention.fopen);\n wkr.port.on('flist_set',that.fm.set);\n wkr.port.on('flist_get',that.actualiseAndEmit);\n wkr.port.on('ext_set',function(ext){defaultExt=ext;});\n wkr.port.on('sync_get',function(){\n wkr.port.emit('sync_ok',version)\n });\n wkr.port.on('DEBUG',function(args){\n debug(args);\n debug(that);\n });\n }\n\n /*\n ====================\n UTILS\n ====================\n */\n\n /**\n * Extention.webAttach - Attachement des scripts a l'onglet du navigateur'\n *\n * @param {sdk_tabs_tab} tab l'onglet a associer\n */\n this.webAttach=function(tab){\n var wkr = tab.attach({\n contentScriptFile: [self.data.url(\"comm.js\"),self.data.url(\"web.js\")]\n });\n that.web.push(wkr);\n that.setWorkerEvents(wkr);\n }\n\n\n /**\n * Extention.actualiseAndEmit - recherche les fichiers films dans les répertoires et les envoies à la page web\n */\n this.actualiseAndEmit=function(){\n that.fm.files=[];\n that.fm.readAll(function(){\n that.wemit('flist_ok',that.fm.files);\n });\n }\n\n // Alias\n //\n /**\n * Extention.wemit - simplification de l'envoi d'action aux pages web.<br>\n * si il y a plusieurs instances de page web , fait un broadcast sur toutes les instance (les supprimes si elles ne sont plus liées)\n *\n * @param {string} action l'action a executer par l'application\n * @param {rainbow} vars les données a transmettre a l'application\n */\n\n this.wemit=function(action,vars){\n for(var i=0; i<that.web.length ; i++){\n try {\n that.web[i].port.emit(action,vars);\n } catch (err) {\n console.log(err);\n that.web.splice(i,1);\n continue;\n }\n }\n }\n\n}", "_updateExternalModuleScriptTags(ast) {\n return __awaiter(this, void 0, void 0, function* () {\n const scripts = dom5.queryAll(ast, matchers.externalModuleScript);\n for (const script of scripts) {\n const oldSrc = dom5.getAttribute(script, 'src');\n const oldFileUrl = this.bundler.analyzer.urlResolver.resolve(this.document.parsedDocument.baseUrl, oldSrc);\n if (oldFileUrl === undefined) {\n continue;\n }\n const bundle = this.manifest.getBundleForFile(oldFileUrl);\n if (bundle === undefined) {\n continue;\n }\n // Do not rewrite the src if the current bundle is going to be the new\n // home of the code.\n if (bundle.url === this.assignedBundle.url) {\n continue;\n }\n const newFileUrl = bundle.url;\n const newSrc = this.bundler.analyzer.urlResolver.relative(this.assignedBundle.url, newFileUrl);\n dom5.setAttribute(script, 'src', newSrc);\n }\n });\n }", "function hack_legacy_app_specific_hacks() {\n\n if(_pTabId == \"pMouseSpinalCord\") {\n\n if(window.console)\n console.log(\"importing legacy spinal hacks\");\n\n import_spinal_hacks();\n\n } else if(_pTabId == \"pGlioblastoma\") {\n\n import_glio_hacks();\n }\n}", "_onAddAsset(asset) {\n // remove from waiting list\n var index = this._waitingAssets.indexOf(asset);\n if (index >= 0) {\n this._waitingAssets.splice(index, 1);\n }\n\n this._assets.push(asset);\n var i;\n var l = this._assets.length;\n for (i = 0; i < l; i++) {\n asset = this._assets[i];\n\n if (!asset.loading && !asset.loaded) {\n this._registry.load(asset);\n }\n }\n }", "chainWebpack(chain) {}", "function prestigeAugmentation() {\n initBitNodeMultipliers();\n\n Player.prestigeAugmentation();\n\n //Delete all Worker Scripts objects\n prestigeWorkerScripts();\n\n var homeComp = Player.getHomeComputer();\n //Delete all servers except home computer\n prestigeAllServers();\n\n //Delete Special Server IPs\n prestigeSpecialServerIps(); //Must be done before initForeignServers()\n\n //Reset home computer (only the programs) and add to AllServers\n prestigeHomeComputer(homeComp);\n\n if (augmentationExists(AugmentationNames.Neurolink) &&\n Augmentations[AugmentationNames.Neurolink].owned) {\n homeComp.programs.push(Programs.FTPCrackProgram);\n homeComp.programs.push(Programs.RelaySMTPProgram);\n }\n if (augmentationExists(AugmentationNames.CashRoot) &&\n Augmentations[AugmentationNames.CashRoot].owned) {\n Player.setMoney(new Decimal(1000000));\n homeComp.programs.push(Programs.BruteSSHProgram);\n }\n\n AddToAllServers(homeComp);\n\n //Re-create foreign servers\n initForeignServers();\n\n //Darkweb is purchase-able\n document.getElementById(\"location-purchase-tor\").setAttribute(\"class\", \"a-link-button\");\n\n //Gain favor for Companies\n for (var member in Companies) {\n if (Companies.hasOwnProperty(member)) {\n Companies[member].gainFavor();\n }\n }\n\n //Gain favor for factions\n for (var member in Factions) {\n if (Factions.hasOwnProperty(member)) {\n Factions[member].gainFavor();\n }\n }\n\n //Stop a Terminal action if there is onerror\n if (Engine._actionInProgress) {\n Engine._actionInProgress = false;\n Terminal.finishAction(true);\n }\n\n //Re-initialize things - This will update any changes\n initFactions(); //Factions must be initialized before augmentations\n initAugmentations(); //Calls reapplyAllAugmentations() and resets Player multipliers\n Player.reapplyAllSourceFiles();\n initCompanies();\n\n //Clear terminal\n $(\"#terminal tr:not(:last)\").remove();\n postNetburnerText();\n\n //Messages\n initMessages();\n\n //Reset Stock market\n if (Player.hasWseAccount) {\n initStockMarket();\n initSymbolToStockMap();\n }\n setStockMarketContentCreated(false);\n var stockMarketList = document.getElementById(\"stock-market-list\");\n while(stockMarketList.firstChild) {\n stockMarketList.removeChild(stockMarketList.firstChild);\n }\n\n //Gang, in BitNode 2\n if (Player.bitNodeN == 2 && Player.inGang()) {\n var faction = Factions[Player.gang.facName];\n if (faction instanceof Faction) {\n joinFaction(faction);\n }\n }\n\n //BitNode 3: Corporatocracy\n if (Player.bitNodeN === 3) {Player.money = new Decimal(150e9);}\n\n //BitNode 8: Ghost of Wall Street\n if (Player.bitNodeN === 8) {Player.money = new Decimal(100e6);}\n if (Player.bitNodeN === 8 || hasWallStreetSF) {\n Player.hasWseAccount = true;\n Player.hasTixApiAccess = true;\n }\n\n var mainMenu = document.getElementById(\"mainmenu-container\");\n mainMenu.style.visibility = \"visible\";\n Terminal.resetTerminalInput();\n Engine.loadTerminalContent();\n\n //Red Pill\n if (augmentationExists(AugmentationNames.TheRedPill) &&\n Augmentations[AugmentationNames.TheRedPill].owned) {\n var WorldDaemon = AllServers[SpecialServerIps[SpecialServerNames.WorldDaemon]];\n var DaedalusServer = AllServers[SpecialServerIps[SpecialServerNames.DaedalusServer]];\n if (WorldDaemon && DaedalusServer) {\n WorldDaemon.serversOnNetwork.push(DaedalusServer.ip);\n DaedalusServer.serversOnNetwork.push(WorldDaemon.ip);\n }\n }\n}", "async populateFlattenedDependencies() {\n _logger().default.debug(`populateFlattenedDependencies starts with ${this.components.length} components`);\n\n this.createGraphs(this.components);\n await this.importExternalDependenciesInBulk();\n await (0, _pMapSeries().default)(this.components, async component => {\n component.flattenedDependencies = await this.getFlattened(component.id);\n });\n }", "function buildSxcRoot() {\n var rootApiV2 = Object(_sxc_root__WEBPACK_IMPORTED_MODULE_4__[\"getRootPartsV2\"])();\n var urlManager = new _tools_url_param_manager__WEBPACK_IMPORTED_MODULE_1__[\"UrlParamManager\"]();\n var debug = new ___WEBPACK_IMPORTED_MODULE_5__[\"Debug\"]();\n // {\n // load: (urlManager.get('debug') === 'true'),\n // uncache: urlManager.get('sxcver'),\n // };\n var stats = new _Stats__WEBPACK_IMPORTED_MODULE_2__[\"Stats\"]();\n var addOn = {\n _controllers: {},\n beta: {},\n _data: {},\n // this creates a full-screen iframe-popup and provides a close-command to finish the dialog as needed\n totalPopup: new _tools_total_popup__WEBPACK_IMPORTED_MODULE_0__[\"TotalPopup\"](),\n urlParams: urlManager,\n // note: I would like to remove this from $2sxc, but it's currently\n // used both in the inpage-edit and in the dialogs\n // debug state which is needed in various places\n debug: debug,\n stats: stats,\n insights: function (partName, index, start, length) { return ___WEBPACK_IMPORTED_MODULE_5__[\"Insights\"].show(partName, index, start, length); },\n _insights: ___WEBPACK_IMPORTED_MODULE_5__[\"Insights\"],\n // mini-helpers to manage 2sxc parts, a bit like a dependency loader\n // which will optimize to load min/max depending on debug state\n parts: {\n getUrl: function (url, preventUnmin) {\n // let r = url;// (preventUnmin || !debug.load) ? url : url.replace('.min', ''); // use min or not\n if (debug.uncache && url.indexOf('sxcver') === -1)\n return url + ((url.indexOf('?') === -1) ? '?' : '&') + 'sxcver=' + debug.uncache;\n return url;\n },\n },\n jq: function () { return $2sxc_jQSuperlight; },\n };\n var merged = addOn.jq().extend(FindSxcInstance, addOn, rootApiV2);\n merged.log.add('sxc controller built');\n console.log(\"$2sxc \" + ___WEBPACK_IMPORTED_MODULE_5__[\"SxcVersion\"] + \" with insights-logging - see https://r.2sxc.org/insights\");\n return merged; //FindSxcInstance as SxcRoot & SxcRootInternals;\n}", "function preBuild(addonPath) {\n // Require the addon\n let addonToBuild = require(addonPath);\n // Augment it with isDevelopingAddon function.\n addonToBuild.isDevelopingAddon = function() {\n return true;\n }\n // If addon has pre-built path set in it use that else use the default path\n if(!addonToBuild.PREBUILT_PATH) {\n addonToBuild.PREBUILT_PATH = `${addonPath}/pre-built`;\n }\n fs.removeSync(addonToBuild.PREBUILT_PATH);\n\n const ui = new UI({\n inputStream: process.stdin,\n outputStream: process.stdout,\n errorStream: process.stderr,\n writeLevel: 'DEBUG' | 'INFO' | 'WARNING' | 'ERROR',\n ci: true | false\n });\n const project = Project.closestSync(addonPath, ui);\n project.initializeAddons();\n // Extend the current addon from base Addon\n const CurrentAddon = Addon.extend(Object.assign({}, addonToBuild, {root: addonPath, pkg: project.pkg}));\n const currAddon = new CurrentAddon(addonPath, project);\n\n // Get the tree for Addon and Vendor\n let addonTree = new Funnel (currAddon.treeFor('addon'), {\n destDir: 'addon'\n });\n\n let vendorTree = new Funnel (currAddon.treeFor('vendor'), {\n destDir: 'vendor'\n });\n\n // Merge, Build the resulting tree and store it in prebuild path\n return build(new Merge([addonTree, vendorTree], { annotation: '[ember-rollup] Merging prebuild addon and vendor tree' }), addonToBuild.PREBUILT_PATH);\n }", "function charJawFront(){ //start script\n app.beginUndoGroup(\"Create Character Jaw Rig Front\");\n\n //if(parseFloat(app.version) >= 10.5){\n var theComp = app.project.activeItem; //only selected\n\n // check if comp is selected\n if (theComp == null || !(theComp instanceof CompItem)){\n // if no comp selected, display an alert\n alert(\"Please establish a comp as the active item and run the script again.\");\n } else {\n var theLayers = theComp.selectedLayers;\n if(theLayers.length==0){\n alert(\"Please select a precomp and run the script again.\");\n }else{\n // otherwise, loop through each selected layer in the selected comp\n for (var i = 0; i < theLayers.length; i++){\n // define the layer in the loop we're currently looking at\n var curLayer = theLayers[i];\n // Select layer to add expression to\n if (curLayer.matchName == \"ADBE AV Layer\"){\n //first check if this is a footage layer\n //next check if this is a comp.\n var myLayer = theComp.selectedLayers[0];\n if(myLayer.source.numLayers==null){\n //not a comp; send alert.\n alert(\"This only works on precomp layers.\");\n }else{\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n //myLayer is indeed a precomp. OK to do stuff.\n var slider = myLayer.property(\"Effects\").addProperty(\"Slider Control\");\n slider.name = \"jaw front control\"\n var headNull = myLayer.source.layers.addNull();\n //var upperJawNull = myLayer.source.layers.addNull();\n var lowerJawNull = myLayer.source.layers.addNull();\n headNull.name = \"head placeholder\";\n //upperJawNull.name = \"upper jaw placeholder\";\n lowerJawNull.name = \"lower jaw placeholder\";\n //when asset replaces null, anchor point will be centered.\n headNull.transform.anchorPoint.setValue([50,50]);\n //upperJawNull.transform.anchorPoint.setValue([50,50]);\n lowerJawNull.transform.anchorPoint.setValue([50,50]);\n headNull.property(\"Opacity\").setValue(100);\n //upperJawNull.property(\"Opacity\").setValue(100);\n lowerJawNull.property(\"Opacity\").setValue(100);\n //parenting jaws to head\n //upperJawNull.parent = headNull;\n lowerJawNull.parent = headNull;\n //expressions\n //headNullExprPos;\n //headNullExprRot;\n //headNullExprScale;\n //headNull.property(\"Position\").expression = headNullExprPos;\n //headNull.property(\"Rotation\").expression = headNullExprRot;\n //headNull.property(\"Scale\").expression = headNullExprScale;\n //--\n //upperJawNullExprPos;\n //upperJawNullExprRot;\n //upperJawNullExprScale;\n //upperJawNull.property(\"Position\").expression = upperJawNullExprPos;\n //upperJawNull.property(\"Rotation\").expression = upperJawNullExprRot;\n //upperJawNull.property(\"Scale\").expression = upperJawNullExprScale;\n //--\n lowerJawNullExprPos = \"var scaler = 1.0;\" + \"\\r\" +\n \"var x = transform.position[0];\" + \"\\r\" +\n \"var y = transform.position[1];\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"[x, y+(s*scaler)];\";\n //lowerJawNullExprRot;\n lowerJawNullExprScale = \"var scaler = 1.0;\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var x = transform.scale[0];\" + \"\\r\" +\n \"var y = transform.scale[1];\" + \"\\r\" +\n \"[x,y+(s*scaler)];\"; \n lowerJawNull.property(\"Position\").expression = lowerJawNullExprPos;\n //lowerJawNull.property(\"Rotation\").expression = lowerJawNullExprRot;\n lowerJawNull.property(\"Scale\").expression = lowerJawNullExprScale;\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n }\n }else{\n //not a footage layer; send alert.\n alert(\"This only works on precomp layers.\");\n }\n }\n }\n }\n \n app.endUndoGroup();\n} //end script", "LoadAllAssets() {}", "extend (config, { isDev, isClient }) {\n config.resolve.alias['fetch'] = path.join(__dirname, 'utils/fetch.js')\n config.resolve.alias['api'] = path.join(__dirname, 'api')\n config.resolve.alias['layouts'] = path.join(__dirname, 'layouts')\n config.resolve.alias['components'] = path.join(__dirname, 'components')\n config.resolve.alias['utils'] = path.join(__dirname, 'utils')\n config.resolve.alias['static'] = path.join(__dirname, 'static')\n config.resolve.alias['directive'] = path.join(__dirname, 'directive')\n config.resolve.alias['filters'] = path.join(__dirname, 'filters')\n config.resolve.alias['styles'] = path.join(__dirname, 'assets/styles')\n config.resolve.alias['element'] = path.join(__dirname, 'plugins/element-ui')\n config.resolve.alias['@element-ui'] = path.join(__dirname, 'plugins/element-ui')\n config.resolve.alias['e-ui'] = path.join(__dirname, 'node_modules/h666888')\n config.resolve.alias['@e-ui'] = path.join(__dirname, 'plugins/e-ui')\n config.resolve.alias['areaJSON'] = path.join(__dirname, 'static/area.json')\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n /*\n const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;\n config.plugins.push(\n new BundleAnalyzerPlugin({\n openAnalyzer: true\n })\n )\n */\n /**\n *全局引入scss文件\n */\n const sassResourcesLoader = {\n loader: 'sass-resources-loader',\n options: {\n resources: [\n 'assets/styles/var.scss'\n ]\n }\n }\n // 遍历nuxt定义的loader配置,向里面添加新的配置。 \n config.module.rules.forEach((rule) => {\n if (rule.test.toString() === '/\\\\.vue$/') {\n rule.options.loaders.sass.push(sassResourcesLoader)\n rule.options.loaders.scss.push(sassResourcesLoader)\n }\n if (['/\\\\.sass$/', '/\\\\.scss$/'].indexOf(rule.test.toString()) !== -1) {\n rule.use.push(sassResourcesLoader)\n }\n })\n }", "function attachCompanion() {\n const jsonPath = `${pathWithoutExt}.json`;\n\n if (fs.existsSync(jsonPath)) {\n /* eslint-disable global-require */\n /* eslint-disable import/no-dynamic-require */\n // eslint-disable-next-line no-param-reassign\n page.context.companion = require(jsonPath);\n /* eslint-enable import/no-dynamic-require */\n /* eslint-enable global-require */\n }\n }", "function copyAddons(target) {\n // fs.copyFileSync(path.resolve(__dirname, '../node_modules/drivelist/build/Release/drivelist.node'), path.join(target, 'drivelist.node'))\n // fs.copyFileSync(path.resolve(__dirname, '../node_modules/drivelist/scripts/darwin.sh'), path.join(target, 'drivelist/darwin.sh'))\n // fs.copyFileSync(path.resolve(__dirname, '../node_modules/drivelist/scripts/linux.sh'), path.join(target, 'drivelist/linux.sh'))\n // fs.copyFileSync(path.resolve(__dirname, '../node_modules/drivelist/scripts/win32.bat'), path.join(target, 'drivelist/win32.bat'))\n\n fs.copyFileSync(path.resolve(__dirname, '../node_modules/nsfw/build/Release/nsfw.node'), path.join(target, 'nsfw.node'))\n fs.copyFileSync(path.resolve(__dirname, '../node_modules/find-git-repositories/build/Release/findGitRepos.node'), path.join(target, 'findGitRepos.node'))\n fs.copyFileSync(path.resolve(__dirname, '../node_modules/oniguruma/build/Release/onig_scanner.node'), path.join(target, 'onig_scanner.node'))\n }", "async handleImport (engineData, ids) {\n const decode = await attachImgToId(engineData.schematic, true)\n if (!decode) return\n const raw_content = BABYLON.Tools.DecodeBase64('data:base64,' + decode.data.base64)\n const blob = new Blob([raw_content])\n const BBJSurl = URL.createObjectURL(blob)\n if (BBJSurl) {\n BABYLON.SceneLoader.loggingLevel = BABYLON.SceneLoader.DETAILED_LOGGING\n console.log(BABYLON.SceneLoader.IsPluginForExtensionAvailable('.glb'))\n const meshes = (await BABYLON.SceneLoader.ImportMeshAsync('', '', BBJSurl, this.scene, null, '.glb')).meshes;\n console.log(meshes)\n if (meshes.length === 0) {\n console.log('Error on import, empty mesh or wrong data to import')\n return\n } \n\n meshes[0].metadata = { \n engineData: engineData,\n id: ids[0], \n id1: ids[1], \n id2: ids[2] \n }\n\n // update mesh transforms based on engine data\n meshes[0].position = new BABYLON.Vector3(engineData.transform.best_sc[0], 0, engineData.transform.best_sc[1])\n meshes[0].rotation = new BABYLON.Vector3(0, engineData.transform.best_sc[2], 0)\n \n // do settings related to imported part\n meshes[0].body = null\n meshes[0].pins = []\n meshes[0].nick = null\n \n for (let i = 0; i < meshes.length; i++) {\n if (meshes[i].name.toLowerCase().indexOf('sc_body') !== -1) {\n meshes[0].body = meshes[i]\n }\n else {\n if (meshes[i].name.toLowerCase().indexOf('sc_pin') !== -1) {\n meshes[0].pins.push(meshes[i])\n }\n else {\n if (meshes[i].name.toLowerCase().indexOf('sc_name2d') !== -1) {\n meshes[0].nick = meshes[i]\n }\n }\n }\n }\n\n // make body clickable\n if (meshes[0].body) {\n this.setBody(meshes[0])\n }\n\n // make pins clickable\n if (meshes[0].pins.length !== 0) {\n for (let i = 0; i < meshes[0].pins.length; i++) {\n this.setPins(meshes[0].pins[i])\n }\n }\n\n // update text on nickname plane\n if (meshes[0].nick) {\n this.updateNick(meshes[0].nick, meshes[0].metadata.engineData.name2d)\n }\n\n console.log(meshes[0])\n }\n }", "async function importLabors() {\n\tconst module = game.modules.get(\"<module_name>\");\n\tlet scenes = null;\n\tlet actors = null;\n\n\tfor ( let p of module.packs ) {\n\t\tconst pack = game.packs.get(\"<module_name>.\"+p.name);\n\t\tif ( p.entity !== \"Playlist\" ) await pack.importAll();\n\t\telse {\n\t\t\tconst music = await pack.getContent();\n\t\t\tPlaylist.create(music.map(p => p.data));\n\t\t}\n\t\tif ( p.entity === \"Scene\" ) scenes = game.folders.getName(p.label);\n\t\tif ( p.entity === \"Actor\" ) actors = game.folders.getName(p.label);\n\t}\n\n\t// Re-associate Tokens for all scenes\n\tconst sceneUpdates = [];\n\tfor ( let s of scenes.entities ) {\n\t\tconst tokens = s.data.tokens.map(t => {\n\t\t\tconst a = actors.entities.find(a => a.name === t.name);\n\t\t\tt.actorId = a ? a.id : null;\n\t\t\treturn t;\n\t\t});\n\t\tsceneUpdates.push({_id: s.id, tokens});\n\t}\n\tawait Scene.update(sceneUpdates);\n\n\t// Activate the splash page\n\tconst s0 = game.scenes.getName(\"The <module_name>\");\n\ts0.activate();\n\n\t// Display the introduction\n\tconst j1 = game.journal.getName(\"A1. Adventure Introduction\");\n\tif ( j1 ) j1.sheet.render(true, {sheetMode: \"text\"});\n\treturn game.settings.set(\"<module_name>\", \"imported\", true);\n}", "extend (config, ctx) {\n config.module.rules.push({\n test: require.resolve('snapsvg'),\n use: 'imports-loader?this=>window,fix=>module.exports=0',\n });\n }", "function minimizeAllExpandedBlocks(){\n\tinjector = [];\n\tattachedImages = [];\n\tfilledClusters = [];\n\texpandedImages = 0;\n}", "updateHeaderBarBackLink() {\n let foundModule = null;\n Shopware.Module.getModuleRegistry().forEach((module) => {\n if (foundModule) {\n return;\n }\n\n if (module.manifest.title === 'sw-extension-store.title') {\n foundModule = module;\n }\n });\n\n if (foundModule) {\n this.$route.meta.parentPath = 'sw.extension.my-extensions.listing.app';\n this.$route.meta.$module = foundModule.manifest;\n }\n }", "function upgradeAllRegisteredInternal() {\n\t for (var n = 0; n < registeredComponents_.length; n++) {\n\t upgradeDomInternal(registeredComponents_[n].className);\n\t }\n\t }", "function upgradeAllRegisteredInternal() {\n\t for (var n = 0; n < registeredComponents_.length; n++) {\n\t upgradeDomInternal(registeredComponents_[n].className);\n\t }\n\t }", "get mainAsset() {}", "preload() {\n\n\t\t// Get our type based on the key in the manifest\n\t\tlet _type = Object.keys(this.manifest)[this.preloader.package_loaded];\n\n\t\t// Check to see if our total loaded is < our manifest\n\t\tif(this.preloader.package_loaded < Object.keys(this.manifest).length){\n\t\t\tthis.preloader.load(_type, this.manifest[_type]);\n\t\t} else {\n\t\t\tthis.trigger('assets_loaded');\n\t\t}\n\t}", "loadExtensions () {\n\n // Derivative Extension\n\n this.viewer.loadExtension(\n 'Viewing.Extension.Derivative', {\n parentControl: this.ctrlGroup\n })\n\n this.derivativeExtension = this.viewer.loadedExtensions[\n 'Viewing.Extension.Derivative']\n\n // ModelTransformer Extension\n\n this.viewer.loadExtension(\n 'Viewing.Extension.ModelTransformer', {\n parentControl: this.ctrlGroup\n })\n\n this.modelTransformerExtension =\n this.viewer.loadedExtensions[\n 'Viewing.Extension.ModelTransformer']\n\n this.modelTransformerExtension.on('model.delete',\n (model) => {\n\n if (model.node && model.node.parent) {\n\n model.node.parent.classList.remove('derivated')\n\n model.node.setTooltip('no derivative on this item')\n }\n\n delete model.version.manifest\n\n this.derivativeExtension.deleteManifest(\n model.storageUrn)\n\n this.sceneManagerExtension.removeModel(model)\n })\n\n // Storage Extension\n\n this.viewer.loadExtension(\n 'Viewing.Extension.Storage', {\n parentControl: this.ctrlGroup,\n showPanel: true\n })\n\n this.storageExtension =\n this.viewer.loadedExtensions['Viewing.Extension.Storage']\n\n this.storageExtension.on('node.added', this.onNodeAddedHandler)\n\n this.storageExtension.on('node.dblClick', (node)=> {\n\n console.log(node)\n\n switch(node.type) {\n\n case 'items':\n\n this.onItemNodeDblClicked(node)\n break;\n\n case 'derivatives':\n\n this.onDerivativeNodeDblClicked(node)\n break;\n\n default:\n break;\n }\n })\n\n // SceneManager Extension\n\n this.viewer.loadExtension(\n 'Viewing.Extension.SceneManager', {\n parentControl: this.ctrlGroup\n })\n\n this.sceneManagerExtension = this.viewer.loadedExtensions[\n 'Viewing.Extension.SceneManager']\n\n this.sceneManagerExtension.on('scene.restore', (scene)=> {\n\n console.log(scene)\n\n scene.deleteSet.forEach((model) => {\n\n this.modelTransformerExtension.deleteModel(\n model, false)\n })\n\n this.modelTransformerExtension.clearModels()\n\n scene.transformSet.forEach((model) => {\n\n this.modelTransformerExtension.addModel(model)\n this.modelTransformerExtension.applyTransform(model)\n\n this.sceneManagerExtension.addModel(model)\n })\n\n scene.loadSet.forEach((modelInfo) => {\n\n try {\n\n // build a fake item\n\n delete modelInfo.version.manifest\n\n var item = {\n name: modelInfo.name,\n versions: [modelInfo.version]\n }\n\n var onFullyLoaded = (model) => {\n\n model.transform = modelInfo.transform\n\n this.modelTransformerExtension.addModel(model)\n this.modelTransformerExtension.applyTransform(model)\n\n this.sceneManagerExtension.addModel(model)\n\n this.viewer.impl.sceneUpdated(true)\n }\n\n var options = {\n showProgress: true,\n onFullyLoaded: onFullyLoaded\n }\n\n this.importModelFromItem(item, options)\n }\n catch(error) {\n\n console.log(error)\n }\n })\n })\n }", "get assetImporter() {}", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push(\n {\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n },\n {\n test: /\\.(png|jpe?g|gif|svg|webp|ico)$/,\n loader: 'url-loader',\n query: {\n limit: 1000 // 1kB\n }\n }\n )\n }\n\n for (const ruleList of Object.values(config.module.rules || {})) {\n for (const rule of Object.values(ruleList.oneOf || {})) {\n for (const loader of rule.use) {\n const loaderModifier = loaderModifiers[loader.loader]\n if (loaderModifier) {\n loaderModifier(loader)\n }\n }\n }\n }\n }", "_onBatchRestored () {\n this._upgrade_1x_to_2x();\n\n this._cullingMask = 1 << _getActualGroupIndex(this);\n\n if (!this._activeInHierarchy) {\n // deactivate ActionManager and EventManager by default\n\n // ActionManager may not be inited in the editor worker.\n let manager = cc.director.getActionManager();\n manager && manager.pauseTarget(this);\n\n eventManager.pauseTarget(this);\n }\n\n var children = this._children;\n for (var i = 0, len = children.length; i < len; i++) {\n children[i]._onBatchRestored();\n }\n\n if (children.length > 0) {\n this._renderFlag |= RenderFlow.FLAG_CHILDREN;\n }\n }", "onpopulate()\n {\n if (this.children.length && !this.shouldRefreshChildren)\n return;\n this.shouldRefreshChildren = false;\n\n this.removeChildren();\n this.updateParentStatus();\n this.prepareToPopulate();\n\n for (var i = 0; i < this._frame.childFrames.length; ++i)\n this.addChildForRepresentedObject(this._frame.childFrames[i]);\n\n for (var i = 0; i < this._frame.resources.length; ++i)\n this.addChildForRepresentedObject(this._frame.resources[i]);\n\n var sourceMaps = this.resource && this.resource.sourceMaps;\n for (var i = 0; i < sourceMaps.length; ++i) {\n var sourceMap = sourceMaps[i];\n for (var j = 0; j < sourceMap.resources.length; ++j)\n this.addChildForRepresentedObject(sourceMap.resources[j]);\n }\n\n var flowMap = this._frame.domTree.flowMap;\n for (var flowKey in flowMap)\n this.addChildForRepresentedObject(flowMap[flowKey]);\n\n for (let extraScript of this._frame.extraScripts) {\n if (extraScript.sourceURL || extraScript.sourceMappingURL)\n this.addChildForRepresentedObject(extraScript);\n }\n }", "function upgradeAllRegisteredInternal() {\n for (var n = 0; n < registeredComponents_.length; n++) {\n upgradeDomInternal(registeredComponents_[n].className);\n }\n }", "function upgradeAllRegisteredInternal() {\n for (var n = 0; n < registeredComponents_.length; n++) {\n upgradeDomInternal(registeredComponents_[n].className);\n }\n }", "function upgradeAllRegisteredInternal() {\n for (var n = 0; n < registeredComponents_.length; n++) {\n upgradeDomInternal(registeredComponents_[n].className);\n }\n }", "function upgradeAllRegisteredInternal() {\n for (var n = 0; n < registeredComponents_.length; n++) {\n upgradeDomInternal(registeredComponents_[n].className);\n }\n }", "function upgradeAllRegisteredInternal() {\n for (var n = 0; n < registeredComponents_.length; n++) {\n upgradeDomInternal(registeredComponents_[n].className);\n }\n }", "function createRootLessFile() {\n console.log('Creating root less file');\n const rootLessFile = path.resolve(__dirname, 'src', 'all.less');\n const relativeFileRoot = './frontend/components/';\n let contents = '';\n\n CONSTANTS.EX_BOWER.forEach((bm) => {\n if (!bm.css || bm.skipLinkTag) {\n return;\n }\n console.log('include CSS for component', bm.name);\n const cssList = Array.isArray(bm.css) ? bm.css : [bm.css];\n cssList.forEach((cssFile) => {\n contents += `@import \"~${bm.name}/${cssFile}\";\\n`;\n });\n });\n\n const allComponents = CONSTANTS.BOWER_ORPHANED;\n allComponents.forEach((bm) => {\n if (!bm.css || bm.skipLinkTag) {\n return;\n }\n console.log('include CSS for component', bm.name);\n const cssList = Array.isArray(bm.css) ? bm.css : [bm.css];\n cssList.forEach((cssFile) => {\n contents += `@import \"${relativeFileRoot}${bm.name}/${cssFile}\";\\n`;\n });\n });\n\n // main ESN less file\n contents += `@import \"./frontend/css/styles.less\";\\n`;\n\n // ESN core modules\n CONSTANTS.coreModules.forEach((mod) => {\n if (!mod.cssRoot) {\n return;\n }\n console.log('include less for module', mod.name);\n const cssList = Array.isArray(mod.cssRoot) ? mod.cssRoot : [mod.cssRoot];\n cssList.forEach((cssFile) => {\n contents += `@import \"./modules/${mod.name}/${cssFile}\";\\n`;\n });\n });\n\n fs.writeFileSync(rootLessFile, contents);\n}", "function charJawSide(){ //start script\n app.beginUndoGroup(\"Create Character Jaw Rig Side\");\n\n //if(parseFloat(app.version) >= 10.5){\n var theComp = app.project.activeItem; //only selected\n\n // check if comp is selected\n if (theComp == null || !(theComp instanceof CompItem)){\n // if no comp selected, display an alert\n alert(\"Please establish a comp as the active item and run the script again.\");\n } else {\n var theLayers = theComp.selectedLayers;\n if(theLayers.length==0){\n alert(\"Please select a precomp and run the script again.\");\n }else{\n // otherwise, loop through each selected layer in the selected comp\n for (var i = 0; i < theLayers.length; i++){\n // define the layer in the loop we're currently looking at\n var curLayer = theLayers[i];\n // Select layer to add expression to\n if (curLayer.matchName == \"ADBE AV Layer\"){\n //first check if this is a footage layer\n //next check if this is a comp.\n var myLayer = theComp.selectedLayers[0];\n if(myLayer.source.numLayers==null){\n //not a comp; send alert.\n alert(\"This only works on precomp layers.\");\n }else{\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n //myLayer is indeed a precomp. OK to do stuff.\n var slider = myLayer.property(\"Effects\").addProperty(\"Slider Control\");\n slider.name = \"jaw side control\"\n var headNull = myLayer.source.layers.addNull();\n var upperJawNull = myLayer.source.layers.addNull();\n var lowerJawNull = myLayer.source.layers.addNull();\n headNull.name = \"head placeholder\";\n upperJawNull.name = \"upper jaw placeholder\";\n lowerJawNull.name = \"lower jaw placeholder\";\n //when asset replaces null, anchor point will be centered.\n headNull.transform.anchorPoint.setValue([50,50]);\n upperJawNull.transform.anchorPoint.setValue([50,50]);\n lowerJawNull.transform.anchorPoint.setValue([50,50]);\n headNull.property(\"Opacity\").setValue(100);\n upperJawNull.property(\"Opacity\").setValue(100);\n lowerJawNull.property(\"Opacity\").setValue(100);\n //parenting jaws to head\n upperJawNull.parent = headNull;\n lowerJawNull.parent = headNull;\n //expressions\n //headNullExprPos;\n //headNullExprRot;\n headNullExprScale = \"var x = transform.scale[0];\" + \"\\r\" +\n \"var y = transform.scale[1];\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"[x,y+(s/-4)];\";\n //headNull.property(\"Position\").expression = headNullExprPos;\n //headNull.property(\"Rotation\").expression = headNullExprRot;\n headNull.property(\"Scale\").expression = headNullExprScale;\n //--\n upperJawNullExprPos = \"var x = transform.position[0];\" + \"\\r\" +\n \"var y = transform.position[1];\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var scaler = -0.2;\" + \"\\r\" +\n \"[x, y+(s*scaler)];\";\n upperJawNullExprRot = \"var r = transform.rotation;\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var scaler = 0.2;\" + \"\\r\" +\n \"r+(s*scaler);\";\n //upperJawNullExprScale;\n upperJawNull.property(\"Position\").expression = upperJawNullExprPos;\n upperJawNull.property(\"Rotation\").expression = upperJawNullExprRot;\n //upperJawNull.property(\"Scale\").expression = upperJawNullExprScale;\n //--\n lowerJawNullExprPos = \"var x = transform.position[0];\" + \"\\r\" +\n \"var y = transform.position[1];\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var scaler = 2;\" + \"\\r\" +\n \"[x, y+(s*scaler)];\";\n lowerJawNullExprRot = \"var r = transform.rotation;\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var scaler = -1.0;\" + \"\\r\" +\n \"r+(s*scaler);\";\n //lowerJawNullExprScale; \n lowerJawNull.property(\"Position\").expression = lowerJawNullExprPos;\n lowerJawNull.property(\"Rotation\").expression = lowerJawNullExprRot;\n //lowerJawNull.property(\"Scale\").expression = lowerJawNullExprScale;\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n }\n }else{\n //not a footage layer; send alert.\n alert(\"This only works on precomp layers.\");\n }\n }\n }\n }\n \n app.endUndoGroup();\n} //end script", "function cleanup(window, prebootData) {\n prebootData = prebootData || {};\n var listeners = prebootData.listeners || [];\n // set focus on the active node AFTER a small delay to ensure buffer switched\n setTimeout(function () {\n setFocus(prebootData.activeNode);\n }, 1);\n // remove all event listeners\n for (var _i = 0, listeners_1 = listeners; _i < listeners_1.length; _i++) {\n var listener = listeners_1[_i];\n listener.node.removeEventListener(listener.eventName, listener.handler);\n }\n // remove the freeze overlay if it exists\n removeOverlay(window);\n // finally clear out the data stored for each app\n prebootData.apps = [];\n clientNodeCache = {};\n }", "extend (config, ctx) {\n config.resolve.alias['class-component'] = '~plugins/class-component'\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/\\.(?!(?:js|json)$).{1,5}$/i, /^vue-awesome/, /^vue-upload-component/]\n })\n ]\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push(\n {\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n },\n {\n test: /\\.ico$/,\n loader: 'uri-loader',\n exclude: /(node_modules)/\n }\n )\n console.log(config.output.publicPath, 'config.output.publicPath')\n // config.output.publicPath = ''\n }\n }", "_setDomModuleAssetpaths(ast, oldBaseUrl, newBaseUrl) {\n const domModules = dom5.queryAll(ast, matchers.domModuleWithoutAssetpath);\n for (let i = 0, node; i < domModules.length; i++) {\n node = domModules[i];\n const assetPathUrl = this.bundler.analyzer.urlResolver.relative(newBaseUrl, url_utils_1.stripUrlFileSearchAndHash(oldBaseUrl));\n // There's no reason to set an assetpath on a dom-module if its\n // different from the document's base.\n if (assetPathUrl !== '') {\n dom5.setAttribute(node, 'assetpath', assetPathUrl);\n }\n }\n }", "_import(){\n const args = arguments;\n const self = this;\n const fileName = args[0];\n const parentName = args[1];\n\n return this.fileNormalize(fileName)\n .then( moduleName => {\n // Add to tracking that is missing in core SystemJs (This needs to also happen on failure to compute parents)\n if (parentName)\n self._addDynamicParent(moduleName, parentName);\n // Import module with SystemJs\n return self._systemImport.apply(self._system, args)\n .then( moduleExports => {\n // Trigger reload for this module\n if (self.isReloading && self._stateStore)\n self._stateStore.reload(moduleExports, moduleName);\n // Return value retrieved from SystemJs\n return moduleExports;\n }).catch( err => {\n // If this a failed initial load, the retry should be identical\n self.failedImports[moduleName] = args;\n throw err;\n });\n });\n }", "loadBallerBase(){\n\n let ballerBase = this.ballerBase = this.rc.getResource(\"baller_base\").scene.children[0].clone();\n\n ballerBase.position.fromArray([0, 0.06999 ,0]);\n\n ballerBase.receiveShadow = true;\n ballerBase.visible = true;\n\n this.playerRollNode.add(ballerBase);\n\n }", "function loadMainProcessFiles () {\n const files = glob.sync(path.join(__dirname, '_side-back/js/**/*.js'))\n files.forEach((file) => { require(file) })\n}", "included(app) {\n this._super.included.apply(this, arguments);\n\n // Not sure if this snippet is necessary here.\n // \"@tbieniek: this code is needed if you want your addon to run in other addons.\"\n // More info here: https://github.com/ember-cli/ember-cli/issues/3718\n while (typeof app.import !== 'function' && app.app) {\n app = app.app;\n }\n\n this._prepareOptions(app);\n this._importEmojiOneJS(app);\n this._importEmojiOneCSS(app);\n }", "apply(compiler) {\n if (!this._options) return null;\n const options = this._options;\n\n // Specify the event hook to attach to\n compiler.hooks.afterEmit.tap(\"MergeRemoteChunksPlugin\", (output) => {\n const emittedAssets = Array.from(output.emittedAssets);\n const { dir, name } = path.parse(options.filename);\n const files = [\"static/chunks/webpack\", path.join(dir, name)]\n .filter((neededChunk) =>\n emittedAssets.some((emmitedAsset) =>\n emmitedAsset.includes(neededChunk)\n )\n )\n .map((neededChunk) =>\n emittedAssets.find((emittedAsset) =>\n emittedAsset.includes(neededChunk)\n )\n )\n .map((file) => path.join(compiler.options.output.path, file));\n\n if (files.length > 1) {\n const runtime = fs.readFileSync(files[0], \"utf-8\");\n const remoteContainer = fs.readFileSync(files[1], \"utf-8\");\n const merged = [runtime, remoteContainer].join(\"\\n\");\n const remotePath = path.join(\n compiler.options.output.path,\n \"static/runtime\"\n );\n if (fs.existsSync(remotePath)) {\n fs.mkdir(remotePath, { recursive: true }, (err) => {\n if (err) throw err;\n });\n }\n fs.writeFile(\n path.join(remotePath, \"/remoteEntryMerged.js\"),\n merged,\n () => {}\n );\n }\n });\n }", "async syncAssets() {\n for (let i = 0; i < this.__packages.length; i++) {\n let pkg = this.__packages[i];\n await qx.tool.utils.Promisify.poolEachOf(pkg.getAssets(), 10, asset =>\n asset.sync(this.__target)\n );\n }\n }", "resolve() {\n for (let name of this.assetTypes) {\n this.resolveRoot(name);\n }\n }", "_appendMinimizedContainerToExternalElement(itemsContainer) {\n const that = this;\n\n itemsContainer.ownerElement = that;\n that._dropDownParent.appendChild(itemsContainer);\n itemsContainer.setAttribute('animation', that.animation);\n\n if (that.theme !== '') {\n itemsContainer.$.addClass(that.theme);\n }\n\n itemsContainer.$.addClass('jqx-menu-drop-down jqx-drop-down');\n itemsContainer.$.addClass('jqx-drop-down-repositioned');\n itemsContainer.setAttribute('check-mode', that.checkMode);\n itemsContainer.setAttribute('drop-down-position', that.dropDownPosition);\n itemsContainer.setAttribute('mode', that.mode);\n itemsContainer.setAttribute('loading-indicator-position', that.loadingIndicatorPosition);\n\n if (that.checkable) {\n itemsContainer.setAttribute('checkable', '');\n }\n\n if (that.checkboxes) {\n itemsContainer.setAttribute('checkboxes', '');\n }\n\n if (that.$.view && that.detachedChildren.indexOf(that.$.view)) {\n that.detachedChildren.push(that.$.view);\n }\n }", "function load()\n{\n dashcode.setupParts();\n}", "function load()\n{\n dashcode.setupParts();\n}", "function load()\n{\n dashcode.setupParts();\n}", "function charBlink(){ //start script\n app.beginUndoGroup(\"Create Character Blink Control\");\n\n //if(parseFloat(app.version) >= 10.5){\n var theComp = app.project.activeItem; //only selected\n\n // check if comp is selected\n if (theComp == null || !(theComp instanceof CompItem)){\n // if no comp selected, display an alert\n alert(\"Please establish a comp as the active item and run the script again.\");\n } else {\n var theLayers = theComp.selectedLayers;\n if(theLayers.length==0){\n alert(\"Please select a precomp and run the script again.\");\n }else{\n // otherwise, loop through each selected layer in the selected comp\n for (var i = 0; i < theLayers.length; i++){\n // define the layer in the loop we're currently looking at\n var curLayer = theLayers[i];\n // Select layer to add expression to\n if (curLayer.matchName == \"ADBE AV Layer\"){\n //first check if this is a footage layer\n //next check if this is a comp.\n var myLayer = theComp.selectedLayers[0];\n if(myLayer.source.numLayers==null){\n //not a comp; send alert.\n alert(\"This only works on precomp layers.\");\n }else{\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n //myLayer is indeed a precomp. OK to do stuff.\n var checkbox = myLayer.property(\"Effects\").addProperty(\"Checkbox Control\");\n checkbox.name = \"blink control\"\n var blinker = myLayer.source.layers.addNull();\n blinker.name = \"blink placeholder\";\n //when blink asset replaces null, anchor point will be centered.\n blinker.transform.anchorPoint.setValue([50,50]);\n expr = \"comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + checkbox.name + \"\\\")(\\\"Checkbox\\\") * 100;\";\n blinker.property(\"Opacity\").expression = expr;\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n }\n }else{\n //not a footage layer; send alert.\n alert(\"This only works on precomp layers.\");\n }\n }\n }\n }\n \n app.endUndoGroup();\n} //end script", "extend(config, { isClient, isDev }) {\n // Run ESLint on save\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue|ts)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n })\n\n // stylelint\n config.plugins.push(\n new StylelintPlugin({\n files: ['**/*.vue'],\n }),\n )\n\n config.devtool = '#source-map'\n }\n\n // glsl\n config.module.rules.push({\n test: /\\.(glsl|vs|fs)$/,\n use: ['raw-loader', 'glslify-loader'],\n exclude: /(node_modules)/,\n })\n\n config.module.rules.push({\n test: /\\.(ogg|mp3|wav|mpe?g)$/i,\n loader: 'file-loader',\n options: {\n name: '[path][name].[ext]',\n },\n })\n\n config.output.globalObject = 'this'\n\n config.module.rules.unshift({\n test: /\\.worker\\.ts$/,\n loader: 'worker-loader',\n })\n config.module.rules.unshift({\n test: /\\.worker\\.js$/,\n loader: 'worker-loader',\n })\n\n // import alias\n config.resolve.alias.Sass = path.resolve(__dirname, './assets/sass/')\n config.resolve.alias.Js = path.resolve(__dirname, './assets/js/')\n config.resolve.alias.Images = path.resolve(__dirname, './assets/images/')\n config.resolve.alias['~'] = path.resolve(__dirname)\n config.resolve.alias['@'] = path.resolve(__dirname)\n }", "flattenAll() {\n EventBus.$emit(\"try-flatten-all-layers\");\n }", "function AddAssets()\n{\n\t//Add static background sprites\n\tbackColor = gfx.CreateRectangle(1, 1, 0xfffdad )\n\tgfx.AddGraphic( backColor, 0 , 0 )\n\tgfx.AddSprite( face, 0, 0.886, 1 )\n\tgfx.AddSprite( pasta, 0.85, 0.08, 0.1 )\n\tgfx.AddSprite( pastaIcon, 0.85, 0.08, 0.1 )\n\tgfx.AddSprite( paperIcon, 0.86, 0.15, 0.08 )\n \n //Add counters.\n\tgfx.AddText( pastaTxt, 0.8, 0.09 );\n\tgfx.AddText( paperTxt, 0.8, 0.15 );\n \n //Add scores\n\tgfx.AddText( score, 0.012, 0.01 );\n\tgfx.AddText( immune, 0.68, 0.02 );\n\tgfx.AddSprite( heart, 0.86, 0.02, 0.08 )\n\t\n\t//Add game objects to screen.\n\tAddHandSan()\n \n //Create a batch containers for our virus and drop sprites.\n //(gives higher performance for lots of same sprite/particle)\n batchVirus = gfx.CreateBatch()\n gfx.AddBatch( batchVirus )\n batchDrops = gfx.CreateBatch()\n gfx.AddBatch( batchDrops )\n \n //Hack to provide missing funcs in GameView.\n batchVirus.RemoveSprite = function( sprite ) { batchVirus.removeChild( sprite.sprite ); sprite.added = false; }\n batchDrops.RemoveSprite = function( sprite ) { batchDrops.removeChild( sprite.sprite ); sprite.added = false; }\n \n\t//Show splash screen.\n gfx.AddSprite( screens, 0, 0, 1,1 )\n \n \n //Start game.\n gfx.Play()\n \n\n\tscreens.PlayRange(2,8,0.08*animationSpeed,false)\n\tsetTimeout(function(){screens.Goto(0); ready=true},2500)\n}", "_tryToAddAllChildren(evt) {\n // If this element's elementInst isn't ready, halt and wait until later\n // If this event isn't coming from this element, do not handle\n const localEvt = Polymer.dom(evt);\n if (!this.elementInst || localEvt.rootTarget !== this) return;\n\n // If my own elementInst was just created, loop over children and try to attach them\n this._attachLayerChildren();\n }", "function loadSubModule() {\n\n // CAPTURE MODULE SIZING ON TRANSITION\n var contentModule = $('#content_module');\n contentModule\n .height(contentModule.height())\n .width(contentModule.width());\n\n // HANDLE SELECTED STATES\n $('.navigation_item').removeClass('selected');\n el.addClass('selected');\n\n // DYNAMIC HEIGHT CALCULATIONS\n var windowHeight = $(window).innerHeight();\n\n var singleOffset = $('#flat_view').offset();\n\n var infoTitle = $('.info_title');\n var infoTitleHeight = infoTitle.outerHeight();\n\n var subNavigation = $('#sub_navigation');\n var subnavHeight = subNavigation.outerHeight();\n var subnavPosition = subNavigation.position();\n var innerSubNavHeight = infoTitleHeight + subnavHeight;\n\n var contentHeight = windowHeight - singleOffset.top;\n\n\n // SET CONTENT LOCATIONS PRE ANIMATION\n $('#sub_module').show().css({visibility: 'hidden'});\n\n var moduleNavigation = $('#module_navigation');\n var moduleNavHeight = moduleNavigation.outerHeight();\n\n if (subAction == \"clip\" || subAction == \"similar\") {\n var subContentHeight = windowHeight\n - (singleOffset.top\n + innerSubNavHeight\n );\n $('#module_navigation').hide();\n $('#episode_inner_wrapper')\n .removeClass('list_view')\n .addClass('thumb_view');\n } else {\n var subContentHeight = windowHeight\n - (singleOffset.top\n + innerSubNavHeight\n + moduleNavHeight\n );\n $('#module_navigation').show();\n $('#episode_inner_wrapper')\n .removeClass('thumb_view')\n .addClass('list_view');\n }\n\n $('#episode_outer').height(subContentHeight);\n\n // TRANSITION ANIMATIONS\n $('#action_subnav').fadeIn(500);\n\n // SUB NAV TRANSITION ANIMATIONS\n contentModule.animate({height: contentHeight}, 250);\n\n $('#content_wrapper').animate({opacity: 0}, 250, function (e) {\n $(this).hide();\n $('#sub_navigation')\n .addClass('subnav_open')\n .css({top: subnavPosition.top})\n .animate({top: infoTitleHeight}, 350);\n\n // SUB MODULE LOADER\n\n $('#sub_module').css({\n top: windowHeight,\n opacity: 1,\n visibility: 'visible'\n }).delay(250).animate({top: innerSubNavHeight}, 350);\n\n /*\n NOTES: redo the module to have 3 internal sections\n - detect which view you are on\n - have it move left or right based on what is currently selected\n */\n\n });\n\n }", "loadModules() {\n const modulePath = this._urlParams.get('modulePath');\n const filePath = this._urlParams.get('filePath');\n let partitions = this._urlParams.get('partition');\n let split = parseInt(this._urlParams.get('split'), 10);\n\n split = isNaN(split) ? 1 : split;\n\n if (partitions === undefined) {\n partitions = [1];\n } else if (!Array.isArray(partitions)) {\n partitions = [partitions];\n }\n\n super.loadModules();\n\n if (modulePath || filePath) {\n this._testModules = filterTestModules(\n this._testModules,\n modulePath,\n filePath\n );\n }\n\n this._testModules = splitTestModules(this._testModules, split, partitions);\n this._testModules.forEach((moduleName) => {\n super.require(moduleName);\n super.unsee(moduleName);\n });\n }", "function applyLayout() {\n\n\n $(settings.target).imagesLoaded(function() {\n\n $(settings.target).find('.assets').css('display', 'inline-block').fadeIn('slow');\n settings.loader.fadeOut('normal');\n // console.timeEnd('instatimer')\n\n settings.after()\n\n });\n\n }", "preloadAssets()\n {\n // Create our manifest of files to load\n // PreloadJS will try to automatically parse what kind of file we're loading \n // We can consider making a seperate JSON file that has all of this info in it\n manifest = [\n\t\t\t{\n src: \"leave_these_alone/audio.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/utils.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/ui/screen.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/ui/ui.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/ui/endscreen.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/ui/gamescreen.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/ui/helpscreen.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/ui/mainmenu.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/gameobjects/actor.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/gameobjects/bullet.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/gameobjects/enemy.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/gameobjects/pickups.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/effects/particle.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/effects/effects.js\",\n },\n \n ];\n\n\t\t// Add user defined assets to the manifest\n\t\tmanifest = manifest.concat(mediaManifest);\n\n // Set the root filepath for our assets\n this.queue = new createjs.LoadQueue(true);\n \n // Use the following to use 'mp3' if 'ogg' doesn't work on browser\n createjs.Sound.alternateExtensions = [\"mp3\"];\n\n // Be sure to install the createjs sound plugin or your sounds won't play\n this.queue.installPlugin(createjs.Sound);\n \n // Set some callbacks\n this.queue.on(\"progress\", this.loadProgress, this);\n this.queue.on(\"fileload\", this.fileLoaded, this);\n this.queue.on(\"complete\", this.loadComplete, this);\n this.queue.loadManifest(manifest);\n }", "function preload () {\n loadAssets();\n enableCrispRendering();\n}", "chainWebpack (config, isServer) {\n if (isServer) {\n config\n .entry('app')\n .clear()\n .add(path.resolve(__dirname, 'lib/webpack/serverEntry.js'))\n } else {\n config\n .entry('app')\n .clear()\n .add(path.resolve(__dirname, 'lib/webpack/clientEntry.js'))\n }\n }", "function createAssets(){\n assets = [];\n assets.push(path.join(__dirname, '../plug/pip_resolve.py'));\n assets.push(path.join(__dirname, '../plug/distPackage.py'));\n assets.push(path.join(__dirname, '../plug/package.py'));\n assets.push(path.join(__dirname, '../plug/reqPackage.py'));\n assets.push(path.join(__dirname, '../plug/utils.py'));\n\n assets.push(path.join(__dirname, '../plug/requirements/fragment.py'));\n assets.push(path.join(__dirname, '../plug/requirements/parser.py'));\n assets.push(path.join(__dirname, '../plug/requirements/requirement.py'));\n assets.push(path.join(__dirname, '../plug/requirements/vcs.py'));\n assets.push(path.join(__dirname, '../plug/requirements/__init__.py'));\n\n return assets;\n}", "postprocessTree(name, tree) {\n\n const aggregatorTree = this.env.app.trees.cssblocks;\n\n // If this is not the root app, or the css tree, no-op.\n if (this.env.isAddon || name !== 'css' || !aggregatorTree) { return tree; }\n\n DEBUG(`Writing all CSS Blocks output to \"${this.outputFile}\".`);\n let merged = new BroccoliMerge([tree, aggregatorTree], { overwrite: true })\n merged = new BroccoliConcat(merged, {\n outputFile: this.outputFile,\n inputFiles: [ this.outputFile, this.aggregateFile ],\n allowNone: true,\n });\n\n return new BroccoliMerge([tree, merged], { overwrite: true });\n }", "function precacheOnLoad(event) {\n // Check inside onload to make sure Package.appcache has had a chance to\n // become available.\n if (!Package.appcache) {\n return;\n } // Prefetch in chunks to reduce overhead. If we call module.prefetch(id)\n // multiple times in the same tick of the event loop, all those modules\n // will be fetched in one HTTP POST request.\n\n\n function prefetchInChunks(modules, amount) {\n Promise.all(modules.splice(0, amount).map(function (id) {\n return _module4.prefetch(id);\n })).then(function () {\n if (modules.length > 0) {\n setTimeout(function () {\n prefetchInChunks(modules, amount);\n }, 0);\n }\n });\n } // Get a flat array of modules and start prefetching.\n\n\n prefetchInChunks(getFlatModuleArray(versions), 50);\n } // Use window.onload to only prefetch after the main bundle has loaded.", "onEnd({ compilation }) {\n console.log('end detecting webpack modules cycles');\n }", "function loadAssets(event)\r\n{\r\n\tfor (var i = 0; i < buttons.length; i++)\r\n\t{\r\n\t\tvar tempBtn = new Image();\r\n\t\ttempBtn.src = buttons[i].img;\r\n\t\ttempBtn.addEventListener(\"load\", onAssetLoad);\r\n\t\tbuttons[i].img = tempBtn; // .img used to hold the path string, now it holds the actual image object.\r\n\t\tvar tempBtnO = new Image();\r\n\t\ttempBtnO.src = buttons[i].imgO;\r\n\t\ttempBtnO.addEventListener(\"load\", onAssetLoad);\r\n\t\tbuttons[i].imgO = tempBtnO;\r\n\t}\r\n}", "preload() {\r\n\r\n // plugins:\r\n this.load.plugin('DialogModalPlugin', './js/dialog_plugin.js');\r\n this.load.plugin('PirateFunctionsPlugin', './js/PirateFunctionsPlugin.js');\r\n\r\n // main images\r\n this.load.image(\"Port\", \"assets/PortScene800.jpg\");\r\n this.load.image(\"SailBtn\", \"assets/TallShip45.jpg\");\r\n this.load.image(\"IronBtn\", \"assets/IronOre4.png\");\r\n\r\n // status icons will be on top of anything else.\r\n //this.load.image(\"singleHeart\", \"assets/singleHeart16.png\");\r\n //this.load.image(\"blankHeart\", \"assets/blankHeart16.png\");\r\n\r\n\r\n // Audio: Needed all incase of game end while in this scene.\r\n //Really should have.ogg too.\r\n // Notes: instances allows for the given number of multiple simultainous plays of the same item.\r\n // so instances :4 allows 4 copies of that sound to play simultainiously or overlapping if desired.\r\n this.load.audio('OceanSound', ['assets/audio/Waves.mp3']);\r\n this.load.audio('MarketSound', ['assets/audio/ShoppingMallAmbiance.mp3']);\r\n //this.load.audio('VolcanoSound', ['assets/audio/Atomic_Bomb.mp3'], { instances: 2 });\r\n //this.load.audio('EarthQuakeSound', ['assets/audio/EarthQuake.mp3']);\r\n\r\n }", "function setup() {\n if (!_baseStylesCreated) {\n ExtensionUtils.loadStyleSheet(module, \"../styles/linguistics.less\");\n _createBaseStyles();\n }\n }", "load( resolver ) {\n const nextToLoad = this.layers.find( ( { isready } ) => !isready );\n if( nextToLoad ) {\n const loader = Promise.all( nextToLoad.prop.use.map( ({ type = \"url\", ...use }) =>\n type === \"url\" ? Loader.default.obtain( use ) : this.get( use.path )\n ));\n loader.then(( packs ) => {\n packs.map( (pkj, index) => {\n const { type = \"url\" } = nextToLoad.prop.use[index];\n if(type === \"url\") {\n this.appendData( pkj, nextToLoad.src );\n }\n else {\n this.merge( pkj, true );\n }\n } );\n nextToLoad.isready = true;\n this.load( resolver );\n });\n }\n else {\n resolver( this );\n }\n }", "processFileChanges(aManifests, aUpdateCompatibility, aOldAppVersion, aOldPlatformVersion) {\n let loadedManifest = (aInstallLocation, aId) => {\n if (!(aInstallLocation.name in aManifests))\n return null;\n if (!(aId in aManifests[aInstallLocation.name]))\n return null;\n return aManifests[aInstallLocation.name][aId];\n };\n\n // Get the previous add-ons from the database and put them into maps by location\n let previousAddons = new Map();\n for (let a of XPIDatabase.getAddons()) {\n let locationAddonMap = previousAddons.get(a.location);\n if (!locationAddonMap) {\n locationAddonMap = new Map();\n previousAddons.set(a.location, locationAddonMap);\n }\n locationAddonMap.set(a.id, a);\n }\n\n // Build the list of current add-ons into similar maps. When add-ons are still\n // present we re-use the add-on objects from the database and update their\n // details directly\n let currentAddons = new Map();\n for (let installLocation of XPIProvider.installLocations) {\n let locationAddonMap = new Map();\n currentAddons.set(installLocation.name, locationAddonMap);\n\n // Get all the on-disk XPI states for this location, and keep track of which\n // ones we see in the database.\n let states = XPIStates.getLocation(installLocation.name);\n\n // Iterate through the add-ons installed the last time the application\n // ran\n let dbAddons = previousAddons.get(installLocation.name);\n if (dbAddons) {\n for (let [id, oldAddon] of dbAddons) {\n // Check if the add-on is still installed\n let xpiState = states && states.get(id);\n if (xpiState) {\n // Here the add-on was present in the database and on disk\n recordAddonTelemetry(oldAddon);\n\n // Check if the add-on has been changed outside the XPI provider\n if (oldAddon.updateDate != xpiState.mtime) {\n // Did time change in the wrong direction?\n if (xpiState.mtime < oldAddon.updateDate) {\n XPIProvider.setTelemetry(oldAddon.id, \"olderFile\", {\n name: XPIProvider._mostRecentlyModifiedFile[id],\n mtime: xpiState.mtime,\n oldtime: oldAddon.updateDate\n });\n } else {\n XPIProvider.setTelemetry(oldAddon.id, \"modifiedFile\",\n XPIProvider._mostRecentlyModifiedFile[id]);\n }\n }\n\n // The add-on has changed if the modification time has changed, or\n // we have an updated manifest for it. Also reload the metadata for\n // add-ons in the application directory when the application version\n // has changed\n let newAddon = loadedManifest(installLocation, id);\n if (newAddon || oldAddon.updateDate != xpiState.mtime ||\n (aUpdateCompatibility && (installLocation.name == KEY_APP_GLOBAL ||\n installLocation.name == KEY_APP_SYSTEM_DEFAULTS))) {\n newAddon = this.updateMetadata(installLocation, oldAddon, xpiState, newAddon);\n }\n else if (oldAddon.descriptor != xpiState.descriptor) {\n newAddon = this.updateDescriptor(installLocation, oldAddon, xpiState);\n }\n else if (aUpdateCompatibility) {\n newAddon = this.updateCompatibility(installLocation, oldAddon, xpiState,\n aOldAppVersion, aOldPlatformVersion);\n }\n else {\n // No change\n newAddon = oldAddon;\n }\n\n if (newAddon)\n locationAddonMap.set(newAddon.id, newAddon);\n }\n else {\n // The add-on is in the DB, but not in xpiState (and thus not on disk).\n this.removeMetadata(oldAddon);\n }\n }\n }\n\n // Any add-on in our current location that we haven't seen needs to\n // be added to the database.\n // Get the migration data for this install location so we can include that as\n // we add, in case this is a database upgrade or rebuild.\n let locMigrateData = {};\n if (XPIDatabase.migrateData && installLocation.name in XPIDatabase.migrateData)\n locMigrateData = XPIDatabase.migrateData[installLocation.name];\n\n if (states) {\n for (let [id, xpiState] of states) {\n if (locationAddonMap.has(id))\n continue;\n let migrateData = id in locMigrateData ? locMigrateData[id] : null;\n let newAddon = loadedManifest(installLocation, id);\n let addon = this.addMetadata(installLocation, id, xpiState, newAddon,\n aOldAppVersion, aOldPlatformVersion, migrateData);\n if (addon)\n locationAddonMap.set(addon.id, addon);\n }\n }\n }\n\n // previousAddons may contain locations where the database contains add-ons\n // but the browser is no longer configured to use that location. The metadata\n // for those add-ons must be removed from the database.\n for (let [locationName, addons] of previousAddons) {\n if (!currentAddons.has(locationName)) {\n for (let [id, oldAddon] of addons)\n this.removeMetadata(oldAddon);\n }\n }\n\n // Validate the updated system add-ons\n let systemAddonLocation = XPIProvider.installLocationsByName[KEY_APP_SYSTEM_ADDONS];\n let addons = currentAddons.get(KEY_APP_SYSTEM_ADDONS) || new Map();\n\n let hideLocation;\n if (systemAddonLocation.isActive() && systemAddonLocation.isValid(addons)) {\n // Hide the system add-on defaults\n logger.info(\"Hiding the default system add-ons.\");\n hideLocation = KEY_APP_SYSTEM_DEFAULTS;\n }\n else {\n // Hide the system add-on updates\n logger.info(\"Hiding the updated system add-ons.\");\n hideLocation = KEY_APP_SYSTEM_ADDONS;\n }\n\n let previousVisible = this.getVisibleAddons(previousAddons);\n let currentVisible = this.flattenByID(currentAddons, hideLocation);\n let sawActiveTheme = false;\n XPIProvider.bootstrappedAddons = {};\n\n // Pass over the new set of visible add-ons, record any changes that occured\n // during startup and call bootstrap install/uninstall scripts as necessary\n for (let [id, currentAddon] of currentVisible) {\n let previousAddon = previousVisible.get(id);\n\n // Note if any visible add-on is not in the application install location\n if (currentAddon._installLocation.name != KEY_APP_GLOBAL)\n XPIProvider.allAppGlobal = false;\n\n let isActive = !currentAddon.disabled;\n let wasActive = previousAddon ? previousAddon.active : currentAddon.active\n\n if (!previousAddon) {\n // If we had a manifest for this add-on it was a staged install and\n // so wasn't something recovered from a corrupt database\n let wasStaged = !!loadedManifest(currentAddon._installLocation, id);\n\n // We might be recovering from a corrupt database, if so use the\n // list of known active add-ons to update the new add-on\n if (!wasStaged && XPIDatabase.activeBundles) {\n // For themes we know which is active by the current skin setting\n if (currentAddon.type == \"theme\")\n isActive = currentAddon.internalName == XPIProvider.currentSkin;\n else\n isActive = XPIDatabase.activeBundles.indexOf(currentAddon.descriptor) != -1;\n\n // If the add-on wasn't active and it isn't already disabled in some way\n // then it was probably either softDisabled or userDisabled\n if (!isActive && !currentAddon.disabled) {\n // If the add-on is softblocked then assume it is softDisabled\n if (currentAddon.blocklistState == Blocklist.STATE_SOFTBLOCKED)\n currentAddon.softDisabled = true;\n else\n currentAddon.userDisabled = true;\n }\n }\n else {\n // This is a new install\n if (currentAddon.foreignInstall)\n AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_INSTALLED, id);\n\n if (currentAddon.bootstrap) {\n // Visible bootstrapped add-ons need to have their install method called\n XPIProvider.callBootstrapMethod(currentAddon, currentAddon._sourceBundle,\n \"install\", BOOTSTRAP_REASONS.ADDON_INSTALL);\n if (!isActive)\n XPIProvider.unloadBootstrapScope(currentAddon.id);\n }\n }\n }\n else {\n if (previousAddon !== currentAddon) {\n // This is an add-on that has changed, either the metadata was reloaded\n // or the version in a different location has become visible\n AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_CHANGED, id);\n\n let installReason = Services.vc.compare(previousAddon.version, currentAddon.version) < 0 ?\n BOOTSTRAP_REASONS.ADDON_UPGRADE :\n BOOTSTRAP_REASONS.ADDON_DOWNGRADE;\n\n // If the previous add-on was in a different path, bootstrapped\n // and still exists then call its uninstall method.\n if (previousAddon.bootstrap && previousAddon._installLocation &&\n previousAddon._sourceBundle.exists() &&\n currentAddon._sourceBundle.path != previousAddon._sourceBundle.path) {\n\n XPIProvider.callBootstrapMethod(previousAddon, previousAddon._sourceBundle,\n \"uninstall\", installReason,\n { newVersion: currentAddon.version });\n XPIProvider.unloadBootstrapScope(previousAddon.id);\n }\n\n // Make sure to flush the cache when an old add-on has gone away\n flushStartupCache();\n\n if (currentAddon.bootstrap) {\n // Visible bootstrapped add-ons need to have their install method called\n let file = Cc[\"@mozilla.org/file/local;1\"].createInstance(Ci.nsIFile);\n file.persistentDescriptor = currentAddon._sourceBundle.persistentDescriptor;\n XPIProvider.callBootstrapMethod(currentAddon, file,\n \"install\", installReason,\n { oldVersion: previousAddon.version });\n if (currentAddon.disabled)\n XPIProvider.unloadBootstrapScope(currentAddon.id);\n }\n }\n\n if (isActive != wasActive) {\n let change = isActive ? AddonManager.STARTUP_CHANGE_ENABLED\n : AddonManager.STARTUP_CHANGE_DISABLED;\n AddonManagerPrivate.addStartupChange(change, id);\n }\n }\n\n XPIDatabase.makeAddonVisible(currentAddon);\n currentAddon.active = isActive;\n\n // Make sure the bootstrap information is up to date for this ID\n if (currentAddon.bootstrap && currentAddon.active) {\n XPIProvider.bootstrappedAddons[id] = {\n version: currentAddon.version,\n type: currentAddon.type,\n descriptor: currentAddon._sourceBundle.persistentDescriptor,\n multiprocessCompatible: currentAddon.multiprocessCompatible,\n runInSafeMode: canRunInSafeMode(currentAddon),\n };\n }\n\n if (currentAddon.active && currentAddon.internalName == XPIProvider.selectedSkin)\n sawActiveTheme = true;\n }\n\n // Pass over the set of previously visible add-ons that have now gone away\n // and record the change.\n for (let [id, previousAddon] of previousVisible) {\n if (currentVisible.has(id))\n continue;\n\n // This add-on vanished\n\n // If the previous add-on was bootstrapped and still exists then call its\n // uninstall method.\n if (previousAddon.bootstrap && previousAddon._sourceBundle.exists()) {\n XPIProvider.callBootstrapMethod(previousAddon, previousAddon._sourceBundle,\n \"uninstall\", BOOTSTRAP_REASONS.ADDON_UNINSTALL);\n XPIProvider.unloadBootstrapScope(previousAddon.id);\n }\n AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_UNINSTALLED, id);\n\n // Make sure to flush the cache when an old add-on has gone away\n flushStartupCache();\n }\n\n // Make sure add-ons from hidden locations are marked invisible and inactive\n let locationAddonMap = currentAddons.get(hideLocation);\n if (locationAddonMap) {\n for (let addon of locationAddonMap.values()) {\n addon.visible = false;\n addon.active = false;\n }\n }\n\n // If a custom theme is selected and it wasn't seen in the new list of\n // active add-ons then enable the default theme\n if (XPIProvider.selectedSkin != XPIProvider.defaultSkin && !sawActiveTheme) {\n logger.info(\"Didn't see selected skin \" + XPIProvider.selectedSkin);\n XPIProvider.enableDefaultTheme();\n }\n\n // Finally update XPIStates to match everything\n for (let [locationName, locationAddonMap] of currentAddons) {\n for (let [id, addon] of locationAddonMap) {\n let xpiState = XPIStates.getAddon(locationName, id);\n xpiState.syncWithDB(addon);\n }\n }\n XPIStates.save();\n\n XPIProvider.persistBootstrappedAddons();\n\n // Clear out any cached migration data.\n XPIDatabase.migrateData = null;\n XPIDatabase.saveChanges();\n\n return true;\n }", "connectedCallback () {\n this._container.addEventListener('click', e => {\n for (let application of this._applications) {\n if (e.target === application) {\n this._windowHandler.addWindow(new SubWindow(application.getNewApplication(), true, application.getIconURL()),\n application.getApplication(application.getNoOfApplicationInstances() - 1).getWidthRequired(),\n application.getApplication(application.getNoOfApplicationInstances() - 1).getHeightRequired() + this._headerSize)\n this._dragger.startListening()\n let app = application.getApplication(application.getNoOfApplicationInstances() - 1)\n // If application is life-game, set eventlistener\n if (application.getName() === 'life') {\n app.addEventListener('sentimage', e => {\n let imgURL = app.getSnapShot()\n for (let application2 of this._applications) {\n if (application2.getName() === 'chat') {\n application2.getAllApplications().forEach(function (element) {\n element.importImageURL(imgURL)\n element.pasteImage()\n })\n }\n }\n })\n }\n }\n }\n })\n\n this._AppContainer.addEventListener('mouseover', e => {\n // Make sure element moves to front\n this._windowHandler.incrementZindex()\n this._windowHandler.unfocusAllWindows()\n this._AppContainer.style.zIndex = this._windowHandler.getHighestZindex()\n this._applications.forEach((element) => {\n element.style.visibility = 'visible'\n })\n\n // And change size of bubble\n this._AppContainer.style.width = `${this._applications.length * (this._buttonWidth + this._buttonSpacer) +\n 2 * this._buttonSpacer}px`\n this._AppContainer.style.height = `${this._buttonHeight + 2 * this._buttonSpacer}px`\n })\n this._AppContainer.addEventListener('mouseout', e => {\n this._applications.forEach((element) => {\n element.style.visibility = 'hidden'\n })\n this._AppContainer.style.width = this._AppContIdleWidth\n this._AppContainer.style.height = this._AppContIdleHeight\n })\n }", "LoadAssetWithSubAssetsAsync() {}" ]
[ "0.5383611", "0.51045036", "0.49603733", "0.49231604", "0.48563278", "0.48110336", "0.47793204", "0.477812", "0.47137147", "0.47124335", "0.46880016", "0.46701124", "0.45786047", "0.45522353", "0.4539783", "0.4539087", "0.45117006", "0.4509285", "0.4509285", "0.4503998", "0.4498734", "0.4494023", "0.44881982", "0.44817227", "0.44564942", "0.44405788", "0.4435279", "0.4433386", "0.4428824", "0.44284865", "0.44134828", "0.44133565", "0.44119018", "0.43966755", "0.43935364", "0.43927822", "0.43732655", "0.43716568", "0.43644944", "0.43590474", "0.43550628", "0.43498847", "0.4349689", "0.4335701", "0.43286875", "0.43149385", "0.43100905", "0.4309536", "0.43082762", "0.43082762", "0.4307928", "0.43074843", "0.43057743", "0.43036407", "0.42960468", "0.4295894", "0.4295566", "0.4289048", "0.4289048", "0.4289048", "0.4289048", "0.4289048", "0.42863545", "0.4285662", "0.42642614", "0.42639592", "0.4259811", "0.42492548", "0.42474365", "0.42454374", "0.42438743", "0.42410824", "0.4240555", "0.42381555", "0.4237308", "0.42364538", "0.42335275", "0.42335275", "0.42335275", "0.4231069", "0.4229515", "0.42260867", "0.42176464", "0.4211927", "0.42116812", "0.42011195", "0.42010137", "0.4198284", "0.41914362", "0.419013", "0.41893384", "0.41865265", "0.4186285", "0.4183866", "0.41758788", "0.41742578", "0.4173795", "0.41719326", "0.41719165", "0.41709384", "0.4168556" ]
0.0
-1
Send everyone in the playerlist their name as well as everyone in the que
static sendQue(socket) { var playerNames = Player.updateNames() for(var i in Player.list){ var socket = SOCKET_LIST[i]; //socket.emit('Players', socket.name, playerNames) console.log(playerNames) socket.emit('Players', socket.name, playerNames) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sendAllMembers(name, data) {\n\t\tlet member = Array.from(this.members).filter((user) => user.name === name);\n\t\tconst memNames = [];\n\t\tfor (let member of this.members) {\n\t\t\tmember.name === name ? memNames.push(\"you\") : memNames.push(member.name);\n\t\t}\n\t\tdata.text = \"In room: \".concat(memNames.join(\",\"));\n\t\tmember[0].send(JSON.stringify(data));\n\t}", "sendJoke(name, data) {\n\t\tlet member = Array.from(this.members).filter((user) => user.name === name);\n\t\tmember[0].send(JSON.stringify(data));\n\t}", "function TellOurName(name : String,info : NetworkMessageInfo){\n\tvar netPlayer : NetworkPlayer = info.sender;\n\tif(netPlayer+\"\"==\"-1\"){\n\t\t//This hack is required to fix the local players networkplayer when the RPC is sent to itself.\n\t\tnetPlayer=Network.player;\n\t}\n\tDebug.Log(\"NetworkPlayer: \"+netPlayer.ToString());\n\t\n\tvar newEntry : FPSPlayerNode = new FPSPlayerNode();\n\tnewEntry.playerName=name;\n\tnewEntry.networkPlayer=netPlayer;\n\tfor (var i=0;i<10;i=i+1){\n\t\tif (playerNumbers[i]==0){\n\t\t\tplayerNumbers[i]=1;\n\t\t\tplayerID=i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tnewEntry.playerID=playerID;\n\tplayerList.Add(newEntry);\n\t\n\tnetworkView.RPC(\"clearLists\",RPCMode.Others);\n\t\n\tfor(var entry : FPSPlayerNode in playerList as List.<FPSPlayerNode>){\n\t\tnetworkView.RPC(\"sendList\",RPCMode.Others,entry.networkPlayer,entry.playerName,entry.playerID,entry.kills,entry.deaths,entry.mode);\n\t}\t\n\t\n\tif(Network.isServer){\n\t\tchatScript.addGameChatMessage(name+\" joined the game\");\n\t}\n}", "function sendPlayers() {\r\n if (!SINGLE) {\r\n process.send({ type: \"players\", count: roomInstance.player_count });\r\n }\r\n}", "function TellOurName(name : String, info : NetworkMessageInfo){\n\tvar netPlayer : NetworkPlayer = info.sender;\n\tif(netPlayer+\"\"==\"-1\"){\n\t\t//This hack is required to fix the local players networkplayer when the RPC is sent to itself.\n\t\tnetPlayer=Network.player;\n\t}\n\t\n\tvar newEntry : FPSPlayerNode = new FPSPlayerNode();\n\tnewEntry.playerName=name;\n\tnewEntry.networkPlayer=netPlayer;\n\tplayerList.Add(newEntry);\n\t\n\tif(Network.isServer){\n\t\tchatScript.addGameChatMessage(name+\" joined the game\");\n\t}\n}", "sendToPlayer(aMessage) {\n\n for (let i = 0, len = this.players.length; i < len; i++) {\n if (this.players[i].playerId === aMessage.playerId) {\n this.players[i].socket.send(JSON.stringify(aMessage));\n }\n }\n }", "function sendMyPlaylists() {\n var playlists = [];\n $(\"#playlists\").children(\"a\").each(function() {\n playlists.push({title: $.trim($(this).find(\".tooltip\").text()), titleLink: getLink($(this))});\n });\n post(\"player-navigationList\", {type: \"playlistsList\", link: \"myPlaylists\", list: playlists, empty: playlists.length === 0});\n }", "static updateNames() {\n var playerNames = [];\n for (var i in Player.list) {\n playerNames.push(SOCKET_LIST[i].name);\n }\n ;\n return playerNames;\n }", "sendPos()\n {\n for(const playerId in this.players)\n {\n const data = []\n const player = this.players[playerId]\n data.push({\n name: player.name,\n color: player.color,\n position: player.engineObject.position,\n musicInfo: player.musicInfo\n })\n for(const nearPlayer of player.getNearPlayers(300))\n {\n data.push({\n id: nearPlayer.id,\n name: nearPlayer.name,\n color: nearPlayer.color,\n position: nearPlayer.engineObject.position,\n musicInfo: nearPlayer.musicInfo,\n energy: nearPlayer.energy\n })\n }\n player.socket.emit('updatePlayer', data)\n }\n }", "sendAll(message) {\n for (let i = 0, len = this.players.length; i < len; i++) {\n this.players[i].socket.send(message);\n }\n }", "function getParticipants() {\n\tdocument.getElementById(\"acceptQuest\").style.display = \"inline\";\n\tvar serverMsg = document.getElementById('serverMsg');\n\tserverMsg.value += \"\\n> please accept/decline quest by clicking below\"\n\tif (isAI) {\n\t\tvar data = JSON.stringify({\n\t\t\t'AICommand' : \"AskToParticipateQuest\"\n\t\t})\n\t\tsetTimeout(function(){ socketConn.send(data); }, 1000);\n\t\tdocument.getElementById(\"acceptQuest\").style.display = \"none\";\n\t\tserverMsg.value += \"\\n> wait for other players...\";\n\t}\n\tgetCurrHand();\n\tfor(var i=0; i<handCardSRC.length; i++) {\n\t\tif(handCardSRC[i].includes(\"Merlin\")) {\n\t\t\tdocument.getElementById(\"merlin\").style.display = \"block\";\n\t\t\tdocument.getElementById(\"merlinPrompt\").innerText = \"You have Merlin in hand, preview stage?\";\n\t\t\tvar data = JSON.stringify({\n\t\t\t\t'hasMerlin' : 0,\n\t\t\t\t'name' : PlayerName\n\t\t\t})\n\t\t\tsocketConn.send(data);\n\t\t}\n\t}\n}", "async askNames(nbPlayers){\n var names = [];\n for (var i = 1; i <= nbPlayers; i++) {\n names.push({\n type: 'input',\n name: 'nomJoueur' + i,\n message: 'Nom joueur ' + i + ':',\n });\n }\n return await inquirer.prompt(names).then(answers => {\n var nameList = Object.values(answers);\n for (var name of nameList){\n var player = new Player(name);\n this.players.push(player);\n }\n })\n }", "function listQueue(res) {\n if (queue.isEmpty()) {\n res.send('Nobody! Like this: []');\n } else {\n res.send('Here\\'s who\\'s in the queue: ' + _.pluck(queue.get(), 'name').join(', ') + '.');\n }\n }", "messagePlayers(message) {\n message = JSON.stringify(message);\n if (this.player1) this.player1.ws.send(message);\n if (this.player2) this.player2.ws.send(message);\n for (let i = this.spectators.length - 1; i >= 0; i--) {\n if (this.spectators[i].ws) {\n this.spectators[i].ws.send(message);\n } else {\n this.spectators.splice(i, 1);\n }\n }\n }", "function searchToQueue(url, name){\n\t socket.emit('link', {\n\t\turl : url,\n\t\ttitle: getVidDeets(url, 'title'),\n\t\tname : name,\n\t\troom : roomID\n\t });\t \n}", "broadcast(message) {\n var raw = JSON.stringify(message);\n for (var p of this.players) {\n p.connection.send(raw);\n }\n }", "function sendAuthPlayers(message,key) {\r\n for (var x in sys.playersOfChannel(tourschan)) {\r\n var arr = sys.playersOfChannel(tourschan);\r\n if (isMegaUser(arr[x]) || tours.tour[key].players.indexOf(sys.name(arr[x]).toLowerCase()) != -1) {\r\n var newmessage = message;\r\n var htmlname = html_escape(sys.name(arr[x]));\r\n var regex = flashtag+htmlname+flashtag;\r\n var newregex1 = \"<font style='BACKGROUND-COLOR: #FFBB00'>\"+htmlname+\"</font><ping/>\";\r\n var flashregex = new RegExp(flashtag,\"g\");\r\n newmessage = message.replace(regex,newregex1).replace(flashregex,\"\");\r\n sendBotMessage(arr[x], newmessage, tourschan, true);\r\n }\r\n }\r\n}", "function sendPlayerDetails(player) {\n\n var sessionID = player.sessionID;\n console.log(player.params.name);\n \n io.sockets.sockets[sessionID].emit('loadPlayerDetails', player);\n return;\n}", "function update(playerObj){\n sendObj.Player = playerObj.Player;\n if(Players.length == 0){\n sendObj.Player = null;\n }\n if(Players.length < 2){\n sendObj.info = \"waiting for players to join\";\n }else{\n sendObj.info = Players[turn] + \"'s turn\"; \n } \n}", "function acceptSponsorQuest() {\n\tquestSetupCards = [];\n\tallQuestInfo = [];\n\tdocument.getElementById('sponsorQuest').style.display = 'none';\n\tvar serverMsg = document.getElementById('serverMsg');\n\tserverMsg.value += \"\\n> you are sponsor, setting up quest...\";\n\tsponsor = PlayerName;\n\tvar data = JSON.stringify({\n\t\t'name' : PlayerName,\n\t\t'sponsor_quest' : true\n\t});\n\tsocketConn.send(data);\n}", "function AddPlayerOnJoin(player)\n{\n jcmp.players.forEach((p) =>\n {\n if (p.c && p.c.ready && p.friends && p.networkId != player.networkId)\n {\n const data = {\n name: player.c.general.name,\n id: player.networkId,\n level: player.c.exp.level,\n steam_id: player.c.general.steam_id,\n ping: player.client.ping,\n friend_status: p.is_friends(player.c.general.steam_id) ? \"Friends\" : \n p.friends_has_invited(player.c.general.steam_id) ? \"Pending\" : \n p.friends_was_requested(player.c.general.steam_id) ? \"Requested\" : \"None\",\n color: player.c.general.color\n };\n\n if (player.tag && player.tag.name && player.tag.color)\n {\n data.tag = \n {\n tagname: player.tag.name,\n tagcolor: player.tag.color\n }\n }\n\n jcmp.events.CallRemote('friends/network/add_entry', p, JSON.stringify(data));\n }\n })\n}", "function sendLobbyPlayerlistUpdate() {\n if (!g_IsController || !Engine.HasXmppClient()) return;\n\n // Extract the relevant player data and minimize packet load\n let minPlayerData = [];\n for (let playerID in g_GameAttributes.settings.PlayerData) {\n if (+playerID == 0) continue;\n\n let pData = g_GameAttributes.settings.PlayerData[playerID];\n\n let minPData = { Name: pData.Name, Civ: pData.Civ };\n\n if (g_GameAttributes.settings.LockTeams) minPData.Team = pData.Team;\n\n if (pData.AI) {\n minPData.AI = pData.AI;\n minPData.AIDiff = pData.AIDiff;\n minPData.AIBehavior = pData.AIBehavior;\n }\n\n if (g_Players[playerID].offline) minPData.Offline = true;\n\n // Whether the player has won or was defeated\n let state = g_Players[playerID].state;\n if (state != \"active\") minPData.State = state;\n\n minPlayerData.push(minPData);\n }\n\n // Add observers\n let connectedPlayers = 0;\n for (let guid in g_PlayerAssignments) {\n let pData =\n g_GameAttributes.settings.PlayerData[g_PlayerAssignments[guid].player];\n\n if (pData) ++connectedPlayers;\n else\n minPlayerData.push({\n Name: g_PlayerAssignments[guid].name,\n Team: \"observer\"\n });\n }\n\n Engine.SendChangeStateGame(\n connectedPlayers,\n playerDataToStringifiedTeamList(minPlayerData)\n );\n}", "function addToWaiting(player) {\r\n console.log(\"Match request received\");\r\n player.emit(\"wait\", {waitMsg: \"Please wait, Looking for an opponent....\"});\r\n connRequestQueue.push(player);\r\n var res = connectPlayer(player);\r\n if (res !== null) {\r\n console.log(\"Player matched\");\r\n player.emit('matched', {matchedMsg: \"Your opponent found\"});\r\n }\r\n }", "function getName() {\n if (!player1.chosen) {\n player1.name = username;\n player1.chosen = true;\n database.ref(\"/connections/users/\" + userKey).update({\n name: username\n })\n } else if (player1.chosen && !player2.chosen) {\n player2.name = username;\n player2.chosen = true;\n }\n\n}", "playerUpdate() {\n this.players.forEach((player) => {\n let a = [];\n a = a.concat(this.currentquestion.a);\n a.push(this.currentquestion.correct);\n //TODO: shuffle a\n player.socket.emit('question', {\n q: this.currentquestion.q,\n a: shuffle(a)\n });\n });\n }", "static sendPacket() {\n sendGamePacket('user|eq|' + equipment.PLAYER_ID);\n }", "sendDetails(){\n console.log('sendDetails');\n var room = this;\n var cpy = [];\n\n // Liste sämtlicher Usernamen\n room.users.forEach(u => {\n cpy.push({Username: u.Username});\n });\n // ... zusammen mit Raum-Name und ob es ein Spiel-Raum ist (oder nicht)\n var msg = JSON.stringify({\n roomName: room.Roomname,\n userList: cpy,\n isPlayRoom: room.isPlayRoom\n });\n\n // .. als Server-Nachricht\n var data = {\n dataType: CHAT_ROOM,\n sender: \"Server\",\n message: msg\n };\n // .. an alle User im Raum senden\n room.sendAll(JSON.stringify(data));\n}", "sendPlayerInfo(){\n\t\tvar player = {\n\t\t\tdataType: dataTypes.PLAYER,\n\n\t\t\tplayerID: this.player.playerID,\n\t\t\t\n\t\t\tposX: this.player.position.x,\n\t\t\tposY: this.player.position.y,\n\t\t\trotation: this.player.rot,\n\n\t\t\thp: this.player.actualHp,\n\n\t\t\tweapon: this.player.weapon,\n\n\t\t\tdead: this.player.dead,\n\t\t};\n\n\n\t\tplayer = JSON.stringify(player);\n\n\t\tconnection.send(player);\n\t}", "function updatePlayers(listOfPlayers) {\n allPlayers = listOfPlayers;\n}", "sendTo(id, message) {\n var player = this.players.find((p) => p.id === id);\n player.connection.send(JSON.stringify(message));\n }", "function sQueue(m) {\n\t//if there's a queue and managing a vc\n\tif(queue.length > 0 && vc != null) {\n\t\t//vc.overwritePermissions('193643658556211200', {'SPEAK': false})\n\t\t//mute members in the vc\n\t\tfor(let i of vc.members)\n\t\t\t//if not a bot or the singer, MUTE\n\t\t\tif(i[0] != queue[0].id && !i[1].user.bot)\n\t\t\t\ti[1].setMute(true)\n\t\t//unmute singer\n\t\tqueue[0].setMute(false)\n\t\tm.channel.sendMessage(`Muting members Xd ...\\n*Singing now is* ${queue[0].toString()} :microphone:`)\n\t\tsinging = true\n\t} else\n\t\tm.channel.sendMessage('There\\'re no more members in the queue :sweat:')\n\treturn\n}", "function updateRoomPlayersList(room) {\n _room.in(room.id).emit('update-player-list', room);\n}", "function sendPatientNamesToAdmin() {\n FB.getAllPatientInfo(function (snapshot) {\n if(snapshot) {\n var list = snapshot.val();\n \n var arr = [];\n for(var pid in list) {\n var obj = {\n pid: pid,\n name: list[pid].Name\n };\n arr.push(obj);\n }\n \n // console.log(arr);\n \n room.emit('patient names', arr);\n }\n });\n}", "function getAllPlayers(data) {\n var room = io.sockets.adapter.rooms[data.gameId];\n var playersInRoom = [];\n\n for(var i = 0; i < players.length; i++) {\n if(room.sockets[players[i].socketId]==true) {\n playersInRoom.push(players[i]);\n }\n }\n var imgSubmitted;\n this.emit('playersInRoom', playersInRoom);\n this.broadcast.to(data.gameId).emit('newPlayerEntered', data);\n this.broadcast.to(data.gameId).emit('timerIs', data.timer);\n \n}", "everyoneDraws(gameID) {\n let players = Array.from(Connection.all.values())\n for (let player of players) {\n if (player.gameID == gameID) {\n let card = new Card(player);\n let message = { op: \"draw\" , player: {name: player.name}, card, gameID}\n this.addToMoveListAndBroadcast(message, gameID) \n }\n }\n }", "function collectPlayer(name) {\n if (name === game.players[game.turn].name) {\n setDrawer(game);\n } \n else {\n setGuesser(name);\n }\n \n }", "allPlayers() {\n let client = this;\n this.socket.on('allplayers', function(data) {\n if (client.ID != null) {\n for (var i = 0; i < data.length; i++) {\n addNewPlayer(data[i].id, data[i].x, data[i].y);\n }\n client.move();\n }\n });\n }", "sendToMember(data) {\n\t\t// extract necessary data\n\t\tlet text = data.text.split(\" \");\n\n\t\tconst receiver = Array.from(this.members).filter(\n\t\t\t(user) => user.name === text[1]\n\t\t)[0];\n\t\tconst sender = Array.from(this.members).filter(\n\t\t\t(user) => user.name === data.name\n\t\t)[0];\n\n\t\tif (receiver) {\n\t\t\tdata.text = text.slice(2).join(\" \");\n\t\t\tdata.otherName = text[1];\n\t\t\treceiver.send(JSON.stringify(data));\n\t\t\tsender.send(JSON.stringify(data));\n\t\t} else {\n\t\t\tdata.text = `Unfortunately either ${text[1]} left the room or not in the room at the moment`;\n\t\t\tdata.name = \"Server\";\n\t\t\tsender.send(JSON.stringify(data));\n\t\t}\n\t}", "function getListPlayer(listUsers){\r\n dbPlayer = listUsers;\r\n}", "function setName(data) {\n if (!player) {\n player = new Player();\n player.name = data.name;\n players.add(player);\n playerSetData();\n } else {\n player.name = data.name;\n }\n publish('player.set.name', { name: player.name });\n \n //console.log( \"| player \" , player);\n }", "function getPlayers(players, playername) {\n if ((players.indexOf(playername) === -1)) {\n players.push(playername);\n }\n}", "function acceptQuestParticipate() {\n\tdocument.getElementById(\"merlin\").style.display = \"none\";\n\tstageCounter = 0;\n\tdocument.getElementById('acceptQuest').style.display = \"none\";\n\tvar data = JSON.stringify({\n\t\t'name' : PlayerName,\n\t\t'participate_quest' : true\n\t});\n\tsocketConn.send(data);\n\tvar serverMsg = document.getElementById('serverMsg');\n\tserverMsg.value += (\"\\n> waiting for others to answer\");\n}", "async run(message, args) {\n var services = sixMansService.GetAllServicesForInstance(message.channel.id);\n if(services == null)\n {\n return;\n }\n var [databaseService, gameService, queue, channels] = services;\n\n if(message.channel.id == channels.queue) {\n // Try add user to the queue\n var[success, error] = queue.TryAddToQueue(message.author, message.channel);\n if(!success) {\n message.reply(error);\n return;\n }\n\n // Add user to the database if they are not already there.\n var user = await databaseService.GetUser(message.author.id);\n if(user == null) {\n await databaseService.AddNewUser(message.author.id, message.author.username)\n }\n\n var queueString = queue.toDiscordString();\n\n var queueReply = new Discord.RichEmbed()\n .addField(\"Player joined the queue\", message.author + \" has joined the queue.\")\n .addField(\"Players in queue: \" + queue.length, queueString)\n .setColor(embedColor2)\n .setFooter(footer, footerImage)\n\n await message.channel.send(queueReply);\n\n if (queue.length == 6) {\n queue.BeginVoting();\n await message.channel.send(\"**THE QUEUE IS FULL! VOTING STARTING!**\\n\\nPlayers: \" + queueString + \"\\n\\nUse **!r** to pick random teams\\nUse **!b** to pick balanced teams\\nUse **!c** to pick captains\");\n }\n }\n }", "function spanNewPlayer(name : String, info : NetworkMessageInfo){\n\tvar lastPlayer = false;\n\t//Remove items from spawn array\n\tplayerArray.Remove(info);\n\tplayerNameArray.Remove(name);\n\t\n\tif (playerArray.Count == 0){\n\t\tlastPlayer = true;\n\t}\n\t\n\tvar player = info.sender;\n\n\tDebug.Log(\"SPAWNING the player, since I am the server\");\n\tvar playerIsMole : boolean = false;\n\t\n\tfor (molePos in MolePosition){\n\t\tif (playerList.length+1 == molePos){\n\t\t\tplayerIsMole = true;\n\t\t}\n\t} \n\n\tnetworkView.RPC(\"initPlayer\", player, player);\n\tnetworkView.RPC(\"spawnPlayer\", RPCMode.All, player, playerIsMole, name, lastPlayer);\n}", "function sendName() {\n\tvar clientMsg = document.getElementById('enterName');\n\tif (clientMsg.value) {\n\t\tPlayerName = clientMsg.value;\n\t\tvar data = JSON.stringify({\n\t\t\t'newName' : $(\"#enterName\").val()\n\t\t})\n\t\tsocketConn.send(data);\n\t\tdocument.getElementById('title').innerHTML = \"Welcome to the Quest of The Round Table - \"\n\t\t\t\t+ clientMsg.value + \"'s View\";\n\t\tchangeColor();\n\t\tdocument.getElementById('nameparagraph').style.display = \"none\";\n\t\tdocument.getElementById('send').style.display = \"none\";\n\t\tdocument.getElementById('rigger').style.display = \"none\";\n\t\tdocument.getElementById('riggerAI').style.display = \"none\";\n\t\tvar serverMsg = document.getElementById('serverMsg');\n\t\tserverMsg.value = \"> waiting for other players \\n> to create AI player(s), open a new browser window and click AI Player button\";\n\t}\n}", "function PlayerList(name) {\r\n this.name = name;\r\n this.list = [];\r\n this.get();\r\n}", "function fillListPlayers(){\n\t\tlistPlayers.push(playerOne);\n\t\tlistPlayers.push(playerTwo);\n\t}", "sendMe() {\n this.sendData('me', {\n dance: 'Techno',\n group: this.id,\n heroSkin: false,\n playerId: this.id,\n skin: this.character,\n team: 'none',\n username: this.playerName,\n weapon: this.weapon,\n weaponSkins: {\n Scar: false,\n Shotgun: false,\n Sniper: false,\n 'Tec-9': false,\n },\n });\n }", "playerReceived(p) {\n let player = newPlayer(p);\n players.push(player);\n }", "function sendAllTourAuth(message) {\r\n for (var x in sys.playersOfChannel(tourschan)) {\r\n var arr = sys.playersOfChannel(tourschan);\r\n if (isMegaUser(arr[x])) {\r\n sys.sendMessage(arr[x], message, tourschan);\r\n }\r\n }\r\n}", "function onNewplayer (data) {\r\n\r\n\tvar newPlayer = new Player(data.x, data.y,this,data);\r\n\t\r\n\t//create an instance of player body \r\n\t/*playerBody = new p2.Body ({\r\n\t\tmass: 0,\r\n\t\tposition: [0,0],\r\n\t\tfixedRotation: true\r\n\t});*/\r\n\t\r\n\tconsole.log(\"created new player with id \" + this.id);\r\n\tnewPlayer.id = this.id;\r\n\r\n\tthis.emit('create_player', {\r\n\t\tx:data.x,\r\n\t\ty:data.y,\r\n\t\thealth:newPlayer.health\r\n\t});\r\n\t\r\n\t//information to be sent to all clients except sender\r\n\tvar current_info = {\r\n\t\tid: newPlayer.id,\r\n\t\tx: newPlayer.position[0],\r\n\t\ty: newPlayer.position[1],\r\n\t\thealth:newPlayer.health\r\n\t}; \r\n\t\r\n\t//send to the new player about everyone who is already connected. \t\r\n\tfor (i = 0; i < player_lst.length; i++) {\r\n\t\texistingPlayer = player_lst[i];\r\n\t\tvar player_info = {\r\n\t\t\tid: existingPlayer.id,\r\n\t\t\tx: existingPlayer.position[0],\r\n\t\t\ty: existingPlayer.position[1],\r\n\t\t\thealth: existingPlayer.health\r\n\t\t};\r\n\t\tconsole.log(\"pushing other players \");\r\n\t\t//send message to the sender-client only\r\n\t\tthis.emit(\"new_enemyPlayer\", player_info);\r\n\t}\r\n\t\r\n\t//Tell the client to make foods that are exisiting\r\n\tfor (j = 0; j < game_instance.food_pickup.length; j++) {\r\n\t\tvar food_pick = game_instance.food_pickup[j];\r\n\t\tthis.emit('item_update', food_pick); \r\n\t}\r\n\r\n\t//send message to every connected client except the sender\r\n\tthis.broadcast.emit('new_enemyPlayer', current_info);\r\n\r\n\tconsumablesManager.updateAllConsumables(this);\r\n\t\r\n\tplayer_lst.push(newPlayer); \r\n}", "function popularPlayer(sender_psid) {\n let key = ['Ronaldo', 'Messi', 'Bale', 'Neymar', 'Hazard', 'Morata', 'Ozil', 'Kroos', 'Isco', 'Alexis', 'Salad'];\n let response = {\n 'text': `Please type a player you want or choose from some quick options below!!!`\n }\n sendResponse.quickReply(sender_psid, response, 'POPULARP', key);\n}", "function sendCurrentUsers() {\n io.emit('current_users', {userList: userList, me: socket.username});\n }", "function updateNames() {\n io.emit('usernames', userNameList);\n }", "joinGame(aNickname) {\n this.nickname = aNickname;\n // Create a 'join' message and queue it in ClientNetChannel\n this.netChannel.addMessageToQueue(true, Constants.CMDS.PLAYER_JOINED, {nickname: \"rickd\"});\n }", "formatPlayers(playerList, guild, steve_emoji) {\n playerList.forEach((player, i, a) => {\n let emoji = guild.emojis.find(e => e.name == player);\n if (!emoji) {\n guild.createEmoji(`https://minotar.net/helm/${player}`, player)\n .then(e => {\n emoji = e;\n console.log(`Emoji :${emoji.name}: created`);\n }).catch(console.error);\n } else {\n console.log(`Emoji :${emoji.name}: already exists`);\n }\n a[i] = `${emoji ? emoji : steve_emoji} \\`${a[i]}\\``;\n if (i !== playerList.length - 1) {\n a[i] = `┣ ${a[i]}`;\n } else {\n a[i] = `┗ ${a[i]}`;\n }\n\n });\n return playerList;\n }", "function searchForPlayers() {\n searchingForGame = true;\n views.setSeachingPlayers();\n socket.emit('lookingForGame', authId);\n console.log(\"waiting for game \" + authId)\n socket.on('startMatch', (otherId) => {\n startMultiPlayer(otherId);\n });\n}", "function getPlayer(){\n\t\tconsole.log(\"id\"+session.avatorId)\n\t\tvar data = {\"name\": name, \"avatorId\": session.avatorId};\n\t\tusersWS[name].emit(\"player data\", data);\n\t}", "async addMembersToTalk(parent, args, ctx, info) {\n // check login\n if (!ctx.request.userId) {\n throw new Error('You must be logged in to do that!');\n }\n // check that the user is the member of the talk\n // TODO\n\n // add new members\n // transform array of members\n const members = args.members.map(member => ({ id: member }));\n return ctx.db.mutation.updateTalk(\n {\n data: {\n members: {\n connect: members,\n },\n },\n where: {\n id: args.id,\n },\n },\n info\n );\n }", "function printQueue(msg, queue) {\n let queueString = \"\";\n for(var item in queue) {\n item = queue[item];\n queueString += item.name + \"\\n\";\n }\n let embed = {\n title: \"Queue\",\n description: queueString,\n // Rezonate red\n color: 16536917\n }\n msg.channel.send({embed: embed});\n}", "function ess_messagePlayerByName(sender, targetPlayerName, msg) {\n try {\n var targetPlayer = Magma.Player.FindByName(targetPlayerName);\n var msg = esMsgArgsToText(args);\n targetPlayer.Message(\"[\" + sender.Name + \" -> You]: \" + msg);\n } catch (err) {\n if (targetPlayer == undefined) {\n sender.Message(\"Could not find player\");\n }\n if (msg == undefined) {\n sender.Message(\"Valid Syntax: /msg (Player) (Message)\");\n } else {\n sender.Message(\"Valid Syntax: /msg (Player) (Message)\");\n }\n }\n}", "function displayplayer(usernamelist){\n console.log(usernamelist)\n for (let a in usernamelist){\n if (!(document.querySelector(\"#playerlist\").contains(document.querySelector(\"#\"+a)))) {\n let element = document.createElement(\"p\");\n element.innerHTML = a;\n element.id = a;\n document.querySelector(\"#playerlist-list\").prepend(element)\n cursors[a] = new Cursor(a);\n }\n };\n $(\"#playerlist-list > p\").each((index, elem) => {\n if (!(elem.id in usernamelist)){\n document.getElementById(elem.id).remove()\n };\n });\n}", "function sendUserItems(channel, userName) {\n findItemsByUserName(userName).then(function(results){\n channel.emit('recivedUserItems', JSON.stringify(results[0].items));\n })\n}", "function submitPlayer(e) {\n\t\te.preventDefault();\n\t\tvar form = $(this);\n\t\tvar playerName = form.find('#name').val();\n\t\tif (playerName.length === 0) {\n\t\t\terror.html('Vinsamlegast sláðu inn eitthvað nafn');\n\t\t\treturn false;\n\t\t}\n\t\t// Broadcast new player name\n\t\tsocket.emit('New player', playerName);\n\t\tsocket.on('Player name checked', function(valid, gameStarted) {\n\t\t\tif (valid && !gameStarted) {\n\t\t\t\tusername = playerName;\n\t\t\t\terror.html('');\n\t\t\t\t// Remove form\n\t\t\t\tform.hide();\n\t\t\t\t// Display identity area\n\t\t\t\tidentityArea.slideDown();\n\t\t\t\tyourUsername.html('Þitt nafn: ' + playerName);\n\t\t\t\tvar userImage = $('<img class=\"user-image\" alt=\"Mynd af þér\"></img>');\n\t\t\t\tuserImage.attr('src', 'http://i.pravatar.cc/45?u=' + playerName);\n\t\t\t\tidentityArea.append(userImage);\n\t\t\t\t// Display starting area\n\t\t\t\tstartArea.slideDown();\n\t\t\t\t// Enable game start\n\t\t\t\tstartGameForm.submit(startGame);\n\t\t\t}\n\t\t\telse if (gameStarted) error.html('Því miður er leikurinn hafinn. Farðu bara út að leika þér.');\n\t\t\telse error.html('Þetta nafn er því miður frátekið');\n\t\t});\n\t\treturn false;\n\t}", "async function execute(message, serverQueue) {\n const args = message.content.split(\" \");\n\n //console.log(args)\n var voiceChannel = message.member.voice.channel;\n //console.log(voiceChannel.voice)\n //console.log(voiceChannel.isVoice())\n var connection;\n if (!voiceChannel){\n if( typeof connection !== 'undefined'){\n connection.destroy();\n }\n \n return message.channel.send(\n \"Du hues keng Moss am Bic!\"//you are not in voice chat\n );\n }\n\n const permissions = voiceChannel.permissionsFor(message.client.user);\n if (!permissions.has(\"CONNECT\") || !permissions.has(\"SPEAK\")) {\n return message.channel.send(\n \"Zwou Bullen Mokka\"//bot has not enough permissions\n );\n \n }\n//search for song\nconst search = args.shift();\nlet searchString;\nfor (let i = 0; i < args.length; i++){\n searchString = searchString + \" \" + args[i];\n}\nconst r = await yts( searchString );\nconst videos = r.videos.slice( 0, 1);\nvar url;\nvideos.forEach( function ( v ) {\n\tconst link = String( v.url )\n //console.log(v);\n\turl = link;\n} );\n//only link\n\nvar songInfo = await ytdl.getInfo(url);\nconsole.log(songInfo);\nconst song = {\n title: songInfo.videoDetails.title,\n url: url,\n};\n//add to queue\nif (!serverQueue) { \n// Creating the contract for our queue\nconst queueContruct = {\n textChannel: message.channel,\n voiceChannel: voiceChannel,\n connection: null,\n songs: [],\n volume: 5,\n playing: true,\n };\n // Setting the queue using our contract\n queue.set(message.guild.id, queueContruct);\n // Pushing the song to our songs array\n queueContruct.songs.push(song);\n console.log(song)//debug undefined\n try {\n // Here we try to join the voicechat and save our connection into our object.\n connection = await joinVoiceChannel({\n channelId: voiceChannel.id,\n guildId: voiceChannel.guild.id,\n adapterCreator: voiceChannel.guild.voiceAdapterCreator,\n });\n queueContruct.connection = connection;\n // Calling the play function to start a song\n play(message.guild, queueContruct.songs[0]);//error serverqueue not init\n } catch (err) {\n // Printing the error message if the bot fails to join the voicechat\n console.log(err);\n console.log(\"connection failed\");\n queue.delete(message.guild.id);\n return message.channel.send(err);\n }\n}else {\n serverQueue.songs.push(song);\n console.log(serverQueue.songs);\n return message.channel.send(`${song.title} leeft dem Ketti mat der Wichsbiischt no`);\n}\n//connect to voice chat of meesenger\n /* connection = joinVoiceChannel({\n channelId: voiceChannel.id,\n guildId: voiceChannel.guild.id,\n adapterCreator: voiceChannel.guild.voiceAdapterCreator,\n });\n*/\n\n\n return;\n}", "function sendMessage(name){\n const embed = new Discord.MessageEmbed\n embed.setTitle('Novo canal criado ')\n embed.setAuthor(\"Rem-chan\", \"https://i.imgur.com/g6FSNhL.png\")\n embed.setColor(0xd31f1f)\n \n embed.addField('Nome:',name);\n \n embed.setFooter('Rem-chan em ', \"https://i.imgur.com/g6FSNhL.png\")\n \n \n \n embed.setTimestamp()\n \n \n \n message.channel.send({embed});\n }", "function syncPlayer() {\n\t\t$scope.players = $scope.room.game.players;\n\t\t$scope.room.game.players.forEach(function(player, ind) {\n\t\t\tif (player.user.name === $routeParams['user']) {\n\t\t\t\t$scope.player = player;\n\t\t\t}\n\t\t});\n\t}", "getPlayer(username){\n var self = this;\n con.query('SELECT * FROM players WHERE id=\"'+username+'\"',\n function(err,rows,fields) {\n if (err){\n console.log('Error during query processing');\n console.log(err);\n } else {\n self.emit('playerData', rows);\n }\n }\n );\n }", "function onNewplayer (data) {\r\n\tconsole.log(data);\r\n\t//new player instance\r\n\tvar newPlayer = new Player(data.x, data.y, data.angle);\r\n\t\r\n\t//create an instance of player body \r\n\tnewPlayer.body = new p2.Body ({\r\n\t\tmass: 0,\r\n\t\tposition: [0,0],\r\n\t\tfixedRotation: true\r\n\t});\r\n\tworld.addBody(newPlayer.body);\r\n\t\r\n\tconsole.log(\"created new player with id \" + this.id);\r\n\tnewPlayer.id = this.id; \t\r\n\t//information to be sent to all clients except sender\r\n\tvar current_info = {\r\n\t\tid: newPlayer.id, \r\n\t\tx: newPlayer.x,\r\n\t\ty: newPlayer.y,\r\n\t\tangle: newPlayer.angle,\r\n\t}; \r\n\t\r\n\t//send to the new player about everyone who is already connected. \t\r\n\tfor (i = 0; i < player_lst.length; i++) {\r\n\t\texistingPlayer = player_lst[i];\r\n\t\tvar player_info = {\r\n\t\t\tid: existingPlayer.id,\r\n\t\t\tx: existingPlayer.x,\r\n\t\t\ty: existingPlayer.y, \r\n\t\t\tangle: existingPlayer.angle,\t\t\t\r\n\t\t};\r\n\t\tconsole.log(\"pushing player\");\r\n\t\t//send message to the sender-client only\r\n\t\tthis.emit(\"new_enemyPlayer\", player_info);\r\n\t}\r\n\t\r\n\t//send message to every connected client except the sender\r\n\tthis.broadcast.emit('new_enemyPlayer', current_info);\r\n\t\r\n\r\n\tplayer_lst.push(newPlayer); \r\n}", "function newPlayer(){\r\n\tlet userName = document.getElementById(\"playerName\").value;\r\n\tif(userName.length > 0){\r\n\t\tfor(let i = 0;i<usedNames.length;i++){\r\n\t\t\t\r\n\t\t\t//Check if user's name choice has been taken\r\n\t\t\tif(userName == usedNames[i]){\r\n\t\t\t\talert(\"That name has been used\");\r\n\t\t\t\tdocument.getElementById(\"playerName\").value = \"\";\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcanJoin = 1;\r\n\t\tstart();\r\n\t}\r\n\treturn false;\r\n}", "joindreGroupe(socket,channel,username){\n $(\"#listDesMessages\").empty();\n $(\"#msgBox\").focus();\n var msg = new Message(\"onJoinChannel\", channel.id , null , username, null );\n socket.send(JSON.stringify(msg));\n document.getElementById(\"current_group_name\").innerHTML = channel.name;\n }", "function send_varslinger(push_liste){\n \"use strict\"\n for(let skole of push_liste){\n send_melding_til_topic(skole.topic, skole.skole, skole.kommentar);\n }\n}", "submit() {\n this.rooms.forEach(room => room.sendPresence());\n }", "function updateUsernames(){\r\n io.sockets.emit('get users', users);\r\n}", "function sayHello(player) {\n console.log(\"Hello, \"+player.name);\n}", "function echoaroundmany(ignore, message)\r\n{\r\n if (ignore.length <= 0)\r\n return;\r\n var room = ignore[0].room;\r\n var people = room.people;\r\n var fail;\r\n for (var _autoKey in people) {\r\n \tvar person = people[_autoKey];\r\n fail = false;\r\n for (var _autoKey in ignore) {\r\n \tvar ignored = ignore[_autoKey];\r\n if (ignored == person)\r\n fail = true;\r\n }\r\n if (!fail)\r\n {\r\n person.send(message);\r\n }\r\n }\r\n}", "handleOnPlayerMessage(player) {\n let _this = this;\n\n // handle on message\n player.socket.on(\"message\", function (message) {\n let _data = JSON.parse(message);\n\n if (_data.messageType === MESSAGE_TYPE.CLIENT_CHAT) {\n let _playerDisplayName = player.id;\n if (player.playerName) {\n _playerDisplayName = player.playerName;\n }\n let _message = new Message(MESSAGE_TYPE.CLIENT_CHAT);\n _message.content = _playerDisplayName + \" : \" + _data.content;\n _this.sendAll(JSON.stringify(_message));\n } else if (_data.messageType === MESSAGE_TYPE.CLIENT_CARD) {\n // Karte in der Logik verarbeiten.\n scopaLogic.processPlayerMessage(_data, _this);\n } else if (_data.messageType === MESSAGE_TYPE.CLIENT_STATE) {\n // Name und ID des Spielers setzen\n player.playerName = _data.playerName;\n player.playerId = _data.playerId;\n console.log(\"Spielername: \" + _data.playerName + \" Spieler ID\" + _data.playerId);\n }else if (_data.messageType === MESSAGE_TYPE.CLIENT_RESTART) {\n scopaLogic.startGame();\n }\n });\n }", "function register(playerObj){\n //for registering\n //the person already registered can switch if there is only one player\n if(Players.length < 2){\n if(Players.includes(playerObj.Player)){\n sendObj.info = \"that colour is taken\";\n sendObj.Player = null;\n }else{\n Players.push(playerObj.Player);\n sendObj.info = null; \n sendObj.Player = playerObj.Player; \n }\n }else{\n sendObj.info = \"the game has 2 players\";\n sendObj.Player = null;\n }\n}", "function updateUserNames(){ \n io.emit('get users', users); // users is the array with all user names\n\n }", "function updateNicknames(){\r\n\t\tio.sockets.emit('usernames', Object.keys(users));\r\n\t}", "function UpdateUsers(userList) {\n users.empty();\n for (var i = 0; i < userList.length; i++) {\n if (userList[i].username != myName) {\n users.append('<li class=\"player\" id=\"' + userList[i].id + '\"><a href=\"#\">' + userList[i].username + '</a></li>')\n }\n }\n }", "playersReceived(p) {\n for(let i=0;i<p.players.length;i++) {\n let exists = false;\n for(let x=0;x<players.length;x++) {\n if(players[x].pid == p.players[i].pid) {\n exists = true;\n }\n }\n //only add new player if it doesn't already exist\n if(!exists) {\n let player = newPlayer(p.players[i]);\n players.push(player);\n }\n }\n }", "who(currentPlayer, channel){\n let map = this.maps[currentPlayer.position]\n let nearbyPlayers = new Array()\n this.players.forEach(player => {\n if(player !== currentPlayer && player.position === currentPlayer.position){\n nearbyPlayers.push(player)\n }\n })\n return nearbyPlayers\n }", "askForInfo(){\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"PLAYERS\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"CPUUSAGE\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"RAMUSAGE\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\t}", "getAllNamesPlayers()\n {\n return this.players.map(player => player.getName());\n }", "function userOnline(name, socket) {\n for (let index = 0; index < thongTinNguoiDung.length; index++) {\n if (thongTinNguoiDung[index].name === name) {\n thongTinNguoiDung[index].id = socket.id;\n socket.emit(\"nguoi-lien-he\", thongTinNguoiDung[index]);\n socket.emit(\n \"notify-request-friend\",\n thongTinNguoiDung[index].arrayFriendRequest\n );\n io.to(getIdUser(name)).emit(\n \"reject-request-friend\",\n thongTinNguoiDung[index].arrayNotify\n );\n socket.emit('create-room-sus',thongTinNguoiDung[index].arrayRoom);\n\n return;\n }\n }\n}", "function updateUsernames() {\n //io.sockets.emit('get users', users);\n\n if (nConnections > 4) {\n \n var nUsersInRoom = nConnections%4;\n var startPos = nConnections - nUsersInRoom;\n var tempUsers = users;\n var subsetOfUsers = tempUsers.splice(startPos, nUsersInRoom);\n io.sockets.in(roomName).emit('get users', subsetOfUsers);\n newRoomFull = false;\n \n } else\n io.sockets.in(roomName).emit('get users', users);\n }", "sendToPlugins(name, value) {\n const plugins = this.plugins;\n for (const id in plugins) {\n if (plugins.hasOwnProperty(id)) {\n plugins[id].send(name, value);\n }\n }\n }", "sendPlayerUpdates() {\n\t\t// console.log(\"Sending player updates\");\n\t\tlet update = this.stage.getUpdatedStageState();\n\n\t\tlet updatedState = JSON.stringify({\n\t\t\ttype: \"stage-update\",\n\t\t\tplayerActors: update.players,\n\t\t\tbulletActors: update.bullets,\n\t\t\tenvironmentActors: update.environment,\n\t\t\tnumAlive: update.numAlive,\n\t\t\thasEnded: update.hasEnded\n\t\t});\n\t\tthis.wss.broadcastToLobby(updatedState, this.gameId);\n\t}", "function BroadcastParty(party_index, action) {\n if (Parties[party_index]) {\n console.log(Parties[party_index]);\n\n var party = {\n 'id' : Parties[party_index].id,\n 'name' : Parties[party_index].name,\n 'index' : Parties[party_index].index,\n 'host' : Parties[party_index].host,\n 'open' : Parties[party_index].open,\n 'nbRound' : Parties[party_index].nbRound,\n 'token' : Parties[party_index].token,\n 'players' : [],\n 'rolled' : Parties[party_index].rolled,\n };\n var playersList = [];\n\n Parties[party_index].players.forEach(function (player) {\n if (player.name !== ''){\n playersList.push(player.getId());\n }\n });\n\n party.players = playersList;\n\n var message = JSON.stringify({\n 'action' : action,\n 'data' : party\n });\n\n Parties[party_index].players.forEach(function (player) {\n player.connection.sendUTF(message);\n });\n }\n}", "function playHand(){\n let sendCards = [];\n let playersHand = hand[0];\n for(let i = 0; i < playersHand.length; i++){\n if(cardsToPlay[playersHand[i]]){\n sendCards.push(playersHand[i]);\n } \n }\n reset();\n if(sendCards.length === 0){\n socket.emit(\"pass\");\n } else{\n socket.emit(\"play_cards\", sendCards)\n }\n }", "playerElimination (playerName) {\n /* show that a player was eliminated */\n console.log('player ' + playerName + ' eliminated')\n\n /* TODO: distribute tokens? */\n }", "async playerJoin(client, playerId, gameId)\n {\n const host = this._getHost(gameId);\n\n if (!(await host.canPlayerJoin(client, playerId))) {\n throw new Error('cannot join when allowJoin is false');\n }\n\n this.log.info('player %s joining game %s', playerId, gameId);\n\n // tell gamelist we've a new player\n await this.net.sendCommand('gamelist', 'playerJoined', {gameId, playerId});\n\n // master list\n this.clients.push({client, playerId, gameId});\n\n // let the host do its thang\n host.addClient(client, playerId);\n }", "sendMessage() {\n const {input} = this.elements;\n const value = input.value;\n if (value === '') {\n return;\n }\n input.value = '';\n drone.publish({\n room: selectedRoom,\n message: value,\n });\n addMessageToRoomArray(selectedRoom, me, value);\n this.addMessageToList(value, me);\n }", "function printListPlayer(listPlayer){\r\n $.each(listPlayer, function(key, data){\r\n var divPlayer = $( \"<div class='single-player' data-id='\"+key+\"'><img src='img/user.png' alt=''><p>\" + data + \"</p></div>\" );\r\n $(\"#selection-player\").append(divPlayer);\r\n });\r\n\r\n // Select player \r\n selectPlayer(0);\r\n}", "function print_playlist(message) {\n for (var key in playlist_dict) {\n message.channel.send(key + ' : ' + playlist_dict[key]);\n }\n}", "async onPlayerAdded(player) {}", "function send(argument, list){\n\n var objectToSend = {}; // nuestro objeto a enviar\n\n var input = document.querySelector(\"#textinput\");\n\n // SOLO BORRAMOS ULTIMO CARACTER SI ES POR ENTER\n // PQ SE AÑADE EL \"\\n\"\n if(input.value.includes(\"\\n\"))\n input.value = input.value.substring(0, input.value.length - 1);\n\n if(input.value == \"\")\n return;\n\n if(checked){\n input.value = input.value.capitalize(); // si la casilla está marcada, se pone mayus\n }\n\n objectToSend.name = guestname;\n objectToSend.message = input.value;\n objectToSend.avatar = avatarPath;\n\n server.sendMessage(objectToSend);\n\n createMsg(guestname, avatarPath, input.value);\n\n input.value = \"\" // reiniciamos el input \n}", "broadcastList(clients, pack, notme) {\n if (notme) {\n notme = true;\n }\n var client = this;\n\n clients.forEach(function(c) {\n if (c === client && notme) {}\n else {\n c.write(pack);\n }\n });\n }", "async joinNemesis(channel, name) {\n\t\tlet player = await sql.getPlayerByUsername(channel, name);\n\t\tlet nemesis = await sql.getNemesis(channel);\n\t\tlet nemesisPlayer = await sql.getPlayerById(nemesis.id);\n\t\tlet henchmen = await sql.getHenchmen(channel);\n\t\tlet world = await sql.getWorld(channel);\n\t\t\n\t\tawait sql.setHenchman(channel, player.id, true);\n\t\tawait sql.deleteOffer(nemesis.id, player.id, enums.OfferTypes.Recruit);\n\n\t\t// If we just hit max henchmen, delete all outstanding recruitment offers\n\t\tlet maxHenchmen = Math.floor(world.maxPopulation / 5) - 1;\n\t\tif(henchmen.length + 1 >= maxHenchmen) {\n\t\t\tawait sql.deleteRecruitOffers(channel);\n\t\t}\n\t\treturn `**${player.name}** has joined the Nemesis in ${this.their(nemesisPlayer.config.pronoun)} campaign of destruction!\\n` +\n\t\t\t`Your power level is increased, and you automatically boost the Nemesis's power when they come under attack. For more info, enter \\`!help henchmen\\`.`;\n\t}" ]
[ "0.68723124", "0.6763342", "0.6680726", "0.6528784", "0.6374334", "0.6221974", "0.6218211", "0.6205564", "0.6189486", "0.599907", "0.5945769", "0.58558273", "0.5853555", "0.5852155", "0.5834324", "0.58187205", "0.58121324", "0.57838976", "0.5770352", "0.5768452", "0.57546073", "0.57460815", "0.57392704", "0.5729988", "0.5704703", "0.5695372", "0.569134", "0.5690306", "0.5678355", "0.5671436", "0.5644036", "0.5642372", "0.56368023", "0.562983", "0.5615778", "0.56107944", "0.5593887", "0.5593651", "0.55933034", "0.5591511", "0.55870944", "0.55812794", "0.55799776", "0.55746543", "0.5558347", "0.5539822", "0.5521994", "0.5520096", "0.55198795", "0.5513532", "0.5510418", "0.55050164", "0.5501616", "0.5501044", "0.549931", "0.5493488", "0.5479915", "0.54785794", "0.54592687", "0.544907", "0.5442796", "0.5441416", "0.5440242", "0.5433851", "0.5433084", "0.54253745", "0.5419957", "0.541682", "0.54066336", "0.5398423", "0.5387249", "0.538054", "0.5378453", "0.537696", "0.5370449", "0.53646284", "0.5364504", "0.53625363", "0.53486556", "0.53478897", "0.5341593", "0.5315819", "0.5315382", "0.53125787", "0.531018", "0.530405", "0.53009444", "0.530066", "0.52910924", "0.52790123", "0.5271272", "0.52659965", "0.5264978", "0.52639896", "0.52635974", "0.5261263", "0.52609754", "0.525945", "0.5256003", "0.5254793" ]
0.7443067
0
Get the current playernames
static updateNames() { var playerNames = []; for (var i in Player.list) { playerNames.push(SOCKET_LIST[i].name); } ; return playerNames; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAllNamesPlayers()\n {\n return this.players.map(player => player.getName());\n }", "function getPlayerName(player) {\r\n return player.PLAYER;\r\n}", "function loadPlayerNames() {\n var player_names = [\n\t\t\"Aaron Ramsey\",\n\t\t\"Abdul Rahman Baba\",\n\t\t\"Adam Lallana\",\n\t\t\"Adem Ljajic\",\n\t\t\"Aderlan Santos\",\n\t\t\"Admir Mehmedi\",\n\t\t\"Adnan Januzaj\",\n\t\t\"Adrián Ramos\",\n\t\t\"Adriano\",\n\t\t\"Alberto Moreno\",\n\t\t\"Aleix Vidal\",\n\t\t\"Aleksandar Mitrovic\",\n\t\t\"Alessandro Florenzi\",\n\t\t\"Alessio Cerci\",\n\t\t\"Alessio Romagnoli\",\n\t\t\"Alex Oxlade-Chamberlain\",\n\t\t\"Alex Sandro\",\n\t\t\"Alexis Sánchez\",\n\t\t\"Allan\",\n\t\t\"Álvaro Domínguez\",\n\t\t\"Álvaro Morata\",\n\t\t\"Álvaro Negredo\",\n\t\t\"Ander Herrera\",\n\t\t\"Ander Iturraspe\",\n\t\t\"André Ayew\",\n\t\t\"André Gomes\",\n\t\t\"André Schürrle\",\n\t\t\"Andrea Bertolacci\",\n\t\t\"Andrea Ranocchia\",\n\t\t\"Andrés Iniesta\",\n\t\t\"Anthony Martial\",\n\t\t\"Antoine Griezmann\",\n\t\t\"Antonio Candreva\",\n\t\t\"Antonio Rüdiger\",\n\t\t\"Arda Turan\",\n\t\t\"Arjen Robben\",\n\t\t\"Arturo Vidal\",\n\t\t\"Asier Illarramendi\",\n\t\t\"Atsuto Uchida\",\n\t\t\"Aymen Abdennour\",\n\t\t\"Aymeric Laporte\",\n\t\t\"Bas Dost\",\n\t\t\"Bastian Schweinsteiger\",\n\t\t\"Benedikt Höwedes\",\n\t\t\"Bernd Leno\",\n\t\t\"Borja Valero\",\n\t\t\"Branislav Ivanovic\",\n\t\t\"Bruno Soriano\",\n\t\t\"Carlos Bacca\",\n\t\t\"Carlos Vela\",\n\t\t\"Carlos Zambrano\",\n\t\t\"Casemiro\",\n\t\t\"Cédric Bakambu\",\n\t\t\"César Azpilicueta\",\n\t\t\"Cesc Fàbregas\",\n\t\t\"Charles Aránguiz\",\n\t\t\"Chicharito\",\n\t\t\"Chris Smalling\",\n\t\t\"Christian Benteke\",\n\t\t\"Christian Eriksen\",\n\t\t\"Christoph Kramer\",\n\t\t\"Ciro Immobile\",\n\t\t\"Claudio Bravo\",\n\t\t\"Claudio Marchisio\",\n\t\t\"Coutinho\",\n\t\t\"Cristiano Ronaldo\",\n\t\t\"Daley Blind\",\n\t\t\"Dani Alves\",\n\t\t\"Dani Parejo\",\n\t\t\"Daniel Caligiuri\",\n\t\t\"Daniel Carriço\",\n\t\t\"Daniel Carvajal\",\n\t\t\"Daniel Sturridge\",\n\t\t\"Daniele De Rossi\",\n\t\t\"Daniele Rugani\",\n\t\t\"Danilo\",\n\t\t\"Danny Welbeck\",\n\t\t\"David Alaba\",\n\t\t\"David de Gea\",\n\t\t\"David López\",\n\t\t\"David Silva\",\n\t\t\"Dejan Lovren\",\n\t\t\"Denis Cheryshev\",\n\t\t\"Denis Suárez\",\n\t\t\"Diego Alves\",\n\t\t\"Diego Costa\",\n\t\t\"Diego Godín\",\n\t\t\"Diego Perotti\",\n\t\t\"Dimitri Payet\",\n\t\t\"Domenico Berardi\",\n\t\t\"Dória\",\n\t\t\"Douglas Costa\",\n\t\t\"Dries Mertens\",\n\t\t\"Dusan Tadic\",\n\t\t\"Duván Zapata\",\n\t\t\"Eden Hazard\",\n\t\t\"Éder\",\n\t\t\"Edin Dzeko\",\n\t\t\"Eliaquim Mangala\",\n\t\t\"Emre Can\",\n\t\t\"Enzo Pérez\",\n\t\t\"Eric Maxim Choupo-Moting\",\n\t\t\"Érik Lamela\",\n\t\t\"Éver Banega\",\n\t\t\"Evgen Konoplyanka\",\n\t\t\"Fabian Johnson\",\n\t\t\"Falcao\",\n\t\t\"Felipe Anderson\",\n\t\t\"Fernandinho\",\n\t\t\"Fernando\",\n\t\t\"Fernando Llorente\",\n\t\t\"Fernando Torres\",\n\t\t\"Filip Kostic\",\n\t\t\"Filipe Luís\",\n\t\t\"Florian Thauvin\",\n\t\t\"Franck Ribéry\",\n\t\t\"Franco Di Santo\",\n\t\t\"Franco Vázquez\",\n\t\t\"Fredy Guarín\",\n\t\t\"Gabi\",\n\t\t\"Gareth Bale\",\n\t\t\"Gary Cahill\",\n\t\t\"Gary Medel\",\n\t\t\"Geoffrey Kondogbia\",\n\t\t\"Georginio Wijnaldum\",\n\t\t\"Gerard Piqué\",\n\t\t\"Gervinho\",\n\t\t\"Giacomo Bonaventura\",\n\t\t\"Giorgio Chiellini\",\n\t\t\"Giuseppe Rossi\",\n\t\t\"Gonzalo Castro\",\n\t\t\"Gonzalo Higuaín\",\n\t\t\"Granit Xhaka\",\n\t\t\"Grzegorz Krychowiak\",\n\t\t\"Guilherme Siqueira\",\n\t\t\"Hakan Calhanoglu\",\n\t\t\"Haris Seferovic\",\n\t\t\"Harry Kane\",\n\t\t\"Henrikh Mkhitaryan\",\n\t\t\"Hernanes\",\n\t\t\"Heung-Min Son\",\n\t\t\"Holger Badstuber\",\n\t\t\"Hugo Lloris\",\n\t\t\"Iago Falqué\",\n\t\t\"Ignacio Camacho\",\n\t\t\"Ignazio Abate\",\n\t\t\"Iker Muniain\",\n\t\t\"Ilkay Gündogan\",\n\t\t\"Iñigo Martínez\",\n\t\t\"Isco\",\n\t\t\"Ivan Perisic\",\n\t\t\"Ivan Rakitic\",\n\t\t\"Jack Wilshere\",\n\t\t\"Jackson Martínez\",\n\t\t\"Jakub Blaszczykowski\",\n\t\t\"James McCarthy\",\n\t\t\"James Milner\",\n\t\t\"James Rodríguez\",\n\t\t\"Jan Oblak\",\n\t\t\"Jan Vertonghen\",\n\t\t\"Javi Fuego\",\n\t\t\"Javi Martínez\",\n\t\t\"Javier Mascherano\",\n\t\t\"Jay Rodríguez\",\n\t\t\"Jeison Murillo\",\n\t\t\"Jérémy Mathieu\",\n\t\t\"Jérémy Ménez\",\n\t\t\"Jérôme Boateng\",\n\t\t\"Jesé\",\n\t\t\"Jesús Navas\",\n\t\t\"Joaquín Correa\",\n\t\t\"Joe Hart\",\n\t\t\"Joel Matip\",\n\t\t\"Johannes Geis\",\n\t\t\"John Stones\",\n\t\t\"Jonas Hector\",\n\t\t\"Jonathan de Guzmán\",\n\t\t\"Jonathan Tah\",\n\t\t\"Jonathas\",\n\t\t\"Jordan Henderson\",\n\t\t\"Jordi Alba\",\n\t\t\"Jorginho\",\n\t\t\"José Callejón\",\n\t\t\"José Giménez\",\n\t\t\"José Luis Gayá\",\n\t\t\"José Salomón Rondón\",\n\t\t\"Josip Drmic\",\n\t\t\"Josuha Guilavogui\",\n\t\t\"Juan Bernat\",\n\t\t\"Juan Cuadrado\",\n\t\t\"Juan Iturbe\",\n\t\t\"Juan Jesus\",\n\t\t\"Juan Mata\",\n\t\t\"Juanfran\",\n\t\t\"Julian Brandt\",\n\t\t\"Julian Draxler\",\n\t\t\"Julian Weigl\",\n\t\t\"Júnior Caiçara\",\n\t\t\"Kalidou Koulibaly\",\n\t\t\"Kamil Glik\",\n\t\t\"Karim Bellarabi\",\n\t\t\"Karim Benzema\",\n\t\t\"Keisuke Honda\",\n\t\t\"Keita Baldé\",\n\t\t\"Kevin De Bruyne\",\n\t\t\"Kévin Gameiro\",\n\t\t\"Kevin Kampl\",\n\t\t\"Kevin Mirallas\",\n\t\t\"Kevin Strootman\",\n\t\t\"Kevin Volland\",\n\t\t\"Keylor Navas\",\n\t\t\"Kieran Gibbs\",\n\t\t\"Kiko Casilla\",\n\t\t\"Kingsley Coman\",\n\t\t\"Klaas-Jan Huntelaar\",\n\t\t\"Koke\",\n\t\t\"Konstantinos Manolas\",\n\t\t\"Kwadwo Asamoah\",\n\t\t\"Kyle Walker\",\n\t\t\"Kyriakos Papadopoulos\",\n\t\t\"Lars Bender\",\n\t\t\"Lars Stindl\",\n\t\t\"Laurent Koscielny\",\n\t\t\"Leandro Castán\",\n\t\t\"Leighton Baines\",\n\t\t\"Leon Goretzka\",\n\t\t\"Leonardo Bonucci\",\n\t\t\"Leroy Sané\",\n\t\t\"Lionel Messi\",\n\t\t\"Lorenzo Insigne\",\n\t\t\"Lucas Biglia\",\n\t\t\"Lucas Digne\",\n\t\t\"Luciano Vietto\",\n\t\t\"Luis Muriel\",\n\t\t\"Luis Suárez\",\n\t\t\"Luiz Adriano\",\n\t\t\"Luiz Gustavo\",\n\t\t\"Luka Modric\",\n\t\t\"Lukasz Piszczek\",\n\t\t\"Luke Shaw\",\n\t\t\"Mamadou Sakho\",\n\t\t\"Manolo Gabbiadini\",\n\t\t\"Manuel Neuer\",\n\t\t\"Marc Bartra\",\n\t\t\"Marc-André ter Stegen\",\n\t\t\"Marcel Schmelzer\",\n\t\t\"Marcelo\",\n\t\t\"Marcelo Brozovic\",\n\t\t\"Marco Parolo\",\n\t\t\"Marco Reus\",\n\t\t\"Marcos Rojo\",\n\t\t\"Marek Hamsik\",\n\t\t\"Mario Balotelli\",\n\t\t\"Mario Götze\",\n\t\t\"Mario Mandzukic\",\n\t\t\"Mario Suárez\",\n\t\t\"Markel Susaeta\",\n\t\t\"Marouane Fellaini\",\n\t\t\"Martín Cáceres\",\n\t\t\"Martín Montoya\",\n\t\t\"Martin Skrtel\",\n\t\t\"Mateo Kovacic\",\n\t\t\"Mateo Musacchio\",\n\t\t\"Mati Fernández\",\n\t\t\"Matija Nastasic\",\n\t\t\"Mats Hummels\",\n\t\t\"Matteo Darmian\",\n\t\t\"Matthias Ginter\",\n\t\t\"Mattia De Sciglio\",\n\t\t\"Mattia Destro\",\n\t\t\"Mattia Perin\",\n\t\t\"Mauro Icardi\",\n\t\t\"Max Kruse\",\n\t\t\"Max Meyer\",\n\t\t\"Maximilian Arnold\",\n\t\t\"Medhi Benatia\",\n\t\t\"Memphis Depay\",\n\t\t\"Mesut Özil\",\n\t\t\"Mikel Rico\",\n\t\t\"Miralem Pjanic\",\n\t\t\"Miranda\",\n\t\t\"Mohamed Salah\",\n\t\t\"Morgan Schneiderlin\",\n\t\t\"Moussa Dembélé\",\n\t\t\"Moussa Sissoko\",\n\t\t\"Munir El Haddadi\",\n\t\t\"Nacer Chadli\",\n\t\t\"Nathaniel Clyne\",\n\t\t\"Nemanja Matic\",\n\t\t\"Neto\",\n\t\t\"Neven Subotic\",\n\t\t\"Neymar\",\n\t\t\"Nicola Sansone\",\n\t\t\"Nicolás Otamendi\",\n\t\t\"Nigel de Jong\",\n\t\t\"Niklas Süle\",\n\t\t\"Nolito\",\n\t\t\"Nuri Sahin\",\n\t\t\"Óliver Torres\",\n\t\t\"Olivier Giroud\",\n\t\t\"Ömer Toprak\",\n\t\t\"Oscar\",\n\t\t\"Pablo Piatti\",\n\t\t\"Pablo Zabaleta\",\n\t\t\"Paco Alcácer\",\n\t\t\"Patrick Herrmann\",\n\t\t\"Paul Pogba\",\n\t\t\"Paulo Dybala\",\n\t\t\"Pedro\",\n\t\t\"Pepe\",\n\t\t\"Per Mertesacker\",\n\t\t\"Phil Jones\",\n\t\t\"Philipp Lahm\",\n\t\t\"Pierre-Emerick Aubameyang\",\n\t\t\"Pierre-Emile Höjbjerg\",\n\t\t\"Radja Nainggolan\",\n\t\t\"Raffael\",\n\t\t\"Rafinha\",\n\t\t\"Raheem Sterling\",\n\t\t\"Ramires\",\n\t\t\"Raphaël Varane\",\n\t\t\"Raúl García\",\n\t\t\"Ricardo Rodríguez\",\n\t\t\"Riccardo Saponara\",\n\t\t\"Robert Lewandowski\",\n\t\t\"Roberto Firmino\",\n\t\t\"Roberto Pereyra\",\n\t\t\"Roberto Soldado\",\n\t\t\"Roberto Soriano\",\n\t\t\"Robin Knoche\",\n\t\t\"Rodrigo\",\n\t\t\"Roman Bürki\",\n\t\t\"Roman Neustädter\",\n\t\t\"Romelu Lukaku\",\n\t\t\"Ron-Robert Zieler\",\n\t\t\"Ross Barkley\",\n\t\t\"Sadio Mané\",\n\t\t\"Saido Berahino\",\n\t\t\"Sami Khedira\",\n\t\t\"Samir Handanovic\",\n\t\t\"Samir Nasri\",\n\t\t\"Samu Castillejo\",\n\t\t\"Samuel\",\n\t\t\"Santi Cazorla\",\n\t\t\"Santi Mina\",\n\t\t\"Saúl Níguez\",\n\t\t\"Sead Kolasinac\",\n\t\t\"Seamus Coleman\",\n\t\t\"Sebastian Rode\",\n\t\t\"Senad Lulic\",\n\t\t\"Sergi Roberto\",\n\t\t\"Sergio Agüero\",\n\t\t\"Sergio Busquets\",\n\t\t\"Sergio Ramos\",\n\t\t\"Shinji Kagawa\",\n\t\t\"Shkodran Mustafi\",\n\t\t\"Sime Vrsaljko\",\n\t\t\"Simone Zaza\",\n\t\t\"Sofiane Feghouli\",\n\t\t\"Sokratis\",\n\t\t\"Stefan de Vrij\",\n\t\t\"Stefan Kießling\",\n\t\t\"Stefan Radu\",\n\t\t\"Stefan Savic\",\n\t\t\"Stefano Sturaro\",\n\t\t\"Stephan Lichtsteiner\",\n\t\t\"Stevan Jovetic\",\n\t\t\"Steven N'Zonzi\",\n\t\t\"Sven Bender\",\n\t\t\"Theo Walcott\",\n\t\t\"Thiago\",\n\t\t\"Thibaut Courtois\",\n\t\t\"Thomas Müller\",\n\t\t\"Thorgan Hazard\",\n\t\t\"Timo Horn\",\n\t\t\"Timo Werner\",\n\t\t\"Tin Jedvaj\",\n\t\t\"Toby Alderweireld\",\n\t\t\"Toni Kroos\",\n\t\t\"Tony Jantschke\",\n\t\t\"Vicente Iborra\",\n\t\t\"Victor Wanyama\",\n\t\t\"Vieirinha\",\n\t\t\"Vincent Kompany\",\n\t\t\"Vitolo\",\n\t\t\"Wayne Rooney\",\n\t\t\"Wendell\",\n\t\t\"Wilfried Bony\",\n\t\t\"Willian\",\n\t\t\"Wojciech Szczesny\",\n\t\t\"Xherdan Shaqiri\",\n\t\t\"Yann Sommer\",\n\t\t\"Yannick Ferreira Carrasco\",\n\t\t\"Yaya Touré\",\n\t\t\"Yohan Cabaye\",\n\t\t\"Yunus Malli\",\n\t\t\"Yuto Nagatomo\",\n\t\t\"Zlatko Junuzovic\"\n\t];\n $( \"#player-name\" ).autocomplete({\n source: player_names\n });\n}", "getNameFromPlayer(player) {\n return this.socketNames[player.socketId];\n }", "getActivePlayerName () {\n return THIS.view.players[THIS.view.currentPlayer].displayName\n }", "info () {\n return {\n name: this.name,\n players: this.players.map(player => player.name)\n }\n }", "function getUsernameList() {\r\n\tvar userlist = getUsernames();\r\n\treturn userlist;\r\n}", "getPlayerName() {\n if (localStorage.getItem('playerName')) {\n this.playerName = JSON.parse(\n localStorage.getItem('playerName')\n ).playerName;\n }\n return this.playerName;\n }", "function getSummonerNames() {\n mongoClient.connect(database, function(err, db) {\n if(err) {\n /* Handle the error */\n handleDbError(err);\n }\n var docs = [];\n /* Keeps track of how long to delay the next lookup in accordance to Riot's API ToS */\n var namesRead = 0;\n var collection = db.collection(dbOnline);\n var playersCursor = collection.find();\n playersCursor.toArray(function(err, documents) {\n if(err) {\n /* Handle the error */\n handleCursorError(err);\n }\n /* Ensure that the database resource is freed only after the \n * entire cursor has been iterated through*/\n var docs = documents.length;\n /* End of the line */\n function checkDocOff() {\n docs--;\n if(docs == 0) {\n db.close();\n }\n }\n /* For each twitch streamer that is ONLINE */\n for(var y = 0; y < documents.length; y++) {\n /* For each lolAccount this user has */\n for(var b = 0; b < documents[y].lolAccounts.length; b++) {\n /* increment namesRead to keep track of how much delay a specific lolAccount lookup needs */\n namesRead += 1;\n /* Query live game data using Riot API. some delay due to Riot API ToS */\n (function(delay, playerDoc, lolAccount) {\n setTimeout(function() {\n checkIfInGame(playerDoc, lolAccount);\n }, (delay)*apiDelay);\n checkDocOff();\n })(namesRead, documents[y], documents[y].lolAccounts[b]);\n }\n }\n });\n });\n}", "getPlayerNameById (playerId) {\n return THIS.view.players[playerId].displayName\n }", "function teamNames() {\n return [homeTeam().teamName, awayTeam().teamName];\n}", "getPlayers() {\n\t\treturn this.players;\n\t}", "getPlayers() {\n\t\treturn this.lobbyPlayers;\n\t}", "getCurrentPlayer() {\n return this.players[this.currentPlayerIndex]\n }", "getPlayers () {\n return this.#players\n }", "function _getThePeople() {\n\tconst match = _storage.getState().Match;\n\tconst { uid } = _storage.getState().Main.user;\n\treturn Object.keys(match.players).map(_pid => {\n\t\tconst pl = match.players[_pid];\n\t\tif (pl.status !== 'D') {\n\t\t\treturn Div({className: 'player-box'}, [\n\t\t\t\t(match.id === uid && _pid !== uid)\n\t\t\t\t? Div({ className: 'delete-btn', onclick: kick })\n\t\t\t\t: Div(),\n\t\t\t\tSpan({}, pl.displayName),\n\t\t\t\tDiv({ className: 'score' }, [Span({}, `x${pl.score}`), Span({className: 'score-coin'})])\n\t\t\t])\n\t\t}\n\t\treturn;\n\t})\n}", "get players() {\n return this._players;\n }", "getAllPlayers() {\n return Player.find({}).exec();\n }", "get activePlayers() {\n return this._activePlayers;\n }", "getLeadingPlayer() {\n if (this.playerOneScore > this.playerTwoScore) {\n return this.playerOneName;\n } else {\n return this.playerTwoName;\n }\n }", "function getTwitchUsernames() {\n mongoClient.connect(database, function(err, db) {\n if(err) {\n /* Handle the error */\n handleDbError(err);\n }\n var docs = [];\n var collection = db.collection(dbPlayers);\n var playersCursor = collection.find();\n playersCursor.toArray(function(err, documents) {\n if(err) {\n /* Handle the error */\n handleCursorError(err);\n }\n /* Ensure that the database resource is freed only after the \n entire cursor has been iterated through*/\n var docs = documents.length;\n /* End of the line */\n function checkDocOff() {\n docs--;\n if(docs == 0) {\n db.close();\n }\n }\n /* Use the twitch API */\n for(var y = 0; y < documents.length; y++) {\n /* Call a function to query twitch because SOFTWARE DESIGN */\n /* Wait some time so I don't DdoS twitch.tv */\n (function(i) {\n setTimeout(function() {\n processTwitchRequest(documents[i]);\n }, (i+1)*apiDelay);\n checkDocOff();\n })(y);\n }\n });\n });\n}", "function getOscarWinnerNames() {\n let winners = []\n\n for (i = 0; i < actors.length; i++) {\n if (actors[i].oscars > 0) {\n winners = winners.concat(actors[i].fullName)\n }\n }\n\n return winners\n}", "async function getActivePlayers (players) {\n const activePlayers = []\n for (let player of players) {\n // eslint-disable-next-line\n let snapshot = await firebase.ref('/status/' + player).once('value')\n if (snapshot.val() === 'online') activePlayers.push(player)\n }\n return activePlayers\n}", "function listenForPlayerNames(element) {\n\telement.addEventListener('change', function() {\n\t\tcurrentPlayerNames.push(element.value)\n\t})\n}", "async userNames() {\n let cursor;\n const userNames = {};\n do {\n const {\n members: users,\n response_metadata: { next_cursor: nextCursor },\n } = await this.usersList({\n cursor,\n });\n\n for (const user of users) {\n userNames[user.id] = user.name;\n }\n\n cursor = nextCursor;\n } while (cursor);\n return userNames;\n }", "function getTheKeys(player) {\n return Object.keys(player); // <== Highlight\n}", "getAllPlayers(){\n var allPlayers = [];\n for(var i = 0; i < this.teams.length; i++){\n var team = this.teams[i];\n for(var j = 0; j < team.players.length; j++){\n var player = team.players[j];\n allPlayers.push(player);\n }\n }\n return allPlayers;\n }", "function getMoons() {\n var moon_names = [];\n moons.forEach(function(moon) {\n moon_names.push(moon.userData.name);\n })\n return moon_names;\n}", "fetchPlayers() {\n if(this.players.length === 0) { return []; }\n return this.players.map((value) => value._player);\n }", "getCurrentPlayer() {\n return this.props.players.find(p =>\n p.playerName === this.props.playerName\n );\n }", "function getAvailableCharacterNamesneu(settings, callback){\n\t// reset counter, otherwise the loader will stop immediately\n\tresetWalkthroughCounter();\n\t// load names\n\tgetAvailableValues(settings, callback, 'name');\n}", "get players() {\n return this._players;\n }", "get players() {\n return this._players;\n }", "function getLeagueList() {\n return League.find({}, \"name\").exec();\n}", "function getNames(data) {\n return data.names;\n}", "function playersNamesFromUi() {\n // names\n if ($(\"#playerListTable tr\").length == 0)\n return [];\n\n let namesArr = [];\n $(\"#playerListTable tr\").each(function (index, element) {\n // in TR, find TD with .playerNameInput class.\n let input = $(element).find('.playerNameInput');\n if (input.length == 0)\n return [];\n namesArr.push(input.val());\n });\n return namesArr;\n}", "function whichPlayer(player) {\n if (player == 1) {\n return playerOneName;\n } else if (player == 2) {\n return playerTwoName;\n }\n }", "function playersName() {\r\n const playerNameStore = [plrEntrName.value];\r\n const displayName = document.getElementById(\"playersNameHere\");\r\n displayName.innerHTML = `Player: ${playerNameStore}`;\r\n}", "getPlayerDetailsByAvailablePromise(){\n return this.GetPromise('/v3/nfl/stats/{format}/Players');\n }", "getCurrentPlayer() {\n return this.findPlayerByName(this.props.playerName);\n }", "function getProjectNames(){\n var store = getProjectStore();\n var names = [];\n for(var name in store){\n names.push(name);\n }\n return names;\n }", "function getCurrentPlayer() {\n\treturn gameState.players[gameState.turnIndex];\n}", "get names() {\n return this.getListAttribute('names');\n }", "get players() { return this.#runtime_.players; }", "function activePlayer(players) {\n return players.find(player => player.isActive === false).name; // === !player.isActive\n}", "function getPlayerNamesAndBalances() {\n const { buyins } = game__getGameState();\n\n return Array.from(document.getElementsByClassName(\"player\")).map(el => {\n const name = el.getElementsByClassName(\"name\")[0].innerHTML;\n const stack = el.getElementsByClassName(\"stack\")[0];\n const value = getNumberContent(stack);\n return { name, buyin: buyins[name], value };\n });\n}", "function getPlanets() {\n var planet_names = [];\n planets.forEach(function(planet) {\n planet_names.push(planet.userData.name);\n })\n return planet_names;\n}", "function getPlayers(filter) {\n currentPlayers = []\n\n var endpoint = \"/player\";\n switch (filter.timespan) {\n case \"This month\": endpoint += \"/month\"; break;\n case \"This week\": endpoint += \"/week\"; break;\n case \"Today\": endpoint += \"/today\"; break;\n }\n\n getPlayersFilter(endpoint);\n\n var aux = [];\n\n if (filter.search) {\n currentPlayers.forEach(function (current) {\n if (current.username.toLowerCase().includes(filter.search.toLowerCase())) {\n aux.push(current);\n return;\n }\n });\n\n currentPlayers = aux;\n }\n}", "function retrieve() {\n return playerInfo;\n }", "function getPlayers(player, team) {\n console.log(player + \": \" + team);\n}", "toDisplay() {\n return {\n player_names: this.p_name,\n player_LIDs: this.p_lid,\n player_active: this.p_active\n };\n }", "function generatePlayerList() {\n const list = playerHistory.map(element => `<li>${element}</li>`).join('\\n');\n return list;\n}", "generateName() {\n return ('Player ' + (this.players.length + 1));\n }", "function getPlayerData(list, playerName) {\n for (let p = 0; p < list.length; p++) {\n const player = list[p];\n if (player.name === playerName) {\n return player;\n }\n }\n // console.log(\"Unable to find player \", playerName, \"in list:\\n\", list);\n}", "function printPlayers(json_players){\n var html = '';\n for (var key in json_players){\n var player = json_players[key];\n if (player !== \"\"){\n html += json_players[key] + ', ';\n }\n }\n html = html.slice(0,-2);\n return html;\n}", "player() {\n return \"player\" + this.index;\n }", "function getPlayer(){\n\t\tconsole.log(\"id\"+session.avatorId)\n\t\tvar data = {\"name\": name, \"avatorId\": session.avatorId};\n\t\tusersWS[name].emit(\"player data\", data);\n\t}", "getAllNames() {\n return Array.from(this.commitPerName.keys());\n }", "function getPlayers() {\n try {\n const sockets = {\n US: new WebSocket(\"wss://d0.drednot.io:4000\"),\n Poland: new WebSocket(\"wss://d1.drednot.io:4000\"),\n Test: new WebSocket(\"wss://t0.drednot.io:4000\"),\n Singapore: new WebSocket(\"wss://s2.drednot.io:4000\")\n };\n for(let i in sockets) {\n sockets[i].addEventListener(\"open\", (e) => {\n sockets[i].send(\"yo\");\n });\n sockets[i].addEventListener(\"message\", (e) => {\n cache.dredplayers[i] = JSON.parse(e.data);\n });\n sockets[i].onerror = (e) => {\n cachelog.error(e);\n }\n }\n } catch(err) {\n cachelog.critical(\"PLAYERCOUNT FAIL (Server offline)\");\n }\n}", "function showWhatPlayer() {\n document.getElementById(\"beurt\").innerHTML = players[currentPlayer];\n console.log(players[currentPlayer])\n\n\n}", "function getCurrentPlayer (){\r\n return _currentPlayer;\r\n }", "function getPlayerName(){\r\n //returns player name\r\n return document.getElementById('p-name')\r\n}", "function getPlayers(players, playername) {\n if ((players.indexOf(playername) === -1)) {\n players.push(playername);\n }\n}", "function getPlayerName(){\n return $(\"#fullname\").val();\n }", "function getPlayerName(room, side) {\n var game = games[room];\n for (var p in game.players) {\n var player = game.players[p];\n if (player.side === side) {\n return player.name;\n }\n }\n }", "function availablePlayers(jwt) {\n const activeGamesURL = BASE_URL + '/player/available_players'\n return httpRequestJWT(activeGamesURL, 'get', jwt)\n}", "function getPlayerName(response) {\n playerName = prompt(response + chapterOne.nameQuestion);\n return playerName;\n }", "function gameCurrentUsersAndGuilds() {\n client.user.setGame(`for ${listeners} on ${client.guilds.size} servers`);\n\n return setTimeout(gameCurrentSong, 10000);\n}", "getCurrentPlayer() {}", "getPlayersPIDs() {\n\t\treturn this.lobbyPlayers.map(player => player.pid);\n\t}", "function getAllPlayers(id) {\n console.log(id);\n const players = [];\n Object.keys(io.sockets.connected).map((socketID) => {\n const player = io.sockets.connected[socketID].player; // eslint-disable-line\n if (player) players.push(player);\n return null;\n });\n console.log('server || running allPlayers\\n', players);\n return players;\n}", "function updateNames() {\n io.emit('usernames', userNameList);\n }", "async getPlayers(channel) {\r\n\t\tconst rows = await sql.all(`SELECT ID, Name FROM Players WHERE Channel = $channel ORDER BY UPPER(Name)`, {$channel: channel});\r\n\t\tlet players = [];\r\n\t\tfor(const row of rows) {\r\n\t\t\tconst player = await this.getPlayerById(row.ID);\r\n\t\t\tplayers.push(player);\r\n\t\t}\r\n\t\treturn players;\r\n\t}", "getDisqualifiedPlayerIds() {}", "function getPlayerData(list, playerName) {\n for (let p = 0; p < list.length; p++) {\n const player = list[p];\n if (player.name === playerName) {\n return player;\n }\n }\n console.log(\"Unable to find player \", playerName, \"in list:\\n\", list);\n}", "get nameServers() {\n return this.getListAttribute('name_servers');\n }", "function multiplayerName(username)\n{\n\tlet multiplayerName = Engine.ConfigDB_GetValue(\"user\", \"playername.multiplayer\") || Engine.GetSystemUsername();\n\treturn !username ? multiplayerName : multiplayerName != username ? multiplayerName + \" (\" + username + \")\" : username;\n}", "getOnline(){\r\n let totalPlayers = [];\r\n\r\n for(var x = 0; x < this.currentPlayer.length; x++){\r\n if(this.currentPlayer[x].index===99 || this.currentPlayer[x].index === undefined){\r\n this.currentPlayer[x].index='type !save to save your progress';\r\n }\r\n totalPlayers.push([`ID: [${this.currentPlayer[x].index}] [${this.currentPlayer[x].playerName}]`]);\r\n }\r\n console.log(totalPlayers);\r\n return totalPlayers;\r\n }", "GetTitleString() {\n\t\treturn this.Name + ' (' + Object.keys( this.Players ).length + ')';\n\t}", "function playerStats(playerInput) {\n for (const playerName in players()) {\n if (playerName === playerInput) {\n return players()[playerName];\n }\n }\n}", "function currentPlayerName() {\n playerName = userNameField.value;\n}", "@api \n get playersJoinedListData() {\n return this._playersJoinedListData;\n }", "function getChampionName(){\n\n}", "who(currentPlayer, channel){\n let map = this.maps[currentPlayer.position]\n let nearbyPlayers = new Array()\n this.players.forEach(player => {\n if(player !== currentPlayer && player.position === currentPlayer.position){\n nearbyPlayers.push(player)\n }\n })\n return nearbyPlayers\n }", "function getPlayerData() {\n\t\tCallModel.fetch('UserGet', {\n\t\t\tid: $routeParams.player1Id\n\t\t},\n\t\t{\n\t\t\tsuccess: function (response) {\n\t\t\t\t$scope.player1.fullName = response.first_name + ' ' + response.last_name;\n\t\t\t\t$scope.player1.id = response.id;\n\t\t\t}\n\t\t});\n\n\t\tCallModel.fetch('UserGet', {\n\t\t\tid: $routeParams.player2Id\n\t\t},\n\t\t{\n\t\t\tsuccess: function (response) {\n\t\t\t\t$scope.player2.fullName = response.first_name + ' ' + response.last_name;\n\t\t\t\t$scope.player2.id = response.id;\n\t\t\t}\n\t\t})\n\t}", "function updateCurrentPlayer() {\n 'use strict';\n var currentPlayerDisp = document.getElementById('currentPlayer');\n othelloState.currentPlayer == OTHELLO_CONST.playerOne ? currentPlayerDisp.innerHTML = gameSessionInfo.playerOneName : currentPlayerDisp.innerHTML = gameSessionInfo.playerTwoName;\n}", "function loadPlayerList() {\n Player_v.all({order: 'id'}, function(err, results) {\n var players = [];\n var player = {};\n player.player_name = 'Not Selected';\n player.id = \"\";\n players[0] = player;\n\n if(results.length > 0) {\n for (var i = 0; i < results.length; i++) {\n // create a brand new instance of player object for every record. One cannot reuse the same player variable.\n var player = { player_name: results[i].first_name + \" \" + results[i].last_name + \"-\" + results[i].city + \"/\" + results[i].state_or_province,\n id: results[i].id};\n players.push(player);\n }\n } // end of if.\n\n this.player_list = players;\n\n next(); // process the next tick.\n }.bind(this));\n}", "function loadStatus() {\n document.getElementById(\"player-1-name\").innerHTML = player1.getSymbol() + \" won\";\n document.getElementById(\"player-1-win\").innerHTML = player1win;\n document.getElementById(\"player-2-name\").innerHTML = player2.getSymbol() + \" won\";\n document.getElementById(\"player-2-win\").innerHTML = player2win;\n}", "getDevelopers() {\n\t\t\t\tlet names = '',\n\t\t\t\t\t\tthat = this;\n\t\t\t\tfor ( let i = 0; i < this.developers.length; i++ ) {\n\t\t\t\t\tnames += that.developers[i].name + ' ';\n\t\t\t\t};\n\t\t\t\treturn names\n\t\t\t}", "function afh_getMemberList() {\n\tGM_xmlhttpRequest({\n\t\tmethod: 'GET',\n\t\turl: 'http://alliancefromhell.com/scripts/greasemonkey/tcnames/names.txt',\n\t\tonload: function(response) {\n\t\t\tif(JSON && JSON.parse) {\n\t\t\t\tafhMembers = JSON.parse(response.responseText);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tafhMembers = eval(response.responseText);\n\t\t\t}\n\t\t}\n\t});\n}", "function getPlayerData() {\n var storedPlayerInitials = JSON.parse(localStorage.getItem(\"player-initials\"));\n if (storedPlayerInitials !== null) {\n playerInitials = storedPlayerInitials;\n }\n var storedPlayerScores = JSON.parse(localStorage.getItem(\"player-scores\"));\n if (storedPlayerScores !== null) {\n playerScores = storedPlayerScores;\n }\n}", "function playerName(){\n if(loggedIn()){\n return firebase.auth().currentUser.email.split(\"@\")[0].substring(0,20).capitalize();\n }\n return \"\";\n}", "function getSummonerName(){\n\n}", "async function getPlayers () {\n const players = await db.player.find({}, { password: 0 })\n // .sort({ ladderPosition: 1 })\n // .toArray()\n\n for (const player of players) {\n player.lastPlayedSingles = await lastPlayedSingles(player._id)\n player.daysSincePlayedSingles = daysSince(player.lastPlayedSingles)\n player.lastPlayedDoubles = await lastPlayedDoubles(player._id)\n player.daysSincePlayedDoubles = daysSince(player.lastPlayedDoubles)\n }\n\n return players\n }", "function getName() {\n if (!player1.chosen) {\n player1.name = username;\n player1.chosen = true;\n database.ref(\"/connections/users/\" + userKey).update({\n name: username\n })\n } else if (player1.chosen && !player2.chosen) {\n player2.name = username;\n player2.chosen = true;\n }\n\n}", "_waitNames () { return this.waitingList.map(person => person.name); }", "function randomPlayerName() {\n let namesSet = new Set(Glob.playerNames.slice(1)); // set of names without first \"Host\"\n $(\"input.playerNameInput\").each(function () {\n let existingName = $(this).val();\n namesSet.delete(existingName);\n });\n return (namesSet.size === 0) ? \"Player-X\" : namesSet.values().next().value;\n}", "startGame(){\r\n for(var x = 0; x < this.currentPlayer.length; x++){\r\n this.playersOnline.push(this.currentPlayer[x]);\r\n if(this.playersOnline[x] === this.currentPlayer[x]){\r\n return [`Players Online: ${this.online}\\n`];\r\n }\r\n }\r\n }", "getNames() {\n return this.map(item => {\n return this.getMiddlewareName(item);\n });\n }", "function listPlayersIds () {\n return [roles[PLAYER_ROLE], roles[HOUSE_PLAYER_ROLE]]\n }" ]
[ "0.8027108", "0.6836199", "0.6812035", "0.67015815", "0.6587808", "0.65266365", "0.65075004", "0.6490363", "0.6465564", "0.64560485", "0.6404803", "0.6327427", "0.63038665", "0.62832254", "0.6272092", "0.62528354", "0.6205687", "0.6183072", "0.6177864", "0.6103091", "0.6062733", "0.60580516", "0.60479164", "0.60473156", "0.6044133", "0.6032484", "0.6018781", "0.6008748", "0.6007738", "0.60001546", "0.5998639", "0.5997397", "0.5997397", "0.5996525", "0.5980853", "0.5965947", "0.5957492", "0.5946279", "0.59434676", "0.5940455", "0.592975", "0.5927406", "0.5919903", "0.5916041", "0.5911719", "0.5909088", "0.59019035", "0.5898001", "0.5896807", "0.58805764", "0.587813", "0.5867675", "0.58658487", "0.5853943", "0.5850394", "0.5850191", "0.58500165", "0.5848902", "0.58441305", "0.5841301", "0.5839793", "0.58341956", "0.5828966", "0.5826154", "0.58216876", "0.5811389", "0.5805238", "0.5802412", "0.5796483", "0.57915074", "0.5790372", "0.5790318", "0.5779415", "0.5775363", "0.5766909", "0.5766481", "0.57651347", "0.5765112", "0.57601476", "0.57438856", "0.57386595", "0.57359916", "0.5733625", "0.57334", "0.57228833", "0.57098967", "0.56867456", "0.5686035", "0.5683554", "0.5678745", "0.567401", "0.56585246", "0.56478953", "0.56406194", "0.5640461", "0.5636925", "0.5629872", "0.5628639", "0.56285614", "0.5625224" ]
0.7790094
1
href = Thiago Vallin / Rafa Reis
decodeHtml(html) { const txt = document.createElement('textarea'); txt.innerHTML = html; return txt.value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get href() {return encodeURI(stringAttribute.get(this, 'href'));}", "get href(){return $href;}", "get href(){return $href;}", "function _(e){var t=document.createElement(\"a\");return t.href=e,t}", "function href(editor, v) {\n\t\tvar a = getFirstAnchor(editor);\n\t\tif (!v)\n\t\t\treturn a ? a.href : '';\n\t\telse if (a)\n\t\t\ta.href = v;\n\t}", "function link(elem) {\n // check if we have a footnote backref\n if (hasClass(elem, \"footnote-backref\")) return \"\";\n\n // otherwise parse the link as usual\n var result = \" [\";\n result += parseChildren(elem);\n return result + \"](\" + elem.getAttribute(\"href\") + \") \";\n}", "function anchorize(text) {\n\treturn text.replace(/((http|https|ftp|ftps|file|smb):\\/{2}[a-zA-Z\\d:\\/.]+)\\b/gim, '<a href=\"$1\">$1</a>');\n}", "function linkURL(formula){\n return formula.match(/=hyperlink\\(\"([^\"]+)\"/i)[1]\n}", "function directLink(link) {\r\n\tlink.href = link.href.replace(/\\/gp/, \"\");\r\n}", "getUrlFromOP(ref) {\n const as = this.$('a');\n const links = as.map((i, el) => this.$(el)).get();\n for (const link of links) {\n const text = link.text();\n if (text === ref) {\n const href = link.attr('href');\n if (href) return href;\n }\n }\n }", "function lc_Linkify(){\r\n var urlRegex = /_?((h\\S\\Sp)?(:\\/\\/|rapidshare\\.)[^\\s+\\\"\\<\\>]+)/ig;\r\n var snapTextElements = document.evaluate(\"//text()[\"+\r\n \"not(ancestor::a) and not(ancestor::script) and (\"+\r\n \"contains(translate(., 'RAPIDSHE', 'rapidshe'), 'rapidshare.')\"+\r\n \" or contains(translate(., 'RAPIDSFENT', 'rapidsfent'), 'rapidsafe.net/')\"+\r\n \" or contains(translate(., 'LIXN', 'lixn'), '://lix.in/')\"+\r\n \")]\", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i=0; i < snapTextElements.snapshotLength; i++) {\r\n var elmText = snapTextElements.snapshotItem(i);\r\n if (urlRegex.test(elmText.nodeValue)) {\r\n var sURLText = elmText.nodeValue;\r\n var elmSpan = document.createElement(\"span\");\r\n // add class name\r\n elmSpan.className = \"rs_linkcheck_linked\";\r\n elmText.parentNode.replaceChild(elmSpan, elmText);\r\n urlRegex.lastIndex = 0;\r\n for(var match = null, lastLastIndex = 0; (match = urlRegex.exec(sURLText)); ) {\r\n // skip truncated links\r\n if(match[0].indexOf(\"...\") != -1) continue;\r\n // skip bare domains\r\n if(match[0].indexOf(\"/\") == -1) continue;\r\n elmSpan.appendChild(document.createTextNode(sURLText.substring(lastLastIndex, match.index)));\r\n lastLastIndex = urlRegex.lastIndex;\r\n var elmLink = document.createElement(\"a\");\r\n // make sure there's an http:\r\n elmLink.href = match[1].replace(/^((h\\S\\Sp)?:\\/\\/)?rapidshare\\./, \"http://rapidshare.\");\r\n var nextPart = \"\";\r\n // Check if there was a space\r\n if(/\\brapidshare\\.(com|de)\\/files\\/.*[^\\.]{5}$/i .test(match[0]) &&\r\n /^\\s.*\\.\\w/.test(sURLText.substring(urlRegex.lastIndex))){\r\n nextPart = sURLText.substring(urlRegex.lastIndex);\r\n nextPart = nextPart.match(/^\\s[^\\s+\\\"\\<\\>]*\\.\\w+(\\.html)?/i)[0];\r\n lastLastIndex += nextPart.length;\r\n elmLink.href += nextPart.replace(/\\s/, \"\");\r\n }\r\n // open in new window or tab\r\n elmLink.target = \"_blank\";\r\n // tool-tip to indicate Linkified\r\n elmLink.title = \"[linked]\";\r\n elmLink.appendChild(document.createTextNode(match[0] + nextPart));\r\n elmSpan.appendChild(elmLink);\r\n }\r\n elmSpan.appendChild(document.createTextNode(\r\n sURLText.substring(lastLastIndex)));\r\n elmSpan.normalize();\r\n // stop events on new links, like pop-ups and cookies\r\n elmSpan.addEventListener(\"click\", function(e){ e.stopPropagation(); }, true);\r\n }\r\n }\r\n}", "function getHref(to) {\n const hist = getInA(get(), historyPath);\n let location = to;\n if (typeof to === \"string\") {\n if (to.charAt(0) !== \"/\") {\n location = createLocation(to, null, null, hist.location);\n } else {\n location = createLocation(to);\n }\n }\n const href = location ? hist.createHref(location) : \"\";\n return href;\n }", "function autoLink(str, elem) {\n var exp =\n /(^|\\s|[^\\u0020-\\u007f])(https?:\\/\\/[\\x21-\\x27\\x2a-\\x7f]+)|((\\#[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x5e\\x60\\x7b-\\x7f]+)|(@[a-zA-Z\\d_]+))/g;\n var lastIndex = 0;\n var m;\n while (m = exp.exec(str)) {\n var text = str.substr(lastIndex, m.index - lastIndex);\n //console.log(text);\n appendText(elem, text);\n var prefix = m[1] || \"\";\n var url;\n var target;\n if (m[4]) { // Hash tag\n text = m[4];\n url = \"/search?q=\" + encodeURIComponent(text) + \"&hl=\" + lang;\n target = \"_self\";\n } else if (m[5]) { // User name\n text = m[5];\n url = \"https://twitter.com/\" + text.replace(/^@/, \"\");\n target = \"_blank\";\n } else if (m[2]) { // URL\n text = m[2];\n url = text;\n target = \"_blank\";\n }\n //console.log(prefix, text, url, target);\n appendText(elem, prefix);\n elem.append(createElementTree([\"a\", {href: url, target: target}, text]));\n lastIndex = m.index + m[0].length;\n }\n var text = str.substr(lastIndex);\n //console.log(text);\n appendText(elem, text);\n}", "function m(e){return e.href.replace(/#.*/,\"\")}", "function lawLink(str) {\n spacereg = '\\s';\n let linkstr ='https://google.com/#q=' + str.replace(spacereg,'%20');\n // astr = '<a target=\"\" href=\"' + linkstr +'\">' + str + '</a>';\n\n return linkstr\n}", "function url(href) {\n return /^([a-z]{2,}):/.test(href) ? href : ('http://' + href)\n}", "autolink() {\n const linkRegex = new RegExp(`(https?://\\\\S+\\\\.\\\\S+)\\\\s`, 'ig');\n const editor = this.getEditor();\n const content = editor.getDocument().toString();\n let match;\n while ((match = linkRegex.exec(content))) {\n const url = match[1];\n if (isURL(url)) {\n const position = match.index;\n const range = [position, position + url.length];\n const hrefAtRange = editor.getDocument().getCommonAttributesAtRange(range).href;\n if (hrefAtRange !== url) {\n this.updateInRange(editor, range, 0, () => {\n if (editor.canActivateAttribute('href')) {\n editor.activateAttribute('href', url);\n }\n });\n }\n }\n }\n }", "function qualifyUrl(url) {\n var element = document.createElement(\"span\");\n element.innerHTML = '<a href=\"' + url + '\">&nbsp;</a>';\n return element.firstChild.href;\n}", "getHref() {\n switch (this.type) {\n case \"room\":\n return \"room.html?\" + this.id + \"+\" + this.title.split(' ').join('_');\n case \"device\":\n return \"device.html?\" + this.id + \"+\" + this.title.split(' ').join('_');\n default:\n return \"home.html\";\n }\n }", "function parseHref(href) {\n var a = document.createElement('a');\n\n a.href = href;\n\n return a;\n }", "function parseHref(href) {\n var a = document.createElement('a');\n\n a.href = href;\n\n return a;\n }", "function getLink($el) {\n var $wrap = $('<div></div>');\n $wrap.append($el);\n return $wrap.find('a[href]').attr('href');\n }", "function url(href) {\n return /^([a-z]{2,}):/.test(href) ? href : ('http://' + href);\n }", "function eLink(db,nm) {\nel = document.createElement(\"a\");\nel.setAttribute(\"target\",\"_blank\");\ndbs = new Array(\"http://www.wowarmory.com/search.xml?searchType=items&searchQuery=\",\"http://www.wowhead.com/?search=\",\"http://www.thottbot.com/?s=\",\"http://wow.allakhazam.com/search.html?q=\");\ndbTs = new Array(\"Armory\",\"Wowhead\",\"Thottbot\",\"Allakhazam\");\ndbHs = new Array(\"&real; \",\"&omega; \",\"&tau; \",\"&alpha;\");\nel.href = dbs[db]+nm;\nel.setAttribute(\"title\",dbTs[db]);\nel.innerHTML = dbHs[db];\nreturn el;\n}", "function getLink(url, term, label) {\n formattedTerm = term.split(' ').join('+');\n return \"<a target=\\\"_blank\\\" href=\\\"\" + url + formattedTerm + \"\\\" title=\\\"View results on \" + label + \"\\\"\\\">\" + term + \"</a>\";\n}", "get hyperLink() { return $(\"//a[contains(text(),'Site Map')]\") }", "function mk_link(text) {\r\n var a = $e('a')\r\n a.style.background = null\r\n a.style.backgroundColor = null\r\n a.href = '#'\r\n a.appendChild( $t(text) )\r\n return a\r\n}", "function eLink(db,nm) {\n\tdbs = new Array(\"http://us.battle.net/wow/en/search?f=wowitem&q=\",\"http://www.wowhead.com/?search=\");\n\tdbTs = new Array(\"Armory\",\"Wowhead\");\n\tdbHs = new Array(\"&real; \",\"&omega; \");\n\tel = '<a href=\"'+ dbs[db]+nm + '\" target=\"_blank\" title=\"'+ dbTs[db] +'\">'+ dbHs[db] + '</a>';\n\treturn el;\n}", "function mustachifyUrl(href) {\n var url = \"http://mustachify.me/4?src=\" + escape(toAbsoluteURL(href));\n return url;\n}", "function hyperlink (part) {\n if (!/^@|#/.test(part)) return part\n var [, type, value] = part.split(/(@|#)(\\w+)/)\n switch (type) {\n case '#': return html`\n <a class=\"u-zBump\" target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://mobile.twitter.com/hashtag/${value}\">#${value}</a>\n `\n case '@': return html`\n <a class=\"u-zBump\" target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://mobile.twitter.com/${value}\">@${value}</a>\n `\n default: return value\n }\n}", "function e(t){return t.replace(s,function(s,e){var d=(e.match(l)||[])[1]||\"\",m=i[d];e=e.replace(l,\"\"),e.split(m).length>e.split(d).length&&(e+=d,d=\"\");var o=e,p=e;return 100<e.length&&(p=p.substr(0,100)+\"...\"),\"www.\"===o.substr(0,4)&&(o=\"http://\"+o),\"<a href=\\\"\"+o+\"\\\">\"+p+\"</a>\"+d})}", "function getAbsUrl(s){\n var a = document.createElement('a');\n a.href = s\n return a.href;\n}", "function openlink(upperCase){\n clickAnchor(upperCase,getItem(\"link\"));\n}", "function setUrlAdr(link) {\n //url_adr = link.onclick;\n if (link.onclick !== null) { url_adr = link.onclick.toString().split(\"'\")[1]; }\n else {url_adr = link.href.toString().split(\"#\")[1];}\n}", "function createAxisLinkObj(href) {\n var hrefSplit = href.split('TrackHyperlink&URL=')[1];\n var encodedHref = hrefSplit.split('&')[0];\n var hashedUrl = decodeURIComponent(encodedHref);\n var linkObj = document.createElement('a');\n linkObj.href = hashedUrl;\n return linkObj;\n}", "function sanearEnlaces(){\n\t\tvar a = find(\"//a[@href='#']\", XPList);\n\t\tfor (var i = 0; i < a.snapshotLength; i++) a.snapshotItem(i).href = 'javascript:void(0)';\n\t}", "function sanearEnlaces(){\r\n\t\tvar a = find(\"//a[@href='#']\", XPList);\r\n\t\tfor (var i = 0; i < a.snapshotLength; i++) a.snapshotItem(i).href = 'javascript:void(0)';\r\n\t}", "function makeHyperlink(url){\n return '<a target=\"_blank\" href=\"'+ url+ '\">' + url + '</a>'\n}", "function render_url(text) {\n if (text.includes(\"http\")) {\n return \"<a href=\\\"\" + text + \"\\\" target=\\\"_blank\\\">Buy Here</a>\";\n } else {\n return text;\n }\n }", "function bp_ont_link(ont_acronym){\n return \"/ontologies/\" + ont_acronym;\n}", "function createLinks(txt){\n let xp =/((?:https?|ftp):\\/\\/[\\-A-Z0-9+\\u0026\\u2019@#\\/%?=()~_|!:,.;]*[\\-A-Z0-9+\\u0026@#\\/%=~(_|])/gi\n \n if (_.isString(txt)){\n return txt.replace(xp, \"<br><a target='_blank' href='$1'>$1</a>\") \n }\n}", "get links () {\n return this.items.filter(v => v.tag === 'a').map(v => {\n let { href } = new URL(v.attributes.href, this.base);\n return href;\n });\n }", "function change_links(a){\r\n\tx = a.href.indexOf('gid=');\r\n\ta.innerHTML = eval('gid'+a.href.substr(a.href.indexOf('gid=')+4));\r\n}", "function makeLink() {\n // var a=\"http://www.geocodezip.com/v3_MW_example_linktothis.html\"\n var url = window.location.pathname;\n var a = url.substring(url.lastIndexOf(\n '/') + 1) + \"?lat=\" +\n map.getCenter()\n .lat()\n .toFixed(6) + \"&lng=\" +\n map.getCenter()\n .lng()\n .toFixed(6) +\n \"&zoom=\" + map.getZoom() +\n \"&type=\" +\n MapTypeId2UrlValue(map.getMapTypeId());\n if (filename !=\n \"TrashDays40.xml\") a +=\n \"&filename=\" + filename;\n document.getElementById(\n \"link\")\n .innerHTML =\n '<a href=\"' + a +\n '\">Link to this page<\\/a>';\n }", "function linkhandler(a){\n\ta.href=\"?\" + a.href.split(\"?\")[1];\n\tvar val = '&arduino_address=' + $(\"#arduino_address\").val();\t\n\t\n\ta.href=a.href + val;\n\ta.href = a.href.replace(val+val,val);\n}", "function getValorAtributoHRef(elem) {\r\n\tvar valorElemento = \"\";\r\n\t\r\n\t//percorre todos os attr e retorna o valor do href\r\n\tfor (var i = 0; i < elem.attributes.length; i++) {\r\n\t\tif (elem.attributes[i].name == \"href\"){\r\n\t\t\tvalorElemento = elem.attributes[i].value;\r\n\t\t}\r\n\t}\r\n\treturn valorElemento;\r\n}", "function getValidHrefString(href) {\n\t\t// Replace spaces with %20.\n\t\thref = href.replace(/\\ /g, \"%20\");\n\n\t\treturn href;\n\t}", "function link(node) {\n var self = this\n var content = self.encode(node.url || '', node)\n var exit = self.enterLink()\n var escaped = self.encode(self.escape(node.url || '', node))\n var value = self.all(node).join('')\n\n exit()\n\n if (node.title == null && protocol.test(content) && escaped === value) {\n // Backslash escapes do not work in autolinks, so we do not escape.\n return uri(self.encode(node.url), true)\n }\n\n content = uri(content)\n\n if (node.title) {\n content += space + title(self.encode(self.escape(node.title, node), node))\n }\n\n return (\n leftSquareBracket +\n value +\n rightSquareBracket +\n leftParenthesis +\n content +\n rightParenthesis\n )\n}", "function link() {\n var LINKY_URL_REGEXP =\n /((ftp|https?):\\/\\/|(www\\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\\S*[^\\s.;,(){}<>\"”’]$/;\n var sub = selection.anchorNode.data.substring(0, selection.anchorOffset - 1);\n if (LINKY_URL_REGEXP.test(sub)) {\n var matchs = sub.match(LINKY_URL_REGEXP);\n if (matchs && matchs.length) {\n var st = selection.anchorOffset - matchs[0].length - 1;\n range.setStart(selection.anchorNode, st);\n scope.doCommand(null, {\n name: 'createLink',\n param: matchs[0]\n });\n }\n }\n }", "get anchor() {}", "function _decorate_urls(text) {\n var pattern = XRegExp('[a-zA-z]+://[^\\\\s]*', 'g');\n return _decorate_process(text, pattern, function(m) {\n return '<span onclick=\"window.open(\\''+m+'\\', \\'_blank\\');\" class=\"content-link\">' + m + '</span>';\n });\n\n\n }", "function followLink()\n{\n for(var ie = 0; ie < this.childNodes.length; ie++)\n {\t\t // loop through all children\n var node = this.childNodes[ie];\n if (node.nodeName == 'A')\n {\t // anchor node\n location = node.href;\n return false;\n }\t // anchor node\n }\t\t // loop through all children\n return false;\n}", "function new_check_link (e, url) {\r\n var a = document.createElement('a');\r\n a.title = url || e.href;\r\n a.href= 'javascript:;';\r\n a.style.fontWeight = \"bold\";\r\n a.style.fontSize = \"small\";\r\n a.style.textDecoration = \"none\";\r\n a.appendChild(document.createTextNode('[C]'));\r\n a.addEventListener(\"click\", click, true);\r\n e.parentNode.insertBefore(a, e.nextSibling);\r\n}", "parseTo(to) {\n let parser = document.createElement('a');\n parser.href = to;\n return parser;\n }", "function HrefFormater(value, row, index) {\n return '<a href=\"' + '/vuln/' +row.id + '\"> ' + row.name +'</a>';\n}", "href() {\n\n return _.find(this.services, {id: this.source}).src.replace(this.param, this.query);\n\n }", "function getLinkAddress(field, candidate) {\r\n\tvar href = field.link;\r\n\tvar match;\r\n\twhile (match = href.match(/^(.*?)@@(.*?)@@(.*)$/)) {\r\n\t\thref = match[1] + candidate[match[2]] + match[3];\r\n\t}\r\n\treturn href;\r\n}", "function $anchor(parent, id, cl, text, href) {\n\tlet a = $new(parent, 'a', id, cl, text);\n\tif (href) a.href = href;\n\treturn a;\n}", "function eLink(db,nm) {\ndbs = new Array(\"http://us.battle.net/wow/en/search?q=\",\"http://www.wowhead.com/?search=\",\"http://db.mmo-champion.com/search/all/\",\"http://www.wowdb.com/search?search=\");\ndbTs = new Array(\"Armory\",\"Wowhead\",\"DB MMO-Champion\",\"WoWDB\");\ndbHs = new Array(\"&real; \",\"&omega; \",\"&delta; \",\"&piv; \");\nel = '<a href=\"'+ dbs[db]+nm + '\" target=\"_blank\" title=\"'+ dbTs[db] +'\">'+ dbHs[db] + '</a>';\nreturn el;\n}", "function get_url(elt)\n{\n var url, tag;\n\n url = '';\n tag = elt.tagName.toUpperCase();\n if (tag == 'A' || tag == 'AREA' || tag == 'LINK')\n url = elt.getAttribute('HREF');\n if (tag == 'FORM')\n url = elt.getAttribute('ACTION');\n if (! isDefinedAttr(url))\n url = '';\n return stripString(url);\n}", "function pne_url2a(url)\n{\n var urlstr;\n\n if (url.length > 57)\n {\n var _url = url.replace(\"&amp;\", \"&\");\n\n if (_url.length > 57)\n {\n _url = _url.substr(0, 57) + '...';\n urlstr = _url.replace(\"&\", \"&amp;\");\n }\n }\n\n if (!urlstr)\n {\n urlstr = url;\n }\n\n document.write('<a href=\"'+url+'\" target=\"_blank\">'+urlstr+'</a>');\n}", "function ini_breadcrumb_genLink(root, name2href, name2title,\r\n\t\t\t\t\t\t\t\tind, ub, name) {\r\n\tvar typ = (ind == ub) ? \"tail\" : \"mid\";\r\n\treturn ini_breadcrumb_getLink(root, name2href[name], name2title[name], typ);\r\n}", "function extractLink(body) {\n body = cheerio.load(body);\n return body('a[tabindex=1]', '.result-1').attr('href');\n}", "function normalizeLink(s) {\n return s.replace(/\\\\/g, '/');\n}", "function sample2_2_1() {\n var element = document.getElementById('sample-2-link');\n var attribute = element.getAttribute('href');\n console.log(attribute);\n}", "function makeLinks(site, node) {\r\n\tvar container = $(\"<span class='torrentLinkSpan'></span>\");\r\n\tvar artistName = getText(site.artistPath ? $(site.artistPath, node) : $(node));\r\n\tvar albumName = site.albumPath ? getText($(site.albumPath, node)) : \"\";\r\n\tif(albumName && site.albumFunction) albumName = site.albumFunction(albumName).replace(/^\\s+/,\"\");\r\n\tfor(j = 0;search=searches[j];j++)\r\n\t\tif(search != site.search) addLink(container, search, {artist:artistName, album:albumName});\r\n\tif (site.beforePath) $(site.beforePath, node).before(container);\r\n\telse (site.placePath ? $(site.placePath, node) : $(node)).append(container);\t\t\r\n}", "function fnVoltarLink() {\r\n\tvar oLink = document.links[0];\r\n\toLink.innerHTML = \"Pegar Feeds\";\r\n\toLink.className = \"\";\r\n\toLink.onclick = fnGo;\r\n}", "function makeHref(to, params, query) {\n var path = makePath(to, params, query);\n\n if (PathStore.getLocation() === HashLocation)\n return '#' + path;\n\n return path;\n}", "function get_url(element) {\r\n\r\n if (element.length > 0) {\r\n GM_log(element.length);\r\n var rhapURL = \"\"\r\n // Remove punctuation but leave the accented chars\r\n , match_re2 = new RegExp(/_|[^\\w\\dáÁâÂàÀåÅãÃäÄæÆçÇðÐéÉêÊèÈëËíÍîÎìÌïÏñÑóÓôÔòÒøØõÕöÖßþÞúÚûÛùÙüÜýÝÿ\\s]+/g)\r\n // Below is a list of special cases where accented characters become anglicized\r\n // Unfortunately Rhapsody.com is not always consistent when dealing with some chars \r\n // especially the & sign. Sometimes it's removed and sometimes changed to \"and\".\r\n , match_re4 = new RegExp(/ñ/g)\r\n , match_re5 = new RegExp(/à|á|a|â|ã|ä|å/g)\r\n , match_re6 = new RegExp(/&amp|\\band\\b/g)\r\n , match_re7 = new RegExp(/é|è|ê|ë/g)\r\n , match_re8 = new RegExp(/ó|ó|ô|õ|ö|ø/g)\r\n , match_re9 = new RegExp(/ì|í|î|ï/g)\r\n , match_re10 = new RegExp(/ù|ú|û|ü/g)\r\n , match_re11 = new RegExp(/ç/g);\r\n\t \r\n artist = $.trim($(element).find('a[href*=\"/artists\"]')\r\n .html()\r\n .toLowerCase()\r\n .replace(/\\bep\\b$|\\bost\\b$/, \"\")\r\n .replace(/&amp;/, \" and \")\r\n .replace(match_re4, \"n\")\r\n .replace(match_re5, \"a\")\r\n .replace(match_re7, \"e\")\r\n .replace(match_re8, \"o\")\r\n .replace(match_re9, \"i\")\r\n .replace(match_re10, \"u\")\r\n .replace(match_re11, \"c\")\r\n .replace(match_re2, \"\")).replace(/\\s/g, '-');\r\n\r\n title = $.trim($(element).find('h2')\r\n .html()\r\n .toLowerCase()\r\n .replace(/\\bep\\b$|\\bost\\b$/, \"\")\r\n .replace(/&amp;/, \" and \")\r\n .replace(match_re4, \"n\")\r\n .replace(match_re5, \"a\")\r\n .replace(match_re7, \"e\")\r\n .replace(match_re8, \"o\")\r\n .replace(match_re9, \"i\")\r\n .replace(match_re10, \"u\")\r\n .replace(match_re11, \"c\")\r\n .replace(match_re2, \"\")).replace(/\\s/g, '-');\r\n\r\n var artSrchNm = 'http://www.rhapsody.com/search/artist/?query='+ artist.replace(/[\\-]+/g, '+');\r\n var albSrchNm = 'http://www.rhapsody.com/search/album/?query='+ title.replace(/[\\-]+/g, '+');\r\n\r\n rhapURL = 'http://www.rhapsody.com/artist/' + artist +'/album/'+ title;\r\n\r\n GM_log(\" Artist: \" + artist + \"\\n Title: \" + title + \"\\n URL: \" + rhapURL);\r\n\r\n GM_xmlhttpRequest({\r\n method: 'GET',\r\n url: rhapURL,\r\n headers: {\r\n 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',\r\n 'Accept': 'text/html',\r\n },\r\n \r\n onload: function(responseDetails) {\r\n var testArray = new Array();\r\n //GM_log(responseDetails.responseText);\r\n var testLen = testArray.length - 1;\r\n var testRe = new RegExp(/\\<meta content=\"music\\.album\"/); // Check the loaded response for album availability\r\n var testString = responseDetails.responseText;\r\n GM_log(testString.search(testRe));\r\n \r\n if (testString.search(testRe) != -1 && testArray[testLen] != \"success\") {\r\n tryConnecting(testString, rhapURL);\r\n testArray.pop();\r\n testArray.push(\"success\");\r\n GM_log(testArray[0]);\r\n } else if (testArray[0] != \"success\"){\r\n failFunc(artSrchNm, albSrchNm, rhapURL, testArray);\r\n }\r\n }\r\n });\r\n }\r\n}", "function addHrefToDom(href, id) {\nvar element = document.getElementById(id); //or grab it by tagname etc\nelement.href = href;\n}", "function clearHref() {\n return splitHref()[0];\n }", "function link(node) {\n var self = this;\n var content = self.encode(node.url || '', node);\n var exit = self.enterLink();\n var escaped = self.encode(self.escape(node.url || '', node));\n var value = self.all(node).join('');\n\n exit();\n\n if (\n node.title == null &&\n PROTOCOL.test(content) &&\n (escaped === value || escaped === 'mailto:' + value)\n ) {\n /* Backslash escapes do not work in autolinks,\n * so we do not escape. */\n return uri(self.encode(node.url), true);\n }\n\n content = uri(content);\n\n if (node.title) {\n content += ' ' + title(self.encode(self.escape(node.title, node), node));\n }\n\n return '[' + value + '](' + content + ')';\n}", "function getUrl(tr)\n{\n var links = tr.getElementsByTagName('a');\n if (links.length < 2)\n return null;\n var url = links[1].href;\n return url.substring(url.lastIndexOf('/') + 1);\n}", "function unitHref(m, n)\n {\n if (typeof m == 'undefined') {\n return ''\n } else if (typeof n == 'undefined') {\n return '#' + m\n } else {\n return '#' + m + '.' + n\n }\n }", "function findLink(text) {\n var urlRegex =/(\\b(https?|ftp|file):\\/\\/[-A-Z0-9+&@#\\/%?=~_|!:,.;]*[-A-Z0-9+&@#\\/%=~_|])/ig;\n return text.replace(urlRegex, function(url) {\n return '<a href=\"' + url + '\">' + url + '</a>';\n });\n}", "function anchorFromLinkPath(linkPath) {\n // They pass a string like \"https://google.com\"\n // And I give them the DOM element equivalent\n // of <a href=\"https://google.com\">https://google.com</a>\n const link = document.createElement(\"a\");\n link.href = linkPath;\n link.textContent = linkPath;\n return link;\n}", "track() {\n return this.reference('href');\n }", "function rtpost(link) {\r\n\tlink.href = link.href.replace(/%D0%9/g,\"%C\");\r\n\tlink.href = link.href.replace(/%D0%A/g,\"%D\");\r\n\tlink.href = link.href.replace(/%D0%B/g,\"%E\");\r\n\tlink.href = link.href.replace(/%D1%8/g,\"%F\");\r\n}", "function UtilHref(util, text)\r\n\t{\r\n\t\treturn '<a href=\"#\" onclick=\"dp.sh.Utils.' + util + '(this); return false;\">' + text + '</a>';\r\n\t}", "function getHref () {\n if (\n props.lang &&\n isRelative(props.href) &&\n !props.isStatic(props.href) &&\n !props.href.match(new RegExp(`^/${props.lang}(/?|/.*)$`)) &&\n !props.href.match(/^(#|\\?)/)\n ) {\n return `/${props.lang}${props.href}`\n }\n\n return props.href\n }", "function createLink(href, text){\n var link = document.createElement('a');\n link.href = href;\n link.innerText = text;\n link.target = '_blank';\n return link;\n}", "function formAnchorHtml(href, label) {\r\n\treturn \"<div class='linkContainer'>\" + label + \": <a href='\" + href + \"' target='_blank'>\" + href + \"</a></div>\";\r\n}", "function getStudentURL(row) {\n\tvar anchorElemArr = row.getElementsByTagName('a');\n\n\tif (anchorElemArr.length < 1) {\n\t\treturn -1;\n\t} else {\n\t\t// usually there will be 2 [from Name & from 'View Profile'] so return 1 href\n\t\treturn anchorElemArr[0].href;\n\t}\n}", "function icm_link (src) {\r\n var a = $x(\"id('content')//ul//a\", src);\r\n if(a.length == 1 && a[0].href.indexOf(\"http://www.imdb.com\") == -1)\r\n return 'http://icheckmovies.com'+a[0].href;\r\n}", "function appendToLinks() {\n let snapTextElements = document.evaluate(\"//a[contains(translate(@href, 'HTTP', 'http'), 'http') and contains(@href, 'assetstore.unity')]\",\n document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\n for (let i = snapTextElements.snapshotLength - 1; i >= 0; i--) {\n let elmLink = snapTextElements.snapshotItem(i);\n let latest = $(elmLink).attr('href').split('/').pop().trim();\n let data_id = Number.isInteger(latest) ? latest : latest.split('-').pop().trim();\n $(elmLink).wrap(`<span class=\"unitystore-holder\" data-id=\"${data_id}\"></span>`);\n $(elmLink).addClass('unitystore-link');\n }\n }", "linkName(link){\n\t\tlet linkSplit = link.split(\"/\");\n\t\treturn linkSplit[2];\n\t}", "function markupHyperLinks(str){\n\t\t\t\tvar reg = new RegExp(/[-a-zA-Z0-9@:%_\\+.~#?&//=]{2,256}\\.[a-z]{2,4}\\b(\\/[-a-zA-Z0-9@:%_\\+.~#?&//=]*)?/gi);\n\t\t\t\tvar match = str.match(reg);\n\t\t\t\tvar res = \"\";\n\t\t\t\tif(match != null)\n\t\t\t\t\tmatch.forEach(\n\t\t\t\t\t\tfunction(e){\n\t\t\t\t\t\t\tvar tmp = str.split(e)[0];\n\t\t\t\t\t\t\tif(tmp != \"\")\n\t\t\t\t\t\t\t\tres += \"<pre>\" + tmp + \"</pre>\";\n\t\t\t\t\t\t\tvar m = e.match(new RegExp(/.*jpg|.*bmp|.*gif|.*png|.*jpeg/));\n\t\t\t\t\t\t\tif(m != null && m.indexOf(e) != -1)\n\t\t\t\t\t\t\t\tres += \"<img style='width:100px; height:auto' src='\" + e + \"'></img>\";\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tres += \"<a href='\" + e + \"'>\" + e + \"</a>\";\n\t\t\t\t\t\t\tvar i = str.indexOf(tmp + e) + (tmp + e).length;\n\t\t\t\t\t\t\tstr = str.substring(i,str.length);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\tif(str != \"\")\n\t\t\t\t\tres += \"<pre>\" + str + \"</pre>\"\n\t\t\t\tconsole.log(res);\n\t\t\t\treturn res;\n\t\t\t}", "function translateHyperLink(code, transMgr)\n{\n\tvar translation = designerMgrTranslate(code, \"\", false, true);\n\tif (translation.useMacRendering)\n\t{\n\t\tvar text = TranslationManager.getAttributeValue(code, \"text\");\n\t\tif (text != \"\")\n\t\t\ttranslation.string = \"<a href=\\\"\\\">\" + text + \"</a>\";\n\t\telse\n\t\t{\n\t\t\tvar imageUrl = TranslationManager.getAttributeValue(code, \"imageurl\");\n\t\t\tif (imageUrl != \"\")\n\t\t\t\ttranslation.string = \"<a href=\\\"\\\"><img src=\\\"\" + imageUrl + \"\\\"/></a>\";\n\t\t\telse\n\t\t\t\ttranslation.string = \"<a href=\\\"\\\">[ASP:HYPERLINK]</a>\";\n\t\t}\n\t}\n\treturn makeAsIsTranslation(translation.string);\n}", "generateLink() {\n return `\n <a href='https://en.wikipedia.org/wiki/${encodeURI(this.options[0])}' property='rdf:seeAlso'>\n ${this.options[0]}\n </a>&nbsp;\n `;\n }", "function branchHyperlink(ix){\n var br = tx.rowinfo[ix].br\n var dest = tx.baseUrl + \"/timeline?r=\" + encodeURIComponent(br)\n dest += tx.fileDiff ? \"&m&cf=\" : \"&m&c=\"\n dest += encodeURIComponent(tx.rowinfo[ix].h)\n return dest\n }", "function ablinks() {\n // Auto Build links list items from bare a-tag source code 20171128\n var k = 0;\n var libs = document.getElementsByClassName('linkpool');\n for (var i = 0; i < libs.length; i++) {\n var lib = libs[i];\n var links = lib.childNodes;\n for (var j = 0; j < links.length; j++) {\n var a = links[j];\n if (a.innerHTML === '') {\n if (a.className !== '') {\n a.className = a.className + ' ali';\n } else {\n a.className = 'ali';\n }\n if (a.title !== '') {\n a.innerHTML = '&bull;&nbsp;' + a.title;\n } else {\n a.innerHTML = a.href;\n }\n a.target = '_blank';\n k = k + 1;\n }\n }\n }\n return k;\n}", "function link(mail) {\n\t\t\treturn mail.permalink\n\t\t}", "function nodeLinks(baseUrl, nodePath, addColonAtEnd) {\n var node_url = baseUrl;\n var span = $('<span/>');\n for (var i in nodePath) {\n node_url += '/' + nodePath[i];\n span.append($('<a>').attr('href', node_url).append(nodePath[i]));\n if (i < nodePath.length - 1) {\n span.append(' / ');\n } else if (addColonAtEnd) {\n span.append(': ');\n }\n }\n return span;\n}", "function createLink(url,text){\r\n\treturn \"<a href=\\\"\"+url+\"\\\"\"+Target+\">\"+text+\"</a>\";\r\n}", "function parseAutomaticLinks()\n{\n\tlet m, regexp = /<[-+.\\w]+([:@])[^\\x17\\s>]+?(?:>|\\x1B7)/g;\n\twhile (m = regexp.exec(text))\n\t{\n\t\t// Re-escape escape sequences in automatic links\n\t\tlet content = decode(m[0].replace(/\\x1B/g, \"\\\\\\x1B\")).replace(/^<(.+)>$/, '$1'),\n\t\t\tstartPos = m.index,\n\t\t\tendPos = startPos + m[0].length - 1,\n\n\t\t\ttagName = (m[1] === ':') ? 'URL' : 'EMAIL',\n\t\t\tattrName = tagName.toLowerCase();\n\n\t\taddTagPair(tagName, startPos, 1, endPos, 1).setAttribute(attrName, content);\n\t}\n}", "function extractHref(element) {\n const anchors = $(element).find(\"a\");\n\n if (anchors.length === 1) {\n // The href is hidden in a template, so we have to do some voodoo\n return $($(element).find(\"template\").prop(\"content\"))\n .find(\"a\")\n .attr(\"href\");\n }\n\n // Otherwise it's pretty simple\n return $(anchors[1]).attr(\"href\");\n}", "function do_links( link_snap, get_char, header ) {\r\n var link_letter_order = []\r\n\r\n\r\n for( var i = 0; i< link_snap.snapshotLength; i++ ) {\r\n var link = link_snap.snapshotItem(i)\r\n\r\n var char = get_char(link)\r\n\r\n if( ! char ) continue\r\n\r\n // if the char is different from the last char...\r\n if( link_letter_order.length == 0 || char != link_letter_order[link_letter_order.length-1] ) {\r\n link_letter_order.push( char )\r\n\r\n var s = $e('div')\r\n s.style.background = '#aaa'\r\n s.style.borderTop = 'solid #777 1px'\r\n\r\n s.style.padding = '3px'\r\n s.style.marginTop = '20px'\r\n s.style.marginBottom = '-7px'\r\n\r\n s.innerHTML = \" &middot; \"\r\n\r\n var a = mk_link(char)\r\n a.name = char\r\n\r\n var top = mk_link('^top')\r\n top.target = '_self'\r\n\r\n\r\n s.appendChild( a )\r\n s.appendChild( $t(' ') )\r\n s.appendChild( top )\r\n\r\n var br = $e('br')\r\n\r\n link.parentNode.insertBefore(br,link)\r\n link.parentNode.insertBefore(s,br)\r\n \r\n /* link.parentNode.insertBefore($e('hr'),s) */\r\n }\r\n }\r\n\r\n for( var j=0; j<link_letter_order.length; j++ ) {\r\n var char = link_letter_order[j]\r\n header.innerHTML += \" <a href='#\" + char + \"' target='_self' style='color:#999'>\" + char + \"</a>\"\r\n }\r\n}", "function fn_createlink(strImgLink)\r\n{\r\n\tvar tempCode;\r\n\ttempCode = \"<a href = \" + chr(34) + strImgLink + chr(34) + \"> View </a>\";\r\n\treturn tempCode + Chr(10);\r\n}", "function fmtInlineLink(str, url, sameTab) {\n const a = $('<a>').attr(\"href\", url).html(str);\n if (sameTab) { return a.prop('outerHTML'); }\n else { return a//.attr(\"target\", \"_blank\")\n .prop('outerHTML'); }\n}", "function highlightURL(str) {\n if (!str) return;\n var tempArr = str.split(\" \");\n var retString = '';\n return tempArr.reduce(function(acc, value) {\n\t\tvar temp;\n if (isURL(value)) {\n temp =acc + ' \\<span class=\"isLink\"\\>' + value + '\\<\\/span\\> ';\n } else {\n temp= acc + ' ' + value + ' ';\n }\n\t\treturn temp;\n }, '');\n}", "function pagerHomePageLink() {\n 'use strict';\n var link = document.createElement('div');\n link.id = 'pagerGoHome';\n link.innerHTML = '<a href=\"../../\">Home</a>';\n return link;\n}" ]
[ "0.715427", "0.7025624", "0.7025624", "0.69692576", "0.6806277", "0.6662019", "0.65937364", "0.65353584", "0.6448026", "0.6439492", "0.6422836", "0.6420274", "0.6417747", "0.63884336", "0.63637036", "0.6358394", "0.63380945", "0.63355356", "0.6295218", "0.62860197", "0.62860197", "0.6273329", "0.62477094", "0.62424004", "0.6217682", "0.61814284", "0.61787707", "0.6169711", "0.6169117", "0.61534464", "0.61395025", "0.6131558", "0.6130997", "0.61248785", "0.61172205", "0.6114589", "0.60869735", "0.6070812", "0.60612273", "0.6047616", "0.60460365", "0.6038426", "0.6023539", "0.6007092", "0.6004764", "0.5998973", "0.59861803", "0.59744024", "0.5969278", "0.5964255", "0.59567654", "0.59551966", "0.592957", "0.59273386", "0.5927029", "0.5924394", "0.5907798", "0.59051305", "0.5898095", "0.58910406", "0.5886365", "0.5886339", "0.58828896", "0.5882175", "0.5874016", "0.58537406", "0.5850184", "0.58412707", "0.58351743", "0.58346146", "0.58296496", "0.5827003", "0.58209044", "0.5816231", "0.5809461", "0.5809366", "0.57955456", "0.5788401", "0.57845163", "0.57804376", "0.57783884", "0.5777695", "0.5776209", "0.57755446", "0.5771832", "0.5769984", "0.57670605", "0.5757072", "0.5747679", "0.5746968", "0.5725764", "0.5724314", "0.5722301", "0.5721961", "0.5710548", "0.5709793", "0.57014084", "0.5690262", "0.5688807", "0.56853837", "0.5684926" ]
0.0
-1
it tells the store what specific parts it needs to be notified of when a change occurs so they can update state accordingly and rerender; this is how the App component subscribes to the store this func and Provider make it possible to render new state;
function mapStateToProps(state) { return { chores: state.chores } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Provider({ store, children }) {\n //console.log(\"STORE_PROVIDER_IS_ACTIVEs\");\n\n const [state, setState] = React.useState(\n store.getState()\n );\n React.useEffect(\n () =>\n store.subscribe(() => {\n\n //console.log(\"REDUX_STORE_IS_ACTIVEs\");\n\n const lastState = store.getState();\n //if a lot of setState calls are made synchronously\n // do not update dom but let it batch update state\n // before triggering a render\n Promise.resolve().then(() => {\n if (lastState === store.getState()) {\n setState(store.getState());\n }\n });\n }),\n [store]\n );\n}", "onStoreChange() {\n this.setState(this._getStateFromStore);\n }", "render() {\n return (\n <Provider store={this.props.store}>\n <AppWithNavigationState />\n </Provider>\n );\n }", "render() {\n\n return (\n <Provider store={Store}>\n <MainPage />\n </Provider>\n )\n\n }", "componentDidMount() {\n this.context.store.subscribe(this.handleChange)\n }", "storeChanged(){\n this.setState(this.getState());\n }", "componentDidMount(){\n AppStore.addChangeListener(this._onChange.bind(this))\n }", "componentDidMount () {\n Store.addChangeListener(this.onChange)\n }", "componentDidMount() {\n this.props.store.subscribe(this.handleChange)\n }", "render(){\n return(\n <Provider store={store}>\n <Container/>\n </Provider>\n )\n }", "componentDidMount() {\n PersonStore.listen(this.onStoreChange);\n }", "render() {\n if (!this.state.isReady) {\n return <AppLoading />;\n }\n return (\n //Provider, the go-between for React and Redux, creates store,\n //imports reducers, and applies Redux-Thunk for using promises\n <Provider \n store={createStore(reducers, { }, applyMiddleware(Thunk))}\n >\n {/* Router component determines which 'page' of app is shown */}\n <Router />\n </Provider>\n );\n }", "_subscribeProviderType () {\n this.network.providerStore.subscribe(() => {\n const { tokens } = this._getTokenRelatedStates()\n this.store.updateState({ tokens })\n })\n }", "handleStoreChange_() {\n\t\t\t\tconst storeState = this.getStore().getState();\n\n\t\t\t\tconst {storeProps_} = this;\n\t\t\t\tconst newStoreProps = this.getStoreProps_(storeState);\n\n\t\t\t\tif (newStoreProps && !object.shallowEqual(storeProps_, newStoreProps)) {\n\t\t\t\t\tthis.hasStorePropsChanged_ = true;\n\t\t\t\t\tthis.storeProps_ = newStoreProps;\n\t\t\t\t}\n\n\t\t\t\tthis.state.storeState = storeState;\n\t\t\t}", "onStateChange() {\n\t\t// brute force update entire UI on store change to keep demo app simple\n\t\tthis.forceUpdate();\n\t}", "render(){\r\n return(\r\n <Provider store={store}>\r\n <DisplayMessages />\r\n </Provider>\r\n )\r\n }", "onStoreChange() {\n this.setState({\n messages: store.getState().messages,\n users: store.getState().users\n });\n }", "componentDidMount(){\n // Attach main listener\n this.store.addListener(this.onStateChange.bind(this));\n // Initial call\n this.onStateChange();\n }", "function App() {\n return (\n <Provider store={store}>\n <CounterContainer />\n </Provider>\n )\n}", "constructor(props) {\n super(props);\n this.onStoreChange = this.onStoreChange.bind(this);\n this.state = this._getStateFromStore()\n }", "function App (props) {\n Component.call(this, props)\n this.state = {\n storeState: props.store()\n }\n}", "componentDidMount() {\n ButtonStore.addChangeListener(this._onChange);\n AuthStore.addChangeListener(this._onChange);\n }", "createStore() {\n return {\n update: (_ref) => {\n let { id, msg, fields } = _ref;\n\n if (msg === \"added\" || msg === \"changed\") {\n this.set(id, fields);\n }\n },\n };\n }", "storeChangeHandler() {\n this.setState({\n items: ItemStore.get('items'),\n loading: ItemStore.get('loading'),\n });\n }", "onStateChange(){\n this.setState(this.store.getState());\n }", "componentDidMount () {\n PageStore.addChangeListener(this._onChange);\n InsightsStore.addChangeListener(this._onChange);\n }", "constructor() {\n super();\n this.lastTechnology = '';\n this.totalClicks = 0;\n\n //Subscribe the component to the store.\n //If the state changes, it will run the code inside the function\n store.subscribe(() => {\n this.handleUpdatedState(store.getState());\n });\n }", "function App() {\n const reducer = combineReducers({\n moduleReducer: moduleReducer,\n lessonReducer: lessonReducer,\n topicReducer: topicReducer,\n widgetReducer: widgetReducer,\n questionReducer: questionReducer,\n quizReducer: quizReducer\n })\n \n // const store = createStore(moduleReducer)\n // const store = createStore(lessonReducer)\n const store = createStore(reducer)\n return (\n <Provider store={store}>\n <BrowserRouter>\n <div className=\"container-fluid\">\n <CourseManager/>\n </div>\n </BrowserRouter>\n </Provider>\n );\n}", "function observeStore(store) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n var onChange = args.pop();\r\n var selectors = args;\r\n var currentState;\r\n function handleChange() {\r\n var nextState = __WEBPACK_IMPORTED_MODULE_0_lodash__[\"map\"](selectors, function (f) { return f(store.getState()); });\r\n var stateChanged = __WEBPACK_IMPORTED_MODULE_0_lodash__(nextState)\r\n .zip(currentState)\r\n .some(function (_a) {\r\n var x = _a[0], y = _a[1];\r\n return x !== y;\r\n });\r\n if (stateChanged) {\r\n currentState = nextState;\r\n onChange.apply(void 0, currentState);\r\n }\r\n }\r\n var unsubscribe = store.subscribe(handleChange);\r\n handleChange();\r\n return unsubscribe;\r\n}", "render() {\n return (\n <Provider store={store}>\n <AppNavigator />\n </Provider>\n )\n }", "componentWillMount() {\n SupplierStore.addChangeListener(EventTypes.ADD_SUPPLIER_EVENT, this.cb_onAddSupplierResult);\n SupplierStore.addChangeListener(EventTypes.UPDATE_SUPPLIER_EVENT, this.cb_onUpdateSupplierResult);\n }", "onStoreChange(event) {\n this.scheduler.onInternalEventStoreChange(event);\n }", "onStoreChange(event) {\n this.scheduler.onInternalEventStoreChange(event);\n }", "addStore(store) {\n // keep a reference to the store to easy access\n this[store.constructor.name] = store\n // fetch all the store's state and put in the superStore\n for (let key in store.state) {\n Vue.set(this.state, key, store.state[key])\n }\n //override state pointer of the store with the global one -> make the store stateless\n store.state = this.state // -> is it dangerous?\n // register the store's reducer in the global dispacher\n store._dispachToken = this.dispatcher.register(store.reduce.bind(store))\n // take all the actions from the store and pass to them the dispacher and the store as a context\n Object.assign(this.actions, store.actions(this.dispatcher, store))\n // make a ref to the superStore\n store.sStore = this\n }", "_handleComponentChange() {\n this.setState(this._getStateFromStore());\n }", "componentDidUpdate() {\n this.store.set(this.state)\n }", "function App() {\n return (\n <Provider store={store}>\n <Navigator />\n </Provider>\n );\n}", "onStoreChange( callbackFn = ()=>{} ) {\n \n }", "bindStore(store) {\n store.on({\n name: storeListenerName$1,\n refresh: 'onStoreDataChange',\n idChange: 'onStoreRecordIdChange',\n update: 'onStoreUpdateRecord',\n add: 'onStoreAdd',\n remove: 'onStoreRemove',\n move: 'onStoreMove',\n replace: 'onStoreReplace',\n removeall: 'onStoreRemoveAll',\n beforerequest: 'onStoreBeforeRequest',\n afterrequest: 'onStoreAfterRequest',\n clearchanges: 'onStoreDataChange',\n exception: 'onStoreException',\n commit: 'onStoreCommit'\n }, this);\n }", "componentWillMount(){\n\t\tItemsStore.on(\"change\", this.getItems);\n\t}", "_onChange(){\n\t\tlog(\"Home Component received change event from App store\", DEBUG);\n\n this.state.events = AppStore._getEvents();\n this.setState(this.state);\n //log(\"Updated this.state.events: \" + JSON.stringify(this.state.events['future_events']),DEBUG);\n }", "storeChangeHandler() {\n this.setState({\n list: WeatherStore.get(['data', 'list']),\n city: WeatherStore.get(['data', 'city']),\n loading: WeatherStore.get('loading'),\n });\n }", "function App() {\n return (\n <Provider store={store}>\n <div className=\"App\">\n <TopNavigation></TopNavigation>\n <FeaturedSlider></FeaturedSlider>\n <ProductCardList></ProductCardList>\n <ProductModal></ProductModal>\n </div>\n </Provider>\n );\n}", "bindStore(store) {\n const me = this;\n\n me.storeDetacher = store.on(\n {\n refresh: me.onStoreDataChange,\n update: me.onStoreUpdateRecord,\n add: me.onStoreAdd,\n remove: me.onStoreRemove,\n move: me.onStoreMove,\n replace: me.onStoreReplace,\n removeall: me.onStoreRemoveAll,\n loadstart: me.onStoreLoadStart,\n afterrequest: me.onStoreAfterRequest,\n clearchanges: me.onStoreDataChange,\n exception: me.onStoreException\n },\n me\n );\n }", "function _publishStore () {\n if (Object.values(storeCallbacks).length > 0) {\n Object.values(storeCallbacks).forEach(function (callback) {\n callback(Object.assign({}, store));\n })\n }\n }", "function App() {\n return (\n <Provider store={createStoreWithMiddleware(rootReducer)}>\n <div className=\"main\">\n <BrowserRouter>\n <Routes />\n </BrowserRouter>\n </div>\n </Provider>\n\n\n );\n}", "componentDidMount() {\n //AppStore.addChangeListener(this._onChange);\n\n // load categories & technologies\n this.loadcategories();\n this.loadtechnologies(); \n\n // Function to locations of events available\n this.loadLocations(); \n\n }", "function mapStateToProps(state) {\n return {\n // addsDataFromStore : state.Adds_Data_Updater,\n \n };\n}", "function mapStateToProps(state){\n return {store: state}\n}", "componentDidMount() {\n ListStore.addChangeListener(this._onChange.bind(this));\n }", "componentWillMount() {\n this.context.store.subscribe(() => {\n let state = this.context.store.getState().currentSelections;\n this.setState({\n windowPosition: state.position,\n showInfoWindow: state.showInfoWindow,\n current_name: state.key\n });\n });\n }", "function mapStateToPros(state){\n //So take state from store and pass to components as props\n return{\n trainers:state.trainers\n }\n}", "onStateUpdate(subscriberFn) {\n stateEventEmitter.on(`${storeName}-${storeEvents.STATEUPDATED}`, (newState) => subscriberFn(newState));\n }", "bindCrudStoreListeners(store) {\n store.on({\n name: 'store',\n change: 'onCrudStoreChange',\n thisObj: this\n });\n }", "componentDidMount() {\n this.subscriptionId = this.props.store.subscribe(this.onStoreChange);\n this.props.store.startClock();\n }", "componentWillMount(){\n\t\tSTORE.on('dataUpdated', ()=> {\n\t\t\tthis.setState(STORE.data)\n\t\t})\n\t}", "componentWillMount(){\n let $this = this;\n FoodStore.on(\"change\", function(){\n $this.setState({results: FoodStore.getAll() });\n });\n }", "componentDidMount() {\n store.subscribe(()=> this.forceUpdate());\n }", "function App() {\n const [state, dispatch] = useReducer(rootReducer, initalState);\n\n return (\n <Router>\n <Provider value={{ state, dispatch }}>\n <div>\n <Navbar />\n <Cart />\n <WishList />\n <Alert />\n <Switch>\n <Route exact path={'/'} component={Home}></Route>\n <Route exact path={'/men'} render={() => { return <Products sexFitFilter=\"men\" /> }}></Route>\n <Route exact path={'/women'} render={() => { return <Products sexFitFilter=\"women\" /> }}></Route>\n <Route exact path={'/checkout'} component={Checkout}></Route>\n <Route path={'/product/:id'} component={SingleProduct}></Route>\n </Switch>\n <Footer />\n </div>\n </Provider>\n </Router>\n );\n}", "initialize(initProps) {\n this.bind(_appStore, this.onStoreUpdate.bind(this));\n }", "onStoreDataChange(data) {\n const store = data.source;\n\n // Grouping mixin needs to process data which then makes sure UI is refeshed\n if (store.isGrouped && store.count > 0) return;\n\n this.overridden.onStoreDataChange(data);\n }", "componentDidMount() {\n NetInfo.isConnected.addEventListener('change', (isConnected) => {\n this.props.store.dispatch(ActionCreators.setConnectivity(isConnected));\n });\n }", "function App() {\n return (\n <Provider store={store}>\n <div className=\"App\">\n <CounterApp />\n </div>\n </Provider>\n );\n}", "function configureStore() {\n\t return createStore(rootReducer)\n\t /*\n return createStore(\n //combineReducers(rootReducer),\n\t\tmovieReducer,\n compose(\n applyMiddleware(...middleware),\n window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()\n )\n );\n\t*/\n}", "function App() {\n useEffect(() => {\n TasksService.observerTasks(snap => {\n const allTasks = snap.docs.map(element => element.data());\n store.dispatch(saveDataFromFirebase(allTasks));\n });\n }, []);\n\n return (\n <Provider store={store}>\n <Layout style={{ minHeight: \"100%\" }}>\n <HeaderComponent />\n <Content>\n <Router>\n <Home path=\"/\" />\n <Done path=\"/done\" />\n <Error404 default />\n </Router>\n </Content>\n <Footer className=\"app-footer\">Created by Julian Valencia</Footer>\n </Layout>\n </Provider>\n );\n}", "_stateChanged(state) {\n this._products = state.shop.products;\n }", "_handleChange() {\n if (this._renderType == SERVER) {\n // We don't need to trigger any subscription callback at server. We'll\n // render twice and we're only interested in the HTML string.\n return;\n }\n\n var timestamp = this._getTimestamp();\n var state = this._store.getState();\n if (this._previousState.state == null) {\n // If no change, no need to trigger callbacks.\n this._setPreviousState(state, timestamp);\n return;\n }\n\n // Assume comparison is cheaper than re-rendering. We do way more comparison\n // when we compare each piece, with the benefits of not doing unnecessary\n // re-rendering.\n var segmentName, segment, segmentState, prevSegmentState, segmentSubscribers,\n queryId, querySubscribers, subscriberId, segmentPiece, shouldUpdate;\n for (segmentName in this._segments) {\n if (!this._segments.hasOwnProperty(segmentName)) continue;\n segment = this._segments[segmentName];\n segmentSubscribers = this._subscribers[segmentName];\n segmentState = state[segmentName];\n prevSegmentState = this._previousState.state[segmentName];\n for (queryId in segmentSubscribers) {\n if (!segmentSubscribers.hasOwnProperty(queryId)) continue;\n querySubscribers = segmentSubscribers[queryId];\n // If segmentState is previously null, then this is a new query call.\n // First getState() method call should already return the initialized\n // object, so we don't need to call update.\n // TODO: This assumption/design seems to be flawed, null to existence is a change, and we should notify listeners.\n shouldUpdate = false;\n if (prevSegmentState != null) {\n segmentPiece = segment._comparePiece(prevSegmentState, segmentState, queryId);\n shouldUpdate = segmentPiece != null;\n }\n if (shouldUpdate) {\n // Segment piece has changed, call all registered subscribers.\n for (subscriberId in querySubscribers) {\n if (!querySubscribers.hasOwnProperty(subscriberId)) continue;\n querySubscribers[subscriberId](segmentPiece[0]);\n }\n }\n }\n }\n\n // Update previous state.\n this._setPreviousState(state, timestamp);\n }", "componentDidMount() {\n\t\t// redraw on change\n\t\tconst updateReact = (mystate) => this.setState({});\n\t\tDataStore.addListener(updateReact);\n\t}", "function App() {\n return (\n <div className=\"App\">\n <Provider store={store}>\n <AppRouter />\n </Provider>\n </div>\n );\n}", "render() {\n\t\t\t\tif (shouldSubscribe && !this.unsubscribeStore_) {\n\t\t\t\t\tthis.unsubscribeStore_ = this.getStore().subscribe(\n\t\t\t\t\t\tthis.handleStoreChange_.bind(this)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn <WrappedComponent {...this.getChildProps_()} />;\n\t\t\t}", "_onStore () {\n if (this.destroyed) return\n this._debug('on store')\n\n // Start discovery before emitting 'ready'\n this._startDiscovery()\n\n this.ready = true\n this.emit('ready')\n\n // Files may start out done if the file was already in the store\n this._checkDone()\n\n // In case any selections were made before torrent was ready\n this._updateSelections()\n }", "_onStore () {\n if (this.destroyed) return\n this._debug('on store')\n\n // Start discovery before emitting 'ready'\n this._startDiscovery()\n\n this.ready = true\n this.emit('ready')\n\n // Files may start out done if the file was already in the store\n this._checkDone()\n\n // In case any selections were made before torrent was ready\n this._updateSelections()\n }", "renderStore() {\n MainStore = <AgentStore props={this.props} />;\n return MainStore;\n }", "onRecieveChange() {\n ArticlesStore.on('change', this.getNewsArticles);\n }", "componentWillMount() {\n StateStore.on(\"ceils_updated\", this.setCeils);\n StateStore.on(\"ceils_clear\", this.clearCeils);\n StateStore.on(\"game_state\", this.gameState);\n }", "function mapStateToProps(store) {\n return {\n intl: store.intl,\n auth: store.auth\n };\n}", "function mapStateToProps(store) {\n return {\n intl: store.intl,\n foobar: \"it worked!\",\n appManager: (<AppManager />),\n currentAppId: getCurrentAppId(store),\n };\n}", "function App() {\n return (\n <StoreProvider>\n <div className = \"App\" >\n <NewItem />\n </div>\n </StoreProvider>\n );\n}", "componentDidMount() {\n this.listenTo(HearthstoneStore, this.updateDecks);\n }", "_onStore () {\n if (this.destroyed) return\n this._debug('on store')\n\n // Start discovery before emitting 'ready'\n this._startDiscovery()\n\n this.ready = true\n this.emit('ready')\n\n // Files may start out done if the file was already in the store\n this._checkDone()\n\n // In case any selections were made before torrent was ready\n this._updateSelections()\n\n // Start requesting pieces after we have initially verified them\n this.wires.forEach(wire => {\n // If we didn't have the metadata at the time ut_metadata was initialized for this\n // wire, we still want to make it available to the peer in case they request it.\n if (wire.ut_metadata) wire.ut_metadata.setMetadata(this.metadata)\n\n this._onWireWithMetadata(wire)\n })\n }", "connectedCallback(){\n this.state = {...this.state, ...initialState, prop: getAttrs(this)};\n const data = objectOnChange(this.state, () => {\n updateComputedState(this.state);\n if (dom.render(this.$root, this.state)) {\n opt.updated.call(this.context);\n }\n });\n \n this.disconnectStore = store(data);\n this.$root.innerHTML = dom.html;\n\n // context contains methods and properties to work on the element\n this.context = { ...methods, data, el: this.$root, prop: this.state.prop, $store: opt.$store}\n\n // Bind events\n bindEvents(this.$root, {...this.context, __$bindInput});\n\n // Initial setup + first rendering\n updateComputedState(this.state);\n dom.render(this.$root, this.state);\n opt.created.call(this.context);\n }", "function render(){\n ReactDOM.render(\n <Provider store={store}>\n <App/>\n </Provider>,\n document.getElementById('app')\n );\n}", "componentWillReceiveProps(newProps) {\n console.log(newProps);\n this.setState({\n initialData: newProps.dataStore\n }, () => {\n this.handleChange();\n });\n }", "componentDidMount() {\n userStore.on(\"change\", this.setCurrentUser);\n }", "function mapStateToProps(store) {\n return store;\n}", "function AppStore() {\n _classCallCheck(this, AppStore);\n\n var _this = _possibleConstructorReturn(this, (AppStore.__proto__ || Object.getPrototypeOf(AppStore)).call(this));\n\n _this.client = null;\n _this.commandLog = [];\n\n __WEBPACK_IMPORTED_MODULE_6__dispatcher__[\"a\" /* default */].register(function (action) {\n // this._log(`Sent action: ${JSON.stringify(action)}`);\n switch (action.actionType) {\n case __WEBPACK_IMPORTED_MODULE_7__constants_app_constants__[\"a\" /* default */].APP_CLIENT_SETUP:\n _this.connectAndSetupClient(action.loginOptions);\n break;\n\n case __WEBPACK_IMPORTED_MODULE_7__constants_app_constants__[\"a\" /* default */].APP_LOGIN:\n _this.connectAndSetupClient(action.loginOptions);\n if (_this.audioView) _this.audioView.resume();\n break;\n\n default:\n // nop\n }\n });\n\n // Register callback to handle app Actions\n __WEBPACK_IMPORTED_MODULE_9__sculpture_store__[\"a\" /* default */].on(__WEBPACK_IMPORTED_MODULE_3_anyware_lib_game_logic_sculpture_store___default.a.EVENT_CHANGE, function (changes, metadata) {\n _this.emitChange();\n setTimeout(function () {\n _this.client.sendStateUpdate(changes, metadata);\n _this._debug('Sent state update: ' + JSON.stringify(changes));\n }, 0);\n });\n _this.sculptureActionCreator = new __WEBPACK_IMPORTED_MODULE_4_anyware_lib_game_logic_actions_sculpture_action_creator___default.a(__WEBPACK_IMPORTED_MODULE_6__dispatcher__[\"a\" /* default */]);\n\n _this.audioInitialized = false;\n _this.audioView = new __WEBPACK_IMPORTED_MODULE_5_anyware_lib_views_audio_view___default.a(__WEBPACK_IMPORTED_MODULE_9__sculpture_store__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_8__config__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_6__dispatcher__[\"a\" /* default */]);\n _this.audioView.load(function (err) {\n if (err) {\n return console.log('AudioView error: ' + err);\n }\n _this.audioInitialized = true;\n console.log('Loaded sounds');\n });\n return _this;\n }", "componentDidMount() {\n // Subscribe to the store for updates\n weatherActions.initialize(); //initialize store\n }", "function mapStateToProps(store) {\n return {\n };\n}", "function mapStateToProps(store) {\n return {\n };\n}", "function App() {\n \n \n return (\n <div className=\"App\">\n <div className=\"count\">\n \n {/* <HookuseState/>\n <HookuseState2/>\n <UseStateArray/>\n <HookMouse/> */}\n {/* <MouseContainer/> */}\n <firstName.Provider value = {{name:\"pavan \" ,lastname:\"kmar\" , number:861545}}>\n \n <ConA/>\n \n </firstName.Provider>\n \n </div>\n </div>\n );\n}", "function App() {\n\n //init StepLength for 70bpm\n let initBeatLength = 60 / 70;\n let initStepLength = initBeatLength / 4;\n\n const [mainState, setMyState] = useState({\n viewBtnState: \"drums\",\n numberOfLoops: 2,\n currentTempo: 70,\n currentStepLength: initStepLength,\n guiDataObj: appDataStore\n });\n\n //console.log(mainState, \"mainstate from main App\");\n \n const panelViewHandler = (panelName) => {\n setMyState({...mainState,\n viewBtnState: panelName });\n };\n\n const onLoopChange = (loopValue) => {\n setMyState({...mainState, numberOfLoops: loopValue });\n };\n\n const onTempoChange = (selectedTempo) => {\n setMyState({ ...mainState, currentTempo: selectedTempo });\n //console.log(\"new tempo\", selectedTempo);\n\n let beatLength = 60 / selectedTempo;\n let newStepLength = beatLength / 4;\n setMyState({...mainState, currentStepLength: newStepLength });\n };\n\n //---------------------onPlayNotes----------------\n const onPlayNotes = (e) => {\n let sampleObj = sampleGetter();\n playNotes(sampleObj, mainState, mainState.guiDataObj);\n }\n\n const onStopNotes = () => {\n stopNotes();\n }\n\n return (\n <GlobalContext.Provider value={{mainState, setMyState}}>\n <div className=\"App appContainer\">\n <NavComponent\n stepLength={mainState.currentStepLength}\n numberOfLoops={mainState.numberOfLoops}\n\n onViewPanelSelect={panelViewHandler}\n loopHandler={onLoopChange}\n tempoHandler={onTempoChange}\n playNotesHandler={onPlayNotes}\n stopNotesHandler={onStopNotes}\n />\n\n <InfoHolder />\n <PatternContainer\n viewPanelState={mainState.viewBtnState}\n />\n </div>\n </GlobalContext.Provider>\n );\n}", "function mapStateToProps(store) {\n return {\n drafts: store.draftManagement,\n authentication: store.authentication,\n userManagement: store.userManagement,\n };\n}", "function useStore(store) {\n var _React$useState = react_default.a.useState(),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n rerender = _React$useState2[1];\n\n var memoizedState = react_default.a.useMemo(function () {\n return store.state;\n }, [store.state]);\n react_default.a.useEffect(function () {\n function syncState() {\n // do not re-render if state has not changed since call\n if (memoizedState !== store.state) {\n rerender({});\n }\n }\n\n function onChange() {\n syncState();\n } // Sync state and force re-render if store has changed\n // during Component mount cycle\n\n\n syncState(); // Subscribe to store changes\n\n store.subscribe(onChange); // Unsubscribe from store\n\n function cleanup() {\n store.unsubscribe(onChange);\n }\n\n return cleanup;\n }, [store]);\n return store;\n}", "componentWillMount() {\n // setState function modifies react component's own internal state\n // render function is called whenever state of the app changes\n store.describe(() => this.setState(store.getState()));\n }", "function App() {\n const [store, dispatch] = useReducer(reducer, initialState);\n\n return (\n <Context.Provider value={{ store, dispatch }}>\n <div className=\"App\">\n <h1>\n {store.easteregg\n ? \"Periodic Table of Memes\"\n : \"Periodic Table of Elements\"}\n </h1>\n <PeriodicTable />\n <EasterEgg />\n </div>\n </Context.Provider>\n );\n}", "handleUpdatedTopicStore( topicStore ) {\n\n this.setState( {\n isActive: this.props.id == topicStore.activeTopicId\n } );\n\n }", "function App() {\n\n const songListFromStore = useSelector(state => state.songs.songList);\n console.log(songListFromStore);\n\n\n // const [ song ] = useState(songListFromStore);\n\n\n return (\n <div className=\"App\">\n <Router>\n <div className=\"Navbar\">\n <NavLink to=\"/Home\">Home</NavLink>\n\n <NavLink to=\"/AddNewSong\">Add New Song</NavLink>\n\n <NavLink to=\"/songs\">List of Songs</NavLink>\n </div>\n <div >\n <Switch>\n <Route path=\"/Home\">\n <Home />\n </Route>\n <Route path=\"/songs\">\n <SongList songs={songListFromStore} />\n </Route>\n <Route path=\"/song/:songId\">\n <SongDetail songs={songListFromStore} />\n </Route>\n <Route path=\"/AddNewSong\">\n <AddNewSong songs={songListFromStore} />\n </Route>\n </Switch>\n </div>\n </Router>\n <div>\n <MessengerCustomerChat\n pageId=\"105409911443105\"\n appId=\"338273787600006\"\n htmlRef=\"<REF_STRING>\"\n />\n </div>\n </div>\n\n );\n}", "componentWillMount() {\n TasksStore.on(\"change\", this.getIsFetchingTasks);\n TasksStore.on(\"change\", this.getTasks);\n TasksActions.loadTasks();\n }", "onInternalEventStoreChange(params) {\n // Too early, bail out\n // Also bail out if this is a reassign using resourceId, any updates will be handled by AssignmentStore instead\n if (!this._mode || params.isAssign || this.assignmentStore.isRemovingAssignment) {\n return;\n }\n\n this.currentOrientation.onEventStoreChange(params);\n }", "onAlbumChange () {\n this.setState(getStateFromAlbumStore())\n }", "function RoomStore({ children }) {\n const [isLit, setLit] = useState(false);\n const toggleLight = () => {\n setLit(!isLit);\n };\n // Pass down the state and the onToggleLight action\n return (\n <RoomContext.Provider\n value={{\n isLit,\n onToggleLight: toggleLight\n }}\n >\n {children}\n </RoomContext.Provider>\n );\n}" ]
[ "0.69938886", "0.6726515", "0.6695996", "0.6692172", "0.66502285", "0.6575116", "0.65651673", "0.6422997", "0.639718", "0.63311505", "0.6317546", "0.6312911", "0.62977636", "0.62741876", "0.62570065", "0.61951196", "0.6181496", "0.6161795", "0.6138613", "0.61331934", "0.61126846", "0.61085194", "0.6106276", "0.610062", "0.60927385", "0.6080862", "0.6065511", "0.6059345", "0.600442", "0.5992131", "0.5953233", "0.59190726", "0.59190726", "0.59178865", "0.59172434", "0.5916924", "0.5899798", "0.58769035", "0.58631545", "0.5825053", "0.58220434", "0.5820599", "0.5781519", "0.5777441", "0.5752388", "0.57522714", "0.57391876", "0.5738283", "0.57278967", "0.57168454", "0.571025", "0.5682721", "0.567353", "0.56692916", "0.5667735", "0.5660843", "0.5656785", "0.5648218", "0.56400067", "0.5628096", "0.5627013", "0.56258583", "0.5624669", "0.5623233", "0.5609327", "0.5601164", "0.55859214", "0.5584397", "0.5571517", "0.5560304", "0.5553956", "0.5553956", "0.55489457", "0.5544291", "0.55440116", "0.55430436", "0.55405664", "0.5533029", "0.5523536", "0.55199796", "0.55185467", "0.55113655", "0.5510142", "0.55077994", "0.5493421", "0.54825795", "0.5475109", "0.54712474", "0.54712474", "0.54702795", "0.54580295", "0.54565686", "0.5449603", "0.544611", "0.54451627", "0.5433067", "0.54255545", "0.54191446", "0.54183793", "0.54141146", "0.54070264" ]
0.0
-1
Anything returned from this function will end up as props on the PromoForm container
function mapDispatchToProps(dispatch) { // Whenever selectBrand is called, the result // should be passed to all of our reducers. return bindActionCreators({selectBrand, selectPromotion, selectSlot, selectFullPromo, editFields}, dispatch); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getProps() {\n let result = super.getProps();\n result.label = result.label ? result.label : '';\n result.inputStyle = result.inputStyle ? result.inputStyle : {};\n result.containerStyle = result.containerStyle ? result.containerStyle: {};\n result.labelStyle = result.labelStyle ? result.labelStyle: {};\n result.inputClass = result.inputClass ? result.inputClass: 'form-control';\n result.labelClass = result.labelClass ? result.labelClass: 'control-label col-sm-2';\n result.containerClass = result.containerClass ? result.containerClass : ( result.label ? \"col-sm-10\" : \"col-sm-12\" );\n result.errorClass = result.errorClass ? result.errorClass: 'error';\n result.onChange = result.onChange ? result.onChange : result.ownerProps.changeItemField;\n result.value = result.value ? result.value : '';\n return result;\n }", "renderForm() {\n\t\treturn (\n\t\t\t<div className=\"note\" \n \t style={this.style}>\n \t<textarea ref=\"newText\" defaultValue={this.props.children}></textarea>\n \t<button onClick={this.handleSave}>SAVE</button>\n </div>\n\t\t);\t\n\t}", "render(){\n //generate props to pass to UI\n const props = this._generateProps()\n\n return( <SignupForm { ...props } submitHandler = {this.submitHandler} handleChange = {this.handleChange}/>);\n }", "render() {\n // Passes/Declares props to drop \"this.props\" within the html\n let { change, handleReturnChange } = this.props;\n\n // Returns the html for the Change Form\n return (\n <Container id=\"changeContainer\">\n <Form>\n <div>\n <h2>Change</h2>\n <Form.Group>\n <Form.Control\n as=\"textarea\"\n rows={2}\n type=\"text\"\n readOnly\n id=\"changeInputBox\"\n value={change}\n />\n </Form.Group>\n <Form.Group>\n <Row>\n <Button\n type=\"button\"\n id=\"returnChangeButton\"\n className=\"btn btn-info\"\n onClick={handleReturnChange}>\n Change Return\n </Button>\n </Row>\n </Form.Group>\n </div>\n </Form>\n </Container>\n );\n }", "getExposedConfig() {\n const {form} = this.props.form;\n return {\n form\n }\n }", "constructor(parent) {\n this.parent = parent;\n this.form = this.createForm();\n }", "constructor(props) {\n super(props)\n\n this.state = {\n form: {\n figure: '',\n quantifier: 'days',\n type: 'email'\n }\n }\n this._onAddReminderClick = ::this._onAddReminderClick\n this._onSelectFieldChange = ::this._onSelectFieldChange\n this._onSelectTypeChange = ::this._onSelectTypeChange\n this._onTextFieldChange = ::this._onTextFieldChange\n }", "renderContent() {\n\t\tif (this.state.showFormReview)\n\t\t\treturn <SurveyFormReview onCancel={() => this.setState({ showFormReview: false })} />;\n\t\treturn (\n\t\t\t<SurveyForm\n\t\t\t\tonSurveySubmit={() => {\n\t\t\t\t\tthis.setState({ showFormReview: true });\n\t\t\t\t}}\n\t\t\t/>\n\t\t);\n\t}", "render() {\n const {\n onSubmit,\n edit,\n patientID,\n addressID,\n firstName,\n lastName,\n streetAddress,\n zipCode,\n city,\n state,\n country,\n apartmentNo,\n primaryContact,\n notes,\n lat,\n long,\n dateOfBirth,\n emergencyContactInfo\n } = this.props;\n return (\n <View style={styles.containerStyle}>\n <AddPatientFormContainer\n onSubmit={onSubmit}\n edit={edit}\n patientID={patientID}\n addressID={addressID}\n firstName={firstName}\n lastName={lastName}\n streetAddress={streetAddress}\n apartmentNo={apartmentNo}\n zipCode={zipCode}\n city={city}\n state={state}\n country={country}\n primaryContact={primaryContact}\n notes={notes}\n lat={lat}\n long={long}\n dateOfBirth={dateOfBirth}\n emergencyContactInfo={emergencyContactInfo}\n />\n </View>\n );\n }", "render() {\n return (\n <div>\n <form action=\"\" className=\"ui form error\" onSubmit={this.props.handleSubmit(this.onSubmit)}>\n <Field name=\"title\" component={this.renderInput} label=\"Enter Title\" />\n <Field name=\"description\" component={this.renderInput} label=\"Enter Description\" />\n <button className=\"ui button primary\">Submit</button>\n </form>\n </div>\n )\n }", "function OptionsForm(props) { \n const classes = makeStyles();\n const {\n formField: {\n optionsCardSize,\n optionsPackaging,\n optionsShippingType,\n deliveryContactNumber\n }\n } = props;\n\n return (\n <div className={classes.root}>\n <Grid container spacing={2}>\n <Grid item xs={12} sm={6}>\n <Paper className={classes.paper}>\n <h3>What size card would you like?</h3>\n <RadioButtons name={optionsCardSize.name} data={cardSizes} fullWidth />\n <span><i>A4 size cards will be delivered via courier.</i></span> \n </Paper>\n </Grid> \n <Grid item xs={12} sm={6}>\n <Paper className={classes.paper}>\n <h3>Would you like an extra envelope?</h3>\n <RadioButtons name={optionsPackaging.name} data={envelopeTypes} fullWidth /> \n <span><i>Extra envelopes are useful if you are handwriting/delvering the card.</i></span> \n </Paper>\n </Grid> \n </Grid> \n <br />\n <Grid container spacing={2}> \n <Grid item xs={12}>\n <Paper className={classes.paper}>\n <h3>How would you like your Greeting Card to be shipped?</h3>\n <RadioButtons name={optionsShippingType.name} data={shippingTypes} fullWidth /> \n <span><i>SingPost Standard Service is 2-3 days - Next Day Delivery if orders received by 12pm.</i></span>\n </Paper>\n </Grid> \n </Grid> \n </div> \n );\n}", "getForm() {\r\n return (\r\n <StagingForm\r\n // Update functions\r\n //onStagingUpdate={this.handleStagingUpdate}\r\n\t\t\t\tupdateValue={this.updateValue}\r\n // Properties\r\n staging={this.staging}\r\n />\r\n ); \r\n }", "render() {\n return (\n <div>\n {this.props.loading\n ? <h1>Loading page...</h1>\n : <form onSubmit= {(e) => this.submitForm(e)}>\n <h2>\n Create a New Note!\n </h2>\n Note Title:<br/>\n <input\n type=\"text\"\n name=\"title\"\n value={this.state.title}\n onChange={this.handleChange}\n required/>\n <br/>\n Note Content:<br/>\n <textarea\n rows=\"10\"\n cols=\"25\"\n name=\"body\"\n value={this.state.body}\n onChange={this.handleChange}\n required/>\n <button>Submit\n </button>\n </form>\n}\n </div>\n )\n }", "render () {\n\n\t\treturn (\n\t\t\t<form onSubmit={this.props.onSubmit}>\n\t\t\t\t<div className=\"input-group\">\n\t\t\t\t\t<span className=\"input-group-btn\">\n\t\t\t\t\t\t<button className=\"btn btn-primary\" type=\"submit\">\n\t\t\t\t\t\t\tAdd\n\t\t\t\t\t\t</button> \n\t\t\t\t\t</span>\n\t\t\t\t\t<input \n\t\t\t\t\t\ttype=\"text\" \n\t\t\t\t\t\tclassName=\"form-control\" \n\t\t\t\t\t\tplaceholder=\"add a todo\"\n\t\t\t\t\t\tvalue={this.props.value} \n\t\t\t\t\t\tonChange={this.props.onChange} />\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t)\n\t}", "render() {\n return (\n <div>\n <List todoData={this.state.todoList} toggleTodo={this.toggleTodo} />\n <Form\n addNewTodo={this.addNewTodo}\n changeHandler={this.changeHandler}\n newTodo={this.state.newTodo}\n toggleTodo={this.toggleTodo}\n clearCompleted={this.clearCompleted}\n />\n </div>\n );\n }", "render() {\n return (\n <Box>\n <Header>\n <Heading>\n New project\n </Heading>\n </Header>\n <Form>\n <FormField label=\"Title\">\n <TextInput id='title'\n name='title'\n value={this.state.title}\n required\n onChange={this.handleChange}\n />\n </FormField>\n <FormField label=\"Description\">\n <TextInput id='description'\n name='description'\n required\n value={this.state.description}\n onChange={this.handleChange}\n />\n </FormField>\n <FormField label=\"Deadline\">\n <DateTime id='deadline'\n format='M/D/YYYY'\n name='deadline'\n required\n value={this.state.deadline}\n onChange={this.handleChange}/>\n </FormField>\n\n <FormField label=\"Status\">\n <Select placeHolder='Select'\n options={['Open', 'Close']}\n value={this.state.status}\n required\n onChange={this.handleChange}/>\n </FormField>\n\n <FormField label=\"Tags\">\n <Select placeHolder='Select'\n multiple={true}\n options={\n this.props.tags.map(tag => {\n return tag;\n })\n }\n value={this.state.tags}\n required\n onChange={this.handleChange}/>\n </FormField>\n\n <FormField label=\"Number of workers\">\n <NumberInput value={this.state.nbworkers}\n required\n onChange={this.handleChange}/>\n </FormField>\n\n </Form>\n </Box>\n );\n }", "insertForm() {\n const {showForm} = this.state;\n if(showForm){\n return <ExpenseInput \n changeBtn={this.state.changeBtn} \n send={this.props.sendLog} \n hideForm={this.hideForm.bind(this)} \n showForm={this.state.showForm}/>\n } \n }", "function Body(props) {\n\n return (\n <Container fluid>\n <ListGroup variant=\"flush\" className=\"below-title\">\n <ListGroup.Item>\n </ListGroup.Item>\n <ListGroup.Item>\n <Form>\n <Form.Group>\n <Form.Row>\n <Form.Label column=\"lg\" xs={3} >Title</Form.Label>\n <Col xs={9}>\n <Form.Label column=\"lg\" xs={9} >{props.survey.title}</Form.Label>\n </Col>\n </Form.Row>\n </Form.Group>\n </Form>\n <Row>\n <Alert xs={12} variant=\"primary\">All fields and questions marked with (<span className=\"required\">*</span>) are required!</Alert>\n </Row>\n </ListGroup.Item>\n <ListGroup.Item>\n <Form>\n <Form.Group>\n <Form.Row>\n <Form.Label column xs={3}>Name<span className=\"required\"> *</span></Form.Label>\n <Col xs={9}>\n <Form.Label column=\"lg\" xs={9} >{props.username}</Form.Label>\n </Col> \n </Form.Row>\n </Form.Group>\n </Form>\n </ListGroup.Item>\n {/* Show a summary of each question created */}\n { props.questionsList.map(question => <Question key={question.questionId} question={question} setModal={props.setModal} setModalQuestion={props.setModalQuestion} />)}\n <ListGroup.Item>\n </ListGroup.Item>\n </ListGroup>\n \n </Container>\n );\n}", "renderAnswerModal() {\n const { showAnswerModal } = this.state;\n const { question: { question_id: questionId, question_body: questionBody } } = this.props;\n const { productName } = this.props;\n let modal;\n if (showAnswerModal) {\n modal = (\n <AnswerModal\n toggleAnswerModal={this.toggleAnswerModal}\n questionId={questionId}\n questionBody={questionBody}\n productName={productName}\n />\n );\n }\n return modal;\n }", "function FormContainer({ children }) {\n return (\n <Div>\n <img className=\"logo\" src={Login} alt=\"phe phim logo\" />\n {children}\n </Div>\n );\n}", "render() {\n return React.createElement(\"form\", { style: { display: 'table', maxWidth: '400px' } }, super.render());\n }", "componentWillMount() {\n this.formFields = this.createFormStructure();\n }", "render() {\n return (\n <div className=\"container\">\n <h1>What's up from Weave</h1>\n <Form callback = {this.props.actions.addItem}/>\n {\n this.props.items ? this.props.items.map(item => (\n <li> {item} </li>\n )) : ''\n }\n \n </div>\n )\n }", "render() {\n return (\n <div>\n <RegisterModal handleSubmit={this.handleSubmit} handleRegister={this.props.handleRegister} handleChanges={this.handleChanges} />\n </div>\n )\n }", "question(){\n return(\n <div className=\"question-area\">\n <div className=\"question\"> {this.props.question.text}</div>\n <div className=\"options\">\n {this.optionsList()}\n </div>\n </div>\n )\n }", "function RegistrationPage() {\n return (\n <div>\n <Form1 />\n </div>\n )\n}", "function onSubmit() {\n props.addCustomerModal(customerModal);\n }", "renderCommentForm(){\n const classes = this.props.classes;\n return (\n <div>\n \n <Editor \n editorState={this.props.editor_state}\n editorClassName={this.props.classes.editor}\n onEditorStateChange={this.props.setEditorState}\n />\n {this.props.request_comment_error ? \n <Typography type=\"body2\" gutterBottom style={{color:'#fc1414'}}>\n Whoops! make sure your input is valid!\n </Typography>\n :null\n }\n {this.props.comment_save_loading ? \n <CircularProgress size={50}/>\n :\n <Button onClick={this.submitComment.bind(this)} raised color=\"primary\" className={classes.button}>\n Save\n </Button>\n }\n </div>\n )\n }", "renderConfirmationForm() {\r\n\t\treturn (\r\n\t\t\t<form onSubmit={this.handleConfirmationSubmit}>\r\n\t\t\t\t<FormGroup controlId=\"confirmationCode\" bsSize=\"medium\">\r\n\t\t\t\t<ControlLabel>Confirmation Code</ControlLabel>\r\n\t\t\t\t<FormControl autoFocus type=\"tel\" value={this.state.confirmationCode} onChange={this.handleChange} />\r\n\t\t\t\t<HelpBlock>Please check your email for the code.</HelpBlock>\r\n\t\t\t\t</FormGroup>\r\n\t\t\t\t<LoaderButton block bsSize=\"small\" disabled={!this.validateConfirmationForm()} type=\"submit\" isLoading={this.state.isLoading} text=\"Verify\" loadingText=\"Verifying…\" />\r\n\t\t\t</form>\r\n\t\t\t);\r\n\t}", "getProps() {\n let result = super.getProps();\n result.items = result.items ? result.items: [];\n result.multiple = result.multiple ? result.multiple : false;\n result.onClose = result.onClose ? result.onClose: () => {}\n return result;\n }", "render () {\n return (\n <div>\n {/* // SEC_017 --- 176. Styling Expense Form 13:19 */}\n <div className=\"primary-page-header\">\n {/* [S07251678|_page-header.scss::.primary-page-header css2;^B] */}\n <div className=\"content-container\">\n {/* [S07251678|_content-container.scss::.content-container css3a;^B] */}\n <h1 className=\"primary-page-header__title\">Add Expense</h1>\n {/* [S07251678|_page-header.scss::.primary-page-header__title css2;^B] */}\n </div>\n </div>\n <div className=\"content-container\">\n {/* [S07251678|_content-container.scss::.content-container css3b;^B] */}\n <CLS_expense_form\n //[S07251667|sec011a_L105_expense_form.jsx::TPL1: CLS_expense_form <1>^B]\n onExpenseSubmit={this.onExpenseSubmit}\n //[ ASN1: onExpenseSubmit <1>^B]\n buttonLabel={'ADD EXPENSE'}\n />\n </div>\n {/* */}\n </div>\n );\n }", "function FormElement(props) {\n return (\n <Form\n viewsiteId={props.viewsiteId}\n viewpageId={props.viewpageId}\n element={props.element}\n onEditElement={props.onEditElement}\n onDeleteElement={props.onDeleteElement}\n onSetGlobalState={props.onSetGlobalState}/>\n );\n}", "renderForm () {\n\t\tif (!this.props.isOpen) return;\n\n\t\tvar form = [];\n\t\tvar list = this.props.list;\n\t\tvar nameField = this.props.list.nameField;\n\t\tvar focusWasSet;\n\n\t\t// If the name field is an initial one, we need to render a proper\n\t\t// input for it\n\t\tif (list.nameIsInitial) {\n\t\t\tvar nameFieldProps = this.getFieldProps(nameField);\n\t\t\tnameFieldProps.autoFocus = focusWasSet = true;\n\t\t\tif (nameField.type === 'text') {\n\t\t\t\tnameFieldProps.className = 'item-name-field';\n\t\t\t\tnameFieldProps.placeholder = nameField.label;\n\t\t\t\tnameFieldProps.label = '';\n\t\t\t}\n\t\t\tform.push(React.createElement(Fields[nameField.type], nameFieldProps));\n\t\t}\n\n\t\t// Render inputs for all initial fields\n\t\tObject.keys(list.initialFields).forEach(key => {\n\t\t\tvar field = list.fields[list.initialFields[key]];\n\t\t\t// If there's something weird passed in as field type, render the\n\t\t\t// invalid field type component\n\t\t\tif (typeof Fields[field.type] !== 'function') {\n\t\t\t\tform.push(React.createElement(InvalidFieldType, { type: field.type, path: field.path, key: field.path }));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Get the props for the input field\n\t\t\tvar fieldProps = this.getFieldProps(field);\n\t\t\t// If there was no focusRef set previously, set the current field to\n\t\t\t// be the one to be focussed. Generally the first input field, if\n\t\t\t// there's an initial name field that takes precedence.\n\t\t\tif (!focusWasSet) {\n\t\t\t\tfieldProps.autoFocus = focusWasSet = true;\n\t\t\t}\n\t\t\tform.push(React.createElement(Fields[field.type], fieldProps));\n\t\t});\n\n\t\treturn (\n\t\t\t<Form layout=\"horizontal\" onSubmit={this.submitForm}>\n\t\t\t\t<Modal.Header\n\t\t\t\t\ttext={'Create a new ' + list.singular}\n\t\t\t\t\tshowCloseButton\n\t\t\t\t/>\n\t\t\t\t<Modal.Body>\n\t\t\t\t\t<AlertMessages alerts={this.state.alerts} />\n\t\t\t\t\t{form}\n\t\t\t\t</Modal.Body>\n\t\t\t\t<Modal.Footer>\n\t\t\t\t\t<Button color=\"success\" type=\"submit\" data-button-type=\"submit\">\n\t\t\t\t\t\tCreate\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tcolor=\"cancel\"\n\t\t\t\t\t\tdata-button-type=\"cancel\"\n\t\t\t\t\t\tonClick={this.props.onCancel}\n\t\t\t\t\t>\n\t\t\t\t\t\tCancel\n\t\t\t\t\t</Button>\n\t\t\t\t</Modal.Footer>\n\t\t\t</Form>\n\t\t);\n\t}", "render(){\n // todo add the components\n return( <LoginForm/>);\n \n // Todo add the Form \n }", "render() {\n // this.getweather is using pops.\n return(\n \n <div>\n \n <div className=\"wrapper\">\n <div className=\"main\">\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-xs-5 title-container\">\n <Titles />\n </div>\n <div className=\"col-xs-7 form-container\">\n <Form getWeather={this.getWeather} />\n <Weather \n temperature={this.state.temperature} \n humidity={this.state.humidity}\n city={this.state.city}\n country={this.state.country}\n description={this.state.description}\n error={this.state.error}\n />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n \n );\n \n }", "onModalFieldAssistedConfirm () {\n const index = this.subPropsModalIndex\n\n // Notify the parent about the update\n this.fieldUpdated(index, { index: index, value: this.formParameters[index].value })\n\n // Reset the modal to initial (closed) state\n this.subPropsModalActive = false\n\n // Refresh root level json object AFTER setting subPropsModalActive to false\n this.refreshSingleParameterModel()\n this.subPropsModalIndex = null\n }", "constructor(props) {\n super(props);\n\n this.inputTitle = () => <input \n type = \"text\"\n name = \"title\"\n placeholder = \"Work title...\"\n value = {this.props.fields.title} \n onChange = {this.props.inputChange}\n disabled = {!this.props.editable}\n />\n\n this.searchResults = () => <ul className=\"search-results\">\n {this.props.searchResults.map((x, i) => \n <li onClick = {() => this.props.okReadClick(x.id)}>\n {x.title}\n </li>\n )}\n </ul>\n\n this.questionsList = () => <RunQuestionsList\n mode = {this.props.mode}\n questions = {this.props.fields.questions}\n changeAnswer = {this.props.changeAnswer}\n editable = {this.props.editable}\n />\n }", "render() {\n return (\n <div>\n <div className={this.props.modal&&this.props.currentModal===\"create\" ? \"modal is-active\" : \"modal\"}>\n <div className=\"modal-background\"></div>\n <div className=\"modal-content\">\n <form onSubmit={this.handleSubmit}>\n <div>\n <input type=\"text\"\n className=\"name\"\n name=\"name\"\n value={this.state.name}\n placeholder=\"Name\"\n onChange={this.handleChange} />\n </div>\n <div>\n <textarea name=\"comment\"\n className=\"text\"\n id=\"\" cols=\"30\" rows=\"10\"\n value={this.state.comment}\n onChange={this.handleChange} ></textarea>\n </div>\n <div>\n <input className=\"button\" type=\"submit\" value=\"Comment\" />\n </div>\n </form>\n </div>\n <button className=\"modal-close is-large\" onClick={this.props.toggle} aria-label=\"close\"></button>\n </div>\n <button onClick={this.props.selectModal} className=\"button\" id=\"showModal\">Comment</button>\n </div>\n )\n }", "render() {\n\n return (\n <div>\n <h1 className=\"title\">Project Page</h1>\n <div className='projectButton'>\n < ProjectForm phases={this.props.phases} {...this.props} addProject={this.props.addProject} projects={this.props.projects}/>\n </div>\n\n <section className=\"projects\">\n {\n\n this.props.projects.map(project =>\n <div key={project.id} >\n <ProjectCard key={project.id} project={project} phases={this.phases} {...this.props} />\n </div>\n )\n }\n </section>\n </div>\n )\n }", "render() {\n return (\n <div>\n <h2>To Do App: MVP</h2>\n <TodoList toggleCompleted={this.toggleCompleted} listTasks={this.state.tasks} />\n <TodoForm \n newValue={this.state.newTasks} \n addToNewTasks={this.addToNewTasks} \n addToList={this.addToList}\n clearButton={this.clearButton}\n />\n </div>\n );\n }", "render(){\n return(\n <div>\n <BookForm onSubmit={this.handleSubmit}>\n <Book {...this.props}></Book>\n </BookForm>\n </div>\n )\n }", "_renderPageMetasForm(callback) {\n var _a, _b, _c, _d, _e, _f, _g;\n return html `\n <div class=\"${this.utils.cls('_page-metas-form')}\">\n <h1 class=\"s-typo:h1 s-mbe:30\">\n ${this.props.i18n.newPageTitle}\n </h1>\n\n <label class=\"s-label:block s-mbe:30\">\n <span>${this.props.i18n.newPageNameLabel}</span>\n <input\n type=\"text\"\n class=\"s-input\"\n maxlength=\"50\"\n required\n placeholder=\"${this.props.i18n.newPageNamePlaceholder}\"\n @change=${(e) => {\n this._askData.name = e.target.value;\n this._askData.slug = `/${__urlCompliant(e.target.value)}`;\n this._askData.uid = __idCompliant(this._askData.name);\n this._askErrors = {};\n this.requestUpdate();\n }}\n />\n ${((_a = this._askErrors) === null || _a === void 0 ? void 0 : _a.name)\n ? html ` ${this._renderError(this._askErrors.name)} `\n : ''}\n </label>\n <label class=\"s-label:block s-mbe:30\">\n <span>${this.props.i18n.newPageSlugLabel}</span>\n <input\n type=\"text\"\n class=\"s-input\"\n maxlength=\"100\"\n autofocus\n required\n .value=${(_b = this._askData.slug) !== null && _b !== void 0 ? _b : ''}\n value=\"${(_c = this._askData.slug) !== null && _c !== void 0 ? _c : ''}\"\n placeholder=\"${this.props.i18n.newPageSlugPlaceholder}\"\n @change=${(e) => {\n this._askData.slug = e.target.value;\n this._askData.slug = __urlCompliant(this._askData.slug);\n delete this._askErrors.slug;\n this.requestUpdate();\n }}\n />\n ${((_d = this._askErrors) === null || _d === void 0 ? void 0 : _d.slug)\n ? html ` ${this._renderError(this._askErrors.slug)} `\n : ''}\n </label>\n <label class=\"s-label:block s-mbe:30\">\n <span>${this.props.i18n.newPageUidLabel}</span>\n <input\n type=\"text\"\n class=\"s-input\"\n maxlength=\"100\"\n .value=${(_e = this._askData.uid) !== null && _e !== void 0 ? _e : ''}\n value=\"${(_f = this._askData.uid) !== null && _f !== void 0 ? _f : ''}\"\n placeholder=\"${this.props.i18n.newPageUidPlaceholder}\"\n @change=${(e) => {\n this._askData.uid = __idCompliant(e.target.value);\n delete this._askErrors.uid;\n this.requestUpdate();\n }}\n />\n ${((_g = this._askErrors) === null || _g === void 0 ? void 0 : _g.uid)\n ? html ` ${this._renderError(this._askErrors.uid)} `\n : ''}\n </label>\n <label class=\"s-label\">\n <span></span>\n <button\n class=\"s-btn s-color:accent\"\n ?disabled=${!this._askData.name ||\n !this._askData.uid ||\n this._askErrors.name ||\n this._askErrors.uid}\n @pointerup=${(e) => __awaiter(this, void 0, void 0, function* () {\n var _h;\n const createResult = yield this._createPage(this._askData);\n if (createResult.error) {\n this._askErrors.uid = createResult.error;\n this.requestUpdate();\n }\n else {\n callback === null || callback === void 0 ? void 0 : callback(this._askData);\n (_h = this._askCallback) === null || _h === void 0 ? void 0 : _h.call(this, this._askData);\n }\n })}\n >\n ${this.props.i18n.newPageButton}\n </button>\n </label>\n </div>\n `;\n }", "render() {\n return (\n <div className=\"container_form\">\n <h3 className=\"margin-bottom-20\">Add a new wheel</h3>\n <form onSubmit={this.props.handleSubmit(this.onSubmit)}>\n <Field\n label=\"Size\"\n name=\"size\"\n type=\"text\"\n component={this.renderField}\n />\n <div className=\"buttons\">\n <button className=\"btn btn-enter my-2 float-left\" type=\"submit\" disabled={this.props.pristine || this.props.submitting}>\n Add the wheel\n </button>\n <Link to={'/admin/wheels'} className=\"btn btn-secondary my-2\" style={{float: 'right'}}>\n Back\n </Link>\n </div>\n </form>\n </div>\n );\n }", "function SignupForm (props){\n const { handleSubmit,closeModal,userSignup,setActiveModal} = props;\n\n return(\n <div >\n <form className=\"SignupForm\" onSubmit={handleSubmit(values =>{\n userSignup(values);\n setActiveModal('confirm');\n closeModal();\n })}>\n <label htmlFor=\"name\"> Name </label>\n <Field className=\"formInput\" name=\"name\" component=\"input\" type=\"text\"/>\n <br/>\n <label htmlFor=\"phone\"> Phone #</label>\n <Field className=\"formInput\" name=\"phone\" component=\"input\" type=\"text\"/>\n <br/>\n <label htmlFor=\"householdName\"> Household name</label>\n <Field className=\"formInput\" name=\"householdName\" component=\"input\" type=\"text\"/>\n\n <input type=\"submit\" value=\"SUBMIT\" className=\"formSubmit\" />\n\n </form>\n\n </div>\n )\n}", "render() {\n return (\n <>\n <Form>\n <Form.Group controlId=\"name\">\n <Form.Label>Name</Form.Label>\n <Form.Control type=\"text\"\n value= {this.props.userProp.name}\n onChange={this.handleFieldChange}\n />\n </Form.Group>\n <Form.Group controlId=\"email\">\n <Form.Label>Email address</Form.Label>\n <Form.Control type=\"text\"\n value= {this.props.userProp.email}\n onChange={this.handleFieldChange} />\n </Form.Group>\n <Form.Group controlId=\"height\">\n <Form.Label>Height</Form.Label>\n <Form.Control\n type=\"text\"\n value= {this.props.userProp.height}\n onChange={this.handleFieldChange}\n />\n </Form.Group>\n <Form.Group controlId=\"weight\">\n <Form.Label>Weight</Form.Label>\n <Form.Control\n type=\"text\"\n onChange={this.handleFieldChange}\n value={this.props.userProp.weight}\n />\n </Form.Group>\n <Form.Group controlId=\"age\">\n <Form.Label>Age</Form.Label>\n <Form.Control\n type=\"text\"\n onChange={this.handleFieldChange}\n value={this.props.userProp.age}\n />\n </Form.Group>\n\n </Form>\n </>\n );\n }", "render () {\n\t\t//return JSX, can only return one parent element \n\t\treturn (\n\t\t\t<form className=\"store-selector\" onSubmit={this.goToStore.bind(this)}> {/*this binds the gotoStore method to this(StorePicker component) */}\n\t\t{ /* this is a comment in jsx */}\n\t\t\t\t<h2>Please Enter a Store</h2>\n\n\t\t\t\t<input type=\"text\" required placeholder=\"Store Name\" defaultValue={getFunName()} ref={(input) => {this.storeInput = input}} />\n\t\t\t\t\t{ /* the ref property contains a function that stores a reference to the element on the component */}\n\t\t\t\t<button type=\"submit\" ref={(button) => {this.buttonCoool = button}}>Visit Store </button>\n\t\t\t</form>\n\t\t)\n\t}", "renderForm() {\n let id = this.props.match.params.postid;\n let post = this.props.post;\n\n return <PostForm history={this.props.history} post={post} postId={id} />;\n }", "render() {\n\n\t\t// Create array of Field components from referenced by key\n\t\tvar fields = [];\n\t\tfor (var key in this.props.form.fields) {\n\t\t\tfields.push(\n\t\t\t\t<Field field={this.props.form.fields[key]} key={key} ref={key} />\n\t\t\t);\n\t\t}\n\t\t// Render view\n\t\treturn (\n\t\t\t<div className=\"row\">\n\t\t\t\t<h2>{this.props.form.title}</h2>\n\t\t\t\t<form onSubmit={this.handleSubmit}>\n\t\t\t\t\t{fields}\n\t\t\t\t\t{ this.state.errorMessage\n\t\t\t\t\t\t? <div className=\"errorMessage\">{this.state.errorMessage}</div>\n\t\t\t\t\t\t: null }\n\t\t\t\t\t<input type=\"submit\" className=\"submit\" value={this.state.buttonText} />\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t);\n \t}", "render() {\n const { currentUser } = this.props;\n const { firstName, lastName, email, isAdmin, designation, status } = currentUser;\n\n return (\n <div className=\"profile-page\">\n <div className=\"container\">\n <ProfileForm\n onSubmit={this.onSubmit}\n firstName={firstName}\n lastName={lastName}\n email={email}\n isAdmin={isAdmin}\n status={status}\n designation={designation}\n />\n </div>\n </div>\n );\n }", "renderStatusForm(){\n const classes = this.props.classes;\n return (\n <form className={classes.container} noValidate autoComplete=\"off\">\n <TextField\n id=\"title\"\n label=\"Title\"\n value={this.props.status_form.title}\n onChange={(e)=>{\n this.props.setStatusTitle(e.target.value)\n }}\n fullWidth\n margin=\"normal\"\n />\n <TextField\n id=\"status-content\"\n label=\"Content\"\n value={this.props.status_form.content}\n onChange={(e)=>{\n this.props.setStatusContent(e.target.value)\n }}\n fullWidth\n margin=\"normal\"\n />\n <FormControl className={classes.formControl}>\n <InputLabel htmlFor=\"status-status\">Status</InputLabel>\n <Select\n value={this.props.status_form.status}\n onChange={(e)=>{\n this.props.setStatusStatus(e.target.value)\n }}\n input={<Input id=\"status-status\" />}\n >\n <MenuItem value=\"\">\n <em>Select Status...</em>\n </MenuItem>\n <MenuItem value={'PENDING'}>Pending</MenuItem>\n <MenuItem value={'IN PROGRESS'}>In Progress</MenuItem>\n <MenuItem value={'UNRESOLVED'}>Unresolved</MenuItem>\n <MenuItem value={'RESOLVED'}>Resolved</MenuItem>\n </Select>\n {this.props.request_status_error ? \n <Typography type=\"body2\" gutterBottom style={{color:'#fc1414'}}>\n Whoops! make sure your input is valid!\n </Typography>\n :null\n }\n {this.props.status_save_loading ? \n <CircularProgress size={50}/>\n :\n <Button onClick={this.submitStatus.bind(this)} raised color=\"primary\" style={{marginTop:25}}>\n Save\n </Button>\n }\n \n </FormControl>\n </form>\n )\n }", "render() {\n const props = this.getProps();\n const inputType = props.password ? 'password' : 'text';\n return [\n props.label ?\n <label className=\"control-label col-sm-2\" key=\"f1\">\n {props.label}\n </label> : '',\n <div className={props.containerClass} style={props.containerStyle} key=\"f2\">\n {!props.multiline ?\n <input className={props.inputClass} style={props.inputStyle} value={props.value}\n onChange={(value) => props.onChange(props.name, value)} type={inputType}\n placeholder={props.placeholder}/> :\n <textarea className={props.inputClass} style={props.inputStyle} value={props.value}\n ref = {(ref) => this.ref = ref}\n onChange={(value) => props.onChange(props.name, value)}/>\n }\n <Error fieldName={props.name} ownerProps={props.ownerProps} className={props.errorClass}\n style={props.errorStyle}/>\n </div>\n ]\n }", "function Form(props) {\n console.log('props from FORM.js', props);\n const [url, setUrl] = useState('');\n const handleOnChange = (evt) => {\n setUrl((evt.target.value));\n }\n\n const handleSubmit = (evt) => {\n evt.preventDefault();\n props.handleAddMeme(url);\n }\n\n // returns some JSX\n return (\n <form onSubmit={handleSubmit}>\n <p><input onChange={handleOnChange} type='text' name='url' value={url}></input></p>\n <p><button>submit</button></p>\n </form>\n )\n}", "render(){\n\t\treturn(\n\t\t\t<form className=\"form-container\" onSubmit ={ event => this.props.handleSubmit(event)}>\n\t\t\t\t<input type=\"text\" id=\"inputValue\"\n\t\t\t\tvalue = {this.props.inputValue}\n\t\t\t\tonChange = {event => this.props.handleChange(event)} \n\t\t\t\t/>\n\t\t\t\t<input type=\"text\" id=\"inputValue2\"\n\t\t\t\tvalue = {this.props.inputValue2}\n\t\t\t\tonChange = {event => this.props.handleChange(event)} \n\t\t\t\t/>\n\t\t\t\t<input type=\"text\" id=\"inputValue3\"\n\t\t\t\tvalue = {this.props.inputValue}\n\t\t\t\tonChange = {event => this.props.handleChange(event)} \n\t\t\t\t/>\n\t\t\t\t<input type=\"text\" id=\"inputValue2\"\n\t\t\t\tvalue = {this.props.inputValue2}\n\t\t\t\tonChange = {event => this.props.handleChange(event)} \n\t\t\t\t/>\n\t\t\t\t<input type=\"submit\" />\n\t\t\t\t\n\t\t\t</form>\n\t\t);\n\t}", "renderFormExt() {\n return (\n <div>\n <Row>\n <Col>\n <h4 className=\"center\">\n {this.props.submission.title}\n </h4>\n </Col>\n </Row>\n <Row>\n <Col className=\"col-label\" span={4}>\n Email\n </Col>\n <Col span={16}>\n {this.props.submission.email}\n </Col>\n </Row>\n <Row>\n <Col className=\"col-label\" span={4}>\n Full Legal Name\n </Col>\n <Col span={16}>\n {this.props.submission.fullLegalName}\n </Col>\n </Row>\n {this.props.submission.occupation && (\n <Row>\n <Col className=\"col-label\" span={4}>\n Occupation\n </Col>\n <Col span={16}>\n {this.props.submission.occupation}\n </Col>\n </Row>\n )}\n {this.props.submission.education && (\n <Row>\n <Col className=\"col-label\" span={4}>\n Education\n </Col>\n <Col span={16}>\n {this.props.submission.education}\n </Col>\n </Row>\n )}\n <Row>\n <Col className=\"form-detail-desc\" offset={4} span={16}>\n What is your native language, who is your audience and where are they located? What are the language(s) you\n plan to use to present Elastos.\n </Col>\n </Row>\n <Row>\n <Col offset={4} span={16}>\n {this.props.submission.audienceInfo}\n </Col>\n </Row>\n <Row>\n <Col className=\"form-detail-desc\" offset={4} span={16}>\n Please describe your public speaking experience and provide any examples.\n </Col>\n </Row>\n <Row>\n <Col offset={4} span={16}>\n {this.props.submission.publicSpeakingExp}\n </Col>\n </Row>\n {this.props.submission.eventOrganizingExp && (\n <div>\n <Row>\n <Col className=\"form-detail-desc\" offset={4} span={16}>\n Do you have any experience organizing events and provide any examples.\n </Col>\n </Row>\n <Row>\n <Col offset={4} span={16}>\n {this.props.submission.eventOrganizingExp}\n </Col>\n </Row>\n </div>\n )}\n <Row>\n <Col className=\"form-detail-desc\" offset={4} span={16}>\n Please list any current or past contributions promoting Elastos.\n </Col>\n </Row>\n <Row>\n <Col offset={4} span={16}>\n {this.props.submission.previousExp}\n </Col>\n </Row>\n <Divider />\n <Row>\n <Col className=\"col-label\" span={4}>\n Are you a developer?\n </Col>\n <Col span={16}>\n {this.props.submission.isDeveloper ? 'Yes' : 'No'}\n </Col>\n </Row>\n {!this.props.submission.isDeveloper && (\n <div>\n <Row>\n <Col className=\"form-detail-desc\" offset={4} span={16}>\n If you are not a developer, please explain how you are familiar with Elastos technology and what problems we\n solve.\n </Col>\n </Row>\n <Row>\n <Col offset={4} span={16}>\n {this.props.submission.devBackground}\n </Col>\n </Row>\n </div>\n )}\n <Row>\n <Col className=\"form-detail-desc\" offset={4} span={16}>\n Describe Elastos in your own words.\n </Col>\n </Row>\n <Row>\n <Col offset={4} span={16}>\n {this.props.submission.description}\n </Col>\n </Row>\n <Row>\n <Col className=\"form-detail-desc\" offset={4} span={16}>\n Tell us in a few words what inspired you to join Cyber Republic.\n </Col>\n </Row>\n <Row>\n <Col offset={4} span={16}>\n {this.props.submission.reason}\n </Col>\n </Row>\n <Row>\n <Col className=\"form-detail-desc\" offset={4} span={16}>\n Please submit a video of your introduction to Cyber Republic.\n </Col>\n </Row>\n <Row>\n <Col offset={4} span={16}>\n <a target=\"_blank\" href={getSafeUrl(this.props.submission.attachment)}>\n <Icon type=\"file\"/>\n {' '}\n&nbsp;\n {this.props.submission.attachmentFilename}\n </a>\n </Col>\n </Row>\n </div>\n )\n }", "function FormDesigner() {\n\t\t\tvar getJsObjectForProperty = function(container, property, value) {\n\t\t\t\tvar defaultValue = \"\";\n\t\t\t\tif(typeof value !== \"undefined\") {\n\t\t\t\t\tdefaultValue = value;\n\t\t\t\t} else if(typeof property[\"default\"] !== \"undefined\") {\n\t\t\t\t\tdefaultValue = property[\"default\"];\n\t\t\t\t}\n\t\t\t\tvar element;\n\t\t\t\tswitch(property[\"htmlFieldType\"]) {\n\t\t\t\t\tcase \"Hidden\": \n\t\t\t\t\t\telement = new HiddenElement(container, property[\"displayName\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"MultiChoice\" :\n\t\t\t\t\t\telement = new MultiChoiceSelectElement(container, property[\"displayName\"], property[\"helpText\"], property[\"options\"], property[\"default\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"MultiText\":\n\t\t\t\t\t\telement = new MultiChoiceTextElement(container, property[\"displayName\"], property[\"helpText\"], property[\"default\"], property[\"placeholder\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Select\":\n\t\t\t\t\t\telement = new SelectElement(container, property[\"displayName\"], property[\"options\"], property[\"helpText\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Editor\":\n\t\t\t\t\t\telement = new EditorElement(container, property[\"displayName\"], property[\"helpText\"], property[\"editorOptions\"]); /*the last argument should be editor options */\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"History\":\n\t\t\t\t\t\telement = new HistoryElement(container, property[\"displayName\"], true); \n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"TextElement\":\n\t\t\t\t\t\telement = new TextElement(container, property[\"displayName\"]); \n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"TextDisplay\":\n\t\t\t\t\t\telement = new TextDisplay(container, property[\"displayName\"]); \n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(defaultValue !== \"\") {\n\t\t\t\t\telement.setValue(defaultValue);\n\t\t\t\t}\n\t\t\t\treturn element;\n\t\t\t}\n\n\t\t\tvar drawEditableObject = function(container, metadata, object) {\n\t\t\t\tvar resultObject = {};\n\t\t\t\tresultObject = $.extend(true, {}, metadata); //make a deep copy\n\t\t\t\t\n\t\t\t\t//creating property div containers\n\t\t\t\tvar html = '<form class=\"form-horizontal\" role=\"form\" class=\"create-form\">';\n\t\t\t\t\thtml += '<div class=\"col-sm-offset-3 col-sm-9 response-container alert alert-dismissible\" role=\"alert\">'; \n\t\t\t\t\t\thtml += '<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>';\n\t\t\t\t\t\thtml += '<span class=\"message\"></span>'\n\t\t\t\t\thtml += \"</div>\";\n\t\t\t\t\thtml += '<div class=\"form-container\">';\n\t\t\t\t\t\tfor(var i = 0; i < metadata[\"propertyOrder\"].length; i++) {\n\t\t\t\t\t\t\tvar propertyKey = metadata[\"propertyOrder\"][i];\n\t\t\t\t\t\t\tif(metadata[\"properties\"][propertyKey][\"htmlFieldType\"] != \"Hidden\") {\n\t\t\t\t\t\t\t\thtml += '<div class=\"form-group ' + propertyKey + \"-id\" + '\"></div>';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\thtml += '<div class=\"' + propertyKey + \"-id\" + '\"></div>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//this gives us a space for the buttons/events\n\t\t\t\t\t\thtml += '<div class=\"col-sm-offset-3 col-sm-9 event-container\">'; \n\t\t\t\t\t\thtml += \"</div>\";\n\t\t\t\t\thtml += \"<br/><br/></div>\";\n\t\t\t\thtml += '</form>';\n\t\t\t\t$(container).html(html);\n\t\t\t\t\n\t\t\t\t//now add js elements to property div containers\n\t\t\t\tfor(property in resultObject[\"properties\"]) {\n\t\t\t\t\tvar propertyContainer = container + ' .' + property + \"-id\";\n\t\t\t\t\tresultObject[\"properties\"][property] = getJsObjectForProperty(propertyContainer, resultObject[\"properties\"][property], object[property]);\n\t\t\t\t}\n\t\t\t\tresultObject[\"metadata\"] = {};\n\t\t\t\tresultObject[\"metadata\"][\"properties\"] = metadata[\"properties\"];\n\t\t\t\t$(container + \" .response-container\").hide();\n\t\t\t\tresultObject[\"showError\"] = function(message) {\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"success\");\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"warning\");\n\t\t\t\t\t$(container + \" .response-container\").addClass(\"alert-danger\");\n\t\t\t\t\t$(container + \" .response-container span.message\").html(message);\n\t\t\t\t\t$(container + \" .response-container\").show();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tresultObject[\"showWarning\"] = function(message) {\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"success\");\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"error\");\n\t\t\t\t\t$(container + \" .response-container\").addClass(\"alert-warning\");\n\t\t\t\t\t$(container + \" .response-container span.message\").html(message);\n\t\t\t\t\t$(container + \" .response-container\").show();\n\t\t\t\t}\n\n\t\t\t\tresultObject[\"showSuccess\"] = function(message) {\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"warning\");\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"error\");\n\t\t\t\t\t$(container + \" .response-container\").addClass(\"alert-success\");\n\t\t\t\t\t$(container + \" .response-container span.message\").html(message);\n\t\t\t\t\t$(container + \" .response-container\").show();\n\t\t\t\t}\n\t\t\t\tresultObject[\"clearValues\"] = function() {\n\t\t\t\t\tfor(property in resultObject[\"properties\"]) {\n\t\t\t\t\t\tresultObject[\"properties\"][property].setValue(resultObject[\"metadata\"][\"properties\"][property][\"default\"]); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn resultObject;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tdrawEditableObject : drawEditableObject\n\t\t\t}\n\t\t}", "async function getForm() {\n try {\n const formComponent = (await doesDBExist()) ? (\n <Unlock setStore={setStore} />\n ) : (\n <InitialLock setStore={setStore} />\n );\n setForm(formComponent);\n } catch (err) {\n console.error('Error connecting to database: \\n' + err);\n setForm(<ErrorCard databaseError />);\n }\n }", "function FormComponent(props) {\n return (\n <main className=\"mainForm\">\n \n <form>\n <input\n name=\"taskName\"\n value={props.data.taskName}\n onChange={props.handleChange}\n placeholder=\"Task Name\"\n />\n <br />\n <textarea\n name=\"taskDesc\"\n value={props.data.taskDesc}\n onChange={props.handleChange}\n placeholder=\"Task Description. 400 max.\"\n />\n <br />\n \n {/* <label>\n <input\n type=\"radio\"\n name=\"status\"\n value=\"done\"\n checked={props.data.status === \"done\"}\n onChange={props.handleChange}\n /> Done\n </label>\n <br />\n <label>\n <input\n type=\"radio\"\n name=\"status\"\n value=\"inProgress\"\n checked={props.data.status === \"inProgress\"}\n onChange={props.handleChange}\n /> In Progress\n </label> */}\n <br />\n <select\n value={props.data.priority}\n name=\"priority\"\n onChange={props.handleChange}\n >\n <option value=\"\">-- Please Choose priority --</option>\n <option value=\"By the end of day\">By the end of day</option>\n <option value=\"End of the Week\">End of the Week</option>\n <option value=\"At some point\">At some point</option>\n </select>\n <br />\n <label>\n <input\n type=\"checkbox\"\n name=\"isDone\"\n onChange={props.handleChange}\n checked={props.data.isDone}\n /> Done\n </label>\n <br />\n <label>\n <input\n type=\"checkbox\"\n name=\"inProgress\"\n onChange={props.handleChange}\n checked={props.data.inProgress}\n /> In Progress\n </label>\n <br />\n\n <br />\n <Button variant=\"primary\" value=\"Create\" onClick={props.handleSubmit} >Submit</Button>\n </form>\n <hr />\n {/* Tätä ei tod.näk tartte, poistetaan kunhan homma etenee */}\n <h2>Task information:</h2>\n <p>Task name: {props.data.taskName}</p>\n <p>Task Description : {props.data.taskDesc}</p>\n <p>Task Priority: {props.data.priority}</p>\n\n </main>\n )\n}", "function MyNavForm(props) {\n return <form className=\"navbar-form\" id={props.id}>{props.children}</form>\n}", "function PPHOC (WrappedComponent){\n return class PP extends Component {\n constructor(props){\n super(props) ;\n this.state = {fileds:{}} ;\n }\n getField(filedName){\n if(!this.state.fileds[filedName]){\n this.state.fileds[filedName] ={\n value:'',\n onChange:event=>{\n this.state.fileds[filedName].value = event.target.value ;\n this.forceUpdate() ;\n }\n };\n }\n return {\n value:this.state.fileds[filedName].value,\n onChange:this.state.fileds[filedName].onChange\n } ;\n }\n render(){\n const props = Object.assign({},this.props,{\n fileds:this.getField.bind(this) \n }) ;\n return (\n <div>\n <h2>PP HOC</h2>\n <p>Im a Props Proxy HOC that abstracts controlled inputs</p>\n <WrappedComponent {...props} /> \n </div>\n ) ;\n }\n }\n}", "getFormActionComponents() {\n return this.props.actions.map((action) =>\n <FormActionComponent {...action} />\n );\n }", "render() {\n return (\n <div className=\"container dritaContainer\">\n <RegForm\n handleFirstName={this.handleFirstName}\n handleLastName={this.handleLastName}\n handleAddOne={this.handleAddOne}\n handleAddTwo={this.handleAddTwo}\n handleCity={this.handleCity}\n handleState={this.handleState}\n handleZip={this.handleZip}\n handlePhone={this.handlePhone}\n handleEmail={this.handleEmail}\n handlePassword={this.handlePassword}\n // handleInputChange={this.handleInputChange}\n // handleInputChange={this.handleInputChange}\n handleFormSubmit={this.handleFormSubmit}\n />\n <br/>\n </div>\n )\n }", "componentWillReceiveProps(newProps) {\n this.type = newProps.p.parameter_spec.type;\n this.name = newProps.p.parameter_spec.name;\n\n // update form controls to current values\n if (this.stringRef) this.stringRef.value = newProps.p.value;\n if (this.numberRef) this.numberRef.value = newProps.p.value;\n if (this.checkboxRef) this.checkboxRef.value = newProps.p.value;\n }", "render() {\n return (\n <div className = \"todo-container\">\n <TodoList completeHandler={this.toggleCompletion} items={this.state.items} />\n <TodoForm\n value={this.state.item}\n changeTodoHandler={this.todoChange}\n addTodoHandler={this.addToDo}\n clearCompletedHandler={this.clearCompleted}\n clearAllHandler = {this.clearAll}\n />\n </div>\n );\n }", "render() {\n return <div>{this.renderManagementModal()}</div>\n }", "function FormComponent(props) {\r\n\r\nreturn (\r\n <div>\r\n <form> \r\n <input \r\n name=\"firstName\" \r\n value={props.firstName} \r\n placeholder=\"First Name\" \r\n onChange={props.handleChange}\r\n />\r\n\r\n <input \r\n name=\"lastName\"\r\n value={props.lastName} \r\n placeholder=\"Last Name\"\r\n onChange={props.handleChange}\r\n />\r\n\r\n <select name=\"favoriteColor\" value={props.favoriteColor} onChange={props.handleChange}>\r\n <option value=\"Pink\"> Pink </option>\r\n <option value=\"Red\"> Red </option>\r\n <option value=\"Blue\"> Blue </option>\r\n </select>\r\n </form>\r\n\r\n <h2>Your Information:</h2>\r\n\r\n <p>Your name: {props.firstName} {props.lastName}</p>\r\n <p>Favorite color: {props.favoriteColor}</p>\r\n </div>\r\n\r\n);\r\n}", "constructor(props) { //added because we moved submit to its own function\n super(props)\n this.submit = this.submit.bind(this) // we must bind the scope of the component to any methods that need to access that scope with this\n }", "form() {\n\t\treturn [\n\n\t\t <div className=\"Form-group\">\n\t\t <label>oAuth Url</label>\n\t\t <input className=\"FormControl\" bidi={this.setting('flarum-auth-faraday-motion.oauth_url')}/>\n\t\t </div>,\n\n\t\t <div className=\"Form-group\">\n\t\t <label>oAuth API Url</label>\n\t\t <input className=\"FormControl\" bidi={this.setting('flarum-auth-faraday-motion.oauth_api_url')}/>\n\t\t </div>, \n\n\t\t <div className=\"Form-group\">\n\t\t <label>Client Id</label>\n\t\t <input className=\"FormControl\" bidi={this.setting('flarum-auth-faraday-motion.client_id')} />\n\t\t </div>, \n\n\t\t <div className=\"Form-group\">\n\t\t <label>Client Secret</label>\n\t\t <input className=\"FormControl\" bidi={this.setting('flarum-auth-faraday-motion.client_secret')}/>\n\t\t </div>\n\t\t];\n\t}", "render() {\n const { handleSubmit } = this.props; // reduxForm function\n\n return (\n <form onSubmit={handleSubmit(this.onSubmit.bind(this))}>\n <Field\n label=\"Title\"\n name=\"title\"\n component={this.renderField}\n />\n <Field\n label=\"Categories\"\n name=\"categories\"\n component={this.renderField}\n />\n <Field\n label=\"Content\"\n name=\"content\"\n component={this.renderField}\n />\n <button type=\"submit\" className=\"btn btn-primary\">Submit</button>\n <Link to=\"/\" className=\"btn btn-danger\">Cancel</Link>\n </form>\n );\n }", "showForm() {\n return (\n <MuiPickersUtilsProvider utils={DateFnsUtils}>\n <SelectType\n ID_type={this.state.ID_type}\n handleChange={() => this.handleChange}/>\n <SelectClub\n ID_club={this.state.ID_club}\n handleChange={() => this.handleChange}/>\n <SelectDepart\n nb_depart={this.state.nb_depart}\n handleChange={() => this.handleChange}/>\n <DatepickerBegin\n date_begin={this.state.date_begin}\n handleChange={() => this.handleChangeDateBegin}/>\n <DatepickerEnd\n date_end={this.state.date_end}\n handleChange={() => this.handleChangeDateEnd}/>\n <DatepickerEndInscription\n date_end_inscription={this.state.date_end_inscription}\n handleChange={() => this.handleChangeDateEndInscription}/>\n\n {/*this.uploadPDF()*/}\n {this.showButtonCreate()}\n\n </MuiPickersUtilsProvider>\n );\n }", "get props () { return this.target.props }", "render() {\n return (\n <div>\n <Form submit={this.addItem} />\n <ol>\n <List items={this.state.items} />\n </ol>\n </div>\n )\n }", "renderContent() {\n if (this.state.showFormReview) {\n return (\n <SurveyFormReview\n onCancel={() => this.setState({ showFormReview: false })}\n />\n );\n }\n return (\n <SurveyForm\n onSurveySubmit={() => this.setState({ showFormReview: true })}\n />\n );\n }", "render() {\n return (\n <form\n onSubmit={this.props.handleSubmit(this.onSubmit)}\n className=\"ui form error\"\n >\n <Field name=\"title\" component={this.renderInput} label=\"Enter Title\" />\n <Field\n name=\"description\"\n component={this.renderInput}\n label=\"Enter Description\"\n />\n <button className=\"ui button primary\">Submit</button>\n </form>\n );\n }", "render() {\n\t\treturn (\n\t\t\t<div className=\"fade-animation container\">\n\t\t\t\t<h3 style={{'fontFamily': 'Helevetica', 'color': 'grey'}}>Create new survey</h3>\n\n\t\t\t\t<form onSubmit={this.props.handleSubmit(this.props.onSurveySubmit)}>\n\t\t\t\t\t{this.renderFields()}\n\t\t\t\t\t<Link to=\"/surveys/new\" className=\"light-red btn-flat red white-text\">\n\t\t\t\t\t\tCancel\n\t\t\t\t\t\t<i className=\"material-icons right\">cancel</i>\n\t\t\t\t\t</Link> \n\t\t\t\t\t<button type=\"submit\" className=\"light-green btn-flat right white-text\"> \n\t\t\t\t\t\tReview \n\t\t\t\t\t\t<i className=\"material-icons right\">done</i>\n\t\t\t\t\t</button>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t);\n\t}", "initalizeForm() {\n const self = this;\n\n self.annotonPresentation = self.getAnnotonPresentation(this.annoton);\n\n }", "createForm(){\n this.form_ = this.create_();\n }", "initForm() {\n return {\n attachmentName: \"\",\n attachmentRejected: false, // Upload fails on drop of file\n attachmentRejections: [], // Failure reasons\n attachmentToken: \"\",\n attachmentUploading: false,\n description: \"\",\n email: \"\",\n name: \"\",\n subject: \"\",\n submitError: false,\n submitted: false,\n submitting: false,\n touched: {},\n type: \"question\",\n };\n }", "render() {\n return (\n <fieldset>\n <textarea\n name={this.props.name}\n id={this.props.id}\n placeholder={this.props.placeholder}\n required\n />\n </fieldset>\n );\n }", "renderFORM() {\r\n return (\r\n <div className=\"card bg-light mb-3\">\r\n <div className='card-body'>\r\n <form>\r\n <div className=\"form-group\">\r\n <label htmlFor=\"exampleFormControlTextarea1\"><b> Title: </b></label>\r\n <textarea name='title' type='text' onChange={this.handleChange} className=\"form-control\" id=\"exampleFormControlTextarea1\"></textarea>\r\n </div>\r\n <div className=\"form-group\">\r\n <label htmlFor=\"exampleFormControlTextarea1\"><b> Category: </b></label>\r\n <textarea name='category' type='text' onChange={this.handleChange} className=\"form-control\" id=\"exampleFormControlTextarea1\"></textarea>\r\n </div>\r\n <div className=\"form-group\">\r\n <label htmlFor=\"exampleFormControlTextarea1\"><b> Description: </b></label>\r\n <textarea name='description' type='text' onChange={this.handleChange} rows='4' className=\"form-control\" id=\"exampleFormControlTextarea1\"></textarea>\r\n </div>\r\n <div className=\"form-group\">\r\n <label htmlFor=\"exampleFormControlTextarea1\"><b> Cover Image: </b></label>\r\n <textarea name='cover_image' type='text' onChange={this.handleChange} className=\"form-control\" id=\"exampleFormControlTextarea1\"></textarea>\r\n </div>\r\n <div className=\"form-group\">\r\n <label htmlFor=\"exampleFormControlTextarea1\"><b> Goal: </b></label>\r\n <textarea type='number' name='goal' min='1' onChange={this.handleChange} className=\"form-control\" id=\"exampleFormControlTextarea1\"></textarea>\r\n </div>\r\n <div className=\"d-flex justify-content-center\">\r\n <MdSave style={{ color: 'black', fontSize: \"30px\" }} onClick={this.createProject}></MdSave>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n )\r\n }", "render() {\n return (\n <div>\n < h2 > Ajouter ou modifier un organisme référent </h2>\n <MenuAllForm />\n <br />\n <AddOrgaRefForm />\n </div>\n );\n }", "render() {\n return (\n <SignUpForm\n onSubmit={this.processForm}\n onChange={this.changeUser}\n errors={this.state.errors}\n user={this.state.user}\n />\n );\n }", "get form() {\n return this.internals_.form;\n }", "displayResponse() {\n console.log(\"props comment: \", this.props.comment)\n if (this.state.showCommentForm) {\n return (\n <div className=\"comment-reply\">\n <CommentForm onCommentSubmit={(newComment) => {\n this.setState({showCommentForm: false});\n return this.props.onCommentSubmit(newComment, this.props.comment)\n }} />\n <a href='#' onClick={(e) => { e.preventDefault(); this.setState({showCommentForm: false});}}>Cancel</a>\n </div>\n )\n } else {\n return <a href='#' onClick={(e) => { e.preventDefault(); this.setState({showCommentForm: true});}}>Reply</a>\n }\n }", "get form() {\n return this.internals_.form;\n }", "getProps() {\n let result = super.getProps();\n result.mulitline = result.mulitline ? result.multiline: false;\n result.password = result.password ? result.password : false;\n result.placeholder = result.placeholder ? result.placeholder : '';\n result.codeMirror = result.codeMirror ? result.codeMirror: null\n return result;\n }", "function ContactForm(props) {\n return (\n <div className=\"contactBack\">\n <MDBRow className=\"my-5\">\n <MDBCol>\n <form action=\"https://formspree.io/[email protected]\" method=\"POST\">\n <p className=\"h5 text-center mb-4\">Contact me here!</p>\n <div className=\"black-text\">\n <MDBInput\n label=\"Your name\"\n icon=\"user\"\n group\n type=\"text\"\n validate\n error=\"wrong\"\n success=\"right\"\n />\n <MDBInput\n label=\"Your email\"\n icon=\"envelope\"\n group\n type=\"email\"\n validate\n error=\"wrong\"\n success=\"right\"\n name=\"_replyto\"\n />\n <MDBInput\n label=\"Subject\"\n icon=\"tag\"\n group\n type=\"text\"\n validate\n error=\"wrong\"\n success=\"right\"\n name=\"_subject\"\n />\n <MDBInput\n type=\"textarea\"\n rows=\"2\"\n label=\"Your message\"\n icon=\"pencil-alt\"\n name=\"name\"\n />\n </div>\n <div className=\"text-center\">\n <MDBBtn\n outline color=\"primary\"\n type=\"submit\"\n value=\"Send\"\n >\n Send <MDBIcon icon=\"paper-plane\" className=\"ml-1\" />\n </MDBBtn>\n </div>\n </form>\n </MDBCol>\n </MDBRow>\n </div>\n );\n}", "render(){\n\t\treturn(\n\t\t\t<div>\n\t\t\t\t{ this.state.isHidden ?\n\t\t\t\t\t<CommentForm name={this.props.name} /> :\n\t\t\t\t\t<button onClick={this.toggleHidden}>Comment this skatepark</button>\n\t\t\t\t}\n\t\t\t</div>\n\t\t)\n\t}", "render() {\n let {companyBiIdData, taxAuthorityList, taxationSystemList, zipcodeList, legalFormList} = this.props,\n responseData = {\n companyBiIdData,\n taxAuthorityList,\n taxationSystemList,\n zipcodeList,\n legalFormList\n };\n\n let result = MapDataToFormElementsService.getElementFormService(this.companyFields, responseData);\n return (\n <div className='col-lg-9 col-md-8'>\n <div className=\"form-row\">\n {result}\n </div>\n </div>\n )\n }", "render() {\n\t\treturn (\n\t\t\t<div className=\"new-user-form\">\n\t\t\t\t<Form>\n\t\t\t\t\t<Form.Input\n\t\t\t\t\tonChange={this.handleChange}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tplaceholder=\"User Name\"\n\t\t\t\t\trequired />\n\t\t\t\t\t<Button id=\"create-user-button\" type=\"submit\">*</Button>\n\t\t\t\t</Form>\n\t\t\t</div>\n\t\t\t)\n\t\t//Need to ensure that this button is actually used for game creation, not just ROOM creation\n\t}", "function App(props){\n return(\n <div>\n <Form />\n <ContactList />\n </div>\n )\n}", "render() {\n\t\tif ( this.props.inline ) {\n\t\t\treturn (\n\t\t\t\t<FormGroup\n\t\t\t\t\tcontrolId=\"formControlsSelect\"\n\t\t\t\t\tvalidationState={this.state.answerState}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\twidth: 'auto',\n\t\t\t\t\t\tdisplay: 'inline'\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<FormControl\n\t\t\t\t\t\tvalue={this.state.value}\n\t\t\t\t\t\tdefaultValue={this.props.defaultValue}\n\t\t\t\t\t\tcomponentClass=\"select\"\n\t\t\t\t\t\tplaceholder=\"select\"\n\t\t\t\t\t\tonChange={this.handleChange}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.props.options.map( e => {\n\t\t\t\t\t\t\treturn <option value={e}>{e}</option>;\n\t\t\t\t\t\t})}\n\t\t\t\t\t</FormControl>\n\t\t\t\t</FormGroup>\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t<Form>\n\t\t\t\t\t<FormGroup controlId=\"formControlsSelect\" validationState={this.state.answerState}>\n\t\t\t\t\t\t{ this.props.legend ?\n\t\t\t\t\t\t\t<ControlLabel>{this.props.legend}</ControlLabel> :\n\t\t\t\t\t\t\tnull\n\t\t\t\t\t\t}\n\t\t\t\t\t\t<FormControl\n\t\t\t\t\t\t\tvalue={this.state.value}\n\t\t\t\t\t\t\tdefaultValue={this.props.defaultValue}\n\t\t\t\t\t\t\tcomponentClass=\"select\"\n\t\t\t\t\t\t\tplaceholder=\"select\"\n\t\t\t\t\t\t\tonChange={this.handleChange}\n\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{this.props.options.map( e => {\n\t\t\t\t\t\t\t\treturn <option value={e}>{e}</option>;\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t</FormGroup>\n\t\t\t\t</Form>\n\t\t\t);\n\t\t}\n\t}", "render() {\r\n return(ViewsiteFormJSX.call(this));\r\n }", "render() {\n const { loading, status, isModalShow, errors } = this.state;\n const formItems = getFormItems.call(this);\n\n return (\n <section>\n <WingBlank size='lg'>\n <WhiteSpace size='lg' />\n <Card>\n {loading ? (\n <PacmanLoader\n css={override}\n sizeUnit='px'\n size={25}\n color='#108ee9'\n loading={loading}\n />\n ) : (\n <Card.Body>\n <div className='transfer-status-container'>\n <Icon type='check-circle' color='green' />\n <p className='transfer-status'>Transfer {status}</p>\n {/* <p className='tip-color transfer-time'>\n {new Date().toLocaleString()}\n </p> */}\n </div>\n <List className='my-list'>\n {formItems.map(item => (\n <Item extra={item.value} key={item.title}>\n {item.title}:\n </Item>\n ))}\n </List>\n </Card.Body>\n )}\n </Card>\n <Button type='primary' onClick={this.jumpToLogin}>\n Back to page Login\n </Button>\n <WhiteSpace size='lg' />\n </WingBlank>\n <Modal\n visible={isModalShow}\n transparent\n maskClosable={false}\n onClose={this.onCloseModal}\n title='Failed'\n footer={[\n {\n text: 'Ok',\n onPress: () => {\n console.log('ok');\n this.onCloseModal();\n }\n }\n ]}\n >\n <p>There are some error:</p>\n {Array.isArray(errors) &&\n errors.map(item => (\n <p key={item.errorCode}>\n {item.errorCode}: {item.errorMsg}\n </p>\n ))}\n </Modal>\n </section>\n );\n }", "renderNewItemForm(e) {\n const form = e.target.parentElement.querySelector('form')\n form.style.display = 'block'\n }", "render() {\n return this.props.editing ? (\n <Fragment>\n <Backdrop onClick={this.cancelProductChangeHandler} />\n <Modal\n title=\"Nouveau produit\"\n acceptEnabled={this.state.formIsValid}\n onCancelModal={this.cancelProductChangeHandler}\n onAcceptModal={this.acceptProductChangeHandler}\n isLoading={this.props.loading}\n >\n <form>\n <Input\n id=\"title\"\n label=\"Title\"\n control=\"input\"\n onChange={this.productInputChangeHandler}\n onBlur={this.inputBlurHandler.bind(this, 'title')}\n valid={this.state.productForm['title'].valid}\n touched={this.state.productForm['title'].touched}\n value={this.state.productForm['title'].value}\n />\n <FilePicker\n id=\"image\"\n label=\"Image\"\n control=\"input\"\n onChange={this.productInputChangeHandler}\n onBlur={this.inputBlurHandler.bind(this, 'image')}\n valid={this.state.productForm['image'].valid}\n touched={this.state.productForm['image'].touched}\n />\n <div className=\"new-product__preview-image\">\n {!this.state.imagePreview && <p>Please choose an image.</p>}\n {this.state.imagePreview && (\n <Image imageUrl={this.state.imagePreview} contain left />\n )}\n </div>\n <Input\n id=\"content\"\n label=\"Content\"\n control=\"textarea\"\n rows=\"5\"\n onChange={this.productInputChangeHandler}\n onBlur={this.inputBlurHandler.bind(this, 'content')}\n valid={this.state.productForm['content'].valid}\n touched={this.state.productForm['content'].touched}\n value={this.state.productForm['content'].value}\n />\n </form>\n </Modal>\n </Fragment>\n ) : null;\n }", "get form() {\n return this.internals.form;\n }", "get form() {\n return this.internals.form;\n }", "get form() {\n return this.internals.form;\n }", "get props() { return this._props }", "render() {\n const { model, manufacturer, type, color, description } = this.state;\n const { change, submit } = this;\n return (\n <UpdateForm car={ this.state } change={ change } submit={ submit } />\n )\n }", "render() {\n const { classes } = this.props;\n\n return (\n <React.Fragment >\n <div className={`applicant-info-container spouse-info-container ${!this.props.AuthStore.authData.user.admin && this.props.registrationStore.applicationData.applicationStatus === \"COMPLETED\" ? 'application-completed' : ''}`}>\n <div className=\"addressForm\">\n <Grid container spacing={5}>\n <Grid item xs={12} sm={6}>\n <TextField\n label=\"outlined\"\n variant=\"outlined\"\n required\n error={this.props && this.props.registrationStore.errors.firstName}\n helperText={this.props && this.props.registrationStore.errors.firstName ? \"Invalid input\" : null}\n id=\"firstName\"\n name=\"firstName\"\n label=\"First name\"\n fullWidth\n autoComplete=\"fname\"\n value={this.props.registrationStore.applicationData[this.props.obj][this.props.index] && this.props.registrationStore.applicationData[this.props.obj][this.props.index].firstName}\n onChange={(event) => this.props.registrationStore.handleDataChange(\"firstName\", event.target.value, this.props.obj, this.props.index)}\n\n />\n </Grid>\n <Grid item xs={12} sm={6}>\n <TextField\n label=\"outlined\"\n variant=\"outlined\"\n required\n id=\"lastName\"\n name=\"lastName\"\n label=\"Last name\"\n fullWidth\n autoComplete=\"lname\"\n value={this.props.registrationStore.applicationData[this.props.obj][this.props.index] && this.props.registrationStore.applicationData[this.props.obj][this.props.index].lastName}\n onChange={(event) => this.props.registrationStore.handleDataChange(\"lastName\", event.target.value, this.props.obj, this.props.index)}\n\n />\n </Grid>\n <Grid container justify=\"flex-start\" item xs={12} sm={6}>\n <TextField\n label=\"outlined\"\n variant=\"outlined\"\n required\n id=\"middleName\"\n name=\"middleName\"\n label=\"Middle Name\"\n fullWidth\n autoComplete=\"middleName\"\n value={this.props.registrationStore.applicationData[this.props.obj][this.props.index] && this.props.registrationStore.applicationData[this.props.obj][this.props.index].middleName}\n onChange={(event) => this.props.registrationStore.handleDataChange(\"middleName\", event.target.value, this.props.obj, this.props.index)}\n />\n <FormControlLabel\n control={<Checkbox color=\"primary\" name=\"saveAddress\" value=\"yes\" />}\n label=\"Don't have middle name\"\n />\n </Grid>\n\n <Grid item xs={12} sm={6}>\n <CountrySelect selectedCountry={this.props.registrationStore.applicationData[this.props.obj][this.props.index].cob} placeHolder=\"Country Of Birth\" onChange={(c) => this.onCountryChange(c, \"cob\", this.props.index)} />\n </Grid>\n <Grid item xs={12} sm={6}>\n <TextField\n label=\"outlined\"\n variant=\"outlined\"\n required\n id=\"cityOfBirth\"\n name=\"cityOfBirth\"\n label=\"City of Birth\"\n fullWidth\n autoComplete=\"cityOfBirth\"\n value={this.props.registrationStore.applicationData[this.props.obj][this.props.index] && this.props.registrationStore.applicationData[this.props.obj][this.props.index].cityOfBirth}\n onChange={(event) => this.props.registrationStore.handleDataChange(\"cityOfBirth\", event.target.value, this.props.obj, this.props.index)}\n />\n </Grid>\n <Grid container justify=\"flex-start\" item xs={12} sm={6}>\n <FormControl component=\"fieldset\" className={classes.formControl}>\n <FormLabel component=\"legend\">Gender</FormLabel>\n <RadioGroup aria-label=\"gender\" name=\"gender1\"\n value={this.props.registrationStore.applicationData[this.props.obj][this.props.index] && this.props.registrationStore.applicationData[this.props.obj][this.props.index].gender}\n onChange={(e) => this.handleGenderChange(e, this.props.index)} row>\n <FormControlLabel value=\"female\" control={<Radio color=\"primary\" />} label=\"Female\" />\n <FormControlLabel value=\"male\" control={<Radio color=\"primary\" />} label=\"Male\" />\n </RadioGroup>\n </FormControl>\n </Grid>\n </Grid>\n\n\n <Grid className=\"bd-container\" container direction=\"row\"\n justify=\"flex-start\" spacing={10}>\n <Grid direction=\"row\" justify=\"flex-start\" container item xs={12} sm={2}>\n <FormControl variant=\"outlined\" className={`select-input ${classes.formControl}`}>\n <InputLabel id=\"Day\">Day</InputLabel>\n <Select\n labelId=\"Day\"\n id=\"Day\"\n label=\"Day\"\n value={this.props.registrationStore.applicationData[this.props.obj][this.props.index].day}\n onChange={(event) => this.props.registrationStore.handleDataChange(\"day\", event.target.value, this.props.obj, this.props.index, this.props.subObj)}\n >\n {Array.from(new Array(31), (v, i) =>\n <MenuItem key={i} value={i + 1}>{i + 1}</MenuItem>\n )}\n </Select>\n </FormControl>\n </Grid>\n <Grid justify=\"flex-start\" container item xs={12} sm={2}>\n <FormControl variant=\"outlined\" className={`select-input ${classes.formControl}`}>\n <InputLabel id=\"Month\">Month</InputLabel>\n <Select\n labelId=\"Month\"\n id=\"Month\"\n label=\"Month\"\n\n value={this.props.registrationStore.applicationData[this.props.obj][this.props.index].month}\n onChange={(event) => this.props.registrationStore.handleDataChange(\"month\", event.target.value, this.props.obj, this.props.index, this.props.subObj)}\n >\n {Array.from(new Array(12), (v, i) =>\n <MenuItem key={i} value={i + 1}>{i + 1}</MenuItem>\n )}\n </Select>\n </FormControl>\n </Grid>\n <Grid justify=\"flex-start\" container item xs={12} sm={2}>\n <FormControl variant=\"outlined\" className={`select-input ${classes.formControl}`}>\n <InputLabel id=\"year\">Year</InputLabel>\n <Select\n labelId=\"year\"\n id=\"year\"\n label=\"year\"\n value={this.props.registrationStore.applicationData[this.props.obj][this.props.index].year}\n onChange={(event) => this.props.registrationStore.handleDataChange(\"year\", event.target.value, this.props.obj, this.props.index, this.props.subObj)}\n >\n {Array.from(new Array(90), (v, i) =>\n <MenuItem key={i} value={this.state.currentYear - i}>{this.state.currentYear - i}</MenuItem>\n\n )}\n </Select>\n </FormControl>\n </Grid>\n </Grid>\n\n\n {<Grid item container className=\"image-upload-container\"\n justify=\"flex-start\" sm={2} >\n {/* <DropzoneArea showPreviewsInDropzone={true} filesLimit={1}\n acceptedFiles={['image/jpeg']}\n\n onChange={setSelectedImage}\n /> */}\n <MediaUploader icon=\"Camera\"\n types=\"image/*\"\n onChange={(event) => this.handleImageChange(event)} />\n </Grid>}\n\n\n\n\n </div>\n </div>\n </React.Fragment>\n\n )\n }" ]
[ "0.65741825", "0.6216278", "0.61510366", "0.598923", "0.59588194", "0.59496826", "0.59447855", "0.5941818", "0.5912043", "0.5898496", "0.5887556", "0.5874158", "0.586362", "0.58521545", "0.5847194", "0.58258474", "0.58124006", "0.57844436", "0.57683843", "0.57674646", "0.57240415", "0.5723631", "0.5722267", "0.57024497", "0.57012784", "0.56973547", "0.56951463", "0.569466", "0.5692102", "0.56801444", "0.56749237", "0.567087", "0.5660312", "0.5653903", "0.56527615", "0.56393164", "0.56342053", "0.5633863", "0.5632", "0.56299543", "0.5627418", "0.56230533", "0.5623035", "0.56222373", "0.56152695", "0.56142086", "0.5609404", "0.56061417", "0.56055355", "0.5593126", "0.55924714", "0.55887586", "0.5588146", "0.5587448", "0.55852365", "0.5580495", "0.55766207", "0.55706227", "0.55631196", "0.55610955", "0.5560535", "0.5552003", "0.5551192", "0.5546949", "0.5544875", "0.5541797", "0.55409384", "0.5540059", "0.5539935", "0.553991", "0.55373585", "0.55368555", "0.55348635", "0.55307925", "0.552817", "0.55242693", "0.5522104", "0.5519314", "0.5511663", "0.55010897", "0.55007166", "0.54972166", "0.54959154", "0.5495758", "0.54946196", "0.5492375", "0.5492148", "0.5490181", "0.5483332", "0.54809195", "0.5479474", "0.5478678", "0.54782635", "0.546934", "0.5466735", "0.54635566", "0.54635566", "0.54635566", "0.5462378", "0.545945", "0.54589885" ]
0.0
-1
Write a object to the database file.
async function writeToDB(content) { try { await fs.writeFileSync(path.join(__dirname, '../../db/db.json'), JSON.stringify(content)); } catch(err) { console.log('Could not write to file :(' + err); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "writeDbObject(obj) {\n this.writeUB4(obj.toid.length);\n this.writeBytesWithLength(obj.toid);\n if (obj.oid) {\n this.writeUB4(obj.oid.length);\n this.writeBytesWithLength(obj.oid);\n } else {\n this.writeUB4(0);\n }\n this.writeUB4(0); // snapshot\n this.writeUB4(0); // version\n const packedData = obj._getPackedData();\n this.writeUB4(packedData.length);\n this.writeUB4(obj.flags);\n this.writeBytesWithLength(packedData);\n }", "function save() {\n try {\n let mydata = JSON.stringify(obj);\n fs.writeFile(\"database2.json\", mydata, \"utf8\", () => {});\n } catch (error) {\n console.log(error);\n }\n}", "function write() {\n fs.writeFileSync(wordLength + filename, JSON.stringify(object), 'utf8');\n}", "function writeDBToFile(){\n console.log(colors.yellow(\"*Writing To File*\"));\n jsonfile.writeFile(path, db, function(err){\n console.log(colors.red(\"db error: \" + err));\n });\n}", "save() {\n this.db.write();\n }", "saveDB() {\n const dbpath = path.join(__dirname, \"../db/data.json\");\n fs.writeFileSync(dbpath, JSON.stringify(this.toJson));\n }", "function write(dbData) {\n\tfs.writeFileSync('db/db.json', JSON.stringify(dbData), 'utf-8');\n}", "guardarDB() {\n fs.writeFileSync(this.dbPath, JSON.stringify(this.historial));\n }", "function writeToDB(file1, songName) {\n var transaction = db.transaction([\"audioFiles\"], \"readwrite\");\n var store = transaction.objectStore(\"audioFiles\");\n console.log(file1);\n var request = store.add(file1, songName);\n\n }", "write(info) {\n return writeToFile('./db/db.json', JSON.stringify(info));\n }", "async save(object){\r\n let objetos = []\r\n try{\r\n objetos = await this.getAll();\r\n let max = 0;\r\n objetos.forEach(producto => {\r\n if (producto.id > max) {\r\n max = producto.id;\r\n }\r\n });\r\n object.id = max+1; \r\n } catch{\r\n object.id = 1;\r\n }\r\n objetos.push(object);\r\n const objetoEnJson = JSON.stringify(objetos);\r\n await fs.promises.writeFile(this.nombreArchivo, objetoEnJson)\r\n }", "function saveObjectIntoDB(Object){\r\n\r\nconsole.log(\"saved: \"+Object);\r\nObject.save(function(error) {\r\n if (error) {\r\n console.error(error);\r\n return false;\r\n }\r\n })\r\n return true;\r\n \r\n}", "function saveObjectIntoDB(Object){\r\n\r\nconsole.log(\"saved: \"+Object);\r\nObject.save(function(error) {\r\n if (error) {\r\n console.error(error);\r\n return false;\r\n }\r\n })\r\n return true;\r\n \r\n}", "function saveRecord(record) {\n // open new entry to db with ability to read and write\n const transaction = db.transaction(['new_Entry'], 'writeRead');\n\n // permission to access the object store \n const statementObjectStore = transaction.objectStore('new_Entry');\n\n // submit new record to your store with the add method\n statementObjectStore.add(record);\n}", "function saveRecord(record) {\n // open a new transaction with the database readwrite permissions \n const transaction = db.transaction(['new_transaction'], 'readwrite');\n \n // access objectStore \n const budgetObjectStore = transaction.objectStore('new_transaction');\n \n // add record to store with add (method)\n budgetObjectStore.add(record);\n}", "function saveObj(object) {\n var search = db.collection('search');\n search.insert(object.data);\n console.log(\"Object was saved successfully!!!\");\n createHistory();\n }", "function writeFile() {\r\n if (!'indexedDB' in window) {\r\n console.log(\" your browser doesnt support indexDB\");\r\n // return;\r\n }\r\n const databaseName = \"TextEditorDB\";\r\n const DBname = window.indexedDB.open(databaseName);\r\n DBname.onupgradeneeded = () => {\r\n let db = DBname.result;\r\n let store = db.createObjectStore(\"Files\", { autoIncrement: true });\r\n // put method\r\n store.put({ name: \"file1\", format: \"text\" });\r\n }\r\n DBname.onsuccess = () => {\r\n if (DBname.readyState == \"done\") {\r\n console.log(\"Data is successfully loaded\");\r\n }\r\n }\r\n}", "function saveData(data) {\n const transaction = db.transaction([\"open\"], \"readwrite\");\n\n const store = transaction.objectStore(\"open\");\n\n store.add(data);\n}", "function saveRecord(record) {\n // open a new transaction with the database with read and write permissions \n const transaction = db.transaction(['new_budget'], 'readwrite');\n \n // access the object store for `new_budget`\n const budgetObjectStore = transaction.objectStore('new_budget');\n \n // add record to your store with add method\n budgetObjectStore.add(record);\n}", "function saveRecord(record) {\n // open a new transaction with the database with read and write permissions \n const transaction = db.transaction(['new_pizza'], 'readwrite');\n \n // access the object store for `new_pizza`\n const pizzaObjectStore = transaction.objectStore('new_pizza');\n \n // add record to your store with add method\n pizzaObjectStore.add(record);\n }", "function saveRecord(record) {\n //open a new transaction with the database with read and write permission\n const transaction = db.transaction(['new_budget'], 'readwrite');\n\n //access the object store for 'new_budget'\n const budgetObjectStore = transaction.objectStore('new_budget');\n\n //add record to your store with add method\n budgetObjectStore.add(record);\n}", "function saveRecord(record) {\n // open transaction with db with read/write permission\n const transaction = db.transaction(['new_pizza'], 'readwrite');\n\n // access object store for 'new_pizza'\n const pizzaObjectStore = transaction.objectStore('new_pizza');\n\n // add record to store with add method\n pizzaObjectStore.add(record);\n}", "function writeToFile(data) {\n try {\n return fs.writeFileSync(\"./db/db.json\", JSON.stringify(data));\n }\n catch {\n return console.log(\"db.json failed.\");\n }\n}", "writeFile(note) {\n return fileWrite('db/db.json', JSON.stringify(note));\n }", "function writeDatabaseToFile(database){\n var lastUpdated = getLastUpdated();\n fs.writeFileSync(\"./local_database.json\", JSON.stringify({\"Characters\": database, \"LastUpdated\": lastUpdated}, null, 2));\n}", "function dump(obj, filename){\n let data_str = JSON.stringify(obj);\n fs.writeFileSync(filename, data_str)\n}", "function writeFile(fpath, wobj) {\n\tfs.writeFileSync(fpath, JSON.stringify(wobj))\n}", "function saveNotes() {\n fs.writeFileSync(\"db/db.json\", JSON.stringify(db));\n}", "write() {\n const statement = this.dbConnector.statements.set(this.params, this.writeBuffer);\n this.dbConnector.query(statement, this.onWriteResult.bind(this), [], true);\n }", "function writeFile () {\n\tvar stringified = JSON.stringify(masterObject);\n\t\n\tfs.writeFile(newFilePath, stringified, function (err) {\n\t\tif (err) {console.log(err)};\n\t\tconsole.log(\"finished\");\n\t})\n}", "function WriteDB(the_record){\n connection.query('select count(id) from record', function (error, results, fields) {\n if (error) throw error\n var num = results[0]['count(id)'];\n var t1 = new Date();\n var time = t1.getFullYear() * 10000 + (t1.getMonth()+1)*100 + t1.getDate();\n\n connection.query(`INSERT INTO record(lineId, id, time) VALUES (\"${the_record.id}\", ${num}, ${time});`);\n connection.query(`INSERT INTO location(id, lat, lng, statu, address) VALUES (${num}, ${the_record.lat}, ${the_record.lon}, '0', '${the_record.address}');`);\n UploadFolder(oAuth2Client, num.toString(), num, the_record);\n })\n}", "guardarDB (){\n const payload ={\n historial: this.historial\n };\n\n fs.writeFileSync(this.dbPath, JSON.stringify(payload));\n\n }", "save() {\n this.db._write(this.data);\n return this.db;\n }", "function saveDatabase(){\n yaml = require('node-yaml');\n filepath = \"./database/database.yml\";\n\n try {\n // write all current info to the db\n yaml.writeSync(filepath, database, \"utf8\", function(err){\n if(err) throw err;\n });\n\n /*\n * ALTERNATE IMPLEMENTATION:\n * The following is an alternate implementation for serializing data.\n * Instead of logging everything to the database.yml file, it writes to\n * three separate files: articles.yml, users.yml, and comments.yml.\n * Using this implementation, the serialized data is segregated according\n * to object type. As new objects are created, new yml files can be created\n * and written to using the following implementation. This method has the\n * advantage of keeping like data separated, increasing readability and\n * maintainability as storage requirements get larger and more varied.\n */\n // users = database.users;\n // articles = database.articles;\n // comments = database.comments;\n // filepath = \"./database/users.yml\";\n // // write the user information to the users.yml file\n // yaml.writeSync(filepath, users, \"utf8\", function(err){\n // if(err) throw err;\n // });\n //\n // // write the articles information to the articles.yml file\n // // filepath = \"./database/articles.yml\";\n // yaml.writeSync(filepath, articles, \"utf8\", function(err){\n // if(err) throw err;\n // });\n //\n // // write the comments information to the comments.yml file\n // // filepath = \"./database/comments.yml\";\n // yaml.writeSync(filepath, comments, \"utf8\", function(err){\n // if(err) throw err;\n // });\n\n } catch (e) {\n console.log(\"Error writing file\");\n console.log(e);\n }\n}", "function saveToDatabase(obj) {\n var request = new XMLHttpRequest();\n request.onreadystatechange = processResponse;\n request.open('POST', 'http://localhost/member/save', true); // Be explicit with the URL; could use /member/save only to assume server is localhost\n request.send(obj);\n}", "function saveRecord(record) {\n const transaction = db.transaction([\"BudgetStore\"], \"readwrite\");\n const budgetStore = transaction.objectStore(\"BudgetStore\");\n budgetStore.add(record);\n}", "function saveSauvegarde(id,nbCoupe,aireAtteinte,temps,score) {\n // création d'un objet contenant les données\n // il sert d'\"enregistrement\" dans la base\n var sauvegarde = {\n\t\tid:id,\n nbCoupe: nbCoupe,\n aireMinimaleAtteinte: aireAtteinte,\n\t\ttemps:temps,\n\t\tscore:score\n }\n\n // on ouvre la base, et on déclare les listeners\n var request = indexedDB.open(\"spacelash2\", 1);\n request.onerror = errorOpen;\n request.onupgradeneeded = createDatabase;\n\n request.onsuccess = function(event) {\n // ici la base a été ouverte avec succés, il faut ajouter l'enregistrement\n\n // on récupère l'objet database\n var db = event.target.result; \n\n // on ouvre une transaction qui permettra d'effectuer\n // les opérations sur la base\n var transaction = db.transaction([\"sauvegarde\"], \"readwrite\");\n transaction.oncomplete = function(event) {\n \n \n };\n\n transaction.onerror = function(event) {\n window.alert('erreur de transaction ');\n };\n\n // on récupère l'object store dans lequel on veut stocker l'objet\n var sauvegardeStore = transaction.objectStore(\"sauvegarde\");\n\n // on créé l'ordre d'ajouter un enregistrement\n // sera effectivement executé lors de la fermeture de la transaction\n var req = sauvegardeStore.put(sauvegarde);\n req.onsuccess = function(event) {\n \n }\n req.onerror = function(event) {\n window.alert('erreur ajout');\n }\n }\n}", "async save() {\n const priv = privates.get(this);\n const tableName = priv.get(\"tableName\");\n if (tableName) {\n const formData = new FormData(this.form);\n if (formData.get(\"saveDetails\") !== \"on\") {\n return;\n }\n const dataToSave = Object.assign({}, this.data, this.toObject());\n if (!db.isOpen()) {\n await db.open();\n }\n await db[tableName].put(dataToSave);\n this.data = dataToSave;\n }\n }", "saveMembers(obj){\n\t\tvar member = this.getMember()\n member.push(obj);\n jsf.writeFileSync(file,member,{spaces: 1, EOL:'\\r\\n'});\n\n\t}", "function saveData(stream, sqlString)\n{\n stream.write(sqlString);\n}", "_writeDBVersion(version) {\n const tx = this._db.beginTxn();\n tx.putNumber(this._mainDb, '_dbVersion', version);\n tx.commit();\n }", "function saveRecord(record) {\n // open a new transaction with the db with read and write permissions\n const transaction = db.transaction(['action'], 'readwrite');\n\n //access the object store for 'action'\n const actionObjectStore = transaction.objectStore('action');\n\n //add record to store\n actionObjectStore.add(record);\n}", "function saveRecord(record) {\n // open a new transaction with the database with read and write permissions\n const transaction = db.transaction(['new_transaction'], 'readwrite');\n\n // access the object store for `new_transaction`\n const transactionObjectStore = transaction.objectStore(\"new_transaction\");\n\n // add record to your store with add method\n transactionObjectStore.add(record);\n}", "function saveRecord(record) {\n //open a new transaction with the database with read and write permissions\n const transaction = db.transaction([\"new_transaction\"], \"readwrite\");\n\n //access the object store for \"new_transaction\"\n const transactionObjectStore = transaction.objectStore(\"new_transaction\");\n\n //add record to your store with add method\n transactionObjectStore.add(record);\n}", "function saveRecord(record) {\n console.log('saveRecord function call');\n // open a new transaction with the database w read/write ability\n const transaction = db.transaction(['new_transaction'], 'readwrite');\n\n // access objectStore\n const transactionObjectStore = transaction.objectStore('new_transaction');\n\n // add record to your store with add method\n transactionObjectStore.add(record);\n}", "function saveDB (file) {\n\n\t// Get file contents\n var source = fs.readFileSync(file. source, 'utf8')\n var source = source.substr(1) // FIX ÿ issue\n\n // Save outputs\n file.output.forEach(function (output) {\n\n\t\t// Connect to database\n\t\tvar connection = new tedious.Connection({\n\t\t userName: config.database.username,\n\t\t password: config.database.password,\n\t\t server : config.database.server,\n\t\t options : {\n\t\t instanceName: config.database.instance,\n\t\t databaseName: config.database.database\n\t\t }\n\t\t})\n\n var query = \" UPDATE \" + argv.table\n + \" SET ReporteSecundario = @file\"\n + \" WHERE NombreReporteOriginal = @name\"\n\n\n // Configure request\n var request = new tedious.Request(query, function (err) {\n if (!!err) return console.error(err)\n \tconnection.close();\n console.log('-> Updated', output)\n })\n\n request.addParameter('name', tedious.TYPES.VarChar, output)\n request.addParameter('file', tedious.TYPES.VarChar, source)\n\n // Execute Query\n connection.on('connect', function (err) {\n\t\t if (!!err) throw err\n \tconnection.execSql(request)\n\t\t})\n })\n\n\n\t\n\n}", "async writeToFile({ fileName, object }) {\r\n const workspaceFolder = vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length ? vscode.workspace.workspaceFolders[0].uri : undefined;\r\n\r\n // Stringify JSON Object\r\n var jsonContent = JSON.stringify(object);\r\n\r\n fs.writeFile(`${workspaceFolder.fsPath}/${fileName}`, jsonContent, \"utf8\", function (err) {\r\n if (err) return console.log(err);\r\n console.log(\"JSON file has been saved.\");\r\n });\r\n }", "function saveRecord(record) {\n const transaction = db.transaction([\"budgetStore\"], \"readwrite\");\n const save = transaction.objectStore(\"budgetStore\");\n\n save.add(record);\n}", "function _save(instance) {\n\t\tinstance._storage.setItem(instance.db._dbconfig.name, Object.toJSON(instance.db));\n\t\treturn instance;\n\t}", "save(){\n\t\tvar dataString = JSON.stringify(this.getData());\n\t\tfs.writeFile('app/json/saveData.txt', dataString);\n\t}", "write(note) {\n return writeFileAsync(\"db/db.json\", JSON.stringify(note));\n }", "function writeData(name, data){\n return dbPromise\n .then(function(db){\n const tx = db.transaction(name, 'readwrite');\n const store = tx.objectStore(name);\n store.put(data);\n \n return tx.complete;\n });\n}", "save(fileobject) {\n\n // if in the browser (as opposed to electron)\n // fileobject is null and must be set to a default value first\n fileobject=bisgenericio.getFixedSaveFileName(fileobject,\"bmi.json\");\n \n\tlet values=this.getValues();\n\tlet out=JSON.stringify(values);\n \tbisgenericio.write(fileobject,out);\n }", "function writeDB(type){\n fs.writeFile(\"db/db.json\",JSON.stringify(notes,'\\t'),err => {\n if (err) throw err;\n return true;\n });\n\n return console.log(`note ${type}`);\n }", "function writeFileContent(data) {\n console.log(\"Write file data to db\");\n\n FileData.find({})\n .exec(function (err, fileData) {\n if (err) {\n console.log(err);\n } else {\n if (fileData.length == 0) {\n //save file data into db\n var newFileData = new FileData()\n\n newFileData.data = data\n\n newFileData.save(function (err) {\n if (err) {\n console.log(err);\n }\n })\n }\n else {\n //update file data into db\n FileData.update({}, {\n $set: {\n data: data\n }\n },\n {\n new: true\n },\n function (err, updatedDetails) {\n if (err) {\n console.log(err);\n }\n });\n }\n }\n });\n}", "function writeDocument(collection, changedDocument) {\n var id = changedDocument._id;\n if (id === undefined) {\n throw new Error(`You cannot write a document to the database without an _id! Use AddDocument if this is a new object.`);\n }\n // Store a copy of the object into the database. Models a database's behavior.\n data[collection][id] = JSONClone(changedDocument);\n // Update our 'database'.\n updated = true;\n}", "function writeDocument(collection, changedDocument) {\n var id = changedDocument._id;\n if (id === undefined) {\n throw new Error(`You cannot write a document to the database without an _id! Use AddDocument if this is a new object.`);\n }\n // Store a copy of the object into the database. Models a database's behavior.\n data[collection][id] = JSONClone(changedDocument);\n // Update our 'database'.\n updated = true;\n}", "function writeDocument(collection, changedDocument) {\n var id = changedDocument._id;\n if (id === undefined) {\n throw new Error(`You cannot write a document to the database without an _id! Use AddDocument if this is a new object.`);\n }\n // Store a copy of the object into the database. Models a database's behavior.\n data[collection][id] = JSONClone(changedDocument);\n // Update our 'database'.\n updated = true;\n}", "storeData(jsonData) {\n fs.writeFileSync(dbPath, JSON.stringify(jsonData));\n }", "async function saveInDb() {\n\t\ttry {\n\t\t\tawait Snapshot.create({\n\t\t\t\tTitle: req.body.title,\n\t\t\t\tText: fullUnitedText,\n\t\t\t\tDictionary: JSON.stringify(fullInfo.dictionary),\n\t\t\t\tWikipedia: JSON.stringify(fullInfo.wiki)\n\t\t\t});\n\n\t\t\tres.status(201).end()\n\t\t} catch (e) {\n\t\t\tres.status(500).send({error: e})\n\t\t}\n\t}", "save_to(path) {\n fs.writeFileSync(path, JSON.stringify(this.data));\n }", "save(data) {\n this.db.save(data);\n }", "function writeDataIntoDB(database) {\n database.save(function (err) {\n if (err) throw err;\n console.log('Write in DB successfully');\n })\n}", "function saveRecord(offLineItem) {\n // Create a transaction on the database \"pending\"\n const transaction = db.transaction([\"pending\"], \"readwrite\");\n // set the store\n const store = transaction.objectStore(\"pending\");\n // add the offLineItem to the store\n store.add(offLineItem);\n}", "function writeTimestamp(table) {\n db = new sqlite3.Database('./db/garage.db');\n db.serialize(function() {\n var stmt = db.prepare(\"INSERT INTO \" + table + \" VALUES (?)\");\n var timestamp = Math.floor(Date.now() / 1000);\n stmt.run(timestamp);\n stmt.finalize();\n });\n db.close();\n}", "function saveRecord(record) {\n const transaction = db.transaction(['new_transaction'], 'readwrite');\n const budgetTrackerObjectStore = transaction.objectStore('new_transaction');\n budgetTrackerObjectStore.add(record);\n}", "function storeToIndexedDB(resourceType, uid, dataObject) {\n\tif (iDB == null) {\n\t\tlog('iDB not available');\n\t\treturn;\n\t}\n\t\n\tvar useStorage = resourceType.substring(0, resourceType.length - 1) + 'Storage';\n\tvar dbTransactions = iDB.transaction([useStorage], 'readwrite');\n\tvar dbStorage = dbTransactions.objectStore(useStorage);\n\tvar storeRequest = dbStorage.put(dataObject, uid);\n\tstoreRequest.onsuccess = function(event) {\n\t\tlog(uid + '(' + resourceType + ') stored.');\n\t};\n\tstoreRequest.onerror = function(event) {\n\t\tlog(uid + '(' + resourceType + ') error while put into DB.');\n\t};\n}", "function saveRecord(record) {\n const transaction = db.transaction(['new_funds'], 'readwrite');\n\n const fundsObjectStore = transaction.objectStore('new_funds');\n\n fundsObjectStore.add(record);\n\n showModal(false);\n}", "function save(objectAndFile) {\n let jsonString;\n let jsonData;\n\n for (let index = 0; index <= objectAndFile.length; index++) {\n let obj = objectAndFile[index];\n // let str = objectAndFile[index]+\"\";\n jsonData = {\n // str : obj,\n Object: obj,\n };\n jsonString = JSON.stringify(jsonData);\n let path = objectAndFile[index + 1] + \"\";\n fs.writeFile(path, jsonString, \"utf-8\", (err) => {\n if (err) {\n console.log(err);\n }\n });\n index += 1;\n }\n}", "function saveHistory(obj) {\n var latest = db.collection('latest');\n latest.insert(obj);\n findObj();\n }", "function writeObj(conn, type, args) {\n\tconn.write(JSON.stringify({type:type, args:args}));\n}", "save() {}", "function set(id, blob, callback) {\n // Open a transaction to the database.\n var transaction = db.transaction([window.GLOBALS.DATABASE_NAME], 'readwrite');\n\n // Put the blob into the dabase.\n // TODO: Check for key collisions.\n var put = transaction.objectStore(window.GLOBALS.OBJECT_STORE_NAME).add({id: id, file: blob});\n\n if (callback) {\n put.onsuccess = callback;\n }\n }", "function SaveObject(obj, nm){\n\tcheckStorage();\n\ttlog(\"save \" + obj);\n\tStorage.setItem(nm, JSON.stringify(obj));\n}", "function addOutcomeToDB() {\n\tvar fs = require('fs');\n\n\tvar json = JSON.stringify(oneTransactionOutcome);\n\n\tfs.open(\"db/db.json\", \"a+\", 0644, function(err, file_handle) {\n\t\tif (!err) {\n\t\t // Записываем в конец файла readme.txt фразу \"Copyrighted by Me\"\n\t\t // при открытии в режиме \"a\" указатель уже в конце файла, и мы передаём null\n\t\t // в качестве позиции\n\t\t fs.write(file_handle, \"\\n\" + json, null, 'utf8', function(err, written) {\n\t\t if (!err) {\n\t\t fs.close(file_handle);// Всё прошло хорошо\n\t\t } else {\n\t\t // Произошла ошибка при записи\n\t\t }\n\t\t });\n\t\t} else {\n\t\t alert(error);\n\t\t}\n\t\t});\n}", "function saveToDatabase() {\n idb.add(dbKeys.stations, JSON.stringify(stationList));\n idb.add(dbKeys.lastFrequency, lastFrequency);\n }", "function writeToDb (agent) {\n // Get parameter from Dialogflow with the string to add to the database\n const databaseEntry = agent.parameters.databaseEntry;\n\n // Get the database collection 'dialogflow' and document 'agent' and store\n // the document {entry: \"<value of database entry>\"} in the 'agent' document\n const dialogflowAgentRef = db.collection('dialogflow').doc('agent');\n return db.runTransaction(t => {\n t.set(dialogflowAgentRef, {entry: databaseEntry}, {merge: true});\n return Promise.resolve('Write complete');\n }).then(doc => {\n agent.add(`Wrote \"${databaseEntry}\" to the Firestore database.`);\n }).catch(err => {\n console.log(`Error writing to Firestore: ${err}`);\n agent.add(`Failed to write \"${databaseEntry}\" to the Firestore database.`);\n });\n }", "function writeToFile() {\n fs.writeFile('actors.json', JSON.stringify(objActors), function (err) {\n if (err) {\n logger.error(\"Failed to write:\" + err);\n console.log(\"Failed to write a file\");\n }\n else {\n logger.info(\"Successfully wrote the actors file\")\n console.log(\"Successfully written actors file\");\n }\n })\n fs.writeFile('movies.json', JSON.stringify(objMovies), function (err) {\n if (err) {\n logger.error(\"Failed to write:\" + err);\n console.log(\"Failed to write a file\");\n }\n else {\n logger.info(\"Successfully wrote the movies file\")\n console.log(\"Successfully written movies file\");\n }\n })\n}", "function writeToDB() {\n\tvar pos = markerPos(); //return pos of marker in the markers array\n\tvar spawn = require(\"child_process\").spawn; //spawns a childs proc.\n\tvar child = spawn('python',[\"userInterface/py/updateDB.py\", new_lat, new_lng, pos]); //calls a python script with parameters\n}", "function writeToFile(){\n fs.writeFile(path+'/'+'movies.json', JSON.stringify(tmdbCollection, null, 4));\n}", "function addStudentInDatabase() {\n const roll = document.getElementById(\"add_roll\").value;\n const name = document.getElementById(\"add_name\").value;\n const department = document.getElementById(\"add_department\").value;\n const year = document.getElementById(\"add_year\").value;\n const semester = document.getElementById(\"add_semester\").value;\n\n const addStudentInfo = {\n Roll: roll,\n Name: name,\n Department: department,\n Year: year,\n Semester: semester\n };\n\n const tx = db.transaction(\"StudentTable\", \"readwrite\");\n const studentInfo = tx.objectStore(\"StudentTable\");\n studentInfo.add(addStudentInfo);\n}", "createJson(obj) {\n var outputFilename = __dirname+'/mappingOrder.json';\n\n fs.writeFile(outputFilename, JSON.stringify(obj, null, 4), function(err) {\n if(err) {\n console.log(err);\n } else {\n console.log(\"JSON saved to \" + outputFilename);\n }\n });\n }", "function saveData(data)\n{\n\tobjectData = data;\n}", "function saveRecord(isAdding) {\n\n let nameEl = JSON.stringify(document.querySelector(\"#t-name\").value);\n let amountEl = document.querySelector(\"#t-amount\").value;\n\n if (!isAdding) {\n amountEl *= -1;\n }\n\n let amountString = JSON.stringify(amountEl);\n\n let transactionObject = [ { name: nameEl, value: amountString, date: new Date().toISOString() } ]\n\n const transaction = db.transaction(['transactions'], 'readwrite'); // Create transaction\n const table = transaction.objectStore('transactions'); // Access table\n table.add(transactionObject); // Add data to table\n}", "function saveRecord(record) {\n // just saving a record\n const transaction = db.transaction([\"pending\"], \"readwrite\");\n const store = transaction.objectStore(\"pending\");\n store.add(record);\n}", "function writeFile(fileEntry, dataObj) {\n // Create a FileWriter object for our FileEntry (log.txt).\n fileEntry.createWriter(function (fileWriter) {\n\n fileWriter.onwriteend = function() {\n console.log(\"Successful file write...\"+fileEntry.name);\n\t\t\t//alert(\"Successful file write...\"+fileEntry.name);\n\t\t\treturn true;\n };\n\n fileWriter.onerror = function(e) {\n console.log(\"Failed file write: \" + e.toString());\n\t\t\t//alert(\"Failed file write: \" + e.toString());\n\t\t\treturn false;\n };\n\n // If data object is not passed in, dont continue\n if (!dataObj) {\n\t\t\tconsole.log(\"writeFile() failed, no dataObj passed\");\n return false;\n }\n\n fileWriter.write(dataObj);\n });\n}", "function saveForLater(team) {\n dbPromised\n .then(function(db) {\n let tx = db.transaction(\"teams\", \"readwrite\");\n let store = tx.objectStore(\"teams\");\n console.log(team);\n store.add(team); //mayerorror\n return tx.complete;\n })\n .then(function() {\n console.log(\"Team ini berhasil di simpan.\");\n });\n}", "write() {\n const json = this.toJson()\n for (let i = 0; i < this._stores.length; i++) {\n this._stores[i].write(json)\n }\n }", "function writeTable(tblArr) {\n try {\n const jsonString = JSON.stringify(tblArr)\n fs.writeFileSync(dbpath, jsonString)\n console.log(\"writeFileSync successful, db.json updated\")\n } catch (e) {\n console.error(\"writeFileSync or JSON.stringify failed \", e)\n }\n}", "function save() {\n storage.write(filename, data);\n }", "function saveRecord(record) {\n const transaction = db.transaction([\"pending\"], \"readwrite\");\n const store = transaction.objectStore(\"pending\");\n store.add(record);\n}", "function saveRecord(record) {\n const transaction = db.transaction([\"pending\"], \"readwrite\");\n const store = transaction.objectStore(\"pending\");\n}", "saveConfigToDb() {}", "function saveDatabase(newData) {\r\n return fs.writeFileSync(path.join(__dirname, \"../../db/db.json\"), JSON.stringify(newData))\r\n}", "function writeOneRecord() {\n var conn = Jdbc.getCloudSqlConnection(dbUrl, user, userPwd);\n\n var stmt = conn.prepareStatement('INSERT INTO entries ' +\n '(guestName, content) values (?, ?)');\n stmt.setString(1, 'First Guest');\n stmt.setString(2, 'Hello, world');\n stmt.execute();\n}", "function writeFile(fileEntry, dataObj) {\n // Create a FileWriter object for our FileEntry (log.txt).\n fileEntry.createWriter(function (fileWriter) {\n // If data object is not passed in,\n // create a new Blob instead.\n if (!dataObj) {\n dataObj = new Blob([], { type: 'text/plain' });\n }\n fileWriter.write(dataObj);\n fileWriter.onwriteend = function() {\n console.log(dataObj);\n };\n fileWriter.onerror = function (e) {\n console.log(\"Failed file write: \" + e.toString());\n };\n });\n }", "function updateFile() {\n fs.writeFile(\"db/db.json\", JSON.stringify(notes,'\\t'), err => {\n if (err) throw err;\n return true;\n });\n }", "function saveEntry(entry) {\n const transaction = db.transaction(['new_budget_entry'], 'readwrite');\n\n const budgetObjectStore = transaction.objectStore('new_budget_entry');\n\n budgetObjectStore.add(entry);\n}", "function writeRecipesToDatabase(recipes){\n db.serialize(function() {\n\n //Here we will drop the current files in the database and work with the new ones that we are creating now\n var serverStringNeeded = \"DROP TABLE IF EXISTS recipes\";\n db.run(serverStringNeeded);\n\n\t //this will create a new table within the database\n serverStringNeeded = \"CREATE TABLE IF NOT EXISTS recipes (id INTEGER PRIMARY KEY, recipe_name TEXT, contributor TEXT, category TEXT, description TEXT, spices TEXT, source TEXT, rating TEXT, ingredients TEXT, directions TEXT)\";\n\n db.run(serverStringNeeded);\n\n var stmt = db.prepare(\"INSERT INTO recipes (recipe_name,contributor,category,description,spices,source,rating,ingredients,directions) VALUES (?,?,?,?,?,?,?,?,?)\");\n for (var i = 0; i < recipes.length; i++) {\n \t recipe = recipes[i];\n stmt.run(recipe.recipe_name, recipe.contributor, recipe.category, recipe.description, recipe.spices, recipe.source, recipe.rating, recipe.ingredients, recipe.directions);\n }\n stmt.finalize();\n });\n}", "function saveToTemp(obj, name) {\n let path = appRootPath + \"/temp/\" + name + \".json\";\n // let obj = {};\n\n // for (let [key, value] of map.entries()) {\n // obj[key] = value;\n // }\n\n let jsonContent = JSON.stringify(obj);\n // console.log(jsonContent);\n\n fs.writeFile(path, jsonContent, \"utf8\", function(err) {\n if (err) {\n console.log(\"An error occured while writing JSON Object to File.\");\n return console.log(err);\n }\n\n console.log(\"JSON file has been saved.\");\n });\n}" ]
[ "0.71094847", "0.6413418", "0.63722146", "0.6359445", "0.6230884", "0.6033907", "0.5939538", "0.57657427", "0.57487947", "0.5743452", "0.5719728", "0.5696048", "0.5696048", "0.56669116", "0.5648214", "0.5644914", "0.56444734", "0.56049013", "0.55927575", "0.55857855", "0.5570429", "0.55624175", "0.55579543", "0.5550575", "0.5522811", "0.5516491", "0.55120283", "0.5508308", "0.5497467", "0.54964197", "0.5496402", "0.54938114", "0.5461878", "0.5425913", "0.5422243", "0.54119253", "0.5391472", "0.5362815", "0.5344469", "0.53388274", "0.532975", "0.53255737", "0.5318227", "0.53179437", "0.5315617", "0.5313819", "0.53061736", "0.5301089", "0.5290396", "0.52876925", "0.5261759", "0.5260621", "0.52536225", "0.52533185", "0.5232226", "0.52227944", "0.52227944", "0.52227944", "0.5222234", "0.52215403", "0.521716", "0.5213159", "0.5207016", "0.5179087", "0.51763016", "0.51518863", "0.5149344", "0.51373166", "0.5118815", "0.5117312", "0.51163936", "0.51142454", "0.51066023", "0.51059514", "0.51038873", "0.5089781", "0.5084685", "0.50788397", "0.50783604", "0.5065163", "0.5059249", "0.5050352", "0.50424534", "0.501217", "0.50090945", "0.50068873", "0.5003059", "0.49989888", "0.4967897", "0.4955719", "0.49536878", "0.49474707", "0.49431595", "0.49385166", "0.49363682", "0.49265066", "0.49245435", "0.49226934", "0.4916416", "0.4913405" ]
0.5555999
23
Read a database file to a object.
async function readFromDB() { return await JSON.parse(fs.readFileSync(path.join(__dirname, '../../db/db.json'))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "readFromDB() {\n return readFile(\"db/db.json\", \"utf8\");\n }", "function readFile( filename ){\n return fs.readFileSync( path.join(dbFolder(), filename)).toString();\n }", "function read() {\n\tvar data = JSON.parse(fs.readFileSync('db/db.json', 'utf-8'));\n\treturn data;\n}", "readDbObject() {\n const obj = {};\n let numBytes = this.readUB4();\n if (numBytes > 0)\n obj.toid = Buffer.from(this.readBytesWithLength());\n numBytes = this.readUB4();\n if (numBytes > 0)\n obj.oid = Buffer.from(this.readBytesWithLength());\n numBytes = this.readUB4();\n if (numBytes > 0)\n obj.snapshot = Buffer.from(this.readBytesWithLength());\n this.skipUB2(); // version\n numBytes = this.readUB4();\n this.skipUB2(); // flags\n if (numBytes > 0)\n obj.packedData = Buffer.from(this.readBytesWithLength());\n return obj;\n }", "readFile() {\n return fileRead('db/db.json', 'utf8');\n }", "readfnc() {\n return read('./Develop/db/db.json', 'utf8');\n }", "async loadDatabase() {\n this.__db =\n (await qx.tool.utils.Json.loadJsonAsync(this.__dbFilename)) || {};\n }", "read() {\n return readFileAsync(\"./db/db.json\", \"utf8\");\n }", "function readDbFile() {\n return new Promise((resolve, reject) => {\n fs.readFile(fileBDConfig, { encoding: 'utf-8'}, (err, data) => {\n if (err) {\n reject(new Error('No se ha podido leer el fichero', fileBDConfig));\n return;\n }\n const jsonContent = JSON.parse(data);\n if (!jsonContent) {\n reject(new Error('El fichero', fileBDConfig, 'no cumple con el formato esperado.'));\n return;\n }\n else if (!jsonContent.hasOwnProperty(Anuncio.getCollectionName())) {\n reject(new Error(`El fichero ${fileBDConfig} no contiene datos para la precarga de la tabla ${Anuncio.getCollectionName()}`));\n return;\n }\n else if (!jsonContent.hasOwnProperty(Usuario.getCollectionName())) {\n reject(new Error(`El fichero ${fileBDConfig} no contiene datos para la precarga de la tabla ${Usuario.getCollectionName()}`));\n return;\n }\n resolve(jsonContent);\n });\n });\n}", "loadObjects (context, { file, database }) {\n const loader = new FileLoader(file)\n loader.loadAsync().then(resp => {\n if (database) {\n const separatedName = path.basename(file).split('.')\n if (separatedName.length > 1) separatedName.pop()\n const tblName = separatedName.join('_')\n context.commit('updateDatabase', { key: tblName, value: resp, database: database })\n } else {\n context.commit('updateState', { key: file, value: resp })\n }\n }).catch(e => {\n console.log(e)\n })\n }", "read() {\n return readFileAsync(\"db/db.json\", \"utf8\"); // shows the notes from the database json file (db.json)\n }", "read() {\n return readFileAsync(\"db/db.json\", \"utf8\");\n }", "rawData() {\n return fs.readFileSync(dbPath);\n }", "function loadDatabase(){\n yaml = require('js-yaml');\n fs = require('fs');\n filepath = \"./database/database.yml\";\n\n try{\n // Deal with users first\n // load all user data into one large user object\n var data = yaml.safeLoad(fs.readFileSync(filepath, 'utf8'));\n // iterate over the object according to its keys.\n // in this case, keys will represent individual users\n return data;\n\n /*\n * ALTERNATE IMPLEMENTATION:\n * The following is an alternate implementation for serializing data.\n * Instead of logging everything to the database.yml file, it writes to\n * three separate files: articles.yml, users.yml, and comments.yml.\n * Using this implementation, the serialized data is segregated according\n * to object type. As new objects are created, new yml files can be created\n * and written to using the following implementation. This method has the\n * advantage of keeping like data separated, increasing readability and\n * maintainability as storage requirements get larger and more varied.\n */\n // if(data){\n // Object.keys(data).forEach(function(key) {\n // // pull the current \"value\" from the yml data.\n // // it will represent a user\n // var val = data[key];\n // const user = val;\n // // add the user to the db\n // database.users[user.username] = user;\n // });\n // }\n //\n // // Articles are handled exactly the same way as users\n // filepath = \"./database/articles.yml\";\n // data = yaml.safeLoad(fs.readFileSync(filepath, 'utf8'));\n // if(data){\n // Object.keys(data).forEach(function(key) {\n // var val = data[key];\n // const article = val;\n // database.articles[article.id] = article;\n // // just make sure to increment nextArticleId for each article\n // database.nextArticleId++;\n // });\n // }\n //\n // // comments are handled the same way as articles\n // filepath = \"./database/comments.yml\";\n // data = yaml.safeLoad(fs.readFileSync(filepath, 'utf8'));\n // if(data){\n // Object.keys(data).forEach(function(key) {\n // var val = data[key];\n // const comment = val;\n // database.comments[comment.id] = comment;\n // database.nextCommentId++;\n // });\n // }\n } catch (e) {\n console.log(\"Error reading file\");\n console.log(e);\n }\n}", "async function load_db_file(filepath) {\n console.log(\"dbfile :\", filepath);\n worker.postMessage({ action: 'open' });\n\n const u = new URL(filepath);\n fetch(u).then(res => res.arrayBuffer()).then(buf => {\n try {\n worker.postMessage({ action: 'open', 'buffer': buf }, [buf]);\n } catch (exception) {\n worker.postMessage({ action: 'open', 'buffer': buf });\n }\n });\n }", "function readSelectedFile(e) {\n var file = e.target.files[0];\n if (!file) {\n return;\n }\n\n var reader = new FileReader();\n reader.onload = function(e) {\n db = new SQL.Database(e.target.result);\n displayConversationsList();\n };\n reader.readAsBinaryString(file);\n}", "function getDatabase() {\r\n const json = fs.readFileSync(path.join(__dirname, \"../../db/db.json\"));\r\n return JSON.parse(json);\r\n}", "function read(fileObject, fileName) {\n var reader = new FileReader();\n\n reader.onerror = function() {\n alert('Error reading file: ' + fileName);\n };\n reader.onloadend = function(event) {\n var array = new Uint8Array(event.target.result);\n\n if (window.ttyRecord) {\n window.ttyRecord.destroy();\n }\n\n window.ttyRecord = new TTYRecord('table', array);\n };\n\n reader.readAsArrayBuffer(fileObject);\n }", "static readAllFromDB(dbElementName) {\r\n\t\treturn DBHelper.openDB('restaurant-review-DB').then(db => {\r\n\t\t\treturn db\r\n\t\t\t\t.transaction(dbElementName)\r\n\t\t\t\t.objectStore(dbElementName)\r\n\t\t\t\t.getAll();\r\n\t\t});\r\n\t}", "function ReadDB () {\r\n const transactions = Budgetdb.transaction([\"pending\"], \"readwrite\")\r\n const stores = transactions.objectStore(\"pending\")\r\n // getAll() method for matching specified parameter OR\r\n // all objects in store if no parameters specified \r\n const getAll = stores.getAll()\r\n // get all object stores onsuccess event if result.length > 0\r\n getAll.onsuccess = () => {\r\n if (getAll.result.length > 0) {\r\n // fetch bulk to post getAll results via json stringify\r\n fetch(\"/api/transaction/bulk\", {\r\n method: \"POST\",\r\n body: JSON.stringify(getAll.result),\r\n headers: {\r\n Accept: \"application/json, text/plain, */*\",\r\n \"Content-Type\": \"application/json\"\r\n }\r\n })\r\n .then(response => response.json())\r\n // clears stores of pending transactions once stored to db\r\n .then(() => {\r\n const transactions = Budgetdb.transaction([\"pending\"], \"readwrite\")\r\n const stores = transactions.objectStore(\"pending\")\r\n stores.clear()\r\n })\r\n }\r\n }\r\n}", "function loadDB()\n{\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"./../Academic-Resources2.txt\", true);\n\n xhr.onload = function(e) \n { \n console.log(xhr.responseText);\n db.run(xhr.responseText); // run the query without returning anything\n };\n\n xhr.send();\n}", "async function getFile(id) {\n var file = await db.readDataPromise('file', { id: id })\n return file[0];\n}", "db() { \n return new sqlite3.Database(this.db_file); \n }", "function model() {\n\tlet rawdata = fs.readFileSync(dbf, 'utf-8');\n\tif (rawdata) {\n\t\treturn new LINQ(JSON.parse(rawdata));\n\t} else\n\t\treturn new LINQ(JSON.parse('[{}]'));\n}", "function open(dbpf) {\n\tif (typeof dbpf === 'string') {\n\t\tdbpf = new Savegame(fs.readFileSync(dbpf));\n\t}\n\treturn dbpf;\n}", "function openConnectionTo(file) {\n let connection = connections.get(file.path);\n if (!connection) {\n connection = Services.storage.openDatabase(file);\n switch (connection.schemaVersion) {\n case 0:\n connection.executeSimpleSQL(\"PRAGMA journal_mode=WAL\");\n connection.executeSimpleSQL(\n \"CREATE TABLE cards (uid TEXT PRIMARY KEY, localId INTEGER)\"\n );\n connection.executeSimpleSQL(\n \"CREATE TABLE properties (card TEXT, name TEXT, value TEXT)\"\n );\n connection.executeSimpleSQL(\n \"CREATE TABLE lists (uid TEXT PRIMARY KEY, localId INTEGER, name TEXT, nickName TEXT, description TEXT)\"\n );\n connection.executeSimpleSQL(\n \"CREATE TABLE list_cards (list TEXT, card TEXT, PRIMARY KEY(list, card))\"\n );\n // Falls through.\n case 1:\n connection.executeSimpleSQL(\n \"CREATE INDEX properties_card ON properties(card)\"\n );\n connection.executeSimpleSQL(\n \"CREATE INDEX properties_name ON properties(name)\"\n );\n connection.schemaVersion = 2;\n break;\n }\n connections.set(file.path, connection);\n }\n return connection;\n}", "function injestJSONFile() {\n var file = fs.readFileSync(dbPath, \"utf-8\");\n return JSON.parse(file);\n}", "function read_file_to_db(){\n const readInterface = readline.createInterface({\n input: fs.createReadStream('./smoke.txt'),\n output: process.stdout,\n console: false\n });\n\n readInterface.on('line', function(line) {\n var words = line.split('\\t');\n if(words[0] != \"Time\"){\n collection.insert([{\n ID: words[1],\n time: words[0],\n smoke: words[2],\n temp: words[3]\n }],\n {w:1},\n function(err, result){});\n }\n });\n}", "function readFile() {\n const fs = require(\"fs\");\n fs.readFile(\"src/database.json\", \"utf8\", (err, jsonString) => {\n //error checkign to make sure that the database is read correctly\n if (err) {\n //This line will print if an error occurs\n console.log(\"Error reading file from disk:\", err);\n return;\n }\n // the try catch method is used as an error prevention method. The code\n // in the 'try' section is run and if errors occur then the 'catch'\n // code is run\n try {\n // create an array of objects which will be each country\n var countries = JSON.parse(jsonString);\n //loop through each country\n countries.forEach(function (country) {\n //------------------------------------------------------------------------\n // TASK 2 and 3\n // you may want to create a seperate function and simply call that function here\n //------------------------------------------------------------------------\n });\n } catch (err) {\n console.log(\"Error parsing JSON string:\", err);\n }\n });\n}", "function read_file(filename) {\n var file_data = data.load(filename);\n return file_data;\n}", "async function readDatabase() {\n const { body: databaseDefinition } = await client.database(databaseId).read();\n console.log(`Reading database:\\n${databaseDefinition.id}\\n`);\n }", "function Database(data) {\n this.filename = 'dbfile_' + (0xffffffff * Math.random() >>> 0);\n if (data != null) {\n FS.createDataFile('/', this.filename, data, true, true);\n }\n this.handleError(sqlite3_open(this.filename, apiTemp));\n this.db = getValue(apiTemp, 'i32');\n this.statements = {};\n }", "function loadFile(file){\n\tlet fs = require('fs');\n\tlet content = fs.readFileSync(file);\n\tlet obj = JSON.parse(content);\n\treturn obj;\n}", "get(fileID) {\n return this.ready.then(db => {\n const transaction = db.transaction([STORE_NAME], 'readonly');\n const request = transaction.objectStore(STORE_NAME).get(this.key(fileID));\n return waitForRequest(request);\n }).then(result => ({\n id: result.data.fileID,\n data: result.data.data\n }));\n }", "function loadFile(file){\n\t\tlet fs = require('fs');\n\t\tlet content = fs.readFileSync(file);\n\t\tlet obj = JSON.parse(content);\n\t\treturn obj;\n\t}", "function openDatabase(file) {\n return DbUtils.connectLite(\"ubiquity_suggestion_memory\", {\n id_string : \"VARCHAR(256)\",\n input : \"VARCHAR(256)\",\n suggestion : \"VARCHAR(256)\",\n score : \"INTEGER\",\n }, [], file)\n}", "function loadDatabase (location) {\n //neste caso, o arquivo é estático e pode ser lido usando o require\n return require(location);\n}", "function OpenDB(p : String) {\n\t connection = \"URI=file:\" + p; // we set the connection to our database\n\t dbcon = new SqliteConnection(connection);\n\t dbcon.Open();\n\t }", "function read(table_id) {\n return db(tableName).where({ table_id }).first();\n}", "async function readDatabase() {\r\n const { resource: databaseDefinition } = await client\r\n .database(databaseId)\r\n .read()\r\n console.log(`Reading database:\\n${databaseDefinition.id}\\n`)\r\n}", "function readJSONFile() {\n return JSON.parse(fs.readFileSync(\"db.json\"))[\"places\"];\n}", "function read() {\n for (var tableName in tables) {\n try {\n var json = fs.readFileSync('./old/' + tableName + '.json', 'utf8')\n tables[tableName] = JSON.parse(json)\n } catch (e) {\n console.error('Could not read or parse ./old/' + tableName + ', skipping')\n }\n }\n}", "function readDB(callback) {\n return new Promise((resolve, reject) => {\n fs.readFile(url, 'utf8', function (error, data) {\n if (error) {\n callback(false);\n reject(error);\n }\n else {\n resolve(data);\n }\n });\n })\n .then(data => callback(null, data))\n .catch(error => {\n callback(false);\n throw new Error(error)\n });\n}", "load(db, values, options) {\n return this.query(db, values, options);\n }", "function readFromDatabase(datasetId, guid, callback) {\n fh.db({\n \"act\": \"read\",\n \"type\": datasetId,\n \"guid\": guid\n },\n function(error, responseData) {\n if (error) {\n return callback(error, null);\n } else {\n return callback(null, responseData);\n }\n });\n }", "async load (filePath) {\n console.log(`Deserializing from ${filePath}`)\n this.data = this.formatStrategy.deserialize(\n await fs.readFile(filePath, 'utf-8')\n )\n }", "init (config, dbConfig) {\n if (config && config.filepath && config.filepath !== this.filepath) {\n\n // first save existing content to new dir before changing\n if (!_.isEmpty(this.store.object[this.name]) && !fs.existsSync(config.filepath)) {\n this.store.saveSync(config.filepath);\n }\n\n this.filepath = config.filepath;\n this.store = low(this.filepath, dbConfig);\n }\n\n let rows = this.rows,\n __model = rows.length && rows[0].__model;\n\n if (__model) {\n this.store.object[this.name] = _.map(rows, (record) => {\n return model(record);\n });\n }\n }", "function readJSONFile() {\r\n return JSON.parse(fs.readFileSync(\"db.json\"))[\"ideas\"];\r\n}", "function readObject(table, column, field, callback) {\n\tpg.connect(connectionString,\t\t\t\t\t\t\t\t\t\t\t\t// try to connect to the database\n\t\tfunction (error, database, done) {\n\t\t\tif (error) return callback(error);\t\t\t\t\t\t\t\t\t// if there was an error, return it\n\n\t\t\tvar querystring = selectFrom(\t\t\t\t\t\t\t\t\t\t// generate the select query\n\t\t\t\ttable, ALL_COLUMNS, map(column, field)\n\t\t\t);\n\t\t\tquery(database, done, querystring,\t\t\t\t\t\t\t\t\t// query the database\n\t\t\t\tfunction (error, result) {\n\t\t\t\t\tif (error) return callback(error);\t\t\t\t\t\t\t// if there was an error, return it\n\t\t\t\t\tif (!result.length) return callback(DOES_NOT_EXIST);\t\t// if there were no matches, return the error\n\t\t\t\t\treturn callback(SUCCESS, result[0]);\t\t\t\t\t\t// otherwise, return the result of the query\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n}", "async read() {\n let contenido = await modelo.find({});\n return contenido;\n }", "async read() {\n let contenido = await modelo.find({});\n return contenido;\n }", "function readFromDbHandler() {\n var request = indexedDB.open('workerDB');\n var db;\n\n request.onerror = function(err) {\n alert(\"Why didn't you allow my web app to use IndexedDB?!\", err);\n };\n\n request.onsuccess = function(event) {\n db = event.target.result;\n\n db.transaction('devices').objectStore('devices').get(1).onsuccess = function(event) {\n dataHeader.textContent = event.target.result.type;\n };\n };\n }", "function loadData(db, fileName, handleTableRow) {\n return new Promise((resolve, reject) => {\n logger.info('Loading data files...', 'loadData()');\n // Read the brand data\n const readableStream = fs.createReadStream(fileName, { highWaterMark : 64*1024 });\n readableStream.on('open', (fd) => {\n logger.info('Opened file: ' + fileName, 'loadData():readableStream.on(open)');\n }).on('data', (chunk) => {\n logger.debug('Got chunk of data (size): ' + chunk.length, 'loadData():readableStream.on(data)');\n let actualChunk = chunkCache + chunk;\n logger.debug('Passing a chunk of size (includes leftovers): ' + actualChunk.length, 'loadData()');\n let lines = utils.transformChunkIntoLines(actualChunk);\n for (let aa = 0; aa < lines.fieldsArray.length; aa++) {\n handleTableRow(db, lines.fieldsArray[aa]);\n }\n chunkCache = lines.leftOvers;\n logger.debug('Leftovers: ' + chunkCache, 'loadData()');\n }).on('error', (err) => {\n logger.error('Error: ' + err.message, 'loadData():readableStream.on(error)');\n reject(err);\n }).on('close', () => {\n logger.info('Closed file: ' + fileName, 'loadData():readableStream.on(close)');\n resolve();\n });\n });\n}", "function openDb(dbpath,mode){\n var exists = fs.existsSync(dbpath);\n if (exists){\n try{\n db = new sqlite3.Database(dbpath,mode);\n }\n catch (err){\n console.log('Could not open database: ' + err);\n }\n }\n else{\n console.log('Could not open database: file does not exists');\n }\n}", "function loadSharkDB() {\n\n let db = new SharkDB([])\n db['branches'] = BRANCHES\n db['evns'] = EVNS\n db['machines'] = MACHINES\n db['codes'] = PRODUCT_CODES\n\n try {\n var data = fs.readFileSync(`${SHARK_DB}`, 'UTF-8');\n return data ? JSON.parse(data.toString()) : db\n } catch (err) {\n console.error(err)\n return db\n }\n}", "async readDatabase() {\n const { resource: databaseDefinition } = await client\n .database(databaseId)\n .read()\n console.log(`Reading database:\\n${databaseDefinition.id}\\n`)\n}", "function read(id) {\r\n return { ...Default, ...(db.get(id) || {}) }\r\n}", "loadFile(path) {\r\n path = this.getAbsoluteDataPath(path);\r\n // Check if a file exists at this path\r\n if (FS_1.FS.existsSync(path)) {\r\n try {\r\n // If it exists, read the contents\r\n const contents = FS_1.FS.readFileSync(path, \"utf8\");\r\n // Return undefined if there are no contents\r\n if (contents.length == 0)\r\n return;\r\n // Parse it to json\r\n const data = JSON.parse(contents);\r\n // Return the data\r\n return data;\r\n }\r\n catch (e) {\r\n // If anything goes wrong, just log an error. TODO: Properly handle these errors\r\n console.error(`Something went wrong while retrieving ${path}:`, e);\r\n }\r\n }\r\n }", "readFile(path, ejsonParseOptions) {\n const fileExtension = path_1.extname(path);\n if (fileExtension !== '.json') {\n return importFresh(path);\n }\n const content = fs_1.readFileSync(path, 'utf-8');\n return bson_1.EJSON.parse(content, ejsonParseOptions);\n }", "constructor(file, defaults) {\n this.db = low(file, { storage: fileAsync, });\n this.db.defaults(defaults).value();\n }", "function doReadFile(callback) {\n fs.readFile(pathToFile, \"utf8\", function (err, data) {\n SQLtext = data;\n callback();\n });\n }", "function onReadOBJFile(fileString, fileName, gl, scale, reverse) {\n var objDoc = new OBJDoc(fileName); // Create a OBJDoc object\n var result = objDoc.parse(fileString, scale, reverse);\n if (!result) {\n g_objDoc = null; g_drawingInfo = null;\n console.log(\"OBJ file parsing error.\");\n return;\n }\n g_objDoc = objDoc;\n}", "function loadModel(id) {\n return persistenceService.readObject(SPACE, id);\n }", "function onReadOBJFile(fileString, fileName, gl, scale, reverse) {\n\tvar objDoc = new OBJDoc(fileName);\t// Create a OBJDoc object\n\tvar result = objDoc.parse(fileString, scale, reverse);\t// Parse the file\n\t\n\tif (!result) {\n\t\tg_objDoc \t\t= null; \n\t\tg_drawingInfo \t= null;\n\t\tconsole.log(\"OBJ file parsing error.\");\n\t\treturn;\n\t\t}\n\t\t\n\tg_objDoc = objDoc;\n}", "static deserialize(fileString)\n {\n // split head and data parts\n let m = fileString.match(/[^\\n]*\\n/)\n if (m === null)\n throw new Error(\"File has bad format - head not found.\")\n let head = m[0]\n let data = fileString.slice(head.length)\n\n // check file version\n if (head != \"v1.0.0\\n\")\n throw new Error(\"File version is not compatible.\")\n\n // parse data\n data = JSON.parse(data)\n\n // load the file\n let file = new File()\n\n file.meta = data.meta\n file.accounts = data.accounts.map(x => Account.deserialize(x))\n file.transactions = data.transactions.map(\n x => Transaction.deserialize(x, file.getAccount.bind(file))\n )\n\n return file\n }", "function readExtData (file) {\n console.error(`loading ${file}...`);\n return require(file).reduce((set, restaurant) => ({\n ...set,\n [restaurant.objectID]: restaurant\n }), {});\n}", "function onReadOBJFile(fileString, fileName, gl, o, scale, reverse) {\n var objDoc = new OBJDoc(fileName); // Create a OBJDoc object\n var result = objDoc.parse(fileString, scale, reverse);\n if (!result) {\n g_objDoc = null; g_drawingInfo = null;\n console.log(\"OBJ file parsing error.\");\n return;\n }\n g_objDoc = objDoc;\n}", "function onReadOBJFile(fileString, fileName, gl, o, scale, reverse) {\n var objDoc = new OBJDoc(fileName); // Create a OBJDoc object\n var result = objDoc.parse(fileString, scale, reverse);\n if (!result) {\n g_objDoc = null; g_drawingInfo = null;\n console.log(\"OBJ file parsing error.\");\n return;\n }\n g_objDoc = objDoc;\n}", "function Retrieval(id) {\n this._id = id;\n this._fullPath = getFilePath(this._id);\n\n fs.ReadStream.apply(this, [this._fullPath]);\n}", "load(fileobject) {\n \n\t// Read returns a structure f\n\tbisgenericio.read(fileobject).then( (f) => {\n\t \n\t let obj = { };\n\t try { \n\t\tobj= JSON.parse(f.data);\n\t } catch(e) {\n\t\twebutil.createAlert(`Failed to parse input file ${f.filename}`,true);\n\t }\n \n\t let newvalues = {};\n\t newvalues.weight=obj.weight || 70.0;\n\t newvalues.height=obj.height || 1.70;\n\t newvalues.ismetric=obj.ismetric || false;\n\t this.setValues(newvalues);\n\n webutil.createAlert('Loaded from '+f.filename,false);\n \n\t}).catch( (e) => {\n webutil.createAlert(e,true);\n });\n \n }", "async readDocument(ctx, documentId) {\n const exists = await this.documentExists(ctx, documentId);\n if (!exists) {\n throw new Error(`The document ${documentId} does not exist`);\n }\n const buffer = await ctx.stub.getState(documentId);\n const asset = JSON.parse(buffer.toString());\n return asset;\n }", "function onReadOBJFile(fileString, fileName, gl, o, scale, reverse) {\n var objDoc = new OBJDoc(fileName); // Create a OBJDoc object\n var result = objDoc.parse(fileString, scale, reverse);\n if (!result) {\n g_objDoc = null;\n g_drawingInfo = null;\n console.log(\"OBJ file parsing error.\");\n return;\n }\n g_objDoc = objDoc;\n}", "leerDB() {\n //Verificar si existe el archivo, si no existe, el array de historial queda como se declaro (vacio).\n if (fs.existsSync(this.dbPath)) {\n const info = fs.readFileSync(this.dbPath, { encoding: 'utf-8' });\n const data = JSON.parse(info);\n this.historial = data;\n }\n }", "function readObjectsFor(table, column, id, objectid, read, callback) {\n\tpg.connect(connectionString,\t\t\t\t\t\t\t\t\t\t\t\t// try to connect to the database\n\t\tfunction (error, database, done) {\n\t\t\tif (error) return callback(error);\t\t\t\t\t\t\t\t\t// if there was an error, return it\n\n\t\t\tvar querystring = selectFrom(\t\t\t\t\t\t\t\t\t\t// generate the read query string\n\t\t\t\ttable, [column], map(id, objectid)\n\t\t\t);\n\n\t\t\tquery(database, done, querystring,\t\t\t\t\t\t\t\t\t// query the database\n\t\t\t\tfunction (error, result) {\n\t\t\t\t\tif (error) return callback(error);\t\t\t\t\t\t\t// if there was an error, return it\n\t\t\t\t\tif (!result.length) return callback(SUCCESS, []);\t\t// if no matches were found, return an error\n\n\t\t\t\t\tvar ids = result;\n\t\t\t\t\tvar objects = [];\t\t\t\t\t\t\t\t\t\t\t// create an empty array to store objects\n\t\t\t\t\treadObjects(column, objects, ids, read,\t\t\t\t\t\t// read the requested objects into arrays\n\t\t\t\t\t\tfunction (error, result) {\n\t\t\t\t\t\t\tif (error) return callback(error);\t\t\t\t\t// if there was an error, return it\n\t\t\t\t\t\t\treturn callback(SUCCESS, result);\t\t\t\t\t// otherwise, return the result of the query\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n}", "function readData(entity, id, baseFolder) {\n\n setId(id);\n setEntity(entity);\n\n if (!baseFolder) baseFolder = config.appDataFolder;\n\n return getFileName(entity, baseFolder)\n .then(readFile)\n .then(processFile)\n .catch(logError);\n\n}", "function onReadOBJFile(fileString, fileName, scale, reverse) {\n var objDoc = new OBJDoc(fileName); // Create a OBJDoc object\n var result = objDoc.parse(fileString, scale, reverse);\n\n if (!result) {\n g_objDoc = null;\n g_drawingInfo = null;\n console.log(\"OBJ file parsing error\");\n } else {\n g_objDoc = objDoc;\n }\n }", "function loadDB(name) {\n\t\t\tif (!isSetObject('taffy_'+name)) return false;\n\t\t\tgetObject('taffy_'+name);\n\t\t}", "function PassiveRecord(db_name) {\n this.db = new SQLiteConnector(db_name);\n this.bootstrap();\n}", "function populateChessGameDatabase() {\r\n // Ensure a file is being passed as an argument.\r\n if (process.argv.length < 4) {\r\n console.log(process.argv[2] + \" is OK File\");\r\n } else {\r\n console.error(\"Error: Not valid arguments.\");\r\n process.exit(1);\r\n }\r\n // MySQL connection properties. Insert your own properties if you wish to run this.\r\n connection = mysql.createPool({\r\n connectionLimit: 500,\r\n host: 'local',\r\n user: 'COLEAR',\r\n password: 'xxx',\r\n database: 'chessgames',\r\n });\r\n this.readTextFile(filename);\r\n}", "constructor() {\n let dataFile = `${__dirname}/db.json`;\n super(dataFile);\n }", "function ReadPDBfile(file,callback)\r\n{\r\n\tvar self = this;\r\n\tvar name= PDButil.stripName(file.name);\r\n\t\r\n\t//Assigning Properties by reading the file\r\n\tvar pdbfileReader = new FileReader();\r\n\t\r\n\t//Reads the file\r\n\tpdbfileReader.readAsText(file);\r\n\t\r\n\t//When file is read, this function is called\r\n\tpdbfileReader.onload = loadStructureHandler;\r\n\tpdbfileReader.onerror = errorStructureHandler;\r\n\t\r\n\tfunction loadStructureHandler(event)\r\n\t{\r\n\t var content = event.target.result.split(\"\\n\");\r\n\t //console.log(content[1]);\r\n\t BuildStructure(name,content,callback, new ProgressDialog(\"Assimilating PDB file \"+name+\"...\"));\r\n\t};\r\n\r\n\tfunction errorStructureHandler(event)\r\n\t{\r\n\t console.log(\"Error while reading the file\");\r\n\t};\r\n \r\n}", "static readFile(callback) {\n DBHelper.fetchFile((error, data) => {\n if(error) {\n callback(error, null);\n }\n else {\n let reader = new FileReader();\n reader.readAsText(data);\n reader.onload = (event) => {\n let csv = event.target.result;\n let results = DBHelper.convertToJson(csv);\n callback(null, results);\n }\n reader.onerror = (event) => {\n if(event.target.error.name == \"NotReadableError\") {\n callback(`File cannot be read`, null);\n }\n }\n }\n });\n }", "function OBJReader () {}", "function loadFile(file){\n\tlet fs = require('fs');\n\tvar data = fs.readFileSync(file);\n\tvar contents = (JSON.parse(data));\n\treturn contents;\n}", "readSelectedFile() {\n var fileReader = new FileReader();\n var objFile = document.getElementById(\"fileInput\").files[0];\n\n if (!objFile) {\n alert(\"OBJ file not set!\");\n return;\n }\n\n fileReader.readAsText(objFile);\n fileReader.onloadend = function() {\n // alert(fileReader.result);\n var customObj = new CustomOBJ(shader, fileReader.result);\n _inputHandler.scene.addGeometry(customObj);\n }\n }", "init() {\n return sqlite\n .open(`${this.server.paths.data}/database.db`, { Promise })\n .then((db) => {\n const schema = fs.readFileSync(`${this.server.paths.root}/server/schema.sql`).toString();\n return db.exec(schema);\n })\n .then((db) => {\n this.db = db;\n });\n }", "function onReadOBJFile(fileString, so, gl, scale, reverse) {\n var objDoc = new OBJDoc(so.filePath); // Create a OBJDoc object\n objDoc.defaultColor = so.color;\n var result = objDoc.parse(fileString, scale, reverse); // Parse the file\n if (!result) {\n so.objDoc = null; so.drawingInfo = null;\n console.log(\"OBJ file parsing error.\");\n return;\n }\n so.objDoc = objDoc;\n}", "function loadData() {\r\n var phoneBookObj = {};\r\n\r\n //try read file//\r\n try {\r\n var content = fs.readFileSync('myFile.txt', 'utf8');\r\n }\r\n\r\n //error with reading file//\r\n catch(err) {\r\n content = \"\";\r\n return content;\r\n }\r\n \r\n //file is exist//\r\n if(content) {\r\n try {\r\n phoneBookObj = JSON.parse(content);\r\n }\r\n\r\n catch (err) {\r\n content = 'error data';\r\n return content;\r\n }\r\n }\r\n \r\n //file is empty//\r\n else {\r\n return \"empty\";\r\n }\r\n\r\n //evrything ok//\r\n if(phoneBookObj) {\r\n return phoneBookObj;\r\n }\r\n }", "function ImportData() {\n //in this method we can connect to database or read our necessery info from file\n //Currently we read registered users from file and History matches from file(maybe) and save to lists\n ReadFromFile();\n}", "function readFile(name) {\n console.log(\"Reading all\");\n fs.readFile(name, async (err, data) => {\n if (err) {\n console.error(err)\n return\n }\n console.log(\"Read...\");\n neatCsv(data).then((data) => {\n res = {}\n data.forEach((elem) => {\n res[elem['cat']] = 1;\n });\n console.log(res);\n /* const batchSize=400;\n for(var i = 0; i < data.length; i+=batchSize) {\n var batch = db.batch();\n data.slice(i,i+batchSize).forEach((elem)=>{\n console.log(elem);\n addElem(batch,elem);\n });\n console.log(\"Commiting\");\n batch.commit();\n };\n */\n });\n });\n }", "loadFromFile(path, callback){\n\t\tfs.readFile(path, 'utf8', function(err, data){\n\t\t\tif(err){\n\t\t\t\tconsole.log(err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//data is the string returned by fs's readFile function.\n\t\t\tlet newData = JSON.parse(data);\n\n\t\t\tthis.idIterator = newData.idIterator;\n\t\t\tthis.currentFeature = newData.currentFeature;\n\t\t\tthis.geo = newData.geo;\n\t\t\tcallback();\n\t\t}.bind(this))\n\t}", "function table_orders (){\n var filebuffer = fs.readFileSync('orders_tpv.db');\n var db = new sqlite3.Database(filebuffer);\n sqlstr = \"SELECT * FROM orders;\";\n var results = db.exec(sqlstr);\n var dataset = results[0];\n db.close();\n return dataset;\n}", "function read(id, cb) {\n const key = ds.key([kind, parseInt(id, 10)]);\n ds.get(key, (err, entity) => {\n cb(null, fromDatastore(entity));\n });\n}", "'export'() {\n for (let _ in this.statements) { const stmt = this.statements[_]; stmt['free'](); }\n this.handleError(sqlite3_close_v2(this.db));\n const binaryDb = readFile(this.filename, { encoding: \"binary\" });\n this.handleError(sqlite3_open(this.filename, apiTemp));\n this.db = getValue(apiTemp, 'i32');\n return binaryDb;\n }", "function loadObj(name, file)\n{\n let obj_info = ObjectPool[name].ObjectInfo;\n if (obj_info == null) return null;\n\n if (file == null)\n {\n obj_info.positions = [];\n obj_info.indices = [];\n obj_info.textureCoordinates = [];\n obj_info.textureIndices = [];\n obj_info.vertexNormals = [];\n obj_info.normalIndices = [];\n return null;\n }\n\n let strs = (file.name).split(\".\");\n if (strs[1] !== \"obj\") return null;\n\n let reader = new FileReader();\n\n reader.onload = function () {\n let res = objStrAna(this.result);\n let lines = res.split('=');\n let objInfo = {\n verPosition : [],\n texPosition : [],\n norPosition : [],\n indicesForVer : [],\n indicesForTex : [],\n indicesForNor : []\n };\n for (let id in lines){\n let line = lines[id];\n let items = line.split(' ');\n switch (items[0]){\n case 'v' :\n objInfo.verPosition.push(parseFloat(items[1]));\n objInfo.verPosition.push(parseFloat(items[2]));\n objInfo.verPosition.push(parseFloat(items[3]));\n break;\n\n case 'vt' :\n objInfo.texPosition.push(parseFloat(items[1]));\n objInfo.texPosition.push(parseFloat(items[2]));\n //objInfo.texPosition.push(parseFloat(items[3]));\n break;\n\n case 'vn' :\n objInfo.norPosition.push(parseFloat(items[1]));\n objInfo.norPosition.push(parseFloat(items[2]));\n objInfo.norPosition.push(parseFloat(items[3]));\n break;\n\n case 'f' :\n for (let i=1; i<=3; i++) {\n let iitems = items[i].split('\\/');\n objInfo.indicesForVer.push(parseInt(iitems[0]) - 1);\n if (iitems[1].length > 0)\n objInfo.indicesForTex.push(parseInt(iitems[1]) - 1);\n if (iitems[2].length > 0)\n objInfo.indicesForNor.push(parseInt(iitems[2]) - 1);\n }\n\n break;\n\n default :\n let list = [];\n for (let i=1; i<items.length; i++){\n list.push(items[i]);\n }\n if (items[0] === '') break;\n objInfo[items[0]] = list;\n break;\n\n }\n\n }\n\n let maxVer = [-1000000.0, -1000000.0, -1000000.0];\n let minVer = [1000000.0, 1000000.0, 1000000.0];\n for (let id in objInfo.verPosition){\n let item = objInfo.verPosition[id];\n if (maxVer[id%3] < item) maxVer[id%3] = item;\n if (minVer[id%3] > item) minVer[id%3] = item;\n }\n let delta = 0;\n for (let i=0; i<3; i++){\n if (maxVer[i] - minVer[i] > delta){\n delta = maxVer[i] - minVer[i];\n }\n }\n\n for (let id in objInfo.verPosition){\n let item = objInfo.verPosition[id];\n objInfo.verPosition[id] = item / delta;\n }\n\n obj_info.positions = objInfo.verPosition;\n obj_info.indices = objInfo.indicesForVer;\n obj_info.textureCoordinates = objInfo.texPosition;\n obj_info.textureIndices = objInfo.indicesForTex;\n obj_info.vertexNormals = objInfo.norPosition;\n obj_info.normalIndices = objInfo.indicesForNor;\n\n refreshItemInObjectPool(name);\n };\n\n reader.readAsText(file);\n\n return file;\n}", "function getItem(object, id) {\r\n var rtn;\r\n\r\n try {\r\n rtn = JSON.parse(fs.readFileSync(folder + object + '/' + id));\r\n } catch (ex) {\r\n rtn = exception(\"SimpleStorage: [\"+object+\"]\", ex.message, 400);\r\n }\r\n\r\n return rtn;\r\n}", "async function readObject ({\n dir,\n gitdir = path__WEBPACK_IMPORTED_MODULE_0___default.a.join(dir, '.git'),\n fs: _fs,\n oid,\n format = 'parsed'\n}) {\n const fs = new FileSystem(_fs);\n // GitObjectManager does not know how to parse content, so we tweak that parameter before passing it.\n const _format = format === 'parsed' ? 'content' : format;\n let result = await GitObjectManager.read({ fs, gitdir, oid, format: _format });\n if (format === 'parsed') {\n switch (result.type) {\n case 'commit':\n result.object = GitCommit.from(result.object).parse();\n break\n case 'tree':\n result.object = { entries: GitTree.from(result.object).entries() };\n break\n case 'blob':\n break\n case 'tag':\n throw new Error(\n 'TODO: Parsing annotated tag objects still needs to be implemented!!'\n )\n default:\n throw new Error(`Unrecognized git object type: '${result.type}'`)\n }\n result.format = 'parsed';\n }\n return result\n}", "async read(filepath) {\n try {\n return await this.reader(filepath, 'utf-8');\n } catch (error) {\n return undefined;\n }\n }", "read() {\n return JSON.parse(\n new File(this.path).read()\n );\n }", "function diserialize_object_database(key) {\n var obj = get_item_database(key);\n return JSON.parse(obj);\n}" ]
[ "0.71794087", "0.68327975", "0.6694844", "0.65316683", "0.6498033", "0.628159", "0.6225904", "0.61525357", "0.6141926", "0.610741", "0.61040515", "0.60082334", "0.5952637", "0.5939405", "0.58726233", "0.5830468", "0.5823237", "0.5663781", "0.56221026", "0.5570073", "0.5556651", "0.5538973", "0.55363196", "0.55297333", "0.55204874", "0.55084634", "0.55055285", "0.5503363", "0.54524034", "0.5442556", "0.5424393", "0.54190713", "0.5413846", "0.53901345", "0.5368553", "0.53604406", "0.53476566", "0.5336392", "0.5313771", "0.5293091", "0.52801836", "0.52554893", "0.5253006", "0.52077997", "0.5207299", "0.52062553", "0.52044445", "0.52029616", "0.52028334", "0.51981866", "0.51981866", "0.5183273", "0.516938", "0.51673394", "0.5164255", "0.5160379", "0.5159911", "0.5158931", "0.51471967", "0.51212937", "0.51193184", "0.5113565", "0.51080906", "0.50944", "0.50888187", "0.5084587", "0.5084132", "0.5084132", "0.508219", "0.5077074", "0.5074252", "0.5073538", "0.5070392", "0.50640523", "0.5057968", "0.5034017", "0.50228333", "0.5018899", "0.4988421", "0.49817118", "0.4980074", "0.49794516", "0.4962975", "0.49578038", "0.49573615", "0.49470457", "0.4946245", "0.4945483", "0.49447975", "0.492237", "0.49186695", "0.49140874", "0.49133286", "0.49090716", "0.49053016", "0.49011818", "0.48885524", "0.4872542", "0.48626408", "0.48576492" ]
0.6434743
5
Label an image with unary and pairwise terms. TODO: alphaexpansion
function imageCRFLabel(imageData, unary, lambda) { var contrast = imageCRFContrast(imageData); // constract maxflow graph var g = maxFlowInit(); maxFlowAddNodes(g, imageData.width * imageData.height); // add unary terms for (var y = 0; y < imageData.height; y++) { for (var x = 0; x < imageData.width; x++) { var u = y * imageData.width + x; maxFlowAddSourceEdge(g, u, unary[y][x]); } } // add pairwise terms for (var y = 1; y < imageData.height; y++) { for (var x = 0; x < imageData.width; x++) { var u = (y - 1) * imageData.width + x; var v = y * imageData.width + x; maxFlowAddEdge(g, u, v, lambda * contrast.north[y][x]); maxFlowAddEdge(g, v, u, lambda * contrast.north[y][x]); } } for (var y = 0; y < imageData.height; y++) { for (var x = 1; x < imageData.width; x++) { var u = y * imageData.width + x; maxFlowAddEdge(g, u, u - 1, lambda * contrast.west[y][x]); maxFlowAddEdge(g, u - 1, u, lambda * contrast.west[y][x]); } } var diagLambda = lambda / Math.sqrt(2.0); for (var y = 1; y < imageData.height; y++) { for (var x = 1; x < imageData.width; x++) { var u = (y - 1) * imageData.width + x - 1; var v = y * imageData.width + x; maxFlowAddEdge(g, u, v, diagLambda * contrast.northwest[y][x]); maxFlowAddEdge(g, v, u, diagLambda * contrast.northwest[y][x]); } } for (var y = 1; y < imageData.height; y++) { for (var x = 0; x < imageData.width - 1; x++) { var u = (y - 1) * imageData.width + x + 1; var v = y * imageData.width + x; maxFlowAddEdge(g, u, v, diagLambda * contrast.northeast[y][x]); maxFlowAddEdge(g, v, u, diagLambda * contrast.northeast[y][x]); } } // find mincut var f = maxFlowBK(g); // generate labels var labels = []; for (var y = 0; y < imageData.height; y++) { var column = []; for (var x = 0; x < imageData.width; x++) { var u = y * imageData.width + x; column[x] = (g.cut[u] == MAX_FLOW_SOURCE) ? 1 : 0; } labels[y] = column; } return labels; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Label() { // Labels (-1 means empty, -2 means undefined)\r\n this.even = undefined; // Even label: alternating path of even distance from root to vertex\r\n this.odd = []; // Odd label: base nodes of blossoms can have two\r\n}", "function encodeLabels(segmentation, data) {\n for (var i = 0; i < segmentation.length; ++i) {\n var value = Math.floor(segmentation[i]);\n data[4 * i + 0] = value & 255;\n data[4 * i + 1] = (value >>> 8) & 255;\n data[4 * i + 2] = (value >>> 16) & 255;\n data[4 * i + 3] = 255;\n }\n }", "createLabelsAsSprites() {\n this.labelsGroup.clear();\n const verticesHashMap = this.createVerticesHashMap();\n Object.entries(verticesHashMap).forEach(([key, vertices]) => {\n for (let i = 0; i < vertices.length; i += 3) {\n const atomPosition = new THREE.Vector3().fromArray(vertices, i);\n const labelSprite = this.createLabelSprite(key, `label-for-${key}`);\n const offsetVector = this.getLabelOffsetVector(atomPosition, key);\n labelSprite.userData = { atomPosition, atomName: key };\n labelSprite.position.addVectors(atomPosition, offsetVector);\n this.labelsGroup.add(labelSprite);\n }\n });\n this.structureGroup.add(this.labelsGroup);\n }", "function addLabels(fieldName) {\n return new LabelClass({\n labelExpressionInfo: { expression: \"$feature.\"+fieldName },\n symbol: {\n type: \"text\", // autocasts as new TextSymbol()\n color: state.bgColor == \"light\" ? \"#1e4667\" : \"white\",\n haloSize: 1.5,\n haloColor: state.bgColor == \"light\" ? \"white\" : \"black\",\n font: {\n size: '14px',\n }\n }\n // these ArcGIS label class properties don't exist in the JSAPI ... yet\n // removeDuplicates: \"all\",\n // removeDuplicatesDistance: 0,\n // repeatLabel: false,\n // repeatLabelDistance: 500,\n });\n }", "function addTrainingImage(trainingImage, label) {\n const y = tf.tidy(() => tf.oneHot(tf.tensor1d([label], 'int32'), NUM_CLASSES));\n\n if (this.xs == null) {\n this.xs = tf.keep(trainingImage);\n this.ys = tf.keep(y);\n } else {\n const oldX = this.xs;\n this.xs = tf.keep(oldX.concat(trainingImage, 0));\n\n const oldY = this.ys;\n this.ys = tf.keep(oldY.concat(y, 0));\n\n oldX.dispose();\n oldY.dispose();\n y.dispose();\n }\n}", "function labelTransform(d) {\n const x = (d.x0 + d.x1) / 2 * 180 / Math.PI;\n const y = (d.y0 + d.y1) / 2 * radius;\n return `rotate(${x - 90}) translate(${y},0) rotate(${x < 180 ? 0 : 180})`;\n }", "function getLabelImage( imgPars )\n {\n var shape = imgPars.shape;\n var size = imgPars.size || [200,200];\n var color = imgPars.color;\n\n canvas.width = size[0];\n canvas.height = size[1];\n switch( imgPars.shape )\n {\n case 'bar':\n ctx.fillStyle = color;\n ctx.rect( 0, 0, canvas.width, canvas.height );\n ctx.fill();\n return canvas.toDataURL();\n }\n }", "function draw_labels(data, opt) {\n for (let i = 0; i < data.no_examples(); i++) {\n let xe = data.x[i];\n let ye = data.y[i];\n let x1 = (xe[0] - opt[2]) / opt[0] * 100;\n let x2 = (xe[1] - opt[3]) / opt[1] * 100;\n drawlabel(x1, x2, ye);\n }\n}", "function beginLabel(TokenConstructor) {\n\tvar token = new TokenConstructor('html_inline', '', 0);\n\ttoken.content = '<label>';\n\treturn token;\n}", "function beginLabel(TokenConstructor) {\n\tvar token = new TokenConstructor('html_inline', '', 0);\n\ttoken.content = '<label>';\n\treturn token;\n}", "function simpleAddIndices(in_image){\r\n in_image = in_image.addBands(in_image.normalizedDifference(['nir', 'red']).select([0],['NDVI']));\r\n in_image = in_image.addBands(in_image.normalizedDifference(['nir', 'swir2']).select([0],['NBR']));\r\n in_image = in_image.addBands(in_image.normalizedDifference(['nir', 'swir1']).select([0],['NDMI']));\r\n in_image = in_image.addBands(in_image.normalizedDifference(['green', 'swir1']).select([0],['NDSI']));\r\n \r\n return in_image;\r\n}", "function labelDetection (imageURL, cb) {\n var labelsArr = [];\n client\n .labelDetection(imageURL)\n .then(results => {\n var labels = results[0].labelAnnotations;\n for (var i = 0; i < 5; i++) {\n labelsArr.push(labels[i].description);\n }\n cb(labelsArr);\n // console.log('Labels:');\n // labels.forEach(label => console.log(label.description));\n })\n .catch(err => {\n console.error('ERROR:', err);\n });\n}", "function setLabel(props){\n //label content\n var labelAttribute = \"<h1>\" + props[expressed] +\n \"</h1>\" + expressed + \"</b>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.adm1_code + \"_label\")\n .html(labelAttribute)\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html((props.NAME_1 + \" Region\").bold());\n }", "function findLabel( operatorArray, index, direction, label ){\n\tlabel=\":\"+label;\n\t\n\tvar i;\n\tif( direction!=\"-\" ){\n\t\tvar imax=operatorArray.length;\n\t\tfor(i=index+1;i<imax;i++){\n\t\t\tif( operatorArray[i]==label ) return i;\n\t\t}\n\t}\n\t\n\tif( direction!=\"+\" ){\n\t\tfor(i=index-1;i>=0;i--){\n\t\t\tif( operatorArray[i]==label ) return i;\n\t\t}\n\t}\n\t\n\tif( label===\":last\" ) return operatorArray.length-1;\n\tif( label===\":first\" ) return 0;\n}", "function addLabel(semantic, element) {\n var bounds = semantic.gfx.labelBounds;\n var visible = true, label;\n if (semantic.type === 'transition') {\n visible = visible && !semantic.isAuto;\n visible = visible && (typeof semantic.gfx.labelVisible === 'undefined' ? true : semantic.gfx.labelVisible);\n visible = visible && semantic.action;\n } else {\n visible = visible && semantic.name;\n }\n label = this._elementFactory.createLabel(\n elementData(semantic, {\n id: semantic.id + '_label',\n labelTarget: element,\n type: 'label',\n hidden: !visible,\n x: Math.round(bounds.x),\n y: Math.round(bounds.y),\n width: Math.round(bounds.width),\n height: Math.round(bounds.height)\n })\n );\n\n return this._canvas.addShape(label, element.parent);\n}", "function ImageLabel(id, caption, image) {\r\n if (id != UI_NO_INIT_ID) {\r\n this.init(id, caption, image);\r\n }\r\n}", "function NDVI(image)\n{\n return image.expression('((b(\"B4\") - b(\"B3\")) / (b(\"B4\") + b(\"B3\")))');\n}", "function label(label) {\n return function(s) {\n var delta = s.length - label.length;\n return strRepeat (' ', Math.floor (delta / 2)) + label +\n strRepeat (' ', Math.ceil (delta / 2));\n };\n }", "function rightLabels() {\n let labels = ['0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9'];\n // Solvent labels\n push();\n fill(128, 0, 128);\n textSize(18);\n for (let i = 0; i < labels.length; i++) {\n text(labels[i], 90 + 40 * (i + 1), 475);\n if (i == labels.length - 1) {\n textSize(22);\n text('solvent', 510, 460);\n }\n }\n pop();\n // Solute labels\n push();\n fill(0, 0, 255);\n textSize(18);\n for (let i = 0; i < labels.length; i++) {\n text(labels[i], 70, 450 - 40 * (i + 1));\n if (i == labels.length - 1) {\n textSize(22);\n noStroke();\n text('solute', 70, 40);\n }\n }\n pop();\n push();\n textSize(22);\n fill(255, 100, 0);\n noStroke();\n text('carrier', 35, 470)\n pop();\n push();\n textSize(22);\n text('solvent mass fraction', 200, 520);\n let angle1 = radians(270);\n translate(35, 350);\n rotate(angle1);\n text('solute mass fraction', 0, 0);\n pop();\n}", "function setLabel(props){\n //label content\n var labelAttribute = \"<h2>\" + props[expressed] +\n \"</h2>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.name + \"_label\")\n .html(labelAttribute);\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.name);\n}", "function makeLabels() {\n svgContainer.append('text')\n .attr('x', 100)\n .attr('y', 40)\n .style('font-size', '14pt')\n .text(\"Fertility vs Life Expectancy (1980)\");\n\n svgContainer.append('text')\n .attr('x', 130)\n .attr('y', 490)\n .style('font-size', '10pt')\n .text('Fertility Rates (Avg Children per Woman)');\n\n svgContainer.append('text')\n .attr('transform', 'translate(15, 300)rotate(-90)')\n .style('font-size', '10pt')\n .text('Life Expectancy (years)');\n }", "function beginLabel(TokenConstructor) {\n var token = new TokenConstructor('html_inline', '', 0);\n token.content = '<label>';\n return token;\n}", "createLabels() {\n if (this.settings.labelsConfig.areSpritesUsed) {\n this.createLabelsAsSprites();\n } else {\n this.createLabelsAsPoints();\n }\n this.render();\n }", "function setLabelTransformation(d) {\n return 'rotate(' + (d.angle * 180 / Math.PI - 90) + ')translate(' + (r0 + 20) + ')' + (d.angle > Math.PI ? 'rotate(180)' : '');\n }", "labelTransform(data, labelKey) {\n if (this.labelNodes[labelKey]) {\n const { width, height } = this.labelNodes[labelKey].getBBox();\n const [cX, cY] = this.arc.centroid(data);\n\n return `translate(${[cX -width/2, cY + height/2]})`\n } else {\n return `translate(${this.arc.centroid(data)})`\n }\n }", "function NDSV(image, b1, b2)\n{\n //print('((b(\\\"' + b2 + '\\\") - b(\\\"' + b1 + '\\\")) / (b(\\\"' + b2 + '\\\") + b(\\\"'+ b1 + '\\\"))) ');\n return image.expression(\n '((b(\\\"' + b2 + '\\\") - b(\\\"' + b1 + '\\\")) / (b(\\\"' + b2 + '\\\") + b(\\\"'+ b1 + '\\\"))) ');\n}", "function generateLabels(l) {\n\t var a = [],\n\t i;\n\t for (i = 0; i < l; i++) {\n\t a[i] = s.labels && s.labels[i] ? s.labels[i] : i;\n\t }\n\t return a;\n\t }", "function Label(text,point_posision) {\n this.tag =\"Label\";\n this.emptyContext = new Object();\n\n\n}", "function addIndices(img){\r\n // Add Normalized Difference Spectral Vector (NDSV)\r\n img = img.addBands(img.normalizedDifference(['blue','green']).rename('ND_blue_green'));\r\n img = img.addBands(img.normalizedDifference(['blue','red']).rename('ND_blue_red'));\r\n img = img.addBands(img.normalizedDifference(['blue','nir']).rename('ND_blue_nir'));\r\n img = img.addBands(img.normalizedDifference(['blue','swir1']).rename('ND_blue_swir1'));\r\n img = img.addBands(img.normalizedDifference(['blue','swir2']).rename('ND_blue_swir2'));\r\n\r\n img = img.addBands(img.normalizedDifference(['green','red']).rename('ND_green_red'));\r\n img = img.addBands(img.normalizedDifference(['green','nir']).rename('ND_green_nir')); //NDWBI\r\n img = img.addBands(img.normalizedDifference(['green','swir1']).rename('ND_green_swir1')); //NDSI, MNDWI\r\n img = img.addBands(img.normalizedDifference(['green','swir2']).rename('ND_green_swir2'));\r\n\r\n img = img.addBands(img.normalizedDifference(['red','swir1']).rename('ND_red_swir1'));\r\n img = img.addBands(img.normalizedDifference(['red','swir2']).rename('ND_red_swir2'));\r\n \r\n \r\n img = img.addBands(img.normalizedDifference(['nir','red']).rename('ND_nir_red')); //NDVI\r\n img = img.addBands(img.normalizedDifference(['nir','swir1']).rename('ND_nir_swir1')); //NDWI, LSWI, -NDBI\r\n img = img.addBands(img.normalizedDifference(['nir','swir2']).rename('ND_nir_swir2')); //NBR, MNDVI\r\n\r\n img = img.addBands(img.normalizedDifference(['swir1','swir2']).rename('ND_swir1_swir2'));\r\n \r\n // Add ratios\r\n img = img.addBands(img.select('swir1').divide(img.select('nir')).rename('R_swir1_nir')); //ratio 5/4\r\n img = img.addBands(img.select('red').divide(img.select('swir1')).rename('R_red_swir1')); // ratio 3/5\r\n\r\n // Add Enhanced Vegetation Index (EVI)\r\n var evi = img.expression(\r\n '2.5 * ((NIR - RED) / (NIR + 6 * RED - 7.5 * BLUE + 1))', {\r\n 'NIR': img.select('nir'),\r\n 'RED': img.select('red'),\r\n 'BLUE': img.select('blue')\r\n }).float();\r\n img = img.addBands(evi.rename('EVI'));\r\n \r\n // Add Soil Adjust Vegetation Index (SAVI)\r\n // using L = 0.5;\r\n var savi = img.expression(\r\n '(NIR - RED) * (1 + 0.5)/(NIR + RED + 0.5)', {\r\n 'NIR': img.select('nir'),\r\n 'RED': img.select('red')\r\n }).float();\r\n img = img.addBands(savi.rename('SAVI'));\r\n \r\n // Add Index-Based Built-Up Index (IBI)\r\n var ibi_a = img.expression(\r\n '2*SWIR1/(SWIR1 + NIR)', {\r\n 'SWIR1': img.select('swir1'),\r\n 'NIR': img.select('nir')\r\n }).rename('IBI_A');\r\n var ibi_b = img.expression(\r\n '(NIR/(NIR + RED)) + (GREEN/(GREEN + SWIR1))', {\r\n 'NIR': img.select('nir'),\r\n 'RED': img.select('red'),\r\n 'GREEN': img.select('green'),\r\n 'SWIR1': img.select('swir1')\r\n }).rename('IBI_B');\r\n ibi_a = ibi_a.addBands(ibi_b);\r\n var ibi = ibi_a.normalizedDifference(['IBI_A','IBI_B']);\r\n img = img.addBands(ibi.rename('IBI'));\r\n \r\n\r\n return img;\r\n}", "function drawLabels() {\n\tvar labelRadius = (table.outerR - table.innerR)/4;\n\tvar halfAngle = (segments.segmentArray[0].endAngle - segments.segmentArray[0].startAngle)/2;\n\n\tfor (var i = 0; i < numTentacles; i++) {\n\t\tvar diff = (table.outerR - table.innerR)/2;\n\t\tvar position = halfAngle + segments.segmentArray[i].startAngle;\n\t\tvar x = (table.centerX + (table.innerR + diff) * Math.cos(position));\n\t\tvar y = (table.centerY + (table.innerR + diff) * Math.sin(position));\n\n\t\t// Colors\n\t\tctx.fillStyle = \"rgba(173,255,47,0.5)\";\n\t\tctx.lineWidth = 3;\n\t\t\n\t\t// Draw plates\n\t\tctx.beginPath();\n\t\tctx.arc(x, y, labelRadius, 0, 2*Math.PI, true);\n\t\tctx.closePath();\n\t\tctx.fill();\n\n\t\tctx.fillStyle = game.bgColor;\n\t\tctx.font = \"bold \" + game.titleSize +\"px Helvetica\";\n\t\tctx.textAlign = \"center\";\n\t\tctx.fillText(button[i],x,y+game.titleSize*0.4);\n\t}\n}", "function beginLabel(TokenConstructor) {\n var token = new TokenConstructor('html_inline', '', 0);\n token.content = '<label>';\n return token;\n }", "function prepOli(img) {\n var orig = img;\n img = renameOli(img);\n img = fmask(img);\n img = calcNbr(img);\n return ee.Image(img.copyProperties(orig, orig.propertyNames()));\n}", "function Label() {\n Shape.call(this);\n\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "function Label() {\n Shape.call(this);\n\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "function drawLabels(vec){\n context.strokeStyle = \"rgb(0,200,0)\"; \n context.font = '18pt Calibri';\n for(var i = 0; i < vec.length; i++){\n context.strokeText(i.toString(), vec[i].x, vec[i].y); \n } \n context.strokeStyle = \"rgb(0,0,0)\"; \n}", "function Label() {\n Shape.call(this);\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "function Label() {\n Shape.call(this);\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "function createLabels(varname, positions, range) {\n if (!positions) {\n console.log('[error] Create labels requires positions (x,y,z) array');\n return;\n }\n\n if (positions.length % 3 !== 0) {\n console.log('[error] Create labels require positions array contain 3d points');\n return;\n }\n\n if (!range) {\n console.log('[error] Create labels requires Valid range');\n return;\n }\n\n var actor = null,\n size = vgl.utils.computePowerOfTwo(48),\n index = 0,\n actors = [],\n origin = [],\n pt1 = [],\n pt2 = [],\n delta = (positions[6] - positions[0]),\n axisLabelOffset = 4, i;\n\n origin.length = 3;\n pt1.length = 3;\n pt2.length = 3;\n\n // For now just create labels for end points\n for (i = 0; i < 2; ++i) {\n index = i * (positions.length - 3);\n\n origin[0] = positions[index] - delta;\n origin[1] = positions[index + 1] - 2 * delta;\n origin[2] = positions[index + 2];\n\n pt1[0] = positions[index] + delta;\n pt1[1] = origin[1];\n pt1[2] = origin[2];\n\n pt2[0] = origin[0];\n pt2[1] = positions[1];\n pt2[2] = origin[2];\n\n actor = vgl.utils.createTexturePlane(\n origin[0], origin[1], origin[2],\n pt1[0], pt1[1], pt1[2],\n pt2[0], pt2[1], pt2[2], true);\n\n actor.setReferenceFrame(vgl.boundingObject.ReferenceFrame.Absolute);\n actor.material().setBinNumber(vgl.material.RenderBin.Overlay);\n actor.material().addAttribute(vgl.utils.create2DTexture(\n range[i].toFixed(2).toString(), 12, null));\n actors.push(actor);\n }\n\n // Create axis label\n origin[0] = (positions[0] + positions[positions.length - 3] - size) * 0.5;\n origin[1] = positions[1] + axisLabelOffset;\n origin[2] = positions[2];\n\n pt1[0] = origin[0] + size;\n pt1[1] = origin[1];\n pt1[2] = origin[2];\n\n pt2[0] = origin[0];\n pt2[1] = origin[1] + size;\n pt2[2] = origin[2];\n\n actor = vgl.utils.createTexturePlane(\n origin[0], origin[1], origin[2],\n pt1[0], pt1[1], pt1[2],\n pt2[0], pt2[1], pt2[2], true);\n actor.setReferenceFrame(vgl.boundingObject.ReferenceFrame.Absolute);\n actor.material().setBinNumber(vgl.material.RenderBin.Overlay);\n actor.material().addAttribute(vgl.utils.create2DTexture(\n varname, 24, null));\n actors.push(actor);\n\n return actors;\n }", "function setLabel(props){\n //label content\n var labelAttribute = \"<h1>\" + props[expressed] + \"%\" +\n \"</h1><b>\" + \"Percent \" + expressed + \"</b>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.NAME_1 + \"_label\")\n .html(labelAttribute);\n\n var stateName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.NAME_1);\n}", "function addlbl() {\n}", "function setLabel(props){\n\t\t//Label content\n\t\tlet labelAttribute = \"<h1>\" + props[expressed] +\n\t\t\t\"</h1><b>\" + expressed + \"</b>\";\n\n\t\t//Create info label div\n\t\tlet infoLabel = d3.select(\"body\")\n\t\t\t.append(\"div\")\n\t\t\t.attr(\"class\", \"infoLabel\")\n\t\t\t.attr(\"id\", props.name + \"_label\")\n\t\t\t.html(labelAttribute);\n\n\t\tlet countryName = infoLabel.append(\"div\")\n\t\t\t.attr(\"class\", \"labelname\")\n\t\t\t.html(props.name);\n\t}", "function novel_collectLabels()\n{\n for (var i = 0; i < novel_script.length; i += 2)\n {\n if (novel_script[i] == label)\n {\n novel.labels[novel_script[i + 1]] = i;\n }\n else if (novel_script[i] == sub)\n {\n novel.subs[novel_script[i+1]] = i;\n }\n }\n}", "createLabels(x_label, y_label) {\r\n\t\tlet oldText = this.texts.selectAll('text');\r\n\t\toldText.remove();\r\n\t\tthis.texts.append('text')\r\n\t\t\t.attr('x', this.offset.x + this.cell_size * this.numCols / 2 - this.cell_size)\r\n\t\t\t.attr('y', this.offset.y + (this.cell_size * this.numRows) + this.cell_size)\r\n\t\t\t.attr('font-family', 'sans-serif')\r\n\t\t\t.attr('font-size', this.text_sizes.normal)\r\n\t\t\t.text(this.x_axis_label + ' (' + this.x_units + ')');\r\n\t\tthis.texts.append('text')\r\n\t\t\t.attr('transform', `rotate(-90)`)\r\n\t\t\t.attr('x', -(this.offset.y + (this.cell_size * this.numRows) / 2 + this.cell_size))\r\n\t\t\t.attr('y', this.offset.x - this.cell_size)\r\n\t\t\t.attr('font-family', 'sans-serif')\r\n\t\t\t.attr('font-size', this.text_sizes.normal)\r\n\t\t\t.text(this.y_axis_label + ' (' + this.y_units + ')');\r\n\t}", "function updateLabels() {\n for (const label of [...document.getElementsByClassName('ehp-label')]) {\n label.parentElement.removeChild(label);\n }\n actions = {};\n for (const label of labels) {\n const element = label.element && (label.element instanceof Node ? label.element : label.element()) || document.createElement('div');\n actions[label.key] = label.action || (element => () => { element.click(); })(element.querySelector('a'));\n if (element) {\n element.style.position = 'relative';\n }\n const el = document.createElement('div');\n el.style.position = 'absolute';\n el.style.border = '1px solid var(--foreground)';\n el.style.borderRadius = '2px';\n el.style.top = '1px';\n el.style.left = '-10px';\n el.style.width = '1em';\n el.style.lineHeight = '1em';\n el.style.backgroundColor = 'var(--background)';\n el.style.color = 'var(--foreground)';\n el.style.textAlign = 'center';\n el.style.fontWeight = 'bold';\n el.style.display = 'none';\n el.classList.add('ehp-label');\n if (label.action) {\n el.style.top = 'calc(50% - 0.5em)';\n el.style.left = 'calc(50% - 0.5em)';\n }\n if (label.top) { el.style.top = label.top; }\n if (label.left) { el.style.left = label.left; }\n el.innerText = label.key;\n element.appendChild(el);\n }\n\n\n\n for (const label of [...document.getElementsByClassName('ehp-tag-label')]) {\n label.parentElement.removeChild(label);\n }\n tagActions = {};\n for (const label of tagLabels) {\n const element = label.element && (label.element instanceof Node ? label.element : label.element()) || document.createElement('div');\n tagActions[label.key] = label.action || (element => () => { element.click(); })(element.querySelector('a'));\n if (element) {\n element.style.position = 'relative';\n }\n const el = document.createElement('div');\n el.style.position = 'absolute';\n el.style.border = '1px solid var(--foreground)';\n el.style.borderRadius = '2px';\n el.style.top = '1px';\n el.style.left = '-10px';\n el.style.width = '1em';\n el.style.lineHeight = '1em';\n el.style.backgroundColor = 'var(--background)';\n el.style.color = 'var(--foreground)';\n el.style.textAlign = 'center';\n el.style.fontWeight = 'bold';\n el.style.display = 'none';\n el.classList.add('ehp-tag-label');\n if (label.action) {\n el.style.top = 'calc(50% - 0.5em)';\n el.style.left = 'calc(50% - 0.5em)';\n }\n if (label.top) { el.style.top = label.top; }\n if (label.left) { el.style.left = label.left; }\n el.innerText = label.key;\n element.appendChild(el);\n }\n }", "function renderLabel(rowid) {\n var lbldata = JSON.parse(document.getElementById(rowid).dataset.label_rw).label;\n// RENDER LABEL\n // create the label's text from its name and add emojis if present in \n // the label name\n var imgtag = undefined;\n if((imgtag = emojitag(lbldata.name)) === undefined) {\n $('#'+rowid+'-color').text(lbldata.name);\n } else {\n // remove emoji text from the name\n var lblname = lbldata.name.replace(/\\:(.*?)\\:/g, '');\n $('#'+rowid+'-color').text(lblname);\n // append each <img> tag with an emoji to the label\n while((img = imgtag.shift()) !== undefined) {\n $('#'+rowid+'-color').append(img);\n }\n }\n // set the label's background color\n $('#'+rowid+'-color').attr('style', 'background-color:#'+lbldata.color+';color:#'+adaptColor(lbldata.color)+';');\n// ^RENDER LABEL\n\n $('#'+rowid+'-desc').text((lbldata.description === null ? '' : lbldata.description));\n}", "function addSyllables(){\n const reducer = (accumulator, currentValue) => accumulator + currentValue;\n return syllableArray.reduce(reducer);\n}", "function Label() {\n Shape.call(this);\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n\n labelRefs.bind(this, 'labelTarget');\n }", "function detectLabels(response, image, callback) {\n var params = {\n Image: image,\n MinConfidence: REKOGNITION_MIN_CONFIDENCE\n };\n\n rekognition.detectLabels(params, (err, data) => {\n if (err){\n callback(err);\n } else {\n let instances = data.Labels.reduce((acc, label) => (\n REKOGNITION_LABELS.includes(label[\"Name\"]) ? acc.concat(label.Instances) : acc\n ), [])\n\n callback(null, response, instances);\n }\n });\n}", "function fLabel(result) {\n \tif(result != null){\n \t\tif(result.length > 7) result = result.substring(0,7);\n \t\tresult = result.toUpperCase();\n \t\tclickedCell.text(result);\n \t\tclickedCell.css(\"color\",\"black\");\n \t\tlabels.push(result);\n \t\tthis.edited = true;\n \t}\n }", "createLabels() {\n return this.props.pie(this.props.data).map((data, idx) => {\n // Don't label the really small wedges.\n if (data.endAngle - data.startAngle < 0.1) return null;\n let labelKey = data.data[this.props.labelKey]\n\n // Note the ref being placed on each label element for easy reference\n // and subsequently easy access to the height/width for repositioning.\n return (\n <text transform={this.labelTransform(data, labelKey)}\n ref={ (node) => this.labelNodes[labelKey] = node }\n key={labelKey}>\n { this.props.formatLabel(data.value) }\n </text>\n );\n });\n }", "function getlabels(xmin,xmax,mesh,xstep) {\r\nvar xlabel = []; \r\nvar igo = 0;\r\nfor (igo = 0; igo < mesh; igo++) {\r\n xlabel[igo] = \"\"; \r\n}\r\nvar nlabel = Math.floor((xmax-xmin)/xstep);\r\nvar ntebox = Math.floor(mesh/nlabel);\r\nfor (igo = 1; igo <= nlabel; igo++) {\r\n xlabel[igo*ntebox] = Math.floor(xmin+xstep*igo);\r\n}\r\nxlabel[0] = form(xmin,1);\r\nreturn xlabel;\r\n}", "function autoLabel() {\n\n app.beginUndoGroup(\"Auto Label\")\n\n var comp = app.project.activeItem;\n\n if (comp == null || !(comp instanceof CompItem)) {\n alert(\"Please pick a composition\")\n return false\n }\n\n var layers = comp.selectedLayers;\n\n //If no layers selected apply to all layers.\n if (layers.length == 0) {\n for (var i = 1; i <= comp.numLayers; i++) {\n layers.push(comp.layers[i]);\n }\n }\n\n for (var i = 0; i < layers.length; i++) {\n\n var type = layerType(layers[i]);\n if (type === false) return false;\n applyLabel(layers[i], type);\n\n }\n\n function layerType(layer) {\n\n if (layer.source instanceof CompItem) {\n return \"composition\"\n } else if (layer instanceof ShapeLayer) {\n return \"shape\"\n } else if (layer instanceof CameraLayer) {\n return \"camera\"\n } else if (layer instanceof LightLayer) {\n return \"light\"\n } else if (layer instanceof TextLayer) {\n return \"text\"\n } else if (layer.nullLayer == true) {\n return \"nullLayer\"\n } else if (layer.adjustmentLayer == true) {\n return \"adjustment\"\n } else if (layer.source.mainSource instanceof SolidSource) {\n return \"solid\"\n } else if (layer.source instanceof FootageItem && layer.source.mainSource.isStill) {\n if (layer.hasVideo) {\n return \"still\"\n } else return false\n } else if (layer.source instanceof FootageItem) {\n return \"video\"\n }\n\n return false\n\n }\n\n function applyLabel(layer, type) {\n\n var isChild = (layer.parent == null) ? false : true;\n var isParent = false;\n var subType;\n\n for (var j = 1; j <= comp.numLayers; j++) {\n if (comp.layers[j].parent == layer) {\n isParent = true\n break\n }\n }\n\n if (layer.isTrackMatte == true) {\n subType = \"matte\";\n } else if (isParent == true && isChild == true) {\n subType = \"parentChild\";\n } else if (isParent == true) {\n subType = \"parented\";\n } else if (isChild == true) {\n subType = \"child\";\n }\n\n if (subType == undefined) {\n layer.label = parseInt(labels.propertyColour(settings[type].colour));\n return false\n }\n\n var stringIntColour = (typeof settings[type].properties[subType].colour == \"string\")\n ? labels.propertyColour(settings[type].properties[subType].colour) :\n settings[type].properties[subType].colour;\n\n layer.label = parseInt(stringIntColour);\n\n }\n\n app.endUndoGroup()\n }", "function draw_label(step, c, label) {\n\tvar t = svg.append('text')\n\t\t.attr('x', get_text_x(step))\n\t\t.attr('y', get_text_y(c))\n\t\t.attr('font-family', 'sans-serif')\n\t\t.attr('font-size', '18')\n\t\t.attr('id', 't'+get_text_x(step)+'label'+get_text_y(c))\n\t\t.attr('text-anchor', 'middle');\n\tfor (i in label.split('\\n')) {\n\t\tt.append('tspan')\n\t\t\t.text(label.split('\\n')[i])\n\t\t\t.attr('dy', i * 20)\n\t\t\t.attr('x', get_text_x(step));\n\t}\n}", "function addLabel(el) {\n $(\"<span></span>\").appendTo(el).html(label);\n }", "addToLabel(label, font_family, font_size, color) {\n const rotatelabel = this.getRotateLabel()\n d3.select(this.html.node().parentElement).select(\"text\")\n .attr(\"x\", (this.x2+edge.x1)/ 2 - 5*label.length)\n .attr(\"y\", (this.y2+edge.y1 - this.stroke_width)/2)\n .attr(\"transform\", rotatelabel)\n .style(\"font-family\", font_family)\n .style(\"font-size\", font_size)\n .attr(\"fill\", color)\n .text(label)\n }", "addAugmentationsImage(text) {\n let result = \"\";\n if (\"hp\" in text) {\n result += \" transforms.RandomHorizontalFlip(),\\n\";\n }\n if (\"vp\" in text) {\n result += \" transforms.RandomVerticalFlip(),\\n\";\n }\n if (\"randSize\" in text) {\n result += \" transforms.RandomResizedCrop(224),\\n\";\n }\n\n return result;\n }", "function setLabel(props){\r\n \r\n if (expressed == attrArray[0]){\r\n var label = REM_2012;\r\n } else if (expressed == attrArray[1]){\r\n var label = REM_2013;\r\n } else if (expressed == attrArray[2]){\r\n var label = REM_2014;\r\n } else if (expressed == attrArray[3]){\r\n var label = REM_2015;\r\n } else if (expressed == attrArray[4]){\r\n var label = REM_2016;\r\n };\r\n \r\n //label content\r\n var labelAttribute = \"<h1>\" + props[expressed] +\r\n \"</h1><br><b>\" + label + \"</b>\";\r\n\r\n //create info label div\r\n var infolabel = d3.select(\"body\")\r\n .append(\"div\")\r\n .attr(\"class\", \"infolabel\")\r\n .attr(\"id\", props.CODE + \"_label\")\r\n .html(labelAttribute);\r\n\r\n var regionName = infolabel.append(\"div\")\r\n .attr(\"class\", \"labelname\")\r\n .html(props.Name);\r\n}", "function addFormula(layer, src, fTxt) {\n\t/* remove the text box */\n\tlet setlectedObjs = layer.getActiveObjects();\n\tlayer.remove(setlectedObjs[0]);\n\tlayer.discardActiveObject();\n\tlayer.requestRenderAll();\n\n\t/* add the formula image */\n\tfabric.Image.fromURL(src, function(img) {\n\t\tlet oImg = img.set({ left: menuPos.x,\n\t\t\ttop: menuPos.y - 60 }).scale(0.5);\n\t\toImg.name = fTxt;\n\t\tlayer.add(oImg);\n\t\tlayer.setActiveObject(oImg);\n\t});\n}", "function detectCustomLabels(response, image, callback) {\n var params = {\n Image: image,\n MinConfidence: REKOGNITION_MIN_CONFIDENCE,\n ProjectVersionArn: REKOGNITION_PROJECT_VERSION_ARN\n };\n\n rekognition.detectCustomLabels(params, (err, data) => {\n if (err){\n callback(err);\n } else {\n let geometries = data.CustomLabels.reduce((acc, label) => (\n REKOGNITION_LABELS.includes(label[\"Name\"])\n ? acc.concat({ BoundingBox: label.Geometry.BoundingBox, Confidence: label.Confidence })\n : acc\n ), [])\n\n callback(null, response, geometries);\n }\n });\n}", "function draw_label(text, v1, v2){\n let dx = parseInt(v2[0] - v1[0]);\n let dy = parseInt(v2[1] - v1[1]-10); \n console.log(dx, dy);\n\n let p=v1;\n let pad = parseFloat(1/2);\n let padding = dx/4;\n \n pad = padding / Math.sqrt(dx*dx+dy*dy);\n \n ctx.save();\n ctx.textAlign = \"left\";\n ctx.translate(parseFloat(p[0] + dx*pad), parseFloat(p[1] + dy*pad));\n // ctx.rotate(Math.atan2(dy,dx));\n if(dx<0){\n ctx.rotate(Math.atan2(dy,dx) - Math.PI); //to avoid label upside down\n }\n else{\n ctx.rotate(Math.atan2(dy,dx));\n }\n ctx.font = '28px arial';\n ctx.fillStyle = \"black\"\n ctx.fillText(text, 0, 0);\n\n ctx.restore();\n}", "function _createImageMap(img, img_src, labels) {\n if (!labels.length) { return; }\n\n var image_href = \"\";\n // If the image has a link, then set all the links in the image map to be that link\n if (img.parentElement.tagName === \"A\"){\n image_href = img.parentElement.href;\n } else {\n image_href = null;\n }\n\n var newMap = document.createElement(\"map\"); \n\n var randomHash = _randInt(0, 10000);\n // Add usemap attribute- set to #labeled_{img_src}\n _addAttribute(img, \"usemap\", \"#labeled_\"+randomHash+img_src); \n _addAttribute(newMap, \"name\", \"labeled_\"+randomHash+img_src);\n\n \n labels.forEach(function (label) {\n var newArea = document.createElement(\"area\");\n _addAttribute(newArea, \"shape\", \"rect\");\n \n // if the image is wrapped in a link set all the area to that link\n // otherwise set a dummy link\n // need to have link for voiceover to read!\n if (image_href) {\n _addAttribute(newArea, \"href\", image_href);\n } else {\n _addAttribute(newArea, \"href\", \"#\"+label['label']);\n // workaround to disable clicking on image maps\n _addAttribute(newArea, \"onclick\", \"return false;\");\n }\n\n var x1 = label['topleft']['x'],\n y1 = label['topleft']['y'],\n x2 = label['bottomright']['x'],\n y2 = label['bottomright']['y'];\n\n _addAttribute(newArea, \"coords\", [x1,y1,x2,y2].join());\n _addAttribute(newArea, \"alt\", label['label']);\n\n newMap.appendChild(newArea);\n });\n _insertAfter(newMap, img);\n}", "function showLabel(labelToken) {\n $(labelToken).css(\"left\", \"0px\");\n}", "function addLabel(link, data, direction) {\n var label = link\n .append('g')\n .attr('id', 'label' + data.id + direction)\n .classed(direction, true);\n\n addLabelRect(label, data, direction);\n if (data.propertyTo === 'disjoint') {\n addDisjointLabel(label);\n return;\n }\n var labelText = label\n .append('text')\n .classed('text', true)\n .attr('text-anchor', 'middle');\n\n addLabelText(labelText, data, direction);\n addPropertyToLabel(labelText, data, direction);\n addSubPropertyLabel(labelText, data, direction);\n }", "function drawRRLabel(label, html, aX, aY, bX, bY, onXAxis) {\n label.innerHTML = html;\n label.hidden = false;\n let offsetX = 0;\n let offsetY = 0;\n // To make it look nice and centered, specify different offsets based on axis\n if (onXAxis) {\n offsetX = label.offsetWidth / -2;\n offsetY = label.offsetWidth * -1;\n } else {\n offsetX = label.offsetWidth * .25;\n offsetY = label.offsetWidth / -2;\n }\n let midpoint = calcMidpoint(aX, aY, bX, bY);\n screenPos = planeCoordToAbsScreenPosition(midpoint.x, midpoint.y,\n offsetX, offsetY);\n label.style.left = screenPos.x + \"px\";\n label.style.top = screenPos.y + \"px\";\n}", "static rule_replaceLocalImageWithLabel(p_info, p_doc) {\n let imgs = p_doc.getElementsByTagName('img');\n for (let i = 0; i < imgs.length; ++i) {\n let img = imgs[i];\n let httpRegExp = new RegExp('^http[s]://');\n if (httpRegExp.test(img.src)) {\n continue;\n }\n\n let dataRegExp = new RegExp('^data:image/');\n if (dataRegExp.test(img.src)) {\n continue;\n }\n\n let spanNode = p_doc.createElement('span');\n spanNode.style = 'font-weight: bold; color: white; background-color: red;'\n spanNode.textContent = 'INSERT_IMAGE_HERE';\n img.parentNode.replaceChild(spanNode, img);\n --i;\n }\n }", "function imageMacro(src){\n return new TreeImage(src,0,0);\n}", "function getLabelInstructions () {\n return {\n 'Walk' : {\n 'id' : 'Walk',\n 'instructionalText' : 'Explore mode: Find and label curb ramps at this intersection.',\n 'textColor' : 'rgba(255,255,255,1)'\n },\n CurbRamp: {\n id: 'CurbRamp',\n instructionalText: 'Label mode: Locate and draw an outline around the <span class=\"underline\">curb ramp</span>',\n textColor: 'rgba(255,255,255,1)'\n },\n NoCurbRamp: {\n id: 'NoCurbRamp',\n instructionalText: 'Label mode: Locate and draw an outline around where a <span class=\"underline\">curb ramp is missing</span>',\n textColor: 'rgba(255,255,255,1)'\n },\n Obstacle: {\n id: 'Obstacle',\n instructionalText: 'Label mode: Locate and draw an outline around a <span class=\"underline\">obstacle in path</span>',\n textColor: 'rgba(255,255,255,1)'\n },\n Other: {\n id: 'Other',\n instructionalText: 'Label mode',\n textColor: 'rgba(255,255,255,1)'\n },\n SurfaceProblem: {\n id: 'SurfaceProblem',\n instructionalText: 'Label mode: Locate and draw an outline around a <span class=\"underline\">sidewalk surface problem</span>',\n textColor: 'rgba(255,255,255,1)'\n },\n 'StopSign' : {\n 'id' : 'StopSign',\n 'instructionalText' : 'Label mode: Locate and click at the bottom of the <span class=\"underline\">stop sign</span>',\n 'textColor' : 'rgba(255,255,255,1)'\n },\n 'StopSign_OneLeg' : {\n 'id' : 'StopSign_OneLeg',\n 'instructionalText' : 'Label mode: Locate and click at the bottom of the <span class=\"underline\">bus stop sign</span>',\n 'textColor' : 'rgba(255,255,255,1)'\n },\n 'StopSign_TwoLegs' : {\n 'id' : 'StopSign_TwoLegs',\n 'instructionalText' :'Label mode: Locate and click at the bottom of the <span class=\"underline\">bus stop sign</span>',\n 'textColor' :'rgba(255,255,255,1)'\n },\n 'StopSign_Column' : {\n 'id' : 'StopSign_Column',\n 'instructionalText' : 'Label mode: Locate and click at the bottom of the <span class=\"underline\">bus stop sign</span>',\n 'textColor' : 'rgba(255,255,255,1)'\n },\n 'Landmark_Shelter' : {\n 'id' : 'Landmark_Shelter',\n 'instructionalText' : 'Label mode: Locate and click at the bottom of the <span class=\"underline\">bus shelter</span>',\n 'textColor' : 'rgba(255,255,255,1)'\n },\n 'Landmark_Bench' : {\n 'id' : 'Landmark_Bench',\n 'instructionalText' : 'Label mode: Locate and click at the bottom of the <span class=\"underline\">bench</span> nearby a bus stop',\n 'textColor' : 'rgba(255,255,255,1)'\n },\n 'Landmark_TrashCan' : {\n 'id' : 'Landmark_TrashCan',\n 'instructionalText' : 'Label mode: Locate and click at the bottom of the <span class=\"underline\">trash can</span> nearby a bus stop',\n 'textColor' : 'rgba(255,255,255,1)'\n },\n 'Landmark_MailboxAndNewsPaperBox' : {\n 'id' : 'Landmark_MailboxAndNewsPaperBox',\n 'instructionalText' : 'Label mode: Locate and click at the bottom of the <span class=\"underline\">mailbox or news paper box</span> nearby a bus stop',\n 'textColor' : 'rgba(255,255,255,1)'\n },\n 'Landmark_OtherPole' : {\n 'id' : 'Landmark_OtherPole',\n 'instructionalText' : 'Label mode: Locate and click at the bottom of poles such as <span class=\"underline bold\">traffic sign, traffic light, and light pole</span> nearby a bus stop',\n 'textColor' : 'rgba(255,255,255,1)'\n }\n }\n}", "function flatOneHot(label, numClasses) {\n var labelOneHot = new Array(numClasses).fill(0);\n labelOneHot[label] = 1;\n return labelOneHot;\n}", "function flatOneHot(label, numClasses) {\n var labelOneHot = new Array(numClasses).fill(0);\n labelOneHot[label] = 1;\n return labelOneHot;\n}", "function setLabels(index){\n\tvar label = '';\n\tif (!defaultSettings.showlabels){\n\t\treturn label;\n\t}\n\t\n\tif (index % 8 === 0){\n\t\tlabel += '<span class=\"label type-num number-' + labelPosition.num + '\">' + labelPosition.num + '</span>';\n\t\tlabelPosition.num--;\n\t}\n\tif (index >=56){\n\t\tlabel += '<span class=\"label type-alpha alphabet-' + String.fromCharCode(labelPosition.alpha) + '\">' + String.fromCharCode(labelPosition.alpha) + '</span>';\n\t\tlabelPosition.alpha++;\n\t}\n\treturn label; \n}", "function config2foldLabel(config) {\n var _s=\" \";\n var _r=config2oneAndTwo(config);\n var _m=config2foldType(config);\n var _tmp=_r[0]+_s+_m+_s+_r[1]; \n return _tmp;\n}", "function addSoilIndices(img){\r\n img = img.addBands(img.normalizedDifference(['red','green']).rename('NDCI'));\r\n img = img.addBands(img.normalizedDifference(['red','swir2']).rename('NDII'));\r\n img = img.addBands(img.normalizedDifference(['swir1','nir']).rename('NDFI'));\r\n \r\n var bsi = img.expression(\r\n '((SWIR1 + RED) - (NIR + BLUE)) / ((SWIR1 + RED) + (NIR + BLUE))', {\r\n 'BLUE': img.select('blue'),\r\n 'RED': img.select('red'),\r\n 'NIR': img.select('nir'),\r\n 'SWIR1': img.select('swir1')\r\n }).float();\r\n img = img.addBands(bsi.rename('BSI'));\r\n \r\n var hi = img.expression(\r\n 'SWIR1 / SWIR2',{\r\n 'SWIR1': img.select('swir1'),\r\n 'SWIR2': img.select('swir2')\r\n }).float();\r\n img = img.addBands(hi.rename('HI')); \r\n return img.float();\r\n}", "function renderLabels() {\n renderLabelsHorizontal.call(this);\n renderLabelsVertical.call(this);\n}", "_addVirtualLabel(name) {\n if (this.virtualNode.labels[name] !== true) {\n this.virtualNode.labels[name] = true;\n\n if (name in this.labelMappings) {\n this.target[this.labelMappings[name]] = true;\n }\n }\n }", "function buildLabels(addLabels, newXScale, updateXAxis, newYScale, updateYAxis) {\n // When the event listener is triggered, make the transition\n addLabels.transition()\n .duration(500)\n .attr(\"x\", d => newXScale(d[updateXAxis]))\n .attr(\"y\", d => newYScale(d[updateYAxis]));\n return addLabels;\n}", "@readOnly\n @computed('renderLabel')\n addLabel (renderLabel) {\n return `Add ${Ember.String.singularize(renderLabel).toLowerCase()}`\n }", "render_label(ui) {\n // Create the edge label.\n const label = ui.render_tex(\n this,\n UI.clear_label_for_cell(this),\n this.label,\n () => this.update_label_transformation(ui),\n );\n this.element.appendChild(label.element);\n // Create an empty label buffer for flicker-free rendering.\n const buffer = ui.render_tex(this, UI.clear_label_for_cell(this, true));\n this.element.appendChild(buffer.element);\n }", "addLabeltoEdge(label, font_family, font_size, color) {\n // Add the Label to the DOM\n const rotatelabel = this.getRotateLabel()\n d3.select(this.html.node().parentElement).append(\"text\")\n .attr(\"x\", (this.x2+this.x1)/ 2 - 5*label.length)\n .attr(\"y\", (this.y2+this.y1 )/2 - this.stroke_width)\n .attr(\"transform\", rotatelabel)\n .style(\"font-family\", font_family)\n .style(\"font-size\", font_size)\n .attr(\"fill\", color)\n .text(label)\n }", "function label(str)\n{\n // do nothing\n}", "function genImg(imgNum){\n // add alt image\n}", "function addLabel(w,h, label, labelForeground, wrapTextWidth) {\r\n\tctx = document.getElementById('canvas').getContext('2d');\r\n\tvar txt, newH, newW;\r\n\t\r\n\tvar nw = w/10;\r\n\tvar nh = h/10;\r\n\t\r\n\tctx.fillStyle = labelForeground;\r\n\tctx.textBaseline = \"top\";\r\n\tctx.textarea_wrap = \"hard\";\r\n\tctx.textarea_row = 2;\r\n\tctx.cols = 10;\r\n\tfor (i= 0; i < label.length; i++) {\r\n\t\ttxt = label[i][0];\r\n\t\tnewW = nw*label[i][1];\r\n\t\tnewH = nh*label[i][2];\r\n\t\tctx.font = \"11pt Bloomberg Prop Unicode I\";\r\n\t\twrapText(ctx,txt, newW,newH, wrapTextWidth, newH);\r\n\t}\r\n}", "function label(node) {\n var type = node.referenceType;\n var value = type === 'full' ? node.identifier : '';\n\n return type === 'shortcut' ? value : '[' + value + ']';\n}", "function detectLabels(imageKey, callback) {\n request.get('images/detect')\n .query({imageKey: imageKey})\n .end(function (err, res) {\n if (err) {\n console.log(err);\n callback(err.statusCode, null)\n }\n else {\n var labels = res.text\n callback(res.statusCode, labels)\n }\n })\n}", "function defineLabels() {\r\n\tsteerAssistLabel = radioLabels[0];\r\n\tbrakeAssistLabel = radioLabels[1];\r\n\tABS_label = radioLabels[2];\r\n\tTC_label = radioLabels[3];\r\n\tSC_label = radioLabels[4];\r\n\tdamageLabel = radioLabels[5];\r\n\tgearLabel = radioLabels[6];\r\n\tclutchLabel = radioLabels[7];\r\n\tlineLabel = radioLabels[8];\r\n\t\r\n\tsetupLabel = checkboxesLabels[0];\r\n\tcontrollerLabel = checkboxesLabels[1];\r\n\tcameraLabel = checkboxesLabels[2];\r\n}", "function addLabelToAlgorithmBar(t){var e=document.createTextNode(t),i=document.createElement(\"td\");i.appendChild(e);var n=document.getElementById(\"AlgorithmSpecificControls\");return n.appendChild(i),e}", "function newAnchorLabel() {\n count = ++that.anchor_count;\n anchor_label = strval((count + 1)); //generating footnote number starting at 1 instead of 0\n /* yil original letter generating label code\n anchor_label = '';\n do {\n anchor_label = chr(ord('a') + (count % 26)) + anchor_label;\n count = (int) floor(count / 26);\n } while (count > 0);*/\n return anchor_label;\n }", "function label(type) {\n return labels[map(type)] || 'Unknown';\n }", "_stringLabel() {\n return this.label instanceof MatStepLabel ? null : this.label;\n }", "function drawImage (values, x_offset, y_offset, w, txt) {\n let dimension = 28; // It's 28 x 28 image\n for (let i = 0; i < values.length; i++) {\n let brightness = values[i] * 256; // Scale upto 256.\n let x = i % dimension; // x postion\n let y = floor(i / dimension);\n // Draw rectangle\n fill(brightness);\n noStroke();\n rect(x_offset + x*w, y_offset + y*w, w, w);\n }\n // Draw the label\n fill(0);\n textSize(12);\n text(txt, x_offset, y_offset + w*35);\n} // End of drawImage function", "updateEdgeLabel() {\n const rotatelabel = this.getRotateLabel()\n d3.select(this.html.node().parentElement).select(\"text\")\n .attr(\"x\", (this.x2+this.x1)/ 2 - 5*this.label.length)\n .attr(\"y\", (this.y2+this.y1 - this.stroke_width)/2)\n .attr(\"transform\", rotatelabel)\n }", "function createPacLabel (x,y,l) {\n\n var g = viz.selection().selectAll(\".vz-halo-arc-plot\").append(\"g\")\n .attr(\"class\",\"vz-halo-label\")\n .style(\"pointer-events\",\"none\")\n .style(\"opacity\",0);\n\n g.append(\"text\")\n .style(\"font-size\",\"11px\")\n .style(\"fill\",theme.skin().labelColor)\n .style(\"fill-opacity\",.75)\n .attr(\"text-anchor\",\"middle\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .text(l);\n\n var rect = g[0][0].getBoundingClientRect();\n g.insert(\"rect\",\"text\")\n .style(\"shape-rendering\",\"auto\")\n .style(\"fill\",theme.skin().labelFill)\n .style(\"opacity\",.45)\n .attr(\"width\",rect.width+12)\n .attr(\"height\",rect.height+12)\n .attr(\"rx\",3)\n .attr(\"ry\",3)\n .attr(\"x\", x-5 - rect.width/2)\n .attr(\"y\", y - rect.height-3);\n\n g.transition().style(\"opacity\",1);\n}", "function createPacLabel (x,y,l) {\n\n var g = viz.selection().selectAll(\".vz-halo-arc-plot\").append(\"g\")\n .attr(\"class\",\"vz-halo-label\")\n .style(\"pointer-events\",\"none\")\n .style(\"opacity\",0);\n\n g.append(\"text\")\n .style(\"font-size\",\"11px\")\n .style(\"fill\",theme.skin().labelColor)\n .style(\"fill-opacity\",.75)\n .attr(\"text-anchor\",\"middle\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .text(l);\n\n var rect = g[0][0].getBoundingClientRect();\n g.insert(\"rect\",\"text\")\n .style(\"shape-rendering\",\"auto\")\n .style(\"fill\",theme.skin().labelFill)\n .style(\"opacity\",.45)\n .attr(\"width\",rect.width+12)\n .attr(\"height\",rect.height+12)\n .attr(\"rx\",3)\n .attr(\"ry\",3)\n .attr(\"x\", x-5 - rect.width/2)\n .attr(\"y\", y - rect.height-3);\n\n g.transition().style(\"opacity\",1);\n}", "function appendLabels(value) {\n eval(`div${value}`).append(eval(`label${value}`));\n eval(`div${value}`).append(eval(`input${value}`));\n }", "show() {\n // circle(this.x, this.y, this.circ);\n // args: image(image var, top edge, left edge, width, height);\n image(charImg, this.x, this.y, this.circ, this.circ);\n }", "configureLabels() {\n this.label\n .attr(\"class\", \"lgv-label\")\n .attr(\"data-node-label\", d => this.extractLabel(d))\n .attr(\"data-node-depth\", d => d.depth)\n .attr(\"data-node-children\", d => d.children ? true : false)\n .attr(\"x\", d => d.x)\n .attr(\"y\", d => d.children ? (d.y - (d.r * 0.9)) : d.y)\n .text(d => this.extractLabel(d));\n }", "function updateLineLabels(bucket: SymbolBucket,\n posMatrix: mat4,\n painter: Painter,\n isText: boolean,\n labelPlaneMatrix: mat4,\n glCoordMatrix: mat4,\n pitchWithMap: boolean,\n keepUpright: boolean,\n pixelsToTileUnits: number,\n layer: SymbolStyleLayer) {\n\n const sizeData = isText ? bucket.textSizeData : bucket.iconSizeData;\n const partiallyEvaluatedSize = symbolSize.evaluateSizeForZoom(sizeData, painter.transform, layer, isText);\n\n const clippingBuffer = [256 / painter.width * 2 + 1, 256 / painter.height * 2 + 1];\n\n const dynamicLayoutVertexArray = isText ?\n bucket.text.dynamicLayoutVertexArray :\n bucket.icon.dynamicLayoutVertexArray;\n dynamicLayoutVertexArray.clear();\n\n const lineVertexArray = bucket.lineVertexArray;\n const placedSymbols = isText ? bucket.placedGlyphArray : bucket.placedIconArray;\n\n for (let s = 0; s < placedSymbols.length; s++) {\n const symbol: any = placedSymbols.get(s);\n\n const anchorPos = [symbol.anchorX, symbol.anchorY, 0, 1];\n vec4.transformMat4(anchorPos, anchorPos, posMatrix);\n\n // Don't bother calculating the correct point for invisible labels.\n if (!isVisible(anchorPos, symbol.placementZoom, clippingBuffer, painter)) {\n hideGlyphs(symbol.numGlyphs, dynamicLayoutVertexArray);\n continue;\n }\n\n const cameraToAnchorDistance = anchorPos[3];\n const perspectiveRatio = 1 + 0.5 * ((cameraToAnchorDistance / painter.transform.cameraToCenterDistance) - 1);\n\n const fontSize = symbolSize.evaluateSizeForFeature(sizeData, partiallyEvaluatedSize, symbol);\n const pitchScaledFontSize = pitchWithMap ?\n fontSize * perspectiveRatio :\n fontSize / perspectiveRatio;\n\n const tileAnchorPoint = new Point(symbol.anchorX, symbol.anchorY);\n const anchorPoint = project(tileAnchorPoint, labelPlaneMatrix).point;\n const projectionCache = {};\n\n const placeUnflipped = placeGlyphsAlongLine(symbol, pitchScaledFontSize, false /*unflipped*/, keepUpright, posMatrix, labelPlaneMatrix, glCoordMatrix,\n bucket.glyphOffsetArray, lineVertexArray, dynamicLayoutVertexArray, anchorPoint, tileAnchorPoint, projectionCache);\n\n if (placeUnflipped.notEnoughRoom ||\n (placeUnflipped.needsFlipping &&\n placeGlyphsAlongLine(symbol, pitchScaledFontSize, true /*flipped*/, keepUpright, posMatrix, labelPlaneMatrix, glCoordMatrix,\n bucket.glyphOffsetArray, lineVertexArray, dynamicLayoutVertexArray, anchorPoint, tileAnchorPoint, projectionCache).notEnoughRoom)) {\n hideGlyphs(symbol.numGlyphs, dynamicLayoutVertexArray);\n }\n }\n\n if (isText) {\n bucket.text.dynamicLayoutVertexBuffer.updateData(dynamicLayoutVertexArray.serialize());\n } else {\n bucket.icon.dynamicLayoutVertexBuffer.updateData(dynamicLayoutVertexArray.serialize());\n }\n}", "function countryLabel(dot){\n dot.append(\"text\")\n .attr(\"class\", function(d){return \"country topleftlabel \"+d.name;})\n .attr(\"text-anchor\", \"start\")\n .attr(\"x\", 24)\n .attr(\"y\", 135)\n .text(function(d) {return d.name; })\n .style(\"fill\", function(d){return colorScale(d.region);});\n }", "function renderLabels() {\n window.dGO.printArea.innerHTML = ''; // Clear out previous labels.\n\n var items = getLabelData(null);\n // Create a label for each line of the CSV.\n items.data.forEach(function(item, i) {\n window.dGO.printArea.appendChild(createLabel(item, i));\n })\n\n // Generate and insert QR Codes\n var qrcodes = document.querySelectorAll('.qrcode');\n qrcodes.forEach(function(el, i){\n new QRCode(el, {\n text: el.dataset.assetTag,\n // Printer resolution is 1200dpi, but 600px is probably more than enough.\n width: 600,\n height: 600,\n useSVG: true, // This doesn't seem to do anything.\n correctLevel: QRCode.CorrectLevel.M\n });\n });\n\n // Draw the mountain scene for large labels.\n MountainScene.drawArtToIMGs(document.querySelectorAll('.labelArt > img'));\n}", "function image(elem) {\n var alt = elem.getAttribute(\"alt\");\n var title = elem.getAttribute(\"title\");\n var url = elem.getAttribute(\"src\");\n\n if (alt === null) {\n alt = url;\n }\n\n var op = \" ![\" + alt + \"](\" + url;\n\n if (title !== null) {\n op += \" \\\"\" + title + \"\\\"\";\n }\n\n return op + \") \";\n}", "function addNdvi(img) {\r\n var nd = img.normalizedDifference(['nir', 'red']);\r\n return img.addBands(nd.float().rename('NDVI'));\r\n}" ]
[ "0.5486794", "0.52453023", "0.52082735", "0.5136994", "0.5084835", "0.5065959", "0.50365865", "0.50061095", "0.50000393", "0.50000393", "0.49778184", "0.49637198", "0.4962145", "0.49583852", "0.4952433", "0.4942034", "0.49257052", "0.4917245", "0.49123636", "0.490611", "0.49060374", "0.49020362", "0.48996845", "0.48991954", "0.48921275", "0.4874646", "0.4867466", "0.48573425", "0.48533133", "0.48527429", "0.4844687", "0.48410133", "0.48130292", "0.48130292", "0.48112798", "0.48087496", "0.48087496", "0.4798942", "0.4787073", "0.47852957", "0.4780231", "0.4768935", "0.47655937", "0.47642416", "0.47463563", "0.4744901", "0.4743376", "0.473138", "0.47304368", "0.47206014", "0.47189015", "0.47024903", "0.470104", "0.46998185", "0.46934086", "0.4690127", "0.46897095", "0.46791455", "0.46781737", "0.4678106", "0.4671924", "0.4667578", "0.46653253", "0.46638745", "0.46585917", "0.46504733", "0.46503684", "0.465001", "0.465001", "0.46489543", "0.46473664", "0.46424475", "0.4637851", "0.46337453", "0.46316913", "0.4623263", "0.46203974", "0.46203947", "0.46197996", "0.46176532", "0.46141472", "0.46094346", "0.46053818", "0.46053657", "0.4602123", "0.4599846", "0.45960233", "0.4591383", "0.4585143", "0.4581492", "0.4574293", "0.4574293", "0.45677128", "0.45615068", "0.4561126", "0.45525774", "0.45500225", "0.45491436", "0.45487037", "0.45228484" ]
0.68044794
0
Compare two arrays (commonly extracted from buffer.getChannelData()) with constraints: options.thresholdSNR: Minimum allowed SNR between the actual and expected signal. The default value is 10000. options.thresholdDiffULP: Maximum allowed difference between the actual and expected signal in ULP(Unit in the last place). The default is 0. options.thresholdDiffCount: Maximum allowed number of sample differences which exceeds the threshold. The default is 0. options.bitDepth: The expected result is assumed to come from an audio file with this number of bits of precision. The default is 16.
function compareBuffersWithConstraints(actual, expected, options) { if (!options) options = {}; if (actual.length !== expected.length) testFailed('Buffer length mismatches.'); var maxError = -1; var diffCount = 0; var errorPosition = -1; var thresholdSNR = (options.thresholdSNR || 10000); var thresholdDiffULP = (options.thresholdDiffULP || 0); var thresholdDiffCount = (options.thresholdDiffCount || 0); // By default, the bit depth is 16. var bitDepth = (options.bitDepth || 16); var scaleFactor = Math.pow(2, bitDepth - 1); var noisePower = 0, signalPower = 0; for (var i = 0; i < actual.length; i++) { var diff = actual[i] - expected[i]; noisePower += diff * diff; signalPower += expected[i] * expected[i]; if (Math.abs(diff) > maxError) { maxError = Math.abs(diff); errorPosition = i; } // The reference file is a 16-bit WAV file, so we will almost never get // an exact match between it and the actual floating-point result. if (Math.abs(diff) > scaleFactor) diffCount++; } var snr = 10 * Math.log10(signalPower / noisePower); var maxErrorULP = maxError * scaleFactor; if (snr >= thresholdSNR) { testPassed('Exceeded SNR threshold of ' + thresholdSNR + ' dB.'); } else { testFailed('Expected SNR of ' + thresholdSNR + ' dB, but actual SNR is ' + snr + ' dB.'); } if (maxErrorULP <= thresholdDiffULP) { testPassed('Maximum difference below threshold of ' + thresholdDiffULP + ' ulp (' + bitDepth + '-bits).'); } else { testFailed('Maximum difference of ' + maxErrorULP + ' at the index ' + errorPosition + ' exceeded threshold of ' + thresholdDiffULP + ' ulp (' + bitDepth + '-bits).'); } if (diffCount <= thresholdDiffCount) { testPassed('Number of differences between results is ' + diffCount + ' out of ' + actual.length + '.'); } else { testFailed(diffCount + ' differences found but expected no more than ' + diffCount + ' out of ' + actual.length + '.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareArrays (oldArray, newArray, options) {\n // For backward compatibility, if the third arg is actually a bool, interpret\n // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n options = (typeof options === 'boolean') ? { dontLimitMoves: options } : (options || {});\n oldArray = oldArray || [];\n newArray = newArray || [];\n\n if (oldArray.length < newArray.length) { return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options) } else { return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options) }\n }", "function compareArrays(oldArray, newArray, options) {\n // For backward compatibility, if the third arg is actually a bool, interpret\n // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});\n oldArray = oldArray || [];\n newArray = newArray || [];\n\n if (oldArray.length <= newArray.length)\n return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options);\n else\n return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options);\n }", "function compareArrays(oldArray, newArray, options) {\n\t // For backward compatibility, if the third arg is actually a bool, interpret\n\t // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n\t options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});\n\t oldArray = oldArray || [];\n\t newArray = newArray || [];\n\n\t if (oldArray.length < newArray.length)\n\t return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options);\n\t else\n\t return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options);\n\t }", "function compareArrays(oldArray, newArray, options) {\n\t // For backward compatibility, if the third arg is actually a bool, interpret\n\t // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n\t options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});\n\t oldArray = oldArray || [];\n\t newArray = newArray || [];\n\n\t if (oldArray.length <= newArray.length)\n\t return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options);\n\t else\n\t return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options);\n\t }", "function compareArrays(oldArray, newArray, options) {\n\t // For backward compatibility, if the third arg is actually a bool, interpret\n\t // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n\t options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});\n\t oldArray = oldArray || [];\n\t newArray = newArray || [];\n\n\t if (oldArray.length <= newArray.length)\n\t return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options);\n\t else\n\t return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options);\n\t }", "function compareArrays(oldArray, newArray, options) {\n // For backward compatibility, if the third arg is actually a bool, interpret\n // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});\n oldArray = oldArray || [];\n newArray = newArray || [];\n\n if (oldArray.length < newArray.length)\n return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options);\n else\n return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options);\n }", "function compareArrays(oldArray, newArray, options) {\n // For backward compatibility, if the third arg is actually a bool, interpret\n // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});\n oldArray = oldArray || [];\n newArray = newArray || [];\n\n if (oldArray.length <= newArray.length)\n return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options);\n else\n return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options);\n }", "function compareArrays(oldArray, newArray, options) {\n // For backward compatibility, if the third arg is actually a bool, interpret\n // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});\n oldArray = oldArray || [];\n newArray = newArray || [];\n\n if (oldArray.length <= newArray.length)\n return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options);\n else\n return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options);\n }", "function compareArrays(oldArray, newArray, options) {\n // For backward compatibility, if the third arg is actually a bool, interpret\n // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});\n oldArray = oldArray || [];\n newArray = newArray || [];\n\n if (oldArray.length < newArray.length)\n return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options);\n else\n return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options);\n }", "function compareArrays(oldArray, newArray, options) {\n // For backward compatibility, if the third arg is actually a bool, interpret\n // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});\n oldArray = oldArray || [];\n newArray = newArray || [];\n\n if (oldArray.length < newArray.length)\n return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options);\n else\n return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options);\n }", "function compareArrays(oldArray, newArray, options) {\n // For backward compatibility, if the third arg is actually a bool, interpret\n // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});\n oldArray = oldArray || [];\n newArray = newArray || [];\n\n if (oldArray.length < newArray.length)\n return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options);\n else\n return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options);\n }", "function compareArrays(oldArray, newArray, options) {\n // For backward compatibility, if the third arg is actually a bool, interpret\n // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});\n oldArray = oldArray || [];\n newArray = newArray || [];\n\n if (oldArray.length < newArray.length)\n return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options);\n else\n return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options);\n }", "function compareArrays(oldArray, newArray, options) {\n // For backward compatibility, if the third arg is actually a bool, interpret\n // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});\n oldArray = oldArray || [];\n newArray = newArray || [];\n\n if (oldArray.length < newArray.length)\n return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options);\n else\n return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options);\n }", "function compareArrays(oldArray, newArray, options) {\n // For backward compatibility, if the third arg is actually a bool, interpret\n // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});\n oldArray = oldArray || [];\n newArray = newArray || [];\n\n if (oldArray.length < newArray.length)\n return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options);\n else\n return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options);\n }", "function equal (bufferA, bufferB) {\n //walk by all the arguments\n if (arguments.length > 2) {\n for (var i = 0, l = arguments.length - 1; i < l; i++) {\n if (!equal(arguments[i], arguments[i + 1])) return false;\n }\n return true;\n }\n\n validate(bufferA);\n validate(bufferB);\n\n if (bufferA.length !== bufferB.length || bufferA.numberOfChannels !== bufferB.numberOfChannels) return false;\n\n for (var channel = 0; channel < bufferA.numberOfChannels; channel++) {\n var dataA = bufferA.getChannelData(channel);\n var dataB = bufferB.getChannelData(channel);\n\n for (var i = 0; i < dataA.length; i++) {\n if (dataA[i] !== dataB[i]) return false;\n }\n }\n\n return true;\n}", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n const aType = (0, _jestGetType2.default)(a);\n let expectedType = aType;\n let omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== Symbol.for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return (\n ' Comparing two different types of values.' +\n ` Expected ${_chalk2.default.green(expectedType)} but ` +\n `received ${_chalk2.default.red((0, _jestGetType2.default)(b))}.`\n );\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n return (0, _diff_strings2.default)(a, b, options);\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);\n }\n}", "calculateLoudness(buffer) {\n\n // first call or after resetMemory\n if (this.copybuffer == undefined) {\n // how long should the copybuffer be at least? \n // --> at least maxT should fit in and length shall be an integer fraction of buffer length\n let length = Math.floor(this.sampleRate * this.loudnessprops.maxT / buffer.length + 1) * buffer.length;\n this.copybuffer = new CircularAudioBuffer(context, this.nChannels, length, this.sampleRate);\n }\n\n //accumulate buffer to previous call\n this.copybuffer.concat(buffer);\n\n // must be gt nSamplesPerInterval\n // or: wait at least one interval time T to be able to calculate loudness\n if (this.copybuffer.getLength() < this.nSamplesPerInterval) {\n console.log('buffer too small ... have to eat more data');\n return NaN;\n }\n\n // get array of meansquares from buffer of overlapping intervals\n let meanSquares = this.getBufferMeanSquares(this.copybuffer, this.nSamplesPerInterval, this.nStepsize);\n\n // first stage filter\n this.filterBlocks(meanSquares, this.gamma_a);\n\n // second stage filter\n let gamma_r = 0.;\n for (let chIdx = 0; chIdx < this.nChannels; chIdx++) {\n let mean = 0.;\n for (let idx = 0; idx < meanSquares[chIdx].length; idx++) {\n mean += meanSquares[chIdx][idx];\n }\n mean /= meanSquares[chIdx].length;\n gamma_r += (this.channelWeight[chIdx] * mean);\n }\n gamma_r = -0.691 + 10.0 * Math.log10(gamma_r) - 10.;\n\n this.filterBlocks(meanSquares, gamma_r);\n\n // gated loudness from filtered blocks\n let gatedLoudness = 0.;\n for (let chIdx = 0; chIdx < this.nChannels; chIdx++) {\n let mean = 0.;\n for (let idx = 0; idx < meanSquares[chIdx].length; idx++) {\n mean += meanSquares[chIdx][idx];\n }\n mean /= meanSquares[chIdx].length;\n\n gatedLoudness += (this.channelWeight[chIdx] * mean);\n }\n gatedLoudness = -0.691 + 10.0 * Math.log10(gatedLoudness);\n\n //console.log(this.id, '- gatedLoudness:', gatedLoudness);\n\n return gatedLoudness;\n }", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n var aType = (0, _jestGetType2.default)(a);\n var expectedType = aType;\n var omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== _Symbol$for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return ' Comparing two different types of values.' + (' Expected ' + _chalk2.default.green(expectedType) + ' but ') + ('received ' + _chalk2.default.red((0, _jestGetType2.default)(b)) + '.');\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n return (0, _diff_strings2.default)(a, b, options);\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);\n }\n }", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n var aType = (0, _jestGetType2.default)(a);\n var expectedType = aType;\n var omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== _Symbol$for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return ' Comparing two different types of values.' + (' Expected ' + _chalk2.default.green(expectedType) + ' but ') + ('received ' + _chalk2.default.red((0, _jestGetType2.default)(b)) + '.');\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n return (0, _diff_strings2.default)(a, b, options);\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);\n }\n }", "function diff(a, b, options) {\n if (a === b) {\n return constants.NO_DIFF_MESSAGE;\n }\n\n var aType = (0, _jestGetType2.default)(a);\n var expectedType = aType;\n var omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== _Symbol$for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== (0, _jestGetType2.default)(b)) {\n return ' Comparing two different types of values.' + (' Expected ' + _chalk2.default.green(expectedType) + ' but ') + ('received ' + _chalk2.default.red((0, _jestGetType2.default)(b)) + '.');\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n var multiline = MULTILINE_REGEXP.test(a) && b.indexOf('\\n') !== -1;\n if (multiline) {\n return (0, _diff_strings2.default)(a, b, options);\n }\n return null;\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);}\n }", "function diffArrayHeuristic(a, b, settings) {\n\tconst lookahead = settings.arrayLookahead;\n\tlet sublog = [];\n\tlet ia = 0;\n\tfor (let i = 0; i < b.length; i++) {\n\t\tlet validDif = 2;\n\t\tlet validSrc = null;\n\t\tfor (let j = ia; j < Math.min(ia + lookahead, a.length); j++) {\n\t\t\tlet dif = diffHeuristic(a[j], b[i], settings);\n\t\t\tif (dif < validDif) {\n\t\t\t\tvalidDif = dif;\n\t\t\t\tvalidSrc = j;\n\t\t\t}\n\t\t}\n\t\tif (validDif > settings.arrayTrulyDifferentThreshold)\n\t\t\tvalidSrc = null;\n\t\tif (validSrc != null) {\n\t\t\twhile (ia < validSrc) {\n\t\t\t\tsublog.push(\"POPA\");\n\t\t\t\tia++;\n\t\t\t}\n\t\t\tsublog.push(\"PATCH\");\n\t\t\tia++;\n\t\t} else {\n\t\t\tif (ia == a.length) {\n\t\t\t\tsublog.push(\"INSERT\");\n\t\t\t} else {\n\t\t\t\tsublog.push(\"PATCH\");\n\t\t\t\tia++;\n\t\t\t}\n\t\t}\n\t}\n\twhile (ia < a.length) {\n\t\tsublog.push(\"POPA\");\n\t\tia++;\n\t}\n\treturn sublog;\n}", "function compareCanvasToTemplate(){\n var source = readTemplateIndexed(),\n target = readCanvasIndexed();\n var diffArray = new Uint8Array(target.length);\n canvasDifferences = 0;\n for(var i=0; i<diffArray.length; i++){\n if(source[i] == target[i] || source[i] == 254){\n diffArray[i] = 0;\n } else {\n diffArray[i] = 1;\n canvasDifferences += 1;\n }\n }\n statRecordProgress(canvasDifferences);\n return diffArray;\n}", "function diff(a: any, b: any, options: ?DiffOptions): ?string {\n if (a === b) {\n return NO_DIFF_MESSAGE;\n }\n\n const aType = getType(a);\n let expectedType = aType;\n let omitDifference = false;\n if (aType === 'object' && typeof a.asymmetricMatch === 'function') {\n if (a.$$typeof !== Symbol.for('jest.asymmetricMatcher')) {\n // Do not know expected type of user-defined asymmetric matcher.\n return null;\n }\n if (typeof a.getExpectedType !== 'function') {\n // For example, expect.anything() matches either null or undefined\n return null;\n }\n expectedType = a.getExpectedType();\n // Primitive types boolean and number omit difference below.\n // For example, omit difference for expect.stringMatching(regexp)\n omitDifference = expectedType === 'string';\n }\n\n if (expectedType !== getType(b)) {\n return (\n ' Comparing two different types of values.' +\n ` Expected ${chalk.green(expectedType)} but ` +\n `received ${chalk.red(getType(b))}.`\n );\n }\n\n if (omitDifference) {\n return null;\n }\n\n switch (aType) {\n case 'string':\n const multiline = MULTILINE_REGEXP.test(a) && b.indexOf('\\n') !== -1;\n if (multiline) {\n return diffStrings(a, b, options);\n }\n return null;\n case 'number':\n case 'boolean':\n return null;\n case 'map':\n return compareObjects(sortMap(a), sortMap(b), options);\n case 'set':\n return compareObjects(sortSet(a), sortSet(b), options);\n default:\n return compareObjects(a, b, options);\n }\n}", "function diff(a, b, config) {\n var _a;\n scanLimit = ((_a = config === null || config === void 0 ? void 0 : config.scanLimit) !== null && _a !== void 0 ? _a : 1e9) >> 1;\n return normalize(a, b, findDiff(a, 0, a.length, b, 0, b.length));\n}", "function ztestP(opt, values, a, b) {\n\t var X = b ? values.map(util.$(a)) : values,\n\t Y = b ? values.map(util.$(b)) : a,\n\t n1 = stats.count(X),\n\t n2 = stats.count(Y),\n\t diffs = Array(), i;\n\n\t if (n1 !== n2) {\n\t throw Error('Array lengths must match.');\n\t }\n\t for (i=0; i<n1; ++i) {\n\t // Only valid differences should contribute to the test statistic\n\t if (util.isValid(X[i]) && util.isValid(Y[i])) {\n\t diffs.push(X[i] - Y[i]);\n\t }\n\t }\n\t return stats.z.test(diffs, opt && opt.nullh || 0);\n\t}", "function ztestP(opt, values, a, b) {\n var X = b ? values.map(util.$(a)) : values,\n Y = b ? values.map(util.$(b)) : a,\n n1 = stats.count(X),\n n2 = stats.count(Y),\n diffs = Array(), i;\n\n if (n1 !== n2) {\n throw Error('Array lengths must match.');\n }\n for (i=0; i<n1; ++i) {\n // Only valid differences should contribute to the test statistic\n if (util.isValid(X[i]) && util.isValid(Y[i])) {\n diffs.push(X[i] - Y[i]);\n }\n }\n return stats.z.test(diffs, opt && opt.nullh || 0);\n}", "function largestSamples(a, b) {\n return b[2]-a[2];\n }", "function compareMatches(arr1, arr2) {\n\t\t\t\tvar diff = 0;\n\t\t\t\tfor (var i = 0; i < arr1.length; i++) {\n\t\t\t\t\tvar num = Math.abs(arr1[i] - arr2[i]);\n\t\t\t\t\tdiff += num\n\t\t\t\t}\n\t\t\t\tresultArray.push(diff);\n\t\t\t}", "function compareArray(a, b) {\n var diffs = []\n Array.prototype.some.call(a, function(numA, idxA) {\n Array.prototype.some.call(b, function(numB, idxB) {\n // console.log('comparing ' + numA + ' with ' + numB);\n // console.log('compare count:', ++count);\n // break if 2 element are equal\n if (numA === numB) {\n return true\n }\n // find a diff if numB is bigger than numA\n if (numB > numA) { \n diffs.push(numA);\n return true\n }\n });\n // break if numA is bigger than last element of bArr\n // slice rest of elements into diffs\n if (numA > b[b.length -1]) {\n console.log('all diffs after this idx:', idxA);\n var rests = Array.prototype.slice.call(a, idxA);\n // console.log('rests:', rests);\n diffs = diffs.concat(rests);\n return true;\n }\n });\n return diffs;\n}", "function compare(data, canvas) {\n var ctx = canvas.getContext(\"2d\");\n var data2 = ctx.getImageData(0, 0, canvas.width, canvas.height);\n\n var d1 = data.data;\n var d2 = data2.data;\n\n var diffcanvas = parentwin.document.createElementNS(\n \"http://www.w3.org/1999/xhtml\", \"canvas\");\n diffcanvas.width = Math.max(data.width, data2.width);\n diffcanvas.height = Math.max(data.height, data2.height);\n /*\n // widths are the same, determine max height\n if (d1.length > d2.length) {\n diffcanvas.height = (d1.length / 4) / canvas.width;\n } else {\n diffcanvas.height = canvas.height;\n }\n */\n var diffctx = diffcanvas.getContext(\"2d\");\n var data3 = diffctx.getImageData(0, 0,\n diffcanvas.width, diffcanvas.height);\n var d3 = data3.data;\n\n var pixdiff = 0;\n var pixsame = 0;\n\n var w=diffcanvas.width, h=diffcanvas.height,\n w1=data.width, h1=data.height,\n w2=data2.width, h2=data2.height;\n\n loop(w, h, function(x, y) {\n var o1 = (y * w1 + x) * 4,\n o2 = (y * w2 + x) * 4,\n offset = (y * w + x) * 4;\n\n if (x > w1 || x > w2 || y > h1 || y > h2) {\n pixdiff++;\n rgba(d3, offset, 180, 20, 20, 200);\n return;\n }\n let r = Math.abs(d1[o1 ] - d2[o2 ]) < tolerance;\n let g = Math.abs(d1[o1+1] - d2[o2+1]) < tolerance;\n let b = Math.abs(d1[o1+2] - d2[o2+2]) < tolerance;\n if (r && g && b) {\n pixsame++;\n rgba(d3, offset, 255, 255, 255, 0);\n } else {\n// let b1 = getBrightness(d1[offset], d1[offset+1], d1[offset+2]),\n// b2 = getBrightness(d2[offset], d2[offset+1], d2[offset+2]);\n//\n// if (Math.abs(b1 - b2) < (tolerance/2))\n// // //false\n// // /*\n// // isAntialiased(pixel1, data1, 1, verticalPos, horizontalPos, width) ||\n// // isAntialiased(pixel2, data2, 2, verticalPos, horizontalPos, width) */\n// // //)\n// {\n// rgba(d3, offset, 255, 255, 255, 0);\n// //\n// } else {\n // unmatched pixel\n rgba(d3, offset, 180, 20, 20, 160);\n //rgba(d3, offset, 255, 255, 0, 255);\n //rgba(d3, offset, 255, 120, 0, 255);\n pixdiff++;\n// }\n }\n });\n\n if (pixdiff && (pixdiff/(d3.length/4) > 0.005)) {\n diffctx.putImageData(data3, 0, 0);\n\n var out = parentwin.document.createElementNS(\n \"http://www.w3.org/1999/xhtml\", \"canvas\");\n out.width = Math.max(data.width, data2.width);\n out.height = Math.max(data.height, data2.height);\n var outctx = out.getContext(\"2d\");\n outctx.globalAlpha = 0.3;\n outctx.drawImage(canvas, 0, 0);\n outctx.globalAlpha = 1.0;\n outctx.drawImage(diffcanvas, 0, 0);\n outctx.restore();\n return out;\n } else {\n return null;\n }\n}", "function compareArrayBySize(a, b) {\n if (a.values.length < b.values.length)\n return 1;\n if (a.values.length > b.values.length)\n return -1;\n return 0;\n}", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length);\n var lengthDiff = Math.abs(array1.length - array2.length);\n var diffs = 0;\n var i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i])\n || (!dontConvert && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__type_checks__[\"a\" /* toInt */])(array1[i]) !== __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__type_checks__[\"a\" /* toInt */])(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n}", "compareVSOptions(vsOptA, vsOptB, sortPayload){\n var returnVal = 0;\n if(sortPayload){\n if(sortPayload.byCategory){\n // put options without category at beginning\n if(vsOptA.VSECategory === null && colObjB.valObj.VSECategory === null){\n returnVal = 0;\n }\n else if(vsOptA.VSECategory === null){\n returnVal = -1;\n }\n else if(vsOptB.VSECategory === null){\n returnVal = 1;\n }\n // compare option category text\n else if(vsOptA.VSECategory == vsOptB.VSECategory){\n returnVal = 0;\n }\n else if(vsOptA.VSECategory < vsOptB.VSECategory){\n returnVal = -1;\n }\n else if(vsOptA.VSECategory > vsOptB.VSECategory){\n returnVal = 1;\n }\n }\n\n if(returnVal == 0){\n if(!(sortPayload.alphabetically)){\n if(vsOptA.OptionOrder < vsOptB.OptionOrder){\n returnVal = -1;\n }\n else if(vsOptA.OptionOrder > vsOptB.OptionOrder){\n returnVal = 1;\n }\n }\n else if(sortPayload.alphabetically){ // compare EntryName\n if(vsOptA.EntryName < vsOptB.EntryName){\n returnVal = -1;\n }\n else if(vsOptA.EntryName > vsOptB.EntryName){\n returnVal = 1;\n }\n }\n }\n }\n else{\n if(vsOptA.EntryValue == vsOptB.EntryValue){\n returnVal = 0;\n }\n else if(vsOptA.EntryValue < vsOptB.EntryValue){\n returnVal = -1;\n }\n else if(vsOptA.EntryValue > vsOptB.EntryValue){\n returnVal = 1;\n }\n }\n\n return returnVal;\n }", "function comparePeaks(reference) {\n var result = 0, cutoff = reference.offset * 1.5;\n\n // Pairwise comparison\n _.each(histogramSorted, function (peak) {\n if (peak == reference) return;\n if (peak.offset < cutoff) return;\n\n // Calculate match value based on narrow window around integer ratios.\n var ratio = peak.offset / reference.offset,\n match = Math.max(0, 1 - Math.abs(ratio - Math.round(ratio)) * 8);\n\n // Scale by peak strength\n strength = peak.strength * peak.permanence * ratio;\n result += match * strength;\n });\n\n return result;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length);\n var lengthDiff = Math.abs(array1.length - array2.length);\n var diffs = 0;\n var i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i])\n || (!dontConvert && Object(__WEBPACK_IMPORTED_MODULE_0__type_checks__[\"k\" /* toInt */])(array1[i]) !== Object(__WEBPACK_IMPORTED_MODULE_0__type_checks__[\"k\" /* toInt */])(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n}", "compare(paths) {\n debug('comparing ...');\n return this.differ.createDiff(LOOKS_SAME_OPTIONS(paths));\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (\n (dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n ) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareOptionValues(a, b) {\n // Radix 10: for numeric values\n // Radix 36: for alphanumeric values\n var sA = parseInt( a.value, 36 );\n var sB = parseInt( b.value, 36 );\n return sA - sB;\n}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if (\n\t (dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n\t ) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if (\n\t (dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n\t ) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if (\n\t (dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n\t ) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (\n (dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n ) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "_AMDF(buf, sampleRate) {\n var SIZE = buf.length; // set SIZE variable equal to buffer length 4096 => half a second\n var MAX_SAMPLES = Math.floor(SIZE / 2); // set MAX_SAMPLES = 4096/2 = 2048\n var best_offset = -1; // initialise best_offset to -1\n var best_correlation = 0; // initialise best_correlation to 0\n var rms = 0; // initialise rms to 0 (rms => root-mean-square)\n var foundGoodCorrelation = false; // initialise foundGoodCorrelation flag to false\n var correlations = new Array(MAX_SAMPLES); // create an array variable called correlations of size MAX_SAMPLES (2048)\n\n for (var i = 0; i < SIZE; i++) {\n var val = buf[i]; // val is equal to the (i)th value in the array\n rms += val * val; // rms is the summation of each value squared\n }\n rms = Math.sqrt(rms / SIZE); // set rms equal to the square root of rms/SIZE (square root of the average)\n if (rms < 0.01) // not enough signal\n return -1;\n\n var lastCorrelation = 1; // initialise lastCorrelation to 1 so that the first check won't be the best correlation\n for (var offset = 52; offset < 160; offset++) { // offset initialised to 52, goes through a for loop from 52 to 160, which will cover the notes that Singphony can render\n var correlation = 0; // re-set correlation to 0 at each offset value\n\n for (var i = 0; i < MAX_SAMPLES; i++) { // cycle through from 0 to 2048\n correlation += Math.abs((buf[i]) - (buf[i + offset])); // step through at each value and subtract the value at the offset from the value in the original buffer and keep adding that to the correlation value\n } // correlation will be a large enough positive float\n\n correlation = 1 - (correlation / MAX_SAMPLES); // set correlation to 1 - correlation/512\n correlations[offset] = correlation; // store it, for the tweaking we need to do below.\n if ((correlation > this.GOOD_ENOUGH_CORRELATION) && (correlation > lastCorrelation)) { // if the correlation value is higher than 0.9 and the previous correlation value\n foundGoodCorrelation = true; // set foundGoodCorrelation flag to true\n if (correlation > best_correlation) { //\n best_correlation = correlation; // update the best_correlation value to the latest correlation value\n best_offset = offset; // update best_offset to the latest offset value\n }\n } else if (foundGoodCorrelation) {\n // short-circuit - we found a good correlation, then a bad one, so we'd just be seeing copies from here.\n return sampleRate / best_offset;\n }\n lastCorrelation = correlation; // set lastCorrelation to latest correlation\n }\n return -1;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (\n dontConvert && array1[i] !== array2[i] ||\n !dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\r\n var len = Math.min(array1.length, array2.length),\r\n lengthDiff = Math.abs(array1.length - array2.length),\r\n diffs = 0,\r\n i;\r\n for (i = 0; i < len; i++) {\r\n if ((dontConvert && array1[i] !== array2[i]) ||\r\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\r\n diffs++;\r\n }\r\n }\r\n return diffs + lengthDiff;\r\n }", "function compareArrays(array1, array2, dontConvert) {\r\n var len = Math.min(array1.length, array2.length),\r\n lengthDiff = Math.abs(array1.length - array2.length),\r\n diffs = 0,\r\n i;\r\n for (i = 0; i < len; i++) {\r\n if ((dontConvert && array1[i] !== array2[i]) ||\r\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\r\n diffs++;\r\n }\r\n }\r\n return diffs + lengthDiff;\r\n }", "function compareArrays(array1, array2, dontConvert) {\r\n var len = Math.min(array1.length, array2.length),\r\n lengthDiff = Math.abs(array1.length - array2.length),\r\n diffs = 0,\r\n i;\r\n for (i = 0; i < len; i++) {\r\n if ((dontConvert && array1[i] !== array2[i]) ||\r\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\r\n diffs++;\r\n }\r\n }\r\n return diffs + lengthDiff;\r\n }", "function diff(target, data1, data2){\n if (data1.length != data2.length) return null;\n var i=0;\n while(i<(data1.length/4)){\n\n target[i*4] = data1[4*i] == 0 ? 0 : fastAbs(data1[4*i] - data2[4*i+1]);\n target[i*4+1] = data1[4*i+1] == 0 ? 0 : fastAbs(data1[4*i+1] - data2[4*i+1]);\n target[i*4+2] = data1[4*i+2] == 0 ? 0 : fastAbs(data1[4*i+2] - data2[4*i+2]);\n target[i*4+3] = 0xFF;\n \n i++;\n }\n}", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }" ]
[ "0.57749796", "0.57412165", "0.57281893", "0.5727517", "0.5727517", "0.5711899", "0.5681763", "0.5681763", "0.5679594", "0.5679594", "0.5679594", "0.5679594", "0.5679594", "0.5679594", "0.5452367", "0.5409068", "0.5376733", "0.5356096", "0.5356096", "0.5355672", "0.533136", "0.52728766", "0.5181175", "0.51695484", "0.5167597", "0.51615834", "0.51605636", "0.5146925", "0.5070805", "0.50607824", "0.5046147", "0.4992304", "0.49921602", "0.49857035", "0.4979478", "0.49699795", "0.495429", "0.49510446", "0.49420577", "0.49420577", "0.49420577", "0.49420577", "0.49420577", "0.49420577", "0.49420577", "0.49420577", "0.49420577", "0.49420577", "0.49420577", "0.49420577", "0.49420577", "0.49420577", "0.49420577", "0.49420577", "0.49420577", "0.49396148", "0.49396148", "0.49396148", "0.4927841", "0.49272373", "0.49223417", "0.49223417", "0.49223417", "0.4918779", "0.4918779", "0.49151543", "0.49027637", "0.49027637", "0.49027637", "0.49027637", "0.49027637", "0.49027637", "0.49027637", "0.49027637", "0.49027637", "0.49027637", "0.49027637", "0.49027637", "0.49027637", "0.49027637", "0.48998123", "0.48881257", "0.48875293", "0.48861173", "0.48793274", "0.48793274", "0.48793274", "0.487533", "0.4872948", "0.4872948", "0.4872948", "0.4872948", "0.4872948", "0.4872948", "0.4872948", "0.4872948", "0.4872948", "0.4872948", "0.4872948", "0.4872948" ]
0.760667
0
Create an impulse in a buffer of length sampleFrameLength
function createImpulseBuffer(context, sampleFrameLength) { var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate); var n = audioBuffer.length; var dataL = audioBuffer.getChannelData(0); for (var k = 0; k < n; ++k) { dataL[k] = 0; } dataL[0] = 1; return audioBuffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createStereoImpulseBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(2, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n var dataR = audioBuffer.getChannelData(1);\n\n for (var k = 0; k < n; ++k) {\n dataL[k] = 0;\n dataR[k] = 0;\n }\n dataL[0] = 1;\n dataR[0] = 1;\n\n return audioBuffer;\n}", "function createStereoImpulseBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(2, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n var dataR = audioBuffer.getChannelData(1);\n\n for (var k = 0; k < n; ++k) {\n dataL[k] = 0;\n dataR[k] = 0;\n }\n dataL[0] = 1;\n dataR[0] = 1;\n\n return audioBuffer;\n}", "function createLinearRampBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var i = 0; i < n; ++i)\n dataL[i] = i / n;\n\n return audioBuffer;\n}", "function createLinearRampBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var i = 0; i < n; ++i)\n dataL[i] = i / n;\n\n return audioBuffer;\n}", "function createConstantBuffer(context, sampleFrameLength, constantValue) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var i = 0; i < n; ++i)\n dataL[i] = constantValue;\n\n return audioBuffer;\n}", "function createConstantBuffer(context, sampleFrameLength, constantValue) {\n var channels;\n var values;\n\n if (typeof constantValue === \"number\") {\n channels = 1;\n values = [constantValue];\n } else {\n channels = constantValue.length;\n values = constantValue;\n }\n\n var audioBuffer = context.createBuffer(channels, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n\n for (var c = 0; c < channels; ++c) {\n var data = audioBuffer.getChannelData(c);\n for (var i = 0; i < n; ++i)\n data[i] = values[c];\n }\n\n return audioBuffer;\n}", "function generateAudioBuffer( freq, fn, duration, volume ) {\n var length = duration * sampleRate;\n\n var buffer = audioContext.createBuffer( 1, length, sampleRate );\n var channel = buffer.getChannelData(0);\n for ( var i = 0; i < length; i++ ) {\n channel[i] = fn( freq * i / sampleRate, i / length ) * volume;\n }\n\n return buffer;\n}", "init(frameDuration){\n // Initialize variables\n\n // Frame information\n // Frame duration (e.g., 0.02 s)\n const fSize = frameDuration*sampleRate;\n // Make the framesize multiple of 128 (audio render block size)\n this._frameSize = 128*Math.round(fSize/128); // Frame duration = this._frameSize/sampleRate;\n this._frameSize = Math.max(128*2, this._frameSize); // Force a minimum of two blocks\n\n this._numBlocksInFrame = this._frameSize/128; // 8 at 48kHz and 20ms window\n // Force an even number of frames\n if (this._numBlocksInFrame % 2){\n this._numBlocksInFrame++;\n this._frameSize += 128;\n }\n // Predefined 50% overlap\n this._numBlocksOverlap = Math.floor(this._numBlocksInFrame/2); // 4 at 48kHz and 20ms window\n\n // Define frame buffers\n this._oddBuffer = new Float32Array(this._frameSize); // previous and current are reused\n this._pairBuffer = new Float32Array(this._frameSize); // previous and current are reused\n\n // We want to reuse the two buffers. This part is a bit complicated and requires a detailed description\n // Finding the block indices that belong to each buffer is complicated\n // for buffers with an odd num of blocks.\n // Instead of using full blocks, half blocks could be used. This also adds\n // another layer of complexity, so not much to gain...\n // Module denominator to compute the block index\n this._modIndexBuffer = this._numBlocksInFrame + this._numBlocksInFrame % 2; // Adds 1 to numBlocksInFrame if it's odd, otherwise adds 0\n\n // Count blocks\n this._countBlock = 0;\n\n // Computed buffers\n this._oddSynthBuffer = new Float32Array(this._frameSize);\n this._pairSynthBuffer = new Float32Array(this._frameSize);\n\n console.log(\"Frame size: \" + this._frameSize +\n \". Set frame length: \" + this._frameSize/sampleRate + \" seconds\" +\n \". Blocks per frame: \" + this._numBlocksInFrame +\n \". Blocks overlap: \" + this._numBlocksOverlap);\n\n\n\n\n // LCP variables\n this._lpcOrder = 20;\n // LPC filter coefficients\n this._lpcCoeff = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n // LPC k coefficients\n this._kCoeff = [];\n // Filter samples\n this._prevY = [];\n // Quantization\n this._quantOpt = false;\n this._quantBits = 2;\n // Reverse K's\n this._reverseKOpt = false;\n // Perfect synthesis\n this._perfectSynthOpt = false;\n\n // resampling before analysis\n this._resamplingFactor = 1;\n this._resampler = new Resampler(this._frameSize, this._resamplingFactor);\n // Unvoiced mix (adds noise to the perfect excitation signal)\n this._unvoicedMix = 0;\n // Pitch factor (modifies this._fundFreq)\n this._pitchFactor = 1;\n // Vibrato effect (modifies this._fundFreq)\n this._vibratoEffect = 0;\n\n\n\n // Synthesis\n // Create impulse signal\n this._oldTonalBuffer = new Float32Array(this._frameSize/2);\n this._excitationSignal = new Float32Array(this._frameSize);\n this._errorBuffer = new Float32Array(this._frameSize);\n this._mixedExcitationSignal = new Float32Array(this._frameSize);\n\n // autocorrelation indices for fundamental frequency estimation\n this._lowerACFBound = Math.floor(sampleRate / 200); // 200 Hz upper frequency limit -> lower limit for periodicity in samples\n this._upperACFBound = Math.ceil(sampleRate / 70); // 70 Hz lower frequency limit -> upper limit\n\n // excitation variables\n this._tonalConfidence = 0.5;\n this._confidenceTonalThreshold = 0.1;\n this._periodFactor = 1;\n\n // buffer for fundamental period estimation\n this._fundPeriodLen = this._upperACFBound - this._lowerACFBound;\n this._fundPeriodBuffer = [];\n this._oldPeriodSamples = this._upperACFBound;\n this._pulseOffset = 0;\n\n\n\n\n // Debug\n // Timer to give updates to the main thread\n this._lastUpdate = currentTime;\n // Block info\n this._block1 = new Float32Array(128);\n this._block2 = new Float32Array(128);\n\n }", "function startSample(index, arNum) {\n\nvar source = context.createBufferSource()\nsource.buffer = userPad[index][arNum].activeVoice[0]\n\nsource.connect(bus[index].input)\nsource.start(0)\n\nsource.onended = function(){\n\tsource.stop()\n }\n\n}", "function audio_reload_convolver_buffer(lpf_taps, lpf_taps_length)\n{\n // always using 2 channels of LPF data seems to work fine\n var audio_lpf_buffer = audio_context.createBuffer(2, lpf_taps_length, audio_output_rate);\n var audio_lpf = audio_lpf_buffer.getChannelData(0);\n audio_lpf.set(lpf_taps);\n audio_lpf = audio_lpf_buffer.getChannelData(1);\n audio_lpf.set(lpf_taps);\n audio_convolver.buffer = audio_lpf_buffer;\n //kiwi_log('audio_reload_convolver_buffer lpf_taps_length='+ lpf_taps_length);\n}", "createSoundWave() {\n this.canvasCtx = this.canvas.getContext('2d');\n this.analyser = this.context.createAnalyser();\n const source = this.context.createMediaStreamSource(this.stream);\n source.connect(this.analyser);\n this.freqs = new Uint8Array(this.analyser.frequencyBinCount);\n this.stopId = requestAnimationFrame(() => this.draw());\n }", "function createBuffer(channelData, duration) {\n // If a single array of numbers is passed, make it an array of arrays\n if (typeof channelData[0] === 'number')\n channelData = [channelData];\n // Normalize to -1..1\n normalize(channelData);\n return {\n duration,\n length: channelData[0].length,\n sampleRate: channelData[0].length / duration,\n numberOfChannels: channelData.length,\n getChannelData: (i) => channelData?.[i],\n copyFromChannel: AudioBuffer.prototype.copyFromChannel,\n copyToChannel: AudioBuffer.prototype.copyToChannel,\n };\n}", "function setupSound() {\n sound = audioContext.createBufferSource();\n sound.buffer = sampleBuffer;\n sound.loop = loop; //auto is false\n sound.playbackRate.value = playbackSlider.value;\n\n analyser.smoothingTimeConstant = .85, //0<->1. 0 is no time smoothing\n analyser.fftSize = 2048, //must be some number by the power of 2, ex. 512\n analyser.minDecibels = -150,\n analyser.maxDecibels = -10,\n\n sound.connect(filter); //can connect more than one to a node, as long as it all ends up at destination\n \n //connect source/sound var to the gain node\n filter.connect(gainNode);\n filter.connect(analyser);\n analyser.connect(scriptProcessorNode);\n scriptProcessorNode.connect(gainNode);\n gainNode.connect(panNode);\n //connect pan node to the destination (a.k.a. the speakers)\n panNode.connect(audioContext.destination);\n \n //frequencyBinCount property of the analyserNode interface is an unsigned long value half that of the fft size -MDN\n bufferLength = analyser.frequencyBinCount; \n\n //animate the bars\n scriptProcessorNode.onaudioprocess = function (audioProcessingEvent) {\n array = new Uint8Array(bufferLength);\n analyser.getByteFrequencyData(array);\n\n boost = 0;\n for (var i = 0; i < array.length; i++) {\n boost += array[i];\n }\n boost = boost / array.length;\n\n var step = Math.round(array.length / numBars);\n\n //iterate through bars and scale the z axis\n for (var i = 0; i < numBars; i++) {\n var value = array[i * step] / 4;\n value = value < 1 ? 1 : value;\n bars[i].scale.z = value;\n }\n }\n}", "function sliceAudioBufferInMono(buffer, start_sec, end_sec){ \n if (start_sec > end_sec || end_sec > buffer.duration || start_sec < 0){\n print(\"error: check start_sec/end_sec/buffer.duration\");\n return buffer;\n }\n\n var sampleRate = buffer.sampleRate;\n var numSamples = (end_sec - start_sec) * sampleRate;\n var startOffset = Math.floor(start_sec * sampleRate);\n\n var o = createContext({offline: true, sampleRate: sampleRate, length: numSamples});\n// var o = new OfflineAudioContext(1, numSamples, sampleRate);\n var newBuffer = o.createBuffer(1, numSamples, sampleRate);\n\n // Temp array\n var array = new Float32Array(numSamples);\n buffer.copyFromChannel(array, 0, startOffset);\n newBuffer.copyToChannel(array, 0, 0);\n return newBuffer;\n}", "function BufferEffect (effect, channelCount, args) {\n\tthis.channelCount\t= isNaN(channelCount) ? this.channelCount : channelCount;\n\tthis.effects\t\t= [];\n\n\tfunction fx () {\n\t\teffect.apply(this, args);\n\t}\n\tfx.prototype = effect.prototype;\n\n\twhile (channelCount--) {\n\t\tthis.effects.push(new fx());\n\t}\n}", "function impulse(pos,time) {\n position = pos\n updateTime = time\n\n while (impulses.length > 0 && (time - impulses[0].time) > FILTER_INTERVAL) impulses.shift()\n impulses.push({pos:pos,time:time})\n\n if (impulses.length < 2) {\n velocity = [0,0]\n return false\n } else {\n var a = impulses[0]\n var b = impulses[impulses.length-1]\n\n velocity = vdiv((b.time - a.time)/1000,\n vsub(b.pos,a.pos))\n return clamp()\n }\n }", "function getAudioBufferArray(){\n let audioBufferArray = [];\n let endPlaybackColumn = getEndPlaybackColumn();\n\n for (let i = 0; i < rows; i++) {\n let tempAudioBuffer = audioContext.createBuffer(2, audioContext.sampleRate * ((endPlaybackColumn + 1) * 5), audioContext.sampleRate);\n let tempFloat32Array = tempAudioBuffer.getChannelData(0);\n let length = 0; // increments of 5 seconds\n \n for (let j = 0; j < columns; j++) {\n let audioBuffer = soundGrid[i][j];\n \n if((audioBuffer === -1) && (j <= endPlaybackColumn)){\n if (length === 0){\n tempFloat32Array.set(getEmptyAudioBuffer().getChannelData(0));\n } else {\n tempFloat32Array.set(getEmptyAudioBuffer().getChannelData(0), length);\n }\n } else if (audioBuffer != -1){\n if (length === 0){\n tempFloat32Array.set(audioBuffer.getChannelData(0));\n } else {\n tempFloat32Array.set(audioBuffer.getChannelData(0), length);\n }\n }\n length = length + (audioContext.sampleRate * 5); \n }\n \n tempAudioBuffer.getChannelData(0).set(tempFloat32Array); // left\n tempAudioBuffer.getChannelData(1).set(tempFloat32Array); // right\n audioBufferArray.push(tempAudioBuffer); \n }\n\n return audioBufferArray;\n }", "function processAudio(e) {\n let buffer = e.inputBuffer.getChannelData(0);\n let out = e.outputBuffer.getChannelData(0);\n let amp = 0;\n\n // Iterate through buffer to get the max amplitude for this frame\n for (let i = 0; i < buffer.length; i++) {\n let loud = Math.abs(buffer[i]);\n if (loud > amp) {\n amp = loud;\n }\n // Write input samples to output unchanged\n out[i] = buffer[i];\n }\n\n // Calc the amp : x,y blur effect and apply it\n amp = amp * 2 + ',0';\n blurFilter.setAttribute(\"stdDeviation\", amp);\n}", "receive(isample) {\n let lastr = this._lastr;\n let lasti = this._lasti;\n\n let space = this._sf.updatex(isample);\n let mark = this._mf.updatex(isample);\n let r = space.r + mark.r;\n let i = space.i + mark.i;\n let x = r * lastr - i * lasti;\n let y = r * lasti + i * lastr;\n this._lastr = r; // save the conjugate\n this._lasti = -i;\n let angle = Math.atan2(y, x); // arg\n let comp = (angle > 0) ? -10.0 : 10.0;\n let sig = this._dataFilter.update(comp);\n // console.log('sig:' + sig + ' comp:' + comp)\n\n this.scopeOut(sig);\n\n let bit = this._bit;\n\n // trace('sig:' + sig)\n if (sig > this._hiHys) {\n bit = false;\n } else if (sig < this._loHys) {\n bit = true;\n }\n\n bit = bit !== this._inverted; // user-settable\n\n this.processBit(bit);\n this._bit = bit;\n }", "function SampleVoice(audioContext, options) {\n\n\tvar that = this;\n\n\toptions = options || {};\n\n\tvar loop = options.loop !== undefined ? options.loop : true;\n\tvar buffer = options.buffer || audioContext.createBuffer(1, audioContext.sampleRate, audioContext.sampleRate);\n\tvar nextNoteAction = options.nextNoteAction || 'cut';\n\tvar bufferSource = null;\n\tvar output = audioContext.createGain();\n\n\t//\n\n\tfunction prepareBufferSource() {\n\t\tbufferSource = audioContext.createBufferSource();\n\t\tbufferSource.loop = loop;\n\t\tbufferSource.buffer = buffer;\n\t\tbufferSource.connect(output);\n\t}\n\n\t// ~~~\n\t\n\tthis.output = output;\n\t\n\tthis.noteOn = function(frequency, volume, when) {\n\n\t\t// TODO use frequency\n\n\t\tif(bufferSource !== null) {\n\t\t\tif(nextNoteAction === 'cut') {\n\t\t\t\t// cut off\n\t\t\t\tthat.noteOff();\n\t\t\t} else {\n\t\t\t\t// continue - don't stop the note but let it \"die away\"\n\t\t\t\t// setting bufferSource to null doesn't stop the sound; we just \"forget\" about it\n\t\t\t\tbufferSource = null;\n\t\t\t}\n\t\t}\n\n\t\tif(bufferSource === null) {\n\t\t\tprepareBufferSource();\n\t\t}\n\t\n\t\tthis.setVolume(volume, when);\n\t\tbufferSource.start(when);\n\n\t\t// Auto note off if not looping, though it can be a little bit inaccurate\n\t\t// (due to setTimeout...)\n\t\tif(!loop && nextNoteAction === 'cut') {\n\t\t\tvar endTime = (when + buffer.duration) * 1000;\n\t\t\t\n\t\t\tsetTimeout(function() {\n\t\t\t\tthat.noteOff();\n\t\t\t}, endTime);\n\t\t}\n\n\t};\n\n\n\tthis.noteOff = function(when) {\n\n\t\twhen = when !== undefined ? when : 0;\n\n\t\tif(bufferSource === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tbufferSource.stop(when);\n\t\tbufferSource = null;\n\n\t};\n\n\t\n\tthis.setVolume = function(value, when) {\n\t\toutput.gain.setValueAtTime(value, when);\n\t};\n\n\t\n}", "function MV_Mix(voice) {\n var start;\n var length;\n var voclength;\n var position;\n var rate;\n var FixedPointBufferSize;\n\n if ((voice.length == 0)\n && (voice.GetSound(voice) != KeepPlaying)) {\n return;\n }\n\n length = MixBufferSize;\n FixedPointBufferSize = voice.FixedPointBufferSize;\n\n MV_MixDestination = MV_FooBuffer;\n MV_LeftVolume = voice.LeftVolume;\n MV_RightVolume = voice.RightVolume;\n MV_GLast = voice.GLast;\n MV_GPos = voice.GPos;\n MV_GVal = voice.GVal;\n\n if ((MV_Channels == 2) && (IS_QUIET(MV_LeftVolume))) {\n MV_LeftVolume = MV_RightVolume;\n MV_MixDestination += 8;\n }\n\n // Add this voice to the mix\n while (length > 0) {\n start = voice.sound;\n rate = voice.RateScale;\n position = voice.position;\n\n // Check if the last sample in this buffer would be\n // beyond the length of the sample block\n if ((position + FixedPointBufferSize) >= voice.length) {\n if (position < voice.length) {\n voclength = (voice.length - position + rate - 1) / rate | 0;\n }\n else {\n voice.GetSound(voice);\n return;\n }\n }\n else {\n voclength = length;\n }\n\n voice.mix(position, rate, start, voclength);\n\n if (voclength & 1) {\n MV_MixPosition += rate;\n voclength -= 1;\n }\n voice.position = MV_MixPosition;\n\n length -= voclength;\n\n if (voice.position >= voice.length) {\n // Get the next block of sound\n if (voice.GetSound(voice) != KeepPlaying) {\n return;\n }\n\n if (length > 0) {\n // Get the position of the last sample in the buffer\n FixedPointBufferSize = voice.RateScale * (length - 1);\n }\n }\n }\n}", "function startLoop(audioBuffer, pan = 0, rate = 1) {\n let sourceNode = audioContext.createBufferSource()\n let pannerNode = audioContext.createStereoPanner()\n\n sourceNode.buffer = audioBuffer\n sourceNode.loop = true\n sourceNode.loopStart = 3.40\n sourceNode.loopEnd = 4.19\n sourceNode.playbackRate.value = rate\n pannerNode.pan.value = pan\n // no longer do you connect the source nodes directly to the audioContext destination like before. We connect them to the panner nodes, and then the panner nodes to the destionation. The audio signals flow through the panners\n // audioBufferSourceNode -----> stereoPannerNode -----> audioDestinationNode\n // we now have an audio graph with two loops panned to different ends of the stereo fields.\n\n sourceNode.connect(pannerNode)\n pannerNode.connect(audioContext.destination)\n\n // sourceNode.start(0, 3.40)\n sourceNode.start()\n}", "function synthesizeAudioData(aPreOutputBuffer, aStartIndex, aAudioFrames) {\n // int zSamplesToProcess=aSamplesPerChannel;\n var zSamples = aAudioFrames * myChannels;\n var zVolChannelZero = Math.floor(((myAUDV[0] << 2) * myVolumePercentage) / 100);\n var zVolChannelOne = Math.floor(((myAUDV[1] << 2) * myVolumePercentage) / 100);\n var zIndex = aStartIndex;\n // Loop until the sample buffer is full\n while (zSamples > 0) {\n // Process both TIA sound channels\n for (var c = 0; c < 2; ++c) {\n // Update P4 & P5 registers for channel if freq divider outputs a pulse\n if ((myFrequencyDivider[c].clock())) {\n switch (myAUDC[c]) {\n case 0x00: // Set to 1\n { // Shift a 1 into the 4-bit register each clock\n myP4[c] = (myP4[c] << 1) | 0x01;\n break;\n }\n\n case 0x01: // 4 bit poly\n {\n // Clock P4 as a standard 4-bit LSFR taps at bits 3 & 2\n myP4[c] = bool(myP4[c] & 0x0f) ? ((myP4[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP4[c] & 0x04) ? 1 : 0))) : 1;\n break;\n }\n\n case 0x02: // div 31 . 4 bit poly\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Clock P4 as a standard 4-bit LSFR taps at bits 3 & 2\n myP4[c] = bool(myP4[c] & 0x0f) ? ((myP4[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP4[c] & 0x04) ? 1 : 0))) : 1;\n }\n break;\n }\n\n case 0x03: // 5 bit poly . 4 bit poly\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // P5 clocks the 4 bit poly\n if (bool(myP5[c] & 0x10)) {\n // Clock P4 as a standard 4-bit LSFR taps at bits 3 & 2\n myP4[c] = bool(myP4[c] & 0x0f) ? ((myP4[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP4[c] & 0x04) ? 1 : 0))) : 1;\n }\n break;\n }\n\n case 0x04: // div 2\n {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n break;\n }\n\n case 0x05: // div 2\n {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n break;\n }\n\n case 0x06: // div 31 . div 2\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n }\n break;\n }\n\n case 0x07: // 5 bit poly . div 2\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // P5 clocks the 4 bit register\n if (bool(myP5[c] & 0x10)) {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n }\n break;\n }\n\n case 0x08: // 9 bit poly\n {\n // Clock P5 & P4 as a standard 9-bit LSFR taps at 8 & 4\n myP5[c] = (bool(myP5[c] & 0x1f) || bool(myP4[c] & 0x0f)) ? ((myP5[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP5[c] & 0x10) ? 1 : 0))) : 1;\n myP4[c] = (myP4[c] << 1) | (bool(myP5[c] & 0x20) ? 1 : 0);\n break;\n }\n\n case 0x09: // 5 bit poly\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // Clock value out of P5 into P4 with no modification\n myP4[c] = (myP4[c] << 1) | (bool(myP5[c] & 0x20) ? 1 : 0);\n break;\n }\n\n case 0x0a: // div 31\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Feed bit 4 of P5 into P4 (this will toggle back and forth)\n myP4[c] = (myP4[c] << 1) | (bool(myP5[c] & 0x10) ? 1 : 0);\n }\n break;\n }\n\n case 0x0b: // Set last 4 bits to 1\n {\n // A 1 is shifted into the 4-bit register each clock\n myP4[c] = (myP4[c] << 1) | 0x01;\n break;\n }\n\n case 0x0c: // div 6\n {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n break;\n }\n\n case 0x0d: // div 6\n {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n break;\n }\n\n case 0x0e: // div 31 . div 6\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n }\n break;\n }\n\n case 0x0f: // poly 5 . div 6\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // Use poly 5 to clock 4-bit div register\n if (bool(myP5[c] & 0x10)) {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n }\n break;\n }\n }\n }\n }\n\n myOutputCounter += JAVA_SOUND_SAMPLE_RATE;\n\n if (myChannels == 1) {\n // Handle mono sample generation\n while ((zSamples > 0) && (myOutputCounter >= TIA_SAMPLE_RATE)) {\n var zChannelZero = (bool(myP4[0] & 8) ? zVolChannelZero : 0); //if bit3 is on, amplitude is the volume, otherwise amp is 0\n var zChannelOne = (bool(myP4[1] & 8) ? zVolChannelOne : 0);\n var zBothChannels = zChannelZero + zChannelOne + myVolumeClip;\n aPreOutputBuffer[zIndex] = (zBothChannels - 128) & 0xFF; // we are using a signed byte, which has a min. of -128\n\n myOutputCounter -= TIA_SAMPLE_RATE;\n zIndex++;\n zSamples--;\n //assert(zIndex<=aStartIndex + zSamplesToProcess);\n\n }\n }\n else {\n // Handle stereo sample generation\n while ((zSamples > 0) && (myOutputCounter >= TIA_SAMPLE_RATE)) {\n var zChannelZero = (bool(myP4[0] & 8) ? zVolChannelZero : 0) + myVolumeClip; //if bit3 is on, amplitude is the volume, otherwise amp is 0\n var zChannelOne = (bool(myP4[1] & 8) ? zVolChannelOne : 0) + myVolumeClip;\n //int zBothChannels=zChannelZero + zChannelOne + myVolumeClip;\n\n aPreOutputBuffer[zIndex] = (zChannelZero - 128) & 0xFF; // we are using a signed byte, which has a min. of -128\n zIndex++;\n zSamples--;\n\n aPreOutputBuffer[zIndex] = (zChannelOne - 128) & 0xFF;\n zIndex++;\n zSamples--;\n\n myOutputCounter -= TIA_SAMPLE_RATE;\n }\n }\n }\n }", "async initialize() {\n // water impulse:\n //const file = 'https://cdn.glitch.com/c44791c8-02d2-4f00-87fb-fa398dfbec75%2Fwater-swirl.wav?v=1574729613476';\n \n // breath impulse:\n const file = 'https://cdn.glitch.com/c44791c8-02d2-4f00-87fb-fa398dfbec75%2Fbreath.wav?v=1574729612779';\n const response = await fetch(file);\n const arrayBuffer = await response.arrayBuffer();\n this._convolver.buffer = await this._context.decodeAudioData(arrayBuffer);\n }", "applyGenericImpulse(impulse) {\n const centerInWorldCoords = this.pointToWorldFrame(new CANNON.Vec3())\n this.applyImpulse(impulse, centerInWorldCoords)\n }", "function playSound(buffer, time) {\n\t\t\tvar source = context.createBufferSource();\n\t\t\tsource.buffer = buffer;\n\t\t\tsource.connect(context.destination);\n\t\t\tsource.start(time);\n\t\t}", "function createAndPlayNoise() {\n if (THREE.AudioContext.state !== \"suspended\")\n {\n window.removeEventListener('touchend', createAndPlayNoise)\n return\n }\n\n var buffer = THREE.AudioContext.createBuffer(1, 1, 22050);\n var source = THREE.AudioContext.createBufferSource();\n source.buffer = buffer;\n source.connect(THREE.AudioContext.destination);\n source.play();\n}", "function process(Data) {\n source = context.createBufferSource(); // Create Sound Source\n context.decodeAudioData(Data, function (buffer) {\n console.log(buffer)\n source.buffer = buffer;\n source.connect(context.destination);\n source.start(context.currentTime);\n })\n }", "function getEmptyAudioBuffer(){\n let emptyAudioBuffer = audioContext.createBuffer(2, audioContext.sampleRate * 5, audioContext.sampleRate);\n return emptyAudioBuffer;\n}", "function buffer2wav(abuffer, offset,len){\n var numOfChan = abuffer.numberOfChannels,\n length = len * numOfChan * 2 + 44,\n buffer = new ArrayBuffer(length),\n view = new DataView(buffer),\n channels = [], i, sample,\n pos = 0;\n\n // write WAVE header\n setUint32(view, pos, 0x46464952); // \"RIFF\"\n setUint32(view, pos, length - 8); // file length - 8\n setUint32(view, pos, 0x45564157); // \"WAVE\"\n\n setUint32(view, pos, 0x20746d66); // \"fmt \" chunk\n setUint32(view, pos, 16); // length = 16\n setUint16(view, pos, 1); // PCM (uncompressed)\n setUint16(view, pos, numOfChan);\n setUint32(view, pos, abuffer.sampleRate);\n setUint32(view, pos, abuffer.sampleRate * 2 * numOfChan); // avg. bytes/sec\n setUint16(view, pos, numOfChan * 2); // block-align\n setUint16(view, pos, 16); // 16-bit (hardcoded in this demo)\n\n setUint32(view, pos, 0x61746164); // \"data\" - chunk\n setUint32(view, pos, length - pos - 4); // chunk length\n\n // write interleaved data\n for(i = 0; i < abuffer.numberOfChannels; i++)\n channels.push(abuffer.getChannelData(i));\n\n while(pos < length) {\n for(i = 0; i < numOfChan; i++) { // interleave channels\n sample = Math.max(-1, Math.min(1, channels[i][offset])); // clamp\n sample = (0.5 + sample < 0 ? sample * 32768 : sample * 32767)|0; // scale to 16-bit signed int\n view.setInt16(pos, sample, true); // update data chunk\n pos += 2;\n }\n }\n offset++; // next source sample\n}", "function resampleBuffer( inBuffer, inNumSamples, inSampleRate, outSampleRate, callback){\n var o = new OfflineAudioContext(1, inNumSamples, outSampleRate);\n \n // create audio buffer\n var b = o.createBuffer(1, inNumSamples, inSampleRate);\n \n // copy data\n var buf = b.getChannelData(0);\n for (var i = 0; i < inNumSamples; i++) {\n buf[i] = inBuffer.getChannelData(0)[i];\n }\n \n /* Play it from the beginning. */\n var source = o.createBufferSource();\n source.buffer = b;\n source.connect(o.destination);\n source.start(0);\n \n /* Start rendering as fast as the machine can. */\n o.startRendering().then(function(renderedBuffer) {\n callback(renderedBuffer);\n }).catch(function(err) {\n console.log('Rendering failed: ' + err);\n });\n }", "function createFadeBuffer(context, activeTime, fadeTime) {\n\t var length1 = activeTime * context.sampleRate;\n\t var length2 = (activeTime - 2*fadeTime) * context.sampleRate;\n\t var length = length1 + length2;\n\t var buffer = context.createBuffer(1, length, context.sampleRate);\n\t var p = buffer.getChannelData(0);\n\t \n\t var fadeLength = fadeTime * context.sampleRate;\n\t\n\t var fadeIndex1 = fadeLength;\n\t var fadeIndex2 = length1 - fadeLength;\n\t \n\t // 1st part of cycle\n\t for (var i = 0; i < length1; ++i) {\n\t var value;\n\t \n\t if (i < fadeIndex1) {\n\t value = Math.sqrt(i / fadeLength);\n\t } else if (i >= fadeIndex2) {\n\t value = Math.sqrt(1 - (i - fadeIndex2) / fadeLength);\n\t } else {\n\t value = 1;\n\t }\n\t \n\t p[i] = value;\n\t }\n\t\n\t // 2nd part\n\t for (var i = length1; i < length; ++i) {\n\t p[i] = 0;\n\t }\n\t \n\t \n\t return buffer;\n\t}", "set Impulse(value) {}", "function createGaussian(duration) {\n var length = Math.floor(WX.srate * duration);\n var noiseFloat32 = new Float32Array(length);\n for (var i = 0; i < length; i++) {\n var r1 = Math.log(Math.random()), r2 = Math.PI * Math.random();\n noiseFloat32[i] = Math.sqrt(-2.0 * r1) * Math.cos(2.0 * r2) * 0.5;\n }\n var noiseBuffer = WX.Buffer(2, length, WX.srate);\n noiseBuffer.getChannelData(0).set(noiseFloat32, 0);\n noiseBuffer.getChannelData(1).set(noiseFloat32, 0);\n return noiseBuffer;\n }", "onProcess(audioProcessingEvent) {\n\n this.blocked = true;\n this.nCall++;\n\n let inputBuffer = audioProcessingEvent.inputBuffer;\n let outputBuffer = audioProcessingEvent.outputBuffer;\n\n for (let chIdx = 0; chIdx < outputBuffer.numberOfChannels; chIdx++) {\n let inputData = inputBuffer.getChannelData(chIdx);\n let outputData = outputBuffer.getChannelData(chIdx);\n\n if (!this.bypass) {\n this.PreStageFilter[chIdx].process(inputData, outputData);\n } else {\n // just copy\n for (let sample = 0; sample < inputBuffer.length; sample++) {\n outputData[sample] = inputData[sample];\n }\n }\n } // next channel\n\n let time = this.nCall * inputBuffer.length / this.sampleRate;\n let gl = this.calculateLoudness(outputBuffer);\n this.callback(time, gl);\n\n this.blocked = false;\n }", "function pointSample(inp, out, inLength, outLength, context)\n{\n const ratio = context.inRate / context.outRate;\n const offset = context.offset;\n const scale = context.scale;\n\n if ( !outLength )\n outLength = Math.round((inLength - offset) / ratio);\n\n // If the out argument is a constructor, construct a new object to use\n // for the output, and return it after processing.\n if ( typeof(out) == \"function\" ) {\n out = new out(outLength);\n }\n\n for ( var i = 0; i < outLength; i++ ) {\n const j = Math.round((i * ratio) + offset);\n if ( j > inLength )\n console.log(\"pointSample input buffer overrun.\");\n out[i] = inp[j] * scale;\n }\n const used = (outLength * ratio) + offset;\n context.offset = ((outLength * ratio) + offset) % ratio; \n return out;\n}", "feedAudioContent(aBuffer) {\n binding.FeedAudioContent(this._impl, aBuffer);\n }", "createAudioPacket(opusPacket, connectionData) {\n const packetBuffer = Buffer.alloc(12);\n packetBuffer[0] = 0x80;\n packetBuffer[1] = 0x78;\n const { sequence, timestamp, ssrc } = connectionData;\n packetBuffer.writeUIntBE(sequence, 2, 2);\n packetBuffer.writeUIntBE(timestamp, 4, 4);\n packetBuffer.writeUIntBE(ssrc, 8, 4);\n packetBuffer.copy(nonce, 0, 0, 12);\n return Buffer.concat([packetBuffer, ...this.encryptOpusPacket(opusPacket, connectionData)]);\n }", "function timeToSampleFrame(time, sampleRate) {\n return Math.floor(0.5 + time * sampleRate);\n}", "function timeToSampleFrame(time, sampleRate) {\n return Math.floor(0.5 + time * sampleRate);\n}", "function simpleSynth(buf, pitch, pitchFun, formantShift, dontStart) {\n formantShift = formantShift || 1.0;\n var rate = audioCtx.sampleRate;\n var start = audioCtx.currentTime;\n var t = 0;\n var choose = 0;\n var outbuf = audioCtx.createBuffer(1, buf.length, audioCtx.sampleRate);\n var out = outbuf.getChannelData(0);\n for (var i = 0; i < pitch.length-1; i++) {\n var delta = pitch[i][1] ? 1/pitch[i][1] : Math.random() * 0.004 + 0.008;\n \n while (t < pitch[i+1][0]) {\n while (choose < t) choose += delta;\n var from = (t-delta/formantShift) * rate | 0;\n var to = (t+delta/formantShift) * rate | 0;\n for (var j = from; j < to; j++) {\n var w = (j - t*rate) / (delta*rate) * formantShift;\n w = Math.cos(w * Math.PI) * 0.5 + 0.5;\n var pos = choose * rate + (j - from) * formantShift;\n if (pos < buf.length-1) {\n var frac = pos - Math.floor(pos);\n var h = Math.floor(pos);\n out[j] += w * ((1-frac) * buf[h] + frac * buf[h+1]);\n }\n }\n if (pitch[i][1] > 1) {\n t += 1/pitchFun(pitch[i][1]);\n }\n else {\n // unvoiced\n t += delta;\n }\n }\n }\n var n = audioCtx.createBufferSource();\n n.connect(audioCtx.destination);\n n.buffer = outbuf;\n n.onended = function () {\n showProgress(\"finished\");\n };\n if (!dontStart) n.start(start);\n return n;\n}", "function instantGenerate(context, buffer, offset, duration, inputNode, url) {\n var sourceNode = context.createBufferSource();\n sourceNode.buffer = buffer;\n sourceNode.loop = false;\n sourceNode.connect(inputNode);\n sourceNode.start(0, offset, duration);\n context.startRendering().then(function (renderedBuffer) {\n console.log('Rendering completed successfully');\n window.AudioContext = window.AudioContext || window.webkitAudioContext;\n var audioCtx = new AudioContext();\n var song = audioCtx.createBufferSource();\n song.buffer = renderedBuffer;\n song.connect(audioCtx.destination);\n song.start();\n }).catch(function (err) {\n console.log('Rendering failed: ' + err);\n // Note: The promise should reject when startRendering is called a second time on an OfflineAudioContext\n });\n}", "function frame(data, frameLength, hopLength) {\n const bufferCount = Math.floor((data.length - frameLength) / hopLength) + 1;\n const buffers = Array.from(\n { length: bufferCount }, (x, i) => new Float32Array(frameLength));\n for (let i = 0; i < bufferCount; i++) {\n const ind = i * hopLength;\n const buffer = data.slice(ind, ind + frameLength);\n buffers[i].set(buffer);\n // In the end, we will likely have an incomplete buffer, which we should\n // just ignore.\n if (buffer.length !== frameLength) {\n continue;\n }\n }\n return buffers;\n}", "function drawWave() {\n requestAnimationFrame(drawWave);\n analyser.getByteTimeDomainData(dataArray);\n canvasCtx.fillStyle = \"rgb(200, 200, 200)\";\n canvasCtx.fillRect(0, 0, canvas.width, canvas.height);\n canvasCtx.lineWidth = 2;\n canvasCtx.strokeStyle = \"rgb(0, 0, 0)\";\n canvasCtx.beginPath();\n var sliceWidth = canvas.width * 1.0 / bufferLength;\n var x = 0;\n for (var i = 0; i < bufferLength; i++) {\n var v = dataArray[i] / 128.0;\n var y = v * canvas.height / 2;\n if (i === 0) {\n canvasCtx.moveTo(x, y);\n }\n else {\n canvasCtx.lineTo(x, y);\n }\n x += sliceWidth;\n }\n canvasCtx.lineTo(canvas.width, canvas.height / 2);\n canvasCtx.stroke();\n}", "function createBufferSource(){\n\t\tvar temp = scope.audioContext.createBufferSource();\n\t\ttemp.onended = function(){\n\t\t\tthis.stop();\n\t\t\tthis.disconnect();\n\t\t}\n\t\treturn temp;\n\t}", "function addShortSamplesToInputBuffer(\r\n samples,\r\n numSamples)\r\n {\r\n if(numSamples == 0) {\r\n return;\r\n }\r\n enlargeInputBufferIfNeeded(numSamples);\r\n move(inputBuffer, numInputSamples, samples, 0, numSamples);\r\n numInputSamples += numSamples;\r\n }", "function firstBufferLoader(buffer)\n {\n \n var index = curSoundSource;\n // Create a new sound so we can have a new sound buffer\n sounds[index] = new THREE.PositionalAudio( listener );\n // sounds[index].setPanningModel(PAN_MODEL);\n sounds[index].setFilter(soundGains[index]);\n // sounds[index].setRolloffFactor(2);\n\n meshes[index] = new THREE.Mesh(sphere, material_spheres[index] );\n meshes[index].position.set( SOUND_POSITIONS[index][0], SOUND_POSITIONS[index][1], SOUND_POSITIONS[index][2] );\n //scene.add( meshes[index+10] );\n\n sounds[index].setBuffer(buffer);\n sounds[index].setRefDistance(REF_DIST);\n sounds[index].setLoop(false);\n sounds[index].startTime = 0;\n sounds[index].setPlaybackRate(1);\n sounds[index].panner.connect(convolver);\n meshes[index].add(sounds[index]);\n analysers[index] = new THREE.AudioAnalyser(sounds[index], FFTSize);\n \n // Add the sound to the object map\n loadedSounds[curSoundFile] = sounds[index];\n sounds[index].play();\n //debugAudioLog(curSoundSource);\n curSoundSource++;\n }", "addSignal(signal) {\n for (var i = 0; i < signal.length; i++) {\n if (i >= this.bufferSize) {\n break;\n }\n this.signal[i] += signal[i];\n\n /*\n // Constrain amplitude\n if ( this.signal[i] > 1 ) {\n this.signal[i] = 1;\n } else if ( this.signal[i] < -1 ) {\n this.signal[i] = -1;\n }\n */\n }\n return this.signal;\n }", "function create_synth(){\n var bus_num = create_new_bus(context.destination);\n\tadd_osc(bus_num, \"sawtooth\");\n\tadd_osc(bus_num, \"square\");\n add_osc(bus_num, \"sawtooth\");\n \n\tadd_osc(bus_num, \"sine\");\n\tadd_convolution(bus_num, \"snd/imp/impulse.wav\");\n\tadd_ADHSR_env(bus_num, 0, 0.2, 0.05, 0.5, 0.5);\n\tadd_filter(bus_num)\n\tdry_wet(0, 1, 100);\n\t\n set_bus_gain(bus_num, 0.03);\n}", "function renderAudio() {\n var now = audioContext.currentTime;\n \n for (var i = 0; i < NUMBER_OF_SOUND_SOURCES; i++)\n {\n if (meshes[i] != null)\n {\n meshes[i].updateMatrixWorld();\n }\n }\n\n\n if (soundsPlaying)\n {\n if ((loopCount % 2) === 0)\n {\n for (var i = 0; i < NUMBER_OF_SOUND_SOURCES; i++)\n {\n if (waitTimes[i] < (now - prevTime[i]))\n {\n \n if (onOff[i])\n {\n // Play a sound from this soundsource chosen by random walk\n \n waitTimes[i] = playRandomSound(i); // playRandomSound returns the duration of the loaded sample\n }\n else\n {\n onOff[i] = true;\n waitTimes[i] = ((Math.random() * WAIT_MAX) + WAIT_OFFSET);\n //console.log(waitTimes[i]);\n\n }\n prevTime[i] = now;\n }\n }\n }\n loopCount++;\n } \n }", "constructor({audioCtx, fftSize, carFreq, modAmpl, modFreq, visualCtx}) {\n this.audioCtx = audioCtx;\n this,fftSize = fftSize;\n this.carFreq = carFreq;\n this.modAmpl = modAmpl;\n this.modFreq = modFreq;\n this.visualCtx = visualCtx;\n this.play = false;\n\n\n this.animate;\n this.analyserNode = audioCtx.createAnalyser();\n this.analyserNode.smoothingTimeConstant = 0.0;\n this.analyserNode.fftSize = fftSize;\n\n // Create the array for the data values\n this.frequencyArray = new Uint8Array(this.analyserNode.frequencyBinCount);\n\n // Uses the chroma.js library by Gregor Aisch to create a color gradient\n // download from https://github.com/gka/chroma.js\n this.colorScale = new chroma.scale('Spectral').domain([1,0]);\n // Global Variables for Drawing\n this.column = 0;\n this.canvasWidth = 800;\n this.canvasHeight = 256;\n }", "function playback() {\n let randomNote = allNotesArray[Math.floor(Math.random() * allNotesArray.length)];\n const playSound = ctx.createBufferSource();\n playSound.buffer = randomNote;\n playSound.connect(ctx.destination);\n playSound.start(ctx.currentTime);\n randomNoteIndex = allNotesArray.indexOf(randomNote);\n console.log(randomNoteIndex);\n}", "onItemPushImpulse(itemTag){\n return (clickedPos, source) =>{\n this.controllerRef.getControllerForwardAsync().then((forward)=>{\n var pushStrength = 3;\n var pushImpulse = [forward[0]*pushStrength, forward[1]*pushStrength, forward[2]*pushStrength];\n this.ball.getTransformAsync().then((transform) => {\n var pos = transform.position;\n var pushPosition = [clickedPos[0] - pos[0], clickedPos[1] - pos[1], clickedPos[2] - pos[2]];\n this.ball.applyImpulse(pushImpulse, pushPosition);\n });\n });\n }\n }", "constructor(sampleRate) {\n this.sampleRate = sampleRate;\n this.gain = 1;\n this.reset();\n this.clear();\n }", "function normalize (buffer, target, start, end) {\n validate(buffer);\n\n //resolve optional target arg\n if (!isAudioBuffer(target)) {\n end = start;\n start = target;\n target = null;\n }\n\n if (target) {\n validate(target);\n }\n else {\n target = buffer;\n }\n\n var max = reduce(buffer, function (prev, curr) {\n return Math.max(Math.abs(prev), Math.abs(curr));\n }, 0, start, end);\n\n var amp = 1 / Math.min(max, 1);\n\n return fill(buffer, target, function (value) {\n return Math.min(value * amp, 1);\n }, start, end);\n}", "function CombFilter (sampleRate, delaySize, feedback, damping) {\n\tvar\tself\t= this;\n\tself.sampleRate\t= sampleRate;\n\tself.buffer\t= new Float32Array(isNaN(delaySize) ? 1200 : delaySize);\n\tself.bufferSize\t= self.buffer.length;\n\tself.feedback\t= isNaN(feedback) ? self.feedback : feedback;\n\tself.damping\t= isNaN(damping) ? self.damping : damping;\n\tself.invDamping\t= 1 - self.damping;\n}", "function playSound(audioBuffer) {\r\n\tsetupAudioNodes(); //이거 사실 한번만 호출해 두면 될 것 같은데...\r\n\tstartTime = audioContext.currentTime;\r\n\tsourceNode.buffer = audioBuffer;\r\n\tsourceNode.start(0, startOffset % audioBuffer.duration);\r\n\tplayingOn = true;\r\n}", "function channelEffects() {\n\n 'use strict';\n\n var\n\n id = 0,\n context,\n\n zeroValue = 0.00000000000000001,\n\n createClass, // defined in util.js\n getSample, // defined in instrument_manager.js\n\n Reverb,\n Panner,\n Panner2,\n Delay,\n BiQuadFilter,\n Compressor;\n\n\n function Effect(config) {\n this.id = 'FX' + id++ + '' + new Date().getTime();\n this.type = config.type;\n this.buffer = config.buffer;\n this.config = config;\n\n this.bypass = false;\n this.amount = 0;//0.5;\n\n this.output = context.createGainNode();\n this.wetGain = context.createGainNode();\n this.dryGain = context.createGainNode();\n\n this.output.gain.value = 1;\n this.wetGain.gain.value = this.amount;\n this.dryGain.gain.value = 1 - this.amount;\n }\n\n\n Effect.prototype.setInput = function (input) {\n // input.connect(this.node);\n // return;\n\n // dry channel\n input.connect(this.dryGain);\n this.dryGain.connect(this.output);\n\n // wet channel\n input.connect(this.node);\n this.node.connect(this.wetGain);\n this.wetGain.connect(this.output);\n };\n\n /*\n Effect.prototype.setOutput = function(output){\n this.output.disconnect(0);\n this.output.connect(output);\n };\n */\n\n Effect.prototype.setAmount = function (value) {\n /*\n this.amount = value < 0 ? 0 : value > 1 ? 1 : value;\n var gain1 = Math.cos(this.amount * 0.5 * Math.PI),\n gain2 = Math.cos((1.0 - this.amount) * 0.5 * Math.PI);\n this.gainNode.gain.value = gain2 * this.ratio;\n */\n\n this.amount = value < 0 ? 0 : value > 1 ? 1 : value;\n this.wetGain.gain.value = this.amount;\n this.dryGain.gain.value = 1 - this.amount;\n //console.log('wet',this.wetGain.gain.value,'dry',this.dryGain.gain.value);\n };\n\n\n Effect.prototype.copy = function () {\n switch (this.type) {\n case 'reverb':\n return new Reverb(this.config);\n case 'panner':\n return new Panner(this.config);\n case 'panner2':\n return new Panner2(this.config);\n case 'delay':\n return new Delay(this.config);\n case 'compressor':\n return new Compressor(this.config);\n }\n };\n\n\n sequencer.createReverb = function (id) {\n var buffer = getSample(id);\n if (buffer === false) {\n console.warn('no reverb with id', id, 'loaded');\n return false;\n }\n var config = {\n type: 'reverb',\n buffer: buffer\n };\n return new Reverb(config);\n };\n\n\n sequencer.createPanner = function (config) {\n config = config || {};\n config.type = 'panner';\n return new Panner(config);\n };\n\n\n sequencer.createPanner2 = function (config) {\n config = config || {};\n config.type = 'panner2';\n return new Panner2(config);\n };\n\n\n sequencer.createDelay = function (config) {\n config = config || {};\n config.type = 'delay';\n return new Delay(config);\n };\n\n\n sequencer.createCompressor = function (config) {\n config = config || {};\n config.type = 'compressor';\n return new Compressor(config);\n };\n\n\n sequencer.createBiQuadFilter = function (config) {\n config = config || {};\n config.type = 'biquadfilter';\n return new BiQuadFilter(config);\n };\n\n\n sequencer.protectedScope.addInitMethod(function () {\n context = sequencer.protectedScope.context;\n createClass = sequencer.protectedScope.createClass;\n getSample = sequencer.getSample;\n\n Reverb = createClass(Effect, function (config) {\n this.node = context.createConvolver();\n this.node.buffer = config.buffer;\n //console.log(this.node.buffer);\n });\n\n Panner = createClass(Effect, function (config) {\n this.node = context.createPanner();\n this.node.panningModel = 'equalpower';\n this.node.setPosition(zeroValue, zeroValue, zeroValue);\n });\n\n Panner2 = createClass(Effect, function (config) {\n this.node = context.createPanner();\n this.node.panningModel = 'HRTF';\n this.node.setPosition(zeroValue, zeroValue, zeroValue);\n });\n\n Delay = createClass(Effect, function (config) {\n this.node = context.createDelay();\n this.node.delayTime.value = 0.3;\n });\n\n Compressor = createClass(Effect, function (config) {\n this.node = context.createDynamicsCompressor();\n });\n\n\n BiQuadFilter = createClass(Effect, function (config) {\n this.node = context.createBiquadFilter();\n this.node.type = 0;\n this.node.Q.value = 4;\n this.node.frequency.value = 1600;\n });\n\n /*\n Panner.prototype.setPosition = function(x, y, z){\n var multiplier = 5;\n console.log(x * multiplier);\n this.node.setPosition(x * multiplier, y * multiplier, z * multiplier);\n };\n */\n\n Panner.prototype.setPosition = function (value) {\n var x = value,\n y = 0,\n z = 1 - Math.abs(x);\n\n x = x === 0 ? zeroValue : x;\n y = y === 0 ? zeroValue : y;\n z = z === 0 ? zeroValue : z;\n this.node.setPosition(x, y, z);\n //console.log(1,x,y,z);\n };\n\n Panner2.prototype.setPosition = function (value) {\n var xDeg = parseInt(value),\n zDeg = xDeg + 90,\n x, y, z;\n if (zDeg > 90) {\n zDeg = 180 - zDeg;\n }\n x = Math.sin(xDeg * (Math.PI / 180));\n y = 0;\n z = Math.sin(zDeg * (Math.PI / 180));\n x = x === 0 ? zeroValue : x;\n y = y === 0 ? zeroValue : y;\n z = z === 0 ? zeroValue : z;\n this.node.setPosition(x, y, z);\n //console.log(2,x,y,z);\n };\n\n Delay.prototype.setTime = function (value) {\n this.node.delayTime.value = value;\n };\n\n });\n}", "synthesizeOutputBlock(outBlock) {\n\n // Get block index for pair and odd buffers\n /*\n We want to get X: the current block to mix\n 0 0 0 X 0 --> Pair block\n X O O O O --> Odd block\n o o o x ... --> Synthesized block (outBlock)\n */\n\n\n let indBlockPair = this._countBlock % this._modIndexBuffer;\n let indBlockOdd = (indBlockPair + this._modIndexBuffer/2) % this._modIndexBuffer;\n\n // TODO: Right now this only works for 50% overlap and an even number of blocks per frame.\n // More modifications would be necessary to include less than 50% overlap and an odd number of blocks per frame. Right now an amplitude modulation would appear for an odd number of blocks per frame (to be tested - AM from 1 to 0.5).\n\n // Iterate over the corresponding block of the synthesized buffers\n for (let i = 0; i<outBlock.length; i++){\n let indPair = i + 128*indBlockPair;\n let indOdd = i + 128*indBlockOdd;\n\n // Hanning window\n // Use hanning window sin^2(pi*n/N)\n let hannPairBValue = Math.pow(Math.sin(Math.PI*indPair/this._frameSize), 2);\n let hannOddBValue = Math.pow(Math.sin(Math.PI*indOdd/this._frameSize), 2);\n //let hannPairBValue = 0.54 - 0.46 * Math.cos(2*Math.PI*indPair/(this._frameSize-1));\n //let hannOddBValue = 0.54 - 0.46 * Math.cos(2*Math.PI*indOdd/(this._frameSize-1));\n // Hanning windowed frames addition\n outBlock[i] = hannPairBValue*this._pairSynthBuffer[indPair] + hannOddBValue*this._oddSynthBuffer[indOdd];\n\n // Debugging\n //outBlock[i] = this._pairBuffer[i];//this._pairSynthBuffer[indPair];//0.5*this._pairSynthBuffer[indPair] + 0.5*this._oddSynthBuffer[indOdd];\n this._block1[i] = this._pairSynthBuffer[indPair];\n this._block2[i] = this._oddSynthBuffer[indOdd];\n }\n\n }", "function playbackHarmonic() {\n let randomNoteHarmonic = allNotesArrayHarmonic[Math.floor(Math.random() * allNotesArrayHarmonic.length)];\n const playSound = ctx.createBufferSource();\n playSound.buffer = randomNoteHarmonic;\n playSound.connect(ctx.destination);\n playSound.start(ctx.currentTime);\n randomNoteIndex = allNotesArrayHarmonic.indexOf(randomNoteHarmonic);\n console.log(randomNoteIndex);\n}", "update() {\n const data = this.sound.waveformData;\n const ctx = this.canvas.getContext('2d');\n\n ctx.clearRect(0, 0, Infinity, Infinity);\n\n for (let x = 0; x < this.canvas.offsetWidth; x++) {\n\n const sampleInd = Math.floor(x * data.width / this.canvasWidth);\n const value = Math.floor(this.canvasHeight * data.samples[sampleInd] / data.height / 2);\n\n for (let y = value; y < this.canvasHeight - value; y++) {\n ctx.fillStyle = x < this.sound.currentTime / this.sound.duration * this.canvasWidth ? '#f60' : '#333';\n ctx.fillRect(x, y, 1, 1);\n }\n }\n }", "function BufferPreset(){\n\n\tthis.output = audioCtx.createGain();\n\n\tthis.playbackRateInlet = new MyGain(1);\n\n}", "function playSound( sound, delay ) {\n var source = audioContext.createBufferSource();\n source.buffer = sound;\n source.connect( audioContext.destination );\n source.start( delay ? audioContext.currentTime + delay : 0 );\n}", "function createLPInputFilter() {\n lpInputFilter = audioContext.createBiquadFilter();\n lpInputFilter.frequency.value = 2048;\n return lpInputFilter;\n}", "function createBuffer(byteArray) {\n /**\n\t * Retrieve the pattern for HUFF table lookup\n\t */\n function bitsBuf2HuffPattern(byteArray, index, nb_bits) {\n var sourceBitStart = index\n var sz = nb_bits - 1\n if (byteArray.length * 8 < sourceBitStart + nb_bits) {\n throw \"Verify that dest buf is large enough\"\n }\n var bittoread = 0\n var pattern = 0\n while (nb_bits > 0) {\n if (byteArray[sourceBitStart >> 3] & (1 << (sourceBitStart & 0x07))) {\n pattern |= 1 << (sz - bittoread)\n }\n nb_bits--\n bittoread++\n sourceBitStart++\n }\n return pattern\n }\n\n return {\n index: 0,\n byteArray: byteArray,\n getNextSample: function(sampleType, nbBitsInput) {\n var nbBits = nbBitsInput || ST[sampleType]\n var sourceBitStart = this.index\n this.index += nbBits\n if (sampleType === ST_FL && nbBits !== 32) {\n throw \"Mauvais sampletype\"\n }\n\n var u32 = 0\n var nbytes = Math.trunc((nbBits - 1) / 8) + 1\n var nbitsfrombyte = nbBits % 8\n if (nbitsfrombyte === 0 && nbytes > 0) {\n nbitsfrombyte = 8\n }\n\n while (nbytes > 0) {\n var bittoread = 0\n while (nbitsfrombyte > 0) {\n var idx = sourceBitStart >> 3\n if (this.byteArray[idx] & (1 << (sourceBitStart & 0x07))) {\n u32 |= 1 << ((nbytes - 1) * 8 + bittoread)\n }\n nbitsfrombyte--\n bittoread++\n sourceBitStart += 1\n }\n nbytes--\n nbitsfrombyte = 8\n }\n // Propagate the sign bit if 1\n if (\n (sampleType == ST_I4 || sampleType == ST_I24) &&\n u32 & (1 << (nbBits - 1))\n ) {\n for (var i = nbBits; i < 32; i++) {\n u32 |= 1 << i\n nbBits++\n }\n }\n return u32\n },\n\n /**\n\t * Extract sz and bi from Huff table\n\t */\n getNextBifromHi: function(huff_coding) {\n for (var i = 2; i < 12; i++) {\n var lhuff = bitsBuf2HuffPattern(this.byteArray, this.index, i)\n for (var j = 0; j < HUFF[huff_coding].length; j++) {\n if (\n HUFF[huff_coding][j].sz == i &&\n lhuff == HUFF[huff_coding][j].lbl\n ) {\n this.index += i\n return j\n }\n }\n }\n throw \"Bi not found in HUFF table\"\n }\n }\n}", "function doSample(event) {\n var now = Date.now();\n if (lastSampleTimestamp <= 0){\n lastSampleTimestamp = now;\n return; \n }\n var deltaSec = (now - lastSampleTimestamp)/1000;\n\n\n if (sampleRateSamples > 0){\n //Use the first several samples to calculate the device's sample rate\n if (rawSampleRate == null) {\n rawSampleRate = 1 / deltaSec;\n } else {\n rawSampleRate = (rawSampleRate + (1 / deltaSec))/2; //Hz \n }\n sampleRateSamples--;\n\n } else if (sampleRateSamples == 0){\n //We got all our device sample-rate related readings, \n //now calculate the sample-rate related parameters\n sampleIntervalMS = 1000 / rawSampleRate;\n\n var destSampleRate = 2*options.max_stride_freq;\n samplesToSkip = Math.floor(rawSampleRate / destSampleRate) - 1;\n sampleIntervalMS *= (samplesToSkip+1);\n actualSampleRate = 1000/sampleIntervalMS; //Hz\n amplitudeCheckSamples = Math.ceil(actualSampleRate); //look a second back\n\n //store first sample\n var datum = event.accelerationIncludingGravity[options.axis] || 0.5;\n shift(samples, datum);\n\n sampleRateSamples--;\n\n } else {\n //normal measurments\n if (samplesSkipped < samplesToSkip) {\n samplesSkipped++;\n return;\n }\n samplesSkipped = 0;\n\n var datum = event.accelerationIncludingGravity[options.axis] || 0.5;\n\n if (samples[samples.length-1] != 0){ //TODO\n //integrate to get a velocity sample\n var velocity = vSamples[vSamples.length-1] + (datum - samples[samples.length-1])*sampleIntervalMS/1000;\n shift(vSamples, velocity);\n }\n\n var smoothed = datum;//smooth(samples[samples.length-1], datum, options.smooth_alpha);\n shift(samples, smoothed);\n\n var freq = -1;\n switch (options.algorithm) {\n case 'fft':\n freq = getFreqFft(samples);\n break;\n case 'zero-cross':\n freq = getFreqCross(samples);\n break;\n case 'zero-cross-v':\n freq = getFreqCross(vSamples);\n break;\n }\n\n var spm = Math.round(freq*60);\n if (spm > lastSpm) {\n //rising (usually slower than falling)\n spm = Math.round(smooth(lastSpm, spm, options.smooth_alpha_rising));\n } else {\n //falling (it's possible to stop very quickly)\n spm = Math.round(smooth(lastSpm, spm, options.smooth_alpha_falling));\n }\n lastSpm = spm;\n }\n \n lastSampleTimestamp = now;\n }", "function updatePitch(timestamp) { // confusing argument, this is mainloop\n\n if(timestamp < lastFrameTimeMs + (1000 / maxFPS)) {\n\twindow.requestAnimationFrame(updatePitch);\n\treturn;\n }\n\n timeDelta = timestamp - lastFrameTimeMs; \n lastFrameTimeMs = timestamp;\n\n var numUpdateSteps = 0;\n\n // oh boy...\n while(timeDelta >= timestep) {\n\n\tanalyser.getFloatTimeDomainData( buf );\n\tvar pitch = audio.autoCorrelate( buf, audioContext.sampleRate );\n\n\tlet pb = mic.pitchBuffer,\n\t pl = pb.length,\n\t prevPitch = !! pl ? pb[pl-1] : 0;\n\n\t// pitch was garbled, or inhuman\n\tif(pitch == -1 || pitch > 4700) // world record is 4186\n\t pitch = prevPitch;\n\n\t// an abrupt change just be noise\n\t// we give a grace period of 3 samples\n\t// meanwhile feed them the last detected pitch\n\t// improvement: calculate where their voice is going\n\tlet abrupt = Math.abs(prevPitch-pitch) > sensibleChange;\n\tif(abrupt) {\n\t if(mic.mightStillBeNoise) {\n\t\tmic.noiseLessLikely();\n\t\tpitch = prevPitch; // assume no change\n\t } else mic.resetNoiseDetection(pitch);\n\t}\n\n\tpitch = mic.smoothPitch(pitch);\n\n\t// update but do not render\n\thandlePitch(pitch, timeDelta, false);\n\n\n\t// oh boy\n\ttimeDelta -= timestep;\n\tif(++numUpdateSteps >= 240) {\n\t panic();\n\t break;\n\t}\n }\n\n // update and render because I can't \"just render\" atm\n handlePitch(pitch, timeDelta, true);\n\n\n rafID = window.requestAnimationFrame( updatePitch );\n\n}", "function create (a, b, c) {\n return new AudioBuffer(a, b, c);\n}", "constructor(d, audioCtx, source, muted=true, dir=\"vertical\") {\n this.clipping = false;\n this.lastClip = 0;\n this.clipLag = 250;\n this.clipLevel = 250;\n this.mode = MeterMode.RMS;\n this.klipKludge = 0;\n\n this.analyser = audioCtx.createAnalyser();\n this.analyser.fftSize = 256;\n this.analyser.smoothingTimeConstant = 0.8;\n\n this.bufferLength = 128; // this.analyser.frequencyBinCount;\n this.dataArray = new Uint8Array(this.bufferLength);\n //this.dataArray = new Float32Array(this.bufferLength);\n\n\tsource.connect(this.analyser);\n // this.canvas = document.createElement(\"canvas\");\n this.canvas = document.createElement(\"div\");\n this.canvas.setAttribute(\"id\", \"audioCanvas\"+canvases++);\n this.canvas.classList.add(\"audioCanvas\");\n\n //this.canvas.width = d.offsetWidth - 4;\n //this.canvas.height = d.offsetHeight - 26;\n\n // this.canvas.style.position = \"absolute\"\n this.canvas.style.width = d.offsetWidth - 4 +\"px\";\n this.canvas.style.height = d.offsetHeight - 26 +\"px\";\n\n this.height = d.offsetHeight;\n\n //this.canvasCtx = this.canvas.getContext(\"2d\");\n this.dir = dir;\n if (this.dir === \"vertical\") {\n //this.canvas.style.opacity = 0.9;\n }\n if (d) {\n d.appendChild(this.canvas);\n }\n\n this.volume = 0;\n this.averaging = 0.95;\n //this.image = new Image(this.canvas.width, this.canvas.height);\n //this.image.src = \"./images/microphone.png\";\n // this.image.onload = () => this.draw;\n this.draw();\n this.muted = muted;\n }", "function init(arrayBuffer) {\n // document.getElementById('instructions').innerHTML = 'Loading ...'\n // Create a new `audioContext` and its `analyser`\n window.audioCtx = new AudioContext();\n context = audioCtx;\n window.analyser = audioCtx.createAnalyser();\n // If a sound is still playing, stop it.\n // if (window.source)\n // source.noteOff(0)\n // Decode the data in our array into an audio buffer\n audioCtx.decodeAudioData(arrayBuffer, function (buffer) {\n // Use the audio buffer with as our audio source\n window.source = audioCtx.createBufferSource();\n source.buffer = buffer;\n // Connect to the analyser ...\n source.connect(analyser);\n // and back to the destination, to play the sound after the analysis.\n analyser.connect(audioCtx.destination);\n // Start playing the buffer.\n source.start(0);\n // Initialize a visualizer object\n var viz = new simpleViz();\n // Finally, initialize the visualizer.\n new visualizer(viz[\"update\"], analyser);\n // document.getElementById('instructions').innerHTML = ''\n });\n}", "function processAudioInput(event)\n{\n const r = window.radioclient\n\n if ( !r.transmitting || r.disable )\n return;\n\n const data = event.inputBuffer.getChannelData(0);\n r.soc.send(pointSample(\n data, Int16Array, data.length, null, r.inputInterpolationContext));\n}", "function MidiSynthSampleAndHoldOscillator(sampleFreq, bufferLen, func) {\r\n MidiSynthOscillator.call(this, sampleFreq, bufferLen);\r\n this.normalizedPhase = 0;\r\n this.phaseStep = 0;\r\n this.func = func;\r\n this.funcSampleFreqMult = 1;\r\n this.value = null;\r\n this.setFrequency(this.freq);\r\n}", "calculateLoudness(buffer) {\n\n // first call or after resetMemory\n if (this.copybuffer == undefined) {\n // how long should the copybuffer be at least? \n // --> at least maxT should fit in and length shall be an integer fraction of buffer length\n let length = Math.floor(this.sampleRate * this.loudnessprops.maxT / buffer.length + 1) * buffer.length;\n this.copybuffer = new CircularAudioBuffer(context, this.nChannels, length, this.sampleRate);\n }\n\n //accumulate buffer to previous call\n this.copybuffer.concat(buffer);\n\n // must be gt nSamplesPerInterval\n // or: wait at least one interval time T to be able to calculate loudness\n if (this.copybuffer.getLength() < this.nSamplesPerInterval) {\n console.log('buffer too small ... have to eat more data');\n return NaN;\n }\n\n // get array of meansquares from buffer of overlapping intervals\n let meanSquares = this.getBufferMeanSquares(this.copybuffer, this.nSamplesPerInterval, this.nStepsize);\n\n // first stage filter\n this.filterBlocks(meanSquares, this.gamma_a);\n\n // second stage filter\n let gamma_r = 0.;\n for (let chIdx = 0; chIdx < this.nChannels; chIdx++) {\n let mean = 0.;\n for (let idx = 0; idx < meanSquares[chIdx].length; idx++) {\n mean += meanSquares[chIdx][idx];\n }\n mean /= meanSquares[chIdx].length;\n gamma_r += (this.channelWeight[chIdx] * mean);\n }\n gamma_r = -0.691 + 10.0 * Math.log10(gamma_r) - 10.;\n\n this.filterBlocks(meanSquares, gamma_r);\n\n // gated loudness from filtered blocks\n let gatedLoudness = 0.;\n for (let chIdx = 0; chIdx < this.nChannels; chIdx++) {\n let mean = 0.;\n for (let idx = 0; idx < meanSquares[chIdx].length; idx++) {\n mean += meanSquares[chIdx][idx];\n }\n mean /= meanSquares[chIdx].length;\n\n gatedLoudness += (this.channelWeight[chIdx] * mean);\n }\n gatedLoudness = -0.691 + 10.0 * Math.log10(gatedLoudness);\n\n //console.log(this.id, '- gatedLoudness:', gatedLoudness);\n\n return gatedLoudness;\n }", "function updateBuffers() {\n \n triangleVerticestop[0] = triangleVerticestop[0] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticestop[3] = triangleVerticestop[3] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticestop[6] = triangleVerticestop[6] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20));\n triangleVerticestop[9] = triangleVerticestop[9] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20));\n triangleVerticestop[12] = triangleVerticestop[12] -0.03*Math.sin(2*Math.PI*((framecount+5)/20)); //repeat vetex, should be the same pace with the bommon fan\n triangleVerticestop[15] = triangleVerticestop[15] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20));\n triangleVerticestop[18] = triangleVerticestop[18] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticestop[21] = triangleVerticestop[21] +0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n\n \n \n triangleVerticesmid[0] = triangleVerticesmid[0] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[3] = triangleVerticesmid[3] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[6] = triangleVerticesmid[6] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[9] = triangleVerticesmid[9] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[15] = triangleVerticesmid[15] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[12] = triangleVerticesmid[12] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0)); //repeat vetex, should be the same pace with the top fan\n triangleVerticesmid[18] = triangleVerticesmid[18] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[21] = triangleVerticesmid[21] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n\n //update the top buffer new positions\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffertop);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVerticestop), gl.DYNAMIC_DRAW);\n vertexPositionBuffertop.itemSize = 3;\n vertexPositionBuffertop.numberOfItems = 8;\n //update the bottom buffer new positions\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffermid);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVerticesmid), gl.DYNAMIC_DRAW);\n vertexPositionBuffermid.itemSize = 3;\n vertexPositionBuffermid.numberOfItems = 8;\n}", "function schedule(buffer, srvTime) {\n var source = audioContext.createBufferSource()\n , gainNode = audioContext.createGain()\n , duration = buffer.duration\n , startTime = transponseTime(srvTime)\n , currentTime = audioContext.currentTime;\n\n // if audioContext is not ready yet.\n if (startTime === null) {\n return;\n }\n\n // connect the components\n source.buffer = buffer;\n source.connect(gainNode);\n gainNode.connect(masterGain);\n // to avoid click! fade in and out\n gainNode.gain.linearRampToValueAtTime(0, startTime);\n gainNode.gain.linearRampToValueAtTime(1, startTime + overlapTime);\n gainNode.gain.linearRampToValueAtTime(1, startTime + duration -overlapTime);\n gainNode.gain.linearRampToValueAtTime(0, startTime + duration);\n\n // play the chunk if it is in the future\n // log the issues.\n if (startTime > currentTime) {\n if (startTime - currentTime < 1) {\n console.log(\"chunk almost late: \", startTime - currentTime);\n }\n source.start(startTime);\n maxScheduledPoint = Math.max(maxScheduledPoint, startTime + duration);\n } else if (startTime + duration > currentTime) {\n console.log(\"chunk played with offset. late for: \",\n currentTime - startTime);\n source.start(currentTime, currentTime - startTime);\n maxScheduledPoint = Math.max(maxScheduledPoint, startTime + duration);\n } else {\n console.log(\"chunk ignored. late for: \", currentTime - startTime);\n }\n }", "constructor() {\n this.r = new Uint16Array(10);\n this.h = new Uint16Array(10);\n this.pad = new Uint16Array(8);\n this.buffer = Buffer.alloc(16);\n this.fin = -1;\n this.leftover = 0;\n }", "init(trackname) {\n window.AudioContext = window.AudioContext || window.webkitAudioContext;\n this.context = new AudioContext();\n let self = this;\n console.log(self);\n this.bufferLoader = new BufferLoader(\n self.context,\n [\n trackname\n ],\n function(bufferList) {\n self.source = self.context.createBufferSource();\n self.source.buffer = bufferList[0];\n self.sourceBuffer1 = self.source.buffer;\n }\n );\n\n this.bufferLoader.load();\n this.masterGain = this.context.createGain();\n this.masterGain.gain.value = 0.5;\n this.gain = this.context.createGain();\n this.gain.gain.value = 0.5;\n this.crossGain = this.context.createGain();\n this.gain.gain.value = 0.5;\n this.highShelf = this.context.createBiquadFilter();\n this.highShelf.type = 'highshelf';\n this.highShelf.frequency.value = 14000;\n this.highShelf.gain.value = 0.0;\n this.peaking = this.context.createBiquadFilter();\n this.peaking.type = 'peaking';\n this.peaking.frequency.value = 2000;\n this.peaking.Q.value= 0.8;\n this.peaking.gain.value = 0;\n this.lowShelf = this.context.createBiquadFilter();\n this.lowShelf.type = 'lowshelf';\n this.lowShelf.frequency.value = 600;\n this.lowShelf.gain.value = 0.0;\n }", "function playSilenceForMillis(length) {\n var iterations = length / 2;\n for (var i = 0; i < iterations * 30; i++) {\n soundData.push(0);\n }\n}", "function flushStream()\r\n {\r\n var remainingSamples = numInputSamples;\r\n var s = speed/pitch;\r\n var r = rate*pitch;\r\n var expectedOutputSamples = Math.floor(numOutputSamples + Math.floor((remainingSamples/s + numPitchSamples)/r + 0.5));\r\n\r\n // Add enough silence to flush both input and pitch buffers.\r\n enlargeInputBufferIfNeeded(remainingSamples + 2*maxRequired);\r\n for(var xSample = 0; xSample < 2*maxRequired*numChannels; xSample++) {\r\n inputBuffer[remainingSamples*numChannels + xSample] = 0;\r\n }\r\n numInputSamples += 2*maxRequired;\r\n writeShortToStream(null, 0);\r\n // Throw away any extra samples we generated due to the silence we added.\r\n if(numOutputSamples > expectedOutputSamples) {\r\n numOutputSamples = expectedOutputSamples;\r\n }\r\n // Empty input and pitch buffers.\r\n numInputSamples = 0;\r\n remainingInputToCopy = 0;\r\n numPitchSamples = 0;\r\n }", "grow(){\n let head = this.body[this.body.length-1].copy();\n this.len++;\n this.body.push(head);\n\n //Increase the Frame Rate every other win\n if (this.body.length%2){\n fr +=1;\n frameRate(fr);\n }\n }", "function loadBuffer(audioFilename, bufferIndex) {\n \n let request = new XMLHttpRequest();\n\n request.open('GET', audioFilename, true);\n request.responseType = 'arraybuffer';\n\n request.onload = function () {\n let fileContents = request.response;\n convertToAudioData(fileContents, bufferIndex);\n }\n\n request.onerror = function() {\n console.log('XHR error loading ' + audioFilename);\n }\n\n request.send();\n }", "function FFT(bufferSize, sampleRate) {\n\t\tthis.bufferSize = bufferSize;\n\t\tthis.sampleRate = sampleRate;\n\t\tthis.spectrum = new Float32Array(bufferSize/2);\n\t\tthis.real = new Float32Array(bufferSize);\n\t\tthis.imag = new Float32Array(bufferSize);\n\t\tthis.reverseTable = new Uint32Array(bufferSize);\n\t\tthis.sinTable = new Float32Array(bufferSize);\n\t\tthis.cosTable = new Float32Array(bufferSize);\n\n\t\tvar limit = 1,\n\t\t\tbit = bufferSize >> 1;\n\n\t\twhile ( limit < bufferSize ) {\n\t\t\tfor ( var i = 0; i < limit; i++ ) {\n\t\t\t\tthis.reverseTable[i + limit] = this.reverseTable[i] + bit;\n\t\t\t}\n\n\t\t\tlimit = limit << 1;\n\t\t\tbit = bit >> 1;\n\t\t}\n\n\t\tfor ( var i = 0; i < bufferSize; i++ ) {\n\t\t\tthis.sinTable[i] = Math.sin(-Math.PI/i);\n\t\t\tthis.cosTable[i] = Math.cos(-Math.PI/i);\n\t\t}\n\t}", "function warmUpAudioContext(){\n\t// create empty buffer\n\tlet buffer = audioContext.createBuffer(1, 1, 22050)\n\tlet source = audioContext.createBufferSource();\n\tsource.buffer = buffer;\n\t// contect the empty buffer to audio destination\n\tsource.connect(audioContext.destination);\n\t// play the empty audio\n\tsource.start(0);\n\n\t// the context was warmed up, nice\n\treturn audioContextWarmed = true;\n}", "function getData() {\n source = audioCtx.createBufferSource();\n let request = new XMLHttpRequest();\n\n request.open('GET', 'viper.ogg', true);\n\n request.responseType = 'arraybuffer';\n\n\n request.onload = function() {\n var audioData = request.response;\n\n audioCtx.decodeAudioData(audioData, function(buffer) {\n myBuffer = buffer;\n songLength = buffer.duration;\n source.buffer = myBuffer;\n source.playbackRate.value = playbackControl.value;\n source.connect(audioCtx.destination);\n source.loop = true;\n\n loopStartControl.setAttribute('max', Math.floor(songLength));\n loopEndControl.setAttribute('max', Math.floor(songLength));\n },\n\n function(e) { console.log(\"Error with decoding audio data\" + e.error); });\n\n };\n\n request.send();\n}", "function Yin_pitchEstimation(inputBuffer, sampleRate) {\n\t\t\tvar yinBuffer = new Float32Array(Math.floor(inputBuffer.length/2));\n\t\t\tyinBuffer[0] = 1;\n\t\t\tvar runningSum = 0;\n\t\t\tvar pitchInHz = 0.0;\n\t\t\tvar foundTau = false;\n\t\t\tvar minTauValue;\n\t\t\tvar minTau = 0;\n\n\t\t\tfor (var tau=1; tau<Math.floor(inputBuffer.length/2); tau++) {\n\t\t\t\t// Step 1: Calculates the squared difference of the signal with a shifted version of itself.\n\t\t\t\tyinBuffer[tau] = 0;\n\t\t\t\tfor (var i=0; i<Math.floor(inputBuffer.length/2); i++) {\n\t\t\t\t\tyinBuffer[tau] += Math.pow(((inputBuffer[i]-128)/128)-((inputBuffer[i+tau]-128)/128),2);\n\t\t\t\t}\n\t\t\t\t// Step 2: Calculate the cumulative mean on the normalised difference calculated in step 1.\n\t\t\t\trunningSum += yinBuffer[tau];\n\t\t\t\tyinBuffer[tau] = yinBuffer[tau]*(tau/runningSum);\n\n\t\t\t\t// Step 3: Check if the current normalised cumulative mean is over the threshold.\n\t\t\t\tif (tau > 1) {\n\t\t\t\t\tif (foundTau) {\n\t\t\t\t\t\tif (yinBuffer[tau] < minTauValue) {\n\t\t\t\t\t\t\tminTauValue = yinBuffer[tau];\n\t\t\t\t\t\t\tminTau = tau;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse break;\n\t\t\t\t\t}\n\t\t\t\t\telse if (yinBuffer[tau] < yinThreshold) {\n\t\t\t\t\t\tfoundTau = true;\n\t\t\t\t\t\tminTau = tau;\n\t\t\t\t\t\tminTauValue = yinBuffer[tau];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (minTau == 0) {\n\t\t\t\tyinProbability = 0;\n\t\t\t\tpitchInHz = 0.0;\n\t\t\t} else {\n\t\t\t\t// Step 4: Interpolate the shift value (tau) to improve the pitch estimate.\n\t\t\t\tminTau += (yinBuffer[minTau+1]-yinBuffer[minTau-1])/(2*((2*yinBuffer[minTau])-yinBuffer[minTau-1]-yinBuffer[minTau+1]));\n\t\t\t\tpitchInHz = sampleRate/minTau;\n\t\t\t\tyinProbability = 1-minTauValue;\n\t\t\t}\n\n\t\t\treturn pitchInHz;\n\t\t}", "function InterleavedBufferAttribute( interleavedBuffer, itemSize, offset, normalized ) {\n\n\tthis.data = interleavedBuffer;\n\tthis.itemSize = itemSize;\n\tthis.offset = offset;\n\n\tthis.normalized = normalized === true;\n\n}", "forward(buffer) {\n var n = this.bufferSize,\n spectrum = this.spectrum,\n x = this.trans,\n TWO_PI = 2 * Math.PI,\n sqrt = Math.sqrt,\n i = n >>> 1,\n bSi = 2 / n,\n n2, n4, n8, nn,\n t1, t2, t3, t4,\n i1, i2, i3, i4, i5, i6, i7, i8,\n st1, cc1, ss1, cc3, ss3,\n e,\n a,\n rval, ival, mag;\n\n this.reverseBinPermute(x, buffer);\n\n for (var ix = 0, id = 4; ix < n; id *= 4) {\n for (var i0 = ix; i0 < n; i0 += id) {\n //sumdiff(x[i0], x[i0+1]); // {a, b} <--| {a+b, a-b}\n st1 = x[i0] - x[i0 + 1];\n x[i0] += x[i0 + 1];\n x[i0 + 1] = st1;\n }\n ix = 2 * (id - 1);\n }\n\n n2 = 2;\n nn = n >>> 1;\n\n while ((nn = nn >>> 1)) {\n ix = 0;\n n2 = n2 << 1;\n id = n2 << 1;\n n4 = n2 >>> 2;\n n8 = n2 >>> 3;\n do {\n if (n4 !== 1) {\n for (i0 = ix; i0 < n; i0 += id) {\n i1 = i0;\n i2 = i1 + n4;\n i3 = i2 + n4;\n i4 = i3 + n4;\n\n //diffsum3_r(x[i3], x[i4], t1); // {a, b, s} <--| {a, b-a, a+b}\n t1 = x[i3] + x[i4];\n x[i4] -= x[i3];\n //sumdiff3(x[i1], t1, x[i3]); // {a, b, d} <--| {a+b, b, a-b}\n x[i3] = x[i1] - t1;\n x[i1] += t1;\n\n i1 += n8;\n i2 += n8;\n i3 += n8;\n i4 += n8;\n\n //sumdiff(x[i3], x[i4], t1, t2); // {s, d} <--| {a+b, a-b}\n t1 = x[i3] + x[i4];\n t2 = x[i3] - x[i4];\n\n t1 = -t1 * Math.SQRT1_2;\n t2 *= Math.SQRT1_2;\n\n // sumdiff(t1, x[i2], x[i4], x[i3]); // {s, d} <--| {a+b, a-b}\n st1 = x[i2];\n x[i4] = t1 + st1;\n x[i3] = t1 - st1;\n\n //sumdiff3(x[i1], t2, x[i2]); // {a, b, d} <--| {a+b, b, a-b}\n x[i2] = x[i1] - t2;\n x[i1] += t2;\n }\n } else {\n for (i0 = ix; i0 < n; i0 += id) {\n i1 = i0;\n i2 = i1 + n4;\n i3 = i2 + n4;\n i4 = i3 + n4;\n\n //diffsum3_r(x[i3], x[i4], t1); // {a, b, s} <--| {a, b-a, a+b}\n t1 = x[i3] + x[i4];\n x[i4] -= x[i3];\n\n //sumdiff3(x[i1], t1, x[i3]); // {a, b, d} <--| {a+b, b, a-b}\n x[i3] = x[i1] - t1;\n x[i1] += t1;\n }\n }\n\n ix = (id << 1) - n2;\n id = id << 2;\n } while (ix < n);\n\n e = TWO_PI / n2;\n\n for (var j = 1; j < n8; j++) {\n a = j * e;\n ss1 = Math.sin(a);\n cc1 = Math.cos(a);\n\n //ss3 = sin(3*a); cc3 = cos(3*a);\n cc3 = 4 * cc1 * (cc1 * cc1 - 0.75);\n ss3 = 4 * ss1 * (0.75 - ss1 * ss1);\n\n ix = 0; id = n2 << 1;\n do {\n for (i0 = ix; i0 < n; i0 += id) {\n i1 = i0 + j;\n i2 = i1 + n4;\n i3 = i2 + n4;\n i4 = i3 + n4;\n\n i5 = i0 + n4 - j;\n i6 = i5 + n4;\n i7 = i6 + n4;\n i8 = i7 + n4;\n\n //cmult(c, s, x, y, &u, &v)\n //cmult(cc1, ss1, x[i7], x[i3], t2, t1); // {u,v} <--| {x*c-y*s, x*s+y*c}\n t2 = x[i7] * cc1 - x[i3] * ss1;\n t1 = x[i7] * ss1 + x[i3] * cc1;\n\n //cmult(cc3, ss3, x[i8], x[i4], t4, t3);\n t4 = x[i8] * cc3 - x[i4] * ss3;\n t3 = x[i8] * ss3 + x[i4] * cc3;\n\n //sumdiff(t2, t4); // {a, b} <--| {a+b, a-b}\n st1 = t2 - t4;\n t2 += t4;\n t4 = st1;\n\n //sumdiff(t2, x[i6], x[i8], x[i3]); // {s, d} <--| {a+b, a-b}\n //st1 = x[i6]; x[i8] = t2 + st1; x[i3] = t2 - st1;\n x[i8] = t2 + x[i6];\n x[i3] = t2 - x[i6];\n\n //sumdiff_r(t1, t3); // {a, b} <--| {a+b, b-a}\n st1 = t3 - t1;\n t1 += t3;\n t3 = st1;\n\n //sumdiff(t3, x[i2], x[i4], x[i7]); // {s, d} <--| {a+b, a-b}\n //st1 = x[i2]; x[i4] = t3 + st1; x[i7] = t3 - st1;\n x[i4] = t3 + x[i2];\n x[i7] = t3 - x[i2];\n\n //sumdiff3(x[i1], t1, x[i6]); // {a, b, d} <--| {a+b, b, a-b}\n x[i6] = x[i1] - t1;\n x[i1] += t1;\n\n //diffsum3_r(t4, x[i5], x[i2]); // {a, b, s} <--| {a, b-a, a+b}\n x[i2] = t4 + x[i5];\n x[i5] -= t4;\n }\n\n ix = (id << 1) - n2;\n id = id << 2;\n\n } while (ix < n);\n }\n }\n\n while (--i) {\n rval = x[i];\n ival = x[n - i - 1];\n mag = bSi * sqrt(rval * rval + ival * ival);\n\n if (mag > this.peak) {\n this.peakBand = i;\n this.peak = mag;\n }\n\n spectrum[i] = mag;\n }\n\n spectrum[0] = bSi * x[0];\n\n return spectrum;\n }", "play(ttsAudioContext, tts) {\n try {\n // Create a source node from the buffer\n const source = ttsAudioContext.createBufferSource();\n const gainNode = ttsAudioContext.createGain();\n source.buffer = tts.buffer;\n \n this.currentSourceArray.push(source);\n \n gainNode.gain.setTargetAtTime(0.1, ttsAudioContext.currentTime + 2, 5);\n source.connect(gainNode);\n gainNode.connect(ttsAudioContext.destination);\n source.start(tts.playTime + ttsAudioContext.currentTime); // 这里必须要加上currentTime\n } catch (error) {\n console.log('error when create source', error);\n }\n }", "function playSoundForMillis(length) {\n var iterations = length / 2;\n for (var i = 0; i < iterations; i++) {\n for (var j = 0; j < 30; j++) {\n soundData.push(3 * Math.sin(Math.PI * (j/15)));\n }\n }\n}", "play() {\n\t\t// create new audio source\n\t\tlet source = audioContext.createBufferSource();\n\t\t// load our previously stored audio buffer into the source\n\t\tsource.buffer = this.buffer;\n\t\t// connect the source to destination (the speakers)\n\t\tsource.connect(audioContext.destination);\n\t\t// play the sound\n\t\tsource.start(0);\n\t}", "function Resampler(fromSampleRate, toSampleRate, channels, inputBuffer) {\n //Input Sample Rate:\n this.fromSampleRate = +fromSampleRate;\n //Output Sample Rate:\n this.toSampleRate = +toSampleRate;\n //Number of channels:\n this.channels = channels | 0;\n //Type checking the input buffer:\n if (typeof inputBuffer != \"object\") {\n throw(new Error(\"inputBuffer is not an object.\"));\n }\n if (!(inputBuffer instanceof Array) && !(inputBuffer instanceof Float32Array) && !(inputBuffer instanceof Float64Array)) {\n throw(new Error(\"inputBuffer is not an array or a float32 or a float64 array.\"));\n }\n this.inputBuffer = inputBuffer;\n //Initialize the resampler:\n this.initialize();\n }", "addToGlBuffer(particle, posBuffer, colorBuffer, sizeBuffer) {\n posBuffer.push(particle.position[0],particle.position[1],particle.position[2]);\n colorBuffer.push(particle.color[0],particle.color[1],particle.color[2],particle.color[3]);\n sizeBuffer.push(particle.size);\n }", "function sampleNU(size, buffer, index) {\n const n = index.length;\n if (size >= n) return index;\n\n for (let i = 0; i < size; ++i) {\n buffer[i] = index[i];\n }\n\n for (let i = size; i < n; ++i) {\n const j = i * random();\n if (j < size) {\n buffer[j | 0] = index[i];\n }\n }\n\n return buffer;\n}", "function Amplitude (sampleRate, attack, decay) {\n\tthis.sampleRate\t\t= isNaN(sampleRate) ? this.sampleRate : sampleRate;\n\tthis.attack\t\t= isNaN(attack) ? this.attack : attack;\n\tthis.decay\t\t= isNaN(decay) ? this.decay : decay;\n}", "function ProcessFrames(mem48, speed, frequency, pitches, amplitude, sampledConsonantFlag) {\n const CombineGlottalAndFormants = (phase1, phase2, phase3, Y) => {\n let tmp; // unsigned int\n tmp = multtable[sinus[phase1] | amplitude[0][Y]];\n tmp += multtable[sinus[phase2] | amplitude[1][Y]];\n tmp += tmp > 255 ? 1 : 0; // if addition above overflows, we for some reason add one;\n tmp += multtable[rectangle[phase3] | amplitude[2][Y]];\n tmp += 136;\n tmp >>= 4; // Scale down to 0..15 range of C64 audio.\n\n Output(0, tmp & 0xf);\n };\n\n const RenderSample = (mem66, consonantFlag, mem49) => {\n const RenderVoicedSample = (hi, off, phase1) => {\n hi = hi & 0xFFFF; // unsigned short\n off = off & 0xFF; // unsigned char\n phase1 = phase1 & 0xFF; // unsigned char\n do {\n let sample = sampleTable[hi+off];\n let bit = 8;\n do {\n if ((sample & 128) !== 0) {\n Output(3, 26);\n } else {\n Output(4, 6);\n }\n sample <<= 1;\n } while(--bit !== 0);\n off++;\n } while (((++phase1) & 0xFF) !== 0);\n\n return off;\n };\n\n const RenderUnvoicedSample = (hi, off, mem53) => {\n hi = hi & 0xFFFF; // unsigned short\n off = off & 0xFF; // unsigned char\n mem53 = mem53 & 0xFF; // unsigned char\n do {\n let bit = 8;\n let sample = sampleTable[hi+off];\n do {\n if ((sample & 128) !== 0) {\n Output(2, 5);\n }\n else {\n Output(1, mem53);\n }\n sample <<= 1;\n } while (--bit !== 0);\n } while (((++off) & 0xFF) !== 0);\n };\n\n // mem49 == current phoneme's index - unsigned char\n\n // mask low three bits and subtract 1 get value to\n // convert 0 bits on unvoiced samples.\n let hibyte = (consonantFlag & 7) - 1;\n\n // determine which offset to use from table { 0x18, 0x1A, 0x17, 0x17, 0x17 }\n // T, S, Z 0 0x18\n // CH, J, SH, ZH 1 0x1A\n // P, F*, V, TH, DH 2 0x17\n // /H 3 0x17\n // /X 4 0x17\n\n let hi = hibyte * 256; // unsigned short\n // voiced sample?\n let pitch = consonantFlag & 248; // unsigned char\n if(pitch === 0) {\n // voiced phoneme: Z*, ZH, V*, DH\n pitch = pitches[mem49 & 0xFF] >> 4;\n return RenderVoicedSample(hi, mem66, pitch ^ 255);\n }\n RenderUnvoicedSample(hi, pitch ^ 255, tab48426[hibyte]);\n return mem66;\n };\n\n let speedcounter = new Uint8(72);\n let phase1 = new Uint8();\n let phase2 = new Uint8();\n let phase3 = new Uint8();\n let mem66 = new Uint8();\n let Y = new Uint8();\n let glottal_pulse = new Uint8(pitches[0]);\n let mem38 = new Uint8(glottal_pulse.get() - (glottal_pulse.get() >> 2)); // mem44 * 0.75\n\n while(mem48) {\n let flags = sampledConsonantFlag[Y.get()];\n\n // unvoiced sampled phoneme?\n if ((flags & 248) !== 0) {\n mem66.set(RenderSample(mem66.get(), flags, Y.get()));\n // skip ahead two in the phoneme buffer\n Y.inc(2);\n mem48 -= 2;\n speedcounter.set(speed);\n } else {\n CombineGlottalAndFormants(phase1.get(), phase2.get(), phase3.get(), Y.get());\n\n speedcounter.dec();\n if (speedcounter.get() === 0) {\n Y.inc(); //go to next amplitude\n // decrement the frame count\n mem48--;\n if(mem48 === 0) {\n return;\n }\n speedcounter.set(speed);\n }\n\n glottal_pulse.dec();\n\n if(glottal_pulse.get() !== 0) {\n // not finished with a glottal pulse\n\n mem38.dec();\n // within the first 75% of the glottal pulse?\n // is the count non-zero and the sampled flag is zero?\n if((mem38.get() !== 0) || (flags === 0)) {\n // reset the phase of the formants to match the pulse\n phase1.inc(frequency[0][Y.get()]);\n phase2.inc(frequency[1][Y.get()]);\n phase3.inc(frequency[2][Y.get()]);\n continue;\n }\n\n // voiced sampled phonemes interleave the sample with the\n // glottal pulse. The sample flag is non-zero, so render\n // the sample for the phoneme.\n mem66.set(RenderSample(mem66.get(), flags, Y.get()));\n }\n }\n\n glottal_pulse.set(pitches[Y.get()]);\n mem38.set(glottal_pulse.get() - (glottal_pulse.get() >> 2)); // mem44 * 0.75\n\n // reset the formant wave generators to keep them in\n // sync with the glottal pulse\n phase1.set(0);\n phase2.set(0);\n phase3.set(0);\n }\n }", "function startAudio() {\n\t// make a new Audio Object\n\taudio = new Audio()\n\t// Get a context \n\tconst audioContext = new (window.AudioContext || window.webkitAudioContext)()\n\t\n\t// Define a source sound file \n\t// You can replace this with your own file\n\taudio.src = 'bird-whistling-a.wav'\n\t// audio.src = 'log-sine-sweep.wav'\n\n\t// Make a new analyser\n\tanalyser = audioContext.createAnalyser()\n\t// Connect the analyser and the audio\n\tconst source = audioContext.createMediaElementSource(audio)\n\tsource.connect(analyser)\n\tanalyser.connect(audioContext.destination)\n\n\t// Get an array of audio data from the analyser\n\tfrequencyArray = new Uint8Array(analyser.frequencyBinCount)\n\t// console.log(frequencyArray.length)\n\t\n\t// Start playing the audio\n\taudio.play()\n\n\trequestAnimationFrame(render)\n}", "function init(arrayBuffer) {\n document.getElementById('instructions').innerHTML = 'Loading ...'\n // Create a new `audioContext` and its `analyser`\n window.audioCtx = new AudioContext()\n window.analyser = audioCtx.createAnalyser()\n // If a sound is still playing, stop it.\n if (window.source)\n source.noteOff(0)\n // Decode the data in our array into an audio buffer\n audioCtx.decodeAudioData(arrayBuffer, function(buffer) {\n // Use the audio buffer with as our audio source\n window.source = audioCtx.createBufferSource() \n source.buffer = buffer\n // Connect to the analyser ...\n source.connect(analyser)\n // and back to the destination, to play the sound after the analysis.\n analyser.connect(audioCtx.destination)\n // Start playing the buffer.\n source.start(0)\n // Initialize a visualizer object\n var viz = new simpleViz()\n // Finally, initialize the visualizer.\n new visualizer(viz['update'], analyser)\n document.getElementById('instructions').innerHTML = ''\n })\n}", "function createPink(duration) {\n var length = Math.floor(WX.srate * duration);\n var noiseFloat32 = new Float32Array(length);\n // pink noise specific\n var pA = [3.8024, 2.9694, 2.5970, 3.0870, 3.4006],\n pSum = [0.00198, 0.01478, 0.06378, 0.23378, 0.91578],\n pASum = 15.8564,\n sample = 0,\n contrib = [0.0, 0.0, 0.0, 0.0, 0.0];\n for (var i = 0; i < length; i++) {\n var ur1 = Math.random(), ur2 = Math.random();\n for (var j = 0; j < 5; j++) {\n if (ur1 <= pSum[j]) {\n sample -= contrib[j];\n contrib[j] = 2 * (ur2 - 0.5) * pA[j];\n sample += contrib[j];\n break;\n }\n }\n noiseFloat32[i] = sample / pASum;\n }\n // console.log(noiseFloat32); // debug\n var noiseBuffer = WX.Buffer(2, length, WX.srate);\n noiseBuffer.getChannelData(0).set(noiseFloat32, 0);\n noiseBuffer.getChannelData(1).set(noiseFloat32, 0);\n return noiseBuffer;\n }", "toMuLaw() {\n this.assure16Bit_();\n let output = new Int16Array(this.data.samples.length / 2);\n unpackArrayTo(this.data.samples, this.dataType, output);\n this.fromScratch(\n this.fmt.numChannels,\n this.fmt.sampleRate,\n '8m',\n alawmulaw.mulaw.encode(output),\n {container: this.correctContainer_()});\n }" ]
[ "0.75263226", "0.75263226", "0.68920356", "0.68920356", "0.632705", "0.6150853", "0.612429", "0.5902425", "0.5783863", "0.5628275", "0.55517095", "0.5447707", "0.54432946", "0.5438855", "0.54174745", "0.5412393", "0.5383046", "0.53300166", "0.5281003", "0.52799463", "0.5259623", "0.52375007", "0.5235207", "0.5220177", "0.52195835", "0.5211994", "0.5205965", "0.51680994", "0.5160705", "0.51457286", "0.5133523", "0.5111198", "0.50921553", "0.50918293", "0.509136", "0.50909024", "0.50792974", "0.5075587", "0.5072746", "0.5072746", "0.5072106", "0.50624824", "0.5062403", "0.505783", "0.50533205", "0.5047194", "0.5001777", "0.49912944", "0.49450186", "0.49400616", "0.4936277", "0.49046728", "0.48979828", "0.48951474", "0.48791227", "0.48726356", "0.4870728", "0.4864292", "0.48582783", "0.4856771", "0.48535305", "0.4844767", "0.48426685", "0.48399302", "0.4834336", "0.4832584", "0.48256713", "0.48159394", "0.481252", "0.48085046", "0.4801602", "0.47989812", "0.47962832", "0.47893056", "0.47799653", "0.47736448", "0.4769752", "0.47638094", "0.4760727", "0.47594807", "0.47541586", "0.47509387", "0.47502708", "0.47476238", "0.47448853", "0.4735942", "0.47285604", "0.47278643", "0.47278398", "0.47235316", "0.4714915", "0.4702575", "0.47020143", "0.46972597", "0.469514", "0.4691943", "0.4679521", "0.46768907", "0.4676055" ]
0.8437261
1
Create a buffer of the given length with a linear ramp having values 0 <= x < 1.
function createLinearRampBuffer(context, sampleFrameLength) { var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate); var n = audioBuffer.length; var dataL = audioBuffer.getChannelData(0); for (var i = 0; i < n; ++i) dataL[i] = i / n; return audioBuffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sliding(n) {\n return new SlidingBuffer(ring(n), n);\n}", "function fixed(n) {\n return new FixedBuffer(ring(n), n);\n}", "function SlowBuffer(length) {\n // eslint-disable-next-line eqeqeq\n if (+length != length) length = 0;\n assertSize(+length);\n return createUnsafeBuffer(+length);\n}", "function ring(n) {\n if (n <= 0) {\n throw new Error(\"Can't create a ring buffer of size 0\");\n }\n\n return new RingBuffer(0, 0, 0, new Array(n));\n}", "function createTrail() {\r\n const cx = Math.floor(Math.random() * bufferCW);\r\n const cy = 0;\r\n const cvy = 5 + Math.random() * 15;\r\n \r\n return [ cx, cy, cvy ];\r\n}", "function createConstantBuffer(context, sampleFrameLength, constantValue) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var i = 0; i < n; ++i)\n dataL[i] = constantValue;\n\n return audioBuffer;\n}", "function interpolate(length, totalLength, start, end) {\n var xy = [\n start[0] + (end[0] - start[0]) * length / totalLength,\n start[1] + (end[1] - start[1]) * length / totalLength\n ];\n return xy;\n }", "*lineGenerator() {\r\n for (let y = 0; y < this.height; ++y) {\r\n let buffer = new Uint8ClampedArray(this.width * 4);\r\n\r\n for (let x = 0; x < this.width; ++x) {\r\n buffer.set(this.calculate(x, y), 4 * x);\r\n }\r\n\r\n yield buffer;\r\n }\r\n }", "function linear () {\r\n let initRange = function (domain, range) {\r\n switch (arguments.length) {\r\n case 0: break\r\n case 1: this.range(domain); break\r\n default: this.range(range).domain(domain); break\r\n }\r\n return this\r\n }\r\n let array = Array.prototype\r\n let slice = array.slice\r\n let unit = [0, 1]\r\n let domain = unit,\r\n range = unit\r\n\r\n let scale = function scale (x) {\r\n let unknown\r\n return isNaN(x = +x) ? unknown : range[0] + (x - domain[0]) * (range[1] - range[0]) / (domain[1] - domain[0])\r\n }\r\n\r\n scale.domain = function (_) {\r\n if (!arguments.length) return domain.slice()\r\n domain = []\r\n let index = new Map()\r\n let i = -1, n = _.length, d, key\r\n while (++i < n) if (!index.has(key = (d = _[i]) + '')) index.set(key, domain.push(d))\r\n return scale\r\n }\r\n\r\n scale.range = function (_) {\r\n return arguments.length ? (range = slice.call(_), scale) : range.slice()\r\n }\r\n\r\n initRange.apply(scale, arguments)\r\n\r\n return scale\r\n }", "function horizontalShift(buffer, fraction) {\n const nRow = buffer.length;\n let nCol = buffer[0].length;\n let cutoff = nRow * fraction;\n cutoff = Math.round(Math.random() * Math.round(cutoff));\n\n let newImage = [];\n let fillBuffer = [];\n\n //left or right cutoff\n const lr = Math.random();\n\n if (options.fill_mode == 'zero') {\n fillBuffer = createZeroBuffer(cutoff, nCol);\n } else if (options.fill_mode == 'nearest') {\n if (lr < 0.5) {\n fillBuffer = createNearestBuffer(cutoff, buffer[0]);\n } else {\n fillBuffer = createNearestBuffer(cutoff, buffer[nRow - 1]);\n }\n }\n\n if (lr < 0.5) {\n newImage = buffer.slice(0, nRow - cutoff);\n newImage = fillBuffer.concat(newImage);\n } else {\n newImage = buffer.slice(cutoff, nRow);\n newImage = newImage.concat(fillBuffer);\n }\n\n return newImage;\n\n function createNearestBuffer(nRows, slice) {\n let nearest = [];\n for (let idx = 0; idx < nRows; idx++) {\n nearest.push(Array.from(slice));\n }\n return nearest;\n }\n\n function createZeroBuffer(nRows, nCols) {\n return Array.from(Array(nRows), () => Array.from(Array(nCols), () => 0));\n }\n }", "function buffer1(geometry) {\n return geometry.buffer(10000);\n}", "function buffer1(geometry) {\n return geometry.buffer(10000);\n}", "function buffer1(geometry) {\n return geometry.buffer(10000);\n}", "function buffer2(geometry) {\n return geometry.buffer(5000);\n}", "function buffer2(geometry) {\n return geometry.buffer(5000);\n}", "function buffer(capacity) {\n return self => buffer_(self, capacity);\n}", "function createImpulseBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var k = 0; k < n; ++k) {\n dataL[k] = 0;\n }\n dataL[0] = 1;\n\n return audioBuffer;\n}", "function createImpulseBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var k = 0; k < n; ++k) {\n dataL[k] = 0;\n }\n dataL[0] = 1;\n\n return audioBuffer;\n}", "function buffer1(geometry) {\n return geometry.buffer(60).bounds();\n}", "function drawBuffer( width, height, context, data ) {\n\n // each chunk of data evenly separates the width\n // of the <canvas> into one pixel per chunk\n var step = Math.ceil( data.length / width );\n\n // scale the drawing height of the waveform by\n // the height of the <canvas>\n var amp = height / 2;\n\n context.fillStyle = \"silver\";\n\n // for each pixel across the width of the <canvas>\n for(var i=0; i < width; i++) {\n var min = 1.0;\n var max = -1.0;\n\n // find the min and max of the next chunk of data\n for (j=0; j<step; j++) {\n var datum = data[(i*step)+j];\n if (datum < min)\n min = datum;\n if (datum > max)\n max = datum;\n }\n\n // params are location (x, y, width, height)\n // x=[i,i+1] because we are scanning across the screen drawing the waveform drawing\n // the width of one pixel at a time\n context.fillRect(i, (1 + min) * amp, 1, Math.max(1, (max - min) * amp));\n }\n}", "function stretch(t, from, to) {\n return (t * (to - from)) + from;\n}", "toBuffer() {\n const superbuff = super.toBuffer();\n const bsize = this.amount.length + superbuff.length;\n const barr = [this.amount, superbuff];\n return buffer_1.Buffer.concat(barr, bsize);\n }", "function laplace( x ) {\n return [ 0, -x, 0, -x, x * 4, -x, 0, -x, 0 ];\n }", "function perlinNoise1D(x){\n //apply the scale var to x\n var xScaled = x * scale;\n //round x down\n var xFloor = Math.floor(xScaled);\n //find the diffrence between them\n var t = xScaled - xFloor;\n //smooth step interpolation calculation\n var tSmoothStep = t * t * (3 - 2 * t);\n //calculating the min and max X values\n var xMin = xFloor % noiseVerticesMask;\n var xMax = (xMin + 1) % noiseVerticesMask;\n\n //calculate y\n var y = r[xMin] * (1 - tSmoothStep) + r[xMax] * tSmoothStep;\n\n //apply amplitude to y\n return y * amplitude;\n}", "function createLoop(x, y, width, height) {\n // x = x - 1, x + width\n let loop = [x - 1, x + width]\n .map((nx) => range(y, y + height).map((ny) => [nx, ny]))\n // y = y - 1, y + height\n loop = loop.concat([y - 1, y + height]\n .map((ny) => range(x, x + width).map((nx) => [nx, ny])))\n loop = flatten2D(loop)\n\n return loop\n}", "function range(x) {\r\n let intRange = new Array(x);\r\n for (let i = 0; i < x; i++) {\r\n intRange[i] = i + 1;\r\n }\r\n return intRange;\r\n}", "function _bufferHandler(event) {\n\t\t\tif (!(event.bufferPercent === null)) {\n\t\t\t\t_currentBuffer = event.bufferPercent;\n\t\t\t}\n\t\t\t\n\t\t\tvar wid = _elements.timeSliderRail.getBoundingClientRect().width;\n\t\t\tvar bufferWidth = isNaN(Math.round(wid * _currentBuffer / 100)) ? 0 : Math.round(wid * _currentBuffer / 100);\n\t\t\t_css(_elements.timeSliderBuffer, {\n\t\t\t\twidth: bufferWidth\n\t\t\t});\n\t\t}", "function Ring(start) {\n\tthis.start = start;\n\tthis.length = 1;\n}", "function genBlWithChunksInDiffSize () {\n var bl = new BufferList();\n var i = 0;\n var j = 0;\n var size = 1;\n while (i < 0x100) {\n if (size + i >= 0x100) size = 0x100 - i;\n var b = Buffer.alloc(size);\n for (j = i; j < size + i; j++) {\n b[j-i] = j;\n }\n i = j;\n bl.append(b);\n size++;\n }\n return bl;\n}", "function addToRollingBuffer1(buffer, maxBufferSize, newElement) {\n buffer.push(newElement);\n if (buffer.length > maxBufferSize) {\n buffer.shift();\n }\n return buffer;\n}", "set stride(value) {}", "function createConstantBuffer(context, sampleFrameLength, constantValue) {\n var channels;\n var values;\n\n if (typeof constantValue === \"number\") {\n channels = 1;\n values = [constantValue];\n } else {\n channels = constantValue.length;\n values = constantValue;\n }\n\n var audioBuffer = context.createBuffer(channels, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n\n for (var c = 0; c < channels; ++c) {\n var data = audioBuffer.getChannelData(c);\n for (var i = 0; i < n; ++i)\n data[i] = values[c];\n }\n\n return audioBuffer;\n}", "function filler(l,x){\n var arr = [];\n while(--l >= 0){\n arr.push(x);\n }\n return arr;\n}", "function ArrayBuffer$(length) {\n if (NewTarget === undefined) throw $TypeError();\n if (STRICT_CONFORMANCE) {\n var numberLength = ToNumber(length);\n var byteLength = ToLength(numberLength);\n if (SameValueZero(numberLength, byteLength) === false) throw $RangeError();\n } else {\n var byteLength = ToIndex(length); // comatible with ES8\n }\n return AllocateArrayBuffer(NewTarget, byteLength);\n}", "function linspace(minx, maxx, npts) {\n var xs = [];\n var len = 1.0 * (maxx - minx);\n var dx = len / (npts - 1);\n for (var i = 0; i < npts; i++) {\n xs.push(minx + i * dx);\n }\n return xs;\n}", "static LerpUnclamped() {}", "function expandBuffer({ buffer, minSize }) {\n const copyTimes = Math.ceil(minSize / buffer.length)\n const bufferList = Array(copyTimes).fill(buffer)\n return Buffer.concat(bufferList)\n}", "function IncrementClamp(x, dx, upper){\n var newX = x+dx;\n if (newX > upper){\n return newX-upper;\n }\n return newX;\n}", "function leftZeroFill(number, targetLength) {\n var output = number + '';\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return output;\n }", "function leftZeroFill(number, targetLength) {\n var output = number + '';\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return output;\n }", "function leftZeroFill(number, targetLength) {\n var output = number + '';\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return output;\n }", "function leftZeroFill(number, targetLength) {\n var output = number + '';\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return output;\n }", "function leftZeroFill(number, targetLength) {\n var output = number + '';\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return output;\n }", "function leftZeroFill(number, targetLength) {\n var output = number + '';\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return output;\n }", "function leftZeroFill(number, targetLength) {\n var output = number + '';\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return output;\n }", "function leftZeroFill(number, targetLength) {\n var output = number + '';\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return output;\n }", "function leftZeroFill(number, targetLength) {\n var output = number + '';\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return output;\n }", "function leftZeroFill(number, targetLength) {\n var output = number + '';\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return output;\n }", "function leftZeroFill(number, targetLength) {\n var output = number + '';\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return output;\n }", "function leftZeroFill(number, targetLength) {\n var output = number + '';\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return output;\n }", "function leftZeroFill(number, targetLength) {\n var output = number + '';\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return output;\n }", "grow() {\n this.r = sin(frameCount * .01) * 100;\n }", "function randX(buffer) {\n return randInt(0, $(document).width()-buffer);\n}", "linearize() {\n const SCALE = 255;\n const value = this.value / SCALE;\n return value <= 0.03928 ? value / 12.92 : Math.pow((value + 0.055) / 1.055, 2.4);\n }", "function buffer(geometry) {\n return geometry.buffer(60).bounds();\n}", "function resize (buffer, length) {\n validate(buffer);\n\n if (length < buffer.length) return slice(buffer, 0, length);\n\n return concat(buffer, create(length - buffer.length));\n}", "linearize() {\n /** The upper limit of the original range. */\n const SCALE = 255;\n /** The current value mapped to a 0 to 1 range, so 255 becomes 1. */\n const value = this.value / SCALE;\n return value <= 0.03928\n ? value / 12.92\n : Math.pow((value + 0.055) / 1.055, 2.4);\n }", "function create_vertex_attr_buffer(program, name, x, n) {\r\n\tlet is_array = Array.isArray(x);\r\n\tlet bufferId = gl.createBuffer(); // create a new buffer\r\n\tgl.bindBuffer(gl.ARRAY_BUFFER, bufferId); // bind to the new buffer\r\n\tgl.bufferData(gl.ARRAY_BUFFER, is_array ? flatten(x) : (x*n*sizeof.vec2/2), gl.STATIC_DRAW); // load the flattened data into the buffer\r\n\tlet attrib_loc = gl.getAttribLocation(program, name); // get the vertex shader attribute location\r\n\tgl.vertexAttribPointer(attrib_loc, is_array ? x[0].length : n, gl.FLOAT, false, 0, 0); // associate the buffer with the attributes making sure it knows its type\r\n\tgl.enableVertexAttribArray(attrib_loc); // enable this set of data\r\n\treturn bufferId;\r\n}", "function Buffer (arg, encodingOrOffset, length) {\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(arg)\n\t }\n\t return from(arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(arg)\n\t }\n\t return from(arg, encodingOrOffset, length)\n\t}", "function makeTestBuffer() {\r\n var dataSize = 4*1024;//400;\r\n var buffer = new ArrayBuffer(dataSize*4+300*4); \r\n var bufferArray = new Int32Array(buffer, 0, dataSize);\r\n for (var i=0; i<dataSize; i++) {\r\n bufferArray[i] = i;\r\n }\r\n bufferArray[0] = dataSize*4;\r\n \r\n return ({\"buffer\":buffer, \"bufferArray\":bufferArray});\r\n}", "expand() {\n const newCapacity = this.capacity * 2;\n const newData = new Array(newCapacity);\n const len = this.length();\n // Rotate the buffer to start at index 0 again, since we can't just\n // allocate more space at the end.\n for (let i = 0; i < len; i++) {\n newData[i] = this.get(this.wrap(this.begin + i));\n }\n this.data = newData;\n this.capacity = newCapacity;\n this.doubledCapacity = 2 * this.capacity;\n this.begin = 0;\n this.end = len;\n }", "function linearInterpolation(from, to, amount) {\n\t\treturn from + amount * (to - from);\n\t}", "fillWithTestData() {\n let sample = 0.0; // Range from -1 to 1.\n for (let i = 0; i < BUFFER_LENGTH; i++) {\n let delta = 2.0 * Math.random() - 1.0; // Range from 1.0 to -1.0\n // If the sample is already high, skew the delta so it goes lower.\n delta -= sample; // If sample is max, delta will only decrease.\n delta *= 0.09; // Only change a bit during each step.\n sample += delta;\n // Convert from -1 to 1 to 0 to 1\n this.dataBuffer[i] = (sample + 1.0) / 2.0;\n }\n }", "function create_size_range(length, size, increment){\n \tvar ans=[];\n \tfor(var i=0;i<length;i++){\n \t\tif(i!=0){\n \t\t\tsize+=increment;\n \t\t}\n \t\tans.push(size+\"%\");\n \t}\n \treturn ans;\n }", "function fromInt(x) {\n if (x === 0) {\n return NIL;\n }\n return cons(NIL, fromInt(x - 1));\n }", "function setRectangle(gl, x, y, width, height) {\n var x1 = x;\n var x2 = x + width;\n var y1 = y;\n var y2 = y + height;\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x2, y1,\n x1, y2,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n}", "function Buffer(arg, encodingOrOffset, length) {\n\t\t// Common case.\n\t\tif (typeof arg === 'number') {\n\t\t\tif (typeof encodingOrOffset === 'string') {\n\t\t\t\tthrow new TypeError('The \"string\" argument must be of type string. Received type number');\n\t\t\t}\n\t\t\treturn allocUnsafe(arg);\n\t\t}\n\t\treturn from(arg, encodingOrOffset, length);\n\t}", "function $fe91$var$Buffer(arg, encodingOrOffset, length) {\n if (!$fe91$var$Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof $fe91$var$Buffer)) {\n return new $fe91$var$Buffer(arg, encodingOrOffset, length);\n } // Common case.\n\n\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error('If encoding is specified then the first argument must be a string');\n }\n\n return $fe91$var$allocUnsafe(this, arg);\n }\n\n return $fe91$var$from(this, arg, encodingOrOffset, length);\n}", "unshift(value) {\n if (this.isFull()) {\n throw new RangeError('Ring buffer is full.');\n }\n this.begin = this.wrap(this.begin - 1);\n this.set(this.begin, value);\n }", "constructor(x, y, newLength) {\n super(x, y);\n\n let _length;\n\n this.setLength = (length) => {\n _length = length > 0 ? length : 1\n };\n\n this.getLength = () => {\n return _length;\n };\n\n this.setLength(newLength);\n }", "function bufferData() {\n\tvar mult = (RENDER_DISTANCE-1)/2;\n\n\tlMinR = MinR - (MaxR - MinR)*mult;\n\tlMaxR = MaxR + (MaxR - MinR)*mult;\n\tlMinI = MinI - (MaxI - MinI)*mult;\n\tlMaxI = MaxI + (MaxI - MinI)*mult;\n\n\tvar ref = (lMaxR - lMinR)/(dimX*RENDER_DISTANCE);\n\tvar imf = (lMaxI - lMinI)/(dimY*RENDE:qR_DISTANCE);\n\n\tvar progress = 0;\n\tvar val, z;\n\tvar count;\n\tvar color;\n\n\tfor (var x = 0; x < dimX*RENDER_DISTANCE; x++) {\n\t\tprogress = 100.0 * (x / (dimX * RENDER_DISTANCE));\n\n\t\tfor (var y = 0; y < dimY*RENDER_DISTANCE; y++) {\n\t\t\tval = new complex(lMinR + x*ref, lMaxI - y*imf);\n\t\t\tz = new complex(val.real, val.imaginary);\n\t\t\tcount = 0;\n\n\t\t\twhile (count < iterations && z.real + z.imaginary < rmax) {\n\t\t\t\tvar tmp = z.square();\n\t\t\t\tz.add(val);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\n\t\t\t//This is building the array in a function direction\n\t\t\t//Will correct later\n\t\t\tcolor = (count == iterations)?0:0xFFFFFF*(count/iterations);\n\t\t\ttoSend[x + y*dimX*RENDER_DISTANCE] = color;\n\t\t}\n\t}\n\tconsole.log(toSend[20000]);\n\n\tself.postMessage({\n\t\t'type': 'data',\n\t\t'buffer': toSend.buffer\n\t}, [toSend.buffer]);\n}", "grow() {\n const size = this.size;\n const list = new Array(size * 2);\n for (var i = 0; i < size; i++) list[i] = this.shift();\n this.size = list.length;\n this.mask = this.size - 1;\n this.top = size;\n this.btm = 0;\n this.list = list;\n this.fill(size);\n }", "function Buffer(arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error('If encoding is specified then the first argument must be a string');\n }\n return allocUnsafe(arg);\n }\n return from(arg, encodingOrOffset, length);\n }", "function setRectangle(gl, x, y, width, height) {\n var x1 = x;\n var x2 = x + width;\n var y1 = y;\n var y2 = y + height;\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x2, y1,\n x1, y2,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n}", "function createBuffer(data, components) {\n var count = data.length / components;\n if (count * components != data.length)\n throw \"invalid buffer size\";\n\n var type = determineBufferType(data);\n\n var buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);\n buffer.count = count;\n buffer.components = components;\n buffer.type = type;\n\n return buffer;\n}", "function Buffer(arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n }", "function Buffer(arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === \"number\") {\n if (typeof encodingOrOffset === \"string\") {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n );\n }\n return allocUnsafe(arg);\n }\n return from(arg, encodingOrOffset, length);\n }", "static getColoredBufferLine(steps, phase, geometry) {\n\t\tlet vertices = geometry.vertices;\n\t\tlet segments = geometry.vertices.length;\n\n\t\tlet newGeometry = new THREE.BufferGeometry();\n\t\tlet lineMaterial = new THREE.LineBasicMaterial({\n\t\t\tvertexColors: THREE.VertexColors\n\t\t});\n\n\t\tlet positions = new Float32Array(segments * 3); // 3 vertices per point\n\t\tlet colors = new Float32Array(segments * 3);\n\n\t\tlet frequency = 1 / (steps * segments);\n\t\tlet color = new THREE.Color();\n\n\t\tlet x, y, z;\n\n\t\tfor (let i = 0, l = segments; i < l; i++) {\n\t\t\tx = vertices[i].x;\n\t\t\ty = vertices[i].y;\n\t\t\tz = vertices[i].z;\n\n\t\t\tpositions[i * 3] = x;\n\t\t\tpositions[i * 3 + 1] = y;\n\t\t\tpositions[i * 3 + 2] = z;\n\n\t\t\tcolor.set(makeColorGradient(i, frequency, phase));\n\n\t\t\tcolors[i * 3] = color.r;\n\t\t\tcolors[i * 3 + 1] = color.g;\n\t\t\tcolors[i * 3 + 2] = color.b;\n\t\t}\n\n\t\tnewGeometry.setAttribute(\n\t\t\t\"position\",\n\t\t\tnew THREE.BufferAttribute(positions, 3)\n\t\t);\n\t\tnewGeometry.setAttribute(\"color\", new THREE.BufferAttribute(colors, 3));\n\n\t\tlet line = new THREE.Line(newGeometry, lineMaterial);\n\n\t\treturn line;\n\t}", "function setRectangle(gl, x, y, width, height) {\n var x1 = x;\n var x2 = x + width;\n var y1 = y;\n var y2 = y + height;\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x2, y1,\n x1, y2,\n x1, y2,\n x2, y1,\n x2, y2]), gl.STATIC_DRAW);\n}", "function xLinearScale(val,iL,iH,oL,oH)\r\n{\r\n var m=(oH-oL)/(iH-iL);\r\n var b=oL-(iL*m);\r\n return m*val+b;\r\n}", "function Buffer(arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n );\n }\n return allocUnsafe(arg);\n }\n return from(arg, encodingOrOffset, length);\n }", "function repeatToLength(x, n) {\n // put x in an array if it's naked\n x = [].concat(x);\n var y = x;\n while (y.length < n) {\n y = y.concat(x);\n }\n return(y.slice(0,n));\n}", "function Buffer$1 (arg, encodingOrOffset, length) {\n\t if (!Buffer$1.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer$1)) {\n\t return new Buffer$1(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function leftZeroFill(number, targetLength, forceSign) {\n\t var output = '' + Math.abs(number),\n\t sign = number >= 0;\n\n\t while (output.length < targetLength) {\n\t output = '0' + output;\n\t }\n\t return (sign ? forceSign ? '+' : '' : '-') + output;\n\t }", "function smoothstep(a, b, x) {\n const t = Range.clamp(Range.unlerp(a, b, x), 0.0, 1.0);\n return t * t * (3.0 - (2.0 * t));\n}", "function ExtendXPassages() {\n for(let i=0; i<x_buffer.length; i++) {\n var j = x_buffer[i].length - 1;\n var rand = $.random.nextInt(0, 99);\n for(var k=0; k<X_PROBABILITY_MAP[j].length; k++) {\n rand -= X_PROBABILITY_MAP[j][k];\n if(rand < 0) break;\n }\n\n var x_array;\n if(x_buffer[i].direction==NORTH) {\n x_array = JSON.parse(JSON.stringify(TEMPLATE_NORTH_X_ARRAY[k]));\n }else if(x_buffer[i].direction==SOUTH) {\n x_array = JSON.parse(JSON.stringify(TEMPLATE_SOUTH_X_ARRAY[k]));\n }\n //console.log(x_array.lengths)\n \n if(x_buffer[i].length < 4) {\n x_array.lengths[0] += 1;\n }else{\n var min = 1;\n var max = x_array.lengths.length - 2;\n var repeat_num = x_buffer[i].length - x_array.rand_base_num + 2;\n if(x_buffer[i].start_side_closed) {\n repeat_num -= 1;\n x_array.lengths[0] = 1;\n min -= 1;\n }\n if(x_buffer[i].end_side_closed) {\n repeat_num -= 1;\n x_array.lengths[x_array.lengths.length - 1] = 1;\n max += 1;\n }\n\n for(let n=0; n<repeat_num; n++) {\n var rand_index = $.random.nextInt(min, max);\n x_array.lengths[rand_index] += 1;\n }\n }\n //console.log(x_array.lengths)\n\n var x = x_buffer[i].x;\n var y = x_buffer[i].y;\n for(let n in x_array.lengths) {\n for(let m=0; m<x_array.lengths[n]; m++) {\n map2d[y][x] = x_array.type[n];\n x++;\n }\n }\n }\n //var fuga = \"\";\n //for(let y=0; y<target_data_map.height; y++) {\n // for(let x=0; x<target_data_map.width; x++) {\n // if(map2d[y][x] == 0) {\n // fuga += \" 0\";\n // }else if (map2d[y][x] == 1) {\n // fuga += \" 1\";\n // }else {\n // fuga += String(map2d[y][x]);\n // }\n // }\n // fuga += \"\\n\";\n //}\n //console.log(fuga);\n }", "function leftZeroFill(number, targetLength, forceSign) {\n\t var output = '' + Math.abs(number),\n\t sign = number >= 0;\n\n\t while (output.length < targetLength) {\n\t output = '0' + output;\n\t }\n\t return (sign ? (forceSign ? '+' : '') : '-') + output;\n\t }", "push (x) {\n const next = this.length\n this.data[next] = x\n this._incrementLength()\n }", "function noise (buffer, target, start, end) {\n return fill(buffer, target, function (sample) { return Math.random() * 2 - 1; }, start, end);\n}", "function Buffer(arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length);\n } // Common case.\n\n\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error('If encoding is specified then the first argument must be a string');\n }\n\n return allocUnsafe(this, arg);\n }\n\n return from(this, arg, encodingOrOffset, length);\n }", "function grow(x){\n let result = 1\n for(let y = 0; y < x.length; y++){\n result = result * x[y]\n }\n return result\n}", "grow(){\n let head = this.body[this.body.length-1].copy();\n this.len++;\n this.body.push(head);\n\n //Increase the Frame Rate every other win\n if (this.body.length%2){\n fr +=1;\n frameRate(fr);\n }\n }", "function clamp(r)\n{\n\t r[3] &= 15;\n r[7] &= 15;\n r[11] &= 15;\n r[15] &= 15;\n r[4] &= 252;\n r[8] &= 252;\n r[12] &= 252;\n return r;\n}", "function intToBuffer(i) {\n var hex = intToHex(i);\n\n return new Buffer(hex.slice(2), 'hex');\n}", "function createX(){\n line(0, 0, -vScale/2, -vScale/2);\n line(0, 0, vScale/2, -vScale/2);\n line(0, 0, vScale/2, vScale/2);\n line(0, 0, -vScale/2, vScale/2);\n}", "function BufferPool(len) {\n this._len = len | 0;\n this._pos = 0;\n this._slab = newBuffer(this._len);\n}", "function BufferPool(len) {\n this._len = len | 0;\n this._pos = 0;\n this._slab = newBuffer(this._len);\n}", "function leftZeroFill(number, targetLength, forceSign) {\n var output = Math.abs(number) + '',\n sign = number >= 0;\n\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return (sign ? (forceSign ? '+' : '') : '-') + output;\n }" ]
[ "0.5695793", "0.54018956", "0.5358065", "0.5158307", "0.5144002", "0.5065776", "0.50528586", "0.5041037", "0.5034923", "0.4898186", "0.48834822", "0.48834822", "0.48834822", "0.48610315", "0.48610315", "0.48556194", "0.48531333", "0.48531333", "0.4846901", "0.4845676", "0.481081", "0.48038697", "0.47854093", "0.4775516", "0.47649014", "0.4764135", "0.47443536", "0.47417033", "0.4734927", "0.47298896", "0.472505", "0.47188732", "0.47108975", "0.46928814", "0.4692343", "0.468073", "0.46773005", "0.46742973", "0.466974", "0.466974", "0.466974", "0.466974", "0.466974", "0.466974", "0.466974", "0.466974", "0.466974", "0.466974", "0.466974", "0.466974", "0.466974", "0.46693018", "0.4639788", "0.46391213", "0.46343347", "0.46188274", "0.45880982", "0.45865476", "0.4583184", "0.4583184", "0.4582869", "0.45764112", "0.4574453", "0.45703176", "0.45634693", "0.45605338", "0.45508263", "0.4548806", "0.4543969", "0.45336935", "0.4523975", "0.45193097", "0.45141193", "0.4508214", "0.45051712", "0.4499505", "0.4494539", "0.4493101", "0.44917393", "0.44874787", "0.4487033", "0.44842738", "0.44825593", "0.44814858", "0.44751003", "0.44710416", "0.44710106", "0.44699338", "0.44693482", "0.44563225", "0.44534004", "0.44516", "0.44501027", "0.44491774", "0.44488707", "0.44480744", "0.4444004", "0.4444004", "0.44425753" ]
0.66798407
1
Create an AudioBuffer of length |sampleFrameLength| having a constant value |constantValue|. If |constantValue| is a number, the buffer has one channel filled with that value. If |constantValue| is an array, the buffer is created wit a number of channels equal to the length of the array, and channel k is filled with the k'th element of the |constantValue| array.
function createConstantBuffer(context, sampleFrameLength, constantValue) { var channels; var values; if (typeof constantValue === "number") { channels = 1; values = [constantValue]; } else { channels = constantValue.length; values = constantValue; } var audioBuffer = context.createBuffer(channels, sampleFrameLength, context.sampleRate); var n = audioBuffer.length; for (var c = 0; c < channels; ++c) { var data = audioBuffer.getChannelData(c); for (var i = 0; i < n; ++i) data[i] = values[c]; } return audioBuffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createConstantBuffer(context, sampleFrameLength, constantValue) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var i = 0; i < n; ++i)\n dataL[i] = constantValue;\n\n return audioBuffer;\n}", "function createImpulseBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var k = 0; k < n; ++k) {\n dataL[k] = 0;\n }\n dataL[0] = 1;\n\n return audioBuffer;\n}", "function createImpulseBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var k = 0; k < n; ++k) {\n dataL[k] = 0;\n }\n dataL[0] = 1;\n\n return audioBuffer;\n}", "function createLinearRampBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var i = 0; i < n; ++i)\n dataL[i] = i / n;\n\n return audioBuffer;\n}", "function createLinearRampBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var i = 0; i < n; ++i)\n dataL[i] = i / n;\n\n return audioBuffer;\n}", "function createBuffer(channelData, duration) {\n // If a single array of numbers is passed, make it an array of arrays\n if (typeof channelData[0] === 'number')\n channelData = [channelData];\n // Normalize to -1..1\n normalize(channelData);\n return {\n duration,\n length: channelData[0].length,\n sampleRate: channelData[0].length / duration,\n numberOfChannels: channelData.length,\n getChannelData: (i) => channelData?.[i],\n copyFromChannel: AudioBuffer.prototype.copyFromChannel,\n copyToChannel: AudioBuffer.prototype.copyToChannel,\n };\n}", "function createStereoImpulseBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(2, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n var dataR = audioBuffer.getChannelData(1);\n\n for (var k = 0; k < n; ++k) {\n dataL[k] = 0;\n dataR[k] = 0;\n }\n dataL[0] = 1;\n dataR[0] = 1;\n\n return audioBuffer;\n}", "function createStereoImpulseBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(2, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n var dataR = audioBuffer.getChannelData(1);\n\n for (var k = 0; k < n; ++k) {\n dataL[k] = 0;\n dataR[k] = 0;\n }\n dataL[0] = 1;\n dataR[0] = 1;\n\n return audioBuffer;\n}", "function generateAudioBuffer( freq, fn, duration, volume ) {\n var length = duration * sampleRate;\n\n var buffer = audioContext.createBuffer( 1, length, sampleRate );\n var channel = buffer.getChannelData(0);\n for ( var i = 0; i < length; i++ ) {\n channel[i] = fn( freq * i / sampleRate, i / length ) * volume;\n }\n\n return buffer;\n}", "function getEmptyAudioBuffer(){\n let emptyAudioBuffer = audioContext.createBuffer(2, audioContext.sampleRate * 5, audioContext.sampleRate);\n return emptyAudioBuffer;\n}", "function create (a, b, c) {\n return new AudioBuffer(a, b, c);\n}", "function CombFilter (sampleRate, delaySize, feedback, damping) {\n\tvar\tself\t= this;\n\tself.sampleRate\t= sampleRate;\n\tself.buffer\t= new Float32Array(isNaN(delaySize) ? 1200 : delaySize);\n\tself.bufferSize\t= self.buffer.length;\n\tself.feedback\t= isNaN(feedback) ? self.feedback : feedback;\n\tself.damping\t= isNaN(damping) ? self.damping : damping;\n\tself.invDamping\t= 1 - self.damping;\n}", "function constant(value) {\n return new Constant(value)\n}", "function audio_reload_convolver_buffer(lpf_taps, lpf_taps_length)\n{\n // always using 2 channels of LPF data seems to work fine\n var audio_lpf_buffer = audio_context.createBuffer(2, lpf_taps_length, audio_output_rate);\n var audio_lpf = audio_lpf_buffer.getChannelData(0);\n audio_lpf.set(lpf_taps);\n audio_lpf = audio_lpf_buffer.getChannelData(1);\n audio_lpf.set(lpf_taps);\n audio_convolver.buffer = audio_lpf_buffer;\n //kiwi_log('audio_reload_convolver_buffer lpf_taps_length='+ lpf_taps_length);\n}", "function shallow (buffer) {\n validate(buffer);\n\n //workaround for faster browser creation\n //avoid extra checks & copying inside of AudioBuffer class\n if (isBrowser) {\n return AudioBuffer.context.createBuffer(buffer.numberOfChannels, buffer.length, buffer.sampleRate);\n }\n\n return create(buffer.numberOfChannels, buffer.length, buffer.sampleRate);\n}", "function createFadeBuffer(context, activeTime, fadeTime) {\n\t var length1 = activeTime * context.sampleRate;\n\t var length2 = (activeTime - 2*fadeTime) * context.sampleRate;\n\t var length = length1 + length2;\n\t var buffer = context.createBuffer(1, length, context.sampleRate);\n\t var p = buffer.getChannelData(0);\n\t \n\t var fadeLength = fadeTime * context.sampleRate;\n\t\n\t var fadeIndex1 = fadeLength;\n\t var fadeIndex2 = length1 - fadeLength;\n\t \n\t // 1st part of cycle\n\t for (var i = 0; i < length1; ++i) {\n\t var value;\n\t \n\t if (i < fadeIndex1) {\n\t value = Math.sqrt(i / fadeLength);\n\t } else if (i >= fadeIndex2) {\n\t value = Math.sqrt(1 - (i - fadeIndex2) / fadeLength);\n\t } else {\n\t value = 1;\n\t }\n\t \n\t p[i] = value;\n\t }\n\t\n\t // 2nd part\n\t for (var i = length1; i < length; ++i) {\n\t p[i] = 0;\n\t }\n\t \n\t \n\t return buffer;\n\t}", "function ArrayBuffer$(length) {\n if (NewTarget === undefined) throw $TypeError();\n if (STRICT_CONFORMANCE) {\n var numberLength = ToNumber(length);\n var byteLength = ToLength(numberLength);\n if (SameValueZero(numberLength, byteLength) === false) throw $RangeError();\n } else {\n var byteLength = ToIndex(length); // comatible with ES8\n }\n return AllocateArrayBuffer(NewTarget, byteLength);\n}", "function _playBuffer ( buffer, offset )\n\t{\n\t\tvar fn, ctx, source, gainNode, duration, timeout, id, channel, type;\n\n\t\tfn = \"[_playBuffer] \";\n\n\t\tctx = _context;\n\n\t\tsource = ctx.createBufferSource();\n\t\tif ( !source )\n\t\t{\n\t\t\treturn _error( fn + \"Invalid bufferSource\" );\n\t\t}\n\t\tsource.buffer = buffer.audio;\n\n\t\tif ( ctx.createGain !== undefined )\n\t\t{\n\t\t\tgainNode = ctx.createGain();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tgainNode = ctx.createGainNode();\n\t\t}\n\n\t\tif ( !gainNode )\n\t\t{\n\t\t\treturn _error( fn + \"Invalid gainNode\" );\n\t\t}\n\n\t\tsource.connect( gainNode );\n\t\tgainNode.connect( ctx.destination );\n\t\tgainNode.gain.value = buffer.params.volume;\n\n\t\tif ( offset === undefined )\n\t\t{\n\t\t\toffset = 0;\n\t\t}\n\n\t\t// calc timeout\n\n\t\tduration = buffer.audio.duration - offset;\n\t\ttimeout = Math.floor( duration * 1000 );\n\n\t\t// get a unique channel id if none assigned\n\n\t\tif ( !buffer.channel_id )\n\t\t{\n\t\t\tbuffer.channel_id = _assignChannel();\n\t\t}\n\t\tid = buffer.channel_id;\n\n\t\tchannel = {\n\t\t\tid : id,\n\t\t\tbuffer : buffer,\n\t\t\tsource : source,\n\t\t\tgainNode : gainNode,\n\t\t\tstartTime : ctx.currentTime - offset, // fixes multiple pauses\n\t\t\tpauseTime : 0, // non-zero if paused\n\t\t\tendTime : -1, // -1 if no end time specified\n\t\t\tstatus : _CHANNEL_PLAYING\n\t\t};\n\n\t\t// Establish timeout for .onDone handling\n\t\t// Save handle for pause\n\t\t// Make it a closure for channel identification\n\n\t\tchannel.thandle = window.setTimeout( function ()\n\t\t {\n\t\t\t var fn, len, i, channel, buffer, params, func;\n\n\t\t\t fn = \"[Web Audio .onDone] \";\n\n\t\t\t // find the channel\n\n\t\t\t len = _channels.length;\n\t\t\t for ( i = 0; i < len; i += 1 )\n\t\t\t {\n\t\t\t\t channel = _channels[ i ];\n\t\t\t\t if ( channel.id === id ) // id obtained from the closure\n\t\t\t\t {\n\t\t\t\t\t if ( _monitor )\n\t\t\t\t\t {\n\t\t\t\t\t\t _debug( fn + \"Ending \" + id );\n\t\t\t\t\t }\n\n\t\t\t\t\t _stopChannel( channel );\n\n\t\t\t\t\t // call user onDone function if valid\n\n\t\t\t\t\t buffer = channel.buffer;\n\t\t\t\t\t params = buffer.params;\n\t\t\t\t\t func = params.onDone;\n\t\t\t\t\t if ( func )\n\t\t\t\t\t {\n\t\t\t\t\t\t try\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t func( params.data );\n\t\t\t\t\t\t }\n\t\t\t\t\t\t catch ( err )\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t _errorCatch( fn + \"onDone function error [\" + err.message + \"]\", err );\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\n\t\t\t\t\t // delete the channel last (why? who knows?)\n\n\t\t\t\t\t _channels.splice( i, 1 );\n\n\t\t\t\t\t // restart if looping\n\n\t\t\t\t\t if ( params.loop )\n\t\t\t\t\t {\n\t\t\t\t\t\t _playBuffer( buffer, 0 ); // fix offset later\n\t\t\t\t\t }\n\t\t\t\t\t return;\n\t\t\t\t }\n\t\t\t }\n\n\t\t\t _error( fn + \"Channel \" + id + \" not found\" );\n\n\t\t }, timeout );\n\n\t\t// save the channel\n\n\t\t_channels.push( channel );\n\n\t\t// begin playback\n\n\t\ttype = _typeOf( source.start );\n\t\tif ( type !== \"undefined\" )\n\t\t{\n\t\t\tsource.start( 0, offset, duration );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsource.noteGrainOn( 0, offset, duration ); // this call is deprecated!\n\t\t}\n\n\t\treturn id;\n\t}", "function Buffer$c (arg, encodingOrOffset, length) {\n if (!Buffer$c.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer$c)) {\n return new Buffer$c(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from$2(this, arg, encodingOrOffset, length)\n}", "function constantGenerator (options) {\n var o = options || {};\n return function (i) {\n return {\n i : i,\n x : i / o.fps,\n y : options.value,\n length : o.length\n }\n }\n}", "set sampleRateSetting(value) {}", "function GLBuffer(elementSize, dataType, targetBufferType, mode) {\n if (dataType === void 0) { dataType = B2DGAME.gl.FLOAT; }\n if (targetBufferType === void 0) { targetBufferType = B2DGAME.gl.ARRAY_BUFFER; }\n if (mode === void 0) { mode = B2DGAME.gl.TRIANGLES; }\n this._hasAttributeLocation = false;\n this._data = [];\n this._attributes = [];\n this._elementSize = elementSize;\n this._dataType = dataType;\n this._targetBufferType = targetBufferType;\n this._mode = mode;\n //Determine byte size\n switch (this._dataType) {\n case B2DGAME.gl.FLOAT:\n case B2DGAME.gl.INT:\n case B2DGAME.gl.UNSIGNED_INT:\n this._typeSize = 4;\n break;\n case B2DGAME.gl.SHORT:\n case B2DGAME.gl.UNSIGNED_SHORT:\n this._typeSize = 2;\n break;\n case B2DGAME.gl.BYTE:\n case B2DGAME.gl.UNSIGNED_BYTE:\n this._typeSize = 1;\n break;\n default:\n throw new Error(\"Unrecognized data type: \" + dataType.toString());\n }\n this._stride = this._elementSize * this._typeSize;\n this._buffer = B2DGAME.gl.createBuffer();\n }", "function initVertexBuffers_circle(gl, x, y, size, a_Position, sCount) {\r\n var theta = Math.PI/sCount;\r\n var count = 0; // add to array\r\n var n = 0; // The number of vertices\r\n var vertices = new Float32Array(98);\r\n\r\n // creating the vertices for circle\r\n for(var circle = 0; circle <= (2*Math.PI); circle += theta){\r\n vertices[count] = (x+(1/(2*size))*Math.cos(n*theta));\r\n count++;\r\n vertices[count] = (y+(1/(2*size))*Math.sin(n*theta));\r\n count++;\r\n n++;\r\n }\r\n n--;\r\n\r\n // Create a buffer object\r\n var vertexBuffer = gl.createBuffer();\r\n if (!vertexBuffer) {\r\n console.log('Failed to create the buffer object');\r\n return -1;\r\n }\r\n\r\n // Bind the buffer object to target\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\r\n // Write date into the buffer object\r\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\r\n\r\n // Assign the buffer object to a_Position variable\r\n gl.vertexAttribPointer(a_Position, 2, gl.FLOAT, false, 0, 0);\r\n\r\n // Enable the assignment to a_Position variable\r\n gl.enableVertexAttribArray(a_Position);\r\n\r\n return n;\r\n}", "function createBuffer(bufferContent) {\r\n let buf;\r\n if (Buffer.from && Buffer.from !== Uint8Array.from) {\r\n buf = Buffer.from(bufferContent);\r\n } else {\r\n if (typeof bufferContent === 'number') {\r\n throw new Error('The \"size\" argument must be not of type number.');\r\n }\r\n buf = new Buffer(bufferContent);\r\n }\r\n return buf;\r\n}", "function Buffer(arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length);\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error('If encoding is specified then the first argument must be a string');\n\t }\n\t return allocUnsafe(this, arg);\n\t }\n\t return from(this, arg, encodingOrOffset, length);\n\t}", "function Buffer(arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length);\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error('If encoding is specified then the first argument must be a string');\n\t }\n\t return allocUnsafe(this, arg);\n\t }\n\t return from(this, arg, encodingOrOffset, length);\n\t}", "function Buffer(arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length);\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error('If encoding is specified then the first argument must be a string');\n\t }\n\t return allocUnsafe(this, arg);\n\t }\n\t return from(this, arg, encodingOrOffset, length);\n\t}", "function Buffer(arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length);\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error('If encoding is specified then the first argument must be a string');\n\t }\n\t return allocUnsafe(this, arg);\n\t }\n\t return from(this, arg, encodingOrOffset, length);\n\t}", "function Buffer(arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length);\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error('If encoding is specified then the first argument must be a string');\n\t }\n\t return allocUnsafe(this, arg);\n\t }\n\t return from(this, arg, encodingOrOffset, length);\n\t}", "function Buffer(arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length);\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error('If encoding is specified then the first argument must be a string');\n }\n return allocUnsafe(this, arg);\n }\n return from(this, arg, encodingOrOffset, length);\n }", "function Buffer(arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length);\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string',\n );\n }\n return allocUnsafe(this, arg);\n }\n return from(this, arg, encodingOrOffset, length);\n }", "function Buffer(arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n }", "function $fe91$var$Buffer(arg, encodingOrOffset, length) {\n if (!$fe91$var$Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof $fe91$var$Buffer)) {\n return new $fe91$var$Buffer(arg, encodingOrOffset, length);\n } // Common case.\n\n\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error('If encoding is specified then the first argument must be a string');\n }\n\n return $fe91$var$allocUnsafe(this, arg);\n }\n\n return $fe91$var$from(this, arg, encodingOrOffset, length);\n}", "function Buffer(arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n }", "function BaseConstant(value) {\n return {\n type: \"constant\",\n value: () => value\n }\n}", "function Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n }", "function Buffer$1 (arg, encodingOrOffset, length) {\n\t if (!Buffer$1.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer$1)) {\n\t return new Buffer$1(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer(arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length);\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n );\n }\n return allocUnsafe(this, arg);\n }\n return from(this, arg, encodingOrOffset, length);\n }", "function Buffer(arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length);\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error('If encoding is specified then the first argument must be a string');\n }\n return allocUnsafe(this, arg);\n }\n return from(this, arg, encodingOrOffset, length);\n }", "function Buffer(arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length);\n } // Common case.\n\n\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error('If encoding is specified then the first argument must be a string');\n }\n\n return allocUnsafe(this, arg);\n }\n\n return from(this, arg, encodingOrOffset, length);\n }", "function createShort(buf, bufPos, value) {\n buf[bufPos + 0] = 0xff & ((value >> 8) & 0xff);\n buf[bufPos + 1] = 0xff & (value & 0xff);\n }", "function createShort(buf, bufPos, value) {\n buf[bufPos + 0] = 0xff & ((value >> 8) & 0xff);\n buf[bufPos + 1] = 0xff & (value & 0xff);\n }", "function RandomBuffer() {\n this.buffer = null;\n this.size = null;\n this.callback = null;\n}", "function RandomBuffer() {\n this.buffer = null;\n this.size = null;\n this.callback = null;\n}", "function Chorus (sampleRate, delayTime, depth, freq) {\n\tvar\tself\t\t= this,\n\t\tbuffer, bufferPos, sample;\n\n\tself.delayTime\t= delayTime || 30;\n\tself.depth\t= depth\t|| 3;\n\tself.freq\t= freq || 0.1;\n\n\tfunction calcCoeff () {\n\t\tbuffer = new Float32Array(self.sampleRate * 0.1);\n\t\tbufferPos = 0;\n\t\tvar i, l = buffer.length;\n\t\tfor (i=0; i<l; i++){\n\t\t\tbuffer[i] = 0.0;\n\t\t}\n\t}\n\n\tself.sampleRate = sampleRate;\n\tself.osc = new Oscillator(sampleRate, freq);\n\tself.calcCoeff = calcCoeff;\n\tself.pushSample = function (s) {\n\t\tif (++bufferPos >= buffer.length){\n\t\t\tbufferPos = 0;\n\t\t}\n\t\tbuffer[bufferPos] = s;\n\t\tself.osc.generate();\n\n\t\tvar delay = self.delayTime + self.osc.getMix() * self.depth;\n\t\tdelay *= self.sampleRate / 1000;\n\t\tdelay = bufferPos - Math.floor(delay);\n\t\twhile(delay < 0){\n\t\t\tdelay += buffer.length;\n\t\t}\n\n\t\tsample = buffer[delay];\n\t\treturn sample;\n\t};\n\tself.getMix = function () {\n\t\treturn sample;\n\t};\n\n\tcalcCoeff();\n}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function getAudioBufferArray(){\n let audioBufferArray = [];\n let endPlaybackColumn = getEndPlaybackColumn();\n\n for (let i = 0; i < rows; i++) {\n let tempAudioBuffer = audioContext.createBuffer(2, audioContext.sampleRate * ((endPlaybackColumn + 1) * 5), audioContext.sampleRate);\n let tempFloat32Array = tempAudioBuffer.getChannelData(0);\n let length = 0; // increments of 5 seconds\n \n for (let j = 0; j < columns; j++) {\n let audioBuffer = soundGrid[i][j];\n \n if((audioBuffer === -1) && (j <= endPlaybackColumn)){\n if (length === 0){\n tempFloat32Array.set(getEmptyAudioBuffer().getChannelData(0));\n } else {\n tempFloat32Array.set(getEmptyAudioBuffer().getChannelData(0), length);\n }\n } else if (audioBuffer != -1){\n if (length === 0){\n tempFloat32Array.set(audioBuffer.getChannelData(0));\n } else {\n tempFloat32Array.set(audioBuffer.getChannelData(0), length);\n }\n }\n length = length + (audioContext.sampleRate * 5); \n }\n \n tempAudioBuffer.getChannelData(0).set(tempFloat32Array); // left\n tempAudioBuffer.getChannelData(1).set(tempFloat32Array); // right\n audioBufferArray.push(tempAudioBuffer); \n }\n\n return audioBufferArray;\n }", "function setSampleRate(\r\n sampleRate)\r\n {\r\n allocateStreamBuffers(sampleRate, numChannels);\r\n }", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "function Buffer(arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length);\n } // Common case.\n\n\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error('If encoding is specified then the first argument must be a string');\n }\n\n return allocUnsafe(this, arg);\n }\n\n return from(this, arg, encodingOrOffset, length);\n }", "function Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n \n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n }", "function Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n }", "function Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n }", "function Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n }", "function FFT(bufferSize, sampleRate) {\n\t\tthis.bufferSize = bufferSize;\n\t\tthis.sampleRate = sampleRate;\n\t\tthis.spectrum = new Float32Array(bufferSize/2);\n\t\tthis.real = new Float32Array(bufferSize);\n\t\tthis.imag = new Float32Array(bufferSize);\n\t\tthis.reverseTable = new Uint32Array(bufferSize);\n\t\tthis.sinTable = new Float32Array(bufferSize);\n\t\tthis.cosTable = new Float32Array(bufferSize);\n\n\t\tvar limit = 1,\n\t\t\tbit = bufferSize >> 1;\n\n\t\twhile ( limit < bufferSize ) {\n\t\t\tfor ( var i = 0; i < limit; i++ ) {\n\t\t\t\tthis.reverseTable[i + limit] = this.reverseTable[i] + bit;\n\t\t\t}\n\n\t\t\tlimit = limit << 1;\n\t\t\tbit = bit >> 1;\n\t\t}\n\n\t\tfor ( var i = 0; i < bufferSize; i++ ) {\n\t\t\tthis.sinTable[i] = Math.sin(-Math.PI/i);\n\t\t\tthis.cosTable[i] = Math.cos(-Math.PI/i);\n\t\t}\n\t}", "function Buffer(arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error('If encoding is specified then the first argument must be a string');\n }\n return allocUnsafe(arg);\n }\n return from(arg, encodingOrOffset, length);\n }", "function createGaussian(duration) {\n var length = Math.floor(WX.srate * duration);\n var noiseFloat32 = new Float32Array(length);\n for (var i = 0; i < length; i++) {\n var r1 = Math.log(Math.random()), r2 = Math.PI * Math.random();\n noiseFloat32[i] = Math.sqrt(-2.0 * r1) * Math.cos(2.0 * r2) * 0.5;\n }\n var noiseBuffer = WX.Buffer(2, length, WX.srate);\n noiseBuffer.getChannelData(0).set(noiseFloat32, 0);\n noiseBuffer.getChannelData(1).set(noiseFloat32, 0);\n return noiseBuffer;\n }", "function Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n }", "function Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n }", "function Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n }", "function loadBuffer(audioFilename, bufferIndex) {\n \n let request = new XMLHttpRequest();\n\n request.open('GET', audioFilename, true);\n request.responseType = 'arraybuffer';\n\n request.onload = function () {\n let fileContents = request.response;\n convertToAudioData(fileContents, bufferIndex);\n }\n\n request.onerror = function() {\n console.log('XHR error loading ' + audioFilename);\n }\n\n request.send();\n }" ]
[ "0.8232728", "0.55788535", "0.55788535", "0.5341614", "0.5341614", "0.52795666", "0.49277818", "0.49277818", "0.48611498", "0.4792038", "0.4518094", "0.44687134", "0.4428806", "0.43605888", "0.4307192", "0.42561933", "0.42232248", "0.42006865", "0.41688406", "0.41628414", "0.41609225", "0.41282985", "0.41176718", "0.40907162", "0.40895206", "0.40895206", "0.40895206", "0.40895206", "0.4082644", "0.4072053", "0.40655237", "0.40590993", "0.40545136", "0.40542707", "0.4045998", "0.40437892", "0.40421793", "0.40388775", "0.40348822", "0.40286005", "0.40238506", "0.40238506", "0.4020124", "0.4020124", "0.40142083", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40061572", "0.40041748", "0.39992768", "0.39986503", "0.39986503", "0.39986503", "0.39986503", "0.39986503", "0.39986503", "0.39986503", "0.39986503", "0.39986503", "0.39986503", "0.39986503", "0.39986503", "0.39986503", "0.39986503", "0.39986503", "0.39986503", "0.39986503", "0.3990586", "0.39797688", "0.39777368", "0.39777368", "0.39777368", "0.39648432", "0.39457056", "0.3934294", "0.39310744", "0.39310744", "0.39310744", "0.39294204" ]
0.8294203
0
Create a stereo impulse in a buffer of length sampleFrameLength
function createStereoImpulseBuffer(context, sampleFrameLength) { var audioBuffer = context.createBuffer(2, sampleFrameLength, context.sampleRate); var n = audioBuffer.length; var dataL = audioBuffer.getChannelData(0); var dataR = audioBuffer.getChannelData(1); for (var k = 0; k < n; ++k) { dataL[k] = 0; dataR[k] = 0; } dataL[0] = 1; dataR[0] = 1; return audioBuffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createImpulseBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var k = 0; k < n; ++k) {\n dataL[k] = 0;\n }\n dataL[0] = 1;\n\n return audioBuffer;\n}", "function createImpulseBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var k = 0; k < n; ++k) {\n dataL[k] = 0;\n }\n dataL[0] = 1;\n\n return audioBuffer;\n}", "function createLinearRampBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var i = 0; i < n; ++i)\n dataL[i] = i / n;\n\n return audioBuffer;\n}", "function createLinearRampBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var i = 0; i < n; ++i)\n dataL[i] = i / n;\n\n return audioBuffer;\n}", "init(frameDuration){\n // Initialize variables\n\n // Frame information\n // Frame duration (e.g., 0.02 s)\n const fSize = frameDuration*sampleRate;\n // Make the framesize multiple of 128 (audio render block size)\n this._frameSize = 128*Math.round(fSize/128); // Frame duration = this._frameSize/sampleRate;\n this._frameSize = Math.max(128*2, this._frameSize); // Force a minimum of two blocks\n\n this._numBlocksInFrame = this._frameSize/128; // 8 at 48kHz and 20ms window\n // Force an even number of frames\n if (this._numBlocksInFrame % 2){\n this._numBlocksInFrame++;\n this._frameSize += 128;\n }\n // Predefined 50% overlap\n this._numBlocksOverlap = Math.floor(this._numBlocksInFrame/2); // 4 at 48kHz and 20ms window\n\n // Define frame buffers\n this._oddBuffer = new Float32Array(this._frameSize); // previous and current are reused\n this._pairBuffer = new Float32Array(this._frameSize); // previous and current are reused\n\n // We want to reuse the two buffers. This part is a bit complicated and requires a detailed description\n // Finding the block indices that belong to each buffer is complicated\n // for buffers with an odd num of blocks.\n // Instead of using full blocks, half blocks could be used. This also adds\n // another layer of complexity, so not much to gain...\n // Module denominator to compute the block index\n this._modIndexBuffer = this._numBlocksInFrame + this._numBlocksInFrame % 2; // Adds 1 to numBlocksInFrame if it's odd, otherwise adds 0\n\n // Count blocks\n this._countBlock = 0;\n\n // Computed buffers\n this._oddSynthBuffer = new Float32Array(this._frameSize);\n this._pairSynthBuffer = new Float32Array(this._frameSize);\n\n console.log(\"Frame size: \" + this._frameSize +\n \". Set frame length: \" + this._frameSize/sampleRate + \" seconds\" +\n \". Blocks per frame: \" + this._numBlocksInFrame +\n \". Blocks overlap: \" + this._numBlocksOverlap);\n\n\n\n\n // LCP variables\n this._lpcOrder = 20;\n // LPC filter coefficients\n this._lpcCoeff = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n // LPC k coefficients\n this._kCoeff = [];\n // Filter samples\n this._prevY = [];\n // Quantization\n this._quantOpt = false;\n this._quantBits = 2;\n // Reverse K's\n this._reverseKOpt = false;\n // Perfect synthesis\n this._perfectSynthOpt = false;\n\n // resampling before analysis\n this._resamplingFactor = 1;\n this._resampler = new Resampler(this._frameSize, this._resamplingFactor);\n // Unvoiced mix (adds noise to the perfect excitation signal)\n this._unvoicedMix = 0;\n // Pitch factor (modifies this._fundFreq)\n this._pitchFactor = 1;\n // Vibrato effect (modifies this._fundFreq)\n this._vibratoEffect = 0;\n\n\n\n // Synthesis\n // Create impulse signal\n this._oldTonalBuffer = new Float32Array(this._frameSize/2);\n this._excitationSignal = new Float32Array(this._frameSize);\n this._errorBuffer = new Float32Array(this._frameSize);\n this._mixedExcitationSignal = new Float32Array(this._frameSize);\n\n // autocorrelation indices for fundamental frequency estimation\n this._lowerACFBound = Math.floor(sampleRate / 200); // 200 Hz upper frequency limit -> lower limit for periodicity in samples\n this._upperACFBound = Math.ceil(sampleRate / 70); // 70 Hz lower frequency limit -> upper limit\n\n // excitation variables\n this._tonalConfidence = 0.5;\n this._confidenceTonalThreshold = 0.1;\n this._periodFactor = 1;\n\n // buffer for fundamental period estimation\n this._fundPeriodLen = this._upperACFBound - this._lowerACFBound;\n this._fundPeriodBuffer = [];\n this._oldPeriodSamples = this._upperACFBound;\n this._pulseOffset = 0;\n\n\n\n\n // Debug\n // Timer to give updates to the main thread\n this._lastUpdate = currentTime;\n // Block info\n this._block1 = new Float32Array(128);\n this._block2 = new Float32Array(128);\n\n }", "function createConstantBuffer(context, sampleFrameLength, constantValue) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var i = 0; i < n; ++i)\n dataL[i] = constantValue;\n\n return audioBuffer;\n}", "function createConstantBuffer(context, sampleFrameLength, constantValue) {\n var channels;\n var values;\n\n if (typeof constantValue === \"number\") {\n channels = 1;\n values = [constantValue];\n } else {\n channels = constantValue.length;\n values = constantValue;\n }\n\n var audioBuffer = context.createBuffer(channels, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n\n for (var c = 0; c < channels; ++c) {\n var data = audioBuffer.getChannelData(c);\n for (var i = 0; i < n; ++i)\n data[i] = values[c];\n }\n\n return audioBuffer;\n}", "function startLoop(audioBuffer, pan = 0, rate = 1) {\n let sourceNode = audioContext.createBufferSource()\n let pannerNode = audioContext.createStereoPanner()\n\n sourceNode.buffer = audioBuffer\n sourceNode.loop = true\n sourceNode.loopStart = 3.40\n sourceNode.loopEnd = 4.19\n sourceNode.playbackRate.value = rate\n pannerNode.pan.value = pan\n // no longer do you connect the source nodes directly to the audioContext destination like before. We connect them to the panner nodes, and then the panner nodes to the destionation. The audio signals flow through the panners\n // audioBufferSourceNode -----> stereoPannerNode -----> audioDestinationNode\n // we now have an audio graph with two loops panned to different ends of the stereo fields.\n\n sourceNode.connect(pannerNode)\n pannerNode.connect(audioContext.destination)\n\n // sourceNode.start(0, 3.40)\n sourceNode.start()\n}", "function createBuffer(channelData, duration) {\n // If a single array of numbers is passed, make it an array of arrays\n if (typeof channelData[0] === 'number')\n channelData = [channelData];\n // Normalize to -1..1\n normalize(channelData);\n return {\n duration,\n length: channelData[0].length,\n sampleRate: channelData[0].length / duration,\n numberOfChannels: channelData.length,\n getChannelData: (i) => channelData?.[i],\n copyFromChannel: AudioBuffer.prototype.copyFromChannel,\n copyToChannel: AudioBuffer.prototype.copyToChannel,\n };\n}", "function startSample(index, arNum) {\n\nvar source = context.createBufferSource()\nsource.buffer = userPad[index][arNum].activeVoice[0]\n\nsource.connect(bus[index].input)\nsource.start(0)\n\nsource.onended = function(){\n\tsource.stop()\n }\n\n}", "function audio_reload_convolver_buffer(lpf_taps, lpf_taps_length)\n{\n // always using 2 channels of LPF data seems to work fine\n var audio_lpf_buffer = audio_context.createBuffer(2, lpf_taps_length, audio_output_rate);\n var audio_lpf = audio_lpf_buffer.getChannelData(0);\n audio_lpf.set(lpf_taps);\n audio_lpf = audio_lpf_buffer.getChannelData(1);\n audio_lpf.set(lpf_taps);\n audio_convolver.buffer = audio_lpf_buffer;\n //kiwi_log('audio_reload_convolver_buffer lpf_taps_length='+ lpf_taps_length);\n}", "function MV_Mix(voice) {\n var start;\n var length;\n var voclength;\n var position;\n var rate;\n var FixedPointBufferSize;\n\n if ((voice.length == 0)\n && (voice.GetSound(voice) != KeepPlaying)) {\n return;\n }\n\n length = MixBufferSize;\n FixedPointBufferSize = voice.FixedPointBufferSize;\n\n MV_MixDestination = MV_FooBuffer;\n MV_LeftVolume = voice.LeftVolume;\n MV_RightVolume = voice.RightVolume;\n MV_GLast = voice.GLast;\n MV_GPos = voice.GPos;\n MV_GVal = voice.GVal;\n\n if ((MV_Channels == 2) && (IS_QUIET(MV_LeftVolume))) {\n MV_LeftVolume = MV_RightVolume;\n MV_MixDestination += 8;\n }\n\n // Add this voice to the mix\n while (length > 0) {\n start = voice.sound;\n rate = voice.RateScale;\n position = voice.position;\n\n // Check if the last sample in this buffer would be\n // beyond the length of the sample block\n if ((position + FixedPointBufferSize) >= voice.length) {\n if (position < voice.length) {\n voclength = (voice.length - position + rate - 1) / rate | 0;\n }\n else {\n voice.GetSound(voice);\n return;\n }\n }\n else {\n voclength = length;\n }\n\n voice.mix(position, rate, start, voclength);\n\n if (voclength & 1) {\n MV_MixPosition += rate;\n voclength -= 1;\n }\n voice.position = MV_MixPosition;\n\n length -= voclength;\n\n if (voice.position >= voice.length) {\n // Get the next block of sound\n if (voice.GetSound(voice) != KeepPlaying) {\n return;\n }\n\n if (length > 0) {\n // Get the position of the last sample in the buffer\n FixedPointBufferSize = voice.RateScale * (length - 1);\n }\n }\n }\n}", "function sliceAudioBufferInMono(buffer, start_sec, end_sec){ \n if (start_sec > end_sec || end_sec > buffer.duration || start_sec < 0){\n print(\"error: check start_sec/end_sec/buffer.duration\");\n return buffer;\n }\n\n var sampleRate = buffer.sampleRate;\n var numSamples = (end_sec - start_sec) * sampleRate;\n var startOffset = Math.floor(start_sec * sampleRate);\n\n var o = createContext({offline: true, sampleRate: sampleRate, length: numSamples});\n// var o = new OfflineAudioContext(1, numSamples, sampleRate);\n var newBuffer = o.createBuffer(1, numSamples, sampleRate);\n\n // Temp array\n var array = new Float32Array(numSamples);\n buffer.copyFromChannel(array, 0, startOffset);\n newBuffer.copyToChannel(array, 0, 0);\n return newBuffer;\n}", "createSoundWave() {\n this.canvasCtx = this.canvas.getContext('2d');\n this.analyser = this.context.createAnalyser();\n const source = this.context.createMediaStreamSource(this.stream);\n source.connect(this.analyser);\n this.freqs = new Uint8Array(this.analyser.frequencyBinCount);\n this.stopId = requestAnimationFrame(() => this.draw());\n }", "function generateAudioBuffer( freq, fn, duration, volume ) {\n var length = duration * sampleRate;\n\n var buffer = audioContext.createBuffer( 1, length, sampleRate );\n var channel = buffer.getChannelData(0);\n for ( var i = 0; i < length; i++ ) {\n channel[i] = fn( freq * i / sampleRate, i / length ) * volume;\n }\n\n return buffer;\n}", "function MV_Init(\n soundcard,\n MixRate,\n Voices,\n numchannels,\n samplebits\n) {\n var ptr;\n var status;\n var buffer;\n var index;\n\n MV_Voices = structArray(VoiceNode, Voices);// new Array();\n\n MV_MaxVoices = Voices;\n\n LL_Reset(VoiceList, \"next\", \"prev\");\n LL_Reset(VoicePool, \"next\", \"prev\");\n\n for (index = 0; index < Voices; index++) {\n LL_Add(VoicePool, MV_Voices[index], \"next\", \"prev\");\n }\n\n MV_SetReverseStereo(false);\n\n MV_SoundCard = soundcard;\n MV_Installed = true;\n MV_CallBackFunc = null;\n MV_RecordFunc = null;\n MV_Recording = false;\n MV_ReverbLevel = 0;\n MV_ReverbTable = -1;\n\n // Set the sampling rate\n MV_RequestedMixRate = MixRate;\n\n // Set Mixer to play stereo digitized sound\n MV_SetMixMode(numchannels, samplebits);\n MV_ReverbDelay = 14320; // MV_BufferSize * 3;\n //InitializeCriticalSection(&reverbCS);\n //reverbMutex = SDL_CreateMutex();\n\n //MV_MixBuffer[MV_NumberOfBuffers] = ptr;\n //for (buffer = 0; buffer < MV_NumberOfBuffers; buffer++) {\n // MV_MixBuffer[buffer] = ptr;\n // ptr += MV_BufferSize;\n //}\n\n // Calculate pan table\n MV_CalcPanTable();\n\n MV_SetVolume(MV_MaxTotalVolume);\n\n //MV_FooBuffer = ptr;\n\n MV_StartPlayback();\n\n return (0/*MV_Ok*/);\n}", "function setupSound() {\n sound = audioContext.createBufferSource();\n sound.buffer = sampleBuffer;\n sound.loop = loop; //auto is false\n sound.playbackRate.value = playbackSlider.value;\n\n analyser.smoothingTimeConstant = .85, //0<->1. 0 is no time smoothing\n analyser.fftSize = 2048, //must be some number by the power of 2, ex. 512\n analyser.minDecibels = -150,\n analyser.maxDecibels = -10,\n\n sound.connect(filter); //can connect more than one to a node, as long as it all ends up at destination\n \n //connect source/sound var to the gain node\n filter.connect(gainNode);\n filter.connect(analyser);\n analyser.connect(scriptProcessorNode);\n scriptProcessorNode.connect(gainNode);\n gainNode.connect(panNode);\n //connect pan node to the destination (a.k.a. the speakers)\n panNode.connect(audioContext.destination);\n \n //frequencyBinCount property of the analyserNode interface is an unsigned long value half that of the fft size -MDN\n bufferLength = analyser.frequencyBinCount; \n\n //animate the bars\n scriptProcessorNode.onaudioprocess = function (audioProcessingEvent) {\n array = new Uint8Array(bufferLength);\n analyser.getByteFrequencyData(array);\n\n boost = 0;\n for (var i = 0; i < array.length; i++) {\n boost += array[i];\n }\n boost = boost / array.length;\n\n var step = Math.round(array.length / numBars);\n\n //iterate through bars and scale the z axis\n for (var i = 0; i < numBars; i++) {\n var value = array[i * step] / 4;\n value = value < 1 ? 1 : value;\n bars[i].scale.z = value;\n }\n }\n}", "function synthesizeAudioData(aPreOutputBuffer, aStartIndex, aAudioFrames) {\n // int zSamplesToProcess=aSamplesPerChannel;\n var zSamples = aAudioFrames * myChannels;\n var zVolChannelZero = Math.floor(((myAUDV[0] << 2) * myVolumePercentage) / 100);\n var zVolChannelOne = Math.floor(((myAUDV[1] << 2) * myVolumePercentage) / 100);\n var zIndex = aStartIndex;\n // Loop until the sample buffer is full\n while (zSamples > 0) {\n // Process both TIA sound channels\n for (var c = 0; c < 2; ++c) {\n // Update P4 & P5 registers for channel if freq divider outputs a pulse\n if ((myFrequencyDivider[c].clock())) {\n switch (myAUDC[c]) {\n case 0x00: // Set to 1\n { // Shift a 1 into the 4-bit register each clock\n myP4[c] = (myP4[c] << 1) | 0x01;\n break;\n }\n\n case 0x01: // 4 bit poly\n {\n // Clock P4 as a standard 4-bit LSFR taps at bits 3 & 2\n myP4[c] = bool(myP4[c] & 0x0f) ? ((myP4[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP4[c] & 0x04) ? 1 : 0))) : 1;\n break;\n }\n\n case 0x02: // div 31 . 4 bit poly\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Clock P4 as a standard 4-bit LSFR taps at bits 3 & 2\n myP4[c] = bool(myP4[c] & 0x0f) ? ((myP4[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP4[c] & 0x04) ? 1 : 0))) : 1;\n }\n break;\n }\n\n case 0x03: // 5 bit poly . 4 bit poly\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // P5 clocks the 4 bit poly\n if (bool(myP5[c] & 0x10)) {\n // Clock P4 as a standard 4-bit LSFR taps at bits 3 & 2\n myP4[c] = bool(myP4[c] & 0x0f) ? ((myP4[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP4[c] & 0x04) ? 1 : 0))) : 1;\n }\n break;\n }\n\n case 0x04: // div 2\n {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n break;\n }\n\n case 0x05: // div 2\n {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n break;\n }\n\n case 0x06: // div 31 . div 2\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n }\n break;\n }\n\n case 0x07: // 5 bit poly . div 2\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // P5 clocks the 4 bit register\n if (bool(myP5[c] & 0x10)) {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n }\n break;\n }\n\n case 0x08: // 9 bit poly\n {\n // Clock P5 & P4 as a standard 9-bit LSFR taps at 8 & 4\n myP5[c] = (bool(myP5[c] & 0x1f) || bool(myP4[c] & 0x0f)) ? ((myP5[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP5[c] & 0x10) ? 1 : 0))) : 1;\n myP4[c] = (myP4[c] << 1) | (bool(myP5[c] & 0x20) ? 1 : 0);\n break;\n }\n\n case 0x09: // 5 bit poly\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // Clock value out of P5 into P4 with no modification\n myP4[c] = (myP4[c] << 1) | (bool(myP5[c] & 0x20) ? 1 : 0);\n break;\n }\n\n case 0x0a: // div 31\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Feed bit 4 of P5 into P4 (this will toggle back and forth)\n myP4[c] = (myP4[c] << 1) | (bool(myP5[c] & 0x10) ? 1 : 0);\n }\n break;\n }\n\n case 0x0b: // Set last 4 bits to 1\n {\n // A 1 is shifted into the 4-bit register each clock\n myP4[c] = (myP4[c] << 1) | 0x01;\n break;\n }\n\n case 0x0c: // div 6\n {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n break;\n }\n\n case 0x0d: // div 6\n {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n break;\n }\n\n case 0x0e: // div 31 . div 6\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n }\n break;\n }\n\n case 0x0f: // poly 5 . div 6\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // Use poly 5 to clock 4-bit div register\n if (bool(myP5[c] & 0x10)) {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n }\n break;\n }\n }\n }\n }\n\n myOutputCounter += JAVA_SOUND_SAMPLE_RATE;\n\n if (myChannels == 1) {\n // Handle mono sample generation\n while ((zSamples > 0) && (myOutputCounter >= TIA_SAMPLE_RATE)) {\n var zChannelZero = (bool(myP4[0] & 8) ? zVolChannelZero : 0); //if bit3 is on, amplitude is the volume, otherwise amp is 0\n var zChannelOne = (bool(myP4[1] & 8) ? zVolChannelOne : 0);\n var zBothChannels = zChannelZero + zChannelOne + myVolumeClip;\n aPreOutputBuffer[zIndex] = (zBothChannels - 128) & 0xFF; // we are using a signed byte, which has a min. of -128\n\n myOutputCounter -= TIA_SAMPLE_RATE;\n zIndex++;\n zSamples--;\n //assert(zIndex<=aStartIndex + zSamplesToProcess);\n\n }\n }\n else {\n // Handle stereo sample generation\n while ((zSamples > 0) && (myOutputCounter >= TIA_SAMPLE_RATE)) {\n var zChannelZero = (bool(myP4[0] & 8) ? zVolChannelZero : 0) + myVolumeClip; //if bit3 is on, amplitude is the volume, otherwise amp is 0\n var zChannelOne = (bool(myP4[1] & 8) ? zVolChannelOne : 0) + myVolumeClip;\n //int zBothChannels=zChannelZero + zChannelOne + myVolumeClip;\n\n aPreOutputBuffer[zIndex] = (zChannelZero - 128) & 0xFF; // we are using a signed byte, which has a min. of -128\n zIndex++;\n zSamples--;\n\n aPreOutputBuffer[zIndex] = (zChannelOne - 128) & 0xFF;\n zIndex++;\n zSamples--;\n\n myOutputCounter -= TIA_SAMPLE_RATE;\n }\n }\n }\n }", "function getAudioBufferArray(){\n let audioBufferArray = [];\n let endPlaybackColumn = getEndPlaybackColumn();\n\n for (let i = 0; i < rows; i++) {\n let tempAudioBuffer = audioContext.createBuffer(2, audioContext.sampleRate * ((endPlaybackColumn + 1) * 5), audioContext.sampleRate);\n let tempFloat32Array = tempAudioBuffer.getChannelData(0);\n let length = 0; // increments of 5 seconds\n \n for (let j = 0; j < columns; j++) {\n let audioBuffer = soundGrid[i][j];\n \n if((audioBuffer === -1) && (j <= endPlaybackColumn)){\n if (length === 0){\n tempFloat32Array.set(getEmptyAudioBuffer().getChannelData(0));\n } else {\n tempFloat32Array.set(getEmptyAudioBuffer().getChannelData(0), length);\n }\n } else if (audioBuffer != -1){\n if (length === 0){\n tempFloat32Array.set(audioBuffer.getChannelData(0));\n } else {\n tempFloat32Array.set(audioBuffer.getChannelData(0), length);\n }\n }\n length = length + (audioContext.sampleRate * 5); \n }\n \n tempAudioBuffer.getChannelData(0).set(tempFloat32Array); // left\n tempAudioBuffer.getChannelData(1).set(tempFloat32Array); // right\n audioBufferArray.push(tempAudioBuffer); \n }\n\n return audioBufferArray;\n }", "function buffer2wav(abuffer, offset,len){\n var numOfChan = abuffer.numberOfChannels,\n length = len * numOfChan * 2 + 44,\n buffer = new ArrayBuffer(length),\n view = new DataView(buffer),\n channels = [], i, sample,\n pos = 0;\n\n // write WAVE header\n setUint32(view, pos, 0x46464952); // \"RIFF\"\n setUint32(view, pos, length - 8); // file length - 8\n setUint32(view, pos, 0x45564157); // \"WAVE\"\n\n setUint32(view, pos, 0x20746d66); // \"fmt \" chunk\n setUint32(view, pos, 16); // length = 16\n setUint16(view, pos, 1); // PCM (uncompressed)\n setUint16(view, pos, numOfChan);\n setUint32(view, pos, abuffer.sampleRate);\n setUint32(view, pos, abuffer.sampleRate * 2 * numOfChan); // avg. bytes/sec\n setUint16(view, pos, numOfChan * 2); // block-align\n setUint16(view, pos, 16); // 16-bit (hardcoded in this demo)\n\n setUint32(view, pos, 0x61746164); // \"data\" - chunk\n setUint32(view, pos, length - pos - 4); // chunk length\n\n // write interleaved data\n for(i = 0; i < abuffer.numberOfChannels; i++)\n channels.push(abuffer.getChannelData(i));\n\n while(pos < length) {\n for(i = 0; i < numOfChan; i++) { // interleave channels\n sample = Math.max(-1, Math.min(1, channels[i][offset])); // clamp\n sample = (0.5 + sample < 0 ? sample * 32768 : sample * 32767)|0; // scale to 16-bit signed int\n view.setInt16(pos, sample, true); // update data chunk\n pos += 2;\n }\n }\n offset++; // next source sample\n}", "function SampleVoice(audioContext, options) {\n\n\tvar that = this;\n\n\toptions = options || {};\n\n\tvar loop = options.loop !== undefined ? options.loop : true;\n\tvar buffer = options.buffer || audioContext.createBuffer(1, audioContext.sampleRate, audioContext.sampleRate);\n\tvar nextNoteAction = options.nextNoteAction || 'cut';\n\tvar bufferSource = null;\n\tvar output = audioContext.createGain();\n\n\t//\n\n\tfunction prepareBufferSource() {\n\t\tbufferSource = audioContext.createBufferSource();\n\t\tbufferSource.loop = loop;\n\t\tbufferSource.buffer = buffer;\n\t\tbufferSource.connect(output);\n\t}\n\n\t// ~~~\n\t\n\tthis.output = output;\n\t\n\tthis.noteOn = function(frequency, volume, when) {\n\n\t\t// TODO use frequency\n\n\t\tif(bufferSource !== null) {\n\t\t\tif(nextNoteAction === 'cut') {\n\t\t\t\t// cut off\n\t\t\t\tthat.noteOff();\n\t\t\t} else {\n\t\t\t\t// continue - don't stop the note but let it \"die away\"\n\t\t\t\t// setting bufferSource to null doesn't stop the sound; we just \"forget\" about it\n\t\t\t\tbufferSource = null;\n\t\t\t}\n\t\t}\n\n\t\tif(bufferSource === null) {\n\t\t\tprepareBufferSource();\n\t\t}\n\t\n\t\tthis.setVolume(volume, when);\n\t\tbufferSource.start(when);\n\n\t\t// Auto note off if not looping, though it can be a little bit inaccurate\n\t\t// (due to setTimeout...)\n\t\tif(!loop && nextNoteAction === 'cut') {\n\t\t\tvar endTime = (when + buffer.duration) * 1000;\n\t\t\t\n\t\t\tsetTimeout(function() {\n\t\t\t\tthat.noteOff();\n\t\t\t}, endTime);\n\t\t}\n\n\t};\n\n\n\tthis.noteOff = function(when) {\n\n\t\twhen = when !== undefined ? when : 0;\n\n\t\tif(bufferSource === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tbufferSource.stop(when);\n\t\tbufferSource = null;\n\n\t};\n\n\t\n\tthis.setVolume = function(value, when) {\n\t\toutput.gain.setValueAtTime(value, when);\n\t};\n\n\t\n}", "function resampleBuffer( inBuffer, inNumSamples, inSampleRate, outSampleRate, callback){\n var o = new OfflineAudioContext(1, inNumSamples, outSampleRate);\n \n // create audio buffer\n var b = o.createBuffer(1, inNumSamples, inSampleRate);\n \n // copy data\n var buf = b.getChannelData(0);\n for (var i = 0; i < inNumSamples; i++) {\n buf[i] = inBuffer.getChannelData(0)[i];\n }\n \n /* Play it from the beginning. */\n var source = o.createBufferSource();\n source.buffer = b;\n source.connect(o.destination);\n source.start(0);\n \n /* Start rendering as fast as the machine can. */\n o.startRendering().then(function(renderedBuffer) {\n callback(renderedBuffer);\n }).catch(function(err) {\n console.log('Rendering failed: ' + err);\n });\n }", "receive(isample) {\n let lastr = this._lastr;\n let lasti = this._lasti;\n\n let space = this._sf.updatex(isample);\n let mark = this._mf.updatex(isample);\n let r = space.r + mark.r;\n let i = space.i + mark.i;\n let x = r * lastr - i * lasti;\n let y = r * lasti + i * lastr;\n this._lastr = r; // save the conjugate\n this._lasti = -i;\n let angle = Math.atan2(y, x); // arg\n let comp = (angle > 0) ? -10.0 : 10.0;\n let sig = this._dataFilter.update(comp);\n // console.log('sig:' + sig + ' comp:' + comp)\n\n this.scopeOut(sig);\n\n let bit = this._bit;\n\n // trace('sig:' + sig)\n if (sig > this._hiHys) {\n bit = false;\n } else if (sig < this._loHys) {\n bit = true;\n }\n\n bit = bit !== this._inverted; // user-settable\n\n this.processBit(bit);\n this._bit = bit;\n }", "synthesizeOutputBlock(outBlock) {\n\n // Get block index for pair and odd buffers\n /*\n We want to get X: the current block to mix\n 0 0 0 X 0 --> Pair block\n X O O O O --> Odd block\n o o o x ... --> Synthesized block (outBlock)\n */\n\n\n let indBlockPair = this._countBlock % this._modIndexBuffer;\n let indBlockOdd = (indBlockPair + this._modIndexBuffer/2) % this._modIndexBuffer;\n\n // TODO: Right now this only works for 50% overlap and an even number of blocks per frame.\n // More modifications would be necessary to include less than 50% overlap and an odd number of blocks per frame. Right now an amplitude modulation would appear for an odd number of blocks per frame (to be tested - AM from 1 to 0.5).\n\n // Iterate over the corresponding block of the synthesized buffers\n for (let i = 0; i<outBlock.length; i++){\n let indPair = i + 128*indBlockPair;\n let indOdd = i + 128*indBlockOdd;\n\n // Hanning window\n // Use hanning window sin^2(pi*n/N)\n let hannPairBValue = Math.pow(Math.sin(Math.PI*indPair/this._frameSize), 2);\n let hannOddBValue = Math.pow(Math.sin(Math.PI*indOdd/this._frameSize), 2);\n //let hannPairBValue = 0.54 - 0.46 * Math.cos(2*Math.PI*indPair/(this._frameSize-1));\n //let hannOddBValue = 0.54 - 0.46 * Math.cos(2*Math.PI*indOdd/(this._frameSize-1));\n // Hanning windowed frames addition\n outBlock[i] = hannPairBValue*this._pairSynthBuffer[indPair] + hannOddBValue*this._oddSynthBuffer[indOdd];\n\n // Debugging\n //outBlock[i] = this._pairBuffer[i];//this._pairSynthBuffer[indPair];//0.5*this._pairSynthBuffer[indPair] + 0.5*this._oddSynthBuffer[indOdd];\n this._block1[i] = this._pairSynthBuffer[indPair];\n this._block2[i] = this._oddSynthBuffer[indOdd];\n }\n\n }", "function impulse(pos,time) {\n position = pos\n updateTime = time\n\n while (impulses.length > 0 && (time - impulses[0].time) > FILTER_INTERVAL) impulses.shift()\n impulses.push({pos:pos,time:time})\n\n if (impulses.length < 2) {\n velocity = [0,0]\n return false\n } else {\n var a = impulses[0]\n var b = impulses[impulses.length-1]\n\n velocity = vdiv((b.time - a.time)/1000,\n vsub(b.pos,a.pos))\n return clamp()\n }\n }", "async initialize() {\n // water impulse:\n //const file = 'https://cdn.glitch.com/c44791c8-02d2-4f00-87fb-fa398dfbec75%2Fwater-swirl.wav?v=1574729613476';\n \n // breath impulse:\n const file = 'https://cdn.glitch.com/c44791c8-02d2-4f00-87fb-fa398dfbec75%2Fbreath.wav?v=1574729612779';\n const response = await fetch(file);\n const arrayBuffer = await response.arrayBuffer();\n this._convolver.buffer = await this._context.decodeAudioData(arrayBuffer);\n }", "constructor(d, audioCtx, source, muted=true, dir=\"vertical\") {\n this.clipping = false;\n this.lastClip = 0;\n this.clipLag = 250;\n this.clipLevel = 250;\n this.mode = MeterMode.RMS;\n this.klipKludge = 0;\n\n this.analyser = audioCtx.createAnalyser();\n this.analyser.fftSize = 256;\n this.analyser.smoothingTimeConstant = 0.8;\n\n this.bufferLength = 128; // this.analyser.frequencyBinCount;\n this.dataArray = new Uint8Array(this.bufferLength);\n //this.dataArray = new Float32Array(this.bufferLength);\n\n\tsource.connect(this.analyser);\n // this.canvas = document.createElement(\"canvas\");\n this.canvas = document.createElement(\"div\");\n this.canvas.setAttribute(\"id\", \"audioCanvas\"+canvases++);\n this.canvas.classList.add(\"audioCanvas\");\n\n //this.canvas.width = d.offsetWidth - 4;\n //this.canvas.height = d.offsetHeight - 26;\n\n // this.canvas.style.position = \"absolute\"\n this.canvas.style.width = d.offsetWidth - 4 +\"px\";\n this.canvas.style.height = d.offsetHeight - 26 +\"px\";\n\n this.height = d.offsetHeight;\n\n //this.canvasCtx = this.canvas.getContext(\"2d\");\n this.dir = dir;\n if (this.dir === \"vertical\") {\n //this.canvas.style.opacity = 0.9;\n }\n if (d) {\n d.appendChild(this.canvas);\n }\n\n this.volume = 0;\n this.averaging = 0.95;\n //this.image = new Image(this.canvas.width, this.canvas.height);\n //this.image.src = \"./images/microphone.png\";\n // this.image.onload = () => this.draw;\n this.draw();\n this.muted = muted;\n }", "function process(Data) {\n source = context.createBufferSource(); // Create Sound Source\n context.decodeAudioData(Data, function (buffer) {\n console.log(buffer)\n source.buffer = buffer;\n source.connect(context.destination);\n source.start(context.currentTime);\n })\n }", "function drawWave() {\n requestAnimationFrame(drawWave);\n analyser.getByteTimeDomainData(dataArray);\n canvasCtx.fillStyle = \"rgb(200, 200, 200)\";\n canvasCtx.fillRect(0, 0, canvas.width, canvas.height);\n canvasCtx.lineWidth = 2;\n canvasCtx.strokeStyle = \"rgb(0, 0, 0)\";\n canvasCtx.beginPath();\n var sliceWidth = canvas.width * 1.0 / bufferLength;\n var x = 0;\n for (var i = 0; i < bufferLength; i++) {\n var v = dataArray[i] / 128.0;\n var y = v * canvas.height / 2;\n if (i === 0) {\n canvasCtx.moveTo(x, y);\n }\n else {\n canvasCtx.lineTo(x, y);\n }\n x += sliceWidth;\n }\n canvasCtx.lineTo(canvas.width, canvas.height / 2);\n canvasCtx.stroke();\n}", "function createAndPlayNoise() {\n if (THREE.AudioContext.state !== \"suspended\")\n {\n window.removeEventListener('touchend', createAndPlayNoise)\n return\n }\n\n var buffer = THREE.AudioContext.createBuffer(1, 1, 22050);\n var source = THREE.AudioContext.createBufferSource();\n source.buffer = buffer;\n source.connect(THREE.AudioContext.destination);\n source.play();\n}", "function sfTone(instrument, pitch, time, duration, volume, pan) {\n const t = time || ctx.currentTime\n const dur = duration || 1\n const p = pitch || 48\n const vol = volume || 1\n const stereo = pan || 0\n const panNode = new StereoPannerNode(ctx, {\n 'pan' : stereo\n })\n panNode.connect(ctx.destination)\n player.loader.decodeAfterLoading(ctx, instrument)\n player.queueWaveTable(ctx, panNode, instrument, t, p, dur, vol)\n}", "function simpleSynth(buf, pitch, pitchFun, formantShift, dontStart) {\n formantShift = formantShift || 1.0;\n var rate = audioCtx.sampleRate;\n var start = audioCtx.currentTime;\n var t = 0;\n var choose = 0;\n var outbuf = audioCtx.createBuffer(1, buf.length, audioCtx.sampleRate);\n var out = outbuf.getChannelData(0);\n for (var i = 0; i < pitch.length-1; i++) {\n var delta = pitch[i][1] ? 1/pitch[i][1] : Math.random() * 0.004 + 0.008;\n \n while (t < pitch[i+1][0]) {\n while (choose < t) choose += delta;\n var from = (t-delta/formantShift) * rate | 0;\n var to = (t+delta/formantShift) * rate | 0;\n for (var j = from; j < to; j++) {\n var w = (j - t*rate) / (delta*rate) * formantShift;\n w = Math.cos(w * Math.PI) * 0.5 + 0.5;\n var pos = choose * rate + (j - from) * formantShift;\n if (pos < buf.length-1) {\n var frac = pos - Math.floor(pos);\n var h = Math.floor(pos);\n out[j] += w * ((1-frac) * buf[h] + frac * buf[h+1]);\n }\n }\n if (pitch[i][1] > 1) {\n t += 1/pitchFun(pitch[i][1]);\n }\n else {\n // unvoiced\n t += delta;\n }\n }\n }\n var n = audioCtx.createBufferSource();\n n.connect(audioCtx.destination);\n n.buffer = outbuf;\n n.onended = function () {\n showProgress(\"finished\");\n };\n if (!dontStart) n.start(start);\n return n;\n}", "function Yin_pitchEstimation(inputBuffer, sampleRate) {\n\t\t\tvar yinBuffer = new Float32Array(Math.floor(inputBuffer.length/2));\n\t\t\tyinBuffer[0] = 1;\n\t\t\tvar runningSum = 0;\n\t\t\tvar pitchInHz = 0.0;\n\t\t\tvar foundTau = false;\n\t\t\tvar minTauValue;\n\t\t\tvar minTau = 0;\n\n\t\t\tfor (var tau=1; tau<Math.floor(inputBuffer.length/2); tau++) {\n\t\t\t\t// Step 1: Calculates the squared difference of the signal with a shifted version of itself.\n\t\t\t\tyinBuffer[tau] = 0;\n\t\t\t\tfor (var i=0; i<Math.floor(inputBuffer.length/2); i++) {\n\t\t\t\t\tyinBuffer[tau] += Math.pow(((inputBuffer[i]-128)/128)-((inputBuffer[i+tau]-128)/128),2);\n\t\t\t\t}\n\t\t\t\t// Step 2: Calculate the cumulative mean on the normalised difference calculated in step 1.\n\t\t\t\trunningSum += yinBuffer[tau];\n\t\t\t\tyinBuffer[tau] = yinBuffer[tau]*(tau/runningSum);\n\n\t\t\t\t// Step 3: Check if the current normalised cumulative mean is over the threshold.\n\t\t\t\tif (tau > 1) {\n\t\t\t\t\tif (foundTau) {\n\t\t\t\t\t\tif (yinBuffer[tau] < minTauValue) {\n\t\t\t\t\t\t\tminTauValue = yinBuffer[tau];\n\t\t\t\t\t\t\tminTau = tau;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse break;\n\t\t\t\t\t}\n\t\t\t\t\telse if (yinBuffer[tau] < yinThreshold) {\n\t\t\t\t\t\tfoundTau = true;\n\t\t\t\t\t\tminTau = tau;\n\t\t\t\t\t\tminTauValue = yinBuffer[tau];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (minTau == 0) {\n\t\t\t\tyinProbability = 0;\n\t\t\t\tpitchInHz = 0.0;\n\t\t\t} else {\n\t\t\t\t// Step 4: Interpolate the shift value (tau) to improve the pitch estimate.\n\t\t\t\tminTau += (yinBuffer[minTau+1]-yinBuffer[minTau-1])/(2*((2*yinBuffer[minTau])-yinBuffer[minTau-1]-yinBuffer[minTau+1]));\n\t\t\t\tpitchInHz = sampleRate/minTau;\n\t\t\t\tyinProbability = 1-minTauValue;\n\t\t\t}\n\n\t\t\treturn pitchInHz;\n\t\t}", "constructor(sampleRate) {\n this.sampleRate = sampleRate;\n this.gain = 1;\n this.reset();\n this.clear();\n }", "function processAudio(e) {\n let buffer = e.inputBuffer.getChannelData(0);\n let out = e.outputBuffer.getChannelData(0);\n let amp = 0;\n\n // Iterate through buffer to get the max amplitude for this frame\n for (let i = 0; i < buffer.length; i++) {\n let loud = Math.abs(buffer[i]);\n if (loud > amp) {\n amp = loud;\n }\n // Write input samples to output unchanged\n out[i] = buffer[i];\n }\n\n // Calc the amp : x,y blur effect and apply it\n amp = amp * 2 + ',0';\n blurFilter.setAttribute(\"stdDeviation\", amp);\n}", "function tone(freq, duration, sampleRate) {\n duration = sampleRate * duration;\n\n var curve = [];\n for (var i=0; i < duration; i++) {\n curve.push(Math.sin((2 * Math.PI) * freq * (i / sampleRate)));\n }\n\n return curve;\n}", "function createFadeBuffer(context, activeTime, fadeTime) {\n\t var length1 = activeTime * context.sampleRate;\n\t var length2 = (activeTime - 2*fadeTime) * context.sampleRate;\n\t var length = length1 + length2;\n\t var buffer = context.createBuffer(1, length, context.sampleRate);\n\t var p = buffer.getChannelData(0);\n\t \n\t var fadeLength = fadeTime * context.sampleRate;\n\t\n\t var fadeIndex1 = fadeLength;\n\t var fadeIndex2 = length1 - fadeLength;\n\t \n\t // 1st part of cycle\n\t for (var i = 0; i < length1; ++i) {\n\t var value;\n\t \n\t if (i < fadeIndex1) {\n\t value = Math.sqrt(i / fadeLength);\n\t } else if (i >= fadeIndex2) {\n\t value = Math.sqrt(1 - (i - fadeIndex2) / fadeLength);\n\t } else {\n\t value = 1;\n\t }\n\t \n\t p[i] = value;\n\t }\n\t\n\t // 2nd part\n\t for (var i = length1; i < length; ++i) {\n\t p[i] = 0;\n\t }\n\t \n\t \n\t return buffer;\n\t}", "onProcess(audioProcessingEvent) {\n\n this.blocked = true;\n this.nCall++;\n\n let inputBuffer = audioProcessingEvent.inputBuffer;\n let outputBuffer = audioProcessingEvent.outputBuffer;\n\n for (let chIdx = 0; chIdx < outputBuffer.numberOfChannels; chIdx++) {\n let inputData = inputBuffer.getChannelData(chIdx);\n let outputData = outputBuffer.getChannelData(chIdx);\n\n if (!this.bypass) {\n this.PreStageFilter[chIdx].process(inputData, outputData);\n } else {\n // just copy\n for (let sample = 0; sample < inputBuffer.length; sample++) {\n outputData[sample] = inputData[sample];\n }\n }\n } // next channel\n\n let time = this.nCall * inputBuffer.length / this.sampleRate;\n let gl = this.calculateLoudness(outputBuffer);\n this.callback(time, gl);\n\n this.blocked = false;\n }", "function FFT(bufferSize, sampleRate) {\n\t\tthis.bufferSize = bufferSize;\n\t\tthis.sampleRate = sampleRate;\n\t\tthis.spectrum = new Float32Array(bufferSize/2);\n\t\tthis.real = new Float32Array(bufferSize);\n\t\tthis.imag = new Float32Array(bufferSize);\n\t\tthis.reverseTable = new Uint32Array(bufferSize);\n\t\tthis.sinTable = new Float32Array(bufferSize);\n\t\tthis.cosTable = new Float32Array(bufferSize);\n\n\t\tvar limit = 1,\n\t\t\tbit = bufferSize >> 1;\n\n\t\twhile ( limit < bufferSize ) {\n\t\t\tfor ( var i = 0; i < limit; i++ ) {\n\t\t\t\tthis.reverseTable[i + limit] = this.reverseTable[i] + bit;\n\t\t\t}\n\n\t\t\tlimit = limit << 1;\n\t\t\tbit = bit >> 1;\n\t\t}\n\n\t\tfor ( var i = 0; i < bufferSize; i++ ) {\n\t\t\tthis.sinTable[i] = Math.sin(-Math.PI/i);\n\t\t\tthis.cosTable[i] = Math.cos(-Math.PI/i);\n\t\t}\n\t}", "function writeReceivedData() {\n // console.log('writeReceivedData');\n\n // how many complex samples are shared by all buffers\n let thisRun = _.min(datas.map((x)=>x.length));\n\n let a,b; // indices into the phase matrix\n\n for(let rxradio = 0; rxradio < radioCount; rxradio++) {\n \n let thebuffer = new ArrayBuffer(thisRun*8*2); // in bytes\n let uint8_view = new Uint8Array(thebuffer);\n let float64_view = new Float64Array(thebuffer);\n\n for(let i = 0; i < thisRun; i++) {\n\n let sam = mt.complex(\n 0.0075*Math.random()-0.00375,\n 0.0075*Math.random()-0.00375\n );\n\n for(let txradio = 0; txradio < radioCount; txradio++) {\n if(rxradio === txradio) {\n continue; // FIXME this forces 'hearself' to false\n }\n\n [a,b] = mutil.lowerTriangular(txradio,rxradio);\n\n let phasor = matrix[a][b];\n\n sam = sam.add( datas[txradio][i].mul(phasor) );\n // console.log('Phasor between ' + rxradio + ' and ' + txradio + ' is ' + phasor.toString());\n\n } // for tx radio\n\n // sam is now a complex object with contributions from each radio\n // we convert it into float,float (real,imag)\n\n float64_view[i*2 ] = sam.re;\n float64_view[(i*2)+1] = sam.im;\n\n // if(rxradio === 1 && i < 16) {\n // console.log(sam.re);\n // }\n\n } // for sample of rx radio\n\n // console.log('done with rx for radio ' + rxradio);\n // console.log(float64_view);\n\n // push data back into the radio\n // console.log(\"r\" + rxradio + \" \" + uint8_view);\n r[rxradio].rx.ours.push(uint8_view);\n\n } // for rx radio\n\n let unblockSystem = () => {\n\n // second pass to cleanup and callback\n for(let rxradio = 0; rxradio < radioCount; rxradio++) {\n var fncopy = outstandingCbs[rxradio]; // copy the callback\n outstandingCbs[rxradio] = undefined; // wipe out the entry, this is for writeCompleted()\n datas[rxradio] = datas[rxradio].slice(thisRun); // delete our copy of the data\n\n // call the callback, this will unblock the incoming stream for this radio\n // seems like this needs to be inside setImmediate or else streams will get data before this loop gets\n // to the next iteration\n setImmediate(fncopy);\n }\n }\n\n\n\n\n now = Date.now();\n\n sampleCountAccumulated += thisRun;\n\n const averagePeriod = 100; // ms\n\n let delayBy = 0;\n\n // how many times has this function been called?\n if( timesWrittenBack > 0) {\n if( rateLimit != 0 ) {\n let deltaMs = now - then;\n if( deltaMs >= averagePeriod ) {\n\n // console.log(now + ', ' + sampleCountAccumulated);\n // how many samples did we chew through since last check\n let deltaSamples = sampleCountAccumulated - sampleCountLatched;\n // how many should we expect if perfectly at rate limit\n let expectedForPeriod = deltaMs * (rateLimit/1000);\n // console.log('expected: ' + expectedForPeriod);\n // console.log('deltaMs: ' + deltaMs + ' samples since last check: ' + deltaSamples + ' samples at ' + sampleCountAccumulated/125E6);\n\n if( deltaSamples > expectedForPeriod ) {\n let rateForThisPeriod = deltaSamples / averagePeriod; // in samples per ms\n // how many samples did we do extra\n let overage = deltaSamples - expectedForPeriod;\n\n let desiredDelay = overage / rateForThisPeriod;\n\n let desiredDelayRound = Math.round(desiredDelay);\n\n if( desiredDelayRound > 0 ) {\n delayBy = desiredDelayRound;\n }\n\n // console.log('overage: ' + overage + ' delay by ' + desiredDelay + ' ms at rate ' + rateForThisPeriod);\n }\n\n then = now;\n sampleCountLatched = sampleCountAccumulated;\n }\n }\n } else {\n\n then = now;\n }\n\n if( delayBy === 0 ) {\n unblockSystem();\n } else {\n setTimeout(unblockSystem, delayBy);\n }\n\n // console.log('writeReceivedData exiting');\n\n timesWrittenBack++;\n\n}", "function updatePitch(timestamp) { // confusing argument, this is mainloop\n\n if(timestamp < lastFrameTimeMs + (1000 / maxFPS)) {\n\twindow.requestAnimationFrame(updatePitch);\n\treturn;\n }\n\n timeDelta = timestamp - lastFrameTimeMs; \n lastFrameTimeMs = timestamp;\n\n var numUpdateSteps = 0;\n\n // oh boy...\n while(timeDelta >= timestep) {\n\n\tanalyser.getFloatTimeDomainData( buf );\n\tvar pitch = audio.autoCorrelate( buf, audioContext.sampleRate );\n\n\tlet pb = mic.pitchBuffer,\n\t pl = pb.length,\n\t prevPitch = !! pl ? pb[pl-1] : 0;\n\n\t// pitch was garbled, or inhuman\n\tif(pitch == -1 || pitch > 4700) // world record is 4186\n\t pitch = prevPitch;\n\n\t// an abrupt change just be noise\n\t// we give a grace period of 3 samples\n\t// meanwhile feed them the last detected pitch\n\t// improvement: calculate where their voice is going\n\tlet abrupt = Math.abs(prevPitch-pitch) > sensibleChange;\n\tif(abrupt) {\n\t if(mic.mightStillBeNoise) {\n\t\tmic.noiseLessLikely();\n\t\tpitch = prevPitch; // assume no change\n\t } else mic.resetNoiseDetection(pitch);\n\t}\n\n\tpitch = mic.smoothPitch(pitch);\n\n\t// update but do not render\n\thandlePitch(pitch, timeDelta, false);\n\n\n\t// oh boy\n\ttimeDelta -= timestep;\n\tif(++numUpdateSteps >= 240) {\n\t panic();\n\t break;\n\t}\n }\n\n // update and render because I can't \"just render\" atm\n handlePitch(pitch, timeDelta, true);\n\n\n rafID = window.requestAnimationFrame( updatePitch );\n\n}", "update() {\n const data = this.sound.waveformData;\n const ctx = this.canvas.getContext('2d');\n\n ctx.clearRect(0, 0, Infinity, Infinity);\n\n for (let x = 0; x < this.canvas.offsetWidth; x++) {\n\n const sampleInd = Math.floor(x * data.width / this.canvasWidth);\n const value = Math.floor(this.canvasHeight * data.samples[sampleInd] / data.height / 2);\n\n for (let y = value; y < this.canvasHeight - value; y++) {\n ctx.fillStyle = x < this.sound.currentTime / this.sound.duration * this.canvasWidth ? '#f60' : '#333';\n ctx.fillRect(x, y, 1, 1);\n }\n }\n }", "function createBufferSource(){\n\t\tvar temp = scope.audioContext.createBufferSource();\n\t\ttemp.onended = function(){\n\t\t\tthis.stop();\n\t\t\tthis.disconnect();\n\t\t}\n\t\treturn temp;\n\t}", "function timeToSampleFrame(time, sampleRate) {\n return Math.floor(0.5 + time * sampleRate);\n}", "function timeToSampleFrame(time, sampleRate) {\n return Math.floor(0.5 + time * sampleRate);\n}", "function setSampleRate(\r\n sampleRate)\r\n {\r\n allocateStreamBuffers(sampleRate, numChannels);\r\n }", "function Resampler(fromSampleRate, toSampleRate, channels, inputBuffer) {\n //Input Sample Rate:\n this.fromSampleRate = +fromSampleRate;\n //Output Sample Rate:\n this.toSampleRate = +toSampleRate;\n //Number of channels:\n this.channels = channels | 0;\n //Type checking the input buffer:\n if (typeof inputBuffer != \"object\") {\n throw(new Error(\"inputBuffer is not an object.\"));\n }\n if (!(inputBuffer instanceof Array) && !(inputBuffer instanceof Float32Array) && !(inputBuffer instanceof Float64Array)) {\n throw(new Error(\"inputBuffer is not an array or a float32 or a float64 array.\"));\n }\n this.inputBuffer = inputBuffer;\n //Initialize the resampler:\n this.initialize();\n }", "function renderAudio() {\n var now = audioContext.currentTime;\n \n for (var i = 0; i < NUMBER_OF_SOUND_SOURCES; i++)\n {\n if (meshes[i] != null)\n {\n meshes[i].updateMatrixWorld();\n }\n }\n\n\n if (soundsPlaying)\n {\n if ((loopCount % 2) === 0)\n {\n for (var i = 0; i < NUMBER_OF_SOUND_SOURCES; i++)\n {\n if (waitTimes[i] < (now - prevTime[i]))\n {\n \n if (onOff[i])\n {\n // Play a sound from this soundsource chosen by random walk\n \n waitTimes[i] = playRandomSound(i); // playRandomSound returns the duration of the loaded sample\n }\n else\n {\n onOff[i] = true;\n waitTimes[i] = ((Math.random() * WAIT_MAX) + WAIT_OFFSET);\n //console.log(waitTimes[i]);\n\n }\n prevTime[i] = now;\n }\n }\n }\n loopCount++;\n } \n }", "toMuLaw() {\n this.assure16Bit_();\n let output = new Int16Array(this.data.samples.length / 2);\n unpackArrayTo(this.data.samples, this.dataType, output);\n this.fromScratch(\n this.fmt.numChannels,\n this.fmt.sampleRate,\n '8m',\n alawmulaw.mulaw.encode(output),\n {container: this.correctContainer_()});\n }", "function playSound(buffer, time) {\n\t\t\tvar source = context.createBufferSource();\n\t\t\tsource.buffer = buffer;\n\t\t\tsource.connect(context.destination);\n\t\t\tsource.start(time);\n\t\t}", "function makeSamples(groove, color, data){\n\n\tvar oneSecond = 44100;\n\tvar loop = false;\n\tvar repeats = 4;\n\tvar repeated = 0;\n\tvar PI = Math.PI;\n\n\tvar maxSamples = (groove.duration * oneSecond ) / 1000 ;\t\n var instrumentType = \"sin\";\n var delay = false;\n if (color == 0) {\n\tdelay = true;\n } \n else if (color == 1) {\n } \n else if (color == 2) {\n\tinstrumentType = \"sqr\";\n } \n else if (color == 3) {\n\tinstrumentType = \"sqr\";\n } \n else if (color == 4) {\n\tinstrumentType = \"sqr\";\n } \n else if (color == 5) {\n\tinstrumentType = \"sqr\";\n } \n else if (color == 6) {\n\tinstrumentType = \"sqr\";\n\tdelay = true;\n } \n else if (color == 7) {\n\tinstrumentType = \"saw\";\n } \n else if (color == 8) {\n\tinstrumentType = \"saw\";\n } \n else if (color == 9) {\n\tinstrumentType = \"saw\";\n } \n else if (color == 10) {\n\tinstrumentType = \"saw\";\n } \n\n var freqs = data[0];\n var times = data[1];\n\tdebugfreqs = freqs;\n \tdebugtimes = times;\n\n var samples = [];\n ii = 0;\n var tcounter = 0;\n for (var j = 0; j < freqs.length - 1; j++) {\n\t\tif (j == 0 && times[0] > groove.startLine){\n\t\t\tvar freqDur = times[j] / groove.lineLength;\n\t \n\t\t\tfreqDur = freqDur * groove.duration;\n\t\t\tfreqDur = freqDur * 44100;\n\t\t\tfreqDur = Math.floor(freqDur / 1000);\n\t \n\t \tfor (var i = 0; i < freqDur; i++) {\n\t \t var t = i / oneSecond; \n\t \t samples[ii] = 0;\n\t \t ii++;\n\t\t }\n\t\t}\n var frequency = freqs[j];\n//\tif (freqs.length > j + 1 && freqs[j + 1] == 0){\n//\t\tfrequency = 0;\n//\t}\n\n var freqDur = times[j + 1] / groove.lineLength;\n \n freqDur = freqDur * groove.duration;\n freqDur = freqDur * 44100;\n freqDur = Math.floor(freqDur / 1000);\n\n// \tfor (var i = 0; i < freqDur; i++){\n\t\tvar i = 0;\n while (true){\n var t = i / oneSecond; // time from 0 to 1\n if (frequency == 0){\n samples[ii] = 0;\n }\n\t\t else if (instrumentType == \"sin\"){\n\t\t samples[ii] = Math.sin(frequency * 2 * PI * t); // wave equation (between -1,+1)\n\t\t }\n else if (instrumentType == \"sqr\") {\n\t\t\t if (Math.sin(frequency * 2 * PI * t) > 0){\n\t\t\t\t\tsamples[ii] = 1; } else { samples[ii] = -1;\n\t\t\t\t}\n\t\t }\n else if (instrumentType == \"saw\") {\n \tsamples[ii] = 1 - ((frequency*t)%1);\n\t\t }\n samples[ii] = samples[ii] * 0.25;\n\n\t\t\tif (i >= freqDur){\n\t\t\t\tif (instrumentType == \"sin\"){\n\t\t\t\t\tif (samples[ii] == 0 || (samples[ii -1] < samples[ii] && samples[ii] < 0.01 && samples[ii] > -0.01)){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\t\n\t\t\t}\n ii++;\n if (maxSamples > 0 && ii >= maxSamples){\n\t\t\t\tbreak;\n\t\t }\n\t\t i++;\n }\n if (maxSamples > 0 && ii >= maxSamples){\n\t\t\tbreak;\n\t }\n }\n if (maxSamples == 0){\n\t\tmaxSamples = ii;\n }\n else {\n\t\twhile (ii < maxSamples){\n\t \t\tsamples[ii] = 0;\n\t \tii++;\n\t\t}\n }\n//\tdocument.write(ii);\n//\tdocument.write(\"<br/>\");\n// var delayLine = new Array;\n// var pointer = 0;\n// var delayLength = oneSecond / 2;\n// for (var ijj = 0; ijj < groove.lineLength; ijj++){\n//\t\tdelayLine[ijj] = 0;\n// }\n for (var repeat = 1 ; repeat < repeats; repeat++){\n for (var jj = 0 ; jj < ii ; jj++){\n samples[jj + ii * repeat] = samples[jj];\n\t if (delay){\n//\t\tsamples[jj + ii * repeat] = samples[jj + ii * repeat] - 0.5*delayLine[pointer];\n//\t\tdelayLine[pointer] = samples[jj + ii * repeat];\n//\t\tpointer = (pointer+1)%lineLength;\n }\n\t }\n\t}\n return samples;\n}", "constructor({audioCtx, fftSize, carFreq, modAmpl, modFreq, visualCtx}) {\n this.audioCtx = audioCtx;\n this,fftSize = fftSize;\n this.carFreq = carFreq;\n this.modAmpl = modAmpl;\n this.modFreq = modFreq;\n this.visualCtx = visualCtx;\n this.play = false;\n\n\n this.animate;\n this.analyserNode = audioCtx.createAnalyser();\n this.analyserNode.smoothingTimeConstant = 0.0;\n this.analyserNode.fftSize = fftSize;\n\n // Create the array for the data values\n this.frequencyArray = new Uint8Array(this.analyserNode.frequencyBinCount);\n\n // Uses the chroma.js library by Gregor Aisch to create a color gradient\n // download from https://github.com/gka/chroma.js\n this.colorScale = new chroma.scale('Spectral').domain([1,0]);\n // Global Variables for Drawing\n this.column = 0;\n this.canvasWidth = 800;\n this.canvasHeight = 256;\n }", "function ProcessFrames(mem48, speed, frequency, pitches, amplitude, sampledConsonantFlag) {\n const CombineGlottalAndFormants = (phase1, phase2, phase3, Y) => {\n let tmp; // unsigned int\n tmp = multtable[sinus[phase1] | amplitude[0][Y]];\n tmp += multtable[sinus[phase2] | amplitude[1][Y]];\n tmp += tmp > 255 ? 1 : 0; // if addition above overflows, we for some reason add one;\n tmp += multtable[rectangle[phase3] | amplitude[2][Y]];\n tmp += 136;\n tmp >>= 4; // Scale down to 0..15 range of C64 audio.\n\n Output(0, tmp & 0xf);\n };\n\n const RenderSample = (mem66, consonantFlag, mem49) => {\n const RenderVoicedSample = (hi, off, phase1) => {\n hi = hi & 0xFFFF; // unsigned short\n off = off & 0xFF; // unsigned char\n phase1 = phase1 & 0xFF; // unsigned char\n do {\n let sample = sampleTable[hi+off];\n let bit = 8;\n do {\n if ((sample & 128) !== 0) {\n Output(3, 26);\n } else {\n Output(4, 6);\n }\n sample <<= 1;\n } while(--bit !== 0);\n off++;\n } while (((++phase1) & 0xFF) !== 0);\n\n return off;\n };\n\n const RenderUnvoicedSample = (hi, off, mem53) => {\n hi = hi & 0xFFFF; // unsigned short\n off = off & 0xFF; // unsigned char\n mem53 = mem53 & 0xFF; // unsigned char\n do {\n let bit = 8;\n let sample = sampleTable[hi+off];\n do {\n if ((sample & 128) !== 0) {\n Output(2, 5);\n }\n else {\n Output(1, mem53);\n }\n sample <<= 1;\n } while (--bit !== 0);\n } while (((++off) & 0xFF) !== 0);\n };\n\n // mem49 == current phoneme's index - unsigned char\n\n // mask low three bits and subtract 1 get value to\n // convert 0 bits on unvoiced samples.\n let hibyte = (consonantFlag & 7) - 1;\n\n // determine which offset to use from table { 0x18, 0x1A, 0x17, 0x17, 0x17 }\n // T, S, Z 0 0x18\n // CH, J, SH, ZH 1 0x1A\n // P, F*, V, TH, DH 2 0x17\n // /H 3 0x17\n // /X 4 0x17\n\n let hi = hibyte * 256; // unsigned short\n // voiced sample?\n let pitch = consonantFlag & 248; // unsigned char\n if(pitch === 0) {\n // voiced phoneme: Z*, ZH, V*, DH\n pitch = pitches[mem49 & 0xFF] >> 4;\n return RenderVoicedSample(hi, mem66, pitch ^ 255);\n }\n RenderUnvoicedSample(hi, pitch ^ 255, tab48426[hibyte]);\n return mem66;\n };\n\n let speedcounter = new Uint8(72);\n let phase1 = new Uint8();\n let phase2 = new Uint8();\n let phase3 = new Uint8();\n let mem66 = new Uint8();\n let Y = new Uint8();\n let glottal_pulse = new Uint8(pitches[0]);\n let mem38 = new Uint8(glottal_pulse.get() - (glottal_pulse.get() >> 2)); // mem44 * 0.75\n\n while(mem48) {\n let flags = sampledConsonantFlag[Y.get()];\n\n // unvoiced sampled phoneme?\n if ((flags & 248) !== 0) {\n mem66.set(RenderSample(mem66.get(), flags, Y.get()));\n // skip ahead two in the phoneme buffer\n Y.inc(2);\n mem48 -= 2;\n speedcounter.set(speed);\n } else {\n CombineGlottalAndFormants(phase1.get(), phase2.get(), phase3.get(), Y.get());\n\n speedcounter.dec();\n if (speedcounter.get() === 0) {\n Y.inc(); //go to next amplitude\n // decrement the frame count\n mem48--;\n if(mem48 === 0) {\n return;\n }\n speedcounter.set(speed);\n }\n\n glottal_pulse.dec();\n\n if(glottal_pulse.get() !== 0) {\n // not finished with a glottal pulse\n\n mem38.dec();\n // within the first 75% of the glottal pulse?\n // is the count non-zero and the sampled flag is zero?\n if((mem38.get() !== 0) || (flags === 0)) {\n // reset the phase of the formants to match the pulse\n phase1.inc(frequency[0][Y.get()]);\n phase2.inc(frequency[1][Y.get()]);\n phase3.inc(frequency[2][Y.get()]);\n continue;\n }\n\n // voiced sampled phonemes interleave the sample with the\n // glottal pulse. The sample flag is non-zero, so render\n // the sample for the phoneme.\n mem66.set(RenderSample(mem66.get(), flags, Y.get()));\n }\n }\n\n glottal_pulse.set(pitches[Y.get()]);\n mem38.set(glottal_pulse.get() - (glottal_pulse.get() >> 2)); // mem44 * 0.75\n\n // reset the formant wave generators to keep them in\n // sync with the glottal pulse\n phase1.set(0);\n phase2.set(0);\n phase3.set(0);\n }\n }", "function CombFilter (sampleRate, delaySize, feedback, damping) {\n\tvar\tself\t= this;\n\tself.sampleRate\t= sampleRate;\n\tself.buffer\t= new Float32Array(isNaN(delaySize) ? 1200 : delaySize);\n\tself.bufferSize\t= self.buffer.length;\n\tself.feedback\t= isNaN(feedback) ? self.feedback : feedback;\n\tself.damping\t= isNaN(damping) ? self.damping : damping;\n\tself.invDamping\t= 1 - self.damping;\n}", "function create_synth(){\n var bus_num = create_new_bus(context.destination);\n\tadd_osc(bus_num, \"sawtooth\");\n\tadd_osc(bus_num, \"square\");\n add_osc(bus_num, \"sawtooth\");\n \n\tadd_osc(bus_num, \"sine\");\n\tadd_convolution(bus_num, \"snd/imp/impulse.wav\");\n\tadd_ADHSR_env(bus_num, 0, 0.2, 0.05, 0.5, 0.5);\n\tadd_filter(bus_num)\n\tdry_wet(0, 1, 100);\n\t\n set_bus_gain(bus_num, 0.03);\n}", "function doSample(event) {\n var now = Date.now();\n if (lastSampleTimestamp <= 0){\n lastSampleTimestamp = now;\n return; \n }\n var deltaSec = (now - lastSampleTimestamp)/1000;\n\n\n if (sampleRateSamples > 0){\n //Use the first several samples to calculate the device's sample rate\n if (rawSampleRate == null) {\n rawSampleRate = 1 / deltaSec;\n } else {\n rawSampleRate = (rawSampleRate + (1 / deltaSec))/2; //Hz \n }\n sampleRateSamples--;\n\n } else if (sampleRateSamples == 0){\n //We got all our device sample-rate related readings, \n //now calculate the sample-rate related parameters\n sampleIntervalMS = 1000 / rawSampleRate;\n\n var destSampleRate = 2*options.max_stride_freq;\n samplesToSkip = Math.floor(rawSampleRate / destSampleRate) - 1;\n sampleIntervalMS *= (samplesToSkip+1);\n actualSampleRate = 1000/sampleIntervalMS; //Hz\n amplitudeCheckSamples = Math.ceil(actualSampleRate); //look a second back\n\n //store first sample\n var datum = event.accelerationIncludingGravity[options.axis] || 0.5;\n shift(samples, datum);\n\n sampleRateSamples--;\n\n } else {\n //normal measurments\n if (samplesSkipped < samplesToSkip) {\n samplesSkipped++;\n return;\n }\n samplesSkipped = 0;\n\n var datum = event.accelerationIncludingGravity[options.axis] || 0.5;\n\n if (samples[samples.length-1] != 0){ //TODO\n //integrate to get a velocity sample\n var velocity = vSamples[vSamples.length-1] + (datum - samples[samples.length-1])*sampleIntervalMS/1000;\n shift(vSamples, velocity);\n }\n\n var smoothed = datum;//smooth(samples[samples.length-1], datum, options.smooth_alpha);\n shift(samples, smoothed);\n\n var freq = -1;\n switch (options.algorithm) {\n case 'fft':\n freq = getFreqFft(samples);\n break;\n case 'zero-cross':\n freq = getFreqCross(samples);\n break;\n case 'zero-cross-v':\n freq = getFreqCross(vSamples);\n break;\n }\n\n var spm = Math.round(freq*60);\n if (spm > lastSpm) {\n //rising (usually slower than falling)\n spm = Math.round(smooth(lastSpm, spm, options.smooth_alpha_rising));\n } else {\n //falling (it's possible to stop very quickly)\n spm = Math.round(smooth(lastSpm, spm, options.smooth_alpha_falling));\n }\n lastSpm = spm;\n }\n \n lastSampleTimestamp = now;\n }", "function Sonic(\r\n sampleRate,\r\n numChannels)\r\n {\r\n allocateStreamBuffers(sampleRate, numChannels);\r\n speed = 1.0;\r\n pitch = 1.0;\r\n volume = 1.0;\r\n rate = 1.0;\r\n oldRatePosition = 0;\r\n newRatePosition = 0;\r\n useChordPitch = false;\r\n quality = 0;\r\n }", "function firstBufferLoader(buffer)\n {\n \n var index = curSoundSource;\n // Create a new sound so we can have a new sound buffer\n sounds[index] = new THREE.PositionalAudio( listener );\n // sounds[index].setPanningModel(PAN_MODEL);\n sounds[index].setFilter(soundGains[index]);\n // sounds[index].setRolloffFactor(2);\n\n meshes[index] = new THREE.Mesh(sphere, material_spheres[index] );\n meshes[index].position.set( SOUND_POSITIONS[index][0], SOUND_POSITIONS[index][1], SOUND_POSITIONS[index][2] );\n //scene.add( meshes[index+10] );\n\n sounds[index].setBuffer(buffer);\n sounds[index].setRefDistance(REF_DIST);\n sounds[index].setLoop(false);\n sounds[index].startTime = 0;\n sounds[index].setPlaybackRate(1);\n sounds[index].panner.connect(convolver);\n meshes[index].add(sounds[index]);\n analysers[index] = new THREE.AudioAnalyser(sounds[index], FFTSize);\n \n // Add the sound to the object map\n loadedSounds[curSoundFile] = sounds[index];\n sounds[index].play();\n //debugAudioLog(curSoundSource);\n curSoundSource++;\n }", "function moveNewSamplesToPitchBuffer(\r\n originalNumOutputSamples)\r\n {\r\n var numSamples = numOutputSamples - originalNumOutputSamples;\r\n\r\n if(numPitchSamples + numSamples > pitchBufferSize) {\r\n pitchBufferSize += (pitchBufferSize >> 1) + numSamples;\r\n pitchBuffer = resize(pitchBuffer, pitchBufferSize);\r\n }\r\n move(pitchBuffer, numPitchSamples, outputBuffer, originalNumOutputSamples, numSamples);\r\n numOutputSamples = originalNumOutputSamples;\r\n numPitchSamples += numSamples;\r\n }", "toMuLaw() {\r\n this.assure16Bit_();\r\n /** @type {!Int16Array} */\r\n let output = new Int16Array(this.data.samples.length / 2);\r\n unpackArrayTo(this.data.samples, this.dataType, output);\r\n this.fromScratch(\r\n this.fmt.numChannels,\r\n this.fmt.sampleRate,\r\n '8m',\r\n alawmulaw.mulaw.encode(output),\r\n {container: this.correctContainer_()});\r\n }", "function updateBuffers() {\n \n triangleVerticestop[0] = triangleVerticestop[0] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticestop[3] = triangleVerticestop[3] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticestop[6] = triangleVerticestop[6] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20));\n triangleVerticestop[9] = triangleVerticestop[9] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20));\n triangleVerticestop[12] = triangleVerticestop[12] -0.03*Math.sin(2*Math.PI*((framecount+5)/20)); //repeat vetex, should be the same pace with the bommon fan\n triangleVerticestop[15] = triangleVerticestop[15] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20));\n triangleVerticestop[18] = triangleVerticestop[18] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticestop[21] = triangleVerticestop[21] +0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n\n \n \n triangleVerticesmid[0] = triangleVerticesmid[0] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[3] = triangleVerticesmid[3] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[6] = triangleVerticesmid[6] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[9] = triangleVerticesmid[9] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[15] = triangleVerticesmid[15] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[12] = triangleVerticesmid[12] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0)); //repeat vetex, should be the same pace with the top fan\n triangleVerticesmid[18] = triangleVerticesmid[18] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[21] = triangleVerticesmid[21] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n\n //update the top buffer new positions\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffertop);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVerticestop), gl.DYNAMIC_DRAW);\n vertexPositionBuffertop.itemSize = 3;\n vertexPositionBuffertop.numberOfItems = 8;\n //update the bottom buffer new positions\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffermid);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVerticesmid), gl.DYNAMIC_DRAW);\n vertexPositionBuffermid.itemSize = 3;\n vertexPositionBuffermid.numberOfItems = 8;\n}", "function channelEffects() {\n\n 'use strict';\n\n var\n\n id = 0,\n context,\n\n zeroValue = 0.00000000000000001,\n\n createClass, // defined in util.js\n getSample, // defined in instrument_manager.js\n\n Reverb,\n Panner,\n Panner2,\n Delay,\n BiQuadFilter,\n Compressor;\n\n\n function Effect(config) {\n this.id = 'FX' + id++ + '' + new Date().getTime();\n this.type = config.type;\n this.buffer = config.buffer;\n this.config = config;\n\n this.bypass = false;\n this.amount = 0;//0.5;\n\n this.output = context.createGainNode();\n this.wetGain = context.createGainNode();\n this.dryGain = context.createGainNode();\n\n this.output.gain.value = 1;\n this.wetGain.gain.value = this.amount;\n this.dryGain.gain.value = 1 - this.amount;\n }\n\n\n Effect.prototype.setInput = function (input) {\n // input.connect(this.node);\n // return;\n\n // dry channel\n input.connect(this.dryGain);\n this.dryGain.connect(this.output);\n\n // wet channel\n input.connect(this.node);\n this.node.connect(this.wetGain);\n this.wetGain.connect(this.output);\n };\n\n /*\n Effect.prototype.setOutput = function(output){\n this.output.disconnect(0);\n this.output.connect(output);\n };\n */\n\n Effect.prototype.setAmount = function (value) {\n /*\n this.amount = value < 0 ? 0 : value > 1 ? 1 : value;\n var gain1 = Math.cos(this.amount * 0.5 * Math.PI),\n gain2 = Math.cos((1.0 - this.amount) * 0.5 * Math.PI);\n this.gainNode.gain.value = gain2 * this.ratio;\n */\n\n this.amount = value < 0 ? 0 : value > 1 ? 1 : value;\n this.wetGain.gain.value = this.amount;\n this.dryGain.gain.value = 1 - this.amount;\n //console.log('wet',this.wetGain.gain.value,'dry',this.dryGain.gain.value);\n };\n\n\n Effect.prototype.copy = function () {\n switch (this.type) {\n case 'reverb':\n return new Reverb(this.config);\n case 'panner':\n return new Panner(this.config);\n case 'panner2':\n return new Panner2(this.config);\n case 'delay':\n return new Delay(this.config);\n case 'compressor':\n return new Compressor(this.config);\n }\n };\n\n\n sequencer.createReverb = function (id) {\n var buffer = getSample(id);\n if (buffer === false) {\n console.warn('no reverb with id', id, 'loaded');\n return false;\n }\n var config = {\n type: 'reverb',\n buffer: buffer\n };\n return new Reverb(config);\n };\n\n\n sequencer.createPanner = function (config) {\n config = config || {};\n config.type = 'panner';\n return new Panner(config);\n };\n\n\n sequencer.createPanner2 = function (config) {\n config = config || {};\n config.type = 'panner2';\n return new Panner2(config);\n };\n\n\n sequencer.createDelay = function (config) {\n config = config || {};\n config.type = 'delay';\n return new Delay(config);\n };\n\n\n sequencer.createCompressor = function (config) {\n config = config || {};\n config.type = 'compressor';\n return new Compressor(config);\n };\n\n\n sequencer.createBiQuadFilter = function (config) {\n config = config || {};\n config.type = 'biquadfilter';\n return new BiQuadFilter(config);\n };\n\n\n sequencer.protectedScope.addInitMethod(function () {\n context = sequencer.protectedScope.context;\n createClass = sequencer.protectedScope.createClass;\n getSample = sequencer.getSample;\n\n Reverb = createClass(Effect, function (config) {\n this.node = context.createConvolver();\n this.node.buffer = config.buffer;\n //console.log(this.node.buffer);\n });\n\n Panner = createClass(Effect, function (config) {\n this.node = context.createPanner();\n this.node.panningModel = 'equalpower';\n this.node.setPosition(zeroValue, zeroValue, zeroValue);\n });\n\n Panner2 = createClass(Effect, function (config) {\n this.node = context.createPanner();\n this.node.panningModel = 'HRTF';\n this.node.setPosition(zeroValue, zeroValue, zeroValue);\n });\n\n Delay = createClass(Effect, function (config) {\n this.node = context.createDelay();\n this.node.delayTime.value = 0.3;\n });\n\n Compressor = createClass(Effect, function (config) {\n this.node = context.createDynamicsCompressor();\n });\n\n\n BiQuadFilter = createClass(Effect, function (config) {\n this.node = context.createBiquadFilter();\n this.node.type = 0;\n this.node.Q.value = 4;\n this.node.frequency.value = 1600;\n });\n\n /*\n Panner.prototype.setPosition = function(x, y, z){\n var multiplier = 5;\n console.log(x * multiplier);\n this.node.setPosition(x * multiplier, y * multiplier, z * multiplier);\n };\n */\n\n Panner.prototype.setPosition = function (value) {\n var x = value,\n y = 0,\n z = 1 - Math.abs(x);\n\n x = x === 0 ? zeroValue : x;\n y = y === 0 ? zeroValue : y;\n z = z === 0 ? zeroValue : z;\n this.node.setPosition(x, y, z);\n //console.log(1,x,y,z);\n };\n\n Panner2.prototype.setPosition = function (value) {\n var xDeg = parseInt(value),\n zDeg = xDeg + 90,\n x, y, z;\n if (zDeg > 90) {\n zDeg = 180 - zDeg;\n }\n x = Math.sin(xDeg * (Math.PI / 180));\n y = 0;\n z = Math.sin(zDeg * (Math.PI / 180));\n x = x === 0 ? zeroValue : x;\n y = y === 0 ? zeroValue : y;\n z = z === 0 ? zeroValue : z;\n this.node.setPosition(x, y, z);\n //console.log(2,x,y,z);\n };\n\n Delay.prototype.setTime = function (value) {\n this.node.delayTime.value = value;\n };\n\n });\n}", "createAudioPacket(opusPacket, connectionData) {\n const packetBuffer = Buffer.alloc(12);\n packetBuffer[0] = 0x80;\n packetBuffer[1] = 0x78;\n const { sequence, timestamp, ssrc } = connectionData;\n packetBuffer.writeUIntBE(sequence, 2, 2);\n packetBuffer.writeUIntBE(timestamp, 4, 4);\n packetBuffer.writeUIntBE(ssrc, 8, 4);\n packetBuffer.copy(nonce, 0, 0, 12);\n return Buffer.concat([packetBuffer, ...this.encryptOpusPacket(opusPacket, connectionData)]);\n }", "function addShortSamplesToInputBuffer(\r\n samples,\r\n numSamples)\r\n {\r\n if(numSamples == 0) {\r\n return;\r\n }\r\n enlargeInputBufferIfNeeded(numSamples);\r\n move(inputBuffer, numInputSamples, samples, 0, numSamples);\r\n numInputSamples += numSamples;\r\n }", "function playback() {\n let randomNote = allNotesArray[Math.floor(Math.random() * allNotesArray.length)];\n const playSound = ctx.createBufferSource();\n playSound.buffer = randomNote;\n playSound.connect(ctx.destination);\n playSound.start(ctx.currentTime);\n randomNoteIndex = allNotesArray.indexOf(randomNote);\n console.log(randomNoteIndex);\n}", "forward(buffer) {\n var n = this.bufferSize,\n spectrum = this.spectrum,\n x = this.trans,\n TWO_PI = 2 * Math.PI,\n sqrt = Math.sqrt,\n i = n >>> 1,\n bSi = 2 / n,\n n2, n4, n8, nn,\n t1, t2, t3, t4,\n i1, i2, i3, i4, i5, i6, i7, i8,\n st1, cc1, ss1, cc3, ss3,\n e,\n a,\n rval, ival, mag;\n\n this.reverseBinPermute(x, buffer);\n\n for (var ix = 0, id = 4; ix < n; id *= 4) {\n for (var i0 = ix; i0 < n; i0 += id) {\n //sumdiff(x[i0], x[i0+1]); // {a, b} <--| {a+b, a-b}\n st1 = x[i0] - x[i0 + 1];\n x[i0] += x[i0 + 1];\n x[i0 + 1] = st1;\n }\n ix = 2 * (id - 1);\n }\n\n n2 = 2;\n nn = n >>> 1;\n\n while ((nn = nn >>> 1)) {\n ix = 0;\n n2 = n2 << 1;\n id = n2 << 1;\n n4 = n2 >>> 2;\n n8 = n2 >>> 3;\n do {\n if (n4 !== 1) {\n for (i0 = ix; i0 < n; i0 += id) {\n i1 = i0;\n i2 = i1 + n4;\n i3 = i2 + n4;\n i4 = i3 + n4;\n\n //diffsum3_r(x[i3], x[i4], t1); // {a, b, s} <--| {a, b-a, a+b}\n t1 = x[i3] + x[i4];\n x[i4] -= x[i3];\n //sumdiff3(x[i1], t1, x[i3]); // {a, b, d} <--| {a+b, b, a-b}\n x[i3] = x[i1] - t1;\n x[i1] += t1;\n\n i1 += n8;\n i2 += n8;\n i3 += n8;\n i4 += n8;\n\n //sumdiff(x[i3], x[i4], t1, t2); // {s, d} <--| {a+b, a-b}\n t1 = x[i3] + x[i4];\n t2 = x[i3] - x[i4];\n\n t1 = -t1 * Math.SQRT1_2;\n t2 *= Math.SQRT1_2;\n\n // sumdiff(t1, x[i2], x[i4], x[i3]); // {s, d} <--| {a+b, a-b}\n st1 = x[i2];\n x[i4] = t1 + st1;\n x[i3] = t1 - st1;\n\n //sumdiff3(x[i1], t2, x[i2]); // {a, b, d} <--| {a+b, b, a-b}\n x[i2] = x[i1] - t2;\n x[i1] += t2;\n }\n } else {\n for (i0 = ix; i0 < n; i0 += id) {\n i1 = i0;\n i2 = i1 + n4;\n i3 = i2 + n4;\n i4 = i3 + n4;\n\n //diffsum3_r(x[i3], x[i4], t1); // {a, b, s} <--| {a, b-a, a+b}\n t1 = x[i3] + x[i4];\n x[i4] -= x[i3];\n\n //sumdiff3(x[i1], t1, x[i3]); // {a, b, d} <--| {a+b, b, a-b}\n x[i3] = x[i1] - t1;\n x[i1] += t1;\n }\n }\n\n ix = (id << 1) - n2;\n id = id << 2;\n } while (ix < n);\n\n e = TWO_PI / n2;\n\n for (var j = 1; j < n8; j++) {\n a = j * e;\n ss1 = Math.sin(a);\n cc1 = Math.cos(a);\n\n //ss3 = sin(3*a); cc3 = cos(3*a);\n cc3 = 4 * cc1 * (cc1 * cc1 - 0.75);\n ss3 = 4 * ss1 * (0.75 - ss1 * ss1);\n\n ix = 0; id = n2 << 1;\n do {\n for (i0 = ix; i0 < n; i0 += id) {\n i1 = i0 + j;\n i2 = i1 + n4;\n i3 = i2 + n4;\n i4 = i3 + n4;\n\n i5 = i0 + n4 - j;\n i6 = i5 + n4;\n i7 = i6 + n4;\n i8 = i7 + n4;\n\n //cmult(c, s, x, y, &u, &v)\n //cmult(cc1, ss1, x[i7], x[i3], t2, t1); // {u,v} <--| {x*c-y*s, x*s+y*c}\n t2 = x[i7] * cc1 - x[i3] * ss1;\n t1 = x[i7] * ss1 + x[i3] * cc1;\n\n //cmult(cc3, ss3, x[i8], x[i4], t4, t3);\n t4 = x[i8] * cc3 - x[i4] * ss3;\n t3 = x[i8] * ss3 + x[i4] * cc3;\n\n //sumdiff(t2, t4); // {a, b} <--| {a+b, a-b}\n st1 = t2 - t4;\n t2 += t4;\n t4 = st1;\n\n //sumdiff(t2, x[i6], x[i8], x[i3]); // {s, d} <--| {a+b, a-b}\n //st1 = x[i6]; x[i8] = t2 + st1; x[i3] = t2 - st1;\n x[i8] = t2 + x[i6];\n x[i3] = t2 - x[i6];\n\n //sumdiff_r(t1, t3); // {a, b} <--| {a+b, b-a}\n st1 = t3 - t1;\n t1 += t3;\n t3 = st1;\n\n //sumdiff(t3, x[i2], x[i4], x[i7]); // {s, d} <--| {a+b, a-b}\n //st1 = x[i2]; x[i4] = t3 + st1; x[i7] = t3 - st1;\n x[i4] = t3 + x[i2];\n x[i7] = t3 - x[i2];\n\n //sumdiff3(x[i1], t1, x[i6]); // {a, b, d} <--| {a+b, b, a-b}\n x[i6] = x[i1] - t1;\n x[i1] += t1;\n\n //diffsum3_r(t4, x[i5], x[i2]); // {a, b, s} <--| {a, b-a, a+b}\n x[i2] = t4 + x[i5];\n x[i5] -= t4;\n }\n\n ix = (id << 1) - n2;\n id = id << 2;\n\n } while (ix < n);\n }\n }\n\n while (--i) {\n rval = x[i];\n ival = x[n - i - 1];\n mag = bSi * sqrt(rval * rval + ival * ival);\n\n if (mag > this.peak) {\n this.peakBand = i;\n this.peak = mag;\n }\n\n spectrum[i] = mag;\n }\n\n spectrum[0] = bSi * x[0];\n\n return spectrum;\n }", "function StereoAudioRecorderHelper(mediaStream, root) {\n\n // variables \n var deviceSampleRate = 44100; // range: 22050 to 96000\n\n if (!ObjectStore.AudioContextConstructor) {\n ObjectStore.AudioContextConstructor = new ObjectStore.AudioContext();\n }\n\n // check device sample rate\n deviceSampleRate = ObjectStore.AudioContextConstructor.sampleRate;\n\n var leftchannel = [];\n var rightchannel = [];\n var scriptprocessornode;\n var recording = false;\n var recordingLength = 0;\n var volume;\n var audioInput;\n var sampleRate = root.sampleRate || deviceSampleRate;\n\n var mimeType = root.mimeType || 'audio/wav';\n var isPCM = mimeType.indexOf('audio/pcm') > -1;\n\n var context;\n\n var numChannels = root.audioChannels || 2;\n\n this.record = function() {\n recording = true;\n // reset the buffers for the new recording\n leftchannel.length = rightchannel.length = 0;\n recordingLength = 0;\n };\n\n this.requestData = function() {\n if (isPaused) {\n return;\n }\n\n if (recordingLength === 0) {\n requestDataInvoked = false;\n return;\n }\n\n requestDataInvoked = true;\n // clone stuff\n var internalLeftChannel = leftchannel.slice(0);\n var internalRightChannel = rightchannel.slice(0);\n var internalRecordingLength = recordingLength;\n\n // reset the buffers for the new recording\n leftchannel.length = rightchannel.length = [];\n recordingLength = 0;\n requestDataInvoked = false;\n\n // we flat the left and right channels down\n var leftBuffer = mergeBuffers(internalLeftChannel, internalRecordingLength);\n\n var interleaved = leftBuffer;\n\n // we interleave both channels together\n if (numChannels === 2) {\n var rightBuffer = mergeBuffers(internalRightChannel, internalRecordingLength); // bug fixed via #70,#71\n interleaved = interleave(leftBuffer, rightBuffer);\n }\n\n if (isPCM) {\n // our final binary blob\n var blob = new Blob([convertoFloat32ToInt16(interleaved)], {\n type: 'audio/pcm'\n });\n\n console.debug('audio recorded blob size:', bytesToSize(blob.size));\n root.ondataavailable(blob);\n return;\n }\n\n // we create our wav file\n var buffer = new ArrayBuffer(44 + interleaved.length * 2);\n var view = new DataView(buffer);\n\n // RIFF chunk descriptor\n writeUTFBytes(view, 0, 'RIFF');\n\n // -8 (via #97)\n view.setUint32(4, 44 + interleaved.length * 2 - 8, true);\n\n writeUTFBytes(view, 8, 'WAVE');\n // FMT sub-chunk\n writeUTFBytes(view, 12, 'fmt ');\n view.setUint32(16, 16, true);\n view.setUint16(20, 1, true);\n // stereo (2 channels)\n view.setUint16(22, numChannels, true);\n view.setUint32(24, sampleRate, true);\n view.setUint32(28, sampleRate * numChannels * 2, true); // numChannels * 2 (via #71)\n view.setUint16(32, numChannels * 2, true);\n view.setUint16(34, 16, true);\n // data sub-chunk\n writeUTFBytes(view, 36, 'data');\n view.setUint32(40, interleaved.length * 2, true);\n\n // write the PCM samples\n var lng = interleaved.length;\n var index = 44;\n var volume = 1;\n for (var i = 0; i < lng; i++) {\n view.setInt16(index, interleaved[i] * (0x7FFF * volume), true);\n index += 2;\n }\n\n // our final binary blob\n var blob = new Blob([view], {\n type: 'audio/wav'\n });\n\n console.debug('audio recorded blob size:', bytesToSize(blob.size));\n\n root.ondataavailable(blob);\n };\n\n this.stop = function() {\n // we stop recording\n recording = false;\n this.requestData();\n\n audioInput.disconnect();\n };\n\n function interleave(leftChannel, rightChannel) {\n var length = leftChannel.length + rightChannel.length;\n var result = new Float32Array(length);\n\n var inputIndex = 0;\n\n for (var index = 0; index < length;) {\n result[index++] = leftChannel[inputIndex];\n result[index++] = rightChannel[inputIndex];\n inputIndex++;\n }\n return result;\n }\n\n function mergeBuffers(channelBuffer, recordingLength) {\n var result = new Float32Array(recordingLength);\n var offset = 0;\n var lng = channelBuffer.length;\n for (var i = 0; i < lng; i++) {\n var buffer = channelBuffer[i];\n result.set(buffer, offset);\n offset += buffer.length;\n }\n return result;\n }\n\n function writeUTFBytes(view, offset, string) {\n var lng = string.length;\n for (var i = 0; i < lng; i++) {\n view.setUint8(offset + i, string.charCodeAt(i));\n }\n }\n\n function convertoFloat32ToInt16(buffer) {\n var l = buffer.length;\n var buf = new Int16Array(l)\n\n while (l--) {\n buf[l] = buffer[l] * 0xFFFF; //convert to 16 bit\n }\n return buf.buffer\n }\n\n // creates the audio context\n var context = ObjectStore.AudioContextConstructor;\n\n // creates a gain node\n ObjectStore.VolumeGainNode = context.createGain();\n\n var volume = ObjectStore.VolumeGainNode;\n\n // creates an audio node from the microphone incoming stream\n ObjectStore.AudioInput = context.createMediaStreamSource(mediaStream);\n\n // creates an audio node from the microphone incoming stream\n var audioInput = ObjectStore.AudioInput;\n\n // connect the stream to the gain node\n audioInput.connect(volume);\n\n /* From the spec: This value controls how frequently the audioprocess event is\n dispatched and how many sample-frames need to be processed each call.\n Lower values for buffer size will result in a lower (better) latency.\n Higher values will be necessary to avoid audio breakup and glitches \n Legal values are 256, 512, 1024, 2048, 4096, 8192, and 16384.*/\n var bufferSize = root.bufferSize || 2048;\n if (root.bufferSize === 0) {\n bufferSize = 0;\n }\n\n if (context.createJavaScriptNode) {\n scriptprocessornode = context.createJavaScriptNode(bufferSize, numChannels, numChannels);\n } else if (context.createScriptProcessor) {\n scriptprocessornode = context.createScriptProcessor(bufferSize, numChannels, numChannels);\n } else {\n throw 'WebAudio API has no support on this browser.';\n }\n\n bufferSize = scriptprocessornode.bufferSize;\n\n console.debug('using audio buffer-size:', bufferSize);\n\n var requestDataInvoked = false;\n\n // sometimes \"scriptprocessornode\" disconnects from he destination-node\n // and there is no exception thrown in this case.\n // and obviously no further \"ondataavailable\" events will be emitted.\n // below global-scope variable is added to debug such unexpected but \"rare\" cases.\n window.scriptprocessornode = scriptprocessornode;\n\n if (numChannels === 1) {\n console.debug('All right-channels are skipped.');\n }\n\n var isPaused = false;\n\n this.pause = function() {\n isPaused = true;\n };\n\n this.resume = function() {\n isPaused = false;\n };\n\n // http://webaudio.github.io/web-audio-api/#the-scriptprocessornode-interface\n scriptprocessornode.onaudioprocess = function(e) {\n if (!recording || requestDataInvoked || isPaused) {\n return;\n }\n\n var left = e.inputBuffer.getChannelData(0);\n leftchannel.push(new Float32Array(left));\n\n if (numChannels === 2) {\n var right = e.inputBuffer.getChannelData(1);\n rightchannel.push(new Float32Array(right));\n }\n recordingLength += bufferSize;\n };\n\n volume.connect(scriptprocessornode);\n scriptprocessornode.connect(context.destination);\n}", "function StereoAudioRecorderHelper(mediaStream, root) {\n\n // variables \n var deviceSampleRate = 44100; // range: 22050 to 96000\n\n if (!ObjectStore.AudioContextConstructor) {\n ObjectStore.AudioContextConstructor = new ObjectStore.AudioContext();\n }\n\n // check device sample rate\n deviceSampleRate = ObjectStore.AudioContextConstructor.sampleRate;\n\n var leftchannel = [];\n var rightchannel = [];\n var scriptprocessornode;\n var recording = false;\n var recordingLength = 0;\n var volume;\n var audioInput;\n var sampleRate = root.sampleRate || deviceSampleRate;\n\n var mimeType = root.mimeType || 'audio/wav';\n var isPCM = mimeType.indexOf('audio/pcm') > -1;\n\n var context;\n\n var numChannels = root.audioChannels || 2;\n\n this.record = function() {\n recording = true;\n // reset the buffers for the new recording\n leftchannel.length = rightchannel.length = 0;\n recordingLength = 0;\n };\n\n this.requestData = function() {\n if (isPaused) {\n return;\n }\n\n if (recordingLength === 0) {\n requestDataInvoked = false;\n return;\n }\n\n requestDataInvoked = true;\n // clone stuff\n var internalLeftChannel = leftchannel.slice(0);\n var internalRightChannel = rightchannel.slice(0);\n var internalRecordingLength = recordingLength;\n\n // reset the buffers for the new recording\n leftchannel.length = rightchannel.length = [];\n recordingLength = 0;\n requestDataInvoked = false;\n\n // we flat the left and right channels down\n var leftBuffer = mergeBuffers(internalLeftChannel, internalRecordingLength);\n\n var interleaved = leftBuffer;\n\n // we interleave both channels together\n if (numChannels === 2) {\n var rightBuffer = mergeBuffers(internalRightChannel, internalRecordingLength); // bug fixed via #70,#71\n interleaved = interleave(leftBuffer, rightBuffer);\n }\n\n if (isPCM) {\n // our final binary blob\n var blob = new Blob([convertoFloat32ToInt16(interleaved)], {\n type: 'audio/pcm'\n });\n\n console.debug('audio recorded blob size:', bytesToSize(blob.size));\n root.ondataavailable(blob);\n return;\n }\n\n // we create our wav file\n var buffer = new ArrayBuffer(44 + interleaved.length * 2);\n var view = new DataView(buffer);\n\n // RIFF chunk descriptor\n writeUTFBytes(view, 0, 'RIFF');\n\n // -8 (via #97)\n view.setUint32(4, 44 + interleaved.length * 2 - 8, true);\n\n writeUTFBytes(view, 8, 'WAVE');\n // FMT sub-chunk\n writeUTFBytes(view, 12, 'fmt ');\n view.setUint32(16, 16, true);\n view.setUint16(20, 1, true);\n // stereo (2 channels)\n view.setUint16(22, numChannels, true);\n view.setUint32(24, sampleRate, true);\n view.setUint32(28, sampleRate * numChannels * 2, true); // numChannels * 2 (via #71)\n view.setUint16(32, numChannels * 2, true);\n view.setUint16(34, 16, true);\n // data sub-chunk\n writeUTFBytes(view, 36, 'data');\n view.setUint32(40, interleaved.length * 2, true);\n\n // write the PCM samples\n var lng = interleaved.length;\n var index = 44;\n var volume = 1;\n for (var i = 0; i < lng; i++) {\n view.setInt16(index, interleaved[i] * (0x7FFF * volume), true);\n index += 2;\n }\n\n // our final binary blob\n var blob = new Blob([view], {\n type: 'audio/wav'\n });\n\n console.debug('audio recorded blob size:', bytesToSize(blob.size));\n\n root.ondataavailable(blob);\n };\n\n this.stop = function() {\n // we stop recording\n recording = false;\n this.requestData();\n\n audioInput.disconnect();\n };\n\n function interleave(leftChannel, rightChannel) {\n var length = leftChannel.length + rightChannel.length;\n var result = new Float32Array(length);\n\n var inputIndex = 0;\n\n for (var index = 0; index < length;) {\n result[index++] = leftChannel[inputIndex];\n result[index++] = rightChannel[inputIndex];\n inputIndex++;\n }\n return result;\n }\n\n function mergeBuffers(channelBuffer, recordingLength) {\n var result = new Float32Array(recordingLength);\n var offset = 0;\n var lng = channelBuffer.length;\n for (var i = 0; i < lng; i++) {\n var buffer = channelBuffer[i];\n result.set(buffer, offset);\n offset += buffer.length;\n }\n return result;\n }\n\n function writeUTFBytes(view, offset, string) {\n var lng = string.length;\n for (var i = 0; i < lng; i++) {\n view.setUint8(offset + i, string.charCodeAt(i));\n }\n }\n\n function convertoFloat32ToInt16(buffer) {\n var l = buffer.length;\n var buf = new Int16Array(l)\n\n while (l--) {\n buf[l] = buffer[l] * 0xFFFF; //convert to 16 bit\n }\n return buf.buffer\n }\n\n // creates the audio context\n var context = ObjectStore.AudioContextConstructor;\n\n // creates a gain node\n ObjectStore.VolumeGainNode = context.createGain();\n\n var volume = ObjectStore.VolumeGainNode;\n\n // creates an audio node from the microphone incoming stream\n ObjectStore.AudioInput = context.createMediaStreamSource(mediaStream);\n\n // creates an audio node from the microphone incoming stream\n var audioInput = ObjectStore.AudioInput;\n\n // connect the stream to the gain node\n audioInput.connect(volume);\n\n /* From the spec: This value controls how frequently the audioprocess event is\n dispatched and how many sample-frames need to be processed each call.\n Lower values for buffer size will result in a lower (better) latency.\n Higher values will be necessary to avoid audio breakup and glitches \n Legal values are 256, 512, 1024, 2048, 4096, 8192, and 16384.*/\n var bufferSize = root.bufferSize || 2048;\n if (root.bufferSize === 0) {\n bufferSize = 0;\n }\n\n if (context.createJavaScriptNode) {\n scriptprocessornode = context.createJavaScriptNode(bufferSize, numChannels, numChannels);\n } else if (context.createScriptProcessor) {\n scriptprocessornode = context.createScriptProcessor(bufferSize, numChannels, numChannels);\n } else {\n throw 'WebAudio API has no support on this browser.';\n }\n\n bufferSize = scriptprocessornode.bufferSize;\n\n console.debug('using audio buffer-size:', bufferSize);\n\n var requestDataInvoked = false;\n\n // sometimes \"scriptprocessornode\" disconnects from he destination-node\n // and there is no exception thrown in this case.\n // and obviously no further \"ondataavailable\" events will be emitted.\n // below global-scope variable is added to debug such unexpected but \"rare\" cases.\n window.scriptprocessornode = scriptprocessornode;\n\n if (numChannels === 1) {\n console.debug('All right-channels are skipped.');\n }\n\n var isPaused = false;\n\n this.pause = function() {\n isPaused = true;\n };\n\n this.resume = function() {\n isPaused = false;\n };\n\n // http://webaudio.github.io/web-audio-api/#the-scriptprocessornode-interface\n scriptprocessornode.onaudioprocess = function(e) {\n if (!recording || requestDataInvoked || isPaused) {\n return;\n }\n\n var left = e.inputBuffer.getChannelData(0);\n leftchannel.push(new Float32Array(left));\n\n if (numChannels === 2) {\n var right = e.inputBuffer.getChannelData(1);\n rightchannel.push(new Float32Array(right));\n }\n recordingLength += bufferSize;\n };\n\n volume.connect(scriptprocessornode);\n scriptprocessornode.connect(context.destination);\n}", "function getInstantBuffer(leftData, rightData, sampleRate) {\n drawContext.drawInstantCurve(leftData, rightData, sampleRate);\n }", "function pcmResampleLinear(src, srcFreq, dstFreq) {\r\n var srcLength = src.length;\r\n var srcDuration = srcLength / srcFreq;\r\n var dstLength = srcDuration * dstFreq;\r\n var dst = new Int16Array(dstLength);\r\n var adjFreq = srcFreq / dstFreq;\r\n for (var dstPtr = 0, adj = 0, srcPtr = 0, weight = 0; dstPtr < dstLength; dstPtr++) {\r\n adj = dstPtr * adjFreq;\r\n srcPtr = Math.floor(adj);\r\n weight = adj % 1;\r\n dst[dstPtr] = lerp(pcmGetSample(src, srcLength, srcPtr), pcmGetSample(src, srcLength, srcPtr + 1), weight);\r\n }\r\n return dst;\r\n }", "function getData() {\n source = audioCtx.createBufferSource();\n let request = new XMLHttpRequest();\n\n request.open('GET', 'viper.ogg', true);\n\n request.responseType = 'arraybuffer';\n\n\n request.onload = function() {\n var audioData = request.response;\n\n audioCtx.decodeAudioData(audioData, function(buffer) {\n myBuffer = buffer;\n songLength = buffer.duration;\n source.buffer = myBuffer;\n source.playbackRate.value = playbackControl.value;\n source.connect(audioCtx.destination);\n source.loop = true;\n\n loopStartControl.setAttribute('max', Math.floor(songLength));\n loopEndControl.setAttribute('max', Math.floor(songLength));\n },\n\n function(e) { console.log(\"Error with decoding audio data\" + e.error); });\n\n };\n\n request.send();\n}", "function pointSample(inp, out, inLength, outLength, context)\n{\n const ratio = context.inRate / context.outRate;\n const offset = context.offset;\n const scale = context.scale;\n\n if ( !outLength )\n outLength = Math.round((inLength - offset) / ratio);\n\n // If the out argument is a constructor, construct a new object to use\n // for the output, and return it after processing.\n if ( typeof(out) == \"function\" ) {\n out = new out(outLength);\n }\n\n for ( var i = 0; i < outLength; i++ ) {\n const j = Math.round((i * ratio) + offset);\n if ( j > inLength )\n console.log(\"pointSample input buffer overrun.\");\n out[i] = inp[j] * scale;\n }\n const used = (outLength * ratio) + offset;\n context.offset = ((outLength * ratio) + offset) % ratio; \n return out;\n}", "function flushStream()\r\n {\r\n var remainingSamples = numInputSamples;\r\n var s = speed/pitch;\r\n var r = rate*pitch;\r\n var expectedOutputSamples = Math.floor(numOutputSamples + Math.floor((remainingSamples/s + numPitchSamples)/r + 0.5));\r\n\r\n // Add enough silence to flush both input and pitch buffers.\r\n enlargeInputBufferIfNeeded(remainingSamples + 2*maxRequired);\r\n for(var xSample = 0; xSample < 2*maxRequired*numChannels; xSample++) {\r\n inputBuffer[remainingSamples*numChannels + xSample] = 0;\r\n }\r\n numInputSamples += 2*maxRequired;\r\n writeShortToStream(null, 0);\r\n // Throw away any extra samples we generated due to the silence we added.\r\n if(numOutputSamples > expectedOutputSamples) {\r\n numOutputSamples = expectedOutputSamples;\r\n }\r\n // Empty input and pitch buffers.\r\n numInputSamples = 0;\r\n remainingInputToCopy = 0;\r\n numPitchSamples = 0;\r\n }", "function playbackHarmonic() {\n let randomNoteHarmonic = allNotesArrayHarmonic[Math.floor(Math.random() * allNotesArrayHarmonic.length)];\n const playSound = ctx.createBufferSource();\n playSound.buffer = randomNoteHarmonic;\n playSound.connect(ctx.destination);\n playSound.start(ctx.currentTime);\n randomNoteIndex = allNotesArrayHarmonic.indexOf(randomNoteHarmonic);\n console.log(randomNoteIndex);\n}", "function processAudioInput(event)\n{\n const r = window.radioclient\n\n if ( !r.transmitting || r.disable )\n return;\n\n const data = event.inputBuffer.getChannelData(0);\n r.soc.send(pointSample(\n data, Int16Array, data.length, null, r.inputInterpolationContext));\n}", "function Sampler (sampleRate, pitch) {\n\tvar\tself\t= this;\n\tself.voices\t= [];\n\tself.sampleRate\t= sampleRate;\n\tself.pitch\t= isNaN(pitch) ? 440 : self.pitch;\n}", "function monoSynth() {\n userStartAudio();\n\n // let level = amplitude.getLevel();\n // let size = map(level, 0,1,0,200);\n\n if(soundLoop.isPlaying) {\n soundLoop.stop();\n } else {\n soundLoop.start();\n }\n}", "function init(arrayBuffer) {\n // document.getElementById('instructions').innerHTML = 'Loading ...'\n // Create a new `audioContext` and its `analyser`\n window.audioCtx = new AudioContext();\n context = audioCtx;\n window.analyser = audioCtx.createAnalyser();\n // If a sound is still playing, stop it.\n // if (window.source)\n // source.noteOff(0)\n // Decode the data in our array into an audio buffer\n audioCtx.decodeAudioData(arrayBuffer, function (buffer) {\n // Use the audio buffer with as our audio source\n window.source = audioCtx.createBufferSource();\n source.buffer = buffer;\n // Connect to the analyser ...\n source.connect(analyser);\n // and back to the destination, to play the sound after the analysis.\n analyser.connect(audioCtx.destination);\n // Start playing the buffer.\n source.start(0);\n // Initialize a visualizer object\n var viz = new simpleViz();\n // Finally, initialize the visualizer.\n new visualizer(viz[\"update\"], analyser);\n // document.getElementById('instructions').innerHTML = ''\n });\n}", "readBufferProcessEvent(e) {\n\t\tlet l = e.outputBuffer.getChannelData(0)\n\t\tlet r = e.outputBuffer.getChannelData(1)\n\t\tconst len = e.inputBuffer.length\n\t\tconst half = this._bufferSize >> 1\n\t\tconst sources = this.targets.lightness\n\t\tconst averages = this.buffers.lightness\n\n\t\tfor (let idx = 0; idx < len; idx++) {\n\t\t\tconst t = this._sample / 44100\n\t\t\t\n\t\t\t// Zero before summing\n\t\t\tl[idx] = 0\n\t\t\tr[idx] = 0\n\n\t\t\t// Iterate through all possible tones, summing\n\t\t\tfor (let tone_idx = 0; tone_idx < half; tone_idx++) {\n\t\t\t\tconst tone = Math.sin(t * this._frequencies[tone_idx])\n\t\t\t\t// Smooth (moving average)\n\t\t\t\taverages[tone_idx] = (sources[this._hilbert[tone_idx]] + averages[tone_idx]) / 2\n\t\t\t\taverages[half+tone_idx] = (sources[this._hilbert[half+tone_idx]] + averages[tone_idx]) / 2\n\n\t\t\t\t// TODO: compression\n\t\t\t\tl[idx] += (tone * averages[tone_idx] )/half\n\t\t\t\tr[idx] += (tone * averages[half + tone_idx] )/half\n\t\t\t}\n\n\t\t\t// Decrease dynamic range\n\t\t\t// Technically we should use abs values here because the output range is [-1 1] but\n\t\t\t// this loop is probably expensive enough already and it will function approximately\n\t\t\t// the same\n\t\t\tif (l[idx] > this.maxLoudness || r[idx] > this.maxLoudness)\n\t\t\t\tthis.maxLoudness += 1e-5\n\n\t\t\tif (this.maxLoudness > 0 && this.compression > 0) {\n\t\t\t\tl[idx] = l[idx] / (this.maxLoudness + (1-this.maxLoudness)*(1-this.compression))\n\t\t\t\tr[idx] = r[idx] / (this.maxLoudness + (1-this.maxLoudness)*(1-this.compression))\n\t\t\t}\n\n\t\t\t// Reduce to effect maximum compression\n\t\t\tthis.maxLoudness -= 1e-6 // will reset back to zero after 10 seconds\n\n\t\t\tthis._sample++\n\t\t}\n\n\t\tconst hues = this.targets.hue\n\t\tconst saturations = this.targets.saturation\n\n\t\tlet average_hueL = 0,\n\t\t average_hueR = 0,\n\t\t count_hueL = 0,\n\t\t\tcount_hueR = 0,\n\t\t\taverage_satL = 0,\n\t\t\taverage_satR = 0\n\t\t// Only look at the central quarter of the image for colour detection\n\t\tfor (let idx = 0; idx < half/4; idx++) {\n\t\t\taverage_satL += saturations[ idx+half/4+half/8]\n\t\t\taverage_satR += saturations[half + idx+half/4+half/8]\n\t\t\tif (!Number.isNaN(hues[idx+half/4+half/8])) {\n\t\t\t\taverage_hueL += hues[idx+half/4+half/8]\n\t\t\t\tcount_hueL++\n\t\t\t}\n\t\t\tif (!Number.isNaN(hues[half+idx+half/4+half/8])) {\n\t\t\t\taverage_hueR += hues[half+idx+half/4+half/8]\n\t\t\t\tcount_hueR++\n\t\t\t}\n\t\t}\n\n\t\t// Modulate frequency for hue\n\t\tif (count_hueL > 0) { \n\t\t\taverage_hueL = average_hueL/count_hueL\n\t\t\tthis.sawtoothNodeL.frequency.value = average_hueL * 1320 + 440\n\t\t}\n\n\t\tif (count_hueR > 0) { \n\t\t\taverage_hueR = average_hueR/count_hueR\n\t\t\tthis.sawtoothNodeR.frequency.value = average_hueR * 1320 + 440\n\t\t}\n\n\t\t// And distortion and amplitude for saturation\n\t\tthis.distortionL.distortion = this.scaleL.max = (average_satL/(half/4)) * this.fmVolume\n\t\tthis.distortionR.distortion = this.scaleR.max = (average_satR/(half/4)) * this.fmVolume\n\t}", "function Sound(name,urlOrArrayBuffer,scene,readyToPlayCallback,options){var _this=this;this.autoplay=false;this.loop=false;this.useCustomAttenuation=false;this.spatialSound=false;this.refDistance=1;this.rolloffFactor=1;this.maxDistance=100;this.distanceModel=\"linear\";this._panningModel=\"equalpower\";this._playbackRate=1;this._streaming=false;this._startTime=0;this._startOffset=0;this._position=BABYLON.Vector3.Zero();this._localDirection=new BABYLON.Vector3(1,0,0);this._volume=1;this._isLoaded=false;this._isReadyToPlay=false;this.isPlaying=false;this.isPaused=false;this._isDirectional=false;// Used if you'd like to create a directional sound.\n// If not set, the sound will be omnidirectional\nthis._coneInnerAngle=360;this._coneOuterAngle=360;this._coneOuterGain=0;this._isOutputConnected=false;this._urlType=\"Unknown\";this.name=name;this._scene=scene;this._readyToPlayCallback=readyToPlayCallback;// Default custom attenuation function is a linear attenuation\nthis._customAttenuationFunction=function(currentVolume,currentDistance,maxDistance,refDistance,rolloffFactor){if(currentDistance<maxDistance){return currentVolume*(1-currentDistance/maxDistance);}else{return 0;}};if(options){this.autoplay=options.autoplay||false;this.loop=options.loop||false;// if volume === 0, we need another way to check this option\nif(options.volume!==undefined){this._volume=options.volume;}this.spatialSound=options.spatialSound||false;this.maxDistance=options.maxDistance||100;this.useCustomAttenuation=options.useCustomAttenuation||false;this.rolloffFactor=options.rolloffFactor||1;this.refDistance=options.refDistance||1;this.distanceModel=options.distanceModel||\"linear\";this._playbackRate=options.playbackRate||1;this._streaming=options.streaming||false;}if(BABYLON.Engine.audioEngine.canUseWebAudio){this._soundGain=BABYLON.Engine.audioEngine.audioContext.createGain();this._soundGain.gain.value=this._volume;this._inputAudioNode=this._soundGain;this._ouputAudioNode=this._soundGain;if(this.spatialSound){this._createSpatialParameters();}this._scene.mainSoundTrack.AddSound(this);var validParameter=true;// if no parameter is passed, you need to call setAudioBuffer yourself to prepare the sound\nif(urlOrArrayBuffer){if(typeof urlOrArrayBuffer===\"string\")this._urlType=\"String\";if(Array.isArray(urlOrArrayBuffer))this._urlType=\"Array\";if(urlOrArrayBuffer instanceof ArrayBuffer)this._urlType=\"ArrayBuffer\";var urls=[];var codecSupportedFound=false;switch(this._urlType){case\"ArrayBuffer\":if(urlOrArrayBuffer.byteLength>0){codecSupportedFound=true;this._soundLoaded(urlOrArrayBuffer);}break;case\"String\":urls.push(urlOrArrayBuffer);case\"Array\":if(urls.length===0)urls=urlOrArrayBuffer;// If we found a supported format, we load it immediately and stop the loop\nfor(var i=0;i<urls.length;i++){var url=urls[i];if(url.indexOf(\".mp3\",url.length-4)!==-1&&BABYLON.Engine.audioEngine.isMP3supported){codecSupportedFound=true;}if(url.indexOf(\".ogg\",url.length-4)!==-1&&BABYLON.Engine.audioEngine.isOGGsupported){codecSupportedFound=true;}if(url.indexOf(\".wav\",url.length-4)!==-1){codecSupportedFound=true;}if(codecSupportedFound){// Loading sound using XHR2\nif(!this._streaming){BABYLON.Tools.LoadFile(url,function(data){_this._soundLoaded(data);},null,this._scene.database,true);}else{this._htmlAudioElement=new Audio(url);this._htmlAudioElement.controls=false;this._htmlAudioElement.loop=this.loop;this._htmlAudioElement.crossOrigin=\"anonymous\";this._htmlAudioElement.preload=\"auto\";this._htmlAudioElement.addEventListener(\"canplaythrough\",function(){_this._isReadyToPlay=true;if(_this.autoplay){_this.play();}if(_this._readyToPlayCallback){_this._readyToPlayCallback();}});document.body.appendChild(this._htmlAudioElement);}break;}}break;default:validParameter=false;break;}if(!validParameter){BABYLON.Tools.Error(\"Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound.\");}else{if(!codecSupportedFound){this._isReadyToPlay=true;// Simulating a ready to play event to avoid breaking code path\nif(this._readyToPlayCallback){window.setTimeout(function(){_this._readyToPlayCallback();},1000);}}}}}else{// Adding an empty sound to avoid breaking audio calls for non Web Audio browsers\nthis._scene.mainSoundTrack.AddSound(this);if(!BABYLON.Engine.audioEngine.WarnedWebAudioUnsupported){BABYLON.Tools.Error(\"Web Audio is not supported by your browser.\");BABYLON.Engine.audioEngine.WarnedWebAudioUnsupported=true;}// Simulating a ready to play event to avoid breaking code for non web audio browsers\nif(this._readyToPlayCallback){window.setTimeout(function(){_this._readyToPlayCallback();},1000);}}}", "function MMLLSpectrumExtractor(blocksize=512,sampleRate=44100,fftsize=1024,hopsize=512,windowtype=0) {\n \n var self = this;\n \n self.audioblocksize = blocksize;\n self.inputAudio = new MMLLInputAudio(self.audioblocksize);\n \n self.sampleRate = sampleRate;\n\n self.numInputChannels = 1;\n\n self.fftsize = fftsize;\n self.hopsize = hopsize;\n self.windowtype = windowtype;\n \n //context required for sampler's decodeAudioData calls\n \n //can request specific sample rate, but leaving as device's default for now\n //https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/AudioContext\n try {\n self.audiocontext = new webkitAudioContext();\n \n } catch (e) {\n \n try {\n \n self.audiocontext = new AudioContext();\n \n } catch(e) {\n \n alert(\"Your browser does not support Web Audio API!\");\n return;\n }\n \n }\n \n //ignore sampleRate of audiocontext for now, just running through sound files at rate set by user\n //self.sampleRate = self.audiocontext.sampleRate; //usually 44100.0\n //console.log(\"AudioContext established with sample rate:\",self.sampleRate,\" and now setting up for input type:\",self.inputtype); //print\n \n \n //use async, wait?\n self.analyseAudioFile = function(filename,updatefunction) {\n \n \n var spectraldata;\n \n self.sampler = new MMLLSampler();\n \n \n return new Promise(function(resolve, reject) {\n //\"/sounds/05_radiohead_killer_cars.wav\"\n self.sampler.loadSamples([filename],\n function onload() {\n \n console.log('loaded: ',filename);\n \n self.sampleplayer = new MMLLSamplePlayer();\n self.sampleplayer.reset(self.sampler.buffers[0]);\n //self.sampleplayer.numChannels = self.sampler.buffers[0]\n \n if(self.sampleplayer.numChannels>1) {\n //interleaved input\n self.numInputChannels = 2;\n \n self.inputAudio.numChannels = self.numInputChannels;\n //self.samplearray = new Float32Array(2*audioblocksize);\n \n }\n //fresh STFT object\n var stft = new MMLLSTFT(self.fftsize,self.hopsize,self.windowtype);\n \n \n //samplearray depends on number of Channels whether interleaved\n \n //include last frame, will be zero padded as needed\n var numblocks = Math.floor(self.sampleplayer.lengthinsampleframes/self.audioblocksize);\n \n \n //starts with fftsize-hopsize in the bank\n var numspectralframes = Math.floor(((numblocks*self.audioblocksize) - self.hopsize)/self.hopsize) + 1;\n \n //self.processSoundFile(self.audioblocksize);\n \n \n spectraldata = new Array(numspectralframes);\n \n \n var j=0, i = 0;\n \n //complex data not in packed form, but dc and nyquist real values as complex numbers at 0 and fftsize indices\n for (j = 0; j < numspectralframes; ++j)\n spectraldata[j] = new Array(self.fftsize+2);\n \n console.log('Extracting spectrum for: ',filename); //debug console message\n \n var spectralframecount = 0;\n \n for (j = 0; j < numblocks; ++j) {\n \n updatefunction(j,numblocks);\n \n //needed since player accumulates to its output\n for (i = 0; i < self.audioblocksize; ++i) self.inputAudio.monoinput[i] = self.inputAudio.inputL[i] = self.inputAudio.inputR[i] = 0.0;\n \n self.sampleplayer.render(self.inputAudio,self.audioblocksize);\n \n var newframe = stft.next(self.inputAudio.monoinput);\n \n if(newframe) {\n \n if(spectralframecount>=numspectralframes) {\n \n console.log(\"what the spectrum?\",numblocks,numspectralframes,spectralframecount,self.hopsize,self.fftsize);\n }\n \n \n // var fftdata = stft.complex;\n \n for (i = 0; i < (self.fftsize+2); ++i)\n spectraldata[spectralframecount][i] = stft.complex[i];\n \n ++spectralframecount;\n }\n \n \n \n }\n \n \n resolve(spectraldata); //return via Promise\n \n \n },self.audiocontext);\n \n })\n \n \n };\n\n\n \n}", "constructor() {\n this.r = new Uint16Array(10);\n this.h = new Uint16Array(10);\n this.pad = new Uint16Array(8);\n this.buffer = Buffer.alloc(16);\n this.fin = -1;\n this.leftover = 0;\n }", "calculateLoudness(buffer) {\n\n // first call or after resetMemory\n if (this.copybuffer == undefined) {\n // how long should the copybuffer be at least? \n // --> at least maxT should fit in and length shall be an integer fraction of buffer length\n let length = Math.floor(this.sampleRate * this.loudnessprops.maxT / buffer.length + 1) * buffer.length;\n this.copybuffer = new CircularAudioBuffer(context, this.nChannels, length, this.sampleRate);\n }\n\n //accumulate buffer to previous call\n this.copybuffer.concat(buffer);\n\n // must be gt nSamplesPerInterval\n // or: wait at least one interval time T to be able to calculate loudness\n if (this.copybuffer.getLength() < this.nSamplesPerInterval) {\n console.log('buffer too small ... have to eat more data');\n return NaN;\n }\n\n // get array of meansquares from buffer of overlapping intervals\n let meanSquares = this.getBufferMeanSquares(this.copybuffer, this.nSamplesPerInterval, this.nStepsize);\n\n // first stage filter\n this.filterBlocks(meanSquares, this.gamma_a);\n\n // second stage filter\n let gamma_r = 0.;\n for (let chIdx = 0; chIdx < this.nChannels; chIdx++) {\n let mean = 0.;\n for (let idx = 0; idx < meanSquares[chIdx].length; idx++) {\n mean += meanSquares[chIdx][idx];\n }\n mean /= meanSquares[chIdx].length;\n gamma_r += (this.channelWeight[chIdx] * mean);\n }\n gamma_r = -0.691 + 10.0 * Math.log10(gamma_r) - 10.;\n\n this.filterBlocks(meanSquares, gamma_r);\n\n // gated loudness from filtered blocks\n let gatedLoudness = 0.;\n for (let chIdx = 0; chIdx < this.nChannels; chIdx++) {\n let mean = 0.;\n for (let idx = 0; idx < meanSquares[chIdx].length; idx++) {\n mean += meanSquares[chIdx][idx];\n }\n mean /= meanSquares[chIdx].length;\n\n gatedLoudness += (this.channelWeight[chIdx] * mean);\n }\n gatedLoudness = -0.691 + 10.0 * Math.log10(gatedLoudness);\n\n //console.log(this.id, '- gatedLoudness:', gatedLoudness);\n\n return gatedLoudness;\n }", "function audioSetup(){ audioContext = new AudioContext();\n\t//audioplyr.currentTime = 0\n\t// analyser (for audio visualization)\n\t analyser = audioContext.createAnalyser();\n\t analyser.fftSize = 2048;\n\t analyser.smoothingTimeConstant = 0.5;\n\t analyser.maxDecibels = -30;\n\t analyser.minDecibels = -100;\n\t analyser.smoothingTimeConstant = 0.1;\n\n\t frequencyData = new Float32Array(analyser.frequencyBinCount);\n\t // audioplyr.setAttribute('src', \"audio/mahsiv.mp3\");\n\t // create an oscillator\n\t var oscillator = audioContext.createOscillator();\n\t oscillator.type = \"sine\";\n\t oscillator.frequency.setValueAtTime(400, audioContext.currentTime);\n\t oscillator.start();\n\t // oscillator.connect(analyser);\n\t // oscillator.connect(audioContext.destination);\n\t \n\t // audio player gain\n\t audioGain = audioContext.createGain();\n\t audioGain.gain.setValueAtTime(1, audioContext.currentTime);\n\t audioGain.connect(analyser);\n\t audioGain.connect(audioContext.destination);\n\t \n\t //drawURL(\"https://upload.wikimedia.org/wikipedia/commons/9/9b/Bruckner_Symphony_No._5%2C_opening.wav\");\n\t //drawURL(\"https://upload.wikimedia.org/wikipedia/commons/3/32/Danse_Macabre_-_Busy_Strings_%28ISRC_USUAN1100556%29.mp3\");\n\t //drawURL(\"https://upload.wikimedia.org/wikipedia/commons/d/d6/Danse_Macabre_-_Light_Dance_%28ISRC_USUAN1100553%29.mp3\");\n\t //drawURL(\"https://upload.wikimedia.org/wikipedia/commons/c/c6/Canon_in_D_Major_%28ISRC_USUAN1100301%29.mp3\");\n\n\t myOscilloscope.resume();\n\tradioSrc = audioContext.createMediaElementSource(audioplyr);\n\t radioSrc.connect(audioGain);\n\t \n\t splitter = audioContext.createChannelSplitter();\n\n\t analyserL = audioContext.createAnalyser();\n\t analyserL.smoothingTimeConstant = 0.7;\n\n\t analyserR = audioContext.createAnalyser();\n\t analyserR.smoothingTimeConstant = 0.7;\n\n\t //sourceNode = audioContext.createMediaElementSource(audio);\n\t radioSrc.connect(splitter);\n\t //sourceNode.connect(audioContext.destination);\n\n\t splitter.connect(analyserL,0,0);\n\t splitter.connect(analyserR,1,0);\n\n\t //audio.play();\n\t analyserL.fftSize = 4096;\n\t analyserR.fftSize = 4096;\n\t bufferLength = analyserL.fftSize;\n\t dataArrayL = new Float32Array(bufferLength);\n\t dataArrayR = new Float32Array(bufferLength);\n\t}", "function videoSoundSampler2Loader(){\n var videoSnapshotTexture;\n blobVideoLoad(0, 5, \"gore.mp4\", false, {'postLoadFunc': () => {\n videoSnapshotTexture = mInputs[6] = createVideoSnapshotTexture(gl, videos[0])\n }});\n\n videoSnapshot = function(){\n if(videoSnapshotTexture && videoSnapshotTexture.globject) updateVideoTexture(gl, videoSnapshotTexture.globject, videos[0]);\n }\n\n sliderConfig = videoBlendSliderVals;\n\n videoUploadResponder = function(videoFile){\n var blobURL = URL.createObjectURL(videoFile);\n var oldVid = videos[0];\n // videos[0].pause(); //todo - delete the underlying video element to free memory\n createVideoElement(blobURL, 0, 5, true);\n oldVid.pause();\n URL.revokeObjectURL(oldVid.src);\n oldVid.removeAttribute(\"src\");\n oldVid.load();\n\n }\n var players = arrayOf(10);\n audioFilesSelected = function(audioFiles){\n console.log(audioFiles);\n players.forEach(player => player ? player.dispose() : 0);\n for(var i = 0; i < Math.min(10, audioFiles.length); i++){\n var objUrl = URL.createObjectURL(audioFiles[i]);\n players[i] = new Tone.Player(objUrl).toMaster();\n }\n }\n var deviations = arrayOf(1000).map((elem, i) => i + Math.random());\n var baseInd = 0;\n var midiNoteFunction = function(note, vel){\n var moveDownNote = lowestKeyboardNote;\n var moveUpNote = lowestKeyboardNote + 24; //62\n if(note == moveDownNote) baseInd = Math.max(baseInd-12, 0);\n else if(note == moveUpNote) baseInd+=12;\n else if(moveDownNote < note && note < moveUpNote ){\n videos[0].currentTime = deviations[baseInd + (note-(lowestKeyboardNote+1))];\n }\n } \n midiEventHandlers[\"on\"] = midiNoteFunction;\n\n var midiCCFunction = function(ccNum, val){\n sliders[ccNum].value = val/128;\n }\n midiEventHandlers[\"cc\"] = midiCCFunction;\n}", "function MidiSynthSampleAndHoldOscillator(sampleFreq, bufferLen, func) {\r\n MidiSynthOscillator.call(this, sampleFreq, bufferLen);\r\n this.normalizedPhase = 0;\r\n this.phaseStep = 0;\r\n this.func = func;\r\n this.funcSampleFreqMult = 1;\r\n this.value = null;\r\n this.setFrequency(this.freq);\r\n}", "function initSoundAnalyse() {\n var canvas = document.getElementById(\"soundCanvas\");\n canvas.style.opacity = 0.7;\n var dataLine = canvas.getContext(\"2d\");\n var time = 0;\n var color = \"#ffffff\";\n var factor;\n setInterval(function(){\n if(analyser){\n time = time + 0.1\n dataLine.clearRect(0, 0, canvas.width, canvas.height);\n dataLine.beginPath();\n if(soundVoice && soundVoice.isPlaying) {\n factor = (analyser.getAverageFrequency()-7)\n } else {\n factor = 0;\n }\n var nextFactor;\n var midWidth = Math.floor(canvas.width/2);\n for(cnt = 0; cnt <= canvas.width; cnt++) {\n nextFactor = cnt<=midWidth ? cnt/midWidth : 1-(cnt-midWidth)/midWidth;\n dataLine.lineTo(cnt, canvas.height * 0.5 - (2 + Math.cos(time + cnt * 0.1) *(factor*nextFactor*0.3)));\n }\n dataLine.lineWidth = 2-1/(analyser.getAverageFrequency()/3);\n dataLine.strokeStyle = color;\n dataLine.stroke();\n\n dataLine.beginPath();\n for(cnt = -1; cnt <= canvas.width; cnt++) {\n nextFactor = cnt<=midWidth ? cnt/midWidth : 1-(cnt-midWidth)/midWidth;\n dataLine.lineTo(cnt, canvas.height * 0.5 - (2 + Math.cos(time + cnt * 0.1) * (factor*nextFactor*0.2)));\n }\n dataLine.lineWidth = 1*(2-1/analyser.getAverageFrequency());\n dataLine.strokeStyle = color;\n dataLine.stroke();\n }\n }, 30);\n}", "function frame(data, frameLength, hopLength) {\n const bufferCount = Math.floor((data.length - frameLength) / hopLength) + 1;\n const buffers = Array.from(\n { length: bufferCount }, (x, i) => new Float32Array(frameLength));\n for (let i = 0; i < bufferCount; i++) {\n const ind = i * hopLength;\n const buffer = data.slice(ind, ind + frameLength);\n buffers[i].set(buffer);\n // In the end, we will likely have an incomplete buffer, which we should\n // just ignore.\n if (buffer.length !== frameLength) {\n continue;\n }\n }\n return buffers;\n}", "function applyVibrato(params, periodSamples) {\n if (params.vib_speed === 0 || params.vib_strength === 0) {\n // No vibrato. Rather than waste time computing an exact copy of the\n // input, just return it unchanged.\n return periodSamples;\n }\n\n var vib_phase = 0.0;\n var vib_speed = Math.pow(params.vib_speed, 2.0) * 0.01;\n var vib_amp = params.vib_strength * 0.5;\n\n var len = periodSamples.length;\n var out = new Float64Array(len);\n for (var i = 0; i < len; i++) {\n vib_phase += vib_speed;\n out[i] = periodSamples[i] * (1.0 + vib_amp * Math.sin(vib_phase));\n }\n return out;\n}", "function updatecolor(){\n for(var i = 1; i < 16; i++){\n if(i%3==0) continue;\n colorsmal[i] = colorsmal[i] + 0.03*Math.sin(2*Math.PI*((framecount)/ 120.0));\n }\n \n gl.bindBuffer(gl.ARRAY_BUFFER, smalcortop);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colorsmal), gl.DYNAMIC_DRAW);\n smalcortop.itemSize = 3;\n smalcortop.numberOfItems = 8;\n gl.bindBuffer(gl.ARRAY_BUFFER, smalcormid);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colorsmal), gl.DYNAMIC_DRAW);\n smalcormid.itemSize = 3;\n smalcormid.numberOfItems = 8;\n \n\n}", "function play(startTimeInMilliseconds) {\n \n // Take each buffer and connect to audio output\n \n sources = bufferList.map((buffer, index) => {\n \n // Get buffer source node\n \n let source = audioContext.createBufferSource();\n source.buffer = buffer;\n\n let gainNode = audioContext.createGain();\n gainNode.gain.value = trackInfo[index].gain;\n gainNodes.push(gainNode);\n\n let panNode = audioContext.createStereoPanner();\n panNode.pan.value = trackInfo[index].pan;\n \n // Connect source node to gain node & gain to output\n \n source.connect(gainNode);\n gainNode.connect(panNode);\n panNode.connect(audioContext.destination)\n // gainNode.connect(audioContext.destination);\n \n return source;\n });\n \n /*\n \n sources = bufferList.map((buffer) => {\n let source = audioContext.createBufferSource();\n source.buffer = buffer;\n source.connect(audioContext.destination);\n return source;\n });\n \n */\n\n // Start audio\n\n console.log(\"TRACK IS BEING PLAYED starting at time \" + startTimeInMilliseconds);\n sources.forEach(source => {\n console.log(\"START SOURCE: \");\n console.log(source.start);\n console.log(`IS MUTED = ${isMuted}`);\n source.start(0, startTimeInMilliseconds / 1000);\n mute(!isMuted);\n // AudioBufferSourceNode.start([when][, offset][, duration]);\n });\n }", "function insertPitchPeriod(\r\n samples,\r\n position,\r\n speed,\r\n period)\r\n {\r\n var newSamples;\r\n\r\n if(speed < 0.5) {\r\n newSamples = Math.floor(period*speed/(1.0 - speed));\r\n } else {\r\n newSamples = period;\r\n remainingInputToCopy = Math.floor(period*(2.0*speed - 1.0)/(1.0 - speed));\r\n }\r\n enlargeOutputBufferIfNeeded(period + newSamples);\r\n move(outputBuffer, numOutputSamples, samples, position, period);\r\n overlapAdd(newSamples, numChannels, outputBuffer, numOutputSamples + period, samples,\r\n position + period, samples, position);\r\n numOutputSamples += period + newSamples;\r\n return newSamples;\r\n }", "setFilterFrequency(y) {\n // min 40Hz\n let min = 40;\n // max half of the sampling rate\n let max = this.myAudioContext.sampleRate / 2;\n // Logarithm (base 2) to compute how many octaves fall in the range.\n let numberOfOctaves = Math.log(max / min) / Math.LN2;\n // Compute a multiplier from 0 to 1 based on an exponential scale.\n // let multiplier = Math.pow(2, numberOfOctaves * (((2 / this.surface.clientHeight) * (this.surface.clientHeight - y)) - 1.0));\n let multiplier = Math.pow(2, numberOfOctaves * (((2 / this.canvas.height/2) * (this.canvas.height - y)) - 1.0));\n // console.log(y,max*multiplier,multiplier);\n // Get back to the frequency value between min and max.\n return max * multiplier;\n }", "function modulator() {\n // this odd construct is for safari compatibility\n this.audioCtx = new(window.AudioContext || window.webkitAudioContext)();\n\n this.samplerate = this.audioCtx.sampleRate;\n\n console.log(\"speakerSampleRate is \" + this.samplerate);\n\n this.encoder = new FskEncoder(this.samplerate);\n\n}", "function silence(duration, sampleRate) {\n duration = sampleRate * duration;\n\n var curve = [];\n for (var i=0; i < duration; i++) {\n curve.push(0);\n }\n\n return curve;\n}", "function playSoundForMillis(length) {\n var iterations = length / 2;\n for (var i = 0; i < iterations; i++) {\n for (var j = 0; j < 30; j++) {\n soundData.push(3 * Math.sin(Math.PI * (j/15)));\n }\n }\n}", "_transform(chunk,encoding,cb) {\n\n const uint8_view = new Uint8Array(chunk, 0, chunk.length);\n var dataView = new DataView(uint8_view.buffer);\n\n let iFloat = Array(this.sz*2);\n let asComplex = Array(this.sz);\n\n\n // for(let i = 0; i < this.sz*2; i+=1) {\n // iFloat[i] = dataView.getFloat64(i*8, true);\n // }\n\n for(let i = 0; i < this.sz*2; i+=2) {\n let re = dataView.getFloat64(i*8, true);\n let im = dataView.getFloat64((i*8)+8, true);\n\n asComplex[i/2] = mt.complex(re,im);\n\n iFloat[i] = re;\n iFloat[i+1] = im;\n\n // if( i < 16 ) {\n // console.log(re);\n // }\n\n }\n\n let iShort = mutil.IFloatToIShortMulti(iFloat);\n\n if( this.onFrameIShort !== null ) {\n this.onFrameIShort(iShort);\n }\n\n // console.log(\"iFloat length \" + iFloat.length);\n // console.log(iFloat.slice(0,16));\n\n // console.log(\"iShort length \" + iShort.length);\n // console.log(iShort.slice(0,16));\n\n\n this.handleDefaultStream(iFloat,iShort,asComplex);\n this.handleFineSync(iFloat,iShort,asComplex);\n this.handleAllSubcarriers(iFloat,iShort,asComplex);\n this.handleDemodData(iFloat,iShort,asComplex);\n\n\n // for(x of iFloat) {\n // console.log(x);\n // }\n\n\n this.uint.frame_track_counter++;\n cb();\n }", "function resetCallbackAPIAudioBuffer(APISampleRate, bufferAlloc) {\n\taudioContextSampleBuffer = getFloat32(webAudioMaxBufferSize);\n\taudioBufferSize = webAudioMaxBufferSize;\n\tresampleBufferStart = 0;\n\tresampleBufferEnd = 0;\n\tresampleBufferSize = Math.max(webAudioMaxBufferSize * Math.ceil(XAudioJSSampleRate / APISampleRate), samplesPerCallback) << 1;\n\tif (webAudioMono) {\n\t\t//MONO Handling:\n\t\tresampled = getFloat32Flat(resampleBufferSize);\n\t\tresampleControl = new Resampler(XAudioJSSampleRate, APISampleRate, 1, resampleBufferSize, true);\n\t\toutputConvert = generateFlashMonoString;\n\t}\n\telse {\n\t\t//STEREO Handling:\n\t\tresampleBufferSize <<= 1;\n\t\tresampled = getFloat32Flat(resampleBufferSize);\n\t\tresampleControl = new Resampler(XAudioJSSampleRate, APISampleRate, 2, resampleBufferSize, true);\n\t\toutputConvert = generateFlashStereoString;\n\t}\n}", "function getViewAudioTrack(trackInfo) {\n\n console.log(\"TRACKINFO\");\n console.log(trackInfo);\n\n let sounds = { main: {}, reverb: {} }; // Initialized in init()\n\n let bufferList, // A list of audio buffers (i.e. sound files)\n sources, // A list of sound sources which are hooked up to audio graphs\n gainNodes = [], // Array of gain nodes (main and reverb)\n isMuted = false;\n\n // play() takes the buffers (audio sources) and \n // creates an audio graph out of each\n // This is a method common to all Views\n // The start time in MS\n\n function play(startTimeInMilliseconds) {\n \n // Take each buffer and connect to audio output\n \n sources = bufferList.map((buffer, index) => {\n \n // Get buffer source node\n \n let source = audioContext.createBufferSource();\n source.buffer = buffer;\n\n let gainNode = audioContext.createGain();\n gainNode.gain.value = trackInfo[index].gain;\n gainNodes.push(gainNode);\n\n let panNode = audioContext.createStereoPanner();\n panNode.pan.value = trackInfo[index].pan;\n \n // Connect source node to gain node & gain to output\n \n source.connect(gainNode);\n gainNode.connect(panNode);\n panNode.connect(audioContext.destination)\n // gainNode.connect(audioContext.destination);\n \n return source;\n });\n \n /*\n \n sources = bufferList.map((buffer) => {\n let source = audioContext.createBufferSource();\n source.buffer = buffer;\n source.connect(audioContext.destination);\n return source;\n });\n \n */\n\n // Start audio\n\n console.log(\"TRACK IS BEING PLAYED starting at time \" + startTimeInMilliseconds);\n sources.forEach(source => {\n console.log(\"START SOURCE: \");\n console.log(source.start);\n console.log(`IS MUTED = ${isMuted}`);\n source.start(0, startTimeInMilliseconds / 1000);\n mute(!isMuted);\n // AudioBufferSourceNode.start([when][, offset][, duration]);\n });\n }\n \n // Stop audio\n \n function stop() {\n console.log(\"TRACK IS BEING STOPPED\");\n sources.forEach(source => source.stop(0));\n }\n\n function setGain(gain) {\n console.log(\"Setting gain to \" + gain);\n gainNodes.forEach(\n gainNode => gainNode.gain.value = gain * gain\n );\n // gainNode.gain.value = gain * gain;\n }\n \n // Won't ever change in mid-play - so maybe \n // not necessary as a stand-alone function\n\n function setPan(pan) {\n console.log(\"Setting pan to \" + pan);\n // panNode.gain.value = pan; THIS NEEDS TO BE IMPLEMENTED\n }\n \n function mute(muteStatus) {\n isMuted = (muteStatus);\n console.log(\"TURNING MUTE STATUS TO \" + muteStatus);\n setGain(muteStatus ? 0 : 1);\n }\n\n // Find the longest duration of the buffers\n\n function getLongestDuration() {\n\n let longestDuration = bufferList.reduce((longestDuration, buffer) => {\n return buffer.duration > longestDuration ? buffer.duration : longestDuration\n }, 0);\n\n return longestDuration * 1000; // Convert to ms\n }\n\n function init2(trackInfo) {\n\n if (trackInfo.mainFilename !== undefined) {\n sounds.main = {\n\n }\n }\n\n sounds.reverb = {\n\n }\n }\n\n function init(trackInfo) {\n\n // Create list of filenames for audio files (can't be undefined)\n\n let trackFilenames = trackInfo.map(track => track.filename);\n\n //let trackFilenames = [trackInfo.mainFilename, trackInfo.reverbFilename].filter(\n // filename => filename !== undefined\n //);\n\n function onFinishedLoading(buffers) { \n bufferList = buffers;\n console.log('Loaded audio files:' + trackFilenames);\n }\n\n // Load audio and call onFinishedLoading()\n\n getAudioFromFilenames(audioContext, trackFilenames, onFinishedLoading);\n\n //let bufferLoader = new AudioLoader(audioContext, trackFilenames, onFinishedLoading);\n //bufferLoader.load(); \n }\n\n init(trackInfo);\n\n return {\n play: play,\n stop: stop,\n mute: mute,\n getDuration: getLongestDuration\n }\n }" ]
[ "0.78334713", "0.78334713", "0.63576996", "0.63576996", "0.61745924", "0.577996", "0.5691106", "0.5647514", "0.5561082", "0.55510974", "0.5547345", "0.5529315", "0.5519007", "0.54949784", "0.5476185", "0.54661536", "0.5402161", "0.5346005", "0.5278198", "0.5256365", "0.5247827", "0.5234737", "0.51817095", "0.51582557", "0.5133318", "0.50798786", "0.5054737", "0.5048463", "0.5029236", "0.5028153", "0.5018567", "0.50119996", "0.49879673", "0.4979994", "0.49768382", "0.49697247", "0.49596518", "0.495712", "0.49422538", "0.49073005", "0.48969597", "0.48914906", "0.48887783", "0.48810852", "0.48810852", "0.4864102", "0.4847456", "0.48434684", "0.48411047", "0.48298514", "0.4828477", "0.4812558", "0.48116007", "0.4810768", "0.47987887", "0.4792551", "0.4784778", "0.4784248", "0.4781136", "0.477959", "0.4773205", "0.477082", "0.4767777", "0.4765863", "0.47617126", "0.4759056", "0.47459665", "0.47459665", "0.47434554", "0.47427306", "0.47411385", "0.47392386", "0.47351906", "0.47304335", "0.47259656", "0.4724635", "0.47057223", "0.47015262", "0.47002628", "0.46996805", "0.46799505", "0.4674376", "0.46723756", "0.46519613", "0.46453494", "0.46431723", "0.4639871", "0.46308282", "0.4627161", "0.46199298", "0.4610955", "0.46059445", "0.46035323", "0.45996094", "0.4597505", "0.4587477", "0.45847142", "0.45756888", "0.4572949" ]
0.8593268
1