query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Adjusts all tasks end times after the task at the index.
adjustAllEndTimes(index) { while(index >= 0) { this.adjustTaskEndTime(index); index--; } }
[ "adjustAllStartTimes(index) {\n while(index < this._taskArr.length) {\n this.adjustTaskStartTime(index);\n index++;\n }\n }", "removeAtIndex(index, adjustEndTimes = false) {\n if(index === 0) {\n this.removeFront();\n } else if (index === this._taskA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an XML request to populateLevels.php Sends XML request, apply callback.
function getLevels(callback) { xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", "populateLevels.php?q=" , true); xmlhttp.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { // defensive check if (typeof callback === "function") { ...
[ "function XML_(){\n let url = `https://${domain}/API/Account/${rad_id}/${APIendpoint}.json?offset=${pagenr}`;\n if (relation.length > 0) {\n url += `&load_relations=[${relation}]`;\n }\n if (query.length > 0) {\n url += query;\n }\n console.log(url);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get car by selling Date
getCarbySellingDate(sellingDate){ return api.get(CarsConfigurations.GET_CAR_BY_SELLING_DATE_URL , {sellingDate}) }
[ "function searchSkyscannerByDate(departureDate, returnDate, originCity, destinationCity) {\n let outboundDate = departureDate;\n let inboundDate = returnDate;\n\n return getSessionKey(originCity, destinationCity, outboundDate, inboundDate)\n .then( (sessionKey) => {\n console.log(\"sessionKey:\", session...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the plural category for a given value. "=value" when the case exists, the plural category otherwise
function getPluralCategory(value, cases, ngLocalization, locale) { var key = "=" + value; if (cases.indexOf(key) > -1) { return key; } key = ngLocalization.getPluralCategory(value, locale); if (cases.indexOf(key) > -1) { return key; } if (cases.indexOf('other') > -1) { ...
[ "function getCategory(type){\n if (type == 'jeans' || type == 'pants' || type == 'leggings') return 'pants';\n if (type == 'longsleeve' || type == 'tshirt' || type == 'sweatshirt' || type == 'sweater' || type == 'dress') return 'shirts';\n if (type == 'tennisShoes' || type == 'heels') return 'shoes'; \n if (typ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
alerts the name that user inputted and deletes last char if its "s"
function hello(){ var clientName = document.getElementById("first-name").value; if (clientName.substr(clientName.length - 1) == "s"){ clientName = clientName.substr(0, clientName.length -1); alert("Čau, " + clientName + "!" + " spied OK lai turpinātu!"); } else { alert("Čau, " + client...
[ "function validateName()\n{\n\t//variable name is set by element id contactName from the form\n\tvar name = document.getElementById(\"contactName\").value; \n\t\n\t//validation for name\n\tif(name.length == 0)\n\t{\n\t\tproducePrompt(\"Name is Required\", \"namePrompt\", \"red\"); \n\t\treturn false; \n\t}\n\tif(!n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to create a single fragrance html code snippet
function createSingleFragranceHtml(id, name, desc, price, sale, img, stock) { var fragranceHtml = '<div id="p' + id + '" class="fragrance">' + '<img src="img/fragrances/' + img + '" />' + '<div class="fragrance-id">SKU:' + id + '</div>' + '<div class="fragrance-name">' + '<b>' + name + '</b>...
[ "function correctAnswerHtml() {\n console.log(\"Generating Correct Answer Response\");\n return `\n <br>\n <div class=\"correct-answer\">\n <img src=\"images/correct-answer.jpg\">\n <h2>Great Job! That is correct!</h2>\n </div>\n `\n }", "function T1_ImgRight_TxtLeft () {\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a sorting list from ConfigService
function createSortList(){ var sortOptions = [{label:'default sort', type:'default', order:'', active: true}]; _.forEach(ConfigService.config.sort_fields, function(value){ sortOptions.push({label: value, type: 'text', order: 'asc', active: false}); sortOptions.push({label: value, type: 'text...
[ "function sortingTestCases() {\n return [\n {\n //the below are for UI calls\n message: 'Sort by Text field in ascending order',\n ColumnName: ['Text Field'],\n SortOrderItem: ['Sort A to Z'],\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Case of P1 patient
function patientFlowP1(patient){ var state = patient.state var hasArrived = (Math.abs(patient.target.row-patient.location.row) +Math.abs(patient.target.col-patient.location.col))==0; switch(state){ case INEMERGENCY: if (hasArrived){ if (patient.timeDelay){ // if leaving if ((patient.timeDela...
[ "function Patient(firstName, lastName, ID, PMR, DOB, Sex){\n\t\t\t this.firstName = firstName;\n\t\t\t this.lastName = lastName;\n\t\t\t this.ID = ID;\n\t\t\t this.diagnosis = [];\n\t\t\t this.isReviewed = false;\n\t\t\t this.PMR\t\t\t = PMR;\n\t\t\t ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
given a grid array, returns its corresponding answer array
function getAnswersArray(Array){ switch(Array){ case grid1: return grid1ans; break; case grid2: return grid2ans; break; case grid3: return grid3ans; break; case grid4: return grid4ans; bre...
[ "function getMatchArray(grid){\n let length = grid.length;\n\n\n \n // for horizontal and vertical match cases\n let horArr = [];\n let verArr = [];\n for(let i=0; i<length; i++){\n let horTemp = [];\n let verTemp = [];\n for(let j=0; j<length; j++){\n horTemp.push(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the intersection between a ranged group and a range. Returns `[]` if the intersection is empty.
function groupIntersect(range, groups) { var result = []; for (var _i = 0, groups_1 = groups; _i < groups_1.length; _i++) { var r = groups_1[_i]; if (range.start >= r.range.end) { continue; } if (range.end < r.range.start) { break; } var in...
[ "function arr_Range(arr, v0, v1) {\n\treturn arr_RangeIndex(arr.indexOf(v0), arr.indexOf(v1))\n}", "getBetweenRangesPos(center, minRange, maxRange) {\n let res = [];\n for(let x = center.x - maxRange; x <= center.x + maxRange; x++) {\n let remainingDistance = maxRange - Math.abs(x-center.x);\n for...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
renderStockInfo uses the bootstrap 4 'card' functionality to render the stocks information
function renderStockInfo(data) { var stockDiv = $("<div>").addClass("card-body"). attr("id","stock-info"), cardh5 = $("<h5>").addClass("card-title"), cardBody = $("<p>").addClass("card-text ticker-paragraph"), addToWatchBtn = buildWatchBtn(data["1. symbol"]), ...
[ "function renderStockInfo(data) {\n var stockDiv = $(\"<div>\").addClass(\"card-body\").\n attr(\"id\",\"stock-info\"),\n cardh5 = $(\"<h5>\").addClass(\"card-title\"),\n cardBody = $(\"<p>\").addClass(\"card-text ticker-paragraph\"),\n addToWatchBtn = buildWatch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
HEATMAP FUNCTIONS Generates a heatmap from a list of coordinates using Leaflet.heat
function generateHeatmap() { crimeHeat = L.heatLayer(crimePoints, { radius: 10, blur: 15, maxZoom: 10, gradient: { 0.6: '#2b83ba', 0.7: '#abdda4', 0.8: '#ffffbf', 0.9: '#fdae61', 1.0: '#d7191c' } }).addTo(mymap...
[ "function HeatmapView(html_id) {\n var DEFAULT_ID = 'energy2d-heatmap-view',\n $heatmap_canvas,\n canvas_ctx,\n rgb_array,\n max_rgb_idx,\n heatmap,\n grid_width,\n grid_height,\n min_temp = 0,\n max_temp = 50,\n //\n // Private methods.\n //\n initHTMLelement =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Will attempt to identify for a volunteer named |name|. Returns a Promise that will be rejected when identification fails. The returned Promise will never resolve a successful identification will result in the page being reloaded.
identify(name) { const endpoint = '/anime/identify.php'; return new Promise((resolve, reject) => { const request = new XMLHttpRequest(); request.addEventListener('load', () => { try { const response = JSON.parse(request.responseText); ...
[ "function validateClaimName (name) {\n\tvar deferred = new Promise(function(resolve, reject) {\n\t\t// validate the characters in the 'name' field\n\t\tif (name.length < 1) {\n\t\t\treject(new NameError(\"You must enter a name for your claim\"));\n\t\t\treturn;\n\t\t}\n\t\tvar invalidCharacters = /[^A-Za-z0-9,-]/g....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
. END utility /patchIfNeededFn/ BEGIN utility /patchFilesFn
function patchFilesFn () { var patch_matrix = pkgMatrix.xhiPatchMatrix || {}, patch_dir_str = patch_matrix.patch_dir_str || '', patch_map_list = patch_matrix.patch_map_list|| [], patch_map_count = patch_map_list.length, promise_list = [], idx, patch_map, promise_obj...
[ "function applyPatches(uniDiff, options) {\n\t if (typeof uniDiff === 'string') {\n\t uniDiff = (0, _parse.parsePatch) (uniDiff);\n\t }\n\t\n\t var currentIndex = 0;\n\t function processIndex() {\n\t var index = uniDiff[currentIndex++];\n\t if (!index) {\n\t return options.complete();\n\t }\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add an extra applicationdefined key to the toplevel data structure By default packs JSON by extracting binary data and replacing it with JSON pointers
addApplicationData(key, data, packOptions = {}) { const jsonData = packOptions.nopack ? data : packBinaryJson(data, this, null, packOptions); this.json[key] = jsonData; return this; }
[ "addExtraData(key, data, packOptions = {}) {\n const packedJson = packOptions.nopack ? data : packBinaryJson(data, this, null, packOptions);\n this.json.extras = this.json.extras || {};\n this.json.extras[key] = packedJson;\n return this;\n }", "addExtension(extensionName, data, packOptions = {}) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: dwscripts.getBalancedSelection DESCRIPTION: Balances the selection, by expanding the selected range until only entire tags are selected. However, if balanceInward is true, then the selection range is reduced, until entire tags are selected. This function also fixes several special case selection problems. Thi...
function dwscripts_getBalancedSelection(dom, balanceInward) { var retVal = null; dom = (dom == null) ? dw.getDocumentDOM() : dom; if (balanceInward) { dwscripts.adjustCursorForEmptyTableCell(dom); } var allText = dom.documentElement.outerHTML; dom.expandSelectionToIncludeActiveContentScript(); va...
[ "function dwscripts_fixUpSelection(dom, bLeaveHeadSelection, bCollapseParagraphs)\n{\n\ttry{\n\t\tvar retVal = null;\n\t\t\n\t\tdom = (dom == null) ? dw.getDocumentDOM() : dom;\n\t\t\n\t\tvar offsets = null;\n\t\t\n\t\tif (!bLeaveHeadSelection && !dwscripts.selectionIsInBody(dom))\n\t\t{\n\t\toffsets = dwscripts.se...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to unlock the door
function unlock() { red.off(); servo.min(); green.on(); knocks = 0; locked = false; console.log( 'The door is unlocked' ); }
[ "function unlockfile() {\n \t\n }", "closeHingedDoor() {\n var hingedDoorSlot = this.getHingedDoorSlot(this.hingedDoor);\n if (this.doesSlotHaveOpenDrawers(hingedDoorSlot)) {\n let aux = function (context, closeFunction) { return function () { closeFunction(context); } }\n this.waitingDoors....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
tests for over or under extraction and informs user
function extractionTest(){ //clear out preexisting results if run again document.getElementById("extractionStmt").innerHTML = ""; document.getElementById("congrats").innerHTML = ""; //tests if extraction is NaN and prevents calc if so if(isNaN(extraction)){ document.getElementById("extr...
[ "importingDone() { if (this.isSearchUI()) MySearchUI.importingDone(); }", "function control_infos(infos)\n {\n //For this purpose use regular expressions\n var exp_string = new RegExp(/[a-z]/i);\n var exp_datum = new RegExp(/\\d{2}\\/\\d{2}\\/\\d{4}/i);\n if (!ex...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the appropriate square size values by finding all common factors between the width and the height
function getSizes() { //if height is greater than width, count to height if (height > width) { for (let i = 0; i <= height; i++) { if (height % i === 0 && width % i === 0) { sizeArray.push(i); } } } //if width is greater than height, count to width if (height < width) { for (...
[ "function calculateSquareSize() {\n var containerWidth = parseInt(containerEl.css('width'), 10);\n\n // defensive, prevent infinite loop\n if (!containerWidth || containerWidth <= 0) {\n return 0;\n }\n\n var boardWidth = containerWidth;\n\n while (boardWidth % 8 !== 0 && boardW...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function creates jasonobject (array) from all checked checkboxes in category country
function getCountry(){ var country = new Array(); $("input:checkbox[name=country]:checked").each(function() { country.push($(this).val()); }); var searchCountry = JSON.stringify(country); return searchCountry; }
[ "function getCheckedCategories() {\n let availableategories = document.getElementsByClassName('filter-checkbox');\n let checkedCategories = [];\n for (let j = 0; j < availableategories.length; ++j) {\n if (availableategories[j].checked == true) {\n checkedCategories.push(availableategorie...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Measure the viewport size.
_measureViewportSize() { const viewportEl = this.elementRef.nativeElement; this._viewportSize = this.orientation === 'horizontal' ? viewportEl.clientWidth : viewportEl.clientHeight; }
[ "updateViewport() {\n const { width, height } = this.renderer.getSize();\n const rw = width / this.frameWidth;\n const rh = height / this.frameHeight;\n const ratio = Math.max(rw, rh);\n const rtw = this.frameWidth * ratio;\n const rth = this.frameHeight * ratio;\n\n let x = 0;\n let y = 0;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Callback function to show user the date note modal
function showDayNoteModal(event) { $prev_day_clicked = $(".fc-day-clicked"); // Check if a date has been clicked if ($prev_day_clicked.length) { $dayNoteModal = $("#noteModal"); $dayNoteModal.css("margin-top", Math.max(0, ($(window).height() - $dayNoteModal.height()) / 2)); $dayNoteModal....
[ "function updateModalDate() {\n\tvar date = document.getElementById('date');\n\tdate.value = todaysDate(activeDate);\n}", "function onClickCalendarDate(e)\n{\n//JBARDIN\n var button = this;\n var date = button.getAttribute(\"title\");\n var dat = new Date(date.substr(6,4), date.substr(3,2)-1, date.substr(0, 2)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a full handset
function create_hand_set(main_arg) { // The default is the texas holdem config var hole_cards = []; var pick_min = 0; var pick_max = 2; var common_cards = []; var hand_set_object = null; if(_.isObject(main_arg)) { hole_cards = main_arg....
[ "function createHand(world, replica, side) {\n const hand = new THREE.Group();\n\n const palm = new THREE.Mesh(world.primitiveGeo.box, replica.material);\n palm.scale.set(0.08, 0.02, 0.16);\n palm.rotation.set(0.3, 0, side * -1);\n palm.position.set(side * 0.02, 0, 0.05);\n hand.add(palm);\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
start at the beginning of the original string. The return value should be arranged in order from shortest to longest substring. Examples: substringsAtStart('abc') // ['a', 'ab', 'abc'] substringsAtStart('a') // ['a'] substringsAtStart('xyzzy') // ['x', 'xy', 'xyz', 'xyzz', 'xyzzy'] Write a method that returns a list of...
function substringsAtStart(string) { var result = []; for (var i = 0; i < string.length; i++) { result.push(string.substr(0, i+1)); } return result; }
[ "function trim_left_1(s, sub) /* (s : string, sub : string) -> string */ { tailcall: while(1)\n{\n if (empty_ques__1(sub)) {\n return s;\n }\n else {\n var _x34 = starts_with(s, sub);\n if (_x34 != null) {\n {\n // tail call\n var _x35 = (string_3(_x34.value));\n s = _x35;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Orders mentions chronologically: by speech and position within speech.
function orderMentions(a, b) { return a.section.speech.id - b.section.speech.id || a.i - b.i; }
[ "order(words){cov_25grm4ggn6.f[7]++;cov_25grm4ggn6.s[40]++;if(!words){cov_25grm4ggn6.b[15][0]++;cov_25grm4ggn6.s[41]++;return[];}else{cov_25grm4ggn6.b[15][1]++;}//ensure we have a list of individual words, not phrases, no punctuation, etc.\nlet list=(cov_25grm4ggn6.s[42]++,words.toString().match(/\\w+/g));cov_25grm...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
31bit min / Parses a Natural number (i.e., nonnegative integer) with either the DIGIT ( nondigit OCTET ) or DIGIT grammar (RFC6265 S5.1.1). The "trailingOK" boolean controls if the grammar accepts a "( nondigit OCTET )" trailer.
function parseDigits(token, minDigits, maxDigits, trailingOK) { var count = 0; while (count < token.length) { var c = token.charCodeAt(count); // "non-digit = %x00-2F / %x3A-FF" if (c <= 0x2F || c >= 0x3A) { break; } count++; } // constrain to a minimum and maximum number of digits. ...
[ "function parseDigits(token, minDigits, maxDigits, trailingOK) {\n\t var count = 0;\n\t while (count < token.length) {\n\t var c = token.charCodeAt(count);\n\t // \"non-digit = %x00-2F / %x3A-FF\"\n\t if (c <= 0x2F || c >= 0x3A) {\n\t break;\n\t }\n\t count++;\n\t }\n\t\n\t // constrain to a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The Invoke method is called as a result of an application request to run the Smart Contract 'fabcar'. The calling application program has also specified the particular smart contract function to be called, with arguments
async Invoke(stub) { let ret = stub.getFunctionAndParameters(); console.info(ret); let method = this[ret.fcn]; if (!method) { console.error('no function of name:' + ret.fcn + ' found'); throw new Error('Received unknown function ' + ret.fcn + ' invocation'); } try { let payloa...
[ "function invokeFunction (ctx, functionInvokeURL, body, callback) {\n const url = new URL(functionInvokeURL)\n var options = {\n host: url.hostname,\n method: 'POST',\n path: url.pathname,\n headers: {\n 'opc-compartment-id': ctx.compartmentId,\n 'Content-Type': 'application/text'\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Indicates if this side is an owner of this relation.
get isOwning() { return !!(this.isManyToOne || (this.isManyToMany && this.joinTable) || (this.isOneToOne && this.joinColumn)); }
[ "get isOneToOneOwner() {\n return this.isOneToOne && this.isOwning;\n }", "get isOneToOneNotOwner() {\n return this.isOneToOne && !this.isOwning;\n }", "isOwner(user) {\n return this.json_.owner._account_id === user._account_id;\n }", "get hasInverseSide() {\n return this.invers...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
testing if inbrowser Find functionality will work on hyphenated text
function test_hyphens_find(delimiter) { try { /* create a dummy input for resetting selection location, and a div container * these have to be appended to document.body, otherwise some browsers can give false negative * div container gets the doubled testword, separated by the de...
[ "function cari(){\n\tvar isi = \"saya beajar di rumah teman\";\n\tconsole.log(isi.search(\"beajar\"));\n\tconsole.log(isi.search(/beajar/));\n}", "writeFindText(text) {\n clipboard.writeFindText(text);\n }", "function searchSpecific() {\n var editor = getEditor();\n var query = getSelectedText(editor)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recursively consume gameStates buffer.
consumeStateBuffer(gameStates) { console.log(new Date() + ' consume'); // Out of states. End of game. if (gameStates.length == 0) { return; } // Get current state. const gameState = gameStates.shift(); // Move elf. this.elf = gameState.elf; ...
[ "function GameState (state) {\n // Storage class that is passed to all players at end of turn\n this.Players = [] ;//Ordered array of players in game\n this.Name = \"\" ;// Game name\n this.id = \"\";\n this.Started = false\n this.GameOwner = 0; //Index into players array of player that owns game\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transform the Trails.js "stores" config into a JSData "adapters" object
transformAdapters (app) { const stores = app.config.database.stores const adapters = _.map(stores, 'adapter') return _.keyBy(adapters, 'identity') }
[ "transformStores (app) {\n const stores = app.config.database.stores\n const jsdata = {}\n Object.keys(stores).forEach(key => {\n const connection = lib.Adapters.loadConnection(stores[key])\n let store = new JSData.DS({\n cacheResponse: stores[key].cacheResponse || false,\n bypassCa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CSS task using PostCSS
function css() { var postcssPlugins = [ // import CSS files using @import plugin.easyImport(), // PostCSS plugin converts modern CSS to polyfills // based on browser support in .browserslistrc plugin.cssPresentEnv({ stage: 1 }), // re-order declartions based on property plugin.cssDeclarat...
[ "function autoprefixStyle(content, filename) {\n return postcss([autoprefixer])\n .process(content, {\n from: filename,\n to: filename,\n })\n .then((output) => ({\n code: output.css,\n map: output.map,\n dependencies: [filename.replace(\".svelte\", \".scss\")],\n }));\n}", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check Valid Event(find id, allowedApplyTime)
async validApplyEvent(id) { return await this.findOne({_id: id, allowedApplyTime: {$gt: new Date()}}) .then(events => events) .catch(err => console.error("Interest getAll Catch", err)); }
[ "function checkEvent(element) {\n if (new Date(element.attr('seminar-date')) >= currentDate) {\n upcomingSeminar = true;\n } else {\n previousSeminar = true;\n }\n }", "function event_create_check(eventCreateForm)\n{\n\t/*++++++++++ first of all check uid ++++++++++*/...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a new content to the activity and the respective elements to edit it
function editorNewContent(content, container, activity) { editorDirty = true; activity.contents.push(content); addContentElement(content, container, activity); }
[ "function addActivity() {\n\t$.mobile.changePage('index.html#addactivity', {\n\t\t\ttransition : \"none\",\n\t\t\treverse : false\n\t\t}, true, true);\n\t$('#activities-contentwrapper').css('bottom', '38px');\n}", "function addContentElement(content, container, activity) {\n let content_div = $($(\"#template-c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
execute an openssl command
async _opensslCommand (args, progress) { let errorMessage = ''; let command = 'openssl ' + args.join(' '); let exitCode = await this.spawnProcess('/bin/bash', ['-c', command], progress, (err) => { errorMessage += err; }); if (exitCode) { throw new Error(errorMessage); } }
[ "function ssh_cmd(cmd, callback) {\n var Client = require('ssh2').Client;\n var conn = new Client();\n console.log(cmd);\n conn.on('ready', function() {\n conn.exec(cmd, function(err, stream) {\n if (err) throw err;\n stream.on('close', function(code, signal) {\n //console.log('Stream :: clo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Intelligently divides one duration by another
function divideDurationByDuration(dur1, dur2) { var months1, months2; if (durationHasTime(dur1) || durationHasTime(dur2)) { return dur1 / dur2; } months1 = dur1.asMonths(); months2 = dur2.asMonths(); if ( Math.abs(months1) >= 1 && isInt(months1) && Math.abs(months2) >= 1 && isInt(months2) ) { return mon...
[ "static calculateDuration (duration) {\n let seconds = duration * 15\n let days = Math.floor(seconds / (3600 * 24))\n seconds -= days * 3600 * 24\n let hrs = Math.floor(seconds / 3600)\n seconds -= hrs * 3600\n let mnts = Math.floor(seconds / 60)\n seconds -= mnts * 60\n const response = day...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Common stuff to get a paging toolbar for a data store
function getPagingBar(dataStore) { var pagingBar = new Ext.PagingToolbar({ pageSize: 50, store: dataStore, displayInfo: true, displayMsg: '{0} - {1} of {2}', emptyMsg: "No data" }); pagingBar.paramNames = { start: 'offset', limit: 'len' }; retu...
[ "buildPaginationInfo() {\n var table = this.table;\n var data = table.pagination,\n reg = this.getReg(),\n page = data.page,\n totalPageCount = data.totalPageCount,\n resultsPerPage = data.resultsPerPage,\n firstObjectNumber = data.firstObjectNumber,\n lastObjectNumbe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update Timestamp for futher queries
updateTimestamp(rawTimestamp) { // Set New Timestamp const timestamp = parseInt(rawTimestamp); if (timestamp > this.timestamp) { this.timestamp = timestamp; } }
[ "static async updateLoginTimestamp(username) {\n await db.query(\n `UPDATE users\n SET last_login_at = current_timestamp\n WHERE username = $1`,\n [username]);\n }", "getUpdateTimestamp() {\n if (this.updated_ === null) {\n this.updated_ = new Date(this.json_.updated);\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
given a grid and a row index: remove the row from the grid, shifting down
function removeRow (grid, i) { //console.log("REMOVING ROW: ", i); // remove the row at index i grid.splice(i,1); // create new empty row let newRow = newEmptyRow(); // insert new row into grid at the top grid.splice(grid.length - 1, 0, newRow); //console.log("NEW GRID: ", ...
[ "_removeCell(index) {\n const layout = this.layout;\n const widget = layout.widgets[index];\n widget.parent = null;\n this.onCellRemoved(index, widget);\n widget.dispose();\n }", "function refreshGridAfterDelete(row)\n { \n row.remove();\n }", "function d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates transition delays for individual menu items, so that they fade in one at a time.
applyTransitionDelays_() { var _MDCSimpleMenuFoundat2 = MDCSimpleMenuFoundation.cssClasses; const BOTTOM_LEFT = _MDCSimpleMenuFoundat2.BOTTOM_LEFT, BOTTOM_RIGHT = _MDCSimpleMenuFoundat2.BOTTOM_RIGHT; const numItems = this.adapter_.getNumberOfItems(); const height = this.dimensions_.height; ...
[ "function aboutScreenAnimations() {\n for (var icon=0; icon < icons.length; icon++) {\n icons[icon].classList.add('animate__fadeInLeft');\n }\n\n for (var item=0; item < navItems.length; item++) {\n navItems[item].classList.add('animate__fadeInDown');\n }\n\n setTimeout(function() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cache nontrivial values to variables to prevent repeated lookups. Closure, which accesses and modifies 'list'.
function cacheList() { if (list.match(/^\w+$/)) { return ''; } var listVar = Blockly.Portugol.variableDB_.getDistinctName( 'tmpList', Blockly.VARIABLE_CATEGORY_NAME); var code = 'var ' + listVar + ' = ' + list + ';\n'; list = listVar; return code; }
[ "function evalList(scope, list, valueConverters) {\n var length = list.length,\n cacheLength, i;\n\n for (cacheLength = evalListCache.length; cacheLength <= length; ++cacheLength) {\n evalListCache.push([]);\n }\n\n var result = evalListCache[length];\n\n for (i = 0; i < length; ++i) {\n result[i] =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: doCreateNewRecord Retrieve the marc record template, process its marcxml to create marceditor, then display the marceditor so the user may edit the template. Parameters: None. Returns: None.
function doCreateNewRecord() { Ext.Ajax.request({ url: filename, method: 'GET', callback: function(options, isSuccess, resp) { var xml = resp.responseText; srchResults = (new DOMParser()).parseFromString(xml, "text/xml"); var currRecord = srchResults.getElementsByTagName('record')[0]; ...
[ "function createCustomRecord(\n currentLineItem,\n internalid,\n shortCode,\n longCode,\n fieldNotes,\n lineId\n ) {\n var custRecord = record.create({\n type: \"customrecord_zoku_prodcode_custrec\",\n });\n custRecord.setValue({\n fieldId: \"custrecord_zoku_item\",\n valu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
member function hitRWall(xpos) applies a collision between the enemy and a wall to the right params: xpos:Number the xposition of the right wall
hitRWall(xpos){ if(Math.abs(this.vel.x) > 2) sfx_enemybump.play(); this.pos.x = xpos - this.getCol().size.x / 2; this.vel.x = -this.bounceFriction * Math.abs(this.vel.x); if(!this.seeking) this.mov = Math.PI; }
[ "hitRWall(xpos){\n\t\tthis.pos.x = xpos - this.getCol().size.x / 2;\n\t\tthis.vel.x = 0;\n\t}", "hitLWall(xpos){\n\t\tthis.pos.x = xpos + this.getCol().size.x / 2;\n\t\tthis.vel.x = 0;\n\t}", "hitLWall(xpos){\n\t\tif(Math.abs(this.vel.x) > 2)\n\t\t\tsfx_enemybump.play();\n\t\tthis.pos.x = xpos + this.getCol().s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Turn a buffer into a Tigerpadded array of 64bit words
function _getMessage(buffer /*: Buffer*/) /*: Array<BigInt>*/ { const words = []; let word = 0n; let byteLen = 0n; for (const c of buffer) { const b = byteLen++ & 0x7n; word |= BigInt(c) << (b << 3n); if (byteLen % 8n == 0n) { words.push(word); word = 0n; } } // Store original si...
[ "function hs_wordToWord64(low) {\n return [0, low];\n}", "static fromBuffer(buffer: Buffer): u64 {\n assert(buffer.length === 8, `Invalid buffer length: ${buffer.length}`);\n return new BN(\n [...buffer]\n .reverse()\n .map(i => `00${i.toString(16)}`.slice(-2))\n .join(''),\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if a path is an ancestor of another.
isAncestor(path, another) { return path.length < another.length && Path.compare(path, another) === 0; }
[ "isParent(path, another) {\n return path.length + 1 === another.length && Path.compare(path, another) === 0;\n }", "isDescendant(path, another) {\n return path.length > another.length && Path.compare(path, another) === 0;\n }", "function is_ancestor(node, target)\r\n{\r\n while (target.parent...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a Promise which sends the QUIT command to the server. We can abort the operating after a certain number of milliseconds by passing the optional `timeout` parameter.
quit(timeout = 0) { const lines = []; const handler = (line) => lines.push(line); const command = `QUIT\r\n`; return super.write(command, handler, timeout).then((code) => { if (code.charAt(0) === '2') { return code; } else { ...
[ "helo(hostname = null, timeout = 0) {\r\n if (!hostname) {\r\n hostname = this._getHostname();\r\n }\r\n const lines = [];\r\n const handler = (line) => lines.push(line);\r\n const command = `HELO ${hostname}\\r\\n`;\r\n return super.write(command, handler, timeo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
change volume bar position regarding video volume level
function volumeChangeBar() { let voloffsets = volumefg.getBoundingClientRect(); let volwidth = voloffsets.right-voloffsets.left; volumefg.style.clip = 'rect(0, '+((video.volume*volwidth)/16)+'rem, '+(volwidth/16)+'rem, 0)'; }
[ "function adjustVolume(deltaVolume){\r\n setVol(globalVolume + deltaVolume);\r\n}", "function adjustVolume(){\n volumeController.volume = \"0.5\";\n volumeController.adjustVolume();\n}", "function updateVolume() {\n if (video.muted) {\n video.muted = false;\n }\n\n video...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
'stamp' an authentication object from `getAuth()` with a [nonce]( and timestamp
function timenonce(o) { o.oauth_timestamp = ohauth.timestamp(); o.oauth_nonce = ohauth.nonce(); return o; }
[ "localLogin(authResult) {\n this.idToken = authResult.idToken;\n this.profile = authResult.idTokenPayload;\n\n // convert the JWT expiry time from seconds to milliseconds\n this.tokenExpiry = new Date(this.profile.exp * 1000);\n\n // save the access token\n this.accessToken = authResult.accessToke...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a subtest for test_get_an_account, and runs the second time the account provisioner window is opened.
function subtest_get_an_account_part_2(w) { // An account should have been added. Assert.equal(nAccounts(), gNumAccounts + 1); // We want this provider to be our default search engine. wait_for_element_invisible(w, "window"); wait_for_element_visible(w, "successful_account"); // Make sure the search engin...
[ "function test_get_an_account(aCloseAndRestore) {\n let originalEngine = Services.search.defaultEngine;\n // Open the provisioner - once opened, let subtest_get_an_account run.\n plan_for_modal_dialog(\"AccountCreation\", subtest_get_an_account);\n open_provisioner_window();\n wait_for_modal_dialog(\"AccountCr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Name: displayPhrase Called by: delegateMethod Parameters: id Phrase ID, from phrase of class "phrase" Returns: Nothing. (Prints to screen.) Explanation: Given a phrase id (which only come from phrases of class "phrase"), this function looks up the id in the phrases hash. Presuming that the phrase is present in the hash...
function displayPhrase(id) { if (id != null) { var phrase = phrases[id]; if (phrase != null) document.getElementById("translation-box").innerHTML = "<b>" + phrase[0] + "</b> " + phrase[1]; } }
[ "function OneWordHelper_highlightPhrase(mainID) {\n for(var i = 0; i < this.locs.length; i++)\n for(var j = 0; j < this.phraseLength; j++)\n utl.id( 'w-'+(this.locs[i]+j) ).className = 'hl-phrase'\n this.showBar(this.locs, mainID)\n} // _highlightPhrase function", "phrase(phrase) {\n for (let m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
verifica string de array e retorna o index indexOf()
function find_index(arr, str) { return arr.indexOf(str); }
[ "function searchArray(input, array){\n //creates new RegExp\n //g = flag to make search global, i means ignore case\n let regex = new RegExp(input, 'gi');\n //filters by matching strings\n \n //match can only be used on strings\n let result = array.filter(current => current.matc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new log file
function createNewLogFile() { var basePath = (global.TYPE.int === global.TYPE_LIST.CLIENT.int ? "./" : path.join(__dirname, "..")); //Get base path if (fs.existsSync(path.join(basePath, "Timbreuse.10.log"))) //If log 10 exists, delete fs.unlinkSync(path.join(basePath, "Timbreuse.10.log")); for (var i = 9; i >...
[ "function createNewLogFileForToday(context) {\n //note: when enter here, date, dd means previous day, not today.\n var minDate = new Date(date);\n minDate.setDate(dd - 1 - context.backupDays);\n var minSuffix = makeSuffix(minDate);\n\n var dir = path.dirname(context.filePath);\n var ext = path.extname(context...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Vertical Click and Drag Scrolling Catatan : Dopake di page portfolios agar tetap bisa scroll saat drag Sumber : ON when the sreen size is less than 768px (Mobile & Tablet)
function triggerClickScroll(x) { if (x.matches) { // If media query matches // Only for Check // document.body.style.backgroundColor = "yellow"; // The Script function enableCliskScroll() { var curDown = false, curYPos = 0, curXPos = 0; $(window).m...
[ "function scrollViews(){\r\n var scroll = 2;\r\n $('#main_area, .ui_city_overview').bind('mousewheel', function(e){\r\n if($('.island_view').hasClass('checked')){\r\n scroll = 2;\r\n } else if($('.strategic_map').hasClass('checked')){\r\n scroll = 1;\r\n } else {\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Internal class that helps "asynchronous WebGL query objects" manage pending requests (e.g. for EXT_disjoint_timer_query and WebGL2 queries) Creates and manages promises for the queries. Tracks pending queries enabling polling. Tracks pending queries enabling invalidation. Encapsulates some standard error messages. Rema...
function QueryManager() { _classCallCheck(this, QueryManager); this.pendingQueries = new Set(); this.invalidQueryType = null; this.invalidErrorMessage = ''; this.checkInvalid = function () { return false; }; }
[ "async query(queryString, variables, operationName) {\n // The query we're going to send to the server.\n let query = {\n query: queryString,\n operationName: operationName,\n variables: variables\n };\n\n // Parameters for sending the query. This holds t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test whether a statement node is the string literal `"use strict"`.
function isUseStrict(stmt) { return options.ecmaVersion >= 5 && stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && stmt.expression.value === "use strict"; }
[ "function validLiteral(node) {\n if (node && node.type === 'Literal' && typeof node.value === 'string') {\n return true;\n }\n return false;\n}", "function isStatement(tree) {\n\tif (tree.type === \"FunctionDeclaration\") {\n\t\treturn !!tree.identifier;\n\t}\n\tvar stats = [\n\t\t\"LocalStatement...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks the first two lines of the Image, trying to find the store name Then calls the apppropriate function for that store
function processImageByStoreName(image) { var line1 = image._arrayOfLines[0]._arrayOfBlocks; var line2 = image._arrayOfLines[1]._arrayOfBlocks; var allBlocks = line1.concat(line2); var closestMatch = ""; var closestDistance = 9999999; for (var i = 0; i < allBlocks.length; i++) { for (var k = 0; k < allowed_st...
[ "function productNameFromImagePath(imagePath) {\n\t// This is the full filename, ex:\n\t// \"Box1_$10.png\"\n\tvar imageFileName = imagePath.match(/[\\w\\$]+\\.\\w+/)[0];\n\n\t// This is the filename without the extension, ex:\n\t// \"Box1_$10\"\n\timageFileName = imageFileName.split('.')[0];\n\n\t// This is the pr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
submit the game results to and checks if the player name is entered if not displays a error message
function submetTheGameResults() { setDisplayVisible("nameSubmet"); if (element("userName").value !== "") { app.userName = element("userName").value; sendTheNumberOfGuessesToDataBase(); } else { setTheElementInnerTextWithNewColor("checked-number-worning","Error Enter your Name ...!!!","#df2920"); } ...
[ "function validatePlayerName() {\n const name = getGameForm()['player-name'].value;\n if (!name.trim()) {\n getById('play-button').style.visibility = 'hidden';\n } else {\n playerName = name;\n getById('play-button').style.visibility = 'visible';\n }\n}", "function newgameOK(respo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
draw actor differently depending on its type
drawActor(context, actor){ switch(actor.type){ case 'Player': this.drawPlayer(context, actor); this.drawTurret(context); break; case 'Enemy': case 'Gunner': this.drawEnemy(context, actor); break; case 'Shielder': if(actor.shield > 0){ context.fillStyle = 'rgba(135, 186, 237,...
[ "drawFacing(context, actor){\n\t\tcontext.fillStyle = 'rgba('+(255-actor.cd)+',0,0,1)';\n\t\tcontext.beginPath(); \n\t\tcontext.arc(actor.fx + actor.x, actor.fy + actor.y, actor.r / 3, 0, 2 * Math.PI, false); \n\t\tcontext.fill(); \n\t}", "function applyDraw(actor)\n{\n\tactor.draw = function()\n\t{\n\t\tctx.dra...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Take the task keys currently in the `queue`, convert it into a list of unique tasks, resolve their execution order and execute them. This is how the task resolution goes: find all the tasks that generate .js artefacts and execute them in parallel before anything else (if any) then execute all tasks that generate other ...
function executeTasks() { var tasks = _.flow(_.map, _.flatten, _.uniq)(queue, toTask), jsTasks = _.intersection(tasks, jsArtefactTasks), nonJsTasks = _.difference(tasks, jsArtefactTasks, [browserSync.reload]), reload = _.first(_.intersection(tasks, [browserSync.reload])), finish = _.first(...
[ "function processQueue()\n{\n if(queue.length == 0) {\n \n //Bring in next queue and execute.\n queue = nextQueue;\n nextQueue = [];\n nextTurn();\n return;\n }\n\n console.log(\"Processing Queue\");\n var cmd = queue.splice(0, 1).toString();\n\n console.log(\"Command = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add file Menu Events
function addNorthfileMenuEvents() { jQuery('#mnu_dash') .attr('view', 'vcdb') .buttonset(); //pcdb button jQuery('#but_pcdb') .click(function() { if (jQuery('#mnu_dash').attr('view') === 'pcdb') { ...
[ "function menuEvents () {\n\n\t\tvar chooseLibrary = document.getElementById('choose-library');\n\t\tvar viewArtists = document.getElementById('view-artists');\n\t\tvar viewAlbums = document.getElementById('view-albums');\n\t\tvar viewSongs = document.getElementById('view-songs');\n\n\t\tchooseLibrary.addEventListe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper to get a typed SimpleDbStore for the primary client object store.
function primaryClientStore(txn) { return txn.store(DbPrimaryClient.store); }
[ "getPrimaryEntity() {\n let primaryEntity;\n if (this.appId) {\n primaryEntity = new App(this.appId);\n } else if (this.templateId) {\n primaryEntity = new Template(this.templateId);\n } else if (this.versionId) {\n primaryEntity = new Version(this.versio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to get random money
function getRandomMoney(){ var num = Math.random(); if (num < 0.6) { money = 10000; prestige = 10; } else if (num < 0.9) { money = 100000; prestige = 30; } else if (num < 0.99) { money = 1000000; prestige = 50; } else { money = 10000000; prestige = 70;...
[ "generateCalBurnt()\r\n {\r\n var calories = Math.floor((Math.random() * 20) + 1)\r\n console.log(calories)\r\n }", "function randomNumberGenerator(){\r\nreturn Math.floor(Mayh.random()*1000);\r\n\r\n}", "static cauchyRand() {\n return Math.tan(Math.PI * (Math.random() - 0.5));\n }", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a function sumArgs (), which will summarize all its arguments:
function sumArgs() { return [].reduce.call(arguments, function(a, b) { return a + b; }); }
[ "function add33(a,b){\n console.log(arguments);\n return a+b;\n}", "function sumEvenArguments(){\n\treturn [].slice.call(arguments).filter(i=>{\n\t\treturn (!(i%2));\n\t}).reduce((acc,next)=>{\n\t\treturn acc+next;\n\t});\n}", "function foo () {\n return fargs(arguments);\n }", "function args_count(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hamburger nav clicked toggle navcollapse
function collapseHamburger() { $('.nav-right-hamburger').toggleClass('on'); $('.nav-right-collapse').toggleClass('on'); }
[ "function collapse(e) {\n e.preventDefault();\n\n //Grabs the navbar element\n var x = document.getElementById(\"myTopnav\");\n\n //if navbar is\n if (x.className === \"topnav\") {\n x.className += \" responsive\";\n } else {\n x.className = \"topnav\";\n }\n}", "toggleMenu() {\n\n /* conditio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
JS port of ADL ADLSeqUtilities.java FAKE: only the functions used in rollup procedure
function ADLSeqUtilities() { this.satisfied = new Object(); this.measure = new Object(); this.status = new Object(); this.score_raw = new Object(); this.score_min = new Object(); this.score_max = new Object(); this.completion_status = new Object(); this.progress_measure = new Object(); }
[ "function Seq(/* exp1, exp2, ... */) {\n precondition_arg_list(arguments);\n return new OEN_Seq(arguments);\n}", "mergeSequences () {\n let lastListElement;\n this.sequence.forEach((e, i) => {\n if (lastListElement && e.locationID === lastListElement.locationID && e.firstStart > lastLis...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
choose what to visit (initial, long version)
function chooseVisitLong() { (places = ["Church", "Tavern", "Market", "City Gates"]), (index = rls.keyInSelect( places, "You walk to the town to see what it has to offer. \n The local tavern has artisanal beer and rooms to rest. \n Nearby marketplace has a variety of shops to browse, e.g. an armory s...
[ "findVersions() {\n this.state.versionData.forEach(yearData => {\n if(yearData.year === this.state.selectedYear) {\n yearData.terms.forEach(termData => {\n if(termData.term === this.state.selectedTerm.toLowerCase()) {\n this.setState({ versi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this program is a JavaScript version of Mersenne Twister, with concealment and encapsulation in class, an almost straight conversion from the original program, mt19937ar.c, translated by y. okada on July 17, 2006. and modified a little at july 20, 2006, but there are not any substantial differences. in this program, pr...
function MersenneTwister19937() { /* constants should be scoped inside the class */ var N, M, MATRIX_A, UPPER_MASK, LOWER_MASK; /* Period parameters */ //c//#define N 624 //c//#define M 397 //c//#define MATRIX_A 0x9908b0dfUL /* constant vector a */ //c//#define UPPER_MASK 0x80000000UL /* most significant w-r b...
[ "randomUint32(){\n this.nextState() ;\n return this.temper() ;\n }", "function main () {\n //here's all the magic\n //alright here comes the 1 part:\n function rand(length,current){\n current = current ? current : '';\n return length ? rand( --length , \"0123456789ABCDEFGHIJKLMNOPQ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
IMGUI_API void PushTextWrapPos(float wrap_pos_x = 0.0f); // wordwrapping for Text() commands. 0.0f: wrap at 'wrap_pos_x' position in window local space
function PushTextWrapPos(wrap_pos_x = 0.0) { bind.PushTextWrapPos(wrap_pos_x); }
[ "function wrapText(game, text, x, y, maxWidth, lineHeight) {\n var cars = text.split(\"\\n\");\n game.ctx.font = \"bold 80pt Helvetica\";\n game.ctx.textAlign = 'center';\n game.ctx.fillStyle = 'black';\n\n for (var ii = 0; ii < cars.length; ii++) {\n\n var line = \"\";\n var words = cars[ii].split(\" \"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ScanParentsForApi Searches all the parents of a given window until it finds an object named "API". If an object of that name is found, a reference to it is returned. Otherwise, this function returns null.
function ScanParentsForApi(win) { /* Establish an outrageously high maximum number of parent windows that we are will to search as a safe guard against an infinite loop. This is probably not strictly necessary, but different browsers can do funny things with undefined objects. */ ...
[ "function getApiWindow()\n{\n // popup launch:\n // SCORM API related to current window(player.html)\n if( window.opener && window.opener.API )\n return window.opener;\n // SCORM API related to lesson frame\n else if( parent.opener && parent.opener.API )\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resolves a given hyperlink with a certain router state (basePath not included). Preserves absolute urls.
function resolveHref(currentPath,href,resolveAs){// we use a dummy base url for relative urls const base=new URL(currentPath,'http://n');const urlAsString=typeof href==='string'?href:(0,_utils.formatWithValidation)(href);// Return because it cannot be routed by the Next.js router if(!isLocalURL(urlAsString)){return res...
[ "function resolveUrl(link) {\n\tif (link === undefined) {\n\t\treturn;\n\t}\n\t//Check if the link is external or specified with nohash and do redirect to requested page (leaving mobile site)\n\tif (link.hostname !== mobile.domain || $(link).attr('nohash') === 'true') {\n\t\twindow.location = link.href;\n\t}\n\tels...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create instance method for hashing a password
@Method hashPassword(password) { if (this.salt && password) { return crypto.pbkdf2Sync(password, new Buffer(this.salt, 'base64'), 10000, 64, 'SHA1').toString('base64'); } else { return password; } }
[ "function createWithHash(context) {\n if (context.data.hash) {\n // user provided password hash\n context.data.password = context.data.hash;\n delete context.data.hash;\n return Promise.resolve(context);\n }\n else {\n // hash the provided password\n return Local.hooks.hashPas...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verify, modify and save tracker package
function processTracker() { var success = true; console.log("\n2. Validating exported metadata"); //Configure sharing and metadata ownership configureSharing(); configureOwnership(); //Remove users from user groups clearUserGroups(); //Make sure the "default defaults" are used setDefaultUid(); //Make...
[ "function savePackageToDB(archiveFilePath, req, res, cb) {\n \n var curPackage = new YPackage();\n\n //where it's stored on the drive\n curPackage.path = archiveFilePath;\n //set the uploading date\n curPackage.creationDate = new Date();\n //set the expiration date\n\tvar now = new Date();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new `Searchbox` component. Creates a new `Coveo.Magicbox` instance and wraps magic box methods (`onblur`, `onsubmit`, etc.). Binds event on `buildingQuery` and on redirection (for standalone box).
function Searchbox(element, options, bindings) { var _this = _super.call(this, element, Searchbox.ID, bindings) || this; _this.element = element; _this.options = options; _this.options = ComponentOptions_1.ComponentOptions.initComponentOptions(element, Searchbox, options); if (_t...
[ "function createSearchElement() {\n appendSearchElementToDOM();\n addDynamicSearchFunctionality();\n}", "function createSearch() {\n const graveSearch = new L.Control.Search({\n layer: occupiedGravePoints,\n propertyName: \"Name\",\n collapsed: false,\n textPlaceholder: \"Search by name...\",\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
given a big int return a big int that is in the range of a valid private key makes sure that the big int is not greater than the max valid private key The priviate key is a 32 byte number in the range of 0 to N where N is defined by the secp256k1 ECDSA standard See
function bigInt2bigIntKey(i){ return i.mod(getSECCurveByName("secp256k1").getN()); }
[ "validPrivateKey(privateKey){}", "function bigInt2ECKey(i){ return new Bitcoin.ECKey(bigInt2bigIntKey(i)); }", "function validateKey(key){\r\n if(key < 0){\r\n key = key *= -1;\r\n }\r\n\r\n return Math.round(key);\r\n}", "function privateKeyFromSubseed(subSeed, securityLevel) {\r\n var...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does. During a batch `onBecomeUnobserved` will be called at most once per observable. Avoids unnecessary recalculations.
function startBatch() { globalState.inBatch++; }
[ "function Batch() {\n this.seq = 0;\n this.state = 'start';\n this.changes = [];\n this.docs = [];\n}", "function Batcher({\n setNotifyBatcherOfChange\n}) {\n const storeRef = useStoreRef();\n const [, setState] = useState([]); // $FlowFixMe[incompatible-call]\n\n setNotifyBatcherOfChange(() => setState({...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
========================================================================= / / sigsuspend()
function sigsuspend ( sigset_mask ) { /// Contract the facts of the case. var sigset_tmp; sigprocmask(SIG_SETMASK, sigset_mask, &(sigset_tmp)); pause(); sigprocmask(SIG_SETMASK, &(sigset_tmp), NULL); return -1; }
[ "unsuspend(stop_reason=false){\n if (this.status_code == \"suspended\"){\n if(stop_reason){\n this.stop_for_reason(\"interruped\", stop_reason)\n this.set_up_next_do(0)\n }\n else {\n this.set_status_code(\"running\")\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle a press on the Expand All button. Expands each entry. Args: e (Event): The event which triggered the action.
_onExpandAllClicked(e) { e.preventDefault(); e.stopPropagation(); this._entryViews.forEach(entryView => entryView.expand()); }
[ "function _toggleExpanded(e) {\n $(\"#categories\").toggleClass(\"expanded\")\n\n if ($(\"#categories\").hasClass(\"expanded\")) {\n $(e.target).text(\"Collapse All\")\n $(\".checkbox\").removeClass(\"hide\")\n } else {\n $(e.target).text(\"Expand All\")\n $(\".checkbox\").not(\".depth0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get polygon points for packed cells knowing cell id
function getPackPolygon(i) { return pack.cells.v[i].map(v => pack.vertices.p[v]); }
[ "function getPositions(polygon) {\n return 'positions' in polygon ? polygon.positions : polygon;\n}", "function getGeometries(geometries, col_arcs_){\n\tvar polygons = [];\n\tgeometries.forEach(function(d){\n\t\tif(d.type==='Polygon'){\n\t\t\tvar a = readPolygon2({arcs:d.arcs}); \n\t\t\tpolygons.push({type:'Poly...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
API call function for creating JWT for APIs Access
function createJWTForAPIsAccess(phoneNo, apiKey){ return fetch(("https://app.aibers.health/createJWTForAPIsAccess"), { method: "POST", headers: {Accept: 'application/json','Content-Type': 'application/json'}, body: JSON.stringify({ pno: phoneNo, apiKey: apiKey }) }).then(response =>...
[ "createJWT () {\n const token = {\n iat: parseInt(Date.now() / 1000),\n exp: parseInt(Date.now() / 1000) + 20 * 60, // 20 minutes\n aud: this.mqtt.project\n }\n return jwt.sign(token, fs.readFileSync(this.device.key.file), { algorithm: this.device.key.algorithm })\n }", "function createTo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
verify access token for every auth type
function verifyAccessToken(token, authType) { switch (authType) { case AUTH_TYPE.PASSWORD: winston.debug('Verifing Password access token'); // Verify password access token return user.verifyPasswordAccessToken(token); case AUTH_TYPE.GOOGLE: winston.debug('Verifing Google access token')...
[ "checkGrant_type()\n {\n if(this.grant_type == 'refresh_token')\n {\n return true;\n }\n }", "verifyAccessToken(access_token) {\n let options = {\n method: 'GET',\n uri: this._server + '/oauth/verify',\n headers: {\n 'Authoriza...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
base cases 1. input world is empty, return world 2. create a 2d visited array 3. traverse the first and last col concurrently, for any ones, i do bfs to visit this island and mark as visited 4. traverse the first and last row concurremtly, for any ones, do bfs and visit this islan and mark as visited 5. visit all the 1...
function removeIslands(matrix) { if (matrix.length < 1) return world const visited = [...Array(matrix.length)].map(e => Array(matrix[0].length).fill(false)) for (let col = 0 ; col < matrix[0].length; col++) { if (!visited[0][col] && matrix[0][col] === 1) { console.log(col) ...
[ "function countNeighbors(board){\n var nCount = createEmptyMatrix(board.length);\n\n for(var i = 0; i < board.length; i++) {\n for (var j = 0; j < board.length; j++) {\n //increment all the neighboring indexes within bounds\n if(board[i][j] == 1) {\n\n if (i > 0) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clears the current photos and sets all the UI elements to their default values.
function clearPhotos() { photos = []; current = 0; document.getElementById("slide-img").src = "Images/Error-Photo.jpg"; document.getElementById("numbertext").innerHTML = ""; document.getElementById("caption").innerHTML = ""; document.getElementById("error-message").innerHTML = "Loading Images..."; }
[ "function reset() {\n for(let i = 0; i < sliderImages.length; i++) {\n sliderImages[i].style.display = 'none';\n }\n}", "resetImagePreview()\n\t{\n\t\tlet selectedImagePreviewSelector = \"div#selected_image_preview\";\n\t\tlet imageTypes = ['original', 'large', 'medium', 'small'];\n\n\t\t// reset for...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Interval to check/update color state
function setGetInterval() { setInterval(() => { getColor(); }, 2000); }
[ "function colourChange(){\n currentColour++;\n if(currentColour==colours.length)currentColour = 0;\n circle(context,halfWidth,halfHeight,step/2,true);\n}", "function colourTimer() {\r\n colourElement.style.display = 'none';\r\n setTimeout(colourChange, 1000);\r\n setTimeout(reactColour, 2000);\r\n setTimeo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if a is a Map or a Set.
function isMapSet(a) { return a.constructor === Map || a.constructor === Set; }
[ "function isMap (data) {\n return Object.prototype.toString.call(data) === '[object Map]';\n }", "isDictType(type) {\n return this.typesAreEquivalent(new DictType(null, null), type);\n }", "function isCollection(obj){\n\treturn typeof obj == \"object\" && obj !== null;\n}", "static is_subset(map...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Static class methods `_resetBlankNodePrefix` restarts blank node prefix identification
static _resetBlankNodePrefix() { blankNodePrefix = 0; }
[ "setPrefix(prefix, uri) {\n if (prefix.slice(0, 7) === 'default') return // Try to weed these out\n if (prefix.slice(0, 2) === 'ns') return // From others inferior algos\n if (!prefix || !uri) return // empty strings not suitable\n\n // remove any existing prefix targeting this uri\n // for (let exi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
removes a dymo and any recursive parts (beware if parts are shared with other dymos)
removeDymo(dymoUri) { this.deleteAllTriplesWithRefs(this.recursiveFindAllTriplesSimple(dymoUri)); }
[ "[_delistFromMeta] () {\n const top = this.top\n const root = this.root\n\n root.inventory.delete(this)\n if (root.meta)\n root.meta.delete(this.path)\n\n // need to also remove from the top meta if that's set. but, we only do\n // that if the top is not the same as the root, or else we'll r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read all chunks from |readable_stream| and return as an array of arrays
async function read_stream(readable_stream) { const reader = readable_stream.getReader(); let chunks = []; while (true) { const {value: chunk, done} = await reader.read(); if (done) { break; } chunks.push(chunk); } reader.releaseLock(); return chunks; }
[ "async function read_stream_as_string(readable_stream) {\n const decoder = new TextDecoderStream();\n const decode_stream = readable_stream.pipeThrough(decoder);\n const reader = decode_stream.getReader();\n\n let chunks = '';\n while (true) {\n const {value: chunk, done} = await reader.read();\n if (don...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hexbased concatenation of two fields.
function concatFields(l, r) { return Buffer.concat([ Buffer.from(l, 'hex'), Buffer.from(r, 'hex') ]) }
[ "function appendFieldLists(f1, f2){\n\tif (!f1) f1 = '';\n\tif (!f2) f2 = '';\n\tvar res = f1;\n\t// separator is needed only when both of the strs are not empty and there is no & at the end of f1\n\tif ((f1.length > 0) && (f2.length > 0)) {\n\t\tif (f1.charAt(f1.length) != \"&\") res += \"&\"; \n\t} \n\tres += f2;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
HACK: Making Anagrams Alice is taking a cryptography class and finding anagrams to be very useful. We consider two strings to be anagrams of each other if the first string's letters can be rearranged to form the second string. In other words, both strings must contain the same exact letters in the same exact frequency ...
function makeAnagrams(a, b) { // O(n*m) approach due to iterating through lengths of both inputs let count = 0; let arrA = a.split(""); let arrB = b.split(""); let totalLength = arrA.length + arrB.length; for (let i = 0; i < arrA.length; i++) { for (let j = 0; j < arrB.length; j++) { if (arrA[i] =...
[ "function makeAnagram(a, b) {\n let count = 0;\n\n //track all the letters that are the longer string and then compare them to the letters from the short string.\n let freq = {};\n\n const longStr = a.length > b.length ? a : b;\n const shortStr = longStr === a ? b : a;\n\n // Log all chars from the long strin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This handler is attached to the window object (on the capture phase) to emulate pointer capture. onTouchEnd is still attached to the tracked element, so stop propagation to avoid processing twice.
function onTouchEndCaptured( tracker, event ) { handleTouchEnd( tracker, event ); $.stopEvent( event ); }
[ "function addTouchEndEvent(element, itemId) {\n //Start focus on the room\n focusTheRoom(0,0);\n //Touchend event handler added to the element\n element.addEventListener('touchend', function(event){\n if(element.getAttribute('draggable') == 'true') {\n event.preventDefault();\n //target room\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Import an external managed policy by ARN. For this managed policy, you only need to know the ARN to be able to use it. This can be useful if you got the ARN from a CloudFormation Export. If the imported Managed Policy ARN is a Token (such as a `CfnParameter.valueAsString` or a `Fn.importValue()`) and the referenced man...
static fromManagedPolicyArn(scope, id, managedPolicyArn) { class Import extends core_1.Resource { constructor() { super(...arguments); this.managedPolicyArn = managedPolicyArn; } } return new Import(scope, id); }
[ "function ManagedPolicy(props) {\n return __assign({ Type: 'AWS::IAM::ManagedPolicy' }, props);\n }", "async resolveImport(from, imported) {\n const scheme = this._getUriScheme(imported);\n if (scheme !== undefined) {\n throw new errors_1.HardhatError(errors_list_1.ERROR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
use to kill several monsters at once
function kills(monsters) { killCount += monsters; for (var i = 0; i < monsters; i++){ playerGold += Math.floor((Math.random() * 3) + 1); }; update(); }
[ "function UnspawnAll(){\n\t\tfor(var i = 0; i < all.Count; i++){\n\t\t\tvar obj : GameObject = all[i] as GameObject;\n\t\t\tif(obj.active)\n\t\t\t\tUnspawn(obj);\n\t\t}\n\t}", "function createMonsters(number) {\n for (let i = 0; i < number; i++) {\n monsterArray.push(new Obstacles(Math.rando...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Modify axis instance with radial logic before common axis init.
function onAxisInit(e) { var chart = this.chart, inverted = chart.inverted, angular = chart.angular, polar = chart.polar, isX = this.isXAxis, coll = this.coll, isHidden = angular && isX, chartOptions = chart.options, paneIndex = e.userOptions.pane || 0, pane = this.pane = chart.pane && chart.pane[paneIndex]; ...
[ "function setAxisTranslation() {\n var axisProto = this.constructor.prototype;\n // Call uber method\n axisProto.setAxisTranslation.call(this);\n // Set transA and minPixelPadding\n if (this.center) { // it's not defined the first time\n if (this.isCircular) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Define the relationship between the element and the host.
function defineHostOwnership(elementNode, hostNode, id) { if ( hostNode && hostNode !== elementNode ) { if ( !hostNode.id ) { hostNode.id = 'host_' + id } _.aria(elementNode, 'owns', hostNode.id) } }
[ "_addLink(r1, r2) {\n this.elements.push({\n group: \"edges\",\n data: {\n id: `${r1.id}_${r2.id}`,\n source: r1.id,\n target: r2.id\n } \n })\n }", "init(actor) {\n this.host = actor\n }", "function ZRelation(below, above, priority, embedded, name, userInf...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create the function reverseDigitsOfNumber(). With methods split(), reverse() and join() we reverse the digits of the given number.
function reverseDigitsOfNumber(enteredNumber) { var reversedNumber = enteredNumber.split("").reverse().join(""); console.log(reversedNumber); }
[ "function reversePhone(number) {\n \n }", "function reverseNumber(n) {\n let num = parseFloat(n.toString().split('').reverse().join(''))\n //multiply the reversed with the positive or negative of the original number passed through the function to keep the sign\n return num *Math.sign(n)\n}", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Identify who follows the most people over 30
function mostPeopleFollowingOver30(){ var maxNumFollowingOver30 = 0; var mostFollowingOver30PersonId = 0; for(var person in data){ var filteredFollowingArray = data[person].follows.filter(function(followingPersonId){ return data[followingPersonId].age > 30; }); if(maxNumFollowingOver30 <= filter...
[ "function mostFollowersOver30(){\n var maxNumFollowersOver30 = 0;\n var mostFollowersOver30PersonId = 0;\n for(person in data){\n var followersOver30 = getFollowersArray(person).filter(function(follower){\n return follower.age > 30\n });\n if(maxNumFollowersOver30 <= followersOver30.length){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
all letters in second should be in first
function mutation([first, second]) { return second.toLowerCase() .split('') .every(letter => first.toLowerCase() .indexOf(letter) !== -1) }
[ "function alpha (stra, strb) {\n // lowercase everything\n var a = stra.toLowerCase ();\n var b = strb.toLowerCase ();\n // test for length\n if (a.length == b.length) {\n // first letter difference\n for (var i = 0; i < a.length; i++) {\n if (a.charCodeAt (i) != b.charCodeAt (i)) {\n if (a.c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: setForceMultipleUpdate DESCRIPTION: ARGUMENTS: bForce boolean. true to force multiple update. RETURNS: none
function ServerBehavior_setForceMultipleUpdate(bForce) { this.bForceMultipleUpdate = bForce; }
[ "function ServerBehavior_getForceMultipleUpdate()\n{\n return this.bForceMultipleUpdate;\n}", "update(forced) {\n // Update the skeleton\n if (forced || (this.sequence !== -1 && this.model.variants[this.sequence])) {\n this.skeleton.update(forced);\n }\n\n // Update the geo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets all specified config values on the stack in the associated Workspace.
setAllConfig(config) { return __awaiter(this, void 0, void 0, function* () { return this.workspace.setAllConfig(this.name, config); }); }
[ "function setValuesInProjectConfig(config) {\n if (!config.projectConfig) { return }\n // for each entry, the 'setValueInTag'-method is called until the tag was found once\n let toDoList = [\n {tag: \"<widget \", pre: \"id=\\\"\", value: config.projectConfig.id, post: \"\\\"\", done: false},\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a Patient resource
static get __resourceType() { return 'Patient'; }
[ "function getResource(){\n var v = \"custom:(uuid,identifiers:ref,person:(uuid,gender,birthdate,dead,deathDate,preferredName:(givenName,middleName,familyName),\"\n + \"attributes:(uuid,value,attributeType:ref)))\";\n r = $resource(OpenmrsSettings.getContext() + \"/ws/rest/v1/patient/:uuid\",\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }