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
Prints IfStatement, prints test, consequent, and alternate.
function IfStatement(node, print) { this.keyword("if"); this.push("("); print.plain(node.test); this.push(")"); this.space(); print.indentOnComments(node.consequent); if (node.alternate) { if (this.isLast("}")) this.space(); this.push("else "); print.indentOnComments(node.alternate); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function IfStatement(node, print) {\n\t this.keyword(\"if\");\n\t this.push(\"(\");\n\t print.plain(node.test);\n\t this.push(\")\");\n\t this.space();\n\n\t print.indentOnComments(node.consequent);\n\n\t if (node.alternate) {\n\t if (this.isLast(\"}\")) this.space();\n\t this.push(\"else \");\n\t ...
[ "0.67851615", "0.67851615", "0.6027429", "0.5965233", "0.5836028", "0.5833135", "0.5833135", "0.5803964", "0.574688", "0.574688", "0.574688", "0.57304645", "0.57161206", "0.5578325", "0.551984", "0.54835385", "0.5429616", "0.5407636", "0.5371538", "0.53346986", "0.5330639", ...
0.6872054
0
Prints WhileStatement, prints test and body.
function WhileStatement(node, print) { this.keyword("while"); this.push("("); print.plain(node.test); this.push(")"); print.block(node.body); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function WhileStatement(node, print) {\n\t this.keyword(\"while\");\n\t this.push(\"(\");\n\t print.plain(node.test);\n\t this.push(\")\");\n\t print.block(node.body);\n\t}", "function WhileStatement(node, print) {\n\t this.keyword(\"while\");\n\t this.push(\"(\");\n\t print.plain(node.test);\n\t this.p...
[ "0.73449045", "0.73449045", "0.66995883", "0.6549304", "0.6549304", "0.64084303", "0.6230721", "0.5922045", "0.5908004", "0.58422047", "0.5647961", "0.5580483", "0.54483104", "0.5339028", "0.52746475", "0.5252742", "0.52289736", "0.5224026", "0.51866585", "0.5165222", "0.5146...
0.7426047
0
Prints DoWhileStatement, prints body and test.
function DoWhileStatement(node, print) { this.push("do "); print.plain(node.body); this.space(); this.keyword("while"); this.push("("); print.plain(node.test); this.push(");"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DoWhileStatement(node, print) {\n\t this.push(\"do \");\n\t print.plain(node.body);\n\t this.space();\n\t this.keyword(\"while\");\n\t this.push(\"(\");\n\t print.plain(node.test);\n\t this.push(\");\");\n\t}", "function DoWhileStatement(node, print) {\n\t this.push(\"do \");\n\t print.plain(no...
[ "0.766542", "0.766542", "0.6704038", "0.6480834", "0.6446341", "0.6401947", "0.6401947", "0.639344", "0.6365147", "0.6365147", "0.6365147", "0.60611933", "0.5605696", "0.5605696", "0.54972917", "0.54316837", "0.54249424", "0.5424665", "0.52399856", "0.5218179", "0.5142441", ...
0.774458
0
Prints LabeledStatement, prints label and body.
function LabeledStatement(node, print) { print.plain(node.label); this.push(": "); print.plain(node.body); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LabeledStatement(node, print) {\n\t print.plain(node.label);\n\t this.push(\": \");\n\t print.plain(node.body);\n\t}", "function LabeledStatement(node, print) {\n\t print.plain(node.label);\n\t this.push(\": \");\n\t print.plain(node.body);\n\t}", "function parse_PrintStatement() {\n tree.add...
[ "0.779981", "0.779981", "0.5902973", "0.558055", "0.5437713", "0.5437713", "0.5437713", "0.54025936", "0.53154415", "0.5304949", "0.52728623", "0.5243986", "0.51469755", "0.50615263", "0.49943024", "0.4854093", "0.4833504", "0.48327005", "0.48296905", "0.47483197", "0.4740772...
0.78314203
0
Prints CatchClause, prints param and body.
function CatchClause(node, print) { this.keyword("catch"); this.push("("); print.plain(node.param); this.push(") "); print.plain(node.body); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CatchClause(node, print) {\n\t this.keyword(\"catch\");\n\t this.push(\"(\");\n\t print.plain(node.param);\n\t this.push(\") \");\n\t print.plain(node.body);\n\t}", "function CatchClause(node, print) {\n\t this.keyword(\"catch\");\n\t this.push(\"(\");\n\t print.plain(node.param);\n\t this.push...
[ "0.7389229", "0.7389229", "0.53301656", "0.5251728", "0.525048", "0.5191504", "0.5191504", "0.5191504", "0.5191504", "0.51861304", "0.5181957", "0.5174932", "0.5174932", "0.5174932", "0.51567566", "0.51096195", "0.51071006", "0.50595975", "0.5041075", "0.5041075", "0.5041075"...
0.7464497
0
Prints SwitchStatement, prints discriminant and cases.
function SwitchStatement(node, print) { this.keyword("switch"); this.push("("); print.plain(node.discriminant); this.push(")"); this.space(); this.push("{"); print.sequence(node.cases, { indent: true, addNewlines: function addNewlines(leading, cas) { if (!leading && node.cases[node.cases.le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SwitchStatement(node, print) {\n\t this.keyword(\"switch\");\n\t this.push(\"(\");\n\t print.plain(node.discriminant);\n\t this.push(\")\");\n\t this.space();\n\t this.push(\"{\");\n\n\t print.sequence(node.cases, {\n\t indent: true,\n\t addNewlines: function addNewlines(leading, cas) {\n\t ...
[ "0.7377573", "0.7377573", "0.6883404", "0.6854019", "0.6854019", "0.5783895", "0.5781856", "0.55737007", "0.5540836", "0.5483094", "0.5483094", "0.5483094", "0.5483094", "0.54824513", "0.54824513", "0.54824513", "0.54824513", "0.54824513", "0.54746693", "0.54713106", "0.54275...
0.7378168
0
Prints SwitchCase, prints test and consequent.
function SwitchCase(node, print) { if (node.test) { this.push("case "); print.plain(node.test); this.push(":"); } else { this.push("default:"); } if (node.consequent.length) { this.newline(); print.sequence(node.consequent, { indent: true }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SwitchCase(node, print) {\n\t if (node.test) {\n\t this.push(\"case \");\n\t print.plain(node.test);\n\t this.push(\":\");\n\t } else {\n\t this.push(\"default:\");\n\t }\n\n\t if (node.consequent.length) {\n\t this.newline();\n\t print.sequence(node.consequent, { indent: true });\n\...
[ "0.77013654", "0.77013654", "0.6304653", "0.6125977", "0.6097045", "0.6097045", "0.5931975", "0.5931975", "0.5931975", "0.5931975", "0.5794292", "0.5794292", "0.57901996", "0.5789467", "0.57888466", "0.5779527", "0.5768278", "0.5768278", "0.5768278", "0.5768278", "0.5768278",...
0.7714438
0
Prints VariableDeclarator, handles id, id.typeAnnotation, and init.
function VariableDeclarator(node, print) { print.plain(node.id); print.plain(node.id.typeAnnotation); if (node.init) { this.space(); this.push("="); this.space(); print.plain(node.init); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function VariableDeclarator(node, print) {\n\t print.plain(node.id);\n\t print.plain(node.id.typeAnnotation);\n\t if (node.init) {\n\t this.space();\n\t this.push(\"=\");\n\t this.space();\n\t print.plain(node.init);\n\t }\n\t}", "function VariableDeclarator(node, print) {\n\t print.plain(node.i...
[ "0.7903393", "0.7903393", "0.7515859", "0.7515859", "0.7399908", "0.67977166", "0.67254764", "0.67254764", "0.65353703", "0.65353703", "0.65343255", "0.61484945", "0.5900561", "0.5847676", "0.561982", "0.5542881", "0.5528477", "0.5432888", "0.53747755", "0.5344477", "0.533948...
0.79979306
0
Prints TemplateLiteral, prints quasis, and expressions.
function TemplateLiteral(node, print) { this.push("`"); var quasis = node.quasis; var len = quasis.length; for (var i = 0; i < len; i++) { print.plain(quasis[i]); if (i + 1 < len) { this.push("${ "); print.plain(node.expressions[i]); this.push(" }"); } } this._push("`"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TemplateLiteral(node, print) {\n\t this.push(\"`\");\n\n\t var quasis = node.quasis;\n\t var len = quasis.length;\n\n\t for (var i = 0; i < len; i++) {\n\t print.plain(quasis[i]);\n\n\t if (i + 1 < len) {\n\t this.push(\"${ \");\n\t print.plain(node.expressions[i]);\n\t this.push(...
[ "0.76591444", "0.76591444", "0.57526654", "0.56728894", "0.5635762", "0.54695183", "0.5435848", "0.5431737", "0.5423158", "0.54186445", "0.54019886", "0.5360863", "0.53510433", "0.5347901", "0.5333049", "0.5333049", "0.5319305", "0.53148675", "0.53090525", "0.52897626", "0.52...
0.7709564
0
Prints ObjectExpression, prints properties.
function ObjectExpression(node, print) { var props = node.properties; this.push("{"); print.printInnerComments(); if (props.length) { this.space(); print.list(props, { indent: true }); this.space(); } this.push("}"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ObjectExpression(node, print) {\n\t var props = node.properties;\n\n\t this.push(\"{\");\n\t print.printInnerComments();\n\n\t if (props.length) {\n\t this.space();\n\t print.list(props, { indent: true });\n\t this.space();\n\t }\n\n\t this.push(\"}\");\n\t}", "function ObjectExpression(n...
[ "0.7614452", "0.7614452", "0.67519146", "0.6733401", "0.6523707", "0.6511078", "0.64682645", "0.6456508", "0.6452972", "0.64483726", "0.64369076", "0.63998467", "0.63944113", "0.63943946", "0.63943946", "0.6380721", "0.63736", "0.6351154", "0.6331956", "0.62615234", "0.623681...
0.7735837
0
Test if YieldExpression needs parentheses.
function YieldExpression(node, parent) { return t.isBinary(parent) || t.isUnaryLike(parent) || t.isCallExpression(parent) || t.isMemberExpression(parent) || t.isNewExpression(parent) || t.isConditionalExpression(parent) || t.isYieldExpression(parent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "statementNeedsParens(): boolean {\n return this.expression.statementShouldAddParens();\n }", "function YieldExpression(node, parent) {\n\t return t.isBinary(parent) || t.isUnaryLike(parent) || t.isCallExpression(parent) || t.isMemberExpression(parent) || t.isNewExpression(parent) || t.isConditionalExpressio...
[ "0.69355136", "0.6430042", "0.6430042", "0.62891793", "0.6273383", "0.6168618", "0.6168618", "0.6168618", "0.6168618", "0.6166156", "0.6161822", "0.61452067", "0.61178154", "0.61178154", "0.6048772", "0.60371387", "0.6022308", "0.5994362", "0.5984699", "0.59500104", "0.589290...
0.64376646
1
Test if ClassExpression needs parentheses.
function ClassExpression(node, parent) { return t.isExpressionStatement(parent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ClassExpression(node, parent) {\n\t return t.isExpressionStatement(parent);\n\t}", "function ClassExpression(node, parent) {\n\t return t.isExpressionStatement(parent);\n\t}", "function foundNestedPseudoClass() {\n var openParen = 0;\n for (var i = pos + 1; i < source_text.length; i++)...
[ "0.6910815", "0.6910815", "0.5755405", "0.57390684", "0.5638566", "0.5638566", "0.5589", "0.55507535", "0.55334085", "0.553262", "0.552582", "0.552582", "0.552088", "0.552088", "0.552088", "0.5502032", "0.5494946", "0.54880935", "0.54869246", "0.54869246", "0.54869246", "0....
0.693307
0
push a default parameter definition
function pushDefNode(left, right, i) { var defNode; if (exceedsLastNonDefault(i) || t.isPattern(left) || file.transformers["es6.spec.blockScoping"].canTransform()) { defNode = util.template("default-parameter", { VARIABLE_NAME: left, DEFAULT_VALUE: right, ARGUMENT_KEY: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addParameter(name, defaultValue) {\n var self = this;\n self.setters[name] = function (x) {\n if (typeof x !== 'undefined') {\n self.parameters[name] = x;\n } else {\n self.parameters[name] = defaultValue;\n }\n return this; // the actual object!\n ...
[ "0.69423187", "0.6930162", "0.6930162", "0.68794715", "0.68794715", "0.6587676", "0.6326956", "0.6287285", "0.61977184", "0.6195188", "0.61616486", "0.60976684", "0.6091485", "0.60609543", "0.5917933", "0.5917933", "0.59085625", "0.5895368", "0.58944654", "0.58477664", "0.584...
0.69341636
1
Given a Babel NodePath, return an asttypes NodePath that includes full ancestry information (up to and including the Program node). This is complicated by having to include intermediate objects like blockStatement.body arrays, in addition to Node objects.
function convertNodePath(path) { var programNode; var keysAlongPath = []; while (path) { var pp = path.parentPath; var parentNode = pp && pp.node; if (parentNode) { keysAlongPath.push(path.key); if (parentNode !== path.container) { var found = Object.keys(parentNode).some(functio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertNodePath(path) {\n\t var programNode;\n\t var keysAlongPath = [];\n\n\t while (path) {\n\t var pp = path.parentPath;\n\t var parentNode = pp && pp.node;\n\t if (parentNode) {\n\t keysAlongPath.push(path.key);\n\n\t if (parentNode !== path.container) {\n\t var found = Ob...
[ "0.62922114", "0.62922114", "0.5015347", "0.50080204", "0.50080204", "0.50080204", "0.50080204", "0.50080204", "0.4985417", "0.48795277", "0.48226827", "0.4805457", "0.47798622", "0.47690558", "0.47332942", "0.4728938", "0.459324", "0.45641544", "0.45567983", "0.45567983", "0...
0.6427387
0
Call the provided `callback` with the `NodePath`s of all the parents. When the `callback` returns a truthy value, we return that node path.
function findParent(callback) { var path = this; while (path = path.parentPath) { if (callback(path)) return path; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findParent(callback) {\n\t var path = this;\n\t while (path = path.parentPath) {\n\t if (callback(path)) return path;\n\t }\n\t return null;\n\t}", "function findParent(callback) {\n\t var path = this;\n\t while (path = path.parentPath) {\n\t if (callback(path)) return path;\n\t }\n\t retu...
[ "0.6742948", "0.6742948", "0.6742948", "0.6742948", "0.6742948", "0.6002058", "0.5983866", "0.5983866", "0.5970971", "0.59614575", "0.59614575", "0.5651372", "0.5498873", "0.54103255", "0.52712476", "0.52425045", "0.5231339", "0.5150662", "0.5053728", "0.50447744", "0.5022627...
0.6777651
0
Build an array of node paths containing the entire ancestry of the current node path. NOTE: The current node path is included in this.
function getAncestry() { var path = this; var paths = []; do { paths.push(path); } while (path = path.parentPath); return paths; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAncestry() {\n\t var path = this;\n\t var paths = [];\n\t do {\n\t paths.push(path);\n\t } while (path = path.parentPath);\n\t return paths;\n\t}", "function getAncestry() {\n\t var path = this;\n\t var paths = [];\n\t do {\n\t paths.push(path);\n\t } while (path = path.parentPath);\n\...
[ "0.7409314", "0.7409314", "0.7409314", "0.7409314", "0.7409314", "0.60374284", "0.5933847", "0.5896089", "0.58768076", "0.58259416", "0.5819557", "0.5785537", "0.57693815", "0.5766716", "0.5713604", "0.5703597", "0.57022464", "0.56768316", "0.56553584", "0.5631033", "0.558564...
0.7428759
0
Give node `comments` of the specified `type`.
function addComments(type, comments) { if (!comments) return; var node = this.node; if (!node) return; var key = type + "Comments"; if (node[key]) { node[key] = node[key].concat(comments); } else { node[key] = comments; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addComments(type, comments) {\n\t if (!comments) return;\n\n\t var node = this.node;\n\t if (!node) return;\n\n\t var key = type + \"Comments\";\n\n\t if (node[key]) {\n\t node[key] = node[key].concat(comments);\n\t } else {\n\t node[key] = comments;\n\t }\n\t}", "function addComments(type,...
[ "0.8280545", "0.8280545", "0.8280545", "0.8068292", "0.8068292", "0.6670248", "0.65866524", "0.65866524", "0.6331389", "0.60866463", "0.5566475", "0.5499729", "0.5426212", "0.5424658", "0.5415617", "0.5415617", "0.5415617", "0.5415617", "0.53864056", "0.5370945", "0.52693635"...
0.82897884
0
Adds given key to the list of keys to be skipped.
function skipKey(key) { this.skipKeys[key] = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function skipKey(key) {\n\t this.skipKeys[key] = true;\n\t}", "function skipKey(key) {\n\t this.skipKeys[key] = true;\n\t}", "function skip(target, propertyKey) {\n if (arguments.length === 1) {\n target[onlySymbol] = true;\n }\n else {\n target[propertyKey][skipSymbol] = true;\n }\...
[ "0.8117308", "0.8117308", "0.620631", "0.5718664", "0.5718664", "0.56325865", "0.56204057", "0.54995686", "0.52593064", "0.5211922", "0.520664", "0.5195075", "0.51916325", "0.5125644", "0.5103856", "0.51025414", "0.5088228", "0.5050812", "0.49964905", "0.49964905", "0.4989519...
0.81502795
0
Check whether the path node `key` strict equals `value`.
function equals(key, value) { return this.node[key] === value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function equals(key, value) {\n\t return this.node[key] === value;\n\t}", "function equals(key, value) {\n\t return this.node[key] === value;\n\t}", "function equals(key, value) {\n\t return this.node[key] === value;\n\t}", "function equals(key, value) /*: boolean*/ {\n\t return this.node[key] === value;...
[ "0.72273666", "0.72273666", "0.72273666", "0.7088066", "0.7088066", "0.5552014", "0.5525059", "0.5488657", "0.54537785", "0.54537785", "0.5439398", "0.54065496", "0.53995603", "0.5383809", "0.5357092", "0.53347224", "0.53019345", "0.53019345", "0.5289709", "0.52795225", "0.52...
0.7318035
0
This checks whether or not we're in one of the following positions: for (KEY in right); for (KEY;;); This is because these spots allow VariableDeclarations AND normal expressions so we need to tell the path replacement that it's ok to replace this with an expression.
function canHaveVariableDeclarationOrExpression() { return (this.key === "init" || this.key === "left") && this.parentPath.isFor(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function canHaveVariableDeclarationOrExpression() {\n\t return (this.key === \"init\" || this.key === \"left\") && this.parentPath.isFor();\n\t}", "function canHaveVariableDeclarationOrExpression() {\n\t return (this.key === \"init\" || this.key === \"left\") && this.parentPath.isFor();\n\t}", "function canH...
[ "0.58627516", "0.58627516", "0.58627516", "0.58627516", "0.58627516", "0.52379197", "0.50443596", "0.5028477", "0.49794272", "0.49747503", "0.49747503", "0.48686484", "0.48686484", "0.4839177", "0.4815636", "0.4815636", "0.4815636", "0.48111996", "0.47606224", "0.4756276", "0...
0.58754635
0
Check whether the current path references a completion record
function isCompletionRecord(allowInsideFunction) { var path = this; var first = true; do { var container = path.container; // we're in a function so can't be a completion record if (path.isFunction() && !first) { return !!allowInsideFunction; } first = false; // check to see if w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isCompletionRecord(allowInsideFunction) {\n\t var path = this;\n\t var first = true;\n\n\t do {\n\t var container = path.container;\n\n\t // we're in a function so can't be a completion record\n\t if (path.isFunction() && !first) {\n\t return !!allowInsideFunction;\n\t }\n\n\t first...
[ "0.7086539", "0.7086539", "0.7086539", "0.69245654", "0.69245654", "0.61091834", "0.61091834", "0.60952854", "0.5987542", "0.5987542", "0.5818631", "0.5748942", "0.5704115", "0.5680691", "0.5677459", "0.56214994", "0.5608075", "0.5604253", "0.5463731", "0.5463731", "0.5445388...
0.7127658
0
Check whether or not the current `key` allows either a single statement or block statement so we can explode it if necessary.
function isStatementOrBlock() { if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) { return false; } else { return _lodashCollectionIncludes2["default"](t.STATEMENT_OR_BLOCK_KEYS, this.key); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isStatementOrBlock() {\n\t if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) {\n\t return false;\n\t } else {\n\t return _lodashCollectionIncludes2[\"default\"](t.STATEMENT_OR_BLOCK_KEYS, this.key);\n\t }\n\t}", "function isStatementOrBlock() {\n\t if (this.parent...
[ "0.66379917", "0.66379917", "0.66379917", "0.66379917", "0.66379917", "0.5529073", "0.54949456", "0.5390218", "0.5327743", "0.5318864", "0.52978826", "0.52520716", "0.5202346", "0.5200338", "0.5165498", "0.515844", "0.515844", "0.515844", "0.515844", "0.509355", "0.50788385",...
0.6699582
0
Get the source code associated with this node.
function getSource() { var node = this.node; if (node.end) { return this.hub.file.code.slice(node.start, node.end); } else { return ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSource() {\n\t var node = this.node;\n\t if (node.end) {\n\t return this.hub.file.code.slice(node.start, node.end);\n\t } else {\n\t return \"\";\n\t }\n\t}", "function getSource() {\n\t var node = this.node;\n\t if (node.end) {\n\t return this.hub.file.code.slice(node.start, node.end)...
[ "0.79741544", "0.79741544", "0.79741544", "0.79741544", "0.79741544", "0.7150175", "0.69210273", "0.6682746", "0.6616578", "0.6513974", "0.6513974", "0.6513974", "0.6362528", "0.6362528", "0.6362528", "0.6362528", "0.6362528", "0.6362528", "0.6362528", "0.6362528", "0.6351624...
0.7985472
0
Update all sibling node paths after `fromIndex` by `incrementBy`.
function updateSiblingKeys(fromIndex, incrementBy) { var paths = this.parent._paths; for (var i = 0; i < paths.length; i++) { var path = paths[i]; if (path.key >= fromIndex) { path.key += incrementBy; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateSiblingKeys(fromIndex, incrementBy) {\n\t if (!this.parent) return;\n\n\t var paths = this.parent[_constants.PATH_CACHE_KEY];\n\t for (var i = 0; i < paths.length; i++) {\n\t var path = paths[i];\n\t if (path.key >= fromIndex) {\n\t path.key += incrementBy;\n\t }\n\t }\n\t}", "fu...
[ "0.78850514", "0.78850514", "0.7881384", "0.7881384", "0.7757888", "0.57216495", "0.5198613", "0.51764", "0.50393325", "0.50078297", "0.4997379", "0.4982009", "0.4972749", "0.49606252", "0.49550283", "0.49343392", "0.49301293", "0.49062544", "0.49001062", "0.48977998", "0.489...
0.7991678
0
Deprecated in favor of `dangerouslyRemove` as it's far more scary and more accurately portrays the risk.
function remove() { console.trace("Path#remove has been renamed to Path#dangerouslyRemove, removing a node is extremely dangerous so please refrain using it."); return this.dangerouslyRemove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dangerouslyRemove() {\n this._assertUnremoved();\n\n this.resync();\n\n if (this._callRemovalHooks(\"pre\")) {\n this._markRemoved();\n return;\n }\n\n this.shareCommentsWithSiblings();\n this._remove();\n this._markRemoved();\n\n this._callRemovalHooks(\"post\");\n}", "function dangerousl...
[ "0.6639605", "0.6639605", "0.6498925", "0.6498925", "0.648563", "0.648563", "0.5456402", "0.5365885", "0.53227305", "0.52309424", "0.5192877", "0.5168006", "0.5107412", "0.50961775", "0.5078428", "0.5041586", "0.5030207", "0.50151086", "0.49810496", "0.49505582", "0.49218383"...
0.6676793
0
Takes an array of `types` and flattens them, removing duplicates and returns a `UnionTypeAnnotation` node containg them.
function createUnionTypeAnnotation(types) { var flattened = removeTypeDuplicates(types); if (flattened.length === 1) { return flattened[0]; } else { return t.unionTypeAnnotation(flattened); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createUnionTypeAnnotation(types /*: Array<Object>*/) {\n\t var flattened = removeTypeDuplicates(types);\n\n\t if (flattened.length === 1) {\n\t return flattened[0];\n\t } else {\n\t return t.unionTypeAnnotation(flattened);\n\t }\n\t}", "function createUnionTypeAnnotation(types) {\n\t var flat...
[ "0.83362585", "0.81920147", "0.81920147", "0.81920147", "0.81920147", "0.6340765", "0.6313202", "0.6313202", "0.590096", "0.57363135", "0.57021993", "0.5679243", "0.5658334", "0.5611891", "0.5591986", "0.5511026", "0.54497284", "0.5447445", "0.5404154", "0.5404154", "0.537243...
0.8248978
1
Registers `is[Type]` and `assert[Type]` generated functions for a given `type`. Pass `skipAliasCheck` to force it to directly compare `node.type` with `type`.
function registerType(type, skipAliasCheck) { var is = t["is" + type] = function (node, opts) { return t.is(type, node, opts, skipAliasCheck); }; t["assert" + type] = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + JSON.stringify(type) + " wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerType(type, skipAliasCheck) {\n\t var is = t[\"is\" + type] = function (node, opts) {\n\t return t.is(type, node, opts, skipAliasCheck);\n\t };\n\n\t t[\"assert\" + type] = function (node, opts) {\n\t opts = opts || {};\n\t if (!is(node, opts)) {\n\t throw new Error(\"Expected type...
[ "0.792146", "0.792146", "0.6606387", "0.6544775", "0.6544775", "0.641843", "0.56187046", "0.55312544", "0.5301408", "0.52739483", "0.52739483", "0.5193378", "0.5011471", "0.5001653", "0.49049672", "0.4889713", "0.4806062", "0.476524", "0.476524", "0.47392404", "0.4729214", ...
0.7948652
0
Returns whether `node` is of given `type`. For better performance, use this instead of `is[Type]` when `type` is unknown. Optionally, pass `skipAliasCheck` to directly compare `node.type` with `type`.
function is(type, node, opts, skipAliasCheck) { if (!node) return false; var matches = isType(node.type, type); if (!matches) return false; if (typeof opts === "undefined") { return true; } else { return t.shallowEqual(node, opts); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is(type, node, opts, skipAliasCheck) {\n\t if (!node) return false;\n\n\t var matches = isType(node.type, type);\n\t if (!matches) return false;\n\n\t if (typeof opts === \"undefined\") {\n\t return true;\n\t } else {\n\t return t.shallowEqual(node, opts);\n\t }\n\t}", "function is(type, nod...
[ "0.74549145", "0.74549145", "0.66514295", "0.66495717", "0.66495717", "0.63761777", "0.6280989", "0.61039335", "0.61039335", "0.60217834", "0.59433043", "0.59433043", "0.58389795", "0.5822051", "0.5822051", "0.58197147", "0.58197147", "0.58197147", "0.58117896", "0.57735556", ...
0.7472794
0
eslintenable nounusedvars Test if a `nodeType` is a `targetType` or if `targetType` is an alias of `nodeType`.
function isType(nodeType, targetType) { if (nodeType === targetType) return true; var aliases = t.FLIPPED_ALIAS_KEYS[targetType]; if (aliases) { if (aliases[0] === nodeType) return true; var _arr = aliases; for (var _i = 0; _i < _arr.length; _i++) { var alias = _arr[_i]; if (nodeType ===...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isType(nodeType, targetType) {\n\t if (nodeType === targetType) return true;\n\n\t var aliases = t.FLIPPED_ALIAS_KEYS[targetType];\n\t if (aliases) {\n\t if (aliases[0] === nodeType) return true;\n\n\t var _arr = aliases;\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var alias = _arr...
[ "0.71641874", "0.71641874", "0.7001014", "0.6943106", "0.6936369", "0.6889781", "0.60015386", "0.5994828", "0.5857106", "0.5807645", "0.5743634", "0.5736611", "0.5736611", "0.5715079", "0.56639355", "0.56613725", "0.563894", "0.5576578", "0.55638385", "0.55385315", "0.5514896...
0.7226132
0
Create a deep clone of a `node` and all of it's child nodes exluding `_private` properties.
function cloneDeep(node) { var newNode = {}; for (var key in node) { if (key[0] === "_") continue; var val = node[key]; if (val) { if (val.type) { val = t.cloneDeep(val); } else if (Array.isArray(val)) { val = val.map(t.cloneDeep); } } newNode[key] = val; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cloneDeep(node) {\n\t var newNode = {};\n\n\t for (var key in node) {\n\t if (key[0] === \"_\") continue;\n\n\t var val = node[key];\n\n\t if (val) {\n\t if (val.type) {\n\t val = t.cloneDeep(val);\n\t } else if (Array.isArray(val)) {\n\t val = val.map(t.cloneDeep);\n\t ...
[ "0.71300393", "0.71300393", "0.71300393", "0.71300393", "0.7111615", "0.70422095", "0.7015486", "0.6756807", "0.66750693", "0.66750693", "0.66750693", "0.66750693", "0.6674831", "0.6674831", "0.6559081", "0.6547835", "0.65109885", "0.6437521", "0.63878995", "0.63126475", "0.6...
0.718303
1
Remove comment properties from a node.
function removeComments(node) { var _arr3 = COMMENT_KEYS; for (var _i3 = 0; _i3 < _arr3.length; _i3++) { var key = _arr3[_i3]; delete node[key]; } return node; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeComments(node) {\n\t var _arr3 = COMMENT_KEYS;\n\n\t for (var _i3 = 0; _i3 < _arr3.length; _i3++) {\n\t var key = _arr3[_i3];\n\t delete node[key];\n\t }\n\t return node;\n\t}", "function removeComments(node) {\n\t var _arr3 = COMMENT_KEYS;\n\n\t for (var _i3 = 0; _i3 < _arr3.length; _...
[ "0.7404897", "0.7404897", "0.7330355", "0.72560716", "0.7125178", "0.70698494", "0.6724746", "0.6720811", "0.5950575", "0.5787806", "0.5759989", "0.5617675", "0.5613829", "0.5602099", "0.5565168", "0.55171263", "0.54370534", "0.5398991", "0.5390184", "0.5351978", "0.53122455"...
0.747322
0
Return a list of binding identifiers associated with the input `node`.
function getBindingIdentifiers(node, duplicates) { var search = [].concat(node); var ids = Object.create(null); while (search.length) { var id = search.shift(); if (!id) continue; var keys = t.getBindingIdentifiers.keys[id.type]; if (t.isIdentifier(id)) { if (duplicates) { var _id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBindingIdentifiers(node, duplicates) {\n\t var search = [].concat(node);\n\t var ids = Object.create(null);\n\n\t while (search.length) {\n\t var id = search.shift();\n\t if (!id) continue;\n\n\t var keys = t.getBindingIdentifiers.keys[id.type];\n\n\t if (t.isIdentifier(id)) {\n\t i...
[ "0.7409113", "0.73892665", "0.71267813", "0.7041759", "0.7041759", "0.6689956", "0.6601168", "0.65852726", "0.6548114", "0.65306324", "0.65306324", "0.57296926", "0.56680405", "0.56659746", "0.55568963", "0.5485246", "0.54785293", "0.5364619", "0.5343338", "0.5299286", "0.525...
0.75435376
0
Check if the input `node` is a `let` variable declaration.
function isLet(node) { return t.isVariableDeclaration(node) && (node.kind !== "var" || node._let); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isLet(node) {\n\t return t.isVariableDeclaration(node) && (node.kind !== \"var\" || node._let);\n\t}", "function isLet(node) {\n\t return t.isVariableDeclaration(node) && (node.kind !== \"var\" || node._let);\n\t}", "function isVar(node) {\n return t.isVariableDeclaration(node, { kind: \"var\" }) &...
[ "0.8003164", "0.8003164", "0.79321384", "0.79142684", "0.79142684", "0.7688092", "0.7688092", "0.76381963", "0.7555918", "0.7552282", "0.7552282", "0.737513", "0.73594874", "0.73594874", "0.7078617", "0.69243354", "0.683313", "0.6753423", "0.6753423", "0.6586244", "0.6552725"...
0.8022121
0
Check if the input `node` is block scoped.
function isBlockScoped(node) { return t.isFunctionDeclaration(node) || t.isClassDeclaration(node) || t.isLet(node); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isBlockScoped(node) {\n\t return t.isFunctionDeclaration(node) || t.isClassDeclaration(node) || t.isLet(node);\n\t}", "function isBlockScoped(node) {\n\t return t.isFunctionDeclaration(node) || t.isClassDeclaration(node) || t.isLet(node);\n\t}", "function isBlockScoped(node) {\n\t return t.isFuncti...
[ "0.8080169", "0.8080169", "0.8080169", "0.8080169", "0.80287665", "0.73948133", "0.7081737", "0.7081737", "0.706617", "0.70453966", "0.70453966", "0.70453966", "0.6995288", "0.68942285", "0.6792844", "0.668882", "0.668882", "0.668882", "0.668882", "0.6670903", "0.66458815", ...
0.8109083
0
Check if the input `specifier` is a `default` import or export.
function isSpecifierDefault(specifier) { return t.isImportDefaultSpecifier(specifier) || t.isIdentifier(specifier.imported || specifier.exported, { name: "default" }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isSpecifierDefault(specifier) {\n\t return t.isImportDefaultSpecifier(specifier) || t.isIdentifier(specifier.imported || specifier.exported, { name: \"default\" });\n\t}", "function isSpecifierDefault(specifier) {\n\t return t.isImportDefaultSpecifier(specifier) || t.isIdentifier(specifier.imported ||...
[ "0.8265183", "0.8265183", "0.8265183", "0.8233112", "0.8233112", "0.66339207", "0.5966666", "0.59412354", "0.5831242", "0.5739878", "0.5739878", "0.5729232", "0.5692818", "0.5677179", "0.553047", "0.553047", "0.5505083", "0.5471877", "0.5437403", "0.54130197", "0.53620905", ...
0.83187425
0
Check if the input `node` is definitely immutable.
function isImmutable(node) { if (t.isType(node.type, "Immutable")) return true; if (t.isLiteral(node)) { if (node.regex) { // regexs are mutable return false; } else { // immutable! return true; } } else if (t.isIdentifier(node)) { if (node.name === "undefined") { //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isImmutable(node) {\n\t if (t.isType(node.type, \"Immutable\")) return true;\n\n\t if (t.isLiteral(node)) {\n\t if (node.regex) {\n\t // regexs are mutable\n\t return false;\n\t } else {\n\t // immutable!\n\t return true;\n\t }\n\t } else if (t.isIdentifier(node)) {\n\t ...
[ "0.81921786", "0.81921786", "0.8161583", "0.8149277", "0.8149277", "0.6636035", "0.6280115", "0.61407596", "0.58044934", "0.57906973", "0.5769451", "0.57636887", "0.5491826", "0.5488065", "0.5457256", "0.5411991", "0.5348243", "0.5322079", "0.5298908", "0.5295736", "0.5295736...
0.8283096
0
Create an array from a boolean, string, or array, mapped by and optional function.
function arrayify(val, mapFn) { if (!val) return []; if (_lodashLangIsBoolean2["default"](val)) return arrayify([val], mapFn); if (_lodashLangIsString2["default"](val)) return arrayify(list(val), mapFn); if (Array.isArray(val)) { if (mapFn) val = val.map(mapFn); return val; } return [val]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayify(val, mapFn) {\n\t if (!val) return [];\n\t if (_lodashLangIsBoolean2[\"default\"](val)) return arrayify([val], mapFn);\n\t if (_lodashLangIsString2[\"default\"](val)) return arrayify(list(val), mapFn);\n\n\t if (Array.isArray(val)) {\n\t if (mapFn) val = val.map(mapFn);\n\t return val;\...
[ "0.6535829", "0.6535829", "0.6535829", "0.64209324", "0.5555848", "0.55197203", "0.5516569", "0.5516569", "0.548373", "0.5460091", "0.5456116", "0.54481494", "0.5439719", "0.5439719", "0.5439719", "0.5439719", "0.5439719", "0.54151946", "0.5412378", "0.5412378", "0.5412378", ...
0.65814096
0
Load templates from transformation/templates directory.
function loadTemplates() { var templates = {}; var templatesLoc = _path2["default"].join(__dirname, "transformation/templates"); if (!_pathExists2["default"].sync(templatesLoc)) { throw new ReferenceError(messages.get("missingTemplatesDirectory")); } var _arr3 = _fs2["default"].readdirSync(templatesLoc)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadTemplates() {\n\t var templates = {};\n\n\t var templatesLoc = _path2[\"default\"].join(__dirname, \"transformation/templates\");\n\t if (!_pathExists2[\"default\"].sync(templatesLoc)) {\n\t throw new ReferenceError(messages.get(\"missingTemplatesDirectory\"));\n\t }\n\n\t var _arr3 = _fs2[\"d...
[ "0.81317264", "0.81317264", "0.7481122", "0.66825235", "0.661435", "0.65700716", "0.64417213", "0.6411855", "0.6319687", "0.6305626", "0.6257228", "0.62122595", "0.6190235", "0.6173165", "0.6123272", "0.61212176", "0.61155754", "0.5972052", "0.5956603", "0.5947523", "0.591795...
0.8141941
0
Get task list for parent
function getTaskListForParent() { var username = localStorage.getItem("username"); database.ref('/task/'+username).once('value').then(function(ss){ var taskList = ss.val(); $.each(taskList, function (index, task) { var taskHTML=` <div class='list'> <div class='content'>`+task.description+`</d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTaskLists() {\n\n}", "function getTaskList(indice) \n{\n RMPApplication.debug(\"begin getTaskList\");\n c_debug(dbug.task, \"=> getTaskList\");\n id_index.setValue(indice);\n var query = \"parent.number=\" + var_order_list[indice].wo_number;\n\n var options = {};\n var pattern = {\...
[ "0.7211214", "0.679023", "0.6412576", "0.63609964", "0.6283259", "0.6183383", "0.61825025", "0.61710614", "0.61299175", "0.6119431", "0.6110658", "0.60436916", "0.60058475", "0.5929807", "0.5907433", "0.58761036", "0.5851946", "0.58494395", "0.5801814", "0.5789902", "0.578491...
0.8047691
0
Creates an instance of Ng4LoadingSpinnerService.
function Ng4LoadingSpinnerService() { /** * \@description spinners BehaviorSubject * \@memberof Ng4LoadingSpinnerService */ this.spinnerSubject = new BehaviorSubject.BehaviorSubject(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function NgxSpinnerService() {\n /**\n * Spinner observable\n *\n * \\@memberof NgxSpinnerService\n */\n this.spinnerObservable = new Subject();\n }", "function loadSpinner() {\t\n\t\t\t// Only inject the spinner if the plugin has been loaded/exist\t\n\t\t\tif (wi...
[ "0.7061956", "0.6396125", "0.6394185", "0.63462406", "0.6272586", "0.6198848", "0.6154921", "0.6154823", "0.6065786", "0.6061939", "0.6056731", "0.60273266", "0.6020463", "0.6020463", "0.601155", "0.59701777", "0.5935785", "0.5926835", "0.5906697", "0.58592796", "0.58094615",...
0.78591156
0
Sets the values in the "Edit Privacy Options" dialog based on existing object that should mirror Cpanel::Mailman
function _set_private_values_in_form() { /* jshint validthis: true */ var clicked_el = this; var form = DOM.getAncestorByTagName(clicked_el, "form"); var form_data = CPANEL.dom.get_data_from_form(form); for (var key in PRIVATE_PRIVACY_OPTIONS) { if (form[key].type =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeShowPass(obj, action) {\n\t//$('showPassBoxLink'));\n\tif(obj.value == 'A') {\n\t\tif(action != 'edit'){\n\t\t\t$('PilotgroupPassword').enable();\n\t\t\t$('ConfirmPilotgroupPassword').enable();\n\t\t}else{\n\t\t\tif($('showPassBoxLink') != null)\n\t\t\t\t$('showPassBoxLink').addClassName('showElemen...
[ "0.56180537", "0.54774356", "0.5430753", "0.5391154", "0.53516936", "0.53503567", "0.53384477", "0.5312619", "0.53072447", "0.5233806", "0.5231229", "0.5182061", "0.5128126", "0.51278675", "0.5119548", "0.5110333", "0.5097837", "0.509523", "0.50827104", "0.50796247", "0.50771...
0.5787206
0
PrivacyWindowController / Creates a new PrivacyWindowController
function PrivacyWindowController(mailingListsService) { var _self = this; /* * @method closed * callback on close of the popup * */ PrivacyWindowController.prototype.closed = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openPrivacyPolicy() {\n\t\t\t//$window.open('/web/CustPortal/#/homepages/privacypolicy', 'width=500,height=400');\n\t\t\t$window.open('/CustPortal/privacy_policy.html', 'Privacy Policy', 'scrollbars=yes,width=500,height=500');\n\t\t}", "function create_new_member_controller () {\n controller = contro...
[ "0.6156795", "0.577837", "0.5714026", "0.54488397", "0.543605", "0.54207057", "0.54207057", "0.5391541", "0.5370246", "0.53340846", "0.5316798", "0.5296606", "0.52317846", "0.5182156", "0.5169243", "0.5132244", "0.51054066", "0.5082062", "0.50592977", "0.504007", "0.5039786",...
0.69471896
0
Get the List of buses of actransit, place it in routeTags
function getRoutes() { var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", "http://webservices.nextbus.com/service/publicXMLFeed?command=routeList&a=actransit", false); xmlhttp.onreadystatechange = function() { var xmlDoc=xmlhttp.responseXML; var nodes = xmlDoc.getElementsByTagName("...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function agencyRoutes(request, response) {\n var endpoint = BASEPATH + '?' + querystring.stringify({command: 'routeList', a: request.params.agencyid});;\n doGet(HOST, endpoint, function(dom) {\n\n console.log(dom);\n\n var result = {\n routes : []\n }\n\n // Run thru th...
[ "0.5504845", "0.5374002", "0.5209441", "0.5207019", "0.51916885", "0.516302", "0.50888586", "0.50087786", "0.49581322", "0.49480402", "0.49347618", "0.4926318", "0.49115083", "0.49015483", "0.48783845", "0.48721877", "0.48528954", "0.4831022", "0.48246557", "0.4802847", "0.47...
0.5662186
0
Inject recorder code into iframe, but only if hasn't already been done.
function injectRecorderJS() { if (!status.codeHasBeenInjected && status.frameReady && status.recorderCodeReady) { console.log("Injecting JS code."); evalCodeInFrame(Shiny.shinyapp.$values.recorder_js); evalCodeInFram...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hook_iframeWrite(ret, dbg) {\r\n\tif( is_iframe(ret) === true ) {\r\n\t\tconsole.log(\"Detected new iframe(dbg:\" + dbg + \")\");//, (iframe: \", ret, \")\");\r\n\t\tvar fw = get_iframe_contentDocument(ret);\r\n\t\tif( fw ) {\r\n\t\t\t//if (is_elt_api_debug) console.log(\"[hook_iframeWrite] fw found (dbg:...
[ "0.6036942", "0.57746553", "0.56516725", "0.5580664", "0.5567129", "0.55104405", "0.5495341", "0.5463922", "0.54415286", "0.5439516", "0.54349047", "0.5421801", "0.5415739", "0.53918046", "0.53828496", "0.53789", "0.5368856", "0.5362644", "0.5277637", "0.5275087", "0.5260328"...
0.72655725
0
Function that does the actual moving of the object specified to the new x,y coordinates Also checks to see if this particular object is grouped to other objects. If it is, all other objects it's grouped to are also moved. This includes objects that are grouped to objects that it is grouped to.
function move(object, newX, newY, updateCon) { if(object == null) alert("object is null"); //Clear hotspots and highlights in case the user put down the object and these no longer need to be shown. clearAllHighlighted(); clearAllHotspots(); //Calculate a delta change, so we know what t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveObject(object, newX, newY, updateCon) {\n //Call the move function\n move(object, newX, newY, updateCon);\n \n //Highlight the object that is being moved. If it's part of a group of objects, highlight the entire group.\n //Note: It may be worth moving the group highlighting code into it...
[ "0.7911493", "0.69001275", "0.6869759", "0.6687594", "0.6606662", "0.6541384", "0.6525706", "0.64903355", "0.64841014", "0.6443329", "0.6421052", "0.6405155", "0.6402429", "0.63958", "0.6358419", "0.63321275", "0.63237745", "0.6240197", "0.6231922", "0.62230146", "0.6217407",...
0.7720848
1
Function that updates the hotspot locations in the Connection containing the specified object. This is called manually after an object stops moving. Otherwise, the Connection information is updated while the object is moving in the move function.
function updateConnection(object, deltaX, deltaY) { //Get objects this object may be grouped with. var groupedWithObjects = new Array(); groupedWithObjects[0] = object; //If we don't do this the original object will be added in the recursive method. getObjectsGroupedWithObject(object, groupedWithOb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function move(object, newX, newY, updateCon) {\n if(object == null)\n alert(\"object is null\");\n \n //Clear hotspots and highlights in case the user put down the object and these no longer need to be shown.\n clearAllHighlighted();\n clearAllHotspots();\n\n //Calculate a delta change, so...
[ "0.5733691", "0.56614906", "0.5456477", "0.53771824", "0.5374509", "0.53664863", "0.52968323", "0.5249757", "0.52374977", "0.52312285", "0.521963", "0.5179045", "0.51660347", "0.51466435", "0.5129183", "0.5113784", "0.5113784", "0.50996536", "0.50875133", "0.5073958", "0.5068...
0.6702225
0
Returns the top left corner and width and height of the group of objects specified in a BoundingBox object. This function does not check whether or not the group of objects passed in is actually connected. so the function can be used for any set of objects. Instead, it just finds the leftmost, topmost, rightmost and bo...
function getBoundingBoxOfGroup(group) { //Just in case, make sure we're provided with at least one object. if(group.length > 0) { //set all of our locations to the first object for now. var leftMostPoint = group[0].offsetLeft; var topMostPoint = group[0].offsetTop; var rightMostP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVisibleBounds(object) {\n var bounds, clippedItem;\n if (object.typename == \"GroupItem\") {\n // if the object is clipped\n if (object.clipped) {\n // check all sub objects to find the clipping path\n for (var i = 0; i < object.pageItems.length; i++) {\n ...
[ "0.6910388", "0.6910388", "0.6532637", "0.60830635", "0.6038461", "0.579367", "0.5746651", "0.5740424", "0.5702082", "0.5689477", "0.56892705", "0.56433", "0.5643269", "0.5617087", "0.5601075", "0.5548505", "0.55011535", "0.5481566", "0.54478586", "0.5407123", "0.53565925", ...
0.80503136
0
Function calls checkObjectOverlap to get the array of overlapping objects. It then takes this array and concatinates it into a string that can be used by the objectiveC code.
function checkObjectOverlapString(object) { var overlapArray = checkObjectOverlap(object); if(overlapArray.length > 0) { var overlapString = ""; for(var i = 0; i < overlapArray.length - 1; i ++) { //overlapString = overlapString + overlapArray[i][0].id + ", " + overlapA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkObjectOverlap(object) {\n //Check to see if object with object is overlapping any other object that it can be grouped with.\n var manipulationObjects = document.getElementsByClassName('manipulationObject');\n var overlapArray = new Array();\n \n for(var i = 0; i < manipulationObjects.l...
[ "0.6317598", "0.6308212", "0.5995977", "0.5837748", "0.58085775", "0.57754743", "0.5749176", "0.5696487", "0.5592587", "0.5580341", "0.5568296", "0.5468618", "0.5365862", "0.5289767", "0.527946", "0.52590483", "0.5240647", "0.52253914", "0.5203762", "0.5148257", "0.5142063", ...
0.7659844
0
Group the two objects at the specified hotspots. x1,y1 specifies the hotspot location of object1 that will be grouped with the hotspot of object2 specified by x2,y2. Object1 is the object that is being manipulated. Object 2 is static when the grouping is animated. TODO: Change the size and zindex of the objects so that...
function groupObjectsAtLoc(object1, x1, y1, object2, x2, y2) { var group = new Connection(object1, x1, y1, object2, x2, y2); //Animate the grouping before adding them to the grouped objects array so that they animate correctly. animateGrouping(group); //Add them to the grouped objects array. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function objectGroupedAtHotspot(object, x, y) {\n var MARGIN = 13;\n //alert(object + \" \" + x + \" \" + y);\n for(var i = 0; i < groupings.length; i ++) {\n var group = groupings[i];\n \n if(object.id == group.obj1.id) {\n //alert(\"inside if\");\n var diffX = ...
[ "0.6835401", "0.5901151", "0.574966", "0.57086563", "0.56741405", "0.5490127", "0.533864", "0.5232238", "0.5190703", "0.5185646", "0.50908345", "0.5036517", "0.5024823", "0.49988374", "0.49982798", "0.49945748", "0.49497086", "0.49482593", "0.49482593", "0.49482593", "0.49482...
0.8005125
0
This function takes a new group that has been created and animates it appropriately so that the object that was being moved slowly animated towards the other object. the x and y coordinates of the connection specify the two hotspots that are joined. object1 is the one that will be moving toward object 2. We need to cal...
function animateGrouping(group) { //Calculate the total change that needs to occur, even though we'll only move a small step size towards the hotspot every time. var deltaX = group.obj2x - group.obj1x; var deltaY = group.obj2y - group.obj1y; //Check to see whether there is more animation to be done...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animateUngrouping(group) {\n var GAP = 10; //we want a 10 pixel gap between objects to show that they're no longer grouped together.\n //Figure out which is the left most and which is the right most object. The left most object will move left and the right most object will move right. TODO: What imp...
[ "0.7181351", "0.7091049", "0.6780688", "0.63752276", "0.62341696", "0.6057723", "0.60552293", "0.60215837", "0.591797", "0.591797", "0.591797", "0.591797", "0.591797", "0.591797", "0.591797", "0.591797", "0.591797", "0.58386296", "0.57569003", "0.57220936", "0.57140064", "0...
0.7435058
0
Ungroups 2 objects from each other.
function ungroupObjects(object1, object2) { //Get the index at which the objects are grouped. var areGrouped = areObjectsGrouped(object1, object2); //Make sure they are grouped, and if they are, ungroup them. if(areGrouped > -1) { //Grab the reference to the connection that needs to be remo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animateUngrouping(group) {\n var GAP = 10; //we want a 10 pixel gap between objects to show that they're no longer grouped together.\n //Figure out which is the left most and which is the right most object. The left most object will move left and the right most object will move right. TODO: What imp...
[ "0.6529381", "0.5766791", "0.56357867", "0.56251067", "0.55982846", "0.54762655", "0.52921146", "0.5279938", "0.52404505", "0.52344173", "0.523364", "0.51941025", "0.5182914", "0.51659304", "0.5140839", "0.5124529", "0.51044744", "0.50914633", "0.50857764", "0.50813794", "0.5...
0.7888047
0
Animate the ungrouping by moving the objects away from each other. Do so by ensuring that the objects no longer overlap and by putting a 10 pixel space in between them. Keep in mind that objects should not be moved off screen when doing so. TODO: Move objects towards the edges of the screens to avoid overlap with other...
function animateUngrouping(group) { var GAP = 10; //we want a 10 pixel gap between objects to show that they're no longer grouped together. //Figure out which is the left most and which is the right most object. The left most object will move left and the right most object will move right. TODO: What implicatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animateGrouping(group) {\n //Calculate the total change that needs to occur, even though we'll only move a small step size towards the hotspot every time.\n var deltaX = group.obj2x - group.obj1x;\n var deltaY = group.obj2y - group.obj1y;\n \n //Check to see whether there is more animation ...
[ "0.6832914", "0.6392483", "0.60269326", "0.58982044", "0.58640933", "0.5747563", "0.57150364", "0.5706949", "0.5674214", "0.5656306", "0.559931", "0.5593715", "0.5586408", "0.5582071", "0.55567294", "0.5537778", "0.5521547", "0.5514739", "0.5504277", "0.5501569", "0.54993135"...
0.8593756
0
A connection object specifying that a grouping exists between object1 and object2. x1, y1 represents the hotspot location that belongs to object1. x2, y2 represents the hotspot location that belongs to object2.
function Connection(object1, x1, y1, object2, x2, y2) { this.obj1 = object1; this.obj1x = x1; this.obj1y = y1; this.obj2 = object2; this.obj2x = x2; this.obj2y = y2 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function groupObjectsAtLoc(object1, x1, y1, object2, x2, y2) {\n var group = new Connection(object1, x1, y1, object2, x2, y2);\n \n //Animate the grouping before adding them to the grouped objects array so that they animate correctly.\n animateGrouping(group);\n \n //Add them to the grouped objec...
[ "0.776581", "0.65059114", "0.64776015", "0.5890266", "0.5652054", "0.5593619", "0.5563652", "0.55130476", "0.550897", "0.5483555", "0.5432921", "0.534225", "0.53395504", "0.52496225", "0.52487445", "0.5224742", "0.5197287", "0.518878", "0.51712304", "0.5168199", "0.5166475", ...
0.7472916
1
Recursive function which finds all objects which are grouped together. Need to recursively check objects due to the fact that 3 or more objects may be grouped at different times. In this case groupedObjects will be an array of pairs of objects that are grouped together. TODO: come back to this and see if this and getOb...
function getGroupedObjectsArray(object, groupedObjects) { //Go through the entire 2D array. for(var i = 0; i < groupings.length; i++) { var group = groupings[i]; if(object.id == group.obj1.id) { if(!pairInList(group.obj1, group.obj2, groupedObjects)) { //aler...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getObjectsGroupedWithObject(object, groupedObjects) {\n //Go through the entire list of connections.\n for(var i = 0; i < groupings.length; i++) {\n var group = groupings[i];\n \n if(object.id == group.obj1.id) {\n if(!objectInList(group.obj2, groupedObjects)) {\n ...
[ "0.78394777", "0.6205068", "0.5945914", "0.5750208", "0.57019675", "0.5556467", "0.53906864", "0.53224975", "0.53179187", "0.5298634", "0.52462536", "0.5234265", "0.52319765", "0.5195848", "0.5191492", "0.513723", "0.51253575", "0.5119305", "0.51068836", "0.507277", "0.507100...
0.7313692
1
Recursive function which finds all objects which are grouped together. Need to recursively check objects due to the fact that 3 or more objects may be grouped at different times. Return the list of objects that are all grouped together.
function getObjectsGroupedWithObject(object, groupedObjects) { //Go through the entire list of connections. for(var i = 0; i < groupings.length; i++) { var group = groupings[i]; if(object.id == group.obj1.id) { if(!objectInList(group.obj2, groupedObjects)) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGroupedObjectsArray(object, groupedObjects) {\n //Go through the entire 2D array.\n for(var i = 0; i < groupings.length; i++) {\n var group = groupings[i];\n \n if(object.id == group.obj1.id) {\n if(!pairInList(group.obj1, group.obj2, groupedObjects)) {\n ...
[ "0.67111737", "0.6261083", "0.6210143", "0.6103167", "0.6006322", "0.5993713", "0.59621155", "0.59015036", "0.58784497", "0.5873705", "0.57453936", "0.5743273", "0.57417977", "0.57115257", "0.5679962", "0.56520075", "0.56502634", "0.56383306", "0.5581682", "0.55600864", "0.55...
0.70501345
0
Used as a helper method for getObjectsGroupedWithObject. Checks to see if the objects is in the list so it isn't added again. The objectList is a list of individual objects.
function objectInList(object, objectList) { for(var i = 0; i < objectList.length; i ++) if(object.id == objectList[i].id) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addObjectInList(list, object) {\n if (object) {\n list.push(object);\n }\n }", "function containsObject(obj, list) {\n\t\tvar i;\n\t\tfor (i = 0; i < list.length; i++) {\n\t\t\tif (list[i] === obj) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t} // END containsObjec...
[ "0.6509239", "0.64748234", "0.6315272", "0.62586075", "0.60983455", "0.60174406", "0.5916627", "0.58992857", "0.58349323", "0.58004314", "0.5449472", "0.5380239", "0.53652453", "0.53276706", "0.5282303", "0.5278274", "0.52672637", "0.52271795", "0.51985085", "0.5081119", "0.5...
0.66505605
0
Used as a helper method for getGroupedObjectsArray. Checks to see if the pair of objects are in the list so it isn't added again. The object list is a list of Connections.
function pairInList(object1, object2, objectList) { for(var i = 0; i < objectList.length; i ++) { var group = objectList[i]; if((object1.id == group.obj1.id) && (object2.id == group.obj2.id)) { return true; } else if((object1.id == group.obj2.id) && (object2.id =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGroupedObjectsArray(object, groupedObjects) {\n //Go through the entire 2D array.\n for(var i = 0; i < groupings.length; i++) {\n var group = groupings[i];\n \n if(object.id == group.obj1.id) {\n if(!pairInList(group.obj1, group.obj2, groupedObjects)) {\n ...
[ "0.6331271", "0.6323315", "0.60130584", "0.5897004", "0.56084144", "0.54636025", "0.5390633", "0.5358642", "0.53226966", "0.5208709", "0.5140313", "0.51217765", "0.5089647", "0.50654143", "0.50452554", "0.5037944", "0.49944472", "0.49935156", "0.49871948", "0.49260554", "0.48...
0.6725316
0
Returns the index at which the objects are in the array if object1 and object 2 are grouped together, and 1 otherwise.
function areObjectsGrouped(object1, object2) { for(var i = 0; i < groupings.length; i ++) { var group = groupings[i]; if((object1.id == group.obj1.id) && (object2.id == group.obj2.id)) return i; else if((object2.id == group.obj1.id) && (object1.id == group.obj2.id)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIndex(objects, obj) {\n\n\t var i;\n\t for (i = 0; i < objects.length; i++) {\n\t if (objects[i] === obj) {\n\t return i;\n\t }\n\t }\n\n\t return -1;\n\t }", "function getIndex(objects, obj) {\n\n ...
[ "0.68283397", "0.67959523", "0.67959523", "0.67959523", "0.67959523", "0.67959523", "0.67959523", "0.67959523", "0.67959523", "0.67959523", "0.67959523", "0.67959523", "0.67959523", "0.6380961", "0.6204211", "0.6204211", "0.60248786", "0.5979222", "0.5956353", "0.5940265", "0...
0.7504102
0
Checks to see if a particular hotspot for an object is already connected to another object. This is necessary to ensure that we're not trying to connect two objects to the same hotspot. It's possible that at some point in time we want to allow multiple objects to connect to the same hotspot based on the object. If so, ...
function objectGroupedAtHotspot(object, x, y) { var MARGIN = 13; //alert(object + " " + x + " " + y); for(var i = 0; i < groupings.length; i ++) { var group = groupings[i]; if(object.id == group.obj1.id) { //alert("inside if"); var diffX = Math.abs(x - group....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateConnection(object, deltaX, deltaY) {\n //Get objects this object may be grouped with.\n var groupedWithObjects = new Array();\n groupedWithObjects[0] = object; //If we don't do this the original object will be added in the recursive method.\n \n getObjectsGroupedWithObject(object, gro...
[ "0.5627877", "0.51454514", "0.51127356", "0.5049047", "0.5007114", "0.4994409", "0.49853724", "0.4979964", "0.4979964", "0.49549565", "0.4910662", "0.4893578", "0.48708677", "0.48414084", "0.48235798", "0.48235798", "0.47810027", "0.47737274", "0.47345886", "0.47325584", "0.4...
0.5652191
0
Helper method that tells us whether one object is completely contained within another object. Will return true if object1 is contained in object2.
function objectContainedInObject(object1, object2) { if((object1.offsetTop >= object2.offsetTop) && (object1.offsetTop + object1.offsetHeight <= object2.offsetTop + object2.offsetHeight) && (object1.offsetLeft > object2.offsetLeft) && (object1.offsetLeft + object1.offsetWidth <= object2.offsetLeft ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function overlap(obj1, obj2) {\n var right1 = obj1.x + obj1.width;\n var right2 = obj2.x + obj2.width;\n var left1 = obj1.x;\n var left2 = obj2.x;\n var top1 = obj1.y;\n var top2 = obj2.y;\n var bottom1 = obj1.y + obj1.height;\n var bottom2 = obj2.y + obj2.height;\n\n if (left1 < right2 ...
[ "0.6754894", "0.6662895", "0.6614878", "0.64708626", "0.634671", "0.62593985", "0.62113714", "0.61921287", "0.6167642", "0.61275756", "0.6094569", "0.605133", "0.6030209", "0.6017776", "0.60137624", "0.59749776", "0.59492046", "0.59440565", "0.59178185", "0.59094644", "0.5907...
0.75906754
0
Swaps the current image src used by objectId for the alternateSrc and adjusts the image width and location
function swapImageSrc(objectId, alternateSrc, width, left, top) { var image = document.getElementById(objectId); //get the image image.src = "../Images/" + alternateSrc; //swap image //Adjust image width and location image.style.width = width; image.style.left = left + "%"; image.style...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "swapSrc(){\n\n const newSrc = this.getNewSrc();\n\n if(newSrc === this.currentSrc) return;\n\n if(this.type === 'img'){\n this.elem.src = newSrc\n }else if (this.type === 'div'){\n this.elem.style.backgroundImage = 'url(' + newSrc + ')';\n }\n this.currentSrc = newSrc;\n...
[ "0.7298635", "0.7061386", "0.69480824", "0.66779447", "0.6658781", "0.6636933", "0.659987", "0.6575232", "0.6557279", "0.6525029", "0.6506032", "0.65027916", "0.64044034", "0.63931525", "0.6385389", "0.6359559", "0.6348925", "0.6328726", "0.63135004", "0.62759686", "0.6275598...
0.81467974
0
This may be moved into a different js file, if there are more things to do when moving to the next sentence. This function just sets the sentence opacity to the specified opacity. It's used to setup the opacity when the activity loads, and when moving from one sentence to the next.
function setSentenceOpacity(sentenceId, opacity) { sentenceId.style.opacity = opacity; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finalOpacity() {\n firstText.style.transition = \"opacity 1.5s linear 0s\"\n let opacity = firstText.style.opacity = \"0\";\n setTimeout(finalText, 1500)\n}", "function ChangeOpacity(value) {\n guiData.opacity = value;\n p.getBubbleDrawer().adjustOpacity(value);\n if (!isPlaying)\n ...
[ "0.7070656", "0.66881585", "0.66796017", "0.66541356", "0.6560531", "0.6551991", "0.64985514", "0.6494203", "0.63848203", "0.63679236", "0.6367868", "0.63475484", "0.6333011", "0.6298605", "0.6260081", "0.6228403", "0.6203673", "0.616687", "0.61504084", "0.61395305", "0.61395...
0.8259086
0
Highlights only the specified object. This function is called by the PMView controller to highlight overlapping objects that have relevant relationships with object being moved. The parameter 'under' indicates that the highlighting should be performed under the object
function highlightObject(object) { highlight(object.offsetLeft, object.offsetTop, object.offsetWidth, object.offsetHeight, "under"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function highlightObjectOnWordTap(object) {\n highlight(object.offsetLeft, object.offsetTop, object.offsetWidth, object.offsetHeight, \"over\");\n}", "function mouseover() {\r\n\t// if the piece is movable, give a class name \"highlight\"\r\n\tif(movable(this)) {\r\n\t\tthis.className = \"highlight\";\r\n\t\t...
[ "0.5969888", "0.5855876", "0.53339607", "0.52454555", "0.5222975", "0.5203272", "0.5136807", "0.5119727", "0.5062102", "0.49940386", "0.4939027", "0.49110842", "0.4877956", "0.48326498", "0.48313653", "0.4770666", "0.47456375", "0.47416162", "0.47416082", "0.47325462", "0.472...
0.70209336
0
Create an oval highlight using the top left corner and width and height specified. If highlighting only one object the top left corner specified will be based on the offsetLeft and offsetTop properies and the width and height will be based on the offsetWidth and offsetTop. If highlighting a group of objects, the top le...
function highlight(topleftX, topleftY, objectWidth, objectHeight, highlightType) { var canvas = document.getElementById('highlight'); //Make sure the canvas is the size of the window. If not, make it the same size. //NOTE: This doesn't work, but we need something like this. /* if(canvas.width ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createHighlight(y, x, col) {\n var highlightPlane = new THREE.PlaneBufferGeometry(unit - .02, unit - .02, 1, 1);\n var highlightMaterial = new THREE.MeshBasicMaterial({\n color: col,\n transparent: true,\n opacity: 0.5\n });\n\n //Set the height for each corner of the highlight\...
[ "0.56315213", "0.5583892", "0.5580921", "0.5515203", "0.5064839", "0.50282604", "0.49528477", "0.49151486", "0.49129033", "0.48431426", "0.48410904", "0.48398688", "0.4812476", "0.47961178", "0.477372", "0.4745259", "0.4738437", "0.47188908", "0.47047853", "0.4669998", "0.464...
0.6936553
0
Draw hotspot at location x,y with the specified color.
function drawHotspot(x, y, color) { var canvas = document.getElementById('overlay'); //Make sure the canvas is the size of the window. If not, make it the same size. //NOTE: This doesn't work, but we need something like this if we ever end up working in different sized screens. /* if(canvas.wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_point(x, y, color)\n\t{\n\t\tscreen.data[(x + y * screen.width) * 4] = color[0];\n\t\tscreen.data[(x + y * screen.width) * 4 + 1] = color[1];\n\t\tscreen.data[(x + y * screen.width) * 4 + 2] = color[2];\n\t\tscreen.data[(x + y * screen.width) * 4 + 3] = color[3];\n\t}", "function drawHitbox ({ x, y,...
[ "0.6435629", "0.61843604", "0.6146152", "0.611559", "0.6084952", "0.5926036", "0.5784938", "0.577726", "0.5742048", "0.57013077", "0.56930584", "0.56179583", "0.5605949", "0.5590732", "0.5535089", "0.5506755", "0.5500449", "0.5481788", "0.5481788", "0.54767156", "0.54634476",...
0.73565406
0
Highlights the specified object on word tap. This function is called by the PMView controller to highlight objects when their word has been clicked. The parameter 'over' indicates that the highlighting should be performed over the object
function highlightObjectOnWordTap(object) { highlight(object.offsetLeft, object.offsetTop, object.offsetWidth, object.offsetHeight, "over"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function highlightObject(object) {\n highlight(object.offsetLeft, object.offsetTop, object.offsetWidth, object.offsetHeight, \"under\");\n}", "function high(which2) {\r\n\ttheobject=which2\r\n\thighlighting=setInterval(\"highlightit(theobject)\",50)\r\n}", "function mouseover() {\r\n\t// if the piece is mov...
[ "0.6702684", "0.62665826", "0.6218592", "0.5925736", "0.58134675", "0.5772505", "0.5719081", "0.56355935", "0.56300294", "0.5610979", "0.5599068", "0.556916", "0.5531644", "0.5496699", "0.54413223", "0.54369336", "0.5435974", "0.54264706", "0.54002535", "0.53918755", "0.53819...
0.81310415
0
Sets the text of a sentence
function setInnerHTMLText (sentenceID, text) { document.getElementById(sentenceID).innerHTML = text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set text(text) {\n\t\tthis._text = text;\n\t}", "set setText (text) {\n this.text = text;\n }", "updateText(text) {\n\t\tthis.text = text;\n\t}", "setText(text) {\n this._setText(text);\n }", "_setText(text) {\n // Reset the dialog\n if (this.text) this.text.destroy();\n\n const x = ...
[ "0.7182274", "0.70608956", "0.67712486", "0.67344147", "0.670011", "0.6638303", "0.6638303", "0.6618756", "0.6532591", "0.6513773", "0.6442227", "0.6326514", "0.6265622", "0.6259383", "0.62558025", "0.62448037", "0.624411", "0.6185409", "0.6159363", "0.6155549", "0.6131459", ...
0.7255422
0
Open an external spreadsheet and return an existing sheet by name or create it if it doesn't exist.
function findOrCreateExternalSheet(id, name) { const doc = SpreadsheetApp.openById(id); let externalSheet = doc.getSheetByName(name); if (!externalSheet) { externalSheet = doc.insertSheet(name); } return externalSheet; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOrCreateSheet(spreadsheet, sheetName) {\n var sheet = spreadsheet.getSheetByName(sheetName);\n if (!sheet) {\n console.warn('Sheet %s does not exists, created new sheet.', sheetName);\n sheet = spreadsheet.insertSheet(sheetName);\n }\n console.log('Returned the sheet: ' + sheetName);\n retur...
[ "0.7083029", "0.6753721", "0.67220515", "0.6666446", "0.6623391", "0.6566311", "0.6292289", "0.6189549", "0.6173755", "0.6039414", "0.6022081", "0.58908963", "0.5833265", "0.57939273", "0.5638666", "0.55992585", "0.5544502", "0.55188876", "0.54551613", "0.5412334", "0.5399211...
0.75755656
0
1) Sets up a global onclick handler which determines which mongobrowser instance has "focus". This is necesarry to send keyboard shortcuts to the right instance (or none if none has focus). 2) Sets up a global onkeypress handler which forwards the events to the focused instance. Executed only once upon startup.
function sendEventsToCorrectInstance(){ var focusedMongoBrowser = null; $(document).click(function(event){ var target = $(event.target); var id = target.closest(".mongoBrowser").attr("id"); if(typeof id === "undefined"){ focusedMongoBrowser = null; }else{ focusedMongoBrowser = MongoBrowser.inst...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_init() {\n\t\twindow.onkeydown = e => {\n\t\t\tfor(let i in this._keys) {\n\t\t\t\tif(this._keys[i].keyCode === e.keyCode) {\n\t\t\t\t\tthis._keys[i].isActive = true;\n\n\t\t\t\t\tif(this._keys[i].action !== null)\n\t\t\t\t\t\tthis._keys[i].action(e);\n\t\t\t\t}\n\t\t\t\telse continue;\n\t\t\t}\n\n\t\t\tif(this._...
[ "0.6563702", "0.6381382", "0.6342217", "0.62985045", "0.62257797", "0.62024367", "0.6154451", "0.61238414", "0.6112415", "0.60717696", "0.60596865", "0.6057929", "0.60238147", "0.6009411", "0.6008101", "0.6007412", "0.59914875", "0.5989316", "0.59860307", "0.59697026", "0.594...
0.73952186
0
It Requires [jQuery]( [underscore.js]( How to use it: myChart = new Stat( urlToFetch (string), params (string), TypeOfChart (string), locationToInjectTheChart (string)); myChart.fetch(); Example: Using Ajax call to get your data comboChart = new Stat( "api/mydata", "start_date=10%2F02%2F2012&end_date=10%2F17%2F2012", "...
function Stat(url, postData, chartType, domTarget){ this.url = url; this.postData = postData; if((typeof chartType === 'undefined')||(chartType === "")){ throw new CustomError("chartType", 'Please specify a chart type (options are: '+ 'ComboChart, PieChart, LineChar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawChart() {\n $.ajax({\n type: \"POST\",\n url: 'api/api.php',\n data: { action: \"get-chart-data\"},\n success: function (output) {\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', '...
[ "0.68784696", "0.67989707", "0.6709867", "0.664297", "0.66103196", "0.6604961", "0.65787923", "0.6529237", "0.6431088", "0.6274273", "0.6239256", "0.62269604", "0.62084407", "0.620036", "0.6200142", "0.61692053", "0.6166262", "0.6149197", "0.61451733", "0.61273694", "0.611825...
0.69640356
0
create an image from the blob
function createImage(blob) { var content = null; var reader = new parentwin.FileReader(); reader.addEventListener('loadend', function() { content = reader.result; }); reader.readAsDataURL(blob); thread = Services.tm.currentThread; while (content === null) { thread.processN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createImage(blob)\n {\n var pastedImage = new Image();\n pastedImage.src = blob;\n\n // Send the image content to the form variable\n pastedImage.onload = function() {\n var sourceSplit = blob.split(\"base64,\");\n var sourceString = sourceSplit[1];\n ...
[ "0.75042343", "0.67050165", "0.65639955", "0.6544471", "0.65097386", "0.6316923", "0.6306023", "0.6196932", "0.6146227", "0.613033", "0.60403216", "0.59777194", "0.5945077", "0.5920961", "0.59105146", "0.58955127", "0.5858851", "0.5839201", "0.5836356", "0.58042556", "0.57915...
0.749535
1
compare captured imagedata to a canvas baseline
function compare(data, canvas) { var ctx = canvas.getContext("2d"); var data2 = ctx.getImageData(0, 0, canvas.width, canvas.height); var d1 = data.data; var d2 = data2.data; var diffcanvas = parentwin.document.createElementNS( "http://www.w3.org/1999/xhtml", "canvas"); diffcanv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareFrame(img1) {\n // just compare if there are two pictures\n if ( img2 != null ) {\n var res=[0,0,0,0];\n var ObjR=10;\n\n try {\n \t\t// compare the two pictures, the given threshold helps to ignore noise\n \t\tres = compare(img1, img2, shipX, shipY, 10, ObjR); \n \t}\n catch...
[ "0.64423186", "0.6325728", "0.62914985", "0.5916906", "0.5751971", "0.5726062", "0.5634962", "0.5519316", "0.55150074", "0.5495072", "0.548688", "0.5485542", "0.548296", "0.5477273", "0.54483765", "0.5423433", "0.5412066", "0.5370194", "0.5357246", "0.53411645", "0.53290987",...
0.6945859
0
the animate of pull button
function pull(){ var ys = $(".bottom-pull"); $(ys).animate({"bottom":"10px"},1000).animate({"bottom":"30px"},1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _onPulling(pullDownEl,pullDownAction,pullUpEl,pullUpAction){\t\t\r\n\tif (pullDownEl.className.match('flip')) {\r\n\t\tpullDownEl.className = 'loading';\r\n\t\tpullDownEl.querySelector('.pullDownLabel').innerHTML =info.loadingLable;\t\t\t\t\r\n\t\tpullDownEl.querySelector('.loader').style.display=\"block\...
[ "0.65259147", "0.6166948", "0.6080395", "0.5916636", "0.5912654", "0.5814419", "0.57835615", "0.5772097", "0.5770741", "0.5706212", "0.56791234", "0.5674423", "0.56473625", "0.5609321", "0.55987114", "0.5572082", "0.55415976", "0.55332613", "0.5531701", "0.5522903", "0.550270...
0.6950698
0
function for sorting CSV data for charts displaying totals
function sortTotalsData(data) { // define variables used later on var labelNames = []; var dataValues = []; var i = 0; // split received data into lines var lines = data.split("\n"); // split each line into labels and data values lines.forEach(function(line) { if (i != 0 && i !...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortData (data) {\n ...\n}", "function sortChart () {\n // Ascending or descending data\n if (this.dataset.status >= 0) {\n this.dataset.status = -1\n data.sort(function (a, b) {\n return a.value - b.value\n })\n } else {\n this.dataset.status = 1\n data.sort(...
[ "0.6528814", "0.63821995", "0.6156985", "0.61103517", "0.6099736", "0.608344", "0.60548526", "0.60477483", "0.60338336", "0.5989733", "0.59527767", "0.5923768", "0.5909865", "0.58824587", "0.58615565", "0.5859411", "0.5847504", "0.57950634", "0.5777683", "0.57597876", "0.5748...
0.6964392
0
execute all queries for all questions
async function executeAllQueries(tx) { for (qsFunc of questionsAndFunctions) { qustion = qsFunc["question"]; queryFunction = qsFunc["queryFunction"]; await queryFunction(qustion, tx); log("\n - - - - - - - - - - - - \n"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function executeQueries() {\n // print questions\n log(\"\\nSelect a question for which you'd like to execute the query?\\n\");\n for (let [index, qsFunc] of questionsAndFunctions.entries())\n log(index + 1 + \". \" + qsFunc[\"question\"]);\n log(\"\");\n\n // get user's selection and call the functi...
[ "0.68665195", "0.6489284", "0.61241066", "0.6019586", "0.5954876", "0.59340984", "0.5863369", "0.5860723", "0.58295786", "0.5821059", "0.58081675", "0.57610655", "0.5737234", "0.5710123", "0.57096946", "0.569781", "0.5677349", "0.5657899", "0.5631417", "0.56267625", "0.561359...
0.7641145
0
this is the main function prints the questions and asks for the input, based on which the corresponding function to execute the query is called
async function executeQueries() { // print questions log("\nSelect a question for which you'd like to execute the query?\n"); for (let [index, qsFunc] of questionsAndFunctions.entries()) log(index + 1 + ". " + qsFunc["question"]); log(""); // get user's selection and call the function for it const rl =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runQuery() {\n\tinquirer.prompt({\n\t\tname: \"options\",\n\t\ttype: \"rawlist\",\n\t\tmessage: \"What would you like to do?\",\n\t\tchoices: [\n\t\t\t\"View products for sale\",\n\t\t\t\"View low inventory\",\n\t\t\t\"Add to inventory\",\n\t\t\t\"Add new product\"\n\t\t]\n\t}).then(function(answer) {\n\t...
[ "0.7254016", "0.6917829", "0.68085766", "0.673054", "0.67163044", "0.67054653", "0.6654088", "0.66370684", "0.6604911", "0.65434766", "0.65166473", "0.64688146", "0.64441735", "0.6434705", "0.6428566", "0.6407931", "0.635833", "0.6357372", "0.635117", "0.6339235", "0.63126814...
0.7446959
0
display called once data has been loaded. sets up the scroller and displays the visualization.
function display(data) { // create a new plot and // display it var plot = scrollVis(); d3.select("#vis") .datum(data) .call(plot); // setup scroll functionality var scroll = scroller() .container(d3.select('#graphic')); // pass in .step selection as the steps scroll(d3.selectAll('.step'))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display(data) {\n \n // create a new plot and\n // display it\n plot = scrollVis();\n d3.select('#vis')\n .datum(data)\n .call(plot);\n\n // setup scroll functionality\n var scroll = scroller().container(d3.select('#graphic'));\n scroll(d3.selectAll('.step'));\n \n // setup event handling...
[ "0.7700769", "0.6854161", "0.68144274", "0.6519831", "0.65133506", "0.6420437", "0.64142144", "0.63858056", "0.6365241", "0.62942034", "0.6282026", "0.62215453", "0.6202686", "0.6202561", "0.61976385", "0.6196346", "0.6157852", "0.6116352", "0.60934037", "0.60934037", "0.6075...
0.7171512
1
Set the buttons visibility depends of the current scroll posotion.
setButtonsAttributes() { if (this.scrollPosition <= 0) { this.btnPrev.classList.add('hidden'); } else if (this.btnPrev.classList.contains('hidden')) { this.btnPrev.classList.remove('hidden'); } if (this.scrollPosition >= this.scrollMaxPosition) { this.btnNext.classList.add('hidden'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayScrollButtons() {\n $('.btn-scroll').each(function() {\n const target = $($(this).data('target'))[0];\n if (target.offsetWidth < target.scrollWidth) {\n $(this).css('visibility', 'visible');\n } else {\n $(this).css('visibility', 'hidden');\n }\n...
[ "0.7633721", "0.7533023", "0.7142938", "0.6662551", "0.66555995", "0.6625494", "0.66247165", "0.662366", "0.66073465", "0.65878785", "0.65793043", "0.6571194", "0.6540641", "0.65313864", "0.6519635", "0.65145856", "0.65126055", "0.6512268", "0.650571", "0.64975756", "0.647892...
0.768451
0
Wrapper function to create an array of promises which a sinle callback
function createPromises (ids, callback) { let promiseArray = []; ids.forEach(function (id, index) { promiseArray.push(createNewPromise(callback, id, index)); }); return promiseArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function new_promise() {\n var resolve, promise = new Promise((res, rej)=>{resolve = res;});\n return [promise, resolve];\n }", "function promiseArray (promise, label) {\n return DS.PromiseArray.create({\n promise: Promise.resolve (promise, label),\n });\n}", "function flatPromise() {\n ...
[ "0.7240015", "0.665785", "0.6575403", "0.654992", "0.6540958", "0.64832956", "0.64355445", "0.64182335", "0.6290189", "0.62201625", "0.61770797", "0.61174184", "0.610329", "0.61003447", "0.6076064", "0.60733664", "0.6019714", "0.5988829", "0.5983708", "0.59800446", "0.5956647...
0.75465196
0
Start the sync loop in the background.
async start() { await this._runLoop(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startLoop() {\n\tisrunnning = true;\n}", "start() {\n this.loop();\n }", "function startLoop(){\n\n // console.log('[LOOP]');\n\n INGAME = true;\n\n // cancel on late-join\n loop.stop();\n\n loop.resume();\n}", "function startLoop(){\n\n // console.log('[LOOP]');\n\n INGAME = true;\n\n /...
[ "0.65156156", "0.63850665", "0.6230704", "0.6230704", "0.62107396", "0.6194832", "0.6189964", "0.6134784", "0.6090302", "0.60871613", "0.60871613", "0.6059753", "0.60545915", "0.60489964", "0.60438496", "0.60153663", "0.5974658", "0.59677976", "0.5938822", "0.5925958", "0.591...
0.70274734
0
Get an image from the sync url by id.
async _getImage(id) { const { body: image } = await request.get(this._syncUrl + '/api/image/' + id) .proto(imagery.Image) .timeout(5000); return image; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get(id, callback) {\n database.schema.Img.find({\n id: id\n }, function (err, imgs) {\n if (err)\n callback(err, null)\n else if (imgs.length === 0)\n callback(new Error('No such image exists.'), null);\n else\n callback(null, imgs[0]);\n ...
[ "0.70487523", "0.6902721", "0.6488413", "0.64844227", "0.6412898", "0.637138", "0.6298628", "0.62262547", "0.6138382", "0.6116566", "0.611364", "0.6111879", "0.610883", "0.6070755", "0.6068871", "0.60550547", "0.6042895", "0.6032127", "0.6022827", "0.6018279", "0.5990984", ...
0.7514873
0
Draw the main timeline with all of the segment clusters visualized
function drawOneLine(x,y){ // Move to the location push(); translate(x,0); noStroke(); fill(220,220,220); // Draw the background gray to give the main timeline greater visual value on the page. rect(x0,y+1,x1-x0,30); // Loop through the cluster array and draw the segments for each cluster at different h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawPoints(x,y){\n // Move to the right place on the screen and scale appropriately.\n push();\n translate(270,50);\n scale(0.50);\n // Set text parameters\n stroke(157,157,157);\n strokeWeight(1);\n textSize(18);\n // Print the duration to indicate the scale of both x and y axes.\n text(str(dur...
[ "0.64897364", "0.644358", "0.6365733", "0.6268486", "0.6126599", "0.6049313", "0.60190845", "0.59603876", "0.5945211", "0.58905303", "0.5878209", "0.5853003", "0.5847129", "0.5846042", "0.5840698", "0.58145124", "0.5786975", "0.57511985", "0.5715513", "0.5713024", "0.5706566"...
0.6939358
0
Draw the metadata for the video
function drawMetaData(){ // Set text size and color fill(0); // Display the number of observers textSize(12); text('('+str(timelinesArray.length)+' Observers)',940,360); // Display the crowdsourced valence, arousal and standard deviations. textSize(13); text('Average Valence: '+valence,680,416); text...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\r\n faceDetection();\r\n background('#EEEEEE');\r\n if (start) {\r\n image(video, (width - video.width) / 2, 0);\r\n fill(color);\r\n noStroke();\r\n textSize(32);\r\n textAlign(LEFT);\r\n text(label, box.bottomLeftX, box.bottomLeftY + 32);\r\n ...
[ "0.59270334", "0.5912164", "0.58155197", "0.5753429", "0.5725025", "0.57179046", "0.5642949", "0.5622602", "0.5622602", "0.56133485", "0.5550438", "0.54965925", "0.5466276", "0.54440594", "0.5436507", "0.5430063", "0.5424934", "0.5411507", "0.5402456", "0.5391518", "0.5386059...
0.72236097
0
Draw the line and write the current video time to track the time
function drawVidLine(){ stroke(157,157,157); strokeWeight(1); line(timeTransform(vid.time()),446,timeTransform(vid.time()),494+15*(timelinesArray.length)); textSize(18); text(precise_round(vid.time(),2),timeTransform(vid.time())-20,524+15*(timelinesArray.length)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawTime() {\n buf.clear();\n buf.setColor(1);\n var d = new Date();\n var da = d.toString().split(\" \");\n var time = da[4];\n buf.setFont(\"Vector\",50);\n buf.setFontAlign(0,-1);\n buf.drawString(time,buf.getWidth()/2,0);\n buf.setFont(\"Vector\",18);\n buf.setFontAlign(0,-1);\n var date = ...
[ "0.7239647", "0.6746703", "0.667432", "0.6658477", "0.665642", "0.66520554", "0.6618375", "0.66044974", "0.6585081", "0.65500814", "0.6540675", "0.65147847", "0.65135974", "0.6497907", "0.64858043", "0.6481331", "0.6478007", "0.64629775", "0.6462604", "0.6445251", "0.64379793...
0.83756834
0
statement : ruleset | atrule;
function statement(toks, i, n, handler) { if (i < n) { var tok = toks[i]; if (tok.charAt(0) === '@') { return atrule(toks, i, n, handler, true); } else { return ruleset(toks, i, n, handler); } } else { return i; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "atrule (node) {\n }", "function parseStatement() {}", "function atrule(toks, i, n, handler, blockok) {\n var start = i++;\n while (i < n && toks[i] !== '{' && toks[i] !== ';') {\n ++i;\n }\n if (i < n && (blockok || toks[i] === ';')) {\n var s = start+1, e = i;\n if (s < n && toks[s...
[ "0.6782126", "0.5894649", "0.5660589", "0.5660589", "0.5660589", "0.5537558", "0.55053884", "0.5502482", "0.5389627", "0.5389627", "0.53702295", "0.5345973", "0.5323736", "0.5323736", "0.52945524", "0.5258047", "0.5180523", "0.51193154", "0.5094615", "0.50719273", "0.5051076"...
0.64435637
1
atrule : ATKEYWORD S any [ block | ';' S ];
function atrule(toks, i, n, handler, blockok) { var start = i++; while (i < n && toks[i] !== '{' && toks[i] !== ';') { ++i; } if (i < n && (blockok || toks[i] === ';')) { var s = start+1, e = i; if (s < n && toks[s] === ' ') { ++s; } if (e > s && toks[e-1] === ' ') { --e; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "atrule (node) {\n }", "function statement(toks, i, n, handler) {\n if (i < n) {\n var tok = toks[i];\n if (tok.charAt(0) === '@') {\n return atrule(toks, i, n, handler, true);\n } else {\n return ruleset(toks, i, n, handler);\n }\n } else {\n return i;\n }\n }", ...
[ "0.69505244", "0.5331195", "0.5331195", "0.5331195", "0.5035591", "0.50167805", "0.5013629", "0.49923754", "0.49789217", "0.49708146", "0.49629426", "0.49054393", "0.48795325", "0.48364064", "0.4732792", "0.4723318", "0.47137186", "0.46895403", "0.4666347", "0.46602008", "0.4...
0.6942652
1
declaration : property ':' S value; property : IDENT S; value : [ any | block | ATKEYWORD S ]+;
function declaration(toks, i, n, handler) { var property = toks[i++]; if (!ident.test(property)) { return skipDeclaration(toks, i, n); } var tok; if (i < n && toks[i] === ' ') { ++i; } if (i == n || toks[i] !== ':') { return skipDeclaration(toks, i, n); } ++i; if (i < n &...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseDeclaration($ast, declaration, scope) {\n var variable = {};\n\n var propertyNode = $ast(declaration).children('property');\n\n variable.declarationClean = propertyNode.value();\n variable.position = propertyNode.get(0).start;\n\n variable.declaration = '$' + variable.declarationClean;\n\n vari...
[ "0.67461866", "0.6094234", "0.5907768", "0.5907768", "0.5907768", "0.5907768", "0.5907768", "0.59065723", "0.57847434", "0.5672841", "0.5654054", "0.56495446", "0.561869", "0.5583142", "0.5583142", "0.5583142", "0.55749196", "0.55580753", "0.54995865", "0.5483692", "0.5483692...
0.64922446
1
compareFiles resolves to true until our test files are ready this allows us to test everything except the actual functionality ;)
function compareFiles(file1, file2) { return Promise.all([md5File(file1), md5File(file2)]).then( hashes => { return true } // should be: hashes[0]===hashes[1] ) //.catch(err => { throw(err) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareAllGeneratedFiles(folder) {\n const destPath = path.join(\"temp\", folder);\n utils.ensureDirectoryExists(\"temp\");\n utils.ensureDirectoryExists(destPath);\n\n const srcPath = path.join(srcPrefix, folder);\n const compPath = path.join(compPrefix, folder);\n\n site.build(srcPath, destPath, f...
[ "0.6484943", "0.6310261", "0.6078372", "0.6011794", "0.5984246", "0.59596324", "0.59119904", "0.58708817", "0.5862787", "0.5847986", "0.57467663", "0.5700304", "0.5698914", "0.56953454", "0.56935227", "0.56925434", "0.56892955", "0.56888956", "0.56189376", "0.5616838", "0.560...
0.6496419
0
Opacity change on hover
function hover_opacity() { $('.portfolio img,.content .gallery, .button, .big_button, .search_submit, .flickr_badge_image img').hover(function() { $(this).stop().animate({ "opacity": .4 }, 250); }, function() { $(this).stop().animate({ "opacity": 1 }, 250); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setHoverIndicatorOpacity (opacity) {\n }", "set HoverAlpha(value) {\n this._hoverAlpha = value;\n }", "set HoverAlpha(value) {\n this._hoverAlpha = value;\n }", "function makeOpacity(event) {\n // projectsImg.forEach(item => item.classList.add(\"opacity\"));\n // highlight the mouseove...
[ "0.7667245", "0.7527634", "0.7527634", "0.7248881", "0.72214335", "0.69793755", "0.68984437", "0.6795955", "0.67363584", "0.6712703", "0.66986763", "0.66986763", "0.66824347", "0.6676019", "0.6614729", "0.66111", "0.6594693", "0.656588", "0.65136874", "0.6507", "0.6486996", ...
0.7667835
0
Convert a pot 'fullness' ratio to a Ypixel value representing the reading
function ratio_to_y(ratio) { return Math.floor(ratio * (POT_MAX_Y - POT_MIN_Y) + POT_MIN_Y) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function yValFromPct(percent) {\n return percent * canvas.height / 100;\n}", "function ratioY() {\n\n if (y < 667) {\n return y < 568 ? 0.75 : 0.875;\n } else if (667 <= y && y < 736) {\n return 1;\n } else if (736 <= y && y < 1024) {\n return 1.1;\n } else if (1024 <= y && y < 1366 ) {\n return...
[ "0.65023625", "0.6294539", "0.59915495", "0.59765404", "0.58480245", "0.57983804", "0.56575745", "0.56320465", "0.55683327", "0.5529506", "0.551997", "0.54832864", "0.5468107", "0.54506654", "0.5421678", "0.542041", "0.5372352", "0.5360133", "0.53536236", "0.53236836", "0.532...
0.643016
1
subscribe to events from RT_SENSOR_ID
function xcoffee_subscribe(sensor_id) { console.log('** subscribing to',sensor_id); var msg_obj = { msg_type: 'rt_subscribe', request_id: 'A', filters: [ { test: "=", key: "acp_id", value: sensor_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function subscribe_to_sensor(sensor_id)\r\n{\r\n var msg_obj = { msg_type: 'rt_subscribe',\r\n request_id: sensor_id,\r\n filters: [ { test: \"=\", key: \"VehicleRef\", value: sensor_id } ]\r\n };\r\n //sock_send_str(JSON.stringify(msg_obj));\r\n rt_m...
[ "0.78838634", "0.64888436", "0.62532043", "0.61510074", "0.61351186", "0.60914296", "0.60846853", "0.60757643", "0.6062716", "0.6039392", "0.60329854", "0.6029859", "0.6012186", "0.59664536", "0.5846644", "0.5835397", "0.58109325", "0.58091897", "0.58086044", "0.57846737", "0...
0.73995286
1
draw_cyl_text() will draw a text string on a canvas as if it is wrapped around a cylinder. The basic technique is to draw the text on an internal 'working' canvas (called 'image'), and then copy vertical slices of that image to the DOM canvas with a suitable x shift (for cylinder effect) and y shift (for tilt).
function draw_cyl_text( drawing_canvas, // id of DOM canvas element on which to draw the text text, // Text string to draw text_h, text_offset_x, // px values for text height and offset from left side of cylinder text_color, // color for text fore...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw(id,text) {\n var canvas = document.getElementById(id); // define the canvas element\n var context = canvas.getContext('2d'); // define the canvas context\n canvas.width = window.innerWidth; // set canvas width to window\n canvas.height = window.innerHeight; // set...
[ "0.6320672", "0.62995416", "0.62686", "0.6163062", "0.61447036", "0.5992699", "0.5987121", "0.59467965", "0.5943208", "0.59393144", "0.5936376", "0.59282696", "0.59131527", "0.59095526", "0.5898445", "0.5895914", "0.58787674", "0.5865642", "0.58452356", "0.5837747", "0.583425...
0.89342284
0
Process the data records arrived from WebSocket or Replay Process websocket data
function handle_records(websock_data) { //console.log(websock_data); //var incoming_data = JSON.parse(websock_data); //console.log('handle_records'+json['request_data'].length); for (var i = 0; i < websock_data[RECORDS_ARRAY].length; i++) { handle_msg(websock_data[RECORDS_ARRAY][i], new ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onWebSocketMessage( data ) {\n // data = JSON.parse(data);\n // console.log('[wss]: received: %s', data.result);\n const replyData = JSON.parse(data);\n console.log('\\n===================On Message====================:');\n console.log(`url=${replyData.url}, cmd=${replyData.cmd}, uuid=${replyData.uu...
[ "0.68812114", "0.6596966", "0.6593676", "0.6513313", "0.6354786", "0.62782556", "0.6277599", "0.623715", "0.6228587", "0.6213624", "0.61798817", "0.61543345", "0.61153483", "0.6071546", "0.60669273", "0.6046331", "0.60189444", "0.60189444", "0.5999602", "0.5995768", "0.598659...
0.7365903
0
We have received a new data message from an existing sensor, so analyze and update state
function update_sensor(msg, clock_time) { // existing sensor data record has arrived //console.log('update_sensor '+clock_time); var sensor_id = msg[RECORD_INDEX]; if (get_msg_date(msg).getTime() != get_msg_date(sensors[sensor_id].msg).getTime()) { // store as latest...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init_old_status(sensor, clock_time)\r\n{\r\n sensor.old = false; // start with the assumption msg is not old, update will correct if needed\r\n update_old_status(sensor, clock_time);\r\n}", "function updateSensors(msg) {\n\tstate[msg.sensor] = msg.voltage;\n}", "function handleSensorDataUpdate(m...
[ "0.69489133", "0.68301225", "0.66284096", "0.65369695", "0.63868403", "0.63096404", "0.62523115", "0.6238817", "0.62259275", "0.61910135", "0.6177606", "0.6137792", "0.6135081", "0.6079856", "0.60517853", "0.60501623", "0.6046478", "0.60267836", "0.60202444", "0.6020223", "0....
0.7143409
0
watchdog function to flag 'old' data records records are stored in 'sensors' object
function check_old_records(clock_time) { //console.log('checking for old data records..,'); var check_time = new Date(); if (clock_time != null) { check_time = clock_time; } // do nothing if timestamp format not recognised switch (RECORD_TS_FORMAT) { case '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async refresh({recording = true, sds011 = null, sensehat = null, log = false}) {\n //Dump sensors\n const t = Date.now()\n const {records} = data\n const d = {}\n if (log)\n console.log(`${t} : refreshing data`)\n //Save data\n if (sds011) {\n ...
[ "0.65461624", "0.6331257", "0.6211763", "0.6008678", "0.5968063", "0.5931112", "0.5904917", "0.5858804", "0.5780655", "0.5780655", "0.57540536", "0.57354754", "0.5715636", "0.5695936", "0.56761473", "0.5670526", "0.56128335", "0.5582997", "0.55675834", "0.5560985", "0.5500899...
0.6842747
0
return a JS Date() from bus message
function get_msg_date(msg) { switch (RECORD_TS_FORMAT) { case 'ISO8601': return new Date(msg[RECORD_TS]); break; case 'unix': return new Date(msg[RECORD_TS]*1000); break; default: break; } return null; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "date() {\n let date = new Date();\n date.setTime(this.u64());\n return date;\n }", "function date(){\r\n let date = new Date();\r\n return date;\r\n }", "get sendDate() {\n return this.response.sendDate;\n }", "function clientDate() {\n\t\treturn new Da...
[ "0.6872192", "0.62279415", "0.61529213", "0.6149148", "0.6054249", "0.6046933", "0.5950551", "0.5931264", "0.5912063", "0.5905137", "0.5861295", "0.58335793", "0.58307964", "0.580198", "0.57942927", "0.57942927", "0.5786923", "0.57808226", "0.576506", "0.5753864", "0.57348543...
0.63999206
1
RTmonitor calls/callbacks user has clicked the 'connect' button
function rt_connect() { console.log('** connecting rtmonitor **'); rt_mon.connect(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bt_OnConnect(ok) {\n if (ok) {\n setTimeout(communicate, 100);\n //hide the connect button\n }\n else app.ShowPopup(\"Failed to connect!\");\n}", "function onConnect() {\n emitHello();\n $log.log(\"monitor is connected\");\n }", "function onConnect()...
[ "0.6890745", "0.6804335", "0.66192067", "0.6469251", "0.64428496", "0.6387599", "0.6368727", "0.6362476", "0.63016915", "0.62739384", "0.62583363", "0.62209165", "0.6210581", "0.6155669", "0.61546165", "0.61546165", "0.61517626", "0.6129001", "0.6111432", "0.6090749", "0.6082...
0.74088085
0
issue a request to server for the latest records
function request_latest_records() { //sock_send_str('{ "msg_type": "rt_request", "request_id": "A", "options": [ "latest_records" ] }'); var msg = { options: [ 'latest_records' ] }; rt_mon.request('A',msg,handle_records); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fetchNewRecords() {\n this.get('model').clear();\n this.set('page', 1);\n this.get('fetchRecords').perform();\n }", "function xcoffee_request(sensor_id)\r\n{\r\n console.log('** requesting latest message from',sensor_id);\r\n\r\n var msg_obj = { options: ['latest_records'],\r\n ...
[ "0.64057624", "0.6195701", "0.61724716", "0.5956438", "0.590322", "0.58808994", "0.58714485", "0.5803167", "0.57788414", "0.5756306", "0.5683796", "0.5661169", "0.5660652", "0.56331104", "0.56312126", "0.5604525", "0.55819404", "0.55676454", "0.5544126", "0.5537501", "0.55198...
0.76012725
0
issue a subscription to server for all records
function subscribe_all() { rt_mon.subscribe('A',{},handle_records); //sock_send_str('{ "msg_type": "rt_subscribe", "request_id": "A" }'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function subscribe(){\n performance.mark('subscribing');\n client.subscribe('payload/empty', function (err) {});\n performance.mark('subscribed');\n performance.measure('subscribing to subscribed', 'subscribing', 'subscribed');\n}", "function requestSubs() {\n loadingProgress(1);\n buildServerRequest(\...
[ "0.7021519", "0.6776661", "0.6477072", "0.6250893", "0.6168494", "0.61242455", "0.6084483", "0.6050343", "0.6033411", "0.6019224", "0.6018838", "0.60149646", "0.6003279", "0.5969925", "0.59649146", "0.5960854", "0.5952132", "0.5941414", "0.59088224", "0.59043485", "0.5903788"...
0.7715413
0
figures out what sort of class a line of text is
function getClass(line){ if (line.includes(openBrack) || line.includes(closeBrack)){ return (classStart + selectClass); } if (line.includes(closeValue)){ return (classStart + elemClass); } else { return (classStart + commentClass); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLineType(line, state) {\n let linetype = 'text'\n if (regexps.dashes.test(line)) {\n linetype = 'dashes'\n } else if (regexps.propvalue.test(line)) {\n linetype = 'propvalue'\n }\n return linetype\n}", "function lineClass(data) {\n var classes = 'team ';\n classes += team2class(data....
[ "0.68212104", "0.6075134", "0.59122866", "0.586102", "0.58548677", "0.57571065", "0.5539644", "0.5518621", "0.5508754", "0.5436252", "0.5430472", "0.5419116", "0.5419116", "0.5419116", "0.54172933", "0.53534216", "0.5346856", "0.5346856", "0.5346856", "0.5327583", "0.5319064"...
0.65348595
1