query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Apply a matrix to normals if node contains a model. | function applyMatrixToNormals(matrix) {
if(this.model !== null) {
this.model.applyMatrixToNormals(matrix);
}
} | [
"function updateNormals() {\n const teapotVars = teapotRef();\n const transformationMatrix = AppState.programs.global.worldMatrix;\n\n // Invert our current transformation matrix\n const inverseMatrix = glMatrix.mat4.create();\n glMatrix.mat4.invert(inverseMatrix, transformationMatrix);\n\n // Tra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
applying properties to ThingMark widget | function applyThingMarkProperties(widget, vrSession) {
const thingMarkImage = vrSession[widget.name + '-image'];
if (thingMarkImage && thingMarkImage.properties !== undefined) {
if (thingMarkImage.properties.decal !== undefined) {
widget.SetDecal(parseBool(thingMarkImage.properties.decal));
... | [
"function updateFromPropertyEditor(marknum, property, propValue) {\n\t//If activeAttachmentClass, work on that\n\tif(activeAttachmentClass!==undefined) {\n\t\t$(\"g#\" + activeAttachmentClass + \" text\").attr(property, propValue);\n\t\t//declutter marks when you update a property of them\n\t\tsetTimeout(function()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this method creates the `Config` folder | createConfigFolder() {
// check if folder `Config` already exists
if (!fs.existsSync(`${this.config}`)) {
// create `Config` folder
fs.mkdirSync(`${this.config}`);
return;
}
console.error(`${this.config} folder already exists`);
} | [
"function initializConfig () {\n checkAndCreateDir(files.configFolder);\n let defaultConfig = {\n current : 'default',\n configurations : [{name : 'default', file: 'default'}]\n };\n checkAndCreatefile(files.configJson, defaultConfig); \n}",
"function createCon... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize main vairables and html elements | function init() {
initializeVariables();
initializeHtmlElements();
} | [
"function SetMainElements() {\n stage_cur = \"main\";\n console.log(\"Setting up main elements...\");\n HTML.topLeft.mDiv.empty();\n HTML.topRight.mDiv.empty();\n HTML.prompt.mDiv.empty();\n HTML.buttonList.mDiv.empty();\n\n\n var $iTopLeft = ModifyText(HTML.topLeft.main);\n HTML.topLeft.mDi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Move grid from one position to another | function moveGrid(from, to) {
let fromGrid = getGrid(from);
let toGrid = getGrid(to);
let type = null;
if (getGridClass(from).includes('wall-grid')) {
type = 'WALL';
}
if (getGridClass(from).includes('point-grid')) {
type = 'POINT';
}
if (getGridClass(from).includes('pacman-grid')) {
type = 'PACMAN';
}
... | [
"function moveTile(currentGrid, pos_from, pos_to) {\n const newGrid = new Grid(shape);\n newGrid.g = currentGrid.g + 1;\n newGrid.parent = currentGrid;\n for (let i = 0; i < currentGrid.arr.length; i++) {\n newGrid.arr[i] = new Array(shape);\n for (let j = 0; j < currentGrid.arr[i].length; j++) {\n n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verify that the hash calculated is valid | verifyHash(hash) {
return (0, _sha2.default)(this.index + this.previousHash + this.timestamp + this.nonce) == hash;
} | [
"async validate() {\n // Get current hash\n const currentHash = this.hash;\n\n // Create a clone of the block removing the hash property.\n const clone = {\n ...this,\n hash: null,\n };\n\n // Create a hash from the clone.\n const newHash = SHA2... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
use the browser demensions to reposition the text elements when load or when browser size is changed | function positionTextElements(){
let numOfPanels = 3
// find browser height and width.
let browserHeight = $(window).height();
// position map application
let mapPosition = (numOfPanels + 2.3) * browserHeight
if($(window).height() < 700){
mapPosition = (numOfPanels + 2.7) * browserH... | [
"function resizeText() {\n\n}",
"function resizeDiv(){\r\nif (printing == \"TRUE\") return;\r\nvar oNav = document.all.item(\"nav\");\r\nvar oText= document.all.item(\"text\");\r\n\r\n if (popupOpen) closePopup();\r\n\tif (oText == null) return;\r\n if (oNav != null){\r\n document.all.nav.style.width... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[MSXLSB] 2.4.299 BrtBorder TODO | function write_BrtBorder(border, o) {
if(!o) o = new_buf(51);
o.write_shift(1, 0); /* diagonal */
write_Blxf(null, o); /* top */
write_Blxf(null, o); /* bottom */
write_Blxf(null, o); /* left */
write_Blxf(null, o); /* right */
write_Blxf(null, o); /* diag */
return o.length > o.l ? o.slice(0, o.l) : o;
} | [
"function write_BrtBorder(border, o) {\n\t\tif(!o) o = new_buf(51);\n\t\to.write_shift(1, 0); /* diagonal */\n\t\twrite_Blxf(null, o); /* top */\n\t\twrite_Blxf(null, o); /* bottom */\n\t\twrite_Blxf(null, o); /* left */\n\t\twrite_Blxf(null, o); /* right */\n\t\twrite_Blxf(null, o); /* diag */\n\t\treturn o.length... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read from the start of the file until it finds the Goto target that matches this._nextTarget | _readUntilNextTarget() {
this._lines.forEach((line,index) => {
if(ParseUtil.isTargetLine(line)
&& ParseUtil.doesLineContainsTarget(line,this._nextTarget)) {
this._currentLine = index;
this._readNextLine();
}
});
} | [
"next() {\n if (this.atDocEnd()) {\n return;\n }\n if (this.sent + 1 < this.numSents[this.side][this.seg]) {\n this.goto(this.seg, this.side, this.sent + 1);\n } else {\n if (this.tgtFirst) {\n if (this.side == 1) {\n this.goto(this.seg, 0, 0);\n } else {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert pokemon name to ID. | function nameToId(name) {
name = name.trim().toLowerCase();
for(var i in pokeTable) {
if(i != "0" && pokeTable.hasOwnProperty(i)) {
if(pokeTable[i].name.toLowerCase() == name)
return pokeTable[i].id;
}
}
return -1;
} | [
"function toId(name){\n\t\treturn name.split(' ').join('');\n\t}",
"function getPokemonId(word) {\n let index = word.indexOf('pokemon')\n let idIndex = index + 8 // 8 = pokemon length\n return word.slice(idIndex, -1)\n }",
"function toIdString(name) {\n return name.replace(/[^a-zA-Z]/gi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if a value is an instance of Backbone.Model or Backbone.Collection. | function isBackboneInstance(value) {
return value instanceof Backbone.Model || value instanceof Backbone.Collection;
} | [
"function isCollection(value) {\n // YOUR CODE BELOW HERE //\n \n if (Array.isArray(value) || isObject(value))\n {return true}\n else {return false}\n \n // if (typeof value === 'object'){\n // if (value === null || \n // Object.prototype.toString.call(value) === '[object Date]')\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility Function to allow interleave before and after high computation tasks | function execTasksWithInterLeave(tasks, callback) {
//let's give others some time to process.
//Context Switch BEFORE Heavy Computation
process.nextTick(function() {
//Heavy Computation
async.parallel(tasks, function(err, info) {
//Context Switch AFTER Heavy Computation
process.nextTick(functi... | [
"function computeIntersectionHelper()\n\t{\n\t\tconsole.log(\"startIndex == \" + startIndex);\n\t\tfor (var i = startIndex; ((i < startIndex + size) && i < bigger.length); i++)\n\t\t{\n\t\t\tfor (var j = 0; j < smaller.length; j++)\n\t\t\t{\n\t\t\t\t// if current element of bigger is the same as that of smaller\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns total weight of a vector, x+y+z | sum(vector) {
return vector.x+vector.y+vector.z;
} | [
"function weightedVectorAdd3( s1, v1, s2, v2 ) {\n\n var ret = [0,0,0];\n\n ret[0] = s1 * v1[0] + s2 * v2[0];\n ret[1] = s1 * v1[1] + s2 * v2[1];\n ret[2] = s1 * v1[2] + s2 * v2[2];\n\n return ret;\n\n\n}",
"getWeight() {\n let sum = 0;\n for (let i = 0; i < this._items.length; i++) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
limitTo sets the maximum number of results. | limitTo(limit) {
this.limit = limit;
return this;
} | [
"function setLimit(setLimit) {\n\tthis._struct.push({ type: 'limit', payload: setLimit });\n\treturn this;\n}",
"function setLimit() { // reset offset when limit is changed\n if (limit != DOC.iSel(\"resultsID\").value) {\n offset = Number(\"0\");\n }\n limit = Number(DOC.iSel(\"resultsID\").value);\n}",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
make sequential HTTP Requests | function callSeqHTTPRequest(i){
i = i || 0 ;
if(i < NO_OF_DATA_POINTS){
(function (index, req) {
sendHTTPRequest(req, index)
})(i, new XMLHttpRequest())
}
} | [
"function runRequest(lines) {\n\tif (continueRequesting && lines.length > 0) {\n\t\tvar line = lines.pop()\n\t\t\n\t\tconsole.log('urls to get: ' + lines.length)\n\t\tvar request =\thttp.get(line, function(res) {\n\t\t\tvar body = '';\n\n\t\t\tres.on('error', function(err) {\n\t\t\t\tconsole.log('we got an error!')... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
newSiteButtonClick open the dropdown for a new host site form and clear all | function newSiteButtonClick() {
$("#hsAction").html("<h4 class=\"form\">New Host Site</h4>");
$("#hostSiteID").val("");
$("#HSname").val("");
$("#address").val("");
$("#city").val("");
$("#province").val("");
$("#postal_code").val("");
$("#phone").val("");
$("#email").val("");
$("#monHrs").val("");
$("#tu... | [
"function update_newsite_btn() {\n if(!$.PercNavigationManager.isAdmin()){\n $( \".perc-finder-menu #perc-finder-new-site\" ).removeClass('ui-enabled').addClass('ui-disabled').off('click');\n }\n else{\n if(!$.PercNavigationManager.getPath().startsWith(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hides all the students | function hideAllStudents() {
for(let i = 0; i < studentLI.length; i++) {
studentLI[i].style.display = "none";
}
} | [
"function hideAllStudents() {\n for (i = 0; i < students.length; i ++) {\n if (students[i]) {\n students[i].style.display = 'none';\n }\n }\n }",
"function hideAllStudents(students){\n\tstudents.each((index) =>{\n \tstudents[index].style.display = 'none';\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FIXME not sure this is the best way to do configuration, currently its not used FIXME just put roles in here too? Security module configuration provider. This configuration specifies constant values that are reasonably expected to be configurable depending on a particular application and the associated backend authenti... | function SecurityConfigurationProvider() {
/**
* Configuration with defaults.
*/
var config = {
/**
* Name of the cache that is used for the authenticated user details.
*/
cacheName : 'authCache',
/**
* Name of the cache key under which t... | [
"static getConfiguration() {\n return Authentication.configuration;\n }",
"function config() {\n\n this.session = '';\n this.responseCode = '';\n this.responseMessage = '';\n this.IsValid = function() {\n if (this.responseCode == LOGIN_SUCCESS) {\n return true;\n } e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get field by name | getField(name) {
return this.fields.find((a) => a.name === name);
} | [
"getField(fieldName) {\n var returnField = null;\n this.getFields().forEach(function(field, index) {\n if (field.name === fieldName) {\n returnField = field;\n }\n });\n return returnField;\n }",
"function getField(name) {\n var form = this._cfg.form;\n return form.getF... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Global Variables Download a wavefront OBJ using jQuery ajax calls | function obj_download(glContext, fileName, callback)
{
var model = new Object();
$.ajax(
{
url: fileName,
cache: false,
dataType: 'text',
success: function(data)
{
model = new obj_create(data);
obj_bindBuffers(model, glContext);
callback(model);
}
});
} | [
"function sl_get_waveform(params) {\n $.ajax({\n url: \"waveform\",\n type: \"GET\",\n data: params,\n dataType: \"json\",\n cache: false,\n success: function (data) {\n sl_display_waveform(data[\"waveform\"], \"id=\" + params[\"id\"] +\n \" tim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns if the checker is curently on the board | isCheckerOnBoard() {
return this.state.checkerPosition[0] < this.state.size
&& this.state.checkerPosition[1] < this.state.size
&& this.state.checkerPosition[0] >= 0
&& this.state.checkerPosition[1] >= 0;
} | [
"inCheck() {\n\t\treturn this.isAttacked(otherColor(this.turn), this.kingPos(this.turn));\n\t}",
"hasWon(board, marker) {\n return !!winStates.find(winState => {\n return winState.every(idx => board[idx] === marker);\n });\n }",
"function boardStateCheck() {\n rowCheckForWin();\n colCheckForWi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
restart from first level | function restart() {
loadLevel(level0);
} | [
"restartstepone() {\n this.restart();\n this.begin();\n }",
"restart() {\n this.state = this.stack[0];\n this.stack.length = 0;\n }",
"restart() {\n this.state = this.stack[0];\n this.stack.length = 0;\n }",
"function restart()\n\t\t{\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iterate through the frames of a window and return the first frame with a matching name. | getFrame(win, frameName) {
EnigmailLog.DEBUG("windows.jsm: getFrame: name=" + frameName + "\n");
for (var j = 0; j < win.frames.length; j++) {
if (win.frames[j].name == frameName) {
return win.frames[j];
}
}
return null;
} | [
"function findFrames(objWindow, strName) {\n var objFrame = objWindow.frames[strName];\n if (!objFrame) {\n for (var i=0; i < objWindow.frames.length && !objFrame; i++)\n objFrame = findFrames(objWindow.frames[i], strName);\n }\n\n return objFrame;\n}",
"function findFrame(w, frmname) {\n var res =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update invitation record from Azure Invitation Table | function acceptInvitation(record_id) {
var foundIndex;
// Get the clicked record ID and look up in new invitation array to get kid names and GUID to pass to create Friends Record
for (i = 0, len = $scope.newInvitationArray.length; i < len; i++) {
if ($scope.newInvitationArray[i].id ... | [
"updateInvitations_() {\n const invitations = this.activeUser ?\n this.invitationStore.invitations(this.activeUser) :\n [];\n if (this.invitation_ !== invitations[0]) {\n this.metrics.record(Metrics.DestinationSearchBucket.INVITATION_AVAILABLE);\n }\n this.invitation_ = invitations.le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
stolen from madeleine checks if web colors are within range of chosen color to replace | function colorWithinRange(margin, webR, webG, webB, toReplace) {
var distanceBetween = Math.sqrt(Math.pow(webR-toReplace.r,2)+Math.pow(webG-toReplace.g,2)+Math.pow(webB-toReplace.b,2));
return distanceBetween<=margin;
} | [
"function colorWithinRange(varMargin, imageR, imageG, imageB, toReplace) {\n\tvar distanceBetween = Math.sqrt(Math.pow(imageR-toReplace.r,2)+Math.pow(imageG-toReplace.g,2)+Math.pow(imageB-toReplace.b,2));\n\treturn distanceBetween<=varMargin;\n}",
"function colorChange(dr,dg,db){\n red -= dr;\n if(red < 10)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set control buttons of the gallery | function setControlButtons(number) {
(function ($) {
var nextGallery = number + 1;
var previousGallery = number - 1;
$(".previousGallery").attr("previousGallery", previousGallery);
$(".nextGallery").attr("nextGallery", nextGallery);
}(jQuery));
} | [
"setControls() {\n this.carouselControls.forEach(control => {\n galleryControlsContainer.appendChild(document.createElement('button')).className = `gallery-controls-${control}`;\n }); \n\n !!galleryControlsContainer.childNodes[0] ? galleryControlsContainer.childNodes[0].innerHTML = this.carouselContro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Signs the provided transaction using the wallet and submits to the XRPL network. | async signAndSubmitTransaction(transaction, wallet) {
const signedTransaction = xpring_common_js_1.Signer.signTransaction(transaction, wallet);
if (!signedTransaction) {
throw xrp_error_1.default.signingError;
}
const submitTransactionRequest = this.networkClient.SubmitTransa... | [
"static signTransaction(transaction, senderWallet) {\n transaction.input = {\n timestamp: Date.now(),\n amount: senderWallet.balance,\n address: senderWallet.publicKey,\n signature: senderWallet.sign(ChainUtil.hash(transaction.outputs))\n };\n }",
"static signTransaction(transaction, se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Strip the query string and fragment off of a given URL or path (if present) | function stripUrlQueryAndFragment(urlPath) {
// eslint-disable-next-line no-useless-escape
return urlPath.split(/[\?#]/, 1)[0];
} | [
"function stripUrlQueryAndFragment(urlPath) {\n // eslint-disable-next-line no-useless-escape\n return urlPath.split(/[\\?#]/, 1)[0];\n }",
"function stripUrlQueryAndFragment(urlPath) {\n // eslint-disable-next-line no-useless-escape\n return urlPath.split(/[\\?#]/, 1)[0];\n}",
"function stripUrlQueryA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
bulletType specifies if the bullet is shot by the player with "player" value or shot by an enemy, specified as "enemy" fromCenter represents the 2d object with x and y components in which the bullet appears and then directed to toCenter coordinates | function createBullet(bulletType, fromCenter, toCenter)
{
let bullet = new NodeObject(BLOCK/5, BLOCK/5);
//fromCenter.y+player.height/2
let angle = Math.atan((toCenter.y-fromCenter.y)/(toCenter.x-fromCenter.x));
let sign = Math.sign(toCenter.x-fromCenter.x);
let velocityX = BULSPEED * Math.cos(ang... | [
"function Bullet(x,y,type){\n\tthis.x = x;\n\tthis.y = y;\n\tthis.width = 9;\n\tthis.height = 54; \n\tthis.type = type;\n\t//Render bullet on to the screen and depending if it's called by an enemy \n\t//or player it will appear differently (ie. blue bullet for player, red bullet for enemy)\n\tthis.draw = function()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the source window from which an object is selected as source object This is done by checking the RMTSourceWindow flag on all the open windows | function findRMTSourceWindow() {
if (getTopWindow().RMTNavigatorWindow && getTopWindow().RMTNavigatorWindow.RMTWindowIdentity &&
getTopWindow().RMTNavigatorWindow.RMTWindowIdentity.tableWindowReference && !getTopWindow().RMTNavigatorWindow
.RMTWindowIdentity.tableWindowReference.closed)
retu... | [
"async function selectPdfWindowAsSource() {\n let pdfWindow;\n\n // While we cannot get a valid source, wait and try again.\n do {\n const inputSources = await desktopCapturer.getSources({\n types: [\"window\"]\n });\n pdfWindow = inputSources.filter(src => src.name === PDF_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Methode intSweetAlert to init a sweet value | initSweetAlert(){
this.setState({sweet : ''})
} | [
"function alertasweet(valorestado, titulo, valormsg) {\n swal({\n type: valorestado,\n title: titulo,\n text: valormsg,\n showConfirmButton: false,\n timer: 3000\n });\n}",
"initSweetAlert(){\n this.setState({sweet : ''})\n }",
"function alertaSuccess(valorestado, valormsg) {\n swa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
VALID HOST ^(([azAZ09]|[azAZ09][azAZ09\][azAZ09])\.)([AZaz09]|[AZaz09][AZaz09\][AZaz09])$ (/^(=|>||>=|<=|!=)[azAZ09 '"][^IS|IN|NOT|LIKE|_|%]|(_|%|^BETWEEN\s|^LIKE\s|^IS NULL$|^IS NOT NULL$)/igm); | function matchQry(str) {
var pat = /^(=|>|<|>|>=|<=|!=|IS|IN|NOT|LIKE|_|%|_|%|BETWEEN\s|LIKE\s|IS NULL|IS NOT NULL$)/igm; //new RegExp (^(=|>|<|>|>=|<=|!=|IS|IN|NOT|LIKE|_|%|_|%|BETWEEN\s|LIKE\s|IS NULL|IS NOT NULL$)/igm);
nStr = str.toUpperCase();
var bExist = pat.test(nStr);
return (bExist);
} | [
"function hostregexp(val){\r\n var source = !isregexp(val)\r\n ? String(val).replace(/([.+?^=!:${}()|\\[\\]\\/\\\\])/g, '\\\\$1').replace(/\\*/g, '([^\\.]+)')\r\n : val.source\r\n\r\n // force leading anchor matching\r\n if (source[0] !== '^') {\r\n source = '^' + source\r\n }\r\n\r\n // force trailin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ / Computes the cloud base when dew point and air temperature are / known. / | function ComputeCloudBaseFromAirTempandBarPress(cloudBaseOut, airTempInput, dewPointInput) {
Equation.call(this, cloudBaseOut, airTempInput, dewPointInput);
} | [
"function ComputeTempFromCloudBaseandDewPoint(airTempOutput, cloudBaseInput, dewPointInput) {\n Equation.call(this, airTempOutput, cloudBaseInput, dewPointInput);\n}",
"function ComputeDewPointFromCloudBaseandTemp(dewPointOutput, cloudBaseInput, airTempInput) {\n Equation.call(this, dewPointOutput, cloudBaseInp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Drag start event handler, on the search result table e = DragEvent Sets global variables noDropZone, isRsltItemDragged and dtSignature | function resultsDragStartHandler (e) {
// Inhibit result pane scrolling
disableRsltScroll();
let rowDragged = e.target; // Should always be a [object HTMLTableRowElement] by construction
//console.log("Drag start event: "+e.type+" target: "+rowDragged+" class: "+rowDragged.classList);
//console.log("Draggable: "+... | [
"function bkmkDragStartHandler (e) {\n let rowDragged = e.target; // Should always be a [object HTMLTableRowElement] by construction\n//console.log(\"Drag start event: \"+e.type+\" target: \"+rowDragged+\" class: \"+rowDragged.classList);\n//console.log(\"Draggable: \"+rowDragged.draggable+\" Protected: \"+rowDrag... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Optional function where you can configure scene animations and gestures. Will be invoked with route and routeStack parameters. | function configureScene(route, routeStack) {
if (route.sceneConfig) {
return route.sceneConfig;
}
return Navigator.SceneConfigs.FloatFromRight;
} | [
"configureScene(route, routeStack){\n //@Todo, change to scene transition from Asynstorage vale\n this.getSceneTransition() ;\n var temp = this.state.sceneTransition ;\n return Navigator.SceneConfigs[temp];\n }",
"scene (store, routerProps, routeState, page) {\n const { route } = routeState\n c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Snaps to a page when pagination is enabled. | function _snapToPage() {
// Check whether pagination is active
if (!this.options.paginated ||
this._scroll.scrollForceCount || //don't paginate while moving
(this._scroll.springPosition !== undefined)) {
return;
}
// When the energy is below... | [
"function _snapToPage() {\n\n\t // Check whether pagination is active\n\t if (!this.options.paginated ||\n\t this._scroll.scrollForceCount || //don't paginate while moving\n\t (this._scroll.springPosition !== undefined)) {\n\t return;\n\t }\n\n\t // When ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Notify the defender that they are being attacked | function notifyDefender() {
bot.say({
type: "message",
channel: defenderObj.id,
text: "You are being attacked by <@" + attackerObj.user + ">. Defend yourself (reply with `defend [0-10]`)",
});
} | [
"function defenderAttack() {\n\t\t\t$( \"#game-text\" )\n\t\t\t\t.append( \"<p>\" + defender.name + \" attacked you for \" + defender.counterAP + \"</p>\" );\n\t\t\tplayer.HP -= defender.counterAP;\n\t\t\t$( \"#player .char-hp\" )\n\t\t\t\t.text( player.HP );\n\t\t\tif ( player.HP <= 20 ) {\n\t\t\t\t$( '#player .ch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to display a leaflet map with markers from GOCDB Site data. | function initmap() {
// set up the map
map = new L.Map('map');
// create the tile layer with correct attribution.
var osmUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmAttrib='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors';
var osm = new L.TileLayer(osmUrl, {
... | [
"function displayMarkers() {\n //TODO\n }",
"function renderMarkers() {\n allListings.forEach(function(listing) {\n var formattedAddress = listing.street + ' ' + listing.city + ',' +\n listing.state + ' ' + listing.zip;\n var id = listing._id;\n geoco... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
here we know that the animation will run, so update the runningTime and progress values | updateProgress() {
var state = this.state;
state.runningTime += state.deltaT;
if (this.duration) {
state.progress = Math.max(0, Math.min(1, state.runningTime / this.duration));
}
} | [
"update() {\n if (this.currentAnimation) {\n this.currentAnimation.update();\n }\n }",
"function updateComponents() {\r\n\tconst time = calculateCurrentTime();\r\n\tconst progress = calculateCurrentProgress(time);\r\n\t$('.timer').text(convertTime(time));\r\n\tcircleProgress.animate(pr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List time by user | async listTime(input = { userId: '0', fromDate: '20180101' }) {
return await this.request({
name: 'time.list',
args: [],
params: {
userId: input.userId,
fromdate: input.fromDate,
todate: input.toDate
}
});
... | [
"function timeLogin() {\n for (var i = 0; i < 60; i++) {\n listMn.push({ id: i, text: i });\n }\n for (var i = loginTimeHr; i < 15; i++) {\n if ( i > 12 ) {\n listHr.push({ id: i, text: \"0\" + i - 12 + \" مساء\" });\n } else {\n li... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hang callback on swipe down event of this frame | onSwipeDown(callback, isOnce = false) {
this._swipeDownCallbacks.push([
callback,
isOnce
]);
} | [
"function onSwipeDown() {\n log('Swipe down')\n triggerSync()\n}",
"handleDownSwipe() {\n window.setTimeout(() => this.props.onSwipeDown(), 100);\n }",
"handleUpSwipe() {\n window.setTimeout(() => this.props.onSwipeUp(), 100);\n }",
"function onPointerUp () {\nconsole.log('up')\npoin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check the point is selected | function isSelected(p) {
return p.selected == PathPointSelection.ANCHORPOINT;
} | [
"function isSelected(point){\n\t\treturn point === _selectedPoint;\n\t}",
"function isSelected(ppt){\r\n return ppt.selected == PathPointSelection.ANCHORPOINT;\r\n}",
"function isSelected(point) {\n return point.selected == PathPointSelection.ANCHORPOINT;\n}",
"function pick_point(event) // on click check... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This will check to see if the host as passed is valid. This only checks the hostname, not anything else (i.e. username, nickname) Set 'wilds' to true if you also allow IRC wildcards to be in the hostname. | function IRC_check_host(host,wilds,uh,nick) {
var regexp = "^[A-Za-z0-9\-\.";
if (wilds)
regexp += "\?\*";
if (uh) {
if (host.slice(host.indexOf("@")+1).indexOf("@") != -1)
return 1; // only one @ allowed.
regexp += "\@";
}
if (nick) {
if (host.slice(host.indexOf("!")+1).indexOf("!") != -1)
return 1;... | [
"function isValidHost(host) {\n return ((typeof host == \"string\") &&\n host.trim() != \"\");\n}",
"function isHostAllowed(hostname, callback)\n{\n var globs = config.allowed_hosts || [''];\n\n // some sanity\n if (typeof callback !== 'function') callback = function() {};\n if (!hostname) r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ / Mouse left click functions Checks which part of the tower was clicked and calls towerClicked() on it. | function checkTowerLeftClick(xPosInDiv,yPosInDiv){
var projector = new THREE.Projector();
var vector = new THREE.Vector3( ( xPosInDiv / DIV_WIDTH ) * 2 - 1, - ( yPosInDiv / DIV_HEIGHT ) * 2 + 1, 0.5 );
projector.unprojectVector( vector, mainCamera );
var raycaster = new THREE.Raycaster( mainCamera.position, vector.... | [
"click(x, y, _isLeftButton) {}",
"function mouseClicked() {}",
"mouseClick() {\n\t\tvar that = this;\n\t\t\n\t\t// Get x,y coordinates of canvas where mouse pointer is\n\t\tvar getXandY = function (e) {\n\t\t\tvar x = e.clientX - that.ctx.canvas.getBoundingClientRect().left;\n\t\t\tvar y = e.clientY - that.ctx.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that finds the checker's index in the checker array by looping through the list and comparing the id's | function findCheckerIndex(checkerId) {
for(var i = 0; i < checkerArray.length; i++) {
if(checkerArray[i].id === checkerId) {
return i;
}
}
return -1;
} | [
"function findIndexById(check){\n // Loop through until we find id that matches the check\n for(let i = 0; i < toDos.length; i ++) {\n if (toDos[i].id === parseInt(check)) {\n return i;\n }\n }\n return false;\n}",
"static getUserIndexById(id, array){\n for (var i = 0; i < ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getTDElement(element) returns the tdElement for the supplied element | function getTDElement(element)
{
if (element && element.tagName == "TD") return element;
if (element.parentNode)
{
element = element.parentNode;
if (element.tagName == "TD") return element;
}
return;
} | [
"function getTdErrorCell ( element ) {\n\t\n\n if( element )\n {\n\t\t\t\t// VL: The following finds <td> cell where error text needs to be displayed.\n\t\t\t\tvar trNode = getCorrectAttribute(element,\"parentNode\",element.parentNode);\n//fatima\n\t\t\t\twhile(trNode.nodeName!=\"TR\" || !(trNode.rowID || getCo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
private _uniqContentEquals function. That function is checking equality of 2 iterator contents with 2 assumptions iterators lengths are the same iterators values are unique falsepositive result will be returned for comparision of, e.g. [1,2,3] and [1,2,3,4] [1,1,1] and [1,2,3] | function _uniqContentEquals(aIterator, bIterator, stackA, stackB) {
var a = _arrayFromIterator(aIterator);
var b = _arrayFromIterator(bIterator);
function eq(_a, _b) {
return _equals(_a, _b, stackA.slice(), stackB.slice());
}
// if *a* array contains any element that is not included in *b*
retu... | [
"function _uniqContentEquals(aIterator, bIterator, stackA, stackB) {\n\t var a = _arrayFromIterator(aIterator);\n\t var b = _arrayFromIterator(bIterator);\n\t\n\t function eq(_a, _b) {\n\t return _equals(_a, _b, stackA.slice(), stackB.slice());\n\t }\n\t\n\t // if *a* array contains any element that is not ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
= Description Moves the rects right and bottom sides to new coordinates. Does not affect the position. = Parameters by separate numeric values: +_width+:: A numeric value representing the new target width of the rect. +_height+:: A numeric value representing the new target height of the rect. by HPoint used as "HSize":... | setSize(_width, _height) {
const _argLen = arguments.length;
// Using width and height:
if (_argLen === 2) {
}
// Using a point:
else if (_argLen === 1 && _width.hasAncestor && _width.hasAncestor(HPoint)) {
const _point = _width;
_width = _point.x;
_height = _point.y;
}
... | [
"resizeBy(_horizontal, _vertical) {\n this.rect.right += _horizontal;\n this.rect.bottom += _vertical;\n this.rect.updateSecondaryValues();\n this.drawRect();\n return this;\n }",
"function updateRectLike(item, x, y, width, height) {\n xy2shape(item, \"x\", x, \"y\", y);\n item.setAt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The constructor of a nonvisual component routeUrl: The route url to which the component is bound | constructor(routeUrl) {
super(routeUrl);
} | [
"constructor(routeUrl) {\n\t\tthis.routeUrl = routeUrl;\n\t\tthis.routeParts = ComponentBase.parseRoute(routeUrl);\n\t\tthis.mode = Mode.Hidden;\n\t\tthis.lastEvent = null;\n\t}",
"constructor(routeUrl, domContainerElement) {\n\t\tsuper(routeUrl);\n\t\tthis.domContainerElement = domContainerElement;\n\n\t\tthis.c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
helper function to play a card with chosen color | function playCardWithChosenColor(id, color) {
if ($('#yourRound').css("display") == "block") {
// console.log("clearing timeout:" + timer);
clearTimeout(timer);
gameSocket.send(JSON.stringify({
'action': 'playOneCard',
'card_id': id,
'choose_color': color,... | [
"playColor(color) {\n if (color === 'green') {\n green.play();\n } else if (color === 'red') {\n red.play();\n } else if (color === 'yellow') {\n yellow.play();\n } else {\n blue.play();\n }\n }",
"function soundTheColor(color) {\n if (color.id === \"r\") {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
7. Function to find a value in an array. Return true if the value is found and false otherwise. Use a loop; DO NOT use Array.includes, Array.indexOf, or Array.find | function find( value, array ){
for(val of array) {
if(value === val) {
return true;
}
}
return false;
} | [
"function find( value, array ){\n let found = false\n for ( let x=0; x<array.length; x++ ) {\n if (array[x] === value) found = true\n }\n return found\n}",
"function findInArray(arr, value) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === value) {\n return true;\n }\n }\n return fa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given two patterns, MN strokemap, compute weighted (respect stroke length when there are concatenated strokes using the wholeWhole distance | function computeWholeDistanceWeighted(pattern1, pattern2, map) {
var [k1,k2,n,m] = getLargerAndSize(pattern1, pattern2);
var dist = 0.0;
var idx = 0;
while(idx < n) {
var stroke_idx = k2[map[idx]];
var start = idx;
var stop = start+1;
while(stop<map.length && map[stop] == map[idx]) {
... | [
"function computeDistance(pattern1, pattern2, distanceMetric, map) {\n\t var [k1,k2,n,m] = getLargerAndSize(pattern1, pattern2);\n\t\t var dist = 0.0;\n\t\t var idx = 0;\n\t\t while(idx < n) {\n\t\t var stroke_idx = k2[map[idx]];\n\t\t\t var start = idx;\n\t\t\t var stop = start+1;\n\t\t\t while(stop<map.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
inform all other clients about my details: name, email, easyrtcid these additional info along with easyrtcid (which is available in 'all_occupants_list') are used for mapping (e.g. which easyrtcid is for which emails and so on) | function informMyDetailsToAllOtherClients(occupants){
var myInfo = {'email': $("#user_email").text(), 'easyrtcid': selfEasyrtcid, 'name': $("#user_name").text()};
//notify all other clients for email for corresponding easyrtcid
notifyAll('inform_my_details_to_all_other_clients', myInfo);
} | [
"function addNewClientToAllOccupantsDetails(newClientDetails){\n all_occupants_details.push(newClientDetails);\n}",
"function getNameForAnEasyRTCid(easyrtcID) {\n for (var i = 0; i < all_occupants_details.length; i++) {\n if (all_occupants_details[i].easyrtcid == easyrtcID) return all_occupants_details[i].... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
step 1a as defined for the porter stemmer algorithm. | function step1a(token) {
if(token.match(/(ss|i)es$/))
return token.replace(/(ss|i)es$/, '$1');
if(token.substr(-1) == 's' && token.substr(-2, 1) != 's' && token.length > 3)
return token.replace(/s?$/, '');
return token;
} | [
"function step1a(token) {\n var r1 = getR1(token);\n\n if (!r1) {\n return token;\n }\n\n var r1Match = r1.match(/(a|e|ede|ande|ende|ane|ene|hetene|en|heten|ar|er|heter|as|es|edes|endes|enes|hetenes|ens|hetens|ers|ets|et|het|ast)$/);\n\n if (r1Match) {\n return token.replace(new RegExp(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an element, if it has a id attribute, then return it otherwise create a unique id and return it. | function getUniqueId(element) {
var id = $(element).attr("id");
if (!id) {
id = generateUniqueId();
}
return id;
} | [
"function elementId(element) {\n\tvar id = null;\n\tif (element) {\n\t\telement = $(element);\n\t\tif (isEmpty(element.id)) {\n\t\t\telement.id = \"_id\" + new Date().getTime() + \"_\" + Math.floor(Math.random() * 1000);\n\t\t}\n\t\tid = element.id;\n\t}\n\telement = null;\n\treturn id;\n}",
"function ensureId(el... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change placeholders to the control panel text input items, based on data type. | function changeControlPanelPlaceholders() {
console.log('changeControlPanelPlaceholders');
var dataTypeName = DATATYPE_NAME[gDataType];
$('#add-manual-button input').attr('placeholder', 'Manual ' + dataTypeName + '(s) to add');
$('#add-random-button input').attr('placeholder', 'Count of random ' + data... | [
"function putPlaceholdersInsteadTitles() {\n $('.form-item').each(function() {\n var item = $(this);\n var label = item.find('label').text();\n var input = item.find('input');\n var select = item.find('select');\n if (input.length) {\n inp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds the html select option groups for characteristic groups loaded from the API | initializeCharacteristicGroups(characteristicGroups) {
characteristicGroups.forEach(group => {
const optGroupName = Utility.getString(group);
let optGroup = Utility.createNode('optgroup', {
label: optGroupName,
class: 'i18nable-optgroup',
'data-key': group['label.id']
});
... | [
"function initGroupSelector() {\n // Add the research groups to the select\n let options = `<option value=\"All\">All research groups</option>`;\n for (let group of researchGroups) {\n options += `<option value=\"${group.name}\">${group.name}</option>`\n }\n $(\"#research-group-selector\").htm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Processes all animation in an animation group. | processAnimations(animationGroup) {
var group = {
name: animationGroup.name,
animations: []
};
animationGroup.targetedAnimations.forEach( ta => {
//console.log("animation: "+ta.animation.name+" target: "+ta.target.getClassName()+" "+ta.target.name+" type "+ta.animation.dataType+" property ... | [
"function AnimationGroup() {}",
"_animateScene(){\n var len = this._animations.length;\n for(var i = 0; i < len; i++){\n\n if(this._animations[i] != null && this._animations[i].length != 0 )\n //Processes an Animation object\n this._animations[i].animate();\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PRIVATE BROWSING CONTEXT API ///////////////////////// Creates a browsing context that can be communicated with using a crossorigin channel. The channel will only operate if the browsing context's origin matches that of the given `url`. | function BrowsingContext(url, options) {
var self = this;
if(!(self instanceof BrowsingContext)) {
return new BrowsingContext(url, options);
}
options = options || {};
var useIframe = options.iframe !== false;
// IE11 detected, use iframe because postMessage is broken on IE, it
// can't communicate c... | [
"function createClipContext() {\n return clipsnailDoc.createElement('iframe');\n}",
"createChannel(url) {\n let c = NetUtil.newChannel({\n uri: url,\n loadUsingSystemPrincipal: true,\n });\n\n return c;\n }",
"static newAndUseCContext(ctxPtr) {\n // assert(typeof ctxPtr === 'numb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the cursor to pan up | setPanCursorUp() {
this.setCursor(ToolkitUtils.getGrabCursor());
} | [
"setPanCursorDown() {\n this.setCursor(ToolkitUtils.getGrabbingCursor());\n }",
"function panUp() {\n\t\tif(zoomMaxY < limits.maxY) {\n\t\t\tvar shift = limits.maxY - zoomMaxY;\n\t\t\tvar halfSpan = (zoomMaxY - zoomMinY) / 2;\n\t\t\tif(shift < halfSpan) {\n\t\t\t\tzoomMaxY = limits.maxY;\n\t\t\t}\n\t\t\telse ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Restaurant blured image URL. | static bluredImageUrlForRestaurant(restaurant) {
// for development we need to remove "/mws-restaurant-stage-1"
const url = window.location.href;
if(url.startsWith('https')) {
return (`/mws-restaurant-stage-1/img/${restaurant.photograph}`);
}
return (`/img/${restaurant.photograph || 10}-... | [
"static imageUrlForRestaurantL(restaurant) {\r\n if (restaurant.photograph === undefined){\r\n return 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';\r\n }\r\n return (`/img/800_${restaurant.photograph}.jpg`);\r\n }",
"static imageUrlForRestaurantS(restaurant) {\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the alarm to the user specified value. Ping the User after it is set. | function setAlarm() {
if(alarmTime) {
const current = new Date();
const timeToAlarm = new Date(alarmTime);
if (timeToAlarm > current) {
const timeout = timeToAlarm.getTime() - current.getTime();
alarmTimeout = setTimeout(() => {audio.play();
... | [
"function setAlarmTime(value) {\r\n alarmTime = value;\r\n}",
"function setAlarm() {\n resetAlarmBtn.disabled = false;\n alarmTime = `${hours.value}:${minutes.value} ${AMorPM.value}`;\n window.alert(`Alarm set for ${alarmTime}`);\n document.getElementById(\"alarm-time\").innerText = `Alarm set for ${al... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
funzione numero pari o dispari | function pariDispari(totale){
let pari = null;
if (totale % 2 === 0){
pari = true;
}else pari = false;
console.log('la somma è pari? ',pari);
return pari;
} | [
"function verificaPariDispari(num) {\r\n if (num % 2 == 0) {\r\n return \"pari\";\r\n } else {\r\n return \"dispari\";\r\n }\r\n }",
"function verificaPariDispari (num) {\n if(num % 2 ===0){\n return \"pari\"\n }\n return \"dispari\"\n}",
"LISTA_PARAMETROS() {\r\n\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that loads the certificates, either on startup or when the user clicks the "Refresh" button. At this point, the UI is already blocked. | function loadCertificates() {
// Call the listCertificates() method to list the user's certificates. For more information see:
// http://webpki.lacunasoftware.com/Help/classes/LacunaWebPKI.html#method_listCertificates
pki.listCertificates({
// The ID of the <select> element to be p... | [
"function loadCertificates() {\r\n\r\n\t\t// Call the listCertificates() method to list the user's certificates. For more information see:\r\n\t\t// http://webpki.lacunasoftware.com/Help/classes/LacunaWebPKI.html#method_listCertificates\r\n\t\tpki.listCertificates({\r\n\r\n\t\t\t// The ID of the <select> element to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
REPAINTS THE CORRESPONDING CLOCK CANVAS DEPENDING ON CURRENT SELECTION MODE | function repaintClock() {
if (selectionMode == 'HOUR') {
repaintClockHourCanvas();
} else {
repaintClockMinuteCanvas();
}
} | [
"function repaintClock() {\n\t\t\t\tif (selectionMode == 'HOUR') {\n\t\t\t\t\trepaintClockHourCanvas();\n\t\t\t\t} else {\n\t\t\t\t\trepaintClockMinuteCanvas();\n\t\t\t\t}\n\t\t\t}",
"function canvasOnFocus() {\n //dojo.debug('canvasOnFocus()');\n top.cairo.stopBlinkTitle();\n stopAutoAway();\n}",
"static _u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
//// /// Object Definition //// /// //// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// / Name: UILabel Author: Mitchell Croft Date: 20/05/2017 Requires: ExtendProperties.js, UIBase.js, Color.js, Graphics.js Version: 1.0 Purpose: A simple display of t... | function UILabel(pSetup) {
//Call the UIBase setup
UIBase.call(this, pSetup);
//Extract the setup values
this.__Internal__Dont__Modify__.text = Validate.type(pSetup["text"], "string", "");
this.__Internal__Dont__Modify__.font = Validate.type(pSetup["font"], "string", "12px Arial");
this.__Internal__Dont__Modify... | [
"function Label1() {\n\n\tthis.Type = \"Label\";\n this.Text = \"Ready...\";\n}",
"function Label2() {\n\n\tthis.Type = \"Label\";\n this.Text = \"...\";\n}",
"function initLabel() {\n this.label = new Surface({\n size: this.options.itemSize, \n content: this.labelTemplate(thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return color function based on plot and dimension | function zcolor(col, dimension) {
var z = zscore(_(col).pluck(dimension).map(parseFloat))
return function(d) { return zcolorscale(z(d[dimension])) }
} | [
"function color(col, dimension) {\n const z = normalize(_(col).pluck(dimension).map(parseFloat));\n return function(d) { return colorscale(z(d[dimension])) }\n}",
"function getColor(d, mode) {\n cartodb_id = d.properties.cartodb_id;\n colorIntensity = heatmapData[mode][cartodb_id];\n color = d3.int... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the label layer | function updateLabelLayer() {
labelLayer.getSource().clear();
if (scope.message) {
var features = MessageService.featuresForMessage(scope.message);
if (features.length > 0) {
var coor... | [
"function updateLabel() {\n // set the label to be chosen emoji\n this.marker.setLabel(image)\n //return the image var to empty so that next created marker does not have a label from start\n image = \"\";\n\n }",
"updateLabelText() { }",
"up... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
decrypts the token in localStorage and returns result to be used for currentUser | function decryptToken(token) {
var base64Url = token.split('.')[1];
var base64 = base64Url.replace('-', '+').replace('_', '/');
var currentUser = JSON.parse($window.atob(base64));
return currentUser;
} | [
"function getToken(){ \n return localStorage['JWT'];\n}",
"function getToken(){\n return localStorage.getItem(\"token\");\n}",
"function getToken() {\n return localStorage.getItem(\"token\");\n}",
"function getToken() {\n return localStorage.getItem(\"token\");\n }",
"function getToken() {\n l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the running sessions based on new data from the server. | function updateRunningSessions(sessions, baseUrl) {
var promises = [];
var running = runningSessions.get(baseUrl) || [];
algorithm_1.each(running.slice(), function (session) {
var updated = algorithm_1.find(sessions, function (sId) {
if (session.id === sId.id) {
... | [
"function updateSessionList() {\n\n\t// request updated session list\n\t$.get('/sessions',\n\t\t{'session_key': server_session_key},\n\t\tfunction(message) {\n\t\t\tconsole.log('/sessions response:' + message);\n\n\t\t\tsessions = new Array();\n\n\t\t\t// update sessions\n\t\t\tvar lines = message.split('\\n');\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function : translator_getTranslation Purpose : retreive the results of the translation process | function translator_getTranslation()
{
return this.parser.getTranslation();
} | [
"function getTranslation() {\n try {\n this.processSlideCopy();\n this.removeFromCache();\n } catch (e) {\n console.error(e);\n }\n}",
"getTranslation(text) {\n return this.translation[text];\n }",
"function getTranslation(sourceWord) {\n\n try {\n\n // Create a new HTTP ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Admin Command: gulp [task] | function adminTasks() {
var pathto = function (file) {
return ('admin/views/assets/' + file);
};
var scripts = {
src: pathto('javascripts/app/*.js'),
dest: pathto('javascripts'),
qor: pathto('javascripts/qor/*.js'),
all: [
'gulpfile.js',
pathto('java... | [
"function runGulp(packageDirectory, task, env) {\n console.log(\"Running gulp task '\" + task + \"' in '\"+packageDirectory+\"'\");\n // clone the env, append npm to path\n for (var e in process.env) env[e] = process.env[e];\n env['PATH'] += (':'+packageDirectory+'/node_modules/.bin/');\n env['PREFIX... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A connection point on the overlay element. | function OverlayConnectionPosition() { } | [
"function OverlayConnectionPosition() {}",
"getConnectedOverlayOrigin() {\n return this._textField || this._elementRef;\n }",
"function ConnectedPosition() { }",
"function connectionpoints(source, target, stubsource, stubtarget, anchorsource, anchortarget, strokestyle, dashstyle){\n insta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the stem (basename w/o extname) (example: `'index.min'`). | get stem() {
return typeof this.path === 'string'
? path$1.basename(this.path, this.extname)
: undefined
} | [
"get stem() {\n return typeof this.path === 'string'\n ? path.basename(this.path, this.extname)\n : undefined\n }",
"get stem() {\n return typeof this.path === 'string'\n ? path.basename(this.path, this.extname)\n : undefined\n }",
"get stem() {\n return typeof thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a Seq of all the parents (self first, then parent, ...) of this cursor. The Seq is lazy. | function parents(cursor) {
if (cursor == null) {
return List()
}
const self = cursor
function* _ancestors() {
let current = self
while (current != null) {
yield current
current = parent(current)
}
}
return Seq(_ancestors())
} | [
"getParents() {\r\n let current = this;\r\n let parents = []\r\n while(current != null) {\r\n parents.unshift(current);\r\n current = current.parent;\r\n }\r\n return parents\r\n }",
"async getAllParents() {\n const parent = await this.parent;\n if (!parent) {\n return [];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Alias for gl.drawBuffers enables all currently enabled color attachments | drawBuffers(custom_array=[]){
let ext = this.ext;
if(gl instanceof WebGL2RenderingContext){
gl.drawBuffers(this.attachmentPoints);
}else{
if(ext !== false){
ext.drawBuffersWEBGL(this.attachmentPoints);
}
... | [
"enable() {\n gl.useProgram(this.shader_loc);\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vbo_loc);\n\n this.attributes.forEach((attribute, _) => {\n gl.vertexAttribPointer(\n attribute.location,\n attribute.count,\n gl.FLOAT,\n false,\n this.vbo_stride,\n attribute... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hide the hru,lu,soils report links | function hideReportLinks(){
document.getElementById("bd_report").style.display="none";
document.getElementById("blc_report").style.display="none";
} | [
"function dropAllHyperlinksNonHTML() {\n\tinnerdropHyperlinks(reportContext.getReportRunnable().designHandle.getBody());\n}",
"function preventPrintLinks() {\n $(\"a\").removeAttr(\"href\", \"#\");\n }",
"function disableInternalReview() {\n var links = document.getElementsByTagName(\"a\");... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ensureColumn Provisioning function to ensure a column has been created on a list ensureColumn Part 1: Check to see if the column already exists | function ensureColumn(listName, columnName, fieldType) {
var siteUrl = getSiteUrl();
var deferred = $q.defer();
var fieldTitle = "";
var found = false;
$http.get(siteUrl + "/_api/web/lists/GetByTitle('" + listName + "')/Fields", getGetConfig())
... | [
"hasColumn(tableName, column) { }",
"hasColumn(tableName, column) {\n const formattedColumn = this.formatter.parameter(column);\n const formattedTable = this.formatter.parameter(this.formatter.wrap(tableName));\n const sql =\n `select object_id from sys.columns ` +\n `where name = ${formattedCo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: dwscripts.isCurrencyDBColumnType DESCRIPTION: This function returns true if the given column type represents a monetary value ARGUMENTS: columnType string a column type string returned from MMDB RETURNS: boolean | function dwscripts_isCurrencyDBColumnType(columnType)
{
var retVal = false;
// Use the Server Model version if it exists
var serverObj = dwscripts.getServerImplObject();
if (serverObj != null && serverObj.isCurrencyDBColumnType != null)
{
retVal = serverObj.isCurrencyDBColumnType(columnType);
}
... | [
"function isCurrencyDBColumnType(columnType)\n{\n var retVal = false;\n switch (columnType)\n {\n case \"money\":\n case \"smallmoney\":\n case \"currency\":\n retVal = true;\n }\n\n return retVal;\n}",
"function dwscripts_isStringDBColumnType(columnType)\n{\n var retVal = false;\n \n // Use... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If they choose to skip name imput | function skipName() {
var name = "";
runIntro(name);
} | [
"function skipName() {\n nameScramble.push(quizName);\n updateScore(-1);\n askName();\n}",
"function isNameIgnored(name) {\n\tvar index = ignoreForNow.indexOf(name);\n\tif(index > -1)\n\t\treturn true;\n\telse\n\t\treturn false;\n}",
"function removeNameFromIgnore(name) {\n\tvar index = ignoreForNow.indexOf(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
funzione ricerca appartamenti dalla barra search home | function searchApartment() {
// opzioni per ricerca
var searchOptions = {
key: 'LXS830AiWeCA3ogV5iiftuD8GgwteTOE',
language: 'it-IT',
limit: 5
};
// opzione autocomplete
var autocompleteOptions = {
key: 'LXS830AiWeCA3ogV5iiftuD8GgwteTOE',
language: 'it-IT'
};
var searchBoxOptions = {
... | [
"function searchParallaxAutoComplete() {\n var config = RentoApp.Config;\n var constants = RentoApp.Constants;\n var attr, qryprm;\n var lclUrl1 = serviceGblURL + \"address/cityname\";\n\n var lclUrl2 = serviceGblURL + \"category/subcategoryname\";\n\n var rentoSearch = Ren... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ReNumber the pages after merge | function renumberPages(document){
var pageStart = 1;
for(var p=0;p < document.sections.length;p++){
document.sections[p].continueNumbering = false;
document.sections[p].pageNumberStart = pageStart;
pageStart = pageStart + destination_doc.sections[p].length;
}
} | [
"function renumberPages() {\n\t\tvar pageLis = $('#pagesPresent').find('li').each(function(index,ele){var pn = index+1;\n\t\t\t$(ele).children('span.pageNum').html(pn);\n\t\t});\t\t\n\t}",
"function incrementPageNumber(){\n setPageNumber(pageNumber+1)\n }",
"function update_page_region_numbers()\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
We are validating if elements are present or not | async vlidatePresenceOfElements () {
await expect(await (await this.inputUsername).isDisplayed()).toBe(true);
await expect(await (await this.inputPassword).isDisplayed()).toBe(true);
// check if submit button is displayed or not
await expect(await (await this.btnSubmit).isDisplayed()).to... | [
"requiredElementsPresent() {\n let allElementsPresent = true;\n const requiredElements = this.get('requiredElements');\n if (isPresent(requiredElements)) {\n requiredElements.forEach((element) => {\n if (allElementsPresent && (!Ember.$(element.selector)[0] || !Ember.$(element.selector).is(':vis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saves input values as names in the database | function save_Names(){
name1 = $("[name='1']").val();
name2 = $("[name='2']").val();
name3 = $("[name='3']").val();
name4 = $("[name='4']").val();
function setItemName(json){
for (var i in json){
if(json[i].id == 1){
json[i].name = name1;
}else if(json[i].id == 2){
json[i].name = name2;
}el... | [
"function getInputAndStoreInDB() {\n\t//get input data\n\tname = $('#train-name').val().trim();\n\tdestination = $('#destination').val().trim();\n\tfirstTrainTime = $('#train-time').val().trim();\n\tfrequency = $('#frequency').val().trim();\n\n\t//store in db\n\tdatabase.ref().push({\n\t\tname: name,\n\t\tdestinati... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Listing businesses based on their category, moderation status, limit and offset | list_category_filter(req, res){
return businesses
.findAll({
where: {
category: req.params.category,
status: req.params.status,
},
offset: req.params.offset,
limit: req.params.limit,
})
.then((result) => res.status(201).send(result))
.catch((error) => res.st... | [
"list_filter(req, res) {\n return businesses\n .findAll({\n where: {\n status: req.params.status,\n },\n offset: req.params.offset,\n limit: req.params.limit,\n })\n\n .then((result) => res.status(201).send(result))\n .catch((error) => res.status(400).send(error))\n\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process the Equiv string input: tree since this routine is called with the reentrance routine serialize_mathml(tree.content[i]), each level down tree is a lower lever content, i.e. looking from the root is like tree.content[i].content[i].content[i].... Therefore inside this routine if you use tree.content[0], you are l... | function processStrEquiv(tree, end_tag)
{
if (isNotEmtyStr(tree.strKiContent))
strKiAppend(tree.strKiContent);
strKiAppend(tree.content[0]); // we want the original content, not the one after escape lookup
if (isNotEmtyStr(tree.strRightDelim))
{
strKiAppend(... | [
"function ParseTreeTransformer() {}",
"function levelorderTraversal(root) {\nvar strings4mNode=new Array();\nvar nodeParent=new Array();\nvar idNo=1;\n////alert(\"AA\");\n// Initialize queue to contain root element\nvar q1 = [root];\n// While there are elements in the queue\nwhile(q1.length) {\n var q2 = [];\n \n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by LUFileParsernewEntityUsesFeatures. | exitNewEntityUsesFeatures(ctx) {
} | [
"exitEntityDeclaration(ctx) {\n\t}",
"exitNewEntityRoleOrFeatures(ctx) {\n\t}",
"exitNewEntitySection(ctx) {\n\t}",
"exitUseDeclaration(ctx) {\n\t}",
"exitEntitySection(ctx) {\n\t}",
"exitNewEntityDefinition(ctx) {\n\t}",
"exitEntityDefinition(ctx) {\n\t}",
"exitNewEntityLine(ctx) {\n\t}",
"exitUseC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Select a schedule from tab | function selectSchedule(name) {
// De-select existing active schedule
/*$("#open-terms").children("li").each(function (index, value) {
value.className = "";
});*/
//$("#"+name).parent().className("dropdown active-schedule");
$("#"+name).toggleClass("active-schedule");
getFilteredSections... | [
"function completeScheduling(){\n View.parentTab.parentPanel.selectTab('select');\n}",
"function chooseSchedule(key) {\n _schedule = key;\n \n // load and display resources for this particular schedule\n loadResources();\n updateUI();\n setupCanvas();\n }",
"function wtSchedu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
write svgjs data to the dom | writeDataToDom() {
// remove previously set data
this.node.removeAttribute('svgjs:data');
if (Object.keys(this.dom).length) {
this.node.setAttribute('svgjs:data', JSON.stringify(this.dom)); // see #428
}
return super.writeDataToDom();
} | [
"writeDataToDom(){// remove previously set data\nthis.node.removeAttribute(\"svgjs:data\");if(Object.keys(this.dom).length){this.node.setAttribute(\"svgjs:data\",JSON.stringify(this.dom));// see #428\n}return super.writeDataToDom()}",
"writeDataToDom() {\n // remove previously set data\n this.node.removeAtt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is used to switch the empty piece and another puzzle piece. It takes a puzzle piece as an argument and calls the isMoveable function to check if that piece can actually be moved. | function move(piece){
if (isMoveable(piece)){
var switchTop = emptyPiece[0] + "px";
var switchLeft = emptyPiece[1] + "px";
var styleTop = piece.style.top;
var styleLeft = piece.style.left;
piece.style.top = switchTop;
piece.style.left = switchLeft;
emptyPiece[0] = parseInt(styleTop);
emptyPiec... | [
"function emptyPieceSwap(piece){ \n\n\t\tif (testForAvailableMove(piece.style.left, piece.style.top)){\n\n\t\t\t//temporary variables for swapping coordinates of empty slot and piece being moved\n\t\t\tvar tempX = piece.style.left;\n\t\t\tvar tempY = piece.style.top;\n\n\t\t\t//giving the piece to me moved a new se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Merges asynchronous validators into a single validator function (combined using `Validators.composeAsync`). | function composeAsyncValidators(validators) {
return validators != null ? Validators.composeAsync(normalizeValidators(validators)) : null;
} | [
"function composeAsyncValidators(validators) {\n return validators != null ? composeAsync(normalizeValidators(validators)) : null;\n}",
"function composeAsyncValidators(validators) {\n return validators != null ? Validators.composeAsync(normalizeValidators(validators)) : null;\n }",
"function composeAs... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getQueryURL makes an ajax call to the google geocoder api. it takes a typical location search (street, city, or place) and returns lat/long. this is necessary b/c the places nearbySearch() fn only accepts lat/long. after they are returned, the callback concatenates a new query url to pass to the places ajax call. | function getQueryURL(address) {
let queryURL = "https://cors-anywhere.herokuapp.com/https://maps.googleapis.com/maps/api/geocode/json?address=" + address + "&key=AIzaSyD9y2VmteYeNrLjnmKgP8l1j0DIp2qex9Y"
$.ajax({
url: queryURL,
method: "GET"
}).then(function (response) {
// lat and l... | [
"function encodeQuery( q, sf ) {\n var encodedQuery = encodeURIComponent( q );\n var url = [ googleAPIurl ];\n url.push( '?sql=' + encodedQuery );\n url.push( '&key=' + googleAPIkey );\n url.push( '&callback=?' );\n $.ajax( {\n url: url.join( '' ),\n dataType: \"jsonp\",\n success: sf,\n error: function () {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a function, randomize_list(), that takes an array and randomizes the order, without resorting to the use of any preexisting array methods. Input: input_array: an array of anything Output: output_array, the original array, randomly arranged Example: var input_array = [5,3,2,5,1] output = randomize_list(input_arra... | function randomize_list(array){
var list = array.length;
var temp = null;
var index = null;
while (list > 0) {
index = Math.floor(Math.random() * list);
list--;
temp = array[list];
array[list] = array[index];
array[index] = temp;
}
return array;
} | [
"function randomizer(array) {\n var currentIndex = array.length;\n var temporaryValue, randomIndex;\n\n // While there remain elements to shuffle...\n while (0 !== currentIndex) {\n // Pick a remaining element...\n randomIndex = Math.floor(Math.random() * currentInd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method: versionGeneratedPluginGulpfile Child: version the gulpfile. Parameters: (string) inputPath Path to wpdtrtgeneratedplugin/ (string) outputPath Path to wpdtrtgeneratedplugin/ output directory (object) packageRoot A reference to the generated plugin's package.json file Returns: (array) src files Output: ./gulpfile... | function versionGeneratedPluginGulpfile(
inputPath,
outputPath,
packageRoot
) {
const files = `${inputPath}gulpfile.babel.js`;
const re = new RegExp(
/(\* @version\s+)([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})/
);
const { version } = packageRoot;
logFiles( files );
return gulp.sr... | [
"function versionGeneratedPluginWpRoot(\n inputPath,\n outputPath,\n packageRoot\n ) {\n const { name, version } = packageRoot;\n const files = `${inputPath}${name}.php`;\n const re1 = new RegExp(\n /(\\* Version:\\s+)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})/\n );\n const re2 = new RegEx... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the error object indicates the target is a directory (`EISDIR`). | static isDirectoryError(error) {
return FileSystem.isErrnoException(error) && error.code === 'EISDIR';
} | [
"function is_dir(target) {\n if (!exports.grunt.file.isDir(target)) {\n exports.failed = true;\n return exports.warn('Invalid path: ' + target + ' is not a directory');\n }\n return true;\n}",
"static isDirectory(source) {\n try {\n return fs.lstatSync(source)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the node and sets up a test UI for a contract (voting contract in this case); | function testNode() {
// Retrieve the ABI from the local json file
fetch("./contracts/voting.sol").then(response => {
return response.text();
}).then((code) => {
$.ajax({
type: "POST",
url: "http://localhost:8080/toAbi",
dataType: "json",
conte... | [
"async runTest(){\r\n this.logger.info(`Start testing 'Actions page'`)\r\n await this.home.navigateToHomePage() // Open LH's CRM Website\r\n await this.home.clickOn('Actions') // Nevigate to actions page\r\n await this.addClient('Zafrir' , 'Freits' , 'israel' , 'Janice Alvarado' , 'zafri... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
some setup is done prior to actually calling the typeAnimation function aka typeAnimationActual | typeAnimation(){
//preserve a copy of all the text we're about to display incase we need to save
this.saveCopy();
FileManager.writing = false;
//figure out how fast we want to type the screen based on how much content needs typing
var letters = 0;
for (i=0; i< this.state.toShowText.length; i++){ ... | [
"generateAnimationType() {\n switch (this.moveDirection) { \n case 0: // up\n if (this.animationtype === 1) { \n this.sx = 382;\n this.sy = 0;\n this.animationtype = 2;\n } else if (this.animationtype === 2) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build TagsInput DOM elements | _build() {
// Create TagsInput DOM
const containerFragment = document.createRange().createContextualFragment(containerTemplate({
emptyTitle: typeof this.options.noResultsLabel !== 'undefined' ? this.options.noResultsLabel : 'No results found',
placeholder: this.element.placeholde... | [
"buildTag() {\n let text = document.createElement('input');\n text.value = 'Add Tag';\n text.contentEditable = 'true';\n text.className = 'add-tag';\n text.style.width = '49px';\n this.input = text;\n let tag = document.createElement('div');\n tag.className = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tell the higher classes that this squad is ready for battle | tellImReadyForTheAttack(){
this._eventEmmiter.emit(SQUAD_RECHARGED, {rechargedSquad: this});
} | [
"unitReady() {\n\t\tif (this.ready === 0) {\n\t\t\tconsole.log(`[RECHARGE] Squad ${this.squadIndex} from army '${this.army}' is recharging`);\n\t\t}\n\t\t// Count ready units and compare to active units\n\t\tthis.ready++;\n\t\tif (this.ready >= this.getActiveUnits().length) {\n\t\t\tthis.ready = 0;\n\t\t\tconsole.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
STATIC METHODS / Sanitizes and validates a given value and throws an error is not a valid Node object, null, or undefined. val Value to validate as a pointer. Valid values are a Node object, null, or undefined. If undefined, the value will be normalized to null. error True to throw an error if validation fails, false o... | static sanitizeNode(val, error) {
switch (true) {
case undefined === val:
val = null;
case null === val:
case val instanceof Node:
break;
default:
error && Node.throw("pointer");
... | [
"function validPointer(val, dbg = false) {\n if (val == 'undefined' || typeof val == 'undefined' || val == null) {\n if (dbg) {\n debugger;\n }\n return false;\n }\n return true;\n }",
"function validateStringValue(val){\r\n if(TypeUtils.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |