query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
console.log(sloap(3)); 10. If the length of your name is greater than 7 say, your name is long else say your name is short. | function myName(value) {
if (value.length > 7) {
return "Your name is long";
} else {
return "Your name is short";
}
} | [
"function isItShort(element){\n if (element.length < 10) {\n return \"That's a small string!\";\n }\n else {\n return \"That's not a small string!\";\n }\n}",
"function howLongIsMyString(element){\n if (element.length > 20) {\n return \"That's a long string!\"\n }\n else if (element.length >= 10 &... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if request and response data are equal | function checkData(res) {
assert.equal(res.body.success, "true", "success should be true");
assert.equal(res.body.data, testData.note.data, "request and response data should be equal");
} | [
"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}",
"function checkResponse() {\n\t\tfor (var i = 0; i < response.length; i++) {\n\t\t\tif (response[i] != sequence[i]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle 'proxy' cmd line arg: p= | function parseArgs() {
var args = process.argv.slice(2);
for (var i = 0; i < args.length; i++) {
var arg = args[i];
if (arg.startsWith('-p')) {
var strs = arg.split('=');
if (strs[1].length > 0) {
proxy = strs[1];
return proxy;
}
}
}
return undefined;
} | [
"SetProxy(short, bool, int, string, string) {\n\n }",
"function setProxy(proxy) {\n\t\t\ttempProxyVar = proxy;\n\t\t\treturn true;\n\t\t}",
"function proxyPrimeOpts(target) {\n const opts = proxyOpts(target);\n\n // Don't intercept if the PRIME environment variable is not set\n if (!prime?.length) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cancel the deletion of the version and reshow the previous interface | function cancelDeleteVersion(versionId) {
$('#version-delete-' + versionId).addClass('hidden');
$('#version-info-' + versionId).removeClass('hidden');
} | [
"function cancelRevise(){\n\t\t\tWL.SimpleDialog.show(\"Cancel Revise\", \"Do you want to cancel this revision without finalizing your changes ?\", [{\n\t\t\t\ttext: \"Continue\",\n\t\t\t\thandler: function(){\n\t\t\t\t\thandleBackButton();\n\t\t\t\t}\n\t\t\t},{\n\t\t\t text : \"Cancel\"\n\t\t\t}]);\t\n\t\t}",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FOURTH PASS PoetryRelated Material Fetches the required data from the database. | function fetchPoetryRelated(response, type, err, contents)
{
"use strict";
var query = "SELECT * FROM Book "+
"LEFT JOIN Author ON Author.code = Book.author "+
"WHERE Book.genre = 'poetry-related' "+
"ORDER BY surname, title;";
db.all(query, ready);
function ready(err... | [
"async function loadMaterial(ctx, next) {\n ctx.state.material = await ctx.orm.material.findByPk(ctx.params.id);\n if (ctx.state.material) {\n return next();\n }\n ctx.redirect(ctx.router.url('materials.list'));\n return 'Invalid Material!';\n}",
"function getMaterials() {\n queryFetch(BASE_URL+'earth9... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns `true` if this config is using the global path, `false` otherwise. | isGlobal() {
return !!this.options.isGlobal;
} | [
"hasFilesystemConfig(): boolean {\n return this.babelrc !== undefined || this.config !== undefined;\n }",
"isRootFound() {\n return Boolean(this.config.root);\n }",
"async checkIfConfigured () {\r\n this.path = await this._getToolPath()\r\n return this.path != null\r\n }",
"async checkIfC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to make output pane small | function makeSmallOutputPane() {
outputPaneRef.current.style.width = "250px"
} | [
"function makeBigOutputPane() {\n outputPaneRef.current.style.width = \"96%\"\n }",
"function sizeDetailPane() {\n}",
"function outputResize() {\n var newHeight = $(\"#output-panel\").height() - 35;\n $(\"#output\").css('max-height', newHeight);\n }",
"function setPaneSi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add a new triangle given vertex indices and adjacent halfedge ids | _addTriangle(i0, i1, i2, a, b, c) {
const t = this.trianglesLen;
this._triangles[t] = i0;
this._triangles[t + 1] = i1;
this._triangles[t + 2] = i2;
this._link(t, a);
this._link(t + 1, b);
this._link(t + 2, c);
this.trianglesLen += 3;
... | [
"function addTriangleVertexForIndices(vIndex, tIndex, nIndex){\r\n //add x,y, and z coordinates\r\n meshVertices.push(vertices[3*vIndex], vertices[3*vIndex+1], vertices[3*vIndex+2]);\r\n //add s and t texture coordinates\r\n meshTexCoords.push(textureCoords[2*tIndex],textureCoords[2*tIndex+1]);\r\n /... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the events for the Poker game. | function createPokerEvents()
{
// canvasObjs[0] (Menu button) is still there so start from 1
// PLAY chip
canvasObjs[1] = new CanvasObject(75, DEFAULT_CANVAS_SIZE - 75, 0, 0, CHIP_RADIUS);
canvasObjs[1].clickCallback = function()
{
Game.counter++;
}
... | [
"function _createCustomEvents() {\n\t\t// create 4 types of event\n\t\tthis.events = {\n\t\t\t'toggled' : document.createEvent('Event'),\n\t\t\t'added' : document.createEvent('Event'),\n\t\t\t'removed' : document.createEvent('Event'),\n\t\t\t'replaced' : document.createEvent('Event')\n\t\t};\n\n\t\tthis.events.togg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the error object indicates that the `unlink` system call failed due to a permissions issue (`EPERM`). | static isUnlinkNotPermittedError(error) {
return FileSystem.isErrnoException(error) && error.code === 'EPERM' && error.syscall === 'unlink';
} | [
"[ISREUSABLE] (entry, st) {\n return entry.type === 'File' &&\n !this.unlink &&\n st.isFile() &&\n st.nlink <= 1 &&\n process.platform !== 'win32'\n }",
"function chownErOk (er) {\n if (!er)\n return true\n\n if (er.code === \"ENOSYS\")\n return true\n\n var nonroot = !p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Comparator between two mappings with inflated source and name strings where the generated positions are compared. | function compareMappings(a, b) {
var cmp = a.generatedLine - b.generatedLine;
if (cmp != 0) return cmp;
cmp = a.generatedColumn - b.generatedColumn;
if (cmp != 0) return cmp;
cmp = strcmp(a.source, b.source);
if (cmp != 0) return cmp;
cmp = a.originalLine - b.originalLine;
if (cmp != 0) re... | [
"function compareByGeneratedPositionsInflated(mappingA,mappingB){var cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp!==0){return cmp;}cmp=mappingA.generatedColumn-mappingB.generatedColumn;if(cmp!==0){return cmp;}cmp=strcmp(mappingA.source,mappingB.source);if(cmp!==0){return cmp;}cmp=mappingA.originalLine-m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to get data from YouTube API | function getYoutubeDataFromApi(searchTerm, callback) {
if($('.js-query').val()){
const query = {
part: 'snippet',
key: 'AIzaSyCo3Hc6JwT7iXeFvOUuVJOyoQPHOlWeUd4',
q: `${searchTerm} in NYT`,
maxResults: "2"
}
$... | [
"function youtubeAPI(data) {\n var youtubeHeading = data.recipe.label;\n var youtubeUrl = `https://youtube.googleapis.com/youtube/v3/search?part=snippet&maxResults=3&q=${youtubeHeading}&key=AIzaSyDIguCz_5VxSSQ_HIouV7kqUS4rNjWoi0A`;\n\n fetch(youtubeUrl)\n .then(function (response) {\n return response.jso... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decide if a Scenegraph item deserves tooltip | function shouldShowTooltip(item) {
// no data, no show
if (!item || !item.datum) {
return false;
}
// (small multiples) avoid showing tooltip for a facet's background
if (item.datum._facetID) {
return false;
}
return true;
} | [
"function shouldShowTooltip (item) {\n // no data, no show\n if (!item || !item.datum) return false;\n\n // (small multiples) avoid showing tooltip for a facet's background\n if (item.datum._facetID) return false;\n\n // avoid showing tooltip for axis title and labels\n if (!item.datum._id) return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to return all inbox threads. | function totalInboxThreads()
{
var threads = GmailApp.getInboxThreads();
return threads
} | [
"function getInboxThreadsBySender() {\n var threadsBySender = new Map();\n var max = 300;\n var start = 0;\n var limit = 100;\n while (max > limit) {\n var threads = GmailApp.search(\"in:inbox is:unread\", start, limit);\n Logger.log(\"got all inbox threads %s\", threads.length);\n var messages = Gmai... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this is to be performed whenever a connected node is disconnected and it is to be removed from the nodes array | function workOnDisconnect(socketDisconnected) {
socketDisconnected.on("disconnect", function(data) {
console.log(data);
let temp = nodes.find(function(obj) {
return obj.socket.id === socketDisconnected.id;
});
console.log("disconnecting", temp.clie... | [
"clear_nodes() {\r\n for (const node of this.nodes) {\r\n node.disconnect()\r\n }\r\n this.nodes = []\r\n }",
"suicide(){\n\t\tfor(let i in this.nodeArray){\n\t\t\tthis.nodeArray[i].disconnect();\n\t\t}\n\t}",
"anchoredNodeRemoved(node) {}",
"removeInstanciedNode(node) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Devuelve TRUE si el array de tags tiene longitud 2 y la primera es la nota y la segunda la la pregunta. Estos corresponden a los criterios de rubrica que se crean al principio | function filtradoTags2(tags) {
return (tags.length==2) && tags[0].includes("mark") && tags[1].includes("isCriteriaOf");
} | [
"function filtradoTags(tags) {\n return (tags.length==2) && tags[0].includes(\"isCriteriaOf\") && tags[1].includes(\"mark\");\n}",
"checkTags() {\n var tag;\n \n var tags;\n var tagName;\n var zephlen;\n for (var i = 0; i < Mavelet.config.check.length; i++) {\n tags = documen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inits server and start to listen for the new connected clients to return the last posts list | function init() {
kalmServer = setServer();
kalmServer.on('connection', function(client) {
redisService.getLastPosts().then((tweets) => {
client.send('tweets', tweets);
});
});
console.log('Server is up');
} | [
"function server_net() {\n this.clients = [];\n }",
"async function startup() {\n console.log(\">SERVER: startup() called\");\n blogPostData = await scraper.getBlogPosts();\n console.log(\">SERVER: got initial blog data, len= \" + blogPostData.length);\n}",
"start () {\n this.ws = new WS.Server(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
You can also get height of the toolbars that are currently displayed | function getHeightOfIOSToolbars() {
var tH = (window.orientation === 0 ? screen.height : screen.width) - getIOSWindowHeight();
return tH > 1 ? tH : 0;
} | [
"function getHeight(){\n return document.getElementById(\"mybeans_panel\").offsetHeight;\n}",
"function getWorkspaceHeight()\r\n{\r\n\tvar total = alib.dom.getClientHeight();\r\n\r\n\t// Subtract the height of the header\r\n\tvar header = document.getElementById(\"appheader\");\r\n\tif (header)\r\n\t\ttotal -=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Object that can be stored in the database. | get dbRepresentation(){
return Object.assign({}, this._obj);
} | [
"get dbRepresentation() {\n\n // serialize the components\n let components = this.components.map(\n component => component.dbRepresentation\n );\n\n // assemble the object for the database.\n let dbObj = Object.assign({}, this._obj);\n dbObj.components = componen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Passing Joke to VoiceRSS API | function tellMe(joke) {
console.log("tell me:", joke);
VoiceRSS.speech({
key: "3d5ce7cfb8d646b8a9a97344c92f31b0",
src: "let me tell you a JOKE.... " + joke,
hl: "en-us",
v: "Linda",
r: 0,
c: "mp3",
f: "44khz_16bit_stereo",
ssml: false,
});
} | [
"function tellJoke(VoiceRSS, joke) {\n // console.log(joke);\n VoiceRSS.speech({\n key: '',\n src: joke,\n hl: 'en-us',\n v: 'Linda',\n r: 0, \n c: 'mp3',\n f: '44khz_16bit_stereo',\n ssml: false\n });\n}",
"function Tellme (joke){\n console.log(\"tell me joke :\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create a new reference entity all this does it create the entity in the breeze cache... | function createReference(initialValues) {
var referenceType = entityManager.metadataStore.getEntityType('Reference');
// create a new reference entity
var entity = entityManager.createEntity(referenceType, initialValues);
entity.Type = 'SP.Data.Research_x0020_ReferencesListItem';
entity['o... | [
"function createEntity(entity) {\r\n var deferred = $q.defer();\r\n\r\n if (entity.name != null && entity.schema != null) {\r\n loadData().then(function (data) {\r\n entity.id = data.length > 0 ? parseInt(data[data.length - 1].id) + 1 : 0;\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Example const blob = b64toBlob(b64Data, contentType); const blobUrl = URL.createObjectURL(blob); | function b64toBlob(b64Data, contentType, sliceSize) {
contentType = contentType || '';
sliceSize = sliceSize || 512;
const byteCharacters = atob(b64Data);
const byteArrays = [];
for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
const slice = byteCharacters.slice(offset, offset ... | [
"base64toBlob(b64Data, contentType) {\n contentType = contentType || \"\";\n let sliceSize = 512;\n let byteCharacters = atob(b64Data);\n let byteArrays = [];\n for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {\n let slice = byteCharacters.slic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve the model for a given comment. This will either generate the appropriate comment object based on ``commentType``, or grab the comment from a cache if it's been generated before. Args: reviewID (number): The ID of the review the comment belongs to. commentID (number): The ID of the comment. commentType (string)... | getComment(reviewID, commentID, commentType) {
if (!this._comments[commentID]) {
const CommentTypes = RB.CommentIssueManager.CommentTypes;
const reviewRequest = this.get('reviewRequest');
let comment = null;
switch (commentType) {
case CommentType... | [
"getComment(reviewID, commentID, commentType) {\n if (!this._comments[commentID]) {\n const reviewRequest = this.get('reviewRequest');\n let comment = null;\n\n switch (commentType) {\n case 'diff_comments':\n comment = reviewRequest\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
to do: create no arctic coverage and ' no antarctic' coverage default graphics, use in python to push with images Loads the catalog json file (which is generated daily with python) If there is a query string in the url it is passed to this function which will load the catalog config and then filter it based on the sear... | function loadCatalog(pageQuery){
//console.log(pageQuery)
// check that we really need to reload info from catalog.json
if ($(".entrydiv").length > 0) {
console.log('we already have a populated catalog') // fix for firing twice from refreshing or clicking too fast?
}
el... | [
"function coverage_image_loaded () {\n\treset_image_display ( 'coverage_image' ) ;\n\tloading ( -1 ) ;\n}",
"function loadCategorizationEntries(url) {\n var exp = URL.buildURL(decodeURIComponent(url));\n if (exp.queryParam('q')) {\n $('.refine > .panel > div').each(function () {\n exp.quer... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Can be called to explicitly disable event listening for clicks and touches outside of this element. | disableOnClickOutside() {
if (document !== null) {
document.removeEventListener('mousedown', this.boundHandler);
document.removeEventListener('touchstart', this.boundHandler);
}
} | [
"function disableClickEvents() {\n $(\".button\").css(\"pointer-events\", \"none\");\n $(\".roundBtn\").css(\"pointer-events\", \"none\");\n clickIsActive = false;\n }",
"cancelTouchEvents_() {\n // TODO(aghassemi, #4754): Ideally we only stop propagation of horizontal\n // touchmove events.\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creating both lab & ccode DOM elements could be combined into a single function | function createCcodesEls(ca) {
cCodeHeader = document.createElement("h2");
cCodeHeader.innerText = "'C' Coded Items";
cCodesEl.appendChild(cCodeHeader);
if (ca.length > 0) {
ca.forEach((el) => {
cCodeEl = document.createElement("DIV");
cCodeEl.innerHTML = `
<div class="${el[1]}">
<articl... | [
"function addCodeToHtml(){ \n let bSortCodeBlock = document.getElementById(\"bubble-sort-code-block\");\n let mSortCodeBlock = document.getElementById(\"merge-sort-code-block\");\n let qSortCodeBlock = document.getElementById(\"quick-sort-code-block\");\n let bSortInfoBlock = document.getElementById(\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse a unary operator, binary operator, cast, or property declaration. | function parsePropertyOrOperator(line) {
var form, parts = splitProperty(line, ',');
if (parts.length === 4) {
form = parts[2].trim();
if (form === 'BinaryOperator') {
return parseBinaryOperator(parts[0].trim(), parts[3].trim());
}
if (form === 'Cast') {
return parseCast(parts[0].trim... | [
"function parseSimpleUnaryExpression(){switch(token()){case 39/* PlusToken */:case 40/* MinusToken */:case 54/* TildeToken */:case 53/* ExclamationToken */:return parsePrefixUnaryExpression();case 85/* DeleteKeyword */:return parseDeleteExpression();case 108/* TypeOfKeyword */:return parseTypeOfExpression();case 11... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prints all headers used for every vertical as well as headers for SEO Liquid Values Tab | function printHeaders(clientProp) {
var seoLvTab = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('SEO Liquid Values');
var headerRange = spinUpTab.getRange(1,1,1,spinUpFileHeaders.length).setValues([spinUpFileHeaders]);
var lvheaderRange = seoLvTab.getRange(1,1,NUM_LV_HEADER_ROWS,seoLiquidValueTabHeaders[c... | [
"function _printHeader(){\n sys.log(sys.product.meta.getHeaderText());\n }",
"displayHeader() {\n const { header } = this.tool.options;\n if (header) {\n this.out(header, 1);\n }\n }",
"function initialize_print_headers() {\n var now = new Date();\n\n set_children($('sit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the toast by id, given it's in the DOM, otherwise returns null | function getToast(toastId, _ref) {
var containerId = _ref.containerId;
var container = getContainer(containerId);
if (!container) return null;
var toast = container.collection[toastId];
if (typeof toast === 'undefined') return null;
return toast;
} | [
"function _get(id) {\n if (!id) return null;\n return _getPanel().find('#shiny-notification-' + $escape(id));\n }",
"function findToast(toasts,id){var position=getToastPosition(toasts,id);var index=position?toasts[position].findIndex(function(toast){return toast.id===id;}):-1;return{position:position... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
launchGridEdit opens the gridedit window if possible. | launchGridEdit() {
if(this.model.grid_document === null || this.model.in_loading_state)
return;
if(this.model.gridedit_window === null || this.model.gridedit_window.closed)
{
this.model.gridedit_window = window.open(this.config.gridedit_url, "gridedit_" + new Da... | [
"function openEditor() {\n editing = true;\n initAppEditModal();\n initAppDeleteModal();\n toggleDragger();\n appNodes.forEach(function (app) {\n addDeleteBadge(app);\n bindAppEvents(app);\n });\n addNewAppPlaceholder();\n}",
"function openNutritionPrintGrid()\n{\n\tvar url = makeURL(\"NutritionDetai... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a snapshot of the data | createSnapshot(){
let fs = require('fs');
let fname = `data/snap${Date.now()}.bck`;
let ws = fs.createWriteStream(fname);
let base64Buffer = new Buffer.from(this.s.read());
ws.write(base64Buffer.toString('base64'));
} | [
"takeSnapshot() {\n this.snapshot_ = this.toJSON();\n }",
"function takeSnapshot() {\n snapshot = context.getImageData(0, 0, canvas.width, canvas.height);\n}",
"createSnapshot(){\r\n let fs = require('fs');\r\n let fname = `data/snap${Date.now()}.bck`;\r\n let ws = fs.createWriteStream(fname... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Open a toast, either as miniplayer or notification. | function openToast() {
closeToast(function() {
if (settings.toastUseMpStyle) {
createPlayer("toast", function(win) {
toastWin = win;
chromeWindows.onRemoved.addListener(toastMpClosed);
}, false);
} else {
var options = getToastOptions();
createNotifica... | [
"function toast() {\n\tM.toast({html: 'Eventual link to Github'})\n}",
"function toastShow() {\n toastElemant.show();\n}",
"function makeToast(toast) {\n Materialize.toast(toast, 3000, 'rounded')\n }",
"function showToast() {\n\n //primero eliminamos todos los toast\n M.Toast.dismissAll();\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize internal websocket callbacks | _initWsCallbacks () {
this._ws.onopen = () => this._wsOnOpen();
this._ws.onclose = async (event) => this._wsOnClose(event);
this._ws.onmessage = (event) => this._wsOnMessage(event);
this._ws.onerror = async (error) => this._wsOnError(error);
} | [
"function init() {\n websocket = new WebSocket(wsUri + salle);\n \n websocket.onopen = function(evt) { onOpen(evt); };\n websocket.onmessage = function(evt) { onMessage(evt); };\n websocket.onclose = function(evt) { onClose(evt); };\n websocket.onerror = function(evt) { onError(evt); };\n}",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
command_Website() Convenience getter of an instance of CW_Network | static get network()
{
return network;
} | [
"async getCurrentNetwork() {\n return await web3Service.getCurrentNetwork();\n }",
"static async getNetwork() {\n return web3.eth.net.getNetworkType();\n }",
"get Website(){\n return getFieldValue(this.accountData.data, WEBSITE);\n }",
"get_network_info() {\r\n return this.call(\"/get_n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
push data into dom_htmlContent_arr by dom_categoryNames_arr(from dom) | function update_htmlContent_arr_by_dom_categoryNames(data, dom_categoryNames_arr, htmlContent_arr){
for (var i = 0; i < dom_categoryNames_arr.length; i++) {
var current_catName = dom_categoryNames_arr[i];
for (var j = 0; j < data.length; j++) {
if (data[j].categoryName == current... | [
"function pushCategoryItemsToIDArr(data, unique_categoryNames, htmlContent_arr){\n for (var i = 0; i < unique_categoryNames.length; i++) {\n var current_catName = unique_categoryNames[i];\n for (var j = 0; j < data.length; j++) {\n if (data[j].categoryName == current_catName) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Modified 'createGrid' function to generate image order popups with a tooltip to show the long name of orders. | function createGridWithToolTip( menuPath,id, methodName, methodArgs,gridType ) {
if(!id)
id = menuPath;
var root = $(id);
var grid = $(id+'-grid');
if (root.getAttribute( 'gridOffset' )==null) {
root.setAttribute( 'gridOffset', grid.getAttribute( 'gridOffset'));
root.setAttribute( 'gridSortCol', grid.g... | [
"createGrids () {\n }",
"_createGrid() {\n this.gridOption = this.artifactoryGridFactory.getGridInstance(this.$scope)\n .setColumns(this._getColumns());\n //.setMultiSelect()\n //.setBatchActions(this._getBatchActions())\n if(this.features.isGlobalRepoEnabled()) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets the right audio file for the trial | function getAudioFile(elem) {
var audio_name = 'audio/mp3s/' + elem.noun + '_' + elem.adj + '_' + elem.vb + '.mp3';
return audio_name;
} | [
"function getAudio(){return _config2.default.audio}",
"function getAudio() {\n return _config2.default.audio;\n }",
"function randomSound() {\n var fileNames = ['audio1', 'audio2', 'audio3', 'audio4'];\n return(fileNames[getRandomInt(0, fileNames.length - 1)]);\n}",
"function getRandomAudio(){\n\t\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the animation rate in milliseconds. | get animationRate() {
return this._animationRate;
} | [
"get animationUpdateRate() {}",
"getPlaybackRate() {\n return this._client.send(\"Animation.getPlaybackRate\");\n }",
"get frameRate() {}",
"function getAnimationSpeed() {\n\t\t\tif (prefersReducedMotion) {\n\t\t\t\tanimationSpeed = 0\n\t\t\t} else {\n\t\t\t\tanimationSpeed = 500\n\t\t\t}\n\t\t}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get connection from Nats Streaming | function getNatsConnection() {
const { clientId, clusterId, uri } = config.eventbus
return new Promise((resolve, reject) => {
if (natsConnection) return resolve(natsConnection)
const stan = nats.connect(clusterId, clientId, { url: uri })
natsConnection = stan
stan.... | [
"get connection () {}",
"getconnection() {\n if ( os.platform() != \"win32\" ) {\n this.socket = net.createConnection(process.argv[1]);\n } else {\n let u = url.parse(\"tcp://\" + process.argv[1], false, false)\n this.socket = new net.Socket()\n this.socke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function just sets the orientation of the control in its scope by comparing the height and the width of it | function checkControlOrientation(scope){
scope.control.isVertical = scope.control.height > scope.control.width;
scope.control.isHorizontal = !scope.control.isVertical;
if (scope.view.turnView){
scope.control.isVertical = !scope.control.isVertical;
scope.control.isHorizon... | [
"setOrientation() {\r\n\t\tif (this.isUpright) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar x = this.width\r\n\t\tvar y = this.length\r\n\t\tvar\tz = this.height\r\n\t\tif (x == Math.min(x, y, z)) {\r\n\t\t\tthis.height = x;\r\n\t\t\tthis.length = Math.max(y, z);\r\n\t\t\tthis.width = Math.min(y, z);\r\n\t\t}\r\n\t\telse... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is used to populate the warning prompt with the desired message. There is an optional function that can be bound to the modal dismiss button click event. | function showWarningModalPrompt(message, action) {
var $modal = $('.js-warning-modal');
$('.js-warning-modal-text').html(message);
if (typeof action === 'function') {
$('.js-warning-button').on("click", action);
}
$modal.modal('show');
} | [
"function displayWarning(modal, title, message, yesButtonText, yesButtonHandler, noButtonText, noButtonHandler) {\r\n\tyesButtonText = yesButtonText || \"YES\";\r\n\tnoButtonText = noButtonText || \"NO\";\r\n\tnoButtonHandler = noButtonHandler || closeModal;\r\n\t$(modal + \" .modalHeader .modalHeaderCenter h2\").t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the specific handler associated with the context. | getSpecificHandler(ctx) {
return specificHandlers[ctx.id()] || null;
} | [
"handler(name) {\n return externals[name].getSpecificHandler(self);\n }",
"getRouteHandler (handler) {\n return `${handler.controllerName}.${handler.handlerName}`\n }",
"get handler() {\n return this._handler;\n }",
"getHandler(key) {\n return this._registry.get('handlers', key, n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Evaluate the success on all the grid return true if all the nonmined case are reavealed otherwise return false | function isSuccessGrid(){
var success = true;
var len = $scope.grid.length - 1;
var i = 1;
while(success && (i<len)){ // Go through the whole grid
var j = 1;
var leng = $scope.grid[i].length - 1;
while(success && (j<leng)){
var item = $scope.grid[i][j]
... | [
"function gridsSolved() {\n for (var i = 0; i < curCanvases.length; ++i) {\n if (curCanvases[i].solved === false) {\n return false;\n }\n }\n return true;\n }",
"function isSuccessFlag(){\n var success = ($scope.caseFlagged==$scope.minesCount); // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Makes the character wear an item, color can be undefined | function InventoryWear(C, AssetName, AssetGroup, ItemColor) {
for (var A = 0; A < Asset.length; A++)
if ((Asset[A].Name == AssetName) && (Asset[A].Group.Name == AssetGroup))
CharacterAppearanceSetItem(C, AssetGroup, Asset[A], ItemColor);
CharacterRefresh(C);
} | [
"setColor(newColor){\n this.phaserCharacter.setTint(newColor);\n }",
"function itemColor(i){\n\t//brown\n\tif(i == 'baseball bat' || i == 'fake sword' || i == 'house key')\n\t\treturn '#B48B14';\n\t//white\n\telse if(i == 'McD Sprite' || i == 'water' || i == 'phone')\n\t\treturn '#eeeeee';\n\t//yellow\n\telse... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the given authentication token in the app state | function setAuthenticationToken(authentication_token_to_set) {
authentication_token = authentication_token_to_set;
updateAppState('dxAuthenticationToken',authentication_token);
} | [
"authToken (state, token) {\n state.authToken = token\n }",
"setAuthenticationToken(token) {\n this._token = token;\n this._adaptor.setAuthenticationToken(token);\n }",
"function setStateToken()\n {\n App.Helpers.debugMessage(\"Setting state token\");\n \n // gen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calls initialization functions for lobby and game objects. | function init() {
lobby.init();
game.init();
} | [
"function init() {\n\t\t// join lobby to wait for other players.\n\t\tcloak.message('joinLobby');\n\t}",
"async init () {\n this.bridge = await this._getBridge()\n this.lamps = await this._getLamps()\n this.modules = await this._loadModules()\n }",
"function init() {\n game = new Game(currentSettin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use to remove the selected device property from the list. | function removeDeviceInfo() {
var deviceProperty, element;
element = document.querySelector("#deviceInfoList .selected td");
if (element !== null && element !== undefined) {
deviceProperty = element.getAttribute("value");
savedDeviceOptions.splice(savedDeviceOptions.indexOf(deviceProperty), ... | [
"function removeSelectedProperty(){\r if(UI[\"exportedProperties\"].selection != null) {\r cyclopsData.exportedProperties.splice(UI[\"exportedProperties\"].selection.index, 1);\r UI[\"exportedProperties\"].remove( UI[\"exportedProperties\"].selection );\r }\r}",
"removeProperty() {\n th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Asks permission to delete the user record. | function deleteUserPermission(user) {
$('#userIdDelete').val(user.user_id);
$('#nameDelete').text(user.first_name + ' ' + user.last_name);
$('#deleteModal').modal('show');
} | [
"function remove() {\n if ($window.confirm('Are you sure you want to delete?')) {\n vm.userPermission.$remove($state.go('user-permissions.list'));\n }\n }",
"function delete_user() {\r\n alertBox.hide();\r\n const username = Utils.getInput();\r\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set class for passed edge | function edgeClassDecider(edge) {
if (
errorPath !== undefined &&
errorPath.includes(edge.source) &&
errorPath.includes(edge.target)
) {
return "arg-edge error-edge";
}
return "arg-edge";
} | [
"function edgeClassDecider(edge) {\n\t\t\t\tif (errorPath !== undefined && errorPath.includes(edge.source) && errorPath.includes(edge.target)) {\n\t\t\t\t\treturn \"arg-edge error-edge\";\n\t\t\t\t} else {\n\t\t\t\t\treturn \"arg-edge\";\n\t\t\t\t}\n\t\t\t}",
"function highlightEdge(edge, on, cssclass) {\n\tif (e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines the previous region, sets it as active and updates the current focus | previousRegion() {
const regions = this.regions;
if (
!regions ||
!regions.length ||
this.modalIsOpen ||
this.popupIsOpen
) {
return;
}
let newRegion;
if (!this.activeRegion || (this.activeRegionIndex !== 0 && th... | [
"setPreviousRowActive() {\n this._setActiveCellByDelta(-1, 0);\n }",
"function focusCurrent() {\n noFill();\n stroke('red');\n strokeWeight(offset);\n rect(current.x * w + offset, current.y * w + offset, w, w);\n}",
"updateActiveRegion() {\n if (!this.activeRegion) {\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
un follow user from profile card | function ProfileCardUnFollow(){
PeopleService.UnFollow($rootScope.UserCard.id)
.then(
resolve => {
$rootScope.UserCard.fav = false ;
$rootScope.User.favs = resolve.data ;
}
);
} | [
"function unfollow() {\n dsactivity.unfollowUser(vm.user.id)\n .then((response) => {\n // The viewing user is now not following this profile's user\n vm.userIsFollowing = false;\n })\n .then(updateUserFollowStats)\n .catch((err) => {\n console.error(err);\n });\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wrapper that saves or updates an object, based on whether it already has an id. Data without an id attribute are created as new objects, and those with an id are updated. This function expects the angular model representation, and will handle the formatting of the request. | function save(data) {
if (data.id) {
return update(data.id, data).then(function (result) {
return data;
});
} else {
return create(data).then(function (result) {
data.id = result.id;
return data;
});
}
} | [
"save(params) {\n const { idField, preferUpdate } = this.constructor\n const id = getId(this, idField)\n if (id != null) {\n return preferUpdate ? this.update(params) : this.patch(params)\n } else {\n return this.create(params)\n }\n }",
"save(model, objToSave) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize a new `Topology`. | function Topology() {
this.name = name;
this.streams = [];
Topology.streams.forEach(function(_stream){
this.stream(_stream.name, _stream);
}, this);
this.emit('init', this);
} | [
"GetTopology() {}",
"constructor(topology_config) {\n this.config = JSON.parse(JSON.stringify(topology_config));\n }",
"_initialise() {\n if (!this.initialised) {\n this.initialised = true;\n this._createNodes()\n this._createEdges()\n } else {\n console.warn('RandomTSP is im... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
tab2Root = AboutPage; tab3Root = ContactPage; | function TabsPage() {
this.tab1Root = __WEBPACK_IMPORTED_MODULE_1__home_home__["a" /* HomePage */];
} | [
"function TabsPage() {\n this.tab1Root = __WEBPACK_IMPORTED_MODULE_1__home_home__[\"a\" /* HomePage */];\n this.tab2Root = __WEBPACK_IMPORTED_MODULE_2__login_login__[\"a\" /* LoginPage */];\n this.tab3Root = __WEBPACK_IMPORTED_MODULE_3__register_register__[\"a\" /* RegisterPage */];\n th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
trim() Trim the specified number of elements from the end of the collection. | trim() {
errors.throwNotImplemented("trimming elements from a collection");
} | [
"trim(numToTrim) {\n this._ensureUnpacked();\n if (numToTrim > 0) {\n this.unpackedArray = this.unpackedArray.slice(0,\n this.unpackedArray.length - numToTrim);\n }\n }",
"function trimToSize() {\n var temp = new Array(this.getSize());\n \n for (var i = 0; i < this.getSize(); i++) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: dwscripts.getParameterCodeFromType DESCRIPTION: Gets the runtime code and default value for the parameter type. ARGUMENTS: paramType string. one of elements returned from dwscripts.getParameterTypeArray. paramNameOrValue string. Value for the parameter. paramDefault string. Default value for the parameter. RE... | function dwscripts_getParameterCodeFromType(paramType,
paramNameOrValue,
paramDefault)
{
var retVal = null;
var serverObj = dwscripts.getServerImplObject();
if (serverObj != null && serverObj.getParameterCodeFromType != null)... | [
"function getParameterCodeFromType(paramType, paramNameOrValue, paramDefault)\n{\n var runtimeVal = dwscripts.sprintf(MM.MSG_UnknownParamType, paramType);\n var nameVal = \"\";\n var defaultVal = \"1\";\n\n switch(paramType)\n {\n case MM.LABEL_PHP_Param_Types[0]:\n runtimeVal = \"$_GET['\" + paramName... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
translate a x coordinate within the room to the view | translateXToView(x) {
const v = this.view;
return v.offsetX + (x - (this.referencePoint.x || 0)) * v.viewToSpaceRatio * v.zoomRatio;
} | [
"WorldToScreenX(x) {\n return Math.round((this.center.x + this.scale.px*x));\n }",
"set x(x) {\n this._dx = x - this.x;\n this._x = x;\n this.root.setAttribute('transform', 'translate( ' + this.x + ', ' + this.y + ')');\n }",
"function trans_x(x) {\n return (x + x_offset) * x_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Say you have a function primitiveMultiply that, in 50 percent of cases, multiplies two numbers, and in the other 50 percent, raises an exception of type MultiplicatorUnitFailure. Write a function that wraps this clunky function and just keeps trying until a call succeeds, after which it returns the result.Make sure you... | function MultiplicatorUnitFailure() {} | [
"function retry() {\n\n\tfunction primitiveMultiply(a,b){\n\t\tvar x = Math.random();\n\t\tif(x < 0.5) {\n\t\t\treturn a*b;\n\t\t}\n\t\telse{\n\t\t\tthrow new Error(\"MultiplicatorUnitFailure\");\n\t\t}\n\t}\n\n\tfunction reliableMultiply(a, b) {\n\t\tfor (;;) {\n\t\t\ttry {\n\t\t\t\treturn primitiveMultiply(a, b);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets box coordinates [ x, y, width, height ] | getBoxCoords(_id) {
const [x, y] = this.getPosition(_id);
const [w, h] = this.getSize(_id);
return [x, y, w, h];
} | [
"function boxPosition(x, y){\n x = parseInt(x);\n y = parseInt(y);\n var startPoint = [x, y];\n return startPoint;\n}",
"function getBox(o){return{xMin:o.position.x,xMax:o.position.x+o.width,yMin:o.position.y,yMax:o.position.y+o.height};}",
"getVisibleBoxCoords(_id, _noOwnScroll) {\n const [x, y] = this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function clears all the fields in the User form container. | function clearFormFields() {
$(".user-name").val("");
$(".user-email").val("");
} | [
"function clearFields() {\n loginForm.username.value = \"\";\n loginForm.password.value = \"\";\n\n signupForm.username.value = \"\";\n signupForm.password.value = \"\";\n signupForm.confirmPassword.value = \"\";\n}",
"function clearFields () {\n titleFormField.value = \"\"\n authorFormField.value = \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the month and year in state, then call _updateBudget: | async componentWillMount() {
this.setState({
month: dateMethods.getMonth(),
year: dateMethods.getYear()
});
this._updateBudget();
} | [
"async _updateBudget () {\n let response = await storageMethods.checkCurrentMonthBudget();\n\n if(response !== false) {\n this.setState({\n budget: response\n });\n return;\n }\n this._renderEnterBudgetComponent();\n }",
"function update(month,year) {\n curr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Installs a handler for change detection batching status changes for a specific fixture. | function installAutoChangeDetectionStatusHandler(fixture) {
if (!activeFixtures.size) {
handleAutoChangeDetectionStatus(({ isDisabled, onDetectChangesNow }) => {
disableAutoChangeDetection = isDisabled;
if (onDetectChangesNow) {
Promise.all(Array.from(activeFixtures).... | [
"function uninstallAutoChangeDetectionStatusHandler(fixture) {\n activeFixtures.delete(fixture);\n if (!activeFixtures.size) {\n stopHandlingAutoChangeDetectionStatus();\n }\n}",
"registerContactHandler(fixture, handler) {\n if (!this.contactListener) {\n console.warn('No contact liste... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
code TODO: recent_added_naatsCtrl | controller_by_user controller by user | function controller_by_user(){
try {
$ionicConfig.backButton.text("");
} catch(e){
console.log("%cerror: %cPage: `recent_added_naats` and field: `Custom Controller`","color:blue;font-size:18px","color:red;font-size:18px");
console.dir(e);
}
} | [
"function controller_by_user(){\n\t\ttry {\n\t\t\t\n$ionicConfig.backButton.text(\"\");\t\t\t\n\t\t} catch(e){\n\t\t\tconsole.log(\"%cerror: %cPage: `new_added_naats_singles` and field: `Custom Controller`\",\"color:blue;font-size:18px\",\"color:red;font-size:18px\");\n\t\t\tconsole.dir(e);\n\t\t}\n\t}",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
copy a key content | function copyKey(target, key) {
var i,
args = arguments;
for (i = 2; i < args.length; i++) {
if (key in args[i]) {
if (args[i].hasOwnProperty(key)) {
target[key] = args[i][key];
return;
}
}
}
} | [
"function copyKeysmash() {\n window.getSelection().selectAllChildren(keysmashElement);\n document.execCommand(\"copy\");\n}",
"function copyKey(target, key) {\n var i, args = arguments;\n for (i = 2; i < args.length; i++) {\n if (key in args[i]) {\n if (args[i].hasOwnProperty(key)) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new `AWS::WAFv2::WebACL`. | constructor(scope, id, props) {
super(scope, id, { type: CfnWebACL.CFN_RESOURCE_TYPE_NAME, properties: props });
try {
jsiiDeprecationWarnings.aws_cdk_lib_aws_wafv2_CfnWebACLProps(props);
}
catch (error) {
if (process.env.JSII_DEBUG !== "1" && error.name === "Depr... | [
"constructor(scope, id, props) {\n super(scope, id, { type: CfnWebACLAssociation.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_wafv2_CfnWebACLAssociationProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBU... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by LUFileParsernormalIntentBody. | exitNormalIntentBody(ctx) {
} | [
"exitNestedIntentBodyDefinition(ctx) {\n\t}",
"exitNestedIntentNameLine(ctx) {\n\t}",
"exitNestedIntentSection(ctx) {\n\t}",
"exitNestedExpressionAtom(ctx) {\n\t}",
"exitNestedIntentName(ctx) {\n\t}",
"exitParse(ctx) {\n\t}",
"exitNestedRowExpressionAtom(ctx) {\n\t}",
"exitRelationElement(ctx) {\n\t}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sort the tree according to the node names | function sortTree() {
tree.sort(function(a, b) {
// return b.name.toLowerCase() < a.name.toLowerCase() ? 1 : -1;
return b.id < a.id ? 1 : -1;
});
} | [
"function sortTree() {\n //tree.sort(function(a, b) {\n // return b.name.toLowerCase() < a.name.toLowerCase() ? 1 : -1;\n //});\n }",
"function sortTree() {\r\n self.tree.sort(function (a, b) {\r\n return b.name.toLowerCase() < a.name.to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reset food at a random position | function resetFood(){
//to ensure the food position is not on surrent snake/resetPos
function isFoodPosOK(x,y){
//not on snake0
for (var i = 0; i < snakes[0].body.length; i++){
if (x == snakes[0].body[i][0] && y == snakes[0].body[i][1])
return ... | [
"function resetFood() {\n\tfood = {\n\t\tx : calculateRandomX(), \n\t\ty : calculateRandomY() \n\t};\n}",
"function resetFood() {\n\tfood.div.remove();\n\tfood = undefined;\n\temptiness = Math.floor(Math.random() * EMPTY_MAX);\n}",
"function setFood() {\n\t\tvar empty = [];\n\t\t//Find all empty cells on the gr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate number of operations to convert string to nearpalindrome. | function solve(inputStr){
if(isNearPalindrome(inputStr) === false){
var s = inputStr.split("").sort();
var nOperations = 0;
var first = 0;
var last = s.length -1;
var incremented = 0;
while(first < last){
if(s[first] !== s[last]){
... | [
"function makePalendrome(str) {\n\t\n\tvar left;\n\tvar right;\n\tvar mid = Math.floor(str.length/2);\n\n\tvar numOps = 0;\n\n\tif (str.length % 2 == 0) {\n\t\tleft = mid-1;\n\t\tright = mid;\n\t}\n\telse {\n\t\tleft = mid-1;\n\t\tright = mid+1;\n\t}\n\n\twhile (left >= 0 && right < str.length) {\n\t\tnumOps+= Math... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds the message to removedMessages and deletes it from receivedMessages | function addRemovedMessage(messageId) {
removedMessages[messageId] = receivedMessages[messageId];
delete receivedMessages[messageId];
setRemovedMessages(removedMessages);
setReceivedMessages(receivedMessages);
} | [
"function removeMessages() {\n message_list.empty();\n }",
"removeMessage(message) {\n this.messages.splice(\n this.messages.findIndex(m => m.id === message.id), 1\n )\n }",
"onMessagesRemoved() {}",
"function removeMessage(message) {\n _.remove(messages, message);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SLSdisplay() return the values in Stack as a string | function SLSdisplay() {
return stack_arr;
} | [
"function display(stack) {\n let displayString = 'Top ->> ';\n let curr = stack.top;\n while (curr !== null) {\n displayString += curr.data + ', ';\n curr = curr.next;\n }\n return console.log(displayString);\n}",
"printStack() { \n var str = \"\"; \n for (var i = 0; i <... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ContactCallbacks() Call callback functions for individual and/or all contacts | function ContactCallbacks(t)
{
// Go through all contacts
for (var i in contacts)
{
// TODO: Check for individual callback function
if (0)
{
// TODO
}
// TODO: Check for global callback functions
else if (0)
{
// TODO
}
... | [
"function forEachContact(fn) {\n \n var contacts = ContactsApp.getContactGroup(config.group).getContacts();\n for (i = 0; i < contacts.length; i++) {\n if (fn) fn(contacts[i]);\n }\n}",
"FindContacts(contacts) {\n this.FindContacts_Reference(contacts);\n }",
"function co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function does an API call to delete posts /????? what goes in the () | function deletePost(id) {
// console.log(id)
$.ajax({
method: "DELETE",
url: "api/private/" + id
})
.then(function() {
getPosts() // show me posts after deleting
});
} | [
"static async deletePost(token, username, id) {\n let res = await this.request(`posts/${username}/${id}`, token, {}, 'delete');\n return { message: res.message };\n }",
"function deletePost(postId) {\n // TODO : Implement this\n}",
"function deletePost() {\n\tvar snippet = {\n\t\tquery : {\n\t\t\t// p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The suggestions drawer animates open & closing. Add additional logic to deal with this. | function openSuggestionDrawer() {
const _isSuggestionsDrawerOpen = () => {
const footer = pierceShadowsSingle(getFooterPath());
const isOpen = browser.elementIdAttribute(footer.value.ELEMENT, 'open');
return isOpen.value;
};
const suggestionsOpen = _isSuggestionsDrawerOpen();
if (!suggestionsOpen) ... | [
"function open() {\n if (!instance.isSuggesting) {\n elSuggest.style.display = displayed.length ? 'block' : 'none';\n updatePosition();\n if (displayed.length) {\n displayed[0].element.scrollIntoView();\n }\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resolve all deferreds that were cancelled previously, if any. This allows the user to bind callbacks to any render callback, even if it was cancelled above. | function resolveDeferreds() {
for (var i = 0; i < manager.deferreds.length; i++){
manager.deferreds[i].resolveWith(root, [root]);
}
manager.deferreds = [];
} | [
"function handleDeferreds() {\n if (connected()) {\n deferreds.filter(function (submit) {\n return submit();\n })\n }\n }",
"function finale(self) {\n if (self._deferreds === null) return\n if (self._deferreds && !isArray(self._deferreds)) {\n handle(self, self._deferreds)\n self._... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
analytics function to track when user clicks on "Add default Shipping" | onClickAddDefaultShippingLogGA(breadCrumb, productName) {
const { gtmDataLayer } = this.props;
const removeAcademyLabel = {
removeAcademyLabel: true
};
gtmDataLayer.push({
event: 'pdpDetailClick',
eventCategory: 'pdp interactions',
eventAction: 'pdp|add a default payment option',... | [
"function attachEventOnShippingBar(className) { \n $jq321(\"#ccannouncement-main\").on(\"click\", function () { \n let freeShippingBarClick = {\n id: impressionsID,\n freeShippingBarClick : 1\n }\n postImpressions(freeShippingBarClick, \"sp_free_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Have the function VowelSquare(strArr) take the strArr parameter being passed which will be a 2D matrix of some arbitrary size filled with letters from the alphabet, and determine if a 2x2 square composed entirely of vowels exists in the matrix. For example: strArr is ["abcd", "eikr", "oufj"] then this matrix looks like... | function VowelSquare(strArr) {
strArr = strArr.map((val) => {
return val.toLowerCase().replace(/[aeiou]/g, '!');
});
for (let i = 0; i < strArr.length - 1; i++) {
for (let j = 0; j < strArr[i].length - 1; j++) {
if (checkPoint(strArr, [i, j])) {
return `${i}-${j}`;
... | [
"function VowelSquare(strArr) { \n var vowels = 'aeiou'.split('');\n \n for (var i = 0; i < strArr.length - 1; i++){\n for (var j = 0; j < strArr[i].length - 1; j++){\n var char = strArr[i][j];\n \n if(vowels.indexOf(char) > -1){\n if(vowels.indexOf(st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Captures the tag name from the start of the tag to the current character index, and converts it to lower case | function captureTagName() {
var startIdx = currentTag.idx + (currentTag.isClosing ? 2 : 1);
return html.slice(startIdx, charIdx).toLowerCase();
} | [
"function captureTagName() {\n var startIdx = currentTag.idx + (currentTag.isClosing ? 2 : 1);\n return html.slice(startIdx, charIdx).toLowerCase();\n }",
"function captureTagName() {\n var startIdx = currentTag.idx + (currentTag.isClosing ? 2 : 1);\n return html.sli... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setup a newly created declaration reflection. | function setupDeclaration(context/*: Context*/, reflection/*: DeclarationReflection*/, node/*: ts.Node*/) {
const modifiers = 0;
reflection.setFlag(ReflectionFlag.External, context.isExternal);
// reflection.setFlag(ReflectionFlag.Protected, !!(modifiers & ts.ModifierFlags.Protected));
reflection.setF... | [
"onDeclaration(context, reflection, node) {\n if (!reflection.comment)\n return;\n // Look for @internal or @external\n let comment = reflection.comment;\n if (this.internals.some((tag) => comment.hasTag(tag))) {\n set... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
overlap time in ms | function timeOverlap(first, second) {
const firstRange = moment.range(first.start, first.end)
const secondRange = moment.range(second.start, second.end)
if (!firstRange.overlaps(secondRange)) return 0
return firstRange.intersect(secondRange).valueOf()
} | [
"timeOverlap(timeA, timeB){\n\n let minInHour = 60;\n let maxHour = 24;\n\n let timeAStart = timeA.start.hour * minInHour + timeA.start.min;\n let timeAEnd = timeA.end.hour * minInHour + timeA.end.min;\n\n // Going from night to morning\n if(timeAStart > timeAEnd) timeAEnd ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Description: Based on the provided coordinates, finds the closest weather station, and returns the ID. Arguments: lat latitude of the point to search lon longitude of the point to serach | function weatherFindClosestStation(lat, lon, callback)
{
var xmlstring = stringUrlWU+lat+','+lon;
$.ajax({
type: 'POST',
url: './PHP/WeatherFunctions.php',
data: { func: 'GetWeatherStations', xml: xmlstring },
dataType:'json',
/*
async: false,
cache: false,
timeout: 500... | [
"function weatherGetClosestStationCoord(callback)\r\n{\r\n // If the closest station was not identified, just quit\r\n if(closestStationIndex == undefined || closestStationIndex > stationList.length)\r\n return;\r\n\r\n weatherGetStationCoordinates(stationList[closestStationIndex].id, function(stationcoord) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function gets called whenever mapExtentChanged event fired to set wether panel only view or panel with all the keys should be visible This method also sets up default symbols to show on map This method will only be called if page subscribed to one of the event published by ESRIUKTDPAPI mapExtentChagned event handl... | function setMapSymbolLayers(/*client id of the container of panel key and panel only control*/ctrl, /*client id of map*/mapid, /*map argument passed by mapExtentChanged event*/mapArgs) {
var map = findMap(mapid);
var panelOnlyViewElm = document.getElementById(ctrl + panelViews[0]);
var panelKeysBo... | [
"function MinimizeMap() {\n ShowOwnerIdDiv(true);\n ShowModeDiv(true);\n ShowPathInfoDiv(true);\n SetMapPanelTop();\n }",
"function setSearchExtent (){\n if (dom.byId('chkExtent').checked === 1) {\n geocoder.activeGeocoder.searchExtent = map.extent;\n } else... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Repopulate bike list when filters are pressed | function filterListener(){
$("#colorFilter").change(function(){
populateBikeList();
});
$("#statusFilter").change(function(){
populateBikeList();
});
} | [
"function buttonFilter () {\n let filters = [\n //{\"flavor\": selectHtmlElementById('validationDefault03').value},\n {\"flavor\": selectHtmlElementById('validationDefault04').value},\n // \"price\": selectHtmlElementByClass('price').value,\n ];\n \n let filtersObj = constructFilterObj(fi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update all participants of a competition. An update action must be supplied, to be executed for every participant. This is to prevent calling jobs from within the service. I'd rather call them from the controller. Note: this is a soft update, meaning it will only create a new snapshot. It won't import from CML or deter... | async function updateAllParticipants(id, updateAction) {
if (!id) {
throw new BadRequestError('Invalid competition id.');
}
const competition = await Competition.findOne({ where: { id } });
if (!competition) {
throw new BadRequestError(`Competition of id ${id} was not found.`);
}
const participan... | [
"async function updateAllParticipants(id, updateAction) {\n if (!id) {\n throw new BadRequestError('Invalid competition id.');\n }\n\n const competition = await Competition.findOne({ where: { id } });\n\n if (!competition) {\n throw new BadRequestError(`Competition of id ${id} was not found.`);\n }\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Requests a friend. The friend to be requested is selected via a textbox in the "Friends List" menu. There are numerous checks to prevent the user from requesting him/herself, a user that is already in their friends list, a user that has already sent them a request or a user that doesn't exist. If all checks are passed,... | function requestFriend() {
let friend = document.getElementsByName("friend").item(0).value.trim();
let allowed = true;
if (friend == data.user.user) {
alert("Can't add yourself to your friends list.");
allowed = false;
}
const right = document.getElementById("right");
const section = right.querySele... | [
"function requestFriend() {\n FYSCloud.API.queryDatabase(\n \"INSERT INTO `friendrequest` (`requestingUser`, `targetUser`) VALUES (?, ?);\", [currentUserId, profileId]\n ).done(function (data) {\n }).fail(function () {\n });\n}",
"function sendFriendRequest() {\n var profileId = sock... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Global variable for selected skill Function formSubmitHandler: called when user clicks "Search" button on form | function formSubmitHandler(event) {
event.preventDefault();
var selectedValue = document.getElementById("optionSelectBox").value; // Get the selected value number 0-5 from the option that was selected
var selectedText = document.getElementById(`${selectedValue}`); // Get reference to html ID associated wi... | [
"function skillSubmit() {\n var myVal = $('.gcconnex-endorsements-input-skill').typeahead('val');\n addNewSkill(myVal);\n}",
"function onSearch(evt){\n //tell browser not to do default behavior\n evt.preventDefault();\n //get whatever is typed into the search input\n var searchQuery=txtSearch.va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A player leaves a lobby. Return true if successful, otherwise false. | leaveLobby(playerId, reason) {
let playerIndex = this.lobbyPlayers.findIndex(player => player.pid == playerId);
// Player is in lobby; remove them
if (playerIndex > -1) {
this.lobbyPlayers.splice(playerIndex, 1);
// console.log("Successfully removed player from lobby, at index " + playerIndex);
// If t... | [
"async leaveLobby() {\n try {\n const requestBody = JSON.stringify({\n playerToken: localStorage.getItem('token')\n });\n\n await api.put('/games/'+this.props.match.params.id+'/lobbies/players', requestBody);\n\n localStorage.removeItem('LobbyGuard')... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a robot that starts from Post Office, going through all destinations. memory is list of remaining next stops to go. | function routeRobot(state, memory){
if (memory.length == 0){
memory = routeRobot.mailRoute; // if all stops reached,
// start all over again.
}
return [memory[0], memory.slice(1)];
} | [
"function routeRobot(state, memory) { //state is the VillageState, memory is the mailRoute.\n if (memory.length == 0) {\n memory = mailRoute;\n }\n return {direction: memory[0], memory: memory.slice(1)};//when the robot goes to one node on the mail route, it drops off/forgets the node by using slice m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compile a drop primary key command. | dropPrimary(pkConstraintName) {
this.pushQuery(
`alter table ${this.tableName()} drop constraint ${pkConstraintName}`
);
} | [
"dropPrimary() {\n this.pushQuery(`alter table ${this.tableName()} drop primary key`);\n }",
"dropPrimaryKey(tableName, oldName, options) {\n var LF, escapeId, indent, words;\n options = _.defaults({}, options, this.options);\n ({words, escapeId, indent, LF} = this);\n return words.alter_t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles the response selecting an offer for edit. | function handleLoadEditOfferResponse(mime, data) {
// alert(mime + "::" + data);
if (mime == "text/url") {
window.location = data;
} else if (mime == "text/error") {
alert(data);
} else if (mime == "application/json") {
var offer = eval("(" + data + ")");
// Set the values we have:
document.getElementById... | [
"function loadSelectedOfferEdit() {\n\n\tofferToUpdate = getURLParameter(\"aid\");\n\t// alert(offerToUpdate);\n\tconnect(\"/hiwi/Provider/js/getOffer\", \"aid=\" + offerToUpdate,\n\t\t\thandleLoadEditOfferResponse);\n}",
"function handleEdit() {\n console.log('clicked edit');\n editID = $(this).data(\"id\");\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the Lime.Application object | function getApplication() {
return eval(m_strGetLimeExpression);
} | [
"get Application() {\n // use lazy initialization because the FUEL object is only available for\n // Firefox and won't work on XUL Runner builds.\n\n if (null == this._application) {\n try {\n // Firefox\n this._application =\n Cc[\"@mozilla.org/fuel/application;1\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
map sidebarOpen property from redux store to props | function mapStateToProps(state) {
return {
sidebarOpen: state.sidebarOpen
}
} | [
"onSetOpen(open) {\n store.dispatch(toggleSidebar(open));\n }",
"sidebarPosition(state, payload) {\n if (payload.mode === 'left') {\n state.settings.sidebarLeft = true\n } else if (payload.mode === 'right') {\n state.settings.sidebarLeft = false\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function simulates the work of a remote service. Because each service differs, you will need to modify this function appropriately to work with the service you are using. This function takes a batch of argument sets and returns a [promise of] batch of values. NOTE: When implementing this function on a server, also... | function _fetchFromRemoteService(requestBatch) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
// Simulate a slow network request to the server;
return [4
/*yield*/
, pause(1000)];
... | [
"function _fetchFromRemoteService(requestBatch) {\r\n // Simulate a slow network request to the server;\r\n return pause(7000).then(function(){\r\n return requestBatch.map(function(request) {\r\n // const { operation, args } = request;\r\n try {\r\n if (request.oper... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the PKCS1 RSA decryption of "ctext". "ctext" is an evenlength hex string and the output is a plain string. | function RSADecrypt(ctext) {
var c = parseBigInt(ctext, 16);
var m = this._doPrivate(c);
if (m == null) return null;
return pkcs1unpad2(m, (this.n.bitLength() + 7) >> 3);
} | [
"function RSADecrypt(ctext) {\n var c = parseBigInt(ctext, 16);\n var m = this.doPrivate(c);\n if (m == null) return null;\n return pkcs1unpad2(m, this.n.bitLength() + 7 >> 3);\n }",
"function RSADecrypt(ctext) {\n var c = parseBigInt(ctext, 16);\n var m = this.doPrivate(c);\n if(m == ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Although directives and controller can watch this service for udpates to state values an update to data in currentState does not trigger a rerendering of the page with a new $digest loop. So after some of the changes to the data are applied we will call maybeApply() to trigger a new $digestion and update the app's disp... | function maybeApply() {
if($rootScope.$root.$$phase != '$apply' && $rootScope.$root.$$phase != '$digest'){
$rootScope.$apply();
}
} | [
"function maybeApply() {\n\t\t\t\tif($rootScope.$root.$$phase != '$apply' && $rootScope.$root.$$phase != '$digest'){\n\t\t\t\t\t\t$rootScope.$apply();\n\t\t\t\t}\n\t\t\t}",
"function updateView() {\n if (!$scope.$$phase) $scope.$apply();\n }",
"function updateChangesState() {\n var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the value for the spring, or set to `undefined` to disable the spring | function _updateSpring() {
var springValue = this._scroll.scrollForceCount ? undefined : this._scroll.springPosition;
if (this._scroll.springValue !== springValue) {
this._scroll.springValue = springValue;
if (springValue === undefined) {
if (this._scroll.spr... | [
"setValue(value) {\n this.value = value;\n }",
"public setValue(val : boolean) : void {\n this.omit = val;\n }",
"setValue(value){\n nnLogger.log(`Neuron: setting value: ${value}`);\n this.value = value;\n }",
"setValue(value) { return this._setValue(value, false); }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert from seer to mon | function seerToMon(seer) {
// error validation for negative number
if(seer<0)
{
return 'please input a valid number';
}
// error validation for numbers that will produce float result
if(seer%40 != 0)
{
return 'please input number which is vidisible by 40';
}
// ... | [
"function seerToMon(seer){\n if(seer < 1 ||typeof seer == 'string' ||typeof seer == 'boolean'){\n return 'Incorrect input';\n }\n else{\n const mon = seer / 40;\n return mon;\n}\n}",
"function seerToMon(seer) {\n seer = Math.abs(seer); // negative value validation\n const mon = seer / 40;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Elimina tutte le prenotazioni del dato account (viene richiamato soltanto in caso di eliminazione dell'account) | function elimina_all_prenotazioni(){
prenotazioni=JSON.parse(localStorage.getItem("prenotazioni") || "[]");
user=JSON.parse(sessionStorage.user);
document.write(prenotazioni.length+"<br>")
for(var i=0;i<prenotazioni.length;i++){
document.write(i+"<br>");
utente_prenotazione=JSON.parse(prenotaz... | [
"function removeItemsPreliminar(k_codusuario,cod_inspeccion) {\n db.transaction(function (tx) {\n var query = \"DELETE FROM ascensor_valores_preliminar WHERE k_codusuario = ? AND k_codinspeccion = ?\";\n tx.executeSql(query, [k_codusuario,cod_inspeccion], function (tx, res) {\n console.log(\"rowsAffecte... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AJAX ACTIONS AND OTHER FUNCTIONS Function to update the name of the list using Ajax. We then take appropriate action based upon the response. | function _updateListNameWithAjax(url, list) {
let formData = new FormData();
formData.append("Id", list.id);
formData.append("ListName", list.name);
fetch(url, {
method: "post",
body: formData
})
.then(response => {
if (!response.o... | [
"function submitListNameChange(){\n //Grab the form data values and assign them as properties of listData const\n const listData = {\n title: $(\"#changeOfList\").val(),\n _id: $(\"#list-id\").val(),\n cardColor: $(\".editColorSquare.selected\").css(\"background-color\")\n };\n //send the changes as an... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates function check bag Checks if bag is within weight limit | checkBag(){
if(this.weight > 500 ){
throw new Error("Suspicious")
}
} | [
"maintainsBalance(pick) {\n let counts = Object.keys(this.game.classes).reduce(function(acc, val) {\n for (const weap of this.game.classes[val].weapons) {\n acc[weap] = 0;\n }\n return acc;\n }.bind(this), {});\n\n for (const char of this.picks.characters) {\n for (const weap of ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |