Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Funzione controllo del numero
function numberIsNumber(userInput) { var userInputNumber = parseInt(userInput) if (Number.isNaN(userInputNumber) && !userInput) { return false } return true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function presionarNumero(numero){\n console.log(\"numero\",numero)\n\n calculadora.agregarNumero(numero)\n actualizarDisplay()\n}", "function getNumero(numero) {\n if (numero === void 0) { numero = 12; }\n return 'el numero es ' + numero;\n}", "function numero(xx) { //recoge el número pul...
[ "0.7163246", "0.6658498", "0.66433555", "0.6590076", "0.6584708", "0.6528237", "0.64961225", "0.64214945", "0.6362474", "0.6327545", "0.63226867", "0.63208914", "0.63130873", "0.62982255", "0.6294038", "0.6226135", "0.6211596", "0.6205355", "0.61994696", "0.6197704", "0.61968...
0.0
-1
Funzione confronto di due Array (ricordati il minore per primo)
function checkInArray(tocheckArray, mainArray) { var checkedItems = [] for (var i = 0; i < tocheckArray.length; i++) { for (var j = 0; j < mainArray.length; j++) { if (tocheckArray[i] === mainArray[j]) { checkedItems.push(mainArray[j])} } } console.log(checkedItems) return checkedItems }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rimuovi(){\n\n\tvar j = 0;\n\n\t// Per ogni elemento controllo la condizione\n\t// Se è idoneo, copio elemento in J\n\n\tfor(var i = 0; i<persone.length; i++){\n\t\tif(persone[i].altezza > 1.5) {\n\t\t\tpersone[j++] = persone[i];\n\t\t}\n\t}\n\t// Aggiorno array con valori nuovi messi in J\n\tpersone.leng...
[ "0.6734216", "0.6712348", "0.63883847", "0.6345884", "0.6298861", "0.62926435", "0.6195799", "0.61523443", "0.6146546", "0.6108231", "0.6102607", "0.60934156", "0.60456514", "0.604099", "0.5945853", "0.593791", "0.5933508", "0.5921939", "0.59188265", "0.5912921", "0.58974916"...
0.0
-1
Counts number of trailing zeros
function countTrailingZeros(v) { var c = 32; v &= -v; if (v) c--; if (v & 0x0000FFFF) c -= 16; if (v & 0x00FF00FF) c -= 8; if (v & 0x0F0F0F0F) c -= 4; if (v & 0x33333333) c -= 2; if (v & 0x55555555) c -= 1; return c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countTrailingZeroes(n) {\n let currNumber = n;\n let count = 0;\n\n while(currNumber > 0) {\n if(currNumber % 10 === 0) {\n count++;\n currNumber /= 10;\n } else {\n return count;\n }\n }\n\n return count;\n}", "function zeros(test) {\r\n let count = 0;\r\...
[ "0.7691476", "0.72729003", "0.72194046", "0.72079146", "0.72079146", "0.72079146", "0.7200482", "0.7189058", "0.7183695", "0.7181872", "0.7159809", "0.70866984", "0.6943503", "0.69381714", "0.69381714", "0.69381714", "0.69381714", "0.69381714", "0.69381714", "0.69381714", "0....
0.7219277
21
Class: Buffer ============= The Buffer constructor returns instances of `Uint8Array` that are augmented with function properties for all the node `Buffer` API functions. We use `Uint8Array` so that square bracket notation works as expected it returns a single octet. By augmenting the instances, we can avoid modifying the `Uint8Array` prototype.
function Buffer (arg) { if (!(this instanceof Buffer)) { // Avoid going through an ArgumentsAdaptorTrampoline in the common case. if (arguments.length > 1) return new Buffer(arg, arguments[1]) return new Buffer(arg) } if (!Buffer.TYPED_ARRAY_SUPPORT) { this.length = 0 this.parent = undefined } // Common case. if (typeof arg === 'number') { return fromNumber(this, arg) } // Slightly less common case. if (typeof arg === 'string') { return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8') } // Unusual. return fromObject(this, arg) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0...
[ "0.7388503", "0.7388503", "0.7388503", "0.7388503", "0.7388503", "0.7388503", "0.7388503", "0.7384735", "0.7384735", "0.7384735", "0.7384735", "0.7384735", "0.7384735", "0.7384735", "0.7384735", "0.7384735", "0.7384735", "0.7384735", "0.7384735", "0.7384735", "0.7384735", "...
0.7126436
64
Duplicate of fromArray() to keep fromArray() monomorphic.
function fromTypedArray (that, array) { var length = checked(array.length) | 0 that = allocate(that, length) // Truncating the elements is probably not what people expect from typed // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior // of the old Buffer constructor. for (var i = 0; i < length; i += 1) { that[i] = array[i] & 255 } return that }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fromArray(as) {\n // For some reason, TypeScript does not infer this type correctly\n var b = build;\n var f = as.reduce(b, []);\n return f;\n }", "function __spreadArray(to, from) {\n for (var i = 0, il = from.length, j = to....
[ "0.65889376", "0.65335846", "0.6512674", "0.64970803", "0.6463127", "0.6455966", "0.644092", "0.63979745", "0.63979745", "0.63979745", "0.63979745", "0.63100034", "0.63100034", "0.62795615", "0.6261167", "0.6261167", "0.6261167", "0.6261167", "0.6261167", "0.6261167", "0.6261...
0.62321496
75
Need to make sure that buffer isn't trying to write out of bounds.
function checkOffset (offset, ext, length) { if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeBuffer(buffer, pos, src) {\n src.copy(buffer, pos)\n return src.length\n}", "function writeBuffer(buffer, pos, src) {\n src.copy(buffer, pos)\n return src.length\n}", "ensure(n) {\n let minsize = this.pos + n;\n if (minsize > this.capacity) {\n let cap = this.capacity * 2;\n w...
[ "0.6671098", "0.6671098", "0.6633269", "0.6519824", "0.6382888", "0.62769973", "0.6255935", "0.6233706", "0.6233706", "0.6106861", "0.6035961", "0.6019949", "0.5982479", "0.59593046", "0.59507954", "0.59507954", "0.59507954", "0.59507954", "0.59507954", "0.59507954", "0.59507...
0.0
-1
This function generates very simple loops analogous to how you typically traverse arrays (the outermost loop corresponds to the slowest changing index, the innermost loop to the fastest changing index) TODO: If two arrays have the same strides (and offsets) there is potential for decreasing the number of "pointers" and related variables. The drawback is that the type signature would become more specific and that there would thus be less potential for caching, but it might still be worth it, especially when dealing with large numbers of arguments.
function innerFill(order, proc, body) { var dimension = order.length , nargs = proc.arrayArgs.length , has_index = proc.indexArgs.length>0 , code = [] , vars = [] , idx=0, pidx=0, i, j for(i=0; i<dimension; ++i) { // Iteration variables vars.push(["i",i,"=0"].join("")) } //Compute scan deltas for(j=0; j<nargs; ++j) { for(i=0; i<dimension; ++i) { pidx = idx idx = order[i] if(i === 0) { // The innermost/fastest dimension's delta is simply its stride vars.push(["d",j,"s",i,"=t",j,"p",idx].join("")) } else { // For other dimensions the delta is basically the stride minus something which essentially "rewinds" the previous (more inner) dimension vars.push(["d",j,"s",i,"=(t",j,"p",idx,"-s",pidx,"*t",j,"p",pidx,")"].join("")) } } } code.push("var " + vars.join(",")) //Scan loop for(i=dimension-1; i>=0; --i) { // Start at largest stride and work your way inwards idx = order[i] code.push(["for(i",i,"=0;i",i,"<s",idx,";++i",i,"){"].join("")) } //Push body of inner loop code.push(body) //Advance scan pointers for(i=0; i<dimension; ++i) { pidx = idx idx = order[i] for(j=0; j<nargs; ++j) { code.push(["p",j,"+=d",j,"s",i].join("")) } if(has_index) { if(i > 0) { code.push(["index[",pidx,"]-=s",pidx].join("")) } code.push(["++index[",idx,"]"].join("")) } code.push("}") } return code.join("\n") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loopTheLoop(firstSize, secondSize) {\n // not n^2 because of different inputs\n for (let i = 0; i < firstSize; i++) {\n for (let j = 1; j < secondSize; j++) {\n console.log(i, j);\n }\n }\n}", "function innerFill(order, proc, body) {\n var dimension = order.length\n , nargs = proc.arra...
[ "0.61390644", "0.5961583", "0.59225935", "0.59225935", "0.59225935", "0.58168125", "0.58168125", "0.55257344", "0.55016446", "0.5497182", "0.54922116", "0.5455689", "0.5452755", "0.54517114", "0.54517114", "0.54517114", "0.54517114", "0.5385444", "0.5385444", "0.5385444", "0....
0.5941542
5
Generate "outer" loops that loop over blocks of data, applying "inner" loops to the blocks by manipulating the local variables in such a way that the inner loop only "sees" the current block. TODO: If this is used, then the previous declaration (done by generateCwiseOp) of s is essentially unnecessary. I believe the s are not used elsewhere (in particular, I don't think they're used in the pre/post parts and "shape" is defined independently), so it would be possible to make defining the s dependent on what loop method is being used.
function outerFill(matched, order, proc, body) { var dimension = order.length , nargs = proc.arrayArgs.length , blockSize = proc.blockSize , has_index = proc.indexArgs.length > 0 , code = [] for(var i=0; i<nargs; ++i) { code.push(["var offset",i,"=p",i].join("")) } //Generate loops for unmatched dimensions // The order in which these dimensions are traversed is fairly arbitrary (from small stride to large stride, for the first argument) // TODO: It would be nice if the order in which these loops are placed would also be somehow "optimal" (at the very least we should check that it really doesn't hurt us if they're not). for(var i=matched; i<dimension; ++i) { code.push(["for(var j"+i+"=SS[", order[i], "]|0;j", i, ">0;){"].join("")) // Iterate back to front code.push(["if(j",i,"<",blockSize,"){"].join("")) // Either decrease j by blockSize (s = blockSize), or set it to zero (after setting s = j). code.push(["s",order[i],"=j",i].join("")) code.push(["j",i,"=0"].join("")) code.push(["}else{s",order[i],"=",blockSize].join("")) code.push(["j",i,"-=",blockSize,"}"].join("")) if(has_index) { code.push(["index[",order[i],"]=j",i].join("")) } } for(var i=0; i<nargs; ++i) { var indexStr = ["offset"+i] for(var j=matched; j<dimension; ++j) { indexStr.push(["j",j,"*t",i,"p",order[j]].join("")) } code.push(["p",i,"=(",indexStr.join("+"),")"].join("")) } code.push(innerFill(order, proc, body)) for(var i=matched; i<dimension; ++i) { code.push("}") } return code.join("\n") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateCWiseOp(proc, typesig) {\n\n //Compute dimension\n // Arrays get put first in typesig, and there are two entries per array (dtype and order), so this gets the number of dimensions in the first array arg.\n var dimension = (typesig[1].length - Math.abs(proc.arrayBlockIndices[0]))|0\n var orders...
[ "0.7018799", "0.7018799", "0.7018799", "0.7018799", "0.69928503", "0.69928503", "0.69928503", "0.69928503", "0.6851732", "0.6851732", "0.59302425", "0.59302425", "0.5589564", "0.5558303", "0.5558303", "0.5558303", "0.55195004", "0.55195004", "0.55195004", "0.55195004", "0.548...
0.5061742
29
Count the number of compatible inner orders This is the length of the longest common prefix of the arrays in orders. Each array in orders lists the dimensions of the correspond ndarray in order of increasing stride. This is thus the maximum number of dimensions that can be efficiently traversed by simple nested loops for all arrays.
function countMatches(orders) { var matched = 0, dimension = orders[0].length while(matched < dimension) { for(var j=1; j<orders.length; ++j) { if(orders[j][matched] !== orders[0][matched]) { return matched } } ++matched } return matched }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countMatches(orders) {\n var matched = 0, dimension = orders[0].length\n while(matched < dimension) {\n for(var j=1; j<orders.length; ++j) {\n if(orders[j][matched] !== orders[0][matched]) {\n return matched\n }\n }\n ++matched\n }\n return matched\n}", "function countMatch...
[ "0.61891526", "0.61891526", "0.61891526", "0.61891526", "0.61891526", "0.61891526", "0.6147925", "0.6147925", "0.5894984", "0.56328326", "0.55223143", "0.54141325", "0.5352982", "0.5352982", "0.5352982", "0.5352982", "0.5352982", "0.5352982", "0.5352982", "0.5352982", "0.5340...
0.621481
3
Processes a block according to the given data types Replaces variable names by different ones, either "local" ones (that are then ferried in and out of the given array) or ones matching the arguments that the function performing the ultimate loop will accept.
function processBlock(block, proc, dtypes) { var code = block.body var pre = [] var post = [] for(var i=0; i<block.args.length; ++i) { var carg = block.args[i] if(carg.count <= 0) { continue } var re = new RegExp(carg.name, "g") var ptrStr = "" var arrNum = proc.arrayArgs.indexOf(i) switch(proc.argTypes[i]) { case "offset": var offArgIndex = proc.offsetArgIndex.indexOf(i) var offArg = proc.offsetArgs[offArgIndex] arrNum = offArg.array ptrStr = "+q" + offArgIndex // Adds offset to the "pointer" in the array case "array": ptrStr = "p" + arrNum + ptrStr var localStr = "l" + i var arrStr = "a" + arrNum if (proc.arrayBlockIndices[arrNum] === 0) { // Argument to body is just a single value from this array if(carg.count === 1) { // Argument/array used only once(?) if(dtypes[arrNum] === "generic") { if(carg.lvalue) { pre.push(["var ", localStr, "=", arrStr, ".get(", ptrStr, ")"].join("")) // Is this necessary if the argument is ONLY used as an lvalue? (keep in mind that we can have a += something, so we would actually need to check carg.rvalue) code = code.replace(re, localStr) post.push([arrStr, ".set(", ptrStr, ",", localStr,")"].join("")) } else { code = code.replace(re, [arrStr, ".get(", ptrStr, ")"].join("")) } } else { code = code.replace(re, [arrStr, "[", ptrStr, "]"].join("")) } } else if(dtypes[arrNum] === "generic") { pre.push(["var ", localStr, "=", arrStr, ".get(", ptrStr, ")"].join("")) // TODO: Could we optimize by checking for carg.rvalue? code = code.replace(re, localStr) if(carg.lvalue) { post.push([arrStr, ".set(", ptrStr, ",", localStr,")"].join("")) } } else { pre.push(["var ", localStr, "=", arrStr, "[", ptrStr, "]"].join("")) // TODO: Could we optimize by checking for carg.rvalue? code = code.replace(re, localStr) if(carg.lvalue) { post.push([arrStr, "[", ptrStr, "]=", localStr].join("")) } } } else { // Argument to body is a "block" var reStrArr = [carg.name], ptrStrArr = [ptrStr] for(var j=0; j<Math.abs(proc.arrayBlockIndices[arrNum]); j++) { reStrArr.push("\\s*\\[([^\\]]+)\\]") ptrStrArr.push("$" + (j+1) + "*t" + arrNum + "b" + j) // Matched index times stride } re = new RegExp(reStrArr.join(""), "g") ptrStr = ptrStrArr.join("+") if(dtypes[arrNum] === "generic") { /*if(carg.lvalue) { pre.push(["var ", localStr, "=", arrStr, ".get(", ptrStr, ")"].join("")) // Is this necessary if the argument is ONLY used as an lvalue? (keep in mind that we can have a += something, so we would actually need to check carg.rvalue) code = code.replace(re, localStr) post.push([arrStr, ".set(", ptrStr, ",", localStr,")"].join("")) } else { code = code.replace(re, [arrStr, ".get(", ptrStr, ")"].join("")) }*/ throw new Error("cwise: Generic arrays not supported in combination with blocks!") } else { // This does not produce any local variables, even if variables are used multiple times. It would be possible to do so, but it would complicate things quite a bit. code = code.replace(re, [arrStr, "[", ptrStr, "]"].join("")) } } break case "scalar": code = code.replace(re, "Y" + proc.scalarArgs.indexOf(i)) break case "index": code = code.replace(re, "index") break case "shape": code = code.replace(re, "shape") break } } return [pre.join("\n"), code, post.join("\n")].join("\n").trim() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processBlock(block, proc, dtypes) {\n var code = block.body\n var pre = []\n var post = []\n for(var i=0; i<block.args.length; ++i) {\n var carg = block.args[i]\n if(carg.count <= 0) {\n continue\n }\n var re = new RegExp(carg.name, \"g\")\n var ptrStr = \"\"\n var arrNum = proc...
[ "0.69868785", "0.69868785", "0.69868785", "0.69868785", "0.6948387", "0.6948387", "0.6937791", "0.6937791", "0.5751973", "0.5527704", "0.5484366", "0.54475564", "0.5349662", "0.5223466", "0.5180604", "0.492264", "0.47843727", "0.47641605", "0.47224653", "0.4700773", "0.469432...
0.69786483
7
Generates a cwise operator
function generateCWiseOp(proc, typesig) { //Compute dimension // Arrays get put first in typesig, and there are two entries per array (dtype and order), so this gets the number of dimensions in the first array arg. var dimension = (typesig[1].length - Math.abs(proc.arrayBlockIndices[0]))|0 var orders = new Array(proc.arrayArgs.length) var dtypes = new Array(proc.arrayArgs.length) for(var i=0; i<proc.arrayArgs.length; ++i) { dtypes[i] = typesig[2*i] orders[i] = typesig[2*i+1] } //Determine where block and loop indices start and end var blockBegin = [], blockEnd = [] // These indices are exposed as blocks var loopBegin = [], loopEnd = [] // These indices are iterated over var loopOrders = [] // orders restricted to the loop indices for(var i=0; i<proc.arrayArgs.length; ++i) { if (proc.arrayBlockIndices[i]<0) { loopBegin.push(0) loopEnd.push(dimension) blockBegin.push(dimension) blockEnd.push(dimension+proc.arrayBlockIndices[i]) } else { loopBegin.push(proc.arrayBlockIndices[i]) // Non-negative loopEnd.push(proc.arrayBlockIndices[i]+dimension) blockBegin.push(0) blockEnd.push(proc.arrayBlockIndices[i]) } var newOrder = [] for(var j=0; j<orders[i].length; j++) { if (loopBegin[i]<=orders[i][j] && orders[i][j]<loopEnd[i]) { newOrder.push(orders[i][j]-loopBegin[i]) // If this is a loop index, put it in newOrder, subtracting loopBegin, to make sure that all loopOrders are using a common set of indices. } } loopOrders.push(newOrder) } //First create arguments for procedure var arglist = ["SS"] // SS is the overall shape over which we iterate var code = ["'use strict'"] var vars = [] for(var j=0; j<dimension; ++j) { vars.push(["s", j, "=SS[", j, "]"].join("")) // The limits for each dimension. } for(var i=0; i<proc.arrayArgs.length; ++i) { arglist.push("a"+i) // Actual data array arglist.push("t"+i) // Strides arglist.push("p"+i) // Offset in the array at which the data starts (also used for iterating over the data) for(var j=0; j<dimension; ++j) { // Unpack the strides into vars for looping vars.push(["t",i,"p",j,"=t",i,"[",loopBegin[i]+j,"]"].join("")) } for(var j=0; j<Math.abs(proc.arrayBlockIndices[i]); ++j) { // Unpack the strides into vars for block iteration vars.push(["t",i,"b",j,"=t",i,"[",blockBegin[i]+j,"]"].join("")) } } for(var i=0; i<proc.scalarArgs.length; ++i) { arglist.push("Y" + i) } if(proc.shapeArgs.length > 0) { vars.push("shape=SS.slice(0)") // Makes the shape over which we iterate available to the user defined functions (so you can use width/height for example) } if(proc.indexArgs.length > 0) { // Prepare an array to keep track of the (logical) indices, initialized to dimension zeroes. var zeros = new Array(dimension) for(var i=0; i<dimension; ++i) { zeros[i] = "0" } vars.push(["index=[", zeros.join(","), "]"].join("")) } for(var i=0; i<proc.offsetArgs.length; ++i) { // Offset arguments used for stencil operations var off_arg = proc.offsetArgs[i] var init_string = [] for(var j=0; j<off_arg.offset.length; ++j) { if(off_arg.offset[j] === 0) { continue } else if(off_arg.offset[j] === 1) { init_string.push(["t", off_arg.array, "p", j].join("")) } else { init_string.push([off_arg.offset[j], "*t", off_arg.array, "p", j].join("")) } } if(init_string.length === 0) { vars.push("q" + i + "=0") } else { vars.push(["q", i, "=", init_string.join("+")].join("")) } } //Prepare this variables var thisVars = uniq([].concat(proc.pre.thisVars) .concat(proc.body.thisVars) .concat(proc.post.thisVars)) vars = vars.concat(thisVars) code.push("var " + vars.join(",")) for(var i=0; i<proc.arrayArgs.length; ++i) { code.push("p"+i+"|=0") } //Inline prelude if(proc.pre.body.length > 3) { code.push(processBlock(proc.pre, proc, dtypes)) } //Process body var body = processBlock(proc.body, proc, dtypes) var matched = countMatches(loopOrders) if(matched < dimension) { code.push(outerFill(matched, loopOrders[0], proc, body)) // TODO: Rather than passing loopOrders[0], it might be interesting to look at passing an order that represents the majority of the arguments for example. } else { code.push(innerFill(loopOrders[0], proc, body)) } //Inline epilog if(proc.post.body.length > 3) { code.push(processBlock(proc.post, proc, dtypes)) } if(proc.debug) { console.log("-----Generated cwise routine for ", typesig, ":\n" + code.join("\n") + "\n----------") } var loopName = [(proc.funcName||"unnamed"), "_cwise_loop_", orders[0].join("s"),"m",matched,typeSummary(dtypes)].join("") var f = new Function(["function ",loopName,"(", arglist.join(","),"){", code.join("\n"),"} return ", loopName].join("")) return f() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "CCF(op){\n op.subtraction_flag = 0;\n op.half_carry_flag = 0;\n op.carry_flag ^= 1;\n }", "function gen_op_clrex()\n{\n gen_opc_ptr.push({func:op_clrex});\n}", "function gen_op_logicq_cc()\n{\n gen_opc_ptr.push({func:op_logicq_cc});\n}", "function gen_op_logic_T0_cc()\n{\n gen_opc_ptr.push...
[ "0.634074", "0.62518406", "0.6250411", "0.62167865", "0.6171341", "0.6124577", "0.6124577", "0.5979284", "0.5831132", "0.57429564", "0.57429564", "0.57429564", "0.57429564", "0.5656328", "0.5619601", "0.5619601", "0.5546452", "0.55394644", "0.54957616", "0.54555213", "0.54321...
0.5659622
16
Retrieves a local variable
function createLocal(id) { var nstr = prefix + id.replace(/\_/g, "__") localVars.push(nstr) return nstr }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVar(){\n var r = varStack[0];\n varStack.shift();\n return r;\n}", "function h$readLocalTVar(t, tv) {\n if(t.checkRead !== null) {\n t.checkRead.add(tv);\n }\n var t0 = t;\n while(t0 !== null) {\n var v = t0.tvars.get(tv);\n if(v !== null) {\n ...
[ "0.7219391", "0.7143212", "0.7135867", "0.7135867", "0.7135867", "0.7074074", "0.6841914", "0.68389076", "0.6784249", "0.66357875", "0.65949667", "0.65949667", "0.6580295", "0.6563201", "0.6563201", "0.6555324", "0.6517439", "0.65061957", "0.6460275", "0.6442359", "0.64340425...
0.0
-1
Creates a this variable
function createThisVar(id) { var nstr = "this_" + id.replace(/\_/g, "__") thisVars.push(nstr) return nstr }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "newInstance() {\r\n\t\t\t\t\tvar base, ref1;\r\n\t\t\t\t\tbase = ((ref1 = this.variable) != null ? ref1.base : void 0) || this.variable;\r\n\t\t\t\t\tif (base instanceof Call && !base.isNew) {\r\n\t\t\t\t\t\tbase.newInstance();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.isNew = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthi...
[ "0.6620614", "0.6212397", "0.6086407", "0.60396516", "0.596879", "0.591245", "0.58820903", "0.5843658", "0.580857", "0.5808394", "0.58077145", "0.57973707", "0.5777957", "0.576941", "0.57302535", "0.5727041", "0.5709703", "0.568413", "0.56579596", "0.56461936", "0.5634682", ...
0.6639504
0
Rewrites an ast node
function rewrite(node, nstr) { var lo = node.range[0], hi = node.range[1] for(var i=lo+1; i<hi; ++i) { exploded[i] = "" } exploded[lo] = nstr }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modifyAST(err, astNode, cb){\n\tif(!err){\n\t\tconsole.log(JSON.stringify(astNode, false, 2));\n\t\tcb(astNode);\n\t}\n\t\n}", "function traverseTree(replacementNode, functionName, ast) {\n console.log('traverse called');\n estraverse.replace(ast, {\n enter(node) {\n if (node.type === 'Functio...
[ "0.67154425", "0.611703", "0.5962941", "0.5861715", "0.5789381", "0.5730407", "0.56855476", "0.56544405", "0.5600378", "0.5600378", "0.55380404", "0.55380404", "0.5503671", "0.545443", "0.545443", "0.5417217", "0.53931147", "0.53647095", "0.53430986", "0.5317483", "0.53174305...
0.49954167
35
Returns the source of an identifier
function source(node) { return exploded.slice(node.range[0], node.range[1]).join("") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resolveId ( source, importer ) {\n return source;\n }", "get sourceId() {\n\t\treturn this.__sourceId;\n\t}", "getIdentifier () {\n return (this._identifier);\n }", "getSourceId(source) {\n let sourceId = this.sourceIds.get(source);\n if (sourceId === undefined) {\n ...
[ "0.697314", "0.6805347", "0.66996", "0.64324826", "0.63143957", "0.6301391", "0.6252789", "0.6216562", "0.614984", "0.6107986", "0.6096205", "0.5918836", "0.5869289", "0.5854014", "0.5845814", "0.5838256", "0.5838256", "0.5838256", "0.5838256", "0.5838256", "0.58195627", "0...
0.0
-1
Ensure the condition is true, otherwise throw an error. This is only to have a better contract semantic, i.e. another safety net to catch a logic error. The condition shall be fulfilled in normal case. Do NOT use this to enforce a certain condition on any user input.
function assert(condition, message) { /* istanbul ignore if */ if (!condition) { throw new Error('ASSERT: ' + message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check(condition, message) {\n if (condition === false) {\n throw new Error(message);\n }\n }", "function check(condition, message) {\n if (!condition) {\n throw Error(message)\n }\n}", "function invariant(condition, message) {\n var booleanCond...
[ "0.72930515", "0.7207999", "0.6812781", "0.6765069", "0.66446507", "0.6640108", "0.6640108", "0.6640108", "0.6640108", "0.6640108", "0.6640108", "0.6636474", "0.6636474", "0.6636474", "0.6636474", "0.6636474", "0.6636474", "0.6636474", "0.6636474", "0.6628533", "0.6478385", ...
0.60113925
48
7.6 Identifier Names and Identifiers
function isIdentifierStart(ch) { return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore) (ch >= 0x41 && ch <= 0x5A) || // A..Z (ch >= 0x61 && ch <= 0x7A) || // a..z (ch === 0x5C) || // \ (backslash) ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function identifer() {\n\t var result = (0, _parser.repeat1)((0, _parser.choice)((0, _parser.range)('a', 'z'), (0, _parser.range)('A', 'Z'), (0, _parser.ch)('_'), (0, _parser.ch)('$')));\n\t return (0, _parser.action)(result, function (ast) {\n\t return {\n\t type: 'identifer',\n\t ...
[ "0.7836606", "0.7385199", "0.7291059", "0.7141224", "0.7141224", "0.7018309", "0.70124626", "0.6906519", "0.689609", "0.68921226", "0.6889619", "0.68158567", "0.6810275", "0.6810275", "0.6807493", "0.67689055", "0.67689055", "0.6741417", "0.6687659", "0.6661118", "0.6644244",...
0.0
-1
7.6.1.2 Future Reserved Words
function isFutureReservedWord(id) { switch (id) { case 'class': case 'enum': case 'export': case 'extends': case 'import': case 'super': return true; default: return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reserved(){}", "function isFutureReservedWord(id) {\n return false;\n }", "function isReserved(str){var c=(str+'').charCodeAt(0);return c===0x24||c===0x5F;}", "function isReserved(str){var c=(str+'').charCodeAt(0);return c===0x24||c===0x5F;}", "function isReserved(str){var c=(str+'').cha...
[ "0.72495985", "0.6624807", "0.63884044", "0.63884044", "0.63884044", "0.63262403", "0.6323935", "0.63224894", "0.62571216", "0.6222904", "0.6222904", "0.61849046", "0.6172429", "0.6172429", "0.6172429", "0.6172429", "0.6172429", "0.61564004", "0.6147203", "0.6132719", "0.6098...
0.59695417
63
Return true if there is a line terminator before the next token.
function peekLineTerminator() { var pos, line, start, found; pos = index; line = lineNumber; start = lineStart; skipComment(); found = lineNumber !== line; index = pos; lineNumber = line; lineStart = start; return found; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function peekLineTerminator$928() {\n return lookahead$891.lineNumber !== lineNumber$881;\n }", "function peekLineTerminator() {\n var pos, line, start, found;\n \n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n ...
[ "0.75550944", "0.7486989", "0.74281865", "0.74191064", "0.74170375", "0.7395164", "0.7395164", "0.7299317", "0.7146332", "0.69136053", "0.6864579", "0.68360275", "0.6830869", "0.6830869", "0.6830869", "0.6827602", "0.6827602", "0.68084955", "0.66874665", "0.6642971", "0.66300...
0.7454905
19
Throw an exception because of the token.
function throwUnexpected(token) { if (token.type === Token.EOF) { throwError(token, Messages.UnexpectedEOS); } if (token.type === Token.NumericLiteral) { throwError(token, Messages.UnexpectedNumber); } if (token.type === Token.StringLiteral) { throwError(token, Messages.UnexpectedString); } if (token.type === Token.Identifier) { throwError(token, Messages.UnexpectedIdentifier); } if (token.type === Token.Keyword) { if (isFutureReservedWord(token.value)) { throwError(token, Messages.UnexpectedReserved); } else if (strict && isStrictModeReservedWord(token.value)) { throwErrorTolerant(token, Messages.StrictReservedWord); return; } throwError(token, Messages.UnexpectedToken, token.value); } // BooleanLiteral, NullLiteral, or Punctuator. throwError(token, Messages.UnexpectedToken, token.value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function throwUnexpected(token) {\n throwError(token, Messages.UnexpectedToken, token.value);\n }", "function throwUnexpected(token) {\n throwError(token, Messages.UnexpectedToken, token.value);\n }", "function throwUnexpected(token) {\n throwError(token, Messages.UnexpectedToken, to...
[ "0.7725581", "0.7725581", "0.7725581", "0.7140519", "0.69908136", "0.6965912", "0.6947362", "0.6947362", "0.69460917", "0.6942947", "0.6921778", "0.6921778", "0.69079626", "0.68972546", "0.68972546", "0.6895765", "0.6895765", "0.6895765", "0.6895765", "0.6895765", "0.68803674...
0.689666
23
Expect the next token to match the specified punctuator. If not, an exception will be thrown.
function expect(value) { var token = lex(); if (token.type !== Token.Punctuator || token.value !== value) { throwUnexpected(token); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPunctuatorToken(token) {\n var kind = token.kind;\n return kind === _tokenKind.TokenKind.BANG || kind === _tokenKind.TokenKind.DOLLAR || kind === _tokenKind.TokenKind.AMP || kind === _tokenKind.TokenKind.PAREN_L || kind === _tokenKind.TokenKind.PAREN_R || kind === _tokenKind.TokenKind.SPREAD || kind =...
[ "0.7801693", "0.7778668", "0.7762108", "0.7759114", "0.7650924", "0.7637846", "0.75821304", "0.7418861", "0.73362464", "0.7310497", "0.72198737", "0.7217579", "0.7217579", "0.7170513", "0.71258837", "0.709807", "0.709807", "0.709807", "0.709807", "0.709807", "0.709807", "0....
0.7039598
41
Expect the next token to match the specified keyword. If not, an exception will be thrown.
function expectKeyword(keyword) { var token = lex(); if (token.type !== Token.Keyword || token.value !== keyword) { throwUnexpected(token); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function expectKeyword(keyword) {\n var token = lex();\n if (token.type !== Token.Keyword || token.value !== keyword) {\n throwUnexpectedToken(token);\n }\n }", "function expectKeyword(keyword) {\n var token = l...
[ "0.8155771", "0.81005055", "0.81005055", "0.81005055", "0.81005055", "0.81005055", "0.81005055", "0.8097621", "0.8045432", "0.8024153", "0.79775137", "0.79143566", "0.76446414", "0.76335007", "0.76152503", "0.76152503", "0.76152503", "0.76152503", "0.73900604", "0.7388385", "...
0.8070497
21
Return true if the next token matches the specified punctuator.
function match(value) { return lookahead.type === Token.Punctuator && lookahead.value === value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function G(e){var t=M();(t.type!==Xt.Keyword||t.value!==e)&&W(t)}// Return true if the next token matches the specified punctuator.", "function isPunctuatorToken(token) {\n var kind = token.kind;\n return kind === _tokenKind.TokenKind.BANG || kind === _tokenKind.TokenKind.DOLLAR || kind === _tokenKind.TokenKin...
[ "0.81115025", "0.7977586", "0.7975386", "0.78996557", "0.78870416", "0.75935584", "0.75342286", "0.7402483", "0.7402483", "0.7402483", "0.7402483", "0.7402483", "0.7318751", "0.7315256", "0.7315256", "0.7219272", "0.71747214", "0.7152664", "0.7146625", "0.7103193", "0.7091807...
0.71755666
36
Return true if the next token matches the specified keyword
function matchKeyword(keyword) { return lookahead.type === Token.Keyword && lookahead.value === keyword; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchKeyword(keyword) {\n var token = lookahead();\n return token.type === Token.Keyword && token.value === keyword;\n }", "function matchKeyword(keyword) {\n var token = lookahead();\n return token.type === Token.Keyword && token.value === keyword;\n }", "function ma...
[ "0.7892951", "0.7892951", "0.7892951", "0.7892951", "0.7892951", "0.7697651", "0.7697651", "0.7678987", "0.76190984", "0.76168966", "0.75312674", "0.7516023", "0.7516023", "0.74989873", "0.7440836", "0.7424621", "0.7352427", "0.72979057", "0.72525215", "0.72525215", "0.725252...
0.75327355
26
Return true if the next token is an assignment operator
function matchAssign() { var op; if (lookahead.type !== Token.Punctuator) { return false; } op = lookahead.value; return op === '=' || op === '*=' || op === '/=' || op === '%=' || op === '+=' || op === '-=' || op === '<<=' || op === '>>=' || op === '>>>=' || op === '&=' || op === '^=' || op === '|='; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_isAssignmentOperator(tokenType) {\n return tokenType === 'SIMPLE_ASSIGN' || tokenType === 'COMPLEX_ASSIGN';\n }", "function matchAssign() {\n var token = lookahead(),\n op = token.value;\n\n if (token.type !== Token.Punctuator) {\n return false;\n }\n return...
[ "0.82661015", "0.79970014", "0.79970014", "0.79970014", "0.79970014", "0.79970014", "0.79240716", "0.7854814", "0.7833919", "0.77979654", "0.7244828", "0.72382146", "0.70757514", "0.6765353", "0.6678297", "0.6469518", "0.6445563", "0.6394306", "0.63458574", "0.63150585", "0.6...
0.79334086
26
Return true if provided expression is LeftHandSideExpression
function isLeftHandSide(expr) { return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isLeftHandSide(expr) {\n switch (expr.type) {\n case 'AssignmentExpression':\n case 'BinaryExpression':\n case 'ConditionalExpression':\n case 'LogicalExpression':\n case 'SequenceExpression':\n case 'UnaryExpression':\n case 'UpdateExpression':\n ...
[ "0.8215102", "0.74610543", "0.70854646", "0.685377", "0.6403905", "0.6375215", "0.63261646", "0.62065786", "0.6187234", "0.6187234", "0.6187234", "0.6187234", "0.6169254", "0.61390203", "0.5947404", "0.5928136", "0.5927452", "0.5848139", "0.5823447", "0.58146197", "0.57984775...
0.6991114
21
11.1.6 The Grouping Operator
function parseGroupExpression() { var expr; expect('('); expr = parseExpression(); expect(')'); return expr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseGroupExpression() {\n var expr, marker, typeAnnotation;\n \n expect('(');\n \n ++state.parenthesizedCount;\n \n marker = markerCreate();\n \n expr = parseExpression();\n \n if (match(':')) {\n typeAnnotati...
[ "0.71333575", "0.7000005", "0.7000005", "0.68837637", "0.67481023", "0.671131", "0.6657709", "0.6657709", "0.6657709", "0.6657709", "0.6657709", "0.665646", "0.65677977", "0.65664375", "0.65365386", "0.6527018", "0.65123206", "0.649026", "0.64882904", "0.64882904", "0.6457547...
0.66095614
25
11.5 Multiplicative Operators 11.6 Additive Operators 11.7 Bitwise Shift Operators 11.8 Relational Operators 11.9 Equality Operators 11.10 Binary Bitwise Operators 11.11 Binary Logical Operators
function parseBinaryExpression() { var marker, markers, expr, token, prec, stack, right, operator, left, i; marker = lookahead; left = parseUnaryExpression(); token = lookahead; prec = binaryPrecedence(token, state.allowIn); if (prec === 0) { return left; } token.prec = prec; lex(); markers = [marker, lookahead]; right = parseUnaryExpression(); stack = [left, token, right]; while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) { // Reduce: make a binary expression from the three topmost entries. while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) { right = stack.pop(); operator = stack.pop().value; left = stack.pop(); expr = delegate.createBinaryExpression(operator, left, right); markers.pop(); marker = markers[markers.length - 1]; delegate.markEnd(expr, marker); stack.push(expr); } // Shift. token = lex(); token.prec = prec; stack.push(token); markers.push(lookahead); expr = parseUnaryExpression(); stack.push(expr); } // Final reduce to clean-up the stack. i = stack.length - 1; expr = stack[i]; markers.pop(); while (i > 1) { expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr); i -= 2; marker = markers.pop(); delegate.markEnd(expr, marker); } return expr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function withBitwiseOperator(n) {\n if (n < 1) {\n return false;\n } else {\n return (n & n - 1) === 0;\n }\n}", "AND_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_fla...
[ "0.6431488", "0.6282463", "0.62678695", "0.62574637", "0.6253815", "0.6229634", "0.6229469", "0.6180219", "0.61788404", "0.616927", "0.616927", "0.616927", "0.616927", "0.616927", "0.616927", "0.616927", "0.616927", "0.616927", "0.616927", "0.616927", "0.616927", "0.616927"...
0.0
-1
kind may be `const` or `let` Both are experimental and not in the specification yet. see and
function parseConstLetDeclaration(kind) { var declarations, startToken; startToken = lookahead; expectKeyword(kind); declarations = parseVariableDeclarationList(kind); consumeSemicolon(); return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseConstLetDeclaration(kind) {\n var declarations, marker = markerCreate();\n \n expectKeyword(kind);\n \n declarations = parseVariableDeclarationList(kind);\n \n consumeSemicolon();\n \n return markerApply(marker, delegate.createVariabl...
[ "0.71001256", "0.70202017", "0.701235", "0.6968589", "0.69573486", "0.69573486", "0.69573486", "0.69573486", "0.69573486", "0.69573486", "0.6845873", "0.6845873", "0.6845873", "0.6629786", "0.6629786", "0.6629786", "0.6629786", "0.6629786", "0.65741307", "0.64181757", "0.6370...
0.6870043
13
12.7 The continue statement
function parseContinueStatement() { var label = null, key; expectKeyword('continue'); // Optimize the most common form: 'continue;'. if (source.charCodeAt(index) === 0x3B) { lex(); if (!state.inIteration) { throwError({}, Messages.IllegalContinue); } return delegate.createContinueStatement(null); } if (peekLineTerminator()) { if (!state.inIteration) { throwError({}, Messages.IllegalContinue); } return delegate.createContinueStatement(null); } if (lookahead.type === Token.Identifier) { label = parseVariableIdentifier(); key = '$' + label.name; if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { throwError({}, Messages.UnknownLabel, label.name); } } consumeSemicolon(); if (label === null && !state.inIteration) { throwError({}, Messages.IllegalContinue); } return delegate.createContinueStatement(label); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseContinueStatement() {\n var label = null, marker = markerCreate();\n \n expectKeyword('continue');\n \n // Optimize the most common form: 'continue;'.\n if (source.charCodeAt(index) === 59) {\n lex();\n \n if (!state.i...
[ "0.7148657", "0.6988531", "0.6957503", "0.6957503", "0.69189596", "0.69189596", "0.69189596", "0.69189596", "0.6844112", "0.6844112", "0.6844112", "0.68307775", "0.6830707", "0.6818726", "0.6808828", "0.67890716", "0.67604464", "0.67429197", "0.67416614", "0.67416614", "0.674...
0.6850173
11
12.8 The break statement
function parseBreakStatement() { var label = null, key; expectKeyword('break'); // Catch the very common case first: immediately a semicolon (U+003B). if (source.charCodeAt(index) === 0x3B) { lex(); if (!(state.inIteration || state.inSwitch)) { throwError({}, Messages.IllegalBreak); } return delegate.createBreakStatement(null); } if (peekLineTerminator()) { if (!(state.inIteration || state.inSwitch)) { throwError({}, Messages.IllegalBreak); } return delegate.createBreakStatement(null); } if (lookahead.type === Token.Identifier) { label = parseVariableIdentifier(); key = '$' + label.name; if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { throwError({}, Messages.UnknownLabel, label.name); } } consumeSemicolon(); if (label === null && !(state.inIteration || state.inSwitch)) { throwError({}, Messages.IllegalBreak); } return delegate.createBreakStatement(label); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Break() {}", "function parseBreakStatement() {\n var label = null, marker = markerCreate();\n \n expectKeyword('break');\n \n // Catch the very common case first: immediately a semicolon (char #59).\n if (source.charCodeAt(index) === 59) {\n ...
[ "0.8167032", "0.73771197", "0.72918534", "0.72918534", "0.72918534", "0.72918534", "0.7251158", "0.7251158", "0.7250289", "0.7212528", "0.7212528", "0.7212528", "0.7203497", "0.7202599", "0.7123717", "0.711589", "0.711589", "0.711589", "0.7108482", "0.7108415", "0.7108415", ...
0.7195099
18
12.9 The return statement
function parseReturnStatement() { var argument = null; expectKeyword('return'); if (!state.inFunctionBody) { throwErrorTolerant({}, Messages.IllegalReturn); } // 'return' followed by a space and an identifier is very common. if (source.charCodeAt(index) === 0x20) { if (isIdentifierStart(source.charCodeAt(index + 1))) { argument = parseExpression(); consumeSemicolon(); return delegate.createReturnStatement(argument); } } if (peekLineTerminator()) { return delegate.createReturnStatement(null); } if (!match(';')) { if (!match('}') && lookahead.type !== Token.EOF) { argument = parseExpression(); } } consumeSemicolon(); return delegate.createReturnStatement(argument); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Te(){var e=null;\n// 'return' followed by a space and an identifier is very common.\n// 'return' followed by a space and an identifier is very common.\nreturn G(\"return\"),mt.inFunctionBody||q({},rt.IllegalReturn),32===at.charCodeAt(lt)&&s(at.charCodeAt(lt+1))?(e=ge(),H(),pt.createReturnStatement(e)):U()...
[ "0.7398579", "0.7128506", "0.70846283", "0.70468366", "0.70187604", "0.6941721", "0.6923836", "0.6873398", "0.6865669", "0.6851207", "0.68086034", "0.6791364", "0.67525816", "0.67525816", "0.67525816", "0.67525816", "0.67394257", "0.6704941", "0.6620697", "0.6589073", "0.6583...
0.6491014
43
12.10 The with statement
function parseWithStatement() { var object, body; if (strict) { // TODO(ikarienator): Should we update the test cases instead? skipComment(); throwErrorTolerant({}, Messages.StrictModeWith); } expectKeyword('with'); expect('('); object = parseExpression(); expect(')'); body = parseStatement(); return delegate.createWithStatement(object, body); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseWithStatement() {\n var object, body, marker = markerCreate();\n \n if (strict) {\n throwErrorTolerant({}, Messages.StrictModeWith);\n }\n \n expectKeyword('with');\n \n expect('(');\n \n object = parseExpres...
[ "0.72355896", "0.72217697", "0.70689327", "0.70689327", "0.70689327", "0.70689327", "0.70689327", "0.70689327", "0.7018208", "0.69797736", "0.69797736", "0.69797736", "0.69797736", "0.69714904", "0.69078356", "0.69078356", "0.69078356", "0.69078356", "0.69078356", "0.6823942", ...
0.6894926
22
12.10 The swith statement
function parseSwitchCase() { var test, consequent = [], statement, startToken; startToken = lookahead; if (matchKeyword('default')) { lex(); test = null; } else { expectKeyword('case'); test = parseExpression(); } expect(':'); while (index < length) { if (match('}') || matchKeyword('default') || matchKeyword('case')) { break; } statement = parseStatement(); consequent.push(statement); } return delegate.markEnd(delegate.createSwitchCase(test, consequent), startToken); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function statement() {\n\n}", "function s(){}", "function n$1(n,t){return n?t?4:3:t?3:2}", "function o(e){switch(e.type){case V.BlockStatement:case V.BreakStatement:case V.CatchClause:case V.ContinueStatement:case V.ClassDeclaration:case V.ClassBody:case V.DirectiveStatement:case V.DoWhileStatement:case V.De...
[ "0.6031139", "0.58516026", "0.5694981", "0.56540257", "0.5596952", "0.55756617", "0.5563063", "0.555822", "0.5548447", "0.5491659", "0.5491659", "0.54649895", "0.544847", "0.5446926", "0.5436133", "0.54195666", "0.54195666", "0.54195666", "0.54195666", "0.54195666", "0.541956...
0.0
-1
12.13 The throw statement
function parseThrowStatement() { var argument; expectKeyword('throw'); if (peekLineTerminator()) { throwError({}, Messages.NewlineAfterThrow); } argument = parseExpression(); consumeSemicolon(); return delegate.createThrowStatement(argument); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function thrower(){throw new Error(\"this should not happen!\")}", "function Exception() {}", "function m(a){throw a;}", "function thrower() {\n throw new Error('thrown');\n}", "function Throw(){ return Statement.apply(this,arguments) }", "function Ne(){var e;return G(\"throw\"),U()&&j({},rt.NewlineAfte...
[ "0.82639456", "0.7707648", "0.7531231", "0.74871564", "0.7379285", "0.7368657", "0.73647875", "0.7271461", "0.72611165", "0.7259888", "0.7244121", "0.7199371", "0.7190658", "0.7184537", "0.714959", "0.7077943", "0.7010637", "0.7003125", "0.69730186", "0.6961365", "0.6960811",...
0.6660329
54
12.14 The try statement
function parseCatchClause() { var param, body, startToken; startToken = lookahead; expectKeyword('catch'); expect('('); if (match(')')) { throwUnexpected(lookahead); } param = parseVariableIdentifier(); // 12.14.1 if (strict && isRestrictedWord(param.name)) { throwErrorTolerant({}, Messages.StrictCatchVariable); } expect(')'); body = parseBlock(); return delegate.markEnd(delegate.createCatchClause(param, body), startToken); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function a120571()\n{\n while(0)\n {\n try\n {\n }\n catch(e)\n {\n continue;\n }\n }\n}", "function p(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}", "function parseTryStatement() {\n var node = create...
[ "0.6898311", "0.67884636", "0.6755726", "0.6696703", "0.6651578", "0.6646401", "0.66031677", "0.64729017", "0.6433329", "0.63939315", "0.6387224", "0.6383057", "0.6383057", "0.6383057", "0.6383057", "0.6383057", "0.6362478", "0.6280455", "0.619323", "0.6102144", "0.60913664",...
0.0
-1
12.15 The debugger statement
function parseDebuggerStatement() { expectKeyword('debugger'); consumeSemicolon(); return delegate.createDebuggerStatement(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function je(){return G(\"debugger\"),H(),pt.createDebuggerStatement()}", "function dbg(x) {\n debugger;\n}", "debug() {}", "debug() {\n\t const vm = this.vm;\n\t if (vm.isWaitingForAnswer)\n\t return;\n\t this._stepOverCurrentLine();\n\t //continue to execute until it ...
[ "0.8074313", "0.77257836", "0.72598785", "0.7027484", "0.6939135", "0.69370955", "0.68971294", "0.6842765", "0.68419385", "0.67382675", "0.6726629", "0.6696662", "0.6649109", "0.6643033", "0.6643033", "0.6640355", "0.6640355", "0.6640355", "0.6640355", "0.6640355", "0.6640355...
0.64237094
81
Radix 2 FFT Adapted from Paul Bourke's C Implementation
function fftRadix2(dir, nrows, ncols, buffer, x_ptr, y_ptr) { dir |= 0 nrows |= 0 ncols |= 0 x_ptr |= 0 y_ptr |= 0 var nn,m,i,i1,j,k,i2,l,l1,l2 var c1,c2,t,t1,t2,u1,u2,z,row,a,b,c,d,k1,k2,k3 // Calculate the number of points nn = ncols m = bits.log2(nn) for(row=0; row<nrows; ++row) { // Do the bit reversal i2 = nn >> 1; j = 0; for(i=0;i<nn-1;i++) { if(i < j) { t = buffer[x_ptr+i] buffer[x_ptr+i] = buffer[x_ptr+j] buffer[x_ptr+j] = t t = buffer[y_ptr+i] buffer[y_ptr+i] = buffer[y_ptr+j] buffer[y_ptr+j] = t } k = i2 while(k <= j) { j -= k k >>= 1 } j += k } // Compute the FFT c1 = -1.0 c2 = 0.0 l2 = 1 for(l=0;l<m;l++) { l1 = l2 l2 <<= 1 u1 = 1.0 u2 = 0.0 for(j=0;j<l1;j++) { for(i=j;i<nn;i+=l2) { i1 = i + l1 a = buffer[x_ptr+i1] b = buffer[y_ptr+i1] c = buffer[x_ptr+i] d = buffer[y_ptr+i] k1 = u1 * (a + b) k2 = a * (u2 - u1) k3 = b * (u1 + u2) t1 = k1 - k3 t2 = k1 + k2 buffer[x_ptr+i1] = c - t1 buffer[y_ptr+i1] = d - t2 buffer[x_ptr+i] += t1 buffer[y_ptr+i] += t2 } k1 = c1 * (u1 + u2) k2 = u1 * (c2 - c1) k3 = u2 * (c1 + c2) u1 = k1 - k3 u2 = k1 + k2 } c2 = Math.sqrt((1.0 - c1) / 2.0) if(dir < 0) { c2 = -c2 } c1 = Math.sqrt((1.0 + c1) / 2.0) } // Scaling for inverse transform if(dir < 0) { var scale_f = 1.0 / nn for(i=0;i<nn;i++) { buffer[x_ptr+i] *= scale_f buffer[y_ptr+i] *= scale_f } } // Advance pointers x_ptr += ncols y_ptr += ncols } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FFT$1(){var _n=0,// order\n_bitrev=null,// bit reversal table\n_cstb=null;// sin/cos table\nvar _tre,_tim;this.init=function(n){if(n!==0&&(n&n-1)===0){_n=n;_setVariables();_makeBitReversal();_makeCosSinTable();}else{throw new Error('init: radix-2 required');}};// 1D-FFT\nthis.fft1d=function(re,im){fft(re,...
[ "0.73435855", "0.7309792", "0.7209207", "0.7152813", "0.714766", "0.71119267", "0.6941669", "0.685232", "0.6794156", "0.67012745", "0.6682935", "0.6543265", "0.6356326", "0.6146801", "0.6014318", "0.60110235", "0.6010517", "0.5832049", "0.5832049", "0.57791466", "0.5729091", ...
0.7726817
0
Use Bluestein algorithm for npot FFTs Scratch memory required: 2 ncols + 4 bits.nextPow2(2ncols + 1)
function fftBluestein(dir, nrows, ncols, buffer, x_ptr, y_ptr, scratch_ptr) { dir |= 0 nrows |= 0 ncols |= 0 x_ptr |= 0 y_ptr |= 0 scratch_ptr |= 0 // Initialize tables var m = bits.nextPow2(2 * ncols + 1) , cos_ptr = scratch_ptr , sin_ptr = cos_ptr + ncols , xs_ptr = sin_ptr + ncols , ys_ptr = xs_ptr + m , cft_ptr = ys_ptr + m , sft_ptr = cft_ptr + m , w = -dir * Math.PI / ncols , row, a, b, c, d, k1, k2, k3 , i for(i=0; i<ncols; ++i) { a = w * ((i * i) % (ncols * 2)) c = Math.cos(a) d = Math.sin(a) buffer[cft_ptr+(m-i)] = buffer[cft_ptr+i] = buffer[cos_ptr+i] = c buffer[sft_ptr+(m-i)] = buffer[sft_ptr+i] = buffer[sin_ptr+i] = d } for(i=ncols; i<=m-ncols; ++i) { buffer[cft_ptr+i] = 0.0 } for(i=ncols; i<=m-ncols; ++i) { buffer[sft_ptr+i] = 0.0 } fftRadix2(1, 1, m, buffer, cft_ptr, sft_ptr) //Compute scale factor if(dir < 0) { w = 1.0 / ncols } else { w = 1.0 } //Handle direction for(row=0; row<nrows; ++row) { // Copy row into scratch memory, multiply weights for(i=0; i<ncols; ++i) { a = buffer[x_ptr+i] b = buffer[y_ptr+i] c = buffer[cos_ptr+i] d = -buffer[sin_ptr+i] k1 = c * (a + b) k2 = a * (d - c) k3 = b * (c + d) buffer[xs_ptr+i] = k1 - k3 buffer[ys_ptr+i] = k1 + k2 } //Zero out the rest for(i=ncols; i<m; ++i) { buffer[xs_ptr+i] = 0.0 } for(i=ncols; i<m; ++i) { buffer[ys_ptr+i] = 0.0 } // FFT buffer fftRadix2(1, 1, m, buffer, xs_ptr, ys_ptr) // Apply multiplier for(i=0; i<m; ++i) { a = buffer[xs_ptr+i] b = buffer[ys_ptr+i] c = buffer[cft_ptr+i] d = buffer[sft_ptr+i] k1 = c * (a + b) k2 = a * (d - c) k3 = b * (c + d) buffer[xs_ptr+i] = k1 - k3 buffer[ys_ptr+i] = k1 + k2 } // Inverse FFT buffer fftRadix2(-1, 1, m, buffer, xs_ptr, ys_ptr) // Copy result back into x/y for(i=0; i<ncols; ++i) { a = buffer[xs_ptr+i] b = buffer[ys_ptr+i] c = buffer[cos_ptr+i] d = -buffer[sin_ptr+i] k1 = c * (a + b) k2 = a * (d - c) k3 = b * (c + d) buffer[x_ptr+i] = w * (k1 - k3) buffer[y_ptr+i] = w * (k1 + k2) } x_ptr += ncols y_ptr += ncols } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transformBluestein(real, imag) {\n // Find a power-of-2 convolution length m such that m >= n * 2 + 1\n var n = real.length;\n var m = 1;\n while (m < n * 2 + 1)\n m *= 2;\n\n // Trignometric tables\n var cosTable = new Array(n);\n var sinTable = new Array(n);\n for (var i =...
[ "0.5942304", "0.5936024", "0.59129936", "0.5848767", "0.57809544", "0.5753499", "0.5447977", "0.5359145", "0.53209746", "0.5241078", "0.52395254", "0.51725304", "0.51725304", "0.51725304", "0.51725304", "0.51725304", "0.51725304", "0.51725304", "0.51697624", "0.5137108", "0.5...
0.7380467
0
include('/audit_config/custom_sql_popup/mine_action.js', '/audit_config/js/controller.js'); include('/audit_config/custom_sql_popup/mine_action.js', '/audit_config/ds_info/ds_info.js');
function CustomSQLDo() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function includeJS(incFile)\n{\n document.write('<script type=\"text/javascript\" src=\"' + incFile+ '\"></scr' + 'ipt>');\n}", "function jqGridInclude()\r\n{\r\n var pathtojsfiles = \"js/\"; // need to be ajusted\r\n // set include to false if you do not want some modules to be included\r\n var modu...
[ "0.63667333", "0.6255466", "0.6237482", "0.60852754", "0.5991929", "0.59515667", "0.59451234", "0.5821001", "0.5757549", "0.57417095", "0.57158166", "0.57149476", "0.56692207", "0.5661394", "0.5643543", "0.56375086", "0.5615504", "0.56107795", "0.56049865", "0.55968934", "0.5...
0.0
-1
init game's state on grid
function init() { this.grid = setupGrid(this.rows, this.lines, this.pattern); draw(this.canvas, this.grid); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initializeGameState()\n {\n this.gameState = [];\n for (let column = 0; column < this.xSize; column++)\n {\n let newColumn = [];\n for (let row = 0; row < this.ySize; row++)\n {\n let newSpace = {bomb: false, revealed: false, flagged: false, t...
[ "0.76835823", "0.76126724", "0.7605477", "0.76018506", "0.75706553", "0.7456369", "0.742831", "0.73816085", "0.7258723", "0.7241117", "0.7238877", "0.7231902", "0.72068304", "0.7197604", "0.7173652", "0.71724117", "0.7141281", "0.7123744", "0.7064598", "0.70569474", "0.703101...
0.67686355
50
update the game's grid asynchronously.
function tick() { var interval = 40, //TODO: parameterize for user to throttle speed canvas = this.canvas, grid = this.grid; var runStep = function () { draw(canvas, grid); grid = nextStep(grid); }; this.isRunning = setInterval(runStep, interval); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateCellsFuture() {\n let allDeath = true;\n for(let row = 0; row < this.rowSize; row++) {\n for(let cell = 0; cell < this.colSize; cell++) {\n this.grid[row][cell].alive = this.grid[row][cell].willLive; \n if ( this.grid[row][cell].alive ) {\n allDeath = false;\n }\n ...
[ "0.7010956", "0.70090115", "0.6837019", "0.6664746", "0.66378295", "0.66346836", "0.6569902", "0.6527904", "0.6523911", "0.64547205", "0.64380044", "0.6369253", "0.6352266", "0.62638223", "0.6231494", "0.6223972", "0.62150896", "0.6210801", "0.61659086", "0.6121369", "0.61207...
0.0
-1
BEGIN API CALLS NEED TO MAKE A FUNCTION TO MAKE 3 API CALLS AND CREATE RESPONSE VARIABLES
function callWxData(param) { callCurrApi(param) function callCurrApi(param) { queryURL = wxApi + wxCurr + param + imperials + wxKey console.log(queryURL) $.ajax({ url: queryURL, method: "GET" }) .then(function (response) { // NEED TO PASS LON,LAT STRING VALUE TO UV CALL let lat = response.coord.lat; let lon = response.coord.lon; let coords = "lat=" + lat + "&lon=" + lon console.log("Coordinate Check" + coords) callUvApi(coords) activeLocation.name = response.name activeLocation.country = response.sys.country activeLocation.temp = response.main.temp activeLocation.humidity = response.main.humidity activeLocation.wind = response.wind.speed activeLocation.wxCond = response.weather[0].description activeLocation.wxIcon = response.weather[0].icon fiveDay.empty() renderCurrWx() // callDailyApi(param) // OLD CALL callOneApi(coords) }) // end of then function } // end of CURRENT WX ajax call function callOneApi(param) { queryURL = wxOne + param + imperials + wxKey console.log(queryURL) $.ajax({ url: queryURL, method: "GET" }) .then(function (response) { console.log(response) var dailyArray = response.daily console.log(dailyArray) for (let i = 1; i < dailyArray.length - 2; i++) { // // console daily objects let dailyObj = dailyArray[i]; console.log(dailyObj.temp.max) let dayCard = $('<div>').addClass('dayCard').appendTo(fiveDay) //append date insert moment iterator $('<div>').addClass('card-header').appendTo(dayCard).text(nextFive[i - 1].day) let wxDeets = $('<div>').addClass('card-body').appendTo(dayCard) //append icon $('<img>').appendTo(wxDeets).attr('src', "http://openweathermap.org/img/wn/" + dailyObj.weather[0].icon + "@2x.png").prop('alt', activeLocation.wxCond) //temp $('<p>').addClass('card-text').appendTo(wxDeets).text("Temperature: " + dailyObj.temp.max.toFixed(0) + " \xB0F") //append humidity $('<p>').addClass('card-text').appendTo(wxDeets).text("Humidity: " + dailyObj.humidity + "%") // TARGET FIVE DAY CONTAINER AND CREATE ELEMENTS FOR EACH DAY OF OBJECT ARRAY { //create card // let dayCard = $('<div>').addClass('day-card').text() // dayCard.appendTo(fiveDay) // let futureDate = $('<div>').addClass('card-header').text() // futureDate.appendTo(dayCard) // let wxDeets = $('<div>').addClass('card-body').text() // wxDeets.appendTo(dayCard) // let futureIcon = $('<h5>').addClass('card-title').text() // futureIcon.appendTo(wxDeets) // let futureTemp = $('<p>').addClass('card-text').text() // futureTemp.appendTo(wxDeets) // let futureHum = $('<p>').addClass('card-text').text() // futureHum.appendTo(wxDeets) } }) // end of then function } // end of ONE CALL WX ajax call function callUvApi(param) { queryURL = wxApi + wxUvI + param + wxKey console.log(queryURL) $.ajax({ url: queryURL, method: "GET", }) .then(function (response) { activeLocation.uvindex = response.value let uvIndex = parseInt(activeLocation.uvindex) console.log(uvIndex) // $('#cityUv').text("UV Index: " + uvIndex) $('#cityUv').text("UV Index: " + uvIndex.toFixed(1)) if (uvIndex < 3) { $('#cityUv').removeClass().addClass('uvLow') } if (uvIndex >= 3) { $('#cityUv').removeClass().addClass('uvMod') } if (uvIndex >= 5) { $('#cityUv').removeClass().addClass('uvHigh') } if (uvIndex >= 7) { $('#cityUv').removeClass().addClass('uvVhigh') } if (uvIndex >= 10) { $('#cityUv').removeClass().addClass('uvXtreme') } }) // end of then function } // end of UV INDEX ajax call }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function StartR() \r\n {\r\n // request, fetch api data\r\n const response = await fetch(api_url); //fetch\r\n const data = await response.json(); //api\r\n let json_split = JSON.parse(JSON.stringify(data)); // split api data\r\n\r\n // only for the first request\r\n ...
[ "0.6548261", "0.6535708", "0.6330252", "0.6303298", "0.6296454", "0.62641484", "0.62635267", "0.62635267", "0.6184757", "0.60557735", "0.60394436", "0.600515", "0.59792894", "0.5976754", "0.59549093", "0.59110314", "0.59055734", "0.5904499", "0.5901554", "0.5811214", "0.57814...
0.5732477
31
THIS save FUNCTION IS WORKING AND SAVES VALUES ADDED TO THE INPUT BOX TO THE LOCAL STORAGE
function saveRecents() { // // saves entire Object to local storage localStorage.setItem('Recent Cities', JSON.stringify(recentSearches)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function savingInLocalStorage() {\n\n\n //1.get all the calaculated data from the BudgetController:\n let sendDataToLocalStorage = budgetCtrl.getAllData();\n\n //2.send data to UIcontroller for storing it in local storage:\n document.querySelector(DOMClassNames.savingData).addEventListe...
[ "0.729548", "0.71950823", "0.7102521", "0.7081648", "0.7050331", "0.7048661", "0.70155525", "0.6945653", "0.69049793", "0.68342", "0.68308836", "0.6830375", "0.68207395", "0.68160135", "0.68122834", "0.6802373", "0.67972827", "0.6775257", "0.67634666", "0.67507786", "0.670007...
0.0
-1
END LOCAL STORAGE BEGIN GEOLOCATION COORDINATES OF USER
function getLocation() { // Make sure browser supports this feature if (navigator.geolocation) { // Provide our showPosition() function to getCurrentPosition console.log(navigator.geolocation.getCurrentPosition(showPosition)); } else { alert("Geolocation is not supported by this browser."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocation(){\n self.polyline = [];\n self.markers = [];\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(setUserLocation);\n } else {\n console.log(\"geolocation error\");\n }\n }", "function onSuccessGeo( position )\n{\n localStorage.setItem( 'lat...
[ "0.60776955", "0.60209423", "0.59454125", "0.594161", "0.59287", "0.59218365", "0.5822929", "0.5792822", "0.5780386", "0.5771821", "0.57523644", "0.56890523", "0.5651212", "0.5642401", "0.5626813", "0.5621031", "0.5605669", "0.5597776", "0.55772036", "0.55746543", "0.5565297"...
0.0
-1
This will get called after getCurrentPosition()
function showPosition(position) { // Grab coordinates from the given object var lat = "lat=" + position.coords.latitude.toFixed(2); var lon = "lon=" + position.coords.longitude.toFixed(2); userLocation = lat + "&" + lon console.log(userLocation); // for now this simply shows me the string to make an ajax call let localWxRqst = wxApi + "weather?" + userLocation + wxKey console.log(localWxRqst); // Call next function to get wx data NEEDS TO BE TURNED OFF FOR NOW callWxData(userLocation); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setLastPos() {\n this.previousPos = this.getCurrentPosition();\n }", "recalculateLastPosition() {\n this._positionStrategy.reapplyLastPosition();\n }", "_getPosition() {\r\n navigator.geolocation.getCurrentPosition(this._loadMap.bind(this), function () {\r\n alert(\"Can't ...
[ "0.7006736", "0.6887366", "0.6755902", "0.6724936", "0.660516", "0.6535325", "0.65215755", "0.6488699", "0.64541763", "0.6387138", "0.6318063", "0.63035095", "0.6273244", "0.6219321", "0.62096", "0.6203042", "0.61854494", "0.61842763", "0.6171744", "0.61568487", "0.61426127",...
0.0
-1
END OF GEOLOCATION COORDINATES OF USER
function renderCurrWx() { //TARGET #activeCityCard ELEMENTS AND UPDATE EACH ELEMENT WITH KEY VALUES $('#cityName').text(activeLocation.name + ", " + activeLocation.country + today) $('#wxCond').attr('src', "http://openweathermap.org/img/wn/" + activeLocation.wxIcon + "@2x.png").prop('alt', activeLocation.wxCond) $('#cityTemp').text("Temperature: " + activeLocation.temp.toFixed(0) + " \xB0F") $('#cityHum').text("Humidity: " + activeLocation.humidity + "%") $('#cityWs').text("Wind Speed: " + activeLocation.wind + " MPH") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endUserLocation() {\n $scope.endUserLocationDetails = true;\n }", "function getLastWayPointCoordinates(){\n return new google.maps.LatLng(\n $scope.wayPoints[$scope.wayPoints.length - 1].latitude,\n $scope.wayPoints[$scope.wayPoints.length - 1].longitude\n ...
[ "0.6377289", "0.5888919", "0.5872836", "0.560028", "0.54315156", "0.541998", "0.5397453", "0.5393223", "0.5377661", "0.53744173", "0.53707063", "0.5320766", "0.5318279", "0.53128964", "0.5303158", "0.52944845", "0.52223885", "0.52162087", "0.5197862", "0.519345", "0.51799816"...
0.0
-1
FUNCTION TIED TO NAV LINK CLICKS TO TAKE THEIR DATA NAME AND SEND TO API CALL
function callWxBtn() { let btnValue = ($(this).data('name')) callWxData(btnValue) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setGoToData(){\n\n\t\t\t$scope.goToData.links.push({type: 'brand id', namePath: 'id', sref: 'spa.brand.brandEdit', paramKey: 'brandId', paramPath: 'id'});\n\t\t\tif(hasAccountsPermissions) $scope.goToData.links.push({type: 'account', namePath: 'relationsBag.parents.account.name', sref: 'spa.account.accoun...
[ "0.59385794", "0.58776444", "0.58179647", "0.5811929", "0.57786924", "0.57786924", "0.57290465", "0.56720346", "0.56720346", "0.56373423", "0.56294775", "0.56144047", "0.56088275", "0.55964774", "0.5584167", "0.55790734", "0.55136925", "0.54995435", "0.54885733", "0.54863894", ...
0.52660865
47
Given an array of wine objects, write a function that returns the name of the wine he will buy for the party. If given an empty array, return null. If given an array of only one, Atticus will buy that wine.
function chosenWine(wines) { if (wines.length == 0) return null; if (wines.length == 1) return wines[0].name; return wines.sort((a, b) => a.price - b.price)[1].name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTower(towerArray, name) {\n\tvar result = towerArray.filter(tower => tower.name === name);\n\tif (result.length > 0) {\n\t\t\treturn result[0];\n\t}\n\telse return null;\n}", "function findWinner(arr) {\n\tlet found = arr.find(el => el.isEligible).name;\n\tif (found) {\n\t\treturn `Congratulations ${...
[ "0.650766", "0.6338317", "0.601858", "0.5637064", "0.5604126", "0.54560345", "0.54550654", "0.54537755", "0.54403776", "0.5301211", "0.5280963", "0.5279994", "0.52252674", "0.5220512", "0.5215777", "0.52066475", "0.5187615", "0.517335", "0.5172325", "0.51317364", "0.50862384"...
0.7218369
0
console.log(toBoolArray('deep')); // [false, true, true, false] // deep converts to 0110 // d is the 4th alphabet 0 // e is the 5th alphabet 1 // e is the 5th alphabet 1 // p is the 16th alphabet 0 console.log(toBoolArray('loves')); // [false, true, false, true, true] console.log(toBoolArray('tesh')); // [false, true, true, false] Create a function that returns the frequency distribution of an array. This function should return an object, where the keys are the unique elements and the values are the frequency in which those elements occur.
function getFrequencies(arr) { let obj = {}; arr.map(val => { if (!(val in obj)) { obj[val] = 1; } else { obj[val]++; } }); return obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function frequencyTable(arr){\n\n}", "function calculateFrequencyDistribution(arr) {\n return arr.reduce((op, inp) => {\n op[inp] = op[inp] || 0;\n op[inp]++;\n return op;\n }, {})\n }", "function getFrequencyDict(arr) {\r\n var dictionary = {};\r\n arr.forEa...
[ "0.66417587", "0.6625387", "0.64302576", "0.6051295", "0.6039453", "0.59497607", "0.5922573", "0.5848281", "0.582161", "0.5814154", "0.5795614", "0.5794617", "0.5793017", "0.5767418", "0.57516724", "0.56951797", "0.5676807", "0.5641756", "0.56346315", "0.5617751", "0.5611264"...
0.6562875
2
const c0 = new Circle(1); console.log(c0.diameter); console.log(c0.getC()); console.log(c0.getA()); Create a function that converts color in RGB format to Hex format.
function rgbToHex(str) { colour = []; str.replace(/[a-z())]+/g, '') .split(',') .map(val => { let value = Number(val).toString(16); value = value < 2 ? `0${value}` : value; colour.push(value); }); return '#' + colour.join(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toHexColor() {\n const R = this.R.toHex().valueOf();\n const G = this.G.toHex().valueOf();\n const B = this.B.toHex().valueOf();\n return new HexColor(`#${R}${G}${B}`);\n }", "toHexColor() {\n const R = this.R.toHex().valueOf();\n const G = this.G.toHex().valueOf();\n const B = ...
[ "0.7320834", "0.70295864", "0.69161236", "0.680667", "0.6662321", "0.66518193", "0.66121244", "0.6606852", "0.65954417", "0.6590858", "0.6560846", "0.6558474", "0.6558064", "0.65393555", "0.65344137", "0.65305257", "0.6530412", "0.6503779", "0.648796", "0.64828473", "0.647535...
0.0
-1
console.log(rgbToHex('rgb(0, 128, 192)')); // "0080c0" console.log(rgbToHex('rgb(45, 255, 192)')); // "2dffc0" console.log(rgbToHex('rgb(0, 0, 0)')); // "000000" rgb > hex > hsl > Given a word, create an object that stores the indexes of each letter in an array. Make sure the letters are the keys. Make sure the letters are symbols. Make sure the indexes are stored in an array and those arrays are values.
function mapLetters(str) { const obj = {}; str.split('').map((val, index) => { if (!(val in obj)) { obj[`${val}`] = [index]; } else { obj[`${val}`].push(index); } }); return obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringToColour(str) {\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n hash = str.charCodeAt(i) + ((hash << 5) - hash);\n }\n let colour = '#';\n for (let i = 0; i < 3; i++) {\n let value = (hash >> (i * 8)) & 0xff;\n colour += ('00' + value.toString(16)).substr(-2);\n }\n return...
[ "0.69670534", "0.69670534", "0.6959512", "0.69374204", "0.6845949", "0.67298126", "0.6652102", "0.66455936", "0.6629226", "0.6571375", "0.6506837", "0.63270646", "0.631844", "0.6301296", "0.6300528", "0.6280047", "0.62677515", "0.6253391", "0.6252446", "0.6227741", "0.6225831...
0.0
-1
console.log(imgurUrlParser(' console.log(imgurUrlParser(' console.log(imgurUrlParser(' console.log(imgurUrlParser(' console.log(imgurUrlParser(' console.log(imgurUrlParser(' console.log(imgurUrlParser(' console.log(imgurUrlParser('i.imgur.com/altd8Ld.png')); You will be given an object with various consumer products and their respective prices. Return a list of the products with a minimum price of 500 in descending order.
function products(obj) { return Object.keys(obj) .filter(val => obj[val] >= 500) .sort((a, b) => (obj[a] > obj[b] ? -1 : 1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function topSellerByRevenue(products, lineItems){\n //TODO\n}", "async function scrapeProduct(url){\n const browser = await puppeteer.launch(); \n const page = await browser.newPage();\n await page.goto(url);\n\n // image \n const [el] = await page.$x('//*[@id=\"ivLargeImage\"]/img');\n const ...
[ "0.55902797", "0.55849737", "0.55443144", "0.5533976", "0.5524638", "0.545593", "0.53911984", "0.5379392", "0.5375494", "0.535836", "0.5337518", "0.53039044", "0.52956927", "0.52540964", "0.52537537", "0.52418333", "0.52404237", "0.5234792", "0.52216697", "0.51963514", "0.519...
0.48319364
79
TODO: need to add object destructuring to babel.
function addField(state = {}, action) { switch (action.type) { case "formBuilder.AddField": { // TODO: Promp for a key/field-name first. let key = "new" + Object.keys(state.properties).length; state.properties[key] = {"type": "string", "title": "Textfield " + Object.keys(state.properties).length}; return state; } default: return state; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dynamicallyAddTranslation(babel) {\n var t = babel.types;\n return {\n visitor: {\n ImportDeclaration: function ImportDeclaration(p) {\n p.insertAfter(t.callExpression(t.identifier('__'), [t.stringLiteral('foo')]));\n }\n }\n };\n ...
[ "0.5741239", "0.5727293", "0.55184275", "0.5488657", "0.5402005", "0.53983116", "0.53134835", "0.5254357", "0.52468604", "0.5244631", "0.5241302", "0.5232732", "0.5214662", "0.52054214", "0.5151123", "0.5151123", "0.5151123", "0.5151123", "0.5118562", "0.5109306", "0.5101672"...
0.0
-1
Remove selected field from the form schema.
function removeField(formSchema = {}, fieldId) { let props = formSchema.properties; delete props[fieldId.replace('root_', '')]; return {...formSchema, properties: props}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeMaterialSchemaValue(fieldName, field) {\n this.fields[fieldName].attributes[field] = null;\n }", "function clearFields() {\n document.getElementById('former').remove();\n}", "removeField(id) {\n this.fieldDescriptor.delete(id);\n this.errors.delete(id);\n }", "function removeField(form, ...
[ "0.6885689", "0.64909214", "0.6388381", "0.6364287", "0.6356985", "0.61660415", "0.61633456", "0.6152233", "0.6132588", "0.61110264", "0.6102599", "0.6094554", "0.6083695", "0.60777915", "0.60590446", "0.6053828", "0.6041608", "0.6040311", "0.6020806", "0.602052", "0.5992053"...
0.6978677
0
Load user and append to req.
function load(req, res, next, id) { User.get(id) .then((foundUser) => { req.user = foundUser; // eslint-disable-line no-param-reassign return next(); }).catch(e => next(e)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadUser(req, res, next) {\n User.findOne({ _id: req.session.user_id }, function(err, user) {\n if (err) { throw err; }\n req.user = user;\n next();\n });\n}", "function loadUser(req, res, next) {\n if (!req.session.user_id) { return next(); }\n\n User.findOne({ _id: req.session.user_id }, ...
[ "0.7231059", "0.71140105", "0.69190633", "0.69069964", "0.6899686", "0.6899686", "0.6899686", "0.6892056", "0.6833907", "0.68269306", "0.6702646", "0.66035783", "0.65964496", "0.6462951", "0.6237058", "0.62016886", "0.6200355", "0.6180543", "0.6146391", "0.6130654", "0.611287...
0.68401
8
check for duplicate items in the shopping list
function checkDuplicate() { var found = false; for (var i = 0; i < $scope.list.length; i++) { if ($scope.list[i].item == $scope.item) { found = true; } } return found; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isDuplicate(item) {\n\t\tvar list = $(\"#items li .label\");\n\n\t\tfor (var i = 0; i < list.length; i++) {\n\t\t\tif ($(list[i]).text() == item) {\n\t\t\t\treturn true;\n\t\t\t}\n \t\t}\n\n \t\t// by default return false\n \t\treturn false;\n\t}", "AddItem(item) {\n //Check for the duplication\n ...
[ "0.68524545", "0.679574", "0.6718979", "0.6714496", "0.6689077", "0.656581", "0.65471476", "0.6494957", "0.6484088", "0.6410508", "0.6408286", "0.63824755", "0.6342123", "0.63280046", "0.6294062", "0.626103", "0.6240735", "0.62084395", "0.6207544", "0.620739", "0.6203393", ...
0.7261372
0
Helper function for checking intersection between two rectangles
function intersect(pos1, size1, pos2, size2) { return (pos1.x < pos2.x + size2.w && pos1.x + size1.w > pos2.x && pos1.y < pos2.y + size2.h && pos1.y + size1.h > pos2.y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function intersectRects(rect1,rect2){var res={left:Math.max(rect1.left,rect2.left),right:Math.min(rect1.right,rect2.right),top:Math.max(rect1.top,rect2.top),bottom:Math.min(rect1.bottom,rect2.bottom)};if(res.left<res.right&&res.top<res.bottom){return res;}return false;}", "function intersection(rect1, rect2) {\n...
[ "0.8105721", "0.81014436", "0.7992286", "0.78038794", "0.7723433", "0.7704247", "0.7704247", "0.7704247", "0.7704247", "0.7704247", "0.76857185", "0.76700425", "0.766654", "0.76594055", "0.76442605", "0.76442605", "0.76442605", "0.76442605", "0.76442605", "0.76442605", "0.764...
0.66158813
97
The player class used in this program
function Player() { this.node = document.getElementById("player"); this.position = PLAYER_INIT_POS; this.motion = motionType.NONE; this.verticalSpeed = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Player() {}", "function player() {}", "function Player() { }", "constructor(player){\n this.player = player;\n }", "constructor(player) {\n this.player = player;\n }", "function Player(name) {\r\n}", "function playerFactory() {}", "getCurrentPlayer() {}", "function Player() {\n ...
[ "0.8372533", "0.82054514", "0.81156886", "0.7723681", "0.7704507", "0.75308", "0.7361384", "0.73216426", "0.7306843", "0.7284678", "0.7252033", "0.7208359", "0.7190443", "0.71702045", "0.7161519", "0.7138468", "0.7138437", "0.71303004", "0.7102295", "0.7082613", "0.7039574", ...
0.69068617
39
The size of a monster Should be executed after the page is loaded
function load() { // Attach keyboard events document.addEventListener("keydown", keydown, false); document.addEventListener("keyup", keyup, false); // Create the player player = new Player(); // Create the monsters createMonster(200, 15); createMonster(400, 270); // Start the game interval gameInterval = setInterval("gamePlay()", GAME_INTERVAL); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateSize() {\n let gameArea = document.getElementById(\"game\");\n let tileProportion = 10;\n h = Math.floor(gameArea.clientHeight * 0.9);\n w = Math.floor(gameArea.clientWidth * 0.9);\n size = Math.min(h, w);\n style = gameArea.style;\n style.setProperty(\"--proportion\", `${tilePr...
[ "0.6475332", "0.6262211", "0.6249719", "0.6245064", "0.6214904", "0.6213394", "0.61643857", "0.61216956", "0.6117641", "0.6086967", "0.60794735", "0.6063296", "0.60502243", "0.6033451", "0.6028427", "0.59597415", "0.5924086", "0.5908016", "0.587726", "0.58578014", "0.5835223"...
0.0
-1
This function creates the monsters in the game
function createMonster(x, y) { var monster = document.createElementNS("http://www.w3.org/2000/svg", "use"); monster.setAttribute("x", x); monster.setAttribute("y", y); monster.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", "#monster"); document.getElementById("monsters").appendChild(monster); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function spawnMonsters(){\n\n if (frameCount % 60 === 0 ){\n var monsters = createSprite(600,170,10,40);\n\n monsters.velocityX = -12\n\n\n var rand = Math.round(random(1,2));\n switch(rand) {\n case 1: monsters.addImage(turtleImg);\n break;\n case 2: monsters.addImage(vectorImg);\n ...
[ "0.7602432", "0.75176483", "0.75172555", "0.71170855", "0.71164656", "0.7082114", "0.7081697", "0.6843119", "0.6697015", "0.667763", "0.6616454", "0.66113347", "0.6593418", "0.6581595", "0.6573578", "0.6559495", "0.65104944", "0.6466898", "0.64501756", "0.64403915", "0.643583...
0.0
-1
This function shoots a bullet from the player
function shootBullet() { // Disable shooting for a short period of time canShoot = false; setTimeout("canShoot = true", SHOOT_INTERVAL); // Create the bullet using the use node var bullet = document.createElementNS("http://www.w3.org/2000/svg", "use"); bullet.setAttribute("x", player.position.x + PLAYER_SIZE.w / 2 - BULLET_SIZE.w / 2); bullet.setAttribute("y", player.position.y + PLAYER_SIZE.h / 2 - BULLET_SIZE.h / 2); bullet.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", "#bullet"); document.getElementById("bullets").appendChild(bullet); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shootBullet() {\n if (!cheatMode) {\n --bulletsLeft;\n }\n\n updateBulletsNumber();\n\n // Disable shooting for a short period of time\n player.readyToShoot = false;\n setTimeout(\"player.readyToShoot = true\", PLAYER_SHOOT_INTERVAL);\n\n // Create the bullet using the use node\n var bullet = d...
[ "0.81954247", "0.8124464", "0.8049461", "0.80111843", "0.7779824", "0.77730066", "0.77631354", "0.7726897", "0.7637813", "0.7588914", "0.7583506", "0.7573156", "0.75551826", "0.75333387", "0.74282426", "0.74223644", "0.7418206", "0.7388679", "0.72680455", "0.7232402", "0.7195...
0.7098799
23
This function updates the position of the bullets
function moveBullets() { // Go through all bullets var bullets = document.getElementById("bullets"); for (var i = 0; i < bullets.childNodes.length; i++) { var node = bullets.childNodes.item(i); // Update the position of the bullet var x = parseInt(node.getAttribute("x")); node.setAttribute("x", x + BULLET_SPEED); // If the bullet is not inside the screen delete it from the group if (x > SCREEN_SIZE.w) { bullets.removeChild(node); i--; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setBulletPosition() {\n\t\tthis.x = Math.round(this.originalPosition.x);\n\t\tthis.y = Math.round(this.originalPosition.y);\n\t}", "function draw_bullets(){\n bullets.forEach(function(element){\n element.y -= 10;\n element.update()\n })\n}", "updateBullets() {\n for (var i = 0; i < this....
[ "0.8091789", "0.80157334", "0.7560784", "0.7291882", "0.72227675", "0.7140583", "0.7088589", "0.70883656", "0.7086638", "0.7082433", "0.7073099", "0.6998997", "0.69621515", "0.69461787", "0.69151276", "0.68710095", "0.68699235", "0.68177396", "0.680836", "0.6769661", "0.67601...
0.7340638
3
This is the keydown handling function for the SVG document
function keydown(evt) { var keyCode = (evt.keyCode)? evt.keyCode : evt.getKeyCode(); switch (keyCode) { case "N".charCodeAt(0): player.motion = motionType.LEFT; break; case "M".charCodeAt(0): player.motion = motionType.RIGHT; break; // Add your code here case "Z".charCodeAt(0): if (player.isOnPlatform()) { player.verticalSpeed = JUMP_SPEED; } break; case 32: // spacebar = shoot if (canShoot) shootBullet(); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "svgKeyDown() {\n\t\tlet {internalFlags, constants} = this;\n\t\t// make sure repeated key presses don't register for each keydown\n\t\tif (internalFlags.lastKeyDown !== -1) return;\n\n\t\tinternalFlags.lastKeyDown = d3.event.keyCode;\n\t\tvar selectedEdge = internalFlags.selectedEdge;\n\t\t// var selectedNode = in...
[ "0.7962954", "0.74845344", "0.74328256", "0.71410114", "0.6666935", "0.6641429", "0.6614348", "0.66029656", "0.6522238", "0.6509535", "0.6413506", "0.6413506", "0.6399048", "0.63777286", "0.6352311", "0.62734455", "0.6260855", "0.6236484", "0.6211403", "0.62006044", "0.619950...
0.0
-1
This is the keyup handling function for the SVG document
function keyup(evt) { // Get the key code var keyCode = (evt.keyCode)? evt.keyCode : evt.getKeyCode(); switch (keyCode) { case "N".charCodeAt(0): if (player.motion == motionType.LEFT) player.motion = motionType.NONE; break; case "M".charCodeAt(0): if (player.motion == motionType.RIGHT) player.motion = motionType.NONE; break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function d3_keyup() {\n\n lastKeyDown = -1;\n // ctrl\n if (!d3.event.ctrlKey) {\n rect.on('mousedown.drag', null)\n .on('touchstart.drag', null);\n svg.classed('ctrl', false);\n }\n}", "svgKeyDown() {\n\t\tlet {internalFlags, constants} = this;\n\t\t// make sure repeated key...
[ "0.6739142", "0.6614581", "0.6191288", "0.6168498", "0.59431124", "0.5933358", "0.5899151", "0.5818731", "0.5818731", "0.5817197", "0.57678103", "0.5706828", "0.5706828", "0.57025915", "0.5670377", "0.566921", "0.5667128", "0.56633455", "0.56535095", "0.5624179", "0.5599112",...
0.0
-1
This function checks collision
function collisionDetection() { // Check whether the player collides with a monster var monsters = document.getElementById("monsters"); for (var i = 0; i < monsters.childNodes.length; i++) { var monster = monsters.childNodes.item(i); var x = parseInt(monster.getAttribute("x")); var y = parseInt(monster.getAttribute("y")); if (intersect(new Point(x, y), MONSTER_SIZE, player.position, PLAYER_SIZE)) { alert("Game over!"); clearInterval(gameInterval); } } // Check whether a bullet hits a monster var bullets = document.getElementById("bullets"); for (var i = 0; i < bullets.childNodes.length; i++) { var bullet = bullets.childNodes.item(i); var x = parseInt(bullet.getAttribute("x")); var y = parseInt(bullet.getAttribute("y")); for (var j = 0; j < monsters.childNodes.length; j++) { var monster = monsters.childNodes.item(j); var mx = parseInt(monster.getAttribute("x")); var my = parseInt(monster.getAttribute("y")); if (intersect(new Point(x, y), BULLET_SIZE, new Point(mx, my), MONSTER_SIZE)) { monsters.removeChild(monster); j--; bullets.removeChild(bullet); i--; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collision (px,py,pw,ph,ex,ey,ew,eh){\nreturn (Math.abs(px - ex) *2 < pw + ew) && (Math.abs(py - ey) * 2 < ph + eh);\n \n}", "function check_collision( objects_to_check )\n\t{\n\t\treturn false;\n\t}", "checkCollision() { \n return (player.x < this.x + 80 &&\n player.x + 80 > this...
[ "0.8242537", "0.81642884", "0.7972531", "0.7969144", "0.79020214", "0.7889868", "0.7889128", "0.7847722", "0.78150135", "0.77911234", "0.77808726", "0.7743704", "0.77410895", "0.77223575", "0.77132636", "0.7702885", "0.76842475", "0.7679602", "0.76764977", "0.7670293", "0.766...
0.0
-1
This function updates the position and motion of the player in the system
function gamePlay() { // Check collisions collisionDetection(); // Check whether the player is on a platform var isOnPlatform = player.isOnPlatform(); // Update player position var displacement = new Point(); // Move left or right if (player.motion == motionType.LEFT) displacement.x = -MOVE_DISPLACEMENT; if (player.motion == motionType.RIGHT) displacement.x = MOVE_DISPLACEMENT; // Fall if (!isOnPlatform && player.verticalSpeed <= 0) { displacement.y = -player.verticalSpeed; player.verticalSpeed -= VERTICAL_DISPLACEMENT; } // Jump if (player.verticalSpeed > 0) { displacement.y = -player.verticalSpeed; player.verticalSpeed -= VERTICAL_DISPLACEMENT; if (player.verticalSpeed <= 0) player.verticalSpeed = 0; } // Get the new position of the player var position = new Point(); position.x = player.position.x + displacement.x; position.y = player.position.y + displacement.y; // Check collision with platforms and screen player.collidePlatform(position); player.collideScreen(position); // Set the location back to the player object (before update the screen) player.position = position; moveBullets(); updateScreen(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n\n \n this.movePlayerManager();\n\n\n \n\n }", "function update() {\n playerMove();\n cooldowns.call(this);\n moveEnemies();\n // this.cameras.main.centerOn(player.x, player.y);\n}", "updatePos() {\n if (this.x != this.player.x || this.y != this.player.y) {\n this.x = thi...
[ "0.7678881", "0.7461553", "0.74586976", "0.7404698", "0.7236142", "0.7215115", "0.7205637", "0.7200216", "0.7189333", "0.7148933", "0.71409374", "0.7139025", "0.71174455", "0.69798136", "0.6968483", "0.6965046", "0.69596887", "0.69544655", "0.6942745", "0.69264126", "0.692351...
0.67552507
28
This function updates the position of the player's SVG object and set the appropriate translation of the game screen relative to the the position of the player
function updateScreen() { // Transform the player player.node.setAttribute("transform", "translate(" + player.position.x + "," + player.position.y + ")"); // Calculate the scaling and translation factors // Add your code here }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateScreen() {\r\n // Transform the player\r\n player.node.setAttribute(\"transform\", \"translate(\" + player.position.x + \",\" + player.position.y + \")\");\r\n\r\n // Calculate the scaling and translation factors\r\n var scale = new Point(zoom, zoom);\r\n var translate = new Point();\...
[ "0.79604137", "0.7808896", "0.7473345", "0.68191874", "0.6784075", "0.6685899", "0.66411537", "0.6572363", "0.65064424", "0.65058273", "0.64343697", "0.6419902", "0.64089346", "0.6400639", "0.6349988", "0.63416183", "0.6277009", "0.6267692", "0.6261956", "0.6210306", "0.62013...
0.7708287
2
With a function defined separately
function sayHi() { alert('Hello Mr. Universe! (3)'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function miFuncion (){}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function fn() {}", "function fun() { }", "function fn() {\n\t\t }", "function Func_s() {\n}", "function a(fn) { fn()}", "function fm(){}", "function myFnCall(fn) {\n return new Function...
[ "0.6948482", "0.68829966", "0.68829966", "0.68829966", "0.6613614", "0.6588897", "0.64869076", "0.63582677", "0.63441885", "0.6329984", "0.62855595", "0.6278528", "0.6277645", "0.6273575", "0.6265701", "0.62605596", "0.6255746", "0.6248913", "0.6244802", "0.6219179", "0.61811...
0.0
-1
Passing parameters to a setTimeout() function
function sayHi2(who) { alert('Hello ' + who + '! (4)'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTimeout(callback, timeout) {return callback()} // TODO", "function setCustomTimeout(fn, delay){\n //wait\n var cur_d = new Date();\n var cur_ticks = cur_d.getTime();\n var ms_passed = 0;\n while(ms_passed < delay) {\n var d = new Date(); // Possible memory leak?\n var ticks = d.g...
[ "0.7155535", "0.7126834", "0.7075202", "0.7008221", "0.6809834", "0.67862034", "0.67361796", "0.6720738", "0.66620857", "0.6627461", "0.6617602", "0.6614258", "0.65808624", "0.6563656", "0.6552372", "0.65374076", "0.6523482", "0.65081596", "0.65048295", "0.6497928", "0.641299...
0.0
-1
Action d'ajouter la valeur au titre de jour
function calendrierAction(event) { /* Référence à l'écran, le jour, la phrase de défaut */ var txtJour = document.querySelector("#textJour"), el = event.target, phraseDefaut = "Day Selected : "; /* Si on ne aucun jour choisi dernièrement */ if(jourChoisi == null) { jourChoisi = new Array(); } /* Cherche notre jour dans le tableau, si rien est trouvé, on l'ajoute*/ if(jourChoisi.indexOf(el.getAttribute("data-jour")) == -1) { /* Ajout du jour dans notre tableau */ jourChoisi.push(el.getAttribute("data-jour")); } /* Si le jour est déjà dans le tableau */ else if(jourChoisi.indexOf(el.getAttribute("data-jour")) != -1){ var posJour = jourChoisi.indexOf(el.getAttribute("data-jour")); jourChoisi.splice(posJour,1); } /* Joue l'animation de fade-in/fade-out */ el.emit("playFade"); /* Enregistrement de la variable jourChoisi dans la sessionStorage */ sessionStorage.setItem("jourChoisi", JSON.stringify(jourChoisi)); txtJour.setAttribute("value", phraseDefaut + jourChoisi.toString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTitle() {\n let niveau = getUrlParameter('level');\n $('#title').text(\"Niveau \" + niveau);\n}", "function setCVCategoryVaardighedenTitle() {\n $('#title').html('Cattegorie instellingen voor Vaardigheden')\n $('#subtitle').html('Stel hier de Categorie voor de vaardigheden die u heeft')\n...
[ "0.7180184", "0.67406917", "0.67269534", "0.6580838", "0.6499202", "0.6490812", "0.64771056", "0.6417916", "0.6402747", "0.6374774", "0.6351741", "0.63261265", "0.6310749", "0.6280746", "0.62772447", "0.6276305", "0.62675136", "0.62562174", "0.6252349", "0.62413377", "0.62161...
0.0
-1
Create new Announcement button
function AddNewA(){ document.getElementById('newABlock').style.display ='block'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createButton(buttonName) {\n\n\t// button details\n\tvar newButton = $(\"<button>\");\n\t\tnewButton.addClass(\"subjectButton btn btn-primary\");\n\t\tnewButton.attr(\"data-subject\", buttonName);\n\t\tnewButton.text(buttonName);\n\n\t// add button to display\n\t$(\"#buttons\").append(newButton);\n\n}", ...
[ "0.665023", "0.6606383", "0.65983284", "0.64718515", "0.63893795", "0.62772244", "0.6237929", "0.6225992", "0.6219636", "0.6174366", "0.6162061", "0.6141454", "0.6138052", "0.61230254", "0.61071116", "0.6099886", "0.60956156", "0.60926545", "0.6083262", "0.60730255", "0.60415...
0.0
-1
get mail template by "id"
function mailTemplatePost(req, res, next) { MailTemplateService.getMailTemplate(req.body.mailTemplate, function(error, result) { if (result.sessionId) { let snapshot = sessionBuilderSnapshotValidationService.getMailTemplateSnapshot(result); res.send({error: error, template: result, snapshot: snapshot}); } else { res.send({error: error, template: result}); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $getMailTemplate(_log, _insDB, _gID){\n return new Promise((_rl, _rj)=> {\n _log.debug(\"The parameters is [%s]\", typeof({\"group_id\": _gID}));\n\n _insDB.any(`select ec.mail_template\n from em_group_2_mail g2m\n inner join em_group eg\n on g2m.group_id = eg....
[ "0.71664476", "0.7139999", "0.6730952", "0.67190117", "0.66259825", "0.655211", "0.6486017", "0.64785486", "0.63310623", "0.6265699", "0.6206418", "0.60506135", "0.6019164", "0.58744156", "0.57988477", "0.5760448", "0.57513577", "0.57502556", "0.5726073", "0.57047874", "0.567...
0.5065423
87
accepts template object from client in case if user tests unsaved HTML fills template with preset data for preview purposes
function previewMailTemplatePost(req, res, next) { MailTemplateService.composePreviewMailTemplate(req.body.mailTemplate, req.body.sessionId, function(result) { if (!result.error) { res.send({error: null, template: result}); } else { res.send({error: result.error, template: null}); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadTemplate() {\n if ($.isEmptyObject(oTemplate) === true) {\n oTemplate = $('.template').clone();\n }\n }", "get template() { return this._template; }", "setTemplate(template) {\n this.template = template;\n }", "function singleStorageTemplate(data) {\n //t...
[ "0.6777535", "0.64942014", "0.6331239", "0.63252074", "0.6237417", "0.62366366", "0.62323594", "0.62054545", "0.61904323", "0.6188724", "0.6177985", "0.6174321", "0.6169499", "0.6157663", "0.6141326", "0.6125919", "0.61192334", "0.611431", "0.6111113", "0.61024475", "0.609984...
0.0
-1
Making a POST request
function addCharacter () { // Create object with new character's info var newCharacter = { name: $('.Swname').val(), occupation: $('.Swocc').val(), weapon: $('.Swweapon').val() }; // Make a POST request to the API with the info var request = $.post('https://ironhack-characters.herokuapp.com/characters', newCharacter); function onSaveSuccess (response) { console.debug('BOOM', response); } function onSaveFailure (err) { // Print out the error response console.error(err.responseJSON); } request.done(onSaveSuccess); request.fail(onSaveFailure); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function postRequest() {\n // TODO\n}", "post(url, body, options = {}) {\n return this.request('POST', url, addBody(options, body));\n }", "post(url, data, opt = {}) {\n opt.method = 'POST';\n opt.data = data;\n return this.sendRequest(url, opt);\n }", "function http_post(req_url){\n ...
[ "0.75870794", "0.74879646", "0.744904", "0.7392511", "0.7313302", "0.73070514", "0.73070514", "0.73070514", "0.73070514", "0.73070514", "0.70975596", "0.70383614", "0.698324", "0.6968119", "0.6946639", "0.6946104", "0.694458", "0.6944179", "0.69398004", "0.69073707", "0.68969...
0.0
-1
get the y axis title of the chart
function getGraphTitleFtn() { return obj.selected; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function appendYAxisTitle(svg, plot) {\n svg.append('text')\n .attr('id', 'yTitle')\n .attr('transform', 'translate(' + (plot.padding.left/3) + ','\n + (plot.padding.top + plot.range.y/2) + ') rotate(-90)')\n .text('Concentration %');\n }", "function name...
[ "0.763321", "0.7325036", "0.69663244", "0.69663244", "0.6665529", "0.6622898", "0.63202524", "0.63202524", "0.6206746", "0.6196276", "0.618874", "0.6132986", "0.60834485", "0.6078867", "0.6063049", "0.6011214", "0.5997495", "0.59961075", "0.5975237", "0.5954416", "0.5948856",...
0.0
-1
set the y axis title of the chart
function setYAxisTitleFtn(chart, index, labels) { $log.info('setting the Y Axis title: ' + labels[index]); chart.options.vAxis.title = labels[index]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function appendYAxisTitle(svg, plot) {\n svg.append('text')\n .attr('id', 'yTitle')\n .attr('transform', 'translate(' + (plot.padding.left/3) + ','\n + (plot.padding.top + plot.range.y/2) + ') rotate(-90)')\n .text('Concentration %');\n }", "function draw...
[ "0.79353875", "0.6971474", "0.68736976", "0.6855753", "0.6648476", "0.6598415", "0.64830506", "0.6376461", "0.6376461", "0.6343131", "0.6199379", "0.61716086", "0.60718036", "0.60692686", "0.60502845", "0.6016776", "0.6013383", "0.5992236", "0.59639055", "0.59461194", "0.5931...
0.81854814
0
set the y axis title of the chart
function getCSVDataFtn() { return google.visualization.dataTableToCsv(obj.chart.data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setYAxisTitleFtn(chart, index, labels) {\n $log.info('setting the Y Axis title: ' + labels[index]);\n chart.options.vAxis.title = labels[index];\n }", "function setYAxisTitleFtn(chart, index, labels) {\n $log.info('setting the Y Axis title: ' + labels[index]);\n chart.op...
[ "0.81841975", "0.81841975", "0.79346555", "0.6973585", "0.68735033", "0.6855978", "0.66479844", "0.65946144", "0.648563", "0.6378859", "0.6378859", "0.63450253", "0.6200137", "0.61728144", "0.60724187", "0.6066875", "0.60516083", "0.60153437", "0.6014644", "0.5994542", "0.596...
0.0
-1
all things done only once
function setup() { createCanvas(600, 400); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeOnce(){\n console.log('writeOnce()');\n doPicList();\n doLargeText();\n // tracker();\n onesZeros();\n}", "__init3() {this._finished = false;}", "__init3() {this._finished = false;}", "__init3() {this._finished = false;}", "once() {\n this.stop()\n this.step()\n ...
[ "0.68978596", "0.60764295", "0.60764295", "0.60764295", "0.60626596", "0.6017886", "0.5959235", "0.58961654", "0.5879064", "0.583562", "0.583562", "0.5827244", "0.5810413", "0.5771238", "0.5762178", "0.5724368", "0.57111174", "0.56801957", "0.5660528", "0.56424916", "0.564119...
0.0
-1
check and report error conditions fail will execute the callback
function error(args, err, cb) { if (err) { seneca.log.debug('error: ' + err); seneca.fail({code:'entity/error',store:name}, cb); } return err; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function failureCB(){}", "function failureCB() { }", "callbackWrapper() {\n if (this.error == \"obstruction_error\") {\n this.error = false\n this.callback('obstruction_error')\n } else if (this.error == 'outofbounds_error') {\n this.error = false\n thi...
[ "0.7674386", "0.73315495", "0.71292096", "0.6966852", "0.67104733", "0.66389793", "0.6566288", "0.6564513", "0.6526316", "0.64390206", "0.64347565", "0.64347565", "0.64347565", "0.6406681", "0.6391222", "0.63375586", "0.63260365", "0.63135886", "0.6309453", "0.6307777", "0.62...
0.0
-1
ensure that the nominated simpledb domain exists. if it does not exist it will be created. params: args ent cb callback
function ensureDomain(args, ent, cb) { var canon = ent.canon$({object:true}); var domainName = (canon.base?canon.base + '_' : '') + canon.name; dbinst.listDomains(function(err, domains){ if (!err) { if (!_.find(domains, function(item) { return item === domainName; })) { dbinst.createDomain(domainName, function(err, result) { cb(err, dbinst, domainName); }); } else { cb(err, dbinst, domainName); } } else { cb(err, null, null); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkPartnerX(callback) {\n origin.create(callback, { url: \"/doesntexist\" });\n }", "function validateDomain() {\n HttpFactory.post('/api/v1/validate', {domain: ctrl.domain.domain})\n .then(function(response) {\n ctrl.isValidDomain = response.data;\n\n ...
[ "0.56095916", "0.5509912", "0.5504735", "0.5421949", "0.53671265", "0.53012884", "0.5293016", "0.5180597", "0.5156601", "0.50719464", "0.5054258", "0.5015661", "0.4983323", "0.49825045", "0.49250302", "0.4923558", "0.49111757", "0.4907865", "0.48981434", "0.48894697", "0.4887...
0.82122284
0
deserialize data from simple DB: objects and boolans need conversion from string TODO: this should most likely live in the simpledb driver NOT here...
function deserialize(data) { var result = {}; _.each(data, function(value, key, list) { if (typeof value === 'string') { if (value === 'true') { data[key] = true; } if (value === 'false') { data[key] = false; } if (value.match(/[\d]+-[\d]+-[\d]+T/g)) { data[key] = new Date(value.replace(/^["\s]+|["\s+]$/g,'')); } if (value.match(/^[\{\[].*[\}\]]$/g)) { try { data[key] = JSON.parse(value); } catch (e) { // not an object continue in any case... } } } }); return data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deserialize(value) {\n // If we haven't marked this string as being specially serialized (i.e.\n // something other than serialized JSON), we can just return it and be\n // done with it.\n if (value.substring(0, SERIALIZED_MARKER_...
[ "0.5997156", "0.59551406", "0.59551406", "0.59551406", "0.5939179", "0.58839494", "0.5883745", "0.58017576", "0.5796141", "0.5796141", "0.5796141", "0.5796141", "0.5796141", "0.5796141", "0.5796141", "0.5796141", "0.5796141", "0.57506883", "0.57506883", "0.574295", "0.5721118...
0.5867194
7
make a GUID Notes: needs better seed generation.
function makeGuid() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c){ var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); return v.toString(16); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static createGuid() {\n return Math.random().toString(36).substring(2, 15) +\n Math.random().toString(36).substring(2, 15);\n }", "createGuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n // eslint-disable-next-line\n var r = Math.ran...
[ "0.85585445", "0.8417411", "0.8376842", "0.83348507", "0.82978654", "0.8284737", "0.82768565", "0.8243388", "0.82218874", "0.82210916", "0.8205596", "0.81921417", "0.8188581", "0.8166545", "0.8163857", "0.81575906", "0.815113", "0.8149187", "0.8144711", "0.8143359", "0.813454...
0.8633084
0
builds a simple db select statement from a mongo style JSON query
function buildSimpleDbSelect(domainName, q) { var query; if (_.keys(q).length > 0) { var where = convertQueryFromJsonToWhere(q); query = "select * from `" + escapeStr(domainName) + "` " + where; } else { query = "select * from `" + escapeStr(domainName) + "`"; } return query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function queryDataTest3() {\n var start_q ='\\\"'+(new Date(Date.UTC(2017,11,1,8,0,0))).toISOString()+'\\\"';\n var end_q = '\\\"'+(new Date(Date.UTC(2017,11,2,10,0,0))).toISOString()+'\\\"';;\n var or1 = '{\"start_time\":{\"$gte\":'+start_q+',\"$lte\":'+end_q+'}},';\n var or2 = '{\"end_time\":{\"$gte\":'+star...
[ "0.5997834", "0.5974881", "0.58595425", "0.5710631", "0.570789", "0.56883186", "0.56547165", "0.56492716", "0.5605174", "0.55827487", "0.5573866", "0.5559298", "0.5507013", "0.5469353", "0.543465", "0.5406462", "0.53495574", "0.5342546", "0.5339981", "0.53333884", "0.526077",...
0.58769935
2
Code for toggle functions taken from
function togglePriNon() { if ($('#prioritize').is(':checked')) $('#list-likey').replaceWith($('<ol id="list-likey">' + $('#list-likey').html() + '</ol>')); else $('#list-likey').replaceWith($('<ul id="list-likey">' + $('#list-likey').html() + '</ul>')); $('.up-down').toggleClass('invisible'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onToggle() {}", "toggle(){this.off=!this.off}", "toggle4() {\r\n }", "onToggle() {\r\n this.toggle = !this.toggle;\r\n }", "function toggles(e){\n switch(e){\n case 49: //1\n lightsOn[0] = !lightsOn[0];\n break;\n case 50: //2\n lightsOn[1] = !lightsOn[1];\n ...
[ "0.82004464", "0.8072964", "0.7931358", "0.74784875", "0.73484015", "0.7144393", "0.7030745", "0.7023448", "0.69760704", "0.69117826", "0.69022447", "0.69011825", "0.68635625", "0.68274593", "0.68274593", "0.6820734", "0.6818354", "0.68117297", "0.68117297", "0.68075037", "0....
0.0
-1
Lifecycle hook, runs after component has mounted onto the DOM structure
componentDidMount() { const request = new Request('http://127.0.0.1:8081/questions/'); fetch(request) .then(response => response.json()) .then(data => this.setState({data: data})); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createdCallback() {\n\t // component will mount only if part of the active document\n\t this.componentWillMount();\n\t}", "load (el) {\n console.log('Component was mounted on the DOM')\n }", "componentDidMount() {\n if(typeof componentHandler !== 'undefined')\n componentHandler.upgradeD...
[ "0.7476048", "0.71652204", "0.70766634", "0.70227003", "0.68935144", "0.68838584", "0.68679917", "0.6843725", "0.6842333", "0.6817542", "0.6811037", "0.678628", "0.678628", "0.67698866", "0.67332137", "0.6731511", "0.67174995", "0.67026144", "0.6663898", "0.6647855", "0.66364...
0.0
-1
rootselector allow for linktracking on ajax loaded content
function linktracking($rootselector) { // console.log("... RUNNING LINK TRACKING ON: " + $rootselector.selector); /* Begin JQuery link tracking */ // allows for link tracking to include a defined prefix for any given page if (typeof(trackingPrefix) != "string") {trackingPrefix = "";} else { trackingPrefix = "/" + trackingPrefix; } // find all A and AREA links to external sites, and enable onclick tacking var allLinks = $rootselector.find("A[href^='http'],AREA[href^='http']"); // must start with http (outgoing), but can't link back to visitphilly.com allLinks = allLinks.not("[class*='cboxElement']"); allLinks = allLinks.not("[href*='://dev.visitphilly.com']"); allLinks = allLinks.not("[href*='://stage.visitphilly.com']"); allLinks = allLinks.not("[href*='://visitphilly.serv']"); allLinks = allLinks.not("[href*='://visitphilly.com']"); allLinks = allLinks.not("[href*='://www.visitphilly.com']"); allLinks = allLinks.not("[href$='.pdf']"); allLinks = allLinks.not("[href$='.mp3']"); allLinks.each(function(i){ $(this).addClass("tracking"); $(this).click(function(e) { var thisHref = $(this).attr("href"); console.log(thisHref); thisHref = thisHref.replace("http://", ""); // remove http thisHref = thisHref.replace("https://", ""); // remove http if (thisHref.charAt(thisHref.length - 1) == "/") { // trim ending slash thisHref = thisHref.substr(0,thisHref.length - 1); } trackitem('/outbound/'+thisHref,this,e); }); var aHref = $(this).attr("href"); if(aHref.indexOf("youvisit.com") == -1) { // Open all external in new window // moved to before click atarget = $(this).attr("target"); if (empty(atarget)) { $(this).attr("target","_blank"); } } }); /* $(".youvisit_container").each(function(i){ $(this).addClass("tracking"); $(this).click(function(e) { _gaq.push(['_trackEvent', 'YouVisit', 'YouVisit','YouVisit']); }); });*/ var allPdf = $rootselector.find("a[href$='.pdf'],a[href$='.mp3']"); allPdf.each( function(i){ $(this).click(function(e) { var thisHref = $(this).attr("href"); thisHref = thisHref.replace("http://c0526532.cdn.cloudfiles.rackspacecloud.com/", ""); thisHref = thisHref.replace("http://www.visitphilly.com/", ""); trackitem('/downloads/' + thisHref,this,e); }); var aHref = $(this).attr("href"); if(aHref.indexOf("youvisit.com") == -1) { // Open all external in new window // moved to before click atarget = $(this).attr("target"); if (empty(atarget)) { $(this).attr("target","_blank"); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fancybox_nested_links() {\n\t\t$.get($(this).attr('href'), function(data){\n\t\t\t// pull out the html starting with div class=\"content\"\n\t\t\tvar x = $('div.content', data).html();\n\t\t\t// insert the new html\n\t\t\t$('#fancybox-content div.content').html(x);\n\t\t\t// register any new fancybox-nest...
[ "0.57153624", "0.57060015", "0.55183095", "0.5467071", "0.54174405", "0.53914773", "0.53624797", "0.53550285", "0.5324521", "0.5324521", "0.5321673", "0.5247417", "0.52308464", "0.5228402", "0.5218341", "0.52110463", "0.520964", "0.51868904", "0.517908", "0.5176264", "0.51544...
0.5219606
14
GENERAL EVENT TRACKING FUNCTION
function trackevent(e,wType,wLab,wVal,nonint,cleantext) { // assumes interaction, unless specficy as not // VALUE CAN ONLY BE NUMBER if (typeof(eventpagename) == "undefined") { console.log("no event page name"); return; } if (empty(eventpagename)) { console.log("no event page name"); return; } wSection = eventpagename; if (typeof(e) != "boolean") { if ( e.originalEvent === undefined ) { console.log("NHEVENT PCLICK"); return; // programatic click, no tracking } } if (!nonint) { nonint = false; } // wVal = nhclean(wVal); wType = oneline(wType); if (empty(wLab)) { wLab = ""; } else { wLab = justpath(wLab); } // strip down if url if (empty(wVal)) { wVal = "0"; } else { wVal = justpath(wVal); } console.log(">>>>>>>>>>>> TRACKEVENT: "+ " " +wSection+ " " + wType + " " + wVal); wVal = parseInt(wVal,10); ///////////_trackEvent, category, action, opt_label, opt_value<number, opt_noninteraction) _gaq.push(['_trackEvent', wSection, wType, wLab , wVal ,nonint]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EventInfo() { }", "function EventInfo() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() {}", "function EventHelper (possibleEvents) {\n }", ...
[ "0.7364112", "0.7364112", "0.6907364", "0.6907364", "0.6907364", "0.6907364", "0.6907364", "0.68415046", "0.66852003", "0.666705", "0.6660577", "0.66283613", "0.6622913", "0.66098434", "0.6585084", "0.6584334", "0.6563585", "0.6528329", "0.65011793", "0.64636385", "0.63906354...
0.6362163
24
Requests to /api/morechildren are capped at 20 comments at a time, but requests to /api/info are capped at 100, so it's easier to send to the latter. The disadvantage is that comment replies are not automatically sent from requests to /api/info.
fetchMore(options) { var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; if (options.amount <= 0 || startIndex >= this.children.length) { return _Promise2.default.resolve([]); } if (!options.skipReplies) { return this.fetchTree(options, startIndex); } var ids = getNextIdSlice(this.children, startIndex, options.amount, _constants.MAX_API_INFO_AMOUNT).map(function (id) { return 't1_' + id; }); // Requests are capped at 100 comments. Send lots of requests recursively to get the comments, then concatenate them. // (This speed-requesting is only possible with comment Listings since the entire list of ids is present initially.) var promiseForThisBatch = this._r._getListing({ uri: 'api/info', qs: { id: ids.join(',') } }); var nextRequestOptions = _extends({}, options, { amount: options.amount - ids.length }); var promiseForRemainingItems = this.fetchMore(nextRequestOptions, startIndex + ids.length); return _Promise2.default.all([promiseForThisBatch, promiseForRemainingItems]).then(_flatten3.default); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getComments(response, request) {\n\tconsole.log(\"Request handler 'getComments' was called.\");\n\n\t// get parent ID\n\tvar queryData = url.parse(request.url, true).query;\n\tvar pid = queryData.id;\n\tif (!data.isValid(pid)) {\n\t\tresponse.writeHead(400, { \"Content-Type\" : MIME_TYPES['.txt']});\n\t\t...
[ "0.63925064", "0.6156463", "0.61188966", "0.60353184", "0.5958397", "0.5895701", "0.58913016", "0.58614826", "0.5786016", "0.5769686", "0.5767934", "0.5744528", "0.57321906", "0.57219565", "0.5721494", "0.5683956", "0.5682594", "0.5672276", "0.56685805", "0.5590386", "0.54742...
0.6965359
0
Row navigation needs to be calculated according to TableFilter's validRowsIndex array
function onAfterSelection(et, selecteElm, e){ if(!o.validRowsIndex) return; //table is not filtered var row = et.defaultSelection != 'row' ? selecteElm.parentNode : selecteElm; var cell = selecteElm.nodeName=='TD' ? selecteElm : null; //cell for default_selection = 'both' or 'cell' var keyCode = e != undefined ? et.Event.GetKey(e) : 0; var isRowValid = o.validRowsIndex.tf_Has(row.rowIndex); var nextRowIndex; var d = (keyCode == 34 || keyCode == 33 ? (o.pagingLength || et.nbRowsPerPage) : 1); //pgup/pgdown keys //If next row is not valid, next valid filtered row needs to be calculated if(!isRowValid){ //Selection direction up/down if(row.rowIndex>o._lastRowIndex){ if(row.rowIndex >= o.validRowsIndex[o.validRowsIndex.length-1]) //last row nextRowIndex = o.validRowsIndex[o.validRowsIndex.length-1]; else{ var calcRowIndex = (o._lastValidRowIndex + d); if(calcRowIndex > (o.validRowsIndex.length-1)) nextRowIndex = o.validRowsIndex[o.validRowsIndex.length-1]; else nextRowIndex = o.validRowsIndex[calcRowIndex]; } } else{ if(row.rowIndex <= o.validRowsIndex[0]) nextRowIndex = o.validRowsIndex[0];//first row else{ var v = o.validRowsIndex[o._lastValidRowIndex - d]; nextRowIndex = v ? v : o.validRowsIndex[0]; } } o._lastRowIndex = row.rowIndex; DoSelection(nextRowIndex); } else{ //If filtered row is valid, special calculation for pgup/pgdown keys if(keyCode!=34 && keyCode!=33){ o._lastValidRowIndex = o.validRowsIndex.tf_IndexByValue(row.rowIndex); o._lastRowIndex = row.rowIndex; } else { if(keyCode == 34){ //pgdown if((o._lastValidRowIndex + d) <= (o.validRowsIndex.length-1)) //last row nextRowIndex = o.validRowsIndex[o._lastValidRowIndex + d]; else nextRowIndex = o.validRowsIndex[o.validRowsIndex.length-1]; } else { //pgup if((o._lastValidRowIndex - d) <= (o.validRowsIndex[0])) //first row nextRowIndex = o.validRowsIndex[0]; else nextRowIndex = o.validRowsIndex[o._lastValidRowIndex - d]; } o._lastRowIndex = nextRowIndex; o._lastValidRowIndex = o.validRowsIndex.tf_IndexByValue(nextRowIndex); DoSelection(nextRowIndex); } } //Next valid filtered row needs to be selected function DoSelection(nextRowIndex){ if(et.defaultSelection == 'row'){ et.Selection.SelectRowByIndex(nextRowIndex); } else { et.ClearSelections(); var cellIndex = selecteElm.cellIndex; var row = o.tbl.rows[nextRowIndex]; if(et.defaultSelection == 'both') et.Selection.SelectRowByIndex(nextRowIndex); if(row) et.Selection.SelectCell(row.cells[cellIndex]); } //Table is filtered if(o.validRowsIndex.length != o.GetRowsNb()){ var row = o.tbl.rows[nextRowIndex]; if(row) row.scrollIntoView(false); if(cell){ if(cell.cellIndex==(o.GetCellsNb()-1) && o.gridLayout) o.tblCont.scrollLeft = 100000000; else if(cell.cellIndex==0 && o.gridLayout) o.tblCont.scrollLeft = 0; else cell.scrollIntoView(false); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function watchByTableRows(){\n scope.$watch(function () {\n return tableCtrl.items;\n }, function (newVal) {\n scope.firstShowingRecordNumber = ( (tableCtrl.currentPage - 1) * tableCtrl.rowsOnPage) + 1;\n scope.lastShowingRecordNumber = scope.firstShowingRecordNumber + new...
[ "0.6275539", "0.6152105", "0.61089987", "0.606125", "0.60141224", "0.599389", "0.59630674", "0.58686024", "0.5865561", "0.5861295", "0.5817468", "0.5797318", "0.5789881", "0.5705301", "0.5701013", "0.56493944", "0.56161875", "0.5613135", "0.5569459", "0.5564996", "0.5547341",...
0.5573224
18
Next valid filtered row needs to be selected
function DoSelection(nextRowIndex){ if(et.defaultSelection == 'row'){ et.Selection.SelectRowByIndex(nextRowIndex); } else { et.ClearSelections(); var cellIndex = selecteElm.cellIndex; var row = o.tbl.rows[nextRowIndex]; if(et.defaultSelection == 'both') et.Selection.SelectRowByIndex(nextRowIndex); if(row) et.Selection.SelectCell(row.cells[cellIndex]); } //Table is filtered if(o.validRowsIndex.length != o.GetRowsNb()){ var row = o.tbl.rows[nextRowIndex]; if(row) row.scrollIntoView(false); if(cell){ if(cell.cellIndex==(o.GetCellsNb()-1) && o.gridLayout) o.tblCont.scrollLeft = 100000000; else if(cell.cellIndex==0 && o.gridLayout) o.tblCont.scrollLeft = 0; else cell.scrollIntoView(false); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onAfterSelection(et, selecteElm, e){\r\n\t\t\t\tif(!o.validRowsIndex) return; //table is not filtered\r\n\t\t\t\tvar row = et.defaultSelection != 'row' ? selecteElm.parentNode : selecteElm;\r\n\t\t\t\tvar cell = selecteElm.nodeName=='TD' ? selecteElm : null; //cell for default_selection = 'both' or 'cell'...
[ "0.65768665", "0.64542824", "0.6219309", "0.6000595", "0.5976577", "0.58699024", "0.5802067", "0.5762353", "0.5749798", "0.56805384", "0.56790257", "0.5644844", "0.56419927", "0.5637537", "0.5635656", "0.56081593", "0.55816525", "0.55596024", "0.5552443", "0.55523646", "0.553...
0.6701543
0
Page navigation has to be enforced whenever selected row is out of the current page range
function onBeforeSelection(et, selecteElm, e){ var row = et.defaultSelection != 'row' ? selecteElm.parentNode : selecteElm; if(o.paging){ if(o.nbPages>1){ et.nbRowsPerPage = o.pagingLength; //page length is re-assigned in case it has changed var pagingEndRow = parseInt(o.startPagingRow) + parseInt(o.pagingLength); var rowIndex = row.rowIndex; if((rowIndex == o.validRowsIndex[o.validRowsIndex.length-1]) && o.currentPageNb!=o.nbPages) o.SetPage('last'); else if((rowIndex == o.validRowsIndex[0]) && o.currentPageNb!=1) o.SetPage('first'); else if(rowIndex > o.validRowsIndex[pagingEndRow-1] && rowIndex < o.validRowsIndex[o.validRowsIndex.length-1]) o.SetPage('next'); else if(rowIndex < o.validRowsIndex[o.startPagingRow] && rowIndex > o.validRowsIndex[0]) o.SetPage('previous'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRowAcrossPages(row) {\n // Get the index for the selected row\n var index = row.childIndex;\n console.log(\"Row is at index: \"+index);\n\n // Find the \"relative\" row location for each page and remove rows\n // from page 1 onward\n index = index % pageSize;\n}", "handlePageClick(data) {\n ...
[ "0.643262", "0.6249248", "0.62237257", "0.6144744", "0.61430174", "0.6114298", "0.60750425", "0.598321", "0.5949296", "0.5937859", "0.59339607", "0.5927115", "0.59027886", "0.58865994", "0.58582413", "0.5851886", "0.58417", "0.5801387", "0.57899684", "0.57341385", "0.5728631"...
0.62034035
3
Col elements are enough to keep column widths after sorting and filtering
function createColTags(o) { if(!o) return; for(var k=(o.nbCells-1); k>=0; k--) { var col = tf_CreateElm( 'col', ['id', o.id+'_col_'+k]); o.tbl.firstChild.parentNode.insertBefore(col,o.tbl.firstChild); col.style.width = o.colWidth[k]; o.gridColElms[k] = col; } o.tblHasColTag = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "recalculateColumnWidths(){if(!this._columnTree){return;// No columns\n}const cols=this._getColumns().filter(col=>!col.hidden&&col.autoWidth);this._recalculateColumnWidths(cols)}", "function getNewColDefs() {\n return [\n {headerName: \"Id\", field: \"id\", width: 50, filter: 'number'},\n {headerNam...
[ "0.72377944", "0.6704", "0.667537", "0.65788454", "0.65455425", "0.6504886", "0.6488202", "0.64539695", "0.6441284", "0.63467854", "0.6333013", "0.6318571", "0.6317491", "0.62882817", "0.62797755", "0.62797755", "0.6240189", "0.6230854", "0.6179183", "0.6158125", "0.6153481",...
0.58373374
57
looks for search argument in current row
function hasArg(sA,cell_data,j) { var occurence; //Search arg operator tests var hasLO = re_l.test(sA), hasLE = re_le.test(sA); var hasGR = re_g.test(sA), hasGE = re_ge.test(sA); var hasDF = re_d.test(sA), hasEQ = re_eq.test(sA); var hasLK = re_lk.test(sA), hasAN = re_an.test(sA); var hasST = re_st.test(sA), hasEN = re_en.test(sA); var hasEM = (re_em == sA), hasNM = (re_nm == sA); var hasRE = re_re.test(sA); //Search arg dates tests var isLDate = (hasLO && tf_IsValidDate(sA.replace(re_l,''),dtType)); var isLEDate = (hasLE && tf_IsValidDate(sA.replace(re_le,''),dtType)); var isGDate = (hasGR && tf_IsValidDate(sA.replace(re_g,''),dtType)); var isGEDate = (hasGE && tf_IsValidDate(sA.replace(re_ge,''),dtType)); var isDFDate = (hasDF && tf_IsValidDate(sA.replace(re_d,''),dtType)); var isEQDate = (hasEQ && tf_IsValidDate(sA.replace(re_eq,''),dtType)); if(tf_IsValidDate(cell_data,dtType)) {//dates var dte1 = tf_FormatDate(cell_data,dtType); if(isLDate) {// lower date var dte2 = tf_FormatDate(sA.replace(re_l,''),dtType); occurence = (dte1 < dte2); } else if(isLEDate) {// lower equal date var dte2 = tf_FormatDate(sA.replace(re_le,''),dtType); occurence = (dte1 <= dte2); } else if(isGEDate) {// greater equal date var dte2 = tf_FormatDate(sA.replace(re_ge,''),dtType); occurence = (dte1 >= dte2); } else if(isGDate) {// greater date var dte2 = tf_FormatDate(sA.replace(re_g,''),dtType); occurence = (dte1 > dte2); } else if(isDFDate) {// different date var dte2 = tf_FormatDate(sA.replace(re_d,''),dtType); occurence = (dte1.toString() != dte2.toString()); } else if(isEQDate) {// equal date var dte2 = tf_FormatDate(sA.replace(re_eq,''),dtType); occurence = (dte1.toString() == dte2.toString()); } else if(re_lk.test(sA)) // searched keyword with * operator doesn't have to be a date {// like date occurence = o.__containsStr(sA.replace(re_lk,''),cell_data,null,false); } else if(tf_IsValidDate(sA,dtType)) { var dte2 = tf_FormatDate(sA,dtType); occurence = (dte1.toString() == dte2.toString()); } else if(hasEM) //empty occurence = (cell_data.tf_Trim()=='' ? true : false); else if(hasNM) //non-empty occurence = (cell_data.tf_Trim()!='' ? true : false); } else { //first numbers need to be formated if(o.hasColNbFormat && o.colNbFormat[j]!=null) { num_cell_data = tf_RemoveNbFormat(cell_data,o.colNbFormat[j]); nbFormat = o.colNbFormat[j]; } else { if(o.thousandsSeparator==',' && o.decimalSeparator=='.') { num_cell_data = tf_RemoveNbFormat(cell_data,'us'); nbFormat = 'us'; } else { num_cell_data = tf_RemoveNbFormat(cell_data,'eu'); nbFormat = 'eu'; } } // first checks if there is any operator (<,>,<=,>=,!,*,=,{,},rgx:) if(hasLE) //lower equal occurence = num_cell_data <= tf_RemoveNbFormat(sA.replace(re_le,''),nbFormat); else if(hasGE) //greater equal occurence = num_cell_data >= tf_RemoveNbFormat(sA.replace(re_ge,''),nbFormat); else if(hasLO) //lower occurence = num_cell_data < tf_RemoveNbFormat(sA.replace(re_l,''),nbFormat); else if(hasGR) //greater occurence = num_cell_data > tf_RemoveNbFormat(sA.replace(re_g,''),nbFormat); else if(hasDF) //different occurence = o.__containsStr(sA.replace(re_d,''),cell_data) ? false : true; else if(hasLK) //like occurence = o.__containsStr(sA.replace(re_lk,''),cell_data,null,false); else if(hasEQ) //equal occurence = o.__containsStr(sA.replace(re_eq,''),cell_data,null,true); else if(hasST) //starts with occurence = cell_data.indexOf(sA.replace(re_st,''))==0 ? true : false; else if(hasEN) //ends with { var searchArg = sA.replace(re_en,''); occurence = cell_data.lastIndexOf(searchArg,cell_data.length-1)==(cell_data.length-1)-(searchArg.length-1) && cell_data.lastIndexOf(searchArg,cell_data.length-1) > -1 ? true : false; } else if(hasEM) //empty occurence = (cell_data.tf_Trim()=='' ? true : false); else if(hasNM) //non-empty occurence = (cell_data.tf_Trim()!='' ? true : false); else if(hasRE){ //regexp try{ //in case regexp fires an exception var searchArg = sA.replace(re_re,''); //operator is removed var rgx = new RegExp(searchArg); occurence = rgx.test(cell_data); } catch(e) { occurence = false; } } else occurence = o.__containsStr(sA,cell_data,(f['col_'+j]==undefined) ? this.fltTypeInp : f['col_'+j]); }//else return occurence; }//fn
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search(thing, column, isReturned) {\n var result = [];\n var doc = SpreadsheetApp.openById(SCRIPT_PROP.getProperty(\"key\"));\n var sheet = doc.getSheetByName('record');\n var data = sheet.getDataRange().getValues();\n //var data = SpreadsheetApp.getActiveSheet().getDataRange().getValues();\n for (v...
[ "0.64562154", "0.6405934", "0.6330053", "0.62250173", "0.6199402", "0.6177251", "0.60919714", "0.60877687", "0.6038497", "0.59825706", "0.5955942", "0.5870263", "0.58612657", "0.5821648", "0.57716537", "0.57626635", "0.5760286", "0.5745494", "0.57413185", "0.56957245", "0.567...
0.5736212
19
ie bug workaround, filters need to be regenerated since row is empty; insertBefore method doesn't seem to work properly with previously generated DOM nodes modified by innerHTML
function refreshFilters(o){ o.tbl.deleteRow(o.filtersRowIndex); o.RemoveGrid(); o.fltIds = []; o.isFirstLoad = true; if(o.popUpFilters) o.RemovePopupFilters(); o._AddGrid(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_createFilterRow(existingFilterRow) {\r\n const that = this;\r\n\r\n if (!that.filtering || !that.filterRow) {\r\n return;\r\n }\r\n\r\n if (existingFilterRow) {\r\n that.$.tableContainer.children[1].insertBefore(existingFilterRow, that.$.tableContainer.children[1]...
[ "0.6603204", "0.62993956", "0.62365973", "0.5883171", "0.5858068", "0.5838278", "0.5747183", "0.57300496", "0.57079357", "0.5700026", "0.5624318", "0.5618044", "0.5611098", "0.5608529", "0.55819273", "0.5571706", "0.5564116", "0.55370295", "0.55263513", "0.55051196", "0.54921...
0.0
-1
/==================================================== General TF utility fns below =====================================================
function tf_GetNodeText(n) /*==================================================== - returns text + text of child nodes of a node =====================================================*/ { var s = n.textContent || n.innerText || n.innerHTML.replace(/\<[^<>]+>/g, ''); s = s.replace(/^\s+/, '').replace(/\s+$/, '')/*.tf_Trim()*/; return s.tf_Trim(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TF(key) {\n this.tf = createTwofish();\n this.tf.open(Array.from(key), 0);\n\n this.encrypt = function(block) {\n return this.tf.encrypt(Array.from(block), 0);\n };\n}", "function TF(key) {\n this.tf = createTwofish();\n this.tf.open(Array.from(key), 0);\n\n this.encrypt = function(block) {\n ...
[ "0.60706496", "0.60706496", "0.6059784", "0.5993308", "0.59173006", "0.58263963", "0.5569604", "0.5419519", "0.5405926", "0.54020846", "0.53792137", "0.5366551", "0.5350338", "0.529773", "0.52623695", "0.52261186", "0.5220202", "0.52025634", "0.51354444", "0.5093367", "0.5089...
0.0
-1
Firefox does not support outerHTML property
function tf_SetOuterHtml(){ if(document.body.__defineGetter__) { if(HTMLElement) { var element = HTMLElement.prototype; if(element.__defineGetter__) { element.__defineGetter__("outerHTML", function(){ var parent = this.parentNode; var el = tf_CreateElm(parent.tagName); el.appendChild(this); var shtml = el.innerHTML; parent.appendChild(this); return shtml; } ); } } } if(element.__defineSetter__) { HTMLElement.prototype.__defineSetter__("outerHTML", function(sHTML) { var r = this.ownerDocument.createRange(); r.setStartBefore(this); var df = r.createContextualFragment(sHTML); this.parentNode.replaceChild(df, this); return sHTML; }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function outerHTML(elem){\n\tvar div = document.createElement('div');\n\tdiv.appendChild(elem.cloneNode(true));\n\treturn div.innerHTML;\n}", "function outerHtml (element) {\n return document.createElement('div').appendChild(element.cloneNode(true)).parentNode.innerHTML;\n }", "function getOuterHTML(el){if...
[ "0.75865865", "0.7538095", "0.74239403", "0.74239403", "0.74239403", "0.7330268", "0.71378577", "0.71378577", "0.7128602", "0.70816106", "0.70718217", "0.70718217", "0.70718217", "0.70707285", "0.70707285", "0.70491534", "0.70491534", "0.70455885", "0.70455885", "0.70455885", ...
0.0
-1
===END removable section=========================== /==================================================== Backward compatibility fns =====================================================
function grabEBI(id){ return tf_Id(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get removable() { return this._removable; }", "private internal function m248() {}", "transient private protected internal function m182() {}", "get removable() {\n return this._removable;\n }", "removed() {}", "removed() {}", "transient private internal function m185() {}", "protected inte...
[ "0.6324693", "0.6123716", "0.59676963", "0.5869448", "0.5841712", "0.5841712", "0.58411694", "0.5802941", "0.57349104", "0.55513406", "0.55364746", "0.5531328", "0.5511446", "0.54937416", "0.5464979", "0.5442133", "0.5442133", "0.54141766", "0.53125405", "0.5280297", "0.52782...
0.0
-1
tworzy zmienna z drugim linkiem
function alarm(e) { e.preventDefault(); //zapobiegamy domyslej akcji console.log('kliknieto kolejny link'); console.log(e.type); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function galerijLinks(){\r\n\tlengthExtensie = getImgPad(\"plaatjeFrame\");\r\n\tif (Number(lengthExtensie[3]) > 1){\r\n\t\tplaatjeNummer = Number(lengthExtensie[3]) - 1;\r\n\t}\r\n\telse{\r\n\t\tplaatjeNummer = totaalPlaatjes;\r\n\t}\r\n\tsetPlaatjeNaam(lengthExtensie, plaatjeNummer, \"plaatjeFrame\");\r\n\tretur...
[ "0.6334056", "0.6281271", "0.6194358", "0.61137885", "0.61066896", "0.5947109", "0.5852844", "0.57178545", "0.56923974", "0.567906", "0.56699646", "0.5617914", "0.5595881", "0.5522329", "0.55221", "0.5503607", "0.54877067", "0.5457458", "0.54450047", "0.5421896", "0.5419858",...
0.0
-1
RESPOND_TO add a module to the Wallet by responding to "emailappspace"
respondTo(type) { if (type == 'email-appspace') { let obj = {}; obj.render = function (app, mod) { Tutorial03EmailAppspace.render(app, mod); } obj.attachEvents = function (app, mod) { Tutorial03EmailAppspace.attachEvents(app, mod); } return obj; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerWithCommMgr() {\n commMgrClient.send({\n type: 'register-msg-handler',\n mskey: msKey,\n mstype: 'msg',\n mshelp: [\n { cmd: '/wallet_set_trustline', txt: 'setup EVER trustline' },\n { cmd: '/wallet_save_keys', txt: 'save/export wallet keys' },\...
[ "0.6189353", "0.59274167", "0.5864611", "0.5841397", "0.56313366", "0.55811656", "0.5579221", "0.54397637", "0.54112774", "0.5353078", "0.53012085", "0.525324", "0.5241864", "0.5210839", "0.5164181", "0.5157823", "0.5142047", "0.51215243", "0.5120802", "0.51195604", "0.511113...
0.0
-1