query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Bez v1.0.10g5ae0136 A plugin to convert CSS3 cubicbezier coordinates to jQuerycompatible easing functions With thanks to Nikolay Nemshilov for clarification on the cubicbezier maths See Copyright 2011 Robert Dallas Gray. All rights reserved. Provided under the FreeBSD license:
function bez (coOrdArray) { var encodedFuncName = "bez_" + $.makeArray(arguments).join("_").replace(".", "p"); if (typeof $['easing'][encodedFuncName] !== "function") { var polyBez = function (p1, p2) { var A = [null, null], B = [null, null], C = [null, null], bezCoOrd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cubicBezier(bezier) {\r\n var mX1 = bezier[0];\r\n var mY1 = bezier[1];\r\n var mX2 = bezier[2];\r\n var mY2 = bezier[3];\r\n\r\n this.get = function(aX) {\r\n if (mX1 == mY1 && mX2 == mY2) return aX; // linear\r\n return CalcBezier(GetTForX(aX), mY1, mY2);\r\n }\r\n\r\n ...
[ "0.7140092", "0.6994965", "0.67167866", "0.67075413", "0.66997284", "0.66524196", "0.66084176", "0.66084176", "0.66084176", "0.66033375", "0.6589807", "0.65643126", "0.65643126", "0.6560477", "0.6538858", "0.6483789", "0.6448068", "0.6411958", "0.6278627", "0.62694573", "0.62...
0.72557205
0
Check is object is number greater of equals zero
function isNumberGreaterOrEqualsToZero(obj) { //If undefined or null, false if (isNullOrUndefined(obj)) { return true; } //If is not a number if (isNaN(obj)) { return false; } //True if match condition return obj >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isGreaterThanZero(element) {\r\n return element.value > 0;\r\n }", "function isNotZero( obj ){\n\tif( obj && isNum( obj ) && obj !== 0){\n\t\treturn true;\n\t}\n\treturn false;\n}", "isNonZero(): boolean {\n return this.value !== 0;\n }", "function lessThanOrEqualToZero(num) {\...
[ "0.72434044", "0.6767759", "0.64235806", "0.6360937", "0.635505", "0.6345477", "0.6315654", "0.62936026", "0.62813103", "0.60877943", "0.6078445", "0.60573024", "0.605247", "0.605247", "0.60355455", "0.60314953", "0.60147405", "0.6013268", "0.5960311", "0.59553593", "0.593376...
0.7424243
0
Check if provided object is a valid array of coordinates
function isCoordinatesArray(obj) { //If is null or undefined, exit if (isNullOrUndefined(obj)) { return false; } //If non array, exit if (!isArray(obj)) { return false; } //Iterate all over elements for (var i = 0; i < obj.length...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkCoordsInput(coords) {\n return /^\\[?\\-?\\d{1,2}\\.\\d{1,5}\\,\\s?\\-?\\d{1,2}\\.\\d{1,5}\\]?/.test(coords);\n}", "validCoords(coords) {\n const [r, c] = coords;\n return r >= 0 && r < this.rows && c >= 0 && c < this.cols;\n }", "function isPolygon(obj) {\n\n //If it's not an arra...
[ "0.70434666", "0.67908037", "0.65797454", "0.6549922", "0.65111864", "0.6490234", "0.6484496", "0.6465235", "0.6465235", "0.6465235", "0.64314973", "0.6395475", "0.63846827", "0.6383521", "0.6339174", "0.6222024", "0.61929935", "0.60413325", "0.60402095", "0.6010492", "0.5982...
0.8332273
0
Check if provided object is a valid polygon
function isPolygon(obj) { //If it's not an array of coordinates, fail if (!isCoordinatesArray(obj)) { return false; } //To be a valid polygon requires at least 3 vertex return obj.length >= 3; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validatePolygon(coordinates) {\n for (var i = 0; i < coordinates.length; i++) {\n // The LinearRing elements must have at least four Points\n if (coordinates[i].length < 4) {\n throw new mongoose.Error(\n \"Each Polygon LinearRing must have at least four elements\"\n );\n }\n ...
[ "0.6932615", "0.66297805", "0.6581632", "0.6581632", "0.6546347", "0.6546347", "0.6448428", "0.63224185", "0.62604755", "0.6253738", "0.62466514", "0.6191507", "0.6164391", "0.6159205", "0.6129389", "0.61150724", "0.6082683", "0.6015724", "0.6012187", "0.6009043", "0.6009043"...
0.84319526
0
CONVERTS Converts provided latitude in decimal notation to sexagesimal notation
function latitudeToSexagesimal(latDecimalValue) { //Arguments validation if (!latDecimalValue) throw new Error("Argument 'latDecimalValue' is invalid"); //Check is it's a number if (isNaN(latDecimalValue)) throw new Error("Provided latitude is not a valid number...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function latitudeToDecimal(latSexagesimalValue) {\n\n //Arguments validation\n if (!latSexagesimalValue)\n throw new Error(\"Argument 'latSexagesimalValue' is invalid\");\n\n //Check if string was passed as argument\n if (typeof latSexagesimalValue !== 'string')\n ...
[ "0.64725196", "0.64535123", "0.64162046", "0.5770398", "0.5753702", "0.5748961", "0.5633092", "0.56132585", "0.550131", "0.5427631", "0.5395859", "0.5350717", "0.5346682", "0.53200877", "0.5270307", "0.526136", "0.5254732", "0.52409756", "0.5194248", "0.518739", "0.5183566", ...
0.6969604
0
Converts provided latitude in sexagesimal notation to decimal notation
function latitudeToDecimal(latSexagesimalValue) { //Arguments validation if (!latSexagesimalValue) throw new Error("Argument 'latSexagesimalValue' is invalid"); //Check if string was passed as argument if (typeof latSexagesimalValue !== 'string') throw new Error...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function latitudeToSexagesimal(latDecimalValue) {\n\n //Arguments validation\n if (!latDecimalValue)\n throw new Error(\"Argument 'latDecimalValue' is invalid\");\n\n //Check is it's a number\n if (isNaN(latDecimalValue))\n throw new Error(\"Provided latitude is no...
[ "0.7694869", "0.721472", "0.6855566", "0.67757636", "0.6449522", "0.62855417", "0.6226829", "0.61075807", "0.5961676", "0.59387493", "0.59267384", "0.58802444", "0.58644325", "0.58446944", "0.5799433", "0.5721397", "0.571584", "0.5679716", "0.5674273", "0.56717265", "0.567007...
0.81362957
0
Converts provided longitude in sexagesimal notation to decimal notation
function longitudeToDecimal(lonSexagesimalValue) { //Arguments validation if (!lonSexagesimalValue) throw new Error("Argument 'lonSexagesimalValue' is invalid"); //Check if string was passed as argument if (typeof lonSexagesimalValue !== 'string') throw new Erro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function longitudeToSexagesimal(lonDecimalValue) {\n\n //Arguments validation\n if (!lonDecimalValue)\n throw new Error(\"Argument 'lonDecimalValue' is invalid\");\n\n //Check is it's a number\n if (isNaN(lonDecimalValue))\n throw new Error(\"Provided longitude is ...
[ "0.78036094", "0.7364629", "0.6952559", "0.6673828", "0.64678335", "0.62447804", "0.6218687", "0.62052566", "0.618441", "0.61205226", "0.61112595", "0.6104113", "0.59811914", "0.5899691", "0.5891019", "0.58628285", "0.5837638", "0.58066934", "0.5802032", "0.5726499", "0.57071...
0.8117596
0
Converts meters value to target unit
function metersToSomething(meters, decimal, targetUnit) { //Arguments validation if (typeof meters === 'undefined' || meters === null) throw new Error("Argument 'meters' is invalid"); if (!targetUnit) throw new Error("Argument 'targetUnit' is invalid"); //Check ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertMeters(meters, units) {\n\t\t\tif (units == UNITS_MI)\n\t\t\t\treturn meters/1609.34;\n\t\t\treturn meters/1000; //return KM\n\t\t}", "function metersToMiles(meters) {\n return meters / 1609.344;\n }", "function normalize(value, units) {\r\n\tswitch(units) {\r\n\t\tcase \"mi\":\r\n...
[ "0.7608386", "0.73851883", "0.7277296", "0.7246874", "0.72427505", "0.72170997", "0.7207261", "0.71510124", "0.70836157", "0.7017538", "0.7014136", "0.7002226", "0.6997125", "0.69959104", "0.69741875", "0.69484705", "0.6940026", "0.69395876", "0.690883", "0.68620384", "0.6851...
0.74086535
1
Converts provided value in meters, to seamiles
function metersToSeamiles(meters, decimals) { //Use basic function return metersToSomething(meters, decimals, 'sm'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function milesToMeters(miles) {\n return miles * 1069.344;\n}", "function milesToMeters(miles) {\n return miles * 1069.344;\n}", "function milesToMeters(miles) {\n return miles * 1069.344;\n}", "function metersToMiles(meters) {\n return meters / 1609.344;\n }", "function metersToMiles...
[ "0.70314074", "0.70314074", "0.70314074", "0.6978245", "0.68329054", "0.6800896", "0.679651", "0.66843915", "0.66199076", "0.6580443", "0.6558384", "0.6534969", "0.64298594", "0.64244336", "0.6393923", "0.63692784", "0.6351674", "0.6316084", "0.6187003", "0.6181144", "0.61792...
0.7206997
0
Converts provided value in meters, to yards
function metersToYards(meters, decimals) { //Use basic function return metersToSomething(meters, decimals, 'yd'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function YardstoAll() {\r\n const Yardsval = parseFloat(inputYards.value);\r\n const Feetval = Yardsval * 3;\r\n const Inchesval = Yardsval * 36;\r\n const Milesval = Yardsval * 0.00056818;\r\n const KmUSval = Yardsval / 1093.6;\r\n const MUSval = Yardsval / 1.0936;\r\n const CmUSval = Yardsva...
[ "0.58464193", "0.5749145", "0.5706067", "0.559105", "0.55544424", "0.5482789", "0.5465149", "0.5437687", "0.5430128", "0.53956354", "0.53034204", "0.52398914", "0.5238291", "0.52352464", "0.52352464", "0.52352464", "0.5216266", "0.52075166", "0.5193507", "0.5190104", "0.51859...
0.6846641
0
Get distance of route defined by array of coordinates
function getRouteDistance(routeCoordinates, accuracy) { //Arguments validation if (!routeCoordinates) throw new Error("Argument 'pointA' is invalid"); //Check if route is a valid coordinate array if (!isCoordinatesArray(routeCoordinates)) throw new Error("Argument 'routeCoo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeDistance(distances, route) {\n \n let totalDistance = 0;\n \n for (let i = 0; i < route.length; i++){\n if (i == route.length-1){\n const finalCity = route[i];\n const startCity = route[0];\n const homeTripDistance = distances[finalCity][startCity...
[ "0.7026946", "0.6508544", "0.64108866", "0.6408914", "0.62318647", "0.61774117", "0.6168385", "0.6154099", "0.6147391", "0.61437637", "0.61324906", "0.6130128", "0.60607314", "0.6033685", "0.59703994", "0.59655285", "0.59378946", "0.59054494", "0.5891639", "0.5879922", "0.587...
0.6981133
1
Draws a single line from v0 to v1 with the given color. Each point is a THREE.Vector3 object.
function _drawLine(v0, v1, color) { var p = new Primitive(); p.vertices = [v0, v1]; p.color = toColor(color); renderer.addPrimitive(p); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Line(point1, point2, color) {\n this.point1 = point1;\n this.point2 = point2;\n this.color = color;\n }", "function drawLine(v1, v2) {\n push();\n strokeWeight(rez * 0.2);\n stroke(255, randomG, randomB);\n line(v1.x, v1.y, v2.x, v2.y);\n pop();\n}", "drawLine() {\n ...
[ "0.74159104", "0.72239625", "0.70545554", "0.70082414", "0.68923104", "0.68914413", "0.6853957", "0.6746367", "0.67406726", "0.66997033", "0.6657227", "0.6537036", "0.65204", "0.6514413", "0.64959973", "0.64442426", "0.64421344", "0.6441006", "0.642941", "0.6415921", "0.63939...
0.8457998
0
Draws a strip of connected lines using the specified points[]. Each point is a THREE.Vector3 object.
function _drawLineStrip(points, color) { if (points.length < 2) { console.error('Line strips must have at least 2 points.'); return; } var p = new Primitive(); p.vertices = points; p.color = toColor(color); renderer.addPrimitive(p); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static insertSegmentStrip(points, color) {\n if (points == null || points.length == 0)\n return null;\n\n let lineGeometry = new THREE.Geometry();\n let lineMaterial = new THREE.LineBasicMaterial({\n color: color,\n ...
[ "0.74497133", "0.6888725", "0.66898656", "0.6681809", "0.66496634", "0.66470295", "0.6618267", "0.65628827", "0.6495486", "0.64137053", "0.6410989", "0.6405413", "0.638079", "0.6367258", "0.6367258", "0.633852", "0.63369864", "0.6335145", "0.63347477", "0.6316979", "0.6315718...
0.81988794
0
Draws an arrow pointing from pStart to pEnd. Specify the size of the arrow with arrowSize.
function _drawArrow(pStart, pEnd, arrowSize, color) { var p = new Primitive(); p.color = toColor(color); p.vertices.push(pStart); p.vertices.push(pEnd); var dir = new THREE.Vector3(); dir.subVectors(pEnd, pStart); dir.normalize(); var right = new THREE....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawArrow(arrow, startX, startY, endX, endY, arrowLabel) {\n arrow.x = startX;\n arrow.y = startY;\n // just storing some end point information\n arrow.endX = endX;\n arrow.endY = endY;\n // Determine the length between the start and end point using pythagoras\n let w = endX - startX;...
[ "0.61848456", "0.60587007", "0.59777194", "0.59453386", "0.593091", "0.5919159", "0.58726054", "0.5862127", "0.5774702", "0.57590014", "0.5690965", "0.56612647", "0.56511873", "0.5625466", "0.5603835", "0.55367124", "0.55070096", "0.5504125", "0.54901564", "0.54839635", "0.54...
0.7680272
0
Draws a bounding box defined by the min/max coordinates. min/max are THREE.Vector3 objects.
function _drawBoundingBox(min, max, color) { var p = new Primitive(); p.color = toColor(color); var halfExtents = new THREE.Vector3(); halfExtents.subVectors(max, min); halfExtents.multiplyScalar(0.5); var center = new THREE.Vector3(); center.addVectors(max, min)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AABBBox(max,min){\n\t\n\tthis.max = max ? max : $V([-10000.0,-10000.0,-10000.0]);\n\tthis.min = min ? min : $V([10000.0,10000.0,10000.0]);\n\t\n}", "function boundingBox(x,y,xextent,yextent)\n{\n \n this.x1=x;\n this.y1=y;\n this.x2=x+xextent;\n this.y2=y+yextent;\n this.toString=funct...
[ "0.71874636", "0.6937588", "0.675724", "0.66624254", "0.6654731", "0.6648251", "0.6648068", "0.660414", "0.6555951", "0.65341985", "0.6520423", "0.6506362", "0.646829", "0.6430366", "0.6376477", "0.63538235", "0.6351718", "0.62787545", "0.6276699", "0.6276699", "0.6272783", ...
0.80515414
0
Draw a sphere at pos with radius r.
function _drawSphere(pos, r, color) { var p = new Primitive(); p.color = toColor(color); // Decreasing these angles will increase complexity of sphere. var dtheta = 35; var dphi = 35; for (var theta = -90; theta <= (90 - dtheta); theta += dtheta) { for (var phi = 0;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _Sphere(radius) {\n var __sphereData = null,\n __sphereVertexPositionBuffer = null,\n __sphereVertexIndexBuffer = null,\n __sphereVertexNormalBuffer = null,\n\n __colour = {r: 0.8, g: 0.8, b: 0.8, a: 1.0},\n __radius = radius || 1.0,\n __modelMatrix = mat4.crea...
[ "0.6738083", "0.66986984", "0.66669214", "0.66447455", "0.6536224", "0.65222025", "0.6493548", "0.64169496", "0.6390218", "0.637157", "0.63642734", "0.63639814", "0.63627976", "0.63495076", "0.63466483", "0.63268805", "0.63268805", "0.6319602", "0.6299415", "0.6240633", "0.61...
0.7922431
0
Translate a FF7 FIELD.LGP's .A file to glTF 2.0 format config = configuration object, see config.json for example animFileId = which animation to include in the output gltf
translateFF7FieldAnimationToGLTF(config, animFileId) { var outputAnimationsDirectory = config.outputFieldCharDirectory; if (!fs.existsSync(outputAnimationsDirectory)) { console.log("Creating output directory: " + outputAnimationsDirectory); mkdirp.sync(outputAnimationsDirectory); } var RO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadFile(file, module, x, y) {\n var dsp_code;\n var reader = new FileReader();\n var ext = file.name.toString().split('.').pop();\n var filename = file.name.toString().split('.').shift();\n var type;\n if (ext == \"dsp\") {\n type = \"dsp\";\n reader...
[ "0.5544356", "0.52323073", "0.5157644", "0.50949734", "0.49494916", "0.48868847", "0.4865624", "0.48543483", "0.48043805", "0.47863507", "0.47823054", "0.47411162", "0.47232607", "0.47149253", "0.46750984", "0.46739137", "0.46739137", "0.46739137", "0.46739137", "0.46739137", ...
0.78383094
0
get Total Count Of the Answers Posted.
function getTotalAnswerCounts() { return new Promise(function (resolve, reject) { Answer.count({ }, function (err, count) { if (!err) { resolve(count); } else { reject(err); } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "total_questions() {\n var total_questions = 0;\n for (var i = 0; i < this.state.quiz_log.length; i++) {\n total_questions = total_questions + this.state.quiz_log[i][1];\n }\n return (total_questions)\n }", "function getTotalQuestions() {\n var totalQuestions = questio...
[ "0.6923883", "0.6911279", "0.678892", "0.6751696", "0.66634023", "0.66355157", "0.64523566", "0.6434681", "0.6347589", "0.6312343", "0.6308883", "0.62880003", "0.62768644", "0.62513196", "0.6237369", "0.6220844", "0.6197784", "0.6197784", "0.6197784", "0.61960393", "0.6196039...
0.73041594
0
get Total Count Of Answers AnsweredBy by the User.
function getTotalAnswerCountsByAuthor(user) { return new Promise(function (resolve, reject) { Answer.find( { created_by: user._id } ).count({ }, function (err, count) { if (!err) { resolve(count); } else { reject(err); } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTotalAnswerCounts() {\n\treturn new Promise(function (resolve, reject) {\n\t\tAnswer.count({\n\t\t}, function (err, count) {\n\t\t\tif (!err) {\n\t\t\t\tresolve(count);\n\t\t\t} else {\n\t\t\t\treject(err);\n\t\t\t}\n\t\t});\n\t});\n\n}", "userCount(teamId, userId, incDec){\n \n\t\treturn new Promis...
[ "0.67295235", "0.6268552", "0.5939363", "0.5938723", "0.59189355", "0.5876417", "0.57625633", "0.5731661", "0.5731621", "0.5731621", "0.57292473", "0.57220185", "0.5688235", "0.56862986", "0.56536716", "0.56187814", "0.5580111", "0.5577954", "0.5570482", "0.5565004", "0.55601...
0.7564332
0
get all the Answers.
function getAllAnswers() { return new Promise(function (resolve, reject) { Answer.find({}).populate('created_by').populate('comments.created_by') .exec(function (err, Answers) { if (!err) { resolve(Answers); } else { reject(err); } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAnswers () {\n\t\tlet ansArray = [];\n\t\tfor (let x of this.answers)\n\t\t\tansArray.push(x.title);\n\n\t\treturn ansArray;\n\t}", "function getAllAnswers(callback) {\n\tquery(\"select * from answers\", callback);\n}", "function getAnswers() {\n const answers = [];\n const items = document.qu...
[ "0.7325676", "0.71151406", "0.7012649", "0.67562383", "0.67310435", "0.66328925", "0.653812", "0.6353237", "0.62562764", "0.62538975", "0.62337446", "0.6144512", "0.6037212", "0.60246783", "0.6007471", "0.5969371", "0.59598285", "0.5956388", "0.5953376", "0.59448874", "0.5939...
0.7671316
0
filtra las sugerencias para el filtrado
filtrarSugerencias(resultado, busqueda){ //filtrar con .filter const filtro = resultado.filter(filtro => filtro.calle.indexOf(busqueda) !== -1); console.log(filtro); //mostrar los pines this.mostrarPines(filtro); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filtro() {\n let selectorSexo = document.getElementById(\"selectorSexo\");\n let inputNombre = document.getElementById(\"inombre\");\n\n const sexo = selectorSexo.value;\n const nombre = inputNombre.value.trim().toLowerCase();\n\n console.trace(`filtro sexo=${sexo} nombre=${nombre}`);\n console.debu...
[ "0.6216611", "0.60949504", "0.60345876", "0.59419066", "0.5916365", "0.58617675", "0.5857683", "0.58292955", "0.57852155", "0.5687241", "0.5671945", "0.5670063", "0.56653947", "0.562448", "0.5574406", "0.5569372", "0.5547801", "0.5512862", "0.551241", "0.55087054", "0.5493714...
0.6310085
0
WARN_RESTART_SESSION ////////////////////////////////// Warn a user that the server has returned a NEW_SESSION response, and we need to reload the client. If the user chooses to proceed via the OK button, the CLIENT_RESTART_SESSION action will be run.
function WARN_RESTART_SESSION() { require(["dialogs/DialogFactory"],function(DialogFactory){ var nsDialog = DialogFactory.makeBasicErrorDialog({ title: "Session Expired", content: "The session appears to have expired. The client will now reload.", okCmdAction: "CLIENT_RESTART_SESSION" }); nsDialo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "transmitRestartRequest(err, response) {\n /*if (response.data && response.data.forceRestart) { // Force restart without proper close breaks because we dont kill everything anymore\n return this.forceRestart();\n }*/\n let logMessage = \"APPLICATION LIFECYCLE:SHUTDOWN:transmitShutdow...
[ "0.61975884", "0.61236954", "0.59780663", "0.59668267", "0.5941293", "0.5938895", "0.59368175", "0.5927129", "0.5919934", "0.5906081", "0.5894936", "0.58453184", "0.58181673", "0.5790689", "0.57865226", "0.5783174", "0.57817376", "0.5777434", "0.57644796", "0.5703454", "0.569...
0.802929
0
PARSE_AND_SEL_ZOOM ////////////////////////// Aggregate method which, given a 'newVal' in e, will parse the entities to select using GET_SELECTION_OBJECTS, then select and zoom using either ZOOM_TO_MODULES (for overlays) or SELECT_AND_ZOOM.
function PARSE_AND_SEL_ZOOM(e) { require(["views/BioTapestryCanvas"],function(BTCanvas){ GET_SELECTION_OBJECTS(e.newVal,BTCanvas.getBtCanvas(e.drawingAreaId || APP_CANVAS_CONTAINER_NODE_ID)).then(function(nodes){ if(e.newVal.set) { require(["widgets/LowerLeftComponents"],function(LowerLeftComponents){ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SELECT_AND_ZOOM(e) {\n\t\trequire([\"controllers/ArtboardController\"],function(ArtboardController){\n\t\t\tvar thisController = ArtboardController.getArtboardController(e.drawingAreaId || APP_CANVAS_CONTAINER_NODE_ID);\n\t\t\tif(e.noZoom) {\n\t\t\t\tthisController.selectNodes(e.newVal,e.AppendToSelection...
[ "0.7020564", "0.5819709", "0.5328535", "0.5301865", "0.5280958", "0.5267801", "0.5254683", "0.52001643", "0.5188059", "0.51843995", "0.51324075", "0.51316714", "0.50680375", "0.506629", "0.5059157", "0.50307184", "0.50307184", "0.50307184", "0.5029271", "0.5022426", "0.501839...
0.7862271
0
MAIN_TREE_PATH //////////////////////////// Aggregate method for userdefined paths
function MAIN_TREE_PATH(which) { require(["controllers/XhrController","static/XhrUris"],function(XhrController,XhrUris){ var args = which.uri ? { uri: which.uri } : null; XhrController.xhrRequest(XhrUris.cmd("MAIN",which.key,args),{method: "POST"}).then(function(data){ if(data.resultType === "SUCCESS") { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPath() {\r\n\t\tvar oCTree = oTree;\r\n\t\t$.each(aPath,function(i,sPath){\r\n\t\t\tif (!oCTree[sPath]) oCTree[sPath] = {contents:{},filled:false};\r\n\t\t\toCTree = oCTree[sPath];\r\n\t\t});\r\n\t\treturn oCTree;\r\n\t}", "path() {\n this.displayFolderStructure();\n }", "function subs_filt...
[ "0.5812827", "0.5784842", "0.5674402", "0.5606076", "0.5533945", "0.5529473", "0.55163056", "0.55163056", "0.55097735", "0.548622", "0.5479287", "0.5448221", "0.5372562", "0.53488153", "0.5332486", "0.53010905", "0.52951074", "0.52898765", "0.5288701", "0.5277135", "0.5263560...
0.6323521
0
GET_SELECTION_OBJECTS //////////////////////////////////////////////////////// Produces a list of selection objects based on a collection of: > array of strings containing entity IDs > array of entity objects > Object of IDs as property strings > Object of entity objects This method converts any of these collections in...
function GET_SELECTION_OBJECTS(nodesToSelect,btCanvas) { var nodes = {}; var nodesToSelectObj; var asyncGetObjs = new Deferred(); btCanvas.getAllNodes().then(function(canvasNodes){ if(nodesToSelect instanceof String) { var nodeId = nodesToSelect; nodesToSelect = new Array(); nodesToSelect.p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectedEntityIds(scope) {\n var arr = [];\n var selectedEntities = getSelectedEntities(scope);\n if (selectedEntities && selectedEntities.length > 0) {\n for (var i = 0; i < selectedEntities.length; i++) {\n if (selectedEntities[i]) {\n ...
[ "0.51299644", "0.50827265", "0.50363326", "0.50363326", "0.50363326", "0.50363326", "0.50363326", "0.5031725", "0.50307786", "0.50183386", "0.50131375", "0.49765342", "0.49598917", "0.49352285", "0.4879025", "0.48497126", "0.48265895", "0.48223358", "0.48196226", "0.4791544", ...
0.7118279
0
DISPLAY_EXPERIMENTAL_DATA ////////////////////////////// Opens an experimental data window and sends the commend to load experimental data for display. The args object must contain: > FrameTitle: String, alternative window title from the server response > ExperimentalData: Server response object > action: an object con...
function DISPLAY_EXPERIMENTAL_DATA(args) { require(["controllers/WindowController","static/XhrUris"],function(WindowController,XhrUris){ WindowController.openWindow({ id: args.id + "_expdata", uri: XhrUris.expData, title: "Experimental Data for " + args.name, failoverType: "EXP_DATA", controllerName: "con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function launchDataLink(data) {\n var Win = open(data,\"DataAccessPage\",\"height=800,width=1000,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes\");\n Win.focus();\n }", "function dataFrame(options) {\n\t\tvar o = $.extend({\n\t\t\t\t\"parent\" : 'body',\n\t\t\t}, options),\n\t\t\t...
[ "0.5597402", "0.5457951", "0.54393303", "0.521259", "0.5141949", "0.5008646", "0.49932167", "0.49692267", "0.4935637", "0.4932259", "0.4929097", "0.4894018", "0.48507604", "0.48464915", "0.48325327", "0.47982424", "0.47710258", "0.4754119", "0.47436857", "0.47355032", "0.4714...
0.8622051
0
PATH_MODEL_GENERATION ////////////////////////// Sends a request to load a given model to the existing model path window. args is the object describing the model path to open per the requirements of the OTHER_PATH_MODEL_GENERATION command flow on the server
function PATH_MODEL_GENERATION(args) { var loadAsync = new Deferred(); require(["controllers/XhrController","static/XhrUris"],function(xhrController,XhrUris){ xhrController.xhrRequest(XhrUris.cmd("OTHER","PATH_MODEL_GENERATION",args)).then(function(response){ loadAsync.resolve(response); }); },functio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "model(args) {\n let argtype = YngwieUI.Util.getType(args).toUpperCase();\n switch (argtype) {\n case \"UNDEFINED\":\n return this._model;\n case \"OBJECT\":\n this._model = YngwieUI.Model.setAsModel(args);\n return this;\n default:\n throw new YngwieError(\"Cannot s...
[ "0.6032716", "0.59753716", "0.5928414", "0.58413434", "0.57786304", "0.55226463", "0.5459112", "0.5439418", "0.5420762", "0.5414052", "0.54083425", "0.54050165", "0.53986156", "0.5344089", "0.5334536", "0.52781045", "0.5262285", "0.5228981", "0.522501", "0.5224473", "0.522223...
0.7584772
0
SELECT_AND_ZOOM ///////////////////////////////////// Aggregate method for all selecting on the ArtboardController. Zooming is optional via sending truthy noZoom in e
function SELECT_AND_ZOOM(e) { require(["controllers/ArtboardController"],function(ArtboardController){ var thisController = ArtboardController.getArtboardController(e.drawingAreaId || APP_CANVAS_CONTAINER_NODE_ID); if(e.noZoom) { thisController.selectNodes(e.newVal,e.AppendToSelection); } else { this...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PARSE_AND_SEL_ZOOM(e) {\n\t\trequire([\"views/BioTapestryCanvas\"],function(BTCanvas){\n\t\t\tGET_SELECTION_OBJECTS(e.newVal,BTCanvas.getBtCanvas(e.drawingAreaId || APP_CANVAS_CONTAINER_NODE_ID)).then(function(nodes){\n\t\t\t\tif(e.newVal.set) {\n\t\t\t\t\trequire([\"widgets/LowerLeftComponents\"],functio...
[ "0.7039411", "0.65121853", "0.64660525", "0.6212288", "0.60986954", "0.60214365", "0.59622175", "0.5874747", "0.58227146", "0.5786927", "0.5726015", "0.57214534", "0.570129", "0.5661583", "0.56332916", "0.56222904", "0.5595932", "0.55936044", "0.5586083", "0.5581836", "0.5550...
0.83403456
0
CLIENT_GOTO_MODEL //////////////////////////////// Change the current application model state (via the GrnModelController)
function CLIENT_GOTO_MODEL(e) { var asyncModelChange = new Deferred(); require(["controllers/GrnModelController","controllers/ModelTreeController"], function(GrnModelController,ModelTreeController){ var modelId = (!e.isGrnId ? GrnModelController.splitModelId(e.modelId) : {modelId: e.modelId,state: e.state}); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CLIENT_GOTO_MODEL_AND_SELECT(e) {\n\t\trequire([\"controllers/ArtboardController\",\"controllers/GrnModelController\",\n\t \"controllers/ModelTreeController\",\"dialogs/DialogFactory\"],\n\t\t\tfunction(ArtboardController,GrnModelController,ModelTreeController,DialogFactory){\n\t\t\t\n\t\t\tvar mo...
[ "0.70888674", "0.66683996", "0.60251087", "0.57933414", "0.5775079", "0.5771936", "0.5763425", "0.57056934", "0.5623119", "0.56163245", "0.5580805", "0.5551474", "0.54848856", "0.5440137", "0.54359", "0.54123986", "0.54028684", "0.53477883", "0.5344912", "0.53141254", "0.5297...
0.7575031
0
CLIENT_GOTO_MODEL_AND_SELECT //////////////////////////////// Change the current application model state (via the GrnModelController) and select the node list supplied e.newVal: single object or Array of entities to select and the models they are found in
function CLIENT_GOTO_MODEL_AND_SELECT(e) { require(["controllers/ArtboardController","controllers/GrnModelController", "controllers/ModelTreeController","dialogs/DialogFactory"], function(ArtboardController,GrnModelController,ModelTreeController,DialogFactory){ var modelId = (e.newVal instanceof A...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CLIENT_GOTO_MODEL(e) {\n\t\tvar asyncModelChange = new Deferred();\n\t\trequire([\"controllers/GrnModelController\",\"controllers/ModelTreeController\"],\n\t\t\tfunction(GrnModelController,ModelTreeController){\n\t\t\tvar modelId = (!e.isGrnId ? GrnModelController.splitModelId(e.modelId) : {modelId: e.mod...
[ "0.73314", "0.5837878", "0.57875717", "0.57398707", "0.5736932", "0.5719412", "0.558961", "0.55706793", "0.5569318", "0.55458224", "0.5538421", "0.5469972", "0.54006636", "0.5365195", "0.53633636", "0.5329749", "0.53106624", "0.52983457", "0.5208625", "0.5196374", "0.519616",...
0.7496107
0
POP_SELECT ///////////////////////////////////// Aggregate method for POP_SELECTION events, which all do the same thing: post a POP_SELECT command to the server, receive results and select+zoom
function POP_SELECT(entity,cmdKey) { return function(e) { require([ "dijit","views/BioTapestryCanvas","controllers/XhrController","static/XhrUris","controllers/StatesController" ],function(dijit,BTCanvas,XhrController,XhrUris,StatesController){ var args = (cmdKey === "SELECT_LINK_TARGETS" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fireSelectedEvent(){\n\t\t\tvar x1 = (selection.first.x <= selection.second.x) ? selection.first.x : selection.second.x;\n\t\t\tvar x2 = (selection.first.x <= selection.second.x) ? selection.second.x : selection.first.x;\n\t\t\tvar y1 = (selection.first.y >= selection.second.y) ? selection.first.y : selec...
[ "0.6272592", "0.6138201", "0.610461", "0.6099316", "0.60698235", "0.60570943", "0.6034123", "0.6034123", "0.6034123", "0.6034123", "0.6015762", "0.5966025", "0.5966025", "0.5856179", "0.58561474", "0.58336604", "0.5826488", "0.58109", "0.5799549", "0.5776335", "0.576895", "...
0.66810167
0
State store the current state of the tracked metrics. It is a singleton it listens for 'ingest' events it can also be flushed, etc.
function State() { this._trackedMetrics = {}; this.on('ingest', ingest); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCountersState() {\n return {\n counters: store.getAll()\n };\n}", "constructor() {\n super();\n this.state = {\n histogram: null\n }\n }", "constructor (initialState = {}) {\n this.emitter = new EventEmitter()\n this.updates = new Map()\n thi...
[ "0.64465696", "0.59511113", "0.576683", "0.56194717", "0.55676407", "0.55676407", "0.5525114", "0.5495126", "0.54684806", "0.54266703", "0.54038763", "0.53963035", "0.5394091", "0.5391312", "0.5372181", "0.5346255", "0.53432876", "0.5337699", "0.5320374", "0.53064114", "0.530...
0.8520605
0
clearList() calls clearAll() from store.js to clear the storage sets output to required text (as per the video example for the assignment) set .innerHTML to output
function clearList() { store.clearAll(); output = "All course registration are removed."; document.getElementById('showInfo').innerHTML = output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearAll(output, list) {\n dataList.innerHTML = '';\n output = '';\n localStorage.clear();\n // allows to use edit feature without issues\n window.location.reload(true);\n}", "clear() {\r\n this.list.innerHTML = \"\";\r\n }", "function clearList(list){\r\n list.innerHTML = ...
[ "0.8222281", "0.75836134", "0.7424079", "0.7244568", "0.7064035", "0.6984373", "0.6962247", "0.6960152", "0.69260293", "0.69220674", "0.6899284", "0.6864624", "0.6860823", "0.6834805", "0.68254954", "0.68210655", "0.67945623", "0.67739546", "0.6765344", "0.6764843", "0.676159...
0.7691546
1
Take in an observation, return an action Epsilon greedy if we are training
policy(obs) { if (this.isTrain && Math.random() < this.epsilon) { return Math.floor(Math.random() * this.env.getActionSpace()); } else { const action = tf.tidy(() => { const logits = this.model.apply([[obs]]); const action = logits.squeeze().argMax(); return action.dataSync(); }); return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getNextAction(state) {\n let action = 0;\n if (Math.random() < this.explorationRate) {\n action = Math.floor(Math.random() * this.numberOfActions);\n }\n else {\n let outputs = this.getOutput(state);\n for (let a = 1; a < outputs.length; a++) {\n ...
[ "0.5978751", "0.5732226", "0.5610921", "0.56019163", "0.55099297", "0.53267646", "0.5250904", "0.5241957", "0.5223127", "0.5204371", "0.5177174", "0.5151882", "0.51417744", "0.51258934", "0.51258934", "0.51130307", "0.5111374", "0.5049127", "0.5016723", "0.49511626", "0.49417...
0.6550983
0
Take in number of episodes to train, update model References trainSteps and loggingPeriod
train() { super.train(); let [states, actions, rewards, dones] = this.rollout(this.replayBuffer.maxSize); this.replayBuffer.pushEpisode(states, actions, rewards, dones); for (let i = 0; i < this.trainSteps; i++) { this.epsilon = this.getEpsilon(i); [states, actions, rewards, dones] = this.rollout(this.bat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n for (let step = 0; step < this.actionHistory.length; step++) {\n \n this.model.actionTensor.assign(this.actionHistory[step]);\n this.model.stateTensor.assign(this.stateHistory[step]);\n this.model.rewardTensor.assign(this.rewardHistory[step]);\n\n ...
[ "0.63919437", "0.5906706", "0.58719987", "0.5832966", "0.57906175", "0.56203675", "0.5610839", "0.55326647", "0.5531219", "0.54548216", "0.534731", "0.534731", "0.5347278", "0.53099316", "0.5300501", "0.5293306", "0.52835083", "0.5282737", "0.52371436", "0.52300626", "0.52184...
0.73080635
0
Take an update step on the model, return the loss
update() { const samples = this.replayBuffer.sample(this.batchSize); const lossFunc = () => tf.tidy(() => { const states = tf.tensor2d(samples.map(x => x[0]), undefined, "float32"); const actions = tf.tensor1d(samples.map(x => x[1]), "int32"); const rewards = tf.tensor1d(samples.map(x => x[2]), "int32"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loss() {\n let currentLoss = 0;\n\n //Accumulate loss\n for (let i = 0; i != this.data.length; ++i) {\n const [y, x1, x2] = this.data[i];\n const prediction = this.predict(x1, x2);\n currentLoss += y * Math.log(prediction) + (1 - y) * Math.log(1 - prediction);\...
[ "0.65694666", "0.62935203", "0.5954872", "0.59354585", "0.5828766", "0.57189775", "0.5713927", "0.57030594", "0.5680571", "0.5678216", "0.56458074", "0.5580704", "0.55350417", "0.5525915", "0.5509885", "0.54991245", "0.53407633", "0.5302093", "0.52757686", "0.5274121", "0.525...
0.64384633
1
GET inbox from server or localStorage
function getInbox() { if (!localStorage.inbox) { $.getJSON('/api/inbox', function (data) { localStorage.inbox = JSON.stringify(data); template.renderInbox(data); }); } else { template.renderInbox(JSON.parse(localStorage.inbox)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function twinkle() {\n result = httpGet('/mailbox/twinkle');\n}", "function renderInbox (){\n\t$.get('checkInbox', {}, function(data){\n\t\t\t\n\t\tvar fndReq = \"<li><h5>Friend Request</h5></li>\";\n\t\t\n\t\t//abort of the data is non-exist\n\t\tif (data == null) {\n\t\t\t$('#inbox ul').html(\"You have no m...
[ "0.6216111", "0.6193129", "0.6190325", "0.6186021", "0.61647063", "0.6138395", "0.6108422", "0.6052071", "0.59876555", "0.595843", "0.58940095", "0.58556926", "0.58516484", "0.5849771", "0.5792867", "0.5791684", "0.57370275", "0.57153517", "0.56727505", "0.5612977", "0.559534...
0.78841126
0
Check which values of tests are in outputs
function test(tests, outputs) { const checks = []; tests.forEach(test => { let found = outputs.some(output => { return output.includes(test); }); checks.push({ test, found }); }); return checks; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkOutputs(index, output, opLength) {\n\n var tmpArray = [];\n\n for (i = index + 1; i < opLength; i++) {\n\n if (operationList[i].OPERATION.INPUTS[0] != null) {\n\n // used to make sure only variable outputs are populated\n var varTest = operationList[i].OPERATION.INP...
[ "0.65505475", "0.6523725", "0.6357041", "0.6169803", "0.59676063", "0.5826501", "0.5793795", "0.5732889", "0.5719267", "0.57077134", "0.57077134", "0.57077134", "0.57077134", "0.5701176", "0.56733036", "0.5634927", "0.5573475", "0.5540651", "0.553937", "0.5539149", "0.5506872...
0.74971557
0
dismiss lockout mode at gadget remove icon of lockout
hide () { this._setLockout() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideLockoutLayerAtStart(){\n\t $(\"#lockout\").css({\"background\": \"\", \"display\":\"none\"});\n }", "function showLockoutLayer(){\n\t $('#lockout').show();\n }", "function unlockModal() {\n locked = false;\n }", "function unlockModal() {\n locked = false;\n }", "f...
[ "0.70139974", "0.66379035", "0.65635973", "0.65635973", "0.65265197", "0.64558405", "0.64319235", "0.6427468", "0.6383314", "0.6238019", "0.6233702", "0.62113243", "0.6164068", "0.6156412", "0.61207587", "0.6103407", "0.6102171", "0.60948026", "0.6093757", "0.605629", "0.6046...
0.7073456
0
Initializes a new AjaxRequest object with the provided authentication token and defaults the mode property to 'ajax'.
function AjaxRequest(token) { this.mode = "ajax"; this.token = token; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setupAjax() {\n $.ajaxSetup({\n headers: {\n 'Authorization': 'Bearer ' + localStorage.getItem('userToken')\n }\n });\n }", "ajaxOptions(url, type, options) {\n options = options || {};\n if (type === \"GET\") {\n options.data = options.data || {};...
[ "0.6511983", "0.63725233", "0.61877537", "0.6096313", "0.60669243", "0.60660547", "0.60660547", "0.5984385", "0.59655213", "0.59184074", "0.5907723", "0.58928144", "0.5877882", "0.5872551", "0.5841274", "0.5818106", "0.57907575", "0.57828087", "0.57435703", "0.56535536", "0.5...
0.81405437
0
this function is called first. It waits VLXViewer applet to load.
function waitViewerToLoad() { if(!document.VLVChart) { // not loaded, try again in 200ms setTimeout(waitViewerToLoad, 200); } else { // loaded. Poll events objChart = document.VLVChart; PollEvent(); // execute callback function if(cb) { cb(this); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\r\n\taddListeners();\r\n\t// Polite loading\r\n\tif (Enabler.isPageLoaded()) {\r\n\t\tshow();\r\n\t}\r\n\telse {\r\n\t\tEnabler.addEventListener(studio.events.StudioEvent.PAGE_LOADED, show);\r\n\t\t//Enabler.addEventListener(studio.events.StudioEvent.VISIBLE, show);\r\n\t}\r\n}", "function NaCl...
[ "0.6192012", "0.6152377", "0.6094755", "0.6066459", "0.60421234", "0.60027784", "0.59999573", "0.5998298", "0.59451365", "0.5941034", "0.59228134", "0.5902934", "0.58835584", "0.5878949", "0.5875835", "0.5870801", "0.5859452", "0.5835255", "0.5832103", "0.5832073", "0.5801216...
0.7338488
0
this function is called from PollEvent() when VLXViewer finishes reorganizing chart animation
function OnReorgDone() { objChart.showWaiting(false); objChart.zoomToFitEx(true, 1,false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnDataLoaded() {\n\t\tobjChart.showWaiting(false);\t\t\t\t\n\t\tobjChart.reorganize();\t\t\n\t}", "_onEndAnim() {\n if (this._overlay) {\n this._peer.getChart().getPlotArea().removeChild(this._overlay);\n this._overlay = null;\n }\n }", "function resizeChart () {\n c...
[ "0.72693574", "0.6462839", "0.6239385", "0.62217087", "0.61787134", "0.6106597", "0.60827726", "0.60704845", "0.60470784", "0.60330707", "0.59415585", "0.5927571", "0.59189606", "0.59113085", "0.5898088", "0.5891382", "0.58876395", "0.5879123", "0.58614606", "0.5858623", "0.5...
0.693442
1
Change 4: Wrapping jsPsych.init() in a function
function initExp() { jsPsych.init({ timeline: timeline, preload_images: all_images, // this speeds things up. show_preload_progress_bar: false, display_element: 'display_stage', fullscreen: true, on_finish: function (data) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initExp() {\n\n // push all the procedures, which are defined in stop-it_main.js to the overall timeline\n var timeline = []; // this array stores the events we want to run in the experiment\n\n // use the full screen\n // also playing sound only works after an interaction with...
[ "0.63820904", "0.62112576", "0.6173847", "0.60571295", "0.59890836", "0.59890836", "0.59890836", "0.59890836", "0.59890836", "0.59890836", "0.59890836", "0.59890836", "0.59890836", "0.59890836", "0.59499323", "0.59479725", "0.592843", "0.592843", "0.592843", "0.5921235", "0.5...
0.65559024
0
The values pulled from the gyroscope of a motion device. Returns an object literal with x and y as options.
function valuesFromMotion(e) { x = e.gamma y = e.beta // Swap x and y in Landscape orientation if (Math.abs(window.orientation) === 90) { var a = x; x = y; y = a; } // Invert x and y in upsidedown orientations if (window.orientation < 0) { x = -x; y = -y; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAccelerometerValues() {\n acc.onreading = () => {\n xval.innerHTML = acc.x.toFixed(3);\n yval.innerHTML = acc.y.toFixed(3);\n zval.innerHTML = acc.z.toFixed(3);\n // Data must be sent on reading!\n this.sendValues();\n }\n acc.start();\n}", "magnetometer() {\n this.setup();\n...
[ "0.5945186", "0.5781852", "0.57620966", "0.5521939", "0.5419441", "0.54123294", "0.5403685", "0.5389543", "0.5368596", "0.527642", "0.5181392", "0.51640004", "0.5153068", "0.5151512", "0.5129137", "0.5108478", "0.5098286", "0.5094067", "0.5093666", "0.5072527", "0.5021079", ...
0.62380695
0
urls: functional version using .map (example version)
function functionalUrls(elements) { return elements.map(element => urlify(element)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapURL(states) {\n return states.map(state => \"https://example.com/\" + urlify(state));\n}", "async function get_urls() {\n const getUrls = await fetch(\"http://localhost:3000\").then((data) => data.json());\n \n getUrls.urls.map( ({name, url}) => writeUrl({name, url}) ); // Add all URLs.\n...
[ "0.7123713", "0.6291587", "0.61715126", "0.61431783", "0.5959501", "0.58535933", "0.5845265", "0.58065623", "0.57420224", "0.5708918", "0.5666242", "0.5661877", "0.55992526", "0.55830836", "0.55525005", "0.5530419", "0.5456213", "0.543285", "0.5430881", "0.5417897", "0.534085...
0.6781762
1
Get xpath position of an element
function getXPath(element) { var xpath = ''; for ( ; element && element.nodeType == 1; element = element.parentNode ) { var id = $(element.parentNode).children(element.tagName).index(element) + 1; id > 1 ? (id = '[' + id + ']') : (id = ''); xpath = '/' + element.tagName.toLowerCase()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Xml_GetPosition(objNode)\r\n{\r\n if(objNode)\r\n {\r\n return Xml_SelectNodes(\"preceding-sibling::*\",objNode).length;\r\n }\r\n \r\n return -1;\r\n}", "function element_xy(e) {\n\tvar x = 0;\n\tvar y = 0;\n\tif(e.offsetParent) {\n\t\tdo {\n\t\t\tx += e.offsetLeft;\n\t\t\ty += e....
[ "0.6527936", "0.6326158", "0.6304317", "0.6293971", "0.62869424", "0.6255757", "0.6232189", "0.6232189", "0.6216509", "0.6199789", "0.61851454", "0.6178089", "0.6178089", "0.6178089", "0.6164631", "0.61611634", "0.6119486", "0.6119466", "0.6113702", "0.61003596", "0.60678595"...
0.6552608
0
Return an object describing the current selected fragment
function getSelectedFragment() { var selection = window.getSelection(); var selected_text = selection.toString(); var data = { url : window.location.href, site_url: window.location.protocol + "//" + window.location.host } if (selection.rangeCount === 0) return data; var range = selection.get...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get_fragment() {\n return this.fc.get_fragment_by_id(this.get_fragment_id());\n }", "get_fragment_id() {\n return this.fragment_id\n }", "fragment(editor, at) {\n var range = Editor.range(editor, at);\n var fragment = Node.fragment(editor, range);\n return fragment;\n }", "fragment(editor, ...
[ "0.7019793", "0.6115792", "0.5816629", "0.5816629", "0.570148", "0.5667828", "0.55940765", "0.5487521", "0.54618996", "0.54524845", "0.54416144", "0.5430723", "0.53883904", "0.5379282", "0.5379282", "0.53769475", "0.537649", "0.53691554", "0.5335577", "0.5335577", "0.5335577"...
0.73274773
0
View selected block offline in the WIP server
function viewBlock(block_url) { console.log('in viewBlock') window.open(block_url,'block'); var data = { function: 'viewBlock', status: 'ok'} return data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getBlockByIndex() {\n this.server.route({\n method: 'GET',\n path: '/block/{index}',\n handler: async (request, h) => {\n let blockIndex = parseInt(request.params.index);\n const result = await this.blockchain.getBlock(blockIndex);\n ...
[ "0.6348414", "0.63196373", "0.6249714", "0.6232103", "0.6229249", "0.6226635", "0.6218296", "0.61891913", "0.61775607", "0.6122609", "0.6064601", "0.60346836", "0.59730047", "0.5949202", "0.59149843", "0.58962214", "0.5882666", "0.58773273", "0.58710855", "0.58626926", "0.586...
0.6887988
0
console.log(data); / Generate Random Fractions
function randomFraction(){ return Math.random(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomFraction() {\n return Math.random();\n}", "function genFraction() {\n var a = Math.floor((Math.random() * maxNumber) + baseNumber);\n var b = Math.floor((Math.random() * maxNumber) + baseNumber);\n return (a + \"/\" + b);\n }", "function randomFraction() {\n\n // Only c...
[ "0.76719433", "0.7340819", "0.71656543", "0.7125419", "0.7057298", "0.7022677", "0.6367624", "0.63205093", "0.63027364", "0.62858623", "0.6243445", "0.6154349", "0.6146014", "0.6145897", "0.61331284", "0.6124172", "0.6100788", "0.60793144", "0.6058562", "0.6042727", "0.599012...
0.75528383
1
convert2Integer("56"); / parseInt Function with a Radix
function convert2IntegerWithRadix(str){ return parseInt(str, 2); // passing it as a base 2 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertToInteger(str) {\n return parseInt(str,10);/*radix is considered as the base d*/\n}", "function sc_string2integer(s, radix) {\n return parseInt(s, radix);\n}", "function convertToInteger(str) {\n\n\n return parseInt(str, 2); // radix 2 -> binary base 2\n}", "function parseInt_(radix) {\n...
[ "0.77283025", "0.7675572", "0.7440733", "0.73078644", "0.72956693", "0.7150018", "0.71126765", "0.707904", "0.7074554", "0.7065456", "0.7053888", "0.7046086", "0.704455", "0.7040833", "0.70244443", "0.70089585", "0.6997476", "0.69911784", "0.6930332", "0.69221586", "0.6922158...
0.8403489
0
Checks if G is a valid adjacency matrix for a graph
function checkGraph(G) { // If the argument isn't an array, it's not valid if(!Array.isArray(G)) { return false; } let width = G.length; let height = G[0].length // If the argument isn't a square array, it's not valid if(width !== height) { return false; } let n = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkConnected(G) {\n let n = G.length;\n\n // Initiate visited array\n let visited = [];\n for(let i = 0; i < n; i++) visited[i] = false;\n\n DFS(G, visited, 0);\n\n for(let i = 0; i < n; i++) {\n if(!visited[i]) {\n return false;\n }\n }\n\n return true;\...
[ "0.69802517", "0.69426304", "0.64779925", "0.638058", "0.60778254", "0.602528", "0.5976545", "0.5958529", "0.5917092", "0.586867", "0.5709448", "0.56191736", "0.5593334", "0.55920964", "0.5532397", "0.54397887", "0.54188925", "0.5390197", "0.53834707", "0.53390366", "0.533341...
0.7510593
0
Checks if G is a represents a connected graph
function checkConnected(G) { let n = G.length; // Initiate visited array let visited = []; for(let i = 0; i < n; i++) visited[i] = false; DFS(G, visited, 0); for(let i = 0; i < n; i++) { if(!visited[i]) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isConnected(/* Graph */g) {\n\tvar src = g.verts[1];\n\tif (typeof src == \"undefined\"){\n\t\treturn false;\n\t}\n\tBFS(src);\n\t// If any vertex is not visited after BFS then the graph is not connected\n\tfor (var i = 0; i < g.verts.length; i++) {\n\t\tif (!g.verts[i].seen)\n\t\t\treturn false;\n\t}\n\t...
[ "0.7875016", "0.6977561", "0.67570925", "0.6542693", "0.6501788", "0.6399403", "0.62967527", "0.629356", "0.6289637", "0.6213473", "0.6182129", "0.6144178", "0.6144178", "0.6133631", "0.6123598", "0.60416776", "0.60333806", "0.6001164", "0.5986575", "0.5972532", "0.59577024",...
0.75816876
1
Checks if a graph is undirected
function isUndirected(G) { let n = G[0].length; // An undirected graph is diagonally symmetric, so if we find any asymmetric values, we'll know the graph isn't undirected for(let i=0; i < n; i++) { for(let j=0; j < n; j++) { if(G[i][j] !== G[j][i]) { return false; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkEulerUndirected(G) {\n let n = G[0].length;\n\n // An undirected graph is eulerian if all it's vertices have a an even degree\n for(let i = 0; i < n; i++) {\n let degree = 0;\n\n for(let j = 0; j < n; j++) {\n if(j === i && G[i][j] !== 0) {\n throw \"T...
[ "0.68386316", "0.6815355", "0.64696914", "0.63749635", "0.63372076", "0.6234266", "0.62163895", "0.6169106", "0.6101042", "0.6101042", "0.607299", "0.607299", "0.60574096", "0.60413194", "0.6012089", "0.59811896", "0.5975519", "0.5936916", "0.59030324", "0.59030324", "0.59030...
0.7978643
0
Checks if an undirected graph is eulerian
function checkEulerUndirected(G) { let n = G[0].length; // An undirected graph is eulerian if all it's vertices have a an even degree for(let i = 0; i < n; i++) { let degree = 0; for(let j = 0; j < n; j++) { if(j === i && G[i][j] !== 0) { throw "To jest multigra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkEulerDirected(G) {\n let width = G.length;\n let height = G[0].length\n\n // Find the number of outgoing and ingoing edges for all vertices\n let outgoing = new Array(width).fill(0);\n let ingoing = new Array(height).fill(0);\n for(let i = 0; i < height; i++) {\n for(let j = ...
[ "0.8134889", "0.72736305", "0.64439243", "0.6406585", "0.6378147", "0.6141498", "0.5828348", "0.58032393", "0.5780461", "0.57750183", "0.57672954", "0.57312304", "0.5697382", "0.5697382", "0.5682352", "0.56495667", "0.5603716", "0.5587333", "0.5568805", "0.55687845", "0.55483...
0.80519605
1
Checks if a directed graph is eulerian
function checkEulerDirected(G) { let width = G.length; let height = G[0].length // Find the number of outgoing and ingoing edges for all vertices let outgoing = new Array(width).fill(0); let ingoing = new Array(height).fill(0); for(let i = 0; i < height; i++) { for(let j = 0; j < width;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkEulerUndirected(G) {\n let n = G[0].length;\n\n // An undirected graph is eulerian if all it's vertices have a an even degree\n for(let i = 0; i < n; i++) {\n let degree = 0;\n\n for(let j = 0; j < n; j++) {\n if(j === i && G[i][j] !== 0) {\n throw \"T...
[ "0.7793752", "0.7140643", "0.6416238", "0.63682604", "0.6154963", "0.60190535", "0.58868986", "0.5812413", "0.5809936", "0.57842416", "0.5765282", "0.57287854", "0.57287854", "0.5647324", "0.5614542", "0.558697", "0.5560906", "0.55574", "0.54802465", "0.5479494", "0.54693097"...
0.80729634
0
Just rout add commands call to the right place
addCommands(commands){if(this.annyang){this.annyang.addCommands(commands)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerCommands()\n{\n addCMD([\"cmd\", listCmds, \"Prints list of available commands\"]);\n addSynonimOf(\"cmd\", \"cmds\");\n addSynonimOf(\"cmd\", \"commands\");\n\n addCMD([\"test\", test, \"Just a test\"]);\n addCMD([\"invite\", inviteMeLink, \"I'll ...
[ "0.7032375", "0.6699486", "0.6642802", "0.66216797", "0.65446633", "0.63487685", "0.63164496", "0.6269504", "0.6254631", "0.61907995", "0.61630094", "0.6160857", "0.6150051", "0.614676", "0.61274534", "0.61274374", "0.6127165", "0.6112494", "0.61031276", "0.6076915", "0.60728...
0.6980671
1
Annyang library has been loaded globally so we can use it
_annyangLoaded(){this.annyang=window.annyang;// Add our commands to annyang if(this.annyang){this.annyang.addCommands(this.commands);this.annyang.debug(this.debug);// Start listening. You can call this here, or attach this call to an event, button, etc. if(this.auto){this.annyang.start({autoRestart:!0,continuous:!0})}e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkForLibrary() {\n try {\n if(window.utag) {\n return true;\n }\n else {\n return false;\n }\n }\n catch (e) {\n log(\"ERROR: Could not find library (from checkForLibrary method): \" + e);\n ...
[ "0.59536284", "0.58818877", "0.5868318", "0.57893676", "0.5780941", "0.576906", "0.576906", "0.5714171", "0.5628917", "0.5588298", "0.55318236", "0.5521751", "0.5519111", "0.5511919", "0.54839253", "0.5446983", "0.53702", "0.5343138", "0.52631485", "0.5254417", "0.5243099", ...
0.5982043
0
Wraps the input value in a new BinarySearchTree and assigns it to either the left or right subtree, depending on its value
insert(value) { if (value < this.value) { if (this.left === null) { this.left = new BinarySearchTree(value); } else { this.left.insert(value); } } else if (value > this.value) { if (this.right === null) { this.right = new BinarySearchTree(value); } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BinarySearchTree (value) {\n this.value = value\n this.left = null\n this.right = null\n}", "function BinarySearchTree (value) {\n this.value = value;\n this.left = null;\n this.right = null;\n}", "insert(value) {\n this.count++;\n let newNode = new Node(value)\n const searchTree = (nod...
[ "0.75130075", "0.745714", "0.7432074", "0.7390642", "0.7334814", "0.7324871", "0.725396", "0.72462976", "0.70220643", "0.7019213", "0.7004558", "0.6987855", "0.6931818", "0.6873559", "0.68595237", "0.6855846", "0.685053", "0.67772686", "0.6765197", "0.6727759", "0.67141926", ...
0.7470174
1
Traverses the tree in a breadthfirst manner, i.e. in layers, starting at the root node, going down to the root node's children, and iterating through all those nodes first before moving on to the next layer of nodes Applies the given callback to each tree node in the process You'll need the queuehelper file for this. O...
breadthFirstForEach(cb) { const q = new Queue(); q.enqueue(this); while (!q.isEmpty()) { const node = q.dequeue(); cb(node.value); if (node.left) { q.enqueue(node.left); } if (node.right) { q.enqueue(node.right); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "breadthFirstForEach(cb) {\n const queue = [];\n queue.push(this);\n while (queue.length !== 0) {\n const currentNode = queue.shift();\n cb(currentNode.value);\n if (currentNode.left) queue.push(currentNode.left);\n if (currentNode.right) queue.push(currentNode.right); \n } \n }", ...
[ "0.7214728", "0.7020077", "0.6961704", "0.69296205", "0.67308724", "0.66464597", "0.64935577", "0.643888", "0.6402412", "0.63690907", "0.63638866", "0.63441837", "0.6340605", "0.63303125", "0.63125014", "0.6254916", "0.6211685", "0.620235", "0.6172929", "0.6171256", "0.616295...
0.7122892
1
VERTICAL CENTERING Position the work descriptions
function verticalCenter() { $('.work_desc').each(function(i) { var $this = $(this); var descHeight = $this.height() / 2; $this.css('margin-top', parseFloat('-'+descHeight)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verticalPlacement() {\r\n\treturn v_ycoordinate + v_yoffset;\r\n}", "function make_desc(ind){\r\n size_marker_icon(ind);\r\n }", "function make_desc(ind){\r\n size_marker_icon(ind);\r\n }", "function ...
[ "0.5829325", "0.5583281", "0.5583281", "0.554493", "0.5497037", "0.5491086", "0.5403739", "0.53529525", "0.5349483", "0.53389704", "0.5321742", "0.53149533", "0.5247033", "0.52414536", "0.52175266", "0.52096826", "0.52024484", "0.51983756", "0.5187268", "0.51749957", "0.51700...
0.69932604
0
LER TOKEN EM QR CODE
function lerToken(){ cordova.plugins.barcodeScanner.scan( result => { document.getElementById("token").value = result.text; }, error => { alert("Erro interno: " + error); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getQRCode(text) {\n var pattern = /\\'otpauth.*?\\'/\n var match = pattern.exec(text);\n text = match[0];\n text = text.substring(1, text.length - 1);\n var qrcode = new QRCode(document.getElementById(\"qrCode\"), {\n width: 300,\n height: 300\n });\n return qrcode.makeC...
[ "0.6745135", "0.64475644", "0.6380774", "0.63284534", "0.62620777", "0.6161496", "0.6089893", "0.6069293", "0.60691476", "0.6056145", "0.6042723", "0.60236907", "0.5989301", "0.59629536", "0.59547454", "0.5847008", "0.5800305", "0.5799277", "0.57412857", "0.5740425", "0.57392...
0.6978462
0
to show the number which is generated function to choose a color by comparing generated number
function numberGenerator(color){ color = [purple(),green(),orange(),blue(),voilet(),red(),yellow()]; console.log(color[random]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateIntermediateColor (){\nlet randomNumber = Math.floor((Math.random() * 100) + 1);\n\nif (randomNumber <= 33) return \"R\";\nelse if (randomNumber > 33 && randomNumber <=66) return \"B\";\nelse return \"G\";\n}", "function rand_color(n){\n\tdiff = Math.floor(Math.random() * n);\n\n\tif (diff_prev...
[ "0.7448091", "0.72545505", "0.7159925", "0.712407", "0.7109967", "0.7088175", "0.70603055", "0.70516413", "0.7040253", "0.693913", "0.6917648", "0.6907732", "0.6887963", "0.6858143", "0.6841669", "0.68352145", "0.68333447", "0.68258435", "0.681926", "0.68128026", "0.6806162",...
0.73453987
1
Busca las paradas de un recorrido dependiendo del ID de la ruta y del tipo de recorrido de esa ruta.
function buscarParadas(id_ruta,radioTipo){ /** * Peticion de las paradas segun una ruta seleccionada */ Ext.Ajax.request({ url : 'core/php/core/RQ4_ParadasRuta.php', method : 'POST', success: function (result) { var r = Ext.util.JSON.decode(result.responseT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRutas(next) {\n RutaModel\n .query(`select r.idRuta, r.idVehiculo, r.noEconomico, r.idRemolque, r.salida, r.destino, r.idConductor, r.fechaSalida, r.fechaLlegada, r.tiempoEstimado,r.idEstado, r.idPrioridad,r.created_at, u.latitud, u.longitud, u.estadoGeoreferencia, u.municipioGeoreferencia, u...
[ "0.6148606", "0.56902146", "0.5678024", "0.54304117", "0.53484356", "0.53229743", "0.5311956", "0.51959455", "0.5188308", "0.51732767", "0.5159093", "0.51120234", "0.5061219", "0.5029863", "0.5006026", "0.5002288", "0.49547568", "0.49526805", "0.49428892", "0.49377847", "0.49...
0.61626625
0
init the children boxes' size
function initSize(){ $this.css({ width : params.width, height : params.height }); $('body').css({ width : params.width, height : params.height }); $this.find('.lsd-box').each(function(){ $(this).css({ width : params.width, height : params.height }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateDimensions() {\n let height = 0.0;\n let depth = 0.0;\n let maxFontSize = 1.0;\n if (this.children) {\n this.children.forEach(x => {\n if (x.height > height) height = x.height;\n if (x.depth > depth) depth = x.depth;\n if (x....
[ "0.6952818", "0.6786521", "0.66953", "0.66875124", "0.66322625", "0.6560616", "0.6527513", "0.6458609", "0.6447832", "0.6429142", "0.6397039", "0.6384642", "0.63687783", "0.6356353", "0.63456625", "0.6337557", "0.6309954", "0.6182562", "0.6173204", "0.6162408", "0.6154345", ...
0.74845904
0
DELETE deleting all users
function deleteAllUsersQuery() { return User.remove({}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteAllUsers() {\n return knex.from('users')\n .del();\n}", "deleteAll() {\n realm.write(() => {\n const user = realm.objects('User');\n realm.delete(user);\n });\n }", "function usersDelete(req, res){\n User.findByIdAndRemove({_id: req.params.id}, function(err){\n if (err) r...
[ "0.812123", "0.78161603", "0.73585844", "0.71881866", "0.71483713", "0.7107298", "0.7099548", "0.7073183", "0.6995546", "0.6984485", "0.69606185", "0.6957882", "0.6926485", "0.6921242", "0.68905467", "0.6869926", "0.68464655", "0.6838772", "0.6833858", "0.6804706", "0.6775622...
0.8013672
1
Define a function we want to run once for each feature in the features array Give each feature a popup describing the muni stop and the lines it services
function onEachFeature(feature, layer) { //abracadabra let stopId = feature.properties.stopId; let stopTitle = feature.properties.title; // let muniLine = feature.properties.Route; let stopInfo = APICallResponse.filter(function(stop) { return stop.stop_point_ref == stopId; }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function do_OnEachFeature(feature, obj) {\r\n obj.bindPopup(\"<h2>\" + feature.properties.title +\r\n \"</h2><hr>\" + \"<h4>\" + new Date(feature.properties.time) + \"</h4>\"\r\n + \"<h4>\" + \"For more information on this event visit:\" + \"</h4>\"\r\n + \"<h5>\" + feature.properties.url ...
[ "0.6696807", "0.6253872", "0.62509346", "0.6242542", "0.6236704", "0.62129635", "0.620138", "0.61842674", "0.61620164", "0.6158293", "0.61538327", "0.6151347", "0.613681", "0.613292", "0.6123034", "0.6112986", "0.6111276", "0.610818", "0.6105504", "0.61049837", "0.6102714", ...
0.7486085
0
this function is used to generate the HTML for each line in the lines array
function linesInfo(linesArray){ let htmlBlock = ""; linesArray.forEach((line) =>{ let lineName = line.line_ref; let minLate = line.scores.min_late; let shameScorePredictionLabel = line.scores.prediction_label; let shameScoreDescription = shame...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderEachLine() {\n return _.map(textArray, (eachLine, i) => {\n return <span key={i} >{eachLine}<br/></span>;\n });\n }", "function embedNL(lines) {\n\tvar htmls = [];\n\tvar tmpDiv = $(document.createElement('div'));\n\tfor (var i = 0 ; i < lines.length ; i++) {\n\t\thtmls.push(tmpDiv.tex...
[ "0.70981884", "0.6284988", "0.60706335", "0.6009686", "0.5969688", "0.5925113", "0.59109795", "0.58940727", "0.5882444", "0.5877127", "0.58577734", "0.58446157", "0.5811117", "0.57910776", "0.5789215", "0.57888055", "0.57651544", "0.5756869", "0.57300735", "0.572551", "0.5715...
0.706777
1
Add the relevant results to this engine An engine could already have old results listed so this must clear those out
function add(results) { // { "name" : name, "type" : type, "terms" : terms, "results" : [ "title" : title, "url" : url ] } var id = _convertEngineName(results.name); // Keep track of how many results we use from the list var count = 0; for (var i in results.results) { // Suggestion Result var item =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshResults()\r\n{\r\n\tvar resultHTML = \"\";\r\n\tfor (resultIndex = 0; resultIndex < results.length; resultIndex++)\r\n\t{\r\n\t\tvar tracks = results[resultIndex];\r\n\t\tvar trackBatchHTML = trackBatchDIV.replace(/#/g, resultIndex);\r\n\t\ttrackBatchHTML = trackBatchHTML.replace(/HEAD_URL/g, track...
[ "0.6636289", "0.6634123", "0.6504655", "0.6478021", "0.6442496", "0.637709", "0.63402325", "0.63167304", "0.6316054", "0.62994635", "0.6213901", "0.6080373", "0.6075906", "0.60259426", "0.601989", "0.59998757", "0.59779966", "0.595473", "0.59303236", "0.5920197", "0.59028935"...
0.68638474
0
Highlight the text with the terms provided while preserving the case used returns wrappers around the terms found in the text
function highlight(text, terms) { var index = text.toLowerCase().indexOf(terms.toLowerCase()); // the terms could not exist in the text at all if (index < 0) { return text; } var pre = text.substring(0, index); var mid = text.substring(index, index + terms.length); var post = text.substring(index + te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resultHighlight(text, term) {\n var terms = term.split(\" \");\n\n $.each(terms, function (key, term) {\n if (term.length >= 3) {\n term = term.replace(/(\\s+)/, \"(<[^>]+>)*$1(<[^>]+>)*\");\n var pattern = new RegExp(\"(\" + term + \")\", \"gi\");\n\...
[ "0.7796213", "0.71868014", "0.71260357", "0.702074", "0.70040405", "0.6946025", "0.6877608", "0.68658453", "0.68658453", "0.68658453", "0.68633133", "0.68172884", "0.68163633", "0.67965037", "0.6776104", "0.6735467", "0.6693561", "0.6681809", "0.66739964", "0.6513862", "0.647...
0.82183903
0
utility function to make the engine name into a usable id XXX this is not good but works shrug
function _convertEngineName(engineName) { return engineName.replace(/[\s(\)\.]*/g, "_") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "idString() {\n return ( Date.now().toString( 36 ) + Math.random().toString( 36 ).substr( 2, 5 ) ).toUpperCase();\n }", "function format_identifier(id) {\n \n\tvar new_id;\n\tif (id[0].match(\"[a-zA-Z_$]\")) {\n\t\tnew_id = id[0];\n\t} else {\n\t\tnew_id = convert_char(id[0]);\n\t}\n\tfor (var j = 1; j < id....
[ "0.64226854", "0.6348925", "0.63180345", "0.6308441", "0.6297317", "0.62964046", "0.62899846", "0.6222861", "0.6219375", "0.6216517", "0.617593", "0.6174389", "0.6148554", "0.6148554", "0.61431384", "0.61362827", "0.61164385", "0.6104732", "0.6089695", "0.6076421", "0.6061584...
0.6934921
0
Driver object That's the interesting part. There is a driver for each schema provided. The schema is a te combination of name (for the database), a version as well as migrations to reach that version of the database.
function Driver(schema, ready, nolog) { this.schema = schema; this.ready = ready; this.error = null; this.transactions = []; // Used to list all transactions and keep track of active ones. this.db = null; this.nolog = nolog...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buildSchema() {\n if (!this.dbSchema) return this.schema;\n for (let tablename in this.dbSchema) {\n this.mapDbTableToGraphqlType(tablename);\n this.mapDbTableToGraphqlQuery(tablename);\n this.mapDbTableToGraphqlFirstOf(tablename);\n this.mapDbTableToGraphqlMutation(tablename);\n thi...
[ "0.5696195", "0.56790096", "0.556478", "0.53738713", "0.5342126", "0.53297025", "0.53251636", "0.5310512", "0.5289843", "0.5232833", "0.518291", "0.5167932", "0.51665527", "0.5123798", "0.5112415", "0.5076819", "0.5070184", "0.5065262", "0.5009676", "0.5007453", "0.5003507", ...
0.6352438
0
ExecutionQueue object The execution queue is an abstraction to buffer up requests to the database. It holds a "driver". When the driver is ready, it just fires up the queue and executes in sync.
function ExecutionQueue(schema,next,nolog) { this.driver = new Driver(schema, this.ready.bind(this), nolog); this.started = false; this.stack = []; this.version = _.last(schema.migrations).version; this.next = next; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Queue() {\n this.debug = debug;\n this.tasks = [];\n return this;\n}", "executeQueue() {\n return new Promise(async (resolve, reject) => {\n try {\n let commands = this.queue;\n\n debug(`Executing queue with ${commands.length} command(s)`);\n\n let response = this.execute...
[ "0.62973607", "0.612066", "0.6097136", "0.6039832", "0.6031513", "0.60121006", "0.5974765", "0.5968472", "0.59203875", "0.59023386", "0.58915246", "0.5851161", "0.5851161", "0.5809159", "0.5717715", "0.5701446", "0.5691578", "0.56831324", "0.56794965", "0.56670356", "0.564971...
0.70765936
0
Reusable function for triggering the afterRender callback and event and setting the hasRendered flag.
function completeRender() { var afterRender = options.afterRender; if (afterRender) { afterRender.call(root, root); } // Always emit an afterRender event. root.trigger("afterRender", root); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleRendered_() {\n\t\tthis.isRendered_ = true;\n\t}", "afterRender() { }", "afterRender() { }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "function _tri...
[ "0.7617698", "0.7053709", "0.7053709", "0.70317197", "0.70317197", "0.70188683", "0.70141137", "0.6718378", "0.6693208", "0.66931146", "0.66931146", "0.66931146", "0.66931146", "0.66931146", "0.6517735", "0.6515757", "0.64877415", "0.6415443", "0.6410133", "0.64060634", "0.63...
0.71263653
1
Once the template is successfully fetched, use its contents to proceed. Context argument is first, since it is bound for partial application reasons.
function done(context, contents) { // Store the rendered template someplace so it can be re-assignable. var rendered; // This allows the `render` method to be asynchronous as well as `fetch`. var renderAsync = LayoutManager._makeAsync(options, function(rendered) { applyTemplate(rendered)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function done(context, template) {\n // Store the rendered template someplace so it can be re-assignable.\n var rendered;\n\n // Trigger this once the render method has completed.\n manager.callback = function(rendered) {\n // Clean up asynchronous manager properties.\n delete man...
[ "0.66350794", "0.6534518", "0.64956605", "0.64956605", "0.6075077", "0.5982786", "0.5911887", "0.5901511", "0.57783645", "0.57407045", "0.5705402", "0.5697883", "0.5689593", "0.56888086", "0.56888086", "0.56888086", "0.5686881", "0.56738544", "0.5667875", "0.5634416", "0.5625...
0.6913862
0
get last index of already existing inlines
function get_index_to_start_from() { var all_present_inlines = this.$('#inline_body tr').not(".form_error"); if (!all_present_inlines.length) return 0 var max_index = $(_.last(all_present_inlines)).attr("index"); return parseInt(max_ind...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLineNumberForIndex(index) {\n const code = this.tokens.code;\n while (this.lastIndex < index && this.lastIndex < code.length) {\n if (code[this.lastIndex] === \"\\n\") {\n this.lastLineNumber++;\n }\n this.lastIndex++;\n }\n return this.lastLineNumber;\n }", "getLineAfterVie...
[ "0.67318416", "0.6709722", "0.656244", "0.63970685", "0.63911545", "0.62337434", "0.62264335", "0.61955094", "0.61955094", "0.61955094", "0.61872673", "0.61872673", "0.61872673", "0.61872673", "0.61872673", "0.61872673", "0.61872673", "0.61872673", "0.61872673", "0.61872673", ...
0.6799933
0
shown if any inline could not be saved
function show_inline_error() { var err = {}; err[that.form.entity_name] = { __all__: ["Some " + that.form.inline.entity + " (in red below) could not be saved. To correct errors and try saving them again - go to list page and edit this " + that.form.entity_name] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static messageSaveError() {\n saveErrorMessage.style.display = 'block';\n }", "function update() {\n if (isEditorEmpty()) {\n show();\n } else {\n hide();\n }\n }", "function main_text_save_complete() {\n $(this).find('.changes-saver').hide();\n}", "function showInlineEr...
[ "0.63618153", "0.61497337", "0.6023601", "0.5879619", "0.58746266", "0.5824764", "0.58222973", "0.5760142", "0.57508904", "0.572002", "0.57144576", "0.5681899", "0.56489766", "0.5647264", "0.5611325", "0.557729", "0.55636346", "0.556059", "0.5550235", "0.55289143", "0.5523374...
0.71980315
0
shown if any bulk could not be saved
function show_bulk_error() { var err = {}; err[that.form.entity_name] = { __all__: ["Some " + that.form.entity_name + " (in red below) could not be saved. To correct errors and try saving them again - open a new add form"] }; that.form....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onSaveError()\n\t{\n\t\talert('Could not save field! Check console');\n\t\tconsole.warn('save error', this, arguments);\n\t\tthis.sidebar.layout.removeClass('saving');\n\t}", "onSaveFail () {\n this.props.setSaveDisabled(false)\n this.props.updateNoteStatus(false)\n }", "saveAddOneError(collect...
[ "0.64602846", "0.5989958", "0.5969507", "0.59617895", "0.5959724", "0.5959724", "0.594177", "0.58900034", "0.5880925", "0.58670956", "0.5856262", "0.5839987", "0.5828855", "0.57757723", "0.57564116", "0.5753056", "0.57494855", "0.5742958", "0.57426846", "0.57288647", "0.57001...
0.77799815
0
Saves the facebook tokens and channel links using the save_data callback passed into the constructor
saveData() { if (this.save_data && this.facebookApi) { const data = { appState: this.facebookApi.getAppState(), channelLinks: this.channelLinks, }; this.save_data(data, function(err) { if (err) console.log('Error saving facebot ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async setupFacebook() {\n try {\n // Try to load the saved data and login to facebook\n // using the saved credentials. Otherwise fallback\n // to reloggin in with the email and pass\n const data = await this.loadData();\n\n this.sendDebugMessage(\n ...
[ "0.66221315", "0.5765929", "0.5671601", "0.5454259", "0.5452968", "0.5437884", "0.543222", "0.54099196", "0.5405531", "0.54000324", "0.5392101", "0.53645736", "0.5352881", "0.52888197", "0.52122587", "0.51443136", "0.51306593", "0.51057243", "0.51054126", "0.5087988", "0.5079...
0.72880054
0
Creates the FB api using either saved tokens or username and password passed in as credentials
async createFBApi(credentials) { this.facebookApi = await Q.nfcall(facebook, credentials); this.sendDebugMessage('Logged into facebook'); this.facebookApi.setOptions({ logLevel: 'error', listenEvents: true, }); this.facebookApi.listen((err, fbmessage) =>...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createOnAuth(accessToken, refreshToken, profile, cb, oauthProviderName) {\n console.log(\"In createOnAuth\");\n var db = mysql.createConnection(conf.DB_OPTIONS);\n // todo: check email instead of or in addition to ID, in case someone tries to do BOTH FB and Goog auth.\n db.query(\"SELECT pro_id FROM p...
[ "0.5958118", "0.5845526", "0.5802396", "0.5710517", "0.5653914", "0.5623628", "0.5579286", "0.5570023", "0.5512946", "0.548329", "0.54800963", "0.54218453", "0.5419965", "0.5412944", "0.5410459", "0.53791356", "0.53347397", "0.5317902", "0.52964324", "0.52928674", "0.52875787...
0.63582987
0
loop that will continue to send the is typing indicator to a channel until we hear back they are not typing, or 10 minutes have past
typingLoop(link) { if ( !link.is_typing || Date.now() / 1000 - link.typing_start_time > 60 * 5 //if they were typing for more than 5 minutes lets assume we missed the typing end event, also mobile devices sometimes don't stay connected to send typing end if they nav away from app ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkTypingStatus() {\n if (!timerRunning) {\n timerRunning = true;\n timeout = setTimeout(() => {\n // isTyping = false;\n timerRunning = false;\n updateChatTyping();\n }, 10 * 1000);\n }\n}", "function autoCheckTyping() {\n checkIsTyping()...
[ "0.73069334", "0.72106695", "0.712527", "0.70855033", "0.69282794", "0.691171", "0.68707204", "0.68707204", "0.68707204", "0.68707204", "0.68707204", "0.68448776", "0.6803309", "0.6778261", "0.6706612", "0.6620344", "0.6587411", "0.6573313", "0.64523983", "0.64097404", "0.640...
0.77206993
0
Handles any facebook messages/events received, formats them and sends them through to the linked slack channels
handleFBNotification(fbmessage) { // Facebook typing notifications store the thread ID in a different // param than normal messages, so first find the threadID let threadID = undefined; if (fbmessage.type == 'message') threadID = fbmessage.threadID.toString(); if (fbm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "postSlackMessagesToFB(message) {\n const attachment = message.type === 'message' &&\n message.attachments &&\n message.attachments.length > 0\n ? message.attachments[0]\n : undefined;\n\n if (\n (this.isChatMessage(message) || attachment) &&\n ...
[ "0.6623696", "0.652809", "0.6416904", "0.6370207", "0.6347963", "0.6344461", "0.6287886", "0.6246564", "0.6191035", "0.6183714", "0.61032885", "0.60789883", "0.6070689", "0.60562944", "0.60533375", "0.6045451", "0.60355747", "0.5972937", "0.59457994", "0.59454536", "0.5918559...
0.6896832
0
Handles any facebook messages with attachments (stickers etc)
handleFBAttachments(fbmessage, link) { fbmessage.attachments.forEach(attachment => { if (attachment.url === undefined) attachment.url = attachment.facebookUrl; if (attachment.url && attachment.url.startsWith('/')) attachment.url = 'https://www.facebook.co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async handleAttachments () {\n\t\t// not yet supported\n\t}", "handleFBAudioMessages(attachment, link) {\n this.postMessage(\n link.slack_channel,\n `<${attachment.url}|Download Voice Message>`,\n {\n username: link.fb_name,\n icon_url: link.i...
[ "0.69898283", "0.6704747", "0.66736686", "0.6662116", "0.6561342", "0.6519081", "0.6477506", "0.6471006", "0.6409863", "0.63774246", "0.63417464", "0.6324648", "0.62534934", "0.61978", "0.6176167", "0.61745375", "0.61619645", "0.6112081", "0.6054353", "0.5997567", "0.5990709"...
0.7813349
0
Posts an image to the slack channel (in link) as the facebook sender
handleFBImageMessages(imgurl, link) { this.postMessage(link.slack_channel, '', { username: link.fb_name, icon_url: link.icon, attachments: [ { fallback: imgurl, image_url: imgurl, }, ], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendImageMessage(sender) {\n var messageData = {\n \"attachment\": {\n \"type\": \"image\",\n \"payload\": {\n \"url\": infoUsuario.profile_pic\n }\n }\n }\n sendMessage(sender, messageData);\n}", "postSlackMessagesToFB(message) {\n ...
[ "0.7536882", "0.71399", "0.71292496", "0.70284593", "0.6897181", "0.66484255", "0.66474277", "0.66204906", "0.6574492", "0.6526243", "0.64892477", "0.64058316", "0.64058316", "0.6357074", "0.6312503", "0.6268161", "0.6268161", "0.6245246", "0.61893773", "0.61670333", "0.61621...
0.7956438
0
Posts an audio message link to the slack channel (in link) as the facebook sender
handleFBAudioMessages(attachment, link) { this.postMessage( link.slack_channel, `<${attachment.url}|Download Voice Message>`, { username: link.fb_name, icon_url: link.icon, } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "postSlackMessagesToFB(message) {\n const attachment = message.type === 'message' &&\n message.attachments &&\n message.attachments.length > 0\n ? message.attachments[0]\n : undefined;\n\n if (\n (this.isChatMessage(message) || attachment) &&\n ...
[ "0.67380965", "0.6439163", "0.6413004", "0.6375305", "0.6369383", "0.62791455", "0.6274584", "0.6219876", "0.620232", "0.61976445", "0.6184365", "0.61834353", "0.6168593", "0.6166797", "0.6163472", "0.6150902", "0.61266065", "0.61266065", "0.60834783", "0.60216177", "0.600934...
0.7865042
0
Posts a video link and thumbnail to the slack channel (in link) as the facebook sender
handleFBVideoMessages(attachment, link) { this.postMessage( link.slack_channel, `<${attachment.url}|Download Video (${attachment.duration} seconds)>`, { username: link.fb_name, icon_url: link.icon, // Use the preview image as th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleFBAttachments(fbmessage, link) {\n fbmessage.attachments.forEach(attachment => {\n if (attachment.url === undefined)\n attachment.url = attachment.facebookUrl;\n\n if (attachment.url && attachment.url.startsWith('/'))\n attachment.url = 'https://www....
[ "0.72014284", "0.7185969", "0.664214", "0.66017604", "0.6472053", "0.6320033", "0.6307959", "0.6306709", "0.61875474", "0.6179889", "0.6124064", "0.6117582", "0.6115336", "0.6045716", "0.6016187", "0.591479", "0.5914764", "0.58818483", "0.5867928", "0.5867928", "0.58475965", ...
0.7638374
0
Handles forwarding any slack messages to facebook users
postSlackMessagesToFB(message) { const attachment = message.type === 'message' && message.attachments && message.attachments.length > 0 ? message.attachments[0] : undefined; if ( (this.isChatMessage(message) || attachment) && !this...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleFBNotification(fbmessage) {\n // Facebook typing notifications store the thread ID in a different\n // param than normal messages, so first find the threadID\n let threadID = undefined;\n if (fbmessage.type == 'message')\n threadID = fbmessage.threadID.toString();\n ...
[ "0.6715883", "0.620715", "0.619526", "0.61389446", "0.612587", "0.6115717", "0.6100464", "0.60499716", "0.5940349", "0.59127885", "0.58211154", "0.574967", "0.5741672", "0.5737729", "0.5725809", "0.5711435", "0.5710078", "0.5701228", "0.56813824", "0.5664513", "0.5661955", ...
0.66577697
1
Unlinks the channel from any facebook friends
respondToUnlinkCommands(message) { const previousSize = this.channelLinks.length; this.channelLinks = this.channelLinks.filter( link => link.slack_channel !== message.channel ); let response; if (previousSize === this.channelLinks.length) { response = 'Th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeFacebookAccountLink() {\n\t\t\t\tinit();\n\t\t\t\tvar currCookie = cookie.get(s.cookie.userId);\n\t\t\t\tif (currCookie) {\n\t\t\t\t\tvar cookieData = w.JSON.parse(currCookie);\n\t\t\t\t}\n\t\t\t\tif (authcode.get() && cookieData && cookieData.identityType == \"FACEBOOK\") {\n\t\t\t\t\tpubsub.publis...
[ "0.68546575", "0.5987475", "0.5982912", "0.5848235", "0.5839846", "0.57955736", "0.578059", "0.57687694", "0.5747853", "0.5728454", "0.5713957", "0.57137966", "0.5629905", "0.55989575", "0.5569411", "0.5558316", "0.5558212", "0.55412006", "0.5539059", "0.55179375", "0.5513891...
0.66896164
1
Scans all slack messages, and if they appear to be a facebot command, gets facebot to run the command
dispatchBotCommands(message) { if ( this.isChatMessage(message) && !this.isMessageFromFacebot(message) && !this.isBotMessage(message) ) { let command = ''; const mention = `<@${this.user.id}>`; if (message.text.startsWith(mention)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkBotCommands( client, channel, tags, message ) {\n\tlet baseCommandString = message.substr(1).split(' ')[0];\n\n\tif ( baseCommandString === displayAllVideo ){\n\n\t\treturn manageDisplayAllVideo(client, channel, tags);\n\n\t} if ( baseCommandString === displayAllSound ){\n\n\t\treturn manageDisplayAl...
[ "0.6059844", "0.592755", "0.5770144", "0.574121", "0.5703021", "0.5697516", "0.56639606", "0.5653619", "0.564869", "0.562623", "0.5556814", "0.5528657", "0.5501698", "0.55009806", "0.5493459", "0.54781693", "0.54600316", "0.5457732", "0.54534197", "0.5453312", "0.54516464", ...
0.6354687
0
Posts a list of the currently linked chats, to the channel the message came from
async postListOfLinkedChannels(message) { if (this.channelLinks.length > 0) { const { groups } = await this.getGroups(); // build a description of each link const linkDescriptions = this.channelLinks .map(link => { const group = groups.fin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sendMessage(){\n\n let subscriptions = App.cable.subscriptions.subscriptions\n let index;\n for (let i = 0; i < subscriptions.length; i++){\n let identifier = JSON.parse(subscriptions[i].identifier)\n if (identifier.channel === \"ChatChannel\"){\n index = i\n break\n }\n }\...
[ "0.6666695", "0.63668925", "0.6182386", "0.6086568", "0.60144544", "0.5958697", "0.5936649", "0.5904485", "0.5889756", "0.5866527", "0.5836433", "0.5812142", "0.5801516", "0.57611763", "0.57318187", "0.57106423", "0.5674952", "0.56721663", "0.56643593", "0.56361014", "0.56345...
0.70897615
0
Posts a message when facebot is added to any groups, to inform the user how to connect the channel to a facebook friend
async postGroupJoinedMessage(message) { if (message.type == 'group_joined') { const allowedUsers = [this.user.id, this.authorised_user.id]; const isTruelyPrivate = await this.groupUsersOnlyContains( message.channel.id, allowedUsers ); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function regChatInfo(message) {\n if (\n (message.chat.type === 'group') && // make sure the event originated from a group\n (message.new_chat_participant.id === telegram.getId()) // the event is about the default bot\n ) {\n // register the chat group info in the database\n // pa...
[ "0.66656864", "0.64800584", "0.64644945", "0.6427247", "0.63718086", "0.6369681", "0.6314595", "0.6281764", "0.62495947", "0.62254274", "0.62209916", "0.62139785", "0.6199772", "0.6175002", "0.61666113", "0.6117886", "0.6053342", "0.60312206", "0.6017", "0.6016593", "0.593756...
0.740574
0
Sends a (slack) direct message to the authorised user if debug messages are enabled
sendDebugMessage(message) { if (this.settings.debug_messages) { this.postMessageToUser(this.settings.authorised_username, message, { as_user: true, }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function direct_message (data) {\n let name = data.source.name\n let screenName = data.source.screen_name\n \n // DM User\n\n console.log('Direct Messaged by: ' + name + ' @' + screenName)\n}", "async sendSlackMessage() {\n if (!this.skipSlackMessage) {\n let prefix = '';\n if (this.dryRun) pre...
[ "0.62778383", "0.6218218", "0.5677757", "0.5677757", "0.56668043", "0.56551135", "0.5591045", "0.5591045", "0.5591045", "0.5591045", "0.5591045", "0.5591045", "0.5591045", "0.5591045", "0.5591045", "0.5591045", "0.5591045", "0.5591045", "0.5591045", "0.5591045", "0.5591045", ...
0.74901885
0
Retruns true if the channel with the id only contains the users in userids users: array of userids
async groupUsersOnlyContains(channelid, userids) { try { groupInfo = await this._api('groups.info', { channel: channelid }); return _.isEmpty(_.difference(groupInfo.group.members, userids)); } catch (err) { throw new Error('This is a not group channel.'); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkUserDMChannel(userid)\n{\n for(let dm of imList)\n {\n if(dm.id===userid)\n {\n return true;\n }\n }\n return false;\n}", "filterUsersFromIds(idsArray) {\n return this.users.filter((item) => { return idsArray.includes(item.id) })\n }", "function isIdInUse(id, idArray) {\n ...
[ "0.73757565", "0.66768193", "0.6507739", "0.6443747", "0.6350552", "0.6174044", "0.6157804", "0.60891426", "0.60137975", "0.59869266", "0.5968787", "0.5945493", "0.5923353", "0.58858585", "0.5873223", "0.58714175", "0.5829926", "0.58249295", "0.5814131", "0.5779166", "0.57606...
0.7434259
0
1.3 solve feasible junction envelopes
searchJunctionEnvelopes () { this.sculpture.setSleeveRadii(); this.axis.sample(this.n); // force PTF to avoid referenced frame rotations this.sculpture.layout(this.unit, {n:this.n,scale:1,torsion:0},true); return this.sculpture.buildJoints(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "computeJunctionEnvelopeFeasibility () {\n for (let i = 0; i < this.n - 1; i ++) {\n let u1 = this.sculpture.units.children[i];\n let u2 = this.sculpture.units.children[i+1];\n if (u1.isEmpty || u2.isEmpty) {\n continue;\n }\n this.collide...
[ "0.7375081", "0.5556376", "0.5452475", "0.54504627", "0.54310226", "0.5274187", "0.52703553", "0.52576977", "0.5211646", "0.51761454", "0.5170617", "0.5160777", "0.5117613", "0.5089191", "0.5075506", "0.5074747", "0.5073877", "0.50690156", "0.5061199", "0.50611883", "0.502526...
0.59967613
1
1.4 initialize unit envelopes as cylinders each cylinders radius is the minimum length of the longest skeleton of a unit
initializeUnitEnvelopes () { // initialize a sculpture with empty units let u = new Unit(); this.sculpture = new KineticSculpture(this.axis); this.sculpture.unit = u; this.axis.sample(this.n); this.sculpture.layout(this.axis.samplingPoints); // get all cylinder ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function example005 () {\n var cy = [];\n for (var i = 0; i <= 5; i++) {\n cy[i] = translate([sin(360 * i / 6) * 80, cos(360 * i / 6) * 80, 0], cylinder({h: 200, r: 10}));\n }\n return translate([0, 0, -120],\n union(\n difference(\n cylinder({h: 50, r: 100}),\n translate([0, 0, 10], c...
[ "0.63106155", "0.627844", "0.6186703", "0.6045943", "0.597835", "0.59672904", "0.5941199", "0.59227765", "0.58957446", "0.5859046", "0.58509445", "0.5803835", "0.57365406", "0.5674161", "0.5663324", "0.5642631", "0.56367904", "0.56210166", "0.5588893", "0.5582371", "0.5546146...
0.66763896
0
2.3 search junction phases 2.4 search skeleton envelopes 2.5 search skeletons 3. Feasibility section find a feasible junction envelope first, other wise E_shape cannot be computed
computeJunctionEnvelopeFeasibility () { for (let i = 0; i < this.n - 1; i ++) { let u1 = this.sculpture.units.children[i]; let u2 = this.sculpture.units.children[i+1]; if (u1.isEmpty || u2.isEmpty) { continue; } this.collideJunctions(u1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "searchJunctionEnvelopes () {\n this.sculpture.setSleeveRadii();\n this.axis.sample(this.n);\n // force PTF to avoid referenced frame rotations\n this.sculpture.layout(this.unit, {n:this.n,scale:1,torsion:0},true);\n return this.sculpture.buildJoints();\n }", "findSecondarySt...
[ "0.65456337", "0.61653864", "0.60805345", "0.5727573", "0.5647194", "0.55430317", "0.55161154", "0.5480992", "0.54261625", "0.53981525", "0.5377911", "0.5374584", "0.53657395", "0.5347119", "0.5305223", "0.5270988", "0.5212443", "0.52100307", "0.5142789", "0.51301354", "0.510...
0.734449
0
build just one skeleton based on N sketches
initializeSkeleton () { // 1. generate normal planes of the axis this.axis.samplingTangents(this.n); // 2. get intersecting points of the normal planes with the jth curve of all N sketches let points = []; for (let i=0;i<this.n;i++) { // get all intersecting points o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buildSkeletons () {\n for (let sketch of this.sketches) {\n let tempAxis = this.axis.clone();\n let sculpture = new KineticSculpture(tempAxis,sketch);\n sculpture.buildSkeleton(10,this.n);\n this.sculptures.push(sculpture);\n }\n }", "loadSkeleton(jsnc...
[ "0.7422286", "0.6498206", "0.6017908", "0.5986853", "0.5986853", "0.5986853", "0.5986853", "0.59721327", "0.59571004", "0.5950204", "0.5944978", "0.5944978", "0.5944978", "0.5944978", "0.5944978", "0.5944978", "0.5942387", "0.59399974", "0.59061754", "0.5895396", "0.589059", ...
0.6651899
1
build N skeletons for N sketches
buildSkeletons () { for (let sketch of this.sketches) { let tempAxis = this.axis.clone(); let sculpture = new KineticSculpture(tempAxis,sketch); sculpture.buildSkeleton(10,this.n); this.sculptures.push(sculpture); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setuploop() {\n if (firstflag){\n for (var i = 0; i < 800; i++) {\n stars[i] = new outerspace()\n }\n }\n }", "function genPlatforms() {\n var platformCount = vars.worldSize * 0.01; // about 500 for the 50k world size\n console.log('platforms: '+pl...
[ "0.5743653", "0.5743546", "0.56697273", "0.55592626", "0.55455774", "0.5535016", "0.5533333", "0.5528759", "0.54866236", "0.5455682", "0.541352", "0.5399406", "0.53788394", "0.5359795", "0.5334439", "0.5326024", "0.53125376", "0.5304113", "0.52759844", "0.5275866", "0.5270101...
0.7656355
0
The state loader is builded as a method that will handle : I The lazy loading of the API requests. II The cyclcling through API fetched posts. III The resulting compoponent's state assignation.
async stateLoader() { if ( // If the post pool is empty, or if theres no more post to render, minus the lazy offset trigger, this.state.posts === null || // Assign the correct value to the offset parameter, then fetch new posts. this.state.index >= this.state.posts.length - 1 -...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "[FETCH_START](state) {\n state.loading = true;\n }", "async fetchInitialData() {\n try {\n let tasks = await Helpers.fetch('/api/tasks', {\n method: 'GET'\n });\n this.setState({tasks: tasks});\n\n let tags = await Helpers.fetch('/api/tags', {...
[ "0.67376316", "0.6472712", "0.63694835", "0.6218388", "0.6105076", "0.6080109", "0.60037017", "0.5920824", "0.5903898", "0.589672", "0.5894762", "0.58872175", "0.58849084", "0.5876454", "0.5876454", "0.58554584", "0.58454794", "0.5784458", "0.5748714", "0.573049", "0.57230824...
0.6912567
0
this is used to deactivate the modal blanket, if the modal setting is defined as true.
function _hideBlanket() { if (settings.modal == true) { $("#pageslide-blanket").animate({ opacity: '0.0' }, 'fast', 'visible', function () { $(this).toggle(); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disablePopUp() {\n setModalValue(!showModal); // toggling value of showModal and setting it in the state\n }", "function modalHidden(){\n\t\trestoreTabindex();\n\t\ttdc.Grd.Modal.isVisible=false;\n\t}", "function onHiddenBsModal() {\n isModalInTransitionToHide = false;\n isModalVisib...
[ "0.7394642", "0.7258216", "0.7206462", "0.7204395", "0.7100157", "0.69984883", "0.69984883", "0.6928772", "0.6920767", "0.6913348", "0.6913348", "0.6904263", "0.6867137", "0.68068266", "0.6799799", "0.6769813", "0.6766921", "0.67570025", "0.67570025", "0.6749888", "0.67446285...
0.7293137
1
add message to message array
message(type, message) { this.array.push({ type, message }) // add element to array this.array[this.messageCount].dom = this.createAlert(type, message); // cumulative message execution function this.messageCount++; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addmessagestoarray(data) {\n if (filteredmessages.length !== 0) {\n messagestore = filteredmessages\n }\n messagestore.push(data)\n setchats([messagestore])\n scrollmessages();\n }", "_newMessage(message) {\n this.messages.push(message);\n t...
[ "0.7586826", "0.7116451", "0.70833945", "0.6999007", "0.6836093", "0.6836093", "0.6790874", "0.6785247", "0.6768364", "0.67232054", "0.6650138", "0.6643322", "0.66220284", "0.6570389", "0.6558503", "0.6529322", "0.6528385", "0.65087223", "0.647787", "0.64602524", "0.6457183",...
0.7160757
1