query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Get a list of apps that a beta tester can test. | function listAllAppsForBetaTester(api, id, query) {
return api_1.GET(api, `/betaTesters/${id}/apps`, { query })
} | [
"function getApps() {\n return Array.from(_apps.values());\n}",
"function getApps() {\n return Array.from(_apps.values());\n}",
"function getApps() {\r\n return Array.from(_apps.values());\r\n}",
"getApps () {\n this._checkProfile()\n return this._getResources('apps')\n }",
"function getApps()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add(nickname: string, no: number) Add a B. sonata | function addSonata(nickname, num, audio) {
throw new Error("Unsupported operation");
} | [
"add(value) {}",
"add(id, nickname) {\n this.presentUsers[id] = nickname;\n }",
"add(displayName) {\r\n const postBody = {\r\n displayName: displayName,\r\n };\r\n return this.postCore({\r\n body: jsS(postBody),\r\n }).then(r => {\r\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves the following information from the modal (form) in a dictionary: 1. Outcome 2. Intervention 3. Comparator 4. Answer 5. Reasoning | function get_form_data() {
var data = {};
data["out"] = $("#outcome-resp").val();
data["int"] = $("#intervention-resp").val();
data["cmp"] = $("#comparator-resp").val();
data["ans"] = getCheckBoxSelection();
data["res"] = $("#reasoning-resp").val();
data["xml"] = $("#reasoning-resp").attr('xml_offsets');
... | [
"function extractDataFromModal() {\n const modal = doc.getElementById(\"myModal\");\n const inputFields = modal.querySelectorAll(\".form .input-field input\");\n const readSwitchButton = modal.querySelector(\".switch-field input\");\n var book = new Book();\n let hasError = false;\n book.read = readSwitchButt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the default command. This command is executed when `allowMention` is true and the bot is pinged with no command. | setDefaultCommand(commandName) {
const command = this.commandForName(commandName);
if (!command)
throw new TypeError(`No known command matches ${commandName}`);
this.defaultCommand = command;
return this;
} | [
"function addDefaultCommand() {\n modules.push({\n name : \"__fed-default__\",\n canDo : function canDoDefault() {\n return true;\n },\n getCommand : function getCommandDefault(command, dir) {\n return command;\n }\n });\n}",
"function defaultCommand(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write an appropriate value for a_property to a_reg | function SetSafeRegProperty( a_reg, a_property, a_value )
{
switch (a_property)
{
case 'comment':
// Comment is a proprietary property not in Roland standard UPG.
//
// JSON would allow strings of arbitrary lengths. But we don't know
// the implementation of the FP-90, and don't want t... | [
"writeValue(register, value) {\n this.reg[this.regNum(register)] = value;\n }",
"function GetSafeRegProperty( a_reg, a_property )\n{\n var retval = undefined;\n switch (a_property)\n {\n case 'comment':\n // Comment is a proprietary property not in Roland standard UPG\n retval = a_reg[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the player has chosen to be a host inform them that the game will start once a player joins then periodically check the server for a joined player | function hostWait(availability) {
var playerList = $("#playerList");
if (availability !== "false") {
playerList.html("<h1 style='color: white;'><b>Game created. Waiting for player to join</b></h1>");
hostTimer = setInterval(function () {
getAjax("https://webgamesdev-blaircalderwo... | [
"function onPlayerStart(){\n if(globals.currentPlayers.length > 1 && globals.gameInProgress !== true){\n io.sockets.emit(\"client start\",{});\n }\n}",
"function join() {\n\t\t// Other player should see that I have joined the game...\n\t\t//COM.publish({cmd:\"join\", who:params.player});\n\t\tCOM.publish(new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the frequency of a note | function setFrequency(note, frequency){
note.frequency = frequency;
} | [
"setFrequency(aFrequency) {\n this.frequency = aFrequency;\n }",
"set frequency(f) {\n\t\tthis.vcos[this.currVoice].frequency = f;\n\t}",
"function YMotor_set_frequency(newval)\n { var rest_val;\n rest_val = String(Math.round(newval * 65536.0));\n return this._setAttr('frequency',rest_val... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds the given key/value pair to the state maintained for the give component | function setComponentState(componentId, key, value) {
var componentState = getViewState(componentId);
if (!componentState) {
componentState = new Object();
setViewState(componentId, componentState);
}
componentState[key] = value;
} | [
"function setComponentState(componentId, key, value) {\r\n var componentState = getViewState(componentId);\r\n if (!componentState) {\r\n componentState = new Object();\r\n setViewState(componentId, componentState);\r\n }\r\n componentState[key] = value;\r\n}",
"createState(key, value) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scales in or out to achieve a target on a custom metric. | scaleToTrackCustomMetric(id, props) {
return super.doScaleToTrackMetric(id, {
customMetric: props.metric,
targetValue: props.targetValue,
policyName: props.policyName,
disableScaleIn: props.disableScaleIn,
scaleInCooldown: props.scaleInCooldown,
... | [
"function yScaleSetter(target, value){\n if(target != null){\n target.setAttributeNS(null, \"transform\", \"scale(1, \" + value + \")\");\n } else {\n System.out.println(\"target is null in yScaleSetter\");\n }\n}",
"function Scale () {}",
"function scale(targetScaling, targetXY, tweenFn,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Codeland Username Validation / Have the function CodelandUsernameValidation(str) take the str parameter being passed and determine if the string is a valid username according to the following rules: 1. The username is between 4 and 25 characters. 2. It must start with a letter. 3. It can only contain letters, numbers, ... | function CodelandUsernameValidation(str) {
// YOUR CODE HERE
let pattern = "/^w+$/";
if (str.length >= 4 || str.length <= 25)
if (str[0] === "/^w")
if (str === pattern)
if (str[str.length - 1] !== "_") return true;
else {return false;};
} | [
"function usernameValidation(str) {\n const letters = /[A-Za-z]/g, regExp = /[A-Za-z0-9_]/g, regExp_ = /[^_]/g;\n if (4 < str.length < 25 && letters.test(str[0]) && regExp.test(str) && regExp_.test(str[str.length - 1]))\n return true;\n else return false\n}",
"function fnIsValidUsername(username){\n // u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Overloads onData to detect payloads. | onData(data) {
const callback = packet => {
// if its the first message we consider the transport open
if ("opening" === this.readyState && packet.type === "open") {
this.onOpen();
}
// if its a close packet, we close the ongoing requests
... | [
"onData(data) {\n const callback = packet => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempt to delete the entity on the server failed or timedout. Action holds the error. If saved pessimistically, the entity could still be in the collection and you may not have to compensate for the error. If saved optimistically, the entity is not in the collection and you may need to compensate for the error. | saveDeleteOneError(collection, action) {
return this.setLoadingFalse(collection);
} | [
"saveDeleteManyError(collection, action) {\n return this.setLoadingFalse(collection);\n }",
"saveDeleteMany(collection, action) {\n const deleteIds = this.extractData(action).map((d) => typeof d === 'object' ? this.selectId(d) : d);\n deleteIds.forEach((deleteId) => {\n const ch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PATIENT functions / Expects: dni and numss Returns: If the parameters given are equals than the values stored in local storage return true | function checkPatient (dni, numss) {
return (dni === localStorage.getItem("dni") && numss === localStorage.getItem("numss"));
} | [
"function isValidDNI(dni) {\n var numero, let, letra;\n var expresion_regular_dni = /^[XYZ]?\\d{5,8}[A-Z]$/;\n\n dni = dni.toUpperCase();\n\n if(expresion_regular_dni.test(dni) === true){\n numero = dni.substr(0,dni.length-1);\n numero = numero.replace('X', 0);\n numero = numero.rep... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given a time this method returns the ball position at that time in the future | FuturePosition( time ) {
//using the equation s = ut + 1/2at^2, where s = distance, a = friction
//u=start velocity
//calculate the ut term, which is a vector
let ut = Vector2D.mul( this.m_vVelocity, time );
//calculate the 1/2at^2 term, which is scalar
let half_a_t_squ... | [
"function setBallPosition(time) {\n // rescale the time dimension so that the period of bouncing maps to pi\n var angle = (time * Math.PI) / guiParams.ballBouncePeriod;\n var abs_cos = Math.abs(Math.sin(angle));\n var ballHeight = linearMap(\n abs_cos,\n 0,\n 1,\n guiParams.ballRadius - sceneParams.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates Top Stories in HTML | function generateTopStories(topStory, index) {
if (topStory.type === 'story') {
removeLoader();
addLimitButton();
var topStoryRow = document.createElement('div');
topStoryRow.className = 'story--container';
// Top Story Icon
var topStoryIcon = docume... | [
"function getTopStories() {\r\n $.ajax({\r\n url: baseUri + \"topstories.json?print=pretty\",\r\n async: false,\r\n success: function (data) {\r\n buildUnorderedList(data);\r\n }\r\n });\r\n }",
"function generateOwnStories() {\n // e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set a POST request to the API server to add a new version for the product. | function addProductVersion() {
var url = [refstackApiUrl, '/products/', ctrl.id,
'/versions'].join('');
ctrl.addVersionRequest = $http.post(url,
{'version': ctrl.newProductVersion})
.success(function (data) {
ctrl.productVersion... | [
"function associateProductVersion() {\n var verId = ctrl.selectedVersion ?\n ctrl.selectedVersion.id : null;\n var testId = resultsData.id;\n var url = refstackApiUrl + '/results/' + testId;\n ctrl.associateRequest = $http.put(url, {'product_versio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize the session, picking up identity from either cookie or local storage | _initSession () {
const session = this.get('session');
return session.fetch()
.then(() => {
debug('User has been automatically logged in... ');
return {success: true, status: 'authenticated'};
})
.catch((ex) => {
debug(`No cookie/localstorage entry was found, user is an... | [
"function init() {\n if ($window.sessionStorage[\"userInfo\"]) {\n userInfo = JSON.parse($window.sessionStorage[\"userInfo\"]);\n }\n }",
"function init_session( req, next )\n{\n\tvar session = req.session;\n\tif (session.user != undefined && (session.instruments == undefined )) {\n\t\t// Look... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PROTECTED Attaches the currently selected List of items to this popup menu object. | function attachListItemsToPopupMenu(list) {
this.items = list;
} | [
"updateSelectedItemsList(selectedItem, isSelected) {\n if (isSelected) this.borrowingCreationRequest.params.selectedItems.push(selectedItem);\n else this.removeItemFromSelectedItemsList(selectedItem);\n }",
"function PopupMenu() {\n this.lastShown = null;\n this.item... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Starts loading and parsing the language file | function loadLang(){
$.get("data/lang.hsv?v=5", function(response){
//Remove any carriage returns
response = response.replace(/\r/g, '');
//Split on newlines;
let lines = response.split("\n");
//Go through each line and parse into lang file
lines.forEach(function(line... | [
"function loadLang() {\n txtWordFound.innerText = texts.occ;\n fontAr.innerText = texts.font + \" \" + texts.size;\n txtTrans.innerText = texts.trans + \" \" + texts.size;\n markColour.innerText = texts.mark + \" \" + texts.colour;\n settingsModelTitle.innerText = texts.pref;\n txtModelClose.inner... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Submits the new annotation using AJAX | function submit_annotation() {
var xml;
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
xml = new XMLHttpRequest();
}
else { // code for IE6, IE5
xml = new ActiveXObject("Microsoft.XMLHTTP");
}
xml.onreadystatechange=function() {
if (xml.readyState==4 && xml.stat... | [
"function submit() {\r\n\r\n // Get all annotations\r\n let annos = {};\r\n let radios = $(\"input.para\");\r\n\r\n\r\n // if (checked.length !== $(\".equi-cand-container\").length) {\r\n //\r\n // }\r\n let unfinished = false;\r\n\r\n radios.each(function() {\r\n let $this = $(this);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function will return the paths to all the directories in the system. This is used in reconciliation to make sure the staryteller database mimicks the file system. | function getAllDirPaths() {
//holds all the dir paths being tracked by storyteller
var allDirPaths = [];
//go through each file/dir mapping
for(var dirPath in pathToIdMap) {
if(pathToIdMap.hasOwnProperty(dirPath)) {
//if the dir exists in the allDirs collecti... | [
"getDirFullPaths() {\n return _.reduce(_dirs, (output, paths, base) => {\n return _.set(output, base, _.uniq(_.map(paths, dirPath => {\n return path.isAbsolute(dirPath) ? dirPath : path.join(_context, dirPath);\n })));\n }, {});\n }",
"async getWorkspacePaths() {\n var _a;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if o is a boolean | function isBoolean(o) {
return toString.call(o) == '[object Boolean]';
} | [
"function boolean(obj) {\n return (typeof obj === 'boolean');\n}",
"function isBoolean(obj) {\n return (typeof obj === \"boolean\");\n }",
"function _boolean(data) {\n return data === false || data === true;\n }",
"function boolean(data) {\n return data === false || data === true... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
makes the difficulty cell for a new task row | function makeNewTaskDifficulty()
{
const cell = makeTableCell("difficulty");
return cell;
} | [
"function createNewTaskRow(task) {\n //create rows with cells\n let newRow = oldTasksTable.insertRow(1);\n let timeCell = newRow.insertCell(0);\n let checkInCell = newRow.insertCell(1);\n let checkOutCell = newRow.insertCell(2);\n let timeSpentCell = newRow.insertCell(3);\n let assignementCell ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Like bind(), except that a "this object" is not required. Useful when the target function is already bound. Usage: var g = partial(f, arg1, arg2); g(arg3, arg4); | function partial(fn, var_args) {
return bind.apply(
null, [fn, null].concat(Array.prototype.slice.call(arguments, 1)));
} | [
"function simpleBind(context,fn){return function(value){fn.call(context,value);};}",
"function bind(func, context) {}",
"function bind(f,boundArgs)\r\n{\r\n return function()\r\n {\r\n return f.apply(this, boundArgs);\r\n };\r\n}",
"function bind(f, arg) {\n var args = Array.p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register callback to run when the account is updated | registerAccountUpdatedCallback(callback) {
this.callbacks.ACCOUNT_UPDATED.push(callback);
} | [
"registerAccountChangedCallback(callback) {\n this.callbacks.ACCOUNT_CHANGED.push(callback);\n }",
"function onAccountChanged(acc) {\n\n account.current = acc;\n forceUpdate();\n updateUserSpecificBlockchainData();\n\n }",
"registerAccountsRetrievedCallback(callback) {\n this.call... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saves options to localStorage. | function save_options() {
localStorage["user"] = document.getElementById("user").value;
localStorage["passwd"] = document.getElementById("passwd").value;
// Update status to let user know options were saved.
update_status("已保存");
} | [
"function setOptions(options) {\n localStorage.setItem(\"options\", options);\n}",
"function save_options() { \n let options = get_options();\n\n chrome_storage_local\n .set(options, ()=>\n {\n let status = document.querySelector('#save-status .status-message');\n status.textCont... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the tcert batch size. | setTCertBatchSize(batchSize) {
this._tcertBatchSize = batchSize;
} | [
"_setMaxBatchSize(size) {\n this.maxBatchSize = size;\n }",
"function setBatchMax(value) {\n if (value > 0) {\n internal.batchMax = value;\n } else {\n throw new Error('batchMax MUST be a number greater than 0');\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get previous paragraph from cell | getPreviousParagraphCell(cell) {
if (!isNullOrUndefined(cell.previousRenderedWidget) && cell.previousRenderedWidget instanceof TableCellWidget) {
cell = cell.previousRenderedWidget;
let block = cell.lastChild;
return this.getLastParagraphBlock(block);
}
return... | [
"getPreviousAcross(cell) {\n let index = this.acrossWords.indexOf(this.getWord(cell, \"across\"));\n if (index === 0) {\n return undefined;\n } else {\n return this.acrossWords[index-1].firstEditableCell();\n }\n }",
"getPreviousParagraphRow(row) {\n if (!isNullOrUndefined(row.previo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
newGame function to reset all stats, randomly pick word from word bank, and create string with placeholders | function newGame() {
// Reset all game info
gameRunning = true;
guessesLeft = 8;
guessedLetterBank = [];
incorrectLetterBank = [];
pickedWordPlaceholderArr = [];
pickedWord = wordBank[Math.floor(Math.random() * wordBank.length)];
// Create placeholders out of new pickedWord
for (var... | [
"function newGame() {\n // reset all game info\n gameRunning = true;\n guessesLeft = 8;\n guessedLetterBank = [];\n incorrectLetterBank = [];\n pickedWordPlaceholdrArr = [];\n\n // pick new word\n pickedWord = wordBank[Math.floor(Math.random() * wordBank.length)];\n\n // crate placeholder... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ajoute le contenu du champ message dans la zonetexte de la page | function ajoutMessage() {
var zonetexte = $('#zonetexte');
// récuperer le contenu du champ de saisie message
var message = $('input#message').val();
zonetexte.append("<p> vous avez dit: " + message + "</p>");
// ne pas soummetre le formulaire
return false;
} | [
"function setMessage(message) {\n const messageLabel = document.getElementById('message');\n messageLabel.innerHTML = '\\n\\n' + message;\n }",
"function message () {\n app.ui.description('Você precisa ter contas cadastradas.');\n app.ui.form.action('Beleza, valeu!');\n app.u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Go eat a piece of fish food. | function eat(food)
{
// Add the food's HTML element to a queue of uneaten food elements.
uneatenFood.push(food.element);
// Tell the fish to swim to the position of the specified food object, appending this swim instruction
// to all other swim paths currently queued, and then when the swimming is done c... | [
"function eat () {\n if (game.fireStatus === true) {\n if (game.fishNumber > 0) {\n game.fishNumber -= 1\n return 'Your fish is being cooked'\n } else if (game.fishNumber < 1) {\n return 'You do not have any fish'\n }\n } else {\n return 'You must start the fire'\n }\n}",
"function g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears and reloads organization from database, except domain. | async reloadOrganization()
{
logger.info('reloadOrganization()');
this._destinations.forEach((destination) =>
{
if (!destination.closed)
destination.close();
});
this._destination = [];
await this._loadDestinations();
this._routes = [];
await this._loadRoutes();
} | [
"function cleanOrganisationData() {\n self.orgs.forEach(function(o) {\n o.id = o.organisation_id\n o.name = o.organisation_name\n o.type = 'org'\n o.url = 'https://digitalsocial.eu/org/' + o.id\n if (!o.linked_prjs) o.linked_prjs = []\n\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hide modal from child object | function hideModalFromChild(object) {
let modal = getModalFromChild(object);
modal.style.display = "none";
} | [
"hide(){\n\t\tthis.modalShadow.hide();\n\t\tthis.modalBody.hide();\n\t}",
"function hideModal(){\r\n setShowEditModal(false)\r\n }",
"function showModalFromChild(object) {\n let modal = getModalFromChild(object);\n modal.style.display = \"block\"; \n}",
"hide() {\n modal.innerHTML = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
job the job object callback f(err) called with error in case there is a duplicated job with the same target and same params | function validateJobTarget(job, callback) {
if (typeof (job) === 'undefined') {
return callback(new wf.BackendInternalError(
'WorkflowRedisBackend.validateJobTarget job(Object) required'));
}
// If no target is given, we don't care:
if (!job.target) {
... | [
"submitJob(job, callback) {\n let attempts = job.attempts ? job.attempts + 1 : 1\n\n // form job body\n let body = {\n name: 'crn-automated-job',\n appId: job.appId,\n batchQueue: job.batchQueue,\n executionSystem: job.executionSystem,\n memoryPerNode: job.memoryPerNode,\n nod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create functions called from Ajax callback w/ json 'data' // maps a polyline for points in data | function createMap(data) {
if (data.length<1 || !GBrowserIsCompatible())
return;
map = new GMap2(
document.getElementById("map_canvas"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(
new GLatLng(data.events[0].point.lat, dat... | [
"function OCG_on_receive_Points_To_Map(jsondata,date)\n{\n\tif(jsondata.status == 'success')\n\t{\n\t\tOCG_clear_vect_layers();\n var data = JSON.parse( jsondata.data );\n\t\tvar gpx=[];\n\t\tgpx.name= date;\n\t\tgpx.maps= \"LINESTRING (\" + data.line + \")\";\n\t\tgpx.waypoints='';\n\t\tOCG_add_gpx(gpx,fals... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HTTP Post form flow action | function onActionHttpPostForm (callback, args) {
util.genericRequestHelper('A30 action.http_post_form', 'post', args, {form: args.data}).then(result => {
if (result.response.statusCode === 200 ||
result.response.statusCode === 201 ||
result.response.statusCode === 202) {
return callback(null... | [
"function halSubmit(e) {\n var form, query, nodes, i, x, args, url, method, template, accept;\n \n args = {};\n form = e.target;\n query = form.action.replace(/%7B/,'{'); // hack\n template = UriTemplate.parse(query);\n method = form.getAttribute(\"halmethod\")||form.method;\n accept = form.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
buttons Add headers and tds for each button that is enabled | _setupButtons(){
var self = this;
$.each(this.settings.buttons, function(i, e){
if(e && !findTd(i)){
addHeader();
addTd(i);
}
});
/**
* Determine if an element has already been
* created in the template for this button
* @param {string} i - button name
*/
function findTd(i){
var... | [
"function addButtons() {\n\t\tcreateButton(\"Outdent\");\n\t\tcreateButton(\"Indent\");\n\t}",
"function makeButtons() {\n setStyleSheet();\n\n let toolbar = $ID('nav-bar');\n\n let container = $E('hbox', {\n id: kUI.container.id\n });\n\n // XXX: I can't handle the 'command' event on <hbox>.\n $event(co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_ifwin This function is intended to be an object member method. As such it operates on the implicit object this. _ifwin returns the this object's contentWindow object, if one exists; null otherwise. Prototype: Object _ifwin() Results: If the this object is an iframe, its contentWindow; null otherwise. | function _ifwin() {
if (this.tagName.toLowerCase() != "iframe") return null;
if (this.contentWindow) return this.contentWindow;
return this;
} | [
"function getContentWindow() {\n if(typeof top.content_frame != 'undefined') {\n return top.content_frame;\n } else {\n return top;\n }\t\n}",
"function _ifdoc() {\r\n if (this.tagName.toLowerCase() != \"iframe\") return null;\r\n if (this.contentWindow) return this.contentWindow.document;\r\n if (thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function reads data from local storage and returns the data and expiry in an object | function readLocalStorage(name) {
let fetchedItem = JSON.parse(localStorage.getItem(name));
const item = {
'value': fetchedItem.value,
'category': fetchedItem.category,
'expiry': fetchedItem.expiry
}
return item;
} | [
"function readstorage() {\n investorName = JSON.parse(localStorage.getItem(\"investorName\"));\n investorEmail = JSON.parse(localStorage.getItem(\"investorEmail\"));\n investorIndustry = JSON.parse(localStorage.getItem(\"investorIndustry\"));\n investedAmount = JSON.parse(localStorage.getItem(\"invested... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validates format and field presence for defaultSortBy attribute | function validateDefaultSortBy(part, path) {
if (_.has(part, 'defaultSortBy')) {
if (typeof part.defaultSortBy !== 'object') {
errors.push(`defaultSortBy in ${path.join('.')} has incorrect format, must be an object`);
} else {
_.each(part.defaultSortBy, (val, key) => {
... | [
"function validateDefaultSortBy(part, path, errors) {\n if (!_.has(part, 'defaultSortBy')) {\n return;\n }\n\n if (typeof part.defaultSortBy !== 'object') {\n return errors.push(`defaultSortBy in ${path.join('.')} has incorrect format, must be an object`);\n }\n\n _.each(part.defaultSortBy,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this is to add the user obj into the post so i was hopefully able to search through both posts & users | async getPostWithUser() {
const { postsWithUser } = this.state
postsWithUser.forEach((post) => {
Object.assign(post, {user: this.getUserFromPost(post.userId)})
})
this.setState({postsWithUser})
} | [
"async savePost({ user, body }, res) {\n console.log(user);\n console.log(body)\n try {\n const newPost = await Post.create({\n author: user.username,\n authorID: user._id,\n title: body.title,\n postText: body.postText,\n image: body.image,\n link: body.link\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creating and hydrating stores in this way saves time, and only requires that we remember to put our stores in the "allStores.js" file imported above This function takes care of helping stores communicate with each other. If there is an array defined on any store named "linkedStores", the array elements (containing exac... | function linkStores(stores) {
Object.keys(stores).forEach((currentStore) => {
if (stores[currentStore].hasOwnProperty('linkedStores')) {
const linkStoreKeys = stores[currentStore].linkedStores || [];
if (linkStoreKeys.length === 0) {
console.warn(`Store ${currentStore} has an empty linkedStor... | [
"fetchAndLoadStores() {\n this.storesAdapter\n .getStores()\n .then(stores => {\n stores.forEach(store => this.stores.push(new Store(store)))\n })\n .then(() => {\n this.renderStore()\n })\n }",
"function importAllStore... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks to see if this graphics geometry can be batched. Currently it needs to be small enough and not contain any native lines. | isBatchable() {
var batches = this.batches;
for (var i = 0; i < batches.length; i++) {
if (batches[i].style.native) {
return false;
}
}
return (this.points.length < GraphicsGeometry.BATCHABLE_SIZE * 2);
} | [
"isBatchable()\n {\n const batches = this.batches;\n\n for (let i = 0; i < batches.length; i++)\n {\n if (batches[i].style.native)\n {\n return false;\n }\n }\n\n return (this.points.length < GraphicsGeometry.BATCHABLE_SIZE * 2);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Perform a term based search with de selected location (from location state) | function doSearchByTerm(location) {
app.showPreloader();
ps.searchByTerm(searchTerm, searchByTermSuccess, searchByTermError);
function searchByTermSuccess(data) {
processResponse(data);
}
function searchByTermError(data) {
showErrorState({message: 'Othe... | [
"function doSearchWith(location) {\n state = 1;\n locations = [];\n errorMessage = '';\n searchTerm = location;\n\n $$('#search-text').val(searchTerm);\n\n doSearchByTerm();\n }",
"search(state, keyword) {\n\n }",
"function searchPlace() {\n const que... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mousemove event handler for canvas draw on canvas | function mousemoveForCanvas(event)
{
var x, y;
// Get the mouse position relative to the canvas element.
/*if (event.layerX || event.layerX == 0) { // Firefox BUT not relative to canvas element (depending on page's css displays etc)
x = event.layerX;
y = event.layerY;
} else*/ if (event... | [
"function canvasMouseMoveEv(event) {}",
"function bindMouseMove() {\r\n canvas.addEventListener('mousemove', function(e) {\r\n mousePos = getMousePos(e);\r\n });\r\n }",
"mouseMoveEvent(){\r\n this.canvas.addEventListener(\"mousemove\" , (e) =>{\r\n if(this.write){\r\n\t\tthis.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for scrollpane init | function scrollPaneInit() {
var __pane = $('.scroll-pane').jScrollPane({
showArrows: true,
verticalDragMaxHeight: 40
});
return __pane.data('jsp');
} | [
"function scroll_reInit(){\n if ($allInner.find('.scroll-pane').length>0) {\n /*if ($mobile) {\n $('.scroll-pane').jScrollPane({\n showArrows: false,\n maintainPosition: true,\n showArrows: false,\n animateScroll: false,\n hijackInternalLinks:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Respond with the "id" uri parameter. | function idParamHandler(req, res) {
return res.send(req.params.id);
} | [
"function handler_atId(id) {\n\treturn this.path.replace('{id}', id);\n}",
"function createGetMethodWithId() {\n this.get(\n '/:id',\n (req, res, next) => {\n let id = req.params.id;\n this.model.findOne(\n { where: { id: id } }\n ).then(result => {\n if (!result) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
call canMove func and if true, move arrival flight. | async arrivalCheckAndMove(flight) {
const canChangeLeg = await this.arrivalCanChangeLeg(flight);
if (canChangeLeg) {
this.arrivalChangeLegAsync(flight);
}
return canChangeLeg;
} | [
"function isValidMove(move){\n //return boolean\n\n\n\n\n\n }",
"function canMakeMove() {\n return game.started && !game.finished && game.turn === player.number;\n}",
"isValidMove (move) {\n const newPoint = this.currentPoint.pointAfterMove(move)\n if (newPoint == null) return false\n\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the suggestions enabled state | get suggestionsEnabled() {
var checkbox = this.getElement({type: "suggest"});
return checkbox.getNode().checked;
} | [
"set suggestionsEnabled(state) {\n var checkbox = this.getElement({type: \"suggest\"});\n this._controller.check(checkbox, state);\n }",
"get allowSpellCheckAndSuggestion() {\n return this.spellSuggestionInternal;\n }",
"availableSuggestions () {\n return this.suggestions;\n }",
"get ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Defining method countryselect with parameter origin | function countryselect(origin){
if (origin.value == 'Default'){
alert('Please select your nationality');
return false;
} else {
return true;
}
} | [
"clickedBorderCountry(event) {\n Requests.getCountriesByAlphaCode(event.currentTarget.id, this.showInfo)\n }",
"function changeCountry(arg) {\nvar selectCity = window.document.getElementById(\"City\");\nvar selectTimeZone = window.document.getElementById(\"TimeZone\");\nselectCity.options.length=0;\nif (arg >... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the cadence of notches to get labels in the secondary color. EG, return 2 if every 2nd notch should be labeled, return 10 if every 10th notch should be labeled, etc. Secondary labels are drawn after primary labels, so if you want to have labels every 10 seconds and another color labels every 60 seconds, the 60 s... | function secondaryLabelInterval(pxPerSec) {
// draw one every 10s as an example
return Math.floor(2 / timeInterval(pxPerSec));
} | [
"function secondaryLabelInterval(pxPerSec) {\n\t// draw one every 10s as an example\n\treturn Math.floor(10 / timeInterval(pxPerSec));\n}",
"function primaryLabelInterval(pxPerSec) {\n var retval = 1;\n /*\n if (pxPerSec >= 25 * 100) {\n retval = 100;\n } else if (pxPerSec >= 25 * 40) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a WebGL context 'gl', an object 'mesh' in the format returned by parsing an OBJ file with 'parse_OBJ_text()', an object 'buffers' containing WebGL buffer objects for each property in 'mesh', a WebGL shader program object 'shaderProgram', and a dictionary 'attributeMap' mapping names of attributes in the vertex sh... | function attach_parsed_OBJ_gl_buffers_to_shader_vertex_attributes( gl, mesh, buffers, shaderProgram, attributeMap )
{
var attributeLocations = {};
for( var attrib in attributeMap )
{
var prop = attributeMap[ attrib ];
gl.bindBuffer( gl.ARRAY_BUFFER, buffers.v... | [
"map_vertex_attrib_to_shader(gl, shaderProgram) {\n let vsize = this.vertices[0].size();\n if (vsize >= 5) {\n gl.bindAttribLocation(shaderProgram, 0, 'aPos');\n gl.bindAttribLocation(shaderProgram, 1, 'aTexCoord');\n }\n if (vsize >= 8) {\n // set normal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that returns two types of paths, one relative to symlink, and one relative to the current working directory. Checks if path is absolute or relative. If the path is relative, this function checks if the path is relative to symlink or relative to current working directory. This is an initiative to find a smarter... | function symlinkPaths (srcpath, dstpath, callback) {
if (path.isAbsolute(srcpath)) {
return fs.lstat(srcpath, function (err, stat) {
if (err) {
err.message = err.message.replace('lstat', 'ensureSymlink')
return callback(err)
}
return callback(null, {
'toCwd': srcpath,
... | [
"function symlinkPaths (srcpath, dstpath, callback) {\n if (path__default.isAbsolute(srcpath)) {\n return gracefulFs.lstat(srcpath, (err, stat) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink');\n return callback(err)\n }\n return callback(null, {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
node 8 don't has timeout attribute on socket | function getSocketTimeout(socket) {
return socket.timeout || socket._idleTimeout;
} | [
"setTimeout(timeout) {\n this.timeout = timeout;\n this.sock.setTimeout(timeout);\n }",
"setTimeout(timeout) {\n this.timeout=timeout;\n this.sock.setTimeout(timeout);\n }",
"function socketOnTimeout() {\n var socket = this;\n var server = socket[kServer];\n if (!server.emit('timeout'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show upload progress number: 0100 | function progress(number) {
var node = $("#fileUploadProgress");
node.text(number + " %");
node.attr("aria-valuenow", number);
node.attr("style", "width:" + number + "%");
} | [
"function progress(e){\n $( \"#progress\" ).show();\n if (UploadStart==0) {\n if(e.lengthComputable){\n //progress bar, works only with modern browsers\n $('progress').attr({value:e.loaded,max:e.total});\n }\n }\n}",
"function upload_progress(ev) {\n var msg;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
2) Acquire a key per timestamp using said token | requestKey(token, timestamp) {
let url = this.url;
return new Promise(function (resolve, reject) {
fetch(`${url}/v1/request/${token}/${timestamp.toString()}`)
.then((resp) => {
return resp.status !== 200
? reject(new Error("not ok"))
: resp.json();
})
... | [
"_cacheToken(token, expiresIn) {\n const preferences = this.get('preferences');\n const currentTime = Date.now();\n const timeToLive = expiresIn * 1000;\n const expiration = currentTime + timeToLive;\n\n preferences.tokenCache = { token, expiration };\n }",
"function getKey( token ){ \n \tif( toke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
define the combination function (uses dp factorial function) | function combination(n, r) {
return factorial(n) / (factorial(n - r) * factorial(r));
} | [
"function combination (n, r) {\n\t\treturn (factorial(n) / (factorial(r) * factorial(n - r)));\n}",
"function calculateFactorial( number ){\n\n}",
"function getCombination(n, r) {\r\n return getFactorial(n) / (getFactorial(r) * getFactorial(n - r));\r\n }",
"function factorial(n, d=1)\n{\n\tif (n < 2) ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add element's edit notes popup Not working crossbrowser Different behavior depending on screen pos Try using a position relative to the PAGE, not viewport > | function addEditNotes(ele, formContainer){
var loc = ele.parentNode.insertBefore(document.createElement('span'), ele.parentNode.firstChild);
loc.setAttribute("style", "position:absolute;top:0;left:0;");
// Appending to node won't accept pointer events!
document.body.appendChild(formContainer);
// Repos... | [
"function positionNotes (noteDivObj)\r\n\t {\r\n //Set left, top. If it crosses the out of focus then position it properly\r\n\t\t \r\n\t \t var $queryField = $(queryField),\r\n\t \t \tfieldOffset = $queryField.offset(),\r\n\t \t \tnewTop = fieldOffset.top + queryField.offsetHeight + 1,\r\n\t \t \tnewLeft = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets all validation metadatas for the given object with the given groups. | getTargetValidationMetadatas(targetConstructor, targetSchema, always, strictGroups, groups) {
const includeMetadataBecauseOfAlwaysOption = (metadata) => {
// `metadata.always` overrides global default.
if (typeof metadata.always !== 'undefined')
return metadata.always;
... | [
"rules() {\r\n return this.request('GET', 'rules')\r\n .then((data) => (!!data['groups'] ? data['groups'] : []).map(RuleGroup.fromJSON));\r\n }",
"function getGroupProperties(item, groups) {\n var array = [];\n angular.forEach(groups, function (group) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get files from specified google drive folder, create array to make things easier when sending the email later | function get_file_array_from_google_drive_(folder_object) {
var return_array = [];
var files = folder_object.getFiles();
while (files.hasNext()){
var file = files.next();
var this_file = {};
this_file.id = file.getId();
this_file.name = file.getName();
this_file.url = file.g... | [
"function get_file_array_from_google_drive(folder_object) {\n \n var return_array = [];\n \n var files = folder_object.getFiles();\n \n while (files.hasNext()){\n var file = files.next();\n \n var this_file = {};\n \n this_file.id = file.getId();\n this_file.name = file.getName();\n this_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sample Twitter API function to get tweet broken down into its components adds one tweet to twitter.movies collection in mongoDB each time it is called | function getTweetSample() {
//q is the query term parameter
//get 10 latest tweets since 2011-11-11
//go to the below link for a list of search params
//https://dev.twitter.com/rest/reference/get/search/tweets
var getParams = {
q: 'movie since:2011-11-11',
count: 1
}
function got... | [
"function getAndManipulateTweets() {\n //searching tweets\n T.get('search/tweets', params, function(err, data, response) {\n //throw error message\n if (err) console.log(err);\n\n if (!err) {\n //get tweetId\n let tweets = data.statuses;\n tweets.map(function(tweet) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
validate the response to the test request | validateResponse (data) {
this.validateDisposition(data);
this.validateVersionInfo(data);
this.validateAgentInfo(data);
this.validateAssetUrl(data);
} | [
"validateResponse (data) {\n\t\t// the response will be empty, since there is no change\n\t\tAssert.deepEqual(data, { }, 'expected empty response');\n\t}",
"validateResponse (data) {\n\t\tAssert.deepStrictEqual(data, {}, 'empty response not returned');\n\t}",
"validateResponse (data) {\n\t\tAssert.notEqual(data... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Oculta o muestra los div de movie o serie segun la opcion del formulario de producciones | function mostrarDIVS(){
var opcioDiv = document.forms["addProduction"]["tipo"];
var divM = document.getElementById("divMovie");
var divS = document.getElementById("divSerie");
if (opcioDiv.value == "0") {
divM.style.display = "none";
divS.style.display = "none";
}else if(opcioDiv.value == "Movie"){
divM.styl... | [
"function mostrarPlantearEje(){ // Cuando toque el boton \"plantear ejercicios\" voy a ver la seccion (plantear tarea a alumnos)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#divDevoluciones\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Controller for time picker input. | function TimeController(timeService) {
var self = this;
/**
* Init controller with sane defaults.
*/
self.$onInit = function() {
self.valueMS = self.valueMS || self.options.default || timeService.milliseconds(timeService.now());
self.valueSTR = timeService.str(time... | [
"function pickerTime(){\r\n console.log('pickerTime called');\r\n\r\n var $input = $('.timepicker').pickatime({\r\n // Escape any “rule” characters with an exclamation mark (!).\r\n format: 'H!hi',\r\n formatLabel: '<b>H</b>!h i',\r\n formatSubmit: 'H:i',\r\n hiddenPrefix: 'p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tie into YouTube API and display videos based on userLocation and userInterests | function youTubeAPICall() {
var locationYouTube = userLocation;
var userInterestYouTube = userInterests;
var searchYouTube = locationYouTube + " " + userInterestYouTube;
var queryURLYouTube = "https://www.googleapis.com/youtube/v3/search?part=snippet&q=" + searchYouTube + "&type=video&key=AIzaSyB8DRZm6... | [
"function getVideos() {\n var arr_search = {\n part: \"snippet\",\n type: \"video\",\n order: \"date\",\n maxResults: 3,\n // topicId: \"/m/04rlf\",\n location: `${lat}, ${lon}`,\n locationRadius: \"100km\",\n videoEmbeddable: true,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
===================================================================================================== 3D object class ===================================================================================================== | function Object_3DClass(){
this._geometry = new THREE.BoxGeometry( 1, 1, 1 );
this._material = new THREE.MeshBasicMaterial( { color: 0xff00ff } );
this._mesh = new THREE.Mesh( this._geometry, this._material );
} | [
"function Object3D()\n{\n\tthis.id = MathUtils.generateID();\n\tthis.name = \"\";\n\tthis.type = \"Object3D\";\n\t\n\t/**\n\t * Local position.\n\t */\n\tthis.position = new Vector3(0,0,0);\n\n\t/**\n\t * Local euler rotation.\n\t */\n\tthis.rotation = new Vector3(0,0,0);\n\n\t/**\n\t * Local scale.\n\t */\n\tthis.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generic function for visiting GraphQLSchema objects. | function visitSchema(schema,
// To accommodate as many different visitor patterns as possible, the
// visitSchema function does not simply accept a single instance of the
// SchemaVisitor class, but instead accepts a function that takes the
// current VisitableSchemaType object and the name of a visitor method and
// ... | [
"function visitSchema(schema, \n // To accommodate as many different visitor patterns as possible, the\n // visitSchema function does not simply accept a single instance of the\n // SchemaVisitor class, but instead accepts a function that takes the\n // current VisitableSchemaType object and the name of... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns whether or not the labs are connected to the host. | function isConnected() {
return _connectionState === Labs.ConnectionState.Connected;
} | [
"is_connected() {\n if (this.active_device === null) {\n return false;\n }\n else {\n return this.active_device.isConnected();\n } \n }",
"function isConnected() {\r\n\tif((typeof con != 'undefined') && con && con.connected())\r\n\t\treturn true;\r\n\t\r\n\tret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get data and create answer, wrong answers and question for that random pokemon | async function getPokemonData() {
let randomPokemonId = Math.floor(Math.random() * numOfPokemon) + 1;
let randomPokemon;
try {
randomPokemon = await fetch(
`https://pokeapi.co/api/v2/pokemon/${randomPokemonId}`
)
.then((res) => res.json())
.then((pokemon) => {
return pokemon;
});
} catch (err) {... | [
"function randomPokemon() {\n selector = Math.floor(Math.random()* 781) + 26 //Random number between 26 and 809\n getAPIData(`https://pokeapi.co/api/v2/pokemon/${selector}`).then((pokeData) => {\n populatePokeCards(pokeData)\n })\n}",
"function getRandomCandidateAnswers() {\n\n let pokemonAnswerIDs = []... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for call logs, add call logs to callLogsContainer | function addCallLogsToContactContainer(list){
if (list==null){
$('#callLogsContainer').html("Error while fetching callLogs, please try again");
}
else {
var div=document.getElementById("callLogsContainer");
var t=document.createElement("table");
t.setAttribute("class","highlight");
var thead=d... | [
"function storeCallLogs() {\n var callEventChannel, action, call, logEntry, contactName;\n return _regenerator2.default.wrap(function storeCallLogs$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return (0, _effects3.actio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register callback to run on account logout | registerAccountLogoutCallback(callback) {
this.callbacks.ACCOUNT_LOGOUT.push(callback);
} | [
"function logoutCallback() {\n logoutUser();\n}",
"setOnLogout(func) {\n this.onLogout = func;\n }",
"function notifyOnLogoutListener() {\n onLogoutListener.forEach((callback) => {\n callback.call(null);\n });\n }",
"handleLogoutRedirect () {\n return userManager.si... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the collections of images present in the HeaderFooters | get headerFooterImages() {
if (this.mHeaderFooterImages === undefined) {
this.mHeaderFooterImages = new Dictionary();
}
return this.mHeaderFooterImages;
} | [
"get headersFooters() {\n if (this.mHeaderFooterColl === undefined) {\n this.mHeaderFooterColl = new Dictionary();\n }\n return this.mHeaderFooterColl;\n }",
"function getLoadedImages() {\r\n return images;\r\n }",
"function getImages(){\n return images;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads 4 bytes from array starting at offset as bigendian unsigned 32bit integer and returns it. | function readUint32BE(array, offset = 0) {
return ((array[offset] << 24) |
(array[offset + 1] << 16) |
(array[offset + 2] << 8) |
array[offset + 3]) >>> 0;
} | [
"function readUint32LE(array, offset) {\n if (offset === void 0) { offset = 0; }\n return ((array[offset + 3] << 24) |\n (array[offset + 2] << 16) |\n (array[offset + 1] << 8) |\n array[offset]) >>> 0;\n}",
"function readUint32BE(array, offset) {\n if (offset === void 0) { offset = 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a random cheerser | function getCheerser() {
return cheersers[Math.floor(Math.random() * cheersers.length)];
} | [
"function get_random () {\n var idx = Math.floor(Math.random() * context.recipes.length);\n return context.recipes[idx];\n }",
"getRandomRecipe() {\n const randomRecipeNumber = this.getRandomInt(this.getChosenRecipe().length);\n return this.getChosenRecipe()[randomRecipeNumber];... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make the tests pass for the following tasks: Create a constructor function for a Person. Each person should have a firstName, lastName, favoriteColor, favoriteNumber and favoriteFoods (which should be an array). | function Person(firstName, lastName, favoriteColor, favoriteNumber, favoriteFoods) {
this.firstName = firstName;
this.lastName = lastName;
this.favoriteColor = favoriteColor;
this.favoriteNumber = favoriteNumber;
this.favoriteFoods = favoriteFoods || [];
this.family = []; // moved up here from p... | [
"function Person(firstName, lastName, favoriteColor, favoriteNumber) {\n\tthis.firstName = firstName;\n\tthis.lastName = lastName;\n\tthis.favoriteColor = favoriteColor;\n\tthis.favoriteNumber = favoriteNumber;\n\n\tthis.family = [];\n}",
"function personTest() {\n\tconsole.log(\"Testing the person class:\");\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enables tool for creating Free Area Polygons. This tool remains active until another tool is enabled or the active tool is disabled. Disable's the previously active tool. | enableCreateFreeAreaPolygonTool() {
this.disableActiveTool();
this.freeAreaPolygonTool.enableViewEventHandlers();
} | [
"enableCreateKeepoutAreaPolygonTool() {\n this.disableActiveTool();\n this.keepoutAreaPolygonTool.enableViewEventHandlers();\n }",
"enableCreateFreeAreaRectangleTool() {\n this.disableActiveTool();\n this.freeAreaRectangleTool.enableViewEventHandlers();\n }",
"function activate... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return adjacent faces counted by number of sides | adjacentFaceCounts() {
return _.countBy(this.adjacentFaces(), 'numSides');
} | [
"countAdjacentTri(e) {\n\tlet count = 0;\n\tfor (let i=0; i<this.faces.length; i++) {\n\t let f = this.faces[i];\n\t let v0 = f.v0;\n\t let v1 = f.v1;\n\t let v2 = f.v2;\n\n\t if (e.equal(v0,v1)) count++;\n\t if (e.equal(v1,v2)) count++;\n\t if (e.equal(v2,v0)) count++;\n\t}\n\treturn count;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Starting from google cloud vision and azure computer vision objects build a common objects array (given also a minimum confidence threshold) | function buildObjectsObj(gCloudV, azureCV, minScore = 0.0){
let objects = [];
if(gCloudV) {// gcloud vision results are available
let gCloudObjects = gCloudV['localizedObjectAnnotations'];
//apply standard bounding box to all the detected objects
if(azureCV)// azure computer vision res... | [
"function buildLandmarksObj(gCloudV, azureCV, minScore = 0.0){\n let landmarks = [];\n\n if(gCloudV){ //google cloud vision results are available\n\n let gCloudLandMarks = gCloudV['landmarkAnnotations'];\n\n //apply standard bounding box to all the landmarks objects\n if(azureCV)// azure ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
VariableDefinition : Variable : Type DefaultValue? Directives[Const]? | function parseVariableDefinition(lexer) {
var start = lexer.token;
return {
kind: Kind.VARIABLE_DEFINITION,
variable: parseVariable(lexer),
type: (expectToken(lexer, TokenKind.COLON), parseTypeReference(lexer)),
defaultValue: expectOptionalToken(lexer, TokenKind.EQUALS) ? parseValueLiteral(lexer, tr... | [
"parseVariableDefinition() {\n return this.node(this._lexer.token, {\n kind: Kind.VARIABLE_DEFINITION,\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS)\n ? this.parseCons... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Expand all groups. This function is exposed on Grid and can thus be called as `grid.expandAll()` | expandAll() {
const me = this;
if (me.store.isGrouped) {
me.store.groupRecords.forEach((r) => me.internalToggleCollapse(r, false, true));
me.grid.refreshRows();
}
} | [
"expandAll() {\n const me = this;\n\n if (me.store.isGrouped && !me.disabled) {\n me.store.groupRecords.forEach(r => me.internalToggleCollapse(r, false, true));\n me.grid.refreshRows();\n }\n }",
"expandAllRows() {\r\n const that = this;\r\n\r\n if (!that.hasAttribute('hierarchy'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cambia el estado del Formulario MonitoreoRoedorFinca | cambiarEstadoValidoFormMonitoreoRoedorFinca(state, nuevoEstado) {
state.formMonitoreoRoedorFincaValido = nuevoEstado
} | [
"vaciarMonitoreoRoedorFinca(state) {\n state.monitoreoRoedorFinca = new MonitoreoRoedorFinca('', '', '', '', '', '', '', '', '', '')\n }",
"cambiarEstadoValidoFormRiego(state, nuevoEstado) {\n state.formRiegoValido = nuevoEstado\n }",
"nuevoMonitoreoRoedorFinca(state, nuevoMo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define a generic wrapping funciton, taking as parameters an object whose method is to be wrapped, name of object method to be wrapped, and function to be executed in place of original method | function wrap(object, method, wrapper) {
// remembers original function so that we can later reference it via
// a closure should we desire
var fn = object[method];
// wraps original function by creating a new function that calls
// function passed as wrapper. within new function, wrapper function
// is ca... | [
"function _make_wrapped_method(name, fn) {\n return function() {\n var tmp = this._super;\n\n // Add a new ._super() method that is the same method\n // but on the super-class\n this._super = _super[name];\n\n // The method only need to be bound temporarily, so we\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
~~~~~~~~~~~~~~~~~~~~~~~~~SET ONE POINT ON MAP~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | function onePoint() {
var branch_id = $('#branch_id').val();
var postData = 'branch=' + branch_id + '&_csrf=' + $('.toPost').val();
$.post('/companies/getonepoint', postData, function(data) {
var answer = jQuery.parseJSON(data);
onePoint = prepareOnePlacemark(answer);
... | [
"function setPointOnMap(ax, ay) {\n myMap.geoObjects.removeAll();\n var onePoint = new ymaps.Placemark(\n [ay, ax], {},\n {\n preset: \"islands#redIcon\",\n });\n\n myMap.geoObjects.add(onePoint);\n myMap.setCenter([ay, ax], 16);\n}",
"function initMap()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
helper function to generate placeholder option for dropdown. | placeholderOption() {
return this.props.placeholderOption ? this.props.placeholderOption : this.props.DropdownOptions[0];
} | [
"function create_null_opt($container){\n\t\t\tvar $null_opt = document.createElement('option');\n\t\t\t$null_opt.innerHTML = config.lang.M14;\n\t\t\t$null_opt.value = '';\n\t\t\t$container.appendChild($null_opt);\n\t\t}",
"singleSelectPlaceholder(options) {\n return `<div class=\"selectivity-placeholder\">... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[Internal Function] Get a socket via UUID | _GetSocket(UUID)
{
const index = this._Sockets.findIndex(s => s._UUID == UUID);
if(index != -1)
{
return this._Sockets[index];
}
else
{
return false;
}
} | [
"function getSocketId() {\n const socketId = socket ? socket.id : 'none';\n\n return socketId || 'none';\n}",
"function getSocket(socketId) {\n return io.sockets.sockets.get(socketId);\n }",
"function getSocketName() {}",
"function getSocket(id)\n \t{\n \t\tif (sockets[id])\n \t\t{\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the weapon interface of the secondary weapon | function updateWeaponInterface() {
switch(activeSecWeapon) {
case 0:
guidedRock.hide();
migPic.hide();
wavePic.hide();
rocketPic.show();
currentAmmo = rocketAmmo;
maxAmmo = MaxRocketAmmo;
break;
case 1:
guidedRock.hide();
rocketPic.hide();
wavePic.hide();
migPic.show();
... | [
"function updateWeaponInterface() {\n\tswitch(activeSecWeapon) {\n\t\tcase 0:\n\t\t\t\tcurrentAmmo = rocketAmmo;\n\t\t\t\tmaxAmmo = MaxRockedAmmo;\n\t\t\t\tbreak;\n\t\tcase 1:\n\t\t\t\tcurrentAmmo = MGAmmo;\n\t\t\t\tmaxAmmo = MaxMGAmmo;\n\t\t\t\tbreak;\n\t\tdefault:\n\t\t\t\tcurrentAmmo = 42;\n\t\t\t\tmaxAmmo = 42;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the http request body with assembling the ending line to the sub request body. | getHttpRequestBody() {
return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`;
} | [
"function serializeSubRequest(request) {\n var requestBody = JSON.stringify(request.body);\n var messagePayload = \"POST \" + request.url + \" HTTP/1.1\\r\\n\";\n messagePayload += \"Content-Length: \" + requestBody.length + \"\\r\\n\";\n messagePayload += 'Content-Type: application/json; charset=UTF-8\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
start the generating process | function startGenerating() {
log("Starting generating...");
if (network == null) {
log("Error: No network loaded.");
return;
}
const melodyLength = (function() {
return 128;
})();
generate(network, melodyLength);
} | [
"function startGenerator() {\n createManager();\n}",
"async start() {\n\t\tawait this.#preprocessor.execQueue();\n\t\tawait this.#pageGen.generatePages();\n\n\t\tthis.#emitter.emit('end');\n\t}",
"function run () {\n // check if template is local\n if (isLocalPath(template)) {\n const templatePath = get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test whether or not the given parameter `obj` is a Position object | function isPosition(obj)
{
try {
return obj.isPosition === true;
} catch (e) {
return false;
}
} | [
"function requirePosition(obj)\n{\n if (!isPosition(obj))\n throw AssertionException(\"Is not a position\");\n}",
"static isIPosition(obj) {\n return (obj\n && (typeof obj.lineNumber === 'number')\n && (typeof obj.column === 'number'));\n }",
"static isIPosition(obj) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
randomly select obstacle type | function randomizeObstacles(typeStrict) {
if (!isGameEnded) {
var type = randomIntGen(1,typeStrict);
switch(type) {
case 1:
return MeshObstacle = new THREE.Mesh(GeometryObstacleA, randomObstacleMaterial());
case 2:
return MeshObstacle = new THREE.Mesh(GeometryObstacl... | [
"renderRandomObstacle() {\n if (this.currentObstacle.hasGoneOffScreen()) {\n this.currentObstacle.resetPosition();\n this.currentObstacle = this.obstacles[getRandomNum(this.obstacles.length)];\n } else {\n this.currentObstacle.obstacleRender();\n }\n }",
"function chooseRandomMove() {\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Xpath for Meeting Card All Race List Tab Race Content | get meetingRaceList_RaceContent() {return browser.element("//android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.widget.TextView[2]");} | [
"get meetingRaceList_RaceNo() {return browser.element(\"//android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.view.ViewGroup[1]\");}",
"get raceListTab() {return browser.element(\"~Race List\");}",
"get Homescreen_RaceResult() {return browser.element(\"//XCUIElementTypeOther[@name='z... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the number of an item which can be crafted given the resources available in this market. | canManufacture(item) {
const res = resource_1.resources[item];
const counts = [];
if (resource_1.isCraft(res)) {
const need = this.getNeed(item);
for (const mat of Object.keys(res.recipe.materials)) {
if (this.getNeed(mat) > need) {... | [
"function canEquipItemCount() {\n var stats = (0, _templateString.$stats)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral([\"Muscle, Mysticality, Moxie\"]))).map(stat => Math.min((0, _kolmafia.myBasestat)(stat), 300));\n\n if (stats.every((value, index) => value === cachedStats[index])) {\n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shows or hides format toolbar depending on current selection | selectionchange() {
const editable = this.editor.getSelectedEditable();
if (editable && !this.editor.window.getSelection().isCollapsed && this.editor.tags.allowed(editable, 'format', true)) {
this.editor.formats.hidden = false;
this.editor.formats.style.top = `${editable.offsetT... | [
"function chooseViewFormat(e) {\n hideAll();\n var position = getPosition(e.currentTarget);\n $('#view-formats').css('top', position.y-4);\n $('#view-formats').show();\n $('#download-formats').hide();\n}",
"function showFormatting() {\n\t$('#formatting_guide').toggle('fast');\n}",
"function hideF... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return number of posts the user can post this week. | function getPostsLeft() {
if (!Meteor.userId()) {
return 0;
}
var startOfWeek = getStartOfWeek();
var postsMade = posts.find({
userId: Meteor.userId(),
createdAt: { $gt: startOfWeek.getTime() }
}).count();
return POSTS_PER_WEEK - postsMade;
} | [
"function getPostsLeft() {\n\tif (!Meteor.userId()) {\n\t\treturn 0;\n\t}\n\tvar startOfWeek = getStartOfWeek();\n\tvar postsMade = posts.find({\n\t\tuserId: Meteor.userId(),\n\t\tcreatedAt: {$gt: startOfWeek.getTime()}\n\t}).count();\n\treturn POSTS_PER_WEEK - postsMade;\n\t// return 1\n}",
"function get_post_co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method is for user player to play TicTacToe first user will get position by using mark x | player()
{
this.showGame();
console.log("which position do you want to mark x" );
var x=readline.question('');
var y=readline.question('');
if(arr[x][y]=='_'){
arr[x][y]='x';
return;
}
else {
console.log ('This position have already marked');
player();
... | [
"getPlayerStartingX() {\n return this.getGridRowPosition(this.players.length);\n }",
"winningPositions(mark){\n if (this.winner() !== null){\n return this.board.winningPositions(mark);\n }\n }",
"function playmove(move, mark, oppmark, visualboard, firstplayermove){\n var correct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a list of marker objects, for markers with defined strength each marker has following fields: x, y, quadrant, botColor, strength set keepUndefined to true to emit every marker, regardless of definition | function getMarkers(board, keepUndefined) {
if (typeof keepUndefined === 'undefined') {
keepUndefined = false
}
var markers = []
for (var x = 0; x < board.num_cols; x++) {
for (var y = 0; y < board.num_rows; y++) {
for (var q = 0; q < Direction.NUM_DIRECTIONS; q++) {
for (var c = 0; c < B... | [
"function get_markers() {\n\t\t$('div.meal').each(function() {\n\t\t\t$(this).children('input').each(function() {\n\t\t\t\tif($(this).attr('title') == 'lat') lat = $(this).val();\n\t\t\t\tif($(this).attr('title') == 'lon') lon = $(this).val();\n\n\t\t\t\t// meal hidden, shown at markerclick\n\t\t\t\t//info = '#'+$(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to upload the Index CPT codes from the CSV file to the MongoDb Database | function parseCsvForCptIndex(req, res) {
let duplicate = 0;
let entries = 0;
fs.readFile(filePathForCptIndex, {
encoding: 'utf-8'
}, async function (err, csvData) {
if (err) {
console.log(err);
}
csvParser(csvData, {
delimiter: ','
}, asy... | [
"function csvToMongo(filePath){\n \n csv()\n .fromFile(filePath)\n .then((jsonObject)=>{\n \n db.collection(\"Data\").insertMany(jsonObject, (err, res) => {\n if (err) {\n throw err;\n }\n res.send(\"Dat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pick a new set of training data indices for the next batch | function draw_indices(N) {
let batch = [];
for (let i = 0; i < N; i++) {
// If there are no more indices, refill them
let nAvailableIndices = indices_sgd.length;
if (nAvailableIndices == 0) {
indices_sgd = get_range(state.data.length);
nAvailableIndices = i... | [
"trainBatch(set, batchSize) {\n for (let i = 0; i < batchSize; i++) {\n let index = Math.floor(Math.random()*set.length);\n this.backpropagate(set[index].input, set[index].label, batchSize);\n }\n }",
"function nextbatch() {\n setPokebatch(nextPokebatch);\n setSpriteoffset(spriteoff... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Copy one search object to another. | function copySearch(fromSearch) {
var toSearch = {
GameId: fromSearch.GameId,
PlayerId: fromSearch.PlayerId,
Turn: fromSearch.Turn,
SearchNumber: fromSearch.SearchNumber,
SearchType: fromSearch.SearchType,
Area: fromSearch.Area,
Markers: []
};
if (from... | [
"function assignValue(searchf, object){\n var result = searchf(object);\n if(_.isUndefined(object.__search)){\n return _.extend({__search:result},object);\n }\n var temp = object;\n temp.__search = object.__search + result;\n return temp;\n }",
"function copy(o1, o2) {\n f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a pageItem's VisibleBounds vs GeometricBounds Difference needed to substract from an item's width/height since they're based on Geometric width/height | function getPgItemGBoundsvsVBoundsDifference (pgitem) {
// get selection bounds
var sel = pgitem;
var selVB = sel.visibleBounds;
var selVw = selVB[2]-selVB[0];
var selVh = selVB[1]-selVB[3];
var selGB = sel.geometricBounds;
var selGw = selGB[2]-selGB[0];
var selGh = selGB[1]-selGB[3];
// get the difference b... | [
"function itemBoundsDiff(item) {\n \n var itemVB = item.visibleBounds,\n itemVW = itemVB[2] - itemVB[0],\n itemVH = itemVB[1] - itemVB[3],\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |