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 |
|---|---|---|---|---|---|---|
Check that connection is alive | checkConnectionIsAlive() {
// Do not allow duplicate timer
if (this.aliveTimer !== null) {
return;
}
// Ask customers once every 30sec by requesting ping.
// In response, the customer must send pong.
// Otherwise, the connection will be closed on the next test.
this.aliveTimer = setIn... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkConnection() {\n if (isConnected) {\n\n }\n\n}",
"function isConnected() {\n var now = new Date().getTime();\n board.io.reportVersion(function() {});\n if (now - board.io.dataTimeStamp > CONNECTION_TIMEOUT){\n return false;\n } else {\n return true;\n }\n}",
"function KeepConnectionA... | [
"0.6941752",
"0.68266445",
"0.678169",
"0.6761889",
"0.675537",
"0.6742335",
"0.6696123",
"0.6668151",
"0.6621643",
"0.66045415",
"0.6544136",
"0.65358",
"0.652093",
"0.65188634",
"0.6518569",
"0.65141696",
"0.65141696",
"0.6498854",
"0.6486624",
"0.6479216",
"0.6476738",
"... | 0.77764577 | 0 |
updating the chart according to which attribute was selected | function update(selectedAttribute, data)
{
d3.selectAll("svg").remove();
svg = setCanvas(selectedAttribute);
var typeofattr;
console.log("the selected attribute is:" );
arr = data.map(function(d)
{
typeofattr = typeof(d[selectedAttribute]);
console.log("type of: "+typeof(d[selectedAttribute]))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n this.updateBarChart(d3.select(\"#dataset\").property(\"value\"));\n }",
"function updateChart({ selection }) {\n if (!selec... | [
"0.67194504",
"0.6584772",
"0.6500075",
"0.64790577",
"0.64647824",
"0.64358515",
"0.6419104",
"0.64184004",
"0.6412492",
"0.63981533",
"0.63969564",
"0.6315804",
"0.631452",
"0.63066876",
"0.6291895",
"0.6290862",
"0.6286394",
"0.62808526",
"0.62427455",
"0.624195",
"0.62405... | 0.7308662 | 0 |
returns the height of a node to the furthest leaf | function get_height(node) {
if (node.children.length == 0) return 0;
else if (node.children.length == 1) return 1;
else return Math.max(get_height(node.children[0])+1, get_height(node.children[1])+1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_height (node) {\n if (!node) return 0\n return Math.max(this._height(node.left), this._height(node.right)) + 1\n }",
"function findHeight(node) {\n\tif (!node) return 0;\n\telse return Math.max(findHeight(node.left), findHeight(node.right)) + 1;\n}",
"height(node = this.root) {\r\n if (!node) return... | [
"0.7765563",
"0.77300835",
"0.77195144",
"0.7708301",
"0.76876795",
"0.7621455",
"0.75658834",
"0.7448691",
"0.74369454",
"0.7433874",
"0.7402723",
"0.7373113",
"0.7365108",
"0.73555005",
"0.7343551",
"0.73127425",
"0.7287313",
"0.7202451",
"0.7189182",
"0.7184855",
"0.717278... | 0.790653 | 0 |
if there is no error, retrieve the list of names available to search enable the drop down list of names | function getNames() {
if (this.status == 200) {
var names = this.responseText.split("\n");
var allnames = document.getElementById("allnames");
for (var i = 0; i < names.length; i++) {
var nameOption = document.createElement("option");
nameOption.value = names[i];
nameOption.innerHTML = names[i];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setList() {\r\n\t\tif (hasErrors(this)) {\r\n\t\t\thandleErrors(this);\r\n\t\t} else {\r\n\t\t\tvar nameSelect = $(\"allnames\");\r\n\t\t\tnameSelect.disabled = false;\r\n\t\t\t\r\n\t\t\tsetLoader(\"names\", \"none\");\r\n\t\t\t\r\n\t\t\tvar names = (this.responseText).split(\"\\n\");\r\n\t\t\t\r\n\t\t\tf... | [
"0.69950914",
"0.6618402",
"0.6500325",
"0.62705576",
"0.62523025",
"0.6245243",
"0.61739445",
"0.6131641",
"0.61269194",
"0.6123658",
"0.6115949",
"0.6052671",
"0.60409606",
"0.6039141",
"0.60207546",
"0.60128003",
"0.6005591",
"0.6005425",
"0.59874535",
"0.59834886",
"0.597... | 0.75885636 | 0 |
if there is no error, get popularity data for the name, if available, and display it on the page by year in bar graph format | function getRanking() {
if (this.status == 200) {
var graph = document.getElementById("graph");
var ranks = this.responseXML.querySelectorAll("rank");
var yearHeaders = document.createElement("tr");
// display the years
for (var i = 0; i < ranks.length; i++) {
var year = document.createElement("th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayData(error, data) {\n\t// create an array of unique years\n\tvar yearSet = [...new Set(data.map(function(d){ return d.year}))]\n\n\t// create an array of unique ages\n\tvar agesSet = [...new Set(data.map(function(d){ return d.age}))]\n\n\t// add another key for each object to represent the order of... | [
"0.6074287",
"0.59971327",
"0.59356487",
"0.5932172",
"0.5852749",
"0.5841779",
"0.58316875",
"0.5792559",
"0.57883775",
"0.5769708",
"0.576833",
"0.576784",
"0.5761044",
"0.5737864",
"0.57156134",
"0.57108307",
"0.5675836",
"0.5657689",
"0.56557786",
"0.5654092",
"0.5650995"... | 0.6354931 | 0 |
styles the ranking bar heights and text color if need be | function rankStyle(yearBar, ranking) {
yearBar.className = "rankingBar";
if (ranking >= 1 && ranking <= 10) {
yearBar.classList.add("topRank");
}
var barHeight;
if (ranking) {
barHeight = parseInt((1000 - ranking) / 4, 10);
} else {
barHeight = 0;
}
yearBar.style.height = barHeight + "px";
y... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateText2(text) {\n\n text\n .attr('fill', d => {\n const barColor = colorScale(d.colorIndex);\n return \"black\";\n })\n.style(\"font-size\",\"9pt\")\n.style(\"font-weight\",\"600\")\n .style('fill','#cfcfcf')\n .text(d => d.score)\n\n .attr(\"transform\",function(d) {\n ... | [
"0.689394",
"0.62302804",
"0.6132684",
"0.61012137",
"0.6004824",
"0.5969505",
"0.5885098",
"0.5865789",
"0.58346426",
"0.57887924",
"0.5786651",
"0.5785051",
"0.57432014",
"0.5725613",
"0.5716586",
"0.56898063",
"0.56828684",
"0.5653354",
"0.56446344",
"0.56430626",
"0.56119... | 0.74603367 | 0 |
Reloads the widget value using the formatted value. | refresh() {
this.content.innerHTML = this.template({
id: this.id,
value: this.customFormat(this.value),
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"redrawValue() {\n this._domControl.value = this.get('value');\n }",
"_formatField() {\n const value = this._loadValue();\n\n if (_.isFunction(this.formatValue)) {\n this.formatValue(value);\n } else {\n this.$el.text(value);\n }\n }",
"refreshDispl... | [
"0.63627326",
"0.6274239",
"0.5750908",
"0.57430285",
"0.5740532",
"0.5584432",
"0.55463773",
"0.5502487",
"0.5500695",
"0.5490982",
"0.5449049",
"0.5436413",
"0.5434021",
"0.53753906",
"0.535478",
"0.5352504",
"0.53293747",
"0.53293747",
"0.53293747",
"0.53293747",
"0.532869... | 0.6372178 | 0 |
Raise an `E_UNALLOWED_EXPRESSION` exception. Filename and expression is required to point the error stack to the correct file | function unallowedExpression(message, filename, loc) {
throw new edge_error_1.EdgeError(message, 'E_UNALLOWED_EXPRESSION', {
line: loc.line,
col: loc.col,
filename: filename,
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function unsupportedExpression(node){\n console.error(node)\n var err = new Error('Unsupported expression: ' + node.type)\n err.node = node\n throw err\n}",
"function checkRegex(fileName, pattern) {\n if (!safeRegex(pattern)) {\n console.error(chalk.red('\\nError - Potentially unsafe regular expression:'... | [
"0.57394516",
"0.5439487",
"0.5352786",
"0.5283095",
"0.52687716",
"0.5253867",
"0.5251387",
"0.5225688",
"0.5182223",
"0.5143747",
"0.5133429",
"0.50994885",
"0.50745356",
"0.50621665",
"0.5045627",
"0.5026397",
"0.5000885",
"0.49840835",
"0.49742824",
"0.49494326",
"0.49480... | 0.7583805 | 0 |
Parses the jsArg by generating and transforming its AST | function parseJsArg(parser, token) {
return parser.utils.transformAst(parser.utils.generateAST(token.properties.jsArg, token.loc, token.filename), token.filename, parser);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseFuncInstrArguments(signature) {\n var args = [];\n var namedArgs = {};\n var signaturePtr = 0;\n\n while (token.type === _tokenizer__WEBPACK_IMPORTED_MODULE_4__[\"tokens\"].name || isKeyword(token, _tokenizer__WEBPACK_IMPORTED_MODULE_4__[\"keywords\"].offset)) {\n var key =... | [
"0.57424045",
"0.56250453",
"0.5622264",
"0.5622264",
"0.55839735",
"0.55839735",
"0.5569182",
"0.5569182",
"0.5569182",
"0.5566923",
"0.55215925",
"0.55215925",
"0.5473688",
"0.5473688",
"0.54621816",
"0.54621816",
"0.54621816",
"0.54621816",
"0.54621816",
"0.54621816",
"0.5... | 0.7610365 | 0 |
sending the email senet index to get the badge value | async getEmailSent() {
return this._getBadgeValue(1)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendMail(email, navn, id) { \n let key = genKey(5)\n\n client\n .patch(id) // Document ID to patch\n .set({secKey: key}) //set the field in question\n .commit() // Perform the patch and return a promise\n .then(updatedkey => {\n console.log('Hurray, generated key is:'+key)... | [
"0.5984186",
"0.5954301",
"0.5907701",
"0.5847844",
"0.5828122",
"0.58213985",
"0.57430696",
"0.56903917",
"0.5657859",
"0.5657324",
"0.56512487",
"0.5649927",
"0.5641323",
"0.5606248",
"0.55948836",
"0.55810004",
"0.5555241",
"0.55471534",
"0.5520555",
"0.55196244",
"0.55062... | 0.64501804 | 0 |
getting the hottest country that appear at analytic page | async getHottestCountry() {
return this._getBadgeValue(3)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getAlpha(country) {\n for(var i = 0; i < this.countryCode.length; i++){\n if(this.countryCode[i][\"country-code\"] == country) {\n return this.countryCode[i][\"alpha-2\"];\n }\n }\n }",
"function google_getCountry(json) {\n return Find_Long_Name_Given_Type(\"country\", json[\"results\"... | [
"0.6748393",
"0.6563266",
"0.6540611",
"0.6538378",
"0.6434909",
"0.63603175",
"0.63182056",
"0.63157195",
"0.62197554",
"0.6214354",
"0.6173407",
"0.6162031",
"0.61509395",
"0.61211807",
"0.6112606",
"0.61101687",
"0.6083857",
"0.6049617",
"0.6046722",
"0.6027642",
"0.602572... | 0.7471945 | 0 |
document.body element.children > HTMLCollection of direct children element.classList.contains(className) | function getElementsByClassName(className) {
let body = document.body;
let results = [];
const getChildren = function(node) {
if (node.classList.contains(className)) {
results.push(node);
}
for(let i = 0; i < node.children.length; i++) {
let child = node.children[i];
if (chil... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getElementsByClassName(element, className) {\n // implement this\n let matches = []\n console.log(\"Within getElementsByClassName\")\n console.log(\"parent element contains desired className\", element.classList.contains(className))\n if (hasSpecifiedClassName(element, className)) {\n matches.push... | [
"0.71016407",
"0.6940191",
"0.6715361",
"0.666167",
"0.6471884",
"0.6448949",
"0.64310515",
"0.6393283",
"0.63493085",
"0.63089204",
"0.6270865",
"0.62154174",
"0.62154174",
"0.6203652",
"0.6182356",
"0.61667246",
"0.6159069",
"0.6152841",
"0.61467844",
"0.6137101",
"0.611293... | 0.6992024 | 1 |
Saves a regID to the db | function saveRegID(id, callback) {
var p = new profile({
regID: id,
categories: [],
offers: []
});
p.save(function (err, data) {
if (err) {
callback(err);
} else {
callback(null, data);
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function doSave (id) {\n\tif (document.forms[0].recId.value == \"\") {\n\t\talert (\"this record has no ID! please use the \\\"Record ID\\\" field and \\\"Change ID\\\" button to assign a record ID\");\n\t\treturn false;\n\t}\n\tdocument.forms[0].command.value = \"save\";\n\treturn doSubmit();\n}",
"save(data,cb... | [
"0.59339184",
"0.574476",
"0.5669584",
"0.5638353",
"0.55375314",
"0.55138636",
"0.5509728",
"0.5492708",
"0.5473278",
"0.54564875",
"0.53885424",
"0.53885424",
"0.53884643",
"0.5352557",
"0.5330652",
"0.53255737",
"0.5319203",
"0.5311657",
"0.52980787",
"0.52909005",
"0.5288... | 0.72855455 | 0 |
Retrieves all the records | function _getRecords() {
vm.loading = true;
RecordService
.getAllRecords()
.then(function(result) {
vm.items = result.data.data;
vm.totalCount = result.data.data.length;
})
.catch(function(er... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getAll () {\n\t\t// TODO: to be setup with pagination later\n\t}",
"function GetAllRecords() {\n var promiseGet = mediaService.getAllMedia(id);\n promiseGet.then(function (pl) {\n $scope.Media = pl.data;\n },\n function (errorPl) {\n $log.error('Some ... | [
"0.7303162",
"0.70960397",
"0.70893025",
"0.70455116",
"0.7044965",
"0.70360994",
"0.69911534",
"0.692462",
"0.6917007",
"0.6869732",
"0.6805182",
"0.67907864",
"0.6779518",
"0.67686933",
"0.67658377",
"0.6647439",
"0.6621789",
"0.6614474",
"0.66085035",
"0.6600444",
"0.65935... | 0.729132 | 1 |
Determins the direction the sort | function getSortDirection() {
return vm.desc ? "up" : "down";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"displaySortDirection() {\n switch (this.currentSortDir) {\n case \"asc\":\n return \"▲\";\n case \"desc\":\n return \"▼\";\n }\n }",
"function getSortDirection(values) {\n var direction = \"ascending\";\n if (values && values[0] && values[values.length - 1]) {\n... | [
"0.72300476",
"0.71239334",
"0.6875217",
"0.6851343",
"0.67812294",
"0.6716666",
"0.6700081",
"0.6643156",
"0.65837306",
"0.6566949",
"0.6548576",
"0.65189564",
"0.64497864",
"0.6423414",
"0.6423238",
"0.64141005",
"0.6408945",
"0.64053273",
"0.6375202",
"0.63665575",
"0.6326... | 0.7615428 | 0 |
draws question counting cubes | function createCubes(question) {
$('.progress').empty();
for(var i = 0; i < questions.length; i++) {
if(i > question-1) {
$('<div class="progress-cube"></div>').appendTo('.progress');
} else {
$('<div class="progress-cube" style="background: #009bc2"></div>').appendTo('.progress');
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawAnswerboxes(){\n\t\tdrawRoundRect0();\n\t\tdrawRoundRect1();\n\t\tdrawRoundRect2();\n\t\tdrawRoundRect3();\n\t}",
"function renderQuizBox() {\n renderQuestionCount();\n renderQuestion();\n renderScore();\n}",
"function paint_question(question) {\n\t\tqctx.clearRect(0, 0, $(\"#question\").width(... | [
"0.66040623",
"0.6360333",
"0.6194409",
"0.6151699",
"0.60860324",
"0.60844564",
"0.6074738",
"0.6046917",
"0.6035845",
"0.6024076",
"0.59976256",
"0.59531647",
"0.594008",
"0.5936531",
"0.59303063",
"0.5926778",
"0.59185696",
"0.58988786",
"0.5893995",
"0.5891423",
"0.588892... | 0.67382616 | 0 |
authorization for the Members of the company | function authorizeOnlyToCompanyMembers(req, res, next){
//check if member is the member of the company
const isMember = req.resources.company.members.find((member) => {
return member.toString() === req.user._id.toString();
});
if(!isMember) {
return res.status(403).json({message:'Unauth... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function authorizeOnlyToCompanyOwner(req, res, next) {\n const isOwner = req.resources.company.owner.toString() === req.user._id.toString();\n\n if (!isOwner) {\n return res.status(403).json({ message: 'Unauthorized owner of the company' });\n }\n\n next();\n}",
"authorizeAccess() {\n console.log(`... | [
"0.642786",
"0.60955685",
"0.6047417",
"0.6033609",
"0.5964197",
"0.5917673",
"0.5852297",
"0.58001226",
"0.5752569",
"0.5690086",
"0.56845194",
"0.56221986",
"0.5608393",
"0.5607142",
"0.5564978",
"0.55588436",
"0.55508685",
"0.5501844",
"0.54838187",
"0.54373866",
"0.543697... | 0.75931066 | 0 |
authorization for owner of the company | function authorizeOnlyToCompanyOwner(req, res, next) {
const isOwner = req.resources.company.owner.toString() === req.user._id.toString();
if (!isOwner) {
return res.status(403).json({ message: 'Unauthorized owner of the company' });
}
next();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function authorizeOnlyToCompanyMembers(req, res, next){\n //check if member is the member of the company \n const isMember = req.resources.company.members.find((member) => {\n return member.toString() === req.user._id.toString();\n });\n if(!isMember) {\n return res.status(403).json({mess... | [
"0.679641",
"0.61359155",
"0.613379",
"0.6088223",
"0.6013963",
"0.5988602",
"0.5945392",
"0.59409654",
"0.5929776",
"0.5917409",
"0.58383864",
"0.57897747",
"0.5789769",
"0.57731307",
"0.57648724",
"0.5758439",
"0.56536627",
"0.5648764",
"0.5638098",
"0.5636891",
"0.5619482"... | 0.7941138 | 0 |
A hack solution for the popup cycle create box | function popupCycleBox() {
var modal = document.getElementById('createcyclebox');
var span = document.getElementsByClassName("close")[0];
span.onclick = function() {
modal.style.display = "none";
}
modal.style.display = "block";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"afterShow(popup) {}",
"function InitPopupTimeRepare() {\n $('#' + Global.Element.timeprepare_Popup).on('shown.bs.modal', function () {\n $('#' + Global.Element.CreatePhasePopup).hide();\n ReloadListTimePrepare_Chooise();\n $('div.divParent').attr('currentPoppup', Global.El... | [
"0.6167675",
"0.60397184",
"0.6007914",
"0.59744287",
"0.59499514",
"0.5785325",
"0.57361543",
"0.57226646",
"0.5686194",
"0.5671243",
"0.56559217",
"0.5653548",
"0.5589469",
"0.5584152",
"0.55575764",
"0.55161226",
"0.54957473",
"0.5473069",
"0.5462321",
"0.54569834",
"0.545... | 0.68868047 | 0 |
Toggles the entire material's buttons | function toggleMaterial(buttonId) {
let elem = document.getElementById(buttonId);
let mat = buttonId.split("-")[1]
if (!elem.classList.contains("toggleOn")) { //we turned on that button, now toggle the others off
toggleButton(buttonId);
for (i = 1; i < 4; i++) {
if ("mat-" + mat ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setupToggleButtons() {\n // your code here\n}",
"function toggleAll() {\n toggleButton();\n toggleMenu();\n toggleBackground();\n}",
"toggle() {\n\n\t}",
"function toggleButtons() {\n if (paused == true) {\n // disable buttons\n plusButton.disabled = true;\n minusButton.disable... | [
"0.6704225",
"0.67010516",
"0.66522425",
"0.6641124",
"0.66225445",
"0.6611619",
"0.6537961",
"0.65148014",
"0.64971435",
"0.64867216",
"0.64743495",
"0.64462656",
"0.6386026",
"0.6314766",
"0.63054526",
"0.6283896",
"0.62527674",
"0.6238983",
"0.6237807",
"0.6202476",
"0.619... | 0.72385865 | 0 |
value of the first array, the second value of the second array, the third value of the third array, and so on... Example 1: var exampleArray = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] diagonalSum(exampleArray) // => 4 Example 2: var exampleArray = [[1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, ... | function diagonalSum(matrix) {
var output = 0;
for (var i=0; i<matrix.length; i++) {
output = output + matrix[i][i];
}
return output;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function diagonalSums(input) {\n let firstDiagonalSum = 0;\n let secondDiagonalSum = 0;\n let firstIndex = 0;\n let secondIndex = input[0].length - 1;\n\n input.forEach(array => {\n firstDiagonalSum += array[firstIndex++];\n secondDiagonalSum += array[secondIndex--];\n });\n\n co... | [
"0.75490785",
"0.689964",
"0.68412375",
"0.66664517",
"0.6525784",
"0.64966655",
"0.64697903",
"0.6449325",
"0.644923",
"0.63971174",
"0.6291435",
"0.6276513",
"0.62478065",
"0.62449956",
"0.6225275",
"0.62164706",
"0.61682594",
"0.61594474",
"0.6158955",
"0.61575717",
"0.614... | 0.7132931 | 1 |
Shows the code of the last pressed key in a small box. | function showKeyCode(e) {
console.log("Event Listener 4: keyup:");
console.log(`keyCode: ${e.keyCode}`);
keyCodeBox.textContent = e.keyCode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function keyPressed() {}",
"function showKeyPad() {\n\tbinaryString = prettyBinaryString(asBinaryString(selectedTiles));\n\tdocument.getElementById(\"show-key-pad\").click();\n}",
"function keyPress()\n {\n var keyPress = event.key;\n document.getElementById(\"p.guessnumber\").innerHTML = gues... | [
"0.64372176",
"0.6277339",
"0.6245015",
"0.62186337",
"0.619686",
"0.6152943",
"0.61170894",
"0.6107633",
"0.6098288",
"0.607078",
"0.5931318",
"0.59287536",
"0.5924648",
"0.5906863",
"0.58967245",
"0.589431",
"0.5884089",
"0.58776194",
"0.5874991",
"0.58657056",
"0.5865311",... | 0.70867205 | 0 |
Return the given info for a single shoot with the namespace/name. This ends always in a server/backend call. | getInfo ({ commit, rootState }, {name, namespace}) {
const user = rootState.user
return getShootInfo({namespace, name, user})
.then(res => res.data)
.then(info => {
if (info.serverUrl) {
const [, scheme, host] = uriPattern.exec(info.serverUrl)
const authority = `//${repla... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"info() {\n return this.endpoint.get(this.path(''));\n }",
"info(name = null) {\n if (name == null) {\n name = this.name;\n }\n let rqst = this.client.newSignedRequest('GET', `${this.urlPrefix}/${name}`, null);\n return this.client._wrapWithPromise(rqst);\n }",
"function getInfo(){\n... | [
"0.5664447",
"0.5577139",
"0.53461695",
"0.5322796",
"0.5305285",
"0.51333934",
"0.5082641",
"0.5068289",
"0.5017568",
"0.49750945",
"0.49686056",
"0.49625912",
"0.496236",
"0.4954113",
"0.493395",
"0.49150223",
"0.49001372",
"0.48796967",
"0.48586652",
"0.48563203",
"0.48550... | 0.7460338 | 0 |
Calculates and presents potential revenue of a given strategy for given candlesticks | function calculateTrades(candlesticks, strategy) {
var trades = getTrades(candlesticks, strategy);
var totalRevenue = 0;
var totalNoOfTrades = 0;
var numberOfProfitTrades = 0;
var numberOfLossTrades = 0;
var maximumLoss = 0;
for (var i = 0; i < trades.length; i++) {
var revenue;
if (stopLoss <... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calc_earnings(){\n\tvar earnings = 0;\n\tearnings += calc_facility_earnings(obj_mines);\n\tearnings += calc_facility_earnings(obj_rigs);\n\tearnings += calc_facility_earnings(obj_refineries);\n\t/* ADD_MORE_FACILITIES */\n\t//earnings += obj_player.cash * interest_multiplier;\n\treturn earnings;\n}",
"f... | [
"0.5642524",
"0.5537031",
"0.5430855",
"0.54295164",
"0.53881866",
"0.53751886",
"0.53641695",
"0.5322914",
"0.5308163",
"0.5298418",
"0.5292092",
"0.52601844",
"0.5251592",
"0.5246451",
"0.52383214",
"0.52365",
"0.52325547",
"0.52213687",
"0.52040905",
"0.5195482",
"0.518242... | 0.7260265 | 0 |
the load function is the first function called and gets the canvas and the canvas context and also starts the game music | function load() {
canvas = document.getElementById("gameCanvas");
canvas.width = 1020;
canvas.height = 512;
context = canvas.getContext("2d");
init();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"preload() {\n //sets background to dark gray\n this.cameras.main.setBackgroundColor('#262626')\n\n //sets loading text\n var loadingText;\n loadingText = this.add.text(this.game.renderer.width / 2.6, this.game.renderer.height/3, 'Loading...', { fontSize: '64px', fontFamily: 'Futu... | [
"0.7325831",
"0.71021473",
"0.7099401",
"0.6981334",
"0.6976325",
"0.6968058",
"0.694481",
"0.6937578",
"0.68663675",
"0.68547565",
"0.6836272",
"0.68075305",
"0.68028605",
"0.68021995",
"0.678954",
"0.67873895",
"0.67716825",
"0.6769855",
"0.6755336",
"0.67526865",
"0.674863... | 0.7158898 | 1 |
mouse down event changes game states when buttons clicked | function mouseDown(evt) {
switch(state){
case GameStates.START:
if (mousClickCheck(getMousePos(evt), playButton)) {
state = GameStates.TUTORIAL;
}
break;
case GameStates.TUTORIAL:
if (mousClickCheck(getMousePos(evt), tutButt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mouseDown() {\n //start music\n a.audio.startBGAudio();\n\n //If the game was paused, unpause and do nothing\n if (sm.paused) {\n sm.paused = false;\n update();\n return;\n }\n //If the game is already in the exploding state, do no... | [
"0.74131906",
"0.7340944",
"0.7292763",
"0.72862434",
"0.7254673",
"0.7219543",
"0.71427274",
"0.71197957",
"0.7108993",
"0.70854896",
"0.7045528",
"0.6992421",
"0.69843423",
"0.6942392",
"0.69124717",
"0.69090235",
"0.6837154",
"0.68234247",
"0.6822837",
"0.68134195",
"0.678... | 0.74789363 | 0 |
Grid Event gridview callback method | setGridCallbackFunc() {
this.gridView.onCurrentChanged = (grid, newIndex) => {
//Grid 내의 Cell 변경시 호출
let rowState = this.dataProvider.getRowState(newIndex.dataRow);
this.setColProperty(grid, rowState, newIndex.dataRow);
this.setGuideVisible(newIndex);
};
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function procategory_indexchange(s, e) {\n POAddEditGrid.PerformCallback();\n}",
"onRowClick() {}",
"function onGridDataSourceRequestEnd(e) {\n if (e.type == \"update\") { \n this.read();\n }\n // console.log(e.type);\n if (e.type == \"create\")\n {\n this.read(); \... | [
"0.71726364",
"0.6714426",
"0.66966677",
"0.6548888",
"0.64520437",
"0.64233154",
"0.64100426",
"0.6397716",
"0.6321261",
"0.62633437",
"0.6174368",
"0.61651146",
"0.61164623",
"0.60416913",
"0.5982521",
"0.5980288",
"0.5899372",
"0.5865651",
"0.58636266",
"0.5857625",
"0.585... | 0.7090047 | 1 |
Activity, Messages & User Note Move for LPC Function to go through ALL LPC and attempt to reassign activities, messages and user notes to Trimech LPC | function actUserNoteSubsidiaryMove()
{
var paramTrxSearchId = nlapiGetContext().getSetting('SCRIPT','custscript_sbXX_searchid'),
paramLastProcTrxId = nlapiGetContext().getSetting('SCRIPT','custscript_sbXX_lastproctrxid');
//MT EmpId:TM EmpId
EmpMap = buildEmployeeMapping();
//log('debug','EmpMap',JSON.stringify... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function take_off(){\n \n console.log(\"wp: \" + lt + \"\\t\" + ln);\n \n index = i++;\n \n //set the flight to takeoff\n var takeoff_srv = new ROSLIB.Service({\n ros: ros,\n name: 'mavros/cmd/takeoff',\n type: 'mavros_msgs... | [
"0.5434585",
"0.5398916",
"0.53598154",
"0.53583986",
"0.5239519",
"0.5135548",
"0.511833",
"0.51149035",
"0.5087274",
"0.5051226",
"0.5045092",
"0.5031573",
"0.50270635",
"0.5011956",
"0.4999747",
"0.49550316",
"0.49512944",
"0.49409944",
"0.49211156",
"0.48979065",
"0.48922... | 0.7108618 | 0 |
OPP in ISSUED ESTIMATE Status ONLY Function to go through ALL Opportunities with status of Issued Estimate ONLY This is Phase 2 Step 1 | function oppWithEstimateSubsidiaryMove()
{
var paramTrxSearchId = nlapiGetContext().getSetting('SCRIPT','custscript_sb281_searchid'),
paramLastProcTrxId = nlapiGetContext().getSetting('SCRIPT','custscript_sb281_lastproctrxid');
//MT EmpId:TM EmpId
EmpMap = buildEmployeeMapping();
//log('debug','EmpMap',JSON.str... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"determineGoalsStatus (goals, orderedAssessments, user) {\n let currentDate = new Date();\n let currentMeasurement;\n goals.forEach((goal, index) => {\n goal.latestAssessmentForGoal = [];\n \n if (orderedAssessments.length === 0 && currentDate < Date.parse(goal.timestamp)) {\n console.log... | [
"0.58473766",
"0.5468042",
"0.54582435",
"0.5416093",
"0.5385553",
"0.53614455",
"0.5338622",
"0.53356",
"0.53005415",
"0.52880985",
"0.526853",
"0.5261661",
"0.52134013",
"0.5210075",
"0.5155881",
"0.5140456",
"0.51278126",
"0.5112469",
"0.50926554",
"0.50533384",
"0.5048798... | 0.6356456 | 0 |
Helper function to SWITCH the LPC records' subsidiary 1. Load Old LPC 2. Old LPC Set custentity_ax_clonedalready to Checked 3. Old LPC Set subsidiary to TM 4. Old LPC IF New Parent ID is passed in, set parent as newParentId 5. Old LPC If Sales Rep (salesrep) is set, swap it out to Subsidiary Employee 6. Old LPC If Lead... | function switchLpcRecSub(clientId, newParentId)
{
var clientRec = nlapiLoadRecord('customer', clientId);
clientRec.setFieldValue('subsidiary', paramTRISubId);
clientRec.setFieldValue('custentity_ax_wasmoderntech','T');
//If newParentId is passed in, set it on the new record
if (newParentId)
{
clientRec.setFie... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function trxSubsidiaryMove()\n{\n\tvar paramTrxSearchId = nlapiGetContext().getSetting('SCRIPT','custscript_sb280_searchid'),\n\t\tparamLastProcTrxId = nlapiGetContext().getSetting('SCRIPT','custscript_sb280_lastproctrxid');\n\t\n\t//MT EmpId:TM EmpId\n\tEmpMap = buildEmployeeMapping();\n\t\n\t//log('debug','EmpMa... | [
"0.6464459",
"0.58768576",
"0.5506623",
"0.5487289",
"0.546003",
"0.5371567",
"0.53704023",
"0.5363314",
"0.53616416",
"0.5348392",
"0.5348392",
"0.53470457",
"0.5262882",
"0.5161124",
"0.50896376",
"0.5079102",
"0.48802587",
"0.48591188",
"0.48331526",
"0.48196256",
"0.48192... | 0.7644741 | 0 |
Grab list of all Trimech employees with ModernTech Employees. If ModernTech Reference is empty, use same ID for both | function buildEmployeeMapping()
{
var eflt = [new nlobjSearchFilter('isinactive', null, 'is','F'),
new nlobjSearchFilter('subsidiary', null, 'anyof', '1')],
ecol = [new nlobjSearchColumn('internalid').setSort(true),
new nlobjSearchColumn('custentity_ax_moderntechempref')],
ers = nlapiS... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getExternalEmployees() {\n\n idEmployee = getIdExternalEmployee();\n\n if (idEmployee)\n getExternalEmployee();\n else\n getExternalEmployeesAll();\n}",
"function getEmployees() {\n idEmployee = getIdEmployee();\n\n if (idEmployee)\n getEmployee();\n else\n ... | [
"0.61660385",
"0.5617485",
"0.55542386",
"0.55517393",
"0.5425331",
"0.540444",
"0.53793997",
"0.52568483",
"0.5183956",
"0.5120371",
"0.50975114",
"0.50534785",
"0.5039246",
"0.5032182",
"0.502642",
"0.49991843",
"0.49983755",
"0.49978533",
"0.49835286",
"0.4975587",
"0.4970... | 0.58426344 | 1 |
keeps reading lines until a line ending with token is found. returns array of lines found, not included line with token. | async _readUntil(terminator) {
var lines = []
var line = ''
// try to read what we already have buffered first
while ((line = this._popLineFromData()) != null) {
if (terminator.test(line)) {
return lines
}
lines.push(line)
}
// if we've exhausted what is buffered, wai... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function readLinesSync(fd, buf, bufferSize, nextPosition) {\n let lines = []\n let chunk = \"\"\n for (; ;) {\n const size = fs.readSync(fd, buf, 0, bufferSize, nextPosition)\n if (size === 0) {\n // end of file\n normalizeLastFileLine(lines)\n return lines\n... | [
"0.5946419",
"0.56256235",
"0.5578841",
"0.5578841",
"0.5567095",
"0.55288965",
"0.55209297",
"0.5518783",
"0.55162024",
"0.5506752",
"0.55049235",
"0.5474635",
"0.54595345",
"0.5457091",
"0.5457091",
"0.54383165",
"0.5435995",
"0.5435995",
"0.5435995",
"0.54328346",
"0.54304... | 0.59520185 | 0 |
attempts to read a line from data and either returns trimmed line or null if no data available | _popLineFromData() {
const endIndex = this.data.indexOf(HD_PROTOCOL_LINE_TERM, this.dataFromIndex)
if (endIndex == -1) {
return null
} else {
const result = this.data.slice(this.dataFromIndex, endIndex)
const newFromIndex = endIndex + HD_PROTOCOL_LINE_TERM.length
if (newFromIndex >= ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async readLine() {\n const s = await this.readLineSlice();\n if (s === null)\n return null;\n return str(s);\n }",
"async readOneLine() {\n let index = -1;\n do {\n let data = this.buffer.slice(0, this.buffe... | [
"0.686995",
"0.6415386",
"0.5859941",
"0.5840037",
"0.5765665",
"0.5603541",
"0.5564544",
"0.55031955",
"0.5483055",
"0.54779935",
"0.5465128",
"0.5465128",
"0.5465128",
"0.5443909",
"0.5361624",
"0.5353914",
"0.5331902",
"0.53172565",
"0.53172565",
"0.53172565",
"0.52941924"... | 0.6710324 | 1 |
When the animation ends, we clean the classes and resolve the Promise | function handleAnimationEnd() {
node.classList.remove(`${prefix}animated`, animationName);
resolve('Animation ended');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleAnimationEnd() {\n node.classList.remove(`${prefix}animated`, animationName, animationLength);\n resolve('Animation ended');\n }",
"function handleAnimationEnd() {\n node.classList.remove(`${prefix}animated`, animationName);\n resolve('Animation ended');\... | [
"0.7265626",
"0.72630495",
"0.72330785",
"0.7182761",
"0.7180276",
"0.7152717",
"0.7152717",
"0.71434724",
"0.6974985",
"0.6957535",
"0.69474036",
"0.6936882",
"0.6931355",
"0.6922655",
"0.6898579",
"0.67587507",
"0.67358965",
"0.667246",
"0.6667139",
"0.6595988",
"0.65507954... | 0.72899354 | 0 |
When the animation ends, we clean the classes and resolve the Promise | function handleAnimationEnd() {
node.classList.remove(`${prefix}animated`, animationName);
resolve('Animation ended');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleAnimationEnd() {\n node.classList.remove(`${prefix}animated`, animationName, animationLength);\n resolve('Animation ended');\n }",
"function handleAnimationEnd() {\n node.classList.remove(`${prefix}animated`, animationName);\n resolve('Animation ended');\... | [
"0.7265626",
"0.72630495",
"0.72330785",
"0.7182761",
"0.7180276",
"0.7152717",
"0.7152717",
"0.71434724",
"0.6974985",
"0.6957535",
"0.69474036",
"0.6936882",
"0.6931355",
"0.6922655",
"0.6898579",
"0.67587507",
"0.67358965",
"0.667246",
"0.6667139",
"0.6595988",
"0.65507954... | 0.72899354 | 1 |
The bishop has no restrictions in distance for each move, but is limited to diagonal movement. Check out the example below to see how it can move: Example For bishop = "a1" and pawn = "c3", the output should be bishopAndPawn(bishop, pawn) = true. For bishop = "h1" and pawn = "h3", the output should be bishopAndPawn(bis... | function bishopAndPawn(bishop, pawn) {
function subNum(num) {
var alphabet = ['a','b','c','d','e','f','g','h'];
return parseInt(alphabet.indexOf(num.split('')[0])+1) >= parseInt(num.split('')[1]) ? parseInt(alphabet.indexOf(num.split('')[0])+1)-parseInt(num.split('')[1]) : parseInt(num.split('')[1])-pa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bishopAndPawn(bishop, pawn) {\n const board = {\n a: 1,\n b: 2,\n c: 3,\n d: 4,\n e: 5,\n f: 6,\n g: 7,\n h: 8,\n };\n\n const bishopX = board[bishop.charAt(0)];\n const bishopY = Number(bishop.charAt(1));\n\n const pawnX = board[pawn.charAt(0)];\n const pawnY = Number(pawn.c... | [
"0.709289",
"0.65879273",
"0.61899674",
"0.6060019",
"0.6056395",
"0.5914352",
"0.5792619",
"0.5758126",
"0.5685641",
"0.56799495",
"0.5676402",
"0.5635804",
"0.5589955",
"0.5580739",
"0.55776626",
"0.5543415",
"0.55134827",
"0.5511097",
"0.55044097",
"0.54953605",
"0.5493222... | 0.68323565 | 1 |
Takes git ref arg and pushes to Gitlab remote of repo arg | function pushRef (name, owner, ref) {
var dir = getRepoWorkingDirPath(name, owner);
return git("push", [
"gitlab",
"origin/" + GITHUB_REF + ":refs/heads/" + GITHUB_REF,
"--force"
], {
cwd: dir
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pushUpdateToGitHub(){\r\n \r\n return new Promise((res, rej)=>{\r\n // add all changes to staging area\r\n\r\n let add = cp.execFile(\"git\",[\"add\", \".\"])\r\n add.stdout.on(\"data\", d=>console.log('add data: ', d))\r\n add.stderr.on(\"data\", rej);\r\n add.on(... | [
"0.67202044",
"0.6547728",
"0.653149",
"0.64282227",
"0.6175671",
"0.61120766",
"0.6076815",
"0.5801076",
"0.5779637",
"0.57764554",
"0.5583236",
"0.556946",
"0.5484545",
"0.54671484",
"0.5439765",
"0.5435566",
"0.5412919",
"0.5389505",
"0.53843516",
"0.53517264",
"0.5346919"... | 0.8052396 | 0 |
add a child application, and adjust the current one | function AddAppChild(id) {
var parent, newkid, newdiv;
var imgid, divid, div;
var offset, add;
parent = document.getElementById(id);
if(!parent) {
return
}
if(parent.className == 'approle_undecided') {
parent.className = 'approle_depth';
div = document.createElement('div');
div.className = 'approle_dep... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"DisplayChildApp(view_name, ...services) {\n var newapp = new App(view_name, this);\n var res = newapp.display(view_name);\n newapp.activate(...services);\n node_add_mixin(res, newapp);\n return res;\n }",
"function createWOChild(grp,typ,stype,cat,apNa... | [
"0.62252",
"0.6214143",
"0.56467825",
"0.56424075",
"0.5592729",
"0.557001",
"0.54968053",
"0.54756165",
"0.5472345",
"0.5383659",
"0.5382929",
"0.53775",
"0.5336505",
"0.52919686",
"0.5289486",
"0.5288348",
"0.5275303",
"0.5257315",
"0.5254195",
"0.52420604",
"0.5200392",
... | 0.6305745 | 0 |
We use this function to sync how the color is stored in the map Right now all of the colors are stored in lower case only, to be more flexible with access. | function _FormatColorForMap(color) {
return color.toLowerCase();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_getColorMaps() {\n let colorKeys = Object.keys(this.theme.colors)\n let colorObj = {}\n colorKeys.forEach(key => {\n let colors = Object.keys(this.theme.colors[key]).forEach((colorKey, idx) => {\n if (!colorObj.hasOwnProperty(this.theme.colors[key][colorKey])) {\n ... | [
"0.6936739",
"0.6496129",
"0.6348723",
"0.61293954",
"0.60547936",
"0.6018985",
"0.59903324",
"0.5975128",
"0.5970375",
"0.5944339",
"0.5944339",
"0.59438175",
"0.59419715",
"0.5940429",
"0.5913989",
"0.5897728",
"0.5892751",
"0.588793",
"0.5875136",
"0.5871863",
"0.58696145"... | 0.7124586 | 0 |
openMouth() Toggles the cat element's image source to "opened mouth" image. | function openMouth()
{
var mouthImagePath = "./images/cat-face-mouth-open.png";
var $cat = document.getElementById('cat');
$cat.src = mouthImagePath;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function closeMouth()\n{\n var mouthImagePath = \"./images/cat-face-mouth-closed.png\";\n var $cat = document.getElementById('cat');\n $cat.src = mouthImagePath;\n}",
"function chew () {\n // We can use .attr() to check the value of an attribute to\n // In this case we check if the image is the open mouth\n... | [
"0.7386577",
"0.6954831",
"0.5934801",
"0.5829658",
"0.57842463",
"0.53102016",
"0.5275932",
"0.52204335",
"0.51855785",
"0.5175595",
"0.51368785",
"0.51016814",
"0.50874233",
"0.5054077",
"0.5052563",
"0.5048897",
"0.50180477",
"0.5015176",
"0.5013185",
"0.5010152",
"0.49724... | 0.81238544 | 0 |
closeMouth() Toggles the cat element's image source to "closed mouth" image. | function closeMouth()
{
var mouthImagePath = "./images/cat-face-mouth-closed.png";
var $cat = document.getElementById('cat');
$cat.src = mouthImagePath;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openMouth()\n{\n var mouthImagePath = \"./images/cat-face-mouth-open.png\";\n var $cat = document.getElementById('cat');\n $cat.src = mouthImagePath;\n}",
"function chew () {\n // We can use .attr() to check the value of an attribute to\n // In this case we check if the image is the open mouth\n i... | [
"0.7414059",
"0.67284",
"0.6005177",
"0.59269816",
"0.54387885",
"0.540894",
"0.53270197",
"0.5324796",
"0.5317661",
"0.5295973",
"0.5264488",
"0.52409446",
"0.52369165",
"0.5203316",
"0.51707196",
"0.51671946",
"0.5159105",
"0.5126703",
"0.5100238",
"0.5071275",
"0.5068513",... | 0.824477 | 0 |
getRandomFood() Returns a random food item that we can use to trigger our Meowgies! | function getRandomFood()
{
var randomNumber = Math.floor(Math.random() * 5) + 1; //random number between 1-5
var randomFood = "food" + randomNumber; //food1
return randomFood;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function randomFood() {\n var randomIndex = Math.floor(Math.random() * favoriteFoods.length);\n console.log('My Favorite Foods : ' +favoriteFoods[randomIndex]);\n}",
"function getfood(){\n var randomfood = Math.floor((Math.random() * foodarr.length) + 0);\n setfood(foodarr[randomfood]);\n}",
"function ... | [
"0.7894832",
"0.76142335",
"0.7562519",
"0.7505646",
"0.7462691",
"0.74171543",
"0.7227576",
"0.72001255",
"0.71843505",
"0.71841455",
"0.71564144",
"0.71035796",
"0.7098328",
"0.7080564",
"0.70522285",
"0.70425206",
"0.70304334",
"0.6984076",
"0.69785136",
"0.6964878",
"0.69... | 0.78510356 | 1 |
isFoodTrigger() Returns true/false depending on if the food passed in via parameter matches the meowgieTriggerFood variable. | function isFoodTrigger(food)
{
if (food === meowgieTriggerFood) {
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkByeFood() {\n if (byeFood === false) {\n createFood();\n }\n byeFood = eatFood(byeFood);\n}",
"function detectFoodEaten() {\r\n\r\n return ( snake[0].x === foodX && snake[0].y === foodY );\r\n}",
"function checkFood(){\r\n const checkX = snake.body[snake.body.length-1][0]\r\n const... | [
"0.6541537",
"0.62294",
"0.6199209",
"0.6028983",
"0.6020706",
"0.5986826",
"0.5933301",
"0.5800739",
"0.5793319",
"0.5705808",
"0.56991917",
"0.56743944",
"0.563809",
"0.5630911",
"0.5608976",
"0.5589077",
"0.55685705",
"0.556701",
"0.55146426",
"0.5509479",
"0.55011964",
... | 0.90057 | 0 |
for gitting JSON file \brief get JSON file \param(file_name) target JSON file name \ret JSON file | function get_json(file_name) {
var requester = create_http_request();
requester.open("GET", file_name, false);
requester.send(null);
var json_text = requester.responseText;
var data = json_parser(json_text);
return data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getJsonData(file) {\n return getFile('src/data/' + path.basename(file.path) + '.json');\n}",
"function getJSONFile(){ // Local bir JSON dosyasindan veri alma\r\n \r\n fetch(\"example.json\")\r\n .then(response => response.json())\r\n .then(data => console.log(data))\r\n .catch(err => con... | [
"0.69037867",
"0.6876171",
"0.66427207",
"0.65731424",
"0.6537508",
"0.65338373",
"0.64937335",
"0.64684707",
"0.64654934",
"0.6446668",
"0.6395027",
"0.6369015",
"0.63382226",
"0.62966156",
"0.6294316",
"0.62934625",
"0.62911755",
"0.627297",
"0.6262652",
"0.62416905",
"0.62... | 0.72275394 | 0 |
getResource Loads multiple Script and CSS resources from the specified URL. a call back is called when all the resources are loaded. | function getResource(url, callback, type) {
var head = document.getElementsByTagName("head")[0],
done = false,
elem,
splitUrl = url.split(',');
type = type || 'script';
if (splitUrl.length > 0) {
for (var i = 0; i < splitUrl.length; i++) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadResources(resources, callback){\n\t\t// summary:\n\t\t//\t\tLoads one or more JavaScript files asynchronously. When complete,\n\t\t//\t\tthe first scene is pushed onto the stack.\n\t\t// resources:\n\t\t//\t\tAn array of module names, e.g. 'dojox.mobile.AlertDialog'\n\n\t\tvar resource;\n\t\tvar url;\... | [
"0.68523896",
"0.68523896",
"0.66508335",
"0.6435082",
"0.6264417",
"0.6231822",
"0.62006366",
"0.619159",
"0.6188395",
"0.6099885",
"0.60929257",
"0.60929257",
"0.60929257",
"0.5955582",
"0.5880348",
"0.5870506",
"0.58586955",
"0.58412355",
"0.582213",
"0.5813261",
"0.576443... | 0.68804675 | 0 |
gets the product matching skin type and sub category | getSubCategoryProduct(skinType, categoryProducts, subCategory, regimenProducts) {
Object.keys(categoryProducts).some((productId, index) => {
let containsAllTypes = false;
let product = categoryProducts[productId];
// console.log(product);
let productSkinTypes = pr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getCategoryProduct(skinType, categoryProducts, category, regimenProducts) {\n Object.keys(categoryProducts).some((productId, index) => {\n let containsAllTypes = false;\n let product = categoryProducts[productId];\n // console.log(product);\n let productSkinTypes ... | [
"0.63638115",
"0.60010266",
"0.5898376",
"0.57568103",
"0.55382293",
"0.55322444",
"0.5502524",
"0.5446256",
"0.53973293",
"0.5387022",
"0.5386614",
"0.5383971",
"0.5319338",
"0.5296659",
"0.5284651",
"0.52561873",
"0.5237901",
"0.5228387",
"0.52232087",
"0.519901",
"0.517983... | 0.6538985 | 0 |
gets the product matching skin type and category | getCategoryProduct(skinType, categoryProducts, category, regimenProducts) {
Object.keys(categoryProducts).some((productId, index) => {
let containsAllTypes = false;
let product = categoryProducts[productId];
// console.log(product);
let productSkinTypes = product[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getSubCategoryProduct(skinType, categoryProducts, subCategory, regimenProducts) {\n Object.keys(categoryProducts).some((productId, index) => {\n let containsAllTypes = false;\n let product = categoryProducts[productId];\n // console.log(product);\n let productSkin... | [
"0.6027637",
"0.56028765",
"0.5591811",
"0.55711156",
"0.55562866",
"0.5554568",
"0.55459166",
"0.54025275",
"0.53862345",
"0.537031",
"0.5338751",
"0.532348",
"0.53194475",
"0.5315758",
"0.529216",
"0.5266929",
"0.5262372",
"0.5230586",
"0.5228365",
"0.52151424",
"0.5211489"... | 0.63235503 | 0 |
Funcion de tweeteo principal | function tweetIt() {
var tweet = new Tweet(false);
//Seleccionamos la fuente
tweet.source = randomSource();
console.log("source: "+tweet.source);
//GET tweet
var count = randomCount();
T.get('statuses/user_timeline', { screen_name: tweet.source, count: count, tweet_mode: 'extended' }, function (err, data, respon... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tweetIt(txt){ \n\n\tvar tweet = { \n\t\tstatus: txt \n\t};\n\n\tT.post('statuses/update', tweet, tweeted);\n\n\n\tfunction tweeted (err, data, response) {\n\t if (err){\n\t \tconsole.log(\"Algo salio mal!!!\");\n\t } else{\n\t console.log(\"Esto trabaja.\")\n\t}\n\t}\n}",
"function tweetIt(txt) {\n ... | [
"0.7713041",
"0.74774307",
"0.7048379",
"0.7014332",
"0.700326",
"0.6989796",
"0.69626117",
"0.6930456",
"0.69239986",
"0.68718725",
"0.68508196",
"0.68508196",
"0.68224347",
"0.6807704",
"0.6805629",
"0.67982167",
"0.6794874",
"0.67946315",
"0.67944115",
"0.67799646",
"0.673... | 0.7804578 | 0 |
postIt: Postea el tweet | function postIt(tweet){
T.post('statuses/update', {status: tweet.finalText}, function (err, data, response) {
if(!err){
console.log("Posteado :)");
}else{
console.log(err);
console.log("Retrying :(");
tweetIt();
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tweetIt(txt){ \n\n\tvar tweet = { \n\t\tstatus: txt \n\t};\n\n\tT.post('statuses/update', tweet, tweeted);\n\n\n\tfunction tweeted (err, data, response) {\n\t if (err){\n\t \tconsole.log(\"Algo salio mal!!!\");\n\t } else{\n\t console.log(\"Esto trabaja.\")\n\t}\n\t}\n}",
"function tweetPost(){\n ... | [
"0.755297",
"0.7551255",
"0.7537153",
"0.7317691",
"0.72879696",
"0.7251358",
"0.7216018",
"0.72065485",
"0.70415306",
"0.70214707",
"0.69489676",
"0.6943159",
"0.6845899",
"0.68274766",
"0.6824094",
"0.68119586",
"0.6795904",
"0.6795771",
"0.6787411",
"0.6729337",
"0.6728231... | 0.7874843 | 0 |
postReply: Reply del tweet Nota: Si se agrega como parametro in_reply_to_status_id: tweet.tweetID, | function postReply(tweet){
T.post('statuses/update', {status: tweet.finalText, in_reply_to_status_id: tweet.tweetID}, function (err, data, response) {
if(!err){
console.log("Reply correcto :)");
}else{
console.log("Retrying Reply :(");
console.log(err);
replayIt();
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function statusReply() {\n\tbot.post('statuses/update', {status: 'test post', in_reply_to_status_id: '916121511961989120'}, \n\t\tfunction(err, data, response)\n\t\t{\n\t\t\tif (err) {\n\t\t\t\tconsole.log(\"Bummer, there's an error: \" + err);\n\t\t\t} else {\n\t\t\t\tconsole.log(data);\n\t\t\t\tconsole.log(data.... | [
"0.7632819",
"0.75353163",
"0.7205137",
"0.6386067",
"0.6381216",
"0.603789",
"0.58801615",
"0.58487344",
"0.5844772",
"0.5836543",
"0.57622856",
"0.5759621",
"0.5715309",
"0.57038987",
"0.5702071",
"0.56599826",
"0.56567293",
"0.560698",
"0.5600803",
"0.5565702",
"0.5540514"... | 0.80026305 | 0 |
randomSource: Busca aleatoreamente una fuente de twitter. Si justPeople existe, se retorna solo usuarios que son personas, no medios de comunicacion. | function randomSource(justPeople){
if(justPeople == undefined){
return sourcesArray[Math.floor(Math.random() * sourcesArray.length)];
}else{
return sourcesArray[Math.floor(Math.random() * sourcesArray.length - 19) + 19];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function randomUsers() {\n usersModule.getUsers(getRandomUsers);\n}",
"function getFirstMentionedUser(msg) {\n return msg.mentions.members.random();\n}",
"function chooseRandomPerson() {\n var randomPerson = classRoster[getRandomNum(classRoster.length)];\n return randomPerson;\n}",
"function randPhot... | [
"0.6138557",
"0.6080545",
"0.5888899",
"0.5788051",
"0.5685995",
"0.5542444",
"0.5542061",
"0.551996",
"0.55029744",
"0.5500809",
"0.5497429",
"0.5494894",
"0.5494196",
"0.548806",
"0.54863507",
"0.5484249",
"0.5480178",
"0.54769987",
"0.54699117",
"0.5462749",
"0.54420507",
... | 0.7113522 | 0 |
randomCount: Busca aleatoreamente un contador | function randomCount(){
return Math.floor(Math.random() * 10) + 1 ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateVoteCount() {\n return Math.floor(Math.random() * 50 + 15);\n //Math.random() used with Math.floor() can be used to return random integers.\n //Math.floor(Math.random() * 10) returns a random integer between 0 and 9 (both included):\n //Math.floor(Math.random() * 10) + 1; // returns a... | [
"0.68963754",
"0.68141526",
"0.6667013",
"0.6665901",
"0.6643345",
"0.6631384",
"0.65638334",
"0.6507297",
"0.6482199",
"0.6475987",
"0.64620966",
"0.6384334",
"0.63744086",
"0.6370019",
"0.6369797",
"0.6367626",
"0.63623357",
"0.635429",
"0.6348245",
"0.6333825",
"0.63259244... | 0.7932046 | 0 |
Creates an instance of AdsManager with a given placementId and adsToRequest. Default number of ads to request is `10`. AdsManager will become loading ads immediately | constructor(placementId: string, adsToRequest: number = 10) {
this.placementId = placementId;
this.adsToRequest = adsToRequest;
this._listenForStateChanges();
CTKNativeAdManager.init(placementId, adsToRequest);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AdManagerFactory() {\n var logger = new Logger_1.Logger(\"AdManagerFactory\");\n var currentAdManager;\n var sandbox;\n function init(box) {\n sandbox = box;\n sandbox.subscribe(\"ads:configureAds\", configureAds);\n return this;\n }\n function destroy(box) {\n ... | [
"0.46140647",
"0.42079738",
"0.41163808",
"0.41158247",
"0.40356433",
"0.40149686",
"0.40140587",
"0.3972739",
"0.3967586",
"0.3966129",
"0.3964717",
"0.39445525",
"0.39427915",
"0.39048254",
"0.39028203",
"0.38644016",
"0.38554677",
"0.38314405",
"0.37996542",
"0.3797985",
"... | 0.7263477 | 0 |
Listens for AdManager state changes and updates internal state. When it changes, callers will be notified of a change | _listenForStateChanges() {
nativeAdEmitter.addListener('CTKNativeAdsManagersChanged', managers => {
const isValidNew = managers[this.placementId];
const isValid = this.isValid;
if (isValid !== isValidNew && isValidNew) {
this.isValid = true;
this.eventEmitter.emit(EVENT_DID_BECOME... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateAdvert(ad){\n this.setState({currentAd: ad})\n document.getElementById('101').textContent = 'Update';\n this.refreshList()\n }",
"update() {\n this._checkEvents();\n }",
"onStateChange() {\n\t\t// brute force update entire UI on store change to keep demo app simple\n\t\tthis.forceUpda... | [
"0.5744114",
"0.54561263",
"0.5448993",
"0.5370647",
"0.530963",
"0.52808166",
"0.5280463",
"0.52713937",
"0.52158237",
"0.52031684",
"0.51824",
"0.51651853",
"0.5110067",
"0.51066566",
"0.51031333",
"0.51029515",
"0.50982195",
"0.50962126",
"0.50924426",
"0.5089802",
"0.5064... | 0.67504984 | 0 |
Disables auto refreshing for this native ad manager | disableAutoRefresh() {
CTKNativeAdManager.disableAutoRefresh(this.placementId);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static disableAutoUpdate() {\n\t\tTestFairyBridge.disableAutoUpdate();\n\t}",
"stopAutomaticRefresh() {\r\n this.clearAccessTokenTimer();\r\n this.clearIdTokenTimer();\r\n }",
"disableAutoReload() {\n this.autoReload = false;\n }",
"function disableInitialLoadAndMakeA9Request() {\n... | [
"0.68844616",
"0.68635255",
"0.6808118",
"0.60896254",
"0.60247576",
"0.6001985",
"0.59906",
"0.58415717",
"0.5784897",
"0.57775503",
"0.57707715",
"0.57707715",
"0.57571036",
"0.5752943",
"0.5742014",
"0.56908077",
"0.5649325",
"0.5649325",
"0.5649325",
"0.5649325",
"0.56486... | 0.87239105 | 0 |
Set the native ads manager caching policy. This controls which media from the native ads are cached before the onAdsLoaded is called. The default is to not block on caching. | setMediaCachePolicy(cachePolicy: AdManagerCachePolicy) {
CTKNativeAdManager.setMediaCachePolicy(this.placementId, cachePolicy);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async setCacheEnabled(enabled = true) {\n await this._frameManager.networkManager().setCacheEnabled(enabled);\n }",
"async setCacheEnabled(enabled = true) {\n await __classPrivateFieldGet(this, _CDPPage_frameManager, \"f\").networkManager.setCacheEnabled(enabled);\n }",
"static noCache() { ... | [
"0.56338286",
"0.55712545",
"0.5195689",
"0.5083554",
"0.4992255",
"0.49366906",
"0.49101022",
"0.48259154",
"0.4825392",
"0.4746243",
"0.47278616",
"0.4689305",
"0.46881345",
"0.46606082",
"0.4656076",
"0.464549",
"0.46163696",
"0.46131763",
"0.45698744",
"0.45588508",
"0.45... | 0.7735027 | 0 |
create a function that displays the previous players info | function previous(){
for(let i = playersArray.length; i >= 0; i--){
if(playerIndex === 0){
playerIndex = playersArray.length;
}
playerIndex --;
image.src = srcArray[playerIndex];
name.innerHTML = nameArray[playerIndex];
position.innerHTML = positionArray[playerIndex];
bi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showPreviousGames() {\n $('#games').empty();\n $.get('/games').done(function(savedGames) {\n savedGames.data.forEach(createPrevGameButton);\n });\n}",
"function playerHistory(allPlayers){\n //Get player history\n var allPlayers = JSON.parse(localStorage.getItem(\"player\"));\n \n\n... | [
"0.65876985",
"0.65789783",
"0.657591",
"0.65588284",
"0.6468266",
"0.6423946",
"0.6325736",
"0.6306881",
"0.62955797",
"0.6285246",
"0.6285231",
"0.6269755",
"0.6245749",
"0.622262",
"0.6196657",
"0.6190423",
"0.6185583",
"0.61626875",
"0.6146098",
"0.6142698",
"0.61388576",... | 0.70883536 | 0 |
END : View Record Details Function / BeGIN : Sort Record Up Button Function | function FuncRecordSortUp(RecordID)
{
document.getElementById("DataID").value = RecordID;
document.getElementById("PageAction").value = "SortUp";
document.form_name.action = "admin_set.php?Action=ActionSortUp";
document.form_name.submit();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function FuncRecordSortDown(RecordID)\n {\n document.getElementById(\"DataID\").value = RecordID;\n document.getElementById(\"PageAction\").value = \"SortDown\";\n document.form_name.action = \"admin_set.php?Action=ActionSortDown\";\n document.form_name.submit();\n }",
"function sortArtworkColumn(fieldNa... | [
"0.6655502",
"0.65647984",
"0.6350093",
"0.62701076",
"0.6171147",
"0.616239",
"0.61512125",
"0.61375976",
"0.6112058",
"0.6109382",
"0.6109058",
"0.6101446",
"0.607295",
"0.60586005",
"0.60529137",
"0.60417956",
"0.60372305",
"0.6034069",
"0.5998768",
"0.5998768",
"0.5989482... | 0.681349 | 0 |
Loops through an array of DOMElements and allows to set on data type of them all to a specific value. | function setDataOfArray(array, data_type, data) {
for (let i=0; i < array.length; i++) {
array[i][data_type] = data;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setElementsText(type, value) {\n this.getElementsByQuery(`[data-type=${type}]`)\n .forEach(element => element.textContent = value);\n }",
"setValue(values) {\n return this.eachSet(isIValueElementNode, ({ node, value }) => node.setValue(value), values);\n }",
"function arrMutation... | [
"0.60238945",
"0.56978357",
"0.56840575",
"0.55313",
"0.54319793",
"0.5361883",
"0.5345927",
"0.53167206",
"0.5238206",
"0.51182544",
"0.5080945",
"0.5075308",
"0.5056515",
"0.50398433",
"0.50325584",
"0.50143534",
"0.49989527",
"0.4978884",
"0.49747095",
"0.4964672",
"0.4959... | 0.5893734 | 1 |
Get a jQuery Element as HTML | function outerHtml ($el) {
var $tmp = $('<div></div>');
$tmp.append($el);
return $tmp.html();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getHTML(element) {\n const wrapper = document.createElement('div');\n wrapper.appendChild(element);\n return wrapper.innerHTML;\n}",
"function outerHTML(element) {\n if (element.outerHTML) {\n return element.outerHTML;\n } else {\n var twrap = document.createElement(\"div\");\... | [
"0.6776107",
"0.62651676",
"0.62487257",
"0.618442",
"0.61415416",
"0.614008",
"0.614008",
"0.61394817",
"0.61394817",
"0.61394817",
"0.611346",
"0.6089146",
"0.6089146",
"0.6089146",
"0.6089146",
"0.6086903",
"0.60596484",
"0.6057237",
"0.6057237",
"0.60469174",
"0.6040409",... | 0.67895573 | 0 |
End the writable destination | function onend () {
dest.end();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_end(destroy) {\n const source = this._source;\n if (source) {\n source.removeListener('end', destinationCloseWhenDone);\n source.removeListener('error', destinationEmitError);\n source.removeListener('readable', destinationFillBuffer);\n delete source._des... | [
"0.7078315",
"0.68206555",
"0.6763765",
"0.6763765",
"0.6763765",
"0.6702362",
"0.6691577",
"0.6489662",
"0.6480258",
"0.64272827",
"0.6411184",
"0.6390918",
"0.63900405",
"0.6379913",
"0.6379913",
"0.6379913",
"0.6379913",
"0.6379913",
"0.6379913",
"0.6379913",
"0.6379913",
... | 0.7887258 | 0 |
Unpipe when there is an error in the destination writable | function onerror (err) {
unpipe();
if (EventEmitter.listenerCount(dest, 'error') === 0) {
dest.emit('error', err);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onerror(er) {\n unpipe();\n if (dest.listeners('error').length === 0)\n dest.emit('error', er);\n }",
"function onerror(er) {\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }",
"function... | [
"0.7282203",
"0.7138843",
"0.7138843",
"0.7138843",
"0.7138843",
"0.7116514",
"0.7116514",
"0.7116514",
"0.7116514",
"0.7116514",
"0.7116514",
"0.7116514",
"0.7116514",
"0.7116514",
"0.7116514",
"0.7116514",
"0.7116514",
"0.7116514",
"0.7116514",
"0.7116514",
"0.7116514",
"... | 0.7393463 | 0 |
find record from images table according to product | async findImagebyId (id) {
const selectQuery = "SELECT * FROM `product_image` where productId = ?";
return (await Lib.execute(selectQuery, [id]));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getProductsWithImages() {\n\tknexInstance\n\t\t.select('product_id', 'name', 'price', 'category', 'image')\n\t\t.from('amazong_products')\n\t\t.whereNotNull('image')\n\t\t.then(result => {\n\t\t\tconsole.log(result)\n\t\t})\n}",
"function getProductsWithImages() {\n knexInstance\n .select(\"product_... | [
"0.67546266",
"0.6416663",
"0.6335924",
"0.6158158",
"0.59710264",
"0.5902125",
"0.5895474",
"0.5890666",
"0.5828194",
"0.58225423",
"0.58120465",
"0.5796483",
"0.5771364",
"0.57672846",
"0.5767192",
"0.5762276",
"0.5717342",
"0.57071424",
"0.5695411",
"0.5691885",
"0.5671639... | 0.70981437 | 0 |
Set background color and shadow to the cell US | function setStyle (row, bgColor) {
row[0].style.backgroundColor = bgColor
row[0].style.boxShadow = '1px 3px 5px #4c928b'
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"tileRollOver() {\r\n this.style('background-color', '#f7e22a');\r\n }",
"function changeToYellow(){\n activeCell.style.background = \"yellow\";\n}",
"function darkCell() { \n var me = $(this);\n data = me.data();\n me.css(\"backgroundColor\",data.backgroundColor);\n // me.css(\"borderColor\",\"rgb(2... | [
"0.63453376",
"0.62992096",
"0.6246886",
"0.61625314",
"0.6133014",
"0.605287",
"0.60336214",
"0.6011495",
"0.5981621",
"0.5971379",
"0.5960637",
"0.59043926",
"0.5870136",
"0.5866764",
"0.5848764",
"0.5793539",
"0.5789364",
"0.5787654",
"0.57852083",
"0.57832783",
"0.5766989... | 0.77016 | 0 |
LIBRAIRIE DES TESTS prefixe 'tu_' pour tests unitaires | function tu_test_unitaire1(){
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_test() {\n\n }",
"registerTests() {}",
"addBaseName(tests, baseName) {\n for (let test of tests) {\n if (test.tests) {\n this.addBaseName(test.tests, baseName + '-' + test.name);\n } else {\n this.tests.push({ name: baseName + '-' + test.name, test });\n }\n }\n }",
"fun... | [
"0.66891927",
"0.6420813",
"0.6310106",
"0.62493086",
"0.6032492",
"0.5993198",
"0.59765196",
"0.5963011",
"0.5952795",
"0.58163905",
"0.5785436",
"0.57787085",
"0.5764853",
"0.5760073",
"0.5745528",
"0.573717",
"0.5696103",
"0.5672747",
"0.56725997",
"0.5649185",
"0.56484425... | 0.7296168 | 0 |
prefixe 'tf_' pour tests fonctionnels | function tf_test_fonctionnel1(){
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_test() {\n\n }",
"function TF(){}",
"function FrameworkUnitTest() {}",
"function tu_test_unitaire1(){\n\t\t\n\t}",
"function makeTestId(prefix) {\n return clsPrefix.bind(null, prefix);\n}",
"function exposeTestFunctionNames() {\n return [ 'testSetup', 'testTeardown'\n , 'testWithValidAr... | [
"0.6083748",
"0.5984473",
"0.570819",
"0.56152946",
"0.5563927",
"0.55332226",
"0.55121255",
"0.5447511",
"0.54457074",
"0.541964",
"0.5405125",
"0.5401448",
"0.5367433",
"0.5357888",
"0.53047514",
"0.5285304",
"0.5261372",
"0.5198677",
"0.51965964",
"0.5179498",
"0.51709145"... | 0.73251885 | 0 |
prefixe 'tm_' pour tests metiers | function tm_test_metier1(){
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tu_test_unitaire1(){\n\t\t\n\t}",
"function m(t)\n {\n if (!t)\n t = \"aosmevbtihgfp\";\n t = t.charAt(rnd(t.length));\n var name = t + rnd(OBJECTS_PER_TYPE);\n switch(rnd(16)) {\n case 0: return m(\"o\") + \".\" + name;\n case 1: return m(\"g\") + \".\" + name;\n case... | [
"0.5998571",
"0.5543238",
"0.5543238",
"0.5543238",
"0.5543238",
"0.5543238",
"0.53491473",
"0.534891",
"0.53117603",
"0.52151674",
"0.5174124",
"0.5151732",
"0.51069295",
"0.5105264",
"0.5105264",
"0.5105264",
"0.510339",
"0.5100259",
"0.50894606",
"0.50894606",
"0.50894606"... | 0.7205962 | 0 |
Returns a translated version of `world` where all objects' positions have been shifted over by [`x`, `y`]. | _getWorldTranslatedBy(world, x, y) {
const newWorld = JSON.parse(JSON.stringify(world));
let objects = newWorld.actualShips.concat(newWorld.apparentShips);
objects = objects.concat(newWorld.staticObjects);
for (const object of objects) {
const position = object.position;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"worldToLocal(world) {\r\n let m = this.matrix;\r\n let a = m.a, b = m.c, c = m.b, d = m.d;\r\n let invDet = 1 / (a * d - b * c);\r\n let x = world.x - m.tx, y = world.y - m.ty;\r\n world.x = (x * d * invDet - y * b * invDet);\r\n world.y = (y * a * ... | [
"0.6661631",
"0.60721946",
"0.602892",
"0.59828377",
"0.5946115",
"0.59317154",
"0.5929687",
"0.5855575",
"0.5709128",
"0.57049215",
"0.5699866",
"0.5683875",
"0.56779593",
"0.56772876",
"0.5675901",
"0.5605912",
"0.5604074",
"0.5543393",
"0.5473678",
"0.5460068",
"0.5435364"... | 0.7973561 | 0 |
Returns a copy of `world` where all coordinates have been normalized, which is to say translated so that the world coordinates of the canvas origin (the top left corner) are in sector 0,0. This reduces rounding errors when drawing objects. | _getNormalizedWorld(world) {
const normalizedWorld = world;
this._worldOrigin = new WorldPoint(this._trueWorldOrigin.x, this._trueWorldOrigin.y);
let xTranslation = 0;
let yTranslation = 0;
while (this._worldOrigin.x < -SECTOR_SIZE_IN_WORLD_UNITS) {
xTranslation += SE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"worldToLocal(world) {\r\n let m = this.matrix;\r\n let a = m.a, b = m.c, c = m.b, d = m.d;\r\n let invDet = 1 / (a * d - b * c);\r\n let x = world.x - m.tx, y = world.y - m.ty;\r\n world.x = (x * d * invDet - y * b * invDet);\r\n world.y = (y * a * ... | [
"0.731759",
"0.66066325",
"0.65202814",
"0.63363063",
"0.6181207",
"0.61578393",
"0.60019374",
"0.5993309",
"0.589316",
"0.5854838",
"0.58526206",
"0.5818893",
"0.5814489",
"0.57460105",
"0.5740176",
"0.5738863",
"0.56856483",
"0.5657132",
"0.5652279",
"0.56233853",
"0.558748... | 0.8300831 | 0 |
Loads data into `computer` based on the pending user command and data. For example, if a jump has been committed in the UI, loads the jump destination into the computer and marks the jump as committed. | _executeUserCommands(computer) {
if (this._userCommand === UserCommand.JUMP) {
computer.selectingJumpTarget = false;
computer.jumpCommitted = true;
computer.jumpDestination = Positions.getPositionForWorldPoint(this._trueMousePosition);
}
this._userCommand = Us... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"load() {\n if (this.state !== TileState.IDLE && this.state !== TileState.ERROR) {\n return;\n }\n this.state = TileState.LOADING;\n this.changed();\n\n const self = this;\n this.loader_()\n .then(function (data) {\n self.data_ = data;\n self.state = TileState.LOADED;\n ... | [
"0.5327703",
"0.5209873",
"0.5068079",
"0.4926999",
"0.49249673",
"0.49186367",
"0.4902899",
"0.48909882",
"0.48886544",
"0.48792124",
"0.48429763",
"0.48308256",
"0.48252973",
"0.48168945",
"0.48040798",
"0.4794275",
"0.47590387",
"0.47587115",
"0.47586995",
"0.47533923",
"0... | 0.5947481 | 0 |
Sets the UI mode based on the state of `computer`. For example, if the computer indicates that the player is selecting a jump target, we will set our UI mode to JUMP_TARGET. | _setUIMode(computer) {
if (computer.selectingJumpTarget) {
this._uiMode = UIMode.JUMP_TARGET;
}
else {
this._uiMode = UIMode.SELECT;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ToggleMode()\n{\n var Mode = get_uiMode();\n if (Mode==\"none\") set_uiMode(\"mini\");\n if (Mode==\"mini\") set_uiMode(\"full\");\n if (Mode==\"full\") set_uiMode(\"none\"); \n}",
"function setGameModeClassic(){\n gameMode = 'classic';\n openNameScreen();\n}",
"function toggle_mode(){\n\t... | [
"0.6423186",
"0.59979665",
"0.59415495",
"0.585918",
"0.5781083",
"0.5700638",
"0.5692036",
"0.56443745",
"0.5630029",
"0.5601957",
"0.5555901",
"0.5504137",
"0.54947644",
"0.5489668",
"0.5476289",
"0.5455209",
"0.5443236",
"0.5423692",
"0.5385671",
"0.5382877",
"0.5375993",
... | 0.71846086 | 0 |
DOM event handler for mouse wheel zoom. Scales the world up or down and recenters it on the mouse location when the wheel event occurred. | _wheelHandler(event) {
const canvasRect = this._canvas.getBoundingClientRect();
const localX = event.x - canvasRect.left;
const localY = event.y - canvasRect.top;
const mouseWorldCoords = this._toTrueWorldCoordinates(localX, localY);
let deltaY = event.deltaY;
if (event.d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onMouseWheel(e){\n\t\t\t\t\t var center = getOffset(e), delta = e.deltaY / 5000;\n \t\tgrapher.zoom((zoomRatio = 1 + delta), center); // Call zoom with the ratio and center.\n \t\tgrapher.update().render(); // Render the graph\n \t\tcurrent_transform = grapher.transform(); // save th... | [
"0.7660186",
"0.743785",
"0.7421236",
"0.74028426",
"0.7126117",
"0.71146095",
"0.7013605",
"0.69852465",
"0.6922099",
"0.68908244",
"0.68475693",
"0.6814788",
"0.67339283",
"0.67302793",
"0.66623074",
"0.66517115",
"0.66503185",
"0.6601594",
"0.65866",
"0.6582807",
"0.653811... | 0.77765703 | 0 |
Renders all the static object (planets, moons, etc) in the world. Also draws an exclusion zone around the object that indicates where the jump drive may not be safely used due to a gravitational acceleration of >= 1m/s^2. | _drawStaticObjects(world, ctx) {
ctx.save();
ctx.lineWidth = this._ppxToWorldUnits(1.0);
for (const staticObject of world.staticObjects) {
ctx.save();
const rawPosition = Positions.getWorldPointForPosition(staticObject.position);
if (!this._isOnscreen(new Worl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function start(){\n var engine = Engine.create(), world = engine.world;\n engine.world.gravity.y = -1;\n var gravity = engine.world.gravity;\n\n var render = Render.create({\n //element: document.body,\n canvas: document.querySelector('#myCanvas'),\n engine: engine,\n options: {\n width: 1000,... | [
"0.68187135",
"0.64644325",
"0.63862216",
"0.6380459",
"0.6351201",
"0.63020325",
"0.6246906",
"0.619824",
"0.6186791",
"0.61398983",
"0.6137107",
"0.61144257",
"0.6098607",
"0.60718894",
"0.6041534",
"0.5978894",
"0.59651065",
"0.595733",
"0.59486425",
"0.5932947",
"0.592995... | 0.7417972 | 0 |
Renders all the ships in the world. The apparent positions of the ships from the point of view of the player ship will be rendered. | _drawShips(world, ctx) {
ctx.save();
ctx.setLineDash([]);
// Debugging: draw actual ship positions too, but in a dimmer color.
for (const ship of world.actualShips || []) {
ctx.save();
const rawPosition = Positions.getWorldPointForPosition(ship.position);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawShips() {\n var ship;\n\n //clear each frame\n ctx.clearRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);\n\n //Render ships to canvas \n for (var i = 0; i < MAX_SHIPS; i++) {\n ship = ships[i];\n ctx.drawImage(ship.img, ship.x, ship.y);\n if ... | [
"0.7137351",
"0.67056406",
"0.6639949",
"0.6490939",
"0.64108115",
"0.6302232",
"0.6228164",
"0.62183607",
"0.61957186",
"0.6174534",
"0.6051599",
"0.6039593",
"0.59196186",
"0.5896782",
"0.5888553",
"0.58486885",
"0.5815944",
"0.58038366",
"0.5795002",
"0.5790817",
"0.574593... | 0.69147843 | 1 |
Renders any sector boundaries that are visible on the map. Sector boundaries are drawn with solid lines, and subsector boundaries (1/60 sector, aka one light second) are drawn with dotted lines. | _drawSectors(ctx) {
ctx.save();
ctx.lineWidth = this._ppxToWorldUnits(1.0);
ctx.strokeStyle = '#006600';
const extents = this._getNormalizedExtentsInWorldUnits();
if (extents.width < LIGHT_MINUTE_IN_WORLD_UNITS) {
const firstLineX = Math.trunc(extents.left / LIGHT_SEC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"drawBounds(ctx) {\n if (this.showBounds) {\n const lineDashOffset = Math.round(Date.now() / 100) % 8;\n // Draw bounds polygon\n const boundsPolygon = this.getSceneBoundsPolygon();\n ctx.save();\n ctx.beginPath();\n boundsPolygon.draw(ctx);\n... | [
"0.63278556",
"0.60816044",
"0.5948278",
"0.5750838",
"0.56912935",
"0.5613232",
"0.5587789",
"0.5578773",
"0.55527955",
"0.55176157",
"0.54710317",
"0.5445679",
"0.54061806",
"0.53955525",
"0.53787667",
"0.53675663",
"0.5336458",
"0.53164977",
"0.5270088",
"0.52275264",
"0.5... | 0.616603 | 1 |
Renders a label at a given world space point. | _drawLabelAtWorldSpacePoint(ctx, text, point, options) {
ctx.save();
// Draw this in screen space.
this._setScreenSpaceTransform(ctx);
let offset = 0;
if (options) {
if (options.fillStyle) {
ctx.fillStyle = options.fillStyle;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function write_label(_x, _y, text, _color) {\n context.fillStyle = _color;\n context.fillText(text, _x + 2, _y - 2);\n}",
"function drawLabel(x, y){\n pointCount++;\n context.font = \"bold 16px Arial\";\n context.fillText(pointCount, (x+12), y);\n }",
"function drawLabel(text, ali... | [
"0.69208205",
"0.6775944",
"0.6482634",
"0.64471596",
"0.6438914",
"0.6395329",
"0.63225454",
"0.6310234",
"0.63080406",
"0.62852055",
"0.62668115",
"0.6241448",
"0.6194659",
"0.6187613",
"0.6178931",
"0.608176",
"0.6077067",
"0.60461336",
"0.6027006",
"0.60042506",
"0.598804... | 0.77979684 | 0 |
Returns a readonly reference to the player ship. | _getPlayerShip(world) {
const playerShip = world.actualShips.find((ship) => ship.exists && ship.isPlayerShip);
if (!playerShip) {
throw new Error('Player ship not found in ships list!');
}
return playerShip;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getShip(shipId) {\n return this._ships.get(shipId);\n }",
"function Ship() {\n this.load = loadShip(this);\n\n this.start = _.bind(this.start, this);\n this.load = _.bind(this.load, this);\n this.down = _.bind(this.down, this);\n}",
"function getShip() {\n\tvar ships : GameObject[] = GameObject.F... | [
"0.6403693",
"0.62512857",
"0.62436265",
"0.62383837",
"0.61781657",
"0.6014235",
"0.5884009",
"0.57781726",
"0.57385784",
"0.56861156",
"0.5664298",
"0.56133354",
"0.560363",
"0.55833954",
"0.55829424",
"0.55764025",
"0.5523457",
"0.5523242",
"0.5519984",
"0.551294",
"0.5458... | 0.6743984 | 0 |
Draws the jump targeting UI, if and only if we are in JUMP_TARGET UI mode. The jump targeting UI consists of a large circle representing the maximum jump radius, and a small ellipse indicating the 95% confidence interval of the jump destination around the current mouse position. Both of these are calculated using the p... | _drawJumpTarget(world, ctx) {
if (this._uiMode !== UIMode.JUMP_TARGET) {
return;
}
ctx.save();
// Draw max jump radius.
// TODO: Only draw as much of the arc as is visible on screen.
const extents = this._getNormalizedExtentsInWorldUnits();
const playe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startJump(viewId, d, jump, optionalArgs) {\n removePopovers(viewId);\n\n // calculate new predicates\n var predDict = jump.predicates.parseFunction()(d, optionalArgs);\n var predArray = [];\n var numLayer = getCanvasById(jump.destId).layers.length;\n for (var i = 0; i < numLayer; i++)\n ... | [
"0.5556395",
"0.5478627",
"0.54333484",
"0.5417308",
"0.54106677",
"0.54069",
"0.54023665",
"0.5393885",
"0.53593564",
"0.5344064",
"0.53265107",
"0.53178984",
"0.528283",
"0.52649224",
"0.52267486",
"0.52254695",
"0.5159994",
"0.515487",
"0.51502645",
"0.51437193",
"0.512826... | 0.76356864 | 0 |
Draws some text indicating the scale of the map, specifically the distance between the left and right edges of the canvas in world space. | _drawScale(ctx) {
ctx.save();
// Draw this in screen space.
this._setScreenSpaceTransform(ctx);
const extents = this._getNormalizedExtentsInWorldUnits();
let text = '';
if (extents.width > LIGHT_MINUTE_IN_WORLD_UNITS / 10) {
text = `${this._distanceFormatter.f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showMapScale(evt) {\n var currentScale = map.getScale().toLocaleString();\n var currentScaleText = \"<b>Map Scale is 1 : \" + currentScale + \"</b>\";\n dojo.byId(\"mapScale\").innerHTML = currentScaleText;\n }",
"function points(){\n\ttextSize(20);\n\ttext(points2,820,84);\n}"... | [
"0.6867028",
"0.6377608",
"0.629475",
"0.62024826",
"0.6122631",
"0.60722476",
"0.60509354",
"0.59825563",
"0.5964094",
"0.5948849",
"0.59428024",
"0.5936678",
"0.59305346",
"0.5913021",
"0.5894803",
"0.587401",
"0.58660173",
"0.586233",
"0.5838691",
"0.58298814",
"0.5811054"... | 0.7115111 | 0 |
Given a rectangle in world coordinates, draws hatching lines within that rectangle. Only lines that at least partially appear inside the current viewport will be drawn. This does not reset the graphics context, so it will use whatever line style is currently set on the context, and you can fill other shapes by setting ... | _drawHatchingInRect(ctx, rect) {
const extents = this._getNormalizedExtentsInWorldUnits();
for (let x = rect.left - rect.height; x <= rect.right; x += this._lpxToWorldUnits(4.0)) {
if (x + rect.height > extents.left && x <= extents.right) {
ctx.moveTo(x, rect.top);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"drawLines () {\n const halfW = Math.ceil(this.width/2);\n const halfH = Math.ceil(this.height/2);\n this.graphics.s(this.color);\n for (var i = -halfW; i <= halfW; i+=this.blockSize) {\n this.graphics.mt(i, -halfH).lt(i, halfH);\n }\n for (var i = -halfH; i <= halfH; i+=this.blockSize) {\n ... | [
"0.6317222",
"0.6216698",
"0.60027266",
"0.58411",
"0.58131105",
"0.57708734",
"0.57295007",
"0.5693324",
"0.56188107",
"0.55877036",
"0.5587327",
"0.5583003",
"0.5570984",
"0.55629385",
"0.5533379",
"0.5530152",
"0.55197704",
"0.55126566",
"0.5507565",
"0.55048543",
"0.54699... | 0.74219656 | 0 |
Returns the normalized world coordinates of the left edge of the canvas. See the section on normalization in the class documentation for more details. | _getCanvasLeftInNormalizedWorldUnits() {
return this._worldOrigin.x;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get screenLeft() {\n if (Engine.client === exports.Client.Electron)\n return GameWindow.browserWindow.getPosition()[0];\n else\n return Engine.graphics.canvas.getBoundingClientRect().left;\n }",
"_getCanvasLeftInTrueWorldUnits() {\n return this._trueWorldOrigi... | [
"0.72466916",
"0.7245714",
"0.7215212",
"0.7191019",
"0.71112144",
"0.7096841",
"0.69661",
"0.69063854",
"0.6843398",
"0.6778584",
"0.670358",
"0.66538894",
"0.6606494",
"0.65931964",
"0.6486255",
"0.6335659",
"0.6335659",
"0.62878454",
"0.6210142",
"0.6148477",
"0.6146434",
... | 0.8116184 | 0 |
Returns the normalized world coordinates of the top edge of the canvas. See the section on normalization in the class documentation for more details. | _getCanvasTopInNormalizedWorldUnits() {
return this._worldOrigin.y;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get screenTop() {\n if (Engine.client === exports.Client.Electron)\n return GameWindow.browserWindow.getPosition()[1];\n else\n return Engine.graphics.canvas.getBoundingClientRect().top;\n }",
"function topEdge(obj){\n\tvar topEdge\n\ttry {\n\t\ttopEdge = obj.positio... | [
"0.66818196",
"0.6537894",
"0.6392668",
"0.6391444",
"0.63347244",
"0.6145159",
"0.6144971",
"0.6076075",
"0.60574615",
"0.6052469",
"0.6050906",
"0.59085953",
"0.5882969",
"0.58405507",
"0.5823294",
"0.5727145",
"0.56743103",
"0.56663936",
"0.5640317",
"0.55895615",
"0.55207... | 0.75768614 | 0 |
Returns the true world coordinates of the left edge of the canvas. See the section on normalization in the class documentation for more details. | _getCanvasLeftInTrueWorldUnits() {
return this._trueWorldOrigin.x;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_getCanvasLeftInNormalizedWorldUnits() {\n return this._worldOrigin.x;\n }",
"get screenLeft() {\n return Math.floor(this.worldX - this.displayWidth / 2 / this.displayZoom);\n }",
"static get screenLeft() {\n if (Engine.client === exports.Client.Electron)\n return GameWindow.bro... | [
"0.8233243",
"0.73987466",
"0.7278504",
"0.7174583",
"0.71583366",
"0.7108009",
"0.6933633",
"0.68852717",
"0.68590415",
"0.6834669",
"0.6759591",
"0.67173207",
"0.6645594",
"0.6550693",
"0.6532072",
"0.64827615",
"0.64827615",
"0.6390027",
"0.6339224",
"0.6325712",
"0.628907... | 0.7800889 | 1 |
Returns the true world coordinates of the top edge of the canvas. See the section on normalization in the class documentation for more details. | _getCanvasTopInTrueWorldUnits() {
return this._trueWorldOrigin.y;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_getCanvasTopInNormalizedWorldUnits() {\n return this._worldOrigin.y;\n }",
"static get screenTop() {\n if (Engine.client === exports.Client.Electron)\n return GameWindow.browserWindow.getPosition()[1];\n else\n return Engine.graphics.canvas.getBoundingClientRect().t... | [
"0.7805272",
"0.67542183",
"0.65024745",
"0.645257",
"0.6406501",
"0.63364905",
"0.62621254",
"0.6192971",
"0.6173168",
"0.61705583",
"0.6124181",
"0.6097825",
"0.5937998",
"0.58693767",
"0.58334434",
"0.58323026",
"0.57567984",
"0.5675341",
"0.56544757",
"0.5649885",
"0.5634... | 0.72798574 | 1 |
Returns the width of the canvas in world units. | _getCanvasWidthInWorldUnits() {
return (1.0 / this._scaleFactor) * CANVAS_WIDTH_PX;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get worldWidth()\n {\n if (this._worldWidth)\n {\n return this._worldWidth;\n }\n\n return this.width / this.scale.x;\n }",
"get screenWorldWidth()\n {\n return this.worldWidth * this.scale.x;\n }",
"get screenWidthInWorldPixels()\n {\n return... | [
"0.83098847",
"0.7890109",
"0.7871457",
"0.752178",
"0.7490953",
"0.743992",
"0.738876",
"0.7363384",
"0.73210186",
"0.7315054",
"0.72779655",
"0.7260949",
"0.7251509",
"0.71438473",
"0.70431083",
"0.7041687",
"0.69477093",
"0.6941623",
"0.69349587",
"0.6927267",
"0.68622714"... | 0.88523954 | 0 |
Returns the height of the canvas in world units. | _getCanvasHeightInWorldUnits() {
return (1.0 / this._scaleFactor) * CANVAS_HEIGHT_PX;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get worldHeight()\n {\n if (this._worldHeight)\n {\n return this._worldHeight;\n }\n\n return this.height / this.scale.y;\n }",
"get screenHeightInWorldPixels()\n {\n return this.screenHeight / this.scale.y;\n }",
"get screenWorldHeight()\n {\n ... | [
"0.83120733",
"0.79711044",
"0.79574513",
"0.7767746",
"0.7517489",
"0.73026985",
"0.72066253",
"0.7120162",
"0.7086802",
"0.7037179",
"0.7027921",
"0.6998795",
"0.6963822",
"0.6955002",
"0.69154775",
"0.6888907",
"0.682922",
"0.6792461",
"0.6746004",
"0.6635746",
"0.6625856"... | 0.84921074 | 0 |
Overwrites the transformation matrix on `ctx` with a default matrix based on the current scale factor and normalized world origin. This will be the matrix that translates normalized world coordinates into screen space physical pixels based on the player's chosen viewport. | _setWorldSpaceTransform(ctx) {
ctx.setTransform(1, 0, 0, 1, 0, 0);
const extents = this._getNormalizedExtentsInWorldUnits();
ctx.scale(window.devicePixelRatio * this._scaleFactor, window.devicePixelRatio * this._scaleFactor);
ctx.translate(-extents.left, -extents.top);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"applyWorldTransform(ctx) {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.scale(this.displayZoom, this.displayZoom);\n ctx.translate(-this.screenLeft, -this.screenTop);\n }",
"_setScreenSpaceTransform(ctx) {\n ctx.setTransform(window.devicePixelRatio, 0, 0, window.devicePixelRatio, 0, 0);\n }",
... | [
"0.75941426",
"0.7112096",
"0.6235564",
"0.6229523",
"0.6213908",
"0.6001805",
"0.59918904",
"0.59672034",
"0.5885931",
"0.5847191",
"0.57867134",
"0.5761748",
"0.5757662",
"0.5757619",
"0.5728441",
"0.57104677",
"0.57104677",
"0.5676471",
"0.56741285",
"0.5673087",
"0.549975... | 0.7344273 | 1 |
Overwrites the transformation matrix on `ctx` with a default matrix that maps from screen space logical pixels to screen space physical pixels. This will be the matrix that allows drawing to the canvas directly in screen space. | _setScreenSpaceTransform(ctx) {
ctx.setTransform(window.devicePixelRatio, 0, 0, window.devicePixelRatio, 0, 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"applyWorldTransform(ctx) {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.scale(this.displayZoom, this.displayZoom);\n ctx.translate(-this.screenLeft, -this.screenTop);\n }",
"function getNewViewToScreenMatrix(canvas){\n\n var sx = canvas.width / 8.0;\n var sy = -canvas.height / 8.0; // the screen... | [
"0.6875932",
"0.6867585",
"0.6702932",
"0.617615",
"0.60028625",
"0.5911458",
"0.57445693",
"0.5730972",
"0.5644077",
"0.55848926",
"0.55822515",
"0.55761755",
"0.5567349",
"0.55584145",
"0.55452335",
"0.5497953",
"0.5401702",
"0.53951246",
"0.5356797",
"0.53535366",
"0.53486... | 0.7398777 | 0 |
Returns whether the given normalized world space rectangle at least partially intersects with the current viewport. | _isOnscreen(rect) {
const extents = this._getNormalizedExtentsInWorldUnits();
return rect.left <= extents.right && rect.right >= extents.left &&
rect.top <= extents.bottom && rect.bottom >= extents.top;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isInViewport(rect, viewport) {\r\n if(!rect || (rect.width <= 0 || rect.height <= 0)) {\r\n return false;\r\n }\r\n return rect.bottom > 0 &&\r\n rect.right > 0 &&\r\n rect.top < viewport.height &&\r\n rect.left < viewport.width;\r\n }",
... | [
"0.7011066",
"0.65028447",
"0.649964",
"0.6424644",
"0.64088327",
"0.63416046",
"0.63122576",
"0.6228653",
"0.6207325",
"0.61948097",
"0.6173064",
"0.61607957",
"0.6119229",
"0.6119029",
"0.6117139",
"0.6111808",
"0.610863",
"0.6062064",
"0.60581845",
"0.6053304",
"0.6051107"... | 0.71493727 | 0 |
Returns a rectangle giving the viewport extents in normalized world coordinates. | _getNormalizedExtentsInWorldUnits() {
const rect = new WorldRect();
rect.left = this._getCanvasLeftInNormalizedWorldUnits();
rect.top = this._getCanvasTopInNormalizedWorldUnits();
rect.right = rect.left + this._getCanvasWidthInWorldUnits();
rect.bottom = rect.top + this._getCanva... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_getTrueExtentsInWorldUnits() {\n const rect = new WorldRect();\n rect.left = this._getCanvasLeftInTrueWorldUnits();\n rect.top = this._getCanvasTopInTrueWorldUnits();\n rect.right = rect.left + this._getCanvasWidthInWorldUnits();\n rect.bottom = rect.top + this._getCanvasHeightI... | [
"0.712658",
"0.6880628",
"0.67002666",
"0.6496405",
"0.6491132",
"0.6448059",
"0.6448059",
"0.6448059",
"0.6448059",
"0.6448059",
"0.63832283",
"0.62768304",
"0.6246685",
"0.6222012",
"0.61973387",
"0.6189813",
"0.6189813",
"0.6189813",
"0.6189813",
"0.6168596",
"0.6159036",
... | 0.7696956 | 0 |
Returns a rectangle giving the viewport extents in true world coordinates. | _getTrueExtentsInWorldUnits() {
const rect = new WorldRect();
rect.left = this._getCanvasLeftInTrueWorldUnits();
rect.top = this._getCanvasTopInTrueWorldUnits();
rect.right = rect.left + this._getCanvasWidthInWorldUnits();
rect.bottom = rect.top + this._getCanvasHeightInWorldUnit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_getNormalizedExtentsInWorldUnits() {\n const rect = new WorldRect();\n rect.left = this._getCanvasLeftInNormalizedWorldUnits();\n rect.top = this._getCanvasTopInNormalizedWorldUnits();\n rect.right = rect.left + this._getCanvasWidthInWorldUnits();\n rect.bottom = rect.top + this... | [
"0.75175",
"0.70082676",
"0.6979909",
"0.66433215",
"0.66183156",
"0.6559922",
"0.65416837",
"0.6533828",
"0.6502785",
"0.6446932",
"0.6441726",
"0.6441726",
"0.6441726",
"0.6441726",
"0.6441726",
"0.6315881",
"0.63091147",
"0.6304803",
"0.6304803",
"0.6304803",
"0.6304803",
... | 0.7598942 | 0 |
Disables the editing of feedback session details. | function disableEditFS(){
// Save then disable fields
getCustomDateTimeFields().each(function(){
$(this).data('last', $(this).prop('disabled'));
});
$('#form_editfeedbacksession').
find("text,input,button,textarea,select").prop('disabled', true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static disableFeedbackForm() {\n\t\tTestFairyBridge.disableFeedbackForm();\n\t}",
"function disable() {\n enabled = false;\n }",
"function disable() {\n enabled = false;\n }",
"function disable() {\n enabled = false;\n }",
"disableAdminM... | [
"0.6924245",
"0.6228927",
"0.6228927",
"0.620207",
"0.6165572",
"0.6164679",
"0.61288774",
"0.61209184",
"0.61209184",
"0.6073077",
"0.60677224",
"0.60659236",
"0.60249907",
"0.5942789",
"0.59169364",
"0.5886746",
"0.5886746",
"0.5886746",
"0.5886746",
"0.58791",
"0.58402",
... | 0.6359915 | 1 |
Disable question fields and "save changes" button for the given question number, and shows the edit link. | function disableQuestion(number) {
$('#questionTable'+number).find('text,button,textarea,select,input').attr("disabled", "disabled");
$('#questionTable'+number).find('#mcqAddOptionLink').hide();
$('#questionTable'+number).find('#msqAddOptionLink').hide();
$('#questionTable'+number).find('.removeOp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enableEditing() {\n $('#editBtn').hide();\n $('#viewSetting').prop('disabled', false);\n $('#updateBtn').show();\n $('#titleHeader').text(\"Edit Student Form\");\n}",
"function enableQuestion(number){\n $('#questionTable'+number).find('text,button,textarea,select,input').\n not('[name=\"re... | [
"0.65885025",
"0.6513285",
"0.6443073",
"0.6389821",
"0.6373199",
"0.63692945",
"0.6192445",
"0.61787295",
"0.60183465",
"0.60139173",
"0.6003847",
"0.6003847",
"0.59839135",
"0.5962198",
"0.59463465",
"0.5943303",
"0.5935244",
"0.5902188",
"0.5889423",
"0.58804274",
"0.58741... | 0.7541485 | 0 |
Formats all questions to hide the "Number of Recipients Box" when participant type is not STUDENTS OR TEAMS, and show it when it is. Formats the label for the number box to fit the selection as well. | function formatNumberBoxes(){
disallowNonNumericEntries($('input.numberOfEntitiesBox'), false, false);
disallowNonNumericEntries($('input.minScaleBox'), false, true);
disallowNonNumericEntries($('input.maxScaleBox'), false, true);
disallowNonNumericEntries($('input.stepBox'), true, false);
disallowN... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatNumberBox(value, qnNumber) {\n if (value == \"STUDENTS\" || value == \"TEAMS\") {\n $(\"div.numberOfEntitiesElements\"+qnNumber).show();\n if(value == \"STUDENTS\") {\n $(\"span#\"+FEEDBACK_QUESTION_NUMBEROFENTITIES+\"_text_inner-\"+qnNumber).html(\"students\");\n ... | [
"0.6658523",
"0.5869954",
"0.5830297",
"0.56487226",
"0.547007",
"0.5456885",
"0.54315585",
"0.54308885",
"0.54171",
"0.5349519",
"0.5337927",
"0.53262705",
"0.5321635",
"0.5309343",
"0.53017527",
"0.5291431",
"0.52797526",
"0.5274031",
"0.5260277",
"0.52463657",
"0.5240844",... | 0.6279909 | 1 |
Hides/shows the "Number of Recipients Box" of the question depending on the participant type and formats the label text for it. | function formatNumberBox(value, qnNumber) {
if (value == "STUDENTS" || value == "TEAMS") {
$("div.numberOfEntitiesElements"+qnNumber).show();
if(value == "STUDENTS") {
$("span#"+FEEDBACK_QUESTION_NUMBEROFENTITIES+"_text_inner-"+qnNumber).html("students");
} else {
$("... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setupQuestion(question) {\n txtQuestion.value = question.QuestionText;\n divAnswers[0].style.display = 'block';\n if (question.QuestionType == 'Choice') {\n divAnswers[1].style.display = 'block';\n } else if (question.QuestionType == 'Range'){\n divAnswers[2].style.display = 'blo... | [
"0.5854153",
"0.583436",
"0.5800984",
"0.5610258",
"0.5509931",
"0.5460858",
"0.54303294",
"0.5429118",
"0.53917485",
"0.53481007",
"0.534644",
"0.533797",
"0.5316655",
"0.53141075",
"0.5275866",
"0.5265592",
"0.52482164",
"0.5215692",
"0.51985824",
"0.51910627",
"0.5184294",... | 0.6031801 | 0 |
Pushes the values of all checked check boxes for the specified question into the appropriate feedback question parameters. | function tallyCheckboxes(qnNumber){
// update hidden parameter FEEDBACK_QUESTION_SHOWRESPONSESTO
var checked = [];
$('.answerCheckbox'+qnNumber+':checked').each(function () {
checked.push($(this).val());
});
$("[name="+FEEDBACK_QUESTION_SHOWRESPONSESTO+"]").val(checked.toString());
// upda... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function prepareQuestions(v)\n{\n\n\tif(v.checked)\n\t\t{\n\t\tquestionsCount++;\n\t\tselectedQuestions=selectedQuestions+v.value+\",\";\n\t\t}\n\telse{\n\t\tquestionsCount--;\n\t\tvar a=selectedQuestions.split(\",\");\n\t\tselectedQuestions=\"\";\n\t\tif(a.length>=2)\n\t\tfor(var i=0;i<a.length-1;i++)\n\t\t\t{\n\... | [
"0.67609507",
"0.62047637",
"0.62047637",
"0.62047637",
"0.62047637",
"0.62047637",
"0.62047637",
"0.62047637",
"0.62047637",
"0.62047637",
"0.62047637",
"0.62047637",
"0.62047637",
"0.62047637",
"0.62047637",
"0.62047637",
"0.62047637",
"0.61878043",
"0.61849093",
"0.6176463",... | 0.65517557 | 1 |
Shows the new question div frame and scrolls to it | function showNewQuestionFrame(type){
copyOptions();
prepareQuestionForm(type);
$('#questionTableNew').show();
enableNewQuestion();
$('#addNewQuestionTable').hide();
$('#empty_message').hide();
$('html, body').animate({scrollTop: $('#frameBodyWrapper')[0].scrollHeight}, 1000);
$('#questio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addScrollToQuestionDiv() {\n //add scroll to question div logic read question div innerHTML ,read inter html of question and set it blank, create new div and add scroll to it , set question inner HTML\n if (mode == \"test\" || mode == \"retake\" || mode == \"review\" || mode == \"study\") {\n var e... | [
"0.6787345",
"0.6783777",
"0.6659948",
"0.66348547",
"0.6463052",
"0.6456688",
"0.6390842",
"0.63516366",
"0.6317095",
"0.6308236",
"0.62742853",
"0.6266475",
"0.6236483",
"0.62244165",
"0.6183368",
"0.61640805",
"0.61011094",
"0.6097478",
"0.60917914",
"0.6091198",
"0.609117... | 0.71024686 | 0 |
Copy options(Feedback giver, recipient, and all check boxes from the previous question | function copyOptions() {
//There's no need to previous question to copy options from.
if($("div[class*='questionTable']").size() < 2){
return;
}
//FEEDBACK GIVER SETUP
var $prevGiver = $("select[name='givertype']").eq(-2);
var currGiver = $("select[name='givertype']").last();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populateProductSpecificQuestionsFromCopy(productAttributes) {\n var productSpecificQuestions = newRequestFactory.productSpecificQuestions;\n for (var i = 0; i < (productSpecificQuestions || []).length; i++) {\n //console.debug(productSpecificQuestions[i].pr... | [
"0.6069468",
"0.59888494",
"0.5884622",
"0.5843396",
"0.58317703",
"0.58317703",
"0.58317703",
"0.58317703",
"0.5824106",
"0.5814778",
"0.5793672",
"0.5793672",
"0.5793672",
"0.5793672",
"0.5793672",
"0.5793672",
"0.5793672",
"0.5793672",
"0.5793672",
"0.5793672",
"0.5793672"... | 0.76467013 | 0 |
Get the friendly (printable) name of the calling file. | function getFriendlyCallerName() {
var friendlyName = 'unknown';
var err = new Error();
var originalPrepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = function (err, stack) {
return stack;
};
try {
var currentfile = err.stack.shift().getFileName();
while (err.stack.length)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showFilename(){\n return __filename\n}",
"name(file) { // 以源文件名字及格式输出\n if (isDev) {\n return '[name].[ext]';\n }\n return '[name].[hash:8].[ext]';\n ... | [
"0.7251546",
"0.68352425",
"0.6820627",
"0.6654049",
"0.65362406",
"0.6354346",
"0.63533944",
"0.62760943",
"0.61234736",
"0.61061066",
"0.6090486",
"0.60433215",
"0.59714323",
"0.593638",
"0.5913574",
"0.5883676",
"0.5857421",
"0.5820701",
"0.5818332",
"0.5809517",
"0.580360... | 0.6966601 | 1 |
end isPermission begin createSubject | function createSubject(vm , callBack){
var httpOptions = {
method : 'post',
url : rootPath + "/postdoctorSubject/createdSubject",
data : vm.subject
}
var httpSuccess = function success(response){
if(callBack != undefined... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function shareSubjectFactory() {\n return new Subject[\"a\" /* Subject */]();\n}",
"create (data, params) {\n const query = params.query\n const context = params.resourcesService.context\n // Make hook usable with query params as well\n const scopeName = data.scope || query.scope // Get scope name... | [
"0.58504575",
"0.5794734",
"0.56990826",
"0.55931836",
"0.5510621",
"0.5500784",
"0.5500784",
"0.5500784",
"0.5420454",
"0.53878313",
"0.53878313",
"0.53878313",
"0.53293294",
"0.52806294",
"0.5235048",
"0.52337426",
"0.52155054",
"0.52001756",
"0.519287",
"0.51630044",
"0.51... | 0.606552 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.